本文整理汇总了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;
}
示例2: HandleLabelEdit
public void HandleLabelEdit(object sender, NodeLabelEditEventArgs e)
{
if (this.m_NodeLabelEditEditEvent != null)
{
this.m_NodeLabelEditEditEvent(sender, e);
}
}
示例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;
}
}
}
}
示例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();
}
}
}
示例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);
}
示例6: LabelModified
public override void LabelModified(NodeLabelEditEventArgs e)
{
TemplateFolder.Name = e.Label;
if (TemplateFolder.Name != e.Label)
e.CancelEdit = true;
}
示例7: OnBeforeLabelEdit
protected override void OnBeforeLabelEdit(NodeLabelEditEventArgs e)
{
base.OnBeforeLabelEdit(e);
ItemNode node = (ItemNode)e.Node;
if (!node.EditingLabel)
e.CancelEdit = true;
}
示例8: OnAfterLabelEdit
protected override void OnAfterLabelEdit( NodeLabelEditEventArgs e )
{
base.OnAfterLabelEdit( e );
AutonomousTreeNode node = e.Node as AutonomousTreeNode;
if ( node != null )
{
node.OnAfterLabelEdit( e );
}
}
示例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);//弹出修改成功的提示信息
}
}
示例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;
}
}
示例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()));
}
}
}
示例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;
}
示例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);
}
}
示例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();
}
示例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;
}
}