private void Connectors_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Remove) { ItemsCollection.Clear(); } OnUpdateItemsCollection(); }
private void Connectors_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Remove) { ItemsCollection.Clear(); SelectedItem = null; OnRequestChangeBuiltInParamSelector(); } else { OnRequestChangeBuiltInParamSelector(); } }
public void ClearList() { ItemsCollection.Clear(); AnchoredPosition = initialContentPosition; if (horizontal) { layoutGroup.padding.right = 0; } else { layoutGroup.padding.top = 0; } poolManager.DespawnChildren(ItemPrefab, contentRect); firstItemIndex = 0; }
public void Select (TEntityAction action) { // DATA IN: // action.CollectionAction.ModelCollection // action.CollectionAction.ExtensionNodeCollection m_ComponentModelDrop.Clear (); if (action.NotNull ()) { ComponentModelCollection.Clear (); ItemsCollection.Clear (); foreach (var modelAction in action.CollectionAction.ModelCollection) { var componentModel = TComponentModel.Create (modelAction.Value); var componentModelItem = TComponentModelItem.Create (componentModel); componentModelItem.Select (action.CategoryType.Category); ComponentModelCollection.Add (componentModelItem); } // sort collection by Name var sortedList = ComponentModelCollection .OrderBy (p => p.Name) .ToList () ; ComponentModelCollection.Clear (); foreach (var item in sortedList) { ComponentModelCollection.Add (item); } foreach (var item in ComponentModelCollection) { item.PopulateNode (action); } } }
public void ClearCollection() { var xmlDoc = new XmlDocument(TestUtility.CreateDefaultNSM().NameTable); xmlDoc.LoadXml( $@"<rowItems xmlns=""http://schemas.openxmlformats.org/spreadsheetml/2006/main"" count=""3""> <i> <x v=""1""/> </i> <i r=""1""> <x v=""2""/> </i> <i r=""1""> <x v=""3""/> </i> </rowItems>" ); var node = xmlDoc.FirstChild; var itemsCollection = new ItemsCollection(TestUtility.CreateDefaultNSM(), node); itemsCollection.Clear(); Assert.AreEqual(0, itemsCollection.Count); Assert.AreEqual(0, node.ChildNodes.Count); }
private void RemoveObjects() { try { string loggedUser = Session["username"] as string; #if DEBUG if (loggedUser == "DEVELOPER") { return; } #endif UsuarioLogic usuariologic = new UsuarioLogic(); List <COCASJOL.DATAACCESS.privilegio> privs = usuariologic.GetPrivilegiosDeUsuario(loggedUser); XmlDocument doc = new XmlDocument(); doc.Load(Server.MapPath(System.Configuration.ConfigurationManager.AppSettings.Get("privilegesXML"))); XmlNodeList nodes = doc.SelectNodes("privilegios/privilege"); DesktopShortcuts listDS = this.MyDesktop.Shortcuts; DesktopModulesCollection listDM = this.MyDesktop.Modules; ItemsCollection <Component> listIC = this.MyDesktop.StartMenu.Items; if (privs.Count == 0) { listDS.Clear(); listDM.Clear(); listIC.Clear(); } else { foreach (XmlNode node in nodes) { XmlNode keyNode = node.SelectSingleNode("key"); XmlNode moduleNode = node.SelectSingleNode("module"); XmlNode shortcutNode = node.SelectSingleNode("shortcut"); XmlNode menuitemNode = node.SelectSingleNode("menuitem"); string key = keyNode.InnerText.Replace("\t", "").Replace("\r\n", "").Replace("\n", "").Trim(); string module = moduleNode.InnerText.Replace("\t", "").Replace("\r\n", "").Replace("\n", "").Trim(); string shortcut = shortcutNode.InnerText.Replace("\t", "").Replace("\r\n", "").Replace("\n", "").Trim(); string menuitem = menuitemNode.InnerText.Replace("\t", "").Replace("\r\n", "").Replace("\n", "").Trim(); var query = from p in privs.AsParallel() where p.PRIV_LLAVE == key select p; if (query.Count() == 0) { for (int x = 0; x < listDS.Count; x++) { DesktopShortcut ds = listDS.ElementAt(x); if (ds.ShortcutID == shortcut) { listDS.Remove(ds); } } for (int x = 0; x < listDM.Count; x++) { DesktopModule dm = listDM.ElementAt(x); if (dm.ModuleID == module) { listDM.Remove(dm); } } for (int x = 0; x < listIC.Count; x++) { Component item = listIC.ElementAt(x); if (item is Ext.Net.MenuItem) { Ext.Net.MenuItem menuItem = (Ext.Net.MenuItem)item; if (menuItem.Menu.Count > 0) { MenuCollection menu = menuItem.Menu; for (int y = 0; y < menu.Primary.Items.Count; y++) { Component itm = menu.Primary.Items.ElementAt(y); if (itm.ID == menuitem) { menu.Primary.Items.Remove(itm); } } } if (menuItem.Menu.Primary.Items.Count == 0) { listIC.Remove(menuItem); } } } } } } } catch (Exception ex) { log.Fatal("Error fatal al remover objetos sin acceso.", ex); throw; } }
/// <summary> /// Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1" />. /// </summary> void IList.Clear() { ItemsCollection.Clear(); }
/// <summary> /// Removes all items from the <see cref="T:System.Collections.Generic.ICollection`1" />. /// </summary> public void Clear() { ItemsCollection.Clear(); }