コード例 #1
0
            public Type GetLiaisonType()
            {
                if (liaison_type == null)
                {
                    liaison_type = TypeCreator.CreateType("ObjectLiaison_" + GetTargetType().Name, TypeAttributesExtensions.PUBLIC_CLASS, delegate(TypeBuilder type_builder) {
                        type_builder.SetParent(typeof(ObjectLiaison));

                        target_serializer_prop_groups = target_props
                                                        .Convert(p => TypeSerializerProp.Create(type_builder, p))
                                                        .Group(
                            p => p.GetUpdateInterval(),
                            (i, ps) => new TypeSerializerPropGroup(type_builder, i, ps)
                            ).ToList();

                        liaison_update_interval = target_serializer_prop_groups
                                                  .Convert(g => g.GetUpdateInterval())
                                                  .Min();

                        type_builder.CreateConstructor(MethodAttributesExtensions.PUBLIC, delegate(ConstructorBuilderEX method) {
                            return(new ILBlock(
                                       method.GetBaseILConstruct(method.GetEffectiveILParameter(0)),
                                       target_serializer_prop_groups
                                       .Convert(g => g.GenerateConstructor(method.GetILThis()))
                                       .ToBlock()
                                       ));
                        }, typeof(TypeSerializer));
                    });
                }

                return(liaison_type);
            }
コード例 #2
0
ファイル: Signal.cs プロジェクト: cuijialang/HDL_ANTLR4
 public static Signal CreateSignal(VHDL.Object.Signal s)
 {
     return(new Signal(TypeCreator.CreateType(s.Type), s));
 }
コード例 #3
0
 public object create(string typeName, params object[] args)
 {
     Trace.Assert(!String.IsNullOrWhiteSpace(typeName));
     return(typeCreator.CreateType(typeName, args));
 }