Example #1
0
        public void treeViewFiles_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            Console.WriteLine("Double Click");
            Console.WriteLine("Full path: " + e.Node.FullPath);
            //pop the save file dialog
            saveFileDialog1.FileOk += saveFileDialog1_FileOk;
            saveFileDialog1.FileName = e.Node.Text;
            saveFileDialog1.ShowDialog();

            //we need the path of the file we want to save
            IList<int> path = GetNodePathIndexes(e.Node);

            StringBuilder fullPath = new StringBuilder("treeview");
            foreach (int index in path)
            {
                fullPath.AppendFormat(".Nodes[{0}]", index);
            }
            Console.WriteLine("After showdialog Full path: " + fullPath);

            //implement the save...
            string fixedpath = e.Node.FullPath.Replace("\\", "/");
            Console.WriteLine("fixed path: " + fixedpath);
            Console.WriteLine("from teh dialog: " + saveFileDialog1.FileName);

            Cursor.Current = Cursors.WaitCursor;
            download_file(fixedpath, txtToken.Text, gbl_TeamObject.members[gbl_current_member_index].profile.member_id, saveFileDialog1.FileName);
            Cursor.Current = Cursors.Default;
        }
Example #2
0
		protected override void OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e) {
			var node = e.Node as TreeNodeX;
			if (node != null) {
				node.OnMouseDoubleClick(e);
			}
			base.OnNodeMouseDoubleClick(e);
		}
        private void TreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            var msg = (e.Node.Tag as EntPhysicalTable)?.AllProperties;

            dgvProps.DataSource = msg?.ToArray();
            dgvProps.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
        }
Example #4
0
 private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e) {
     if (e.Node.Text == "New User") {
         loadControls(newUserControl);
     } else if (e.Node.Text == "Change Password") {
         loadControls(changePasswordControl);
     }
 }
 private void explorerTreeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         explorerTreeView1.SelectedNode = e.Node;
     }
 }
Example #6
0
 private void tvProjectFolders_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     ProjectFolder pf = project.GetProductFolderFromLinkReference(e.Node);
     lvProjectFiles.Items.Clear();
     ListViewProjectFiles lvpf = new ListViewProjectFiles(lvProjectFiles, pf);
     lvpf.Fill();
 }
Example #7
0
        private void OnTreeViewNodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs eventArgs)
        {
            FindResult? findResult = eventArgs.Node.Tag as FindResult?;

            if (findResult == null || !findResult.HasValue) {
                return;
            }

            // フォームがnullまたは破棄されている場合
            if (findResult.Value.mTextEditorForm == null || findResult.Value.mTextEditorForm.IsDisposed) {
                return;
            }

            // フォームが見つからなかった場合
            if (!this.mMainForm.TextEditorForms.Contains(findResult.Value.mTextEditorForm)) {
                return;
            }

            findResult.Value.mTextEditorForm.Activate();

            // 指定されたファイルの場所にジャンプ
            Scintilla scintilla = findResult.Value.mTextEditorForm.Scintilla;
            scintilla.SelectionStart = (int)findResult.Value.mPosition;
            scintilla.SelectionEnd = scintilla.SelectionStart;
            scintilla.ScrollCaret();
        }
        void workspaceTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (GisApp.ActiveApp.SelectNode != null)
            {
                WorkspaceTreeNodeBase node = GisApp.ActiveApp.SelectNode;
                if (node.NodeType == WorkspaceTreeNodeDataType.SceneName)
                {
                    string sceneName = node.Text;
                    //打开场景,假如说已经打开,则激活
                    //否则,直接新建这个场景
                    var document = GisApp.ActiveApp.FormMain.DocumentManager.View.Documents.Where(s =>
                        {
                            bool result = false;
                            IFormScene form = s.Form as IFormScene;
                            result = s.Caption == sceneName && form != null;
                            return result;
                        }).FirstOrDefault();

                    IFormScene formScene = null;
                    if (document != null)
                    {
                        formScene = document.Form as IFormScene;
                        GisApp.ActiveApp.FormMain.DocumentManager.View.ActivateDocument(document.Control);
                    }
                    else
                    {
                        formScene = GisApp.ActiveApp.CreateFormScene(sceneName);
                    }
                    formScene.SceneControl.Scene.Workspace = GisApp.ActiveApp.Workspace;
                    formScene.SceneControl.Scene.Open(sceneName);
                }
            }
        }
Example #9
0
		private void ProjectExplorer_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
		{
			if (NodeIsFile(e.Node))
			{
				_openedProject?.OpenFile(new FileInfo(e.Node.FullPath));
			}
		}
Example #10
0
        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                try
                {
                    //重置颜色和字体
                    richTextBox1.SelectAll();
                    richTextBox1.SelectionColor = Color.Black;
                    richTextBox1.SelectionFont = new Font(richTextBox1.Font.FontFamily, richTextBox1.Font.Size);

                    string tag = e.Node.Tag == null ? "" : e.Node.Tag.ToString();
                    int index = richTextBox1.Text.IndexOf(tag);

                    richTextBox1.SelectionStart = index;
                    richTextBox1.SelectionLength = tag.Length;
                    richTextBox1.SelectionColor = Color.FromArgb(0, 128, 0);
                    richTextBox1.SelectionFont = new Font(richTextBox1.Font.FontFamily, richTextBox1.Font.Size, FontStyle.Bold);
                    richTextBox1.ScrollToCaret();
                }
                catch
                {
                }
            }
        }
 private void ShowReportInfo(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Node.Nodes.Count == 0)
     {
         reportInfo.Text = e.Node.Tag.ToString();
     }
 }
Example #12
0
        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Node.Level == 0)
            {
                //点击的数据库节点
                TabPage page = tabControl1.TabPages[e.Node.Text];
                if (page == null)
                {
                    page = new TabPage(e.Node.Text);
                    page.Name = e.Node.Text;
                    page.BackColor = Color.White;
                    TableControl tc = new TableControl();
                    tc.DataBaseName = e.Node.Text;
                    tc.Server = server;
                    tc.Dock = DockStyle.Fill;
                    page.Controls.Add(tc);
                    tabControl1.TabPages.Add(page);
                }
                tabControl1.SelectTab(page);
                //e.Node.Nodes.Clear();
                //List<string> tables = DbHelper.GetTables(server, e.Node.Text);
                //foreach (var table in tables)
                //{
                //    e.Node.Nodes.Add(table);
                //}
                //e.Node.Expand();
            }
            else if (e.Node.Level == 1)
            {
                //点击的表

            }
        }
Example #13
0
 private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (_dc == null) return;
     var method = e.Node.Tag as ModelMethod;
     if (method != null)
         textBox1.Text = _dc.GetText(method);
 }
        private void snapShotDataTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button != MouseButtons.Right) { return; }
            snapShotDataTree.SelectedNode = e.Node;
            if (!(e.Node is CallNode)) return;
            CallNode tmpNode = (CallNode)e.Node;
            Csta.ConnectionID_t selectedConnId = tmpNode.connection;
            ContextMenuStrip snapShotDataTreeContextMenu = new ContextMenuStrip();
            ToolStripItem cstaClearCallContextMenuItem = snapShotDataTreeContextMenu.Items.Add("cstaClearCall");
            ToolStripItem cstaClearConnectionContextMenuItem = snapShotDataTreeContextMenu.Items.Add("cstaClearConnection");
            cstaClearCallContextMenuItem.Click += (s, ev) =>
            {
                Csta.EventBuffer_t evtbuf = Csta.clearCall(this.parentForm.acsHandle, selectedConnId);
                if (evtbuf.evt.eventHeader.eventClass.eventClass == Csta.CSTACONFIRMATION && evtbuf.evt.eventHeader.eventType.eventType == Csta.CSTA_CLEAR_CALL_CONF)
                {
                    snapShotDataTree.Nodes.Remove(tmpNode);
                }
            };

            cstaClearConnectionContextMenuItem.Click += (s, ev) =>
            {
                Csta.EventBuffer_t evtbuf = Csta.clearConnection(parentForm.acsHandle, parentForm.privData, selectedConnId);
                if (evtbuf.evt.eventHeader.eventClass.eventClass == Csta.CSTACONFIRMATION && evtbuf.evt.eventHeader.eventType.eventType == Csta.CSTA_CLEAR_CONNECTION_CONF)
                {
                    snapShotDataTree.Nodes.Remove(tmpNode);
                }
            };

            snapShotDataTreeContextMenu.Show(Cursor.Position);
        }
Example #15
0
        private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            //if (__frmComposite != null) __frmComposite.Close();
            //if (__frmSwitch != null) __frmSwitch.Close();
            //if (__gerPlus != null) __gerPlus.Close();

            if (e.Node.Name == "Node0")
            {               
                if (__gerPlus == null) __gerPlus = new GerenalPlus.Form1();
                LoadActiveForm(__gerPlus);
            }
            else if (e.Node.Name == "Node1")
            {
                if (__frmSwitch == null) __frmSwitch = new SwitchDemo.Form3();
                LoadActiveForm(__frmSwitch);
            }
            else if (e.Node.Name == "Node2")
            {
                if (__frmComposite == null) __frmComposite = new SwitchDemo.Form4();
                LoadActiveForm(__frmComposite);
            }
            else if (e.Node.Name == "Node3")
            {
                if (__S12Debug == null) __S12Debug = new S21Debug.Form1();
                LoadActiveForm(__S12Debug);        
                //System.Diagnostics.Process proc = new System.Diagnostics.Process();
                //ZNE_100TL_Factory_Config.ZConfig.Run();            
            }
        }
        private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
        {

            try
            {
                TreeNode parentnode = e.Node;
                while (parentnode.Parent != null)
                {
                    parentnode = parentnode.Parent;
                }

                if (parentnode.Text.Equals("Match Result"))
                //if (e.Node.Level == 3 || e.Node.Level == 5)
                {
                    OddsCheckerCrawler parent = this.MdiParent as OddsCheckerCrawler;
                    if (!parent.IsProcessRunning)
                    {
                        //if (!string.IsNullOrEmpty(parent.SelectedBookies()))
                        //{

                        //parent.SetProgress(true);
                        //parent.IsProcessRunning = true;
                        string info = e.Node.Text;
                        string[] info1 = info.Split(':');
                        CrawlAllMarkets crawl = new CrawlAllMarkets();
                        string[] match = crawl.GetChampionMatchInfo(Convert.ToInt32(info1[1].ToString()));
                        //match[0]=link;match[1]=time;
                        if (match[0] != null)
                        {
                            parent.IsProcessRunning = true;
                            parent.SetProgress(true);
                            flowLayoutPanel1.Controls.Clear();

                            //    lblsportid.Text = info1[3];
                            countthread = 0;

                            Task taskA = Task.Factory.StartNew(() =>
                            {
                                FillMatchInfo(info1[1], match[0], match[1],1);

                            }, TaskCreationOptions.LongRunning);
                        }
                        //}
                        //else
                        //{
                        //    MessageBox.Show("Please select atleast one bookie from Select Bookies menu");
                        //}
                    }
                    else
                    {
                        MessageBox.Show("A process is already running");
                    }

                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("An internal error occured while processing the request");
            }
        }
        void treeView1_NodeMouseClick(object sender,
    TreeNodeMouseClickEventArgs e)
        {
            TreeNode newSelected = e.Node;
            listView1.Items.Clear();
            DirectoryInfo nodeDirInfo = (DirectoryInfo)newSelected.Tag;
            ListViewItem.ListViewSubItem[] subItems;
            ListViewItem item = null;

            foreach (DirectoryInfo dir in nodeDirInfo.GetDirectories())
            {
                item = new ListViewItem(dir.Name, 0);
                subItems = new ListViewItem.ListViewSubItem[]
                          {new ListViewItem.ListViewSubItem(item, "Directory"),
                   new ListViewItem.ListViewSubItem(item,
                dir.LastAccessTime.ToShortDateString())};
                item.SubItems.AddRange(subItems);
                listView1.Items.Add(item);
            }
            foreach (FileInfo file in nodeDirInfo.GetFiles())
            {
                item = new ListViewItem(file.Name, 1);
                subItems = new ListViewItem.ListViewSubItem[]
                          { new ListViewItem.ListViewSubItem(item, "File"),
                   new ListViewItem.ListViewSubItem(item,
                file.LastAccessTime.ToShortDateString())};

                item.SubItems.AddRange(subItems);
                listView1.Items.Add(item);
            }

            listView1.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }
Example #18
0
        private void tvTrees_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            //点击一级菜单栏
            if (e.Node.Level == 0)
            {
                this.tvTrees.CollapseAll();//收缩

                var databaseName = e.Node.Name;

                List<TableContext> tableContexts =
                    GlobalContext.DataBaseContexts.First(p => p.DataBaseName.Equals(databaseName)).TableList;

                //加载对应表
                foreach (var tableNode in tableContexts.Select(tableContext => new TreeNode() { Text = tableContext.Name+(string.IsNullOrEmpty(tableContext.Description) ? string.Empty :"【"+tableContext.Description+"】"), Name = tableContext.Name }))
                {
                    e.Node.Nodes.Add(tableNode);
                }

                e.Node.ExpandAll();
            }
            else if (e.Node.Level == 1)//点击表
            {
                var databaseName = e.Node.Parent.Name;
                var tableName = e.Node.Name;

                this.dgvColumn.DataSource = DAOHelper.GetColumnContextListByTableName(databaseName, tableName);

            }
        }
Example #19
0
 public void NodeClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Button == MouseButtons.Right)
     {
         //if (e.Node is BaseNode)
         //{
         //    this.TNMCEA = e;
         //    e.Node.ContextMenuStrip = GetRightMenu((e.Node as BaseNode).RightMenu);
         //}
     }
     else
     {
         //if (e.Node is BaseNode)
         //{
         //    string MName = (e.Node as BaseNode).Name + "_" + (e.Node as BaseNode).Click;
         //    MethodInfo methodInfo = this.GetType().GetMethods().Where(n => n.Name.Equals(MName)).FirstOrDefault();
         //    if (methodInfo != null)
         //    {
         //        methodInfo.Invoke(this, new object[] { e });
         //    }
         //    else
         //    {
         //        //MessageBox.Show("没有设置匹配的事件。");
         //    }
         //}
     }
 }
Example #20
0
 //declara método para alterar tela de ajuda
 private void TreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     //método executado cada vez que é precionada uma opção na TreeView
     richTextBox1.BackColor = System.Drawing.Color.White; //altera a cor de fundo do mesmo para branco(dando um aspecto de em funcionalidade)
     string caminho = Convert.ToString(e.Node.Tag); //converte o valor da tag da opção de TreeView para string, e depois armazena em caminho
     richTextBox1.LoadFile(caminho, RichTextBoxStreamType.PlainText); //carrega arquivo referentea a opção selecionada
 }
Example #21
0
        private void WorkspaceTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button != MouseButtons.Right)
            {
                return;
            }

            WorkspaceTreeView.SelectedNode = WorkspaceTreeView.GetNodeAt(e.X, e.Y);
            TreeNode curNode = WorkspaceTreeView.GetNodeAt(e.X, e.Y);
            if (curNode == null)
            {
                return;
            }
            else if (curNode == mUsersAndLicensingNode)
            {
                UserAndLicensingContextMenuStrip.Show(Cursor.Position);
            }
            else if (curNode == mColorSettingNode)
            {

            }

            /*
            if (WorkspaceTreeView.SelectedNode.Tag is TaskModel)
            {
                TaskContextMenuStrip.Show(Cursor.Position);
            }
            */
        }
 /// <summary>
 /// 左侧点击对应的树节点的控件属性在表达式显示对应的(控件名.属性)
 /// </summary>
 /// <param name="sender">事件发送者</param>
 /// <param name="e">事件数据</param>
 private void ControlTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     TreeNode SelectNode = ControlTree.SelectedNode;
     string ReturnValue = null;
     if (SelectNode != null && SelectNode.Nodes.Count == 0)
     {
         foreach (List<string> TmpControl in tempAttribute)
         {
             if (SelectNode.Parent.Text == TmpControl[0])
             {
                 ReturnValue = TmpControl[0] + ".";
                 foreach (string Attribute in TmpControl)
                 {
                     if (Attribute.Split(',')[0] == SelectNode.Text)
                     {
                         ReturnValue += Attribute.Split(',')[1];
                         break;
                     }
                 }
                 break;
             }
         }
     }
     ExpressBox.Text += ReturnValue;
 }
Example #23
0
 public void HandleNodeClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (this.m_NodeClickEvent != null)
     {
         this.m_NodeClickEvent(sender, e);
     }
 }
Example #24
0
        private void leksykonATCTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            string atc = e.Node.Tag as string;
            leksykonDescriptionLabel.Text = "Preparaty z grupy: " + atc;

            Leksykon_UpdateGrid(UnitOfWork.MedicineRepository.GetMedicinesByATC(atc));
        }
		/// <summary>
		/// Occurs when the <see cref="E:System.Windows.Forms.TreeView.NodeMouseClick"></see> event is fired
		/// -- that is, when a node in the tree view is clicked.
		/// </summary>
		/// <param name="e">A <see cref="T:System.Windows.Forms.TreeNodeMouseClickEventArgs"></see> that contains the event data.</param>
		protected override void OnNodeMouseClick(TreeNodeMouseClickEventArgs e)
		{
			// Are we dealing with a dropdown node?
			this.ShowComboBox(e.Node as DropDownTreeNode);
			//if (e.Node is DropDownTreeNode)
			//{
			//    this.m_CurrentNode = (DropDownTreeNode)e.Node;
			//    this.m_CurrentSelectionIdx = this.m_CurrentNode.ComboBox.SelectedIndex;

			//    // Need to add the node's ComboBox to the TreeView's list of controls for it to work
			//    this.Controls.Add(this.m_CurrentNode.ComboBox);                                        

			//    // Set the bounds of the ComboBox, with a little adjustment to make it look right
			//    this.m_CurrentNode.ComboBox.SetBounds(
			//        this.m_CurrentNode.Bounds.X - 1,
			//        this.m_CurrentNode.Bounds.Y - 2,
			//        this.CalcualteComboBoundsWidth(this.m_CurrentNode.ComboBox),
			//        //this.m_CurrentNode.Bounds.Width + 25,
			//        this.m_CurrentNode.Bounds.Height);

			//    // Listen to the SelectedValueChanged event of the node's ComboBox
			//    this.m_CurrentNode.ComboBox.SelectedValueChanged += new EventHandler(ComboBox_SelectedValueChanged);
			//    this.m_CurrentNode.ComboBox.DropDownClosed += new EventHandler(ComboBox_DropDownClosed);
			//    this.m_CurrentNode.ComboBox.BackColor = Color.DeepPink;

			//    // Now show the ComboBox
			//    this.m_CurrentNode.ComboBox.Show();
			//    this.m_CurrentNode.ComboBox.DroppedDown = true;
			//}
			base.OnNodeMouseClick(e);
		}
Example #26
0
 public void NodeDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     try
     {
         string MName = e.Node.Name + "_NodeDoubleClick";
         MethodInfo methodInfo = this.GetType().GetMethods().Where(n => n.Name.Equals(MName)).FirstOrDefault();
         if (methodInfo != null)
         {
             SENDER = sender;
             TNMCEA = e;
             TREENODE = e.Node;
             if (e.Node.Tag is Pin)
             {
                 PIN = e.Node.Tag as Pin;
                 NdataBaseHelper.DBFullName = PIN.DataBasePath;
             }
             methodInfo.Invoke(this, new object[] { });//调用MName名字的函数
             DoubleClick_OK = true;
         }
         else
         {
             DoubleClick_OK = false;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #27
0
 protected override void OnNodeMouseDoubleClick(TreeNodeMouseClickEventArgs e)
 {
     base.OnNodeMouseDoubleClick(e);
     if (e.Node.IsExpanded)
         e.Node.Collapse();
     else
         e.Node.Expand();
 }
 protected override void OnNodeMouseClick(TreeNodeMouseClickEventArgs e)
 {
     if (!object.ReferenceEquals(this.SelectedNode, e.Node))
     {
         this.SelectedNode = e.Node;
     }
     base.OnNodeMouseClick(e);
 }
Example #29
0
 /// <summary>
 /// Shows the clicked directory content in the list view
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void treeView1_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     TreeNode newSelected = e.Node;
     listView1.Items.Clear();
     currentDir=new Directories((DirectoryInfo)newSelected.Tag);
     PopulateListView(currentDir);
     
 }
Example #30
0
 protected override void OnNodeMouseClick(TreeNodeMouseClickEventArgs e)
 {
     base.OnNodeMouseClick(e);
     if (!(e.Node is IShadowNode))
     {
         SelectedNode = e.Node;
     }
 }