private void Sectionwindow_UpdateSectionEvent(object sender, MySection e) { var selectedItem = SectionInQueueDataGrid.SelectedItem as MySection; sectioninqueue.Remove(selectedItem); sectioninqueue.Add(e); UpdateBindings_MainWindow(); }
public static void Main() { MySection ms = (MySection)ConfigurationManager.GetSection("MySection"); foreach (MyElement e in ms.MyElements) { Console.WriteLine(e.Name); } }
static void AssertNotModified(MySection my, TestLabel label) { label.EnterScope("modified"); Assert.That(my, Is.Not.Null, label.Get()); Assert.That(my.IsModified, Is.False, label.Get()); Assert.That(my.List, Is.Not.Null, label.Get()); Assert.That(my.List.Collection.Count, Is.EqualTo(0), label.Get()); Assert.That(my.List.IsModified, Is.False, label.Get()); label.LeaveScope(); }
static void AssertNotModified(MySection my, TestLabel label) { label.EnterScope("modified"); Assert.NotNull(my); Assert.False(my.IsModified, label.Get()); Assert.NotNull(my.List); Assert.Equal(0, my.List.Collection.Count); Assert.False(my.List.IsModified, label.Get()); label.LeaveScope(); }
public void AddSection() { Run("AddSection", (config, label) => { Assert.That(config.Sections ["my"], Is.Null, label.Get()); var my = new MySection(); config.Sections.Add("my2", my); config.Save(ConfigurationSaveMode.Full); Assert.That(File.Exists(config.FilePath), Is.True, label.Get()); }); }
public ActionResult Index() { Dictionary <string, string> dict = new Dictionary <string, string>(); MySection section = (MySection)ConfigurationManager.GetSection("mySection"); foreach (EntryElement item in section.MyCollection) { dict.Add(item.Name, item.Value); } return(View("~/Views/Home/Ccs.cshtml", dict)); }
public static void Main() { try { MySection ms = (MySection)ConfigurationManager.GetSection("MySection"); foreach (MyElement e in ms.MyElements) { Console.WriteLine(e.Name); } } catch (ConfigurationException ex) { Console.WriteLine("Error."); } }
private void ArriveButton_Click(object sender, RoutedEventArgs e) { SectionInfoWindow sectionwindow_add = new SectionInfoWindow(); MySection qsection1 = new MySection(); //this.IsEnabled = false; sectionwindow_add.UpdateButton.IsEnabled = false; sectionwindow_add.UpdateButton.Visibility = Visibility.Hidden; //WPF sectionwindow_add.arrivaltimeTB.Text = DateTime.Now.ToString(); //data qsection1.ArrivalTime = DateTime.Now; sectionwindow_add.currentsection = qsection1; sectionwindow_add.AddSectionEvent += Sectionwindow_AddSectionEvent;//subscribe event sectionwindow_add.ShowDialog(); }
public ActionResult Single() { MySection section = (MySection)ConfigurationManager.GetSection("mySection"); return(View("~/Views/Home/DisplaySingle.cshtml", (object)section.MyCollection[section.MyCollection.Default].Value)); }
public void AddSection() { MySection qsection1 = new MySection { JobNumber = "41586003-001", SectionNumber = "2", JobName = "Texas Instruments Lewisville", Location = "C1", ArrivalTime = new DateTime(2018, 11, 07, 1, 1, 32, DateTimeKind.Local), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "No", CheckSheetResult = "Fail", Impact = "Low", Q3Issue = "Missing kit cart", SolutionUpdates = "breaker rework ETA 2hrs" } }; MySection qsection2 = new MySection { JobNumber = "40838431-001", SectionNumber = "1", JobName = "ETHICON", Location = "A1", ArrivalTime = new DateTime(2018, 11, 07, 2, 30, 52), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "No", CheckSheetResult = "Fail", Impact = "Low", Q3Issue = "Missing kit cart", SolutionUpdates = "team lead to sign off" } }; MySection qsection3 = new MySection { JobNumber = "40009165-001", SectionNumber = "4", JobName = "BASF SUB C", Location = "C3", ArrivalTime = new DateTime(2018, 11, 07, 4, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection4 = new MySection { JobNumber = "41385019-003", SectionNumber = "1", JobName = "Warner Bros Tour Center", Location = "B2", ArrivalTime = new DateTime(2018, 11, 07, 5, 30, 52), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection5 = new MySection { JobNumber = "41385019-003", SectionNumber = "2", JobName = "Warner Bros Tour Center", Location = "A2", ArrivalTime = new DateTime(2018, 11, 07, 6, 30, 52), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "No", CheckSheetResult = "Fail", Impact = "High", Q3Issue = "Missing kit cart", SolutionUpdates = "parts shortage 10pm" } }; MySection qsection6 = new MySection { JobNumber = "41385019-003", SectionNumber = "3", JobName = "Warner Bros Tour Center", Location = "B2", ArrivalTime = new DateTime(2018, 11, 06, 6, 20, 52), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "No", CheckSheetResult = "Fail", Impact = "High", Q3Issue = "Missing kit cart", SolutionUpdates = "parts shortage 10pm" } }; MySection qsection7 = new MySection { JobNumber = "41385019-003", SectionNumber = "4", JobName = "Warner Bros Tour Center", Location = "E2", ArrivalTime = new DateTime(2018, 11, 06, 6, 30, 52), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "No", CheckSheetResult = "Fail", Impact = "High", Q3Issue = "Missing kit cart", SolutionUpdates = "parts shortage 10pm" } }; MySection qsection8 = new MySection { JobNumber = "40337205-015", SectionNumber = "1", JobName = "HCA SUNRISE HOSPITAL", Location = "D1", ArrivalTime = new DateTime(2018, 11, 06, 7, 30, 52), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "No", CheckSheetResult = "Fail", Impact = "High", Q3Issue = "Missing kit cart", SolutionUpdates = "parts shortage 10pm" } }; MySection qsection9 = new MySection { JobNumber = "40337205-015", SectionNumber = "2", JobName = "HCA SUNRISE HOSPITAL", Location = "D2", ArrivalTime = new DateTime(2018, 11, 06, 8, 30, 52), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "No", CheckSheetResult = "Fail", Impact = "High", Q3Issue = "Missing kit cart", SolutionUpdates = "parts shortage 10pm" } }; //MySection qsection10 = new MySection //{ // JobNumber = "41385019-003", // SectionNumber = "2", // JobName = "Warner Bros Tour Center", // Location = "B2", // ArrivalTime = new DateTime(2018, 11, 06, 9, 30, 52), // CCSheet = new CheckSheet // { // Question1Result = "Yes", // Question2Result = "Yes", // Question3Result = "No", // CheckSheetResult = "Fail", // Impact = "High", // Q3Issue = "Missing kit cart", // SolutionUpdates = "parts shortage 10pm" // } //}; //MySection qsection11 = new MySection //{ // JobNumber = "41385019-003", // SectionNumber = "2", // JobName = "Warner Bros Tour Center", // Location = "B2", // ArrivalTime = new DateTime(2018, 11, 06, 12, 30, 52), // CCSheet = new CheckSheet // { // Question1Result = "Yes", // Question2Result = "Yes", // Question3Result = "No", // CheckSheetResult = "Fail", // Impact = "Low", // Q3Issue = "Changes requrie re-work", // SolutionUpdates = "missing cover" // } //}; //MySection qsection12 = new MySection //{ // JobNumber = "41385019-003", // SectionNumber = "2", // JobName = "Warner Bros Tour Center", // Location = "B2", // ArrivalTime = new DateTime(2018, 11, 05, 12, 30, 52), // CCSheet = new CheckSheet // { // Question1Result = "Yes", // Question2Result = "Yes", // Question3Result = "No", // CheckSheetResult = "Fail", // Impact = "High", // Q3Issue = "Missing kit cart", // SolutionUpdates = "parts shortage 10pm" // } //}; MySection qsection13 = new MySection { JobNumber = "41496242-033", SectionNumber = "1", JobName = "FS17007 - First Solar", Location = "E1", ArrivalTime = new DateTime(2018, 11, 05, 15, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection14 = new MySection { JobNumber = "41496242-033", SectionNumber = "2", JobName = "FS17007 - First Solar", Location = "E2", ArrivalTime = new DateTime(2018, 11, 05, 16, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection15 = new MySection { JobNumber = "41496242-033", SectionNumber = "3", JobName = "FS17007 - First Solar", Location = "E3", ArrivalTime = new DateTime(2018, 11, 04, 12, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection16 = new MySection { JobNumber = "41397014-001", SectionNumber = "4", JobName = "ATT Plaza Generator Re-Feed", Location = "B1", ArrivalTime = new DateTime(2018, 11, 04, 3, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection17 = new MySection { JobNumber = "41397014-001", SectionNumber = "2", JobName = "ATT Plaza Generator Re-Feed", Location = "B2", ArrivalTime = new DateTime(2018, 11, 02, 12, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection18 = new MySection { JobNumber = "41407062-001", SectionNumber = "3", JobName = "SLC-40 Hangar Upgrades", Location = "C5", ArrivalTime = new DateTime(2018, 11, 06, 14, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection19 = new MySection { JobNumber = "41407062-001", SectionNumber = "1", JobName = "SLC-40 Hangar Upgrades", Location = "C4", ArrivalTime = new DateTime(2018, 11, 05, 17, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; MySection qsection20 = new MySection { JobNumber = "39874222-001", SectionNumber = "2", JobName = "UK Parking Structure #2", Location = "A5", ArrivalTime = new DateTime(2018, 11, 01, 12, 30, 56), CCSheet = new CheckSheet { Question1Result = "Yes", Question2Result = "Yes", Question3Result = "Yes", CheckSheetResult = "Pass", Impact = "Low", SolutionUpdates = "Good" } }; sections.Add(qsection1); sections.Add(qsection2); sections.Add(qsection3); sections.Add(qsection4); sections.Add(qsection5); sections.Add(qsection6); sections.Add(qsection7); sections.Add(qsection8); sections.Add(qsection9); //sections.Add(qsection10); //sections.Add(qsection11); //sections.Add(qsection12); sections.Add(qsection13); sections.Add(qsection14); sections.Add(qsection15); sections.Add(qsection16); sections.Add(qsection17); sections.Add(qsection18); sections.Add(qsection19); sections.Add(qsection20); }
//event action private void Sectionwindow_AddSectionEvent(object sender, MySection e) { sectioninqueue.Add(e); this.IsEnabled = true; UpdateBindings_MainWindow(); }
static void ValidateSection(Assembly asmInfo, MySection section) { var unintendedSettings = section.MyElements.OfType<MyElement>().Where(_ => _.Target.Module.Assembly != asmInfo).ToArray(); if (0 < unintendedSettings.Length) throw new InvalidOperationException( string.Format("Now the indirection settings for \"{0}\" is being analysed, but the settings for \"{1}\" was detected.", asmInfo.FullName, unintendedSettings[0].Target.Module.Assembly.FullName)); }