Example #1
0
 public bool GenerateSdkMessagePair(
     CodeGenerationSdkMessagePair messagePair
     , ICodeGenerationServiceProvider iCodeGenerationServiceProvider
     )
 {
     return(true);
 }
Example #2
0
 public CodeGenerationSdkMessageRequest(CodeGenerationSdkMessagePair message, Guid id, string name)
 {
     this.Id            = id;
     this.Name          = name;
     this.MessagePair   = message;
     this.RequestFields = new Dictionary <int, Entities.SdkMessageRequestField>();
 }
        public string GetNameForMessagePair(
            CodeGenerationSdkMessagePair messagePair
            , ICodeGenerationServiceProvider iCodeGenerationServiceProvider
            )
        {
            if (this._knowNames.ContainsKey(messagePair.Id.ToString()))
            {
                return(this._knowNames[messagePair.Id.ToString()]);
            }

            string validTypeName = this.CreateValidTypeName(messagePair.Request.Name);

            this._knowNames.Add(messagePair.Id.ToString(), validTypeName);

            return(validTypeName);
        }
        internal void Fill(
            IEnumerable <Entities.SdkMessageFilter> sdkMessageFilters
            , IEnumerable <Entities.SdkMessagePair> sdkMessagePairs

            , IEnumerable <Entities.SdkMessageRequest> sdkMessageRequests
            , IEnumerable <Entities.SdkMessageRequestField> sdkMessageRequestFields

            , IEnumerable <Entities.SdkMessageResponse> sdkMessageResponses
            , IEnumerable <Entities.SdkMessageResponseField> sdkMessageResponseFields
            )
        {
            foreach (var sdkMessagePair in sdkMessagePairs)
            {
                if (sdkMessagePair.SdkMessagePairId.HasValue && !this.SdkMessagePairs.ContainsKey(sdkMessagePair.SdkMessagePairId.Value))
                {
                    var request  = sdkMessageRequests.FirstOrDefault(r => r.SdkMessagePairId?.Id == sdkMessagePair.SdkMessagePairId);
                    var response = sdkMessageResponses.FirstOrDefault(r => r.SdkMessageRequestId?.Id == request?.SdkMessageRequestId);

                    CodeGenerationSdkMessagePair codeSdkMessagePair = new CodeGenerationSdkMessagePair(this, sdkMessagePair.SdkMessagePairId.Value, sdkMessagePair.Namespace, request, response);
                    this.SdkMessagePairs.Add(sdkMessagePair.Id, codeSdkMessagePair);

                    var requestFields  = sdkMessageRequestFields.Where(r => r.SdkMessageRequestId?.Id == request?.SdkMessageRequestId);
                    var responseFields = sdkMessageResponseFields.Where(r => r.SdkMessageResponseId?.Id == response?.SdkMessageResponseId);

                    codeSdkMessagePair.Fill(requestFields, responseFields);
                }
            }

            foreach (var sdkMessageFilter in sdkMessageFilters)
            {
                if (sdkMessageFilter.SdkMessageFilterId.HasValue && !this.SdkMessageFilters.ContainsKey(sdkMessageFilter.SdkMessageFilterId.Value))
                {
                    this.SdkMessageFilters.Add(sdkMessageFilter.SdkMessageFilterId.Value, sdkMessageFilter);
                }
            }
        }
 public IEnumerable <string> GetCommentsForMessagePair(CodeGenerationSdkMessagePair messagePair, ICodeGenerationServiceProvider iCodeGenerationServiceProvider)
 {
     return(Enumerable.Empty <string>());
 }