resolve some warnings

This commit is contained in:
tian-lt 2021-06-04 00:32:08 +08:00
commit 4947072e37
11 changed files with 37 additions and 24 deletions

View file

@ -499,9 +499,6 @@ namespace CalculatorApp
private Dictionary<int, WindowFrameService> m_secondaryWindows = new Dictionary<int, WindowFrameService>(); private Dictionary<int, WindowFrameService> m_secondaryWindows = new Dictionary<int, WindowFrameService>();
private int m_mainViewId; private int m_mainViewId;
private bool m_preLaunched; private bool m_preLaunched;
// CSHARP_MIGRATION: TODO: check whether or not this field is in use.
private Windows.UI.Xaml.Controls.Primitives.Popup m_aboutPopup;
} }
} }

View file

@ -223,8 +223,12 @@ namespace CalculatorApp
} }
public event EventHandler<object> CurrentChanged; public event EventHandler<object> CurrentChanged;
public event CurrentChangingEventHandler CurrentChanging; // CSHARP_MIGRATION: TODO: check why this member is never being used.
public event VectorChangedEventHandler<object> VectorChanged; public event VectorChangedEventHandler<object> VectorChanged;
public event CurrentChangingEventHandler CurrentChanging
{
add => throw new NotImplementedException();
remove => throw new NotImplementedException();
}
IList m_source; IList m_source;
int m_currentPosition; int m_currentPosition;

View file

@ -38,7 +38,6 @@ namespace CalculatorApp
public OverflowTextBlock() public OverflowTextBlock()
{ {
m_isAccessibilityViewControl = false; m_isAccessibilityViewControl = false;
m_ignoreViewChanged = false;
m_expressionContent = null; m_expressionContent = null;
m_itemsControl = null; m_itemsControl = null;
m_expressionContainer = null; m_expressionContainer = null;
@ -322,7 +321,6 @@ namespace CalculatorApp
private const double SCROLL_RATIO = 0.7; private const double SCROLL_RATIO = 0.7;
private bool m_isAccessibilityViewControl; private bool m_isAccessibilityViewControl;
private bool m_ignoreViewChanged;
private Windows.UI.Xaml.FrameworkElement m_expressionContent; private Windows.UI.Xaml.FrameworkElement m_expressionContent;
private Windows.UI.Xaml.Controls.ItemsControl m_itemsControl; private Windows.UI.Xaml.Controls.ItemsControl m_itemsControl;
private Windows.UI.Xaml.Controls.ScrollViewer m_expressionContainer; private Windows.UI.Xaml.Controls.ScrollViewer m_expressionContainer;

View file

@ -107,14 +107,11 @@ namespace CalculatorApp
{ {
case EquationLineStyle.Dot: case EquationLineStyle.Dot:
return resourceLoader.GetResourceString("dotLineStyleAutomationName"); return resourceLoader.GetResourceString("dotLineStyleAutomationName");
break;
case EquationLineStyle.Dash: case EquationLineStyle.Dash:
return resourceLoader.GetResourceString("dashLineStyleAutomationName"); return resourceLoader.GetResourceString("dashLineStyleAutomationName");
break;
case EquationLineStyle.Solid: case EquationLineStyle.Solid:
default: default:
return resourceLoader.GetResourceString("solidLineStyleAutomationName"); return resourceLoader.GetResourceString("solidLineStyleAutomationName");
break;
} }
} }

View file

@ -629,7 +629,6 @@ namespace CalculatorApp
} }
} }
private Windows.UI.Xaml.Controls.ListView m_tokenList;
private Windows.UI.Xaml.Controls.MenuFlyout m_displayFlyout; private Windows.UI.Xaml.Controls.MenuFlyout m_displayFlyout;
private bool m_doAnimate; private bool m_doAnimate;
private bool m_resultAnimate; private bool m_resultAnimate;
@ -646,7 +645,6 @@ namespace CalculatorApp
private string m_dockPanelMemoryList; private string m_dockPanelMemoryList;
private Windows.UI.Xaml.Controls.PivotItem m_pivotItem; private Windows.UI.Xaml.Controls.PivotItem m_pivotItem;
private bool m_IsDigit = false;
private Memory m_memory; private Memory m_memory;
private void HistoryFlyout_Opened(object sender, object args) private void HistoryFlyout_Opened(object sender, object args)

View file

@ -34,7 +34,20 @@ namespace CalculatorApp
get { return (StandardCalculatorViewModel)this.DataContext; } get { return (StandardCalculatorViewModel)this.DataContext; }
} }
public bool IsErrorVisualState { get; set; } public bool IsErrorVisualState
{
get => m_isErrorVisualState;
set
{
if(m_isErrorVisualState != value)
{
m_isErrorVisualState = value;
string newState = m_isErrorVisualState ? "ErrorLayout" : "NoErrorLayout";
VisualStateManager.GoToState(this, newState, false);
NumberPad.IsErrorVisualState = m_isErrorVisualState;
}
}
}
public string ParenthesisCountToString(uint count) public string ParenthesisCountToString(uint count)
{ {

View file

@ -60,7 +60,19 @@ namespace CalculatorApp
} }
private System.Windows.Input.ICommand donotuse_ButtonPressed; private System.Windows.Input.ICommand donotuse_ButtonPressed;
public bool IsErrorVisualState { get; set; } public bool IsErrorVisualState
{
get => m_isErrorVisualState;
set
{
if(m_isErrorVisualState != value)
{
m_isErrorVisualState = value;
string newState = m_isErrorVisualState ? "ErrorFlyout" : "NoErrorFlyout";
VisualStateManager.GoToState(this, newState, false);
}
}
}
private void OnAngleButtonPressed(object commandParameter) private void OnAngleButtonPressed(object commandParameter)
{ {

View file

@ -26,7 +26,6 @@ using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input; using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation; using Windows.UI.Xaml.Navigation;
using Windows.UI.Core;
namespace CalculatorApp namespace CalculatorApp
{ {

View file

@ -43,9 +43,6 @@ namespace CalculatorApp
public static readonly DependencyProperty RowHeightProperty = public static readonly DependencyProperty RowHeightProperty =
DependencyProperty.Register(nameof(RowHeight), typeof(Windows.UI.Xaml.GridLength), typeof(HistoryList), new PropertyMetadata(default(Windows.UI.Xaml.GridLength))); DependencyProperty.Register(nameof(RowHeight), typeof(Windows.UI.Xaml.GridLength), typeof(HistoryList), new PropertyMetadata(default(Windows.UI.Xaml.GridLength)));
private Windows.Foundation.Rect m_visibleBounds;
private Windows.Foundation.Rect m_coreBounds;
private void ListView_ItemClick(object sender, ItemClickEventArgs e) private void ListView_ItemClick(object sender, ItemClickEventArgs e)
{ {
HistoryViewModel historyVM = (DataContext as HistoryViewModel); HistoryViewModel historyVM = (DataContext as HistoryViewModel);

View file

@ -49,8 +49,6 @@ namespace CalculatorApp
} }
} }
private Windows.Foundation.Rect m_visibleBounds;
private Windows.Foundation.Rect m_coreBounds;
private bool m_isErrorVisualState = false; private bool m_isErrorVisualState = false;
private void MemoryListItemClick(object sender, ItemClickEventArgs e) private void MemoryListItemClick(object sender, ItemClickEventArgs e)

View file

@ -48,7 +48,7 @@ namespace CalculatorApp
get => this.m_FlowDirectionHorizontalAlignment; get => this.m_FlowDirectionHorizontalAlignment;
} }
private Windows.UI.Xaml.HorizontalAlignment m_FlowDirectionHorizontalAlignment; private Windows.UI.Xaml.HorizontalAlignment m_FlowDirectionHorizontalAlignment = default(HorizontalAlignment);
public void AnimateConverter() public void AnimateConverter()
{ {
@ -373,11 +373,11 @@ namespace CalculatorApp
} }
private static Lazy<UISettings> uiSettings = new Lazy<UISettings>(true); private static Lazy<UISettings> uiSettings = new Lazy<UISettings>(true);
private Windows.UI.Xaml.FlowDirection m_layoutDirection; private Windows.UI.Xaml.FlowDirection m_layoutDirection = default(FlowDirection);
private Windows.UI.Xaml.Controls.MenuFlyout m_resultsFlyout; private Windows.UI.Xaml.Controls.MenuFlyout m_resultsFlyout = default(MenuFlyout);
private string m_chargesMayApplyText; private string m_chargesMayApplyText = string.Empty;
private string m_failedToRefreshText; private string m_failedToRefreshText = string.Empty;
private bool m_meteredConnectionOverride; private bool m_meteredConnectionOverride;