Exemplo n.º 1
0
 /// <summary> Gets the menu entry path of this node </summary>
 public static string GetNodePath(Type nodeType)
 {
     object[] attrs = nodeType.GetCustomAttributes(typeof(GraphContextMenuItem), true);
     if (attrs.Length > 0)
     {
         GraphContextMenuItem attr = (GraphContextMenuItem)attrs[0];
         return(string.IsNullOrEmpty(attr.Path) ? null : attr.Path);
     }
     Log.Error("Can not add node of type " + nodeType + ". Node path annotation is missing.");
     return(null);
 }
Exemplo n.º 2
0
 /// <summary> Gets the menu entry name of this node </summary>
 public static string GetNodeName(Type nodeType)
 {
     object[] attrs = nodeType.GetCustomAttributes(typeof(GraphContextMenuItem), true);
     if (attrs.Length > 0)
     {
         GraphContextMenuItem attr = (GraphContextMenuItem)attrs[0];
         return(string.IsNullOrEmpty(attr.Name) ? nodeType.Name : attr.Name);
     }
     Log.Error("Can not add node of type " + nodeType + ". Node name annotation is missing.");
     return(nodeType.ToString());
 }