Ejemplo n.º 1
0
        void AddAssembly(string path, bool updateSettings)
        {
            var assembly = Assembly.LoadFile(path);

            var node = new AssemblyNode();

            node.Assembly = assembly;
            node.Path     = path;
            foreach (var t in assembly.GetExportedTypes())
            {
                if (IsControl(t) && Metadata.IsPopularControl(t))
                {
                    node.Controls.Add(new ControlNode()
                    {
                        Type = t
                    });
                }
            }

            node.Controls.Sort(delegate(ControlNode c1, ControlNode c2)  {
                return(c1.Name.CompareTo(c2.Name));
            });

            AssemblyNodes.Add(node);

            if (updateSettings)
            {
                if (Settings.Default.AssemblyList == null)
                {
                    Settings.Default.AssemblyList = new StringCollection();
                }
                Settings.Default.AssemblyList.Add(path);
            }
        }
Ejemplo n.º 2
0
		void AddAssembly(string path, bool updateSettings)
		{
			var assembly = Assembly.LoadFile(path);
			
			MyTypeFinder.Instance.RegisterAssembly(assembly);
			
			var node = new AssemblyNode();
			node.Assembly = assembly;
			node.Path = path;
			foreach (var t in assembly.GetExportedTypes()) {
				if (IsControl(t) /* && Metadata.IsPopularControl(t) */) {
					node.Controls.Add(new ControlNode() { Type = t });
				}
			}

			node.Controls.Sort(delegate(ControlNode c1, ControlNode c2)  {
			                   	return c1.Name.CompareTo(c2.Name);
			                   });

			AssemblyNodes.Add(node);

			if (updateSettings) {
				if (Settings.Default.AssemblyList == null) {
					Settings.Default.AssemblyList = new StringCollection();
				}
				Settings.Default.AssemblyList.Add(path);
			}
		}
Ejemplo n.º 3
0
        void Remove()
        {
            AssemblyNode node = uxTreeView.SelectedItem as AssemblyNode;

            if (node != null)
            {
                Toolbox.Instance.Remove(node);
            }
        }
Ejemplo n.º 4
0
        void AddAssembly(string path, bool updateSettings)
        {
            var assembly = Assembly.LoadFile(path);

            MyTypeFinder.Instance.RegisterAssembly(assembly);

            var node = new AssemblyNode();

            node.Assembly = assembly;
            node.Path     = path;
            node.Controls.Add(new ControlNode()
            {
                Type = typeof(Button)
            });
            node.Controls.Add(new ControlNode()
            {
                Type = typeof(TextBox)
            });
            node.Controls.Add(new ControlNode()
            {
                Type = typeof(Label)
            });

            node.Controls.Sort(delegate(ControlNode c1, ControlNode c2)  {
                return(c1.Name.CompareTo(c2.Name));
            });

            AssemblyNodes.Add(node);

            if (updateSettings)
            {
                if (Settings.Default.AssemblyList == null)
                {
                    Settings.Default.AssemblyList = new StringCollection();
                }
                Settings.Default.AssemblyList.Add(path);
            }
        }
Ejemplo n.º 5
0
 public void Remove(AssemblyNode node)
 {
     AssemblyNodes.Remove(node);
     Settings.Default.AssemblyList.Remove(node.Path);
 }
Ejemplo n.º 6
0
		public void Remove(AssemblyNode node)
		{
			AssemblyNodes.Remove(node);
			Settings.Default.AssemblyList.Remove(node.Path);
		}