mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 22:23:29 -07:00
commit
98e7f0dc47
6 changed files with 43 additions and 23 deletions
|
@ -66,7 +66,7 @@
|
||||||
<PackageReference Include="Newtonsoft.Json">
|
<PackageReference Include="Newtonsoft.Json">
|
||||||
<Version>12.0.2</Version>
|
<Version>12.0.2</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" />
|
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1608" />
|
||||||
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.32" />
|
<PackageReference Include="Uno.UniversalImageLoader" Version="1.9.32" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
|
||||||
|
|
|
@ -252,28 +252,44 @@ namespace CalculatorApp
|
||||||
|
|
||||||
ApplicationDataContainer GetHistoryContainer(CalculationManager.CALCULATOR_MODE cMode)
|
ApplicationDataContainer GetHistoryContainer(CalculationManager.CALCULATOR_MODE cMode)
|
||||||
{
|
{
|
||||||
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
// TODO UNO
|
||||||
ApplicationDataContainer historyContainer;
|
//ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
||||||
|
//ApplicationDataContainer historyContainer;
|
||||||
|
|
||||||
// naming container based on mode
|
//// naming container based on mode
|
||||||
string historyContainerKey = GetHistoryContainerKey(cMode);
|
//string historyContainerKey = GetHistoryContainerKey(cMode);
|
||||||
|
|
||||||
if (localSettings.Containers.ContainsKey(historyContainerKey))
|
//if (localSettings.Containers.ContainsKey(historyContainerKey))
|
||||||
{
|
//{
|
||||||
historyContainer = localSettings.Containers[historyContainerKey];
|
// historyContainer = localSettings.Containers[historyContainerKey];
|
||||||
}
|
//}
|
||||||
else
|
//else
|
||||||
{
|
//{
|
||||||
// create container for adding data
|
// // create container for adding data
|
||||||
historyContainer = localSettings.CreateContainer(historyContainerKey, ApplicationDataCreateDisposition.Always);
|
// historyContainer = localSettings.CreateContainer(historyContainerKey, ApplicationDataCreateDisposition.Always);
|
||||||
int initialHistoryVectorLength = 0;
|
// int initialHistoryVectorLength = 0;
|
||||||
historyContainer.Values.Add(HistoryVectorLengthKey, initialHistoryVectorLength);
|
// historyContainer.Values.Add(HistoryVectorLengthKey, initialHistoryVectorLength);
|
||||||
}
|
//}
|
||||||
|
|
||||||
return historyContainer;
|
//return historyContainer;
|
||||||
}
|
|
||||||
|
|
||||||
void ClearHistoryContainer(CalculationManager.CALCULATOR_MODE cMode)
|
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
||||||
|
ApplicationDataContainer historyContainer = localSettings;
|
||||||
|
|
||||||
|
// naming container based on mode
|
||||||
|
string historyContainerKey = GetHistoryContainerKey(cMode);
|
||||||
|
|
||||||
|
if (!historyContainer.Values.ContainsKey(HistoryVectorLengthKey))
|
||||||
|
{
|
||||||
|
int initialHistoryVectorLength = 0;
|
||||||
|
historyContainer.Values.Add(HistoryVectorLengthKey, initialHistoryVectorLength);
|
||||||
|
}
|
||||||
|
|
||||||
|
return historyContainer;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ClearHistoryContainer(CalculationManager.CALCULATOR_MODE cMode)
|
||||||
{
|
{
|
||||||
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
|
||||||
localSettings.DeleteContainer(GetHistoryContainerKey(cMode));
|
localSettings.DeleteContainer(GetHistoryContainerKey(cMode));
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
<Version>4.3.1</Version>
|
<Version>4.3.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Uno.UI">
|
<PackageReference Include="Uno.UI">
|
||||||
<Version>1.45.0-dev.1595</Version>
|
<Version>1.45.0-dev.1608</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
|
||||||
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" />
|
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1608" />
|
||||||
<PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.281" />
|
<PackageReference Include="Uno.Wasm.Bootstrap" Version="1.0.0-dev.281" />
|
||||||
<DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.276" />
|
<DotNetCliToolReference Include="Uno.Wasm.Bootstrap.Cli" Version="1.0.0-dev.276" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -3,6 +3,7 @@ using Microsoft.Extensions.Logging;
|
||||||
using System;
|
using System;
|
||||||
using Uno.Extensions;
|
using Uno.Extensions;
|
||||||
using Windows.UI.Xaml;
|
using Windows.UI.Xaml;
|
||||||
|
using Uno.UI;
|
||||||
|
|
||||||
namespace WindowsCalculator.Wasm
|
namespace WindowsCalculator.Wasm
|
||||||
{
|
{
|
||||||
|
@ -14,7 +15,10 @@ namespace WindowsCalculator.Wasm
|
||||||
{
|
{
|
||||||
Console.WriteLine("Program.Main");
|
Console.WriteLine("Program.Main");
|
||||||
|
|
||||||
Windows.UI.Xaml.Application.Start(_ => _app = new App());
|
FeatureConfiguration.UIElement.AssignDOMXamlName = true;
|
||||||
|
|
||||||
|
|
||||||
|
Windows.UI.Xaml.Application.Start(_ => _app = new App());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,7 +208,7 @@
|
||||||
<PackageReference Include="Newtonsoft.Json">
|
<PackageReference Include="Newtonsoft.Json">
|
||||||
<Version>12.0.2</Version>
|
<Version>12.0.2</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1595" />
|
<PackageReference Include="Uno.UI" Version="1.45.0-dev.1608" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" />
|
||||||
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
|
<PackageReference Include="Microsoft.Extensions.Logging.Filter" Version="1.1.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue