• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.NodeLabelEditEventArgs类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: HandleLabelEdit

 public void HandleLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     try
     {
         this.mapTree.BeforeRenameNode = e.Node;
         bool isNodeChecked = false;
         if (e.Node.StateImageIndex != 1)
         {
             isNodeChecked = true;
         }
         int tag = (int) e.Node.Tag;
         string name = e.Label.Trim();
         if (e.Node.Text == name)
         {
             e.CancelEdit = true;
         }
         else if (name == string.Empty)
         {
             e.CancelEdit = true;
         }
         else if (this.CheckRename(name))
         {
             e.CancelEdit = true;
             MessageBoxUtil.ShowWarning(TrafficMapResource.TRAFFIC_NAME_EXISTED);
         }
         else
         {
             ITrafficMapModelService modelService = this.m_ServiceContext.Lookup(typeof(ITrafficMapModelService).FullName) as ITrafficMapModelService;
             this.changeMapName(modelService, tag, this.mapTree.BeforeRenameNode.Text, name, isNodeChecked);
             e.Node.Text = name;
             e.CancelEdit = true;
         }
     }
     catch (Exception exception)
     {
         WriteLog.Logger.Warn(exception.StackTrace);
     }
 }
开发者ID:xiaoyj,项目名称:Space,代码行数:38,代码来源:TrafficMapTreeNodeOperation.cs


示例17: treeView1_BeforeLabelEdit

 private void treeView1_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e)
 {
     if (e.Node is IObjectDatabaseTag || e.Node.Tag is StreamEmbed)
         e.CancelEdit = false;
     else
         e.CancelEdit = true;
 }
开发者ID:nagyist,项目名称:StreamDesk,代码行数:7,代码来源:StreamDatabaseEditor.cs


示例18: treeView1_AfterLabelEdit

        private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            var ex = (IObjectDatabaseTag)e.Node;
            if (e.Label == null) {
                MessageBox.Show("You cannot name a object by nothing.", "StreamDesk Editor", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.CancelEdit = true;
                return;
            }

            if (ex.ProviderObject.SubProviders.Where(v => v.Name == e.Label).Count() != 0 || ex.ProviderObject.Streams.Where(v => v.Name == e.Label).Count() != 0) {
                MessageBox.Show("This object already exists.", "StreamDesk Editor", MessageBoxButtons.OK, MessageBoxIcon.Error);
                e.CancelEdit = true;
                return;
            }

            ex.MenuTitle = e.Label;
            if (ex.IsProvider)
                ex.ProviderObject.Name = e.Label;
            else
                ex.StreamObject.Name = e.Label;
        }
开发者ID:nagyist,项目名称:StreamDesk,代码行数:21,代码来源:StreamDatabaseEditor.cs


示例19: treeView1_AfterLabelEdit

        private void treeView1_AfterLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            if (e.Label == null) return;

            TreeNode[] nodes = treeView1.Nodes.Find(e.Label, true);
            if (nodes.Length > 0)
            {
                MessageBox.Show("A layer or item with the name \"" + e.Label + "\" already exists in the level. Please use another name!");
                e.CancelEdit = true;
                return;
            }
            if (e.Node.Tag is Level)
            {
                Level l = (Level)e.Node.Tag;
                Editor.Instance.beginCommand("Rename Level (\"" + l.Name + "\" -> \"" + e.Label + "\")");
                l.Name = e.Label;
                e.Node.Name = e.Label;
                Editor.Instance.endCommand();
            }
            if (e.Node.Tag is Layer)
            {
                Layer l = (Layer)e.Node.Tag;
                Editor.Instance.beginCommand("Rename Layer (\"" + l.Name + "\" -> \"" + e.Label + "\")");
                l.Name = e.Label;
                e.Node.Name = e.Label;
                Editor.Instance.endCommand();
            }
            if (e.Node.Tag is Item)
            {
                Item i = (Item)e.Node.Tag;
                Editor.Instance.beginCommand("Rename Item (\"" + i.Name + "\" -> \"" + e.Label + "\")");
                i.Name = e.Label;
                e.Node.Name = e.Label;
                Editor.Instance.endCommand();
            }
            propertyGrid1.Refresh();
            pictureBox1.Select();
        }
开发者ID:hzl2928963,项目名称:gleed2d,代码行数:38,代码来源:MainForm.cs


示例20: treeView_BeforeLabelEdit

        /// <summary>
        /// Handles when the user tries to rename a tree node.
        /// </summary>
        private void treeView_BeforeLabelEdit(object sender, NodeLabelEditEventArgs e)
        {
            NodeTag nodetag= (NodeTag) e.Node.Tag;

            // we may not rename nodes, node folders and the root behaviour folder
            if( nodetag.Type ==NodeTagType.Node ||
                nodetag.Type ==NodeTagType.NodeFolder ||
                nodetag.Type ==NodeTagType.BehaviorFolder && e.Node.Parent ==null)
            {
                e.CancelEdit= true;
            }
            else
            {
                // we may not rename newly created behaviours as the label is used to identify them
                if(nodetag.Filename ==string.Empty)
                    e.CancelEdit= true;
            }
        }
开发者ID:yiliu1203,项目名称:Brainiac-Designer,代码行数:21,代码来源:BehaviorTreeList.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.NotifyIcon类代码示例发布时间:2022-05-26
下一篇:
C# Forms.Msg类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap