Skip to content

Commit 82667df

Browse files
committed
update aboutbox for better readability of the json
1 parent 3dc40db commit 82667df

2 files changed

Lines changed: 21 additions & 34 deletions

File tree

src/LogExpert.UI/Dialogs/AboutBox.Designer.cs

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/LogExpert.UI/Dialogs/AboutBox.cs

Lines changed: 18 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ public AboutBox ()
2424
InitializeComponent();
2525

2626
LoadResources();
27-
27+
usedComponentsDataGrid.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
2828
_assembly = Assembly.GetExecutingAssembly();
2929

3030
Text = $@"About {AssemblyTitle}";
3131
labelProductName.Text = AssemblyProduct;
3232
labelVersion.Text = AssemblyVersion;
3333
labelCopyright.Text = AssemblyCopyright;
3434
var link = "https://github.com/LogExperts/LogExpert";
35-
linkLabelURL.Links.Add(new LinkLabel.Link(0, link.Length, link));
35+
_ = linkLabelURL.Links.Add(new LinkLabel.Link(0, link.Length, link));
3636
LoadUsedComponents();
3737
}
3838

@@ -44,6 +44,7 @@ private void LoadUsedComponents ()
4444
var usedComponents = JsonConvert.DeserializeObject<UsedComponents[]>(json);
4545
usedComponents = usedComponents?.OrderBy(x => x.PackageId).ToArray();
4646
usedComponentsDataGrid.DataSource = usedComponents;
47+
4748
}
4849

4950

@@ -64,7 +65,7 @@ public string AssemblyTitle
6465
if (attributes.Length > 0)
6566
{
6667
var titleAttribute = (AssemblyTitleAttribute)attributes[0];
67-
if (titleAttribute.Title != string.Empty)
68+
if (!string.IsNullOrEmpty(titleAttribute.Title))
6869
{
6970
return titleAttribute.Title;
7071
}
@@ -77,20 +78,11 @@ public string AssemblyVersion
7778
{
7879
get
7980
{
80-
AssemblyName assembly = _assembly.GetName();
81-
82-
if (assembly.Version != null)
83-
{
84-
var version = $"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}.{assembly.Version.Revision}";
85-
if (assembly.Version.Revision >= 9000)
86-
{
87-
version += " Testrelease";
88-
}
89-
90-
return version;
91-
}
81+
var assembly = _assembly.GetName();
9282

93-
return "0.0.0.0";
83+
return assembly.Version != null
84+
? $"{assembly.Version.Major}.{assembly.Version.Minor}.{assembly.Version.Build}.{assembly.Version.Revision}"
85+
: "0.0.0.0";
9486
}
9587

9688
}
@@ -101,11 +93,9 @@ public string AssemblyDescription
10193
{
10294
var attributes = _assembly.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
10395

104-
if (attributes.Length == 0)
105-
{
106-
return string.Empty;
107-
}
108-
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
96+
return attributes.Length == 0
97+
? string.Empty
98+
: ((AssemblyDescriptionAttribute)attributes[0]).Description;
10999
}
110100
}
111101

@@ -114,11 +104,9 @@ public string AssemblyProduct
114104
get
115105
{
116106
var attributes = _assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);
117-
if (attributes.Length == 0)
118-
{
119-
return string.Empty;
120-
}
121-
return ((AssemblyProductAttribute)attributes[0]).Product;
107+
return attributes.Length == 0
108+
? string.Empty
109+
: ((AssemblyProductAttribute)attributes[0]).Product;
122110
}
123111
}
124112

@@ -127,11 +115,9 @@ public string AssemblyCopyright
127115
get
128116
{
129117
var attributes = _assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
130-
if (attributes.Length == 0)
131-
{
132-
return string.Empty;
133-
}
134-
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
118+
return attributes.Length == 0
119+
? string.Empty
120+
: ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
135121
}
136122
}
137123

@@ -148,7 +134,7 @@ private void OnLinkLabelURLClicked (object sender, LinkLabelLinkClickedEventArgs
148134
target = e.Link.LinkData as string;
149135
}
150136

151-
Process.Start(new ProcessStartInfo
137+
_ = Process.Start(new ProcessStartInfo
152138
{
153139
UseShellExecute = true,
154140
FileName = target,

0 commit comments

Comments
 (0)