Example #1
0
 public TreeNode AddNamespace(TreeNode parent, Namespace ns)
 {
     return AddNode(NodeType.Namespace, parent, ns.Name, new TreeNodeMetaData()
     {
         Namespace = ns
     });
 }
Example #2
0
 private void LoadNamespace(TreeNode parent, Namespace _namespace)
 {
     foreach (var ns in _namespace.Namespaces)
         LoadNamespace(AddNamespace(parent, ns), ns);
     foreach (var cls in _namespace.Classes)
         AddClass(parent, cls);
     foreach (var intf in _namespace.Interfaces)
         AddInterface(parent, intf);
 }
Example #3
0
 public AddClass(NodeType nodeType, Namespace parent)
 {
     InitializeComponent();
     Text = "Add " + (nodeType == NodeType.Class ? "Class" : nodeType == NodeType.Abstract ? "Abstract" : "Interface");
     if (nodeType == NodeType.Interface)
         cxCtor.Enabled = false;
     NsParent = parent;
     foreach (var ac in nodeType == NodeType.Interface ? Interface.AllowedAccessibilities : Class.AllowedAccessibilities)
         cbAccess.Items.Add(ac);
     cbAccess.SelectedItem = nodeType == NodeType.Interface ? Interface.DefaultAccessibility : Class.DefaultAccessibility;
 }
Example #4
0
        private void btnAddParam_Click(object sender, EventArgs e)
        {
            AddNamespace an = new AddNamespace(Tree.GetNamespace(tvProject.SelectedNode));

            if (an.ShowDialog(this) == DialogResult.OK)
            {
                Namespace ns = new Namespace() { Name = an.Namespace };
                Tree.GetNamespace(tvProject.SelectedNode)?.Namespaces.Add(ns);
                Program.Db.SaveChanges();
                Tree.AddNamespace(tvProject.SelectedNode, ns);
                tvProject.SelectedNode.Expand();
            }

            an.Dispose();
        }
Example #5
0
 public AddNamespace(Namespace parent)
 {
     InitializeComponent();
     NsParent = parent;
 }