Exemple #1
0
        void MainForm_Load(object sender, EventArgs e)
        {
            this.BackColor = Color.White;
            tv.Nodes.Clear();

            tabs.SelectedIndexChanged += new EventHandler(tabs_SelectedIndexChanged);

            ActionTreeViewNode node;

			node = new ActionTreeViewNode
			{
				Name = "dbp",
				Text = "DB Partitioning",
				ActivateCallback = delegate(ActionTreeViewNode n)
				{
					ClearModules();
					return true;
				}
			};
			tv.Nodes.Add(node);

			//node = new ActionTreeViewNode
			//{
			//    Name = "ham",
			//    Text = "Plan Designer",
			//    ActivateCallback = delegate(ActionTreeViewNode n)
			//    {
			//        ClearModules();
			//        AddModule(typeof(PlanForm), n);
			//        return true;
			//    }
			//};
			//tv.Nodes.Add(node);

            //node = new ActionTreeViewNode
            //{
            //    Name = "utl",
            //    Text = "Utilities",
            //    ActivateCallback = delegate(ActionTreeViewNode n)
            //    {
            //        ClearModules();
            //        AddModule(typeof(PID), n);
            //        return true;
            //    }
            //};
            //tv.Nodes.Add(node);

            //node = new ActionTreeViewNode
            //{
            //    Name = "lch",
            //    Text = "Launcher",
            //    ActivateCallback = delegate(ActionTreeViewNode n)
            //    {
            //        ClearModules();
            //        AddModule(typeof(P1Launcher), n);
            //        return true;
            //    }
            //};
            //tv.Nodes.Add(node);

            //node = new ActionTreeViewNode
            //{
            //    Name = "dpl",
            //    Text = "Deployment",
            //    ActivateCallback = delegate(ActionTreeViewNode n)
            //    {
            //        ClearModules();
            //        AddModule(typeof(MsiSeekerForm), n);
            //        return true;
            //    }
            //};
            //tv.Nodes.Add(node);

            tv.NodeMouseClick += new TreeNodeMouseClickEventHandler(tv_NodeMouseClick);

            tabs.TabPages.Clear();
            ActivateNode(node);
            tv.SelectedNode = node;
            ExceptionHandler.Handlers.Add(HandleException);
        }
Exemple #2
0
 protected IEmbededModule AddModule(Type moduleType, ActionTreeViewNode node = null)
 {
     IEmbededModule instance = moduleType.GetConstructor(Type.EmptyTypes).Invoke(null) as IEmbededModule;
     TabPage page = CreateTab();
     instance.EmbedInto(page);
     if (node != null)
     {
         node.AddModule(instance);
     }
     return instance;
 }
Exemple #3
0
 private void tv_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     ActionTreeViewNode node = e.Node as ActionTreeViewNode;
     if (prevSelectedNode != node)
     {
         ActivateNode(node);
         prevSelectedNode = node;
     }
 }
Exemple #4
0
 private void ActivateNode(ActionTreeViewNode node)
 {
     if (node != null && node.ActivateCallback != null)
     {
         node.ActivateCallback(node);
         prevSelectedNode = node;
     }
 }
Exemple #5
0
		private bool NodeActivateCallback(ActionTreeViewNode sender)
		{
			CommandTreeViewNode cnode = sender as CommandTreeViewNode;
			if (cnode != null)
			{
				CfgCommand.Generate(cnode.CmdNode);
			}
			return true;
		}