当前位置: 首页>>代码示例>>C#>>正文


C# Forms.NodeLabelEditEventArgs类代码示例

本文整理汇总了C#中System.Windows.Forms.NodeLabelEditEventArgs的典型用法代码示例。如果您正苦于以下问题:C# NodeLabelEditEventArgs类的具体用法?C# NodeLabelEditEventArgs怎么用?C# NodeLabelEditEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NodeLabelEditEventArgs类属于System.Windows.Forms命名空间,在下文中一共展示了NodeLabelEditEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OPMShellTreeView_AfterLabelEdit

        void OPMShellTreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (!string.IsNullOrEmpty(e.Label))
            {
                string newName = e.Label;
                DirectoryInfo di = new DirectoryInfo(e.Node.FullPath);
                if (di != null && di.Exists && di.Parent != null && di.Parent.Exists)
                {
                    string newPath = Path.Combine(di.Parent.FullName, newName);

                    try
                    {
                        di.MoveTo(newPath);
                        e.Node.Name = di.Name;
                        e.Node.Tag = di;
                        e.CancelEdit = false;

                        SelectedNode = null;
                        SelectedNode = e.Node;

                        return;
                    }
                    catch { }
                }
            }

            e.CancelEdit = true;
        }
开发者ID:rraguso,项目名称:protone-suite,代码行数:28,代码来源:OPMShellTreeView.cs

示例2: HandleLabelEdit

 public void HandleLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (this.m_NodeLabelEditEditEvent != null)
     {
         this.m_NodeLabelEditEditEvent(sender, e);
     }
 }
开发者ID:xiaoyj,项目名称:Space,代码行数:7,代码来源:FuncTreeNodeOperation.cs

示例3: AfterLabelEdit

 public void AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label != null)
     {
         if ((e.Node.Text == "Propagation Models") || (e.Node.Parent.Text == "Propagation Models"))
         {
             e.CancelEdit = true;
         }
         else if (e.Label.Trim().Equals(""))
         {
             e.CancelEdit = true;
         }
         else if (e.Node.Tag.GetType().BaseType == typeof(ValueType))
         {
             int propModelID = Convert.ToInt32(e.Node.Tag);
             string label = e.Label;
             this.m_PropModelCollection.RenamePropModel(propModelID, e.Label);
             if (e.Label.Equals(this.m_PropModelCollection.GetPropModel(propModelID).PropModelName))
             {
                 e.Node.Text = e.Label;
                 e.CancelEdit = false;
             }
             else
             {
                 MessageBoxUtil.ShowWarning(string.Format(PropagationResource.PROP_NAME_EXIST, label));
                 e.CancelEdit = true;
             }
         }
     }
 }
开发者ID:xiaoyj,项目名称:Space,代码行数:30,代码来源:PropModelTreeUserControl.cs

示例4: treeView1_AfterLabelEdit

 private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label != null)
     {
         if (e.Label.Length > 0)
         {
             if (e.Label.IndexOfAny(new char[] { '@', '.', ',', '!' }) == -1)
             {
                 // Stop editing without canceling the label change.
                 e.Node.EndEdit(false);
             }
             else
             {
                 /* Cancel the label edit action, inform the user, and
                    place the node in edit mode again. */
                 e.CancelEdit = true;
                 MessageBox.Show("Invalid tree node label.\n" +
                    "The invalid characters are: '@','.', ',', '!'",
                    "Node Label Edit");
                 e.Node.BeginEdit();
             }
         }
         else
         {
             /* Cancel the label edit action, inform the user, and
                place the node in edit mode again. */
             e.CancelEdit = true;
             MessageBox.Show("Invalid tree node label.\nThe label cannot be blank",
                "Node Label Edit");
             e.Node.BeginEdit();
         }
     }
 }
开发者ID:Zheaoli,项目名称:Switch_hosts,代码行数:33,代码来源:Form1.cs

示例5: tree_AfterLabelEdit

 private void tree_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label == null)
         return;
     Subject subject=(Subject) e.Node.Tag;
     DatabaseAccess.RenameSubject(subject.Id,e.Label);
 }
开发者ID:rmasoudi,项目名称:mshkat,代码行数:7,代码来源:Form1.cs

示例6: LabelModified

        public override void LabelModified(NodeLabelEditEventArgs e)
        {
            TemplateFolder.Name = e.Label;

            if (TemplateFolder.Name != e.Label)
                e.CancelEdit = true;
        }
开发者ID:BachelorEric,项目名称:ModelFirst,代码行数:7,代码来源:FolderNode.cs

示例7: OnBeforeLabelEdit

        protected override void OnBeforeLabelEdit(NodeLabelEditEventArgs e)
        {
            base.OnBeforeLabelEdit(e);

            ItemNode node = (ItemNode)e.Node;
            if (!node.EditingLabel)
                e.CancelEdit = true;
        }
开发者ID:BachelorEric,项目名称:ModelFirst,代码行数:8,代码来源:DocumentItemTreeView.cs

示例8: OnAfterLabelEdit

 protected override void OnAfterLabelEdit( NodeLabelEditEventArgs e )
 {
     base.OnAfterLabelEdit( e );
     AutonomousTreeNode node = e.Node as AutonomousTreeNode;
     if ( node != null )
     {
         node.OnAfterLabelEdit( e );
     }
 }
开发者ID:jogibear9988,项目名称:ormbattle,代码行数:9,代码来源:AutonomousTreeView.cs

示例9: treeView1_AfterLabelEdit

 private void treeView1_AfterLabelEdit(object sender,NodeLabelEditEventArgs e)
 {
     if(e.Label != null && e.Label != "")//当选定项的内容存在且不为空时
     {
         NexusConnection.Open();//打开数据库连接
         string RefreshString = "update Ware set 产品名称='" + //定义一个数据库连接字段
             e.Label + "' where 产品编号=" + (e.Node.Index + 1).ToString();
         NexusCommand = new OleDbCommand(RefreshString,NexusConnection);//定义一个执行SQL语句的对象
         NexusCommand.ExecuteNonQuery();//执行SQL语句
         NexusConnection.Close();//关闭数据库连接
         MessageBox.Show("修改成功!","提示信息",MessageBoxButtons.OK,MessageBoxIcon.Asterisk);//弹出修改成功的提示信息
     }
 }
开发者ID:TGHGH,项目名称:C-1200,代码行数:13,代码来源:Frm_Main.cs

示例10: TreeView_AfterLabelEdit

        void TreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            Node.TreeView.AfterLabelEdit -= new NodeLabelEditEventHandler(TreeView_AfterLabelEdit);
            Node.TreeView.LabelEdit = false;

            try
            {
                this.Table.Rename(e.Label);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "重新命名失敗", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.CancelEdit = true;
            }
        }
开发者ID:lidonghao1116,项目名称:ProjectManager,代码行数:15,代码来源:TableNodeHandler.cs

示例11: OnBeforeLabelEdit

        protected override void OnBeforeLabelEdit(NodeLabelEditEventArgs e)
        {
            var before = e.Node != null ? e.Node.Text : null;

            base.OnBeforeLabelEdit(e);

            if (!e.CancelEdit && e.Node != null)
            {
                var after = e.Node.Text;
                if (before != after)
                {
                    e.CancelEdit = true;
                    BeginInvoke((Action)(() => e.Node.BeginEdit()));
                }
            }
        }
开发者ID:nemec,项目名称:Fiddler-Launchpad,代码行数:16,代码来源:LauncherTreeview.cs

示例12: BlobTreeAfterLabelEdit

        private void BlobTreeAfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            e.Node.EndEdit(false);

            // Create a new container...

            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
            CloudBlobContainer containerRef = blobClient.GetContainerReference(e.Label);

            containerRef.CreateIfNotExist();

            var containerNode = e.Node as ContainerTreeNode;

            if (containerNode == null)
                return;

               containerNode.Container = containerRef;
        }
开发者ID:caseywatson,项目名称:AzureStorageDemo,代码行数:18,代码来源:Form1.cs

示例13: DefTreeView_AfterLabelEdit

        private void DefTreeView_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Label == null)
            {
                e.CancelEdit = true;
                e.Node.BeginEdit();
            }
            else
            {
                if (e.Node.Level == 0)
                    tempDef.ListOfSectors.ElementAt(e.Node.Index).SectorName = e.Label;
                if (e.Node.Level == 1)
                    tempDef.ListOfSectors.ElementAt(e.Node.Parent.Index).ListOfFloors.ElementAt(e.Node.Index).NameFloor = e.Label;
                if (e.Node.Level == 2)
                    tempDef.ListOfSectors.ElementAt(e.Node.Parent.Parent.Index).ListOfFloors.ElementAt(e.Node.Parent.Index).ListOfRooms.ElementAt(e.Node.Index).RoomName = e.Label;
                e.Node.EndEdit(false);

            }
        }
开发者ID:BorislavRadev,项目名称:NPLab,代码行数:19,代码来源:EL-4.cs

示例14: KeySpaceTree_AfterLabelEdit

        private void KeySpaceTree_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            List<CfDef> cfDefs = new List<CfDef>();
            CfDef cfDef = new CfDef();
            cfDef.Name = "Test";
            cfDef.Keyspace = e.Node.Text;
            cfDef.Column_type = "Standard";
            cfDefs.Add(cfDef);

            KsDef keySpaceDef = new KsDef();
            keySpaceDef.Name = e.Node.Text;
            keySpaceDef.Replication_factor = 1;
            keySpaceDef.Strategy_class = "org.apache.cassandra.locator.RackUnawareStrategy";
            keySpaceDef.Cf_defs = cfDefs;

            client.system_add_keyspace(keySpaceDef);

            // Data bind in future
            populateTreeView();
        }
开发者ID:chak71,项目名称:CassandraWorkbench,代码行数:20,代码来源:MainForm.cs

示例15: AfterLabelEdit

 private void AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Label != null)
     {
         if (String.Equals("Misc", e.Label))
         {
             e.CancelEdit = true;
             MessageBox.Show("Invalid name. Name is reserved.", "SkillGroup Edit");
             e.Node.BeginEdit();
         }
         else if (e.Label.Length > 0)
             e.Node.EndEdit(false);
         else
         {
             e.CancelEdit = true;
             MessageBox.Show("Invalid name. Name cannot be empty.", "SkillGroup Edit");
             e.Node.BeginEdit();
         }
         treeView1.LabelEdit = false;
     }
 }
开发者ID:polserver,项目名称:poltools,代码行数:21,代码来源:SkillGrp.cs


注:本文中的System.Windows.Forms.NodeLabelEditEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。