Skip to content

Commit 4115677

Browse files
authored
Merge pull request #30 from Mijo-Software/mjohne-patch-1
Add files via upload
2 parents 17947a1 + 4de66ee commit 4115677

File tree

7 files changed

+136
-104
lines changed

7 files changed

+136
-104
lines changed

DisksizeWatcher/AboutBoxForm.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ private void SetStatusbarText(string text)
2222
labelInformation.Text = text;
2323
}
2424

25+
/// <summary>
26+
/// Constructor
27+
/// </summary>
2528
public AboutBoxForm()
2629
{
2730
InitializeComponent();

DisksizeWatcher/App.config

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
55
<section name="DisksizeWatcher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
66
</sectionGroup>
7+
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
8+
<section name="DisksizeWatcher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
9+
</sectionGroup>
710
</configSections>
811
<startup>
912
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" />
1013
</startup>
1114
<userSettings>
1215
<DisksizeWatcher.Properties.Settings>
13-
<setting name="StayOnTop" serializeAs="String">
16+
<setting name="StayOnTopUser" serializeAs="String">
17+
<value>False</value>
18+
</setting>
19+
<setting name="MinimizeToTrayUser" serializeAs="String">
1420
<value>False</value>
1521
</setting>
1622
</DisksizeWatcher.Properties.Settings>
@@ -23,4 +29,14 @@
2329
</dependentAssembly>
2430
</assemblyBinding>
2531
</runtime>
32+
<applicationSettings>
33+
<DisksizeWatcher.Properties.Settings>
34+
<setting name="StayOnTopDefault" serializeAs="String">
35+
<value>False</value>
36+
</setting>
37+
<setting name="MinimizeToTrayDefault" serializeAs="String">
38+
<value>False</value>
39+
</setting>
40+
</DisksizeWatcher.Properties.Settings>
41+
</applicationSettings>
2642
</configuration>

DisksizeWatcher/DisksizeWatcher.csproj

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</NuGetPackageImportStamp>
1717
<TargetFrameworkProfile />
1818
<IsWebBootstrapper>false</IsWebBootstrapper>
19-
<PublishUrl>publish\</PublishUrl>
19+
<PublishUrl>C:\Program Files\Disksize Watcher\</PublishUrl>
2020
<Install>true</Install>
2121
<InstallFrom>Disk</InstallFrom>
2222
<UpdateEnabled>false</UpdateEnabled>
@@ -26,9 +26,12 @@
2626
<UpdatePeriodically>false</UpdatePeriodically>
2727
<UpdateRequired>false</UpdateRequired>
2828
<MapFileExtensions>true</MapFileExtensions>
29-
<ApplicationRevision>0</ApplicationRevision>
30-
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
29+
<ProductName>Disksize Watcher</ProductName>
30+
<PublisherName>Mijo Software</PublisherName>
31+
<ApplicationRevision>10</ApplicationRevision>
32+
<ApplicationVersion>0.5.1.%2a</ApplicationVersion>
3133
<UseApplicationTrust>false</UseApplicationTrust>
34+
<PublishWizardCompleted>true</PublishWizardCompleted>
3235
<BootstrapperEnabled>true</BootstrapperEnabled>
3336
</PropertyGroup>
3437
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
@@ -104,6 +107,18 @@
104107
<ErrorReport>prompt</ErrorReport>
105108
<Prefer32Bit>true</Prefer32Bit>
106109
</PropertyGroup>
110+
<PropertyGroup>
111+
<ManifestCertificateThumbprint>DBC77668A257E90F13D4500321410F0C4FCE74EF</ManifestCertificateThumbprint>
112+
</PropertyGroup>
113+
<PropertyGroup>
114+
<ManifestKeyFile>DisksizeWatcher_TemporaryKey.pfx</ManifestKeyFile>
115+
</PropertyGroup>
116+
<PropertyGroup>
117+
<GenerateManifests>true</GenerateManifests>
118+
</PropertyGroup>
119+
<PropertyGroup>
120+
<SignManifests>true</SignManifests>
121+
</PropertyGroup>
107122
<ItemGroup>
108123
<Reference Include="System" />
109124
<Reference Include="System.ComponentModel.Composition" />
@@ -161,6 +176,7 @@
161176
<EmbeddedResource Include="SettingsForm.resx">
162177
<DependentUpon>SettingsForm.cs</DependentUpon>
163178
</EmbeddedResource>
179+
<None Include="DisksizeWatcher_TemporaryKey.pfx" />
164180
<None Include="Properties\Settings.settings">
165181
<Generator>SettingsSingleFileGenerator</Generator>
166182
<LastGenOutput>Settings.Designer.cs</LastGenOutput>

DisksizeWatcher/DisksizeWatcher.csproj.user

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<PropertyGroup>
4-
<PublishUrlHistory>publish\</PublishUrlHistory>
4+
<PublishUrlHistory>C:\Program Files\Disksize Watcher\|https://mijo-software.de/programme/system/disksize-watcher/|publish\</PublishUrlHistory>
55
<InstallUrlHistory />
66
<SupportUrlHistory />
77
<UpdateUrlHistory />
88
<BootstrapperUrlHistory />
9-
<ErrorReportUrlHistory />
9+
<ErrorReportUrlHistory>https://mijo-software.de/</ErrorReportUrlHistory>
1010
<FallbackCulture>de-DE</FallbackCulture>
1111
<VerifyUploadedFiles>false</VerifyUploadedFiles>
1212
</PropertyGroup>

DisksizeWatcher/MainForm.cs

Lines changed: 52 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -151,38 +151,43 @@ private void SetUpNumberWithFraction()
151151
{
152152
numberFormat = Resources.numberformatN6;
153153
}
154+
return;
154155
}
155-
else
156+
if (toolStripMenuItemDecimalSeparatorTo0.Checked)
156157
{
157-
if (toolStripMenuItemDecimalSeparatorTo0.Checked)
158-
{
159-
numberFormat = Resources.numberformatF0;
160-
}
161-
else if (toolStripMenuItemDecimalSeparatorTo1.Checked)
162-
{
163-
numberFormat = Resources.numberformatF1;
164-
}
165-
else if (toolStripMenuItemDecimalSeparatorTo2.Checked)
166-
{
167-
numberFormat = Resources.numberformatF2;
168-
}
169-
else if (toolStripMenuItemDecimalSeparatorTo3.Checked)
170-
{
171-
numberFormat = Resources.numberformatF3;
172-
}
173-
else if (toolStripMenuItemDecimalSeparatorTo4.Checked)
174-
{
175-
numberFormat = Resources.numberformatF4;
176-
}
177-
else if (toolStripMenuItemDecimalSeparatorTo5.Checked)
178-
{
179-
numberFormat = Resources.numberformatF5;
180-
}
181-
else if (toolStripMenuItemDecimalSeparatorTo6.Checked)
182-
{
183-
numberFormat = Resources.numberformatF6;
184-
}
158+
numberFormat = Resources.numberformatF0;
159+
return;
160+
}
161+
if (toolStripMenuItemDecimalSeparatorTo1.Checked)
162+
{
163+
numberFormat = Resources.numberformatF1;
164+
return;
185165
}
166+
if (toolStripMenuItemDecimalSeparatorTo2.Checked)
167+
{
168+
numberFormat = Resources.numberformatF2;
169+
return;
170+
}
171+
if (toolStripMenuItemDecimalSeparatorTo3.Checked)
172+
{
173+
numberFormat = Resources.numberformatF3;
174+
return;
175+
}
176+
if (toolStripMenuItemDecimalSeparatorTo4.Checked)
177+
{
178+
numberFormat = Resources.numberformatF4;
179+
return;
180+
}
181+
if (toolStripMenuItemDecimalSeparatorTo5.Checked)
182+
{
183+
numberFormat = Resources.numberformatF5;
184+
return;
185+
}
186+
if (!toolStripMenuItemDecimalSeparatorTo6.Checked)
187+
{
188+
return;
189+
}
190+
numberFormat = Resources.numberformatF6;
186191
}
187192

188193
/// <summary>
@@ -215,77 +220,32 @@ private void UpdateSpaceInfo()
215220
{
216221
case (int)SizeUnit.Kilobyte:
217222
usedSpace /= 1024;
218-
break;
219-
case (int)SizeUnit.Megabyte:
220-
usedSpace = usedSpace / 1024 / 1024;
221-
break;
222-
case (int)SizeUnit.Gigabyte:
223-
usedSpace = usedSpace / 1024 / 1024 / 1024;
224-
break;
225-
case (int)SizeUnit.Terabyte:
226-
usedSpace = usedSpace / 1024 / 1024 / 1024 / 1024;
227-
break;
228-
case (int)SizeUnit.Pentabyte:
229-
usedSpace = usedSpace / 1024 / 1024 / 1024 / 1024 / 1024;
230-
break;
231-
default:
232-
break;
233-
}
234-
switch (unitSpace)
235-
{
236-
case (int)SizeUnit.Kilobyte:
223+
totalSpace /= 1024;
237224
freeSpace /= 1024;
225+
diffSpace /= 1024;
238226
break;
239227
case (int)SizeUnit.Megabyte:
228+
usedSpace = usedSpace / 1024 / 1024;
240229
freeSpace = freeSpace / 1024 / 1024;
241-
break;
242-
case (int)SizeUnit.Gigabyte:
243-
freeSpace = freeSpace / 1024 / 1024 / 1024;
244-
break;
245-
case (int)SizeUnit.Terabyte:
246-
freeSpace = freeSpace / 1024 / 1024 / 1024 / 1024;
247-
break;
248-
case (int)SizeUnit.Pentabyte:
249-
freeSpace = freeSpace / 1024 / 1024 / 1024 / 1024 / 1024;
250-
break;
251-
default:
252-
break;
253-
}
254-
switch (unitSpace)
255-
{
256-
case (int)SizeUnit.Kilobyte:
257-
totalSpace /= 1024;
258-
break;
259-
case (int)SizeUnit.Megabyte:
260230
totalSpace = totalSpace / 1024 / 1024;
261-
break;
262-
case (int)SizeUnit.Gigabyte:
263-
totalSpace = totalSpace / 1024 / 1024 / 1024;
264-
break;
265-
case (int)SizeUnit.Terabyte:
266-
totalSpace = totalSpace / 1024 / 1024 / 1024 / 1024;
267-
break;
268-
case (int)SizeUnit.Pentabyte:
269-
totalSpace = totalSpace / 1024 / 1024 / 1024 / 1024 / 1024;
270-
break;
271-
default:
272-
break;
273-
}
274-
switch (unitSpace)
275-
{
276-
case (int)SizeUnit.Kilobyte:
277-
diffSpace /= 1024;
278-
break;
279-
case (int)SizeUnit.Megabyte:
280231
diffSpace = diffSpace / 1024 / 1024;
281232
break;
282233
case (int)SizeUnit.Gigabyte:
234+
usedSpace = usedSpace / 1024 / 1024 / 1024;
235+
freeSpace = freeSpace / 1024 / 1024 / 1024;
236+
totalSpace = totalSpace / 1024 / 1024 / 1024;
283237
diffSpace = diffSpace / 1024 / 1024 / 1024;
284238
break;
285239
case (int)SizeUnit.Terabyte:
240+
usedSpace = usedSpace / 1024 / 1024 / 1024 / 1024;
241+
freeSpace = freeSpace / 1024 / 1024 / 1024 / 1024;
242+
totalSpace = totalSpace / 1024 / 1024 / 1024 / 1024;
286243
diffSpace = diffSpace / 1024 / 1024 / 1024 / 1024;
287244
break;
288245
case (int)SizeUnit.Pentabyte:
246+
usedSpace = usedSpace / 1024 / 1024 / 1024 / 1024 / 1024;
247+
freeSpace = freeSpace / 1024 / 1024 / 1024 / 1024 / 1024;
248+
totalSpace = totalSpace / 1024 / 1024 / 1024 / 1024 / 1024;
289249
diffSpace = diffSpace / 1024 / 1024 / 1024 / 1024 / 1024;
290250
break;
291251
default:
@@ -295,7 +255,7 @@ private void UpdateSpaceInfo()
295255
usedSpacePerc = 100 - freeSpacePerc;
296256
progressBarPercentage.Value = (int)usedSpacePerc;
297257
numberFormat = Resources.numberformatG6;
298-
labelSpacePercentageValue.Text = $"{usedSpacePerc.ToString(format: numberFormat, provider: CultureInfo.InvariantCulture)} %";
258+
labelSpacePercentageValue.Text = $"{usedSpacePerc.ToString(format: numberFormat, provider: CultureInfo.CurrentCulture)} %";
299259
numberFormat = string.Empty;
300260
if (HasFraction(number: usedSpace))
301261
{
@@ -305,7 +265,7 @@ private void UpdateSpaceInfo()
305265
{
306266
SetUpNumberWithoutFraction();
307267
}
308-
textBoxSpaceUsed.Text = usedSpace.ToString(format: numberFormat, provider: CultureInfo.InvariantCulture);
268+
textBoxSpaceUsed.Text = usedSpace.ToString(format: numberFormat, provider: CultureInfo.CurrentCulture);
309269
numberFormat = string.Empty;
310270
if (HasFraction(number: freeSpace))
311271
{
@@ -315,7 +275,7 @@ private void UpdateSpaceInfo()
315275
{
316276
SetUpNumberWithoutFraction();
317277
}
318-
textBoxSpaceFree.Text = freeSpace.ToString(format: numberFormat, provider: CultureInfo.InvariantCulture);
278+
textBoxSpaceFree.Text = freeSpace.ToString(format: numberFormat, provider: CultureInfo.CurrentCulture);
319279
numberFormat = string.Empty;
320280
if (HasFraction(number: totalSpace))
321281
{
@@ -325,9 +285,7 @@ private void UpdateSpaceInfo()
325285
{
326286
SetUpNumberWithoutFraction();
327287
}
328-
textBoxSpaceTotal.Text = totalSpace.ToString(
329-
format: numberFormat,
330-
provider: CultureInfo.InvariantCulture);
288+
textBoxSpaceTotal.Text = totalSpace.ToString(format: numberFormat, provider: CultureInfo.CurrentCulture);
331289
numberFormat = string.Empty;
332290
if (HasFraction(number: diffSpace))
333291
{
@@ -359,7 +317,7 @@ private void UpdateSpaceInfo()
359317
break;
360318
}
361319
textBoxSpaceDiff.Text = Math.Abs(diffSpace - usedSpace)
362-
.ToString(format: numberFormat, provider: CultureInfo.InvariantCulture);
320+
.ToString(format: numberFormat, provider: CultureInfo.CurrentCulture);
363321
}
364322
}
365323
#endregion
@@ -386,7 +344,7 @@ private void MainForm_Load(object sender, EventArgs e)
386344
notifyIcon.Visible = false;
387345
if (drive.IsReady)
388346
{
389-
textBoxSpaceTotal.Text = drive.TotalSize.ToString(provider: CultureInfo.InvariantCulture);
347+
textBoxSpaceTotal.Text = drive.TotalSize.ToString(provider: CultureInfo.CurrentCulture);
390348
fileSystemWatcher.Path = drive.Name;
391349
}
392350
}

DisksizeWatcher/Properties/Settings.Designer.cs

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

DisksizeWatcher/Properties/Settings.settings

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="DisksizeWatcher.Properties" GeneratedClassName="Settings">
33
<Profiles />
44
<Settings>
5-
<Setting Name="StayOnTop" Type="System.Boolean" Scope="User">
5+
<Setting Name="StayOnTopUser" Type="System.Boolean" Scope="User">
6+
<Value Profile="(Default)">False</Value>
7+
</Setting>
8+
<Setting Name="StayOnTopDefault" Type="System.Boolean" Scope="Application">
9+
<Value Profile="(Default)">False</Value>
10+
</Setting>
11+
<Setting Name="MinimizeToTrayUser" Type="System.Boolean" Scope="User">
12+
<Value Profile="(Default)">False</Value>
13+
</Setting>
14+
<Setting Name="MinimizeToTrayDefault" Type="System.Boolean" Scope="Application">
615
<Value Profile="(Default)">False</Value>
716
</Setting>
817
</Settings>

0 commit comments

Comments
 (0)