コード例 #1
0
ファイル: TypeMappingService.cs プロジェクト: snugglesftw/Crm
 internal TypeMappingService(CrmSvcUtilParameters parameters)
 {
     _namespace = parameters.Namespace;
     _attributeTypeMapping = new Dictionary<AttributeTypeCode, Type>
         {
             {AttributeTypeCode.Boolean, typeof (bool)},
             {AttributeTypeCode.ManagedProperty, typeof (BooleanManagedProperty)},
             {AttributeTypeCode.CalendarRules, typeof (object)},
             {AttributeTypeCode.Customer, typeof (EntityReference)},
             {AttributeTypeCode.DateTime, typeof (DateTime)},
             {AttributeTypeCode.Decimal, typeof (decimal)},
             {AttributeTypeCode.Double, typeof (double)},
             {AttributeTypeCode.Integer, typeof (int)},
             {AttributeTypeCode.EntityName, typeof (string)},
             {AttributeTypeCode.BigInt, typeof (long)},
             {AttributeTypeCode.Lookup, typeof (EntityReference)},
             {AttributeTypeCode.Memo, typeof (string)},
             {AttributeTypeCode.Money, typeof (Money)},
             {AttributeTypeCode.Owner, typeof (EntityReference)},
             {AttributeTypeCode.Picklist, typeof (OptionSetValue)},
             {AttributeTypeCode.Status, typeof (OptionSetValue)},
             {AttributeTypeCode.String, typeof (string)},
             {AttributeTypeCode.Uniqueidentifier, typeof (Guid)}
         };
 }
コード例 #2
0
ファイル: ServiceProvider.cs プロジェクト: snugglesftw/Crm
 internal void InitializeServices(CrmSvcUtilParameters parameters)
 {
     var defaultServiceInstance = new CodeWriterFilterService(parameters);
     _services.Add(typeof (ICodeWriterFilterService), ServiceFactory.CreateInstance<ICodeWriterFilterService>(defaultServiceInstance, parameters.CodeWriterFilterService, parameters));
     _services.Add(typeof (ICodeWriterMessageFilterService), ServiceFactory.CreateInstance<ICodeWriterMessageFilterService>(defaultServiceInstance, parameters.CodeWriterMessageFilterService, parameters));
     _services.Add(typeof (IMetadataProviderService), ServiceFactory.CreateInstance<IMetadataProviderService>(new SdkMetadataProviderService(parameters), parameters.MetadataProviderService, parameters));
     _services.Add(typeof (ICodeGenerationService), ServiceFactory.CreateInstance<ICodeGenerationService>(new CodeGenerationService(), parameters.CodeGenerationService, parameters));
     _services.Add(typeof (INamingService), ServiceFactory.CreateInstance<INamingService>(new NamingService(parameters), parameters.NamingService, parameters));
     _services.Add(typeof (ICustomizeCodeDomService), ServiceFactory.CreateInstance<ICustomizeCodeDomService>(new CodeDomCustomizationService(), parameters.CodeCustomizationService, parameters));
     _services.Add(typeof (ITypeMappingService), new TypeMappingService(parameters));
 }
コード例 #3
0
ファイル: NamingService.cs プロジェクト: snugglesftw/Crm
 internal NamingService(CrmSvcUtilParameters parameters)
 {
     if (!string.IsNullOrWhiteSpace(parameters.ServiceContextName))
     {
         _serviceContextName = parameters.ServiceContextName;
     }
     else
     {
         _serviceContextName = typeof (OrganizationServiceContext).Name + "1";
     }
     _nameMap = new Dictionary<string, int>();
     _knowNames = new Dictionary<string, string>();
     _reservedAttributeNames = new List<string>();
     foreach (var info in typeof (Entity).GetProperties())
     {
         _reservedAttributeNames.Add(info.Name);
     }
 }
コード例 #4
0
 internal SdkMetadataProviderService(CrmSvcUtilParameters parameters)
 {
     _parameters = parameters;
 }
コード例 #5
0
ファイル: CrmSvcUtil.cs プロジェクト: snugglesftw/Crm
 CrmSvcUtil()
 {
     MethodTracer.Enter();
     _parameters = new CrmSvcUtilParameters();
     MethodTracer.Exit();
 }
コード例 #6
0
 internal CodeWriterFilterService(CrmSvcUtilParameters parameters)
 {
     _messageNamespace = parameters.MessageNamespace;
     _generateMessages = parameters.GenerateMessages;
     _generateServiceContext = !string.IsNullOrWhiteSpace(parameters.ServiceContextName);
 }