示例#1
0
 public IEnumerable <EditFunction> GetFunctions()
 {
     return(target_type.GetFilteredInstanceMethods(
                Filterer_MethodInfo.HasCustomAttributeOfType <InspectorFunctionAttribute>()
                ).Convert(m => m.CreateFunction())
            .Convert(f => EditFunction.New(this, f)));
 }
示例#2
0
        protected override void GenerateAdditionalObjectMembers(UnityEngine.Object value, CSTextDocumentBuilder builder)
        {
            CSTextDocumentWriter writer = builder.CreateWriterWithVariablePairs(
                "TYPE", value.GetType().Name,
                "NAME", value.name.StyleAsVariableName(),
                "FUNCTION", ("Draw_" + value.name).StyleAsFunctionName()
                );

            foreach (MethodInfo method in value.GetType().GetFilteredInstanceMethods(
                         Filterer_MethodInfo.IsNamed("Initialize"),
                         Filterer_MethodInfo.IsOriginalMethod()
                         ))
            {
                string parameters = method.GetParameters()
                                    .Convert(p => p.ParameterType.GetCleanName() + " " + p.Name)
                                    .Join(", ");

                string arguments = method.GetParameters()
                                   .Convert(p => p.Name)
                                   .Join(", ");

                writer.Write("static public void ?FUNCTION(" + parameters + ")", delegate() {
                    writer.Write("GetInstance().?NAME.Draw(" + arguments + ");");
                });
            }
        }
示例#3
0
 public MethodInfo Resolve()
 {
     return(declaring_type.GetFilteredMethods(
                Filterer_MethodInfo.IsNamed(name),
                Filterer_MethodInfo.CanTechnicalParametersHold(parameter_types)
                ).GetFirst());
 }
示例#4
0
        protected override void GenerateTypeMembers(Type type, CSTextDocumentBuilder builder)
        {
            CSTextDocumentWriter writer = builder.CreateWriterWithVariablePairs(
                "TYPE", type.Name
                );

            foreach (MethodInfo method in type.GetFilteredInstanceMethods(
                         Filterer_MethodInfo.IsNamed("Initialize"),
                         Filterer_MethodInfo.IsOriginalMethodOf(type)
                         ))
            {
                string parameters = method.GetParameters()
                                    .Convert(p => p.ParameterType.GetCleanName() + " " + p.Name)
                                    .Prepend("this ?TYPE item")
                                    .Join(", ");

                string arguments = method.GetParameters()
                                   .Convert(p => p.Name)
                                   .Join(", ");

                writer.Write("static public void Draw(" + parameters + ")", delegate() {
                    writer.Write("EphemeralSystem.Next(item).Initialize(" + arguments + ");");
                });
            }
        }
示例#5
0
 public IEnumerable <EditAction> GetRecoveryActions()
 {
     return(target_type.GetFilteredInstanceMethods(
                Filterer_MethodInfo.HasNoEffectiveParameters(),
                Filterer_MethodInfo.HasCustomAttributeOfType <RecoveryFunctionAttribute>()
                ).Convert(m => m.CreateAction())
            .Convert(a => EditAction.New(this, a)));
 }
示例#6
0
        static public T ExecuteEditDistinction <T, P1>(P1 p1)
        {
            return((T)MarkedMethods <ATTRIBUTE_TYPE> .GetFilteredMarkedStaticMethods(
                       Filterer_MethodInfo.CanEffectiveParametersHold <P1>(),

                       Filterer_MethodInfo.CanReturnInto <T>()
                       ).GetFirst().Invoke(null, p1));
        }
示例#7
0
        static public void ExecuteNoReturnEditDistinction <P1>(P1 p1)
        {
            MarkedMethods <ATTRIBUTE_TYPE> .GetFilteredMarkedStaticMethods(
                Filterer_MethodInfo.CanEffectiveParametersHold <P1>(),

                Filterer_MethodInfo.HasNoReturn()
                ).GetFirst().Invoke(null, p1);
        }
示例#8
0
        static public T ExecuteEditDistinction <T, P1, P2, P3, P4, P5, P6, P7, P8, P9>(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9)
        {
            return((T)MarkedMethods <ATTRIBUTE_TYPE> .GetFilteredMarkedStaticMethods(
                       Filterer_MethodInfo.CanEffectiveParametersHold <P1, P2, P3, P4, P5, P6, P7, P8, P9>(),

                       Filterer_MethodInfo.CanReturnInto <T>()
                       ).GetFirst().Invoke(null, p1, p2, p3, p4, p5, p6, p7, p8, p9));
        }
示例#9
0
        static public void ExecuteNoReturnEditDistinction <P1, P2, P3, P4, P5, P6, P7, P8>(P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8)
        {
            MarkedMethods <ATTRIBUTE_TYPE> .GetFilteredMarkedStaticMethods(
                Filterer_MethodInfo.CanEffectiveParametersHold <P1, P2, P3, P4, P5, P6, P7, P8>(),

                Filterer_MethodInfo.HasNoReturn()
                ).GetFirst().Invoke(null, p1, p2, p3, p4, p5, p6, p7, p8);
        }
示例#10
0
 static private void Initialize()
 {
     MarkedMethods <EditorInitializerAttribute>
     .GetFilteredMarkedStaticMethods(
         Filterer_MethodInfo.HasNoEffectiveParameters()
         ).ProcessSandboxed(
         m => m.Invoke(null, Empty.Array <object>()),
         e => Debug.LogException(e)
         );
 }
示例#11
0
 private TyonTypeHandler_Deconstructable()
 {
     deconstruction_invokers = new OperationCache <BasicConversionInvoker, Type>(
         "deconstruction_invokers",
         t => MarkedMethods <DefinitionDeconstructionAttribute>
         .GetFilteredMarkedStaticMethods(Filterer_MethodInfo.CanEffectiveParametersHold(t))
         .GetFirst()
         .IfNotNull(m => m.GetBasicConversionInvoker())
         );
 }
示例#12
0
 public ILValue GetILValue()
 {
     return(MarkedMethods <MExpFunctionAttribute> .GetFilteredMarkedStaticMethods(
                Filterer_MethodInfo.IsNamed(GetId())
                )
            .GetFirst()
            .GetStaticILMethodInvokation(
                GetMExpExpressions().Convert(e => e.GetILValue())
                ));
 }
示例#13
0
 private IEnumerable <MethodInfoEX> GetApplicationEXMarkedTypeMethods(string name)
 {
     return(GetApplicationEXMarkedTypes()
            .Convert(t => t.GetFilteredStaticMethods(
                         Filterer_MethodInfo.IsNamed(name),
                         Filterer_MethodInfo.HasNoReturn(),
                         Filterer_MethodInfo.HasNoEffectiveParameters(),
                         Filterer_MethodInfo.IsStaticMethod()
                         ))
            .Flatten());
 }
示例#14
0
        public override IEnumerable <MethodInfo> GetOptions(string text)
        {
            Type type;

            if (type_property.TryGetContentValues <Type>(out type))
            {
                return(type.GetFilteredInstanceMethods(
                           Filterer_MethodInfo.DoesNameContain(text)
                           ).Convert <MethodInfoEX, MethodInfo>());
            }

            return(Empty.IEnumerable <MethodInfo>());
        }
示例#15
0
        static private void GenerateCode()
        {
            REGENERATION_COUNT = 0;

            MarkedMethods <CodeGeneratorAttribute>
            .GetFilteredMarkedStaticMethods(
                Filterer_MethodInfo.HasNoEffectiveParameters()
                ).ProcessSandboxed(
                m => m.Invoke(null, Empty.Array <object>()),
                e => Debug.LogException(e)
                );

            if (REGENERATION_COUNT >= 1)
            {
                AssetDatabase.Refresh();
            }
        }