Пример #1
0
 /// <summary>
 /// Generate event code.
 /// </summary>
 /// <param name="from"></param>
 /// <param name="target"></param>
 /// <param name="type"></param>
 /// <returns></returns>
 public static string GenerateEventCode(Node from, Block target, EventData.EventType type)
 {
     if (target == null)
     {
         throw new System.Exception("target can't null");
     }
     if (type == EventData.EventType.Action)
     {
         if (setting.fullComment)
         {
             string data = target.GenerateCode(from);
             if (!string.IsNullOrEmpty(data))
             {
                 data = data.Insert(0, "//Action: " + target.Name + " | Type: " + CodeGenerator.ParseType(target.GetType()) + "\n");
             }
             return(data);
         }
         return(target.GenerateCode(from));
     }
     else
     {
         return(target.GenerateConditionCode(from));
     }
 }