示例#1
0
        private void generateField(ref ClassDescripter classDescripter)
        {
            var invokerField = new FieldDescripter(ClassServicerInvokerName)
                               .SetType(typeof(ServicerInvoker));

            invokerField.SetAccess(AccessType.PrivateReadonly);

            classDescripter.CreateFiled(invokerField)
            .AddUsing(typeof(ServicerInvoker).Namespace);
        }
        private void generateField(ref ClassDescripter classDescripter)
        {
            var binarySerializerField = new FieldDescripter(ClassBinarySerializerName)
                                        .SetType(typeof(IBinarySerializer));

            binarySerializerField.SetAccess(AccessType.PrivateReadonly);

            var providerField = new FieldDescripter(ClassProviderName)
                                .SetType(typeof(IObjectProvider));

            providerField.SetAccess(AccessType.PrivateReadonly);

            var loggerField = new FieldDescripter(ClassLoggerName).SetType(typeof(ILogger));

            loggerField.SetAccess(AccessType.PrivateReadonly);

            classDescripter.CreateFiled(binarySerializerField, providerField, loggerField)
            .AddUsing(typeof(IBinarySerializer).Namespace)
            .AddUsing(typeof(IObjectProvider).Namespace)
            .AddUsing(typeof(ILogger).Namespace);
        }