mirror of
https://github.com/ZuneDev/ZuneShell.dll.git
synced 2026-07-27 13:11:51 -07:00
Removed unnecessary casts
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
public BooleanChoice()
|
||||
{
|
||||
this._options = (IList)BooleanChoice.s_defaultOptions;
|
||||
this._options = s_defaultOptions;
|
||||
this._chosen = 0;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
if (options != null && options.Count == 2)
|
||||
return base.ValidateOptionsList(options, out error);
|
||||
error = string.Format("Script runtime failure: Invalid '{0}' value for '{1}'", (object)options, (object)"Options");
|
||||
error = string.Format("Script runtime failure: Invalid '{0}' value for '{1}'", options, "Options");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
INotifyObject
|
||||
{
|
||||
public ByteRangedValue()
|
||||
: base(0.0f, (float)byte.MaxValue, 1f)
|
||||
: base(0.0f, byte.MaxValue, 1f)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
int num = Win32Api.GetCaretBlinkTime();
|
||||
if (num < 0)
|
||||
num = 0;
|
||||
return (float)num / 1000f;
|
||||
return num / 1000f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
this.SetOptions((IList)null, true);
|
||||
this.SetOptions(null, true);
|
||||
base.OnDispose();
|
||||
}
|
||||
|
||||
@@ -67,10 +67,10 @@ namespace Microsoft.Iris.ModelItems
|
||||
public bool ValidateIndex(int index, out string error)
|
||||
{
|
||||
bool flag = true;
|
||||
error = (string)null;
|
||||
error = null;
|
||||
if (this._options != null && (index < 0 || index >= this._options.Count))
|
||||
{
|
||||
error = string.Format("Selected Index {0} is not a valid index in SourceList of size {1}", (object)index, (object)this._options.Count);
|
||||
error = string.Format("Selected Index {0} is not a valid index in SourceList of size {1}", index, _options.Count);
|
||||
flag = false;
|
||||
}
|
||||
return flag;
|
||||
@@ -86,17 +86,17 @@ namespace Microsoft.Iris.ModelItems
|
||||
if (index >= 0)
|
||||
flag = true;
|
||||
}
|
||||
error = !flag ? string.Format("Script runtime failure: Invalid '{0}' value for '{1}'", option, (object)"ChosenValue") : (string)null;
|
||||
error = !flag ? string.Format("Script runtime failure: Invalid '{0}' value for '{1}'", option, "ChosenValue") : null;
|
||||
return flag;
|
||||
}
|
||||
|
||||
public virtual bool ValidateOptionsList(IList options, out string error)
|
||||
{
|
||||
error = (string)null;
|
||||
error = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public object ChosenValue => !this.HasSelection || this.OptionsCount == 0 ? (object)null : this._options[this._chosen];
|
||||
public object ChosenValue => !this.HasSelection || this.OptionsCount == 0 ? null : this._options[this._chosen];
|
||||
|
||||
public int ChosenIndex
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
if (eventToFire == null)
|
||||
return;
|
||||
eventToFire((object)this, EventArgs.Empty);
|
||||
eventToFire(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
public bool ReadOnly
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
INotifyObject
|
||||
{
|
||||
public IntRangedValue()
|
||||
: base((float)int.MinValue, (float)int.MaxValue, 1f)
|
||||
: base(int.MinValue, int.MaxValue, 1f)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
private IList _source;
|
||||
|
||||
public NotifyList()
|
||||
: this((IList)new ArrayList())
|
||||
: this(new ArrayList())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
if (this.ContentsChanged == null)
|
||||
return;
|
||||
this.ContentsChanged((IList)this, new UIListContentsChangedArgs(type, oldIndex, newIndex));
|
||||
this.ContentsChanged(this, new UIListContentsChangedArgs(type, oldIndex, newIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,6 +74,6 @@ namespace Microsoft.Iris.ModelItems
|
||||
return intList;
|
||||
}
|
||||
|
||||
public override string ToString() => string.Format("{{{0} to {1}}}", (object)this._begin, (object)this._end);
|
||||
public override string ToString() => string.Format("{{{0} to {1}}}", _begin, _end);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
value = Math.Max(value, this._min);
|
||||
value = Math.Min(value, this._max);
|
||||
if ((double)this._value == (double)value)
|
||||
if (_value == (double)value)
|
||||
return;
|
||||
using (new RangedValue.PrevNextNotifier(this))
|
||||
{
|
||||
@@ -47,14 +47,14 @@ namespace Microsoft.Iris.ModelItems
|
||||
}
|
||||
}
|
||||
|
||||
object IUIValueRange.ObjectValue => (object)this._value;
|
||||
object IUIValueRange.ObjectValue => _value;
|
||||
|
||||
public float MinValue
|
||||
{
|
||||
get => this._min;
|
||||
set
|
||||
{
|
||||
if ((double)this._min == (double)value)
|
||||
if (_min == (double)value)
|
||||
return;
|
||||
using (new RangedValue.PrevNextNotifier(this))
|
||||
{
|
||||
@@ -71,7 +71,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
get => this._max;
|
||||
set
|
||||
{
|
||||
if ((double)this._max == (double)value)
|
||||
if (_max == (double)value)
|
||||
return;
|
||||
using (new RangedValue.PrevNextNotifier(this))
|
||||
{
|
||||
@@ -90,7 +90,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
get => this._step;
|
||||
set
|
||||
{
|
||||
if ((double)this._step == (double)value)
|
||||
if (_step == (double)value)
|
||||
return;
|
||||
using (new RangedValue.PrevNextNotifier(this))
|
||||
{
|
||||
@@ -100,9 +100,9 @@ namespace Microsoft.Iris.ModelItems
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasPreviousValue => (double)this._step < 0.0 ? (double)this._value < (double)this._max : (double)this._value > (double)this._min;
|
||||
public bool HasPreviousValue => _step < 0.0 ? _value < (double)this._max : _value > (double)this._min;
|
||||
|
||||
public bool HasNextValue => (double)this._step < 0.0 ? (double)this._value > (double)this._min : (double)this._value < (double)this._max;
|
||||
public bool HasNextValue => _step < 0.0 ? _value > (double)this._min : _value < (double)this._max;
|
||||
|
||||
public void PreviousValue() => this.Value -= this.Step;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
public void AttachToViewItem(ViewItem vi)
|
||||
{
|
||||
vi.LayoutInput = (ILayoutInput)this._input;
|
||||
vi.LayoutInput = _input;
|
||||
vi.LayoutComplete += new LayoutCompleteEventHandler(this.OnLayoutComplete);
|
||||
this._targetItem = vi;
|
||||
}
|
||||
@@ -61,14 +61,14 @@ namespace Microsoft.Iris.ModelItems
|
||||
public void DetachFromViewItem(ViewItem vi)
|
||||
{
|
||||
this._targetItem.LayoutComplete -= new LayoutCompleteEventHandler(this.OnLayoutComplete);
|
||||
this._targetItem.SetLayoutInput(ScrollingLayoutInput.Data, (ILayoutInput)null);
|
||||
this._targetItem = (ViewItem)null;
|
||||
this._output = (ScrollingLayoutOutput)null;
|
||||
this._lastFocusedItem = (ViewItem)null;
|
||||
this._uiWithAreaOfInterestToClear = (UIClass)null;
|
||||
this._postLayoutAction = (ScrollModel.PostLayoutAction)null;
|
||||
this._navigateAction = (ScrollModel.NavigateAction)null;
|
||||
this._assignFocusAction = (ScrollModel.AssignFocusAction)null;
|
||||
this._targetItem.SetLayoutInput(ScrollingLayoutInput.Data, null);
|
||||
this._targetItem = null;
|
||||
this._output = null;
|
||||
this._lastFocusedItem = null;
|
||||
this._uiWithAreaOfInterestToClear = null;
|
||||
this._postLayoutAction = null;
|
||||
this._navigateAction = null;
|
||||
this._assignFocusAction = null;
|
||||
}
|
||||
|
||||
public ViewItem TargetViewItem
|
||||
@@ -123,7 +123,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
get => this._input.PageStep;
|
||||
set
|
||||
{
|
||||
if ((double)this._input.PageStep == (double)value)
|
||||
if (_input.PageStep == (double)value)
|
||||
return;
|
||||
this._input.PageStep = value;
|
||||
this.OnLayoutInputChanged();
|
||||
@@ -254,9 +254,9 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
public override void ScrollToPosition(float position)
|
||||
{
|
||||
if ((double)position < 0.0)
|
||||
if (position < 0.0)
|
||||
position = 0.0f;
|
||||
else if ((double)position > 1.0)
|
||||
else if (position > 1.0)
|
||||
position = 1f;
|
||||
this.DisableScrollIntoView();
|
||||
this._input.ScrollToPosition(position);
|
||||
@@ -270,7 +270,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
get => this._userDisposition;
|
||||
set
|
||||
{
|
||||
if (this._userDisposition.Equals((object)value))
|
||||
if (this._userDisposition.Equals(value))
|
||||
return;
|
||||
this._userDisposition = value;
|
||||
this.EnableScrollIntoView();
|
||||
@@ -340,7 +340,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
get => this.ScrollIntoViewDisposition.LockedPosition;
|
||||
set
|
||||
{
|
||||
if ((double)this.ScrollIntoViewDisposition.LockedPosition == (double)value)
|
||||
if (ScrollIntoViewDisposition.LockedPosition == (double)value)
|
||||
return;
|
||||
this.ScrollIntoViewDisposition.LockedPosition = value;
|
||||
this.EnableScrollIntoView();
|
||||
@@ -379,7 +379,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
get => this.ScrollIntoViewDisposition.LockedAlignment;
|
||||
set
|
||||
{
|
||||
if ((double)this.ScrollIntoViewDisposition.LockedAlignment == (double)value)
|
||||
if (ScrollIntoViewDisposition.LockedAlignment == (double)value)
|
||||
return;
|
||||
this.ScrollIntoViewDisposition.LockedAlignment = value;
|
||||
this.EnableScrollIntoView();
|
||||
@@ -438,7 +438,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
this.ActualScrollIntoViewDisposition.Locked = true;
|
||||
this.SetPendingFocusAreaOfInterest(this._lastFocusedItem.UI);
|
||||
this.OnLayoutInputChanged();
|
||||
this.SetPostLayoutAction((ScrollModel.PostLayoutAction)instance);
|
||||
this.SetPostLayoutAction(instance);
|
||||
}
|
||||
}
|
||||
else if (nearDirection)
|
||||
@@ -469,7 +469,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
if (this._postLayoutAction == null)
|
||||
return;
|
||||
this._postLayoutAction.Go();
|
||||
this._postLayoutAction = (ScrollModel.PostLayoutAction)null;
|
||||
this._postLayoutAction = null;
|
||||
}
|
||||
|
||||
private Direction NearFarToDirection(bool near)
|
||||
@@ -490,7 +490,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
RectangleF scrollerRect = this.GetScrollerRect(false);
|
||||
RectangleF viewItemRect = this.GetViewItemRect(item, false);
|
||||
return !(RectangleF.Intersect(scrollerRect, viewItemRect) == viewItemRect) ? (this.ScrollOrientation != Orientation.Horizontal ? ((double)viewItemRect.Top >= (double)scrollerRect.Top ? ScrollModel.ItemLocation.OffscreenInFarDirection : ScrollModel.ItemLocation.OffscreenInNearDirection) : ((double)viewItemRect.Left < (double)scrollerRect.Left || this._targetItem.Zone.Session.IsRtl && (double)viewItemRect.Right > (double)scrollerRect.Right ? ScrollModel.ItemLocation.OffscreenInNearDirection : ScrollModel.ItemLocation.OffscreenInFarDirection)) : ScrollModel.ItemLocation.Onscreen;
|
||||
return !(RectangleF.Intersect(scrollerRect, viewItemRect) == viewItemRect) ? (this.ScrollOrientation != Orientation.Horizontal ? (viewItemRect.Top >= (double)scrollerRect.Top ? ScrollModel.ItemLocation.OffscreenInFarDirection : ScrollModel.ItemLocation.OffscreenInNearDirection) : (viewItemRect.Left < (double)scrollerRect.Left || this._targetItem.Zone.Session.IsRtl && viewItemRect.Right > (double)scrollerRect.Right ? ScrollModel.ItemLocation.OffscreenInNearDirection : ScrollModel.ItemLocation.OffscreenInFarDirection)) : ScrollModel.ItemLocation.Onscreen;
|
||||
}
|
||||
|
||||
private bool PotentialNavigationTargetIsOnscreen(Direction dir, out UIClass navigationResult) => this.PotentialNavigationTargetIsOnscreen(this._lastFocusedItem.UI, dir, out navigationResult);
|
||||
@@ -514,7 +514,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
out UIClass navigationResult)
|
||||
{
|
||||
bool flag = false;
|
||||
if (ui.FindNextFocusablePeer(dir, RectangleF.Zero, out navigationResult) && navigationResult != null && this._targetItem.HasDescendant((Microsoft.Iris.Library.TreeNode)navigationResult.RootItem))
|
||||
if (ui.FindNextFocusablePeer(dir, RectangleF.Zero, out navigationResult) && navigationResult != null && this._targetItem.HasDescendant(navigationResult.RootItem))
|
||||
flag = true;
|
||||
return flag;
|
||||
}
|
||||
@@ -581,7 +581,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
if (!flag2)
|
||||
instance.Go();
|
||||
else
|
||||
this.SetPostLayoutAction((ScrollModel.PostLayoutAction)instance);
|
||||
this.SetPostLayoutAction(instance);
|
||||
}
|
||||
|
||||
private void MoveDirection(bool nearDirection)
|
||||
@@ -605,7 +605,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
this.ActualScrollIntoViewDisposition.Reset();
|
||||
this.ActualScrollIntoViewDisposition.Enabled = true;
|
||||
this.SetPendingFocusAreaOfInterest(this._lastFocusedItem.UI);
|
||||
this.SetPostLayoutAction((ScrollModel.PostLayoutAction)ScrollModel.NavigateAction.GetInstance(this, nearDirection, direction));
|
||||
this.SetPostLayoutAction(ScrollModel.NavigateAction.GetInstance(this, nearDirection, direction));
|
||||
this.OnLayoutInputChanged();
|
||||
}
|
||||
else if (nearDirection)
|
||||
@@ -654,13 +654,13 @@ namespace Microsoft.Iris.ModelItems
|
||||
this.FireNotification(NotificationID.CanScrollUp);
|
||||
if (this._output.CanScrollPositive != output.CanScrollPositive)
|
||||
this.FireNotification(NotificationID.CanScrollDown);
|
||||
if ((double)this._output.CurrentPage != (double)output.CurrentPage)
|
||||
if (_output.CurrentPage != (double)output.CurrentPage)
|
||||
this.FireNotification(NotificationID.CurrentPage);
|
||||
if ((double)this._output.TotalPages != (double)output.TotalPages)
|
||||
if (_output.TotalPages != (double)output.TotalPages)
|
||||
this.FireNotification(NotificationID.TotalPages);
|
||||
if ((double)this._output.ViewNear != (double)output.ViewNear)
|
||||
if (_output.ViewNear != (double)output.ViewNear)
|
||||
this.FireNotification(NotificationID.ViewNear);
|
||||
if ((double)this._output.ViewFar == (double)output.ViewFar)
|
||||
if (_output.ViewFar == (double)output.ViewFar)
|
||||
return;
|
||||
this.FireNotification(NotificationID.ViewFar);
|
||||
}
|
||||
@@ -669,7 +669,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
this.OnLayoutOutputChanged();
|
||||
UIClass keyFocusDescendant = this._targetItem.UI.KeyFocusDescendant;
|
||||
if (keyFocusDescendant != null && keyFocusDescendant != this._targetItem.UI && this._targetItem.HasDescendant((Microsoft.Iris.Library.TreeNode)keyFocusDescendant.RootItem))
|
||||
if (keyFocusDescendant != null && keyFocusDescendant != this._targetItem.UI && this._targetItem.HasDescendant(keyFocusDescendant.RootItem))
|
||||
this._lastFocusedItem = keyFocusDescendant.RootItem;
|
||||
this.ClearPendingFocusAreaOfInterest();
|
||||
if (!this._useUserDisposition)
|
||||
@@ -689,7 +689,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
return;
|
||||
if (!this._uiWithAreaOfInterestToClear.IsDisposed)
|
||||
this._uiWithAreaOfInterestToClear.ClearAreaOfInterest(AreaOfInterestID.PendingFocus);
|
||||
this._uiWithAreaOfInterestToClear = (UIClass)null;
|
||||
this._uiWithAreaOfInterestToClear = null;
|
||||
}
|
||||
|
||||
private void SetPendingFocusAreaOfInterest(UIClass ui)
|
||||
@@ -704,7 +704,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
private bool HadFocus()
|
||||
{
|
||||
if (this._lastFocusedItem != null && this._lastFocusedItem.IsDisposed)
|
||||
this._lastFocusedItem = (ViewItem)null;
|
||||
this._lastFocusedItem = null;
|
||||
return this._lastFocusedItem != null;
|
||||
}
|
||||
|
||||
@@ -717,7 +717,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
private RectangleF GetViewItemRect(ViewItem item, bool forNavigation)
|
||||
{
|
||||
if (!forNavigation)
|
||||
return RectangleF.FromRectangle(((ITrackableUIElement)item).EstimatePosition((IZoneDisplayChild)this._targetItem));
|
||||
return RectangleF.FromRectangle(((ITrackableUIElement)item).EstimatePosition(_targetItem));
|
||||
Vector3 positionPxlVector;
|
||||
Vector3 sizePxlVector;
|
||||
((INavigationSite)item).ComputeBounds(out positionPxlVector, out sizePxlVector);
|
||||
@@ -806,9 +806,9 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
if (this.Origin == null || this.Origin.IsDisposed)
|
||||
return;
|
||||
UIClass uiClass = this.Origin.DirectKeyFocus ? this.Origin : (UIClass)null;
|
||||
UIClass uiClass = this.Origin.DirectKeyFocus ? this.Origin : null;
|
||||
UIClass resultUI;
|
||||
if (this.Origin.FindNextFocusablePeer(this._direction, RectangleF.Zero, out resultUI) && resultUI != null && (resultUI != uiClass && this.Target.HasDescendant((Microsoft.Iris.Library.TreeNode)resultUI.RootItem)))
|
||||
if (this.Origin.FindNextFocusablePeer(this._direction, RectangleF.Zero, out resultUI) && resultUI != null && (resultUI != uiClass && this.Target.HasDescendant(resultUI.RootItem)))
|
||||
{
|
||||
this.Data.NavigateToUI(resultUI);
|
||||
this.Data.EnableScrollIntoView();
|
||||
@@ -847,7 +847,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
public override void Go()
|
||||
{
|
||||
UIClass ui = (UIClass)null;
|
||||
UIClass ui = null;
|
||||
if (this._tryNonBiasedSearchFirst)
|
||||
ui = this.FindNavigationResult(true);
|
||||
if (ui == null)
|
||||
@@ -861,18 +861,18 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
private UIClass FindNavigationResult(bool findNearest)
|
||||
{
|
||||
UIClass uiClass = (UIClass)null;
|
||||
UIClass uiClass = null;
|
||||
INavigationSite result;
|
||||
bool fromPoint;
|
||||
if (findNearest)
|
||||
{
|
||||
fromPoint = NavigationServices.FindFromPoint((INavigationSite)this.Target, this._assignPoint, out result);
|
||||
fromPoint = NavigationServices.FindFromPoint(Target, this._assignPoint, out result);
|
||||
}
|
||||
else
|
||||
{
|
||||
Direction direction = this.Data.NearFarToDirection(this.NearDirection);
|
||||
this._assignPoint = this.Data.GetMoveToEndpointPoint(this.NearDirection);
|
||||
fromPoint = NavigationServices.FindFromPoint((INavigationSite)this.Target, direction, this._assignPoint, out result);
|
||||
fromPoint = NavigationServices.FindFromPoint(Target, direction, this._assignPoint, out result);
|
||||
}
|
||||
if (fromPoint && result != null)
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
}
|
||||
}
|
||||
list.Sort();
|
||||
this._selectedIndicesCache = (IList)new SelectionManager.ReadOnlyList((IList)list, nameof(SelectedIndices));
|
||||
this._selectedIndicesCache = new SelectionManager.ReadOnlyList(list, nameof(SelectedIndices));
|
||||
}
|
||||
return this._selectedIndicesCache;
|
||||
}
|
||||
@@ -83,10 +83,10 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
if (this._selectedItemsCache == null)
|
||||
{
|
||||
IList originalList = (IList)null;
|
||||
IList originalList = null;
|
||||
if (this.Count > 0 && this.SourceList != null)
|
||||
{
|
||||
originalList = (IList)new List<object>();
|
||||
originalList = new List<object>();
|
||||
foreach (int original in (List<int>)((SelectionManager.ReadOnlyList)this.SelectedIndices).OriginalList)
|
||||
{
|
||||
if (this.IsValidIndex(original))
|
||||
@@ -94,8 +94,8 @@ namespace Microsoft.Iris.ModelItems
|
||||
}
|
||||
}
|
||||
if (originalList == null)
|
||||
originalList = (IList)SelectionManager.s_emptyList;
|
||||
this._selectedItemsCache = (IList)new SelectionManager.ReadOnlyList(originalList, nameof(SelectedItems));
|
||||
originalList = s_emptyList;
|
||||
this._selectedItemsCache = new SelectionManager.ReadOnlyList(originalList, nameof(SelectedItems));
|
||||
}
|
||||
return this._selectedItemsCache;
|
||||
}
|
||||
@@ -115,7 +115,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
}
|
||||
}
|
||||
|
||||
public object SelectedItem => this.Count > 0 ? this.SelectedItems[0] : (object)null;
|
||||
public object SelectedItem => this.Count > 0 ? this.SelectedItems[0] : null;
|
||||
|
||||
public int Count => this._count;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
if (!this.SingleSelect)
|
||||
return;
|
||||
ErrorManager.ReportError("Calling {0} is not supported on a SelectionManager in single selection modes.", (object)operation);
|
||||
ErrorManager.ReportError("Calling {0} is not supported on a SelectionManager in single selection modes.", operation);
|
||||
}
|
||||
|
||||
private void OnListContentsChanged(IList senderList, UIListContentsChangedArgs args)
|
||||
@@ -348,7 +348,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
this.ValidateMultiSelect("Select(IList, bool)");
|
||||
bool flag = true;
|
||||
foreach (object index in (IEnumerable)indices)
|
||||
foreach (object index in indices)
|
||||
flag &= this.Select((int)index, select, false, true);
|
||||
return flag;
|
||||
}
|
||||
@@ -359,7 +359,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
this.ValidateMultiSelect("ToggleSelect(IList)");
|
||||
bool flag = true;
|
||||
foreach (int index in (IEnumerable)items)
|
||||
foreach (int index in items)
|
||||
flag &= this.Select(index, !this.IsSelected(index), false, true);
|
||||
return flag;
|
||||
}
|
||||
@@ -468,7 +468,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
private void OnSelectionChanged(bool countChanged)
|
||||
{
|
||||
this._selectedIndicesCache = (IList)null;
|
||||
this._selectedIndicesCache = null;
|
||||
this.FireNotification(NotificationID.SelectedIndices);
|
||||
this.FireNotification(NotificationID.SelectedIndex);
|
||||
if (!countChanged)
|
||||
@@ -476,7 +476,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
this.FireNotification(NotificationID.Count);
|
||||
if (this.SourceList == null)
|
||||
return;
|
||||
this._selectedItemsCache = (IList)null;
|
||||
this._selectedItemsCache = null;
|
||||
this.FireNotification(NotificationID.SelectedItems);
|
||||
this.FireNotification(NotificationID.SelectedItem);
|
||||
}
|
||||
@@ -497,7 +497,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
public object this[int index]
|
||||
{
|
||||
get => this._originalList[index];
|
||||
set => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", (object)this._listName);
|
||||
set => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", _listName);
|
||||
}
|
||||
|
||||
public int Count => this._originalList.Count;
|
||||
@@ -512,7 +512,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
public bool IsSynchronized => false;
|
||||
|
||||
public object SyncRoot => (object)this._originalList;
|
||||
public object SyncRoot => _originalList;
|
||||
|
||||
public IEnumerator GetEnumerator() => this._originalList.GetEnumerator();
|
||||
|
||||
@@ -520,17 +520,17 @@ namespace Microsoft.Iris.ModelItems
|
||||
|
||||
public int Add(object value)
|
||||
{
|
||||
ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", (object)this._listName);
|
||||
ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", _listName);
|
||||
return -1;
|
||||
}
|
||||
|
||||
public void Clear() => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", (object)this._listName);
|
||||
public void Clear() => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", _listName);
|
||||
|
||||
public void Insert(int index, object value) => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", (object)this._listName);
|
||||
public void Insert(int index, object value) => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", _listName);
|
||||
|
||||
public void Remove(object value) => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", (object)this._listName);
|
||||
public void Remove(object value) => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", _listName);
|
||||
|
||||
public void RemoveAt(int index) => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", (object)this._listName);
|
||||
public void RemoveAt(int index) => ErrorManager.ReportError("Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead.", _listName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
this._handler = handler;
|
||||
}
|
||||
|
||||
public void DetachCallbacks() => this._handler = (ITextScrollModelCallback)null;
|
||||
public void DetachCallbacks() => this._handler = null;
|
||||
|
||||
public override int ScrollStep
|
||||
{
|
||||
@@ -102,20 +102,20 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
if (this._handler == null || this.AvailableScrollSpace <= 0)
|
||||
return;
|
||||
this._handler.ScrollToPosition(this, (int)((double)this.AvailableScrollSpace * (double)scrollAmount));
|
||||
this._handler.ScrollToPosition(this, (int)(AvailableScrollSpace * (double)scrollAmount));
|
||||
}
|
||||
|
||||
public override bool CanScrollUp => this._canScrollUp;
|
||||
|
||||
public override bool CanScrollDown => this._canScrollDown;
|
||||
|
||||
public override float CurrentPage => this._viewExtent != 0 ? (float)((double)this._scrollAmount / (double)this._viewExtent + 1.0) : 0.0f;
|
||||
public override float CurrentPage => this._viewExtent != 0 ? (float)(_scrollAmount / (double)this._viewExtent + 1.0) : 0.0f;
|
||||
|
||||
public override float TotalPages => this._viewExtent != 0 ? (float)((double)this.AvailableScrollSpace / (double)this._viewExtent + 1.0) : 0.0f;
|
||||
public override float TotalPages => this._viewExtent != 0 ? (float)(AvailableScrollSpace / (double)this._viewExtent + 1.0) : 0.0f;
|
||||
|
||||
public override float ViewNear => this._extent != 0 ? Math.Max((float)this._scrollAmount / (float)this._extent, 0.0f) : 0.0f;
|
||||
public override float ViewNear => this._extent != 0 ? Math.Max(_scrollAmount / (float)this._extent, 0.0f) : 0.0f;
|
||||
|
||||
public override float ViewFar => this._extent != 0 ? Math.Min((float)(this._scrollAmount + this._viewExtent) / (float)this._extent, 1f) : 0.0f;
|
||||
public override float ViewFar => this._extent != 0 ? Math.Min((this._scrollAmount + this._viewExtent) / (float)this._extent, 1f) : 0.0f;
|
||||
|
||||
private int AvailableScrollSpace => this._extent - this._viewExtent + 1;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Microsoft.Iris.ModelItems
|
||||
{
|
||||
private DispatcherTimer _dispatcherTimer;
|
||||
|
||||
public UITimer() => this._dispatcherTimer = new DispatcherTimer((ITimerOwner)this);
|
||||
public UITimer() => this._dispatcherTimer = new DispatcherTimer(this);
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user