Skip to content

Commit

Permalink
Merge 4d4de13 into ddbcdae
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih authored Dec 14, 2023
2 parents ddbcdae + 4d4de13 commit 4602f28
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 46 deletions.
9 changes: 0 additions & 9 deletions src/Docfx.Build/TableOfContents/TocDocumentProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,6 @@ private static void ResolveUid(TocItemViewModel item, FileModel model, IDocument
{
item.Name = xref.Name;
}

if (string.IsNullOrEmpty(item.NameForCSharp) && xref.TryGetXrefStringValue("name.csharp", out var nameForCSharp))
{
item.NameForCSharp = nameForCSharp;
}
if (string.IsNullOrEmpty(item.NameForVB) && xref.TryGetXrefStringValue("name.vb", out var nameForVB))
{
item.NameForVB = nameForVB;
}
}
}
}
Expand Down
38 changes: 1 addition & 37 deletions src/Docfx.DataContracts.Common/TocItemViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,6 @@ public class TocItemViewModel
[JsonPropertyName(Constants.PropertyName.DisplayName)]
public string DisplayName { get; set; }

[ExtensibleMember(Constants.ExtensionMemberPrefix.Name)]
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public SortedList<string, string> NameInDevLangs { get; } = new SortedList<string, string>();

[YamlIgnore]
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string NameForCSharp
{
get
{
NameInDevLangs.TryGetValue(Constants.DevLang.CSharp, out string result);
return result;
}
set { NameInDevLangs[Constants.DevLang.CSharp] = value; }
}

[YamlIgnore]
[Newtonsoft.Json.JsonIgnore]
[System.Text.Json.Serialization.JsonIgnore]
public string NameForVB
{
get
{
NameInDevLangs.TryGetValue(Constants.DevLang.VB, out string result);
return result;
}
set { NameInDevLangs[Constants.DevLang.VB] = value; }
}

[YamlMember(Alias = Constants.PropertyName.Href)]
[JsonProperty(Constants.PropertyName.Href)]
[JsonPropertyName(Constants.PropertyName.Href)]
Expand Down Expand Up @@ -147,12 +116,7 @@ public string NameForVB
[YamlIgnore]
[Newtonsoft.Json.JsonExtensionData]
[System.Text.Json.Serialization.JsonExtensionData]
public CompositeDictionary MetadataJson =>
CompositeDictionary
.CreateBuilder()
.Add(Constants.ExtensionMemberPrefix.Name, NameInDevLangs, JTokenConverter.Convert<string>)
.Add(string.Empty, Metadata)
.Create();
public CompositeDictionary MetadataJson => CompositeDictionary.CreateBuilder().Add(string.Empty, Metadata).Create();

public TocItemViewModel Clone()
{
Expand Down

0 comments on commit 4602f28

Please sign in to comment.