public void Provide(Type type, ComponentData data) { var contextNames = GetContextNamesOrDefault(type); data.SetContextNames(contextNames); }
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]); }
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; }
public static bool ShouldGenerateIndex(this ComponentData data) { return((bool)data[COMPONENT_GENERATE_INDEX]); }
public static void ShouldGenerateMethods(this ComponentData data, bool generate) { data[COMPONENT_GENERATE_METHODS] = generate; }
public static string ComponentNameWithContext(this ComponentData data, string contextName) { return(contextName + data.ComponentName()); }
public void Provide(Type type, ComponentData data) { data.ShouldGenerateIndex(GetGenerateIndex(type)); }
public static string ComponentNameValidUppercaseFirst(this ComponentData data) { return(ComponentName(data).UppercaseFirst().AddPrefixIfIsKeyword()); }
public static string ComponentName(this ComponentData data) { return(data.GetTypeName().ToComponentName()); }
public static string EventListener(this ComponentData data, string contextName, EventData eventData) { return(data.Event(contextName, eventData).AddListenerSuffix()); }
public static void SetContextNames(this ComponentData data, string[] contextNames) { data[COMPONENT_CONTEXTS] = contextNames; }
public static void ShouldGenerateIndex(this ComponentData data, bool generate) { data[COMPONENT_GENERATE_INDEX] = generate; }
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; }
public static string PrefixedComponentName(this ComponentData data) { return(data.GetFlagPrefix().UppercaseFirst() + data.ComponentName()); }