/// <summary> /// Returns a writable copy of the current attributes. /// </summary> public TsCAeAttributeDictionary GetAttributes() { LicenseHandler.ValidateFeatures(LicenseHandler.ProductFeature.AlarmsConditions); TsCAeAttributeDictionary attributes = new TsCAeAttributeDictionary(); IDictionaryEnumerator enumerator = attributes_.GetEnumerator(); while (enumerator.MoveNext()) { if (enumerator.Key != null) { var categoryId = (int)enumerator.Key; AttributeCollection attributeIDs = (AttributeCollection)enumerator.Value; attributes.Add(categoryId, attributeIDs.ToArray()); } } return(attributes); }
/// <summary> /// Adds selected attributes to the dictionary. /// </summary> private void GetSelectedAttributes(TreeNode parent, Technosoftware.DaAeHdaClient.Ae.TsCAeCategory category, Technosoftware.DaAeHdaClient.Ae.TsCAeAttributeDictionary attributes) { foreach (TreeNode child in parent.Nodes) { if (!typeof(Technosoftware.DaAeHdaClient.Ae.TsCAeAttribute).IsInstanceOfType(child.Tag)) { continue; } if (child.Checked) { Technosoftware.DaAeHdaClient.Ae.TsCAeAttributeCollection collection = attributes[category.ID]; if (collection == null) { attributes.Add(category.ID, null); collection = attributes[category.ID]; } collection.Add(((Technosoftware.DaAeHdaClient.Ae.TsCAeAttribute)child.Tag).ID); } } }