Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Loads all collections
 /// </summary>
 public void LoadCollections()
 {
     if (Owner == null)
     {
         Owner = Helper.GetOwner <UMLUseCase>(this);
     }
     _dets  = getDets();
     _files = getFiles();
     _steps = getSteps();
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public void LoadCollections()
 {
     Collaborations = getCollaborationsAssociated();
     Attributes     = GetAttributes();
 }
Ejemplo n.º 6
0
        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;
        }
Ejemplo n.º 7
0
        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;
        }