Exemple #1
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),
            });
        }
Exemple #2
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,
            });
        }