public void LoadTreeViewAttributes(TreeNode fileNode) { UMLFile file = (UMLFile)fileNode.Tag; bool checkFile = false; file.LoadCollections(); UMLAttributeCollection attributes = file.Attributes; foreach (UMLAttribute fileAttribute in attributes) { TreeNode node = new TreeNode(); node.Text = fileAttribute.Name; node.Tag = fileAttribute; foreach (UMLAttribute collaborationAttribute in Collaboration.Dets) { if (collaborationAttribute.Guid == fileAttribute.Guid) { node.Checked = true; checkFile = true; break; } } fileNode.Nodes.Add(node); } fileNode.Checked = checkFile; }
private static UMLAttributeCollection GetProperties(Type type) { UMLAttributeCollection attributes = new UMLAttributeCollection(); foreach (PropertyInfo property in type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)) { if (property.DeclaringType == type && !property.IsSpecialName) { MethodInfo methodInfo = property.GetGetMethod(true); if (methodInfo != null) { UMLAttribute attribute = new UMLAttribute(); attribute.Name = property.Name; attribute.Type = property.PropertyType.Name; if (methodInfo.IsPublic) { attribute.Visibility = Visibility.Public; } if (methodInfo.IsPrivate) { attribute.Visibility = Visibility.Private; } if (methodInfo.IsFamily) { attribute.Visibility = Visibility.Protected; } attributes.Add(attribute); } } } return(attributes); }
/// <summary> /// Loads all collections /// </summary> public void LoadCollections() { if (Owner == null) { Owner = Helper.GetOwner <UMLUseCase>(this); } _dets = getDets(); _files = getFiles(); _steps = getSteps(); }
private static UMLAttributeCollection GetStaticAndConstants(Type type) { UMLAttributeCollection attributes = new UMLAttributeCollection(); foreach (FieldInfo filed in type.GetFields(BindingFlags.Public | BindingFlags.Static)) { if (filed.DeclaringType == type && !filed.IsSpecialName) { UMLAttribute attribute = new UMLAttribute(); attribute.Name = filed.Name; attribute.Type = filed.FieldType.Name; attributes.Add(attribute); } } return(attributes); }
public void LoadCollections() { Collaborations = getCollaborationsAssociated(); Attributes = GetAttributes(); }
private static UMLAttributeCollection GetProperties(Type type) { UMLAttributeCollection attributes = new UMLAttributeCollection(); foreach (PropertyInfo property in type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance)) { if (property.DeclaringType == type && !property.IsSpecialName) { MethodInfo methodInfo = property.GetGetMethod(true); if (methodInfo != null) { UMLAttribute attribute = new UMLAttribute(); attribute.Name = property.Name; attribute.Type = property.PropertyType.Name; if (methodInfo.IsPublic) { attribute.Visibility = Visibility.Public; } if (methodInfo.IsPrivate) { attribute.Visibility = Visibility.Private; } if (methodInfo.IsFamily) { attribute.Visibility = Visibility.Protected; } attributes.Add(attribute); } } } return attributes; }
private static UMLAttributeCollection GetStaticAndConstants(Type type) { UMLAttributeCollection attributes = new UMLAttributeCollection(); foreach (FieldInfo filed in type.GetFields(BindingFlags.Public | BindingFlags.Static)) { if (filed.DeclaringType == type && !filed.IsSpecialName) { UMLAttribute attribute = new UMLAttribute(); attribute.Name = filed.Name; attribute.Type = filed.FieldType.Name; attributes.Add(attribute); } } return attributes; }