Esempio n. 1
0
        private static string GetCompositeName(SpecViewModel svm)
        {
            // If href does not exists, return full name
            if (string.IsNullOrEmpty(svm.Uid))
            {
                return(StringHelper.HtmlEncode(svm.FullName));
            }

            // If href exists, return name with href
            return(ApiBuildOutputUtility.GetXref(svm.Uid, svm.FullName, svm.Name));
        }
Esempio n. 2
0
        public static ApiReferenceBuildOutput FromModel(ItemViewModel vm)
        {
            if (vm == null)
            {
                return(null);
            }

            return(new ApiReferenceBuildOutput
            {
                Uid = vm.Uid,
                Id = XrefDetails.GetHtmlId(vm.Uid),
                Parent = vm.Parent,
                IsExternal = false,
                Href = vm.Href,
                Name = ApiBuildOutputUtility.TransformToLanguagePairList(vm.Name, vm.Names, vm.SupportedLanguages),
                FullName = ApiBuildOutputUtility.TransformToLanguagePairList(vm.FullName, vm.FullNames, vm.SupportedLanguages),
                Spec = GetSpecNames(ApiBuildOutputUtility.GetXref(vm.Uid, vm.FullName, vm.Name), vm.SupportedLanguages),
                Type = vm.Type,
                Summary = vm.Summary,
                Platform = vm.Platform,
                Source = vm.Source,
                Documentation = vm.Documentation,
                AssemblyNameList = vm.AssemblyNameList,
                NamespaceName = vm.NamespaceName,
                Remarks = vm.Remarks,
                Examples = vm.Examples,
                Overridden = vm.Overridden,
                SeeAlsos = vm.SeeAlsos?.Select(s => ApiCrefInfoBuildOutput.FromModel(s)).ToList(),
                Sees = vm.Sees?.Select(s => ApiCrefInfoBuildOutput.FromModel(s)).ToList(),
                Inheritance = vm.Inheritance?.Select(i => FromUid(i)).ToList(),
                Implements = vm.Implements,
                InheritedMembers = vm.InheritedMembers,
                Modifiers = vm.Modifiers,
                Conceptual = vm.Conceptual,
                Metadata = vm.Metadata,
                Syntax = ApiSyntaxBuildOutput.FromModel(vm.Syntax, vm.SupportedLanguages),
                Exceptions = vm.Exceptions?.Select(s => ApiCrefInfoBuildOutput.FromModel(s)).ToList(),
            });
        }
Esempio n. 3
0
        public static ApiReferenceBuildOutput FromModel(ReferenceViewModel vm, string[] supportedLanguages)
        {
            if (vm == null)
            {
                return(null);
            }

            return(new ApiReferenceBuildOutput
            {
                Uid = vm.Uid,
                Id = XrefDetails.GetHtmlId(vm.Uid),
                Parent = vm.Parent,
                Definition = vm.Definition,
                IsExternal = vm.IsExternal,
                Href = vm.Href,
                Name = ApiBuildOutputUtility.TransformToLanguagePairList(vm.Name, vm.NameInDevLangs, supportedLanguages),
                FullName = ApiBuildOutputUtility.TransformToLanguagePairList(vm.FullName, vm.FullNameInDevLangs, supportedLanguages),
                Spec = GetSpecNames(ApiBuildOutputUtility.GetXref(vm.Uid, vm.FullName, vm.Name), supportedLanguages, vm.Specs),
                Type = vm.Type,
                Summary = vm.Summary,
                Platform = vm.Platform,
                Syntax = ApiSyntaxBuildOutput.FromModel(vm.Syntax, supportedLanguages),
            });
        }