Exemplo n.º 1
0
        public TemplateBrowser(IMyGenerationMDI mdi)
		{
			//
			// Required for Windows Form Designer support
			//
            InitializeComponent();
            this.mdi = mdi;
            this.DockPanel = mdi.DockPanel;

			treeViewTemplates.MouseDown += new System.Windows.Forms.MouseEventHandler(this.treeViewTemplates_MouseDown);
			treeViewTemplates.DoubleClick += new System.EventHandler(this.treeViewTemplates_OnDoubleClick);
			treeViewTemplates.AfterExpand += new TreeViewEventHandler(this.treeViewTemplates_AfterExpand);
			treeViewTemplates.AfterCollapse += new TreeViewEventHandler(this.treeViewTemplates_AfterCollapse);
			treeViewTemplates.KeyDown += new KeyEventHandler(this.treeViewTemplates_KeyDown);
			treeViewTemplates.MouseMove += new MouseEventHandler(treeViewTemplates_MouseMove);
			
			treeBuilder = new TemplateTreeBuilder(treeViewTemplates);

			treeBuilder.LoadTemplates();
        }
Exemplo n.º 2
0
        public TemplateBrowser(IMyGenerationMDI mdi)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            this.mdi       = mdi;
            this.DockPanel = mdi.DockPanel;

            treeViewTemplates.MouseDown     += new System.Windows.Forms.MouseEventHandler(this.treeViewTemplates_MouseDown);
            treeViewTemplates.DoubleClick   += new System.EventHandler(this.treeViewTemplates_OnDoubleClick);
            treeViewTemplates.AfterExpand   += new TreeViewEventHandler(this.treeViewTemplates_AfterExpand);
            treeViewTemplates.AfterCollapse += new TreeViewEventHandler(this.treeViewTemplates_AfterCollapse);
            treeViewTemplates.KeyDown       += new KeyEventHandler(this.treeViewTemplates_KeyDown);
            treeViewTemplates.MouseMove     += new MouseEventHandler(treeViewTemplates_MouseMove);

            treeBuilder = new TemplateTreeBuilder(treeViewTemplates);

            treeBuilder.LoadTemplates();
        }
Exemplo n.º 3
0
        public void LoadTemplates(string selectedid)
        {
            treeViewTemplates.Nodes.Clear();
            treeViewTemplates.HideSelection = false;
            treeBuilder = new TemplateTreeBuilder(treeViewTemplates);
            treeBuilder.LoadTemplates();

            TemplateTreeNode selectedNode = null;
            string           id           = selectedid;

            if (id != null)
            {
                id = id.ToLower();
            }
            selectedNode = FindNodeByID(id, treeViewTemplates.Nodes[0], false);

            if (selectedNode == null)
            {
                selectedNode = FindNodeByID(_lastRecordedSelectedId, treeViewTemplates.Nodes[0], false);

                if (selectedNode == null)
                {
                    selectedNode = FindNodeByID(id, treeViewTemplates.Nodes[0], true);
                }
            }

            if (selectedNode != null)
            {
                _lastRecordedSelectedId = selectedNode.UniqueId.ToLower();

                this.treeViewTemplates.SelectedNode = selectedNode;

                TreeNode parent = selectedNode.Parent;
                while (parent != null)
                {
                    parent.Expand();
                    parent = parent.Parent;
                }
            }
        }
		public void LoadTemplates(string selectedid) 
		{
			treeViewTemplates.Nodes.Clear();
			treeViewTemplates.HideSelection = false;
			treeBuilder = new TemplateTreeBuilder(treeViewTemplates);
			treeBuilder.LoadTemplates();
			
			TemplateTreeNode selectedNode = null;
			string id = selectedid;
			if (id != null)  id = id.ToLower();
			selectedNode = FindNodeByID(id, treeViewTemplates.Nodes[0], false);

			if (selectedNode == null)
			{
				selectedNode = FindNodeByID(_lastRecordedSelectedId, treeViewTemplates.Nodes[0], false);

				if (selectedNode == null)
				{
					selectedNode = FindNodeByID(id, treeViewTemplates.Nodes[0], true);
				}
			}

			if (selectedNode != null) 
			{
				_lastRecordedSelectedId = selectedNode.UniqueId.ToLower();

				this.treeViewTemplates.SelectedNode = selectedNode;

				TreeNode parent = selectedNode.Parent;
				while (parent != null) 
				{
					parent.Expand();
					parent = parent.Parent;
				}
			}
		}
Exemplo n.º 5
0
 public void Initialize()
 {
     _treeBuilder = new TemplateTreeBuilder(treeViewTemplates);
     _treeBuilder.LoadTemplates();
 }
 public void Initialize()
 {
     _treeBuilder = new TemplateTreeBuilder(treeViewTemplates);
     _treeBuilder.LoadTemplates();
 }