Add project files.

This commit is contained in:
Joshua Askharoun
2022-03-03 08:14:05 -06:00
parent cfa6f93211
commit 1198cc8a66
967 changed files with 118389 additions and 0 deletions
@@ -0,0 +1,43 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.BooleanChoice
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using System.Collections;
namespace Microsoft.Iris.ModelItems
{
internal class BooleanChoice :
Choice,
IUIBooleanChoice,
IUIChoice,
IUIValueRange,
IDisposableObject,
INotifyObject
{
private static object[] s_defaultOptions = new object[2];
static BooleanChoice()
{
s_defaultOptions[0] = BooleanBoxes.FalseBox;
s_defaultOptions[1] = BooleanBoxes.TrueBox;
}
public BooleanChoice()
{
_options = s_defaultOptions;
_chosen = 0;
}
public override bool ValidateOptionsList(IList options, out string error)
{
if (options != null && options.Count == 2)
return base.ValidateOptionsList(options, out error);
error = string.Format("Script runtime failure: Invalid '{0}' value for '{1}'", options, "Options");
return false;
}
}
}
@@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.ByteRangedValue
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Markup;
namespace Microsoft.Iris.ModelItems
{
internal class ByteRangedValue :
RangedValue,
IUIByteRangedValue,
IUIRangedValue,
IUIValueRange,
INotifyObject
{
public ByteRangedValue()
: base(0.0f, byte.MaxValue, 1f)
{
}
}
}
@@ -0,0 +1,94 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.CaretInfo
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using Microsoft.Iris.OS;
using Microsoft.Iris.Render;
namespace Microsoft.Iris.ModelItems
{
internal class CaretInfo : NotifyObjectBase
{
private Point _position;
private Size _suggestedSize;
private int _idealWidth;
private bool _visible;
private bool _ignoreIdealWidth;
public CaretInfo() => _idealWidth = GetSystemCaretWidth();
public int IdealWidth
{
get => _idealWidth;
set
{
if (_idealWidth == value)
return;
_idealWidth = value;
FireThreadSafeNotification(NotificationID.IdealWidth);
UpdateSuggestedSize(SuggestedSize);
}
}
public Point Position => _position;
public Size SuggestedSize => _suggestedSize;
public bool Visible => _visible && _position.X >= 0 && _position.Y >= 0;
internal bool IgnoreIdealWidth
{
get => _ignoreIdealWidth;
set => _ignoreIdealWidth = value;
}
public void CreateCaret(Size size) => UpdateSuggestedSize(size);
public void SetVisible(bool visible)
{
if (_visible == visible)
return;
_visible = visible;
FireThreadSafeNotification(NotificationID.Visible);
}
public void SetCaretPosition(Point position)
{
if (_position.X == position.X && _position.Y == position.Y)
return;
bool visible = Visible;
_position = position;
FireThreadSafeNotification(NotificationID.Position);
if (Visible == visible)
return;
FireThreadSafeNotification(NotificationID.Visible);
}
private void UpdateSuggestedSize(Size newSize)
{
if (newSize.Width == 1 && _idealWidth != 0 && !IgnoreIdealWidth)
newSize.Width = _idealWidth;
if (!(newSize != _suggestedSize))
return;
_suggestedSize = newSize;
FireThreadSafeNotification(NotificationID.SuggestedSize);
}
private int GetSystemCaretWidth() => Win32Api.GetCaretWidth();
public float BlinkTime
{
get
{
int num = Win32Api.GetCaretBlinkTime();
if (num < 0)
num = 0;
return num / 1000f;
}
}
}
}
+278
View File
@@ -0,0 +1,278 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.Choice
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Data;
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using System.Collections;
namespace Microsoft.Iris.ModelItems
{
internal class Choice :
DisposableNotifyObjectBase,
IUIChoice,
IUIValueRange,
IDisposableObject,
INotifyObject
{
protected IList _options;
protected int _chosen;
private int _default;
private bool _wrap;
private static int s_noSelectionSentinal = -1;
public Choice()
{
_chosen = s_noSelectionSentinal;
_default = 0;
}
protected override void OnDispose()
{
SetOptions(null, true);
base.OnDispose();
}
public IList Options
{
get => _options;
set => SetOptions(value, false);
}
private void SetOptions(IList value, bool disposing)
{
if (_options == value)
return;
if (_options != null && _options is INotifyList options)
options.ContentsChanged -= new UIListContentsChangedHandler(OnListContentsChanged);
_options = value;
if (value != null && value is INotifyList notifyList)
notifyList.ContentsChanged += new UIListContentsChangedHandler(OnListContentsChanged);
if (disposing)
return;
int chosen = _chosen;
Clear();
if (ValidateIndex(chosen))
SetChosenIndex(chosen);
else if (!ListUtility.IsNullOrEmpty(_options))
SetChosenIndex(0);
FireNotification(NotificationID.Options);
}
private bool ValidateIndex(int index) => ValidateIndex(index, out string _);
public bool ValidateIndex(int index, out string error)
{
bool flag = true;
error = null;
if (_options != null && (index < 0 || index >= _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;
}
public bool ValidateOption(object option, out int index, out string error)
{
bool flag = false;
index = -1;
if (_options != null)
{
index = _options.IndexOf(option);
if (index >= 0)
flag = true;
}
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 = null;
return true;
}
public object ChosenValue => !HasSelection || OptionsCount == 0 ? null : _options[_chosen];
public int ChosenIndex
{
get => _chosen;
set => SetChosenIndex(value);
}
public int DefaultIndex
{
get => _default;
set
{
if (_default == value)
return;
_default = value;
FireNotification(NotificationID.DefaultIndex);
}
}
private void SetChosenIndex(int index)
{
if (_chosen == index)
return;
bool hasSelection = HasSelection;
bool hasPreviousValue;
bool hasNextValue;
CapturePrevNextState(out hasPreviousValue, out hasNextValue);
_chosen = index;
FireNotification(NotificationID.ChosenIndex);
FireNotification(NotificationID.ChosenValue);
FireNotification(NotificationID.Value);
if (HasSelection != hasSelection)
FireNotification(NotificationID.HasSelection);
FirePrevNextNotifications(hasPreviousValue, hasNextValue);
}
public bool HasSelection => _chosen != s_noSelectionSentinal && _options != null;
public bool HasPreviousValue => HasPreviousValueWorker(_wrap);
public bool HasPreviousValueWorker(bool wrap)
{
if (!HasSelection)
return false;
return wrap || _chosen > 0;
}
public bool HasNextValue => HasNextValueWorker(_wrap);
public bool HasNextValueWorker(bool wrap)
{
if (!HasSelection)
return false;
return wrap || _chosen < OptionsCount - 1;
}
public bool Wrap
{
get => _wrap;
set
{
if (_wrap == value)
return;
bool hasPreviousValue;
bool hasNextValue;
CapturePrevNextState(out hasPreviousValue, out hasNextValue);
_wrap = value;
FireNotification(NotificationID.Wrap);
FirePrevNextNotifications(hasPreviousValue, hasNextValue);
}
}
private void CapturePrevNextState(out bool hasPreviousValue, out bool hasNextValue)
{
hasPreviousValue = HasPreviousValue;
hasNextValue = HasNextValue;
}
private void FirePrevNextNotifications(bool hadPreviousValue, bool hadNextValue)
{
if (hadPreviousValue != HasPreviousValue)
FireNotification(NotificationID.HasPreviousValue);
if (hadNextValue == HasNextValue)
return;
FireNotification(NotificationID.HasNextValue);
}
private int OptionsCount
{
get
{
int num = 0;
if (_options != null)
num = _options.Count;
return num;
}
}
public void PreviousValue() => PreviousValue(_wrap);
public void PreviousValue(bool wrap)
{
if (!HasPreviousValueWorker(wrap))
return;
int index = _chosen - 1;
if (index < 0)
index = OptionsCount - 1;
SetChosenIndex(index);
}
public void NextValue() => NextValue(_wrap);
public void NextValue(bool wrap)
{
if (!HasNextValueWorker(wrap))
return;
int index = _chosen + 1;
if (index >= OptionsCount)
index = 0;
SetChosenIndex(index);
}
public void DefaultValue()
{
if (_default < 0 || _default >= OptionsCount)
return;
SetChosenIndex(_default);
}
object IUIValueRange.ObjectValue => ChosenValue;
public void Clear() => SetChosenIndex(s_noSelectionSentinal);
private void OnListContentsChanged(IList senderList, UIListContentsChangedArgs args)
{
UIListContentsChangeType type = args.Type;
int oldIndex = args.OldIndex;
int newIndex = args.NewIndex;
int count = args.Count;
switch (type)
{
case UIListContentsChangeType.Add:
case UIListContentsChangeType.AddRange:
case UIListContentsChangeType.Insert:
case UIListContentsChangeType.InsertRange:
if (_chosen < newIndex)
break;
SetChosenIndex(_chosen + count);
break;
case UIListContentsChangeType.Remove:
if (oldIndex == _chosen)
{
Clear();
break;
}
if (_chosen <= oldIndex)
break;
SetChosenIndex(_chosen - 1);
break;
case UIListContentsChangeType.Move:
if (oldIndex == newIndex || _chosen < oldIndex)
break;
if (_chosen == oldIndex)
{
SetChosenIndex(newIndex);
break;
}
if (_chosen >= newIndex)
break;
SetChosenIndex(newIndex - 1);
break;
case UIListContentsChangeType.Clear:
case UIListContentsChangeType.Reset:
Clear();
break;
}
}
}
}
@@ -0,0 +1,20 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.Clipboard
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.OS;
namespace Microsoft.Iris.ModelItems
{
internal static class Clipboard
{
public static bool ContainsText() => Win32Api.IsClipboardFormatAvailable(13U);
private enum ClipboardFormats
{
Text = 13, // 0x0000000D
}
}
}
@@ -0,0 +1,93 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.EditableTextData
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using Microsoft.Iris.Session;
using System;
namespace Microsoft.Iris.ModelItems
{
internal class EditableTextData : NotifyObjectBase
{
private int _maxLength;
private bool _readOnly;
private string _value;
public EditableTextData()
{
_value = string.Empty;
_maxLength = int.MaxValue;
}
public string Value
{
get => _value;
set
{
if (ReadOnly || !(_value != value))
return;
_value = value;
FireCodeEvent(ValueChanged);
FireThreadSafeNotification(NotificationID.Value);
}
}
public int MaxLength
{
get => _maxLength;
set
{
if (_maxLength == value)
return;
_maxLength = value;
FireCodeEvent(MaxLengthChanged);
FireThreadSafeNotification(NotificationID.MaxLength);
}
}
private void FireCodeEvent(EventHandler eventToFire)
{
if (eventToFire == null)
return;
eventToFire(this, EventArgs.Empty);
}
public bool ReadOnly
{
get => _readOnly;
set
{
if (_readOnly == value)
return;
_readOnly = value;
FireCodeEvent(ReadOnlyChanged);
FireThreadSafeNotification(NotificationID.ReadOnly);
}
}
public event EventHandler Submitted;
public event EventHandler MaxLengthChanged;
public event EventHandler ReadOnlyChanged;
public event EventHandler ValueChanged;
public void Submit() => DeferredCall.Post(DispatchPriority.AppEvent, new SimpleCallback(AsyncInvoke));
private void AsyncInvoke()
{
FireCodeEvent(Submitted);
FireThreadSafeNotification(NotificationID.Submitted);
OnSubmitted();
}
protected virtual void OnSubmitted()
{
}
}
}
@@ -0,0 +1,21 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.ITextScrollModelCallback
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.ModelItems
{
internal interface ITextScrollModelCallback
{
void ScrollUp(TextScrollModel who);
void ScrollDown(TextScrollModel who);
void PageUp(TextScrollModel who);
void PageDown(TextScrollModel who);
void ScrollToPosition(TextScrollModel who, int whereTo);
}
}
@@ -0,0 +1,15 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUIBooleanChoice
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
namespace Microsoft.Iris.ModelItems
{
internal interface IUIBooleanChoice : IUIChoice, IUIValueRange, IDisposableObject, INotifyObject
{
}
}
@@ -0,0 +1,14 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUIByteRangedValue
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Markup;
namespace Microsoft.Iris.ModelItems
{
internal interface IUIByteRangedValue : IUIRangedValue, IUIValueRange, INotifyObject
{
}
}
@@ -0,0 +1,41 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUIChoice
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using System.Collections;
namespace Microsoft.Iris.ModelItems
{
internal interface IUIChoice : IUIValueRange, IDisposableObject, INotifyObject
{
object ChosenValue { get; }
int ChosenIndex { get; set; }
int DefaultIndex { get; set; }
IList Options { get; set; }
bool HasSelection { get; }
bool Wrap { get; set; }
void PreviousValue(bool wrap);
void NextValue(bool wrap);
void DefaultValue();
void Clear();
bool ValidateIndex(int index, out string error);
bool ValidateOption(object value, out int index, out string error);
bool ValidateOptionsList(IList value, out string error);
}
}
@@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUICommand
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.ModelItems
{
internal interface IUICommand
{
bool Available { get; set; }
InvokePriority Priority { get; set; }
void Invoke();
}
}
+17
View File
@@ -0,0 +1,17 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUIGroup
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System.Collections;
namespace Microsoft.Iris.ModelItems
{
internal interface IUIGroup : IList, ICollection, IEnumerable
{
int StartIndex { get; }
int EndIndex { get; }
}
}
@@ -0,0 +1,14 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUIIntRangedValue
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Markup;
namespace Microsoft.Iris.ModelItems
{
internal interface IUIIntRangedValue : IUIRangedValue, IUIValueRange, INotifyObject
{
}
}
+19
View File
@@ -0,0 +1,19 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUIList
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using System.Collections;
namespace Microsoft.Iris.ModelItems
{
internal interface IUIList : IList, ICollection, IEnumerable
{
bool CanSearch { get; }
int SearchForString(string searchString);
void Move(int oldIndex, int newIndex);
}
}
@@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUIRangedValue
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Markup;
namespace Microsoft.Iris.ModelItems
{
internal interface IUIRangedValue : IUIValueRange, INotifyObject
{
float Value { get; set; }
float MinValue { get; set; }
float MaxValue { get; set; }
float Range { get; }
float Step { get; set; }
}
}
@@ -0,0 +1,21 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IUIValueRange
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.ModelItems
{
internal interface IUIValueRange
{
object ObjectValue { get; }
bool HasNextValue { get; }
bool HasPreviousValue { get; }
void PreviousValue();
void NextValue();
}
}
@@ -0,0 +1,23 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.IntRangedValue
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Markup;
namespace Microsoft.Iris.ModelItems
{
internal class IntRangedValue :
RangedValue,
IUIIntRangedValue,
IUIRangedValue,
IUIValueRange,
INotifyObject
{
public IntRangedValue()
: base(int.MinValue, int.MaxValue, 1f)
{
}
}
}
@@ -0,0 +1,14 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.InvokePriority
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
namespace Microsoft.Iris.ModelItems
{
internal enum InvokePriority
{
Normal,
Low,
}
}
@@ -0,0 +1,33 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.LayoutOutput
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using Microsoft.Iris.Render;
namespace Microsoft.Iris.ModelItems
{
internal class LayoutOutput : NotifyObjectBase
{
private Size _size;
public LayoutOutput(Size size) => _size = size;
public Size Size
{
get => _size;
private set
{
if (!(_size != value))
return;
_size = value;
FireNotification(NotificationID.Size);
}
}
public void OnLayoutComplete(Size size) => Size = size;
}
}
+111
View File
@@ -0,0 +1,111 @@
// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.ModelItems.NotifyList
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Data;
using Microsoft.Iris.Library;
using Microsoft.Iris.Markup;
using System;
using System.Collections;
namespace Microsoft.Iris.ModelItems
{
internal class NotifyList : NotifyObjectBase, INotifyList, IList, ICollection, IEnumerable
{
private IList _source;
public NotifyList()
: this(new ArrayList())
{
}
public NotifyList(IList source) => _source = source;
public int Add(object value)
{
int newIndex = _source.Add(value);
FireSetChanged(UIListContentsChangeType.Add, -1, newIndex);
FireNotification(NotificationID.Count);
return newIndex;
}
public void Clear()
{
_source.Clear();
FireSetChanged(UIListContentsChangeType.Clear, -1, -1);
FireNotification(NotificationID.Count);
}
public bool Contains(object value) => _source.Contains(value);
public int IndexOf(object value) => _source.IndexOf(value);
public void Insert(int index, object value)
{
_source.Insert(index, value);
FireSetChanged(UIListContentsChangeType.Insert, -1, index);
FireNotification(NotificationID.Count);
}
public void Remove(object value)
{
int index = IndexOf(value);
if (index == -1)
return;
RemoveAt(index);
}
public void RemoveAt(int index)
{
object obj = this[index];
_source.RemoveAt(index);
FireSetChanged(UIListContentsChangeType.Remove, index, -1);
FireNotification(NotificationID.Count);
}
public bool IsFixedSize => false;
public bool IsReadOnly => false;
public object this[int index]
{
get => _source[index];
set
{
if (_source[index] == value)
return;
_source[index] = value;
FireSetChanged(UIListContentsChangeType.Modified, index, index);
}
}
public void CopyTo(Array array, int index) => _source.CopyTo(array, index);
public int Count => _source.Count;
public bool IsSynchronized => false;
public object SyncRoot => _source.SyncRoot;
public IEnumerator GetEnumerator() => _source.GetEnumerator();
public void Move(int oldIndex, int newIndex)
{
object obj = this[oldIndex];
_source.RemoveAt(oldIndex);
_source.Insert(newIndex, obj);
FireSetChanged(UIListContentsChangeType.Move, oldIndex, newIndex);
}
public event UIListContentsChangedHandler ContentsChanged;
private void FireSetChanged(UIListContentsChangeType type, int oldIndex, int newIndex)
{
if (ContentsChanged == null)
return;
ContentsChanged(this, new UIListContentsChangedArgs(type, oldIndex, newIndex));
}
}
}

Some files were not shown because too many files have changed in this diff Show More