示例#1
0
        public void Provide(Type type, ComponentData data)
        {
            var contextNames = GetContextNamesOrDefault(type);

            data.SetContextNames(contextNames);
        }
示例#2
0
 public static string[] GetContextNames(this ComponentData data)
 {
     return((string[])data[COMPONENT_CONTEXTS]);
 }
 public static bool IsUnique(this ComponentData data)
 {
     return((bool)data[COMPONENT_IS_UNIQUE]);
 }
示例#4
0
        public static string Event(this ComponentData data, string contextName, EventData eventData)
        {
            var optionalContextName = data.GetContextNames().Length > 1 ? contextName : string.Empty;

            return(optionalContextName + EventComponentName(data, eventData) + GetEventTypeSuffix(eventData));
        }
 public static void IsEvent(this ComponentData data, bool isEvent)
 {
     data[COMPONENT_EVENT] = isEvent;
 }
 public static void SetEventData(this ComponentData data, EventData[] eventData)
 {
     data[COMPONENT_EVENT_DATA] = eventData;
 }
示例#7
0
 public static bool ShouldGenerateIndex(this ComponentData data)
 {
     return((bool)data[COMPONENT_GENERATE_INDEX]);
 }
示例#8
0
 public static void ShouldGenerateMethods(this ComponentData data, bool generate)
 {
     data[COMPONENT_GENERATE_METHODS] = generate;
 }
示例#9
0
 public static string ComponentNameWithContext(this ComponentData data, string contextName)
 {
     return(contextName + data.ComponentName());
 }
示例#10
0
 public void Provide(Type type, ComponentData data)
 {
     data.ShouldGenerateIndex(GetGenerateIndex(type));
 }
示例#11
0
 public static string ComponentNameValidUppercaseFirst(this ComponentData data)
 {
     return(ComponentName(data).UppercaseFirst().AddPrefixIfIsKeyword());
 }
示例#12
0
 public static string ComponentName(this ComponentData data)
 {
     return(data.GetTypeName().ToComponentName());
 }
示例#13
0
 public static string EventListener(this ComponentData data, string contextName, EventData eventData)
 {
     return(data.Event(contextName, eventData).AddListenerSuffix());
 }
示例#14
0
 public static void SetContextNames(this ComponentData data, string[] contextNames)
 {
     data[COMPONENT_CONTEXTS] = contextNames;
 }
示例#15
0
 public static void ShouldGenerateIndex(this ComponentData data, bool generate)
 {
     data[COMPONENT_GENERATE_INDEX] = generate;
 }
示例#16
0
 public static bool ShouldGenerateMethods(this ComponentData data)
 {
     return((bool)data[COMPONENT_GENERATE_METHODS]);
 }
 public static bool ShouldGenerateComponent(this ComponentData data)
 {
     return((bool)data[COMPONENT_GENERATE_COMPONENT]);
 }
 public static bool IsEvent(this ComponentData data)
 {
     return((bool)data[COMPONENT_EVENT]);
 }
 public static void ShouldGenerateComponent(this ComponentData data, bool generate)
 {
     data[COMPONENT_GENERATE_COMPONENT] = generate;
 }
 public static EventData[] GetEventData(this ComponentData data)
 {
     return((EventData[])data[COMPONENT_EVENT_DATA]);
 }
 public static string GetObjectTypeName(this ComponentData data)
 {
     return((string)data[COMPONENT_OBJECT_TYPE]);
 }
 private CodeGenFile[] Generate(ComponentData data)
 {
     return(data.GetContextNames()
            .SelectMany(contextName => Generate(contextName, data))
            .ToArray());
 }
 public static void SetObjectTypeName(this ComponentData data, string type)
 {
     data[COMPONENT_OBJECT_TYPE] = type;
 }
 public static void IsUnique(this ComponentData data, bool isUnique)
 {
     data[COMPONENT_IS_UNIQUE] = isUnique;
 }
示例#25
0
 public static string PrefixedComponentName(this ComponentData data)
 {
     return(data.GetFlagPrefix().UppercaseFirst() + data.ComponentName());
 }