Пример #1
0
        public EventWrapperMemberBuilderInfo
        (
            IEventSymbol wrapperSymbol,
            Core core
        ) : base(wrapperSymbol, core)
        {
            int idx = TheCore.GetEventThisIdx(WrapperSymbol);

            if (idx < 0)
            {
                EventThisIdxAttribute eventThisIdxAttr = WrapperSymbol.GetAttrObject <EventThisIdxAttribute>();

                if (eventThisIdxAttr != null)
                {
                    idx = eventThisIdxAttr.ThisIdx;
                }
            }

            if (idx < 0)
            {
                idx = core.GetEventIdx(wrapperSymbol.GetUniqueEventId());
            }

            if (idx >= 0)
            {
                this.IndexInputParamToReplaceByThis = idx;
            }

            this.DefaultCodeBuilder = new SimpleEventBuilder();
        }
Пример #2
0
        // adds the class to compilation.
        public void ConfigurationCompleted()
        {
            if (TheSelfTypeSymbol != null)
            {
                return;
            }

            this.GenerateCode();

            TheCore.AddClass(this);

            TheSelfTypeSymbol =
                TheCore.TheCompilation.GetTypeByMetadataName(FullTypeName);
        }
Пример #3
0
        public ITypeConfig FindOrCreateConcretizationTypeConf
        (
            INamedTypeSymbol typeToConcretizeSymbol,
            string concreteClassName = null)
        {
            concreteClassName = concreteClassName ?? typeToConcretizeSymbol.Name.GetConcretizationName();

            ITypeConfig typeConfig =
                TheCore.FindOrCreateTypeConfByTypeToImpl(concreteClassName, typeToConcretizeSymbol);

            if (typeConfig.TheGeneratedCode == null)
            {
                typeConfig.TheBuilderSetter =
                    DefaultConcretizationMemberBuilderSetter.TheDefaultConcretizationBuilderSetter;

                typeConfig.ConfigurationCompleted();
            }

            return(typeConfig);
        }
Пример #4
0
 public static T Concretize <T>()
 {
     return(TheCore.ConcretizeType <T>());
 }
Пример #5
0
 public static T CreateEnumWrapper <T, EnumType>(EnumType enumVal, bool allowNonPublic = true)
     where EnumType : struct
 {
     return(TheCore.BuildEnumWrapper <T, EnumType>(enumVal));
 }
Пример #6
0
 public static void CreateEnumerationAdapter <T, EnumType>(Type staticEnumExtensionsType, bool allowNonPublic = true)
 {
     TheCore.CreateEnumAdaptor <T, EnumType>(staticEnumExtensionsType, allowNonPublic);
 }
Пример #7
0
 public static TypeToImplement CreateWrapperWithNonPublicMembers <TypeToImplement, TWrapper>(string className)
 {
     return(TheCore.WrapWithNonPublicMembers <TypeToImplement, TWrapper>(className));
 }
Пример #8
0
 public static ITypeConfig FindOrCreateConcretizationTypeConfig <T>()
 {
     return(TheCore.FindOrCreateConcretizationTypeConf <T>());
 }
Пример #9
0
 public static ITypeConfig FindOrCreateConcretizationTypeConfig(INamedTypeSymbol classTypeSymbol)
 {
     return(TheCore.FindOrCreateConcretizationTypeConf(classTypeSymbol));
 }
Пример #10
0
 public static T GetInstanceOfGeneratedType <T>(string className = null, params object[] args)
 {
     return(TheCore.GetInstOfGeneratedType <T>(className, args));
 }
Пример #11
0
 public static ITypeConfig FindOrCreateTypeConfigByTypeToImpl <TypeToImpl>(string className)
 {
     return(TheCore.FindOrCreateTypeConfByTypeToImpl <TypeToImpl>(className));
 }
Пример #12
0
 public static TToImplement CreateImplementedInstance <TToImplement, TWrapper>(params object[] args)
 {
     return(TheCore.CreateImplInstance <TToImplement, TWrapper>(args));
 }
Пример #13
0
 public static ITypeConfig FindOrCreateTypeConfig <TToImplement, TImplementor>(string className = null)
 {
     return(TheCore.FindOrCreateTypeConf <TToImplement, TImplementor>(className));
 }
Пример #14
0
 public void RecompileAssembly()
 {
     TheCore.RegenerateAssembly();
 }
Пример #15
0
 public static void Save(string path)
 {
     TheCore.SaveToPath(path);
 }
Пример #16
0
 public static void SetSaveOnErrorPath(string savePath)
 {
     TheCore.SaveToPathOnCompilationError(savePath);
 }
Пример #17
0
 public static void AddEventIdxInfo <TEventContainer>(string eventName, int idx = 0)
 {
     TheCore.AddEventInfo <TEventContainer>(eventName, idx);
 }