content
stringlengths
5
1.04M
avg_line_length
float64
1.75
12.9k
max_line_length
int64
2
244k
alphanum_fraction
float64
0
0.98
licenses
list
repository_name
stringlengths
7
92
path
stringlengths
3
249
size
int64
5
1.04M
lang
stringclasses
2 values
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("Machine.Specifications.FailingExample")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("39a975ce-a297-41ac-9df4-38face7457ff")]
39.666667
85
0.758703
[ "MIT" ]
rho24/machine.specifications
Source/Machine.Specifications.FailingExample/Properties/AssemblyInfo.cs
835
C#
// Copyright (c) Alexandre Mutel. All rights reserved. // This file is licensed under the BSD-Clause 2 license. // See the license.txt file in the project root for more information. using System; using System.Text; namespace Markdig.Helpers { public static class StringBuilderCache { /// <summary> /// A StringBuilder that can be used locally in a method body only. /// </summary> [ThreadStatic] private static StringBuilder local; /// <summary> /// Provides a string builder that can only be used locally in a method. This StringBuilder MUST not be stored. /// </summary> /// <returns></returns> public static StringBuilder Local() { var sb = local ?? (local = new StringBuilder()); if (sb.Length > 0) { sb.Length = 0; } return sb; } } }
29.83871
119
0.577297
[ "BSD-2-Clause" ]
lellid/markdig
src/Markdig/Helpers/StringBuilderCache.cs
925
C#
using UnityEngine; using System.Collections; public class EnemySpawnerController : MonoBehaviour { public int delay; public Transform instancier; public GameObject enemy; private int charge = 1; void Update () { if (charge == 1) { StartCoroutine(enemyInstancier()); charge = 0; } } //Metodo para instanciar enemigos cada x tiempo IEnumerator enemyInstancier () { Instantiate(enemy, instancier.position, Quaternion.identity); yield return new WaitForSeconds(delay); charge = 1; } }
20.724138
69
0.620632
[ "MIT" ]
Mario40000/Heroic_Adventure
Assets/Scripts/Enemy/EnemySpawnerController.cs
603
C#
using System; using System.Drawing; using NAudio.Wave; namespace NAudio.WaveFormRenderer { public class WaveFormRenderer { public Image Render(string selectedFile, WaveFormRendererSettings settings) { return Render(selectedFile, new MaxPeakProvider(), settings); } public Image Render(string selectedFile, IPeakProvider peakProvider, WaveFormRendererSettings settings) { return Render(selectedFile, peakProvider, settings, (a) => new AudioFileReader(a)); } /// <summary> /// /// </summary> /// <param name="selectedFile"></param> /// <param name="peakProvider"></param> /// <param name="settings"></param> /// <param name="audioFileReader">Like AudioFileReader, it has to inherit both WaveStream and ISampleProvider</param> /// <returns></returns> public Image Render(string selectedFile, IPeakProvider peakProvider, WaveFormRendererSettings settings, Func<string, WaveStream> audioFileReader) { using (WaveStream reader = audioFileReader.Invoke(selectedFile)) { int bytesPerSample = (reader.WaveFormat.BitsPerSample / 8); var samples = reader.Length / (bytesPerSample); var samplesPerPixel = (int)(samples / settings.Width); var stepSize = settings.PixelsPerPeak + settings.SpacerPixels; peakProvider.Init((ISampleProvider)reader, samplesPerPixel * stepSize); return Render(peakProvider, settings); } } public Image Render(WaveStream audioFileReader, IPeakProvider peakProvider, WaveFormRendererSettings settings) { using (audioFileReader) { int bytesPerSample = (audioFileReader.WaveFormat.BitsPerSample / 8); var samples = audioFileReader.Length / (bytesPerSample); var samplesPerPixel = (int)(samples / settings.Width); var stepSize = settings.PixelsPerPeak + settings.SpacerPixels; peakProvider.Init((ISampleProvider)audioFileReader, samplesPerPixel * stepSize); return Render(peakProvider, settings); } } private static Image Render(IPeakProvider peakProvider, WaveFormRendererSettings settings) { if (settings.DecibelScale) peakProvider = new DecibelPeakProvider(peakProvider, 48); var b = new Bitmap(settings.Width, settings.TopHeight + settings.BottomHeight); if (settings.BackgroundColor == Color.Transparent) { b.MakeTransparent(); } using (var g = Graphics.FromImage(b)) { g.FillRectangle(settings.BackgroundBrush, 0, 0, b.Width, b.Height); var midPoint = settings.TopHeight; int x = 0; var currentPeak = peakProvider.GetNextPeak(); while (x < settings.Width) { var nextPeak = peakProvider.GetNextPeak(); for (int n = 0; n < settings.PixelsPerPeak; n++) { var lineHeight = settings.TopHeight * currentPeak.Max; g.DrawLine(settings.TopPeakPen, x, midPoint, x, midPoint - lineHeight); lineHeight = settings.BottomHeight * currentPeak.Min; g.DrawLine(settings.BottomPeakPen, x, midPoint, x, midPoint - lineHeight); x++; } for (int n = 0; n < settings.SpacerPixels; n++) { // spacer bars are always the lower of the var max = Math.Min(currentPeak.Max, nextPeak.Max); var min = Math.Max(currentPeak.Min, nextPeak.Min); var lineHeight = settings.TopHeight * max; g.DrawLine(settings.TopSpacerPen, x, midPoint, x, midPoint - lineHeight); lineHeight = settings.BottomHeight * min; g.DrawLine(settings.BottomSpacerPen, x, midPoint, x, midPoint - lineHeight); x++; } currentPeak = nextPeak; } } return b; } } }
43.058252
153
0.560992
[ "MIT" ]
quellatalo/NAudio.WaveFormRenderer
WaveFormRendererLib/WaveFormRenderer.cs
4,437
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.AliCloud.Ess.Outputs { [OutputType] public sealed class GetScalingConfigurationsConfigurationDataDiskResult { /// <summary> /// Category of data disk. /// </summary> public readonly string? Category; /// <summary> /// Delete_with_instance attribute of data disk. /// </summary> public readonly bool? DeleteWithInstance; /// <summary> /// Device attribute of data disk. /// </summary> public readonly string? Device; /// <summary> /// The performance level of the ESSD used as data disk. /// </summary> public readonly string? PerformanceLevel; /// <summary> /// Size of data disk. /// </summary> public readonly int? Size; /// <summary> /// Size of data disk. /// </summary> public readonly string? SnapshotId; [OutputConstructor] private GetScalingConfigurationsConfigurationDataDiskResult( string? category, bool? deleteWithInstance, string? device, string? performanceLevel, int? size, string? snapshotId) { Category = category; DeleteWithInstance = deleteWithInstance; Device = device; PerformanceLevel = performanceLevel; Size = size; SnapshotId = snapshotId; } } }
28.03125
88
0.586957
[ "ECL-2.0", "Apache-2.0" ]
pulumi/pulumi-alicloud
sdk/dotnet/Ess/Outputs/GetScalingConfigurationsConfigurationDataDiskResult.cs
1,794
C#
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Text.RegularExpressions; using System.Threading; using System.Windows.Forms; namespace JRunner.Panels { public partial class XeBuildPanel : UserControl { List<String> patches = new List<string>(new string[8]); // -a nofcrt // -a noSShdd // -a nointmu // -a nohdd // -a nohdmiwait // -a nolan // -r WB/WB4G/13182 public XeBuildPanel() { InitializeComponent(); checkDevGL("None"); } #region delegates public delegate void ClickedGetMB(); public event ClickedGetMB Getmb; public delegate void ChangedHack(); public event ChangedHack HackChanged; public delegate void DashAdded(); public event DashAdded AddedDash; public delegate void DashDeleted(); public event DashDeleted DeletedDash; public delegate void CallMotherboards(); public event CallMotherboards CallMB; public delegate void loadFile(ref string filename, bool erase = false); public event loadFile loadFil; public delegate void updateProgress(int progress); public event updateProgress UpdateProgres; public delegate void updateSource(string filename); public event updateSource updateSourc; public delegate void ModeDrive(); public event ModeDrive DriveMode; #endregion #region getters/setters public DataSet1 getDataSet() { return dataSet1; } public ComboBox getComboDash() { return comboDash; } // Hack Getters public bool getRbtnRetailChecked() { return rbtnRetail.Checked; } public bool getRbtnGlitchChecked() { return rbtnGlitch.Checked; } public bool getRbtnGlitch2Checked() { return rbtnGlitch2.Checked; } public bool getRbtnGlitch2mChecked() { return rbtnGlitch2m.Checked; } public bool getRbtnJtagChecked() { return rbtnJtag.Checked; } public bool getRbtnDevGLChecked() { return rbtnDevGL.Checked; } public string getRbtnChecked() { if (rbtnRetail.Checked) return "Retail"; else if (rbtnGlitch.Checked) return "Glitch"; else if (rbtnGlitch2.Checked) return "Glitch2"; else if (rbtnGlitch2m.Checked) return "Glitch2m"; else if (rbtnJtag.Checked) { if (chkRJtag.Checked) return "R-JTAG"; else return "JTAG"; } else if (rbtnDevGL.Checked) return "DEVGL"; else return ""; } // Hack Setters public void setRbtnRetailChecked(bool check) { if (check && !rbtnRetail.Enabled) return; rbtnRetail.Checked = check; } public void setRbtnGlitchChecked(bool check) { if (check && !rbtnGlitch.Enabled) return; rbtnGlitch.Checked = check; } public void setRbtnGlitch2Checked(bool check) { if (check && !rbtnGlitch2.Enabled) return; rbtnGlitch2.Checked = check; } public void setRbtnGlitch2mChecked(bool check) { if (check && !rbtnGlitch2m.Enabled) return; rbtnGlitch2m.Checked = check; } public void setRbtnJtagChecked(bool check) { if (check && !rbtnJtag.Enabled) return; rbtnJtag.Checked = check; } public void setRbtnDevGLChecked(bool check) { if (check && !rbtnDevGL.Enabled) return; rbtnDevGL.Checked = check; } // Checkbox Getters public bool getCleanSMCChecked() { return chkCleanSMC.Checked; } public bool getCR4Checked() { return chkCR4.Checked; } public bool getSMCPChecked() { return chkSMCP.Checked; } public bool getRgh3Checked() { return chkRgh3.Checked; } public int getRgh3Mhz() { return int.Parse(Rgh3Mhz.Text); } public bool getAudClampChecked() { return chkAudClamp.Checked; } public bool getRJtagChecked() { return chkRJtag.Checked; } public int getWBChecked() { if (chkWB.Checked) return 1; else if (chkWB4G.Checked) return 2; else return 0; } // Checkbox Setters public void setCleanSMCChecked(bool check) { if (check && !chkCleanSMC.Enabled) return; chkCleanSMC.Checked = check; } public void setNoFcrt(bool check) { chkListBoxPatches.SetItemChecked(0, check); } public void clear() { txtMBname.Text = "None Selected"; if (rbtnRetail.Enabled == true) rbtnRetail.Checked = true; else if (rbtnGlitch.Checked) rbtnGlitch.Checked = false; else if (rbtnGlitch2.Checked) rbtnGlitch2.Checked = false; else if (rbtnGlitch2m.Checked) rbtnGlitch2m.Checked = false; else if (rbtnJtag.Checked) rbtnJtag.Checked = false; else if (rbtnDevGL.Checked) rbtnDevGL.Checked = false; checkAvailableHackTypes(); tabControl1.SelectedTab = Xebuild; for (int i = 0; i < chkListBoxPatches.Items.Count; i++) { chkListBoxPatches.SetItemChecked(i, false); } chkxesettings.Checked = false; } public void setMBname(string txt) { txtMBname.Text = txt; variables.boardtype = txt; checkAvailableHackTypes(); checkWB(txt); checkBigffs(txt); if (txt.Contains("Xenon")) { chkCR4.Checked = false; chkCR4.Enabled = false; chkSMCP.Checked = false; chkSMCP.Enabled = false; chkAudClamp.Checked = false; chkAudClamp.Enabled = false; } else { chkCR4.Enabled = true; chkSMCP.Enabled = true; chkAudClamp.Enabled = true; } checkRgh3(txt); } #endregion #region UI private void rbtn_CheckedChanged(object sender, EventArgs e) { if (rbtnRetail.Checked) { if (checkDLPatches.Checked) variables.DashLaunchE = checkDLPatches.Checked; checkDLPatches.Enabled = chkLaunch.Visible = false; if (sender.Equals(rbtnRetail)) Console.WriteLine("Retail Selected"); } else if (rbtnJtag.Checked) { checkDLPatches.Enabled = true; checkDLPatches.Checked = chkLaunch.Visible = variables.DashLaunchE; if (sender.Equals(rbtnJtag)) Console.WriteLine("JTAG Selected"); } else if (rbtnGlitch.Checked || rbtnGlitch2.Checked || rbtnGlitch2m.Checked) { checkDLPatches.Enabled = true; checkDLPatches.Checked = chkLaunch.Visible = variables.DashLaunchE; if (rbtnGlitch.Checked && sender.Equals(rbtnGlitch)) Console.WriteLine("Glitch Selected"); else if (rbtnGlitch2.Checked && sender.Equals(rbtnGlitch2)) Console.WriteLine("Glitch2 Selected"); else if (rbtnGlitch2m.Checked && sender.Equals(rbtnGlitch2m)) Console.WriteLine("Glitch2m Selected"); } else if (rbtnDevGL.Checked) { checkDLPatches.Enabled = true; checkDLPatches.Checked = chkLaunch.Visible = variables.DashLaunchE; if (sender.Equals(rbtnDevGL)) Console.WriteLine("DEVGL Selected"); } labelCB.Visible = comboCB.Visible = rbtnRetail.Checked; chkCleanSMC.Visible = rbtnRetail.Checked || rbtnGlitch.Checked || rbtnGlitch2.Checked || rbtnGlitch2m.Checked || rbtnDevGL.Checked; chkCR4.Visible = rbtnGlitch2.Checked || rbtnGlitch2m.Checked; chkSMCP.Visible = rbtnGlitch2.Checked || rbtnGlitch2m.Checked; chkRgh3.Visible = rbtnGlitch2.Checked || rbtnGlitch2m.Checked; chkAudClamp.Visible = rbtnJtag.Checked; chkRJtag.Visible = rbtnJtag.Checked; chk0Fuse.Visible = rbtnDevGL.Checked; checkWBXdkBuild(); checkBigffs(variables.boardtype); if (!rbtnRetail.Checked && !rbtnGlitch.Checked && !rbtnGlitch2.Checked && !rbtnGlitch2m.Checked && !rbtnDevGL.Checked) chkCleanSMC.Checked = false; if (!rbtnGlitch2.Checked && !rbtnGlitch2m.Checked) { chkCR4.Checked = false; chkSMCP.Checked = false; chkRgh3.Checked = false; chkWB.Checked = false; chkWB4G.Checked = false; } if (!rbtnJtag.Checked) { chkAudClamp.Checked = false; chkRJtag.Checked = false; } checkRgh3(variables.boardtype); if (!rbtnDevGL.Checked) chk0Fuse.Checked = false; checkWB(variables.boardtype); try { HackChanged(); } catch (Exception) { } updateCommand(); setComboCB(rbtnRetail.Checked); } private void btnXeBuildOptions_Click(object sender, EventArgs e) { XBOptions xb = new XBOptions(); xb.ShowDialog(); chkxesettings.Checked = true; } private void btnLaunch_Click(object sender, EventArgs e) { DashLaunch myNewForm3 = new DashLaunch(); myNewForm3.ShowDialog(); } private void txtMBname_Click(object sender, EventArgs e) { CallMB(); } private void comboDash_SelectedIndexChanged(object sender, EventArgs e) { if (comboDash.SelectedIndex == comboDash.Items.Count - 2) { add_dash(); } else if (comboDash.SelectedIndex == comboDash.Items.Count - 1) { del_dash(); } else if (comboDash.SelectedIndex == comboDash.Items.Count - 3) { checkAvailableHackTypes(); // will set all false } else if (comboDash.SelectedIndex >= 0) { variables.preferredDash = comboDash.Text; variables.dashversion = Convert.ToInt32(comboDash.Text); lblDash.Text = comboDash.Text; } if (comboDash.SelectedIndex < comboDash.Items.Count - 3) { checkAvailableHackTypes(); } checkWBXdkBuild(); updateCommand(); setComboCB(); } public void checkAvailableHackTypes() { if (comboDash.SelectedValue == null || comboDash.SelectedValue.ToString().Contains("-")) { rbtnRetail.Enabled = rbtnRetail.Checked = false; rbtnGlitch.Enabled = rbtnGlitch.Checked = false; rbtnGlitch2.Enabled = rbtnGlitch2.Checked = false; rbtnGlitch2m.Enabled = rbtnGlitch2m.Checked = false; rbtnJtag.Enabled = rbtnJtag.Checked = false; rbtnDevGL.Enabled = rbtnDevGL.Checked = false; return; } if (variables.debugme) Console.WriteLine(Path.Combine(variables.update_path, comboDash.SelectedValue + "\\_file.ini")); if (!File.Exists(Path.Combine(variables.update_path, comboDash.SelectedValue + "\\_glitch2.ini"))) { rbtnGlitch2.Enabled = rbtnGlitch2.Checked = false; } else { checkGlitch2(variables.boardtype); } if (!File.Exists(Path.Combine(variables.update_path, comboDash.SelectedValue + "\\_glitch2m.ini"))) { rbtnGlitch2m.Enabled = rbtnGlitch2m.Checked = false; } else { checkGlitch2m(variables.boardtype); } if (!File.Exists(Path.Combine(variables.update_path, comboDash.SelectedValue + "/_glitch.ini"))) { rbtnGlitch.Enabled = rbtnGlitch.Checked = false; } else { checkGlitch(variables.boardtype); } if (!File.Exists(Path.Combine(variables.update_path, comboDash.SelectedValue + "/_jtag.ini"))) { rbtnJtag.Enabled = rbtnJtag.Checked = false; } else { checkJtag(variables.boardtype); } if (!File.Exists(Path.Combine(variables.update_path, comboDash.SelectedValue + "/_retail.ini"))) { rbtnRetail.Checked = rbtnRetail.Enabled = false; } else { rbtnRetail.Enabled = true; } if (!File.Exists(Path.Combine(variables.update_path, comboDash.SelectedValue + "/_devgl.ini"))) { rbtnDevGL.Enabled = rbtnDevGL.Checked = false; } else { checkDevGL(variables.boardtype); } } private void checkJtag(string board) { if (board == null) board = "None"; if (board.Contains("Corona") || board.Contains("Trinity")) rbtnJtag.Enabled = rbtnJtag.Checked = false; else rbtnJtag.Enabled = true; } public void checkGlitch(string board) { if (board == null) board = "None"; if (variables.rghable) { if (board.Contains("Corona") || board.Contains("Trinity")) rbtnGlitch.Enabled = rbtnGlitch.Checked = false; else if (!variables.rgh1able) rbtnGlitch.Enabled = rbtnGlitch.Checked = false; else rbtnGlitch.Enabled = true; } else rbtnGlitch.Enabled = rbtnGlitch.Checked = false; } private void checkGlitch2(string board) { if (board == null) board = "None"; //if (board.Contains("Xenon")) rbtnGlitch2.Enabled = rbtnGlitch2.Checked = false; //else rbtnGlitch2.Enabled = true; } private void checkGlitch2m(string board) { if (board == null) board = "None"; if (variables.dashversion == 17489) { rbtnGlitch2m.Enabled = true; } else { if (board.Contains("Corona") || board.Contains("Trinity") || board.Contains("None")) rbtnGlitch2m.Enabled = true; else rbtnGlitch2m.Enabled = rbtnGlitch2m.Checked = false; } } private void checkDevGL(string board) { if (canDevGL(board)) rbtnDevGL.Enabled = true; else rbtnDevGL.Enabled = rbtnDevGL.Checked = false; } public bool canDevGL(string board) { if (board == null) board = "None"; if (File.Exists(Path.Combine(variables.pathforit, @"xebuild\common\" + "sb_priv.bin"))) { if (board.Contains("Jasper") || board.Contains("Corona") || board.Contains("Trinity") || board.Contains("None")) return true; else return false; } else return false; } public void checkBigffs(string board) { if ((rbtnGlitch.Checked || rbtnGlitch2.Checked || rbtnGlitch2m.Checked || rbtnJtag.Checked || rbtnDevGL.Checked) && !chkXdkBuild.Checked) { if (board == null) board = "None"; if (board.Contains("Trinity BB")) chkBigffs.Enabled = true; else if (board.Contains("Xenon") || board.Contains("Zephyr") || board.Contains("Falcon") || board.Contains("Jasper 16MB") || board.Contains("Jasper SB") || board.Contains("Trinity") || board.Contains("Corona")) { chkBigffs.Checked = false; chkBigffs.Enabled = false; } else { chkBigffs.Enabled = true; } } else { chkBigffs.Checked = false; chkBigffs.Enabled = false; } } bool chkWB4GVis = false; bool chkWB4GEn = true; public void checkWBXdkBuild() { if (rbtnGlitch2m.Checked && variables.dashversion == 17489 && File.Exists(variables.pathforit + @"\xeBuild\17489\!XDKbuild Only!.txt")) { chkWB.Visible = false; chkWB.Checked = false; //chkWB4G.Visible = false; // chkWB4G.Checked = false; chkWB4GVis = false; chkXdkBuild.Visible = true; chkXdkBuild.Checked = true; } else { if (rbtnGlitch2.Checked || rbtnGlitch2m.Checked) { chkWB.Visible = true; //chkWB4G.Visible = true; chkWB4GVis = true; } else { chkWB.Visible = false; chkWB.Checked = false; //chkWB4G.Visible = false; //chkWB4G.Checked = false; chkWB4GVis = false; } chkXdkBuild.Visible = false; chkXdkBuild.Checked = false; } checkWB4G(); } private void checkWB(string board) { if (board == null) board = "None"; if ((board.Contains("Corona") || board.Contains("None")) && (rbtnGlitch2.Checked || rbtnGlitch2m.Checked) && !chkXdkBuild.Checked) { chkWB.Enabled = true; //chkWB4G.Enabled = true; chkWB4GEn = true; } else { chkWB.Checked = false; chkWB.Enabled = false; //chkWB4G.Checked = false; //chkWB4G.Enabled = false; chkWB4GEn = false; } checkWB4G(); } private void checkWB4G() { if (chkWB4GVis && chkWB4GEn) chkWB4G.Enabled = true; else { chkWB4G.Checked = false; chkWB4G.Enabled = false; } } private void checkDLPatches_CheckedChanged(object sender, EventArgs e) { variables.DashLaunchE = checkDLPatches.Checked; if (!checkDLPatches.Checked || !checkDLPatches.Enabled) { chkLaunch.Visible = false; chkLaunch.Checked = false; } else if (checkDLPatches.Checked && checkDLPatches.Enabled) chkLaunch.Visible = true; } public void setDLPatches(bool checkd) { checkDLPatches.Checked = chkLaunch.Checked = checkd; } private void btnDrive_Click(object sender, EventArgs e) { try { DriveMode(); } catch (Exception) { } } private void checkDLPatches_EnabledChanged(object sender, EventArgs e) { if (!checkDLPatches.Enabled) chkLaunch.Visible = false; else if (checkDLPatches.Checked) chkLaunch.Visible = true; } private void chkListBoxPatches_SelectedIndexChanged(object sender, EventArgs e) { int selected = chkListBoxPatches.SelectedIndex; if (selected >= 0 && selected <= 5) { if (chkListBoxPatches.GetItemChecked(selected)) { Console.WriteLine(chkListBoxPatches.Items[selected].ToString() + " Enabled"); if (selected == 0) patches[selected + 1] = "-a nofcrt"; else if (selected == 1) patches[selected + 1] = "-a noSShdd"; else if (selected == 2) patches[selected + 1] = "-a nointmu"; else if (selected == 3) patches[selected + 1] = "-a nohdd"; else if (selected == 4) patches[selected + 1] = "-a nohdmiwait"; else if (selected == 5) patches[selected + 1] = "-a nolan"; } else { Console.WriteLine(chkListBoxPatches.Items[selected].ToString() + " Disabled"); patches[selected + 1] = ""; } } updateCommand(); } private void chkRJtag_CheckedChanged(object sender, EventArgs e) { if (chkRJtag.Checked) Console.WriteLine("R-JTAG Selected"); else Console.WriteLine("R-JTAG Deselected"); } // Handling checkboxes allows us to only have one selected at time without extra stuff happening private void chkCleanSMC_CheckedChanged(object sender, EventArgs e) { if (chkCleanSMC.Checked) { Console.WriteLine("Clean SMC Selected"); chkCR4.Checked = false; chkSMCP.Checked = false; chkRgh3.Checked = false; } else if (!chkCR4.Checked && !chkSMCP.Checked && !chkRgh3.Checked) // Don't uselessly spam the console { Console.WriteLine("Clean SMC Deselected"); } if (chkCleanSMC.Checked) { if (File.Exists(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin"))) { if (MessageBox.Show("smc.bin found. Delete it?\nUnless you put it there, delete it!", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { File.Delete(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin")); } } } } private void chkCR4_CheckedChanged(object sender, EventArgs e) { if (chkCR4.Checked) { Console.WriteLine("CR4 Selected"); chkCleanSMC.Checked = false; chkSMCP.Checked = false; chkRgh3.Checked = false; } else if (!chkCleanSMC.Checked && !chkSMCP.Checked && !chkRgh3.Checked) // Don't uselessly spam the console { Console.WriteLine("CR4 Deselected"); } if (chkCR4.Checked) { if (File.Exists(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin"))) { if (MessageBox.Show("smc.bin found. Delete it?\nUnless you put it there, delete it!", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { File.Delete(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin")); } } } } private void chkSMCP_CheckedChanged(object sender, EventArgs e) { if (chkSMCP.Checked) { Console.WriteLine("SMC+ Selected"); chkCleanSMC.Checked = false; chkCR4.Checked = false; chkRgh3.Checked = false; } else if (!chkCleanSMC.Checked && !chkCR4.Checked && !chkRgh3.Checked) // Don't uselessly spam the console { Console.WriteLine("SMC+ Deselected"); } if (chkSMCP.Checked) { if (File.Exists(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin"))) { if (MessageBox.Show("smc.bin found. Delete it?\nUnless you put it there, delete it!", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { File.Delete(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin")); } } } } private void chkRgh3_CheckedChanged(object sender, EventArgs e) { if (chkRgh3.Checked) { Console.WriteLine("RGH3 Selected"); chkCleanSMC.Checked = false; chkCR4.Checked = false; chkSMCP.Checked = false; } else if (!chkCleanSMC.Checked && !chkCR4.Checked && !chkSMCP.Checked) // Don't uselessly spam the console { Console.WriteLine("RGH3 Deselected"); } if (chkRgh3.Checked) { if (File.Exists(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin"))) { if (MessageBox.Show("smc.bin found. Delete it?\nUnless you put it there, delete it!", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { File.Delete(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin")); } } } else Rgh3Mhz.SelectedIndex = 1; checkRgh3(variables.boardtype); } private void checkRgh3(string board) { if (board == null) board = "None"; if (board.Contains("Falcon") || board.Contains("Jasper")) { Rgh3Label.Visible = Rgh3Mhz.Visible = chkRgh3.Checked; Rgh3Label2.Visible = false; } else if (board.Contains("Trinity")) { Rgh3Label2.Text = "27"; Rgh3Label.Visible = Rgh3Label2.Visible = chkRgh3.Checked; Rgh3Mhz.Visible = false; } else if (board.Contains("Corona")) { Rgh3Label2.Text = "25"; Rgh3Label.Visible = Rgh3Label2.Visible = chkRgh3.Checked; Rgh3Mhz.Visible = false; } else { Rgh3Label.Visible = Rgh3Label2.Visible = Rgh3Mhz.Visible = false; } if (board.Contains("Xenon") || board.Contains("Zephyr") || board.Contains("Jasper SB") || board.Contains("Trinity BB") || chkXdkBuild.Checked) { chkRgh3.Checked = false; chkRgh3.Enabled = false; } else chkRgh3.Enabled = true; } private void chkWB_CheckedChanged(object sender, EventArgs e) { if (chkWB.Checked) { Console.WriteLine("Winbond 2K Selected"); chkWB4G.Checked = false; } else if (!chkWB4G.Checked) // Don't uselessly spam the console { Console.WriteLine("Winbond 2K Deselected"); } // Don't do it twice if (!chkWB4G.Checked && chkWB.Checked) { updateWB(); } else if (!chkWB.Checked && !chkWB4G.Checked) { updateWB(); } } private void chkWB4G_CheckedChanged(object sender, EventArgs e) { if (chkWB4G.Checked) { MessageBox.Show("Warning: This function is for advanced users only\n\nIf you don't understand what this is for, use WB 2K on the XeBuild tab instead", "Steep Hill Ahead", MessageBoxButtons.OK, MessageBoxIcon.Information); Console.WriteLine("Winbond 2K Buffer Selected"); chkWB.Checked = false; } else if (!chkWB.Checked) // Don't uselessly spam the console { Console.WriteLine("Winbond 2K Buffer Deselected"); } // Don't do it twice if (!chkWB.Checked && chkWB4G.Checked) { updateWB(); } else if (!chkWB.Checked && !chkWB4G.Checked) { updateWB(); } } private void updateWB() { if (chkWB.Checked) patches[7] = "-r WB"; else if (chkWB4G.Checked) patches[7] = "-r WB4G"; else patches[7] = ""; updateCommand(); } private void chkBigffs_CheckedChanged(object sender, EventArgs e) { if (chkBigffs.Checked) Console.WriteLine("bigffs Selected"); else Console.WriteLine("bigffs Deselected"); } private void chkXdkBuild_CheckedChanged(object sender, EventArgs e) { checkWB(variables.boardtype); checkBigffs(variables.boardtype); if (chkXdkBuild.Checked) Console.WriteLine("XDKbuild Selected"); else Console.WriteLine("XDKbuild Deselected"); checkRgh3(variables.boardtype); } private void chkAudClamp_CheckedChanged(object sender, EventArgs e) { if (chkAudClamp.Checked) Console.WriteLine("Aud_Clamp Selected"); else Console.WriteLine("Aud_Clamp Deselected"); } private void btnGetMB_Click(object sender, EventArgs e) { Getmb(); } private void btnXEUpdate_Click(object sender, EventArgs e) { ThreadStart starter = delegate { xe_update(); }; new Thread(starter).Start(); } private void btnRead_Click(object sender, EventArgs e) { if (File.Exists(Path.Combine(variables.outfolder, "consoleDump.bin"))) { MessageBox.Show("consoleDump.bin already exists"); return; } string arguments; if (!String.IsNullOrWhiteSpace(txtOffset.Text)) { arguments = "-rb " + "\"" + Path.Combine(variables.outfolder, "consoleDump.bin") + "\""; arguments += " " + txtOffset.Text; if (!String.IsNullOrWhiteSpace(txtLength.Text)) { arguments += " " + txtLength.Text; } } else { arguments = "-r " + "\"" + Path.Combine(variables.outfolder, "consoleDump.bin") + "\""; } if (chkShutdown.Checked) arguments += " -s"; if (chkReboot.Checked) arguments += " -reboot"; if (chkForceIP.Checked) arguments += " -ip " + txtIP2.Text; Console.WriteLine("Starting Read - please wait......"); ThreadStart starter = delegate { xe_client(arguments); }; new Thread(starter).Start(); } private void btnWrite_Click(object sender, EventArgs e) { string arguments; if (!String.IsNullOrWhiteSpace(txtOffset.Text)) { arguments = "-wb " + "\"" + variables.filename1 + "\""; arguments += " " + txtOffset.Text; if (!String.IsNullOrWhiteSpace(txtLength.Text)) { arguments += " " + txtLength.Text; } } else { arguments = "-w " + "\"" + variables.filename1 + "\""; } if (chkShutdown.Checked) arguments += " -s"; if (chkReboot.Checked) arguments += " -reboot"; if (chkForceIP.Checked) arguments += " -ip " + txtIP2.Text; Console.WriteLine("Starting Write - please wait......"); ThreadStart starter = delegate { xe_client(arguments); }; new Thread(starter).Start(); } private void btnErase_Click(object sender, EventArgs e) { string arguments = "-eb " + txtOffset.Text; if (chkShutdown.Checked) arguments += " -s"; if (chkReboot.Checked) arguments += " -reboot"; if (chkForceIP.Checked) arguments += " -ip " + txtIP2.Text; ThreadStart starter = delegate { xe_client(arguments); }; new Thread(starter).Start(); } private void btnPatches_Click(object sender, EventArgs e) { string arguments = "-p"; if (!String.IsNullOrWhiteSpace(variables.filename1)) { if (MessageBox.Show("Make sure that source file is a patch file.", "Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.Cancel) return; arguments += " \"" + variables.filename1 + "\""; } if (chkShutdown.Checked) arguments += " -s"; if (chkReboot.Checked) arguments += " -reboot"; if (chkForceIP.Checked) arguments += " -ip " + txtIP2.Text; ThreadStart starter = delegate { xe_client(arguments); }; new Thread(starter).Start(); } private void btnAvatar_Click(object sender, EventArgs e) { if (variables.debugme) Console.WriteLine(Path.Combine(variables.update_path, comboDash.Text + @"\$systemupdate")); if (Directory.Exists(Path.Combine(variables.update_path, comboDash.Text + @"\$systemupdate"))) { Console.WriteLine("Starting, please wait!"); string upPath = Path.Combine(variables.update_path, comboDash.Text, @"\$systemupdate"); //Path.Combine(upPath, @"\$systemupdate"); // Console.WriteLine(Path.Combine(variables.update_path, comboDash.Text + @"\$systemupdate")); ThreadStart starter = delegate { xe_compatibilityAvatar(Path.Combine(variables.update_path, (comboDash.Text)), "-e "); }; new Thread(starter).Start(); } else { FolderBrowserDialog fd = new FolderBrowserDialog(); if (fd.ShowDialog() == DialogResult.Cancel) return; Console.WriteLine("Starting, please wait!"); ThreadStart starter = delegate { xe_compatibilityAvatar(fd.SelectedPath, "-e "); }; new Thread(starter).Start(); } } private void btnComp_Click(object sender, EventArgs e) { FolderBrowserDialog fd = new FolderBrowserDialog(); if (fd.ShowDialog() == DialogResult.Cancel) return; ThreadStart starter = delegate { xe_compatibilityAvatar(fd.SelectedPath, "-c "); }; new Thread(starter).Start(); } private void chkForceIP_CheckedChanged(object sender, EventArgs e) { if (chkForceIP.Checked) { txtIP.Enabled = txtIP2.Enabled = chkForceIP2.Checked = true; txtIP.Text = txtIP2.Text = ""; Console.WriteLine("ForceIP Selected"); } else { txtIP.Enabled = txtIP2.Enabled = chkForceIP2.Checked = false; txtIP.Text = txtIP2.Text = "Autoscan LAN"; Console.WriteLine("ForceIP Deselected"); } } private void txtIP2_TextChanged(object sender, EventArgs e) { txtIP.Text = txtIP2.Text; } private void chkForceIP2_CheckedChanged(object sender, EventArgs e) { if (chkForceIP2.Checked) { txtIP.Enabled = txtIP2.Enabled = chkForceIP.Checked = true; txtIP.Text = txtIP2.Text = ""; } else { txtIP.Enabled = txtIP2.Enabled = chkForceIP.Checked = false; txtIP.Text = txtIP2.Text = "Autoscan LAN"; } } private void txtIP_TextChanged(object sender, EventArgs e) { txtIP2.Text = txtIP.Text; } private void XeBuildPanel_Load(object sender, EventArgs e) { chkCR4.Visible = false; chkSMCP.Visible = false; chkRgh3.Visible = false; Rgh3Label.Visible = false; Rgh3Label2.Visible = false; Rgh3Mhz.Visible = false; chkWB.Visible = false; chkWB4G.Enabled = false; chkXdkBuild.Visible = false; chkRJtag.Visible = false; chkAudClamp.Visible = false; chkBigffs.Enabled = false; chk0Fuse.Visible = false; setComboCB(); } private void chkNoWrite_CheckedChanged(object sender, EventArgs e) { if (chkNoWrite.Checked) Console.WriteLine("nowrite Selected"); else Console.WriteLine("nowrite Deselected"); } private void chkNoAva_CheckedChanged(object sender, EventArgs e) { if (chkNoAva.Checked) Console.WriteLine("noava Selected"); else Console.WriteLine("noava Deselected"); } private void chkClean_CheckedChanged(object sender, EventArgs e) { if (chkClean.Checked) Console.WriteLine("clean Selected"); else Console.WriteLine("clean Deselected"); } private void chkNoReeb_CheckedChanged(object sender, EventArgs e) { if (chkNoReeb.Checked) Console.WriteLine("noreeb Selected"); else Console.WriteLine("noreeb Deselected"); } private void chkShutdown_CheckedChanged(object sender, EventArgs e) { if (chkShutdown.Checked) Console.WriteLine("shutdown Selected"); else Console.WriteLine("shutdown Deselected"); } private void chkReboot_CheckedChanged(object sender, EventArgs e) { if (chkReboot.Checked) Console.WriteLine("reboot Selected"); else Console.WriteLine("reboot Deselected"); } private void chkxesettings_CheckedChanged(object sender, EventArgs e) { if (chkxesettings.Checked) Console.WriteLine("Use Edited Options Selected"); else Console.WriteLine("Use Edited Options Deselected"); } #endregion #region code void xe_update() { Classes.xebuild xe = new Classes.xebuild(); xe.Uloadvariables(variables.dashversion, (variables.hacktypes)variables.ttyp, patches, chkxesettings.Checked, chkNoWrite.Checked, chkNoAva.Checked, chkClean.Checked, chkNoReeb.Checked, checkDLPatches.Checked, chkLaunch.Checked); File.Delete(Path.Combine(variables.pathforit, @"xebuild\data\" + "smc.bin")); try { string[] files = { "kv.bin", "smc.bin", "smc_config.bin", "fcrt.bin" }; foreach (string file in files) { if (File.Exists(Path.Combine(variables.pathforit, @"xebuild\data\" + file))) { if (MessageBox.Show(file + " found. Delete it?\nUnless you put it there, delete it!", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { File.Delete(Path.Combine(variables.pathforit, @"xebuild\data\" + file)); } } } } catch (Exception ex) { if (variables.debugme) Console.WriteLine(ex.ToString()); } Classes.xebuild.XebuildError er = xe.createxebuild(); if (er == Classes.xebuild.XebuildError.none) { xe.xeExit += xe_xeUExit; xe.update(); } else if (er == Classes.xebuild.XebuildError.nodash) { MessageBox.Show("No Dash Selected"); return; } else { MessageBox.Show("Something Bad Happened"); return; } } void xe_client(string arguments) { Classes.xebuild xe = new Classes.xebuild(); xe.client(arguments); } void xe_compatibilityAvatar(string path, string command) { Classes.xebuild xe = new Classes.xebuild(); string arguments = command + path + "\\"; if (chkShutdown.Checked) arguments += " -s"; if (chkReboot.Checked) arguments += " -reboot"; if (chkForceIP.Checked) arguments += " -ip " + txtIP2.Text; xe.client(arguments); } void add_dash() { addDash newdash = new addDash(); if (newdash.ShowDialog() == DialogResult.Cancel) return; try { AddedDash(); } catch (Exception) { } } void del_dash() { Dashes.delDash deldash = new Dashes.delDash(); deldash.ShowDialog(); try { DeletedDash(); } catch (Exception) { } } public void createxebuild_v2(bool custom, Nand.PrivateN nand, bool fullDataClean) { Classes.xebuild xe = new Classes.xebuild(); xe.loadvariables(nand._cpukey, (variables.hacktypes)variables.ttyp, variables.dashversion, variables.ctyp, patches, nand, chkxesettings.Checked, checkDLPatches.Checked, chkLaunch.Checked, chkAudClamp.Checked, chkRJtag.Checked, chkCleanSMC.Checked, chkCR4.Checked, chkSMCP.Checked, chkRgh3.Checked, chkBigffs.Checked, chk0Fuse.Checked, chkXdkBuild.Checked, fullDataClean); string ini = (variables.launchpath + @"\" + variables.dashversion + @"\_" + variables.ttyp + ".ini"); if (!custom) { if (String.IsNullOrWhiteSpace(variables.filename1)) { loadFil(ref variables.filename1, true); if (String.IsNullOrWhiteSpace(variables.filename1)) { MessageBox.Show("No file was selected!", "Can't", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } if (!File.Exists(variables.filename1)) { MessageBox.Show("File is missing. Ensure it wasn't moved and app can access it.", "Can't", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (Path.GetExtension(variables.filename1) != ".bin") { MessageBox.Show("You must select a .bin file", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); return; } try { string[] files = { "kv.bin", "smc.bin", "smc_config.bin", "fcrt.bin" }; foreach (string file in files) { if (File.Exists(Path.Combine(variables.pathforit, @"xebuild\data\" + file))) { if (MessageBox.Show(file + " found. Delete it?\nUnless you put it there, delete it!", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes) { File.Delete(Path.Combine(variables.pathforit, @"xebuild\data\" + file)); } } } } catch (Exception ex) { if (variables.debugme) Console.WriteLine(ex.ToString()); } if (!nand.cpukeyverification(nand._cpukey)) { Console.WriteLine("Wrong CPU Key"); return; } } else { string[] filesa = { "kv.bin", "smc.bin", "smc_config.bin" }; foreach (string file in filesa) { if (file == "smc.bin" && (chkCleanSMC.Checked || chkCR4.Checked || chkSMCP.Checked || rbtnJtag.Checked)) // Options that put in an SMC { // Skip because we put our own SMC in } else { if (!File.Exists(Path.Combine(variables.pathforit, @"xebuild\data\" + file))) { MessageBox.Show(file + " is missing", "Can't", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } } Regex objAlphaPattern = new Regex("[a-fA-F0-9]{32}$"); bool sts = objAlphaPattern.IsMatch(variables.cpkey); if ((variables.cpkey.Length == 32 && sts)) { if (variables.debugme) Console.WriteLine("Key verification"); long size = 0; if (Nand.Nand.cpukeyverification(Oper.openfile(Path.Combine(variables.pathforit, @"xebuild\data\kv.bin"), ref size, 0), variables.cpkey)) { if (variables.debugme) Console.WriteLine("CPU Key is Correct"); if (Nand.Nand.getfcrtflag(File.ReadAllBytes(Path.Combine(variables.pathforit, @"xebuild\data\kv.bin")), variables.cpkey)) { if (!File.Exists(Path.Combine(variables.pathforit, @"xebuild\data\fcrt.bin"))) { MessageBox.Show("fcrt.bin is missing"); Process.Start(Path.Combine(variables.pathforit, @"xebuild\data")); return; } } } else Console.WriteLine("Wrong CPU Key"); } string cba = "", cbb = ""; string[] files = parse_ini.parselabel(ini, variables.ctyp.Ini + "bl"); if (files.Length >= 2) { if (files[0].Contains("cb")) cba = files[0].Substring(files[0].IndexOf("_") + 1, files[0].IndexOf(".bin") - 4); if (files[1].Contains("cbb")) cbb = files[1].Substring(files[1].IndexOf("cbb_") + 4, files[1].IndexOf(".bin") - 4); } if (variables.changeldv == 0) { Forms.xeBuildOptions ldv = new Forms.xeBuildOptions(); ldv.enumeratecbs(cba, cbb); ldv.ShowDialog(); } } Start: switch (xe.createxebuild(custom)) { case Classes.xebuild.XebuildError.nocpukey: MessageBox.Show("CPU Key is Missing"); return; case Classes.xebuild.XebuildError.nodash: MessageBox.Show("No Dash Selected"); return; case Classes.xebuild.XebuildError.noinis: MessageBox.Show("Ini's are Missing"); return; case Classes.xebuild.XebuildError.nobootloaders: Console.WriteLine("The specified console bootloader list ({0}) is missing from the ini ({1})", variables.ctyp.Ini + "bl", ini); Console.WriteLine("You can either add it manually or ask for it get added if its possible"); return; case Classes.xebuild.XebuildError.wrongcpukey: MessageBox.Show("Wrong CPU Key"); return; case Classes.xebuild.XebuildError.noconsole: variables.ctyp = callconsoletypes(ConsoleTypes.Selected.All); if (variables.ctyp.ID == -1) return; else { Console.WriteLine((variables.hacktypes)variables.ttyp); xe.loadvariables(nand._cpukey, (variables.hacktypes)variables.ttyp, variables.dashversion, variables.ctyp, patches, nand, chkxesettings.Checked, checkDLPatches.Checked, chkLaunch.Checked, chkAudClamp.Checked, chkRJtag.Checked, chkCleanSMC.Checked, chkCR4.Checked, chkSMCP.Checked, chkRgh3.Checked, chkBigffs.Checked, chk0Fuse.Checked, chkXdkBuild.Checked, fullDataClean); goto Start; } case Classes.xebuild.XebuildError.none: copyfiles(nand._cpukey); xe.xeExit += xe_xeExit; xe.build(); break; default: break; } } public void xe_xeExit(object sender, EventArgs e) { xeExitActual(); } public void xeExitActual() { variables.changeldv = 0; UpdateProgres(100); try { File.Copy(Path.Combine(variables.pathforit, @"xebuild\options.ini"), Path.Combine(variables.pathforit, @"xebuild\data\options.ini"), true); chkxesettings.Checked = false; File.Move(Path.Combine(variables.xefolder, variables.nandflash + ".log"), Path.Combine(variables.xefolder, variables.nandflash.Substring(0, variables.nandflash.IndexOf(".")) + "(" + DateTime.Now.ToString("ddMMyyyyHHmm") + ").bin.log")); } catch (Exception ex) { if (variables.debugme) Console.WriteLine(ex.ToString()); } try { if (File.Exists(Path.Combine(variables.pathforit, @"build.log"))) File.Delete(Path.Combine(variables.pathforit, @"build.log")); } catch { } if (variables.xefinished) { Console.WriteLine("Saved to {0}", variables.xefolder); Console.WriteLine("Image is Ready"); variables.filename1 = Path.Combine(variables.xefolder, variables.nandflash); updateSourc(variables.filename1); //Process.Start(variables.xefolder); } else { Console.WriteLine("Failed"); } try { delfiles(); } catch (Exception ex) { if (variables.debugme) Console.WriteLine(ex.ToString()); } if (variables.debugme) Console.WriteLine("Deleted Files Successfully"); variables.xefinished = false; } private void copyfiles(string cpukey) { string targetkey = System.IO.Path.Combine(variables.xePath, variables.cpukeypath); string targetnand = System.IO.Path.Combine(variables.xePath, variables.nanddump); File.WriteAllText(targetkey, cpukey); if (String.IsNullOrEmpty(variables.filename1)) return; // FileInfo fi = new FileInfo(variables.filename1); if (fi.Length == 0xE0400000) { if (MessageBox.Show("Copy all 4GB data?", "Copy", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { JRunner.Functions.Copy c = new JRunner.Functions.Copy(variables.filename1, targetnand); c.ShowDialog(); } else { try { FileStream fr = new FileStream(variables.filename1, FileMode.Open); FileStream fw = new FileStream(targetnand, FileMode.Create); int buffersize = 0x200; byte[] buffer = new byte[buffersize]; for (int i = 0; i < 0x3000000; i += buffersize) { fr.Read(buffer, 0, buffersize); fw.Write(buffer, 0, buffersize); } fr.Close(); fw.Close(); } catch (Exception ex) { if (variables.debugme) Console.WriteLine(ex.ToString()); } } } /**/ else /**/File.Copy(variables.filename1, targetnand, true); } private void delfiles() { if (File.Exists(variables.xePath + variables.nanddump)) { try { File.Delete(variables.xePath + variables.nanddump); if (variables.debugme) Console.WriteLine("Deleted {0}", variables.xePath + variables.nanddump); } catch (System.IO.IOException e) { MessageBox.Show(e.Message); return; } } if (File.Exists(variables.xePath + variables.cpukeypath)) { try { File.Delete(variables.xePath + variables.cpukeypath); if (variables.debugme) Console.WriteLine("Deleted {0}", variables.xePath + variables.cpukeypath); } catch (System.IO.IOException e) { MessageBox.Show(e.Message); return; } } if (File.Exists(variables.launchpath + @"\" + variables.dashversion + @"\launch.ini")) { try { File.Delete(variables.launchpath + @"\" + variables.dashversion + @"\launch.ini"); if (variables.debugme) Console.WriteLine("Deleted launch.ini"); } catch (System.IO.IOException e) { MessageBox.Show(e.Message); return; } } if (File.Exists(Path.Combine(variables.xePath, "SMC.bin")) && (variables.copiedSMC || variables.fullDataClean)) // Only Delete SMCs it puts there { try { File.Delete(Path.Combine(variables.xePath, "SMC.bin")); if (variables.debugme) Console.WriteLine("Deleted SMC.bin"); } catch (System.IO.IOException e) { MessageBox.Show(e.Message); return; } } if (File.Exists(Path.Combine(variables.xePath, "KV.bin")) && variables.fullDataClean) { try { File.Delete(Path.Combine(variables.xePath, "KV.bin")); if (variables.debugme) Console.WriteLine("Deleted KV.bin"); } catch (System.IO.IOException e) { MessageBox.Show(e.Message); return; } } if (File.Exists(Path.Combine(variables.xePath, "fcrt.bin")) && variables.fullDataClean) { try { File.Delete(Path.Combine(variables.xePath, "fcrt.bin")); if (variables.debugme) Console.WriteLine("Deleted fcrt.bin"); } catch (System.IO.IOException e) { MessageBox.Show(e.Message); return; } } if (File.Exists(Path.Combine(variables.xePath, "smc_config.bin")) && variables.fullDataClean) { try { File.Delete(Path.Combine(variables.xePath, "smc_config.bin")); if (variables.debugme) Console.WriteLine("Deleted KV.bin"); } catch (System.IO.IOException e) { MessageBox.Show(e.Message); return; } } } consoles callconsoletypes(ConsoleTypes.Selected selec, bool twomb = false, bool full = false) { ConsoleTypes myNewForm = new ConsoleTypes(); myNewForm.sel = selec; myNewForm.twombread = twomb; myNewForm.sfulldump = full; myNewForm.ShowDialog(); if (myNewForm.DialogResult == DialogResult.Cancel) return (variables.cunts[0]); if (myNewForm.heResult().ID == -1) return variables.cunts[0]; variables.fulldump = myNewForm.fulldump(); variables.twombread = myNewForm.twombdump(); if (variables.debugme) Console.WriteLine("fulldump variable = {0}", variables.fulldump); setMBname(myNewForm.heResult().Text); return (myNewForm.heResult()); } public void xe_xeUExit(object sender, EventArgs e) { variables.changeldv = 0; UpdateProgres(100); if (variables.xefinished) { Console.WriteLine("Saved to {0}", variables.xefolder); Console.WriteLine("Image is Ready"); variables.filename1 = Path.Combine(variables.xefolder, variables.nandflash); updateSourc(variables.filename1); //Process.Start(variables.xefolder); } else { Console.WriteLine("Failed"); } variables.xefinished = false; } #endregion private void btnInfo_Click(object sender, EventArgs e) { ThreadStart starter = delegate { xe_compatibilityAvatar(variables.outfolder, "-i "); }; new Thread(starter).Start(); } private void updateCommand(bool wait = false) { if (wait) Thread.Sleep(100); string c = ""; c = "-t " + variables.ttyp; c += " -c " + variables.ctyp.XeBuild; foreach (String patch in patches) { c += " " + patch; } c += " -f " + variables.dashversion; c += " -d data"; c += " \"" + variables.xefolder + "\\" + variables.nandflash + "\" "; RegexOptions options = RegexOptions.None; Regex regex = new Regex(@"[ ]{2,}", options); c = regex.Replace(c, @" "); try { txtCommand.Text = c; } catch (Exception) { } } private void txtMBname_TextChanged(object sender, EventArgs e) { new Thread(new ThreadStart(delegate { updateCommand(true); })).Start(); new Thread(new ThreadStart(delegate { setComboCB(false, true); })).Start(); } private void setComboCB(bool erase = false, bool wait = false) { if (erase) { patches[7] = ""; return; } if (wait) Thread.Sleep(100); try { comboCB.Items.Clear(); if (variables.dashversion != 0) { string ini = (variables.launchpath + @"\" + variables.dashversion + @"\_retail.ini"); List<string> labels = parse_ini.getlabels(ini); foreach (string s in labels) { if (!s.Contains("bl")) continue; if (variables.ctyp.ID == -1) { if (s.Contains("_")) comboCB.Items.Add(new CB(s.Substring(s.IndexOf("_") + 1), true)); else { comboCB.Items.Add(new CB(Nand.ntable.getCBFromDash(getConsoleFromIni(s.Substring(0, s.IndexOf("bl"))), variables.dashversion), false)); } } else { if (s.Contains(variables.ctyp.Ini)) { if (s.Contains("_")) comboCB.Items.Add(new CB(s.Substring(s.IndexOf("_") + 1), true)); else comboCB.Items.Add(new CB(Nand.ntable.getCBFromDash(getConsoleFromIni(variables.ctyp.Ini), variables.dashversion), false)); } } } if (comboCB.Items.Count > 0) comboCB.SelectedIndex = 0; } } catch (Exception) { } } private void comboCB_SelectedIndexChanged(object sender, EventArgs e) { if (comboCB.Items.Count > 0) { CB c = (CB)comboCB.SelectedItem; if (c.Patch) patches[7] = "-r " + c.Version; else patches[7] = ""; updateCommand(); } } private consoles getConsoleFromIni(string ini) { foreach (consoles c in variables.cunts) { if (c.ID == -1) continue; if (ini == c.Ini) return c; } return variables.cunts[0]; } class CB { public string Version { get; set; } public bool Patch { get; set; } public CB(string v, bool p) { Version = v; Patch = p; } public CB(int v, bool p) { Version = v.ToString(); Patch = p; } public override string ToString() { return Version; } } } }
38.197166
252
0.510549
[ "MIT" ]
X360Tools/J-Runner-Pro
J-Runner/Panels/XeBuildPanel.cs
61,996
C#
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Threading.Tasks; using Pulumi.Serialization; namespace Pulumi.Keycloak.OpenId.Outputs { [OutputType] public sealed class ClientPermissionsMapRolesScope { public readonly string? DecisionStrategy; public readonly string? Description; public readonly ImmutableArray<string> Policies; [OutputConstructor] private ClientPermissionsMapRolesScope( string? decisionStrategy, string? description, ImmutableArray<string> policies) { DecisionStrategy = decisionStrategy; Description = description; Policies = policies; } } }
27.441176
88
0.675241
[ "ECL-2.0", "Apache-2.0" ]
davide-talesco/pulumi-keycloak
sdk/dotnet/OpenId/Outputs/ClientPermissionsMapRolesScope.cs
933
C#
using ScriperLib.Configuration; namespace Scriper.TimeSchedule { public interface IScriptSchedulerManagerAdapter { void Add(IScriptConfiguration scriptConfiguration); void Remove(string scriptName); void Replace(IScriptConfiguration scriptConfiguration); } }
24.75
63
0.750842
[ "MIT" ]
Gramli/Scriper
ScriperSol/Scriper/TimeSchedule/IScriptSchedulerManagerAdapter.cs
299
C#
// -------------------------------------------------------------------------------------------------------------------- // <copyright file="BinarySqlDataTypeRepresentation.cs" company="Naos Project"> // Copyright (c) Naos Project 2019. All rights reserved. // </copyright> // -------------------------------------------------------------------------------------------------------------------- namespace Naos.SqlServer.Domain { using System; using System.Globalization; using OBeautifulCode.Assertion.Recipes; using OBeautifulCode.Type; /// <summary> /// Top level . /// </summary> public partial class BinarySqlDataTypeRepresentation : SqlDataTypeRepresentationBase, IModelViaCodeGen { /// <summary> /// The maximum length constant. /// </summary> public const int MaxLengthConstant = -1; /// <summary> /// Initializes a new instance of the <see cref="BinarySqlDataTypeRepresentation"/> class. /// </summary> /// <param name="supportedLength">Length of the byte array that is supported, <see cref="MaxLengthConstant"/> will be maximum.</param> public BinarySqlDataTypeRepresentation( int supportedLength) { this.SupportedLength = supportedLength; } /// <summary> /// Gets the length of the string that is supported. /// </summary> /// <value>The length of the supported.</value> public int SupportedLength { get; private set; } /// <inheritdoc /> public override string DeclarationInSqlSyntax => FormattableString.Invariant($"[VARBINARY]({(this.SupportedLength == MaxLengthConstant ? "MAX" : this.SupportedLength.ToString(CultureInfo.InvariantCulture))})"); /// <inheritdoc /> public override void ValidateObjectTypeIsCompatible( Type objectType) { objectType.MustForArg(nameof(objectType)).NotBeNull().And().BeEqualTo(typeof(byte[])); } } }
39
173
0.561637
[ "MIT" ]
NaosProject/Naos.SqlServer
Naos.SqlServer.Domain/Model/DataTypeRepresentation/BinarySqlDataTypeRepresentation.cs
2,030
C#
using System; using System.Collections.Generic; using Traces.Web.Models.Files; namespace Traces.Web.Models { public class CreateTraceItemModel { public CreateTraceItemModel() { DueDate = DateTime.Now; } public string Title { get; set; } public string Description { get; set; } public DateTime DueDate { get; set; } public string ReservationId { get; set; } public string PropertyId { get; set; } public string AssignedRole { get; set; } #pragma warning disable CA2227 // disables argument can be null public List<CreateTraceFileItemModel> FilesToUpload { get; set; } #pragma warning restore CA2227 public bool FileContainsNoPii { get; set; } } }
23.242424
73
0.645372
[ "MIT" ]
apaleo/oss-traces
src/Traces.Web/Models/CreateTraceItemModel.cs
767
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; using System.Net; using System.Net.Http; using System.Security.Claims; using System.Text; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Routing; using Newtonsoft.Json; using Xunit; namespace System.Web.Http { public class ApiControllerTest { [Fact] public void AccessDependentProperties() { // Arrange var controller = new ConcreteApiController(); var httpContext = new DefaultHttpContext(); httpContext.User = new ClaimsPrincipal(); var actionContext = new ActionContext(httpContext, new RouteData(), new ControllerActionDescriptor()); // Act controller.ControllerContext = new ControllerContext(actionContext); // Assert Assert.Same(httpContext, controller.Context); Assert.Same(actionContext.ModelState, controller.ModelState); Assert.Same(httpContext.User, controller.User); } [Fact] public void AccessDependentProperties_UnsetContext() { // Arrange var controller = new ConcreteApiController(); // Act & Assert Assert.Null(controller.Context); Assert.NotNull(controller.ModelState); Assert.Null(controller.User); } [Fact] public void ApiController_BadRequest() { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.BadRequest(); // Assert Assert.Equal(StatusCodes.Status400BadRequest, Assert.IsType<BadRequestResult>(result).StatusCode); } [Fact] public void ApiController_BadRequest_Message() { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.BadRequest("Error"); // Assert var badRequest = Assert.IsType<BadRequestErrorMessageResult>(result); Assert.Equal("Error", badRequest.Message); var httpError = Assert.IsType<HttpError>(badRequest.Value); Assert.Equal("Error", httpError.Message); } [Fact] public void ApiController_BadRequest_ModelState() { // Arrange var controller = new ConcreteApiController(); var modelState = new ModelStateDictionary(); modelState.AddModelError("product.Name", "Name is required"); // Act var result = controller.BadRequest(modelState); // Assert var badRequest = Assert.IsType<InvalidModelStateResult>(result); var modelError = Assert.IsType<HttpError>(badRequest.Value).ModelState; Assert.Equal(new string[] { "Name is required" }, modelError["product.Name"]); } [Fact] public void ApiController_Created_Uri() { // Arrange var controller = new ConcreteApiController(); var uri = new Uri("http://contoso.com/"); var product = new Product(); // Act var result = controller.Created(uri, product); // Assert var created = Assert.IsType<CreatedResult>(result); Assert.Same(product, created.Value); Assert.Equal(uri.OriginalString, created.Location); } [Theory] [InlineData("http://contoso.com/Api/Products")] [InlineData("/Api/Products")] [InlineData("Products")] public void ApiController_Created_String(string uri) { // Arrange var controller = new ConcreteApiController(); var product = new Product(); // Act var result = controller.Created(uri, product); // Assert var created = Assert.IsType<CreatedResult>(result); Assert.Same(product, created.Value); Assert.Equal(uri, created.Location); } [Fact] public void ApiController_CreatedAtRoute() { // Arrange var controller = new ConcreteApiController(); var product = new Product(); // Act var result = controller.CreatedAtRoute("api_route", new { controller = "Products" }, product); // Assert var created = Assert.IsType<CreatedAtRouteResult>(result); Assert.Same(product, created.Value); Assert.Equal("api_route", created.RouteName); Assert.Equal("Products", created.RouteValues["controller"]); } [Fact] public void ApiController_CreatedAtRoute_Dictionary() { // Arrange var controller = new ConcreteApiController(); var product = new Product(); var values = new RouteValueDictionary(new { controller = "Products" }); // Act var result = controller.CreatedAtRoute("api_route", values, product); // Assert var created = Assert.IsType<CreatedAtRouteResult>(result); Assert.Same(product, created.Value); Assert.Equal("api_route", created.RouteName); Assert.Equal("Products", created.RouteValues["controller"]); Assert.Equal<KeyValuePair<string, object>>(values, created.RouteValues); } [Fact] public void ApiController_Conflict() { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.Conflict(); // Assert Assert.Equal(StatusCodes.Status409Conflict, Assert.IsType<ConflictResult>(result).StatusCode); } [Fact] public void ApiController_Content() { // Arrange var controller = new ConcreteApiController(); var content = new Product(); // Act var result = controller.Content(HttpStatusCode.Found, content); // Assert var contentResult = Assert.IsType<NegotiatedContentResult<Product>>(result); Assert.Equal(StatusCodes.Status302Found, contentResult.StatusCode); Assert.Equal(content, contentResult.Value); } [Fact] public void ApiController_InternalServerError() { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.InternalServerError(); // Assert Assert.Equal(StatusCodes.Status500InternalServerError, Assert.IsType<InternalServerErrorResult>(result).StatusCode); } [Fact] public void ApiController_InternalServerError_Exception() { // Arrange var controller = new ConcreteApiController(); var exception = new ArgumentException(); // Act var result = controller.InternalServerError(exception); // Assert var exceptionResult = Assert.IsType<ExceptionResult>(result); Assert.Same(exception, exceptionResult.Exception); } [Fact] public void ApiController_Json() { // Arrange var controller = new ConcreteApiController(); var product = new Product(); // Act var result = controller.Json(product); // Assert var jsonResult = Assert.IsType<JsonResult>(result); Assert.Same(product, jsonResult.Value); } [Fact] public void ApiController_Json_Encoding() { // Arrange var controller = new ConcreteApiController(); var product = new Product(); var settings = new JsonSerializerSettings(); // Act var result = controller.Json(product, settings, Encoding.UTF8); // Assert var jsonResult = Assert.IsType<JsonResult>(result); Assert.Same(product, jsonResult.Value); Assert.Same(Encoding.UTF8, MediaType.GetEncoding(jsonResult.ContentType)); } [Fact] public void ApiController_NotFound() { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.NotFound(); // Assert Assert.Equal(404, Assert.IsType<NotFoundResult>(result).StatusCode); } [Fact] public void ApiController_Ok() { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.Ok(); // Assert Assert.Equal(200, Assert.IsType<OkResult>(result).StatusCode); } [Fact] public void ApiController_Ok_Content() { // Arrange var controller = new ConcreteApiController(); var product = new Product(); // Act var result = controller.Ok(product); // Assert var okResult = Assert.IsType<OkObjectResult>(result); Assert.Same(product, okResult.Value); } [Fact] public void ApiController_Redirect() { // Arrange var controller = new ConcreteApiController(); var uri = new Uri("http://contoso.com"); // Act var result = controller.Redirect(uri); // Assert var redirect = Assert.IsType<RedirectResult>(result); Assert.Equal(uri.AbsoluteUri, result.Url); } [Theory] [InlineData("http://contoso.com/Api/Products")] public void ApiController_Redirect_String(string uri) { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.Redirect(uri); // Assert var redirect = Assert.IsType<RedirectResult>(result); Assert.Equal(uri, result.Url); } [Fact] public void ApiController_RedirectToRoute() { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.RedirectToRoute("api_route", new { controller = "Products" }); // Assert var created = Assert.IsType<RedirectToRouteResult>(result); Assert.Equal("api_route", created.RouteName); Assert.Equal("Products", created.RouteValues["controller"]); } [Fact] public void ApiController_RedirectToRoute_Dictionary() { // Arrange var controller = new ConcreteApiController(); var product = new Product(); var values = new RouteValueDictionary(new { controller = "Products" }); // Act var result = controller.RedirectToRoute("api_route", values); // Assert var created = Assert.IsType<RedirectToRouteResult>(result); Assert.Equal("api_route", created.RouteName); Assert.Equal("Products", created.RouteValues["controller"]); } [Fact] public void ApiController_ResponseMessage() { // Arrange var controller = new ConcreteApiController(); var response = new HttpResponseMessage(HttpStatusCode.NoContent); // Act var result = controller.ResponseMessage(response); // Assert var responseResult = Assert.IsType<ResponseMessageResult>(result); Assert.Same(response, responseResult.Response); } [Fact] public void ApiController_StatusCode() { // Arrange var controller = new ConcreteApiController(); // Act var result = controller.StatusCode(HttpStatusCode.ExpectationFailed); // Assert Assert.Equal(StatusCodes.Status417ExpectationFailed, Assert.IsType<StatusCodeResult>(result).StatusCode); } private class Product { public string Name { get; set; } public int Id { get; set; } } private class ConcreteApiController : ApiController { } } }
30.701923
128
0.573598
[ "Apache-2.0" ]
Elfocrash/Mvc
test/Microsoft.AspNetCore.Mvc.WebApiCompatShimTest/ApiControllerTest.cs
12,772
C#
using Amazon.Lambda.Core; using MailCheck.Common.Messaging.Sqs; // Assembly attribute to enable the Lambda function's JSON input to be converted into a .NET class. [assembly: LambdaSerializer(typeof(Amazon.Lambda.Serialization.Json.JsonSerializer))] namespace MailCheck.Spf.Poller { public class SpfPollerLambdaEntryPoint : SqsTriggeredLambdaEntryPoint { public SpfPollerLambdaEntryPoint() : base(new StartUp.StartUp()) { } } }
29.125
99
0.744635
[ "Apache-2.0" ]
ukncsc/MailCheck.Public.Spf
src/MailCheck.Spf.Poller/SpfPollerLambdaEntryPoint.cs
466
C#
using UnityEngine; #if UNITY_2019_1 || UNITY_2019_2 //HDRP 5.x, 6.x using UnityEngine.Experimental.Rendering.HDPipeline; #else //HDRP 7.x and above using UnityEngine.Rendering.HighDefinition; #endif [RequireComponent(typeof(Camera), typeof(HDAdditionalCameraData))] public class HDRPRenderTextureBlitter : MonoBehaviour { [SerializeField] Camera m_rtCamera = null; Camera m_cam; HDAdditionalCameraData m_hdData; private void OnEnable() { m_cam = GetComponent<Camera>(); m_hdData = GetComponent<HDAdditionalCameraData>(); //Render nothing m_cam.clearFlags = CameraClearFlags.Nothing; m_cam.cullingMask = 0; m_hdData.fullscreenPassthrough = true; m_hdData.customRender += BlitRenderStreamingRT; } //--------------------------------------------------------------------------------------------------------------------- private void OnDisable() { m_hdData.customRender -= BlitRenderStreamingRT; } //--------------------------------------------------------------------------------------------------------------------- public void BlitRenderStreamingRT(UnityEngine.Rendering.ScriptableRenderContext context, HDCamera cam) { Graphics.Blit(m_rtCamera.targetTexture, (RenderTexture) null); } }
33.195122
120
0.565026
[ "MIT" ]
JesusGarciaValadez/UnityRenderStreaming
Assets/RenderPipeline/HDRP/Scripts/HDRPRenderTextureBlitter.cs
1,363
C#
// <auto-generated /> using EstateManagement.Models; using EstateManagement.Models.DataBase; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.EntityFrameworkCore.Storage.Internal; using System; namespace EstateManagement.Migrations { [DbContext(typeof(DatabaseContext))] [Migration("20180122001858_test3")] partial class test3 { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "2.0.1-rtm-125") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("EstateManagement.Models.Adress", b => { b.Property<int>("AdressId") .ValueGeneratedOnAdd(); b.Property<string>("City"); b.Property<string>("Street"); b.HasKey("AdressId"); b.ToTable("Adresses"); }); modelBuilder.Entity("EstateManagement.Models.Owner", b => { b.Property<int>("OwnerId") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.Property<string>("Phone"); b.Property<string>("Surname"); b.HasKey("OwnerId"); b.ToTable("Owners"); }); modelBuilder.Entity("EstateManagement.Models.Property", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<int>("AdressId"); b.Property<int>("Area"); b.Property<string>("Description"); b.Property<bool>("Iron"); b.Property<int>("OwnerId"); b.Property<bool>("Refrigerator"); b.Property<int>("Rooms"); b.Property<int>("Type"); b.Property<bool>("Washer"); b.HasKey("Id"); b.HasIndex("AdressId"); b.HasIndex("OwnerId"); b.ToTable("Properties"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken(); b.Property<string>("Name") .HasMaxLength(256); b.Property<string>("NormalizedName") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasName("RoleNameIndex") .HasFilter("[NormalizedName] IS NOT NULL"); b.ToTable("AspNetRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ClaimType"); b.Property<string>("ClaimValue"); b.Property<string>("RoleId") .IsRequired(); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => { b.Property<string>("Id") .ValueGeneratedOnAdd(); b.Property<int>("AccessFailedCount"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken(); b.Property<string>("Email") .HasMaxLength(256); b.Property<bool>("EmailConfirmed"); b.Property<bool>("LockoutEnabled"); b.Property<DateTimeOffset?>("LockoutEnd"); b.Property<string>("NormalizedEmail") .HasMaxLength(256); b.Property<string>("NormalizedUserName") .HasMaxLength(256); b.Property<string>("PasswordHash"); b.Property<string>("PhoneNumber"); b.Property<bool>("PhoneNumberConfirmed"); b.Property<string>("SecurityStamp"); b.Property<bool>("TwoFactorEnabled"); b.Property<string>("UserName") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasName("UserNameIndex") .HasFilter("[NormalizedUserName] IS NOT NULL"); b.ToTable("AspNetUsers"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ClaimType"); b.Property<string>("ClaimValue"); b.Property<string>("UserId") .IsRequired(); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => { b.Property<string>("LoginProvider"); b.Property<string>("ProviderKey"); b.Property<string>("ProviderDisplayName"); b.Property<string>("UserId") .IsRequired(); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => { b.Property<string>("UserId"); b.Property<string>("RoleId"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => { b.Property<string>("UserId"); b.Property<string>("LoginProvider"); b.Property<string>("Name"); b.Property<string>("Value"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens"); }); modelBuilder.Entity("EstateManagement.Models.Property", b => { b.HasOne("EstateManagement.Models.Adress", "Adress") .WithMany() .HasForeignKey("AdressId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("EstateManagement.Models.Owner", "Owner") .WithMany() .HasForeignKey("OwnerId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole") .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b => { b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); #pragma warning restore 612, 618 } } }
32.791531
117
0.467269
[ "MIT" ]
zbikowskiL/EstateManagement
EstateManagement/Migrations/20180122001858_test3.Designer.cs
10,069
C#
using System.Threading.Tasks; using ReduxSharp; namespace Counter { public class AppReducer : IReducer<AppState> { public AppState Invoke<TAction>(AppState state, TAction action) { if (action is CountUpAction) { return new AppState { Counter = new CounterState { Count = state.Counter.Count + 1, } }; } else if (action is CountDownAction) { return new AppState { Counter = new CounterState { Count = state.Counter.Count - 1, } }; } else { return state; } } } public class CountUpAction { CountUpAction() { } public static readonly CountUpAction Instance = new CountUpAction(); } public class CountDownAction { CountDownAction() { } public static readonly CountDownAction Instance = new CountDownAction(); } }
23.431373
80
0.446025
[ "MIT" ]
tnakamura/ReduxSharp
examples/Counter/AppReducer.cs
1,197
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Drawing.Drawing2D; using System.Drawing.Imaging; using System.Drawing.Internal; using System.Globalization; using System.Numerics; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Runtime.Versioning; using Gdip = System.Drawing.SafeNativeMethods.Gdip; namespace System.Drawing { /// <summary> /// Encapsulates a GDI+ drawing surface. /// </summary> public sealed partial class Graphics : MarshalByRefObject, IDisposable, IDeviceContext { #if FINALIZATION_WATCH static readonly TraceSwitch GraphicsFinalization = new TraceSwitch( "GraphicsFinalization", "Tracks the creation and destruction of finalization" ); internal static string GetAllocationStack() { if (GraphicsFinalization.TraceVerbose) { return Environment.StackTrace; } else { return "Enabled 'GraphicsFinalization' switch to see stack of allocation"; } } private string allocationSite = Graphics.GetAllocationStack(); #endif /// <summary> /// The context state previous to the current Graphics context (the head of the stack). /// We don't keep a GraphicsContext for the current context since it is available at any time from GDI+ and /// we don't want to keep track of changes in it. /// </summary> private GraphicsContext? _previousContext; private static readonly object s_syncObject = new object(); // Object reference used for printing; it could point to a PrintPreviewGraphics to obtain the VisibleClipBounds, or // a DeviceContext holding a printer DC. private object? _printingHelper; // GDI+'s preferred HPALETTE. private static IntPtr s_halftonePalette; // pointer back to the Image backing a specific graphic object private Image? _backingImage; /// <summary> /// Constructor to initialize this object from a native GDI+ Graphics pointer. /// </summary> private Graphics(IntPtr gdipNativeGraphics) { if (gdipNativeGraphics == IntPtr.Zero) throw new ArgumentNullException(nameof(gdipNativeGraphics)); NativeGraphics = gdipNativeGraphics; } /// <summary> /// Creates a new instance of the <see cref='Graphics'/> class from the specified handle to a device context. /// </summary> [EditorBrowsable(EditorBrowsableState.Advanced)] public static Graphics FromHdc(IntPtr hdc) { if (hdc == IntPtr.Zero) throw new ArgumentNullException(nameof(hdc)); return FromHdcInternal(hdc); } [EditorBrowsable(EditorBrowsableState.Advanced)] public static Graphics FromHdcInternal(IntPtr hdc) { Gdip.CheckStatus(Gdip.GdipCreateFromHDC(hdc, out IntPtr nativeGraphics)); return new Graphics(nativeGraphics); } /// <summary> /// Creates a new instance of the Graphics class from the specified handle to a device context and handle to a device. /// </summary> [EditorBrowsable(EditorBrowsableState.Advanced)] public static Graphics FromHdc(IntPtr hdc, IntPtr hdevice) { Gdip.CheckStatus(Gdip.GdipCreateFromHDC2(hdc, hdevice, out IntPtr nativeGraphics)); return new Graphics(nativeGraphics); } /// <summary> /// Creates a new instance of the <see cref='Graphics'/> class from a window handle. /// </summary> [EditorBrowsable(EditorBrowsableState.Advanced)] public static Graphics FromHwnd(IntPtr hwnd) => FromHwndInternal(hwnd); [EditorBrowsable(EditorBrowsableState.Advanced)] public static Graphics FromHwndInternal(IntPtr hwnd) { Gdip.CheckStatus(Gdip.GdipCreateFromHWND(hwnd, out IntPtr nativeGraphics)); return new Graphics(nativeGraphics); } /// <summary> /// Creates an instance of the <see cref='Graphics'/> class from an existing <see cref='Image'/>. /// </summary> public static Graphics FromImage(Image image) { if (image == null) throw new ArgumentNullException(nameof(image)); if ((image.PixelFormat & PixelFormat.Indexed) != 0) throw new ArgumentException( SR.GdiplusCannotCreateGraphicsFromIndexedPixelFormat, nameof(image) ); Gdip.CheckStatus( Gdip.GdipGetImageGraphicsContext( new HandleRef(image, image.nativeImage), out IntPtr nativeGraphics ) ); return new Graphics(nativeGraphics) { _backingImage = image }; } [EditorBrowsable(EditorBrowsableState.Never)] public void ReleaseHdcInternal(IntPtr hdc) { Gdip.CheckStatus( !Gdip.Initialized ? Gdip.Ok : Gdip.GdipReleaseDC(new HandleRef(this, NativeGraphics), hdc) ); _nativeHdc = IntPtr.Zero; } /// <summary> /// Deletes this <see cref='Graphics'/>, and frees the memory allocated for it. /// </summary> public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } private void Dispose(bool disposing) { #if DEBUG && FINALIZATION_WATCH if (!disposing && _nativeGraphics != IntPtr.Zero) { Debug.WriteLine( "System.Drawing.Graphics: ***************************************************" ); Debug.WriteLine( "System.Drawing.Graphics: Object Disposed through finalization:\n" + allocationSite ); } #endif while (_previousContext != null) { // Dispose entire stack. GraphicsContext? context = _previousContext.Previous; _previousContext.Dispose(); _previousContext = context; } if (NativeGraphics != IntPtr.Zero) { try { if (_nativeHdc != IntPtr.Zero) // avoid a handle leak. { ReleaseHdc(); } if (PrintingHelper is DeviceContext printerDC) { printerDC.Dispose(); _printingHelper = null; } #if DEBUG int status = !Gdip.Initialized ? Gdip.Ok : #endif Gdip.GdipDeleteGraphics(new HandleRef(this, NativeGraphics)); #if DEBUG Debug.Assert( status == Gdip.Ok, "GDI+ returned an error status: " + status.ToString(CultureInfo.InvariantCulture) ); #endif } catch (Exception ex) when (!ClientUtils.IsSecurityOrCriticalException(ex)) { } finally { NativeGraphics = IntPtr.Zero; } } } ~Graphics() => Dispose(false); private void FlushCore() { // Libgdiplus needs to synchronize a macOS context. Windows does not do anything. } /// <summary> /// Represents an object used in connection with the printing API, it is used to hold a reference to a /// PrintPreviewGraphics (fake graphics) or a printer DeviceContext (and maybe more in the future). /// </summary> internal object? PrintingHelper { get => _printingHelper; set { Debug.Assert( _printingHelper == null, "WARNING: Overwritting the printing helper reference!" ); _printingHelper = value; } } /// <summary> /// CopyPixels will perform a gdi "bitblt" operation to the source from the destination with the given size /// and specified raster operation. /// </summary> public void CopyFromScreen( int sourceX, int sourceY, int destinationX, int destinationY, Size blockRegionSize, CopyPixelOperation copyPixelOperation ) { switch (copyPixelOperation) { case CopyPixelOperation.Blackness: case CopyPixelOperation.NotSourceErase: case CopyPixelOperation.NotSourceCopy: case CopyPixelOperation.SourceErase: case CopyPixelOperation.DestinationInvert: case CopyPixelOperation.PatInvert: case CopyPixelOperation.SourceInvert: case CopyPixelOperation.SourceAnd: case CopyPixelOperation.MergePaint: case CopyPixelOperation.MergeCopy: case CopyPixelOperation.SourceCopy: case CopyPixelOperation.SourcePaint: case CopyPixelOperation.PatCopy: case CopyPixelOperation.PatPaint: case CopyPixelOperation.Whiteness: case CopyPixelOperation.CaptureBlt: case CopyPixelOperation.NoMirrorBitmap: break; default: throw new InvalidEnumArgumentException( nameof(copyPixelOperation), (int)copyPixelOperation, typeof(CopyPixelOperation) ); } int destWidth = blockRegionSize.Width; int destHeight = blockRegionSize.Height; IntPtr screenDC = Interop.User32.GetDC(IntPtr.Zero); try { IntPtr targetDC = GetHdc(); int result = Interop.Gdi32.BitBlt( targetDC, destinationX, destinationY, destWidth, destHeight, screenDC, sourceX, sourceY, (Interop.Gdi32.RasterOp)copyPixelOperation ); //a zero result indicates a win32 exception has been thrown if (result == 0) { throw new Win32Exception(); } } finally { Interop.User32.ReleaseDC(IntPtr.Zero, screenDC); ReleaseHdc(); } } public Color GetNearestColor(Color color) { int nearest = color.ToArgb(); Gdip.CheckStatus( Gdip.GdipGetNearestColor(new HandleRef(this, NativeGraphics), ref nearest) ); return Color.FromArgb(nearest); } /// <summary> /// Draws a line connecting the two specified points. /// </summary> public void DrawLine(Pen pen, float x1, float y1, float x2, float y2) { if (pen == null) throw new ArgumentNullException(nameof(pen)); CheckErrorStatus( Gdip.GdipDrawLine( new HandleRef(this, NativeGraphics), new HandleRef(pen, pen.NativePen), x1, y1, x2, y2 ) ); } /// <summary> /// Draws a series of cubic Bezier curves from an array of points. /// </summary> public unsafe void DrawBeziers(Pen pen, PointF[] points) { if (pen == null) throw new ArgumentNullException(nameof(pen)); if (points == null) throw new ArgumentNullException(nameof(points)); fixed (PointF* p = points) { CheckErrorStatus( Gdip.GdipDrawBeziers( new HandleRef(this, NativeGraphics), new HandleRef(pen, pen.NativePen), p, points.Length ) ); } } /// <summary> /// Draws a series of cubic Bezier curves from an array of points. /// </summary> public unsafe void DrawBeziers(Pen pen, Point[] points) { if (pen == null) throw new ArgumentNullException(nameof(pen)); if (points == null) throw new ArgumentNullException(nameof(points)); fixed (Point* p = points) { CheckErrorStatus( Gdip.GdipDrawBeziersI( new HandleRef(this, NativeGraphics), new HandleRef(pen, pen.NativePen), p, points.Length ) ); } } /// <summary> /// Fills the interior of a path. /// </summary> public void FillPath(Brush brush, GraphicsPath path) { if (brush == null) throw new ArgumentNullException(nameof(brush)); if (path == null) throw new ArgumentNullException(nameof(path)); CheckErrorStatus( Gdip.GdipFillPath( new HandleRef(this, NativeGraphics), new HandleRef(brush, brush.NativeBrush), new HandleRef(path, path._nativePath) ) ); } /// <summary> /// Fills the interior of a <see cref='Region'/>. /// </summary> public void FillRegion(Brush brush, Region region) { if (brush == null) throw new ArgumentNullException(nameof(brush)); if (region == null) throw new ArgumentNullException(nameof(region)); CheckErrorStatus( Gdip.GdipFillRegion( new HandleRef(this, NativeGraphics), new HandleRef(brush, brush.NativeBrush), new HandleRef(region, region.NativeRegion) ) ); } public void DrawIcon(Icon icon, int x, int y) { if (icon == null) throw new ArgumentNullException(nameof(icon)); if (_backingImage != null) { // We don't call the icon directly because we want to stay in GDI+ all the time // to avoid alpha channel interop issues between gdi and gdi+ // so we do icon.ToBitmap() and then we call DrawImage. This is probably slower. DrawImage(icon.ToBitmap(), x, y); } else { icon.Draw(this, x, y); } } /// <summary> /// Draws this image to a graphics object. The drawing command originates on the graphics /// object, but a graphics object generally has no idea how to render a given image. So, /// it passes the call to the actual image. This version crops the image to the given /// dimensions and allows the user to specify a rectangle within the image to draw. /// </summary> public void DrawIcon(Icon icon, Rectangle targetRect) { if (icon == null) throw new ArgumentNullException(nameof(icon)); if (_backingImage != null) { // We don't call the icon directly because we want to stay in GDI+ all the time // to avoid alpha channel interop issues between gdi and gdi+ // so we do icon.ToBitmap() and then we call DrawImage. This is probably slower. DrawImage(icon.ToBitmap(), targetRect); } else { icon.Draw(this, targetRect); } } /// <summary> /// Draws this image to a graphics object. The drawing command originates on the graphics /// object, but a graphics object generally has no idea how to render a given image. So, /// it passes the call to the actual image. This version stretches the image to the given /// dimensions and allows the user to specify a rectangle within the image to draw. /// </summary> public void DrawIconUnstretched(Icon icon, Rectangle targetRect) { if (icon == null) throw new ArgumentNullException(nameof(icon)); if (_backingImage != null) { DrawImageUnscaled(icon.ToBitmap(), targetRect); } else { icon.DrawUnstretched(this, targetRect); } } public void EnumerateMetafile( Metafile metafile, PointF destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileDestPoint( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), ref destPoint, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } public void EnumerateMetafile( Metafile metafile, Point destPoint, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileDestPointI( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), ref destPoint, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } public void EnumerateMetafile( Metafile metafile, RectangleF destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileDestRect( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), ref destRect, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } public void EnumerateMetafile( Metafile metafile, Rectangle destRect, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileDestRectI( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), ref destRect, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } public unsafe void EnumerateMetafile( Metafile metafile, PointF[] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { if (destPoints == null) throw new ArgumentNullException(nameof(destPoints)); if (destPoints.Length != 3) throw new ArgumentException(SR.GdiplusDestPointsInvalidParallelogram); fixed (PointF* p = destPoints) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileDestPoints( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), p, destPoints.Length, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } } public unsafe void EnumerateMetafile( Metafile metafile, Point[] destPoints, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { if (destPoints == null) throw new ArgumentNullException(nameof(destPoints)); if (destPoints.Length != 3) throw new ArgumentException(SR.GdiplusDestPointsInvalidParallelogram); fixed (Point* p = destPoints) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileDestPointsI( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), p, destPoints.Length, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } } public void EnumerateMetafile( Metafile metafile, PointF destPoint, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileSrcRectDestPoint( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), ref destPoint, ref srcRect, unit, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } public void EnumerateMetafile( Metafile metafile, Point destPoint, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileSrcRectDestPointI( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), ref destPoint, ref srcRect, unit, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } public void EnumerateMetafile( Metafile metafile, RectangleF destRect, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileSrcRectDestRect( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), ref destRect, ref srcRect, unit, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } public void EnumerateMetafile( Metafile metafile, Rectangle destRect, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileSrcRectDestRectI( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), ref destRect, ref srcRect, unit, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } public unsafe void EnumerateMetafile( Metafile metafile, PointF[] destPoints, RectangleF srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { if (destPoints == null) throw new ArgumentNullException(nameof(destPoints)); if (destPoints.Length != 3) throw new ArgumentException(SR.GdiplusDestPointsInvalidParallelogram); fixed (PointF* p = destPoints) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileSrcRectDestPoints( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), p, destPoints.Length, ref srcRect, unit, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } } public unsafe void EnumerateMetafile( Metafile metafile, Point[] destPoints, Rectangle srcRect, GraphicsUnit unit, EnumerateMetafileProc callback, IntPtr callbackData, ImageAttributes? imageAttr ) { if (destPoints == null) throw new ArgumentNullException(nameof(destPoints)); if (destPoints.Length != 3) throw new ArgumentException(SR.GdiplusDestPointsInvalidParallelogram); fixed (Point* p = destPoints) { Gdip.CheckStatus( Gdip.GdipEnumerateMetafileSrcRectDestPointsI( new HandleRef(this, NativeGraphics), new HandleRef(metafile, metafile?.nativeImage ?? IntPtr.Zero), p, destPoints.Length, ref srcRect, unit, callback, callbackData, new HandleRef(imageAttr, imageAttr?.nativeImageAttributes ?? IntPtr.Zero) ) ); } } /// <summary> /// Combines current Graphics context with all previous contexts. /// When BeginContainer() is called, a copy of the current context is pushed into the GDI+ context stack, it keeps track of the /// absolute clipping and transform but reset the public properties so it looks like a brand new context. /// When Save() is called, a copy of the current context is also pushed in the GDI+ stack but the public clipping and transform /// properties are not reset (cumulative). Consecutive Save context are ignored with the exception of the top one which contains /// all previous information. /// The return value is an object array where the first element contains the cumulative clip region and the second the cumulative /// translate transform matrix. /// WARNING: This method is for internal FX support only. /// </summary> [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete( Obsoletions.GetContextInfoMessage, DiagnosticId = Obsoletions.GetContextInfoDiagId, UrlFormat = Obsoletions.SharedUrlFormat )] [SupportedOSPlatform("windows")] public object GetContextInfo() { GetContextInfo( out Matrix3x2 cumulativeTransform, calculateClip: true, out Region? cumulativeClip ); return new object[] { cumulativeClip ?? new Region(), new Matrix(cumulativeTransform) }; } private void GetContextInfo( out Matrix3x2 cumulativeTransform, bool calculateClip, out Region? cumulativeClip ) { cumulativeClip = calculateClip ? GetRegionIfNotInfinite() : null; // Current context clip. cumulativeTransform = TransformElements; // Current context transform. Vector2 currentOffset = default; // Offset of current context. Vector2 totalOffset = default; // Absolute coordinate offset of top context. GraphicsContext? context = _previousContext; if (!cumulativeTransform.IsIdentity) { currentOffset = cumulativeTransform.Translation; } while (context is not null) { if (!context.TransformOffset.IsEmpty()) { cumulativeTransform.Translate(context.TransformOffset); } if (!currentOffset.IsEmpty()) { // The location of the GDI+ clip region is relative to the coordinate origin after any translate transform // has been applied. We need to intersect regions using the same coordinate origin relative to the previous // context. // If we don't have a cumulative clip, we're infinite, and translation on infinite regions is a no-op. cumulativeClip?.Translate(currentOffset.X, currentOffset.Y); totalOffset.X += currentOffset.X; totalOffset.Y += currentOffset.Y; } // Context only stores clips if they are not infinite. Intersecting a clip with an infinite clip is a no-op. if (calculateClip && context.Clip is not null) { // Intersecting an infinite clip with another is just a copy of the second clip. if (cumulativeClip is null) { cumulativeClip = context.Clip; } else { cumulativeClip.Intersect(context.Clip); } } currentOffset = context.TransformOffset; // Ignore subsequent cumulative contexts. do { context = context.Previous; if (context == null || !context.Next!.IsCumulative) { break; } } while (context.IsCumulative); } if (!totalOffset.IsEmpty()) { // We need now to reset the total transform in the region so when calling Region.GetHRgn(Graphics) // the HRegion is properly offset by GDI+ based on the total offset of the graphics object. // If we don't have a cumulative clip, we're infinite, and translation on infinite regions is a no-op. cumulativeClip?.Translate(-totalOffset.X, -totalOffset.Y); } } /// <summary> /// Gets the cumulative offset. /// </summary> /// <param name="offset">The cumulative offset.</param> [EditorBrowsable(EditorBrowsableState.Never)] [SupportedOSPlatform("windows")] public void GetContextInfo(out PointF offset) { GetContextInfo(out Matrix3x2 cumulativeTransform, calculateClip: false, out _); Vector2 translation = cumulativeTransform.Translation; offset = new PointF(translation.X, translation.Y); } /// <summary> /// Gets the cumulative offset and clip region. /// </summary> /// <param name="offset">The cumulative offset.</param> /// <param name="clip">The cumulative clip region or null if the clip region is infinite.</param> [EditorBrowsable(EditorBrowsableState.Never)] [SupportedOSPlatform("windows")] public void GetContextInfo(out PointF offset, out Region? clip) { GetContextInfo(out Matrix3x2 cumulativeTransform, calculateClip: true, out clip); Vector2 translation = cumulativeTransform.Translation; offset = new PointF(translation.X, translation.Y); } public RectangleF VisibleClipBounds { get { if (PrintingHelper is PrintPreviewGraphics ppGraphics) return ppGraphics.VisibleClipBounds; Gdip.CheckStatus( Gdip.GdipGetVisibleClipBounds( new HandleRef(this, NativeGraphics), out RectangleF rect ) ); return rect; } } /// <summary> /// Saves the current context into the context stack. /// </summary> private void PushContext(GraphicsContext context) { Debug.Assert( context != null && context.State != 0, "GraphicsContext object is null or not valid." ); if (_previousContext != null) { // Push context. context.Previous = _previousContext; _previousContext.Next = context; } _previousContext = context; } /// <summary> /// Pops all contexts from the specified one included. The specified context is becoming the current context. /// </summary> private void PopContext(int currentContextState) { Debug.Assert( _previousContext != null, "Trying to restore a context when the stack is empty" ); GraphicsContext? context = _previousContext; // Pop all contexts up the stack. while (context != null) { if (context.State == currentContextState) { _previousContext = context.Previous; // This will dipose all context object up the stack. context.Dispose(); return; } context = context.Previous; } Debug.Fail("Warning: context state not found!"); } public GraphicsState Save() { GraphicsContext context = new GraphicsContext(this); int status = Gdip.GdipSaveGraphics(new HandleRef(this, NativeGraphics), out int state); if (status != Gdip.Ok) { context.Dispose(); throw Gdip.StatusException(status); } context.State = state; context.IsCumulative = true; PushContext(context); return new GraphicsState(state); } public void Restore(GraphicsState gstate) { Gdip.CheckStatus( Gdip.GdipRestoreGraphics(new HandleRef(this, NativeGraphics), gstate.nativeState) ); PopContext(gstate.nativeState); } public GraphicsContainer BeginContainer( RectangleF dstrect, RectangleF srcrect, GraphicsUnit unit ) { GraphicsContext context = new GraphicsContext(this); int status = Gdip.GdipBeginContainer( new HandleRef(this, NativeGraphics), ref dstrect, ref srcrect, unit, out int state ); if (status != Gdip.Ok) { context.Dispose(); throw Gdip.StatusException(status); } context.State = state; PushContext(context); return new GraphicsContainer(state); } public GraphicsContainer BeginContainer() { GraphicsContext context = new GraphicsContext(this); int status = Gdip.GdipBeginContainer2( new HandleRef(this, NativeGraphics), out int state ); if (status != Gdip.Ok) { context.Dispose(); throw Gdip.StatusException(status); } context.State = state; PushContext(context); return new GraphicsContainer(state); } public void EndContainer(GraphicsContainer container) { if (container == null) throw new ArgumentNullException(nameof(container)); Gdip.CheckStatus( Gdip.GdipEndContainer( new HandleRef(this, NativeGraphics), container.nativeGraphicsContainer ) ); PopContext(container.nativeGraphicsContainer); } public GraphicsContainer BeginContainer( Rectangle dstrect, Rectangle srcrect, GraphicsUnit unit ) { GraphicsContext context = new GraphicsContext(this); int status = Gdip.GdipBeginContainerI( new HandleRef(this, NativeGraphics), ref dstrect, ref srcrect, unit, out int state ); if (status != Gdip.Ok) { context.Dispose(); throw Gdip.StatusException(status); } context.State = state; PushContext(context); return new GraphicsContainer(state); } public void AddMetafileComment(byte[] data) { if (data == null) throw new ArgumentNullException(nameof(data)); Gdip.CheckStatus( Gdip.GdipComment(new HandleRef(this, NativeGraphics), data.Length, data) ); } public static IntPtr GetHalftonePalette() { if (s_halftonePalette == IntPtr.Zero) { lock (s_syncObject) { if (s_halftonePalette == IntPtr.Zero) { AppDomain.CurrentDomain.DomainUnload += OnDomainUnload; AppDomain.CurrentDomain.ProcessExit += OnDomainUnload; s_halftonePalette = Gdip.GdipCreateHalftonePalette(); } } } return s_halftonePalette; } // This is called from AppDomain.ProcessExit and AppDomain.DomainUnload. private static void OnDomainUnload(object? sender, EventArgs e) { if (s_halftonePalette != IntPtr.Zero) { Interop.Gdi32.DeleteObject(s_halftonePalette); s_halftonePalette = IntPtr.Zero; } } /// <summary> /// GDI+ will return a 'generic error' with specific win32 last error codes when /// a terminal server session has been closed, minimized, etc... We don't want /// to throw when this happens, so we'll guard against this by looking at the /// 'last win32 error code' and checking to see if it is either 1) access denied /// or 2) proc not found and then ignore it. /// /// The problem is that when you lock the machine, the secure desktop is enabled and /// rendering fails which is expected (since the app doesn't have permission to draw /// on the secure desktop). Not sure if there's anything you can do, short of catching /// the desktop switch message and absorbing all the exceptions that get thrown while /// it's the secure desktop. /// </summary> private void CheckErrorStatus(int status) { if (status == Gdip.Ok) return; // Generic error from GDI+ can be GenericError or Win32Error. if (status == Gdip.GenericError || status == Gdip.Win32Error) { int error = Marshal.GetLastWin32Error(); if ( error == SafeNativeMethods.ERROR_ACCESS_DENIED || error == SafeNativeMethods.ERROR_PROC_NOT_FOUND || // Here, we'll check to see if we are in a terminal services session... ( ( ( Interop.User32.GetSystemMetrics(NativeMethods.SM_REMOTESESSION) & 0x00000001 ) != 0 ) && (error == 0) ) ) { return; } } // Legitimate error, throw our status exception. throw Gdip.StatusException(status); } } }
36.05312
137
0.520358
[ "MIT" ]
belav/runtime
src/libraries/System.Drawing.Common/src/System/Drawing/Graphics.Windows.cs
42,759
C#
// Python Tools for Visual Studio // Copyright(c) Microsoft Corporation // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the License); you may not use // this file except in compliance with the License. You may obtain a copy of the // License at http://www.apache.org/licenses/LICENSE-2.0 // // THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS // OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY // IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, // MERCHANTABLITY OR NON-INFRINGEMENT. // // See the Apache Version 2.0 License for specific language governing // permissions and limitations under the License. using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; [assembly: AssemblyTitle("Visual Studio - Python Test Explorer integration")] [assembly: AssemblyDescription("Provides integration with the Visual Studio Test Explorer for Python projects.")] [assembly: AssemblyConfiguration("")] [assembly: ComVisible(false)] [assembly: InternalsVisibleTo("TestAdapterTests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007d1fa57c4aed9f0a32e84aa0faefd0de9e8fd6aec8f87fb03766c834c99921eb23be79ad9d5dcc1dd9ad236132102900b723cf980957fc4e177108fc607774f29e8320e92ea05ece4e821c0a5efe8f1645c4c0c93c1ab99285d622caa652c1dfad63d745d6f2de5f17e5eaf0fc4963d261c8a12436518206dc093344d5ad293")]
52.428571
382
0.827657
[ "Apache-2.0" ]
113771169/PTVS
Python/Product/TestAdapter/Properties/AssemblyInfo.cs
1,468
C#
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ using System.Collections.Generic; using Aliyun.Acs.Core; namespace Aliyun.Acs.CloudPhoto.Model.V20170711 { public class RenameAlbumResponse : AcsResponse { private string code; private string message; private string requestId; private string action; public string Code { get { return code; } set { code = value; } } public string Message { get { return message; } set { message = value; } } public string RequestId { get { return requestId; } set { requestId = value; } } public string Action { get { return action; } set { action = value; } } } }
18.458824
63
0.643085
[ "Apache-2.0" ]
AxiosCros/aliyun-openapi-net-sdk
aliyun-net-sdk-cloudphoto/CloudPhoto/Model/V20170711/RenameAlbumResponse.cs
1,569
C#
using Tempus.Abstractions.Events; using Tempus.Abstractions.Exceptions; namespace Tempus.Aggregates { public abstract class AggregateRoot { private readonly List<IEvent> _changes = new List<IEvent>(); public AggregateState State { get; set; } public Guid AggregateIdentifier { get; set; } public int AggregateVersion { get; set; } public abstract AggregateState CreateState(); public IEvent[] GetUncommittedChanges() { lock (_changes) { return _changes.ToArray(); } } public IEvent[] FlushUncommittedChanges() { lock (_changes) { var changes = _changes.ToArray(); var i = 0; foreach (var change in changes) { if (change.AggregateIdentifier == Guid.Empty && AggregateIdentifier == Guid.Empty) throw new MissingAggregateIdentifierException(GetType(), change.GetType()); if (change.AggregateIdentifier == Guid.Empty) change.AggregateIdentifier = AggregateIdentifier; i++; change.AggregateVersion = AggregateVersion + i; change.EventTime = DateTimeOffset.UtcNow; } AggregateVersion = AggregateVersion + changes.Length; _changes.Clear(); return changes; } } public void Rehydrate(IEnumerable<IEvent> history) { lock (_changes) { foreach (var change in history.ToArray()) { if (change.AggregateVersion != AggregateVersion + 1) throw new UnorderedEventsException(change.AggregateIdentifier); ApplyEvent(change); AggregateIdentifier = change.AggregateIdentifier; AggregateVersion++; } } } protected void Apply(IEvent change) { lock (_changes) { ApplyEvent(change); _changes.Add(change); } } protected virtual void ApplyEvent(IEvent change) { if (State == null) State = CreateState(); State.Apply(change); } } }
27
102
0.505902
[ "MIT" ]
andrewbroekman/Tempus
src/Tempus/Aggregates/AggregateRoot.cs
2,459
C#
using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Tests { [TestClass] public class ATests { [TestMethod] public void TestMethod1() { var input = @"2 3 4"; var output = @"52"; Tester.InOutTest(() => Tasks.A.Solve(), input, output); } [TestMethod] public void TestMethod2() { var input = @"3 4 2"; var output = @"52"; Tester.InOutTest(() => Tasks.A.Solve(), input, output); } [TestMethod] public void TestMethod3() { var input = @"100 100 100"; var output = @"60000"; Tester.InOutTest(() => Tasks.A.Solve(), input, output); } [TestMethod] public void TestMethod4() { var input = @"1 1 1"; var output = @"6"; Tester.InOutTest(() => Tasks.A.Solve(), input, output); } } }
23.707317
67
0.467078
[ "CC0-1.0" ]
AconCavy/AtCoder.Tasks.CS
ABC/ABC039/Tests/ATests.cs
972
C#
using System; using System.Collections.Generic; namespace BitFab.KW1281Test.Blocks { class NakBlock : Block { public NakBlock(List<byte> bytes) : base(bytes) { Dump(); } private void Dump() { Logger.WriteLine("Received NAK block"); } } }
17.105263
55
0.538462
[ "MIT" ]
IJskonijn/kw1281test
Blocks/NakBlock.cs
327
C#
using System; using System.Diagnostics; using System.IO; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Threading; namespace Neat_Note { public partial class DF : Window { MainWindow mainWindow = ((MainWindow)Application.Current.MainWindow); public RichTextBox rtb; bool isMaximized = false; //creating diferent timers DispatcherTimer dispatcherTimer = new DispatcherTimer(); DispatcherTimer saveTimer = new DispatcherTimer(); //fields to store current window position private double RestoredHeight; private double RestoredWidth; private double RestoredLeft; private double RestoredTop; public DF(RichTextBox rtb) { InitializeComponent(); this.rtb = rtb; Grid.SetColumn(rtb, 1); Grid.SetRow(rtb, 2); dfGrid.Children.Add(rtb); //creating different timers dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Interval = new TimeSpan(0, 0, 2); saveTimer.Tick += SaveTimer_Tick; saveTimer.Interval = new TimeSpan(0, 0, 3); saveTimer.Start(); } private void dispatcherTimer_Tick(object sender, EventArgs e) { btnMaximize.Visibility = Visibility.Hidden; btnMinimize.Visibility = Visibility.Hidden; dispatcherTimer.Stop(); } private void SaveTimer_Tick(object sender, EventArgs e) { //Don't save anything if this window is not active if (!this.IsActive) { return; } CommonWindowHelper.DisplayMessage("", lblSave); //saving contents in active rich text box if (rtb != null) { int difference = rtb.Document.ContentStart.GetOffsetToPosition(rtb.Document.ContentEnd); //adding a character make difference 5 or more if (difference >= 5) { CommonWindowHelper.DisplayMessage("Saved", lblSave); TextRange range = new TextRange(rtb.Document.ContentStart, rtb.Document.ContentEnd); try { //saving as different file types if (((string)rtb.Tag).EndsWith(".rtf", StringComparison.InvariantCultureIgnoreCase)) { rtb.Foreground = Brushes.Black; using (FileStream file = new FileStream((string)rtb.Tag, FileMode.OpenOrCreate, FileAccess.Write)) { range.Save(file, DataFormats.Rtf); } rtb.Foreground = Brushes.White; } else { File.WriteAllText((string)rtb.Tag, range.Text); } } catch (Exception ex) { rtb.Foreground = Brushes.White; CommonWindowHelper.DisplayException("Error saving.\r\nHover over me to learn more.", lblSave, ex); } //updating count of words and lines CommonWindowHelper.DisplayUpdatedWordAndLineCount(range, lblCount); } } } private void resizeHandle_MouseMove(object sender, MouseEventArgs e) { if (e.LeftButton == MouseButtonState.Pressed) { this.Height = e.GetPosition(this).Y; this.Width = e.GetPosition(this).X + 20; isMaximized = false; CommonWindowHelper.SetRestoredBackground(maxBorder); } e.Handled = true; } private void resizeHandle_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { ((UIElement)e.Source).ReleaseMouseCapture(); } private void resizeHandle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { ((UIElement)e.Source).CaptureMouse(); } private void Border_MouseEnter(object sender, MouseEventArgs e) { //showing window bar buttons btnMaximize.Visibility = Visibility.Visible; btnMinimize.Visibility = Visibility.Visible; dispatcherTimer.Stop(); } private void Border_MouseLeave(object sender, MouseEventArgs e) { dispatcherTimer.Start(); } private void btnMinimize_Click(object sender, RoutedEventArgs e) { this.WindowState = WindowState.Minimized; } private void btnMaximize_Click(object sender, RoutedEventArgs e) { if (isMaximized) { Height = RestoredHeight; Width = RestoredWidth; Left = RestoredLeft; Top = RestoredTop; isMaximized = false; CommonWindowHelper.SetRestoredBackground(maxBorder); } else { WindowStartupLocation = WindowStartupLocation.Manual; RestoredHeight = Height; RestoredWidth = Width; RestoredLeft = Left; RestoredTop = Top; Height = SystemParameters.WorkArea.Height; Width = SystemParameters.WorkArea.Width; Left = (SystemParameters.WorkArea.Location.X); Top = (SystemParameters.WorkArea.Location.Y); isMaximized = true; CommonWindowHelper.SetMaximizedBackground(maxBorder); } } private void btnReattach_Click(object sender, RoutedEventArgs e) { SaveTimer_Tick(sender, e); dfGrid.Children.Remove(rtb); mainWindow.AttachRichTextBox(rtb); Hide(); mainWindow.DisconnectDF(); } private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (!resizeHandle.IsMouseOver) { DragMove(); } } private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { e.Cancel = true; } } }
32.091787
126
0.54072
[ "MIT" ]
farhin00farhin/NeatNote
Neat Note/DF.xaml.cs
6,645
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Mvc.DataAnnotations; using Microsoft.Extensions.Localization; namespace Mvc.LocalizationSample.Web { public class CustomValidationAttributeAdapterProvider : ValidationAttributeAdapterProvider, IValidationAttributeAdapterProvider { public CustomValidationAttributeAdapterProvider() { } IAttributeAdapter IValidationAttributeAdapterProvider.GetAttributeAdapter( ValidationAttribute attribute, IStringLocalizer stringLocalizer) { var adapter = base.GetAttributeAdapter(attribute, stringLocalizer); if (adapter == null) { var minLengthSix = attribute as MinLengthSixAttribute; if (minLengthSix != null) { adapter = new MinLengthSixAttributeAdapter(minLengthSix, stringLocalizer); } } return adapter; } } }
33.771429
111
0.666667
[ "Apache-2.0" ]
GhalamborM/Entropy
samples/Mvc.LocalizationSample.Web/CustomValidationAttributeAdapterProvider.cs
1,184
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.DotNet.UpgradeAssistant.Dependencies; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace Microsoft.DotNet.UpgradeAssistant.Steps.Packages.Analyzers { public class UpgradeAssistantReferenceAnalyzer : IDependencyAnalyzer { private const string AnalyzerPackageName = "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers"; private readonly IPackageLoader _packageLoader; private readonly ILogger<UpgradeAssistantReferenceAnalyzer> _logger; public string Name => "Upgrade assistant reference analyzer"; public UpgradeAssistantReferenceAnalyzer(IOptions<PackageUpdaterOptions> updaterOptions, IPackageLoader packageLoader, ILogger<UpgradeAssistantReferenceAnalyzer> logger) { if (updaterOptions is null) { throw new ArgumentNullException(nameof(updaterOptions)); } _packageLoader = packageLoader ?? throw new ArgumentNullException(nameof(packageLoader)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } public async Task AnalyzeAsync(IProject project, IDependencyAnalysisState state, CancellationToken token) { if (project is null) { throw new ArgumentNullException(nameof(project)); } if (state is null) { throw new ArgumentNullException(nameof(state)); } // If the project doesn't include a reference to the analyzer package, mark it for addition if (!state.Packages.Any(r => AnalyzerPackageName.Equals(r.Name, StringComparison.OrdinalIgnoreCase))) { var analyzerPackage = await _packageLoader.GetLatestVersionAsync(AnalyzerPackageName, project.TargetFrameworks, true, token).ConfigureAwait(false); if (analyzerPackage is not null) { _logger.LogInformation("Reference to .NET Upgrade Assistant analyzer package ({AnalyzerPackageName}, version {AnalyzerPackageVersion}) needs added", AnalyzerPackageName, analyzerPackage.Version); state.Packages.Add(analyzerPackage with { PrivateAssets = "all" }); } else { _logger.LogWarning(".NET Upgrade Assistant analyzer NuGet package reference cannot be added because the package cannot be found"); } } else { _logger.LogDebug("Reference to .NET Upgrade Assistant analyzer package ({AnalyzerPackageName}) already exists", AnalyzerPackageName); } } } }
43.338235
215
0.667798
[ "MIT" ]
johanbenschop/upgrade-assistant
src/steps/Microsoft.DotNet.UpgradeAssistant.Steps.Packages/Analyzers/UpgradeAssistantReferenceAnalyzer.cs
2,949
C#
using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("AWSSDK.CloudHSM")] [assembly: AssemblyDescription("The Amazon Web Services SDK for .NET (3.5) - Amazon CloudHSM. The AWS CloudHSM service helps you meet corporate, contractual and regulatory compliance requirements for data security by using dedicated Hardware Security Module (HSM) appliances within the AWS cloud. With CloudHSM, you control the encryption keys and cryptographic operations performed by the HSM.")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyProduct("Amazon Web Services SDK for .NET")] [assembly: AssemblyCompany("Amazon.com, Inc")] [assembly: AssemblyCopyright("Copyright 2009-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] // Version information for an assembly consists of the following four values: // // Major Version // Minor Version // Build Number // Revision // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("3.3")] [assembly: AssemblyFileVersion("3.3.0.33")]
52.15625
397
0.761534
[ "Apache-2.0" ]
phillip-haydon/aws-sdk-net
sdk/code-analysis/ServiceAnalysis/CloudHSM/Properties/AssemblyInfo.cs
1,669
C#
using System; namespace SsitEngine.Unity.WebRequest { /// <summary> /// Web 请求管理器接口。 /// </summary> public interface IWebRequestManager { /// <summary> /// 获取 Web 请求代理总数量。 /// </summary> int TotalAgentCount { get; } /// <summary> /// 获取可用 Web 请求代理数量。 /// </summary> int FreeAgentCount { get; } /// <summary> /// 获取工作中 Web 请求代理数量。 /// </summary> int WorkingAgentCount { get; } /// <summary> /// 获取等待 Web 请求数量。 /// </summary> int WaitingTaskCount { get; } /// <summary> /// 获取或设置 Web 请求超时时长,以秒为单位。 /// </summary> float Timeout { get; set; } /// <summary> /// Web 请求开始事件。 /// </summary> event EventHandler<WebRequestStartEventArgs> WebRequestStart; /// <summary> /// Web 请求成功事件。 /// </summary> event EventHandler<WebRequestSuccessEventArgs> WebRequestSuccess; /// <summary> /// Web 请求失败事件。 /// </summary> event EventHandler<WebRequestFailureEventArgs> WebRequestFailure; /// <summary> /// 增加 Web 请求代理辅助器。 /// </summary> void AddWebRequestAgent(); /// <summary> /// 增加 Web 请求任务。 /// </summary> /// <param name="webRequestUri">Web 请求地址。</param> /// <param name="postData">要发送的数据流。</param> /// <returns>新增 Web 请求任务的序列编号。</returns> ulong AddWebRequest( string webRequestUri, byte[] postData ); /// <summary> /// 增加 Web 请求任务。 /// </summary> /// <param name="webRequestUri">Web 请求地址。</param> /// <param name="priority">Web 请求任务的优先级。</param> /// <returns>新增 Web 请求任务的序列编号。</returns> ulong AddWebRequest( string webRequestUri, int priority ); /// <summary> /// 增加 Web 请求任务。 /// </summary> /// <param name="webRequestUri">Web 请求地址。</param> /// <param name="userData">用户自定义数据。</param> /// <returns>新增 Web 请求任务的序列编号。</returns> ulong AddWebRequest( string webRequestUri, IWebRequestInfo userData ); /// <summary> /// 增加 Web 请求任务。 /// </summary> /// <param name="webRequestUri">Web 请求地址。</param> /// <param name="postData">要发送的数据流。</param> /// <param name="priority">Web 请求任务的优先级。</param> /// <returns>新增 Web 请求任务的序列编号。</returns> ulong AddWebRequest( string webRequestUri, byte[] postData, int priority ); /// <summary> /// 增加 Web 请求任务。 /// </summary> /// <param name="webRequestUri">Web 请求地址。</param> /// <param name="postData">要发送的数据流。</param> /// <param name="userData">用户自定义数据。</param> /// <returns>新增 Web 请求任务的序列编号。</returns> ulong AddWebRequest( string webRequestUri, byte[] postData, IWebRequestInfo userData ); /// <summary> /// 增加 Web 请求任务。 /// </summary> /// <param name="webRequestUri">Web 请求地址。</param> /// <param name="priority">Web 请求任务的优先级。</param> /// <param name="userData">用户自定义数据。</param> /// <returns>新增 Web 请求任务的序列编号。</returns> ulong AddWebRequest( string webRequestUri, int priority, IWebRequestInfo userData ); /// <summary> /// 增加 Web 请求任务。 /// </summary> /// <param name="webRequestUri">Web 请求地址。</param> /// <param name="postData">要发送的数据流。</param> /// <param name="priority">Web 请求任务的优先级。</param> /// <param name="userData">用户自定义数据。</param> /// <returns>新增 Web 请求任务的序列编号。</returns> ulong AddWebRequest( string webRequestUri, byte[] postData, int priority, IWebRequestInfo userData ); /// <summary> /// 移除 Web 请求任务。 /// </summary> /// <param name="serialId">要移除 Web 请求任务的序列编号。</param> /// <returns>是否移除 Web 请求任务成功。</returns> bool RemoveWebRequest( ulong serialId ); /// <summary> /// 移除所有 Web 请求任务。 /// </summary> void RemoveAllWebRequests(); } }
32.364341
109
0.529102
[ "BSD-2-Clause" ]
jojo-WJ/SsitEngine
Assets/SsitFramework/SsitEngine.Unity/Manager/WebRequestManager/Interface/IWebRequestManager.cs
4,991
C#
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ using System.Collections.Generic; using Aliyun.Acs.Core; using Aliyun.Acs.Core.Http; using Aliyun.Acs.Core.Transform; using Aliyun.Acs.Core.Utils; using Aliyun.Acs.Slb.Transform; using Aliyun.Acs.Slb.Transform.V20140515; namespace Aliyun.Acs.Slb.Model.V20140515 { public class ModifyVServerGroupBackendServersRequest : RpcAcsRequest<ModifyVServerGroupBackendServersResponse> { public ModifyVServerGroupBackendServersRequest() : base("Slb", "2014-05-15", "ModifyVServerGroupBackendServers", "slb", "openAPI") { if (this.GetType().GetProperty("ProductEndpointMap") != null && this.GetType().GetProperty("ProductEndpointType") != null) { this.GetType().GetProperty("ProductEndpointMap").SetValue(this, Endpoint.endpointMap, null); this.GetType().GetProperty("ProductEndpointType").SetValue(this, Endpoint.endpointRegionalType, null); } } private long? resourceOwnerId; private string vServerGroupId; private string resourceOwnerAccount; private string newBackendServers; private string ownerAccount; private long? ownerId; private string oldBackendServers; public long? ResourceOwnerId { get { return resourceOwnerId; } set { resourceOwnerId = value; DictionaryUtil.Add(QueryParameters, "ResourceOwnerId", value.ToString()); } } public string VServerGroupId { get { return vServerGroupId; } set { vServerGroupId = value; DictionaryUtil.Add(QueryParameters, "VServerGroupId", value); } } public string ResourceOwnerAccount { get { return resourceOwnerAccount; } set { resourceOwnerAccount = value; DictionaryUtil.Add(QueryParameters, "ResourceOwnerAccount", value); } } public string NewBackendServers { get { return newBackendServers; } set { newBackendServers = value; DictionaryUtil.Add(QueryParameters, "NewBackendServers", value); } } public string OwnerAccount { get { return ownerAccount; } set { ownerAccount = value; DictionaryUtil.Add(QueryParameters, "OwnerAccount", value); } } public long? OwnerId { get { return ownerId; } set { ownerId = value; DictionaryUtil.Add(QueryParameters, "OwnerId", value.ToString()); } } public string OldBackendServers { get { return oldBackendServers; } set { oldBackendServers = value; DictionaryUtil.Add(QueryParameters, "OldBackendServers", value); } } public override ModifyVServerGroupBackendServersResponse GetResponse(UnmarshallerContext unmarshallerContext) { return ModifyVServerGroupBackendServersResponseUnmarshaller.Unmarshall(unmarshallerContext); } } }
24.601307
134
0.674548
[ "Apache-2.0" ]
bbs168/aliyun-openapi-net-sdk
aliyun-net-sdk-slb/Slb/Model/V20140515/ModifyVServerGroupBackendServersRequest.cs
3,764
C#
namespace Moviq.Domain.Auth.Tests { using Couchbase; using Enyim.Caching.Memcached; using Enyim.Caching.Memcached.Results; using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; using Moviq.Interfaces.Factories; using Moviq.Interfaces.Models; using Moviq.Interfaces.Repositories; using Moviq.Locale; using Newtonsoft.Json; using Ploeh.AutoFixture; using Ploeh.AutoFixture.AutoMoq; using System.Collections.Generic; [TestClass] public class UserRepositoryFixture { public UserRepositoryFixture() { // Fixture setup var fixture = new Fixture() .Customize(new AutoMoqCustomization()); mockUser = fixture.Freeze<User>(); mockUsers = fixture.Freeze<IEnumerable<User>>(); string mockProductString = JsonConvert.SerializeObject(mockUser); ICouchbaseClient db = MakeMockCbClient(mockProductString); IFactory<IUser> userFactory = new UserFactory(); ILocale locale = fixture.Freeze<DefaultLocale>(); //ICouchbaseClient db, IFactory<IUser> userFactory, ILocale locale userRepo = new UserRepository(db, userFactory, locale, "http://localhost:9200/unittests/_search"); } IRepository<IUser> userRepo; IUser mockUser; IEnumerable<IUser> mockUsers; private ICouchbaseClient MakeMockCbClient(string mockProductString) //, IDictionary<string, object> mockFindResultSet) { var service = new Mock<ICouchbaseClient>(); service.Setup(cli => cli.Get<string>(It.IsAny<string>()) ).Returns(mockProductString); service.Setup(cli => cli.ExecuteStore(StoreMode.Set, It.IsAny<string>(), It.IsAny<object>()) ).Returns(new StoreOperationResult { Success = true }); //service.Setup(cli => // cli.Get(It.IsAny<IEnumerable<string>>()) //).Returns(mockFindResultSet); return service.Object; } [TestMethod] [TestCategory("UserRepository, when Get is called with a valid Guid, it")] public void should_return_a_user_with_the_given_guid() { // given var expected = userRepo.Set(mockUser); // when var actual = userRepo.Get(expected.Guid.ToString()); // then actual.Guid.ShouldBeEquivalentTo(expected.Guid); actual.Email.ShouldBeEquivalentTo(expected.Email); actual.Name.ShouldBeEquivalentTo(expected.Name); } [TestMethod] [TestCategory("UserRepository, when Set is executed with valid data, it")] public void should_return_the_user_that_was_created() { // given var expected = mockUser; // when var actual = userRepo.Set(expected); // then actual.Guid.ShouldBeEquivalentTo(expected.Guid); actual.Email.ShouldBeEquivalentTo(expected.Email); actual.Name.ShouldBeEquivalentTo(expected.Name); } } }
33.142857
127
0.609298
[ "MIT" ]
pomonav/Heinz95729
dotnet/Moviq.Domain.Auth.Tests/UserRepositoryFixture.cs
3,250
C#
using System; using Xamarin.Forms; using System.Collections.Generic; namespace GlowingBrain.DataCapture.Views { public class SimpleListView : StackLayout { public static readonly BindableProperty ItemsProperty = BindableProperty.Create<SimpleListView, IList<View>> ( p => p.Items, new List<View> (), BindingMode.OneWay, propertyChanged: OnItemsChanged); public IList<View> Items { get { return (IList<View>)GetValue (ItemsProperty); } set { SetValue (ItemsProperty, value); } } protected virtual void OnItemsChanged (IList<View> oldValue, IList<View> newValue) { Children.Clear (); if (newValue == null) { return; } for (var i = 0; i < newValue.Count; i++) { var isLastItem = (i == newValue.Count - 1); Children.Add (newValue [i]); if (!isLastItem) { var separator = OnCreateSeperatorView (); if (separator != null) { Children.Add (separator); } } } } protected virtual View OnCreateSeperatorView () { return null; } static void OnItemsChanged (BindableObject bindable, IList<View> oldValue, IList<View> newValue) { ((SimpleListView)bindable).OnItemsChanged (oldValue, newValue); } } }
23.115385
112
0.674709
[ "MIT" ]
davidjcaton/glowingbrain-data-capture
src/GlowingBrain.DataCapture/Views/SimpleListView.cs
1,202
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.DataLake.Analytics.Models { using Microsoft.Azure; using Microsoft.Azure.Management; using Microsoft.Azure.Management.DataLake; using Microsoft.Azure.Management.DataLake.Analytics; using Newtonsoft.Json; using System.Linq; /// <summary> /// The Data Lake Analytics job error details. /// </summary> public partial class JobInnerError { /// <summary> /// Initializes a new instance of the JobInnerError class. /// </summary> public JobInnerError() { CustomInit(); } /// <summary> /// Initializes a new instance of the JobInnerError class. /// </summary> /// <param name="diagnosticCode">the diagnostic error code.</param> /// <param name="severity">the severity level of the failure. Possible /// values include: 'Warning', 'Error', 'Info', 'SevereWarning', /// 'Deprecated', 'UserWarning'</param> /// <param name="details">the details of the error message.</param> /// <param name="component">the component that failed.</param> /// <param name="errorId">the specific identifier for the type of error /// encountered in the job.</param> /// <param name="helpLink">the link to MSDN or Azure help for this type /// of error, if any.</param> /// <param name="internalDiagnostics">the internal diagnostic stack /// trace if the user requesting the job error details has sufficient /// permissions it will be retrieved, otherwise it will be /// empty.</param> /// <param name="message">the user friendly error message for the /// failure.</param> /// <param name="resolution">the recommended resolution for the /// failure, if any.</param> /// <param name="source">the ultimate source of the failure (usually /// either SYSTEM or USER).</param> /// <param name="description">the error message description</param> /// <param name="innerError">the inner error of this specific job error /// message, if any.</param> public JobInnerError(int? diagnosticCode = default(int?), SeverityTypes? severity = default(SeverityTypes?), string details = default(string), string component = default(string), string errorId = default(string), string helpLink = default(string), string internalDiagnostics = default(string), string message = default(string), string resolution = default(string), string source = default(string), string description = default(string), JobInnerError innerError = default(JobInnerError)) { DiagnosticCode = diagnosticCode; Severity = severity; Details = details; Component = component; ErrorId = errorId; HelpLink = helpLink; InternalDiagnostics = internalDiagnostics; Message = message; Resolution = resolution; Source = source; Description = description; InnerError = innerError; CustomInit(); } /// <summary> /// An initialization method that performs custom operations like setting defaults /// </summary> partial void CustomInit(); /// <summary> /// Gets the diagnostic error code. /// </summary> [JsonProperty(PropertyName = "diagnosticCode")] public int? DiagnosticCode { get; private set; } /// <summary> /// Gets the severity level of the failure. Possible values include: /// 'Warning', 'Error', 'Info', 'SevereWarning', 'Deprecated', /// 'UserWarning' /// </summary> [JsonProperty(PropertyName = "severity")] public SeverityTypes? Severity { get; private set; } /// <summary> /// Gets the details of the error message. /// </summary> [JsonProperty(PropertyName = "details")] public string Details { get; private set; } /// <summary> /// Gets the component that failed. /// </summary> [JsonProperty(PropertyName = "component")] public string Component { get; private set; } /// <summary> /// Gets the specific identifier for the type of error encountered in /// the job. /// </summary> [JsonProperty(PropertyName = "errorId")] public string ErrorId { get; private set; } /// <summary> /// Gets the link to MSDN or Azure help for this type of error, if any. /// </summary> [JsonProperty(PropertyName = "helpLink")] public string HelpLink { get; private set; } /// <summary> /// Gets the internal diagnostic stack trace if the user requesting the /// job error details has sufficient permissions it will be retrieved, /// otherwise it will be empty. /// </summary> [JsonProperty(PropertyName = "internalDiagnostics")] public string InternalDiagnostics { get; private set; } /// <summary> /// Gets the user friendly error message for the failure. /// </summary> [JsonProperty(PropertyName = "message")] public string Message { get; private set; } /// <summary> /// Gets the recommended resolution for the failure, if any. /// </summary> [JsonProperty(PropertyName = "resolution")] public string Resolution { get; private set; } /// <summary> /// Gets the ultimate source of the failure (usually either SYSTEM or /// USER). /// </summary> [JsonProperty(PropertyName = "source")] public string Source { get; private set; } /// <summary> /// Gets the error message description /// </summary> [JsonProperty(PropertyName = "description")] public string Description { get; private set; } /// <summary> /// Gets the inner error of this specific job error message, if any. /// </summary> [JsonProperty(PropertyName = "innerError")] public JobInnerError InnerError { get; private set; } } }
40.974843
494
0.610284
[ "MIT" ]
AzureAutomationTeam/azure-sdk-for-net
src/SDKs/DataLake.Analytics/Management.DataLake.Analytics/Generated/Models/JobInnerError.cs
6,515
C#
//创建者:Icarus //手动滑稽,滑稽脸 //ヾ(•ω•`)o //https://www.ykls.app //2019年06月14日-02:55 //Assembly-CSharp using System; using Shader.MessageObjects; using UnityEngine; namespace Chat.Component { public partial class ChatComponent { public static event Action<SendMesgResponses> SendMessageEve; } }
17.166667
69
0.718447
[ "MIT" ]
yika-aixi/MagicOnionDemo
Assets/Scripts/Chat/Component/ChatEvents.cs
342
C#
/* * OANDA v20 REST API * * The full OANDA v20 REST API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more. * * OpenAPI spec version: 3.0.15 * Contact: api@oanda.com * Generated by: https://github.com/swagger-api/swagger-codegen.git */ using System; using System.Linq; using System.IO; using System.Text; using System.Text.RegularExpressions; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Runtime.Serialization; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using System.ComponentModel.DataAnnotations; namespace Oanda.RestV20.Model { /// <summary> /// The dynamic (calculated) state of an open Trade /// </summary> [DataContract] public partial class CalculatedTradeState : IEquatable<CalculatedTradeState>, IValidatableObject { /// <summary> /// Initializes a new instance of the <see cref="CalculatedTradeState" /> class. /// </summary> /// <param name="Id">The Trade&#39;s ID..</param> /// <param name="UnrealizedPL">The Trade&#39;s unrealized profit/loss..</param> public CalculatedTradeState(string Id = default(string), string UnrealizedPL = default(string)) { this.Id = Id; this.UnrealizedPL = UnrealizedPL; } /// <summary> /// The Trade&#39;s ID. /// </summary> /// <value>The Trade&#39;s ID.</value> [DataMember(Name="id", EmitDefaultValue=false)] public string Id { get; set; } /// <summary> /// The Trade&#39;s unrealized profit/loss. /// </summary> /// <value>The Trade&#39;s unrealized profit/loss.</value> [DataMember(Name="unrealizedPL", EmitDefaultValue=false)] public string UnrealizedPL { get; set; } /// <summary> /// Returns the string presentation of the object /// </summary> /// <returns>String presentation of the object</returns> public override string ToString() { var sb = new StringBuilder(); sb.Append("class CalculatedTradeState {\n"); sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" UnrealizedPL: ").Append(UnrealizedPL).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// <summary> /// Returns the JSON string presentation of the object /// </summary> /// <returns>JSON string presentation of the object</returns> public string ToJson() { return JsonConvert.SerializeObject(this, Formatting.Indented); } /// <summary> /// Returns true if objects are equal /// </summary> /// <param name="obj">Object to be compared</param> /// <returns>Boolean</returns> public override bool Equals(object obj) { // credit: http://stackoverflow.com/a/10454552/677735 return this.Equals(obj as CalculatedTradeState); } /// <summary> /// Returns true if CalculatedTradeState instances are equal /// </summary> /// <param name="other">Instance of CalculatedTradeState to be compared</param> /// <returns>Boolean</returns> public bool Equals(CalculatedTradeState other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) return false; return ( this.Id == other.Id || this.Id != null && this.Id.Equals(other.Id) ) && ( this.UnrealizedPL == other.UnrealizedPL || this.UnrealizedPL != null && this.UnrealizedPL.Equals(other.UnrealizedPL) ); } /// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks etc, of course :) if (this.Id != null) hash = hash * 59 + this.Id.GetHashCode(); if (this.UnrealizedPL != null) hash = hash * 59 + this.UnrealizedPL.GetHashCode(); return hash; } } /// <summary> /// To validate all properties of the instance /// </summary> /// <param name="validationContext">Validation context</param> /// <returns>Validation Result</returns> IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } }
34.9375
141
0.564699
[ "Apache-2.0" ]
3ai-co/Lean
Brokerages/Oanda/RestV20/Model/CalculatedTradeState.cs
5,031
C#
/* * Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the quicksight-2018-04-01.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.QuickSight.Model { /// <summary> /// Container for the parameters to the UpdateDataSet operation. /// Updates a dataset. /// </summary> public partial class UpdateDataSetRequest : AmazonQuickSightRequest { private string _awsAccountId; private List<ColumnGroup> _columnGroups = new List<ColumnGroup>(); private string _dataSetId; private DataSetImportMode _importMode; private Dictionary<string, LogicalTable> _logicalTableMap = new Dictionary<string, LogicalTable>(); private string _name; private Dictionary<string, PhysicalTable> _physicalTableMap = new Dictionary<string, PhysicalTable>(); private RowLevelPermissionDataSet _rowLevelPermissionDataSet; /// <summary> /// Gets and sets the property AwsAccountId. /// <para> /// The AWS account ID. /// </para> /// </summary> [AWSProperty(Required=true, Min=12, Max=12)] public string AwsAccountId { get { return this._awsAccountId; } set { this._awsAccountId = value; } } // Check to see if AwsAccountId property is set internal bool IsSetAwsAccountId() { return this._awsAccountId != null; } /// <summary> /// Gets and sets the property ColumnGroups. /// <para> /// Groupings of columns that work together in certain QuickSight features. Currently, /// only geospatial hierarchy is supported. /// </para> /// </summary> [AWSProperty(Min=1, Max=8)] public List<ColumnGroup> ColumnGroups { get { return this._columnGroups; } set { this._columnGroups = value; } } // Check to see if ColumnGroups property is set internal bool IsSetColumnGroups() { return this._columnGroups != null && this._columnGroups.Count > 0; } /// <summary> /// Gets and sets the property DataSetId. /// <para> /// The ID for the dataset that you want to update. This ID is unique per AWS Region for /// each AWS account. /// </para> /// </summary> [AWSProperty(Required=true)] public string DataSetId { get { return this._dataSetId; } set { this._dataSetId = value; } } // Check to see if DataSetId property is set internal bool IsSetDataSetId() { return this._dataSetId != null; } /// <summary> /// Gets and sets the property ImportMode. /// <para> /// Indicates whether you want to import the data into SPICE. /// </para> /// </summary> [AWSProperty(Required=true)] public DataSetImportMode ImportMode { get { return this._importMode; } set { this._importMode = value; } } // Check to see if ImportMode property is set internal bool IsSetImportMode() { return this._importMode != null; } /// <summary> /// Gets and sets the property LogicalTableMap. /// <para> /// Configures the combination and transformation of the data from the physical tables. /// </para> /// </summary> [AWSProperty(Min=1, Max=32)] public Dictionary<string, LogicalTable> LogicalTableMap { get { return this._logicalTableMap; } set { this._logicalTableMap = value; } } // Check to see if LogicalTableMap property is set internal bool IsSetLogicalTableMap() { return this._logicalTableMap != null && this._logicalTableMap.Count > 0; } /// <summary> /// Gets and sets the property Name. /// <para> /// The display name for the dataset. /// </para> /// </summary> [AWSProperty(Required=true, Min=1, Max=128)] public string Name { get { return this._name; } set { this._name = value; } } // Check to see if Name property is set internal bool IsSetName() { return this._name != null; } /// <summary> /// Gets and sets the property PhysicalTableMap. /// <para> /// Declares the physical tables that are available in the underlying data sources. /// </para> /// </summary> [AWSProperty(Required=true, Min=1, Max=16)] public Dictionary<string, PhysicalTable> PhysicalTableMap { get { return this._physicalTableMap; } set { this._physicalTableMap = value; } } // Check to see if PhysicalTableMap property is set internal bool IsSetPhysicalTableMap() { return this._physicalTableMap != null && this._physicalTableMap.Count > 0; } /// <summary> /// Gets and sets the property RowLevelPermissionDataSet. /// <para> /// The row-level security configuration for the data you want to create. /// </para> /// </summary> public RowLevelPermissionDataSet RowLevelPermissionDataSet { get { return this._rowLevelPermissionDataSet; } set { this._rowLevelPermissionDataSet = value; } } // Check to see if RowLevelPermissionDataSet property is set internal bool IsSetRowLevelPermissionDataSet() { return this._rowLevelPermissionDataSet != null; } } }
32.745
110
0.591083
[ "Apache-2.0" ]
DetlefGolze/aws-sdk-net
sdk/src/Services/QuickSight/Generated/Model/UpdateDataSetRequest.cs
6,549
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. using System; using System.Collections.Generic; using System.Diagnostics; using System.Text.Json; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Azure.WebPubSub.Common; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace Microsoft.Azure.WebPubSub.AspNetCore { internal class ServiceRequestHandlerAdapter { private readonly WebPubSubOptions _options; private readonly IServiceProvider _provider; private readonly ILogger _logger; // <hubName, HubImpl> private readonly Dictionary<string, WebPubSubHub> _hubRegistry = new(StringComparer.OrdinalIgnoreCase); public ServiceRequestHandlerAdapter(IServiceProvider provider, IOptions<WebPubSubOptions> options, ILogger<ServiceRequestHandlerAdapter> logger) { _provider = provider ?? throw new ArgumentNullException(nameof(provider)); _options = options.Value; _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } public void RegisterHub<THub>() where THub : WebPubSubHub { var hub = Create<THub>(); _hubRegistry[hub.GetType().Name] = hub; } public WebPubSubHub GetHub(string hubName) { if (_hubRegistry.TryGetValue(hubName, out var hub)) { return hub; } return null; } public async Task HandleRequest(HttpContext context) { HttpRequest request = context.Request; if (context == null) { throw new ArgumentNullException(nameof(context)); } // Should check in middleware to skip not match calls. // And keep here for internal reference lib robustness and return as 400BadRequest. #region WebPubSubRequest Check // Not Web PubSub request. if (!context.Request.Headers.ContainsKey(Constants.Headers.CloudEvents.WebPubSubVersion) || !context.Request.Headers.TryGetValue(Constants.Headers.CloudEvents.Hub, out var hubName)) { throw new ArgumentException("Invalid Web PubSub request."); } // Hub not registered var hub = GetHub(hubName); if (hub == null) { context.Response.StatusCode = StatusCodes.Status400BadRequest; await context.Response.WriteAsync("Hub is not registered.").ConfigureAwait(false); return; } #endregion try { var serviceRequest = await request.ReadWebPubSubEventAsync(_options.ValidationOptions, context.RequestAborted); Log.StartToHandleRequest(_logger, serviceRequest.ConnectionContext); switch (serviceRequest) { // should not hit. case PreflightRequest preflightRequest: { if (preflightRequest.IsValid) { context.Response.Headers.Add(Constants.Headers.WebHookAllowedOrigin, Constants.AllowedAllOrigins); break; } context.Response.StatusCode = StatusCodes.Status400BadRequest; await context.Response.WriteAsync("Abuse Protection validation failed.").ConfigureAwait(false); break; } case ConnectEventRequest connectEventRequest: { var response = await hub.OnConnectAsync(connectEventRequest, context.RequestAborted).ConfigureAwait(false); // default as null is allowed. if (response != null) { SetConnectionState(ref context, connectEventRequest.ConnectionContext, response.States); await context.Response.WriteAsync(JsonSerializer.Serialize(response)).ConfigureAwait(false); } break; } case UserEventRequest messageRequest: { var response = await hub.OnMessageReceivedAsync(messageRequest, context.RequestAborted).ConfigureAwait(false); // default as null is allowed. if (response != null) { SetConnectionState(ref context, messageRequest.ConnectionContext, response.States); } if (response.Data != null) { context.Response.ContentType = ConvertToContentType(response.DataType); var payload = response.Data.ToArray(); await context.Response.Body.WriteAsync(payload, 0, payload.Length).ConfigureAwait(false); } break; } case ConnectedEventRequest connectedEvent: { _ = hub.OnConnectedAsync(connectedEvent).ConfigureAwait(false); break; } case DisconnectedEventRequest disconnectedEvent: { _ = hub.OnDisconnectedAsync(disconnectedEvent).ConfigureAwait(false); break; } default: break; } Log.SucceededToHandleRequest(_logger, serviceRequest.ConnectionContext); } catch (UnauthorizedAccessException ex) { Log.FailedToHandleRequest(_logger, ex.Message, ex); context.Response.StatusCode = StatusCodes.Status401Unauthorized; await context.Response.WriteAsync(ex.Message).ConfigureAwait(false); } catch (Exception ex) { Log.FailedToHandleRequest(_logger, ex.Message, ex); // logging to service. context.Response.StatusCode = StatusCodes.Status500InternalServerError; await context.Response.WriteAsync(ex.Message).ConfigureAwait(false); } } private static void SetConnectionState(ref HttpContext context, WebPubSubConnectionContext connectionContext, Dictionary<string, object> newStates) { var updatedStates = connectionContext.UpdateStates(newStates); if (updatedStates != null) { context.Response.Headers.Add(Constants.Headers.CloudEvents.State, updatedStates.EncodeConnectionStates()); } } private static string ConvertToContentType(WebPubSubDataType dataType) => dataType switch { WebPubSubDataType.Text => $"{Constants.ContentTypes.PlainTextContentType}; {Constants.ContentTypes.CharsetUTF8}", WebPubSubDataType.Json => $"{Constants.ContentTypes.JsonContentType}; {Constants.ContentTypes.CharsetUTF8}", _ => Constants.ContentTypes.BinaryContentType }; private THub Create<THub>() where THub : WebPubSubHub { var hub = _provider.GetService<THub>(); if (hub == null) { hub = ActivatorUtilities.CreateInstance<THub>(_provider); } if (_hubRegistry.TryGetValue(nameof(hub), out _)) { Debug.Assert(true, $"{typeof(THub)} must not be reused."); } return hub; } private static class Log { private static readonly Action<ILogger, string, string, string, Exception> _startToHandleRequest = LoggerMessage.Define<string, string, string>(LogLevel.Debug, new EventId(1, "StartToHandleRequest"), "Start to handle request, connectionId: {connectionId}, eventType: {eventType}, eventName: {eventName}"); private static readonly Action<ILogger, string, string, string, Exception> _succeededToHandleRequest = LoggerMessage.Define<string, string, string>(LogLevel.Debug, new EventId(2, "SucceededToHandleRequest"), "Succeeded to handle request, connectionId: {connectionId}, eventType: {eventType}, eventName: {eventName}"); private static readonly Action<ILogger, string, Exception> _failedToHandleRequest = LoggerMessage.Define<string>(LogLevel.Warning, new EventId(3, "FailedToHandleRequest"), "Handle request failed. {error}"); public static void StartToHandleRequest(ILogger logger, WebPubSubConnectionContext context) { _startToHandleRequest(logger, context?.ConnectionId, context?.EventType.ToString(), context?.EventName, null); } public static void SucceededToHandleRequest(ILogger logger, WebPubSubConnectionContext context) { _succeededToHandleRequest(logger, context?.ConnectionId, context?.EventType.ToString(), context?.EventName, null); } public static void FailedToHandleRequest(ILogger logger, string error, Exception exception) { _failedToHandleRequest(logger, error, exception); } } } }
46.164319
230
0.574291
[ "MIT" ]
daniellezhang/azure-sdk-for-net
sdk/webpubsub/Microsoft.Azure.WebPubSub.AspNetCore/src/Internal/ServiceRequestHandlerAdapter.cs
9,835
C#
using NUnit.Framework; using Problems.Leetcode; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ProblemTest { [TestFixture] public class TwoSumTest { private List<Tuple<int[], int>> _inputData; private Random _rnd = new Random(); [SetUp] public void Init() { _inputData = new List<Tuple<int[], int>>(); int size = 3; for (int p = 0; p < 100; p++) { var arr = new int[size]; for (int i = 0; i < size; i++) { arr[i] = _rnd.Next(-10, 10); } int a, b; do { a = _rnd.Next(0, size-1); b = _rnd.Next(0, size-1); } while (a == b); int sum = arr[a] + arr[b]; _inputData.Add(new Tuple<int[], int>(arr, sum)); } } [Test] public void TestSolution1() { var p = new TwoSum(); for (int i = 0; i < _inputData.Count(); i++) { PrintArray(_inputData[i].Item1); Console.WriteLine("target:{0}", _inputData[i].Item2); var result = p.Solution1(_inputData[i].Item1, _inputData[i].Item2); Console.WriteLine("{0}, {1}", result[0], result[1]); Assert.True(result[0] != -1); Assert.True(result[1] != -1); Assert.True(result[1] != result[0]); Assert.AreEqual(_inputData[i].Item1[result[0]] + _inputData[i].Item1[result[1]], _inputData[i].Item2); } } private void PrintArray(int[] a) { for (int i = 0; i < a.Length; i++) Console.Write("{0} ", a[i]); Console.WriteLine(); } } }
28.26087
118
0.447179
[ "MIT" ]
MaxIakovliev/Problems
ProblemTest/TwoSumTest.cs
1,952
C#
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See LICENSE in the project root for license information. using Microsoft.MixedReality.Toolkit.Input; using Microsoft.MixedReality.Toolkit.Utilities; using System; using System.Collections.Generic; using System.Runtime.CompilerServices; using UnityEngine; using UnityEngine.Events; using UnityEngine.Serialization; using UnityPhysics = UnityEngine.Physics; namespace Microsoft.MixedReality.Toolkit.UI { /// <summary> /// BoundingBox allows to transform objects (rotate and scale) and draws a cube around the object to visualize /// the possibility of user triggered transform manipulation. /// BoundingBox provides scale and rotation handles that can be used for far and near interaction manipulation /// of the object. It further provides a proximity effect for scale and rotation handles that alters scaling and material. /// </summary> [HelpURL("https://microsoft.github.io/MixedRealityToolkit-Unity/Documentation/README_BoundingBox.html")] [AddComponentMenu("Scripts/MRTK/SDK/BoundingBox")] public class BoundingBox : MonoBehaviour, IMixedRealitySourceStateHandler, IMixedRealityFocusChangedHandler, IMixedRealityFocusHandler, IBoundsTargetProvider { #region Enums /// <summary> /// Enum which describes how an object's BoundingBox is to be flattened. /// </summary> public enum FlattenModeType { DoNotFlatten = 0, /// <summary> /// Flatten the X axis /// </summary> FlattenX, /// <summary> /// Flatten the Y axis /// </summary> FlattenY, /// <summary> /// Flatten the Z axis /// </summary> FlattenZ, /// <summary> /// Flatten the smallest relative axis if it falls below threshold /// </summary> FlattenAuto, } /// <summary> /// Enum which describes whether a BoundingBox handle which has been grabbed, is /// a Rotation Handle (sphere) or a Scale Handle( cube) /// </summary> public enum HandleType { None = 0, Rotation, Scale } /// <summary> /// This enum describes which primitive type the wireframe portion of the BoundingBox /// consists of. /// </summary> /// <remarks> /// Wireframe refers to the thin linkage between the handles. When the handles are invisible /// the wireframe looks like an outline box around an object. /// </remarks> public enum WireframeType { Cubic = 0, Cylindrical } /// <summary> /// This enum defines which of the axes a given rotation handle revolves about. /// </summary> private enum CardinalAxisType { X = 0, Y, Z } /// <summary> /// This enum defines what volume type the bound calculation depends on and its priority /// for it. /// </summary> public enum BoundsCalculationMethod { /// <summary> /// Used Renderers for the bounds calculation and Colliders as a fallback /// </summary> RendererOverCollider = 0, /// <summary> /// Used Colliders for the bounds calculation and Renderers as a fallback /// </summary> ColliderOverRenderer, /// <summary> /// Omits Renderers and uses Colliders for the bounds calculation exclusively /// </summary> ColliderOnly, /// <summary> /// Omits Colliders and uses Renderers for the bounds calculation exclusively /// </summary> RendererOnly, } /// <summary> /// This enum defines how the BoundingBox gets activated /// </summary> public enum BoundingBoxActivationType { ActivateOnStart = 0, ActivateByProximity, ActivateByPointer, ActivateByProximityAndPointer, ActivateManually } /// <summary> /// Internal state tracking for proximity of a handle /// </summary> private enum HandleProximityState { FullsizeNoProximity = 0, MediumProximity, CloseProximity } /// <summary> /// This enum defines the type of collider in use when a rotation handle prefab is provided. /// </summary> public enum RotationHandlePrefabCollider { Sphere, Box } /// <summary> /// Container for handle references and states (including scale and rotation type handles) which is used in the handle proximity effect /// </summary> private class Handle { public Transform HandleVisual; public Renderer HandleVisualRenderer; public HandleType Type = HandleType.None; public HandleProximityState ProximityState = HandleProximityState.FullsizeNoProximity; } #endregion Enums #region Serialized Fields and Properties [SerializeField] [Tooltip("The object that the bounding box rig will be modifying.")] private GameObject targetObject; /// <summary> /// The object that the bounding box rig will be modifying. /// </summary> public GameObject Target { get { if (targetObject == null) { targetObject = gameObject; } return targetObject; } set { if (targetObject != value) { targetObject = value; CreateRig(); } } } [Tooltip("For complex objects, automatic bounds calculation may not behave as expected. Use an existing Box Collider (even on a child object) to manually determine bounds of Bounding Box.")] [SerializeField] [FormerlySerializedAs("BoxColliderToUse")] private BoxCollider boundsOverride = null; /// <summary> /// For complex objects, automatic bounds calculation may not behave as expected. Use an existing Box Collider (even on a child object) to manually determine bounds of Bounding Box. /// </summary> public BoxCollider BoundsOverride { get { return boundsOverride; } set { if (boundsOverride != value) { boundsOverride = value; if (boundsOverride == null) { prevBoundsOverride = new Bounds(); } CreateRig(); } } } [SerializeField] [Tooltip("Defines the volume type and the priority for the bounds calculation")] private BoundsCalculationMethod boundsCalculationMethod = BoundsCalculationMethod.RendererOverCollider; /// <summary> /// Defines the volume type and the priority for the bounds calculation /// </summary> public BoundsCalculationMethod CalculationMethod { get { return boundsCalculationMethod; } set { if (boundsCalculationMethod != value) { boundsCalculationMethod = value; CreateRig(); } } } [Header("Behavior")] [SerializeField] [Tooltip("Type of activation method for showing/hiding bounding box handles and controls")] private BoundingBoxActivationType activation = BoundingBoxActivationType.ActivateOnStart; /// <summary> /// Type of activation method for showing/hiding bounding box handles and controls /// </summary> public BoundingBoxActivationType BoundingBoxActivation { get { return activation; } set { if (activation != value) { activation = value; ResetHandleVisibility(); } } } [SerializeField] [Obsolete("Use a MinMaxScaleConstraint script rather than setting minimum on BoundingBox directly", false)] [Tooltip("Minimum scaling allowed relative to the initial size")] private float scaleMinimum = 0.2f; [SerializeField] [Obsolete("Use a MinMaxScaleConstraint script rather than setting maximum on BoundingBox directly")] [Tooltip("Maximum scaling allowed relative to the initial size")] private float scaleMaximum = 2.0f; /// <summary> /// Deprecated: Use <see cref="Microsoft.MixedReality.Toolkit.UI.MinMaxScaleConstraint"/> component instead. /// Public property for the scale minimum, in the target's local scale. /// Set this value with SetScaleLimits. /// </summary> [Obsolete("Use a MinMaxScaleConstraint. ScaleMinimum as it is the authoritative value for min scale")] public float ScaleMinimum { get { if (scaleConstraint != null) { return scaleConstraint.ScaleMinimum; } return 0.0f; } } /// <summary> /// Deprecated: Use <see cref="Microsoft.MixedReality.Toolkit.UI.MinMaxScaleConstraint"/> component instead. /// Public property for the scale maximum, in the target's local scale. /// Set this value with SetScaleLimits. /// </summary> [Obsolete("Use a MinMaxScaleConstraint component instead. ScaleMinimum as it is the authoritative value for max scale")] public float ScaleMaximum { get { if (scaleConstraint != null) { return scaleConstraint.ScaleMaximum; } return 0.0f; } } [Header("Box Display")] [SerializeField] [Tooltip("Flatten bounds in the specified axis or flatten the smallest one if 'auto' is selected")] private FlattenModeType flattenAxis = FlattenModeType.DoNotFlatten; /// <summary> /// Flatten bounds in the specified axis or flatten the smallest one if 'auto' is selected /// </summary> public FlattenModeType FlattenAxis { get { return flattenAxis; } set { if (flattenAxis != value) { flattenAxis = value; CreateRig(); } } } [SerializeField] [Tooltip("When an axis is flattened what value to set that axis's scale to for display.")] private float flattenAxisDisplayScale = 0.0f; /// <summary> /// When an axis is flattened what value to set that axis's scale to for display. /// </summary> public float FlattenAxisDisplayScale { get { return flattenAxisDisplayScale; } set { if (flattenAxisDisplayScale != value) { flattenAxisDisplayScale = value; CreateRig(); } } } [SerializeField] [FormerlySerializedAs("wireframePadding")] [Tooltip("Extra padding added to the actual Target bounds")] private Vector3 boxPadding = Vector3.zero; /// <summary> /// Extra padding added to the actual Target bounds /// </summary> public Vector3 BoxPadding { get { return boxPadding; } set { if (Vector3.Distance(boxPadding, value) > float.Epsilon) { boxPadding = value; CreateRig(); } } } [SerializeField] [Tooltip("Material used to display the bounding box. If set to null no bounding box will be displayed")] private Material boxMaterial = null; /// <summary> /// Material used to display the bounding box. If set to null no bounding box will be displayed /// </summary> public Material BoxMaterial { get { return boxMaterial; } set { if (boxMaterial != value) { boxMaterial = value; CreateRig(); } } } [SerializeField] [Tooltip("Material used to display the bounding box when grabbed. If set to null no change will occur when grabbed.")] private Material boxGrabbedMaterial = null; /// <summary> /// Material used to display the bounding box when grabbed. If set to null no change will occur when grabbed. /// </summary> public Material BoxGrabbedMaterial { get { return boxGrabbedMaterial; } set { if (boxGrabbedMaterial != value) { boxGrabbedMaterial = value; CreateRig(); } } } [SerializeField] [Tooltip("Show a wireframe around the bounding box when checked. Wireframe parameters below have no effect unless this is checked")] private bool showWireframe = true; /// <summary> /// Show a wireframe around the bounding box when checked. Wireframe parameters below have no effect unless this is checked /// </summary> public bool ShowWireFrame { get { return showWireframe; } set { if (showWireframe != value) { showWireframe = value; CreateRig(); } } } [SerializeField] [Tooltip("Shape used for wireframe display")] private WireframeType wireframeShape = WireframeType.Cubic; /// <summary> /// Shape used for wireframe display /// </summary> public WireframeType WireframeShape { get { return wireframeShape; } set { if (wireframeShape != value) { wireframeShape = value; CreateRig(); } } } [SerializeField] [Tooltip("Material used for wireframe display")] private Material wireframeMaterial; /// <summary> /// Material used for wireframe display /// </summary> public Material WireframeMaterial { get { return wireframeMaterial; } set { if (wireframeMaterial != value) { wireframeMaterial = value; CreateRig(); } } } [SerializeField] [FormerlySerializedAs("linkRadius")] [Tooltip("Radius for wireframe edges")] private float wireframeEdgeRadius = 0.001f; /// <summary> /// Radius for wireframe edges /// </summary> public float WireframeEdgeRadius { get { return wireframeEdgeRadius; } set { if (wireframeEdgeRadius != value) { wireframeEdgeRadius = value; CreateRig(); } } } [Header("Handles")] [SerializeField] [Tooltip("Material applied to handles when they are not in a grabbed state")] private Material handleMaterial; /// <summary> /// Material applied to handles when they are not in a grabbed state /// </summary> public Material HandleMaterial { get { return handleMaterial; } set { if (handleMaterial != value) { handleMaterial = value; CreateRig(); } } } [SerializeField] [Tooltip("Material applied to handles while they are a grabbed")] private Material handleGrabbedMaterial; /// <summary> /// Material applied to handles while they are a grabbed /// </summary> public Material HandleGrabbedMaterial { get { return handleGrabbedMaterial; } set { if (handleGrabbedMaterial != value) { handleGrabbedMaterial = value; CreateRig(); } } } [SerializeField] [Tooltip("Prefab used to display scale handles in corners. If not set, boxes will be displayed instead")] GameObject scaleHandlePrefab = null; /// <summary> /// Prefab used to display scale handles in corners. If not set, boxes will be displayed instead /// </summary> public GameObject ScaleHandlePrefab { get { return scaleHandlePrefab; } set { if (scaleHandlePrefab != value) { scaleHandlePrefab = value; CreateRig(); } } } [SerializeField] [Tooltip("Prefab used to display scale handles in corners for 2D slate. If not set, boxes will be displayed instead")] GameObject scaleHandleSlatePrefab = null; /// <summary> /// Prefab used to display scale handles in corners for 2D slate. If not set, boxes will be displayed instead /// </summary> public GameObject ScaleHandleSlatePrefab { get { return scaleHandleSlatePrefab; } set { if (scaleHandleSlatePrefab != value) { scaleHandleSlatePrefab = value; CreateRig(); } } } [SerializeField] [FormerlySerializedAs("cornerRadius")] [Tooltip("Size of the cube collidable used in scale handles")] private float scaleHandleSize = 0.016f; // 1.6cm default handle size /// <summary> /// Size of the cube collidable used in scale handles /// </summary> public float ScaleHandleSize { get { return scaleHandleSize; } set { if (scaleHandleSize != value) { scaleHandleSize = value; CreateRig(); } } } [SerializeField] [Tooltip("Additional padding to apply to the collider on scale handle to make handle easier to hit")] private Vector3 scaleHandleColliderPadding = new Vector3(0.016f, 0.016f, 0.016f); /// <summary> /// Additional padding to apply to the collider on scale handle to make handle easier to hit /// </summary> public Vector3 ScaleHandleColliderPadding { get { return scaleHandleColliderPadding; } set { if (scaleHandleColliderPadding != value) { scaleHandleColliderPadding = value; CreateRig(); } } } [SerializeField] [Tooltip("Prefab used to display rotation handles in the midpoint of each edge. Aligns the Y axis of the prefab with the pivot axis, and the X and Z axes pointing outward. If not set, spheres will be displayed instead")] private GameObject rotationHandlePrefab = null; /// <summary> /// Prefab used to display rotation handles in the midpoint of each edge. Aligns the Y axis of the prefab with the pivot axis, and the X and Z axes pointing outward. If not set, spheres will be displayed instead /// </summary> public GameObject RotationHandlePrefab { get { return rotationHandlePrefab; } set { if (rotationHandlePrefab != value) { rotationHandlePrefab = value; CreateRig(); } } } /// <summary> /// Prefab used to display rotation handles in the midpoint of each edge. Aligns the Y axis of the prefab with the pivot axis, and the X and Z axes pointing outward. If not set, spheres will be displayed instead /// </summary> [Obsolete("This property has been renamed RotationHandlePrefab.")] public GameObject RotationHandleSlatePrefab { get { return RotationHandlePrefab; } set { RotationHandlePrefab = value; } } [SerializeField] [FormerlySerializedAs("ballRadius")] [Tooltip("Radius of the handle geometry of rotation handles")] private float rotationHandleSize = 0.016f; // 1.6cm default handle size /// <summary> /// Radius of the handle geometry of rotation handles /// </summary> public float RotationHandleSize { get { return rotationHandleSize; } set { if (rotationHandleSize != value) { rotationHandleSize = value; CreateRig(); } } } [SerializeField] [Tooltip("Additional padding to apply to the collider on rotate handle to make handle easier to hit")] private Vector3 rotateHandleColliderPadding = new Vector3(0.016f, 0.016f, 0.016f); /// <summary> /// Additional padding to apply to the collider on rotate handle to make handle easier to hit /// </summary> public Vector3 RotateHandleColliderPadding { get { return rotateHandleColliderPadding; } set { if (rotateHandleColliderPadding != value) { rotateHandleColliderPadding = value; CreateRig(); } } } [SerializeField] [Tooltip("Determines the type of collider that will surround the rotation handle prefab.")] private RotationHandlePrefabCollider rotationHandlePrefabColliderType = RotationHandlePrefabCollider.Box; /// <summary> /// Determines the type of collider that will surround the rotation handle prefab. /// </summary> public RotationHandlePrefabCollider RotationHandlePrefabColliderType { get { return rotationHandlePrefabColliderType; } set { if (rotationHandlePrefabColliderType != value) { rotationHandlePrefabColliderType = value; CreateRig(); } } } [SerializeField] [Tooltip("Check to show scale handles")] private bool showScaleHandles = true; /// <summary> /// Public property to Set the visibility of the corner cube Scaling handles. /// This property can be set independent of the Rotate handles. /// </summary> public bool ShowScaleHandles { get { return showScaleHandles; } set { if (showScaleHandles != value) { showScaleHandles = value; ResetHandleVisibility(); } } } [SerializeField] [Tooltip("Check to show rotation handles for the X axis")] private bool showRotationHandleForX = true; /// <summary> /// Check to show rotation handles for the X axis /// </summary> public bool ShowRotationHandleForX { get { return showRotationHandleForX; } set { if (showRotationHandleForX != value) { showRotationHandleForX = value; ResetHandleVisibility(); } } } [SerializeField] [Tooltip("Check to show rotation handles for the Y axis")] private bool showRotationHandleForY = true; /// <summary> /// Check to show rotation handles for the Y axis /// </summary> public bool ShowRotationHandleForY { get { return showRotationHandleForY; } set { if (showRotationHandleForY != value) { showRotationHandleForY = value; ResetHandleVisibility(); } } } [SerializeField] [Tooltip("Check to show rotation handles for the Z axis")] private bool showRotationHandleForZ = true; /// <summary> /// Check to show rotation handles for the Z axis /// </summary> public bool ShowRotationHandleForZ { get { return showRotationHandleForZ; } set { if (showRotationHandleForZ != value) { showRotationHandleForZ = value; ResetHandleVisibility(); } } } [SerializeField] [Tooltip("Check to draw a tether point from the handles to the hand when manipulating.")] private bool drawTetherWhenManipulating = true; /// <summary> /// Check to draw a tether point from the handles to the hand when manipulating. /// </summary> public bool DrawTetherWhenManipulating { get { return drawTetherWhenManipulating; } set { drawTetherWhenManipulating = value; } } [Header("Proximity")] [SerializeField] [Tooltip("Determines whether proximity feature (scaling and material toggling) for bounding box handles is activated")] private bool proximityEffectActive = false; /// <summary> /// Determines whether proximity feature (scaling and material toggling) for bounding box handles is activated /// </summary> public bool ProximityEffectActive { get { return proximityEffectActive; } set { proximityEffectActive = value; } } [SerializeField] [Tooltip("How far away should the hand be from a handle before it starts scaling the handle?")] [Range(0.005f, 0.2f)] private float handleMediumProximity = 0.1f; /// <summary> /// Distance between handle and hand before proximity scaling will be triggered. /// </summary> public float HandleMediumProximity => handleMediumProximity; [SerializeField] [Tooltip("How far away should the hand be from a handle before it activates the close-proximity scaling effect?")] [Range(0.001f, 0.1f)] private float handleCloseProximity = 0.03f; /// <summary> /// Distance between handle and hand that will trigger the close proximity effect. /// </summary> public float HandleCloseProximity => handleCloseProximity; [SerializeField] [Tooltip("A Proximity-enabled Handle scales by this amount when a hand moves out of range. Default is 0, invisible handle.")] private float farScale = 0.0f; /// <summary> /// A Proximity-enabled Handle scales by this amount when a hand moves out of range. Default is 0, invisible handle. /// </summary> public float FarScale { get { return farScale; } set { farScale = value; } } [SerializeField] [Tooltip("A Proximity-enabled Handle scales by this amount when a hand moves into the Medium Proximity range. Default is 1.0, original handle size.")] private float mediumScale = 1.0f; /// <summary> /// A Proximity-enabled Handle scales by this amount when a hand moves into the Medium Proximity range. Default is 1.0, original handle size. /// </summary> public float MediumScale { get { return mediumScale; } set { mediumScale = value; } } [SerializeField] [Tooltip("A Proximity-enabled Handle scales by this amount when a hand moves into the Close Proximity range. Default is 1.5, larger handle size.")] private float closeScale = 1.5f; /// <summary> /// A Proximity-enabled Handle scales by this amount when a hand moves into the Close Proximity range. Default is 1.5, larger handle size /// </summary> public float CloseScale { get { return closeScale; } set { closeScale = value; } } [SerializeField] [Tooltip("At what rate should a Proximity-scaled Handle scale when the Hand moves from Medium proximity to Far proximity?")] [Range(0.0f, 1.0f)] private float farGrowRate = 0.3f; /// <summary> /// Scaling animation velocity from medium to far proximity state. /// </summary> public float FarGrowRate => farGrowRate; [SerializeField] [Tooltip("At what rate should a Proximity-scaled Handle scale when the Hand moves to a distance that activates Medium Scale ?")] [Range(0.0f, 1.0f)] private float mediumGrowRate = 0.2f; /// <summary> /// Scaling animation velocity from far to medium proximity. /// </summary> public float MediumGrowRate => mediumGrowRate; [SerializeField] [Tooltip("At what rate should a Proximity-scaled Handle scale when the Hand moves to a distance that activates Close Scale ?")] [Range(0.0f, 1.0f)] private float closeGrowRate = 0.3f; /// <summary> /// Scaling animation velocity from medium to close proximity. /// </summary> public float CloseGrowRate => closeGrowRate; [SerializeField] [Tooltip("Add a Collider here if you do not want the handle colliders to interact with another object's collider.")] private Collider handlesIgnoreCollider = null; /// <summary> /// Add a Collider here if you do not want the handle colliders to interact with another object's collider. /// </summary> public Collider HandlesIgnoreCollider { get { return handlesIgnoreCollider; } set { handlesIgnoreCollider = value; } } [Header("Debug")] [Tooltip("Debug only. Component used to display debug messages")] /// <summary> /// Debug only. Component used to display debug messages /// </summary> public TextMesh debugText; [SerializeField] [Tooltip("Determines whether to hide GameObjects (i.e handles, links etc) created and managed by this component in the editor")] private bool hideElementsInInspector = true; /// <summary> /// Determines whether to hide GameObjects (i.e handles, links etc) created and managed by this component in the editor /// </summary> public bool HideElementsInInspector { get { return hideElementsInInspector; } set { if (hideElementsInInspector != value) { hideElementsInInspector = value; UpdateRigVisibilityInInspector(); } } } private void UpdateRigVisibilityInInspector() { HideFlags desiredFlags = hideElementsInInspector ? HideFlags.HideInHierarchy | HideFlags.HideInInspector : HideFlags.None; if (corners != null) { foreach (var cube in corners) { cube.hideFlags = desiredFlags; } } if (boxDisplay != null) { boxDisplay.hideFlags = desiredFlags; } if (rigRoot != null) { rigRoot.hideFlags = desiredFlags; } if (links != null) { foreach (var link in links) { link.hideFlags = desiredFlags; } } } [Header("Events")] /// <summary> /// Event that gets fired when interaction with a rotation handle starts. /// </summary> public UnityEvent RotateStarted = new UnityEvent(); /// <summary> /// Event that gets fired when interaction with a rotation handle stops. /// </summary> public UnityEvent RotateStopped = new UnityEvent(); /// <summary> /// Event that gets fired when interaction with a scale handle starts. /// </summary> public UnityEvent ScaleStarted = new UnityEvent(); /// <summary> /// Event that gets fired when interaction with a scale handle stops. /// </summary> public UnityEvent ScaleStopped = new UnityEvent(); #endregion Serialized Fields #region Private Fields // Whether we should be displaying just the wireframe (if enabled) or the handles too private bool wireframeOnly = false; // Pointer that is being used to manipulate the bounding box private IMixedRealityPointer currentPointer; private Transform rigRoot; // Game object used to display the bounding box. Parented to the rig root private GameObject boxDisplay; private Vector3[] boundsCorners; // Half the size of the current bounds private Vector3 currentBoundsExtents; private IMixedRealityEyeGazeProvider EyeTrackingProvider => eyeTrackingProvider ?? (eyeTrackingProvider = CoreServices.InputSystem?.EyeGazeProvider); private IMixedRealityEyeGazeProvider eyeTrackingProvider = null; private readonly List<IMixedRealityInputSource> touchingSources = new List<IMixedRealityInputSource>(); private List<Transform> links; private List<Renderer> linkRenderers; private List<IMixedRealityController> sourcesDetected; private Vector3[] edgeCenters; // Current axis of rotation about the center of the rig root private Vector3 currentRotationAxis; // Scale of the target at the beginning of the current manipulation private Vector3 initialScaleOnGrabStart; // Position of the target at the beginning of the current manipulation private Vector3 initialPositionOnGrabStart; // Point that was initially grabbed in OnPointerDown() private Vector3 initialGrabPoint; // Current position of the grab point private Vector3 currentGrabPoint; private MinMaxScaleConstraint scaleConstraint; // Grab point position in pointer space. Used to calculate the current grab point from the current pointer pose. private Vector3 grabPointInPointer; private CardinalAxisType[] edgeAxes; private int[] flattenedHandles; // Corner opposite to the grabbed one. Scaling will be relative to it. private Vector3 oppositeCorner; // Direction of the diagonal from the opposite corner to the grabbed one. private Vector3 diagonalDir; private HandleType currentHandleType; // The size, position of boundsOverride object in the previous frame // Used to determine if boundsOverride size has changed. private Bounds prevBoundsOverride = new Bounds(); // True if this game object is a child of the Target one private bool isChildOfTarget = false; private static readonly string rigRootName = "rigRoot"; // Cache for the corner points of either renderers or colliders during the bounds calculation phase private static List<Vector3> totalBoundsCorners = new List<Vector3>(); private HashSet<IMixedRealityPointer> proximityPointers = new HashSet<IMixedRealityPointer>(); private List<Vector3> proximityPoints = new List<Vector3>(); #endregion #region public Properties // TODO Review this, it feels like we should be using Behaviour.enabled instead. private bool active = false; /// <summary> /// Flag that indicates if the bounding box is currently active / visible. /// </summary> public bool Active { get { return active; } set { if (active != value) { active = value; rigRoot?.gameObject.SetActive(value); ResetHandleVisibility(); if (value && proximityEffectActive) { ResetHandleProximityScale(); } } } } /// <summary> /// The collider reference tracking the bounds utilized by this component during runtime /// </summary> public BoxCollider TargetBounds { get; private set; } private List<Handle> handles; private List<Transform> corners; /// <summary> /// Returns list of transforms pointing to the scale handles of the bounding box. /// </summary> public IReadOnlyList<Transform> ScaleCorners { get { return corners; } } private List<Transform> balls; /// <summary> /// Returns list of transforms pointing to the rotation handles of the bounding box. /// </summary> public IReadOnlyList<Transform> RotateMidpoints { get { return balls; } } #endregion Public Properties #region Public Methods /// <summary> /// Allows to manually enable wire (edge) highlighting (edges) of the bounding box. /// This is useful if connected to the Manipulation events of a /// <see cref="Microsoft.MixedReality.Toolkit.UI.ObjectManipulator"/> /// when used in conjunction with this MonoBehavior. /// </summary> public void HighlightWires() { SetHighlighted(null); } public void UnhighlightWires() { ResetHandleVisibility(); } /// <summary> /// Sets the minimum/maximum scale for the bounding box at runtime. /// </summary> /// <param name="min">Minimum scale</param> /// <param name="max">Maximum scale</param> /// <param name="relativeToInitialState">If true the values will be multiplied by scale of target at startup. If false they will be in absolute local scale.</param> [Obsolete("Use a MinMaxScaleConstraint script rather than setting min/max scale on BoundingBox directly")] public void SetScaleLimits(float min, float max, bool relativeToInitialState = true) { scaleMinimum = min; scaleMaximum = max; } /// <summary> /// Destroys and re-creates the rig around the bounding box /// </summary> public void CreateRig() { DestroyRig(); SetMaterials(); InitializeRigRoot(); InitializeDataStructures(); SetBoundingBoxCollider(); UpdateBounds(); AddCorners(); AddLinks(); HandleIgnoreCollider(); AddBoxDisplay(); UpdateRigHandles(); Flatten(); ResetHandleVisibility(); rigRoot.gameObject.SetActive(active); UpdateRigVisibilityInInspector(); } #endregion #region MonoBehaviour Methods private void OnEnable() { CreateRig(); CaptureInitialState(); if (activation == BoundingBoxActivationType.ActivateByProximityAndPointer || activation == BoundingBoxActivationType.ActivateByProximity || activation == BoundingBoxActivationType.ActivateByPointer) { wireframeOnly = true; Active = true; } else if (activation == BoundingBoxActivationType.ActivateOnStart) { Active = true; } else if (activation == BoundingBoxActivationType.ActivateManually) { // Activate to create handles etc. then deactivate. Active = true; Active = false; } } private void OnDisable() { DestroyRig(); if (currentPointer != null) { DropController(); } } private void Update() { if (active) { if (currentPointer != null) { TransformTarget(); UpdateBounds(); UpdateRigHandles(); } else if ((!isChildOfTarget && Target.transform.hasChanged) || (boundsOverride != null && HasBoundsOverrideChanged())) { UpdateBounds(); UpdateRigHandles(); Target.transform.hasChanged = false; } // Only update proximity scaling of handles if they are visible which is when // active is true and wireframeOnly is false if (proximityEffectActive && !wireframeOnly) { // If any handle type is visible, then update if (ShowScaleHandles || ShowRotationHandleForX || ShowRotationHandleForY || ShowRotationHandleForZ) { HandleProximityScaling(); } } } else if (boundsOverride != null && HasBoundsOverrideChanged()) { UpdateBounds(); UpdateRigHandles(); } } /// <summary> /// Assumes that boundsOverride is not null /// Returns true if the size / location of boundsOverride has changed. /// If boundsOverride gets set to null, rig is re-created in BoundsOverride /// property setter. /// </summary> private bool HasBoundsOverrideChanged() { Debug.Assert(boundsOverride != null, "HasBoundsOverrideChanged called but boundsOverride is null"); Bounds curBounds = boundsOverride.bounds; bool result = curBounds != prevBoundsOverride; prevBoundsOverride = curBounds; return result; } #endregion MonoBehaviour Methods #region Private Methods private void DestroyRig() { if (boundsOverride == null) { Destroy(TargetBounds); } else { boundsOverride.size -= boxPadding; if (TargetBounds != null) { if (TargetBounds.gameObject.GetComponent<NearInteractionGrabbable>()) { Destroy(TargetBounds.gameObject.GetComponent<NearInteractionGrabbable>()); } } } if (handles != null) { handles.Clear(); } if (balls != null) { foreach (Transform transform in balls) { Destroy(transform.gameObject); } balls.Clear(); } if (links != null) { foreach (Transform transform in links) { Destroy(transform.gameObject); } links.Clear(); links = null; } if (corners != null) { foreach (Transform transform in corners) { Destroy(transform.gameObject); } corners.Clear(); } if (rigRoot != null) { Destroy(rigRoot.gameObject); rigRoot = null; } } private void TransformTarget() { if (currentHandleType != HandleType.None) { Vector3 prevGrabPoint = currentGrabPoint; currentGrabPoint = (currentPointer.Rotation * grabPointInPointer) + currentPointer.Position; if (currentHandleType == HandleType.Rotation) { Vector3 prevDir = Vector3.ProjectOnPlane(prevGrabPoint - rigRoot.transform.position, currentRotationAxis).normalized; Vector3 currentDir = Vector3.ProjectOnPlane(currentGrabPoint - rigRoot.transform.position, currentRotationAxis).normalized; Quaternion q = Quaternion.FromToRotation(prevDir, currentDir); q.ToAngleAxis(out float angle, out Vector3 axis); Target.transform.RotateAround(rigRoot.transform.position, axis, angle); } else if (currentHandleType == HandleType.Scale) { float initialDist = Vector3.Dot(initialGrabPoint - oppositeCorner, diagonalDir); float currentDist = Vector3.Dot(currentGrabPoint - oppositeCorner, diagonalDir); float scaleFactor = 1 + (currentDist - initialDist) / initialDist; Vector3 newScale = initialScaleOnGrabStart * scaleFactor; MixedRealityTransform clampedTransform = MixedRealityTransform.NewScale(newScale); if (scaleConstraint != null) { scaleConstraint.ApplyConstraint(ref clampedTransform); if (clampedTransform.Scale != newScale) { scaleFactor = clampedTransform.Scale[0] / initialScaleOnGrabStart[0]; } } Target.transform.localScale = clampedTransform.Scale; Target.transform.position = initialPositionOnGrabStart * scaleFactor + (1 - scaleFactor) * oppositeCorner; } } } private Vector3 GetRotationAxis(Transform handle) { for (int i = 0; i < balls.Count; ++i) { if (handle == balls[i]) { if (edgeAxes[i] == CardinalAxisType.X) { return rigRoot.transform.right; } else if (edgeAxes[i] == CardinalAxisType.Y) { return rigRoot.transform.up; } else { return rigRoot.transform.forward; } } } return Vector3.zero; } private void AddCorners() { bool isFlattened = (flattenAxis != FlattenModeType.DoNotFlatten); for (int i = 0; i < boundsCorners.Length; ++i) { GameObject corner = new GameObject { name = "corner_" + i.ToString() }; corner.transform.parent = rigRoot.transform; corner.transform.localPosition = boundsCorners[i]; GameObject visualsScale = new GameObject(); visualsScale.name = "visualsScale"; visualsScale.transform.parent = corner.transform; visualsScale.transform.localPosition = Vector3.zero; // Compute mirroring scale { Vector3 p = boundsCorners[i]; visualsScale.transform.localScale = new Vector3(Mathf.Sign(p[0]), Mathf.Sign(p[1]), Mathf.Sign(p[2])); } // figure out which prefab to instantiate GameObject prefabToInstantiate = isFlattened ? scaleHandleSlatePrefab : scaleHandlePrefab; GameObject cornerVisual = null; if (prefabToInstantiate == null) { // instantiate default prefab, a cube. Remove the box collider from it cornerVisual = GameObject.CreatePrimitive(PrimitiveType.Cube); cornerVisual.transform.parent = visualsScale.transform; cornerVisual.transform.localPosition = Vector3.zero; Destroy(cornerVisual.GetComponent<BoxCollider>()); } else { cornerVisual = Instantiate(prefabToInstantiate, visualsScale.transform); } if (isFlattened) { // Rotate 2D slate handle asset for proper orientation cornerVisual.transform.Rotate(0, 0, -90); } cornerVisual.name = "visuals"; // this is the size of the corner visuals var cornerbounds = GetMaxBounds(cornerVisual); float maxDim = Mathf.Max(Mathf.Max(cornerbounds.size.x, cornerbounds.size.y), cornerbounds.size.z); cornerbounds.size = maxDim * Vector3.one; cornerbounds.center = new Vector3( (i & (1 << 0)) == 0 ? cornerbounds.center.x : -cornerbounds.center.x, (i & (1 << 1)) == 0 ? -cornerbounds.center.y : cornerbounds.center.y, (i & (1 << 2)) == 0 ? -cornerbounds.center.z : cornerbounds.center.z ); // we need to multiply by this amount to get to desired scale handle size var invScale = scaleHandleSize / cornerbounds.size.x; cornerVisual.transform.localScale = new Vector3(invScale, invScale, invScale); ApplyMaterialToAllRenderers(cornerVisual, handleMaterial); AddComponentsToAffordance(corner, new Bounds(cornerbounds.center * invScale, cornerbounds.size * invScale), RotationHandlePrefabCollider.Box, CursorContextInfo.CursorAction.Scale, scaleHandleColliderPadding); corners.Add(corner.transform); handles.Add(new Handle() { Type = HandleType.Scale, HandleVisual = cornerVisual.transform, HandleVisualRenderer = cornerVisual.GetComponentInChildren<Renderer>(), }); } } /// <summary> /// Add all common components to a corner or rotate affordance /// </summary> private void AddComponentsToAffordance(GameObject afford, Bounds bounds, RotationHandlePrefabCollider colliderType, CursorContextInfo.CursorAction cursorType, Vector3 colliderPadding) { if (colliderType == RotationHandlePrefabCollider.Box) { BoxCollider collider = afford.AddComponent<BoxCollider>(); collider.size = bounds.size; collider.center = bounds.center; collider.size += colliderPadding; } else { SphereCollider sphere = afford.AddComponent<SphereCollider>(); sphere.center = bounds.center; sphere.radius = bounds.extents.x; sphere.radius += Mathf.Max(Mathf.Max(colliderPadding.x, colliderPadding.y), colliderPadding.z); } // In order for the affordance to be grabbed using near interaction we need // to add NearInteractionGrabbable; var g = afford.EnsureComponent<NearInteractionGrabbable>(); g.ShowTetherWhenManipulating = drawTetherWhenManipulating; var contextInfo = afford.EnsureComponent<CursorContextInfo>(); contextInfo.CurrentCursorAction = cursorType; contextInfo.ObjectCenter = rigRoot.transform; } private Bounds GetMaxBounds(GameObject g) { var b = new Bounds(); Mesh currentMesh; foreach (MeshFilter r in g.GetComponentsInChildren<MeshFilter>()) { if ((currentMesh = r.sharedMesh) == null) { continue; } if (b.size == Vector3.zero) { b = currentMesh.bounds; } else { b.Encapsulate(currentMesh.bounds); } } return b; } private void AddLinks() { edgeCenters = new Vector3[12]; CalculateEdgeCenters(); edgeAxes = new CardinalAxisType[12]; edgeAxes[0] = CardinalAxisType.X; edgeAxes[1] = CardinalAxisType.Y; edgeAxes[2] = CardinalAxisType.X; edgeAxes[3] = CardinalAxisType.Y; edgeAxes[4] = CardinalAxisType.X; edgeAxes[5] = CardinalAxisType.Y; edgeAxes[6] = CardinalAxisType.X; edgeAxes[7] = CardinalAxisType.Y; edgeAxes[8] = CardinalAxisType.Z; edgeAxes[9] = CardinalAxisType.Z; edgeAxes[10] = CardinalAxisType.Z; edgeAxes[11] = CardinalAxisType.Z; for (int i = 0; i < edgeCenters.Length; ++i) { GameObject midpoint = new GameObject(); midpoint.name = "midpoint_" + i.ToString(); midpoint.transform.position = edgeCenters[i]; midpoint.transform.parent = rigRoot.transform; GameObject midpointVisual; if (rotationHandlePrefab != null) { midpointVisual = Instantiate(rotationHandlePrefab); } else { midpointVisual = GameObject.CreatePrimitive(PrimitiveType.Sphere); Destroy(midpointVisual.GetComponent<SphereCollider>()); } // Align handle with its edge assuming that the prefab is initially aligned with the up direction if (edgeAxes[i] == CardinalAxisType.X) { Quaternion realignment = Quaternion.FromToRotation(Vector3.up, Vector3.right); midpointVisual.transform.localRotation = realignment * midpointVisual.transform.localRotation; } else if (edgeAxes[i] == CardinalAxisType.Z) { Quaternion realignment = Quaternion.FromToRotation(Vector3.up, Vector3.forward); midpointVisual.transform.localRotation = realignment * midpointVisual.transform.localRotation; } Bounds midpointBounds = GetMaxBounds(midpointVisual); float maxDim = Mathf.Max( Mathf.Max(midpointBounds.size.x, midpointBounds.size.y), midpointBounds.size.z); float invScale = rotationHandleSize / maxDim; midpointVisual.transform.parent = midpoint.transform; midpointVisual.transform.localScale = new Vector3(invScale, invScale, invScale); midpointVisual.transform.localPosition = Vector3.zero; Bounds bounds = new Bounds(midpointBounds.center * invScale, midpointBounds.size * invScale); if (edgeAxes[i] == CardinalAxisType.X) { bounds.size = new Vector3(bounds.size.y, bounds.size.x, bounds.size.z); } else if (edgeAxes[i] == CardinalAxisType.Z) { bounds.size = new Vector3(bounds.size.x, bounds.size.z, bounds.size.y); } AddComponentsToAffordance(midpoint, bounds, rotationHandlePrefabColliderType, CursorContextInfo.CursorAction.Rotate, rotateHandleColliderPadding); balls.Add(midpoint.transform); handles.Add(new Handle() { Type = HandleType.Rotation, HandleVisual = midpointVisual.transform, HandleVisualRenderer = midpointVisual.GetComponent<Renderer>(), }); if (handleMaterial != null) { ApplyMaterialToAllRenderers(midpointVisual, handleMaterial); } } if (links != null) { GameObject link; for (int i = 0; i < edgeCenters.Length; ++i) { if (wireframeShape == WireframeType.Cubic) { link = GameObject.CreatePrimitive(PrimitiveType.Cube); Destroy(link.GetComponent<BoxCollider>()); } else { link = GameObject.CreatePrimitive(PrimitiveType.Cylinder); Destroy(link.GetComponent<CapsuleCollider>()); } link.name = "link_" + i.ToString(); Vector3 linkDimensions = GetLinkDimensions(); if (edgeAxes[i] == CardinalAxisType.Y) { link.transform.localScale = new Vector3(wireframeEdgeRadius, linkDimensions.y, wireframeEdgeRadius); link.transform.Rotate(new Vector3(0.0f, 90.0f, 0.0f)); } else if (edgeAxes[i] == CardinalAxisType.Z) { link.transform.localScale = new Vector3(wireframeEdgeRadius, linkDimensions.z, wireframeEdgeRadius); link.transform.Rotate(new Vector3(90.0f, 0.0f, 0.0f)); } else // edgeAxes[i] == CardinalAxisType.X { link.transform.localScale = new Vector3(wireframeEdgeRadius, linkDimensions.x, wireframeEdgeRadius); link.transform.Rotate(new Vector3(0.0f, 0.0f, 90.0f)); } link.transform.position = edgeCenters[i]; link.transform.parent = rigRoot.transform; Renderer linkRenderer = link.GetComponent<Renderer>(); linkRenderers.Add(linkRenderer); if (wireframeMaterial != null) { linkRenderer.material = wireframeMaterial; } links.Add(link.transform); } } } /// <summary> /// Make the handle colliders ignore specified collider. (e.g. spatial mapping's floor collider to avoid the object get lifted up) /// </summary> private void HandleIgnoreCollider() { if (handlesIgnoreCollider != null) { foreach (Transform corner in corners) { Collider[] colliders = corner.gameObject.GetComponents<Collider>(); foreach (Collider collider in colliders) { UnityEngine.Physics.IgnoreCollision(collider, handlesIgnoreCollider); } } foreach (Transform ball in balls) { Collider[] colliders = ball.gameObject.GetComponents<Collider>(); foreach (Collider collider in colliders) { UnityEngine.Physics.IgnoreCollision(collider, handlesIgnoreCollider); } } } } private void AddBoxDisplay() { if (boxMaterial != null) { bool isFlattened = flattenAxis != FlattenModeType.DoNotFlatten; boxDisplay = GameObject.CreatePrimitive(isFlattened ? PrimitiveType.Quad : PrimitiveType.Cube); Destroy(boxDisplay.GetComponent<Collider>()); boxDisplay.name = "bounding box"; ApplyMaterialToAllRenderers(boxDisplay, boxMaterial); boxDisplay.transform.localScale = GetBoxDisplayScale(); boxDisplay.transform.parent = rigRoot.transform; } } private Vector3 GetBoxDisplayScale() { // When a box is flattened one axis is normally scaled to zero, this doesn't always work well with visuals so we take // that flattened axis and re-scale it to the flattenAxisDisplayScale. Vector3 displayScale = currentBoundsExtents; displayScale.x = (flattenAxis == FlattenModeType.FlattenX) ? flattenAxisDisplayScale : displayScale.x; displayScale.y = (flattenAxis == FlattenModeType.FlattenY) ? flattenAxisDisplayScale : displayScale.y; displayScale.z = (flattenAxis == FlattenModeType.FlattenZ) ? flattenAxisDisplayScale : displayScale.z; return 2.0f * displayScale; } private void SetBoundingBoxCollider() { // Make sure that the bounds of all child objects are up to date before we compute bounds UnityPhysics.SyncTransforms(); if (boundsOverride != null) { TargetBounds = boundsOverride; TargetBounds.transform.hasChanged = true; } else { TargetBounds = Target.AddComponent<BoxCollider>(); Bounds bounds = GetTargetBounds(); TargetBounds.center = bounds.center; TargetBounds.size = bounds.size; } CalculateBoxPadding(); TargetBounds.EnsureComponent<NearInteractionGrabbable>(); } private void CalculateBoxPadding() { if (boxPadding == Vector3.zero) { return; } Vector3 scale = TargetBounds.transform.lossyScale; for (int i = 0; i < 3; i++) { if (scale[i] == 0f) { return; } scale[i] = 1f / scale[i]; } TargetBounds.size += Vector3.Scale(boxPadding, scale); } private Bounds GetTargetBounds() { totalBoundsCorners.Clear(); // Collect all Transforms except for the rigRoot(s) transform structure(s) // Its possible we have two rigRoots here, the one about to be deleted and the new one // Since those have the gizmo structure childed, be need to omit them completely in the calculation of the bounds // This can only happen by name unless there is a better idea of tracking the rigRoot that needs destruction List<Transform> childTransforms = new List<Transform>(); if (Target != gameObject) { childTransforms.Add(Target.transform); } foreach (Transform childTransform in Target.transform) { if (childTransform.name.Equals(rigRootName)) { continue; } childTransforms.AddRange(childTransform.GetComponentsInChildren<Transform>()); } // Iterate transforms and collect bound volumes foreach (Transform childTransform in childTransforms) { Debug.Assert(childTransform != rigRoot); ExtractBoundsCorners(childTransform, boundsCalculationMethod); } Transform targetTransform = Target.transform; // In case we found nothing and this is the Target, we add it's inevitable collider's bounds if (totalBoundsCorners.Count == 0 && Target == gameObject) { ExtractBoundsCorners(targetTransform, BoundsCalculationMethod.ColliderOnly); } // Gather all corners and calculate their bounds Bounds finalBounds = new Bounds(targetTransform.InverseTransformPoint(totalBoundsCorners[0]), Vector3.zero); for (int i = 1; i < totalBoundsCorners.Count; i++) { finalBounds.Encapsulate(targetTransform.InverseTransformPoint(totalBoundsCorners[i])); } return finalBounds; } private void ExtractBoundsCorners(Transform childTransform, BoundsCalculationMethod boundsCalculationMethod) { KeyValuePair<Transform, Collider> colliderByTransform; KeyValuePair<Transform, Bounds> rendererBoundsByTransform; if (boundsCalculationMethod != BoundsCalculationMethod.RendererOnly) { Collider collider = childTransform.GetComponent<Collider>(); if (collider != null) { colliderByTransform = new KeyValuePair<Transform, Collider>(childTransform, collider); } else { colliderByTransform = new KeyValuePair<Transform, Collider>(); } } if (boundsCalculationMethod != BoundsCalculationMethod.ColliderOnly) { MeshFilter meshFilter = childTransform.GetComponent<MeshFilter>(); if (meshFilter != null && meshFilter.sharedMesh != null) { rendererBoundsByTransform = new KeyValuePair<Transform, Bounds>(childTransform, meshFilter.sharedMesh.bounds); } else { rendererBoundsByTransform = new KeyValuePair<Transform, Bounds>(); } } // Encapsulate the collider bounds if criteria match if (boundsCalculationMethod == BoundsCalculationMethod.ColliderOnly || boundsCalculationMethod == BoundsCalculationMethod.ColliderOverRenderer) { if (AddColliderBoundsCornersToTarget(colliderByTransform) && boundsCalculationMethod == BoundsCalculationMethod.ColliderOverRenderer || boundsCalculationMethod == BoundsCalculationMethod.ColliderOnly) { return; } } // Encapsulate the renderer bounds if criteria match if (boundsCalculationMethod != BoundsCalculationMethod.ColliderOnly) { if (AddRendererBoundsCornersToTarget(rendererBoundsByTransform) && boundsCalculationMethod == BoundsCalculationMethod.RendererOverCollider || boundsCalculationMethod == BoundsCalculationMethod.RendererOnly) { return; } } // Do the collider for the one case that we chose RendererOverCollider and did not find a renderer AddColliderBoundsCornersToTarget(colliderByTransform); } private bool AddRendererBoundsCornersToTarget(KeyValuePair<Transform, Bounds> rendererBoundsByTarget) { if (rendererBoundsByTarget.Key == null) { return false; } Vector3[] cornersToWorld = null; rendererBoundsByTarget.Value.GetCornerPositions(rendererBoundsByTarget.Key, ref cornersToWorld); totalBoundsCorners.AddRange(cornersToWorld); return true; } private bool AddColliderBoundsCornersToTarget(KeyValuePair<Transform, Collider> colliderByTransform) { if (colliderByTransform.Key == null) { return false; } BoundsExtensions.GetColliderBoundsPoints(colliderByTransform.Value, totalBoundsCorners, 0); return colliderByTransform.Key != null; } private void SetMaterials() { // Ensure materials if (wireframeMaterial == null) { float[] color = { 1.0f, 1.0f, 1.0f, 0.75f }; wireframeMaterial = new Material(StandardShaderUtility.MrtkStandardShader); wireframeMaterial.EnableKeyword("_InnerGlow"); wireframeMaterial.SetColor("_Color", new Color(0.0f, 0.63f, 1.0f)); wireframeMaterial.SetFloat("_InnerGlow", 1.0f); wireframeMaterial.SetFloatArray("_InnerGlowColor", color); } if (handleMaterial == null && handleMaterial != wireframeMaterial) { float[] color = { 1.0f, 1.0f, 1.0f, 0.75f }; handleMaterial = new Material(StandardShaderUtility.MrtkStandardShader); handleMaterial.EnableKeyword("_InnerGlow"); handleMaterial.SetColor("_Color", new Color(0.0f, 0.63f, 1.0f)); handleMaterial.SetFloat("_InnerGlow", 1.0f); handleMaterial.SetFloatArray("_InnerGlowColor", color); } if (handleGrabbedMaterial == null && handleGrabbedMaterial != handleMaterial && handleGrabbedMaterial != wireframeMaterial) { float[] color = { 1.0f, 1.0f, 1.0f, 0.75f }; handleGrabbedMaterial = new Material(StandardShaderUtility.MrtkStandardShader); handleGrabbedMaterial.EnableKeyword("_InnerGlow"); handleGrabbedMaterial.SetColor("_Color", new Color(0.0f, 0.63f, 1.0f)); handleGrabbedMaterial.SetFloat("_InnerGlow", 1.0f); handleGrabbedMaterial.SetFloatArray("_InnerGlowColor", color); } } private void InitializeRigRoot() { var rigRootObj = new GameObject(rigRootName); rigRoot = rigRootObj.transform; rigRoot.parent = Target.transform; var pH = rigRootObj.AddComponent<PointerHandler>(); pH.OnPointerDown.AddListener(OnPointerDown); pH.OnPointerDragged.AddListener(OnPointerDragged); pH.OnPointerUp.AddListener(OnPointerUp); } private void InitializeDataStructures() { boundsCorners = new Vector3[8]; corners = new List<Transform>(); balls = new List<Transform>(); handles = new List<Handle>(); if (showWireframe) { links = new List<Transform>(); linkRenderers = new List<Renderer>(); } sourcesDetected = new List<IMixedRealityController>(); } private void CalculateEdgeCenters() { if (boundsCorners != null && edgeCenters != null) { edgeCenters[0] = (boundsCorners[0] + boundsCorners[1]) * 0.5f; edgeCenters[1] = (boundsCorners[0] + boundsCorners[2]) * 0.5f; edgeCenters[2] = (boundsCorners[3] + boundsCorners[2]) * 0.5f; edgeCenters[3] = (boundsCorners[3] + boundsCorners[1]) * 0.5f; edgeCenters[4] = (boundsCorners[4] + boundsCorners[5]) * 0.5f; edgeCenters[5] = (boundsCorners[4] + boundsCorners[6]) * 0.5f; edgeCenters[6] = (boundsCorners[7] + boundsCorners[6]) * 0.5f; edgeCenters[7] = (boundsCorners[7] + boundsCorners[5]) * 0.5f; edgeCenters[8] = (boundsCorners[0] + boundsCorners[4]) * 0.5f; edgeCenters[9] = (boundsCorners[1] + boundsCorners[5]) * 0.5f; edgeCenters[10] = (boundsCorners[2] + boundsCorners[6]) * 0.5f; edgeCenters[11] = (boundsCorners[3] + boundsCorners[7]) * 0.5f; } } private void CaptureInitialState() { var target = Target; if (target != null) { isChildOfTarget = transform.IsChildOf(target.transform); scaleConstraint = GetComponent<MinMaxScaleConstraint>(); if (scaleConstraint == null) { scaleConstraint = gameObject.AddComponent<MinMaxScaleConstraint>(); scaleConstraint.TargetTransform = Target.transform; #pragma warning disable 0618 scaleConstraint.ScaleMinimum = scaleMinimum; scaleConstraint.ScaleMaximum = scaleMaximum; #pragma warning restore 0618 } } } private Vector3 GetLinkDimensions() { float linkLengthAdjustor = wireframeShape == WireframeType.Cubic ? 2.0f : 1.0f - (6.0f * wireframeEdgeRadius); return (currentBoundsExtents * linkLengthAdjustor) + new Vector3(wireframeEdgeRadius, wireframeEdgeRadius, wireframeEdgeRadius); } private bool ShouldRotateHandleBeVisible(CardinalAxisType axisType) { return (axisType == CardinalAxisType.X && showRotationHandleForX) || (axisType == CardinalAxisType.Y && showRotationHandleForY) || (axisType == CardinalAxisType.Z && showRotationHandleForZ); } private void ResetHandleVisibility() { if (currentPointer != null) { return; } bool isVisible; // Set balls visibility if (balls != null) { isVisible = (active == true && wireframeOnly == false); for (int i = 0; i < balls.Count; ++i) { balls[i].gameObject.SetActive(isVisible && ShouldRotateHandleBeVisible(edgeAxes[i])); ApplyMaterialToAllRenderers(balls[i].gameObject, handleMaterial); } } // Set link visibility if (links != null) { isVisible = active == true; for (int i = 0; i < linkRenderers.Count; ++i) { if (linkRenderers[i] != null) { linkRenderers[i].enabled = isVisible; } } } // Set box display visibility if (boxDisplay != null) { boxDisplay.SetActive(active); ApplyMaterialToAllRenderers(boxDisplay, boxMaterial); } // Set corner visibility if (corners != null) { isVisible = (active == true && wireframeOnly == false && showScaleHandles == true); for (int i = 0; i < corners.Count; ++i) { corners[i].gameObject.SetActive(isVisible); ApplyMaterialToAllRenderers(corners[i].gameObject, handleMaterial); } } SetHiddenHandles(); } private void SetHighlighted(Transform activeHandle) { // Turn off all balls if (balls != null) { for (int i = 0; i < balls.Count; ++i) { if (balls[i] != activeHandle) { balls[i].gameObject.SetActive(false); } else { ApplyMaterialToAllRenderers(balls[i].gameObject, handleGrabbedMaterial); } } } // Turn off all corners if (corners != null) { for (int i = 0; i < corners.Count; ++i) { if (corners[i] != activeHandle) { corners[i].gameObject.SetActive(false); } else { ApplyMaterialToAllRenderers(corners[i].gameObject, handleGrabbedMaterial); } } } // Update the box material to the grabbed material if (boxDisplay != null) { ApplyMaterialToAllRenderers(boxDisplay, boxGrabbedMaterial); } } private void UpdateBounds() { if (TargetBounds != null) { // Store current rotation then zero out the rotation so that the bounds // are computed when the object is in its 'axis aligned orientation'. Quaternion currentRotation = Target.transform.rotation; Target.transform.rotation = Quaternion.identity; UnityPhysics.SyncTransforms(); // Update collider bounds Vector3 boundsExtents = TargetBounds.bounds.extents; // After bounds are computed, restore rotation... Target.transform.rotation = currentRotation; UnityPhysics.SyncTransforms(); if (boundsExtents != Vector3.zero) { if (flattenAxis == FlattenModeType.FlattenAuto) { float min = Mathf.Min(boundsExtents.x, Mathf.Min(boundsExtents.y, boundsExtents.z)); flattenAxis = (min == boundsExtents.x) ? FlattenModeType.FlattenX : ((min == boundsExtents.y) ? FlattenModeType.FlattenY : FlattenModeType.FlattenZ); } boundsExtents.x = (flattenAxis == FlattenModeType.FlattenX) ? 0.0f : boundsExtents.x; boundsExtents.y = (flattenAxis == FlattenModeType.FlattenY) ? 0.0f : boundsExtents.y; boundsExtents.z = (flattenAxis == FlattenModeType.FlattenZ) ? 0.0f : boundsExtents.z; currentBoundsExtents = boundsExtents; GetCornerPositionsFromBounds(new Bounds(Vector3.zero, boundsExtents * 2.0f), ref boundsCorners); CalculateEdgeCenters(); } } } private void UpdateRigHandles() { if (rigRoot != null && Target != null && TargetBounds != null) { // We move the rigRoot to the scene root to ensure that non-uniform scaling performed // anywhere above the rigRoot does not impact the position of rig corners / edges rigRoot.parent = null; rigRoot.rotation = Quaternion.identity; rigRoot.position = Vector3.zero; rigRoot.localScale = Vector3.one; for (int i = 0; i < corners.Count; ++i) { corners[i].position = boundsCorners[i]; } Vector3 rootScale = rigRoot.lossyScale; Vector3 invRootScale = new Vector3(1.0f / rootScale[0], 1.0f / rootScale[1], 1.0f / rootScale[2]); // Compute the local scale that produces the desired world space dimensions Vector3 linkDimensions = Vector3.Scale(GetLinkDimensions(), invRootScale); for (int i = 0; i < edgeCenters.Length; ++i) { balls[i].position = edgeCenters[i]; if (links != null) { links[i].position = edgeCenters[i]; if (edgeAxes[i] == CardinalAxisType.X) { links[i].localScale = new Vector3(wireframeEdgeRadius, linkDimensions.x, wireframeEdgeRadius); } else if (edgeAxes[i] == CardinalAxisType.Y) { links[i].localScale = new Vector3(wireframeEdgeRadius, linkDimensions.y, wireframeEdgeRadius); } else // edgeAxes[i] == CardinalAxisType.Z { links[i].localScale = new Vector3(wireframeEdgeRadius, linkDimensions.z, wireframeEdgeRadius); } } } if (boxDisplay != null) { // Compute the local scale that produces the desired world space size boxDisplay.transform.localScale = Vector3.Scale(GetBoxDisplayScale(), invRootScale); } // move rig into position and rotation rigRoot.position = TargetBounds.bounds.center; rigRoot.rotation = Target.transform.rotation; rigRoot.parent = Target.transform; } } private void HandleProximityScaling() { // Only use proximity effect if nothing is being dragged or grabbed if (currentPointer == null) { proximityPointers.Clear(); proximityPoints.Clear(); // Find all valid pointers foreach (var inputSource in CoreServices.InputSystem.DetectedInputSources) { foreach (var pointer in inputSource.Pointers) { if (pointer.IsInteractionEnabled && !proximityPointers.Contains(pointer)) { proximityPointers.Add(pointer); } } } // Get the max radius possible of our current bounds and extent the range to include proximity scaled objects. This is done by adjusting the original bounds to include the ObjectMediumProximity range in x, y and z axis float maxRadius = currentBoundsExtents.sqrMagnitude + (3 * handleMediumProximity * handleMediumProximity); // Grab points within sphere of influence from valid pointers foreach (var pointer in proximityPointers) { if (IsPointWithinBounds(pointer.Position, maxRadius)) { proximityPoints.Add(pointer.Position); } Vector3? point = pointer.Result?.Details.Point; if (point.HasValue && IsPointWithinBounds(point.Value, maxRadius)) { proximityPoints.Add(pointer.Result.Details.Point); } } // Loop through all handles and find closest one int closestHandleIdx = -1; float closestDistanceSqr = float.MaxValue; foreach (var point in proximityPoints) { for (int i = 0; i < handles.Count; ++i) { // If handle can't be visible, skip calculations if (!IsHandleTypeVisible(handles[i].Type)) continue; // Perform comparison on sqr distance since sqrt() operation is expensive in Vector3.Distance() float sqrDistance = (handles[i].HandleVisual.position - point).sqrMagnitude; if (sqrDistance < closestDistanceSqr) { closestHandleIdx = i; closestDistanceSqr = sqrDistance; } } } // Loop through all handles and update visual state based on closest point for (int i = 0; i < handles.Count; ++i) { Handle h = handles[i]; HandleProximityState newState = i == closestHandleIdx ? GetProximityState(closestDistanceSqr) : HandleProximityState.FullsizeNoProximity; // Only apply updates if handle is in a new state or closest handle needs to lerp scaling if (h.ProximityState != newState) { // Update and save new state h.ProximityState = newState; if (h.HandleVisualRenderer != null) { h.HandleVisualRenderer.material = newState == HandleProximityState.CloseProximity ? handleGrabbedMaterial : handleMaterial; } } ScaleHandle(h, true); } } } /// <summary> /// Get the ProximityState value based on the distanced provided /// </summary> /// <param name="sqrDistance">distance squared in proximity in meters</param> /// <returns>HandleProximityState for given distance</returns> private HandleProximityState GetProximityState(float sqrDistance) { if (sqrDistance < handleCloseProximity * handleCloseProximity) { return HandleProximityState.CloseProximity; } else if (sqrDistance < handleMediumProximity * handleMediumProximity) { return HandleProximityState.MediumProximity; } else { return HandleProximityState.FullsizeNoProximity; } } private void ScaleHandle(Handle handle, bool lerp = false) { float handleSize = handle.Type == HandleType.Scale ? scaleHandleSize : rotationHandleSize; float targetScale = 1.0f, weight = 0.0f; switch (handle.ProximityState) { case HandleProximityState.FullsizeNoProximity: targetScale = farScale; weight = lerp ? farGrowRate : 1.0f; break; case HandleProximityState.MediumProximity: targetScale = mediumScale; weight = lerp ? mediumGrowRate : 1.0f; break; case HandleProximityState.CloseProximity: targetScale = closeScale; weight = lerp ? closeGrowRate : 1.0f; break; } float newLocalScale = (handle.HandleVisual.localScale.x * (1.0f - weight)) + (handleSize * targetScale * weight); handle.HandleVisual.localScale = new Vector3(newLocalScale, newLocalScale, newLocalScale); } /// <summary> /// Determine if passed point is within sphere of radius around this GameObject /// To avoid function overhead, request compiler to inline this function since repeatedly called every Update() for every pointer position and result /// </summary> /// <param name="point">world space position</param> /// <param name="radiusSqr">radius of sphere in distance squared for faster comparison</param> /// <returns>true if point is within sphere</returns> [MethodImpl(MethodImplOptions.AggressiveInlining)] private bool IsPointWithinBounds(Vector3 point, float radiusSqr) { return (Vector3.Scale(TargetBounds.center, TargetBounds.gameObject.transform.lossyScale) + transform.position - point).sqrMagnitude < radiusSqr; } /// <summary> /// Helper method to check if handle type may be visible based on configuration /// </summary> /// <param name="h">handle reference to check</param> /// <returns>true if potentially visible, false otherwise</returns> private bool IsHandleTypeVisible(HandleType type) { return (type == HandleType.Scale && ShowScaleHandles) || (type == HandleType.Rotation && (ShowRotationHandleForX || ShowRotationHandleForY || ShowRotationHandleForZ)); } private void ResetHandleProximityScale() { for (int i = 0; i < handles.Count; ++i) { Handle h = handles[i]; if (h.ProximityState != HandleProximityState.FullsizeNoProximity) { h.ProximityState = HandleProximityState.FullsizeNoProximity; if (h.HandleVisualRenderer != null) { h.HandleVisualRenderer.material = handleMaterial; } ScaleHandle(h); } } } private HandleType GetHandleType(Transform handle) { for (int i = 0; i < balls.Count; ++i) { if (handle == balls[i]) { return HandleType.Rotation; } } for (int i = 0; i < corners.Count; ++i) { if (handle == corners[i]) { return HandleType.Scale; } } return HandleType.None; } private void Flatten() { if (flattenAxis == FlattenModeType.FlattenX) { flattenedHandles = new int[] { 0, 4, 2, 6 }; } else if (flattenAxis == FlattenModeType.FlattenY) { flattenedHandles = new int[] { 1, 3, 5, 7 }; } else if (flattenAxis == FlattenModeType.FlattenZ) { flattenedHandles = new int[] { 9, 10, 8, 11 }; } if (flattenedHandles != null && linkRenderers != null) { for (int i = 0; i < flattenedHandles.Length; ++i) { linkRenderers[flattenedHandles[i]].enabled = false; } } } private void SetHiddenHandles() { if (flattenedHandles != null) { for (int i = 0; i < flattenedHandles.Length; ++i) { balls[flattenedHandles[i]].gameObject.SetActive(false); } } } private void GetCornerPositionsFromBounds(Bounds bounds, ref Vector3[] positions) { int numCorners = 1 << 3; if (positions == null || positions.Length != numCorners) { positions = new Vector3[numCorners]; } // Permutate all axes using minCorner and maxCorner. Vector3 minCorner = bounds.center - bounds.extents; Vector3 maxCorner = bounds.center + bounds.extents; for (int c = 0; c < numCorners; c++) { positions[c] = new Vector3( (c & (1 << 0)) == 0 ? minCorner[0] : maxCorner[0], (c & (1 << 1)) == 0 ? minCorner[1] : maxCorner[1], (c & (1 << 2)) == 0 ? minCorner[2] : maxCorner[2]); } } private static void ApplyMaterialToAllRenderers(GameObject root, Material material) { if (material != null) { Renderer[] renderers = root.GetComponentsInChildren<Renderer>(); for (int i = 0; i < renderers.Length; ++i) { renderers[i].material = material; } } } private bool DoesActivationMatchFocus(FocusEventData eventData) { switch (activation) { case BoundingBoxActivationType.ActivateOnStart: case BoundingBoxActivationType.ActivateManually: return false; case BoundingBoxActivationType.ActivateByProximity: return eventData.Pointer is IMixedRealityNearPointer; case BoundingBoxActivationType.ActivateByPointer: return eventData.Pointer is IMixedRealityPointer; case BoundingBoxActivationType.ActivateByProximityAndPointer: return true; default: return false; } } private void DropController() { HandleType lastHandleType = currentHandleType; currentPointer = null; currentHandleType = HandleType.None; ResetHandleVisibility(); if (lastHandleType == HandleType.Scale) { if (debugText != null) debugText.text = "OnPointerUp:ScaleStopped"; ScaleStopped?.Invoke(); } else if (lastHandleType == HandleType.Rotation) { if (debugText != null) debugText.text = "OnPointerUp:RotateStopped"; RotateStopped?.Invoke(); } } #endregion Private Methods #region Used Event Handlers void IMixedRealityFocusChangedHandler.OnFocusChanged(FocusEventData eventData) { if (proximityEffectActive && eventData.NewFocusedObject == null) { ResetHandleProximityScale(); } if (activation == BoundingBoxActivationType.ActivateManually || activation == BoundingBoxActivationType.ActivateOnStart) { return; } if (!DoesActivationMatchFocus(eventData)) { return; } bool handInProximity = eventData.NewFocusedObject != null && eventData.NewFocusedObject.transform.IsChildOf(transform); if (handInProximity == wireframeOnly) { wireframeOnly = !handInProximity; ResetHandleVisibility(); } } void IMixedRealityFocusHandler.OnFocusExit(FocusEventData eventData) { if (currentPointer != null && eventData.Pointer == currentPointer) { DropController(); } } void IMixedRealityFocusHandler.OnFocusEnter(FocusEventData eventData) { } private void OnPointerUp(MixedRealityPointerEventData eventData) { if (currentPointer != null && eventData.Pointer == currentPointer) { DropController(); eventData.Use(); } } private void OnPointerDown(MixedRealityPointerEventData eventData) { if (currentPointer == null && !eventData.used) { GameObject grabbedHandle = eventData.Pointer.Result.CurrentPointerTarget; Transform grabbedHandleTransform = grabbedHandle.transform; currentHandleType = GetHandleType(grabbedHandleTransform); if (currentHandleType != HandleType.None) { currentPointer = eventData.Pointer; initialGrabPoint = currentPointer.Result.Details.Point; currentGrabPoint = initialGrabPoint; initialScaleOnGrabStart = Target.transform.localScale; initialPositionOnGrabStart = Target.transform.position; grabPointInPointer = Quaternion.Inverse(eventData.Pointer.Rotation) * (initialGrabPoint - currentPointer.Position); SetHighlighted(grabbedHandleTransform); if (currentHandleType == HandleType.Scale) { // Will use this to scale the target relative to the opposite corner oppositeCorner = rigRoot.transform.TransformPoint(-grabbedHandle.transform.localPosition); diagonalDir = (grabbedHandle.transform.position - oppositeCorner).normalized; ScaleStarted?.Invoke(); if (debugText != null) { debugText.text = "OnPointerDown:ScaleStarted"; } } else if (currentHandleType == HandleType.Rotation) { currentRotationAxis = GetRotationAxis(grabbedHandleTransform); RotateStarted?.Invoke(); if (debugText != null) { debugText.text = "OnPointerDown:RotateStarted"; } } eventData.Use(); } } if (currentPointer != null) { // Always mark the pointer data as used to prevent any other behavior to handle pointer events // as long as BoundingBox manipulation is active. // This is due to us reacting to both "Select" and "Grip" events. eventData.Use(); } } private void OnPointerDragged(MixedRealityPointerEventData eventData) { } public void OnSourceDetected(SourceStateEventData eventData) { if (eventData.Controller != null) { if (sourcesDetected.Count == 0 || sourcesDetected.Contains(eventData.Controller) == false) { sourcesDetected.Add(eventData.Controller); } } } public void OnSourceLost(SourceStateEventData eventData) { sourcesDetected.Remove(eventData.Controller); if (currentPointer != null && currentPointer.InputSourceParent.SourceId == eventData.SourceId) { HandleType lastHandleType = currentHandleType; currentPointer = null; currentHandleType = HandleType.None; ResetHandleVisibility(); if (lastHandleType == HandleType.Scale) { if (debugText != null) debugText.text = "OnSourceLost:ScaleStopped"; ScaleStopped?.Invoke(); } else if (lastHandleType == HandleType.Rotation) { if (debugText != null) debugText.text = "OnSourceLost:RotateStopped"; RotateStopped?.Invoke(); } } } #endregion Used Event Handlers #region Unused Event Handlers void IMixedRealityFocusChangedHandler.OnBeforeFocusChange(FocusEventData eventData) { } #endregion Unused Event Handlers } }
37.103654
234
0.537352
[ "MIT" ]
MRW-Eric/MixedRealityToolkit-Unity
Assets/MRTK/SDK/Features/UX/Scripts/BoundingBox/BoundingBox.cs
99,514
C#
using System.Collections.Generic; using System.IO; using PizzaBox.Domain.Abstracts; using PizzaBox.Domain.Models; using PizzaBox.Storing; namespace PizzaBox.Domain.Singletons { /// <summary> /// /// </summary> public class StoreSingleton { readonly private string _storesPath = "Stores.xml"; private static StoreSingleton _storeSingleton; public List<Store> Stores { get; set; } public static StoreSingleton Instance { get { if(_storeSingleton == null) { _storeSingleton = new StoreSingleton(); } return _storeSingleton; } } private StoreSingleton() { if(File.Exists(_storesPath)) { LoadStores(); }/* else { Stores = new List<Store>(); Stores.Add(new Store("Steve's Pizzeria", 192)); Stores.Add(new Store("Panucci's Pizza", 136)); SaveStores(); }*/ } private void LoadStores() { Stores = (List<Store>)FileStorage.Instance.ReadFromXml<Store>(_storesPath); } private void SaveStores() { FileStorage.Instance.WriteToXml<Store>(Stores, _storesPath); } } }
25.545455
87
0.508897
[ "MIT" ]
Kugelsicher/pizzabox_p1
PizzaBox.Domain/Singletons/StoreSingleton.cs
1,405
C#
using AutoFixture; using FluentAssertions; using TramsDataApi.DatabaseModels; using TramsDataApi.Factories; using Xunit; namespace TramsDataApi.Test.Factories { public class AcademyConversionProjectNoteResponseFactoryTests { private readonly Fixture _fixture; public AcademyConversionProjectNoteResponseFactoryTests() { _fixture = new Fixture(); } [Fact] public void ReturnsAcademyConversionProjectNoteResponse_WhenGivenAcademyConversionProjectNote() { var projectNote = _fixture.Create<AcademyConversionProjectNote>(); var response = AcademyConversionProjectNoteResponseFactory.Create(projectNote); response.Subject.Should().Be(projectNote.Subject); response.Note.Should().Be(projectNote.Note); response.Author.Should().Be(projectNote.Author); response.Date.Should().Be(projectNote.Date); } } }
30.967742
103
0.698958
[ "MIT" ]
DFE-Digital/trams-data-api
TramsDataApi.Test/Factories/AcademyConversionProjectNoteResponseFactoryTests.cs
960
C#
using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SEIDR.Test { [TestClass] public class DocRandTest { Doc.DocValueRandom r = new Doc.DocValueRandom(); [TestMethod] public void RandomDateTime() { DateTime? n = r.GetDateTimeNullable(30, 2010, yearThrough: 2020); if (n == null) return; DateTime dt = n.Value; Assert.IsTrue(dt.Year >= 2010); Assert.IsTrue(dt.Year <= 2020); } [TestMethod] public void percentCheckTest() { for(int i = 0; i < 10000; i++) { Assert.IsTrue(r.PercentCheck(100)); Assert.IsFalse(r.PercentCheck(0)); } } [TestMethod] public void PercentDecimalPointTest() { int counter = 0; const int LIMIT_COUNT = 10000000; const double PERCENT = 7.05834; const double EXPECTED = LIMIT_COUNT * PERCENT * .01; const double VARIANCE = LIMIT_COUNT * .00010; //.001% for (int i = 0; i < LIMIT_COUNT; i++) { if (r.PercentCheck(PERCENT)) counter++; } Assert.IsTrue(counter.Between((int)(EXPECTED - VARIANCE), (int)(EXPECTED + VARIANCE))); } [TestMethod] public void RandomText() { string test = r.GetText(6000); Assert.AreEqual(6000, test.Length); test = r.GetText(12000); Assert.AreEqual(12000, test.Length); test = r.GetText(15); Assert.AreEqual(15, test.Length); } [TestMethod] public void RandomString() { string phonePattern = "([1-9]{3})[1-9]{3}-[1-9]{4}@@"; //Phone pattern + @@ string s = r.GetString(phonePattern); string phonePatternRegexAssert = @"\([1-9]{3}\)[1-9]{3}\-[1-9]{4}@@"; //Escape regex special characters to assert. Assert.IsTrue(s.Like(phonePatternRegexAssert, false)); string ssnPattern = "[1-57-9][0-9]{2}-[0-9]{2}-[1-9][0-9]{3}"; s = r.GetString(ssnPattern); string ssnPatternRegexAssert = @"[1-57-9][0-9]{2}\-[0-9]{2}\-[1-9][0-9]{3}"; Assert.IsTrue(s.Like(ssnPatternRegexAssert, false)); string escapePattern = @"@[1-2]\{2}"; s = r.GetString(escapePattern); Assert.IsTrue(s.Like(escapePattern, false)); } } }
31.364706
126
0.52138
[ "MIT" ]
maron6/SEIDR
SEIDR.Test/DocRandTest.cs
2,668
C#
using AutoMapper; using EasyManager.Application.Interfaces; using EasyManager.Application.ViewModels; using EasyManager.Domain.Commands; using EasyManager.Domain.Core.Bus; using EasyManager.Domain.Interfaces; using EasyManager.Infra.Data.Repository.EventSourcing; namespace EasyManager.Application.Services { public class BankAccountAppService : BaseAppService<Domain.Models.BankAccount, BankAccountViewModel, BankAccountShortViewModel, IBankAccountRepository, RegisterNewBankAccountCommand, RemoveBankAccountCommand, UpdateBankAccountCommand>, IBankAccountAppService { public BankAccountAppService(IMapper mapper, IBankAccountRepository repository, IMediatorHandler bus, IEventStoreRepository eventStoreRepository) : base(mapper, repository, bus, eventStoreRepository) { } } }
38.642857
134
0.625693
[ "Apache-2.0" ]
fahelmoreira/EasyManagerERP
src/EasyManager.Application/Services/BankAccountAppService.cs
1,082
C#
using System; using System.Collections.ObjectModel; namespace S22.Mail { [Serializable] public class SerializableAttachmentCollection : Collection<SerializableAttachment>, IDisposable { /// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { } } }
24.3125
114
0.717224
[ "MIT" ]
castle-it/S22.Mail
SerializableMailMessage/SerializableAttachmentCollection.cs
391
C#
using System; using Xamarin.Forms; namespace MicrosoftHouse { public class CustomEntry : Entry { /// <summary> /// The font property /// </summary> public static readonly BindableProperty FontProperty = BindableProperty.Create("Font", typeof(Font), typeof(CustomEntry), new Font()); /// <summary> /// The XAlign property /// </summary> public static readonly BindableProperty XAlignProperty = BindableProperty.Create("XAlign", typeof(TextAlignment), typeof(CustomEntry), TextAlignment.Start); /// <summary> /// The PlaceholderTextColor property /// </summary> public static readonly BindableProperty PlaceholderTextColorProperty = BindableProperty.Create("PlaceholderTextColor", typeof(Color), typeof(CustomEntry), Color.Default); /// <summary> /// The MaxLength property /// </summary> public static readonly BindableProperty MaxLengthProperty = BindableProperty.Create("MaxLength", typeof(int), typeof(CustomEntry), int.MaxValue); /// <summary> /// Gets or sets the MaxLength /// </summary> public int MaxLength { get { return (int)this.GetValue(MaxLengthProperty); } set { this.SetValue(MaxLengthProperty, value); } } /// <summary> /// Gets or sets the Font /// </summary> public Font Font { get { return (Font)GetValue(FontProperty); } set { SetValue(FontProperty, value); } } /// <summary> /// Gets or sets the X alignment of the text /// </summary> public TextAlignment XAlign { get { return (TextAlignment)GetValue(XAlignProperty); } set { SetValue(XAlignProperty, value); } } /// <summary> /// Sets color for placeholder text /// </summary> public Color PlaceholderTextColor { get { return (Color)GetValue(PlaceholderTextColorProperty); } set { SetValue(PlaceholderTextColorProperty, value); } } } }
25.915493
102
0.691848
[ "MIT" ]
Menne/Microsoft-House
App/MicrosoftHouse/MicrosoftHouse/Controls/CustomEntry.cs
1,842
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ namespace BankProject { public partial class OpenCustomerAccount { /// <summary> /// ValidationSummary1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; /// <summary> /// RadWindowManager1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadWindowManager RadWindowManager1; /// <summary> /// RadToolBar1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadToolBar RadToolBar1; /// <summary> /// txtId control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.TextBox txtId; /// <summary> /// lblDepositCode control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lblDepositCode; /// <summary> /// RequiredFieldValidator1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; /// <summary> /// cmbCustomerId control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbCustomerId; /// <summary> /// lbCustomerName control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lbCustomerName; /// <summary> /// lbCustomerType control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lbCustomerType; /// <summary> /// RequiredFieldValidator2 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2; /// <summary> /// cmbCategory control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbCategory; /// <summary> /// lbCategoryType control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lbCategoryType; /// <summary> /// cmbProductLine control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbProductLine; /// <summary> /// RequiredFieldValidator3 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator3; /// <summary> /// cmbCurrency control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbCurrency; /// <summary> /// txtAccountTitle control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadTextBox txtAccountTitle; /// <summary> /// txtShortTitle control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadTextBox txtShortTitle; /// <summary> /// cmbAccountOfficer control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbAccountOfficer; /// <summary> /// cmbChargeCode control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbChargeCode; /// <summary> /// cmbIDJoinHolder control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbIDJoinHolder; /// <summary> /// lbJoinHolderName control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Label lbJoinHolderName; /// <summary> /// cmbRelationCode control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbRelationCode; /// <summary> /// txtJoinNotes control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadTextBox txtJoinNotes; /// <summary> /// cmbRestrictTxn control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadComboBox cmbRestrictTxn; /// <summary> /// tbIntCaptoAC control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadTextBox tbIntCaptoAC; /// <summary> /// RadAjaxManager1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadAjaxManager RadAjaxManager1; /// <summary> /// RadCodeBlock1 control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadCodeBlock RadCodeBlock1; /// <summary> /// btSearch control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::System.Web.UI.WebControls.Button btSearch; /// <summary> /// txtDocID control. /// </summary> /// <remarks> /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// </remarks> protected global::Telerik.Web.UI.RadTextBox txtDocID; } }
36.916968
100
0.537942
[ "Apache-2.0", "BSD-3-Clause" ]
nguyenppt/biscorebanksys
DesktopModules/TrainingCoreBanking/BankProject/OpenCustomerAccount.ascx.designer.cs
10,228
C#
using System; using System.Collections.Generic; using Comformation.IntrinsicFunctions; namespace Comformation.EKS.Cluster { /// <summary> /// AWS::EKS::Cluster /// https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-cluster.html /// </summary> public class ClusterResource : ResourceBase { public class ClusterProperties { /// <summary> /// Version /// The desired Kubernetes version for your cluster. If you don&#39;t specify a value here, the latest /// version available in Amazon EKS is used. /// Required: No /// Type: String /// Update requires: No interruption /// </summary> public Union<string, IntrinsicFunction> Version { get; set; } /// <summary> /// EncryptionConfig /// The encryption configuration for the cluster. /// Required: No /// Type: List of EncryptionConfig /// Maximum: 1 /// Update requires: Replacement /// </summary> public List<EncryptionConfig> EncryptionConfig { get; set; } /// <summary> /// RoleArn /// The Amazon Resource Name (ARN) of the IAM role that provides permissions for the Kubernetes control /// plane to make calls to AWS API operations on your behalf. For more information, see Amazon EKS /// Service IAM Role in the Amazon EKS User Guide . /// Required: Yes /// Type: String /// Update requires: Replacement /// </summary> public Union<string, IntrinsicFunction> RoleArn { get; set; } /// <summary> /// ResourcesVpcConfig /// The VPC configuration used by the cluster control plane. Amazon EKS VPC resources have specific /// requirements to work properly with Kubernetes. For more information, see Cluster VPC Considerations /// and Cluster Security Group Considerations in the Amazon EKS User Guide. You must specify at least /// two subnets. You can specify up to five security groups, but we recommend that you use a dedicated /// security group for your cluster control plane. /// Required: Yes /// Type: ResourcesVpcConfig /// Update requires: Replacement /// </summary> public ResourcesVpcConfig ResourcesVpcConfig { get; set; } /// <summary> /// KubernetesNetworkConfig /// The Kubernetes network configuration for the cluster. /// Required: No /// Type: KubernetesNetworkConfig /// Update requires: Replacement /// </summary> public KubernetesNetworkConfig KubernetesNetworkConfig { get; set; } /// <summary> /// Name /// The unique name to give to your cluster. /// Required: No /// Type: String /// Minimum: 1 /// Maximum: 100 /// Pattern: ^[0-9A-Za-z][A-Za-z0-9\-_]* /// Update requires: Replacement /// </summary> public Union<string, IntrinsicFunction> Name { get; set; } } public string Type { get; } = "AWS::EKS::Cluster"; public ClusterProperties Properties { get; } = new ClusterProperties(); } public static class ClusterAttributes { public static readonly ResourceAttribute<Union<string, IntrinsicFunction>> Endpoint = new ResourceAttribute<Union<string, IntrinsicFunction>>("Endpoint"); public static readonly ResourceAttribute<Union<string, IntrinsicFunction>> ClusterSecurityGroupId = new ResourceAttribute<Union<string, IntrinsicFunction>>("ClusterSecurityGroupId"); public static readonly ResourceAttribute<Union<string, IntrinsicFunction>> EncryptionConfigKeyArn = new ResourceAttribute<Union<string, IntrinsicFunction>>("EncryptionConfigKeyArn"); public static readonly ResourceAttribute<Union<string, IntrinsicFunction>> Arn = new ResourceAttribute<Union<string, IntrinsicFunction>>("Arn"); public static readonly ResourceAttribute<Union<string, IntrinsicFunction>> CertificateAuthorityData = new ResourceAttribute<Union<string, IntrinsicFunction>>("CertificateAuthorityData"); public static readonly ResourceAttribute<Union<string, IntrinsicFunction>> OpenIdConnectIssuerUrl = new ResourceAttribute<Union<string, IntrinsicFunction>>("OpenIdConnectIssuerUrl"); } }
47.091837
194
0.624702
[ "MIT" ]
stanb/Comformation
src/Comformation/Generated/EKS/Cluster/ClusterResource.cs
4,615
C#
using Chloe.Core; using Chloe.Core.Visitors; using Chloe.DbExpressions; using Chloe.Descriptors; using Chloe.Entity; using Chloe.Exceptions; using Chloe.Infrastructure; using Chloe.InternalExtensions; using Chloe.Utility; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Text; namespace Chloe.PostgreSQL { public partial class PostgreSQLContext : DbContext { static Action<TEntity, IDataReader> GetMapper<TEntity>(PropertyDescriptor propertyDescriptor, int ordinal) { Action<TEntity, IDataReader> mapper = (TEntity entity, IDataReader reader) => { object value = reader.GetValue(ordinal); if (value == null || value == DBNull.Value) throw new ChloeException("Unable to get the identity/sequence value."); value = PublicHelper.ConvertObjType(value, propertyDescriptor.PropertyType); propertyDescriptor.SetValue(entity, value); }; return mapper; } string AppendInsertRangeSqlTemplate(DbTable table, List<PropertyDescriptor> mappingPropertyDescriptors) { StringBuilder sqlBuilder = new StringBuilder(); sqlBuilder.Append("INSERT INTO "); sqlBuilder.Append(this.AppendTableName(table)); sqlBuilder.Append("("); for (int i = 0; i < mappingPropertyDescriptors.Count; i++) { PropertyDescriptor mappingPropertyDescriptor = mappingPropertyDescriptors[i]; if (i > 0) sqlBuilder.Append(","); sqlBuilder.Append(Utils.QuoteName(mappingPropertyDescriptor.Column.Name, this.ConvertToLowercase)); } sqlBuilder.Append(") VALUES"); string sqlTemplate = sqlBuilder.ToString(); return sqlTemplate; } string AppendTableName(DbTable table) { if (string.IsNullOrEmpty(table.Schema)) return Utils.QuoteName(table.Name, this.ConvertToLowercase); return string.Format("{0}.{1}", Utils.QuoteName(table.Schema, this.ConvertToLowercase), Utils.QuoteName(table.Name, this.ConvertToLowercase)); } } }
34.776119
154
0.645064
[ "MIT" ]
1163891508/Chloe
src/Chloe.PostgreSQL/PostgreSQLContext_Helper.cs
2,332
C#
// <developer>niklas@protocol7.com</developer> // <completed>100</completed> using System; using System.Xml; namespace SharpVectors.Dom.Css { /// <summary> /// This interface represents a CSS view. The getComputedStyle /// method provides a read only access to the computed values of /// an element. /// </summary> public interface ICssView { /// <summary> /// This method is used to get the computed style as it is defined in [CSS2]. /// </summary> /// <param name="elt">The element whose style is to be computed. This parameter cannot be null.</param> /// <param name="pseudoElt">The pseudo-element or null if none</param> ICssStyleDeclaration GetComputedStyle(XmlElement elt, string pseudoElt); } }
31.291667
106
0.687084
[ "BSD-3-Clause" ]
GuillaumeSmartLiberty/SharpVectors
Main/Source/SharpVectorCore/Css/ICssView.cs
751
C#
using System; using System.CodeDom.Compiler; using System.ComponentModel; using System.Diagnostics; using System.Runtime.CompilerServices; using System.Xml.Schema; using System.Xml.Serialization; namespace Workday.StudentRecords { [GeneratedCode("System.Xml", "4.6.1590.0"), DesignerCategory("code"), DebuggerStepThrough, XmlType(Namespace = "urn:com.workday/bsvc")] [Serializable] public class Student_GradeObjectType : INotifyPropertyChanged { private Student_GradeObjectIDType[] idField; private string descriptorField; [method: CompilerGenerated] [CompilerGenerated] public event PropertyChangedEventHandler PropertyChanged; [XmlElement("ID", Order = 0)] public Student_GradeObjectIDType[] ID { get { return this.idField; } set { this.idField = value; this.RaisePropertyChanged("ID"); } } [XmlAttribute(Form = XmlSchemaForm.Qualified)] public string Descriptor { get { return this.descriptorField; } set { this.descriptorField = value; this.RaisePropertyChanged("Descriptor"); } } protected void RaisePropertyChanged(string propertyName) { PropertyChangedEventHandler propertyChanged = this.PropertyChanged; if (propertyChanged != null) { propertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } }
21.918033
136
0.732984
[ "MIT" ]
matteofabbri/Workday.WebServices
Workday.StudentRecords/Student_GradeObjectType.cs
1,337
C#
using System; using System.Collections.Generic; using System.Reactive.Concurrency; using System.Reactive.Linq; using System.Reactive.Subjects; using System.Threading.Tasks; using System.Windows.Media.Imaging; using Akavache; using GitHub.Caches; using GitHub.Factories; using GitHub.Services; using NSubstitute; using Rothko; using Xunit; public class ImageCacheTests { public class TheGetImageBytesMethod : TestBaseClass { [Fact] public async Task RetrievesImageFromCacheAndDoesNotFetchIt() { var singlePixel = Convert.FromBase64String("R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw=="); var cache = new InMemoryBlobCache(); await cache.Insert("https://fake/", singlePixel); var cacheFactory = Substitute.For<IBlobCacheFactory>(); cacheFactory.CreateBlobCache(Args.String).Returns(cache); var imageDownloader = Substitute.For<IImageDownloader>(); imageDownloader.DownloadImageBytes(Args.Uri).Returns(_ => { throw new InvalidOperationException(); }); var imageCache = new ImageCache(cacheFactory, Substitute.For<IEnvironment>(), new Lazy<IImageDownloader>(() => imageDownloader)); var retrieved = await imageCache.GetImage(new Uri("https://fake/")).FirstAsync(); Assert.NotNull(retrieved); Assert.Equal(32, retrieved.PixelWidth); Assert.Equal(32, retrieved.PixelHeight); } [Fact] public async Task WhenLoadingFromCacheFailsInvalidatesCacheEntry() { var cache = new InMemoryBlobCache(); await cache.Insert("https://fake/", new byte[] { 0, 0, 0 }); var cacheFactory = Substitute.For<IBlobCacheFactory>(); cacheFactory.CreateBlobCache(Args.String).Returns(cache); var imageDownloader = Substitute.For<IImageDownloader>(); imageDownloader.DownloadImageBytes(Args.Uri).Returns(_ => { throw new InvalidOperationException(); }); var imageCache = new ImageCache(cacheFactory, Substitute.For<IEnvironment>(), new Lazy<IImageDownloader>(() => imageDownloader)); var retrieved = await imageCache .GetImage(new Uri("https://fake/")) .Catch(Observable.Return<BitmapSource>(null)) .FirstAsync(); Assert.Null(retrieved); await Assert.ThrowsAsync<KeyNotFoundException>(async () => await cache.Get("https://fake/")); } [Fact] public async Task DownloadsImageWhenMissingAndCachesIt() { var singlePixel = Convert.FromBase64String("R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw=="); var imageUri = new Uri("https://example.com/poop.gif"); var cacheFactory = Substitute.For<IBlobCacheFactory>(); cacheFactory.CreateBlobCache(Args.String).Returns(new InMemoryBlobCache()); var imageDownloader = Substitute.For<IImageDownloader>(); imageDownloader.DownloadImageBytes(imageUri).Returns(Observable.Return(singlePixel)); var imageCache = new ImageCache(cacheFactory, Substitute.For<Rothko.Environment>(), new Lazy<IImageDownloader>(() => imageDownloader)); var retrieved = await imageCache.GetImage(imageUri).FirstAsync(); Assert.NotNull(retrieved); Assert.Equal(32, retrieved.PixelWidth); Assert.Equal(32, retrieved.PixelHeight); } [Fact] public async Task ThrowsKeyNotFoundExceptionWhenItemNotInCacheAndImageFetchThrowsException() { var imageUri = new Uri("https://example.com/poop.gif"); var cacheFactory = Substitute.For<IBlobCacheFactory>(); cacheFactory.CreateBlobCache(Args.String).Returns(new InMemoryBlobCache()); var imageDownloader = Substitute.For<IImageDownloader>(); imageDownloader.DownloadImageBytes(imageUri).Returns(Observable.Throw<byte[]>(new InvalidOperationException())); var imageCache = new ImageCache(cacheFactory, Substitute.For<IEnvironment>(), new Lazy<IImageDownloader>(() => imageDownloader)); await Assert.ThrowsAsync<KeyNotFoundException>(async () => await imageCache.GetImage(imageUri).FirstAsync()); } [Fact] public async Task ThrowsKeyNotFoundExceptionWhenItemNotInCacheAndImageFetchReturnsEmpty() { var imageUri = new Uri("https://example.com/poop.gif"); var cache = new InMemoryBlobCache(); var cacheFactory = Substitute.For<IBlobCacheFactory>(); cacheFactory.CreateBlobCache(Args.String).Returns(cache); var imageDownloader = Substitute.For<IImageDownloader>(); imageDownloader.DownloadImageBytes(imageUri).Returns(Observable.Empty<byte[]>()); var imageCache = new ImageCache(cacheFactory, Substitute.For<IEnvironment>(), new Lazy<IImageDownloader>(() => imageDownloader)); await Assert.ThrowsAsync<KeyNotFoundException>(async () => await imageCache.GetImage(imageUri).FirstAsync()); } [Fact] public void OnlyDownloadsAndDecodesOnceForConcurrentOperations() { var singlePixel = Convert.FromBase64String("R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw=="); var subj = new Subject<byte[]>(); var cache = new InMemoryBlobCache(Scheduler.Immediate); var cacheFactory = Substitute.For<IBlobCacheFactory>(); cacheFactory.CreateBlobCache(Args.String).Returns(cache); var imageDownloader = Substitute.For<IImageDownloader>(); imageDownloader.DownloadImageBytes(Args.Uri).Returns(subj, Observable.Throw<byte[]>(new InvalidOperationException())); var imageCache = new ImageCache(cacheFactory, Substitute.For<IEnvironment>(), new Lazy<IImageDownloader>(() => imageDownloader)); var uri = new Uri("https://github.com/foo.png"); BitmapSource res1 = null; BitmapSource res2 = null; var sub1 = imageCache.GetImage(uri).Subscribe(x => res1 = x); var sub2 = imageCache.GetImage(uri).Subscribe(x => res2 = x); Assert.Null(res1); Assert.Null(res2); subj.OnNext(singlePixel); subj.OnCompleted(); Assert.NotNull(res1); Assert.Equal(res1, res2); } } public class TheInvalidateMethod : TestBaseClass { [Fact] public async Task RemovesImageFromCache() { var singlePixel = Convert.FromBase64String("R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw=="); var cache = new InMemoryBlobCache(); await cache.Insert("https://fake/", singlePixel); var cacheFactory = Substitute.For<IBlobCacheFactory>(); cacheFactory.CreateBlobCache(Args.String).Returns(cache); var imageCache = new ImageCache(cacheFactory, Substitute.For<IEnvironment>(), new Lazy<IImageDownloader>(() => Substitute.For<IImageDownloader>())); await imageCache.Invalidate(new Uri("https://fake/")); await Assert.ThrowsAsync<KeyNotFoundException>(async () => await cache.Get("https://fake/")); } } public class TheSeedImageMethod : TestBaseClass { [Fact] public async Task AddsImageDirectlyToCache() { var singlePixel = Convert.FromBase64String("R0lGODlhAQABAIAAAAAAAAAAACH5BAAAAAAALAAAAAABAAEAAAICTAEAOw=="); var cache = new InMemoryBlobCache(); var cacheFactory = Substitute.For<IBlobCacheFactory>(); cacheFactory.CreateBlobCache(Args.String).Returns(cache); var imageCache = new ImageCache(cacheFactory, Substitute.For<IEnvironment>(), new Lazy<IImageDownloader>(() => Substitute.For<IImageDownloader>())); await imageCache.SeedImage(new Uri("https://fake/"), singlePixel, DateTimeOffset.MaxValue); var retrieved = await cache.Get("https://fake/"); Assert.Equal(singlePixel, retrieved); } } }
46.5625
160
0.659304
[ "MIT" ]
Acidburn0zzz/Github-io-VisualStudio
src/UnitTests/GitHub.App/Caches/ImageCacheTests.cs
8,197
C#
namespace SampleProject.Application.Customers.IntegrationHandlers { using Configuration.DomainEvents; using Domain.Customers; using Newtonsoft.Json; public class CustomerRegisteredNotification : DomainNotificationBase<CustomerRegisteredEvent> { public CustomerRegisteredNotification(CustomerRegisteredEvent domainEvent) : base(domainEvent) { CustomerId = domainEvent.CustomerId; } [JsonConstructor] public CustomerRegisteredNotification(CustomerId customerId) : base(null) { CustomerId = customerId; } public CustomerId CustomerId { get; } } }
29.954545
102
0.698027
[ "MIT" ]
gabrielesteveslima/net-public-sample-dotnet-core-cqrs-api
src/SampleProject.Application/Customers/IntegrationHandlers/CustomerRegisteredNotification.cs
661
C#
using System; using System.Collections.Generic; using System.Text; namespace HelpScoutSharp { public class Thread : IHasId { public class Action { public string type { get; set; } public string text { get; set; } //public associatedEntities } public class Source { public string type { get; set; } public string via { get; set; } } public class AssignedTo { public long id { get; set; } public string first { get; set; } public string last { get; set; } public string email { get; set; } public string type { get; set; } } public class CreatedBy { public long id { get; set; } public string type { get; set; } public string first { get; set; } public string last { get; set; } public string email { get; set; } } public class ThreadCustomer { public long id { get; set; } public string photoUrl { get; set; } public string first { get; set; } public string last { get; set; } public string email { get; set; } } public class Embedded { public class Attachment { public long id { get; set; } public string filename { get; set; } public string mimeType { get; set; } public long? width { get; set; } public long? height { get; set; } public long size { get; set; } } public Attachment[] attachments { get; set; } } public long id { get; set; } public AssignedTo assignedTo { get; set; } public string status { get; set; } public string state { get; set; } public Action action { get; set; } public string body { get; set; } public Source source { get; set; } public ThreadCustomer customer { get; set; } public CreatedBy createdBy { get; set; } public long savedReplyId { get; set; } public string type { get; set; } public string[] to { get; set; } public string[] cc { get; set; } public string[] bcc { get; set; } public DateTime createdAt { get; set; } public DateTime? openedAt { get; set; } public Embedded _embedded { get; set; } } }
21.512605
57
0.497656
[ "MIT" ]
better-reports/HelpScoutSharp
HelpScoutSharp/Conversations/Threads/Thread.cs
2,562
C#
using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; // 有关程序集的常规信息通过以下 // 特性集控制。更改这些特性值可修改 // 与程序集关联的信息。 [assembly: AssemblyTitle("EmitLogDirect")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("EmitLogDirect")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] // 将 ComVisible 设置为 false 使此程序集中的类型 // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, // 则将该类型上的 ComVisible 特性设置为 true。 [assembly: ComVisible(false)] // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID [assembly: Guid("e07575ba-38fa-41e2-8483-5c8479ada551")] // 程序集的版本信息由下面四个值组成: // // 主版本 // 次版本 // 生成号 // 修订号 // // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, // 方法是按如下所示使用“*”: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")]
25.810811
56
0.713089
[ "Apache-2.0" ]
luoyefeiwu/Jerry
Jerry/RabbitMQ/Routing/EmitLogDirect/Properties/AssemblyInfo.cs
1,314
C#
using System; using System.IO; using System.Xml; namespace xharness { static class PListExtensions { public static void LoadWithoutNetworkAccess (this XmlDocument doc, string filename) { using (var fs = new FileStream (filename, FileMode.Open, FileAccess.Read)) { var settings = new XmlReaderSettings () { XmlResolver = null, DtdProcessing = DtdProcessing.Parse, }; using (var reader = XmlReader.Create (fs, settings)) { doc.Load (reader); } } } public static void SetMinimumOSVersion (this XmlDocument plist, string value) { SetPListStringValue (plist, "MinimumOSVersion", value); } public static string GetMinimumOSVersion (this XmlDocument plist) { return GetPListStringValue (plist, "MinimumOSVersion"); } public static void SetCFBundleIdentifier (this XmlDocument plist, string value) { SetPListStringValue (plist, "CFBundleIdentifier", value); } public static void SetCFBundleName (this XmlDocument plist, string value) { SetPListStringValue (plist, "CFBundleName", value); } public static void SetUIDeviceFamily (this XmlDocument plist, params int[] families) { SetPListArrayOfIntegerValues (plist, "UIDeviceFamily", families); } public static string GetCFBundleIdentifier (this XmlDocument plist) { return GetPListStringValue (plist, "CFBundleIdentifier"); } public static string GetPListStringValue (this XmlDocument plist, string node) { return plist.SelectSingleNode ("//dict/key[text()='" + node + "']").NextSibling.InnerText; } public static void SetPListStringValue (this XmlDocument plist, string node, string value) { plist.SelectSingleNode ("//dict/key[text()='" + node + "']").NextSibling.InnerText = value; } public static void AddPListStringValue (this XmlDocument plist, string node, string value) { var keyElement = plist.CreateElement ("key"); keyElement.InnerText = node; var valueElement = plist.CreateElement ("string"); valueElement.InnerText = value; var root = plist.SelectSingleNode ("//dict"); root.AppendChild (keyElement); root.AppendChild (valueElement); } public static void AddPListKeyValuePair (this XmlDocument plist, string node, string valueType, string value) { var keyElement = plist.CreateElement ("key"); keyElement.InnerText = node; var valueElement = plist.CreateElement (valueType); valueElement.InnerXml = value; var root = plist.SelectSingleNode ("//dict"); root.AppendChild (keyElement); root.AppendChild (valueElement); } public static void SetPListArrayOfIntegerValues (this XmlDocument plist, string node, params int[] values) { var key = plist.SelectSingleNode ("//dict/key[text()='" + node + "']"); key.ParentNode.RemoveChild (key.NextSibling); var array = plist.CreateElement ("array"); foreach (var value in values) { var element = plist.CreateElement ("integer"); element.InnerText = value.ToString (); array.AppendChild (element); } key.ParentNode.InsertAfter (array, key); } public static void RemoveUIRequiredDeviceCapabilities (this XmlDocument plist) { var key = plist.SelectSingleNode ("//dict/key[text()='UIRequiredDeviceCapabilities']"); key.ParentNode.RemoveChild (key.NextSibling); key.ParentNode.RemoveChild (key); } public static bool ContainsKey (this XmlDocument plist, string key) { return plist.SelectSingleNode ("//dict/key[text()='" + key + "']") != null; } } }
31.432432
111
0.715105
[ "BSD-3-Clause" ]
ludovic-henry/xamarin-macios
tests/xharness/PListExtensions.cs
3,491
C#
namespace Shared.Group_003 { using Xunit; public class Benchmark048Tests { [Fact] public void Test_001() { } [Fact] public void Test_002() { } [Fact] public void Test_003() { } [Fact] public void Test_004() { } [Fact] public void Test_005() { } [Fact] public void Test_006() { } [Fact] public void Test_007() { } [Fact] public void Test_008() { } [Fact] public void Test_009() { } [Fact] public void Test_010() { } [Fact] public void Test_011() { } [Fact] public void Test_012() { } [Fact] public void Test_013() { } [Fact] public void Test_014() { } [Fact] public void Test_015() { } [Fact] public void Test_016() { } [Fact] public void Test_017() { } [Fact] public void Test_018() { } [Fact] public void Test_019() { } [Fact] public void Test_020() { } [Fact] public void Test_021() { } [Fact] public void Test_022() { } [Fact] public void Test_023() { } [Fact] public void Test_024() { } [Fact] public void Test_025() { } [Fact] public void Test_026() { } [Fact] public void Test_027() { } [Fact] public void Test_028() { } [Fact] public void Test_029() { } [Fact] public void Test_030() { } [Fact] public void Test_031() { } [Fact] public void Test_032() { } [Fact] public void Test_033() { } [Fact] public void Test_034() { } [Fact] public void Test_035() { } [Fact] public void Test_036() { } [Fact] public void Test_037() { } [Fact] public void Test_038() { } [Fact] public void Test_039() { } [Fact] public void Test_040() { } [Fact] public void Test_041() { } [Fact] public void Test_042() { } [Fact] public void Test_043() { } [Fact] public void Test_044() { } [Fact] public void Test_045() { } [Fact] public void Test_046() { } [Fact] public void Test_047() { } [Fact] public void Test_048() { } [Fact] public void Test_049() { } [Fact] public void Test_050() { } } }
37.220339
41
0.529144
[ "MIT" ]
chan18/fixie.benchmark
src/Shared/Group_003/Benchmark048Tests.cs
2,196
C#
using System; using System.IO; using Dapper; using FewBox.Core.Persistence.Orm; using Microsoft.VisualStudio.TestTools.UnitTesting; using Moq; namespace FewBox.Core.Persistence.UnitTest { [TestClass] public class OrmSessionUnitTest { private ICurrentUser<Guid> CurrentUser { get; set; } private IOrmConfiguration OrmConfiguration { get; set; } [TestInitialize] public void Init() { SqlMapper.AddTypeHandler(new SQLiteGuidTypeHandler()); string filePath = $"{Environment.CurrentDirectory}/FewBox.sqlite"; if (!File.Exists(filePath)) { throw new Exception($"The SQLite file '{filePath}' is not exists!"); } var ormConfigurationMock = new Mock<IOrmConfiguration>(); ormConfigurationMock.Setup(x => x.GetConnectionString()).Returns($"Data Source={filePath};"); //Server=localhost;Database=fewbox;Uid=fewbox;Pwd=fewbox;SslMode=REQUIRED;Charset=utf8;ConnectionTimeout=60;DefaultCommandTimeout=60; this.OrmConfiguration = ormConfigurationMock.Object; var currentUserMock = new Mock<ICurrentUser<Guid>>(); currentUserMock.Setup(x => x.GetId()).Returns(Guid.Empty); this.CurrentUser = currentUserMock.Object; } [TestMethod] public void TestSession() { int effectRows = 0; Guid record1Id = new Guid("00000000-0000-0000-0000-000000000001"); Guid record2Id = Guid.Empty; Guid char36Id = Guid.NewGuid(); this.Wrapper((appRespository) => { if (this.VerifyTempData(appRespository)) { appRespository.Clear(); } }, "app"); this.Wrapper((appRespository) => { // Create Guid id = appRespository.Save(new App { Id = record1Id, Name = "FewBox1", Key = "Landpy1", Char36Id = char36Id }); Assert.AreEqual(record1Id, id); record2Id = appRespository.Save(new App { Name = "FewBox2", Key = "Landpy2", Char36Id = char36Id }); }, "app"); this.Wrapper((appRespository) => { // Read var app2 = appRespository.FindOne(record2Id); Assert.AreEqual("FewBox2", app2.Name); Assert.AreEqual(char36Id, app2.Char36Id); // Update app2.Name = "FewBox"; app2.Char36Id = Guid.Empty; appRespository.Update(app2); }, "app"); this.Wrapper((appRespository) => { // Verify FindOne var app2 = appRespository.FindOne(record2Id); Assert.AreEqual("FewBox", app2.Name); Assert.AreEqual(Guid.Empty, app2.Char36Id); // Verify FindAll var apps = appRespository.FindAll(); Assert.IsTrue(apps.AsList().Count == 2); Assert.AreEqual("FewBox", apps.AsList()[1].Name); Assert.AreEqual(Guid.Empty, apps.AsList()[1].Char36Id); // Verify FindAll CreatedBy var createdByApps = appRespository.FindAllByCreatedBy(Guid.Empty, 1, 1 ); // Verify Count int count = appRespository.Count(); Assert.IsTrue(count == 2); // Verify Recycle appRespository.Recycle(record2Id); count = appRespository.Count(); Assert.IsTrue(count == 1); }, "app"); this.Wrapper((appRecycleRespository) => { // Verify Recycle int count = appRecycleRespository.Count(); Assert.IsTrue(count == 1); // Truncate appRecycleRespository.Clear(); }, "app_recycle"); this.Wrapper((appRespository) => { // FindOne var app = appRespository.FindOne(record1Id); // Delete effectRows = appRespository.Delete(record1Id); Assert.AreEqual(1, effectRows); }, "app"); } private bool VerifyTempData(IAppRespository appRespository) { return appRespository.Count() > 0; } private void Wrapper(Action<IAppRespository> action, string tableName) { var ormSession = new SQLiteSession(this.OrmConfiguration); var appRespository = new AppRespository(tableName, ormSession, this.CurrentUser); try { ormSession.UnitOfWork.Start(); action(appRespository); ormSession.UnitOfWork.Commit(); } catch (Exception exception) { ormSession.UnitOfWork.Rollback(); Assert.Fail(exception.Message + exception.StackTrace); } finally { ormSession.UnitOfWork.Stop(); } } } }
39.229008
239
0.535707
[ "Apache-2.0" ]
FewBox/FewBox.Core.Persistence
FewBox.Core.Persistence.UnitTest/OrmSessionUnitTest.cs
5,141
C#
//------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. // Runtime Version:4.0.30319.17929 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ #pragma warning disable 1591 namespace ChinookDatabase.DataSources._Xml.Schema { /// <summary> ///Represents a strongly typed in-memory cache of data. ///</summary> [global::System.Serializable()] [global::System.ComponentModel.DesignerCategoryAttribute("code")] [global::System.ComponentModel.ToolboxItem(true)] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")] [global::System.Xml.Serialization.XmlRootAttribute("ChinookDataSet")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")] public partial class ChinookDataSet : global::System.Data.DataSet { private GenreDataTable tableGenre; private MediaTypeDataTable tableMediaType; private ArtistDataTable tableArtist; private AlbumDataTable tableAlbum; private TrackDataTable tableTrack; private EmployeeDataTable tableEmployee; private CustomerDataTable tableCustomer; private InvoiceDataTable tableInvoice; private InvoiceLineDataTable tableInvoiceLine; private PlaylistDataTable tablePlaylist; private PlaylistTrackDataTable tablePlaylistTrack; private global::System.Data.SchemaSerializationMode _schemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public ChinookDataSet() { this.BeginInit(); this.InitClass(); global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); base.Tables.CollectionChanged += schemaChangedHandler; base.Relations.CollectionChanged += schemaChangedHandler; this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected ChinookDataSet(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context, false) { if ((this.IsBinarySerialized(info, context) == true)) { this.InitVars(false); global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); this.Tables.CollectionChanged += schemaChangedHandler1; this.Relations.CollectionChanged += schemaChangedHandler1; return; } string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string)))); if ((this.DetermineSchemaSerializationMode(info, context) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { global::System.Data.DataSet ds = new global::System.Data.DataSet(); ds.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); if ((ds.Tables["Genre"] != null)) { base.Tables.Add(new GenreDataTable(ds.Tables["Genre"])); } if ((ds.Tables["MediaType"] != null)) { base.Tables.Add(new MediaTypeDataTable(ds.Tables["MediaType"])); } if ((ds.Tables["Artist"] != null)) { base.Tables.Add(new ArtistDataTable(ds.Tables["Artist"])); } if ((ds.Tables["Album"] != null)) { base.Tables.Add(new AlbumDataTable(ds.Tables["Album"])); } if ((ds.Tables["Track"] != null)) { base.Tables.Add(new TrackDataTable(ds.Tables["Track"])); } if ((ds.Tables["Employee"] != null)) { base.Tables.Add(new EmployeeDataTable(ds.Tables["Employee"])); } if ((ds.Tables["Customer"] != null)) { base.Tables.Add(new CustomerDataTable(ds.Tables["Customer"])); } if ((ds.Tables["Invoice"] != null)) { base.Tables.Add(new InvoiceDataTable(ds.Tables["Invoice"])); } if ((ds.Tables["InvoiceLine"] != null)) { base.Tables.Add(new InvoiceLineDataTable(ds.Tables["InvoiceLine"])); } if ((ds.Tables["Playlist"] != null)) { base.Tables.Add(new PlaylistDataTable(ds.Tables["Playlist"])); } if ((ds.Tables["PlaylistTrack"] != null)) { base.Tables.Add(new PlaylistTrackDataTable(ds.Tables["PlaylistTrack"])); } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; this.Locale = ds.Locale; this.CaseSensitive = ds.CaseSensitive; this.EnforceConstraints = ds.EnforceConstraints; this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); this.InitVars(); } else { this.ReadXmlSchema(new global::System.Xml.XmlTextReader(new global::System.IO.StringReader(strSchema))); } this.GetSerializationData(info, context); global::System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new global::System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged); base.Tables.CollectionChanged += schemaChangedHandler; this.Relations.CollectionChanged += schemaChangedHandler; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public GenreDataTable Genre { get { return this.tableGenre; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public MediaTypeDataTable MediaType { get { return this.tableMediaType; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public ArtistDataTable Artist { get { return this.tableArtist; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public AlbumDataTable Album { get { return this.tableAlbum; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public TrackDataTable Track { get { return this.tableTrack; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public EmployeeDataTable Employee { get { return this.tableEmployee; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public CustomerDataTable Customer { get { return this.tableCustomer; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public InvoiceDataTable Invoice { get { return this.tableInvoice; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public InvoiceLineDataTable InvoiceLine { get { return this.tableInvoiceLine; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public PlaylistDataTable Playlist { get { return this.tablePlaylist; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] [global::System.ComponentModel.DesignerSerializationVisibility(global::System.ComponentModel.DesignerSerializationVisibility.Content)] public PlaylistTrackDataTable PlaylistTrack { get { return this.tablePlaylistTrack; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.BrowsableAttribute(true)] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Visible)] public override global::System.Data.SchemaSerializationMode SchemaSerializationMode { get { return this._schemaSerializationMode; } set { this._schemaSerializationMode = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] public new global::System.Data.DataTableCollection Tables { get { return base.Tables; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.DesignerSerializationVisibilityAttribute(global::System.ComponentModel.DesignerSerializationVisibility.Hidden)] public new global::System.Data.DataRelationCollection Relations { get { return base.Relations; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void InitializeDerivedDataSet() { this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataSet Clone() { ChinookDataSet cln = ((ChinookDataSet)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override bool ShouldSerializeTables() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override bool ShouldSerializeRelations() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void ReadXmlSerializable(global::System.Xml.XmlReader reader) { if ((this.DetermineSchemaSerializationMode(reader) == global::System.Data.SchemaSerializationMode.IncludeSchema)) { this.Reset(); global::System.Data.DataSet ds = new global::System.Data.DataSet(); ds.ReadXml(reader); if ((ds.Tables["Genre"] != null)) { base.Tables.Add(new GenreDataTable(ds.Tables["Genre"])); } if ((ds.Tables["MediaType"] != null)) { base.Tables.Add(new MediaTypeDataTable(ds.Tables["MediaType"])); } if ((ds.Tables["Artist"] != null)) { base.Tables.Add(new ArtistDataTable(ds.Tables["Artist"])); } if ((ds.Tables["Album"] != null)) { base.Tables.Add(new AlbumDataTable(ds.Tables["Album"])); } if ((ds.Tables["Track"] != null)) { base.Tables.Add(new TrackDataTable(ds.Tables["Track"])); } if ((ds.Tables["Employee"] != null)) { base.Tables.Add(new EmployeeDataTable(ds.Tables["Employee"])); } if ((ds.Tables["Customer"] != null)) { base.Tables.Add(new CustomerDataTable(ds.Tables["Customer"])); } if ((ds.Tables["Invoice"] != null)) { base.Tables.Add(new InvoiceDataTable(ds.Tables["Invoice"])); } if ((ds.Tables["InvoiceLine"] != null)) { base.Tables.Add(new InvoiceLineDataTable(ds.Tables["InvoiceLine"])); } if ((ds.Tables["Playlist"] != null)) { base.Tables.Add(new PlaylistDataTable(ds.Tables["Playlist"])); } if ((ds.Tables["PlaylistTrack"] != null)) { base.Tables.Add(new PlaylistTrackDataTable(ds.Tables["PlaylistTrack"])); } this.DataSetName = ds.DataSetName; this.Prefix = ds.Prefix; this.Namespace = ds.Namespace; this.Locale = ds.Locale; this.CaseSensitive = ds.CaseSensitive; this.EnforceConstraints = ds.EnforceConstraints; this.Merge(ds, false, global::System.Data.MissingSchemaAction.Add); this.InitVars(); } else { this.ReadXml(reader); this.InitVars(); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Xml.Schema.XmlSchema GetSchemaSerializable() { global::System.IO.MemoryStream stream = new global::System.IO.MemoryStream(); this.WriteXmlSchema(new global::System.Xml.XmlTextWriter(stream, null)); stream.Position = 0; return global::System.Xml.Schema.XmlSchema.Read(new global::System.Xml.XmlTextReader(stream), null); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.InitVars(true); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars(bool initTable) { this.tableGenre = ((GenreDataTable)(base.Tables["Genre"])); if ((initTable == true)) { if ((this.tableGenre != null)) { this.tableGenre.InitVars(); } } this.tableMediaType = ((MediaTypeDataTable)(base.Tables["MediaType"])); if ((initTable == true)) { if ((this.tableMediaType != null)) { this.tableMediaType.InitVars(); } } this.tableArtist = ((ArtistDataTable)(base.Tables["Artist"])); if ((initTable == true)) { if ((this.tableArtist != null)) { this.tableArtist.InitVars(); } } this.tableAlbum = ((AlbumDataTable)(base.Tables["Album"])); if ((initTable == true)) { if ((this.tableAlbum != null)) { this.tableAlbum.InitVars(); } } this.tableTrack = ((TrackDataTable)(base.Tables["Track"])); if ((initTable == true)) { if ((this.tableTrack != null)) { this.tableTrack.InitVars(); } } this.tableEmployee = ((EmployeeDataTable)(base.Tables["Employee"])); if ((initTable == true)) { if ((this.tableEmployee != null)) { this.tableEmployee.InitVars(); } } this.tableCustomer = ((CustomerDataTable)(base.Tables["Customer"])); if ((initTable == true)) { if ((this.tableCustomer != null)) { this.tableCustomer.InitVars(); } } this.tableInvoice = ((InvoiceDataTable)(base.Tables["Invoice"])); if ((initTable == true)) { if ((this.tableInvoice != null)) { this.tableInvoice.InitVars(); } } this.tableInvoiceLine = ((InvoiceLineDataTable)(base.Tables["InvoiceLine"])); if ((initTable == true)) { if ((this.tableInvoiceLine != null)) { this.tableInvoiceLine.InitVars(); } } this.tablePlaylist = ((PlaylistDataTable)(base.Tables["Playlist"])); if ((initTable == true)) { if ((this.tablePlaylist != null)) { this.tablePlaylist.InitVars(); } } this.tablePlaylistTrack = ((PlaylistTrackDataTable)(base.Tables["PlaylistTrack"])); if ((initTable == true)) { if ((this.tablePlaylistTrack != null)) { this.tablePlaylistTrack.InitVars(); } } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.DataSetName = "ChinookDataSet"; this.Prefix = ""; this.Namespace = "http://tempuri.org/DataSet.xsd"; this.EnforceConstraints = true; this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; this.tableGenre = new GenreDataTable(); base.Tables.Add(this.tableGenre); this.tableMediaType = new MediaTypeDataTable(); base.Tables.Add(this.tableMediaType); this.tableArtist = new ArtistDataTable(); base.Tables.Add(this.tableArtist); this.tableAlbum = new AlbumDataTable(); base.Tables.Add(this.tableAlbum); this.tableTrack = new TrackDataTable(); base.Tables.Add(this.tableTrack); this.tableEmployee = new EmployeeDataTable(); base.Tables.Add(this.tableEmployee); this.tableCustomer = new CustomerDataTable(); base.Tables.Add(this.tableCustomer); this.tableInvoice = new InvoiceDataTable(); base.Tables.Add(this.tableInvoice); this.tableInvoiceLine = new InvoiceLineDataTable(); base.Tables.Add(this.tableInvoiceLine); this.tablePlaylist = new PlaylistDataTable(); base.Tables.Add(this.tablePlaylist); this.tablePlaylistTrack = new PlaylistTrackDataTable(); base.Tables.Add(this.tablePlaylistTrack); global::System.Data.ForeignKeyConstraint fkc; fkc = new global::System.Data.ForeignKeyConstraint("FK_Artist_Album", new global::System.Data.DataColumn[] { this.tableArtist.ArtistIdColumn}, new global::System.Data.DataColumn[] { this.tableAlbum.ArtistIdColumn}); this.tableAlbum.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Album_Track", new global::System.Data.DataColumn[] { this.tableAlbum.AlbumIdColumn}, new global::System.Data.DataColumn[] { this.tableTrack.AlbumIdColumn}); this.tableTrack.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_MediaType_Track", new global::System.Data.DataColumn[] { this.tableMediaType.MediaTypeIdColumn}, new global::System.Data.DataColumn[] { this.tableTrack.MediaTypeIdColumn}); this.tableTrack.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Genre_Track", new global::System.Data.DataColumn[] { this.tableGenre.GenreIdColumn}, new global::System.Data.DataColumn[] { this.tableTrack.GenreIdColumn}); this.tableTrack.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Employee_ReportsTo", new global::System.Data.DataColumn[] { this.tableEmployee.EmployeeIdColumn}, new global::System.Data.DataColumn[] { this.tableEmployee.ReportsToColumn}); this.tableEmployee.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Employee_Customer", new global::System.Data.DataColumn[] { this.tableEmployee.EmployeeIdColumn}, new global::System.Data.DataColumn[] { this.tableCustomer.SupportRepIdColumn}); this.tableCustomer.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Customer_Invoice", new global::System.Data.DataColumn[] { this.tableCustomer.CustomerIdColumn}, new global::System.Data.DataColumn[] { this.tableInvoice.CustomerIdColumn}); this.tableInvoice.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Track_InvoiceLine", new global::System.Data.DataColumn[] { this.tableTrack.TrackIdColumn}, new global::System.Data.DataColumn[] { this.tableInvoiceLine.TrackIdColumn}); this.tableInvoiceLine.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.None; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Invoice_InvoiceLine", new global::System.Data.DataColumn[] { this.tableInvoice.InvoiceIdColumn}, new global::System.Data.DataColumn[] { this.tableInvoiceLine.InvoiceIdColumn}); this.tableInvoiceLine.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Track_PlaylistTrack", new global::System.Data.DataColumn[] { this.tableTrack.TrackIdColumn}, new global::System.Data.DataColumn[] { this.tablePlaylistTrack.TrackIdColumn}); this.tablePlaylistTrack.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.Cascade; fkc = new global::System.Data.ForeignKeyConstraint("FK_Playlist_PlaylistTrack", new global::System.Data.DataColumn[] { this.tablePlaylist.PlaylistIdColumn}, new global::System.Data.DataColumn[] { this.tablePlaylistTrack.PlaylistIdColumn}); this.tablePlaylistTrack.Constraints.Add(fkc); fkc.AcceptRejectRule = global::System.Data.AcceptRejectRule.None; fkc.DeleteRule = global::System.Data.Rule.Cascade; fkc.UpdateRule = global::System.Data.Rule.Cascade; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeGenre() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeMediaType() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeArtist() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeAlbum() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeTrack() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeEmployee() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeCustomer() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeInvoice() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializeInvoiceLine() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializePlaylist() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private bool ShouldSerializePlaylistTrack() { return false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void SchemaChanged(object sender, global::System.ComponentModel.CollectionChangeEventArgs e) { if ((e.Action == global::System.ComponentModel.CollectionChangeAction.Remove)) { this.InitVars(); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void GenreRowChangeEventHandler(object sender, GenreRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void MediaTypeRowChangeEventHandler(object sender, MediaTypeRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void ArtistRowChangeEventHandler(object sender, ArtistRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void AlbumRowChangeEventHandler(object sender, AlbumRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void TrackRowChangeEventHandler(object sender, TrackRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void EmployeeRowChangeEventHandler(object sender, EmployeeRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void CustomerRowChangeEventHandler(object sender, CustomerRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void InvoiceRowChangeEventHandler(object sender, InvoiceRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void InvoiceLineRowChangeEventHandler(object sender, InvoiceLineRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void PlaylistRowChangeEventHandler(object sender, PlaylistRowChangeEvent e); [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public delegate void PlaylistTrackRowChangeEventHandler(object sender, PlaylistTrackRowChangeEvent e); /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class GenreDataTable : global::System.Data.TypedTableBase<GenreRow> { private global::System.Data.DataColumn columnGenreId; private global::System.Data.DataColumn columnName; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public GenreDataTable() { this.TableName = "Genre"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal GenreDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected GenreDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn GenreIdColumn { get { return this.columnGenreId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn NameColumn { get { return this.columnName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public GenreRow this[int index] { get { return ((GenreRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event GenreRowChangeEventHandler GenreRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event GenreRowChangeEventHandler GenreRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event GenreRowChangeEventHandler GenreRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event GenreRowChangeEventHandler GenreRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddGenreRow(GenreRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public GenreRow AddGenreRow(string Name) { GenreRow rowGenreRow = ((GenreRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, Name}; rowGenreRow.ItemArray = columnValuesArray; this.Rows.Add(rowGenreRow); return rowGenreRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public GenreRow FindByGenreId(int GenreId) { return ((GenreRow)(this.Rows.Find(new object[] { GenreId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { GenreDataTable cln = ((GenreDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new GenreDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnGenreId = base.Columns["GenreId"]; this.columnName = base.Columns["Name"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnGenreId = new global::System.Data.DataColumn("GenreId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnGenreId); this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnName); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_Genre", new global::System.Data.DataColumn[] { this.columnGenreId}, true)); this.columnGenreId.AutoIncrement = true; this.columnGenreId.AutoIncrementSeed = 1; this.columnGenreId.AllowDBNull = false; this.columnGenreId.Unique = true; this.columnName.MaxLength = 120; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public GenreRow NewGenreRow() { return ((GenreRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new GenreRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(GenreRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.GenreRowChanged != null)) { this.GenreRowChanged(this, new GenreRowChangeEvent(((GenreRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.GenreRowChanging != null)) { this.GenreRowChanging(this, new GenreRowChangeEvent(((GenreRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.GenreRowDeleted != null)) { this.GenreRowDeleted(this, new GenreRowChangeEvent(((GenreRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.GenreRowDeleting != null)) { this.GenreRowDeleting(this, new GenreRowChangeEvent(((GenreRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveGenreRow(GenreRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "GenreDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class MediaTypeDataTable : global::System.Data.TypedTableBase<MediaTypeRow> { private global::System.Data.DataColumn columnMediaTypeId; private global::System.Data.DataColumn columnName; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public MediaTypeDataTable() { this.TableName = "MediaType"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal MediaTypeDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected MediaTypeDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn MediaTypeIdColumn { get { return this.columnMediaTypeId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn NameColumn { get { return this.columnName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public MediaTypeRow this[int index] { get { return ((MediaTypeRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event MediaTypeRowChangeEventHandler MediaTypeRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event MediaTypeRowChangeEventHandler MediaTypeRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event MediaTypeRowChangeEventHandler MediaTypeRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event MediaTypeRowChangeEventHandler MediaTypeRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddMediaTypeRow(MediaTypeRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public MediaTypeRow AddMediaTypeRow(string Name) { MediaTypeRow rowMediaTypeRow = ((MediaTypeRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, Name}; rowMediaTypeRow.ItemArray = columnValuesArray; this.Rows.Add(rowMediaTypeRow); return rowMediaTypeRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public MediaTypeRow FindByMediaTypeId(int MediaTypeId) { return ((MediaTypeRow)(this.Rows.Find(new object[] { MediaTypeId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { MediaTypeDataTable cln = ((MediaTypeDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new MediaTypeDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnMediaTypeId = base.Columns["MediaTypeId"]; this.columnName = base.Columns["Name"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnMediaTypeId = new global::System.Data.DataColumn("MediaTypeId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnMediaTypeId); this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnName); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_MediaType", new global::System.Data.DataColumn[] { this.columnMediaTypeId}, true)); this.columnMediaTypeId.AutoIncrement = true; this.columnMediaTypeId.AutoIncrementSeed = 1; this.columnMediaTypeId.AllowDBNull = false; this.columnMediaTypeId.Unique = true; this.columnName.MaxLength = 120; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public MediaTypeRow NewMediaTypeRow() { return ((MediaTypeRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new MediaTypeRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(MediaTypeRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.MediaTypeRowChanged != null)) { this.MediaTypeRowChanged(this, new MediaTypeRowChangeEvent(((MediaTypeRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.MediaTypeRowChanging != null)) { this.MediaTypeRowChanging(this, new MediaTypeRowChangeEvent(((MediaTypeRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.MediaTypeRowDeleted != null)) { this.MediaTypeRowDeleted(this, new MediaTypeRowChangeEvent(((MediaTypeRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.MediaTypeRowDeleting != null)) { this.MediaTypeRowDeleting(this, new MediaTypeRowChangeEvent(((MediaTypeRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveMediaTypeRow(MediaTypeRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "MediaTypeDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class ArtistDataTable : global::System.Data.TypedTableBase<ArtistRow> { private global::System.Data.DataColumn columnArtistId; private global::System.Data.DataColumn columnName; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public ArtistDataTable() { this.TableName = "Artist"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal ArtistDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected ArtistDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn ArtistIdColumn { get { return this.columnArtistId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn NameColumn { get { return this.columnName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public ArtistRow this[int index] { get { return ((ArtistRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event ArtistRowChangeEventHandler ArtistRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event ArtistRowChangeEventHandler ArtistRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event ArtistRowChangeEventHandler ArtistRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event ArtistRowChangeEventHandler ArtistRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddArtistRow(ArtistRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public ArtistRow AddArtistRow(string Name) { ArtistRow rowArtistRow = ((ArtistRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, Name}; rowArtistRow.ItemArray = columnValuesArray; this.Rows.Add(rowArtistRow); return rowArtistRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public ArtistRow FindByArtistId(int ArtistId) { return ((ArtistRow)(this.Rows.Find(new object[] { ArtistId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { ArtistDataTable cln = ((ArtistDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new ArtistDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnArtistId = base.Columns["ArtistId"]; this.columnName = base.Columns["Name"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnArtistId = new global::System.Data.DataColumn("ArtistId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnArtistId); this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnName); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_Artist", new global::System.Data.DataColumn[] { this.columnArtistId}, true)); this.columnArtistId.AutoIncrement = true; this.columnArtistId.AutoIncrementSeed = 1; this.columnArtistId.AllowDBNull = false; this.columnArtistId.Unique = true; this.columnName.MaxLength = 120; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public ArtistRow NewArtistRow() { return ((ArtistRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new ArtistRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(ArtistRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.ArtistRowChanged != null)) { this.ArtistRowChanged(this, new ArtistRowChangeEvent(((ArtistRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.ArtistRowChanging != null)) { this.ArtistRowChanging(this, new ArtistRowChangeEvent(((ArtistRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.ArtistRowDeleted != null)) { this.ArtistRowDeleted(this, new ArtistRowChangeEvent(((ArtistRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.ArtistRowDeleting != null)) { this.ArtistRowDeleting(this, new ArtistRowChangeEvent(((ArtistRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveArtistRow(ArtistRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "ArtistDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class AlbumDataTable : global::System.Data.TypedTableBase<AlbumRow> { private global::System.Data.DataColumn columnAlbumId; private global::System.Data.DataColumn columnTitle; private global::System.Data.DataColumn columnArtistId; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public AlbumDataTable() { this.TableName = "Album"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal AlbumDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected AlbumDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn AlbumIdColumn { get { return this.columnAlbumId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn TitleColumn { get { return this.columnTitle; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn ArtistIdColumn { get { return this.columnArtistId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public AlbumRow this[int index] { get { return ((AlbumRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event AlbumRowChangeEventHandler AlbumRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event AlbumRowChangeEventHandler AlbumRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event AlbumRowChangeEventHandler AlbumRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event AlbumRowChangeEventHandler AlbumRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddAlbumRow(AlbumRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public AlbumRow AddAlbumRow(string Title, int ArtistId) { AlbumRow rowAlbumRow = ((AlbumRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, Title, ArtistId}; rowAlbumRow.ItemArray = columnValuesArray; this.Rows.Add(rowAlbumRow); return rowAlbumRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public AlbumRow FindByAlbumId(int AlbumId) { return ((AlbumRow)(this.Rows.Find(new object[] { AlbumId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { AlbumDataTable cln = ((AlbumDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new AlbumDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnAlbumId = base.Columns["AlbumId"]; this.columnTitle = base.Columns["Title"]; this.columnArtistId = base.Columns["ArtistId"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnAlbumId = new global::System.Data.DataColumn("AlbumId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnAlbumId); this.columnTitle = new global::System.Data.DataColumn("Title", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnTitle); this.columnArtistId = new global::System.Data.DataColumn("ArtistId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnArtistId); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_Album", new global::System.Data.DataColumn[] { this.columnAlbumId}, true)); this.columnAlbumId.AutoIncrement = true; this.columnAlbumId.AutoIncrementSeed = 1; this.columnAlbumId.AllowDBNull = false; this.columnAlbumId.Unique = true; this.columnTitle.AllowDBNull = false; this.columnTitle.MaxLength = 160; this.columnArtistId.AllowDBNull = false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public AlbumRow NewAlbumRow() { return ((AlbumRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new AlbumRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(AlbumRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.AlbumRowChanged != null)) { this.AlbumRowChanged(this, new AlbumRowChangeEvent(((AlbumRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.AlbumRowChanging != null)) { this.AlbumRowChanging(this, new AlbumRowChangeEvent(((AlbumRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.AlbumRowDeleted != null)) { this.AlbumRowDeleted(this, new AlbumRowChangeEvent(((AlbumRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.AlbumRowDeleting != null)) { this.AlbumRowDeleting(this, new AlbumRowChangeEvent(((AlbumRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveAlbumRow(AlbumRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "AlbumDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class TrackDataTable : global::System.Data.TypedTableBase<TrackRow> { private global::System.Data.DataColumn columnTrackId; private global::System.Data.DataColumn columnName; private global::System.Data.DataColumn columnAlbumId; private global::System.Data.DataColumn columnMediaTypeId; private global::System.Data.DataColumn columnGenreId; private global::System.Data.DataColumn columnComposer; private global::System.Data.DataColumn columnMilliseconds; private global::System.Data.DataColumn columnBytes; private global::System.Data.DataColumn columnUnitPrice; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public TrackDataTable() { this.TableName = "Track"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal TrackDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected TrackDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn TrackIdColumn { get { return this.columnTrackId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn NameColumn { get { return this.columnName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn AlbumIdColumn { get { return this.columnAlbumId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn MediaTypeIdColumn { get { return this.columnMediaTypeId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn GenreIdColumn { get { return this.columnGenreId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn ComposerColumn { get { return this.columnComposer; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn MillisecondsColumn { get { return this.columnMilliseconds; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn BytesColumn { get { return this.columnBytes; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn UnitPriceColumn { get { return this.columnUnitPrice; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public TrackRow this[int index] { get { return ((TrackRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event TrackRowChangeEventHandler TrackRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event TrackRowChangeEventHandler TrackRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event TrackRowChangeEventHandler TrackRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event TrackRowChangeEventHandler TrackRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddTrackRow(TrackRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public TrackRow AddTrackRow(string Name, int AlbumId, int MediaTypeId, int GenreId, string Composer, int Milliseconds, int Bytes, decimal UnitPrice) { TrackRow rowTrackRow = ((TrackRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, Name, AlbumId, MediaTypeId, GenreId, Composer, Milliseconds, Bytes, UnitPrice}; rowTrackRow.ItemArray = columnValuesArray; this.Rows.Add(rowTrackRow); return rowTrackRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public TrackRow FindByTrackId(int TrackId) { return ((TrackRow)(this.Rows.Find(new object[] { TrackId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { TrackDataTable cln = ((TrackDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new TrackDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnTrackId = base.Columns["TrackId"]; this.columnName = base.Columns["Name"]; this.columnAlbumId = base.Columns["AlbumId"]; this.columnMediaTypeId = base.Columns["MediaTypeId"]; this.columnGenreId = base.Columns["GenreId"]; this.columnComposer = base.Columns["Composer"]; this.columnMilliseconds = base.Columns["Milliseconds"]; this.columnBytes = base.Columns["Bytes"]; this.columnUnitPrice = base.Columns["UnitPrice"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnTrackId = new global::System.Data.DataColumn("TrackId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnTrackId); this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnName); this.columnAlbumId = new global::System.Data.DataColumn("AlbumId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnAlbumId); this.columnMediaTypeId = new global::System.Data.DataColumn("MediaTypeId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnMediaTypeId); this.columnGenreId = new global::System.Data.DataColumn("GenreId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnGenreId); this.columnComposer = new global::System.Data.DataColumn("Composer", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnComposer); this.columnMilliseconds = new global::System.Data.DataColumn("Milliseconds", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnMilliseconds); this.columnBytes = new global::System.Data.DataColumn("Bytes", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnBytes); this.columnUnitPrice = new global::System.Data.DataColumn("UnitPrice", typeof(decimal), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnUnitPrice); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_Track", new global::System.Data.DataColumn[] { this.columnTrackId}, true)); this.columnTrackId.AutoIncrement = true; this.columnTrackId.AutoIncrementSeed = 1; this.columnTrackId.AllowDBNull = false; this.columnTrackId.Unique = true; this.columnName.AllowDBNull = false; this.columnName.MaxLength = 200; this.columnMediaTypeId.AllowDBNull = false; this.columnComposer.MaxLength = 220; this.columnMilliseconds.AllowDBNull = false; this.columnUnitPrice.AllowDBNull = false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public TrackRow NewTrackRow() { return ((TrackRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new TrackRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(TrackRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.TrackRowChanged != null)) { this.TrackRowChanged(this, new TrackRowChangeEvent(((TrackRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.TrackRowChanging != null)) { this.TrackRowChanging(this, new TrackRowChangeEvent(((TrackRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.TrackRowDeleted != null)) { this.TrackRowDeleted(this, new TrackRowChangeEvent(((TrackRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.TrackRowDeleting != null)) { this.TrackRowDeleting(this, new TrackRowChangeEvent(((TrackRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveTrackRow(TrackRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "TrackDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class EmployeeDataTable : global::System.Data.TypedTableBase<EmployeeRow> { private global::System.Data.DataColumn columnEmployeeId; private global::System.Data.DataColumn columnLastName; private global::System.Data.DataColumn columnFirstName; private global::System.Data.DataColumn columnTitle; private global::System.Data.DataColumn columnReportsTo; private global::System.Data.DataColumn columnBirthDate; private global::System.Data.DataColumn columnHireDate; private global::System.Data.DataColumn address; private global::System.Data.DataColumn columnCity; private global::System.Data.DataColumn columnState; private global::System.Data.DataColumn columnCountry; private global::System.Data.DataColumn columnPostalCode; private global::System.Data.DataColumn columnPhone; private global::System.Data.DataColumn columnFax; private global::System.Data.DataColumn columnEmail; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public EmployeeDataTable() { this.TableName = "Employee"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal EmployeeDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected EmployeeDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn EmployeeIdColumn { get { return this.columnEmployeeId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn LastNameColumn { get { return this.columnLastName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn FirstNameColumn { get { return this.columnFirstName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn TitleColumn { get { return this.columnTitle; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn ReportsToColumn { get { return this.columnReportsTo; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn BirthDateColumn { get { return this.columnBirthDate; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn HireDateColumn { get { return this.columnHireDate; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn AddressColumn { get { return this.address; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn CityColumn { get { return this.columnCity; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn StateColumn { get { return this.columnState; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn CountryColumn { get { return this.columnCountry; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn PostalCodeColumn { get { return this.columnPostalCode; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn PhoneColumn { get { return this.columnPhone; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn FaxColumn { get { return this.columnFax; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn EmailColumn { get { return this.columnEmail; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public EmployeeRow this[int index] { get { return ((EmployeeRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event EmployeeRowChangeEventHandler EmployeeRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event EmployeeRowChangeEventHandler EmployeeRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event EmployeeRowChangeEventHandler EmployeeRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event EmployeeRowChangeEventHandler EmployeeRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddEmployeeRow(EmployeeRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public EmployeeRow AddEmployeeRow(string LastName, string FirstName, string Title, int ReportsTo, System.DateTime BirthDate, System.DateTime HireDate, string Address, string City, string State, string Country, string PostalCode, string Phone, string Fax, string Email) { EmployeeRow rowEmployeeRow = ((EmployeeRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, LastName, FirstName, Title, ReportsTo, BirthDate, HireDate, Address, City, State, Country, PostalCode, Phone, Fax, Email}; rowEmployeeRow.ItemArray = columnValuesArray; this.Rows.Add(rowEmployeeRow); return rowEmployeeRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public EmployeeRow FindByEmployeeId(int EmployeeId) { return ((EmployeeRow)(this.Rows.Find(new object[] { EmployeeId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { EmployeeDataTable cln = ((EmployeeDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new EmployeeDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnEmployeeId = base.Columns["EmployeeId"]; this.columnLastName = base.Columns["LastName"]; this.columnFirstName = base.Columns["FirstName"]; this.columnTitle = base.Columns["Title"]; this.columnReportsTo = base.Columns["ReportsTo"]; this.columnBirthDate = base.Columns["BirthDate"]; this.columnHireDate = base.Columns["HireDate"]; this.address = base.Columns["Address"]; this.columnCity = base.Columns["City"]; this.columnState = base.Columns["State"]; this.columnCountry = base.Columns["Country"]; this.columnPostalCode = base.Columns["PostalCode"]; this.columnPhone = base.Columns["Phone"]; this.columnFax = base.Columns["Fax"]; this.columnEmail = base.Columns["Email"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnEmployeeId = new global::System.Data.DataColumn("EmployeeId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnEmployeeId); this.columnLastName = new global::System.Data.DataColumn("LastName", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnLastName); this.columnFirstName = new global::System.Data.DataColumn("FirstName", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnFirstName); this.columnTitle = new global::System.Data.DataColumn("Title", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnTitle); this.columnReportsTo = new global::System.Data.DataColumn("ReportsTo", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnReportsTo); this.columnBirthDate = new global::System.Data.DataColumn("BirthDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnBirthDate); this.columnHireDate = new global::System.Data.DataColumn("HireDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnHireDate); this.address = new global::System.Data.DataColumn("Address", typeof(string), null, global::System.Data.MappingType.Element); this.address.ExtendedProperties.Add("Generator_ColumnVarNameInTable", "address"); this.address.ExtendedProperties.Add("Generator_UserColumnName", "Address"); base.Columns.Add(this.address); this.columnCity = new global::System.Data.DataColumn("City", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnCity); this.columnState = new global::System.Data.DataColumn("State", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnState); this.columnCountry = new global::System.Data.DataColumn("Country", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnCountry); this.columnPostalCode = new global::System.Data.DataColumn("PostalCode", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnPostalCode); this.columnPhone = new global::System.Data.DataColumn("Phone", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnPhone); this.columnFax = new global::System.Data.DataColumn("Fax", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnFax); this.columnEmail = new global::System.Data.DataColumn("Email", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnEmail); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_Employee", new global::System.Data.DataColumn[] { this.columnEmployeeId}, true)); this.columnEmployeeId.AutoIncrement = true; this.columnEmployeeId.AutoIncrementSeed = 1; this.columnEmployeeId.AllowDBNull = false; this.columnEmployeeId.Unique = true; this.columnLastName.AllowDBNull = false; this.columnLastName.MaxLength = 20; this.columnFirstName.AllowDBNull = false; this.columnFirstName.MaxLength = 20; this.columnTitle.MaxLength = 30; this.address.MaxLength = 70; this.columnCity.MaxLength = 40; this.columnState.MaxLength = 40; this.columnCountry.MaxLength = 40; this.columnPostalCode.MaxLength = 10; this.columnPhone.MaxLength = 24; this.columnFax.MaxLength = 24; this.columnEmail.MaxLength = 60; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public EmployeeRow NewEmployeeRow() { return ((EmployeeRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new EmployeeRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(EmployeeRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.EmployeeRowChanged != null)) { this.EmployeeRowChanged(this, new EmployeeRowChangeEvent(((EmployeeRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.EmployeeRowChanging != null)) { this.EmployeeRowChanging(this, new EmployeeRowChangeEvent(((EmployeeRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.EmployeeRowDeleted != null)) { this.EmployeeRowDeleted(this, new EmployeeRowChangeEvent(((EmployeeRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.EmployeeRowDeleting != null)) { this.EmployeeRowDeleting(this, new EmployeeRowChangeEvent(((EmployeeRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveEmployeeRow(EmployeeRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "EmployeeDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class CustomerDataTable : global::System.Data.TypedTableBase<CustomerRow> { private global::System.Data.DataColumn columnCustomerId; private global::System.Data.DataColumn columnFirstName; private global::System.Data.DataColumn columnLastName; private global::System.Data.DataColumn columnCompany; private global::System.Data.DataColumn address; private global::System.Data.DataColumn columnCity; private global::System.Data.DataColumn columnState; private global::System.Data.DataColumn columnCountry; private global::System.Data.DataColumn columnPostalCode; private global::System.Data.DataColumn columnPhone; private global::System.Data.DataColumn columnFax; private global::System.Data.DataColumn columnEmail; private global::System.Data.DataColumn columnSupportRepId; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public CustomerDataTable() { this.TableName = "Customer"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal CustomerDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected CustomerDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn CustomerIdColumn { get { return this.columnCustomerId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn FirstNameColumn { get { return this.columnFirstName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn LastNameColumn { get { return this.columnLastName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn CompanyColumn { get { return this.columnCompany; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn AddressColumn { get { return this.address; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn CityColumn { get { return this.columnCity; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn StateColumn { get { return this.columnState; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn CountryColumn { get { return this.columnCountry; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn PostalCodeColumn { get { return this.columnPostalCode; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn PhoneColumn { get { return this.columnPhone; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn FaxColumn { get { return this.columnFax; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn EmailColumn { get { return this.columnEmail; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn SupportRepIdColumn { get { return this.columnSupportRepId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public CustomerRow this[int index] { get { return ((CustomerRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event CustomerRowChangeEventHandler CustomerRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event CustomerRowChangeEventHandler CustomerRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event CustomerRowChangeEventHandler CustomerRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event CustomerRowChangeEventHandler CustomerRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddCustomerRow(CustomerRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public CustomerRow AddCustomerRow(string FirstName, string LastName, string Company, string Address, string City, string State, string Country, string PostalCode, string Phone, string Fax, string Email, int SupportRepId) { CustomerRow rowCustomerRow = ((CustomerRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, FirstName, LastName, Company, Address, City, State, Country, PostalCode, Phone, Fax, Email, SupportRepId}; rowCustomerRow.ItemArray = columnValuesArray; this.Rows.Add(rowCustomerRow); return rowCustomerRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public CustomerRow FindByCustomerId(int CustomerId) { return ((CustomerRow)(this.Rows.Find(new object[] { CustomerId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { CustomerDataTable cln = ((CustomerDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new CustomerDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnCustomerId = base.Columns["CustomerId"]; this.columnFirstName = base.Columns["FirstName"]; this.columnLastName = base.Columns["LastName"]; this.columnCompany = base.Columns["Company"]; this.address = base.Columns["Address"]; this.columnCity = base.Columns["City"]; this.columnState = base.Columns["State"]; this.columnCountry = base.Columns["Country"]; this.columnPostalCode = base.Columns["PostalCode"]; this.columnPhone = base.Columns["Phone"]; this.columnFax = base.Columns["Fax"]; this.columnEmail = base.Columns["Email"]; this.columnSupportRepId = base.Columns["SupportRepId"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnCustomerId = new global::System.Data.DataColumn("CustomerId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnCustomerId); this.columnFirstName = new global::System.Data.DataColumn("FirstName", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnFirstName); this.columnLastName = new global::System.Data.DataColumn("LastName", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnLastName); this.columnCompany = new global::System.Data.DataColumn("Company", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnCompany); this.address = new global::System.Data.DataColumn("Address", typeof(string), null, global::System.Data.MappingType.Element); this.address.ExtendedProperties.Add("Generator_ColumnVarNameInTable", "address"); this.address.ExtendedProperties.Add("Generator_UserColumnName", "Address"); base.Columns.Add(this.address); this.columnCity = new global::System.Data.DataColumn("City", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnCity); this.columnState = new global::System.Data.DataColumn("State", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnState); this.columnCountry = new global::System.Data.DataColumn("Country", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnCountry); this.columnPostalCode = new global::System.Data.DataColumn("PostalCode", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnPostalCode); this.columnPhone = new global::System.Data.DataColumn("Phone", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnPhone); this.columnFax = new global::System.Data.DataColumn("Fax", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnFax); this.columnEmail = new global::System.Data.DataColumn("Email", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnEmail); this.columnSupportRepId = new global::System.Data.DataColumn("SupportRepId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnSupportRepId); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_Customer", new global::System.Data.DataColumn[] { this.columnCustomerId}, true)); this.columnCustomerId.AutoIncrement = true; this.columnCustomerId.AutoIncrementSeed = 1; this.columnCustomerId.AllowDBNull = false; this.columnCustomerId.Unique = true; this.columnFirstName.AllowDBNull = false; this.columnFirstName.MaxLength = 40; this.columnLastName.AllowDBNull = false; this.columnLastName.MaxLength = 20; this.columnCompany.MaxLength = 80; this.address.MaxLength = 70; this.columnCity.MaxLength = 40; this.columnState.MaxLength = 40; this.columnCountry.MaxLength = 40; this.columnPostalCode.MaxLength = 10; this.columnPhone.MaxLength = 24; this.columnFax.MaxLength = 24; this.columnEmail.AllowDBNull = false; this.columnEmail.MaxLength = 60; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public CustomerRow NewCustomerRow() { return ((CustomerRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new CustomerRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(CustomerRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.CustomerRowChanged != null)) { this.CustomerRowChanged(this, new CustomerRowChangeEvent(((CustomerRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.CustomerRowChanging != null)) { this.CustomerRowChanging(this, new CustomerRowChangeEvent(((CustomerRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.CustomerRowDeleted != null)) { this.CustomerRowDeleted(this, new CustomerRowChangeEvent(((CustomerRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.CustomerRowDeleting != null)) { this.CustomerRowDeleting(this, new CustomerRowChangeEvent(((CustomerRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveCustomerRow(CustomerRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "CustomerDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class InvoiceDataTable : global::System.Data.TypedTableBase<InvoiceRow> { private global::System.Data.DataColumn columnInvoiceId; private global::System.Data.DataColumn columnCustomerId; private global::System.Data.DataColumn columnInvoiceDate; private global::System.Data.DataColumn columnBillingAddress; private global::System.Data.DataColumn columnBillingCity; private global::System.Data.DataColumn columnBillingState; private global::System.Data.DataColumn columnBillingCountry; private global::System.Data.DataColumn columnBillingPostalCode; private global::System.Data.DataColumn columnTotal; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceDataTable() { this.TableName = "Invoice"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal InvoiceDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected InvoiceDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn InvoiceIdColumn { get { return this.columnInvoiceId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn CustomerIdColumn { get { return this.columnCustomerId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn InvoiceDateColumn { get { return this.columnInvoiceDate; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn BillingAddressColumn { get { return this.columnBillingAddress; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn BillingCityColumn { get { return this.columnBillingCity; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn BillingStateColumn { get { return this.columnBillingState; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn BillingCountryColumn { get { return this.columnBillingCountry; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn BillingPostalCodeColumn { get { return this.columnBillingPostalCode; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn TotalColumn { get { return this.columnTotal; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceRow this[int index] { get { return ((InvoiceRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event InvoiceRowChangeEventHandler InvoiceRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event InvoiceRowChangeEventHandler InvoiceRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event InvoiceRowChangeEventHandler InvoiceRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event InvoiceRowChangeEventHandler InvoiceRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddInvoiceRow(InvoiceRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceRow AddInvoiceRow(int CustomerId, System.DateTime InvoiceDate, string BillingAddress, string BillingCity, string BillingState, string BillingCountry, string BillingPostalCode, decimal Total) { InvoiceRow rowInvoiceRow = ((InvoiceRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, CustomerId, InvoiceDate, BillingAddress, BillingCity, BillingState, BillingCountry, BillingPostalCode, Total}; rowInvoiceRow.ItemArray = columnValuesArray; this.Rows.Add(rowInvoiceRow); return rowInvoiceRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceRow FindByInvoiceId(int InvoiceId) { return ((InvoiceRow)(this.Rows.Find(new object[] { InvoiceId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { InvoiceDataTable cln = ((InvoiceDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new InvoiceDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnInvoiceId = base.Columns["InvoiceId"]; this.columnCustomerId = base.Columns["CustomerId"]; this.columnInvoiceDate = base.Columns["InvoiceDate"]; this.columnBillingAddress = base.Columns["BillingAddress"]; this.columnBillingCity = base.Columns["BillingCity"]; this.columnBillingState = base.Columns["BillingState"]; this.columnBillingCountry = base.Columns["BillingCountry"]; this.columnBillingPostalCode = base.Columns["BillingPostalCode"]; this.columnTotal = base.Columns["Total"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnInvoiceId = new global::System.Data.DataColumn("InvoiceId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnInvoiceId); this.columnCustomerId = new global::System.Data.DataColumn("CustomerId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnCustomerId); this.columnInvoiceDate = new global::System.Data.DataColumn("InvoiceDate", typeof(global::System.DateTime), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnInvoiceDate); this.columnBillingAddress = new global::System.Data.DataColumn("BillingAddress", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnBillingAddress); this.columnBillingCity = new global::System.Data.DataColumn("BillingCity", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnBillingCity); this.columnBillingState = new global::System.Data.DataColumn("BillingState", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnBillingState); this.columnBillingCountry = new global::System.Data.DataColumn("BillingCountry", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnBillingCountry); this.columnBillingPostalCode = new global::System.Data.DataColumn("BillingPostalCode", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnBillingPostalCode); this.columnTotal = new global::System.Data.DataColumn("Total", typeof(decimal), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnTotal); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_Invoice", new global::System.Data.DataColumn[] { this.columnInvoiceId}, true)); this.columnInvoiceId.AutoIncrement = true; this.columnInvoiceId.AutoIncrementSeed = 1; this.columnInvoiceId.AllowDBNull = false; this.columnInvoiceId.Unique = true; this.columnCustomerId.AllowDBNull = false; this.columnInvoiceDate.AllowDBNull = false; this.columnBillingAddress.MaxLength = 70; this.columnBillingCity.MaxLength = 40; this.columnBillingState.MaxLength = 40; this.columnBillingCountry.MaxLength = 40; this.columnBillingPostalCode.MaxLength = 10; this.columnTotal.AllowDBNull = false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceRow NewInvoiceRow() { return ((InvoiceRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new InvoiceRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(InvoiceRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.InvoiceRowChanged != null)) { this.InvoiceRowChanged(this, new InvoiceRowChangeEvent(((InvoiceRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.InvoiceRowChanging != null)) { this.InvoiceRowChanging(this, new InvoiceRowChangeEvent(((InvoiceRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.InvoiceRowDeleted != null)) { this.InvoiceRowDeleted(this, new InvoiceRowChangeEvent(((InvoiceRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.InvoiceRowDeleting != null)) { this.InvoiceRowDeleting(this, new InvoiceRowChangeEvent(((InvoiceRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveInvoiceRow(InvoiceRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "InvoiceDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class InvoiceLineDataTable : global::System.Data.TypedTableBase<InvoiceLineRow> { private global::System.Data.DataColumn columnInvoiceLineId; private global::System.Data.DataColumn columnInvoiceId; private global::System.Data.DataColumn columnTrackId; private global::System.Data.DataColumn columnUnitPrice; private global::System.Data.DataColumn columnQuantity; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceLineDataTable() { this.TableName = "InvoiceLine"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal InvoiceLineDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected InvoiceLineDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn InvoiceLineIdColumn { get { return this.columnInvoiceLineId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn InvoiceIdColumn { get { return this.columnInvoiceId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn TrackIdColumn { get { return this.columnTrackId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn UnitPriceColumn { get { return this.columnUnitPrice; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn QuantityColumn { get { return this.columnQuantity; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceLineRow this[int index] { get { return ((InvoiceLineRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event InvoiceLineRowChangeEventHandler InvoiceLineRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event InvoiceLineRowChangeEventHandler InvoiceLineRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event InvoiceLineRowChangeEventHandler InvoiceLineRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event InvoiceLineRowChangeEventHandler InvoiceLineRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddInvoiceLineRow(InvoiceLineRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceLineRow AddInvoiceLineRow(int InvoiceId, int TrackId, decimal UnitPrice, int Quantity) { InvoiceLineRow rowInvoiceLineRow = ((InvoiceLineRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, InvoiceId, TrackId, UnitPrice, Quantity}; rowInvoiceLineRow.ItemArray = columnValuesArray; this.Rows.Add(rowInvoiceLineRow); return rowInvoiceLineRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceLineRow FindByInvoiceLineId(int InvoiceLineId) { return ((InvoiceLineRow)(this.Rows.Find(new object[] { InvoiceLineId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { InvoiceLineDataTable cln = ((InvoiceLineDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new InvoiceLineDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnInvoiceLineId = base.Columns["InvoiceLineId"]; this.columnInvoiceId = base.Columns["InvoiceId"]; this.columnTrackId = base.Columns["TrackId"]; this.columnUnitPrice = base.Columns["UnitPrice"]; this.columnQuantity = base.Columns["Quantity"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnInvoiceLineId = new global::System.Data.DataColumn("InvoiceLineId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnInvoiceLineId); this.columnInvoiceId = new global::System.Data.DataColumn("InvoiceId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnInvoiceId); this.columnTrackId = new global::System.Data.DataColumn("TrackId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnTrackId); this.columnUnitPrice = new global::System.Data.DataColumn("UnitPrice", typeof(decimal), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnUnitPrice); this.columnQuantity = new global::System.Data.DataColumn("Quantity", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnQuantity); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_InvoiceLine", new global::System.Data.DataColumn[] { this.columnInvoiceLineId}, true)); this.columnInvoiceLineId.AutoIncrement = true; this.columnInvoiceLineId.AutoIncrementSeed = 1; this.columnInvoiceLineId.AllowDBNull = false; this.columnInvoiceLineId.Unique = true; this.columnInvoiceId.AllowDBNull = false; this.columnTrackId.AllowDBNull = false; this.columnUnitPrice.AllowDBNull = false; this.columnQuantity.AllowDBNull = false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceLineRow NewInvoiceLineRow() { return ((InvoiceLineRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new InvoiceLineRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(InvoiceLineRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.InvoiceLineRowChanged != null)) { this.InvoiceLineRowChanged(this, new InvoiceLineRowChangeEvent(((InvoiceLineRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.InvoiceLineRowChanging != null)) { this.InvoiceLineRowChanging(this, new InvoiceLineRowChangeEvent(((InvoiceLineRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.InvoiceLineRowDeleted != null)) { this.InvoiceLineRowDeleted(this, new InvoiceLineRowChangeEvent(((InvoiceLineRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.InvoiceLineRowDeleting != null)) { this.InvoiceLineRowDeleting(this, new InvoiceLineRowChangeEvent(((InvoiceLineRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemoveInvoiceLineRow(InvoiceLineRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "InvoiceLineDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class PlaylistDataTable : global::System.Data.TypedTableBase<PlaylistRow> { private global::System.Data.DataColumn columnPlaylistId; private global::System.Data.DataColumn columnName; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistDataTable() { this.TableName = "Playlist"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal PlaylistDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected PlaylistDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn PlaylistIdColumn { get { return this.columnPlaylistId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn NameColumn { get { return this.columnName; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistRow this[int index] { get { return ((PlaylistRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event PlaylistRowChangeEventHandler PlaylistRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event PlaylistRowChangeEventHandler PlaylistRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event PlaylistRowChangeEventHandler PlaylistRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event PlaylistRowChangeEventHandler PlaylistRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddPlaylistRow(PlaylistRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistRow AddPlaylistRow(string Name) { PlaylistRow rowPlaylistRow = ((PlaylistRow)(this.NewRow())); object[] columnValuesArray = new object[] { null, Name}; rowPlaylistRow.ItemArray = columnValuesArray; this.Rows.Add(rowPlaylistRow); return rowPlaylistRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistRow FindByPlaylistId(int PlaylistId) { return ((PlaylistRow)(this.Rows.Find(new object[] { PlaylistId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { PlaylistDataTable cln = ((PlaylistDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new PlaylistDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnPlaylistId = base.Columns["PlaylistId"]; this.columnName = base.Columns["Name"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnPlaylistId = new global::System.Data.DataColumn("PlaylistId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnPlaylistId); this.columnName = new global::System.Data.DataColumn("Name", typeof(string), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnName); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_Playlist", new global::System.Data.DataColumn[] { this.columnPlaylistId}, true)); this.columnPlaylistId.AutoIncrement = true; this.columnPlaylistId.AutoIncrementSeed = 1; this.columnPlaylistId.AllowDBNull = false; this.columnPlaylistId.Unique = true; this.columnName.MaxLength = 120; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistRow NewPlaylistRow() { return ((PlaylistRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new PlaylistRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(PlaylistRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.PlaylistRowChanged != null)) { this.PlaylistRowChanged(this, new PlaylistRowChangeEvent(((PlaylistRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.PlaylistRowChanging != null)) { this.PlaylistRowChanging(this, new PlaylistRowChangeEvent(((PlaylistRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.PlaylistRowDeleted != null)) { this.PlaylistRowDeleted(this, new PlaylistRowChangeEvent(((PlaylistRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.PlaylistRowDeleting != null)) { this.PlaylistRowDeleting(this, new PlaylistRowChangeEvent(((PlaylistRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemovePlaylistRow(PlaylistRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "PlaylistDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents the strongly named DataTable class. ///</summary> [global::System.Serializable()] [global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")] public partial class PlaylistTrackDataTable : global::System.Data.TypedTableBase<PlaylistTrackRow> { private global::System.Data.DataColumn columnPlaylistId; private global::System.Data.DataColumn columnTrackId; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistTrackDataTable() { this.TableName = "PlaylistTrack"; this.BeginInit(); this.InitClass(); this.EndInit(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal PlaylistTrackDataTable(global::System.Data.DataTable table) { this.TableName = table.TableName; if ((table.CaseSensitive != table.DataSet.CaseSensitive)) { this.CaseSensitive = table.CaseSensitive; } if ((table.Locale.ToString() != table.DataSet.Locale.ToString())) { this.Locale = table.Locale; } if ((table.Namespace != table.DataSet.Namespace)) { this.Namespace = table.Namespace; } this.Prefix = table.Prefix; this.MinimumCapacity = table.MinimumCapacity; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected PlaylistTrackDataTable(global::System.Runtime.Serialization.SerializationInfo info, global::System.Runtime.Serialization.StreamingContext context) : base(info, context) { this.InitVars(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn PlaylistIdColumn { get { return this.columnPlaylistId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataColumn TrackIdColumn { get { return this.columnTrackId; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] [global::System.ComponentModel.Browsable(false)] public int Count { get { return this.Rows.Count; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistTrackRow this[int index] { get { return ((PlaylistTrackRow)(this.Rows[index])); } } [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event PlaylistTrackRowChangeEventHandler PlaylistTrackRowChanging; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event PlaylistTrackRowChangeEventHandler PlaylistTrackRowChanged; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event PlaylistTrackRowChangeEventHandler PlaylistTrackRowDeleting; [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public event PlaylistTrackRowChangeEventHandler PlaylistTrackRowDeleted; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void AddPlaylistTrackRow(PlaylistTrackRow row) { this.Rows.Add(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistTrackRow AddPlaylistTrackRow(int PlaylistId, int TrackId) { PlaylistTrackRow rowPlaylistTrackRow = ((PlaylistTrackRow)(this.NewRow())); object[] columnValuesArray = new object[] { PlaylistId, TrackId}; rowPlaylistTrackRow.ItemArray = columnValuesArray; this.Rows.Add(rowPlaylistTrackRow); return rowPlaylistTrackRow; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistTrackRow FindByPlaylistIdTrackId(int PlaylistId, int TrackId) { return ((PlaylistTrackRow)(this.Rows.Find(new object[] { PlaylistId, TrackId}))); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public override global::System.Data.DataTable Clone() { PlaylistTrackDataTable cln = ((PlaylistTrackDataTable)(base.Clone())); cln.InitVars(); return cln; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataTable CreateInstance() { return new PlaylistTrackDataTable(); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal void InitVars() { this.columnPlaylistId = base.Columns["PlaylistId"]; this.columnTrackId = base.Columns["TrackId"]; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] private void InitClass() { this.columnPlaylistId = new global::System.Data.DataColumn("PlaylistId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnPlaylistId); this.columnTrackId = new global::System.Data.DataColumn("TrackId", typeof(int), null, global::System.Data.MappingType.Element); base.Columns.Add(this.columnTrackId); this.Constraints.Add(new global::System.Data.UniqueConstraint("PK_PlaylistTrack", new global::System.Data.DataColumn[] { this.columnPlaylistId, this.columnTrackId}, true)); this.columnPlaylistId.AllowDBNull = false; this.columnTrackId.AllowDBNull = false; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistTrackRow NewPlaylistTrackRow() { return ((PlaylistTrackRow)(this.NewRow())); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Data.DataRow NewRowFromBuilder(global::System.Data.DataRowBuilder builder) { return new PlaylistTrackRow(builder); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override global::System.Type GetRowType() { return typeof(PlaylistTrackRow); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanged(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanged(e); if ((this.PlaylistTrackRowChanged != null)) { this.PlaylistTrackRowChanged(this, new PlaylistTrackRowChangeEvent(((PlaylistTrackRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowChanging(global::System.Data.DataRowChangeEventArgs e) { base.OnRowChanging(e); if ((this.PlaylistTrackRowChanging != null)) { this.PlaylistTrackRowChanging(this, new PlaylistTrackRowChangeEvent(((PlaylistTrackRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleted(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleted(e); if ((this.PlaylistTrackRowDeleted != null)) { this.PlaylistTrackRowDeleted(this, new PlaylistTrackRowChangeEvent(((PlaylistTrackRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] protected override void OnRowDeleting(global::System.Data.DataRowChangeEventArgs e) { base.OnRowDeleting(e); if ((this.PlaylistTrackRowDeleting != null)) { this.PlaylistTrackRowDeleting(this, new PlaylistTrackRowChangeEvent(((PlaylistTrackRow)(e.Row)), e.Action)); } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void RemovePlaylistTrackRow(PlaylistTrackRow row) { this.Rows.Remove(row); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); ChinookDataSet ds = new ChinookDataSet(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "PlaylistTrackDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class GenreRow : global::System.Data.DataRow { private GenreDataTable tableGenre; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal GenreRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableGenre = ((GenreDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int GenreId { get { return ((int)(this[this.tableGenre.GenreIdColumn])); } set { this[this.tableGenre.GenreIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Name { get { try { return ((string)(this[this.tableGenre.NameColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'Genre\' is DBNull.", e); } } set { this[this.tableGenre.NameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsNameNull() { return this.IsNull(this.tableGenre.NameColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetNameNull() { this[this.tableGenre.NameColumn] = global::System.Convert.DBNull; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class MediaTypeRow : global::System.Data.DataRow { private MediaTypeDataTable tableMediaType; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal MediaTypeRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableMediaType = ((MediaTypeDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int MediaTypeId { get { return ((int)(this[this.tableMediaType.MediaTypeIdColumn])); } set { this[this.tableMediaType.MediaTypeIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Name { get { try { return ((string)(this[this.tableMediaType.NameColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'MediaType\' is DBNull.", e); } } set { this[this.tableMediaType.NameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsNameNull() { return this.IsNull(this.tableMediaType.NameColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetNameNull() { this[this.tableMediaType.NameColumn] = global::System.Convert.DBNull; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class ArtistRow : global::System.Data.DataRow { private ArtistDataTable tableArtist; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal ArtistRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableArtist = ((ArtistDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int ArtistId { get { return ((int)(this[this.tableArtist.ArtistIdColumn])); } set { this[this.tableArtist.ArtistIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Name { get { try { return ((string)(this[this.tableArtist.NameColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'Artist\' is DBNull.", e); } } set { this[this.tableArtist.NameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsNameNull() { return this.IsNull(this.tableArtist.NameColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetNameNull() { this[this.tableArtist.NameColumn] = global::System.Convert.DBNull; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class AlbumRow : global::System.Data.DataRow { private AlbumDataTable tableAlbum; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal AlbumRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableAlbum = ((AlbumDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int AlbumId { get { return ((int)(this[this.tableAlbum.AlbumIdColumn])); } set { this[this.tableAlbum.AlbumIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Title { get { return ((string)(this[this.tableAlbum.TitleColumn])); } set { this[this.tableAlbum.TitleColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int ArtistId { get { return ((int)(this[this.tableAlbum.ArtistIdColumn])); } set { this[this.tableAlbum.ArtistIdColumn] = value; } } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class TrackRow : global::System.Data.DataRow { private TrackDataTable tableTrack; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal TrackRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableTrack = ((TrackDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int TrackId { get { return ((int)(this[this.tableTrack.TrackIdColumn])); } set { this[this.tableTrack.TrackIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Name { get { return ((string)(this[this.tableTrack.NameColumn])); } set { this[this.tableTrack.NameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int AlbumId { get { try { return ((int)(this[this.tableTrack.AlbumIdColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'AlbumId\' in table \'Track\' is DBNull.", e); } } set { this[this.tableTrack.AlbumIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int MediaTypeId { get { return ((int)(this[this.tableTrack.MediaTypeIdColumn])); } set { this[this.tableTrack.MediaTypeIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int GenreId { get { try { return ((int)(this[this.tableTrack.GenreIdColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'GenreId\' in table \'Track\' is DBNull.", e); } } set { this[this.tableTrack.GenreIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Composer { get { try { return ((string)(this[this.tableTrack.ComposerColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Composer\' in table \'Track\' is DBNull.", e); } } set { this[this.tableTrack.ComposerColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int Milliseconds { get { return ((int)(this[this.tableTrack.MillisecondsColumn])); } set { this[this.tableTrack.MillisecondsColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int Bytes { get { try { return ((int)(this[this.tableTrack.BytesColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Bytes\' in table \'Track\' is DBNull.", e); } } set { this[this.tableTrack.BytesColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public decimal UnitPrice { get { return ((decimal)(this[this.tableTrack.UnitPriceColumn])); } set { this[this.tableTrack.UnitPriceColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsAlbumIdNull() { return this.IsNull(this.tableTrack.AlbumIdColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetAlbumIdNull() { this[this.tableTrack.AlbumIdColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsGenreIdNull() { return this.IsNull(this.tableTrack.GenreIdColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetGenreIdNull() { this[this.tableTrack.GenreIdColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsComposerNull() { return this.IsNull(this.tableTrack.ComposerColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetComposerNull() { this[this.tableTrack.ComposerColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsBytesNull() { return this.IsNull(this.tableTrack.BytesColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetBytesNull() { this[this.tableTrack.BytesColumn] = global::System.Convert.DBNull; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class EmployeeRow : global::System.Data.DataRow { private EmployeeDataTable tableEmployee; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal EmployeeRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableEmployee = ((EmployeeDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int EmployeeId { get { return ((int)(this[this.tableEmployee.EmployeeIdColumn])); } set { this[this.tableEmployee.EmployeeIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string LastName { get { return ((string)(this[this.tableEmployee.LastNameColumn])); } set { this[this.tableEmployee.LastNameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string FirstName { get { return ((string)(this[this.tableEmployee.FirstNameColumn])); } set { this[this.tableEmployee.FirstNameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Title { get { try { return ((string)(this[this.tableEmployee.TitleColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Title\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.TitleColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int ReportsTo { get { try { return ((int)(this[this.tableEmployee.ReportsToColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'ReportsTo\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.ReportsToColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public System.DateTime BirthDate { get { try { return ((global::System.DateTime)(this[this.tableEmployee.BirthDateColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'BirthDate\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.BirthDateColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public System.DateTime HireDate { get { try { return ((global::System.DateTime)(this[this.tableEmployee.HireDateColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'HireDate\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.HireDateColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Address { get { try { return ((string)(this[this.tableEmployee.AddressColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Address\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.AddressColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string City { get { try { return ((string)(this[this.tableEmployee.CityColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'City\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.CityColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string State { get { try { return ((string)(this[this.tableEmployee.StateColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'State\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.StateColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Country { get { try { return ((string)(this[this.tableEmployee.CountryColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Country\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.CountryColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string PostalCode { get { try { return ((string)(this[this.tableEmployee.PostalCodeColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'PostalCode\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.PostalCodeColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Phone { get { try { return ((string)(this[this.tableEmployee.PhoneColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Phone\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.PhoneColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Fax { get { try { return ((string)(this[this.tableEmployee.FaxColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Fax\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.FaxColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Email { get { try { return ((string)(this[this.tableEmployee.EmailColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Email\' in table \'Employee\' is DBNull.", e); } } set { this[this.tableEmployee.EmailColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsTitleNull() { return this.IsNull(this.tableEmployee.TitleColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetTitleNull() { this[this.tableEmployee.TitleColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsReportsToNull() { return this.IsNull(this.tableEmployee.ReportsToColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetReportsToNull() { this[this.tableEmployee.ReportsToColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsBirthDateNull() { return this.IsNull(this.tableEmployee.BirthDateColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetBirthDateNull() { this[this.tableEmployee.BirthDateColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsHireDateNull() { return this.IsNull(this.tableEmployee.HireDateColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetHireDateNull() { this[this.tableEmployee.HireDateColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsAddressNull() { return this.IsNull(this.tableEmployee.AddressColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetAddressNull() { this[this.tableEmployee.AddressColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsCityNull() { return this.IsNull(this.tableEmployee.CityColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetCityNull() { this[this.tableEmployee.CityColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsStateNull() { return this.IsNull(this.tableEmployee.StateColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetStateNull() { this[this.tableEmployee.StateColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsCountryNull() { return this.IsNull(this.tableEmployee.CountryColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetCountryNull() { this[this.tableEmployee.CountryColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsPostalCodeNull() { return this.IsNull(this.tableEmployee.PostalCodeColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetPostalCodeNull() { this[this.tableEmployee.PostalCodeColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsPhoneNull() { return this.IsNull(this.tableEmployee.PhoneColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetPhoneNull() { this[this.tableEmployee.PhoneColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsFaxNull() { return this.IsNull(this.tableEmployee.FaxColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetFaxNull() { this[this.tableEmployee.FaxColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsEmailNull() { return this.IsNull(this.tableEmployee.EmailColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetEmailNull() { this[this.tableEmployee.EmailColumn] = global::System.Convert.DBNull; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class CustomerRow : global::System.Data.DataRow { private CustomerDataTable tableCustomer; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal CustomerRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableCustomer = ((CustomerDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int CustomerId { get { return ((int)(this[this.tableCustomer.CustomerIdColumn])); } set { this[this.tableCustomer.CustomerIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string FirstName { get { return ((string)(this[this.tableCustomer.FirstNameColumn])); } set { this[this.tableCustomer.FirstNameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string LastName { get { return ((string)(this[this.tableCustomer.LastNameColumn])); } set { this[this.tableCustomer.LastNameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Company { get { try { return ((string)(this[this.tableCustomer.CompanyColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Company\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.CompanyColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Address { get { try { return ((string)(this[this.tableCustomer.AddressColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Address\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.AddressColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string City { get { try { return ((string)(this[this.tableCustomer.CityColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'City\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.CityColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string State { get { try { return ((string)(this[this.tableCustomer.StateColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'State\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.StateColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Country { get { try { return ((string)(this[this.tableCustomer.CountryColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Country\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.CountryColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string PostalCode { get { try { return ((string)(this[this.tableCustomer.PostalCodeColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'PostalCode\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.PostalCodeColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Phone { get { try { return ((string)(this[this.tableCustomer.PhoneColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Phone\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.PhoneColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Fax { get { try { return ((string)(this[this.tableCustomer.FaxColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Fax\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.FaxColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Email { get { return ((string)(this[this.tableCustomer.EmailColumn])); } set { this[this.tableCustomer.EmailColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int SupportRepId { get { try { return ((int)(this[this.tableCustomer.SupportRepIdColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'SupportRepId\' in table \'Customer\' is DBNull.", e); } } set { this[this.tableCustomer.SupportRepIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsCompanyNull() { return this.IsNull(this.tableCustomer.CompanyColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetCompanyNull() { this[this.tableCustomer.CompanyColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsAddressNull() { return this.IsNull(this.tableCustomer.AddressColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetAddressNull() { this[this.tableCustomer.AddressColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsCityNull() { return this.IsNull(this.tableCustomer.CityColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetCityNull() { this[this.tableCustomer.CityColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsStateNull() { return this.IsNull(this.tableCustomer.StateColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetStateNull() { this[this.tableCustomer.StateColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsCountryNull() { return this.IsNull(this.tableCustomer.CountryColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetCountryNull() { this[this.tableCustomer.CountryColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsPostalCodeNull() { return this.IsNull(this.tableCustomer.PostalCodeColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetPostalCodeNull() { this[this.tableCustomer.PostalCodeColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsPhoneNull() { return this.IsNull(this.tableCustomer.PhoneColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetPhoneNull() { this[this.tableCustomer.PhoneColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsFaxNull() { return this.IsNull(this.tableCustomer.FaxColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetFaxNull() { this[this.tableCustomer.FaxColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsSupportRepIdNull() { return this.IsNull(this.tableCustomer.SupportRepIdColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetSupportRepIdNull() { this[this.tableCustomer.SupportRepIdColumn] = global::System.Convert.DBNull; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class InvoiceRow : global::System.Data.DataRow { private InvoiceDataTable tableInvoice; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal InvoiceRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableInvoice = ((InvoiceDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int InvoiceId { get { return ((int)(this[this.tableInvoice.InvoiceIdColumn])); } set { this[this.tableInvoice.InvoiceIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int CustomerId { get { return ((int)(this[this.tableInvoice.CustomerIdColumn])); } set { this[this.tableInvoice.CustomerIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public System.DateTime InvoiceDate { get { return ((global::System.DateTime)(this[this.tableInvoice.InvoiceDateColumn])); } set { this[this.tableInvoice.InvoiceDateColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string BillingAddress { get { try { return ((string)(this[this.tableInvoice.BillingAddressColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'BillingAddress\' in table \'Invoice\' is DBNull.", e); } } set { this[this.tableInvoice.BillingAddressColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string BillingCity { get { try { return ((string)(this[this.tableInvoice.BillingCityColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'BillingCity\' in table \'Invoice\' is DBNull.", e); } } set { this[this.tableInvoice.BillingCityColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string BillingState { get { try { return ((string)(this[this.tableInvoice.BillingStateColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'BillingState\' in table \'Invoice\' is DBNull.", e); } } set { this[this.tableInvoice.BillingStateColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string BillingCountry { get { try { return ((string)(this[this.tableInvoice.BillingCountryColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'BillingCountry\' in table \'Invoice\' is DBNull.", e); } } set { this[this.tableInvoice.BillingCountryColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string BillingPostalCode { get { try { return ((string)(this[this.tableInvoice.BillingPostalCodeColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'BillingPostalCode\' in table \'Invoice\' is DBNull.", e); } } set { this[this.tableInvoice.BillingPostalCodeColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public decimal Total { get { return ((decimal)(this[this.tableInvoice.TotalColumn])); } set { this[this.tableInvoice.TotalColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsBillingAddressNull() { return this.IsNull(this.tableInvoice.BillingAddressColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetBillingAddressNull() { this[this.tableInvoice.BillingAddressColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsBillingCityNull() { return this.IsNull(this.tableInvoice.BillingCityColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetBillingCityNull() { this[this.tableInvoice.BillingCityColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsBillingStateNull() { return this.IsNull(this.tableInvoice.BillingStateColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetBillingStateNull() { this[this.tableInvoice.BillingStateColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsBillingCountryNull() { return this.IsNull(this.tableInvoice.BillingCountryColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetBillingCountryNull() { this[this.tableInvoice.BillingCountryColumn] = global::System.Convert.DBNull; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsBillingPostalCodeNull() { return this.IsNull(this.tableInvoice.BillingPostalCodeColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetBillingPostalCodeNull() { this[this.tableInvoice.BillingPostalCodeColumn] = global::System.Convert.DBNull; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class InvoiceLineRow : global::System.Data.DataRow { private InvoiceLineDataTable tableInvoiceLine; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal InvoiceLineRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableInvoiceLine = ((InvoiceLineDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int InvoiceLineId { get { return ((int)(this[this.tableInvoiceLine.InvoiceLineIdColumn])); } set { this[this.tableInvoiceLine.InvoiceLineIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int InvoiceId { get { return ((int)(this[this.tableInvoiceLine.InvoiceIdColumn])); } set { this[this.tableInvoiceLine.InvoiceIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int TrackId { get { return ((int)(this[this.tableInvoiceLine.TrackIdColumn])); } set { this[this.tableInvoiceLine.TrackIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public decimal UnitPrice { get { return ((decimal)(this[this.tableInvoiceLine.UnitPriceColumn])); } set { this[this.tableInvoiceLine.UnitPriceColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int Quantity { get { return ((int)(this[this.tableInvoiceLine.QuantityColumn])); } set { this[this.tableInvoiceLine.QuantityColumn] = value; } } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class PlaylistRow : global::System.Data.DataRow { private PlaylistDataTable tablePlaylist; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal PlaylistRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tablePlaylist = ((PlaylistDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int PlaylistId { get { return ((int)(this[this.tablePlaylist.PlaylistIdColumn])); } set { this[this.tablePlaylist.PlaylistIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public string Name { get { try { return ((string)(this[this.tablePlaylist.NameColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'Name\' in table \'Playlist\' is DBNull.", e); } } set { this[this.tablePlaylist.NameColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public bool IsNameNull() { return this.IsNull(this.tablePlaylist.NameColumn); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public void SetNameNull() { this[this.tablePlaylist.NameColumn] = global::System.Convert.DBNull; } } /// <summary> ///Represents strongly named DataRow class. ///</summary> public partial class PlaylistTrackRow : global::System.Data.DataRow { private PlaylistTrackDataTable tablePlaylistTrack; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] internal PlaylistTrackRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tablePlaylistTrack = ((PlaylistTrackDataTable)(this.Table)); } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int PlaylistId { get { return ((int)(this[this.tablePlaylistTrack.PlaylistIdColumn])); } set { this[this.tablePlaylistTrack.PlaylistIdColumn] = value; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public int TrackId { get { return ((int)(this[this.tablePlaylistTrack.TrackIdColumn])); } set { this[this.tablePlaylistTrack.TrackIdColumn] = value; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class GenreRowChangeEvent : global::System.EventArgs { private GenreRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public GenreRowChangeEvent(GenreRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public GenreRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class MediaTypeRowChangeEvent : global::System.EventArgs { private MediaTypeRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public MediaTypeRowChangeEvent(MediaTypeRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public MediaTypeRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class ArtistRowChangeEvent : global::System.EventArgs { private ArtistRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public ArtistRowChangeEvent(ArtistRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public ArtistRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class AlbumRowChangeEvent : global::System.EventArgs { private AlbumRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public AlbumRowChangeEvent(AlbumRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public AlbumRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class TrackRowChangeEvent : global::System.EventArgs { private TrackRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public TrackRowChangeEvent(TrackRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public TrackRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class EmployeeRowChangeEvent : global::System.EventArgs { private EmployeeRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public EmployeeRowChangeEvent(EmployeeRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public EmployeeRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class CustomerRowChangeEvent : global::System.EventArgs { private CustomerRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public CustomerRowChangeEvent(CustomerRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public CustomerRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class InvoiceRowChangeEvent : global::System.EventArgs { private InvoiceRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceRowChangeEvent(InvoiceRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class InvoiceLineRowChangeEvent : global::System.EventArgs { private InvoiceLineRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceLineRowChangeEvent(InvoiceLineRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public InvoiceLineRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class PlaylistRowChangeEvent : global::System.EventArgs { private PlaylistRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistRowChangeEvent(PlaylistRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } /// <summary> ///Row event argument class ///</summary> [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public class PlaylistTrackRowChangeEvent : global::System.EventArgs { private PlaylistTrackRow eventRow; private global::System.Data.DataRowAction eventAction; [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistTrackRowChangeEvent(PlaylistTrackRow row, global::System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public PlaylistTrackRow Row { get { return this.eventRow; } } [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")] public global::System.Data.DataRowAction Action { get { return this.eventAction; } } } } } #pragma warning restore 1591
54.217173
282
0.578229
[ "MIT" ]
SebastianBienert/AdvancedDatabase
ChinookDatabase/DataSources/_Xml/Schema/ChinookDataSet.Designer.cs
335,281
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Stencil.SDK { public class ListResult<T> : ActionResult { public ListResult() { this.items = new List<T>(); } public ListResult(List<T> items) { this.items = items; } public ListResult(List<T> items, PagingInfo paging) { this.items = items; this.paging = paging; } public ListResult(List<T> items, SteppingInfo stepping) { this.items = items; this.stepping = stepping; } public ListResult(IEnumerable<T> items, PagingInfo paging) { this.items = items.ToList(); this.paging = paging; } public ListResult(IEnumerable<T> items, SteppingInfo stepping) { this.items = items.ToList(); this.stepping = stepping; } public virtual List<T> items { get; set; } public virtual PagingInfo paging { get; set; } public virtual SteppingInfo stepping { get; set; } } public class ListResult<TData, TMeta> : ListResult<TData> where TMeta : new() { public ListResult() : base() { this.meta = new TMeta(); } public virtual TMeta meta { get; set; } } }
24.327586
70
0.532955
[ "MIT" ]
DanMasterson1/stencil
Source/Stencil.Server/Stencil.SDK.Shared/ListResult.cs
1,413
C#
// <copyright file="SqlServerNaturalKeyRepository.cs" company="dddlib contributors"> // Copyright (c) dddlib contributors. All rights reserved. // </copyright> namespace dddlib.Persistence.SqlServer { using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Transactions; using dddlib.Persistence.Sdk; using dddlib.Sdk; /// <summary> /// Represents the SQL Server natural key repository. /// </summary> public class SqlServerNaturalKeyRepository : INaturalKeyRepository { private readonly string connectionString; private readonly string schema; /// <summary> /// Initializes a new instance of the <see cref="SqlServerNaturalKeyRepository"/> class. /// </summary> /// <param name="connectionString">The connection string.</param> /// <param name="schema">The schema.</param> public SqlServerNaturalKeyRepository(string connectionString, string schema) { this.connectionString = connectionString; this.schema = schema; var connection = new SqlConnection(connectionString); connection.InitializeSchema(schema, "SqlServerPersistence"); connection.InitializeSchema(schema, typeof(SqlServerNaturalKeyRepository)); } /// <summary> /// Gets the natural key records for the specified type of aggregate root from the specified checkpoint. /// </summary> /// <param name="aggregateRootType">Type of the aggregate root.</param> /// <param name="checkpoint">The checkpoint.</param> /// <returns>The natural key records.</returns> public IEnumerable<NaturalKeyRecord> GetNaturalKeys(Type aggregateRootType, long checkpoint) { Guard.Against.Null(() => aggregateRootType); using (new TransactionScope(TransactionScopeOption.Suppress)) using (var connection = new SqlConnection(this.connectionString)) using (var command = connection.CreateCommand()) { command.CommandType = CommandType.StoredProcedure; command.CommandText = string.Concat(this.schema, ".GetNaturalKeys"); command.Parameters.Add("@AggregateRootTypeName", SqlDbType.VarChar, 511).Value = aggregateRootType.GetSerializedName(); command.Parameters.Add("@Checkpoint", SqlDbType.BigInt).Value = checkpoint; connection.Open(); using (var reader = command.ExecuteReader()) { while (reader.Read()) { yield return new NaturalKeyRecord { Identity = new Guid(Convert.ToString(reader["Id"])), SerializedValue = (string)reader["SerializedValue"], Checkpoint = Convert.ToInt64(reader["Checkpoint"]), IsRemoved = Convert.ToBoolean(reader["IsRemoved"]), }; } } } } /// <summary> /// Attempts to add the natural key to the natural key records. /// </summary> /// <param name="aggregateRootType">Type of the aggregate root.</param> /// <param name="serializedNaturalKey">The serialized natural key.</param> /// <param name="checkpoint">The checkpoint.</param> /// <param name="naturalKeyRecord">The natural key record.</param> /// <returns>Returns <c>true</c> if the natural key record was successfully added; otherwise <c>false</c>.</returns> public bool TryAddNaturalKey(Type aggregateRootType, object serializedNaturalKey, long checkpoint, out NaturalKeyRecord naturalKeyRecord) { Guard.Against.Null(() => aggregateRootType); Guard.Against.Null(() => serializedNaturalKey); using (new TransactionScope(TransactionScopeOption.Suppress)) using (var connection = new SqlConnection(this.connectionString)) using (var command = connection.CreateCommand()) { command.CommandType = CommandType.StoredProcedure; command.CommandText = string.Concat(this.schema, ".TryAddNaturalKey"); command.Parameters.Add("@AggregateRootTypeName", SqlDbType.VarChar, 511).Value = aggregateRootType.GetSerializedName(); command.Parameters.Add("@SerializedValue", SqlDbType.VarChar).Value = serializedNaturalKey; command.Parameters.Add("@Checkpoint", SqlDbType.BigInt).Value = checkpoint; connection.Open(); using (var reader = command.ExecuteReader()) { if (!reader.Read()) { naturalKeyRecord = null; return false; } naturalKeyRecord = new NaturalKeyRecord { Identity = new Guid(Convert.ToString(reader["Id"])), SerializedValue = (string)serializedNaturalKey, Checkpoint = Convert.ToInt64(reader["Checkpoint"]), }; return true; } } } /// <summary> /// Removes the natural key with the specified identity from the natural key records. /// </summary> /// <param name="naturalKeyIdentity">The natural key identity.</param> public void Remove(Guid naturalKeyIdentity) { using (new TransactionScope(TransactionScopeOption.Suppress)) using (var connection = new SqlConnection(this.connectionString)) using (var command = connection.CreateCommand()) { command.CommandType = CommandType.StoredProcedure; command.CommandText = string.Concat(this.schema, ".RemoveNaturalKey"); command.Parameters.Add("@Id", SqlDbType.UniqueIdentifier).Value = naturalKeyIdentity; connection.Open(); command.ExecuteNonQuery(); } } } }
45.453901
146
0.579342
[ "MIT" ]
cameronfletcher/dddlib
src/dddlib.Persistence/SqlServer/SqlServerNaturalKeyRepository.cs
6,411
C#
namespace Infrastructure.EntityFrameworkDataAccess.Migrations { using System; using Microsoft.EntityFrameworkCore.Migrations; public partial class ExternalUserIdAdded : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn<string>( name: "ExternalUserId", table: "Customer", nullable : false, defaultValue : string.Empty); migrationBuilder.UpdateData( table: "Credit", keyColumn: "Id", keyValue : new Guid("f5117315-e789-491a-b662-958c37237f9b"), column: "TransactionDate", value : new DateTime(2019, 11, 16, 22, 15, 10, 176, DateTimeKind.Utc).AddTicks(4260)); migrationBuilder.UpdateData( table: "Customer", keyColumn: "Id", keyValue : new Guid("197d0438-e04b-453d-b5de-eca05960c6ae"), column: "ExternalUserId", value: "42"); migrationBuilder.UpdateData( table: "Debit", keyColumn: "Id", keyValue : new Guid("3d6032df-7a3b-46e6-8706-be971e3d539f"), column: "TransactionDate", value : new DateTime(2019, 11, 16, 22, 15, 10, 176, DateTimeKind.Utc).AddTicks(5200)); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "ExternalUserId", table: "Customer"); migrationBuilder.UpdateData( table: "Credit", keyColumn: "Id", keyValue : new Guid("f5117315-e789-491a-b662-958c37237f9b"), column: "TransactionDate", value : new DateTime(2019, 9, 28, 21, 51, 12, 605, DateTimeKind.Utc).AddTicks(4990)); migrationBuilder.UpdateData( table: "Debit", keyColumn: "Id", keyValue : new Guid("3d6032df-7a3b-46e6-8706-be971e3d539f"), column: "TransactionDate", value : new DateTime(2019, 9, 28, 21, 51, 12, 605, DateTimeKind.Utc).AddTicks(5890)); } } }
38.762712
102
0.54613
[ "Apache-2.0" ]
phmatray/clean-architecture-manga
src/Infrastructure/EntityFrameworkDataAccess/Migrations/20191116221510_ExternalUserIdAdded.cs
2,287
C#
using System; using System.Collections.Generic; namespace OneSignalSDK_WP_WNS { public class OneSignal { public const string VERSION = "010100"; public delegate void NotificationReceived(string message, IDictionary<string, string> additionalData, bool isActive); public static NotificationReceived notificationDelegate = null; public delegate void IdsAvailable(string playerID, string pushToken); public static IdsAvailable idsAvailableDelegate = null; public delegate void TagsReceived(IDictionary<string, string> tags); public static TagsReceived tagsReceivedDelegate = null; public static void UnityInit(string appId, NotificationReceived inNotificationDelegate) { } public static void SendTag(string key, string value) { } public static void SendTags(IDictionary<string, string> keyValues) { } public static void SendTags(IDictionary<string, int> keyValues) { } public static void SendTags(IDictionary<string, object> keyValues) { } public static void DeleteTags(IList<string> tags) { } public static void DeleteTag(string tag) { } public static void SendPurchase(double amount) { } public static void SendPurchase(decimal amount) { } public static void GetIdsAvailable() { } public static void GetIdsAvailable(IdsAvailable inIdsAvailableDelegate) { } public static void GetTags() { } public static void GetTags(TagsReceived inTagsReceivedDelegate) { } private static void SendGetTagsMessage() { } } }
26.918033
123
0.693666
[ "MIT" ]
Festyk/OneSignal-WindowsPhone-SDK
Source/OneSignalWP_WNS_UnityShell/OneSignal.cs
1,644
C#
/* Copyright 2018 Digimarc, Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SPDX-License-Identifier: Apache-2.0 */ using System; using System.Collections.Generic; using System.Text; namespace Whalerator.Integration { internal class TestSettings { public static TestSettings FromFile(string filename) => new YamlDotNet.Serialization.Deserializer().Deserialize<TestSettings>(System.IO.File.ReadAllText(filename)); [YamlDotNet.Serialization.YamlMember(Alias = "registry")] public string Registry { get; set; } [YamlDotNet.Serialization.YamlMember(Alias = "user")] public string User { get; set; } [YamlDotNet.Serialization.YamlMember(Alias = "password")] public string Password { get; set; } [YamlDotNet.Serialization.YamlMember(Alias = "repository")] public string Repository { get; set; } } }
35.175
120
0.711443
[ "Apache-2.0" ]
abowergroup/whalerator
lib/Whalerator.Integration/TestSettings.cs
1,409
C#
// c:\program files (x86)\windows kits\10\include\10.0.18362.0\shared\d3dkmddi.h(2843,9) using System; using System.Runtime.InteropServices; namespace DirectN { [StructLayout(LayoutKind.Sequential)] public partial struct _DXGK_POWER_RUNTIME_COMPONENT { public uint StateCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public _DXGK_POWER_RUNTIME_STATE[] States; public _DXGK_POWER_COMPONENT_MAPPING ComponentMapping; public _DXGK_POWER_COMPONENT_FLAGS Flags; public Guid ComponentGuid; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 40)] public byte[] ComponentName; public uint ProviderCount; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] public uint[] Providers; } }
34.73913
89
0.709637
[ "MIT" ]
bbday/DirectN
DirectN/DirectN/Generated/_DXGK_POWER_RUNTIME_COMPONENT.cs
801
C#
using System; using System.Diagnostics; using System.Collections.Generic; using Fizz.Chat; namespace Fizz.Common { public static class FizzUtils { public static void DoCallback (Action callback) { if (callback != null) { try { callback.Invoke (); } catch { FizzLogger.W ("Callback threw exception"); } } } public static void DoCallback (FizzException ex, Action<FizzException> callback) { if (callback != null) { try { callback (ex); } catch { FizzLogger.W ("Callback threw exception"); } } } public static void DoCallback<TResult> (TResult result, FizzException ex, Action<TResult, FizzException> callback) { if (callback != null) { try { callback (result, ex); } catch (Exception callbackEx) { FizzLogger.W ("Callback threw exception: " + callbackEx.Message); } } } public static long Now () { System.DateTime epochStart = new System.DateTime (1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc); long cur_time = (long)(System.DateTime.UtcNow - epochStart).TotalMilliseconds; return cur_time; } public static IDictionary<string, string> Headers (string sessionToken) { return new Dictionary<string, string> { { FizzConfig.API_HEADER_SESSION_TOKEN, sessionToken } }; } public static Action SafeCallback (Action callback) { bool called = false; return () => { Debug.Assert (called == false); called = true; if (callback != null) { callback.Invoke (); } }; } public static Action<TValue1, TValue2> SafeCallback<TValue1, TValue2> (Action<TValue1, TValue2> callback) { bool called = false; return (v1, v2) => { Debug.Assert (called == false); called = true; callback.Invoke (v1, v2); }; } public static bool HasFlag (this Enum variable, Enum value) { if (variable == null) return false; if (value == null) throw new ArgumentNullException ("value"); // Not as good as the .NET 4 version of this function, but should be good enough if (!Enum.IsDefined (variable.GetType (), value)) { throw new ArgumentException (string.Format ( "Enumeration type mismatch. The flag is of type '{0}', was expecting '{1}'.", value.GetType (), variable.GetType ())); } ulong num = Convert.ToUInt64 (value); return ((Convert.ToUInt64 (variable) & num) == num); } public static FizzGroupMemberState ParseState(string value) { if (value == null) { throw new FizzException(FizzError.ERROR_BAD_ARGUMENT, "invalid_member_state"); } switch(value) { case "pending": return FizzGroupMemberState.Pending; case "joined": return FizzGroupMemberState.Joined; default: return FizzGroupMemberState.Unknown; } } public static FizzGroupMemberRole ParseRole(string value) { if (value == null) { throw new FizzException(FizzError.ERROR_BAD_ARGUMENT, "invalid_member_role"); } switch(value) { case "member": return FizzGroupMemberRole.Member; case "moderator": return FizzGroupMemberRole.Moderator; default: return FizzGroupMemberRole.Unknown; } } } }
29.437086
122
0.468391
[ "MIT" ]
FizzCorp/Fizz-Unity-Client
Assets/FizzClient/Scripts/Common/FizzUtils.cs
4,447
C#
/* * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ using System; using System.ComponentModel; using System.Runtime.CompilerServices; using System.Windows.Input; using BasicCalculator.Models; using Xamarin.Forms; namespace BasicCalculator.ViewModels { public class CalculatorViewModel : INotifyPropertyChanged { #region fields /// <summary> /// Maximum length of the expression. /// </summary> private const int EXPRESSION_MAX_LENGTH = 24; /// <summary> /// Maximum length of the expression's calculated value. /// </summary> private const int RESULT_MAX_LENGTH = 12; /// <summary> /// Backing field for the <see cref="EnteredExpression"/> property. /// </summary> private string _enteredExpression = "0"; /// <summary> /// Backing field for the <see cref="CurrentResult"/> property. /// </summary> private string _currentResult = "0"; /// <summary> /// Event fired on property changed. /// </summary> public event PropertyChangedEventHandler PropertyChanged; #endregion fields #region properties /// <summary> /// Current result of entered expression. /// </summary> public string CurrentResult { get => _currentResult; set { _currentResult = value; OnPropertyChanged(); } } /// <summary> /// Currently entered expression for calculation. /// Sets expression new value if it has valid length. /// Calls result recalculation when changed. /// </summary> public string EnteredExpression { get => _enteredExpression; set { if (value.Length > EXPRESSION_MAX_LENGTH || value.Equals(_enteredExpression)) { return; } _enteredExpression = value; // Update current result MathExpression e = new MathExpression(_enteredExpression); try { string result = e.Evaluate(RESULT_MAX_LENGTH); CurrentResult = result; } catch (MathExpressionEvaluationException) { CurrentResult = "Expression error"; } catch (MathExpressionResultLengthExceededException) { CurrentResult = "Result length exceeded"; } catch (Exception) { CurrentResult = "Error"; } OnPropertyChanged(); } } /// <summary> /// Command for appending a character to the current expression. /// </summary> public ICommand AppendToExpressionCommand { get; set; } /// <summary> /// Command for clearing current expression. /// </summary> public ICommand ClearInputCommand { get; set; } /// <summary> /// Command for adding bracket to the current expression. /// </summary> public ICommand BracketCommand { get; set; } /// <summary> /// Command to delete last character from the current expression. /// </summary> public ICommand DeleteCommand { get; set; } /// <summary> /// Command for changing sign of the lastly entered value. /// </summary> public ICommand ChangeSignCommand { get; set; } /// <summary> /// Command to evaluate current expression. /// </summary> public ICommand EvaluateExpressionCommand { get; set; } /// <summary> /// Command for appending decimal point to the expression. /// </summary> public ICommand AppendDecimalPointCommand { get; set; } /// <summary> /// Command for appending an operator to the current expression. /// </summary> public ICommand AppendOperatorCommand { get; set; } #endregion properties #region methods /// <summary> /// Initializes view model. /// Creates and assigns view model commands. /// </summary> public CalculatorViewModel() { AppendToExpressionCommand = new Command(AppendToExpression); ClearInputCommand = new Command(ClearInput); BracketCommand = new Command(AppendBracket); DeleteCommand = new Command(DeleteLastCharacter); ChangeSignCommand = new Command(ChangeSign); EvaluateExpressionCommand = new Command(EvaluateExpression); AppendDecimalPointCommand = new Command(AppendDecimalPoint); AppendOperatorCommand = new Command(AppendOperator); } /// <summary> /// Invokes property changed with caller (property) name. /// </summary> /// <param name="propertyName">Name of the property changed.</param> protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } /// <summary> /// Indicates if character passed in parameter is supported mathematic operator. /// </summary> /// <param name="c">Character</param> /// <returns>True if character is supported operator.</returns> private bool IsOperator(char c) { return c == '+' || c == '-' || c == '×' || c == '÷'; } /// <summary> /// Clears current input (entered expression). /// </summary> private void ClearInput() { EnteredExpression = "0"; } /// <summary> /// Changes sign of the last value. /// </summary> private void ChangeSign() { char lastCharacter = EnteredExpression[EnteredExpression.Length - 1]; if (!char.IsDigit(lastCharacter)) { if (lastCharacter == '-' && EnteredExpression.Length > 1 && EnteredExpression[EnteredExpression.Length - 2] == '(') { EnteredExpression = EnteredExpression.Remove(EnteredExpression.Length - 2, 2); return; } if (!IsOperator(lastCharacter)) { EnteredExpression += "×"; } EnteredExpression += "(-"; return; } // Find last value start index int lastValueStart = EnteredExpression.Length - 1; while (lastValueStart > 0 && (char.IsDigit(EnteredExpression[lastValueStart - 1]) || EnteredExpression[lastValueStart - 1] == '.')) { --lastValueStart; } // If it is already negative, make it positive if (lastValueStart >= 2 && EnteredExpression[lastValueStart - 2] == '(' && EnteredExpression[lastValueStart - 1] == '-') { EnteredExpression = EnteredExpression.Remove(lastValueStart - 2, 2); return; } if (lastValueStart == 1 && EnteredExpression[0] == '-') { EnteredExpression = EnteredExpression.Remove(0, 1); return; } // Otherwise make it negative EnteredExpression = EnteredExpression.Insert(lastValueStart, "(-"); } /// <summary> /// Compares number of the entered opening brackets to the closing brackets. /// </summary> /// <returns>0 if the number equals, more than 0 if there are more opening brackets, /// otherwise less than 0.</returns> private int BracketBalance() { int balance = 0; foreach (char t in EnteredExpression) { balance = t.Equals('(') ? balance + 1 : t.Equals(')') ? balance - 1 : balance; } return balance; } /// <summary> /// Appends bracket to the current expression. /// </summary> private void AppendBracket() { char lastCharacter = EnteredExpression[EnteredExpression.Length - 1]; // remove last character if it's a '.' if (lastCharacter == '.') { EnteredExpression = EnteredExpression.Remove(EnteredExpression.Length - 1); lastCharacter = EnteredExpression[EnteredExpression.Length - 1]; } if (EnteredExpression == "0") { EnteredExpression = "("; } else if (IsOperator(lastCharacter) || lastCharacter.Equals('(')) { EnteredExpression += "("; } else if (BracketBalance() > 0) { EnteredExpression += ")"; } else { EnteredExpression += "×("; } } /// <summary> /// Deletes last character from the current expression. /// </summary> private void DeleteLastCharacter() { EnteredExpression = EnteredExpression.Remove(EnteredExpression.Length - 1); if (EnteredExpression.Length == 0) { EnteredExpression = "0"; } } /// <summary> /// Appends decimal point to the current expression. /// Point is added only when last entered character is a number /// and has no decimal point added already. /// </summary> private void AppendDecimalPoint() { int index = EnteredExpression.Length - 1; if (!char.IsDigit(EnteredExpression[index])) { return; } while (index > 0 && char.IsDigit(EnteredExpression[index])) { --index; } if (!EnteredExpression[index].Equals('.')) { EnteredExpression += "."; } } /// <summary> /// Appends and operator to the current expression. /// Operator is added when last expression character is not an opening bracket. /// If method is called with for '-' operator and expression has initial '0' value /// then current expression is replaced with '-'. /// If last expression character is a comma, it is removed before appending passed operator. /// </summary> /// <param name="operatorObject">The operator to be added.</param> private void AppendOperator(object operatorObject) { string operatorString = operatorObject as string; char lastCharacter = EnteredExpression[EnteredExpression.Length - 1]; // we always have it // ignore if last character was '(' if (lastCharacter.Equals('(') && !operatorString.Equals("-")) { return; } // exchange if it's a starting '-' sign if (operatorString.Equals("-") && EnteredExpression.Equals("0")) { EnteredExpression = operatorString; return; } // if operator pressed after other operator, we exchange it if (IsOperator(lastCharacter) || lastCharacter.Equals('.')) { EnteredExpression = EnteredExpression.Remove(EnteredExpression.Length - 1) + operatorString; return; } EnteredExpression += operatorString; } /// <summary> /// Appends one character to currently entered expression. /// When adding digit to expression with default value (0) replaces 0 with provided digit. /// </summary> /// <param name="contentObject">String containing character to append.</param> public void AppendToExpression(object contentObject) { string contentToAppend = contentObject as string; if (contentToAppend == null) { return; } char lastCharacter = EnteredExpression[EnteredExpression.Length - 1]; // digits exchange "0" if it's the only current input if (EnteredExpression.Equals("0") && char.IsDigit(contentToAppend[0])) { EnteredExpression = contentToAppend; } // insert '%' only after digits and ')', otherwise ignore it else if (contentToAppend.Equals("%")) { if (char.IsDigit(lastCharacter) || lastCharacter.Equals(')')) { EnteredExpression += contentToAppend; } } else { if (lastCharacter.Equals('%')) { EnteredExpression += '×'; } EnteredExpression += contentToAppend; } } /// <summary> /// Evaluates current expression. /// Updates expression with result value if calculated successfully. /// </summary> private void EvaluateExpression() { MathExpression e = new MathExpression(EnteredExpression); try { EnteredExpression = e.Evaluate(RESULT_MAX_LENGTH); } catch (Exception) { // do nothing } } #endregion methods } }
33.247113
121
0.533968
[ "Apache-2.0" ]
Jonathan435/Tizen-CSharp-Samples
Mobile/BasicCalculator/src/BasicCalculator/BasicCalculator/ViewModels/CalculatorViewModel.cs
14,401
C#
using Microsoft.VisualStudio.Modeling; using nHydrate.Dsl; using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace nHydrate.DslPackage.Forms { public partial class IndexesForm : Form { private object _lockObject = new object(); private nHydrateModel _model = null; private Store _store = null; private List<Entity> _entityList = null; public IndexesForm() { InitializeComponent(); lvwItem.Columns.Clear(); lvwItem.Columns.Add("Types"); lvwItem.Columns.Add("Entity"); lvwItem.Columns.Add("Columns"); lvwItem.Resize += new EventHandler(AutoSizeGrid); AutoSizeGrid(null, null); txtFilter.TextChanged += new EventHandler(txtFilter_TextChanged); } private void txtFilter_TextChanged(object sender, EventArgs e) { LoadGrid(); } public IndexesForm(List<Entity> entityList, nHydrateModel model, Store store) : this() { _model = model; _store = store; _entityList = entityList; LoadGrid(); lblHeader.Text = "A list of indexed fields"; } private void LoadGrid() { lock (_lockObject) { lvwItem.Items.Clear(); foreach (var entity in _entityList) { foreach (var index in entity.Indexes) { var li = new ListViewItem(); li.Tag = index; //Types var types = string.Empty; if (index.IndexType == IndexTypeConstants.PrimaryKey) types += "PK "; //else // types += "User "; if (index.IsUnique) { types += "UQ "; } if (index.Clustered) { types += "CLUSTERED "; } li.SubItems[0].Text = types; //Entity li.SubItems.Add(entity.Name); //Columns var text = string.Empty; foreach (var indexColumn in index.IndexColumns.OrderBy(x => x.SortOrder)) { var field = indexColumn.GetField(); if (field != null) text += field.Name + ","; else text += "(Undefined Column),"; } if (text.EndsWith(",")) text = text.Substring(0, text.Length - 1); li.SubItems.Add(text); if (string.IsNullOrEmpty(txtFilter.Text)) { lvwItem.Items.Add(li); } else if (entity.Name.ToLower().Contains(txtFilter.Text.ToLower()) || text.ToLower().Contains(txtFilter.Text.ToLower()) || types.ToLower().Contains(txtFilter.Text.ToLower())) { //Only add if there is a text match lvwItem.Items.Add(li); } } } } } private void cmdClose_Click(object sender, EventArgs e) { this.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.Close(); } private void AutoSizeGrid(object sender, EventArgs e) { const int COL1 = 120; const int COL2 = 160; var width = lvwItem.Width - 30; lvwItem.Columns[0].Width = COL1; lvwItem.Columns[1].Width = COL2; lvwItem.Columns[2].Width = width - COL1 - COL2; } private void ShowColumns() { if (lvwItem.SelectedItems.Count > 0) { var index = lvwItem.SelectedItems[0].Tag as Index; var F = new IndexColumnOrder(index, _model, _store); if (F.ShowDialog() == System.Windows.Forms.DialogResult.OK) { LoadGrid(); } } } private void lvwItem_DoubleClick(object sender, EventArgs e) { ShowColumns(); } private void lvwItem_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ShowColumns(); } } private void cmdEdit_Click(object sender, EventArgs e) { ShowColumns(); } } }
32.55
98
0.423195
[ "MIT" ]
aTiKhan/nHydrate
Source/nHydrate.DslPackage/Forms/IndexesForm.cs
5,208
C#
using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Module.Core.Data; namespace WebHost.Migrations { [DbContext(typeof(SimplDbContext))] partial class SimplDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { modelBuilder .HasAnnotation("ProductVersion", "1.1.0-rtm-22752") .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<long>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ClaimType"); b.Property<string>("ClaimValue"); b.Property<long>("RoleId"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("Core_RoleClaim"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<long>", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ClaimType"); b.Property<string>("ClaimValue"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("Core_UserClaim"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<long>", b => { b.Property<string>("LoginProvider"); b.Property<string>("ProviderKey"); b.Property<string>("ProviderDisplayName"); b.Property<long>("UserId"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("Core_UserLogin"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserToken<long>", b => { b.Property<long>("UserId"); b.Property<string>("LoginProvider"); b.Property<string>("Name"); b.Property<string>("Value"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("Core_UserToken"); }); modelBuilder.Entity("Module.ActivityLog.Models.Activity", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("ActivityTypeId"); b.Property<DateTimeOffset>("CreatedOn"); b.Property<long>("EntityId"); b.Property<long>("EntityTypeId"); b.HasKey("Id"); b.HasIndex("ActivityTypeId"); b.ToTable("ActivityLog_Activity"); }); modelBuilder.Entity("Module.ActivityLog.Models.ActivityType", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("ActivityLog_ActivityType"); }); modelBuilder.Entity("Module.Catalog.Models.Brand", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Description") .HasMaxLength(5000); b.Property<bool>("IsDeleted"); b.Property<bool>("IsPublished"); b.Property<string>("Name"); b.Property<string>("SeoTitle"); b.HasKey("Id"); b.ToTable("Catalog_Brand"); }); modelBuilder.Entity("Module.Catalog.Models.Category", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Description") .HasMaxLength(5000); b.Property<int>("DisplayOrder"); b.Property<bool>("IncludeInMenu"); b.Property<bool>("IsDeleted"); b.Property<bool>("IsPublished"); b.Property<string>("Name"); b.Property<long?>("ParentId"); b.Property<string>("SeoTitle"); b.Property<long?>("ThumbnailImageId"); b.HasKey("Id"); b.HasIndex("ParentId"); b.HasIndex("ThumbnailImageId"); b.ToTable("Catalog_Category"); }); modelBuilder.Entity("Module.Catalog.Models.Product", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long?>("BrandId"); b.Property<long?>("CreatedById"); b.Property<DateTimeOffset>("CreatedOn"); b.Property<string>("Description"); b.Property<int>("DisplayOrder"); b.Property<bool>("HasOptions"); b.Property<bool>("IsAllowToOrder"); b.Property<bool>("IsCallForPricing"); b.Property<bool>("IsDeleted"); b.Property<bool>("IsFeatured"); b.Property<bool>("IsPublished"); b.Property<bool>("IsVisibleIndividually"); b.Property<string>("MetaDescription"); b.Property<string>("MetaKeywords"); b.Property<string>("MetaTitle"); b.Property<string>("Name"); b.Property<string>("NormalizedName"); b.Property<decimal?>("OldPrice"); b.Property<decimal>("Price"); b.Property<DateTimeOffset?>("PublishedOn"); b.Property<double?>("RatingAverage"); b.Property<int>("ReviewsCount"); b.Property<string>("SeoTitle"); b.Property<string>("ShortDescription"); b.Property<string>("Sku"); b.Property<decimal?>("SpecialPrice"); b.Property<DateTimeOffset?>("SpecialPriceEnd"); b.Property<DateTimeOffset?>("SpecialPriceStart"); b.Property<string>("Specification"); b.Property<int?>("StockQuantity"); b.Property<long?>("ThumbnailImageId"); b.Property<long?>("UpdatedById"); b.Property<DateTimeOffset>("UpdatedOn"); b.Property<long?>("VendorId"); b.HasKey("Id"); b.HasIndex("BrandId"); b.HasIndex("CreatedById"); b.HasIndex("ThumbnailImageId"); b.HasIndex("UpdatedById"); b.ToTable("Catalog_Product"); }); modelBuilder.Entity("Module.Catalog.Models.ProductAttribute", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("GroupId"); b.Property<string>("Name"); b.HasKey("Id"); b.HasIndex("GroupId"); b.ToTable("Catalog_ProductAttribute"); }); modelBuilder.Entity("Module.Catalog.Models.ProductAttributeGroup", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Catalog_ProductAttributeGroup"); }); modelBuilder.Entity("Module.Catalog.Models.ProductAttributeValue", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("AttributeId"); b.Property<long>("ProductId"); b.Property<string>("Value"); b.HasKey("Id"); b.HasIndex("AttributeId"); b.HasIndex("ProductId"); b.ToTable("Catalog_ProductAttributeValue"); }); modelBuilder.Entity("Module.Catalog.Models.ProductCategory", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("CategoryId"); b.Property<int>("DisplayOrder"); b.Property<bool>("IsFeaturedProduct"); b.Property<long>("ProductId"); b.HasKey("Id"); b.HasIndex("CategoryId"); b.HasIndex("ProductId"); b.ToTable("Catalog_ProductCategory"); }); modelBuilder.Entity("Module.Catalog.Models.ProductLink", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<int>("LinkType"); b.Property<long>("LinkedProductId"); b.Property<long>("ProductId"); b.HasKey("Id"); b.HasIndex("LinkedProductId"); b.HasIndex("ProductId"); b.ToTable("Catalog_ProductLink"); }); modelBuilder.Entity("Module.Catalog.Models.ProductMedia", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<int>("DisplayOrder"); b.Property<long>("MediaId"); b.Property<long>("ProductId"); b.HasKey("Id"); b.HasIndex("MediaId"); b.HasIndex("ProductId"); b.ToTable("Catalog_ProductMedia"); }); modelBuilder.Entity("Module.Catalog.Models.ProductOption", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Catalog_ProductOption"); }); modelBuilder.Entity("Module.Catalog.Models.ProductOptionCombination", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("OptionId"); b.Property<long>("ProductId"); b.Property<int>("SortIndex"); b.Property<string>("Value"); b.HasKey("Id"); b.HasIndex("OptionId"); b.HasIndex("ProductId"); b.ToTable("Catalog_ProductOptionCombination"); }); modelBuilder.Entity("Module.Catalog.Models.ProductOptionValue", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("OptionId"); b.Property<long>("ProductId"); b.Property<int>("SortIndex"); b.Property<string>("Value"); b.HasKey("Id"); b.HasIndex("OptionId"); b.HasIndex("ProductId"); b.ToTable("Catalog_ProductOptionValue"); }); modelBuilder.Entity("Module.Catalog.Models.ProductTemplate", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name") .IsRequired(); b.HasKey("Id"); b.ToTable("Catalog_ProductTemplate"); }); modelBuilder.Entity("Module.Catalog.Models.ProductTemplateProductAttribute", b => { b.Property<long>("ProductTemplateId"); b.Property<long>("ProductAttributeId"); b.HasKey("ProductTemplateId", "ProductAttributeId"); b.HasIndex("ProductAttributeId"); b.ToTable("Catalog_ProductTemplateProductAttribute"); }); modelBuilder.Entity("Module.Cms.Models.Menu", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<bool>("IsPublished"); b.Property<bool>("IsSystem"); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Cms_Menu"); }); modelBuilder.Entity("Module.Cms.Models.MenuItem", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("CustomLink"); b.Property<long?>("EntityId"); b.Property<long>("MenuId"); b.Property<string>("Name"); b.Property<long?>("ParentId"); b.HasKey("Id"); b.HasIndex("EntityId"); b.HasIndex("MenuId"); b.HasIndex("ParentId"); b.ToTable("Cms_MenuItem"); }); modelBuilder.Entity("Module.Cms.Models.Page", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Body"); b.Property<long?>("CreatedById"); b.Property<DateTimeOffset>("CreatedOn"); b.Property<bool>("IsDeleted"); b.Property<bool>("IsPublished"); b.Property<string>("MetaDescription"); b.Property<string>("MetaKeywords"); b.Property<string>("MetaTitle"); b.Property<string>("Name"); b.Property<DateTimeOffset?>("PublishedOn"); b.Property<string>("SeoTitle"); b.Property<long?>("UpdatedById"); b.Property<DateTimeOffset>("UpdatedOn"); b.HasKey("Id"); b.HasIndex("CreatedById"); b.HasIndex("UpdatedById"); b.ToTable("Cms_Page"); }); modelBuilder.Entity("Module.Contacts.Models.Contact", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Address"); b.Property<long>("ContactAreaId"); b.Property<string>("Content"); b.Property<DateTimeOffset>("CreatedOn"); b.Property<string>("EmailAddress"); b.Property<string>("FullName"); b.Property<bool>("IsDeleted"); b.Property<string>("PhoneNumber"); b.HasKey("Id"); b.HasIndex("ContactAreaId"); b.ToTable("Contacts_Contact"); }); modelBuilder.Entity("Module.Contacts.Models.ContactArea", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<bool>("IsDeleted"); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Contacts_ContactArea"); }); modelBuilder.Entity("Module.Core.Models.Address", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("AddressLine1"); b.Property<string>("AddressLine2"); b.Property<string>("ContactName"); b.Property<long>("CountryId"); b.Property<long>("DistrictId"); b.Property<string>("Phone"); b.Property<long>("StateOrProvinceId"); b.HasKey("Id"); b.HasIndex("CountryId"); b.HasIndex("DistrictId"); b.HasIndex("StateOrProvinceId"); b.ToTable("Core_Address"); }); modelBuilder.Entity("Module.Core.Models.AppSetting", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Key"); b.Property<string>("Value"); b.HasKey("Id"); b.ToTable("Core_AppSetting"); }); modelBuilder.Entity("Module.Core.Models.Country", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Core_Country"); }); modelBuilder.Entity("Module.Core.Models.District", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Location"); b.Property<string>("Name"); b.Property<long>("StateOrProvinceId"); b.Property<string>("Type"); b.HasKey("Id"); b.HasIndex("StateOrProvinceId"); b.ToTable("Core_District"); }); modelBuilder.Entity("Module.Core.Models.Entity", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("EntityId"); b.Property<long>("EntityTypeId"); b.Property<string>("Name"); b.Property<string>("Slug"); b.HasKey("Id"); b.HasIndex("EntityTypeId"); b.ToTable("Core_Entity"); }); modelBuilder.Entity("Module.Core.Models.EntityType", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<bool>("IsMenuable"); b.Property<string>("Name"); b.Property<string>("RoutingAction"); b.Property<string>("RoutingController"); b.HasKey("Id"); b.ToTable("Core_EntityType"); }); modelBuilder.Entity("Module.Core.Models.Media", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Caption"); b.Property<string>("FileName"); b.Property<int>("FileSize"); b.Property<int>("MediaType"); b.HasKey("Id"); b.ToTable("Core_Media"); }); modelBuilder.Entity("Module.Core.Models.Role", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken(); b.Property<string>("Name") .HasMaxLength(256); b.Property<string>("NormalizedName") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasName("RoleNameIndex"); b.ToTable("Core_Role"); }); modelBuilder.Entity("Module.Core.Models.StateOrProvince", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("CountryId"); b.Property<string>("Name"); b.Property<string>("Type"); b.HasKey("Id"); b.HasIndex("CountryId"); b.ToTable("Core_StateOrProvince"); }); modelBuilder.Entity("Module.Core.Models.User", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<int>("AccessFailedCount"); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken(); b.Property<DateTimeOffset>("CreatedOn"); b.Property<long?>("DefaultBillingAddressId"); b.Property<long?>("DefaultShippingAddressId"); b.Property<string>("Email") .HasMaxLength(256); b.Property<bool>("EmailConfirmed"); b.Property<string>("FullName"); b.Property<bool>("IsDeleted"); b.Property<bool>("LockoutEnabled"); b.Property<DateTimeOffset?>("LockoutEnd"); b.Property<string>("NormalizedEmail") .HasMaxLength(256); b.Property<string>("NormalizedUserName") .HasMaxLength(256); b.Property<string>("PasswordHash"); b.Property<string>("PhoneNumber"); b.Property<bool>("PhoneNumberConfirmed"); b.Property<string>("SecurityStamp"); b.Property<bool>("TwoFactorEnabled"); b.Property<DateTimeOffset>("UpdatedOn"); b.Property<Guid>("UserGuid"); b.Property<string>("UserName") .HasMaxLength(256); b.Property<long?>("VendorId"); b.HasKey("Id"); b.HasIndex("DefaultBillingAddressId"); b.HasIndex("DefaultShippingAddressId"); b.HasIndex("NormalizedEmail") .HasName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasName("UserNameIndex"); b.HasIndex("VendorId"); b.ToTable("Core_User"); }); modelBuilder.Entity("Module.Core.Models.UserAddress", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("AddressId"); b.Property<int>("AddressType"); b.Property<DateTimeOffset?>("LastUsedOn"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("AddressId"); b.HasIndex("UserId"); b.ToTable("Core_UserAddress"); }); modelBuilder.Entity("Module.Core.Models.UserRole", b => { b.Property<long>("UserId"); b.Property<long>("RoleId"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("Core_UserRole"); }); modelBuilder.Entity("Module.Core.Models.Vendor", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTimeOffset>("CreatedOn"); b.Property<string>("Description"); b.Property<string>("Email"); b.Property<bool>("IsActive"); b.Property<bool>("IsDeleted"); b.Property<string>("Name"); b.Property<string>("SeoTitle"); b.Property<DateTimeOffset>("UpdatedOn"); b.HasKey("Id"); b.ToTable("Core_Vendor"); }); modelBuilder.Entity("Module.Core.Models.Widget", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Code"); b.Property<string>("CreateUrl"); b.Property<DateTimeOffset>("CreatedOn"); b.Property<string>("EditUrl"); b.Property<bool>("IsPublished"); b.Property<string>("Name"); b.Property<string>("ViewComponentName"); b.HasKey("Id"); b.ToTable("Core_Widget"); }); modelBuilder.Entity("Module.Core.Models.WidgetInstance", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTimeOffset>("CreatedOn"); b.Property<string>("Data"); b.Property<int>("DisplayOrder"); b.Property<string>("HtmlData"); b.Property<string>("Name"); b.Property<DateTimeOffset?>("PublishEnd"); b.Property<DateTimeOffset?>("PublishStart"); b.Property<DateTimeOffset>("UpdatedOn"); b.Property<long>("WidgetId"); b.Property<long>("WidgetZoneId"); b.HasKey("Id"); b.HasIndex("WidgetId"); b.HasIndex("WidgetZoneId"); b.ToTable("Core_WidgetInstance"); }); modelBuilder.Entity("Module.Core.Models.WidgetZone", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Description"); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Core_WidgetZone"); }); modelBuilder.Entity("Module.Localization.Models.Culture", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Name"); b.HasKey("Id"); b.ToTable("Localization_Culture"); }); modelBuilder.Entity("Module.Localization.Models.Resource", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("CultureId"); b.Property<string>("Key"); b.Property<string>("Value"); b.HasKey("Id"); b.HasIndex("CultureId"); b.ToTable("Localization_Resource"); }); modelBuilder.Entity("Module.News.Models.NewsCategory", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Description") .HasMaxLength(5000); b.Property<int>("DisplayOrder"); b.Property<bool>("IsDeleted"); b.Property<bool>("IsPublished"); b.Property<string>("Name"); b.Property<string>("SeoTitle"); b.HasKey("Id"); b.ToTable("News_NewsCategory"); }); modelBuilder.Entity("Module.News.Models.NewsItem", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long?>("CreatedById"); b.Property<DateTimeOffset>("CreatedOn"); b.Property<string>("FullContent"); b.Property<bool>("IsDeleted"); b.Property<bool>("IsPublished"); b.Property<string>("MetaDescription"); b.Property<string>("MetaKeywords"); b.Property<string>("MetaTitle"); b.Property<string>("Name"); b.Property<DateTimeOffset?>("PublishedOn"); b.Property<string>("SeoTitle"); b.Property<string>("ShortContent"); b.Property<long?>("ThumbnailImageId"); b.Property<long?>("UpdatedById"); b.Property<DateTimeOffset>("UpdatedOn"); b.HasKey("Id"); b.HasIndex("CreatedById"); b.HasIndex("ThumbnailImageId"); b.HasIndex("UpdatedById"); b.ToTable("News_NewsItem"); }); modelBuilder.Entity("Module.News.Models.NewsItemCategory", b => { b.Property<long>("CategoryId"); b.Property<long>("NewsItemId"); b.HasKey("CategoryId", "NewsItemId"); b.HasIndex("NewsItemId"); b.ToTable("News_NewsItemCategory"); }); modelBuilder.Entity("Module.Orders.Models.CartItem", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTimeOffset>("CreatedOn"); b.Property<long>("ProductId"); b.Property<int>("Quantity"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("ProductId"); b.HasIndex("UserId"); b.ToTable("Orders_CartItem"); }); modelBuilder.Entity("Module.Orders.Models.Order", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("BillingAddressId"); b.Property<long>("CreatedById"); b.Property<DateTimeOffset>("CreatedOn"); b.Property<int>("OrderStatus"); b.Property<long?>("ParentId"); b.Property<long>("ShippingAddressId"); b.Property<decimal>("SubTotal"); b.Property<DateTimeOffset?>("UpdatedOn"); b.Property<long?>("VendorId"); b.HasKey("Id"); b.HasIndex("BillingAddressId"); b.HasIndex("CreatedById"); b.HasIndex("ParentId"); b.HasIndex("ShippingAddressId"); b.ToTable("Orders_Order"); }); modelBuilder.Entity("Module.Orders.Models.OrderAddress", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("AddressLine1"); b.Property<string>("AddressLine2"); b.Property<string>("ContactName"); b.Property<long>("CountryId"); b.Property<long>("DistrictId"); b.Property<string>("Phone"); b.Property<long>("StateOrProvinceId"); b.HasKey("Id"); b.HasIndex("CountryId"); b.HasIndex("DistrictId"); b.HasIndex("StateOrProvinceId"); b.ToTable("Orders_OrderAddress"); }); modelBuilder.Entity("Module.Orders.Models.OrderItem", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long?>("OrderId"); b.Property<long>("ProductId"); b.Property<decimal>("ProductPrice"); b.Property<int>("Quantity"); b.HasKey("Id"); b.HasIndex("OrderId"); b.HasIndex("ProductId"); b.ToTable("Orders_OrderItem"); }); modelBuilder.Entity("Module.ProductComparison.Models.ComparingProduct", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTimeOffset>("CreatedOn"); b.Property<long>("ProductId"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("ProductId"); b.HasIndex("UserId"); b.ToTable("ProductComparison_ComparingProduct"); }); modelBuilder.Entity("Module.Reviews.Models.Review", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Comment"); b.Property<DateTimeOffset>("CreatedOn"); b.Property<long>("EntityId"); b.Property<long>("EntityTypeId"); b.Property<int>("Rating"); b.Property<string>("ReviewerName"); b.Property<int>("Status"); b.Property<string>("Title"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("Reviews_Review"); }); modelBuilder.Entity("Module.Search.Models.Query", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTimeOffset>("CreatedOn"); b.Property<string>("QueryText"); b.Property<int>("ResultsCount"); b.HasKey("Id"); b.ToTable("Search_Query"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRoleClaim<long>", b => { b.HasOne("Module.Core.Models.Role") .WithMany("Claims") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserClaim<long>", b => { b.HasOne("Module.Core.Models.User") .WithMany("Claims") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUserLogin<long>", b => { b.HasOne("Module.Core.Models.User") .WithMany("Logins") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.ActivityLog.Models.Activity", b => { b.HasOne("Module.ActivityLog.Models.ActivityType", "ActivityType") .WithMany() .HasForeignKey("ActivityTypeId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Catalog.Models.Category", b => { b.HasOne("Module.Catalog.Models.Category", "Parent") .WithMany("Children") .HasForeignKey("ParentId"); b.HasOne("Module.Core.Models.Media", "ThumbnailImage") .WithMany() .HasForeignKey("ThumbnailImageId"); }); modelBuilder.Entity("Module.Catalog.Models.Product", b => { b.HasOne("Module.Catalog.Models.Brand", "Brand") .WithMany() .HasForeignKey("BrandId"); b.HasOne("Module.Core.Models.User", "CreatedBy") .WithMany() .HasForeignKey("CreatedById"); b.HasOne("Module.Core.Models.Media", "ThumbnailImage") .WithMany() .HasForeignKey("ThumbnailImageId"); b.HasOne("Module.Core.Models.User", "UpdatedBy") .WithMany() .HasForeignKey("UpdatedById"); }); modelBuilder.Entity("Module.Catalog.Models.ProductAttribute", b => { b.HasOne("Module.Catalog.Models.ProductAttributeGroup", "Group") .WithMany("Attributes") .HasForeignKey("GroupId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Catalog.Models.ProductAttributeValue", b => { b.HasOne("Module.Catalog.Models.ProductAttribute", "Attribute") .WithMany() .HasForeignKey("AttributeId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany("AttributeValues") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Catalog.Models.ProductCategory", b => { b.HasOne("Module.Catalog.Models.Category", "Category") .WithMany() .HasForeignKey("CategoryId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany("Categories") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Catalog.Models.ProductLink", b => { b.HasOne("Module.Catalog.Models.Product", "LinkedProduct") .WithMany("LinkedProductLinks") .HasForeignKey("LinkedProductId"); b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany("ProductLinks") .HasForeignKey("ProductId"); }); modelBuilder.Entity("Module.Catalog.Models.ProductMedia", b => { b.HasOne("Module.Core.Models.Media", "Media") .WithMany() .HasForeignKey("MediaId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany("Medias") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Catalog.Models.ProductOptionCombination", b => { b.HasOne("Module.Catalog.Models.ProductOption", "Option") .WithMany() .HasForeignKey("OptionId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany("OptionCombinations") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Catalog.Models.ProductOptionValue", b => { b.HasOne("Module.Catalog.Models.ProductOption", "Option") .WithMany() .HasForeignKey("OptionId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany("OptionValues") .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Catalog.Models.ProductTemplateProductAttribute", b => { b.HasOne("Module.Catalog.Models.ProductAttribute", "ProductAttribute") .WithMany("ProductTemplates") .HasForeignKey("ProductAttributeId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Catalog.Models.ProductTemplate", "ProductTemplate") .WithMany("ProductAttributes") .HasForeignKey("ProductTemplateId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Cms.Models.MenuItem", b => { b.HasOne("Module.Core.Models.Entity", "Entity") .WithMany() .HasForeignKey("EntityId"); b.HasOne("Module.Cms.Models.Menu", "Menu") .WithMany("MenuItems") .HasForeignKey("MenuId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Cms.Models.MenuItem", "Parent") .WithMany("Children") .HasForeignKey("ParentId"); }); modelBuilder.Entity("Module.Cms.Models.Page", b => { b.HasOne("Module.Core.Models.User", "CreatedBy") .WithMany() .HasForeignKey("CreatedById"); b.HasOne("Module.Core.Models.User", "UpdatedBy") .WithMany() .HasForeignKey("UpdatedById"); }); modelBuilder.Entity("Module.Contacts.Models.Contact", b => { b.HasOne("Module.Contacts.Models.ContactArea", "ContactArea") .WithMany() .HasForeignKey("ContactAreaId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Core.Models.Address", b => { b.HasOne("Module.Core.Models.Country", "Country") .WithMany() .HasForeignKey("CountryId"); b.HasOne("Module.Core.Models.District", "District") .WithMany() .HasForeignKey("DistrictId"); b.HasOne("Module.Core.Models.StateOrProvince", "StateOrProvince") .WithMany() .HasForeignKey("StateOrProvinceId"); }); modelBuilder.Entity("Module.Core.Models.District", b => { b.HasOne("Module.Core.Models.StateOrProvince", "StateOrProvince") .WithMany() .HasForeignKey("StateOrProvinceId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Core.Models.Entity", b => { b.HasOne("Module.Core.Models.EntityType", "EntityType") .WithMany() .HasForeignKey("EntityTypeId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Core.Models.StateOrProvince", b => { b.HasOne("Module.Core.Models.Country", "Country") .WithMany() .HasForeignKey("CountryId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Core.Models.User", b => { b.HasOne("Module.Core.Models.UserAddress", "DefaultBillingAddress") .WithMany() .HasForeignKey("DefaultBillingAddressId"); b.HasOne("Module.Core.Models.UserAddress", "DefaultShippingAddress") .WithMany() .HasForeignKey("DefaultShippingAddressId"); b.HasOne("Module.Core.Models.Vendor") .WithMany("Users") .HasForeignKey("VendorId"); }); modelBuilder.Entity("Module.Core.Models.UserAddress", b => { b.HasOne("Module.Core.Models.Address", "Address") .WithMany("UserAddresses") .HasForeignKey("AddressId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Core.Models.User", "User") .WithMany("UserAddresses") .HasForeignKey("UserId"); }); modelBuilder.Entity("Module.Core.Models.UserRole", b => { b.HasOne("Module.Core.Models.Role", "Role") .WithMany("Users") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Core.Models.User", "User") .WithMany("Roles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Core.Models.WidgetInstance", b => { b.HasOne("Module.Core.Models.Widget", "Widget") .WithMany() .HasForeignKey("WidgetId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Core.Models.WidgetZone", "WidgetZone") .WithMany() .HasForeignKey("WidgetZoneId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Localization.Models.Resource", b => { b.HasOne("Module.Localization.Models.Culture", "Culture") .WithMany("Resources") .HasForeignKey("CultureId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.News.Models.NewsItem", b => { b.HasOne("Module.Core.Models.User", "CreatedBy") .WithMany() .HasForeignKey("CreatedById"); b.HasOne("Module.Core.Models.Media", "ThumbnailImage") .WithMany() .HasForeignKey("ThumbnailImageId"); b.HasOne("Module.Core.Models.User", "UpdatedBy") .WithMany() .HasForeignKey("UpdatedById"); }); modelBuilder.Entity("Module.News.Models.NewsItemCategory", b => { b.HasOne("Module.News.Models.NewsCategory", "Category") .WithMany("NewsItems") .HasForeignKey("CategoryId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.News.Models.NewsItem", "NewsItem") .WithMany("Categories") .HasForeignKey("NewsItemId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Orders.Models.CartItem", b => { b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany() .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Core.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Orders.Models.Order", b => { b.HasOne("Module.Orders.Models.OrderAddress", "BillingAddress") .WithMany() .HasForeignKey("BillingAddressId"); b.HasOne("Module.Core.Models.User", "CreatedBy") .WithMany() .HasForeignKey("CreatedById") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Orders.Models.Order", "Parent") .WithMany("Children") .HasForeignKey("ParentId"); b.HasOne("Module.Orders.Models.OrderAddress", "ShippingAddress") .WithMany() .HasForeignKey("ShippingAddressId"); }); modelBuilder.Entity("Module.Orders.Models.OrderAddress", b => { b.HasOne("Module.Core.Models.Country", "Country") .WithMany() .HasForeignKey("CountryId"); b.HasOne("Module.Core.Models.District", "District") .WithMany() .HasForeignKey("DistrictId"); b.HasOne("Module.Core.Models.StateOrProvince", "StateOrProvince") .WithMany() .HasForeignKey("StateOrProvinceId"); }); modelBuilder.Entity("Module.Orders.Models.OrderItem", b => { b.HasOne("Module.Orders.Models.Order", "Order") .WithMany("OrderItems") .HasForeignKey("OrderId"); b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany() .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.ProductComparison.Models.ComparingProduct", b => { b.HasOne("Module.Catalog.Models.Product", "Product") .WithMany() .HasForeignKey("ProductId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("Module.Core.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Module.Reviews.Models.Review", b => { b.HasOne("Module.Core.Models.User", "User") .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); } } }
31.830498
117
0.438226
[ "Apache-2.0" ]
JuRogn/BaseProject
src/WebHost/Migrations/SimplDbContextModelSnapshot.cs
52,395
C#
using System.ComponentModel.DataAnnotations; namespace CustomerQuery.Models { public class ExternalLoginConfirmationViewModel { [Required] [Display(Name = "User name")] public string UserName { get; set; } } public class ManageUserViewModel { [Required] [DataType(DataType.Password)] [Display(Name = "Current password")] public string OldPassword { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "New password")] public string NewPassword { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm new password")] [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] public string ConfirmPassword { get; set; } } public class LoginViewModel { [Required] [Display(Name = "User name")] public string UserName { get; set; } [Required] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [Display(Name = "Remember me?")] public bool RememberMe { get; set; } } public class RegisterViewModel { [Required] [Display(Name = "User name")] public string UserName { get; set; } [Required] [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)] [DataType(DataType.Password)] [Display(Name = "Password")] public string Password { get; set; } [DataType(DataType.Password)] [Display(Name = "Confirm password")] [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] public string ConfirmPassword { get; set; } } }
30.71875
110
0.604781
[ "MIT" ]
azurechamp/AppServiceCamp
Presentation/Web/Demo2 - Cache Azure Table Storage/source/CustomerQuery/Models/AccountViewModels.cs
1,968
C#
using Domain.Primary.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Persistence.Primary.Configurations { public class CommentRateConfig : IEntityTypeConfiguration<CommentRate> { public void Configure(EntityTypeBuilder<CommentRate> builder) { builder .ToTable("CommentRate"); builder .Property(e => e.CommentRateId) .ValueGeneratedOnAdd(); builder .HasIndex(e => e.CommentId, "IX_CommentRate_CommentId"); builder .HasOne(d => d.Comment) .WithMany(p => p.CommentRates) .HasForeignKey(d => d.CommentId) .HasConstraintName("FK_CommentRate_CommentId"); builder .Property(e => e.UserId) .IsRequired() .HasMaxLength(450); builder .HasIndex(e => new {e.CommentId, e.UserId}) .IsUnique(); } } }
29
74
0.550792
[ "Apache-2.0" ]
BobMakhlin/XNews-backend
src/Persistence.Primary/Configurations/CommentRateConfig.cs
1,075
C#
using Sabio.Web.Domain; using Sabio.Web.Models.Responses; using Sabio.Web.Services; using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web.Http; namespace Sabio.Web.Controllers.Api { [RoutePrefix("api/squadssquadTags")] public class SquadsSquadTagsAPIController : ApiController { [Route("squads/{id:int}"), HttpGet] public HttpResponseMessage SelectSquadTagBySquad(int id) { ItemsResponse<SquadTag> res = new ItemsResponse<SquadTag>(); res.Items = SquadSquadTagService.SelectSquadTags(id); return Request.CreateResponse(HttpStatusCode.OK, res); } [Route("squadTags/{id:int}"), HttpGet] public HttpResponseMessage SelectSquadBySquadTag(int id) { ItemsResponse<Squad> res = new ItemsResponse<Squad>(); res.Items = SquadSquadTagService.SelectSquads(id); return Request.CreateResponse(HttpStatusCode.OK, res); } } }
31.424242
72
0.679846
[ "MIT" ]
entrotech/deployapp
Sabio.Web/Controllers/Api/SquadsSquadTagsAPIController.cs
1,039
C#
using Moq; using NUnit.Framework; using System; using TestStack.FluentMVCTesting; using ToDoList.Models; using ToDoList.Models.Enums; using ToDoList.Services.Contracts; using ToDoList.Web.Areas.User.Controllers; using ToDoList.Web.Models.TaskViewModels; namespace ToDoList.Web.Tests.Controllers.ToDoListControllerTests { [TestFixture] public class EditListSould { [Test] public void Throw_WhenIdIsEmpty() { //Arrange var mokcedToDoListModelService = new Mock<IToDoListModelService>(); var mokcedUserService = new Mock<IUserService>(); var controller = new ToDoListController(mokcedToDoListModelService.Object, mokcedUserService.Object); //Act&Assert Assert.Throws<ArgumentException>(() => { controller.EditList(string.Empty,It.IsAny<ToDoListViewModel>()); }); } [Test] public void Throw_WhenIdIsNull() { //Arrange var mokcedToDoListModelService = new Mock<IToDoListModelService>(); var mokcedUserService = new Mock<IUserService>(); var controller = new ToDoListController(mokcedToDoListModelService.Object, mokcedUserService.Object); //Act&Assert Assert.Throws<ArgumentNullException>(() => { controller.EditList(null, It.IsAny<ToDoListViewModel>()); }); } [Test] public void CallToDoListModelServiceMethodGetListById_OnlyOnce() { //Arrange var mokcedToDoListModelService = new Mock<IToDoListModelService>(); var mokcedUserService = new Mock<IUserService>(); var mockedList = new Mock<ToDoListModel>(); var id = Guid.NewGuid(); mockedList.Object.Id = id; mokcedToDoListModelService.Setup(s => s.GetListById(id)).Returns(mockedList.Object); var controller = new ToDoListController(mokcedToDoListModelService.Object, mokcedUserService.Object); var listmodel = new ToDoListViewModel() { Name = "name", IsPublic = true, Category = CategoryTypes.Entertainment}; //Act controller.EditList(id.ToString(), listmodel); //Assert mokcedToDoListModelService.Verify(s => s.GetListById(id), Times.Once); } [Test] public void CallToDoListModelServiceMethodUpdateToDoList_OnlyOnce() { //Arrange var mokcedToDoListModelService = new Mock<IToDoListModelService>(); var mokcedUserService = new Mock<IUserService>(); var mockedList = new Mock<ToDoListModel>(); var id = Guid.NewGuid(); mockedList.Object.Id = id; mokcedToDoListModelService.Setup(s => s.GetListById(id)).Returns(mockedList.Object); var controller = new ToDoListController(mokcedToDoListModelService.Object, mokcedUserService.Object); var listmodel = new ToDoListViewModel() { Name = "name", IsPublic = true, Category = CategoryTypes.Entertainment }; //Act&Assert controller.WithCallTo(c => c.EditList(id.ToString(), listmodel)).ShouldRedirectTo(r => r.ListsAndTasks(It.IsAny<string>())); } } }
38.081395
136
0.641832
[ "MIT" ]
mkjordanov/ToDoList
ToDoList.Web.Tests/Controllers/ToDoListControllerTests/EditListSould.cs
3,277
C#
// <auto-generated /> using System; using MaestroApp.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace MaestroApp.Migrations { [DbContext(typeof(MaestroAppDbContext))] [Migration("20190727204054_addcampoviajeorigen")] partial class addcampoviajeorigen { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn) .HasAnnotation("ProductVersion", "2.2.4-servicing-10062") .HasAnnotation("Relational:MaxIdentifierLength", 63); modelBuilder.Entity("Abp.Application.Editions.Edition", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<string>("DisplayName") .IsRequired() .HasMaxLength(64); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<string>("Name") .IsRequired() .HasMaxLength(32); b.HasKey("Id"); b.ToTable("AbpEditions"); }); modelBuilder.Entity("Abp.Application.Features.FeatureSetting", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<string>("Discriminator") .IsRequired(); b.Property<string>("Name") .IsRequired() .HasMaxLength(128); b.Property<int?>("TenantId"); b.Property<string>("Value") .IsRequired() .HasMaxLength(2000); b.HasKey("Id"); b.ToTable("AbpFeatures"); b.HasDiscriminator<string>("Discriminator").HasValue("FeatureSetting"); }); modelBuilder.Entity("Abp.Auditing.AuditLog", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("BrowserInfo") .HasMaxLength(512); b.Property<string>("ClientIpAddress") .HasMaxLength(64); b.Property<string>("ClientName") .HasMaxLength(128); b.Property<string>("CustomData") .HasMaxLength(2000); b.Property<string>("Exception") .HasMaxLength(2000); b.Property<int>("ExecutionDuration"); b.Property<DateTime>("ExecutionTime"); b.Property<int?>("ImpersonatorTenantId"); b.Property<long?>("ImpersonatorUserId"); b.Property<string>("MethodName") .HasMaxLength(256); b.Property<string>("Parameters") .HasMaxLength(1024); b.Property<string>("ReturnValue"); b.Property<string>("ServiceName") .HasMaxLength(256); b.Property<int?>("TenantId"); b.Property<long?>("UserId"); b.HasKey("Id"); b.HasIndex("TenantId", "ExecutionDuration"); b.HasIndex("TenantId", "ExecutionTime"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpAuditLogs"); }); modelBuilder.Entity("Abp.Authorization.PermissionSetting", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<string>("Discriminator") .IsRequired(); b.Property<bool>("IsGranted"); b.Property<string>("Name") .IsRequired() .HasMaxLength(128); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("TenantId", "Name"); b.ToTable("AbpPermissions"); b.HasDiscriminator<string>("Discriminator").HasValue("PermissionSetting"); }); modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ClaimType") .HasMaxLength(256); b.Property<string>("ClaimValue"); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<int>("RoleId"); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("RoleId"); b.HasIndex("TenantId", "ClaimType"); b.ToTable("AbpRoleClaims"); }); modelBuilder.Entity("Abp.Authorization.Users.UserAccount", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<string>("EmailAddress") .HasMaxLength(256); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<int?>("TenantId"); b.Property<long>("UserId"); b.Property<long?>("UserLinkId"); b.Property<string>("UserName") .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("EmailAddress"); b.HasIndex("UserName"); b.HasIndex("TenantId", "EmailAddress"); b.HasIndex("TenantId", "UserId"); b.HasIndex("TenantId", "UserName"); b.ToTable("AbpUserAccounts"); }); modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ClaimType") .HasMaxLength(256); b.Property<string>("ClaimValue"); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<int?>("TenantId"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "ClaimType"); b.ToTable("AbpUserClaims"); }); modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("LoginProvider") .IsRequired() .HasMaxLength(128); b.Property<string>("ProviderKey") .IsRequired() .HasMaxLength(256); b.Property<int?>("TenantId"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "UserId"); b.HasIndex("TenantId", "LoginProvider", "ProviderKey"); b.ToTable("AbpUserLogins"); }); modelBuilder.Entity("Abp.Authorization.Users.UserLoginAttempt", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("BrowserInfo") .HasMaxLength(512); b.Property<string>("ClientIpAddress") .HasMaxLength(64); b.Property<string>("ClientName") .HasMaxLength(128); b.Property<DateTime>("CreationTime"); b.Property<byte>("Result"); b.Property<string>("TenancyName") .HasMaxLength(64); b.Property<int?>("TenantId"); b.Property<long?>("UserId"); b.Property<string>("UserNameOrEmailAddress") .HasMaxLength(255); b.HasKey("Id"); b.HasIndex("UserId", "TenantId"); b.HasIndex("TenancyName", "UserNameOrEmailAddress", "Result"); b.ToTable("AbpUserLoginAttempts"); }); modelBuilder.Entity("Abp.Authorization.Users.UserOrganizationUnit", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<bool>("IsDeleted"); b.Property<long>("OrganizationUnitId"); b.Property<int?>("TenantId"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("TenantId", "OrganizationUnitId"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpUserOrganizationUnits"); }); modelBuilder.Entity("Abp.Authorization.Users.UserRole", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<int>("RoleId"); b.Property<int?>("TenantId"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "RoleId"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpUserRoles"); }); modelBuilder.Entity("Abp.Authorization.Users.UserToken", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime?>("ExpireDate"); b.Property<string>("LoginProvider") .HasMaxLength(128); b.Property<string>("Name") .HasMaxLength(128); b.Property<int?>("TenantId"); b.Property<long>("UserId"); b.Property<string>("Value") .HasMaxLength(512); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpUserTokens"); }); modelBuilder.Entity("Abp.BackgroundJobs.BackgroundJobInfo", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<bool>("IsAbandoned"); b.Property<string>("JobArgs") .IsRequired() .HasMaxLength(1048576); b.Property<string>("JobType") .IsRequired() .HasMaxLength(512); b.Property<DateTime?>("LastTryTime"); b.Property<DateTime>("NextTryTime"); b.Property<byte>("Priority"); b.Property<short>("TryCount"); b.HasKey("Id"); b.HasIndex("IsAbandoned", "NextTryTime"); b.ToTable("AbpBackgroundJobs"); }); modelBuilder.Entity("Abp.Configuration.Setting", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<string>("Name") .IsRequired() .HasMaxLength(256); b.Property<int?>("TenantId"); b.Property<long?>("UserId"); b.Property<string>("Value") .HasMaxLength(2000); b.HasKey("Id"); b.HasIndex("UserId"); b.HasIndex("TenantId", "Name"); b.ToTable("AbpSettings"); }); modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("ChangeTime"); b.Property<byte>("ChangeType"); b.Property<long>("EntityChangeSetId"); b.Property<string>("EntityId") .HasMaxLength(48); b.Property<string>("EntityTypeFullName") .HasMaxLength(192); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("EntityChangeSetId"); b.HasIndex("EntityTypeFullName", "EntityId"); b.ToTable("AbpEntityChanges"); }); modelBuilder.Entity("Abp.EntityHistory.EntityChangeSet", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("BrowserInfo") .HasMaxLength(512); b.Property<string>("ClientIpAddress") .HasMaxLength(64); b.Property<string>("ClientName") .HasMaxLength(128); b.Property<DateTime>("CreationTime"); b.Property<string>("ExtensionData"); b.Property<int?>("ImpersonatorTenantId"); b.Property<long?>("ImpersonatorUserId"); b.Property<string>("Reason") .HasMaxLength(256); b.Property<int?>("TenantId"); b.Property<long?>("UserId"); b.HasKey("Id"); b.HasIndex("TenantId", "CreationTime"); b.HasIndex("TenantId", "Reason"); b.HasIndex("TenantId", "UserId"); b.ToTable("AbpEntityChangeSets"); }); modelBuilder.Entity("Abp.EntityHistory.EntityPropertyChange", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<long>("EntityChangeId"); b.Property<string>("NewValue") .HasMaxLength(512); b.Property<string>("OriginalValue") .HasMaxLength(512); b.Property<string>("PropertyName") .HasMaxLength(96); b.Property<string>("PropertyTypeFullName") .HasMaxLength(192); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("EntityChangeId"); b.ToTable("AbpEntityPropertyChanges"); }); modelBuilder.Entity("Abp.Localization.ApplicationLanguage", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<string>("DisplayName") .IsRequired() .HasMaxLength(64); b.Property<string>("Icon") .HasMaxLength(128); b.Property<bool>("IsDeleted"); b.Property<bool>("IsDisabled"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<string>("Name") .IsRequired() .HasMaxLength(10); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("TenantId", "Name"); b.ToTable("AbpLanguages"); }); modelBuilder.Entity("Abp.Localization.ApplicationLanguageText", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<string>("Key") .IsRequired() .HasMaxLength(256); b.Property<string>("LanguageName") .IsRequired() .HasMaxLength(10); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<string>("Source") .IsRequired() .HasMaxLength(128); b.Property<int?>("TenantId"); b.Property<string>("Value") .IsRequired() .HasMaxLength(100); b.HasKey("Id"); b.HasIndex("TenantId", "Source", "LanguageName", "Key"); b.ToTable("AbpLanguageTexts"); }); modelBuilder.Entity("Abp.Notifications.NotificationInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<string>("Data") .HasMaxLength(1048576); b.Property<string>("DataTypeName") .HasMaxLength(512); b.Property<string>("EntityId") .HasMaxLength(96); b.Property<string>("EntityTypeAssemblyQualifiedName") .HasMaxLength(512); b.Property<string>("EntityTypeName") .HasMaxLength(250); b.Property<string>("ExcludedUserIds") .HasMaxLength(131072); b.Property<string>("NotificationName") .IsRequired() .HasMaxLength(96); b.Property<byte>("Severity"); b.Property<string>("TenantIds") .HasMaxLength(131072); b.Property<string>("UserIds") .HasMaxLength(131072); b.HasKey("Id"); b.ToTable("AbpNotifications"); }); modelBuilder.Entity("Abp.Notifications.NotificationSubscriptionInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<string>("EntityId") .HasMaxLength(96); b.Property<string>("EntityTypeAssemblyQualifiedName") .HasMaxLength(512); b.Property<string>("EntityTypeName") .HasMaxLength(250); b.Property<string>("NotificationName") .HasMaxLength(96); b.Property<int?>("TenantId"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("NotificationName", "EntityTypeName", "EntityId", "UserId"); b.HasIndex("TenantId", "NotificationName", "EntityTypeName", "EntityId", "UserId"); b.ToTable("AbpNotificationSubscriptions"); }); modelBuilder.Entity("Abp.Notifications.TenantNotificationInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<string>("Data") .HasMaxLength(1048576); b.Property<string>("DataTypeName") .HasMaxLength(512); b.Property<string>("EntityId") .HasMaxLength(96); b.Property<string>("EntityTypeAssemblyQualifiedName") .HasMaxLength(512); b.Property<string>("EntityTypeName") .HasMaxLength(250); b.Property<string>("NotificationName") .IsRequired() .HasMaxLength(96); b.Property<byte>("Severity"); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("TenantId"); b.ToTable("AbpTenantNotifications"); }); modelBuilder.Entity("Abp.Notifications.UserNotificationInfo", b => { b.Property<Guid>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<int>("State"); b.Property<int?>("TenantId"); b.Property<Guid>("TenantNotificationId"); b.Property<long>("UserId"); b.HasKey("Id"); b.HasIndex("UserId", "State", "CreationTime"); b.ToTable("AbpUserNotifications"); }); modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<string>("Code") .IsRequired() .HasMaxLength(95); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<string>("DisplayName") .IsRequired() .HasMaxLength(128); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<long?>("ParentId"); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("ParentId"); b.HasIndex("TenantId", "Code"); b.ToTable("AbpOrganizationUnits"); }); modelBuilder.Entity("Abp.Organizations.OrganizationUnitRole", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<bool>("IsDeleted"); b.Property<long>("OrganizationUnitId"); b.Property<int>("RoleId"); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("TenantId", "OrganizationUnitId"); b.HasIndex("TenantId", "RoleId"); b.ToTable("AbpOrganizationUnitRoles"); }); modelBuilder.Entity("MaestroApp.Authorization.Roles.Role", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasMaxLength(128); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<string>("Description") .HasMaxLength(5000); b.Property<string>("DisplayName") .IsRequired() .HasMaxLength(64); b.Property<bool>("IsDefault"); b.Property<bool>("IsDeleted"); b.Property<bool>("IsStatic"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<string>("Name") .IsRequired() .HasMaxLength(32); b.Property<string>("NormalizedName") .IsRequired() .HasMaxLength(32); b.Property<int?>("TenantId"); b.HasKey("Id"); b.HasIndex("CreatorUserId"); b.HasIndex("DeleterUserId"); b.HasIndex("LastModifierUserId"); b.HasIndex("TenantId", "NormalizedName"); b.ToTable("AbpRoles"); }); modelBuilder.Entity("MaestroApp.Authorization.Users.User", b => { b.Property<long>("Id") .ValueGeneratedOnAdd(); b.Property<int>("AccessFailedCount"); b.Property<string>("AuthenticationSource") .HasMaxLength(64); b.Property<string>("ConcurrencyStamp") .IsConcurrencyToken() .HasMaxLength(128); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<string>("EmailAddress") .IsRequired() .HasMaxLength(256); b.Property<string>("EmailConfirmationCode") .HasMaxLength(328); b.Property<bool>("IsActive"); b.Property<bool>("IsDeleted"); b.Property<bool>("IsEmailConfirmed"); b.Property<bool>("IsLockoutEnabled"); b.Property<bool>("IsPhoneNumberConfirmed"); b.Property<bool>("IsTwoFactorEnabled"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<DateTime?>("LockoutEndDateUtc"); b.Property<string>("Name") .IsRequired() .HasMaxLength(64); b.Property<string>("NormalizedEmailAddress") .IsRequired() .HasMaxLength(256); b.Property<string>("NormalizedUserName") .IsRequired() .HasMaxLength(256); b.Property<string>("Password") .IsRequired() .HasMaxLength(128); b.Property<string>("PasswordResetCode") .HasMaxLength(328); b.Property<string>("PhoneNumber") .HasMaxLength(32); b.Property<string>("SecurityStamp") .HasMaxLength(128); b.Property<string>("Surname") .IsRequired() .HasMaxLength(64); b.Property<int?>("TenantId"); b.Property<string>("UserName") .IsRequired() .HasMaxLength(256); b.HasKey("Id"); b.HasIndex("CreatorUserId"); b.HasIndex("DeleterUserId"); b.HasIndex("LastModifierUserId"); b.HasIndex("TenantId", "NormalizedEmailAddress"); b.HasIndex("TenantId", "NormalizedUserName"); b.ToTable("AbpUsers"); }); modelBuilder.Entity("MaestroApp.Maestro.Container.Contenedor", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<int>("CantidadViajes"); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<int>("EstadoId"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<string>("Nombre") .IsRequired() .HasMaxLength(100); b.HasKey("Id"); b.HasIndex("EstadoId"); b.ToTable("MaestroContenedor"); }); modelBuilder.Entity("MaestroApp.Maestro.State.Estado", b => { b.Property<int>("EstadoId") .ValueGeneratedOnAdd(); b.Property<string>("Nombre") .IsRequired() .HasMaxLength(100); b.HasKey("EstadoId"); b.ToTable("MaestroEstado"); }); modelBuilder.Entity("MaestroApp.Maestro.Travel.Viaje", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<string>("Destino") .IsRequired() .HasMaxLength(100); b.Property<int>("EstadoId"); b.Property<DateTime>("FechaFin"); b.Property<DateTime>("FechaInicio"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<string>("Origen") .IsRequired() .HasMaxLength(100); b.Property<string>("Responsable") .IsRequired() .HasMaxLength(100); b.HasKey("Id"); b.HasIndex("EstadoId"); b.ToTable("MaestroViaje"); }); modelBuilder.Entity("MaestroApp.Maestro.TravelContainer.ViajeContenedor", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<int>("ContenedorId"); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<int>("ViajeId"); b.HasKey("Id"); b.HasIndex("ContenedorId"); b.HasIndex("ViajeId"); b.ToTable("MaestroViajeContenedor"); }); modelBuilder.Entity("MaestroApp.MultiTenancy.Tenant", b => { b.Property<int>("Id") .ValueGeneratedOnAdd(); b.Property<string>("ConnectionString") .HasMaxLength(1024); b.Property<DateTime>("CreationTime"); b.Property<long?>("CreatorUserId"); b.Property<long?>("DeleterUserId"); b.Property<DateTime?>("DeletionTime"); b.Property<int?>("EditionId"); b.Property<bool>("IsActive"); b.Property<bool>("IsDeleted"); b.Property<DateTime?>("LastModificationTime"); b.Property<long?>("LastModifierUserId"); b.Property<string>("Name") .IsRequired() .HasMaxLength(128); b.Property<string>("TenancyName") .IsRequired() .HasMaxLength(64); b.HasKey("Id"); b.HasIndex("CreatorUserId"); b.HasIndex("DeleterUserId"); b.HasIndex("EditionId"); b.HasIndex("LastModifierUserId"); b.HasIndex("TenancyName"); b.ToTable("AbpTenants"); }); modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b => { b.HasBaseType("Abp.Application.Features.FeatureSetting"); b.Property<int>("EditionId"); b.HasIndex("EditionId", "Name"); b.ToTable("AbpFeatures"); b.HasDiscriminator().HasValue("EditionFeatureSetting"); }); modelBuilder.Entity("Abp.MultiTenancy.TenantFeatureSetting", b => { b.HasBaseType("Abp.Application.Features.FeatureSetting"); b.HasIndex("TenantId", "Name"); b.ToTable("AbpFeatures"); b.HasDiscriminator().HasValue("TenantFeatureSetting"); }); modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b => { b.HasBaseType("Abp.Authorization.PermissionSetting"); b.Property<int>("RoleId"); b.HasIndex("RoleId"); b.ToTable("AbpPermissions"); b.HasDiscriminator().HasValue("RolePermissionSetting"); }); modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b => { b.HasBaseType("Abp.Authorization.PermissionSetting"); b.Property<long>("UserId"); b.HasIndex("UserId"); b.ToTable("AbpPermissions"); b.HasDiscriminator().HasValue("UserPermissionSetting"); }); modelBuilder.Entity("Abp.Authorization.Roles.RoleClaim", b => { b.HasOne("MaestroApp.Authorization.Roles.Role") .WithMany("Claims") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.Authorization.Users.UserClaim", b => { b.HasOne("MaestroApp.Authorization.Users.User") .WithMany("Claims") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.Authorization.Users.UserLogin", b => { b.HasOne("MaestroApp.Authorization.Users.User") .WithMany("Logins") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.Authorization.Users.UserRole", b => { b.HasOne("MaestroApp.Authorization.Users.User") .WithMany("Roles") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.Authorization.Users.UserToken", b => { b.HasOne("MaestroApp.Authorization.Users.User") .WithMany("Tokens") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.Configuration.Setting", b => { b.HasOne("MaestroApp.Authorization.Users.User") .WithMany("Settings") .HasForeignKey("UserId"); }); modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => { b.HasOne("Abp.EntityHistory.EntityChangeSet") .WithMany("EntityChanges") .HasForeignKey("EntityChangeSetId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.EntityHistory.EntityPropertyChange", b => { b.HasOne("Abp.EntityHistory.EntityChange") .WithMany("PropertyChanges") .HasForeignKey("EntityChangeId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.Organizations.OrganizationUnit", b => { b.HasOne("Abp.Organizations.OrganizationUnit", "Parent") .WithMany("Children") .HasForeignKey("ParentId"); }); modelBuilder.Entity("MaestroApp.Authorization.Roles.Role", b => { b.HasOne("MaestroApp.Authorization.Users.User", "CreatorUser") .WithMany() .HasForeignKey("CreatorUserId"); b.HasOne("MaestroApp.Authorization.Users.User", "DeleterUser") .WithMany() .HasForeignKey("DeleterUserId"); b.HasOne("MaestroApp.Authorization.Users.User", "LastModifierUser") .WithMany() .HasForeignKey("LastModifierUserId"); }); modelBuilder.Entity("MaestroApp.Authorization.Users.User", b => { b.HasOne("MaestroApp.Authorization.Users.User", "CreatorUser") .WithMany() .HasForeignKey("CreatorUserId"); b.HasOne("MaestroApp.Authorization.Users.User", "DeleterUser") .WithMany() .HasForeignKey("DeleterUserId"); b.HasOne("MaestroApp.Authorization.Users.User", "LastModifierUser") .WithMany() .HasForeignKey("LastModifierUserId"); }); modelBuilder.Entity("MaestroApp.Maestro.Container.Contenedor", b => { b.HasOne("MaestroApp.Maestro.State.Estado", "Estado") .WithMany() .HasForeignKey("EstadoId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("MaestroApp.Maestro.Travel.Viaje", b => { b.HasOne("MaestroApp.Maestro.State.Estado", "Estado") .WithMany() .HasForeignKey("EstadoId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("MaestroApp.Maestro.TravelContainer.ViajeContenedor", b => { b.HasOne("MaestroApp.Maestro.Container.Contenedor", "Contenedor") .WithMany("ViajeContenedor") .HasForeignKey("ContenedorId") .OnDelete(DeleteBehavior.Cascade); b.HasOne("MaestroApp.Maestro.Travel.Viaje", "Viaje") .WithMany("ViajeContenedor") .HasForeignKey("ViajeId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("MaestroApp.MultiTenancy.Tenant", b => { b.HasOne("MaestroApp.Authorization.Users.User", "CreatorUser") .WithMany() .HasForeignKey("CreatorUserId"); b.HasOne("MaestroApp.Authorization.Users.User", "DeleterUser") .WithMany() .HasForeignKey("DeleterUserId"); b.HasOne("Abp.Application.Editions.Edition", "Edition") .WithMany() .HasForeignKey("EditionId"); b.HasOne("MaestroApp.Authorization.Users.User", "LastModifierUser") .WithMany() .HasForeignKey("LastModifierUserId"); }); modelBuilder.Entity("Abp.Application.Features.EditionFeatureSetting", b => { b.HasOne("Abp.Application.Editions.Edition", "Edition") .WithMany() .HasForeignKey("EditionId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.Authorization.Roles.RolePermissionSetting", b => { b.HasOne("MaestroApp.Authorization.Roles.Role") .WithMany("Permissions") .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Abp.Authorization.Users.UserPermissionSetting", b => { b.HasOne("MaestroApp.Authorization.Users.User") .WithMany("Permissions") .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); #pragma warning restore 612, 618 } } }
31.920028
108
0.440436
[ "MIT" ]
dviltres18/MaestroApp
aspnet-core/src/MaestroApp.EntityFrameworkCore/Migrations/20190727204054_addcampoviajeorigen.Designer.cs
45,105
C#
/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ /* * Do not modify this file. This file is generated from the shield-2016-06-02.normal.json service model. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using System.IO; using System.Net; using Amazon.Runtime; using Amazon.Runtime.Internal; namespace Amazon.Shield.Model { /// <summary> /// This is the response object from the DescribeAttack operation. /// </summary> public partial class DescribeAttackResponse : AmazonWebServiceResponse { private AttackDetail _attack; /// <summary> /// Gets and sets the property Attack. /// <para> /// The attack that is described. /// </para> /// </summary> public AttackDetail Attack { get { return this._attack; } set { this._attack = value; } } // Check to see if Attack property is set internal bool IsSetAttack() { return this._attack != null; } } }
28.210526
104
0.652985
[ "Apache-2.0" ]
ChristopherButtars/aws-sdk-net
sdk/src/Services/Shield/Generated/Model/DescribeAttackResponse.cs
1,608
C#
namespace SentimentAnalyzer.Services.Data { using System.Linq; using MovieMind.Data.Common; using SentimentAnalyzer.Data.Models; public class WordsOccurrencesService : IWordsOccurrencesService { private readonly IDbRepository<WordOccurrences> wordOccurrences; public WordsOccurrencesService(IDbRepository<WordOccurrences> wordOccurrences) { this.wordOccurrences = wordOccurrences; } public void Create(WordOccurrences word) { this.wordOccurrences.Add(word); this.wordOccurrences.Save(); } public IQueryable<WordOccurrences> GetAll() { return this.wordOccurrences.All() .OrderBy(w => w.Word); } } }
26.586207
86
0.639429
[ "MIT" ]
gbelcheva/MovieMind
Source/Services/SentimentAnalyzer.Services.Data/WordsOccurrencesService.cs
773
C#
/* * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ namespace TencentCloud.Antiddos.V20200309.Models { using Newtonsoft.Json; using System.Collections.Generic; using TencentCloud.Common; public class BGPIPInstance : AbstractModel { /// <summary> /// 资产实例的详细信息 /// </summary> [JsonProperty("InstanceDetail")] public InstanceRelation InstanceDetail{ get; set; } /// <summary> /// 资产实例的规格信息 /// </summary> [JsonProperty("SpecificationLimit")] public BGPIPInstanceSpecification SpecificationLimit{ get; set; } /// <summary> /// 资产实例的使用统计信息 /// </summary> [JsonProperty("Usage")] public BGPIPInstanceUsages Usage{ get; set; } /// <summary> /// 资产实例所在的地域 /// </summary> [JsonProperty("Region")] public RegionInfo Region{ get; set; } /// <summary> /// 资产实例的防护状态,状态码如下: /// "idle":正常状态(无攻击) /// "attacking":攻击中 /// "blocking":封堵中 /// "creating":创建中 /// "deblocking":解封中 /// "isolate":回收隔离中 /// </summary> [JsonProperty("Status")] public string Status{ get; set; } /// <summary> /// 购买时间 /// </summary> [JsonProperty("ExpiredTime")] public string ExpiredTime{ get; set; } /// <summary> /// 到期时间 /// </summary> [JsonProperty("CreatedTime")] public string CreatedTime{ get; set; } /// <summary> /// 资产实例的名称 /// </summary> [JsonProperty("Name")] public string Name{ get; set; } /// <summary> /// 资产实例所属的套餐包信息, /// 注意:当资产实例不是套餐包的实例时,此字段为null /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("PackInfo")] public PackInfo PackInfo{ get; set; } /// <summary> /// 资产实例所属的三网套餐包详情, /// 注意:当资产实例不是三网套餐包的实例时,此字段为null /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("StaticPackRelation")] public StaticPackRelation StaticPackRelation{ get; set; } /// <summary> /// 区分高防IP境外线路 /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("ZoneId")] public ulong? ZoneId{ get; set; } /// <summary> /// 区分集群 /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("Tgw")] public ulong? Tgw{ get; set; } /// <summary> /// 高防弹性公网IP状态,包含'CREATING'(创建中),'BINDING'(绑定中),'BIND'(已绑定),'UNBINDING'(解绑中),'UNBIND'(已解绑),'OFFLINING'(释放中),'BIND_ENI'(绑定悬空弹性网卡)。只对高防弹性公网IP实例有效。 /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("EipAddressStatus")] public string EipAddressStatus{ get; set; } /// <summary> /// 是否高防弹性公网IP实例,是为1,否为0。 /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("EipFlag")] public long? EipFlag{ get; set; } /// <summary> /// 资产实例所属的高防弹性公网IP套餐包详情, /// 注意:当资产实例不是高防弹性公网IP套餐包的实例时,此字段为null /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("EipAddressPackRelation")] public EipAddressPackRelation EipAddressPackRelation{ get; set; } /// <summary> /// 高防弹性公网IP关联的实例信息。 /// 注意:当资产实例不是高防弹性公网IP实例时,此字段为null /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("EipAddressInfo")] public EipAddressRelation EipAddressInfo{ get; set; } /// <summary> /// 建议客户接入的域名,客户可使用域名接入。 /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("Domain")] public string Domain{ get; set; } /// <summary> /// 是否开启安全加速,是为1,否为0。 /// </summary> [JsonProperty("DamDDoSStatus")] public ulong? DamDDoSStatus{ get; set; } /// <summary> /// 是否Ipv6版本的IP, 是为1,否为0 /// 注意:此字段可能返回 null,表示取不到有效值。 /// </summary> [JsonProperty("V6Flag")] public ulong? V6Flag{ get; set; } /// <summary> /// For internal usage only. DO NOT USE IT. /// </summary> public override void ToMap(Dictionary<string, string> map, string prefix) { this.SetParamObj(map, prefix + "InstanceDetail.", this.InstanceDetail); this.SetParamObj(map, prefix + "SpecificationLimit.", this.SpecificationLimit); this.SetParamObj(map, prefix + "Usage.", this.Usage); this.SetParamObj(map, prefix + "Region.", this.Region); this.SetParamSimple(map, prefix + "Status", this.Status); this.SetParamSimple(map, prefix + "ExpiredTime", this.ExpiredTime); this.SetParamSimple(map, prefix + "CreatedTime", this.CreatedTime); this.SetParamSimple(map, prefix + "Name", this.Name); this.SetParamObj(map, prefix + "PackInfo.", this.PackInfo); this.SetParamObj(map, prefix + "StaticPackRelation.", this.StaticPackRelation); this.SetParamSimple(map, prefix + "ZoneId", this.ZoneId); this.SetParamSimple(map, prefix + "Tgw", this.Tgw); this.SetParamSimple(map, prefix + "EipAddressStatus", this.EipAddressStatus); this.SetParamSimple(map, prefix + "EipFlag", this.EipFlag); this.SetParamObj(map, prefix + "EipAddressPackRelation.", this.EipAddressPackRelation); this.SetParamObj(map, prefix + "EipAddressInfo.", this.EipAddressInfo); this.SetParamSimple(map, prefix + "Domain", this.Domain); this.SetParamSimple(map, prefix + "DamDDoSStatus", this.DamDDoSStatus); this.SetParamSimple(map, prefix + "V6Flag", this.V6Flag); } } }
33.789474
152
0.575234
[ "Apache-2.0" ]
TencentCloud/tencentcloud-sdk-dotnet
TencentCloud/Antiddos/V20200309/Models/BGPIPInstance.cs
7,586
C#
namespace doorman_db_api.data.interfaces { using entities; using implementations.entities; using System; using System.Data.Entity; public interface IContext : IDisposable { DbSet<CardEntity> Cards { get; } int SaveChanges(); void SetModified(IEntity entity); } }
21.133333
43
0.659306
[ "MIT" ]
pandawan91/doorman-db-api
doorman-db-api/doorman-db-api-data/interfaces/IContext.cs
319
C#
using BattleTech; using Harmony; using System; using System.Collections.Generic; using UnityEngine; using us.frostraptor.modUtils; namespace AurasHelper { [HarmonyPatch(typeof(AuraCache), "UpdateAura")] [HarmonyPatch(new Type[] { typeof(AbstractActor), typeof(AbstractActor), typeof(Vector3), typeof(Ability), typeof(float), typeof(EffectTriggerType), typeof(bool) })] public static class AuraCache_UpdateAura_Ability { public static void Postfix(AuraCache __instance, AbstractActor fromActor, AbstractActor movingActor, Vector3 movingActorPos, Ability auraAbility, float distSquared, EffectTriggerType triggerSource, bool skipECMCheck) { Mod.Log.Trace("AC:UA:A entered"); } } [HarmonyPatch(typeof(AuraCache), "UpdateAura")] [HarmonyPatch(new Type[] { typeof(AbstractActor), typeof(AbstractActor), typeof(Vector3), typeof(MechComponent), typeof(float), typeof(EffectTriggerType), typeof(bool)})] public static class AuraCache_UpdateAura_MechComponent { public static void Postfix(AuraCache __instance, AbstractActor fromActor, AbstractActor movingActor, Vector3 movingActorPos, MechComponent auraComponent, float distSquared, EffectTriggerType triggerSource, bool skipECMCheck) { Mod.Log.Trace("AC:UA:MC entered"); } } [HarmonyPatch(typeof(AuraCache), "AuraConditionsPassed")] [HarmonyPatch(new Type[] { typeof(AbstractActor), typeof(Ability), typeof(EffectData), typeof(float), typeof(EffectTriggerType) })] public static class AuraCache_AuraConditionsPassed_Ability { public static void Postfix(AuraCache __instance, bool __result, AbstractActor fromActor, float distSquared) { Mod.Log.Trace($"-- AuraCache:AuraConditionsPassed:Ability result: {__result} for actor: {CombatantUtils.Label(fromActor)} at range: {distSquared}"); } } [HarmonyPatch(typeof(AuraCache), "AuraConditionsPassed")] [HarmonyPatch(new Type[] { typeof(AbstractActor), typeof(MechComponent), typeof(EffectData), typeof(float), typeof(EffectTriggerType) })] public static class AuraCache_AuraConditionsPassed_MechComponent { public static void Postfix(AuraCache __instance, bool __result, AbstractActor fromActor, float distSquared) { Mod.Log.Trace($"-- AuraCache:AuraConditionsPassed:MechComponent result: {__result} for actor: {CombatantUtils.Label(fromActor)} at range: {distSquared}"); } } [HarmonyPatch(typeof(AuraCache), "AddEffectIfNotPresent")] public static class AuraCache_AddEffectIfNotPresent{ public static void Prefix(AuraCache __instance, ref bool __result, AbstractActor fromActor, AbstractActor movingActor, Vector3 movingActorPos, string effectCreatorId, EffectData effect, ref List<string> existingEffectIDs, EffectTriggerType triggerSource) { Mod.Log.Trace("AC:AEINP:pre entered"); Traverse ownerT = Traverse.Create(__instance).Property("Owner"); AbstractActor Owner = ownerT.GetValue<AbstractActor>(); // 1. When the same effectId is added, record every actor that contributes the same effect id. Only remove the effect if all actors have removed the effect string sourcesStat = $"{effect.Description.Id}_AH_SOURCES"; string sourceValue = CombatantUtils.Label(fromActor); Mod.Log.Debug($" sourceValue: ({sourceValue})"); if (!Owner.StatCollection.ContainsStatistic(sourcesStat)) { Owner.StatCollection.AddStatistic<string>(sourcesStat, ""); Owner.StatCollection.Set<string>(sourcesStat, sourceValue); //Mod.Log.Debug($" new sources statistic: ({sourcesStat}) value: ({sourceValue})"); } else { string statSources = Owner.StatCollection.GetStatistic(sourcesStat).Value<string>(); HashSet<string> sources = new HashSet<string>(); foreach (string value in statSources.Split(',')) { if (value != null && !value.Equals(sourceValue)) { sources.Add(value); } } sources.Add(sourceValue); string newValue = string.Join(",", new List<string>(sources).ToArray()); Owner.StatCollection.Set<string>(sourcesStat, newValue); //Mod.Log.Debug($" sources statistic: ({sourcesStat}) value: ({newValue})"); } // 2. When multiple effects add to the same statistic, record each value as an array if (effect.effectType == EffectType.StatisticEffect) { Mod.Log.Debug($"Tracking statEffect vs statistic: {effect.statisticData.statName} fromActor: {CombatantUtils.Label(fromActor)} effectCreatorId: {effectCreatorId} " + $"vs. movingActor: {CombatantUtils.Label(movingActor)}"); // Create a tracking stat, denoting effectId:fromActorGUID:strength string valuesStat = $"{effect.Description.Id}_AH_VALUES"; string effectValue = $"{effect.Description.Id}:{CombatantUtils.Label(fromActor)}:{effectCreatorId}:{effect.statisticData.modValue}"; Mod.Log.Debug($" effectValue: ({effectValue})"); if (!Owner.StatCollection.ContainsStatistic(valuesStat)) { Owner.StatCollection.AddStatistic<string>(valuesStat, ""); Owner.StatCollection.Set<string>(valuesStat, effectValue); //Mod.Log.Debug($" new values statistic: ({valuesStat}) value: ({effectValue})"); } else { string statValues = Owner.StatCollection.GetStatistic(valuesStat).Value<string>(); HashSet<string> values = new HashSet<string>(); foreach (string value in statValues.Split(',')) { if (value != null && !value.Equals(effectValue)) { values.Add(value); } } values.Add(effectValue); string newValue = string.Join(",", new List<string>(values).ToArray()); Owner.StatCollection.Set<string>(valuesStat, newValue); //Mod.Log.Debug($" values statistic: ({valuesStat}) value: ({newValue})"); } } } } [HarmonyPatch(typeof(AuraCache), "RemoveEffectIfPresent")] public static class AuraCache_RemoveEffectIfPresent { public static bool Prefix(AuraCache __instance, AbstractActor fromActor, string effectCreatorId, EffectData effect, List<Effect> existingEffects, EffectTriggerType triggerSource) { Mod.Log.Trace("AC:REIP entered"); bool allowMethod = true; Traverse ownerT = Traverse.Create(__instance).Property("Owner"); AbstractActor Owner = ownerT.GetValue<AbstractActor>(); // 1. When the same effectId is added, record every actor that contributes the same effect id. Only remove the effect if all actors have removed the effect string sourcesStat = $"{effect.Description.Id}_AH_SOURCES"; string sourceValue = CombatantUtils.Label(fromActor); if (Owner.StatCollection.ContainsStatistic(sourcesStat)) { Mod.Log.Debug($" Removing effectSource: {sourceValue} from Owner: ({CombatantUtils.Label(Owner)}"); string statSources = Owner.StatCollection.GetStatistic(sourcesStat).Value<string>(); Mod.Log.Debug($" -- statSources: ({statSources})"); HashSet<string> newValues = new HashSet<string>(); foreach (string value in statSources.Split(',')) { if (value != null && value != "") { newValues.Add(value); } } if (newValues.Contains(sourceValue)) { newValues.Remove(sourceValue); } if (newValues.Count > 0) { string newValue = string.Join(",", new List<string>(newValues).ToArray()); Mod.Log.Debug($" changing effectSources on actor: ({CombatantUtils.Label(Owner)}) from: ({statSources}) to: ({newValue})"); Owner.StatCollection.Set(sourcesStat, newValue); allowMethod = false; } else { Mod.Log.Debug($" No effectSources remaining on actor: ({CombatantUtils.Label(Owner)}), removing statistic: {sourcesStat}"); Owner.StatCollection.RemoveStatistic(sourcesStat); } } // 2. When multiple effects add to the same statistic, record each value as an array if (effect != null && effect.effectType == EffectType.StatisticEffect) { string valuesStat = $"{effect.Description.Id}_AH_VALUES"; string effectValue = $"{effect.Description.Id}:{CombatantUtils.Label(fromActor)}:{effectCreatorId}:{effect.statisticData.modValue}"; if (Owner.StatCollection.ContainsStatistic(valuesStat)) { Mod.Log.Debug($" Removing effectValue: {effectValue} from Owner: ({CombatantUtils.Label(Owner)}"); string statValues = Owner.StatCollection.GetStatistic(valuesStat).Value<string>(); Mod.Log.Debug($" -- statValues: ({statValues})"); HashSet<string> newValues = new HashSet<string>(); foreach (string value in statValues.Split(',')) { if (value != null || value != "") { newValues.Add(value); } } if (newValues.Contains(effectValue)) { newValues.Remove(effectValue); } if (newValues.Count > 0) { string newValue = string.Join(",", new List<string>(newValues).ToArray()); Mod.Log.Debug($" changing statValues from: ({statValues}) to: ({newValue})"); Owner.StatCollection.Set(valuesStat, newValue); allowMethod = false; } else { Mod.Log.Debug($" No effects remaining on actor: ({CombatantUtils.Label(Owner)}), removing all values"); Owner.StatCollection.RemoveStatistic(valuesStat); } } } return allowMethod; } } [HarmonyPatch(typeof(AbstractActor), "OnMoveComplete")] public static class AbstractActor_OnMoveComplete { public static void Prefix(AbstractActor __instance) { Mod.Log.Debug($" OnMoveComplete for Actor: {CombatantUtils.Label(__instance)}"); foreach (KeyValuePair<string, Statistic> kvp in __instance.StatCollection) { if (kvp.Key.EndsWith("_AH_SOURCES") || kvp.Key.EndsWith("_AH_VALUES")) { Mod.Log.Debug($" -- stat: ({kvp.Key}) has value: ({kvp.Value.Value<string>()})"); } } foreach (AbstractActor unit in __instance.team.units) { if (unit.GUID != __instance.GUID) { Mod.Log.Debug($" -- friendly actor: {CombatantUtils.Label(unit)}"); foreach (KeyValuePair<string, Statistic> kvp in unit.StatCollection) { if (kvp.Key.EndsWith("_AH_SOURCES") || kvp.Key.EndsWith("_AH_VALUES")) { Mod.Log.Debug($" -- stat: ({kvp.Key}) has value: ({kvp.Value.Value<string>()})"); } } } } } } }
54.643192
181
0.611822
[ "MIT" ]
IceRaptor/AurasHelper
AurasHelper/AurasHelper/Patches/Patches.cs
11,641
C#
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; namespace TenisKortProjesi { public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } } }
24.333333
99
0.590753
[ "MIT" ]
erhan11040/Csharp-MVC-TennisCourt-RentApp
TenisKortProjesi/TenisKortProjesi/App_Start/RouteConfig.cs
586
C#
using CandyFramework.Core.Interface.BusinessLayer; using CandyFramework.Entity.Entity.ViewModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace CandyFramework.BusinessLayer.Interface { public interface ISettingService : IBaseService<SettingView> { void LoadSettings(); } }
23.375
64
0.786096
[ "MIT" ]
fatihgurdal/CandyFramework
CandyFramework.BusinessLayer/Interface/ISettingService.cs
376
C#
/* * Copyright (c) 2011-2014, Longxiang He <helongxiang@smeshlink.com>, * SmeshLink Technology Co. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY. * * This file is part of the CoAP.NET, a CoAP framework in C#. * Please see README for more information. */ namespace CoAP { public delegate void Action(); public delegate void Action<T1, T2>(T1 arg1, T2 arg2); public delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3); public delegate TResult Func<out TResult>(); public delegate TResult Func<in T1, out TResult>(T1 arg1); public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2); public delegate TResult Func<in T1, in T2, in T3, out TResult>(T1 arg1, T2 arg2, T3 arg3); public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4); public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5); }
41.04
126
0.688109
[ "BSD-3-Clause" ]
Com-AugustCellars/CoAP-CSharp
CoAP.NET/Util/Delegates.cs
1,028
C#
using NUnit.Framework; namespace SFA.DAS.Data.Application.UnitTests.Gateways.RoatpGatewayTests { [TestFixture] public class WhenIGetProvider : RoatpGatewayTestsBase { [Test] public void WithNullUkPrnReturnsNull() { var provider = RoatpGateway.GetProvider(null); Assert.IsNull(provider); } [Test] public void WithValidUkPrnReturnsProvider() { var provider = RoatpGateway.GetProvider(ValidUkPrn); Assert.IsNotNull(provider); Assert.AreSame(provider, ExpectedProvider); } } }
25.666667
71
0.625
[ "MIT" ]
SkillsFundingAgency/das-data
src/SFA.DAS.Data.Application.UnitTests/Gateways/RoatpGatewayTests/WhenIGetProvider.cs
618
C#
using System; using System.Collections.Generic; using System.Windows.Forms; namespace Planets { class Physics { //Gravitational constant for use in Newton's law of universal gravitation private static double GravConst = .00000000006673; //Lists to keep track of all the objects created by the user private List<Planet> m_planets; private List<Star> m_stars; private List<ImmovableMass> m_masses; //Time scale private double m_time_scale; //Conversion for meters in simulation to pixels on screen private int m_meters_per_pixel; //Length of time to use for each subsimulation private float m_sub_sim_time; //Keep track of how many times to run the simulation per frame private int m_num_sub_sim; //Keep a reference to the frame the simulation is drawn to //Need it only for the height and width, which could change depending on the user PictureBox m_render_window; public Physics(double ts, int mpp, PictureBox f) { m_time_scale = ts; m_meters_per_pixel = mpp; m_render_window = f; //Initialize all of the lists m_planets = new List<Planet>(); m_stars = new List<Star>(); m_masses = new List<ImmovableMass>(); //Simulate m_sub_sim_time seconds of time per iteration of the simulation m_sub_sim_time = 0.1f; //Run the calculations in Simulate() m_num_sub_sim times per frame m_num_sub_sim = (int)(m_time_scale * .03 / m_sub_sim_time); } //Physics step called once per frame public void Simulate() { for (int i = 0; i < m_num_sub_sim; i++) { //Check each planet foreach (Planet earth in m_planets) { //keep track of the x- and y-components of the net force on the planet double xforce = 0.0; double yforce = 0.0; //Calculate the total force of the other planets affecting this planet foreach (Planet other in m_planets) { //First, find the distance between the two planets double dist = FindDistance(earth.X, earth.Y, other.X, other.Y); //Declare a double to store the magnitude of the force double subforce = 0.0; //If the planets are not colliding if (dist > 1.0) { //Calculate the force between the two planets with //Newton's Law of Universal Gravitation subforce = (GravConst * earth.Mass * other.Mass) / dist; } //Calculate the angle between the two planets double angle = FindAngle(earth.X, earth.Y, other.X, other.Y); //Break the force into it's x- and y-components and add it to the running sum xforce += subforce * Math.Cos(angle); yforce += subforce * Math.Sin(angle); } //Repeat the above, but for each star foreach (Planet other in m_stars) { double dist = FindDistance(earth.X, earth.Y, other.X, other.Y); double subforce = 0.0; if (dist > 1.0) subforce = (GravConst * earth.Mass * other.Mass) / dist; double angle = FindAngle(earth.X, earth.Y, other.X, other.Y); xforce += subforce * Math.Cos(angle); yforce += subforce * Math.Sin(angle); } //Round three, but this time with the immovable masses foreach (Planet other in m_masses) { double dist = FindDistance(earth.X, earth.Y, other.X, other.Y); double subforce = 0.0; if (dist > 1.0) subforce = (GravConst * earth.Mass * other.Mass) / dist; double angle = FindAngle(earth.X, earth.Y, other.X, other.Y); xforce += subforce * Math.Cos(angle); yforce += subforce * Math.Sin(angle); } //Calculate the x- and y-components of the planet's acceleration //Using the calculated force and the planet's mass. //Force = Mass * Acceleration double xaccel = xforce / earth.Mass; double yaccel = yforce / earth.Mass; //Calculate the x- and y-components of the planet's change //in velocity for the time step using the calculated acceleration. //Velocity = Acceleration * Time elapsed earth.XVel += xaccel * m_sub_sim_time; earth.YVel += yaccel * m_sub_sim_time; //Calculated the planet's new position using //the calculated velocity components //Divide by the distance factor to scale from meters to pixels earth.X += (float)((earth.XVel * m_sub_sim_time) / m_meters_per_pixel); earth.Y += (float)((earth.YVel * m_sub_sim_time) / m_meters_per_pixel); //Make sure the planet stays on screen CheckBounds(earth); } //Same thing as the previous block, just for each of the stars instead foreach (Planet star in m_stars) { double xforce = 0.0; double yforce = 0.0; foreach (Planet other in m_planets) { double dist = FindDistance(star.X, star.Y, other.X, other.Y); double subforce = 0.0; if (dist > 1.0) subforce = (GravConst * star.Mass * other.Mass) / dist; double angle = FindAngle(star.X, star.Y, other.X, other.Y); xforce += subforce * Math.Cos(angle); yforce += subforce * Math.Sin(angle); } foreach (Planet other in m_stars) { double dist = FindDistance(star.X, star.Y, other.X, other.Y); double subforce = 0.0; if (dist > 1.0) subforce = (GravConst * star.Mass * other.Mass) / dist; double angle = FindAngle(star.X, star.Y, other.X, other.Y); xforce += subforce * Math.Cos(angle); yforce += subforce * Math.Sin(angle); } foreach (Planet other in m_masses) { double dist = FindDistance(star.X, star.Y, other.X, other.Y); double subforce = 0.0; if (dist > 1.0) subforce = (GravConst * star.Mass * other.Mass) / dist; double angle = FindAngle(star.X, star.Y, other.X, other.Y); xforce += subforce * Math.Cos(angle); yforce += subforce * Math.Sin(angle); } double xaccel = xforce / star.Mass; double yaccel = yforce / star.Mass; star.XVel += xaccel * m_sub_sim_time; star.YVel += yaccel * m_sub_sim_time; star.X += (float)((star.XVel * m_sub_sim_time) / m_meters_per_pixel); star.Y += (float)((star.YVel * m_sub_sim_time) / m_meters_per_pixel); CheckBounds(star); } } } //Find the distance between two points using the Pythagorean Theorem private double FindDistance(float x1, float y1, float x2, float y2) { float dx = x1 - x2; float dy = y1 - y2; return Math.Sqrt(dx * dx + dy * dy) * m_meters_per_pixel; } //Find the angle between two points using arctangent() private double FindAngle(float x1, float y1, float x2, float y2) { float dx = x2 - x1; float dy = y2 - y1; return Math.Atan2(dy, dx); } //Check to make sure that a planet is in the bounds of the drawing area //Flips the sign on the correct velocity component to make it bounce off the wall private void CheckBounds(Planet planet) { //Check if the planet is going off the left side of the image if (planet.X < 0) { planet.X = 0; planet.XVel *= -1; } //Check if the planet is going off the right side of the image if (planet.X > m_render_window.Width) { planet.X = m_render_window.Width - 5; planet.XVel *= -1; } //Check if the planet is going off the top of the image if (planet.Y < 0) { planet.Y = 0; planet.YVel *= -1; } //Check if the planet is going off the bottom of the image if (planet.Y > m_render_window.Height) { planet.Y = m_render_window.Height - 5; planet.YVel *= -1; } } //Adds the given type of celestial body to the simulation public void AddBody(int type, int x, int y) { switch (type) { case 0: m_planets.Add(new Planet(new System.Drawing.Point(x, y))); break; case 1: m_stars.Add(new Star(new System.Drawing.Point(x, y))); break; case 2: m_masses.Add(new ImmovableMass(new System.Drawing.Point(x, y))); break; default: break; } } //Set the time factor public void SetTimeFactor(double time) { //Set the factor m_time_scale = time; //Recalculate how many times per frame to run the calculations in Simulate() m_num_sub_sim = (int)(m_time_scale * .03 / m_sub_sim_time); } //Set the distance factor public void SetDistanceFactor(int factor) { m_meters_per_pixel = factor; } //Clears all of the bodies from the simulation public void ClearBodies() { m_planets.Clear(); m_stars.Clear(); m_masses.Clear(); } //Properties for the celestial objects public IList<Planet> Planets { get { return m_planets.AsReadOnly(); } } public IList<Star> Stars { get { return m_stars.AsReadOnly(); } } public IList<ImmovableMass> Masses { get { return m_masses.AsReadOnly(); } } } }
28.436482
83
0.646392
[ "MIT" ]
JohnAChoi/Planets
Physics.cs
8,732
C#
namespace BESL.Application.Tests.Games.Commands.Create { using System; using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; using CloudinaryDotNet; using Moq; using Microsoft.AspNetCore.Http; using Shouldly; using Xunit; using BESL.Application.Games.Commands.Create; using BESL.Application.Interfaces; using BESL.Application.Tests.Infrastructure; using BESL.Entities; using BESL.Application.Exceptions; public class CreateGameCommandTests : BaseTest<Game> { [Trait(nameof(Game), "CreateGame command tests.")] [Fact(DisplayName ="Handle given valid request should create valid entity.")] public async Task Handle_GivenValidRequest_ShouldCreateValidEntity() { // Arrange var cloudinaryHelperMock = new Mock<ICloudinaryHelper>(); var cloudinaryMock = new Mock<Cloudinary>(); var imagePlaceholderUrl = "https://steamcdn-a.akamaihd.net/steam/apps/440/header.jpg"; cloudinaryHelperMock .Setup(x => x.UploadImage(It.IsAny<IFormFile>(), It.IsAny<string>(), It.IsAny<Transformation>())) .ReturnsAsync(imagePlaceholderUrl); var sut = new CreateGameCommandHandler(this.deletableEntityRepository, cloudinaryHelperMock.Object, this.mediatorMock.Object); var command = new CreateGameCommand() { Name = "Team Fortress 2", Description = @"One of the most popular online action games of all time, Team Fortress 2 delivers constant free updates—new game modes, maps, equipment and, most importantly, hats. Nine distinct classes provide a broad range of tactical abilities and personalities, and lend themselves to a variety of player skills. New to TF ? Don’t sweat it! No matter what your style and experience, we’ve got a character for you.Detailed training and offline practice modes will help you hone your skills before jumping into one of TF2’s many game modes, including Capture the Flag, Control Point, Payload, Arena, King of the Hill and more. Make a character your own! There are hundreds of weapons, hats and more to collect, craft, buy and trade.Tweak your favorite class to suit your gameplay style and personal taste.You don’t need to pay to win—virtually all of the items in the Mann Co.Store can also be found in-game.", GameImage = new FormFile(It.IsAny<Stream>(), It.IsAny<long>(), It.IsAny<long>(), It.IsAny<string>(), It.IsAny<string>()) }; // Act await sut.Handle(command, CancellationToken.None); var game = this.dbContext.Games.SingleOrDefault(g => g.Name == command.Name); // Assert this.mediatorMock.Verify(x => x.Publish(It.IsAny<GameCreatedNotification>(), It.IsAny<CancellationToken>())); game.ShouldNotBeNull(); game.Name.ShouldBe(command.Name); game.GameImageUrl.ShouldBe(imagePlaceholderUrl); game.Description.ShouldBe(command.Description); } [Trait(nameof(Game), "CreateGame command tests.")] [Fact(DisplayName ="Handle given null request should throw ArgumentNullException.")] public async Task Handle_GivenNullRequest_ShouldThrowArgumentNullException() { // Arrange var sut = new CreateGameCommandHandler(It.IsAny<IDeletableEntityRepository<Game>>(), It.IsAny<ICloudinaryHelper>(), this.mediatorMock.Object); CreateGameCommand command = null; // Act & Assert await Should.ThrowAsync<ArgumentNullException>(sut.Handle(command, It.IsAny<CancellationToken>())); } [Trait(nameof(Game), "CreateGame command tests.")] [Fact(DisplayName = "Handle given invalid request should throw EntityAlreadyExistsException.")] public async Task Handle_GivenInvalidRequest_ShouldThrowEntityAlreadyExistsException() { // Arrange var sut = new CreateGameCommandHandler(this.deletableEntityRepository, It.IsAny<ICloudinaryHelper>(), this.mediatorMock.Object); CreateGameCommand command = new CreateGameCommand { Name = "SampleGame1" }; // Act & Assert await Should.ThrowAsync<EntityAlreadyExistsException>(sut.Handle(command, It.IsAny<CancellationToken>())); } } }
54.666667
928
0.682023
[ "MIT" ]
SonnyRR/BESL
BESL.Application.Tests/Games/Commands/Create/CreateGameCommandTests.cs
4,442
C#
// ------------------------------------------------------------------------------ // <copyright file="CodeCatchClauseCollection.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> // ------------------------------------------------------------------------------ // namespace System.CodeDom { using System; using System.Collections; using System.Runtime.InteropServices; /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection"]/*' /> /// <devdoc> /// <para> /// A collection that stores <see cref='System.CodeDom.CodeCatchClause'/> objects. /// </para> /// </devdoc> [ ClassInterface(ClassInterfaceType.AutoDispatch), ComVisible(true), Serializable, ] public class CodeCatchClauseCollection : CollectionBase { /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.CodeCatchClauseCollection"]/*' /> /// <devdoc> /// <para> /// Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/>. /// </para> /// </devdoc> public CodeCatchClauseCollection() { } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.CodeCatchClauseCollection1"]/*' /> /// <devdoc> /// <para> /// Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/> based on another <see cref='System.CodeDom.CodeCatchClauseCollection'/>. /// </para> /// </devdoc> public CodeCatchClauseCollection(CodeCatchClauseCollection value) { this.AddRange(value); } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.CodeCatchClauseCollection2"]/*' /> /// <devdoc> /// <para> /// Initializes a new instance of <see cref='System.CodeDom.CodeCatchClauseCollection'/> containing any array of <see cref='System.CodeDom.CodeCatchClause'/> objects. /// </para> /// </devdoc> public CodeCatchClauseCollection(CodeCatchClause[] value) { this.AddRange(value); } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.this"]/*' /> /// <devdoc> /// <para>Represents the entry at the specified index of the <see cref='System.CodeDom.CodeCatchClause'/>.</para> /// </devdoc> public CodeCatchClause this[int index] { get { return ((CodeCatchClause)(List[index])); } set { List[index] = value; } } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.Add"]/*' /> /// <devdoc> /// <para>Adds a <see cref='System.CodeDom.CodeCatchClause'/> with the specified value to the /// <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para> /// </devdoc> public int Add(CodeCatchClause value) { return List.Add(value); } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.AddRange"]/*' /> /// <devdoc> /// <para>Copies the elements of an array to the end of the <see cref='System.CodeDom.CodeCatchClauseCollection'/>.</para> /// </devdoc> public void AddRange(CodeCatchClause[] value) { if (value == null) { throw new ArgumentNullException("value"); } for (int i = 0; ((i) < (value.Length)); i = ((i) + (1))) { this.Add(value[i]); } } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.AddRange1"]/*' /> /// <devdoc> /// <para> /// Adds the contents of another <see cref='System.CodeDom.CodeCatchClauseCollection'/> to the end of the collection. /// </para> /// </devdoc> public void AddRange(CodeCatchClauseCollection value) { if (value == null) { throw new ArgumentNullException("value"); } int currentCount = value.Count; for (int i = 0; i < currentCount; i = ((i) + (1))) { this.Add(value[i]); } } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.Contains"]/*' /> /// <devdoc> /// <para>Gets a value indicating whether the /// <see cref='System.CodeDom.CodeCatchClauseCollection'/> contains the specified <see cref='System.CodeDom.CodeCatchClause'/>.</para> /// </devdoc> public bool Contains(CodeCatchClause value) { return List.Contains(value); } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.CopyTo"]/*' /> /// <devdoc> /// <para>Copies the <see cref='System.CodeDom.CodeCatchClauseCollection'/> values to a one-dimensional <see cref='System.Array'/> instance at the /// specified index.</para> /// </devdoc> public void CopyTo(CodeCatchClause[] array, int index) { List.CopyTo(array, index); } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.IndexOf"]/*' /> /// <devdoc> /// <para>Returns the index of a <see cref='System.CodeDom.CodeCatchClause'/> in /// the <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para> /// </devdoc> public int IndexOf(CodeCatchClause value) { return List.IndexOf(value); } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.Insert"]/*' /> /// <devdoc> /// <para>Inserts a <see cref='System.CodeDom.CodeCatchClause'/> into the <see cref='System.CodeDom.CodeCatchClauseCollection'/> at the specified index.</para> /// </devdoc> public void Insert(int index, CodeCatchClause value) { List.Insert(index, value); } /// <include file='doc\CodeCatchClauseCollection.uex' path='docs/doc[@for="CodeCatchClauseCollection.Remove"]/*' /> /// <devdoc> /// <para> Removes a specific <see cref='System.CodeDom.CodeCatchClause'/> from the /// <see cref='System.CodeDom.CodeCatchClauseCollection'/> .</para> /// </devdoc> public void Remove(CodeCatchClause value) { List.Remove(value); } } }
47.198675
181
0.558299
[ "Unlicense" ]
bestbat/Windows-Server
com/netfx/src/framework/compmod/system/codedom/codecatchclausecollection.cs
7,127
C#
/* MIT License Copyright (c) 2019 Digital Ruby, LLC - https://www.digitalruby.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Threading.Tasks; namespace DigitalRuby.IPBanCore { /// <summary> /// Main method helpers /// </summary> public static class IPBanMain { /// <summary> /// Start typed ipban service /// </summary> /// <typeparam name="T">Type of ipban service</typeparam> /// <param name="args">Args</param> /// <param name="started">Started callback</param> /// <returns>Task</returns> public static async Task MainService<T>(string[] args, Action started = null) where T : IPBanService { T service = IPBanService.CreateService<T>(); await MainService(args, async (_args) => { // kick off start in background thread, make sure service starts up in a timely manner await service.StartAsync(); started?.Invoke(); // wait for service to end await service.WaitAsync(Timeout.Infinite); }, () => { // stop the service, will cause any WaitAsync to exit service.Stop(); }); } /// <summary> /// Start generic ipban service with callbacks. The service implementation should have already been created before this method is called. /// </summary> /// <param name="args">Args</param> /// <param name="start">Start callback, start your implementation running here</param> /// <param name="stop">Stop callback, stop your implementation running here</param> /// <param name="requireAdministrator">Whether administrator access is required</param> /// <returns>Task</returns> public static async Task MainService(string[] args, Func<string[], Task> start, Action stop, bool requireAdministrator = true) { try { using IPBanServiceRunner runner = new IPBanServiceRunner(args, start, stop); await runner.RunAsync(requireAdministrator); } catch (Exception ex) { ExtensionMethods.FileWriteAllTextWithRetry(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "startup_fail.txt"), ex.ToString()); Logger.Fatal("Fatal error starting service", ex); } } } }
41.313953
157
0.653251
[ "MIT" ]
fran1987/IPBan
IPBanCore/IPBanMain.cs
3,555
C#
using NPOI.SS.UserModel; using NPOI.XSSF.UserModel; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; using Newtonsoft.Json; using NPOI.SS.Util; using NPOI.HSSF.Util; namespace SummitReports.Objects { [Flags] public enum CellBorder { None = 0, Bottom = 1, Top = 2, Left = 4, Right = 8, TopBottom = 2 + 1, LeftRight = 4 + 8, LeftBottom = 1 + 4, LeftTop = 2 + 4, RightBottom = 1 + 8, RightTop = 2 + 8, All = 1 + 2 + 4 + 8 } public enum FormatStyle { Default = 0, Date = 1, Number = 2, Decimal = 3, Currency = 4, Percent = 5 } public static class NpoiColor { public static XSSFColor BLACK { get { return new XSSFColor(System.Drawing.Color.Black); } } public static XSSFColor? WithIndex(this XSSFColor xSSFColor) { if (xSSFColor == null) return null; if (hexStringIndexColorCache.Count() == 0) CacheIndexColors(); if (hexStringIndexColorCache.ContainsKey("#" + ByteArrayToString(xSSFColor.RGB))) xSSFColor.Indexed = hexStringIndexColorCache["#" + ByteArrayToString(xSSFColor.RGB)].Index; return xSSFColor; } /// <summary> /// This will change the IColor that shoudld of of type XSSFColor, but also will attempt to find the index color and populate it. this is important because POI/NPOI cell styles require the index as opposed /// to and XSSFColor object. /// </summary> /// <param name="colorToConvert"></param> /// <returns></returns> public static XSSFColor? AsXSSFColor(this IColor colorToConvert) { if (colorToConvert == null) return null; return ((XSSFColor)colorToConvert).WithIndex(); } public static XSSFColor? AsXSSFColor(this IndexedColors indexedColor) { if (indexedColor == null) return null; return (new XSSFColor(indexedColor.RGB)).WithIndex(); } private static string ByteArrayToString(byte[] ba) { StringBuilder hex = new StringBuilder(ba.Length * 2); foreach (byte b in ba) hex.AppendFormat("{0:x2}", b); return hex.ToString(); } private static Dictionary<string, IndexedColors> hexStringIndexColorCache = new Dictionary<string, IndexedColors>(); private static void CacheIndexColors() { Type type = typeof(IndexedColors); // MyClass is static class with static properties foreach (var p in type.GetFields(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.NonPublic)) { var colors = (Dictionary<string, IndexedColors>)p.GetValue(null); foreach(var color in colors.Keys) { var indexColor = colors[color]; if (hexStringIndexColorCache.ContainsKey(indexColor.HexString)) { Console.WriteLine(indexColor.HexString); } else { hexStringIndexColorCache.Add(indexColor.HexString, indexColor); } } break; } } } public class CellFormats { public string Default = ""; public string Date = "mm/dd/yyyy"; public string Integer = "#,##0"; public string Decimal = "#,##0.00"; public string Currency = "$#,##0.00"; public string Percent = "#0.00%"; public string FormatStringFromStyle(FormatStyle formatStyle) { if (formatStyle == FormatStyle.Default) return this.Default; else if (formatStyle == FormatStyle.Date) return this.Date; else if (formatStyle == FormatStyle.Currency) return this.Currency; else if (formatStyle == FormatStyle.Number) return this.Integer; else if (formatStyle == FormatStyle.Decimal) return this.Decimal; else if (formatStyle == FormatStyle.Percent) return this.Percent; return ""; } } public class NpoiStyle<T, Y> { public FormatStyle FormatStyle { get; set; } = FormatStyle.Default; public CellBorder Border { get; set; } = CellBorder.None; public BorderStyle BorderStyle { get; set; } public virtual IColor BorderColor { get; set; } = null; public string CellFormat { get { return this.CellFormats.Default; } set { this.CellFormats.Default = value; } } public virtual Y SetFormatStyle(FormatStyle style) { throw new Exception("Must override this function!!!"); } public CellFormats CellFormats { get; set; } = new CellFormats(); public double? FontHeightInPoints { get; set; } = null; public string FontName { get; set; } = null; public virtual IColor FontColor { get; set; } = null; public bool? IsBold { get; set; } = null; public bool? IsItalic { get; set; } = null; public HorizontalAlignment? HorizontalAlignment { get; set; } = null; public VerticalAlignment? VerticalAlignment { get; set; } = null; public virtual IColor BackgroundColor { get; set; } = null; public virtual IColor FillForegroundColor { get; set; } = null; public FillPattern? FillPattern { get; set; } = null; public bool? WrapText { get; set; } = null; public NpoiStyle() { } protected virtual T Render(IWorkbook workbook, FormatStyle formatStyle) { throw new Exception("Must override this function!!!"); } private bool hasRendered = false; public T Render(ICell cell, FormatStyle formatStyle) { return Render(cell.Sheet.Workbook, formatStyle); } public T Render(ICell cell) { if (!this.hasRendered) { foreach (FormatStyle formatStyle in (FormatStyle[])Enum.GetValues(typeof(FormatStyle))) { Render(cell.Sheet.Workbook, formatStyle); } this.hasRendered = true; } return Render(cell.Sheet.Workbook, this.FormatStyle); } } public class XSSFNPoiStyle : NpoiStyle<XSSFCellStyle, XSSFNPoiStyle> { public override XSSFNPoiStyle SetFormatStyle(FormatStyle style) { this.FormatStyle = style; this.CellFormat = this.CellFormats.FormatStringFromStyle(style); return this; } public XSSFNPoiStyle SetFormatStyle(string customFormatString) { this.FormatStyle = FormatStyle.Default; this.CellFormat = customFormatString; return this; } private string GetSha256Hash(string input) { using (SHA256 hash = SHA256Managed.Create()) { return String.Concat(hash .ComputeHash(Encoding.UTF8.GetBytes(input)) .Select(item => item.ToString("x2"))); } // Convert the input string to a byte array and compute the hash. } public CellRangeAddress ApplyBorderToRange(ISheet worksheet, CellRangeAddress range) { var defaultCellStyle = worksheet.Workbook.GetCellStyleAt(0); if (this.Border != CellBorder.None) { if (this.Border.HasFlag(CellBorder.Top)) { RegionUtil.SetBorderTop((int)this.BorderStyle, range, worksheet, worksheet.Workbook); if (this.BorderColor == null) { RegionUtil.SetTopBorderColor(defaultCellStyle.TopBorderColor, range, worksheet, worksheet.Workbook); } else { throw new Exception("RegionUtil.SetTopBorderColor(this.BorderColor.Indexed, range, worksheet, worksheet.Workbook)"); //RegionUtil.SetTopBorderColor(this.BorderColor.Indexed, range, worksheet, worksheet.Workbook); } } if (this.Border.HasFlag(CellBorder.Bottom)) { RegionUtil.SetBorderBottom((int)this.BorderStyle, range, worksheet, worksheet.Workbook); if (this.BorderColor == null) { RegionUtil.SetBottomBorderColor(defaultCellStyle.BottomBorderColor, range, worksheet, worksheet.Workbook); } else { throw new Exception("RegionUtil.SetBottomBorderColor(this.BorderColor.Indexed, range, worksheet, worksheet.Workbook)"); //RegionUtil.SetBottomBorderColor(this.BorderColor.Indexed, range, worksheet, worksheet.Workbook); } } if (this.Border.HasFlag(CellBorder.Right)) { RegionUtil.SetBorderRight((int)this.BorderStyle, range, worksheet, worksheet.Workbook); if (this.BorderColor == null) { RegionUtil.SetRightBorderColor(defaultCellStyle.RightBorderColor, range, worksheet, worksheet.Workbook); } else { throw new Exception("RegionUtil.SetRightBorderColor(this.BorderColor.Indexed, range, worksheet, worksheet.Workbook)"); //RegionUtil.SetRightBorderColor(this.BorderColor.Indexed, range, worksheet, worksheet.Workbook); } } if (this.Border.HasFlag(CellBorder.Left)) { RegionUtil.SetBorderLeft((int)this.BorderStyle, range, worksheet, worksheet.Workbook); if (this.BorderColor == null) { RegionUtil.SetLeftBorderColor(defaultCellStyle.LeftBorderColor, range, worksheet, worksheet.Workbook); } else { throw new Exception("egionUtil.SetLeftBorderColor(this.BorderColor.Indexed, range, worksheet, worksheet.Workbook)"); //RegionUtil.SetLeftBorderColor(this.BorderColor.Indexed, range, worksheet, worksheet.Workbook); } } } return range; } protected override XSSFCellStyle Render(IWorkbook workbook, FormatStyle formatStyle) { //var saveCellFormat = this.CellFormat; //this.CellFormat = this.CellFormats.FormatStringFromStyle(formatStyle); string thisStyleCacheKey = GetSha256Hash(JsonConvert.SerializeObject(this)); //this.CellFormat = saveCellFormat; if (NPoiExtentions.StyleCache.ContainsKey(thisStyleCacheKey)) { return (XSSFCellStyle)NPoiExtentions.StyleCache[thisStyleCacheKey]; } XSSFCellStyle cellStyle = (XSSFCellStyle)workbook.CreateCellStyle(); var defaultCellStyle = workbook.GetCellStyleAt(0); if (this.Border != CellBorder.None) { if (this.Border.HasFlag(CellBorder.Top)) { cellStyle.BorderTop = this.BorderStyle; if (this.BorderColor==null) { cellStyle.TopBorderColor = defaultCellStyle.TopBorderColor; } else { cellStyle.SetTopBorderColor(this.BorderColor.AsXSSFColor()); cellStyle.SetBorderColor(NPOI.XSSF.UserModel.Extensions.BorderSide.TOP, this.BorderColor.AsXSSFColor()); } } if (this.Border.HasFlag(CellBorder.Bottom)) { cellStyle.BorderBottom = this.BorderStyle; if (this.BorderColor == null) { cellStyle.BottomBorderColor = defaultCellStyle.BottomBorderColor; } else { cellStyle.SetBottomBorderColor(this.BorderColor.AsXSSFColor()); cellStyle.SetBorderColor(NPOI.XSSF.UserModel.Extensions.BorderSide.BOTTOM, this.BorderColor.AsXSSFColor()); } } if (this.Border.HasFlag(CellBorder.Right)) { cellStyle.BorderRight = this.BorderStyle; if (this.BorderColor == null) { cellStyle.RightBorderColor = defaultCellStyle.RightBorderColor; } else { cellStyle.SetRightBorderColor(this.BorderColor.AsXSSFColor()); cellStyle.SetBorderColor(NPOI.XSSF.UserModel.Extensions.BorderSide.RIGHT, this.BorderColor.AsXSSFColor()); } } if (this.Border.HasFlag(CellBorder.Left)) { cellStyle.BorderLeft = this.BorderStyle; if (this.BorderColor == null) { cellStyle.LeftBorderColor = defaultCellStyle.LeftBorderColor; } else { cellStyle.SetLeftBorderColor(this.BorderColor.AsXSSFColor()); cellStyle.SetBorderColor(NPOI.XSSF.UserModel.Extensions.BorderSide.LEFT, this.BorderColor.AsXSSFColor()); } } } if ((this.FontHeightInPoints.HasValue) || (this.FontName != null) || (this.FontColor != null) || (this.IsBold.HasValue) || (this.IsItalic.HasValue)) { var defaultFont = workbook.GetFontAt(0); var font = workbook.CreateFont(); font.FontHeightInPoints = (this.FontHeightInPoints.HasValue) ? this.FontHeightInPoints.Value : defaultFont.FontHeightInPoints; font.FontName = (this.FontName!=null) ? this.FontName : defaultFont.FontName; // this.FontName; font.Color = (this.FontColor!=null) ? this.FontColor.AsXSSFColor().Indexed: defaultFont.Color; //this.FontColor.Indexed; font.IsBold = (this.IsBold.HasValue) ? this.IsBold.Value : defaultFont.IsBold; //this.IsBold; font.IsItalic = (this.IsItalic.HasValue) ? this.IsItalic.Value : defaultFont.IsItalic; //this.IsItalic; cellStyle.SetFont(font); } if (this.BackgroundColor != null) cellStyle.SetFillBackgroundColor(this.BackgroundColor.AsXSSFColor()); if (this.HorizontalAlignment != null) cellStyle.Alignment = this.HorizontalAlignment.Value; if (this.VerticalAlignment != null) cellStyle.VerticalAlignment = this.VerticalAlignment.Value; if (!string.IsNullOrEmpty(this.CellFormat)) cellStyle.DataFormat = workbook.CreateDataFormat().GetFormat(this.CellFormat); if (this.FillForegroundColor != null) cellStyle.SetFillForegroundColor(FillForegroundColor.AsXSSFColor()); if (this.FillPattern != null) cellStyle.FillPattern = this.FillPattern.Value; if (this.WrapText != null) cellStyle.WrapText = this.WrapText.Value; if (!NPoiExtentions.StyleCache.ContainsKey(thisStyleCacheKey)) NPoiExtentions.StyleCache.Remove(thisStyleCacheKey); NPoiExtentions.StyleCache.Add(thisStyleCacheKey, cellStyle); return cellStyle; } } }
44.534435
215
0.559879
[ "MIT" ]
ajoyce-sim/SummitReports
Src/SummitReports.Objects/Classes/NpoiStyles.cs
16,168
C#
// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.Extensions.ObjectPool; using Microsoft.Extensions.Options; using Microsoft.Extensions.Primitives; namespace Microsoft.AspNetCore.ResponseCaching { internal class ResponseCachingKeyProvider : IResponseCachingKeyProvider { // Use the record separator for delimiting components of the cache key to avoid possible collisions private static readonly char KeyDelimiter = '\x1e'; // Use the unit separator for delimiting subcomponents of the cache key to avoid possible collisions private static readonly char KeySubDelimiter = '\x1f'; private readonly ObjectPool<StringBuilder> _builderPool; private readonly ResponseCachingOptions _options; internal ResponseCachingKeyProvider( ObjectPoolProvider poolProvider, IOptions<ResponseCachingOptions> options ) { if (poolProvider == null) { throw new ArgumentNullException(nameof(poolProvider)); } if (options == null) { throw new ArgumentNullException(nameof(options)); } _builderPool = poolProvider.CreateStringBuilderPool(); _options = options.Value; } public IEnumerable<string> CreateLookupVaryByKeys(ResponseCachingContext context) { return new string[] { CreateStorageVaryByKey(context) }; } // GET<delimiter>SCHEME<delimiter>HOST:PORT/PATHBASE/PATH public string CreateBaseKey(ResponseCachingContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var request = context.HttpContext.Request; var builder = _builderPool.Get(); try { builder .AppendUpperInvariant(request.Method) .Append(KeyDelimiter) .AppendUpperInvariant(request.Scheme) .Append(KeyDelimiter) .AppendUpperInvariant(request.Host.Value); if (_options.UseCaseSensitivePaths) { builder.Append(request.PathBase.Value).Append(request.Path.Value); } else { builder .AppendUpperInvariant(request.PathBase.Value) .AppendUpperInvariant(request.Path.Value); } return builder.ToString(); } finally { _builderPool.Return(builder); } } // BaseKey<delimiter>H<delimiter>HeaderName=HeaderValue<delimiter>Q<delimiter>QueryName=QueryValue1<subdelimiter>QueryValue2 public string CreateStorageVaryByKey(ResponseCachingContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var varyByRules = context.CachedVaryByRules; if (varyByRules == null) { throw new InvalidOperationException( $"{nameof(CachedVaryByRules)} must not be null on the {nameof(ResponseCachingContext)}" ); } if ( StringValues.IsNullOrEmpty(varyByRules.Headers) && StringValues.IsNullOrEmpty(varyByRules.QueryKeys) ) { return varyByRules.VaryByKeyPrefix; } var request = context.HttpContext.Request; var builder = _builderPool.Get(); try { // Prepend with the Guid of the CachedVaryByRules builder.Append(varyByRules.VaryByKeyPrefix); // Vary by headers var headersCount = varyByRules?.Headers.Count ?? 0; if (headersCount > 0) { // Append a group separator for the header segment of the cache key builder.Append(KeyDelimiter).Append('H'); var requestHeaders = context.HttpContext.Request.Headers; for (var i = 0; i < headersCount; i++) { var header = varyByRules!.Headers[i]; var headerValues = requestHeaders[header]; builder.Append(KeyDelimiter).Append(header).Append('='); var headerValuesArray = headerValues.ToArray(); Array.Sort(headerValuesArray, StringComparer.Ordinal); for (var j = 0; j < headerValuesArray.Length; j++) { builder.Append(headerValuesArray[j]); } } } // Vary by query keys if (varyByRules?.QueryKeys.Count > 0) { // Append a group separator for the query key segment of the cache key builder.Append(KeyDelimiter).Append('Q'); if ( varyByRules.QueryKeys.Count == 1 && string.Equals(varyByRules.QueryKeys[0], "*", StringComparison.Ordinal) ) { // Vary by all available query keys var queryArray = context.HttpContext.Request.Query.ToArray(); // Query keys are aggregated case-insensitively whereas the query values are compared ordinally. Array.Sort(queryArray, QueryKeyComparer.OrdinalIgnoreCase); for (var i = 0; i < queryArray.Length; i++) { builder .Append(KeyDelimiter) .AppendUpperInvariant(queryArray[i].Key) .Append('='); var queryValueArray = queryArray[i].Value.ToArray(); Array.Sort(queryValueArray, StringComparer.Ordinal); for (var j = 0; j < queryValueArray.Length; j++) { if (j > 0) { builder.Append(KeySubDelimiter); } builder.Append(queryValueArray[j]); } } } else { for (var i = 0; i < varyByRules.QueryKeys.Count; i++) { var queryKey = varyByRules.QueryKeys[i]; var queryKeyValues = context.HttpContext.Request.Query[queryKey]; builder.Append(KeyDelimiter).Append(queryKey).Append('='); var queryValueArray = queryKeyValues.ToArray(); Array.Sort(queryValueArray, StringComparer.Ordinal); for (var j = 0; j < queryValueArray.Length; j++) { if (j > 0) { builder.Append(KeySubDelimiter); } builder.Append(queryValueArray[j]); } } } } return builder.ToString(); } finally { _builderPool.Return(builder); } } private class QueryKeyComparer : IComparer<KeyValuePair<string, StringValues>> { private readonly StringComparer _stringComparer; public static QueryKeyComparer OrdinalIgnoreCase { get; } = new QueryKeyComparer(StringComparer.OrdinalIgnoreCase); public QueryKeyComparer(StringComparer stringComparer) { _stringComparer = stringComparer; } public int Compare( KeyValuePair<string, StringValues> x, KeyValuePair<string, StringValues> y ) => _stringComparer.Compare(x.Key, y.Key); } } }
37.848485
132
0.498685
[ "Apache-2.0" ]
belav/aspnetcore
src/Middleware/ResponseCaching/src/ResponseCachingKeyProvider.cs
8,743
C#
// Copyright (c) Nate McMaster. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Certes; using LettuceEncrypt.Acme; using Microsoft.Extensions.Logging; namespace LettuceEncrypt.Internal { internal class AcmeClientFactory { private readonly ICertificateAuthorityConfiguration _certificateAuthority; private readonly ILogger<AcmeClient> _logger; public AcmeClientFactory( ICertificateAuthorityConfiguration certificateAuthority, ILogger<AcmeClient> logger) { _certificateAuthority = certificateAuthority; _logger = logger; } public AcmeClient Create(IKey acmeAccountKey) { var directoryUri = _certificateAuthority.AcmeDirectoryUri; return new AcmeClient(_logger, directoryUri, acmeAccountKey); } } }
29.677419
111
0.698913
[ "Apache-2.0" ]
ANDDEV-OSS/LettuceEncrypt
src/LettuceEncrypt/Internal/AcmeClientFactory.cs
920
C#
//////////////////////////////////////////////////////////////////////////////// //NUnit tests for "EF Core Provider for LCPI OLE DB" // IBProvider and Contributors. 07.12.2021. using System; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using Microsoft.EntityFrameworkCore; using NUnit.Framework; using xdb=lcpi.data.oledb; namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D1.Query.Funcs.NullableInt16.SET001.STD.Equals.Complete.Int64{ //////////////////////////////////////////////////////////////////////////////// using T_DATA1 =System.Nullable<System.Int16>; using T_DATA2 =System.Int64; using T_DATA1_U=System.Int16; using T_DATA2_U=System.Int64; //////////////////////////////////////////////////////////////////////////////// //class TestSet_001__fields__01__VV public static class TestSet_001__fields__01__VV { private const string c_NameOf__TABLE ="TEST_MODIFY_ROW2"; private const string c_NameOf__COL_DATA1 ="COL_SMALLINT"; private const string c_NameOf__COL_DATA2 ="COL2_BIGINT"; private sealed class MyContext:TestBaseDbContext { [Table(c_NameOf__TABLE)] public sealed class TEST_RECORD { [Key] [Column("TEST_ID")] public System.Int64? TEST_ID { get; set; } [Column(c_NameOf__COL_DATA1)] public T_DATA1 COL_DATA1 { get; set; } [Column(c_NameOf__COL_DATA2)] public T_DATA2 COL_DATA2 { get; set; } };//class TEST_RECORD //---------------------------------------------------------------------- public DbSet<TEST_RECORD> testTable { get; set; } //---------------------------------------------------------------------- public MyContext(xdb.OleDbTransaction tr) :base(tr) { }//MyContext };//class MyContext //----------------------------------------------------------------------- [Test] public static void Test_001() { using(var cn=LocalCnHelper.CreateCn()) { cn.Open(); using(var tr=cn.BeginTransaction()) { //insert new record in external transaction using(var db=new MyContext(tr)) { const T_DATA1_U c_value1=4; const T_DATA2_U c_value2=4; System.Int64? testID=Helper__InsertRow(db,c_value1,c_value2); var recs=db.testTable.Where(r => ((r.COL_DATA1) /*OP{*/ .Equals /*}OP*/ (r.COL_DATA2)) && r.TEST_ID==testID); int nRecs=0; foreach(var r in recs) { Assert.AreEqual (0, nRecs); ++nRecs; Assert.IsTrue (r.TEST_ID.HasValue); Assert.AreEqual (testID, r.TEST_ID.Value); Assert.AreEqual (c_value1, r.COL_DATA1); Assert.AreEqual (c_value2, r.COL_DATA2); }//foreach r db.CheckTextOfLastExecutedCommand (new TestSqlTemplate() .T("SELECT ").N("t","TEST_ID").T(", ").N("t",c_NameOf__COL_DATA1).T(", ").N("t",c_NameOf__COL_DATA2).EOL() .T("FROM ").N(c_NameOf__TABLE).T(" AS ").N("t").EOL() .T("WHERE (").N("t",c_NameOf__COL_DATA1).T(" = ").N("t",c_NameOf__COL_DATA2).T(") AND (").N("t","TEST_ID").T(" = ").P_ID("__testID_0").T(")")); Assert.AreEqual (1, nRecs); }//using db tr.Rollback(); }//using tr }//using cn }//Test_001 //Helper methods -------------------------------------------------------- private static System.Int64 Helper__InsertRow(MyContext db, T_DATA1 valueForColData1, T_DATA2 valueForColData2) { var newRecord=new MyContext.TEST_RECORD(); newRecord.COL_DATA1 =valueForColData1; newRecord.COL_DATA2 =valueForColData2; db.testTable.Add(newRecord); db.SaveChanges(); db.CheckTextOfLastExecutedCommand (new TestSqlTemplate() .T("INSERT INTO ").N(c_NameOf__TABLE).T(" (").N(c_NameOf__COL_DATA1).T(", ").N(c_NameOf__COL_DATA2).T(")").EOL() .T("VALUES (").P("p0").T(", ").P("p1").T(")").EOL() .T("RETURNING ").N("TEST_ID").EOL() .T("INTO ").P("p2").T(";")); Assert.IsTrue (newRecord.TEST_ID.HasValue); Console.WriteLine("TEST_ID: {0}",newRecord.TEST_ID.Value); return newRecord.TEST_ID.Value; }//Helper__InsertRow };//class TestSet_001__fields__01__VV //////////////////////////////////////////////////////////////////////////////// }//namespace EFCore_LcpiOleDb_Tests.General.Work.DBMS.Firebird.V03_0_0.D1.Query.Funcs.NullableInt16.SET001.STD.Equals.Complete.Int64
29.801325
151
0.564222
[ "MIT" ]
ibprovider/Lcpi.EFCore.LcpiOleDb
Tests/General/Source/Work/DBMS/Firebird/V03_0_0/D1/Query/Funcs/NullableInt16/SET001/STD/Equals/Complete/Int64/TestSet_001__fields__01__VV.cs
4,502
C#
/* * Generated code file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty */ using System; using System.Diagnostics; using System.Runtime.CompilerServices; // Image 50: SteamVR.dll - Assembly: SteamVR, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - Types 7133-7547 namespace Valve.VR { public class SteamVR_Skeleton_FingerIndexes // TypeDefIndex: 7215 { // Fields public const int thumb = 0; // Metadata: 0x003A53DC public const int index = 1; // Metadata: 0x003A53E0 public const int middle = 2; // Metadata: 0x003A53E4 public const int ring = 3; // Metadata: 0x003A53E8 public const int pinky = 4; // Metadata: 0x003A53EC public static SteamVR_Skeleton_FingerIndexEnum[] enumArray; // 0x00 // Constructors public SteamVR_Skeleton_FingerIndexes(); // 0x00000001802650F0-0x0000000180265100 static SteamVR_Skeleton_FingerIndexes(); // 0x0000000180C710F0-0x0000000180C711F0 } }
33.5
117
0.753731
[ "MIT" ]
TotalJTM/PrimitierModdingFramework
Dumps/PrimitierDumpV1.0.1/Valve/VR/SteamVR_Skeleton_FingerIndexes.cs
940
C#
using CourtTask.Interfaces; using CourtTask.Models.Citizens; using System; using System.Collections.Generic; using System.Text; namespace CourtTask.Models { public interface ILegalEntity : IPerson { string Position { get; } int YearsOfExperience { get; } int LawsuitsCount { get; set; } void AskQuestion(Citizen citizen, string question); void AddNotes(string note); } }
19.545455
59
0.67907
[ "MIT" ]
BorislavVladimirov/Microinvest-Academy
MicroinvestOOP/Abstraction/MicrointvestAbstraction/CourtTask/Models/LegalEntities/Interfaces/ILegalEntity.cs
432
C#
namespace SFA.DAS.Support.Shared.SearchIndexModel { public enum SearchCategory { None, User, Account, Apprentice } }
16.1
50
0.57764
[ "MIT" ]
SkillsFundingAgency/das-support-portal
src/SFA.DAS.Support.Shared/SearchIndexModel/SearchCategory.cs
163
C#
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Uhuru.WindowsIsolation.Cmd { class Program { static void Main(string[] args) { string invokedVerb = null; object invokedVerbInstance = null; var options = new Options(); if (!CommandLine.Parser.Default.ParseArguments(args, options, (verb, subOptions) => { // if parsing succeeds the verb name and correct instance // will be passed to onVerbCommand delegate (string,object) invokedVerb = verb; invokedVerbInstance = subOptions; })) { Environment.Exit(CommandLine.Parser.DefaultExitCodeFail); } if (invokedVerb == "list") { var listSubOptions = (ListSubOptions)invokedVerbInstance; if (listSubOptions.Orphaned) { Dictionary<CellType, CellInstanceInfo[]> instances = Prison.ListCellInstances(); foreach (CellType cellType in instances.Keys) { TableBuilder tb = new TableBuilder(); tb.AddRow(cellType.ToString(), "Info"); tb.AddRow(new string('-', cellType.ToString().Length), "----"); foreach (CellInstanceInfo cellInstance in instances[cellType]) { tb.AddRow(cellInstance.Name, cellInstance.Info); } Console.Write(tb.Output()); Console.WriteLine(); } } } else if (invokedVerb == "list-users") { var listUsersSubOptions = (ListUsersSubOptions)invokedVerbInstance; if (string.IsNullOrWhiteSpace(listUsersSubOptions.Filter)) { PrisonUser[] users = PrisonUser.ListUsers(); TableBuilder tb = new TableBuilder(); tb.AddRow("Full Username", "Prefix"); tb.AddRow("-------------", "------"); foreach (PrisonUser user in users) { tb.AddRow(user.Username, user.UsernamePrefix); } Console.Write(tb.Output()); Console.WriteLine(); } } } } }
34.289474
100
0.47736
[ "Apache-2.0", "MIT" ]
UhuruSoftware/vcap-dotnet
src/Uhuru.WindowsIsolation.Cmd/Program.cs
2,608
C#
//------------------------------------------------------------------------------ // <copyright file="CacheOutputQuery.cs" company="Microsoft"> // Copyright (c) Microsoft Corporation. All rights reserved. // </copyright> // <owner current="true" primary="true">[....]</owner> //------------------------------------------------------------------------------ namespace MS.Internal.Xml.XPath { using System; using System.Xml; using System.Xml.XPath; using System.Diagnostics; using System.Xml.Xsl; using System.Collections.Generic; internal abstract class CacheOutputQuery : Query { internal Query input; // int count; -- we reusing it here protected List<XPathNavigator> outputBuffer; public CacheOutputQuery(Query input) { this.input = input; this.outputBuffer = new List<XPathNavigator>(); this.count = 0; } protected CacheOutputQuery(CacheOutputQuery other) : base(other) { this.input = Clone(other.input); this.outputBuffer = new List<XPathNavigator>(other.outputBuffer); this.count = other.count; } public override void Reset() { this.count = 0; } public override void SetXsltContext(XsltContext context){ input.SetXsltContext(context); } public override object Evaluate(XPathNodeIterator context) { outputBuffer.Clear(); count = 0; return input.Evaluate(context);// This is trick. IDQuery needs this value. Otherwise we would return this. // All subclasses should and would anyway override thismethod and return this. } public override XPathNavigator Advance() { Debug.Assert(0 <= count && count <= outputBuffer.Count); if (count < outputBuffer.Count) { return outputBuffer[count++]; } return null; } public override XPathNavigator Current { get { Debug.Assert(0 <= count && count <= outputBuffer.Count); if (count == 0) { return null; } return outputBuffer[count - 1]; } } public override XPathResultType StaticType { get { return XPathResultType.NodeSet; } } public override int CurrentPosition { get { return count; } } public override int Count { get { return outputBuffer.Count; } } public override QueryProps Properties { get { return QueryProps.Merge | QueryProps.Cached | QueryProps.Position | QueryProps.Count; } } public override void PrintQuery(XmlWriter w) { w.WriteStartElement(this.GetType().Name); input.PrintQuery(w); w.WriteEndElement(); } } }
38.779221
143
0.534829
[ "Apache-2.0" ]
295007712/295007712.github.io
sourceCode/dotNet4.6/ndp/fx/src/Xml/System/Xml/XPath/Internal/CacheOutputQuery.cs
2,986
C#
 namespace DncZeus.Api.ViewModels.Rbac.DncIcon { /// <summary> /// /// </summary> public class IconImportViewModel { /// <summary> /// /// </summary> public string Icons { get; set; } } }
12.047619
45
0.478261
[ "MIT" ]
SkyGrass/ttxy
DncZeus.Api/ViewModels/Rbac/DncIcon/IconImportViewModel.cs
255
C#
using System; using Microsoft.Xna.Framework; namespace MonoCollisionFramework { public interface IWorld { Matrix World { get; } } }
13
32
0.565934
[ "MIT" ]
djmacgames/MonoCollisionFramework
MonoCollide/MonoCollisionFramework/IWorld.cs
184
C#
//----------------------------------------------------------------------------- // <copyright file="MockHttpRequestFactory.cs" company="Amazon.com"> // Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). // You may not use this file except in compliance with the License. // A copy of the License is located at // // http://aws.amazon.com/apache2.0 // // or in the "license" file accompanying this file. This file is distributed // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either // express or implied. See the License for the specific language governing // permissions and limitations under the License. // </copyright> //----------------------------------------------------------------------------- using System; using System.IO; using System.Net; using Amazon.Runtime; namespace Amazon.XRay.Recorder.UnitTests.Tools { /// <summary> /// Not thread safe, initialize once for each test. /// </summary> public class MockHttpRequestFactory : IHttpRequestFactory<Stream> { public Action GetResponseAction { get; set; } public Func<MockHttpRequest, HttpWebResponse> ResponseCreator { get; set; } public MockHttpRequest LastCreatedRequest { get; private set; } public IHttpRequest<Stream> CreateHttpRequest(Uri requestUri) { this.LastCreatedRequest = new MockHttpRequest(requestUri, this.GetResponseAction, this.ResponseCreator); return this.LastCreatedRequest; } public void Dispose() { } } }
36.434783
116
0.615155
[ "Apache-2.0" ]
FinanzaPro/aws-xray-sdk-dotnet
sdk/test/UnitTests/Tools/MockHttpRequestFactory.cs
1,678
C#
using AlonsoAdmin.Entities.System; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Text; namespace AlonsoAdmin.Services.System.Request { /// <summary> /// 添加实体类 要么继承 数据库实体类,要么属性尽量取名一致(除非迁就前端),避免automapper做对应映射处理 /// </summary> public class GroupAddRequest { /// <summary> /// 数据组编码 数据组编码 /// </summary> public string Code { get; set; } = string.Empty; /// <summary> /// 数据组标题 数据组标题 /// </summary> [Required(ErrorMessage = "标题不能为空!")] public string Title { get; set; } = string.Empty; /// <summary> /// 数据组描述 /// </summary> public string Description { get; set; } = string.Empty; /// <summary> /// 父级ID /// </summary> public string ParentId { get; set; } /// <summary> /// 是否默认展开 /// </summary> public bool? Opened { get; set; } /// <summary> /// 是否禁用 /// </summary> public bool IsDisabled { get; set; } = false; /// <summary> /// 数据归属组 /// </summary> public string GroupId { get; set; } = string.Empty; } public class GroupEditRequest : GroupAddRequest { public string Id { get; set; } public int? OrderIndex { get; set; } public int Revision { get; set; } } public class GroupFilterRequest { /// <summary> /// 查询关键字 /// </summary> public string Key { get; set; } = string.Empty; /// <summary> /// 是否包含禁用的数据 /// </summary> public bool WithDisable { get; set; } = false; } }
19.472973
61
0.618321
[ "MIT" ]
alonsoalon/TenantSite.Server
Src/AlonsoAdmin.Services/System/Request/GroupRequest.cs
1,653
C#
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. /****************************************************************************** * This file is auto-generated from a template file by the GenerateTests.csx * * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * * changes, please update the corresponding template and run according to the * * directions listed in the file. * ******************************************************************************/ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Intrinsics.Arm; namespace JIT.HardwareIntrinsics.Arm { public static partial class Program { private static void ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1() { var test = new ImmBinaryOpTest__ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1(); if (test.IsSupported) { // Validates basic functionality works, using Unsafe.Read test.RunBasicScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates basic functionality works, using Load test.RunBasicScenario_Load(); } // Validates calling via reflection works, using Unsafe.Read test.RunReflectionScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates calling via reflection works, using Load test.RunReflectionScenario_Load(); } // Validates passing a static member works test.RunClsVarScenario(); if (AdvSimd.IsSupported) { // Validates passing a static member works, using pinning and Load test.RunClsVarScenario_Load(); } // Validates passing a local works, using Unsafe.Read test.RunLclVarScenario_UnsafeRead(); if (AdvSimd.IsSupported) { // Validates passing a local works, using Load test.RunLclVarScenario_Load(); } // Validates passing the field of a local class works test.RunClassLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local class works, using pinning and Load test.RunClassLclFldScenario_Load(); } // Validates passing an instance member of a class works test.RunClassFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a class works, using pinning and Load test.RunClassFldScenario_Load(); } // Validates passing the field of a local struct works test.RunStructLclFldScenario(); if (AdvSimd.IsSupported) { // Validates passing the field of a local struct works, using pinning and Load test.RunStructLclFldScenario_Load(); } // Validates passing an instance member of a struct works test.RunStructFldScenario(); if (AdvSimd.IsSupported) { // Validates passing an instance member of a struct works, using pinning and Load test.RunStructFldScenario_Load(); } } else { // Validates we throw on unsupported hardware test.RunUnsupportedScenario(); } if (!test.Succeeded) { throw new Exception("One or more scenarios did not complete as expected."); } } } public sealed unsafe class ImmBinaryOpTest__ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1 { private struct DataTable { private byte[] inArray1; private byte[] inArray2; private byte[] outArray; private GCHandle inHandle1; private GCHandle inHandle2; private GCHandle outHandle; private ulong alignment; public DataTable(SByte[] inArray1, Int16[] inArray2, SByte[] outArray, int alignment) { int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<SByte>(); int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int16>(); int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<SByte>(); if ( (alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray ) { throw new ArgumentException("Invalid value of alignment"); } this.inArray1 = new byte[alignment * 2]; this.inArray2 = new byte[alignment * 2]; this.outArray = new byte[alignment * 2]; this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned); this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned); this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned); this.alignment = (ulong)alignment; Unsafe.CopyBlockUnaligned( ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<SByte, byte>(ref inArray1[0]), (uint)sizeOfinArray1 ); Unsafe.CopyBlockUnaligned( ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int16, byte>(ref inArray2[0]), (uint)sizeOfinArray2 ); } public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment); public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment); public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment); public void Dispose() { inHandle1.Free(); inHandle2.Free(); outHandle.Free(); } private static unsafe void* Align(byte* buffer, ulong expectedAlignment) { return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1)); } } private struct TestStruct { public Vector64<SByte> _fld1; public Vector128<Int16> _fld2; public static TestStruct Create() { var testStruct = new TestStruct(); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned( ref Unsafe.As<Vector64<SByte>, byte>(ref testStruct._fld1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>() ); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned( ref Unsafe.As<Vector128<Int16>, byte>(ref testStruct._fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>() ); return testStruct; } public void RunStructFldScenario( ImmBinaryOpTest__ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1 testClass ) { var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( _fld1, _fld2, 1 ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } public void RunStructFldScenario_Load( ImmBinaryOpTest__ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1 testClass ) { fixed (Vector64<SByte>* pFld1 = &_fld1) fixed (Vector128<Int16>* pFld2 = &_fld2) { var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( AdvSimd.LoadVector64((SByte*)(pFld1)), AdvSimd.LoadVector128((Int16*)(pFld2)), 1 ); Unsafe.Write(testClass._dataTable.outArrayPtr, result); testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr); } } } private static readonly int LargestVectorSize = 16; private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<SByte>>() / sizeof(SByte); private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int16>>() / sizeof(Int16); private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<SByte>>() / sizeof(SByte); private static readonly byte Imm = 1; private static SByte[] _data1 = new SByte[Op1ElementCount]; private static Int16[] _data2 = new Int16[Op2ElementCount]; private static Vector64<SByte> _clsVar1; private static Vector128<Int16> _clsVar2; private Vector64<SByte> _fld1; private Vector128<Int16> _fld2; private DataTable _dataTable; static ImmBinaryOpTest__ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1() { for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned( ref Unsafe.As<Vector64<SByte>, byte>(ref _clsVar1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>() ); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned( ref Unsafe.As<Vector128<Int16>, byte>(ref _clsVar2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>() ); } public ImmBinaryOpTest__ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1() { Succeeded = true; for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } Unsafe.CopyBlockUnaligned( ref Unsafe.As<Vector64<SByte>, byte>(ref _fld1), ref Unsafe.As<SByte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<SByte>>() ); for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } Unsafe.CopyBlockUnaligned( ref Unsafe.As<Vector128<Int16>, byte>(ref _fld2), ref Unsafe.As<Int16, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int16>>() ); for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSByte(); } for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt16(); } _dataTable = new DataTable( _data1, _data2, new SByte[RetElementCount], LargestVectorSize ); } public bool IsSupported => AdvSimd.IsSupported; public bool Succeeded { get; set; } public void RunBasicScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead)); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( Unsafe.Read<Vector64<SByte>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<Int16>>(_dataTable.inArray2Ptr), 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunBasicScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load)); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead)); var result = typeof(AdvSimd) .GetMethod( nameof(AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper), new Type[] { typeof(Vector64<SByte>), typeof(Vector128<Int16>), typeof(byte) } ) .Invoke( null, new object[] { Unsafe.Read<Vector64<SByte>>(_dataTable.inArray1Ptr), Unsafe.Read<Vector128<Int16>>(_dataTable.inArray2Ptr), (byte)1 } ); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<SByte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunReflectionScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load)); var result = typeof(AdvSimd) .GetMethod( nameof(AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper), new Type[] { typeof(Vector64<SByte>), typeof(Vector128<Int16>), typeof(byte) } ) .Invoke( null, new object[] { AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)), AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)), (byte)1 } ); Unsafe.Write(_dataTable.outArrayPtr, (Vector128<SByte>)(result)); ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr); } public void RunClsVarScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario)); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( _clsVar1, _clsVar2, 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } public void RunClsVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load)); fixed (Vector64<SByte>* pClsVar1 = &_clsVar1) fixed (Vector128<Int16>* pClsVar2 = &_clsVar2) { var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( AdvSimd.LoadVector64((SByte*)(pClsVar1)), AdvSimd.LoadVector128((Int16*)(pClsVar2)), 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr); } } public void RunLclVarScenario_UnsafeRead() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead)); var op1 = Unsafe.Read<Vector64<SByte>>(_dataTable.inArray1Ptr); var op2 = Unsafe.Read<Vector128<Int16>>(_dataTable.inArray2Ptr); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(op1, op2, 1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunLclVarScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load)); var op1 = AdvSimd.LoadVector64((SByte*)(_dataTable.inArray1Ptr)); var op2 = AdvSimd.LoadVector128((Int16*)(_dataTable.inArray2Ptr)); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(op1, op2, 1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(op1, op2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario)); var test = new ImmBinaryOpTest__ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1(); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( test._fld1, test._fld2, 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunClassLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load)); var test = new ImmBinaryOpTest__ShiftRightLogicalRoundedNarrowingSaturateUpper_Vector128_SByte_1(); fixed (Vector64<SByte>* pFld1 = &test._fld1) fixed (Vector128<Int16>* pFld2 = &test._fld2) { var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( AdvSimd.LoadVector64((SByte*)(pFld1)), AdvSimd.LoadVector128((Int16*)(pFld2)), 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } } public void RunClassFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario)); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper(_fld1, _fld2, 1); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } public void RunClassFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load)); fixed (Vector64<SByte>* pFld1 = &_fld1) fixed (Vector128<Int16>* pFld2 = &_fld2) { var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( AdvSimd.LoadVector64((SByte*)(pFld1)), AdvSimd.LoadVector128((Int16*)(pFld2)), 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr); } } public void RunStructLclFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario)); var test = TestStruct.Create(); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( test._fld1, test._fld2, 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructLclFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load)); var test = TestStruct.Create(); var result = AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper( AdvSimd.LoadVector64((SByte*)(&test._fld1)), AdvSimd.LoadVector128((Int16*)(&test._fld2)), 1 ); Unsafe.Write(_dataTable.outArrayPtr, result); ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr); } public void RunStructFldScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario)); var test = TestStruct.Create(); test.RunStructFldScenario(this); } public void RunStructFldScenario_Load() { TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load)); var test = TestStruct.Create(); test.RunStructFldScenario_Load(this); } public void RunUnsupportedScenario() { TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario)); bool succeeded = false; try { RunBasicScenario_UnsafeRead(); } catch (PlatformNotSupportedException) { succeeded = true; } if (!succeeded) { Succeeded = false; } } private void ValidateResult( Vector64<SByte> firstOp, Vector128<Int16> secondOp, void* result, [CallerMemberName] string method = "" ) { SByte[] inArray1 = new SByte[Op1ElementCount]; Int16[] inArray2 = new Int16[Op2ElementCount]; SByte[] outArray = new SByte[RetElementCount]; Unsafe.WriteUnaligned(ref Unsafe.As<SByte, byte>(ref inArray1[0]), firstOp); Unsafe.WriteUnaligned(ref Unsafe.As<Int16, byte>(ref inArray2[0]), secondOp); Unsafe.CopyBlockUnaligned( ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<SByte>>() ); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult( void* firstOp, void* secondOp, void* result, [CallerMemberName] string method = "" ) { SByte[] inArray1 = new SByte[Op1ElementCount]; Int16[] inArray2 = new Int16[Op2ElementCount]; SByte[] outArray = new SByte[RetElementCount]; Unsafe.CopyBlockUnaligned( ref Unsafe.As<SByte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(firstOp), (uint)Unsafe.SizeOf<Vector64<SByte>>() ); Unsafe.CopyBlockUnaligned( ref Unsafe.As<Int16, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(secondOp), (uint)Unsafe.SizeOf<Vector128<Int16>>() ); Unsafe.CopyBlockUnaligned( ref Unsafe.As<SByte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<SByte>>() ); ValidateResult(inArray1, inArray2, outArray, method); } private void ValidateResult( SByte[] firstOp, Int16[] secondOp, SByte[] result, [CallerMemberName] string method = "" ) { bool succeeded = true; for (var i = 0; i < RetElementCount; i++) { if ( Helpers.ShiftRightLogicalRoundedNarrowingSaturateUpper( firstOp, secondOp, Imm, i ) != result[i] ) { succeeded = false; break; } } if (!succeeded) { TestLibrary.TestFramework.LogInformation( $"{nameof(AdvSimd)}.{nameof(AdvSimd.ShiftRightLogicalRoundedNarrowingSaturateUpper)}<SByte>(Vector64<SByte>, Vector128<Int16>, 1): {method} failed:" ); TestLibrary.TestFramework.LogInformation( $" firstOp: ({string.Join(", ", firstOp)})" ); TestLibrary.TestFramework.LogInformation( $" secondOp: ({string.Join(", ", secondOp)})" ); TestLibrary.TestFramework.LogInformation( $" result: ({string.Join(", ", result)})" ); TestLibrary.TestFramework.LogInformation(string.Empty); Succeeded = false; } } } }
37.479076
168
0.542294
[ "MIT" ]
belav/runtime
src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/ShiftRightLogicalRoundedNarrowingSaturateUpper.Vector128.SByte.1.cs
25,973
C#
using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Windows.Data; namespace XC.MediaRat { /// <summary> /// Converts string to timecode /// </summary> public class StringTCConverter : IValueConverter { #region IValueConverter Members /// <summary> /// Modifies the source data before passing it to the target for display in the UI. /// </summary> /// <param name="value">The source data being passed to the target.</param> /// <param name="targetType">The <see cref="T:System.Type"/> of data expected by the target dependency property.</param> /// <param name="parameter">An optional parameter to be used in the converter logic.</param> /// <param name="culture">The culture of the conversion.</param> /// <returns> /// The value to be passed to the target dependency property. /// </returns> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { TimeSpan? ts = value as TimeSpan?; if (ts == null) return null; return string.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Value.Hours, ts.Value.Minutes, ts.Value.Seconds, ts.Value.Milliseconds); } /// <summary> /// Modifies the target data before passing it to the source object. This method is called only in <see cref="F:System.Windows.Data.BindingMode.TwoWay"/> bindings. /// </summary> /// <param name="value">The target data being passed to the source.</param> /// <param name="targetType">The <see cref="T:System.Type"/> of data expected by the source object.</param> /// <param name="parameter">An optional parameter to be used in the converter logic.</param> /// <param name="culture">The culture of the conversion.</param> /// <returns> /// The value to be passed to the source object. /// </returns> public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) return null; string[] parts = value.ToString().Split(':'); if (parts.Length > 3) throw new FormatException(string.Format("Wrong Time Code format. Expected HH:mm:ss.ff")); if (parts.Length == 0) return null; int pn = parts.Length - 1; double secs = double.Parse(parts[pn]); pn--; if (pn >= 0) { secs += double.Parse(parts[pn]) * 60; pn--; if (pn >= 0) { secs += double.Parse(parts[pn]) * 3600; } } return (TimeSpan?)TimeSpan.FromSeconds(secs); } #endregion } }
44.09375
172
0.594614
[ "MIT" ]
xcrover/MediaRat
MediaRat/Common/StringTCConverter.cs
2,824
C#
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. // Ported from um/strmif.h in the Windows SDK for Windows 10.0.20348.0 // Original source is Copyright © Microsoft. All rights reserved. namespace TerraFX.Interop { public enum TVAudioMode { AMTVAUDIO_MODE_MONO = 0x1, AMTVAUDIO_MODE_STEREO = 0x2, AMTVAUDIO_MODE_LANG_A = 0x10, AMTVAUDIO_MODE_LANG_B = 0x20, AMTVAUDIO_MODE_LANG_C = 0x40, AMTVAUDIO_PRESET_STEREO = 0x200, AMTVAUDIO_PRESET_LANG_A = 0x1000, AMTVAUDIO_PRESET_LANG_B = 0x2000, AMTVAUDIO_PRESET_LANG_C = 0x4000, } }
33.714286
145
0.704802
[ "MIT" ]
DaZombieKiller/terrafx.interop.windows
sources/Interop/Windows/um/strmif/TVAudioMode.cs
710
C#
//----------------------------------------------------------------------------- // Filename: RTPSession.cs // // Description: Represents an RTP session constituted of a single media stream. The session // does not control the sockets as they may be shared by multiple sessions. // // Author(s): // Aaron Clauson (aaron@sipsorcery.com) // // History: // 25 Aug 2019 Aaron Clauson Created, Montreux, Switzerland. // 12 Nov 2019 Aaron Clauson Added send event method. // // License: // BSD 3-Clause "New" or "Revised" License, see included LICENSE.md file. //----------------------------------------------------------------------------- using System; using System.Net; using System.Net.Sockets; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; using SIPSorcery.Sys; namespace SIPSorcery.Net { public delegate int ProtectRtpPacket(byte[] payload, int length); public class RTPSession { private const int RTP_MAX_PAYLOAD = 1400; private const int SRTP_AUTH_KEY_LENGTH = 10; public const int RTP_EVENT_DEFAULT_SAMPLE_PERIOD_MS = 50; // Default sample period for an RTP event as specified by RFC2833. private static ILogger logger = Log.Logger; /// <summary> /// The payload type for the RTP packet header. /// </summary> public int PayloadType { get; private set; } public uint Ssrc { get; private set; } public ushort SeqNum { get; private set; } public uint PacketsSent { get; private set; } public uint OctetsSent { get; private set; } /// <summary> /// Function pointer to an SRTP context that encrypts an RTP packet. /// </summary> public ProtectRtpPacket SrtpProtect { get; private set; } /// <summary> /// Function pointer to an SRTCP context that encrypts an RTCP packet. /// </summary> public ProtectRtpPacket SrtcpProtect { get; private set; } /// <summary> /// Creates a new RTP session. The synchronisation source and sequence number are initialised to /// pseudo random values. /// </summary> /// <param name="payloadType">The payload type for the media attached to the sync source.</param> /// <param name="srtpProtect">Optional secure DTLS context for encrypting RTP packets.</param> /// <param name="srtcpProtect">Optional secure DTLS context for encrypting RTCP packets.</param> public RTPSession(int payloadType, ProtectRtpPacket srtpProtect, ProtectRtpPacket srtcpProtect) { PayloadType = payloadType; SrtpProtect = srtpProtect; SrtcpProtect = srtcpProtect; Ssrc = Convert.ToUInt32(Crypto.GetRandomInt(0, Int32.MaxValue)); SeqNum = Convert.ToUInt16(Crypto.GetRandomInt(0, UInt16.MaxValue)); } /// <summary> /// Packages and sends a single audio frame over one or more RTP packets. /// </summary> public void SendAudioFrame(Socket srcRtpSocket, IPEndPoint dstRtpSocket, uint timestamp, byte[] buffer) { try { for (int index = 0; index * RTP_MAX_PAYLOAD < buffer.Length; index++) { SeqNum = (ushort)(SeqNum % UInt16.MaxValue); int offset = (index == 0) ? 0 : (index * RTP_MAX_PAYLOAD); int payloadLength = (offset + RTP_MAX_PAYLOAD < buffer.Length) ? RTP_MAX_PAYLOAD : buffer.Length - offset; int srtpProtectionLength = (SrtpProtect != null) ? SRTP_AUTH_KEY_LENGTH : 0; RTPPacket rtpPacket = new RTPPacket(payloadLength + srtpProtectionLength); rtpPacket.Header.SyncSource = Ssrc; rtpPacket.Header.SequenceNumber = SeqNum++; rtpPacket.Header.Timestamp = timestamp; rtpPacket.Header.MarkerBit = ((offset + payloadLength) >= buffer.Length) ? 1 : 0; // Set marker bit for the last packet in the frame. rtpPacket.Header.PayloadType = (int)PayloadType; Buffer.BlockCopy(buffer, offset, rtpPacket.Payload, 0, payloadLength); var rtpBuffer = rtpPacket.GetBytes(); int rtperr = SrtpProtect == null ? 0 : SrtpProtect(rtpBuffer, rtpBuffer.Length - srtpProtectionLength); if (rtperr != 0) { logger.LogError("SendAudioFrame SRTP packet protection failed, result " + rtperr + "."); } else { srcRtpSocket.SendTo(rtpBuffer, dstRtpSocket); } PacketsSent++; OctetsSent += (uint)payloadLength; } } catch (System.Net.Sockets.SocketException sockExcp) { logger.LogError("SocketException SendAudioFrame. " + sockExcp.Message); } } public void SendVp8Frame(Socket srcRtpSocket, IPEndPoint dstRtpSocket, uint timestamp, byte[] buffer) { try { for (int index = 0; index * RTP_MAX_PAYLOAD < buffer.Length; index++) { SeqNum = (ushort)(SeqNum % UInt16.MaxValue); int offset = (index == 0) ? 0 : (index * RTP_MAX_PAYLOAD); int payloadLength = (offset + RTP_MAX_PAYLOAD < buffer.Length) ? RTP_MAX_PAYLOAD : buffer.Length - offset; int srtpProtectionLength = (SrtpProtect != null) ? SRTP_AUTH_KEY_LENGTH : 0; byte[] vp8HeaderBytes = (index == 0) ? new byte[] { 0x10 } : new byte[] { 0x00 }; RTPPacket rtpPacket = new RTPPacket(payloadLength + vp8HeaderBytes.Length + srtpProtectionLength); rtpPacket.Header.SyncSource = Ssrc; rtpPacket.Header.SequenceNumber = SeqNum++; rtpPacket.Header.Timestamp = timestamp; rtpPacket.Header.MarkerBit = ((offset + payloadLength) >= buffer.Length) ? 1 : 0; // Set marker bit for the last packet in the frame. rtpPacket.Header.PayloadType = (int)PayloadType; Buffer.BlockCopy(vp8HeaderBytes, 0, rtpPacket.Payload, 0, vp8HeaderBytes.Length); Buffer.BlockCopy(buffer, offset, rtpPacket.Payload, vp8HeaderBytes.Length, payloadLength); var rtpBuffer = rtpPacket.GetBytes(); int rtperr = SrtpProtect == null ? 0 : SrtpProtect(rtpBuffer, rtpBuffer.Length - srtpProtectionLength); if (rtperr != 0) { logger.LogError("SendVp8Frame SRTP packet protection failed, result " + rtperr + "."); } else { srcRtpSocket.SendTo(rtpBuffer, dstRtpSocket); } PacketsSent++; OctetsSent += (uint)payloadLength; } } catch (System.Net.Sockets.SocketException sockExcp) { logger.LogError("SocketException SendVp8Frame. " + sockExcp.Message); } } public void SendRtcpSenderReport(Socket srcRtpSocket, IPEndPoint dstRtpSocket, uint timestamp) { try { var ntp = RTSPSession.DateTimeToNptTimestamp(DateTime.Now); var rtcpSRPacket = new RTCPPacket(Ssrc, ntp, timestamp, PacketsSent, OctetsSent); if (SrtcpProtect == null) { srcRtpSocket.SendTo(rtcpSRPacket.GetBytes(), dstRtpSocket); } else { var rtcpSRBytes = rtcpSRPacket.GetBytes(); byte[] sendBuffer = new byte[rtcpSRBytes.Length + SRTP_AUTH_KEY_LENGTH]; Buffer.BlockCopy(rtcpSRBytes, 0, sendBuffer, 0, rtcpSRBytes.Length); int rtperr = SrtcpProtect(sendBuffer, sendBuffer.Length - SRTP_AUTH_KEY_LENGTH); if (rtperr != 0) { logger.LogWarning("SRTP RTCP packet protection failed, result " + rtperr + "."); } else { srcRtpSocket.SendTo(sendBuffer, dstRtpSocket); } } } catch (Exception excp) { logger.LogWarning("Exception SendRtcpSenderReport. " + excp.Message); } } /// <summary> /// Sends an RTP event for a DTMF tone as per RFC2833. Sending the event requires multiple packets to be sent. /// This method will hold onto the socket until all the packets required for the event have been sent. The send /// can be cancelled using the cancellation token. /// </summary> /// <param name="srcRtpSocket">The local RTP socket to send the event from.</param> /// <param name="dstRtpSocket">The remote RTP socket to send the event to.</param> /// <param name="rtpEvent">The RTP event to send.</param> /// <param name="startTimestamp">The RTP timestamp at the start of the event.</param> /// <param name="samplePeriod">The sample period in milliseconds being used for the media stream that the event /// is being inserted into. Should be set to 50ms if main media stream is dynamic or sample period is unknown.</param> /// <param name="timestampStep">The RTP timestamp step corresponding to the sampling period. This can change depending /// on the codec being used. For example using PCMU with a sampling frequency of 8000Hz the timestamp step /// for a sample period of 50ms is 400 (8000 / (1000 / 50)). For a sample period of 20ms it's 160 (8000 / (1000 / 20)).</param> /// <param name="cts">Token source to allow the operation to be cancelled prematurely.</param> public async Task SendDtmfEvent(Socket srcRtpSocket, IPEndPoint dstRtpSocket, RTPEvent rtpEvent, uint startTimestamp, ushort samplePeriod, ushort timestampStep, CancellationTokenSource cts) { try { // If only the minimum number of packets are being sent then they are both the start and end of the event. rtpEvent.EndOfEvent = (rtpEvent.TotalDuration <= timestampStep); rtpEvent.Duration = timestampStep; // Send the start of event packets. for (int i = 0; i < RTPEvent.DUPLICATE_COUNT && !cts.IsCancellationRequested; i++) { byte[] buffer = rtpEvent.GetEventPayload(); int markerBit = (i == 0) ? 1 : 0; // Set marker bit for the first packet in the event. SendRtpPacket(srcRtpSocket, dstRtpSocket, buffer, startTimestamp, markerBit, rtpEvent.PayloadTypeID); SeqNum++; PacketsSent++; } await Task.Delay(samplePeriod, cts.Token); if (!rtpEvent.EndOfEvent) { // Send the progressive event packets while ((rtpEvent.Duration + timestampStep) < rtpEvent.TotalDuration && !cts.IsCancellationRequested) { rtpEvent.Duration += timestampStep; byte[] buffer = rtpEvent.GetEventPayload(); SendRtpPacket(srcRtpSocket, dstRtpSocket, buffer, startTimestamp, 0, rtpEvent.PayloadTypeID); PacketsSent++; SeqNum++; await Task.Delay(samplePeriod, cts.Token); } // Send the end of event packets. for (int j = 0; j < RTPEvent.DUPLICATE_COUNT && !cts.IsCancellationRequested; j++) { rtpEvent.EndOfEvent = true; rtpEvent.Duration = rtpEvent.TotalDuration; byte[] buffer = rtpEvent.GetEventPayload(); SendRtpPacket(srcRtpSocket, dstRtpSocket, buffer, startTimestamp, 0, rtpEvent.PayloadTypeID); SeqNum++; PacketsSent++; } } } catch (System.Net.Sockets.SocketException sockExcp) { logger.LogError("SocketException SendDtmfEvent. " + sockExcp.Message); } catch (System.Threading.Tasks.TaskCanceledException) { logger.LogWarning("SendDtmfEvent was cancelled by caller."); } } /// <summary> /// Does the actual sending of an RTP packet using the specified data nad header values. /// </summary> /// <param name="srcRtpSocket">Socket to send from.</param> /// <param name="dstRtpSocket">Destination to send to.</param> /// <param name="data">The RTP packet payload.</param> /// <param name="timestamp">The RTP header timestamp.</param> /// <param name="markerBit">The RTP header marker bit.</param> /// <param name="payloadType">The RTP header payload type.</param> private void SendRtpPacket(Socket srcRtpSocket, IPEndPoint dstRtpSocket, byte[] data, uint timestamp, int markerBit, int payloadType) { int srtpProtectionLength = (SrtpProtect != null) ? SRTP_AUTH_KEY_LENGTH : 0; RTPPacket rtpPacket = new RTPPacket(data.Length + srtpProtectionLength); rtpPacket.Header.SyncSource = Ssrc; rtpPacket.Header.SequenceNumber = SeqNum; rtpPacket.Header.Timestamp = timestamp; rtpPacket.Header.MarkerBit = markerBit; rtpPacket.Header.PayloadType = payloadType; Buffer.BlockCopy(data, 0, rtpPacket.Payload, 0, data.Length); var rtpBuffer = rtpPacket.GetBytes(); int rtperr = SrtpProtect == null ? 0 : SrtpProtect(rtpBuffer, rtpBuffer.Length - srtpProtectionLength); if (rtperr != 0) { logger.LogError("SendDtmfEvent SRTP packet protection failed, result " + rtperr + "."); } else { srcRtpSocket.SendTo(rtpBuffer, dstRtpSocket); } } } }
46.5919
154
0.550749
[ "BSD-3-Clause" ]
salihy/sipsorcery
src/net/RTP/RTPSession.cs
14,958
C#