Microsoft.DocAsCode.Build.ManagedReference.BuildOutputs.ApiReferenceBuildOutput.GetSpecNames C# (CSharp) Method

GetSpecNames() public static method

public static GetSpecNames ( string xref, string supportedLanguages, SortedList specs = null ) : List
xref string
supportedLanguages string
specs SortedList
return List
        public static List<ApiLanguageValuePair> GetSpecNames(string xref, string[] supportedLanguages, SortedList<string, List<SpecViewModel>> specs = null)
        {
            if (specs != null && specs.Count > 0)
            {
                return specs.Where(kv => supportedLanguages.Contains(kv.Key)).Select(kv => new ApiLanguageValuePair() { Language = kv.Key, Value = GetSpecName(kv.Value) }).ToList();
            }
            if (!string.IsNullOrEmpty(xref))
            {
                return supportedLanguages.Select(s => new ApiLanguageValuePair() { Language = s, Value = xref }).ToList();
            }
            return null;
        }

Usage Example

Example #1
0
 public static List <ApiLanguageValuePair> GetSpec(string key, Dictionary <string, ApiReferenceBuildOutput> references, string[] supportedLanguages)
 {
     if (string.IsNullOrEmpty(key))
     {
         return(null);
     }
     if (!references.TryGetValue(key, out ApiReferenceBuildOutput reference))
     {
         return(ApiReferenceBuildOutput.GetSpecNames(GetXref(key), supportedLanguages));
     }
     else
     {
         return(reference.Spec);
     }
 }
All Usage Examples Of Microsoft.DocAsCode.Build.ManagedReference.BuildOutputs.ApiReferenceBuildOutput::GetSpecNames