コード例 #1
0
ファイル: CommandTreeNode.cs プロジェクト: vgrinin/gin
 public abstract CommandTreeNode AppendChild(Command command, GinNameAttribute commandAttribute, PropertyInfo property, GinArgumentAttribute propertyAttribute);
コード例 #2
0
ファイル: CommandTreeNode.cs プロジェクト: vgrinin/gin
 public abstract CommandTreeNode InsertAfter(Command command, GinNameAttribute commandAttribute, CommandTreeNode nodeAfter);
コード例 #3
0
ファイル: CommandTreeNode.cs プロジェクト: vgrinin/gin
 public abstract CommandTreeNode AppendChild(Command command, GinNameAttribute commandAttribute);
コード例 #4
0
ファイル: TreeViewTreeNode.cs プロジェクト: vgrinin/gin
 private string GetCommandName(Command command, GinNameAttribute commandAttribute)
 {
     return command.GetHumanReadableName();
 }
コード例 #5
0
ファイル: TreeViewTreeNode.cs プロジェクト: vgrinin/gin
 public override CommandTreeNode InsertAfter(Command command, GinNameAttribute commandAttribute, CommandTreeNode nodeAfter)
 {
     TreeNode node = new TreeNode()
     {
         Text = GetCommandName(command, commandAttribute),
         ToolTipText = commandAttribute.Description,
         ImageIndex = 0,
         Tag = new TreeNodeData()
         {
             Command = command,
             CommandAttribute = commandAttribute,
             Property = null,
             PropertyAttribute = null,
             AcceptedTypes = null,
             NotAcceptedTypes = null
         }
     };
     TreeViewTreeNode afterNode = (TreeViewTreeNode)nodeAfter;
     int index = _node.Nodes.IndexOf(afterNode._node);
     if (index >= 0)
     {
         _node.Nodes.Insert(index + 1, node);
     }
     else
     {
         _node.Nodes.Add(node);
     }
     TreeViewTreeNode treeNode = new TreeViewTreeNode(node);
     ((TreeNodeData)node.Tag).Node = treeNode;
     return treeNode;
 }
コード例 #6
0
ファイル: TreeViewTreeNode.cs プロジェクト: vgrinin/gin
 public override CommandTreeNode AppendChild(Command command, GinNameAttribute commandAttribute, PropertyInfo property, GinArgumentAttribute propertyAttribute)
 {
     var acceptNot = property.GetCustomAttributes(typeof(GinArgumentCommandAcceptNotAttribute), false);
     List<Type> notAcceptedTypes = null;
     if (acceptNot != null)
     {
         notAcceptedTypes = new List<Type>();
         foreach (var item in acceptNot)
         {
             notAcceptedTypes.Add(((GinArgumentCommandAcceptNotAttribute)item).NotAcceptedType);
         }
     }
     var acceptOnly = property.GetCustomAttributes(typeof(GinArgumentCommandAcceptOnlyAttribute), false);
     List<Type> acceptedTypes = null;
     if (acceptOnly != null)
     {
         acceptedTypes = new List<Type>();
         foreach (var item in acceptOnly)
         {
             acceptedTypes.Add(((GinArgumentCommandAcceptOnlyAttribute)item).AcceptedType);
         }
     }
     TreeNode node = new TreeNode()
     {
         Text = propertyAttribute.Name,
         ToolTipText = propertyAttribute.Description,
         ImageIndex = 1,
         SelectedImageIndex = 1,
         Tag = new TreeNodeData()
         {
             Command = command,
             CommandAttribute = commandAttribute,
             Property = property,
             PropertyAttribute = propertyAttribute,
             AcceptedTypes = acceptedTypes.ToArray(),
             NotAcceptedTypes = notAcceptedTypes.ToArray()
         }
     };
     _node.Nodes.Add(node);
     TreeViewTreeNode treeNode = new TreeViewTreeNode(node);
     ((TreeNodeData)node.Tag).Node = treeNode;
     return treeNode;
 }
コード例 #7
0
ファイル: TreeViewTreeNode.cs プロジェクト: vgrinin/gin
 public override CommandTreeNode AppendChild(Command command, GinNameAttribute commandAttribute)
 {
     TreeNode node = new TreeNode()
     {
         Text = GetCommandName(command, commandAttribute),
         ToolTipText = commandAttribute.Description,
         ImageIndex = 0,
         Tag = new TreeNodeData()
         {
             Command = command,
             CommandAttribute = commandAttribute,
             Property = null,
             PropertyAttribute = null,
             AcceptedTypes = null,
             NotAcceptedTypes = null
         }
     };
     _node.Nodes.Add(node);
     TreeViewTreeNode treeNode = new TreeViewTreeNode(node);
     ((TreeNodeData)node.Tag).Node = treeNode;
     return treeNode;
 }