Пример #1
0
 public static ApiSyntaxBuildOutput FromModel(SyntaxDetailViewModel model, string[] supportedLanguages)
 {
     if (model == null)
     {
         return(null);
     }
     return(new ApiSyntaxBuildOutput
     {
         Content = ApiBuildOutputUtility.TransformToLanguagePairList(model.Content, model.Contents, supportedLanguages),
         Parameters = model.Parameters?.Select(ApiParameterBuildOutput.FromModel).ToList(),
         TypeParameters = model.TypeParameters?.Select(ApiParameterBuildOutput.FromModel).ToList(),
         Return = ApiParameterBuildOutput.FromModel(model.Return),
     });
 }
Пример #2
0
        public static ApiSyntaxBuildOutput FromModel(SyntaxDetailViewModel model, string[] supportedLanguages)
        {
            if (model == null)
            {
                return(null);
            }

            return(new ApiSyntaxBuildOutput
            {
                Content = GetContents(model.Content, model.ContentForCSharp, model.ContentForVB, supportedLanguages),
                Parameters = model.Parameters?.Select(s => ApiParameterBuildOutput.FromModel(s)).ToList(),
                TypeParameters = model.TypeParameters?.Select(s => ApiParameterBuildOutput.FromModel(s)).ToList(),
                Return = ApiParameterBuildOutput.FromModel(model.Return),
            });
        }
Пример #3
0
 public static ApiSyntaxBuildOutput FromModel(SyntaxDetailViewModel model, Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
 {
     if (model == null)
     {
         return(null);
     }
     return(new ApiSyntaxBuildOutput
     {
         Content = ApiBuildOutputUtility.TransformToLanguagePairList(model.Content, model.Contents, supportedLanguages),
         Parameters = model.Parameters?.Select(s => ApiParameterBuildOutput.FromModel(s, references, supportedLanguages)).ToList(),
         TypeParameters = model.TypeParameters?.Select(ApiParameterBuildOutput.FromModel).ToList(),
         Return = ApiParameterBuildOutput.FromModel(model.Return, references, supportedLanguages),
         _needExpand = false,
     });
 }
Пример #4
0
        public static ApiSyntaxBuildOutput FromModel(SyntaxDetailViewModel model, Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
        {
            if (model == null)
            {
                return(null);
            }

            return(new ApiSyntaxBuildOutput
            {
                Content = GetContents(model.Content, model.ContentForCSharp, model.ContentForVB, supportedLanguages),
                Parameters = model.Parameters?.Select(s => ApiParameterBuildOutput.FromModel(s, references, supportedLanguages)).ToList(),
                TypeParameters = model.TypeParameters?.Select(s => ApiParameterBuildOutput.FromModel(s)).ToList(),
                Return = ApiParameterBuildOutput.FromModel(model.Return, references, supportedLanguages),
                _isExpanded = true,
            });
        }