GetReferenceViewModel() 공개 정적인 메소드

public static GetReferenceViewModel ( string key, ApiReferenceBuildOutput>.Dictionary references, string supportedLanguages ) : ApiReferenceBuildOutput
key string
references ApiReferenceBuildOutput>.Dictionary
supportedLanguages string
리턴 ApiReferenceBuildOutput
예제 #1
0
 public void Expand(Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
 {
     if (_needExpand)
     {
         _needExpand = false;
         Type        = ApiBuildOutputUtility.GetReferenceViewModel(Type?.Uid, references, supportedLanguages);
     }
 }
예제 #2
0
 public void Expand(Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
 {
     if (!_isExpanded)
     {
         Type        = ApiBuildOutputUtility.GetReferenceViewModel(Type?.Uid, references, supportedLanguages);
         _isExpanded = true;
     }
 }
예제 #3
0
 public void Expand(Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
 {
     if (!_isExpanded)
     {
         Inheritance = Inheritance?.Select(i => ApiBuildOutputUtility.GetReferenceViewModel(i.Uid, references, supportedLanguages)).ToList();
         Syntax?.Expand(references, supportedLanguages);
         SeeAlsos?.ForEach(e => e.Expand(references, supportedLanguages));
         Sees?.ForEach(e => e.Expand(references, supportedLanguages));
         Exceptions?.ForEach(e => e.Expand(references, supportedLanguages));
         _isExpanded = true;
     }
 }
예제 #4
0
 public void Expand(Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
 {
     if (_needExpand)
     {
         _needExpand = false;
         Inheritance = Inheritance?.Select(i => ApiBuildOutputUtility.GetReferenceViewModel(i.Uid, references, supportedLanguages)).ToList();
         Implements  = Implements?.Select(i => ApiBuildOutputUtility.GetApiNames(i.Uid, references, supportedLanguages)).ToList();
         Syntax?.Expand(references, supportedLanguages);
         Overridden = ApiBuildOutputUtility.GetApiNames(Overridden?.Uid, references, supportedLanguages);
         SeeAlsos?.ForEach(e => e.Expand(references, supportedLanguages));
         Sees?.ForEach(e => e.Expand(references, supportedLanguages));
         Exceptions?.ForEach(e => e.Expand(references, supportedLanguages));
     }
 }
예제 #5
0
 private static List <ApiReferenceBuildOutput> GetReferenceList(List <string> uids,
                                                                Dictionary <string, ApiReferenceBuildOutput> references,
                                                                string[] supportedLanguages,
                                                                bool extractIndex = false)
 {
     if (extractIndex)
     {
         return(uids?.Select((u, i) => ApiBuildOutputUtility.GetReferenceViewModel(u, references, supportedLanguages, i)).ToList());
     }
     else
     {
         return(uids?.Select(u => ApiBuildOutputUtility.GetReferenceViewModel(u, references, supportedLanguages)).ToList());
     }
 }
예제 #6
0
        public static ApiCrefInfoBuildOutput FromModel(CrefInfo model, Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
        {
            if (model == null)
            {
                return(null);
            }

            return(new ApiCrefInfoBuildOutput
            {
                Type = ApiBuildOutputUtility.GetReferenceViewModel(model.Type, references, supportedLanguages),
                Description = model.Description,
                _isExpanded = true,
            });
        }
예제 #7
0
        public static ApiParameterBuildOutput FromModel(ApiParameter model, Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
        {
            if (model == null)
            {
                return(null);
            }

            return(new ApiParameterBuildOutput
            {
                Name = model.Name,
                Type = ApiBuildOutputUtility.GetReferenceViewModel(model.Type, references, supportedLanguages),
                Description = model.Description,
            });
        }
예제 #8
0
        private static ApiBuildOutput FromModel(ItemViewModel model, Dictionary <string, ApiReferenceBuildOutput> references, Dictionary <string, object> metadata)
        {
            if (model == null)
            {
                return(null);
            }

            var output = new ApiBuildOutput
            {
                Uid = model.Uid,
                Id  = Utility.GetHtmlId(model.Uid),
                IsExplicitInterfaceImplementation = model.IsExplicitInterfaceImplementation,
                IsExtensionMethod = model.IsExtensionMethod,
                Parent            = ApiBuildOutputUtility.GetReferenceViewModel(model.Parent, references, model.SupportedLanguages),
                Children          = GetReferenceList(model.Children, references, model.SupportedLanguages),
                Href = model.Href,
                SupportedLanguages = model.SupportedLanguages,
                Name             = ApiBuildOutputUtility.TransformToLanguagePairList(model.Name, model.Names, model.SupportedLanguages),
                NameWithType     = ApiBuildOutputUtility.TransformToLanguagePairList(model.NameWithType, model.NamesWithType, model.SupportedLanguages),
                FullName         = ApiBuildOutputUtility.TransformToLanguagePairList(model.FullName, model.FullNames, model.SupportedLanguages),
                Type             = model.Type,
                Source           = model.Source,
                Documentation    = model.Documentation,
                AssemblyNameList = model.AssemblyNameList,
                NamespaceName    = ApiBuildOutputUtility.GetReferenceViewModel(model.NamespaceName, references, model.SupportedLanguages),
                Summary          = model.Summary,
                Remarks          = model.Remarks,
                Examples         = model.Examples,
                Syntax           = ApiSyntaxBuildOutput.FromModel(model.Syntax, references, model.SupportedLanguages),
                Overridden       = ApiBuildOutputUtility.GetApiNames(model.Overridden, references, model.SupportedLanguages),
                Overload         = ApiBuildOutputUtility.GetApiNames(model.Overload, references, model.SupportedLanguages),
                Exceptions       = GetCrefInfoList(model.Exceptions, references, model.SupportedLanguages),
                SeeAlsos         = GetLinkInfoList(model.SeeAlsos, references, model.SupportedLanguages),
                Sees             = GetLinkInfoList(model.Sees, references, model.SupportedLanguages),
                Inheritance      = GetReferenceList(model.Inheritance, references, model.SupportedLanguages, true),
                Implements       = model.Implements?.Select(u => ApiBuildOutputUtility.GetApiNames(u, references, model.SupportedLanguages)).ToList(),
                InheritedMembers = GetReferenceList(model.InheritedMembers, references, model.SupportedLanguages),
                ExtensionMethods = GetReferenceList(model.ExtensionMethods, references, model.SupportedLanguages),
                Conceptual       = model.Conceptual,
                Platform         = model.Platform,
                Attributes       = model.Attributes,
                Metadata         = metadata.Concat(model.Metadata.Where(p => !metadata.Keys.Contains(p.Key))).ToDictionary(p => p.Key, p => p.Value),
            };

            output.DerivedClasses = GetReferenceList(model.DerivedClasses, references, model.SupportedLanguages, true, output.Level + 1);
            return(output);
        }
예제 #9
0
        private static ApiBuildOutput FromModel(ItemViewModel model, Dictionary <string, ApiReferenceBuildOutput> references, Dictionary <string, object> metadata)
        {
            if (model == null)
            {
                return(null);
            }

            return(new ApiBuildOutput
            {
                Uid = model.Uid,
                Id = Utility.GetHtmlId(model.Uid),
                Parent = ApiBuildOutputUtility.GetReferenceViewModel(model.Parent, references, model.SupportedLanguages),
                Children = GetReferenceList(model.Children, references, model.SupportedLanguages),
                Href = model.Href,
                SupportedLanguages = model.SupportedLanguages,
                Name = ApiBuildOutputUtility.TransformToLanguagePairList(model.Name, model.Names, model.SupportedLanguages),
                FullName = ApiBuildOutputUtility.TransformToLanguagePairList(model.FullName, model.FullNames, model.SupportedLanguages),
                Type = model.Type,
                Source = model.Source,
                Documentation = model.Documentation,
                AssemblyNameList = model.AssemblyNameList,
                NamespaceName = ApiBuildOutputUtility.GetReferenceViewModel(model.NamespaceName, references, model.SupportedLanguages),
                Summary = model.Summary,
                Remarks = model.Remarks,
                Examples = model.Examples,
                Syntax = ApiSyntaxBuildOutput.FromModel(model.Syntax, references, model.SupportedLanguages),
                Overridden = ApiBuildOutputUtility.GetReferenceViewModel(model.Overridden, references, model.SupportedLanguages),
                Exceptions = GetCrefInfoList(model.Exceptions, references, model.SupportedLanguages),
                SeeAlsos = GetCrefInfoList(model.SeeAlsos, references, model.SupportedLanguages),
                Sees = GetCrefInfoList(model.Sees, references, model.SupportedLanguages),
                Inheritance = GetReferenceList(model.Inheritance, references, model.SupportedLanguages, true),
                Implements = GetReferenceList(model.Implements, references, model.SupportedLanguages),
                InheritedMembers = GetReferenceList(model.InheritedMembers, references, model.SupportedLanguages),
                Conceptual = model.Conceptual,
                Platform = model.Platform,
                Metadata = metadata.Concat(model.Metadata.Where(p => !metadata.Keys.Contains(p.Key))).ToDictionary(p => p.Key, p => p.Value),
            });
        }