public IDataValidationErrors Add(DataValidationError value) { value.VerifyNotNull(nameof(value)); if (!IsSealed) { _list.Add(value); return(this); } if (Count == 0) { return(value); } else { var result = new ListGroup(); for (int i = 0; i < Count; i++) { result.Add(this[i]); } result.Add(value); return(result); } }
public async Task <IActionResult> Edit(int id, [Bind("listGroupID,listGroupName,userID")] ListGroup listGroup) { if (id != listGroup.listGroupID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(listGroup); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ListGroupExists(listGroup.listGroupID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(listGroup)); }
private void Form1_Load(object sender, EventArgs e) { // Create a GroupedListControl instance: GroupListControl glc = this.groupListControl1; glc.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); // Add some sample columns: for (int i = 1; i <= 5; i++) { ListGroup lg = new ListGroup(); lg.Columns.Add("List Group " + i.ToString(), 120); lg.Columns.Add("Group " + i + " SubItem 1", 150); lg.Columns.Add("Group " + i + " Subitem 2", 150); lg.Name = "Group " + i; // Now add some sample items: for (int j = 1; j <= 5; j++) { ListViewItem item = lg.Items.Add("Item " + j.ToString()); item.SubItems.Add(item.Text + " SubItem 1"); item.SubItems.Add(item.Text + " SubItem 2"); } // Add handling for the columnRightClick Event: lg.ColumnRightClick += new ListGroup.ColumnRightClickHandler(lg_ColumnRightClick); lg.MouseClick += new MouseEventHandler(lg_MouseClick); glc.Controls.Add(lg); } }
public RadListDataGroupItem(ListGroup group) : base(group.Header) { this.group = group; this.Collapsed = group.Collapsed; this.Collapsible = group.Collapsible; }
private ListGroup getListGroup(patientLocationMapping PLM) { ListGroup lg; if (!(glc.Controls).ContainsKey(PLM.ID)) { lg = new ListGroup(); lg.Name = PLM.ID; lg.Columns.Add(PLM.ID); lg.Columns[lg.Columns.Count - 1].Width = 170; // Add handling for the columnRightClick Event: lg.MouseClick += new MouseEventHandler(lg_MouseClick); glc.Controls.Add(lg); return(lg); } else { return((ListGroup)glc.Controls[PLM.ID]); //((ListGroup)glc.Controls[key]).Columns[1].Text = "Results(" + ++patientList[key].messageCount + ")"; //((ListGroup)glc.Controls[key]).Columns[2].Text = "Latest Received: (" + receiveTimeString + ")"; //if (patientList[key].messageCount % 2 == 0) // rowColor = Color.SkyBlue; //else // rowColor = Color.White; } }
public void ListGroupConstInitList() { var someClass = new dataClass(); var list = new ListGroup <String, dataClass> (new List <dataClass> { someClass }); Assert.Contains(someClass, list); }
public void ListGroupConstInitListAndKey() { var someClass = new dataClass(); var list = new ListGroup <String, dataClass>("MyKey", new List <dataClass> { someClass }); Assert.AreEqual("MyKey", list.Key); }
public async Task <IActionResult> Create([Bind("listGroupID,listGroupName,userID")] ListGroup listGroup) { if (ModelState.IsValid) { _context.Add(listGroup); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(listGroup)); }
// GET: ListGroups/Create public IActionResult Create() { User loggedInUser = JsonConvert.DeserializeObject <User>(HttpContext.Session.GetString("loggedInUser")); userID = loggedInUser.userID; ListGroup newListGroup = new ListGroup(); newListGroup.listGroupName = ""; newListGroup.listGroupID = 0; newListGroup.userID = userID; return(View("Create", newListGroup)); }
// GET: ListGroups/Create public IActionResult Create() { TempData["UserID"] = 1; userID = Convert.ToInt16(@TempData["UserID"]); TempData["UserID"] = userID; ListGroup newListGroup = new ListGroup(); newListGroup.listGroupName = ""; newListGroup.listGroupID = 0; newListGroup.userID = userID; return(View("Create", newListGroup)); }
public void RenderListEmptyInnerlist() { var qdc = new XmlConverter(new JArray()); qdc._document = new XmlDocument(); var emptyList = new ListGroup(new ListItem[] { new ListItem(new BlockGroup(DeltaInsertOp.CreateNewLineOp(), new DeltaInsertOp[] { })) }); var node = qdc.RenderList(new ListGroup(new ListItem[] { new ListItem(new BlockGroup(new DeltaInsertOp("thing"), new DeltaInsertOp[] { }), emptyList) })); node.OuterXml.Should().Be("<p />"); }
private async void name_groups_ItemTapped(object sender, ItemTappedEventArgs e) { ((ListView)sender).SelectedItem = null; ListGroup listGroupev = e.Item as ListGroup; if (listGroupev != null) { foreach (MyGroup mg in Groups.groups) { if (mg.group == listGroupev.Group_name) { MyGroup mg1 = mg; await Navigation.PushModalAsync(new ItemDetailPage(this, mg1)); } } } }
void lg_ColumnRightClick(object sender, ColumnClickEventArgs e) { ListGroup lg = (ListGroup)sender; // Tuck the Active ListGroup into the Tag property: _ListGroupContextMenu.Tag = lg; // If the header is right-clicked, the user has not indicated an item to edit or delete. // Disable those options: _editOption.Enabled = false; _deleteOption.Enabled = false; // Because we are not using the GroupedList's own ContextMenuStrip, // we need to use the PointToClient method so that the menu appears // in the correct position relative to the control: _ListGroupContextMenu.Show(lg, lg.PointToClient(MousePosition)); }
private void comboBoxpodmacierz_SelectedIndexChanged(object sender, EventArgs e) { if (glc != null && glc.Controls != null) { while (glc.Controls.Count > 0) { glc.Controls.RemoveAt(0); } glc.Visible = false; for (int i = 0; i < one.Count; i += 4) { if (Convert.ToInt32(one[i]) == Convert.ToInt32(this.comboBoxpodmacierz.Text)) { ListGroup lg = new ListGroup(); lg.Columns.Add(one[i], 120); lg.Columns.Add(one[i + 2], 150); lg.Columns.Add(one[i + 3], 150); lg.Columns.Add("Liczba falowa", 150); lg.Columns.Add("Długość fali", 150); lg.Columns.Add("Przejście", 150); lg.Name = "Group " + i; List <string> wynik = oblicz(this.comboBoxpodmacierz.Text, one[i], two); for (int j = 0; j < wynik.Count; j += 6) { ListViewItem item = lg.Items.Add(wynik[j]); item.SubItems.Add(wynik[j + 1]); item.SubItems.Add(wynik[j + 2]); item.SubItems.Add(wynik[j + 3]); item.SubItems.Add(wynik[j + 4]); item.SubItems.Add(wynik[j + 5]); } lg.ColumnRightClick += new ListGroup.ColumnRightClickHandler(lg_ColumnRightClick); lg.MouseClick += new MouseEventHandler(lg_MouseClick); glc.Controls.Add(lg); } } glc.Visible = true; comboBoxpodmacierz.Enabled = false; comboBoxpodmacierz.Enabled = true; } }
private object GetDeveloperChart() { var listGroup = new ListGroup("Sales by Developer") { XBinSize = 1, }; listGroup.AddDimensions(Tab.Database.ReleaseViews, nameof(ReleaseView.Developer), nameof(ReleaseView.YearOfRelease), nameof(ReleaseView.Global_Sales)); var chartSettings = new ChartSettings(listGroup); var model = new TabModel() { MinDesiredWidth = 1000, }; model.AddObject(chartSettings); return(model); }
void lg_MouseClick(object sender, MouseEventArgs e) { ListGroup lg = (ListGroup)sender; ListViewHitTestInfo info = lg.HitTest(e.X, e.Y); ListViewItem item = info.Item; if (e.Button == MouseButtons.Right) { // Tuck the Active ListGroup into the Tag property: _ListGroupContextMenu.Tag = lg; // Make sure the Delete and Edit options are enabled: _editOption.Enabled = true; _deleteOption.Enabled = true; // Because we are not using the GroupedList's own ContextMenuStrip, // we need to use the PointToClient method so that the menu appears // in the correct position relative to the control: _ListGroupContextMenu.Show(lg, lg.PointToClient(MousePosition)); } }
void lg_GroupExpanded(object sender, EventArgs e) { // Grab a reference to the ListGroup which sent the message: ListGroup expanded = (ListGroup)sender; //ListViewHitTestInfo info = expanded.HitTest(e.X, e.Y); // ListViewItem itemTemp = info.Item; // If Single item only expansion, collapse all ListGroups in except // the one currently exanding: if (this.SingleItemOnlyExpansion) { this.SuspendLayout(); foreach (ListGroup lgTemp in this.Controls) { if (!lgTemp.Equals(expanded)) { lgTemp.Collapse(); } } this.ResumeLayout(true); } }
/// <summary> /// For clearing user information from controls /// </summary> public void ClearUserInfo() { try { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); UserID = null; UserName = null; Password = null; Email = null; IsActive = null; FirstName = null; LastName = null; LastLogin = null; Phone = null; ListCustomer = ListCustomer.Select(x => new UserCustomerList { CustomerName = x.CustomerName, CustomerID = x.CustomerID, IsSelected = false }).ToList(); ListModule = ListModule.Select(x => new ModuleList { ModuleID = x.ModuleID, ModuleName = x.ModuleName, IsSelected = false, ModuleCode = x.ModuleCode }).ToList(); ListRole = ListRole.Select(x => new RoleList { RoleID = x.RoleID, RoleName = x.RoleName, Description = x.Description, IsSelected = false }).ToList(); ListGroup = ListGroup.Select(x => new GroupList { GroupID = x.GroupID, GroupName = x.GroupName, Description = x.Description, IsSelected = false }).ToList(); } catch (Exception ex) { CommonSettings.logger.LogError(this.GetType(), ex); } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); } }
void lg_MouseClick(object sender, MouseEventArgs e) { ListGroup lg = (ListGroup)sender; ListViewHitTestInfo info = lg.HitTest(e.X, e.Y); ListViewItem item = info.Item; }
private static ListGroup <MyBusinessObject> GetObjectListGroup(MyBusinessObject businessObj) { var group = new ListGroup <MyBusinessObject>(businessObj.NetworkName); return(group); }
private void button1_Click(object sender, EventArgs e) { System.IO.StreamReader sr = new System.IO.StreamReader(this._File1Stream); List <string> temp = new List <string>(); while (!sr.EndOfStream) { temp.Add(sr.ReadLine()); } one = dane(temp.ToArray <string>()); _MatrixCount = Convert.ToInt32(one[(one.Count - 4)]); for (int i = 1; i <= _MatrixCount; i++) { this.comboBoxpodmacierz.Items.Add(i); this.comboBoxpodmacierz.SelectedItem = 1; } sr.Close(); sr = new System.IO.StreamReader(_File2Stream); temp = new List <string>(); while (!sr.EndOfStream) { temp.Add(sr.ReadLine()); } two = dane(temp.ToArray <string>()); sr.Close(); glc = this.groupListControl1; glc.Visible = false; glc.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); if (glc != null && glc.Controls != null) { while (glc.Controls.Count > 0) { glc.Controls.RemoveAt(0); } } // Add some sample columns: for (int i = 0; i < one.Count; i += 4) { if (Convert.ToInt32(one[i]) == Convert.ToInt32(this.comboBoxpodmacierz.Text)) { ListGroup lg = new ListGroup(); lg.Columns.Add(one[i], 120); lg.Columns.Add(one[i + 2], 150); lg.Columns.Add(one[i + 3], 150); lg.Columns.Add("Liczba falowa", 150); lg.Columns.Add("Długość fali", 150); lg.Columns.Add("Przejście", 150); lg.Name = "Group " + i; List <string> wynik = oblicz(this.comboBoxpodmacierz.Text, one[i + 2], two); for (int j = 0; j < wynik.Count; j += 6) { ListViewItem item = lg.Items.Add(wynik[j]); item.SubItems.Add(wynik[j + 1]); item.SubItems.Add(wynik[j + 2]); item.SubItems.Add(wynik[j + 3]); item.SubItems.Add(wynik[j + 4]); item.SubItems.Add(wynik[j + 5]); } // Add handling for the columnRightClick Event: lg.ColumnRightClick += new ListGroup.ColumnRightClickHandler(lg_ColumnRightClick); //lg.GroupCollapsed += new ListGroup.GroupExpansionHandler(lg_GroupCollapsed); lg.GroupExpanded += new ListGroup.GroupExpansionHandler(lg_GroupExpanded); lg.MouseClick += new MouseEventHandler(lg_MouseClick); glc.Controls.Add(lg); } } glc.Visible = true; this.labelPodmacierz.Visible = true; this.comboBoxpodmacierz.Visible = true; this.chkSingleItemOnlyMode.Visible = true; }
private CommandLine(ListGroup <SingleOptimizedStrings> optionArgs, ResourceManager?resourceManager) { _optionArgs = optionArgs ?? throw new ArgumentNullException(nameof(optionArgs)); ResourceManager = resourceManager; }
public void ListGroupEmptyConst() { var list = new ListGroup<String,dataClass> (); Assert.IsNotNull (list); }
public void ListGroupConstInitList() { var someClass = new dataClass (); var list = new ListGroup<String,dataClass> (new List<dataClass>{someClass}); Assert.Contains(someClass,list); }
public void ListGroupConstInitListAndKey() { var someClass = new dataClass (); var list = new ListGroup<String,dataClass>("MyKey",new List<dataClass>{someClass}); Assert.AreEqual ("MyKey",list.Key ); }
/// <summary> /// Function to Save/Update a particular user. /// </summary> /// <param name="obj"></param> /// <returns>NA</returns> /// <createdBy></createdBy> /// <createdOn>May-27,2016</createdOn> public void Save_Click(object obj) { try { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgStart, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); WebPortalUserList objUserProp = new WebPortalUserList(); if (UserID != null && UserID > 0) { objUserProp.userID = (int)UserID; } objUserProp.username = UserName; objUserProp.password = Password; objUserProp.firstname = FirstName; objUserProp.lastname = LastName; objUserProp.email = Email; objUserProp.phone = Phone; objUserProp.isActive = IsActive; objUserProp.isSuperUser = 0; objUserProp.lastLogin = DateTime.Now; if (IsAction == Resources.ActionSave) { objUserProp.whoCreated = Application.Current.Properties["LoggedInUserName"].ToString(); objUserProp.dateCreated = DateTime.Now; } else if (IsAction == Resources.ActionUpdate) { objUserProp.whoModified = Application.Current.Properties["LoggedInUserName"].ToString(); objUserProp.dateModified = DateTime.Now; } if (!string.IsNullOrEmpty(UserName)) { if (!string.IsNullOrEmpty(Password)) { if (!string.IsNullOrEmpty(Email)) { ValidateEmail emailValidation = new ValidateEmail(); bool isValid = emailValidation.IsValidEmail(Email); if (isValid) { bool checkDuplicateUserName = _serviceInstance.CheckDuplicateEmail(Email); bool checkDuplicateEmailID = _serviceInstance.CheckDuplicatePortalUserName(UserName); bool isSuccessfull = false; if (IsAction == Resources.ActionSave) { if (!checkDuplicateUserName) { if (!checkDuplicateEmailID) { isSuccessfull = _serviceInstance.InsertUpdateUser(objUserProp, ListCustomer.ToArray(), ListModule.ToArray(), ListRole.ToArray(), ListGroup.ToArray()); } else { MessageBox.Show(Resources.MsgDuplicateUserName); } } else { MessageBox.Show(Resources.MsgDuplicateEmailID); } } else if (IsAction == Resources.ActionUpdate) { isSuccessfull = _serviceInstance.InsertUpdateUser(objUserProp, ListCustomer.ToArray(), ListModule.ToArray(), ListRole.ToArray(), ListGroup.ToArray()); } if (isSuccessfull) { if (IsAction == Resources.ActionUpdate) { MessageBox.Show(Resources.msgUpdatedSuccessfully); } else if (IsAction == Resources.ActionSave) { MessageBox.Show(Resources.msgInsertedSuccessfully); } ClearUserInfo(); CurrentView = new WebPortalUsersView(); IsVisibleInfo = Resources.MsgHidden; IsModify = true; IsButtonPanel = Resources.MsgHidden; IsAction = Resources.ActionSave; LoadUsers(null); View_Click(null); AcceptChanges(); } } else { MessageBox.Show(Resources.ErrorEmail); } } else { MessageBox.Show(Resources.ReqEmail); } } else { MessageBox.Show(Resources.ReqPassword); } } else { MessageBox.Show(Resources.ReqrUserName); } } catch (Exception ex) { CommonSettings.logger.LogError(this.GetType(), ex); } finally { CommonSettings.logger.LogInfo(typeof(string), string.Format(CultureInfo.InvariantCulture, Resources.loggerMsgEnd, DateTime.Now.ToShortDateString(), DateTime.Now.ToShortTimeString(), MethodBase.GetCurrentMethod().Name)); } }
private static ListGroup<MyBusinessObject> GetObjectListGroup(MyBusinessObject businessObj) { var group = new ListGroup<MyBusinessObject>(businessObj.NetworkName); return (group); }
private void process(string rawString) { Patient pat = new Patient("blank"); Location loc; patientLocationMapping PLM = new patientLocationMapping(); ListGroup lg = new ListGroup(); string MSHTimeString = ""; DateTime MSHTime; string ParmTimeString = ""; DateTime ParmTime; int parmIndex; string receiveTimeString = DateTime.Now.ToString("h:m:s t"); string[] segments = rawString.Replace("" + (char)11, "").Split(new string[] { "\r" }, StringSplitOptions.None); Console.WriteLine(segments.Count() + " Segments:"); foreach (string segment in segments) { string[] fields = segment.Split(new string[] { "|" }, StringSplitOptions.None); switch (fields[0]) { case "MSH": try { MSHTimeString = fields[6]; MSHTime = DateTime.ParseExact(MSHTimeString, "yyyyMMddHHmmss", CultureInfo.CurrentCulture); MSHTimeString = MSHTime.ToString("h:m:s t"); } catch (Exception ex) { Console.WriteLine("Error parsing msg time: " + ex.Message); MSHTimeString = "no_time"; } break; case "PID": pat = getPatientFromPIDFields(fields); break; case "PV1": loc = getLocationFromPV1Fields(fields); PLM = getPatientLocationMapping(pat, loc); lg = getListGroup(PLM); // Add column for the result lg.Columns.Add(receiveTimeString + " (" + MSHTimeString + ")"); lg.Columns[lg.Columns.Count - 1].Width = 135; break; case "OBX": ListViewItem parmValueItem; // ListViewItem parmTimeItem; string[] parameter_subfields = fields[3].Split(new string[] { "^" }, StringSplitOptions.None); string parameter_name = parameter_subfields[0]; parameter_subfields = fields[6].Split(new string[] { "^" }, StringSplitOptions.None); string parameter_uom = parameter_subfields[0]; string ParameterID = parameter_name + " in " + parameter_uom; if (!PLM.parameters.ContainsKey(ParameterID)) { PLM.parameters.Add(ParameterID, new Parameter(PLM.parameters.Count(), ParameterID, 1)); Console.WriteLine("New Parameter = " + ParameterID); parmIndex = PLM.parameters.Count() - 1; // itemIndex = parmIndex * 2; parmValueItem = lg.Items.Insert(parmIndex, ParameterID); // parmTimeItem = lg.Items.Insert(parmIndex + 1, new ListViewItem("Timestamps")); } else { Console.WriteLine("Existing Parameter = " + ParameterID); parmIndex = PLM.parameters[ParameterID].index; // itemIndex = parmIndex * 2; parmValueItem = lg.Items[parmIndex]; // parmTimeItem = lg.Items[itemIndex + 1]; } string parameter_value = fields[5]; try { ParmTimeString = fields[14]; ParmTime = DateTime.ParseExact(ParmTimeString, "yyyyMMddHHmmss", CultureInfo.CurrentCulture); ParmTimeString = ParmTime.ToString("h:m:s t"); } catch (Exception ex) { Console.WriteLine("Error parsing parameter time: " + ex.Message); ParmTimeString = "no_time"; } parmValueItem.SubItems.Add(parameter_value + "\t(" + ParmTimeString + ")"); // parmTimeItem.SubItems.Add(parameter_time); break; default: break; } } }
/// <summary> /// Read in all settings from XML file and build selection lists /// </summary> private void ReadSettings() { int indx = 0; string Regel = null; string NX_Install = null; ListApp.Items.Clear(); ListGroup.Items.Clear(); try { using (StreamReader FStream = new StreamReader(Path.GetDirectoryName(Application.ExecutablePath) + "\\" + XML_File)) { while (FStream.Peek() >= 0) { Regel = FStream.ReadLine(); if (!(Regel.IndexOf("<NX_AppName>") == -1)) //NX application, add to list, if installed { NX_AppName = Regel.Replace("<NX_AppName>", "").Replace("</NX_AppName>", "").Trim(); NX_Install = _defaultinstallationfolder + NX_AppName; NX_App = NX_AppName.Replace(".", "").Replace(" ", "").Replace("NX", "").Trim(); if (Directory.Exists(NX_Install)) { ListApp.Items.Add(NX_AppName); NX_availible = true; indx = ListApp.Items.Count - 1; if (_defver == NX_App) { ListAppSelected = indx + 1; } } } if (!(Regel.IndexOf("<GroupName>") == -1)) //NX customer group { NX_GroupName = Regel.Replace("<GroupName>", "").Replace("</GroupName>", "").Trim(); ListGroup.Items.Add(NX_GroupName); indx = ListGroup.Items.Count - 1; if (_defgroup == NX_GroupName) { ListGroupSelected = indx + 1; } } if (!(Regel.IndexOf("<TC_ver>") == -1)) //Teamcenter version { Lbl_TC_versie.Text = Regel.Replace("<TC_ver>", "").Replace("</TC_ver>", "").Trim(); } if (!(Regel.IndexOf("<TC_server>") == -1)) //Teamcenter server { TC_Server = Regel.Replace("<TC_server>", "").Replace("</TC_server>", "").Trim(); LBL_TC_Server.Text = TC_Server.Replace("\\", ""); } if (!(Regel.IndexOf("<TC_Env>") == -1)) //Teamcenter Environment string { TC_Env = Regel.Replace("<TC_Env>", "").Replace("</TC_Env>", "").Trim(); } if (!(Regel.IndexOf("<TC_bat>") == -1)) //Teamcenter startup batch-file { TC_BatFile = Regel.Replace("<TC_bat>", "").Replace("</TC_bat>", "").Trim(); } if (!(Regel.IndexOf("<TC_portal>") == -1)) //Startup argument for batch-file { TC_para_portal = Regel.Replace("<TC_portal>", "").Replace("</TC_portal>", "").Trim(); } if (!(Regel.IndexOf("<TC_NXman>") == -1)) //Startup argument for batch-file { TC_para_manager = Regel.Replace("<TC_NXman>", "").Replace("</TC_NXman>", "").Trim(); } if (!(Regel.IndexOf("<TC_FixedNX>") == -1)) //Startup argument for batch-file { if (Regel.Replace("<TC_FixedNX>", "").Replace("</TC_FixedNX>", "").Trim() == "yes") { TC_FIXED_NX = true; } } if (!(Regel.IndexOf("<TC_FixedNXver>") == -1)) //Startup argument for batch-file { TC_FIXED_NXVer = Regel.Replace("<TC_FixedNXver>", "").Replace("</TC_FixedNXver>", "").Trim(); if (TC_FIXED_NXVer.Length == 2) { TC_FIXED_NXVer = TC_FIXED_NXVer + "0"; } } } } } catch (Exception e) { MessageBox.Show(e.Message, "File not Found", MessageBoxButtons.OK, MessageBoxIcon.Error); Afsluiten(); } if (!(ListAppSelected == 0)) //If a default version -last saved- was found, highlight it { ListApp.SetSelected(ListAppSelected - 1, true); } if (!(ListGroupSelected == 0)) //If a default group -last saved- was found, highlight it { ListGroup.SetSelected(ListGroupSelected - 1, true); } Check_NX(); }
private void ShowDictionary(ListGroup group, Dictionary<int, ListItem> add, Dictionary<int, RecordSet> append, int linePoint) { var pointer = 0; //if (linePoint > 15) pointer = linePoint - 15; for (var i = pointer; i < linePoint; i++) { ListItem item; RecordSet record; if (add.TryGetValue(i, out item)) group.Add(item); else if(append.TryGetValue(i, out record)) group.Append(record); } }
public void NestsIfListsAreSameAndLaterOnesHaveHigherIndent() { var ops = new DeltaInsertOp[] { new DeltaInsertOp("item 1"), new DeltaInsertOp("\n", new OpAttributes { List = ListType.Ordered }), new DeltaInsertOp("item 1a"), new DeltaInsertOp("\n", new OpAttributes { List = ListType.Ordered, Indent = 1 }), new DeltaInsertOp("item 1a-i"), new DeltaInsertOp("\n", new OpAttributes { List = ListType.Ordered, Indent = 3 }), new DeltaInsertOp("item 1b"), new DeltaInsertOp("\n", new OpAttributes { List = ListType.Ordered, Indent = 1 }), new DeltaInsertOp("item 2"), new DeltaInsertOp("\n", new OpAttributes { List = ListType.Ordered }), new DeltaInsertOp("haha"), new DeltaInsertOp("\n"), new DeltaInsertOp("\n", new OpAttributes { List = ListType.Ordered, Indent = 5 }), new DeltaInsertOp("\n", new OpAttributes { List = ListType.Bullet, Indent = 4 }), }; var pairs = Grouper.PairOpsWithTheirBlock(ops); var act = ListNester.Nest(pairs); //console.log(JSON.stringify( act, null, 4)); var l1b = new ListItem((BlockGroup)pairs[3]); var lai = new ListGroup(new ListItem[] { new ListItem((BlockGroup)pairs[2]) }); var l1a = new ListGroup(new ListItem[] { new ListItem((BlockGroup)pairs[1], lai) }); var li1 = new ListGroup(new ListItem[] { new ListItem((BlockGroup)pairs[0]) }); li1.Items[0].InnerList = new ListGroup( l1a.Items.Concat(Enumerable.Repeat(l1b, 1)).ToArray()); var li2 = new ListGroup(new ListItem[] { new ListItem((BlockGroup)pairs[4]) }); //console.log(JSON.stringify(act, null, 3)); act.Should().BeEquivalentTo(new Group[] { new ListGroup(li1.Items.Concat(li2.Items).ToArray()), new InlineGroup(new DeltaInsertOp[] { ops[10], ops[11] }), new ListGroup(new ListItem[] { new ListItem(new BlockGroup(ops[12], new DeltaInsertOp [] { })) }), new ListGroup(new ListItem[] { new ListItem(new BlockGroup(ops[13], new DeltaInsertOp [] { })) }) }, opts => opts.RespectingRuntimeTypes() .WithStrictOrdering() .AllowingInfiniteRecursion()); }
public void ListGroupEmptyConst() { var list = new ListGroup <String, dataClass> (); Assert.IsNotNull(list); }