diff --git a/UIX/Microsoft/Iris/Accessibility/Accessible.cs b/UIX/Microsoft/Iris/Accessibility/Accessible.cs index 8105466..99025de 100644 --- a/UIX/Microsoft/Iris/Accessibility/Accessible.cs +++ b/UIX/Microsoft/Iris/Accessibility/Accessible.cs @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Accessibility private static readonly DataCookie s_popupStateSlot = DataCookie.ReserveSlot(); private static readonly DataCookie s_multiSelectableStateSlot = DataCookie.ReserveSlot(); - public Accessible() => this.SetData(Accessible.s_roleSlot, (object)AccRole.Client); + public Accessible() => this.SetData(Accessible.s_roleSlot, AccRole.Client); public void Attach(AccessibleProxy proxy) { @@ -51,8 +51,8 @@ namespace Microsoft.Iris.Accessibility public void Detach() { - this.SetData(Accessible.s_defaultActionCommandSlot, (object)null); - this._proxy = (AccessibleProxy)null; + this.SetData(Accessible.s_defaultActionCommandSlot, null); + this._proxy = null; } public bool Enabled => this._proxy != null; @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Accessibility string description = this.Description; if (!(value != description)) return; - this.SetData(Accessible.s_descriptionSlot, (object)value); + this.SetData(Accessible.s_descriptionSlot, value); this.FireAccessiblePropertyChanged(NotificationID.Description, AccessibleProperty.Description); } } @@ -78,7 +78,7 @@ namespace Microsoft.Iris.Accessibility string defaultAction = this.DefaultAction; if (!(value != defaultAction)) return; - this.SetData(Accessible.s_defaultActionSlot, (object)value); + this.SetData(Accessible.s_defaultActionSlot, value); this.FireAccessiblePropertyChanged(NotificationID.DefaultAction, AccessibleProperty.DefaultAction); } } @@ -91,7 +91,7 @@ namespace Microsoft.Iris.Accessibility IUICommand defaultActionCommand = this.DefaultActionCommand; if (value == defaultActionCommand) return; - this.SetData(Accessible.s_defaultActionCommandSlot, (object)value); + this.SetData(Accessible.s_defaultActionCommandSlot, value); this.FireAccessiblePropertyChanged(NotificationID.DefaultActionCommand, AccessibleProperty.DefaultActionCommand); } } @@ -104,7 +104,7 @@ namespace Microsoft.Iris.Accessibility string help = this.Help; if (!(value != help)) return; - this.SetData(Accessible.s_helpSlot, (object)value); + this.SetData(Accessible.s_helpSlot, value); this.FireAccessiblePropertyChanged(NotificationID.Help, AccessibleProperty.Help); } } @@ -121,7 +121,7 @@ namespace Microsoft.Iris.Accessibility int helpTopic = this.HelpTopic; if (value == helpTopic) return; - this.SetData(Accessible.s_helpTopicSlot, (object)value); + this.SetData(Accessible.s_helpTopicSlot, value); this.FireAccessiblePropertyChanged(NotificationID.HelpTopic, AccessibleProperty.HelpTopic); } } @@ -134,7 +134,7 @@ namespace Microsoft.Iris.Accessibility string keyboardShortcut = this.KeyboardShortcut; if (!(value != keyboardShortcut)) return; - this.SetData(Accessible.s_keyboardShortcutSlot, (object)value); + this.SetData(Accessible.s_keyboardShortcutSlot, value); this.FireAccessiblePropertyChanged(NotificationID.KeyboardShortcut, AccessibleProperty.KeyboardShortcut); } } @@ -147,7 +147,7 @@ namespace Microsoft.Iris.Accessibility string name = this.Name; if (!(value != name)) return; - this.SetData(Accessible.s_nameSlot, (object)value); + this.SetData(Accessible.s_nameSlot, value); this.FireAccessiblePropertyChanged(NotificationID.Name, AccessibleProperty.Name); } } @@ -164,7 +164,7 @@ namespace Microsoft.Iris.Accessibility AccRole role = this.Role; if (value == role) return; - this.SetData(Accessible.s_roleSlot, (object)value); + this.SetData(Accessible.s_roleSlot, value); this.FireAccessiblePropertyChanged(NotificationID.Role, AccessibleProperty.Role); } } @@ -177,7 +177,7 @@ namespace Microsoft.Iris.Accessibility string str = this.Value; if (!(value != str)) return; - this.SetData(Accessible.s_valueSlot, (object)value); + this.SetData(Accessible.s_valueSlot, value); this.FireAccessiblePropertyChanged(NotificationID.Value, AccessibleProperty.Value); } } @@ -194,7 +194,7 @@ namespace Microsoft.Iris.Accessibility bool isAnimated = this.IsAnimated; if (value == isAnimated) return; - this.SetData(Accessible.s_animatedStateSlot, (object)value); + this.SetData(Accessible.s_animatedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsAnimated, AccessibleProperty.IsAnimated); } } @@ -211,7 +211,7 @@ namespace Microsoft.Iris.Accessibility bool isUnavailable = this.IsUnavailable; if (value == isUnavailable) return; - this.SetData(Accessible.s_unavailableStateSlot, (object)value); + this.SetData(Accessible.s_unavailableStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsUnavailable, AccessibleProperty.IsUnavailable); } } @@ -228,7 +228,7 @@ namespace Microsoft.Iris.Accessibility bool isSelected = this.IsSelected; if (value == isSelected) return; - this.SetData(Accessible.s_selectedStateSlot, (object)value); + this.SetData(Accessible.s_selectedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsSelected, AccessibleProperty.IsSelected); } } @@ -245,7 +245,7 @@ namespace Microsoft.Iris.Accessibility bool isBusy = this.IsBusy; if (value == isBusy) return; - this.SetData(Accessible.s_busyStateSlot, (object)value); + this.SetData(Accessible.s_busyStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsBusy, AccessibleProperty.IsBusy); } } @@ -262,7 +262,7 @@ namespace Microsoft.Iris.Accessibility bool isPressed = this.IsPressed; if (value == isPressed) return; - this.SetData(Accessible.s_pressedStateSlot, (object)value); + this.SetData(Accessible.s_pressedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsPressed, AccessibleProperty.IsPressed); } } @@ -279,7 +279,7 @@ namespace Microsoft.Iris.Accessibility bool isChecked = this.IsChecked; if (value == isChecked) return; - this.SetData(Accessible.s_checkedStateSlot, (object)value); + this.SetData(Accessible.s_checkedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsChecked, AccessibleProperty.IsChecked); } } @@ -296,7 +296,7 @@ namespace Microsoft.Iris.Accessibility bool isCollapsed = this.IsCollapsed; if (value == isCollapsed) return; - this.SetData(Accessible.s_collapsedStateSlot, (object)value); + this.SetData(Accessible.s_collapsedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsCollapsed, AccessibleProperty.IsCollapsed); } } @@ -313,7 +313,7 @@ namespace Microsoft.Iris.Accessibility bool isDefault = this.IsDefault; if (value == isDefault) return; - this.SetData(Accessible.s_defaultStateSlot, (object)value); + this.SetData(Accessible.s_defaultStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsDefault, AccessibleProperty.IsDefault); } } @@ -330,7 +330,7 @@ namespace Microsoft.Iris.Accessibility bool isMarquee = this.IsMarquee; if (value == isMarquee) return; - this.SetData(Accessible.s_marqueeStateSlot, (object)value); + this.SetData(Accessible.s_marqueeStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsMarquee, AccessibleProperty.IsMarquee); } } @@ -347,7 +347,7 @@ namespace Microsoft.Iris.Accessibility bool isMixed = this.IsMixed; if (value == isMixed) return; - this.SetData(Accessible.s_mixedStateSlot, (object)value); + this.SetData(Accessible.s_mixedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsMixed, AccessibleProperty.IsMixed); } } @@ -364,7 +364,7 @@ namespace Microsoft.Iris.Accessibility bool isExpanded = this.IsExpanded; if (value == isExpanded) return; - this.SetData(Accessible.s_expandedStateSlot, (object)value); + this.SetData(Accessible.s_expandedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsExpanded, AccessibleProperty.IsExpanded); } } @@ -381,7 +381,7 @@ namespace Microsoft.Iris.Accessibility bool isTraversed = this.IsTraversed; if (value == isTraversed) return; - this.SetData(Accessible.s_traversedStateSlot, (object)value); + this.SetData(Accessible.s_traversedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsTraversed, AccessibleProperty.IsTraversed); } } @@ -398,7 +398,7 @@ namespace Microsoft.Iris.Accessibility bool isSelectable = this.IsSelectable; if (value == isSelectable) return; - this.SetData(Accessible.s_selectableStateSlot, (object)value); + this.SetData(Accessible.s_selectableStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsSelectable, AccessibleProperty.IsSelectable); } } @@ -415,7 +415,7 @@ namespace Microsoft.Iris.Accessibility bool isMultiSelectable = this.IsMultiSelectable; if (value == isMultiSelectable) return; - this.SetData(Accessible.s_multiSelectableStateSlot, (object)value); + this.SetData(Accessible.s_multiSelectableStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsMultiSelectable, AccessibleProperty.IsMultiSelectable); } } @@ -432,7 +432,7 @@ namespace Microsoft.Iris.Accessibility bool isProtected = this.IsProtected; if (value == isProtected) return; - this.SetData(Accessible.s_protectedStateSlot, (object)value); + this.SetData(Accessible.s_protectedStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.IsProtected, AccessibleProperty.IsProtected); } } @@ -449,7 +449,7 @@ namespace Microsoft.Iris.Accessibility bool hasPopup = this.HasPopup; if (value == hasPopup) return; - this.SetData(Accessible.s_popupStateSlot, (object)value); + this.SetData(Accessible.s_popupStateSlot, value); this.FireAccessiblePropertyChanged(NotificationID.HasPopup, AccessibleProperty.HasPopup); } } @@ -467,7 +467,7 @@ namespace Microsoft.Iris.Accessibility { if (accessibleProperty == AccessibleProperty.Name) return; - ErrorManager.ReportWarning("Accessibility: Script modifications to the 'Accessible' object ('{0}' property) detected even though an Accessibility client is not is use. Use 'if (Accessible.Enabled) {{ ... }}' to bypass Accessible property access in this case", (object)propertyName); + ErrorManager.ReportWarning("Accessibility: Script modifications to the 'Accessible' object ('{0}' property) detected even though an Accessibility client is not is use. Use 'if (Accessible.Enabled) {{ ... }}' to bypass Accessible property access in this case", propertyName); } } diff --git a/UIX/Microsoft/Iris/Accessibility/AccessibleChildren.cs b/UIX/Microsoft/Iris/Accessibility/AccessibleChildren.cs index a97fc15..7c30e56 100644 --- a/UIX/Microsoft/Iris/Accessibility/AccessibleChildren.cs +++ b/UIX/Microsoft/Iris/Accessibility/AccessibleChildren.cs @@ -29,7 +29,7 @@ namespace Microsoft.Iris.Accessibility this._current = position; } - internal IEnumVARIANT Clone() => (IEnumVARIANT)new AccessibleChildren(this._proxy, this._current); + internal IEnumVARIANT Clone() => new AccessibleChildren(this._proxy, this._current); internal int Next(int count, object[] children) { @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Accessibility break; } UIClass child = (UIClass)this._proxy.UI.Children[this._current]; - children[index] = (object)child.AccessibleProxy; + children[index] = child.AccessibleProxy; ++index; } while (index < count); diff --git a/UIX/Microsoft/Iris/Accessibility/AccessibleProxy.cs b/UIX/Microsoft/Iris/Accessibility/AccessibleProxy.cs index ab8134a..0bc8f2e 100644 --- a/UIX/Microsoft/Iris/Accessibility/AccessibleProxy.cs +++ b/UIX/Microsoft/Iris/Accessibility/AccessibleProxy.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Accessibility this._ui = ui; this._data = data; this._data.Attach(this); - this._children = (IEnumVARIANT)new AccessibleChildren(this); + this._children = new AccessibleChildren(this); } internal UIClass UI => this._ui; @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Accessibility internal void Detach() { this._data.Detach(); - this._ui = (UIClass)null; + this._ui = null; if (this._proxyID == -1) return; AccessibleProxy.s_proxyFromID.Remove(this._proxyID); @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Accessibility set => AccessibleProxy.s_accessibilityActive = true; } - internal virtual IAccessible Parent => this._ui.Parent != null ? (IAccessible)this._ui.Parent.AccessibleProxy : (IAccessible)null; + internal virtual IAccessible Parent => this._ui.Parent != null ? _ui.Parent.AccessibleProxy : null; internal int ChildCount => this._ui.Children.Count; @@ -157,7 +157,7 @@ namespace Microsoft.Iris.Accessibility internal virtual IAccessible Navigate(AccNavDirs navDir) { - UIClass resultUI = (UIClass)null; + UIClass resultUI = null; switch (navDir) { case AccNavDirs.Up: @@ -185,7 +185,7 @@ namespace Microsoft.Iris.Accessibility resultUI = (UIClass)this._ui.LastChild; break; } - return resultUI != null ? (IAccessible)resultUI.AccessibleProxy : (IAccessible)null; + return resultUI != null ? resultUI.AccessibleProxy : null; } internal void DoDefaultAction() @@ -290,10 +290,10 @@ namespace Microsoft.Iris.Accessibility private void QueueNotifyEvent(AccEvents eventType) { - object obj = (object)new object[2] + object obj = new object[2] { - (object) this, - (object) (int) eventType + this, + (int) eventType }; DeferredCall.Post(DispatchPriority.AppEvent, AccessibleProxy.s_notifyEventHandler, obj); } @@ -315,7 +315,7 @@ namespace Microsoft.Iris.Accessibility get { this.VerifyProxyAccess(); - return (object)this.Parent; + return Parent; } } @@ -323,7 +323,7 @@ namespace Microsoft.Iris.Accessibility { this.VerifyProxyAccess(); this.VerifySelfChildID(varChild); - return (object)this; + return this; } int IAccessible.accChildCount @@ -360,14 +360,14 @@ namespace Microsoft.Iris.Accessibility { this.VerifyProxyAccess(); this.VerifySelfChildID(varChild); - return (object)(int)this.Role; + return (int)this.Role; } object IAccessible.get_accState(object varChild) { this.VerifyProxyAccess(); this.VerifySelfChildID(varChild); - return (object)(int)this.State; + return (int)this.State; } string IAccessible.get_accHelp(object varChild) @@ -381,7 +381,7 @@ namespace Microsoft.Iris.Accessibility { this.VerifyProxyAccess(); this.VerifySelfChildID(varChild); - pszHelpFile = (string)null; + pszHelpFile = null; return this.HelpTopic; } @@ -397,7 +397,7 @@ namespace Microsoft.Iris.Accessibility get { this.VerifyProxyAccess(); - return this.HasFocus ? (object)0 : (object)null; + return this.HasFocus ? 0 : (object)null; } } @@ -407,7 +407,7 @@ namespace Microsoft.Iris.Accessibility { this.VerifyProxyAccess(); Marshal.ThrowExceptionForHR(-2147467263); - return (object)null; + return null; } } @@ -445,14 +445,14 @@ namespace Microsoft.Iris.Accessibility { this.VerifyProxyAccess(); this.VerifySelfChildID(varStart); - return (object)this.Navigate((AccNavDirs)navDir); + return this.Navigate((AccNavDirs)navDir); } object IAccessible.accHitTest(int xLeft, int yTop) { this.VerifyProxyAccess(); Marshal.ThrowExceptionForHR(-2147467263); - return (object)null; + return null; } void IAccessible.accDoDefaultAction(object varChild) diff --git a/UIX/Microsoft/Iris/Accessibility/RootAccessibleProxy.cs b/UIX/Microsoft/Iris/Accessibility/RootAccessibleProxy.cs index b3af402..94ead1d 100644 --- a/UIX/Microsoft/Iris/Accessibility/RootAccessibleProxy.cs +++ b/UIX/Microsoft/Iris/Accessibility/RootAccessibleProxy.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Accessibility internal override IAccessible Navigate(AccNavDirs navDir) { - IAccessible accessible = (IAccessible)null; + IAccessible accessible = null; switch (navDir) { case AccNavDirs.Up: @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Accessibility case AccNavDirs.Right: case AccNavDirs.Next: case AccNavDirs.Previous: - accessible = (IAccessible)this._clientBridge.accNavigate((int)navDir, (object)0); + accessible = (IAccessible)this._clientBridge.accNavigate((int)navDir, 0); break; case AccNavDirs.FirstChild: case AccNavDirs.LastChild: diff --git a/UIX/Microsoft/Iris/AggregateList.cs b/UIX/Microsoft/Iris/AggregateList.cs index 7037d14..50b183c 100644 --- a/UIX/Microsoft/Iris/AggregateList.cs +++ b/UIX/Microsoft/Iris/AggregateList.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris private IList[] _lists; public AggregateList() - : this((IList[])null) + : this(null) { } @@ -51,7 +51,7 @@ namespace Microsoft.Iris for (int index = 0; index < this._lists.Length; ++index) { if (this._lists[index] == null) - this._lists[index] = (IList)new ArrayList(); + this._lists[index] = new ArrayList(); IList list = this._lists[index]; if (list is INotifyList notifyList) notifyList.ContentsChanged += contentsChangedHandler; @@ -71,7 +71,7 @@ namespace Microsoft.Iris if (list is INotifyList notifyList) notifyList.ContentsChanged -= contentsChangedHandler; if (list is IVirtualList virtualList && virtualList.SlowDataRequestsEnabled) - virtualList.SlowDataAcquireCompleteHandler = (SlowDataAcquireCompleteHandler)null; + virtualList.SlowDataAcquireCompleteHandler = null; } } base.OnDispose(disposing); @@ -108,7 +108,7 @@ namespace Microsoft.Iris private bool ChildListSlowDataAcquired(IVirtualList childList, int index) { - this.NotifySlowDataAcquireComplete(this.ListIndexToMasterIndex((IList)childList, index)); + this.NotifySlowDataAcquireComplete(this.ListIndexToMasterIndex(childList, index)); return true; } @@ -171,7 +171,7 @@ namespace Microsoft.Iris { int num = 0; int index1 = 0; - list = (IList)null; + list = null; for (; index1 < this._lists.Length; ++index1) { list = this._lists[index1]; diff --git a/UIX/Microsoft/Iris/Animations/ActiveSequence.cs b/UIX/Microsoft/Iris/Animations/ActiveSequence.cs index dde7ada..af995f1 100644 --- a/UIX/Microsoft/Iris/Animations/ActiveSequence.cs +++ b/UIX/Microsoft/Iris/Animations/ActiveSequence.cs @@ -40,13 +40,13 @@ namespace Microsoft.Iris.Animations if (animationCollection != null) { foreach (DisposableObject disposableObject in animationCollection) - disposableObject.Dispose((object)this); + disposableObject.Dispose(this); this.FireComplete(false); } - this._session = (UISession)null; - this._animatableTarget = (IAnimatable)null; - this._template = (AnimationTemplate)null; - this._ready = (Vector)null; + this._session = null; + this._animatableTarget = null; + this._template = null; + this._ready = null; } public UISession Session => this._session; @@ -62,7 +62,7 @@ namespace Microsoft.Iris.Animations public void Play() { Vector ready = this._ready; - this._ready = (Vector)null; + this._ready = null; if (ready.Count > 0) { foreach (AnimationProxy animationProxy in ready) @@ -77,7 +77,7 @@ namespace Microsoft.Iris.Animations } } - public void Stop() => this.Stop((StopCommandSet)null); + public void Stop() => this.Stop(null); public void Stop(StopCommandSet stopSetCommand) { @@ -91,7 +91,7 @@ namespace Microsoft.Iris.Animations { if (!this.Session.IsValid) return; - DeferredCall.Post(DispatchPriority.High, new DeferredHandler(this.DeferredStop), (object)stopSetCommand); + DeferredCall.Post(DispatchPriority.High, new DeferredHandler(this.DeferredStop), stopSetCommand); } catch (InvalidOperationException ex) { @@ -126,7 +126,7 @@ namespace Microsoft.Iris.Animations internal void OnAttachChildAnimation(AnimationProxy child) { - child.DeclareOwner((object)this); + child.DeclareOwner(this); this._ready.Add(child); } @@ -138,8 +138,8 @@ namespace Microsoft.Iris.Animations if (animationCollection == null) return; animationCollection.Remove(child); - child.Dispose((object)this); - if ((double)this._lastProgress < (double)progress) + child.Dispose(this); + if (_lastProgress < (double)progress) this._lastProgress = progress; if (animationCollection != this._playing || animationCollection.Count != 0) return; @@ -151,13 +151,13 @@ namespace Microsoft.Iris.Animations private void FireComplete(bool notify) { if (this._playing != null) - this._playing = (Vector)null; + this._playing = null; this.OnStop(this._lastProgress, notify); } public StopCommandSet GetStopCommandSet() { - StopCommandSet stopCommandSet = (StopCommandSet)null; + StopCommandSet stopCommandSet = null; foreach (AnimationProxy animation in this.GetAnimationCollection()) { if (animation.HasDynamicKeyframes) @@ -258,8 +258,8 @@ namespace Microsoft.Iris.Animations else { Animation template = this._template as Animation; - if ((object)template != null) - stringBuilder.Append((object)template.Type); + if (template != null) + stringBuilder.Append(template.Type); else stringBuilder.Append(""); } @@ -285,7 +285,7 @@ namespace Microsoft.Iris.Animations ++this._playingCount; if (this._playingCount != 1 || this.AnimationStarted == null) return; - this.AnimationStarted((object)this, EventArgs.Empty); + this.AnimationStarted(this, EventArgs.Empty); } internal void OnStop(float progress, bool notify) @@ -293,12 +293,12 @@ namespace Microsoft.Iris.Animations --this._playingCount; if (notify && this._playingCount == 0) { - EventArgs e = (EventArgs)new AnimationCompleteArgs(progress); + EventArgs e = new AnimationCompleteArgs(progress); if (this.AnimationCompleted != null) - this.AnimationCompleted((object)this, e); + this.AnimationCompleted(this, e); if (this.AfterAnimationCompleted == null) return; - this.AfterAnimationCompleted((object)this, e); + this.AfterAnimationCompleted(this, e); } else { diff --git a/UIX/Microsoft/Iris/Animations/AlphaKeyframe.cs b/UIX/Microsoft/Iris/Animations/AlphaKeyframe.cs index 99f3b0d..e447af7 100644 --- a/UIX/Microsoft/Iris/Animations/AlphaKeyframe.cs +++ b/UIX/Microsoft/Iris/Animations/AlphaKeyframe.cs @@ -26,7 +26,7 @@ namespace Microsoft.Iris.Animations public override void MagnifyValue(float magnifyValue) { float num = this.Value * magnifyValue; - if ((double)num > 1.0) + if (num > 1.0) num = 1f; this.Value = num; } diff --git a/UIX/Microsoft/Iris/Animations/Animation.cs b/UIX/Microsoft/Iris/Animations/Animation.cs index b1b32b8..2422e68 100644 --- a/UIX/Microsoft/Iris/Animations/Animation.cs +++ b/UIX/Microsoft/Iris/Animations/Animation.cs @@ -32,8 +32,8 @@ namespace Microsoft.Iris.Animations public override object Clone() { Animation animation = new Animation(); - this.CloneWorker((AnimationTemplate)animation); - return (object)animation; + this.CloneWorker(animation); + return animation; } protected override void CloneWorker(AnimationTemplate rawAnimation) @@ -71,7 +71,7 @@ namespace Microsoft.Iris.Animations { if (!(this.CenterPointPercent != value)) return; - this.SetData(Animation.s_centerPointScaleProperty, (object)value); + this.SetData(Animation.s_centerPointScaleProperty, value); this.SetBit(Animation.Bits.CenterPointScale, true); } } @@ -83,7 +83,7 @@ namespace Microsoft.Iris.Animations { if (!(this.RotationAxis != value)) return; - this.SetData(Animation.s_rotationAxisProperty, (object)value); + this.SetData(Animation.s_rotationAxisProperty, value); this.SetBit(Animation.Bits.RotationAxis, true); } } @@ -98,7 +98,7 @@ namespace Microsoft.Iris.Animations ref AnimationArgs args) { this.PrepareToPlay(ref args); - return (AnimationTemplate)this; + return this; } public bool CanCache => true; diff --git a/UIX/Microsoft/Iris/Animations/AnimationArgs.cs b/UIX/Microsoft/Iris/Animations/AnimationArgs.cs index d7105ca..e5fd41d 100644 --- a/UIX/Microsoft/Iris/Animations/AnimationArgs.cs +++ b/UIX/Microsoft/Iris/Animations/AnimationArgs.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Animations public AnimationArgs(Camera cam) { - this.ViewItem = (ViewItem)null; + this.ViewItem = null; this.OldPosition = Vector3.Zero; this.OldSize = Vector2.Zero; this.OldScale = Vector3.Zero; diff --git a/UIX/Microsoft/Iris/Animations/AnimationHandle.cs b/UIX/Microsoft/Iris/Animations/AnimationHandle.cs index bc41b66..6be6c50 100644 --- a/UIX/Microsoft/Iris/Animations/AnimationHandle.cs +++ b/UIX/Microsoft/Iris/Animations/AnimationHandle.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Animations internal void FireCompleted() { if (this.Completed != null) - this.Completed((object)this, EventArgs.Empty); + this.Completed(this, EventArgs.Empty); this.FireNotification(NotificationID.Completed); } diff --git a/UIX/Microsoft/Iris/Animations/AnimationManager.cs b/UIX/Microsoft/Iris/Animations/AnimationManager.cs index 6e338a3..8e86702 100644 --- a/UIX/Microsoft/Iris/Animations/AnimationManager.cs +++ b/UIX/Microsoft/Iris/Animations/AnimationManager.cs @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Animations public void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Animations if (!inDisposeFlag) return; foreach (DisposableObject orphan in this._orphans) - orphan.Dispose((object)this); + orphan.Dispose(this); this._orphans.Clear(); } @@ -83,26 +83,26 @@ namespace Microsoft.Iris.Animations internal IKeyframeAnimation BuildAnimation(AnimationProxy owner) { this.ValidateConnected(); - IKeyframeAnimation keyframeAnimation = (IKeyframeAnimation)null; + IKeyframeAnimation keyframeAnimation = null; switch (owner.Type) { case AnimationType.Position: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultPositionInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultPositionInput); break; case AnimationType.Size: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultSizeInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultSizeInput); break; case AnimationType.Alpha: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultAlphaInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultAlphaInput); break; case AnimationType.Scale: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultScaleInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultScaleInput); break; case AnimationType.Rotate: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultRotationInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultRotationInput); break; case AnimationType.Orientation: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultOrientationInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultOrientationInput); break; case AnimationType.PositionX: case AnimationType.PositionY: @@ -111,28 +111,28 @@ namespace Microsoft.Iris.Animations case AnimationType.ScaleX: case AnimationType.ScaleY: case AnimationType.Float: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultFloatInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultFloatInput); break; case AnimationType.Vector2: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultVector2Input); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector2Input); break; case AnimationType.Vector3: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultVector3Input); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector3Input); break; case AnimationType.Vector4: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultVector4Input); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector4Input); break; case AnimationType.CameraEye: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultCameraEyeInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraEyeInput); break; case AnimationType.CameraAt: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultCameraAtInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraAtInput); break; case AnimationType.CameraUp: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultCameraUpInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraUpInput); break; case AnimationType.CameraZn: - keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation((object)owner, (AnimationInput)AnimationManager.s_defaultCameraZnInput); + keyframeAnimation = this._session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraZnInput); break; } return keyframeAnimation; diff --git a/UIX/Microsoft/Iris/Animations/AnimationProxy.cs b/UIX/Microsoft/Iris/Animations/AnimationProxy.cs index 85040b4..2849878 100644 --- a/UIX/Microsoft/Iris/Animations/AnimationProxy.cs +++ b/UIX/Microsoft/Iris/Animations/AnimationProxy.cs @@ -46,8 +46,8 @@ namespace Microsoft.Iris.Animations { this._animation.RepeatCount = loopCount; this._animation.AsyncNotifyEvent += new AsyncNotifyHandler(this.OnAsyncNotification); - this._animation.AddStageEvent(AnimationStage.Complete, new AnimationEvent((IActivatable)this._animation, "AsyncNotify", 1U)); - this._animation.AddStageEvent(AnimationStage.Reset, new AnimationEvent((IActivatable)this._animation, "AsyncNotify", 2U)); + this._animation.AddStageEvent(AnimationStage.Complete, new AnimationEvent(_animation, "AsyncNotify", 1U)); + this._animation.AddStageEvent(AnimationStage.Reset, new AnimationEvent(_animation, "AsyncNotify", 2U)); this.SetStopCommand(stopCmd); this._activeSequence.OnAttachChildAnimation(this); } @@ -78,19 +78,19 @@ namespace Microsoft.Iris.Animations { this._dynamicFlag = true; animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); - if (keyframe.Multiply && (double)value != 1.0) + if (keyframe.Multiply && value != 1.0) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); + AnimationInput animationInput2 = new ConstantAnimationInput(value); animationInput1 *= animationInput2; } - else if (!keyframe.Multiply && (double)value != 0.0) + else if (!keyframe.Multiply && value != 0.0) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); + AnimationInput animationInput2 = new ConstantAnimationInput(value); animationInput1 += animationInput2; } } else - animationInput1 = (AnimationInput)new ConstantAnimationInput(value); + animationInput1 = new ConstantAnimationInput(value); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation))); } @@ -104,17 +104,17 @@ namespace Microsoft.Iris.Animations animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); if (keyframe.Multiply && value != Vector2.UnitVector) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); + AnimationInput animationInput2 = new ConstantAnimationInput(value); animationInput1 *= animationInput2; } else if (!keyframe.Multiply && value != Vector2.Zero) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); + AnimationInput animationInput2 = new ConstantAnimationInput(value); animationInput1 += animationInput2; } } else - animationInput1 = (AnimationInput)new ConstantAnimationInput(value); + animationInput1 = new ConstantAnimationInput(value); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation))); } @@ -128,17 +128,17 @@ namespace Microsoft.Iris.Animations animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); if (keyframe.Multiply && value != Vector3.UnitVector) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); + AnimationInput animationInput2 = new ConstantAnimationInput(value); animationInput1 *= animationInput2; } else if (!keyframe.Multiply && value != Vector3.Zero) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); + AnimationInput animationInput2 = new ConstantAnimationInput(value); animationInput1 += animationInput2; } } else - animationInput1 = (AnimationInput)new ConstantAnimationInput(value); + animationInput1 = new ConstantAnimationInput(value); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation))); } @@ -152,17 +152,17 @@ namespace Microsoft.Iris.Animations animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); if (keyframe.Multiply && value != Vector4.UnitVector) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); + AnimationInput animationInput2 = new ConstantAnimationInput(value); animationInput1 *= animationInput2; } else if (!keyframe.Multiply && value != Vector4.Zero) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(value); + AnimationInput animationInput2 = new ConstantAnimationInput(value); animationInput1 += animationInput2; } } else - animationInput1 = (AnimationInput)new ConstantAnimationInput(value); + animationInput1 = new ConstantAnimationInput(value); this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, AnimationProxy.GenerateInterpolation(keyframe.Interpolation))); } @@ -182,12 +182,12 @@ namespace Microsoft.Iris.Animations animationInput1 = keyframe.RelativeTo.CreateAnimationInput(this._animatableTarget, this._rendererProperty.Property, this._rendererProperty.SourceMask); if (value != Rotation.Default) { - AnimationInput animationInput2 = (AnimationInput)new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians)); + AnimationInput animationInput2 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians)); animationInput1 *= animationInput2; } } else - animationInput1 = (AnimationInput)new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians)); + animationInput1 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians)); AnimationInterpolation interpolation = AnimationProxy.GenerateInterpolation(keyframe.Interpolation); interpolation.UseSphericalCombination = true; this._animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, interpolation)); @@ -266,7 +266,7 @@ namespace Microsoft.Iris.Animations { if (!this.Session.IsValid) return; - DeferredCall.Post(DispatchPriority.Housekeeping, AnimationProxy.s_deferredCleanupWorker, (object)this); + DeferredCall.Post(DispatchPriority.Housekeeping, AnimationProxy.s_deferredCleanupWorker, this); } } @@ -276,10 +276,10 @@ namespace Microsoft.Iris.Animations if (this._animation != null) { this._animation.AsyncNotifyEvent -= new AsyncNotifyHandler(this.OnAsyncNotification); - this._animation.UnregisterUsage((object)this); - this._animation = (IKeyframeAnimation)null; + this._animation.UnregisterUsage(this); + this._animation = null; } - this._animatableTarget = (IAnimatable)null; + this._animatableTarget = null; if (!withNotifications) return; this._activeSequence.OnDetachChildAnimation(this, progress); @@ -291,29 +291,29 @@ namespace Microsoft.Iris.Animations Interpolation interpolation) { if (interpolation == null) - return (AnimationInterpolation)new LinearInterpolation(); + return new LinearInterpolation(); switch (interpolation.Type) { case InterpolationType.Linear: - return (AnimationInterpolation)new LinearInterpolation(); + return new LinearInterpolation(); case InterpolationType.SCurve: - return (AnimationInterpolation)new SCurveInterpolation(interpolation.Weight * 10f); + return new SCurveInterpolation(interpolation.Weight * 10f); case InterpolationType.Exp: - return (double)interpolation.Weight > 0.0 ? (AnimationInterpolation)new ExponentialInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation(); + return interpolation.Weight > 0.0 ? new ExponentialInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation(); case InterpolationType.Log: - return (double)interpolation.Weight > 0.0 ? (AnimationInterpolation)new LogarithmicInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation(); + return interpolation.Weight > 0.0 ? new LogarithmicInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation(); case InterpolationType.Sine: - return (AnimationInterpolation)new SineInterpolation(); + return new SineInterpolation(); case InterpolationType.Cosine: - return (AnimationInterpolation)new CosineInterpolation(); + return new CosineInterpolation(); case InterpolationType.Bezier: - return (AnimationInterpolation)new BezierInterpolation(interpolation.BezierHandle1, interpolation.BezierHandle2); + return new BezierInterpolation(interpolation.BezierHandle1, interpolation.BezierHandle2); case InterpolationType.EaseIn: - return (AnimationInterpolation)new EaseInInterpolation(interpolation.Weight * 10f, interpolation.EasePercent); + return new EaseInInterpolation(interpolation.Weight * 10f, interpolation.EasePercent); case InterpolationType.EaseOut: - return (AnimationInterpolation)new EaseOutInterpolation(interpolation.Weight * 10f, interpolation.EasePercent); + return new EaseOutInterpolation(interpolation.Weight * 10f, interpolation.EasePercent); default: - return (AnimationInterpolation)new LinearInterpolation(); + return new LinearInterpolation(); } } diff --git a/UIX/Microsoft/Iris/Animations/AnimationSystem.cs b/UIX/Microsoft/Iris/Animations/AnimationSystem.cs index 32d7b88..5ee7e1c 100644 --- a/UIX/Microsoft/Iris/Animations/AnimationSystem.cs +++ b/UIX/Microsoft/Iris/Animations/AnimationSystem.cs @@ -25,11 +25,11 @@ namespace Microsoft.Iris.Animations public static AnimationTemplate GetSequenceByID(string id) { if (!AnimationSystem.Enabled) - return (AnimationTemplate)null; - return AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : (AnimationTemplate)null; + return null; + return AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : null; } - public static AnimationTemplate GetSequenceByIDAlways(string id) => AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : (AnimationTemplate)null; + public static AnimationTemplate GetSequenceByIDAlways(string id) => AnimationSystem.SequenceExists(id) ? (AnimationTemplate)AnimationSystem._sequences[id].Clone() : null; public static void AddSequenceByID(string id, AnimationTemplate seq) { @@ -40,7 +40,7 @@ namespace Microsoft.Iris.Animations public static void ClearSequences() => AnimationSystem._sequences = new Dictionary(); - public static ICollection GetAllSequences() => (ICollection)AnimationSystem._sequences.Values; + public static ICollection GetAllSequences() => _sequences.Values; public static bool Enabled => AnimationSystem._enabledFlag; diff --git a/UIX/Microsoft/Iris/Animations/AnimationTemplate.cs b/UIX/Microsoft/Iris/Animations/AnimationTemplate.cs index 39bdc53..57ae029 100644 --- a/UIX/Microsoft/Iris/Animations/AnimationTemplate.cs +++ b/UIX/Microsoft/Iris/Animations/AnimationTemplate.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Animations private StopCommandSet _StopCommandSet; public AnimationTemplate() - : this((string)null) + : this(null) { } @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Animations public ActiveSequence Play(ViewItem vi) { AnimationArgs args = new AnimationArgs(vi); - return this.Play(vi.RendererVisual, ref args, (EventHandler)null); + return this.Play(vi.RendererVisual, ref args, null); } public ActiveSequence Play( @@ -58,7 +58,7 @@ namespace Microsoft.Iris.Animations ref AnimationArgs args, EventHandler onCompleteHandler) { - ActiveSequence instance = this.CreateInstance((IAnimatable)visualTarget, ref args); + ActiveSequence instance = this.CreateInstance(visualTarget, ref args); if (onCompleteHandler != null) instance.AnimationCompleted += onCompleteHandler; instance.Play(); @@ -73,7 +73,7 @@ namespace Microsoft.Iris.Animations if (this._keyframesList.Count == 0) { ErrorManager.ReportError("Animations must have at least 2 keyframes to play"); - return (ActiveSequence)null; + return null; } ActiveSequence aseq = new ActiveSequence(this, animatableTarget, UISession.Default); AnimationProxy[] animationProxyArray = new AnimationProxy[20]; @@ -84,7 +84,7 @@ namespace Microsoft.Iris.Animations int type = (int)keyframes.Type; keyframes.AddtoAnimation(this, aseq, property, ref args, ref animationProxyArray[type]); ++numArray[type]; - flagArray[type] |= (double)keyframes.Time == 0.0; + flagArray[type] |= keyframes.Time == 0.0; } for (int index = 0; index <= 19; ++index) { @@ -93,24 +93,24 @@ namespace Microsoft.Iris.Animations AnimationType animationType = (AnimationType)index; if (numArray[index] < 2) { - ErrorManager.ReportError("Animation must have at least 2 keyframes of each type. Attempted to play an animation that only has {0} keyframe of type '{1}'.", (object)numArray[index], (object)animationType); - return (ActiveSequence)null; + ErrorManager.ReportError("Animation must have at least 2 keyframes of each type. Attempted to play an animation that only has {0} keyframe of type '{1}'.", numArray[index], animationType); + return null; } if (!flagArray[index]) { - ErrorManager.ReportError("Animation must have a keyframe at time 0.0 for each type. Attempted to play an animation that has no start keyframe for type '{0}'", (object)animationType); - return (ActiveSequence)null; + ErrorManager.ReportError("Animation must have a keyframe at time 0.0 for each type. Attempted to play an animation that has no start keyframe for type '{0}'", animationType); + return null; } } } - return !aseq.ValidatePlayable() ? (ActiveSequence)null : aseq; + return !aseq.ValidatePlayable() ? null : aseq; } public ActiveSequence CreateInstance( IAnimatable animatableTarget, ref AnimationArgs args) { - return this.CreateInstance(animatableTarget, (string)null, ref args); + return this.CreateInstance(animatableTarget, null, ref args); } public void AddKeyframe(BaseKeyframe key) => this.InsertSorted(key); @@ -124,7 +124,7 @@ namespace Microsoft.Iris.Animations if (AnimationTemplate.IsSameTime(time, keyframes.Time)) return keyframes; } - return (BaseKeyframe)null; + return null; } public void RemoveKeyframe(float time) @@ -158,7 +158,7 @@ namespace Microsoft.Iris.Animations { AnimationTemplate anim = new AnimationTemplate(this._debugIDName); this.CloneWorker(anim); - return (object)anim; + return anim; } protected virtual void CloneWorker(AnimationTemplate anim) @@ -174,7 +174,7 @@ namespace Microsoft.Iris.Animations { for (int index = this._keyframesList.Count - 1; index >= 0; --index) { - if ((double)this._keyframesList[index].Time < (double)key.Time) + if (_keyframesList[index].Time < (double)key.Time) { this._keyframesList.Insert(index + 1, key); return; @@ -186,9 +186,9 @@ namespace Microsoft.Iris.Animations private static bool IsSameTime(float t1, float t2) { float num = t2 - t1; - if ((double)num < 0.0) + if (num < 0.0) num *= -1f; - return (double)num < 9.99999974737875E-05; + return num < 9.99999974737875E-05; } internal class AnimationTemplateComparer : IComparer diff --git a/UIX/Microsoft/Iris/Animations/BaseFloatKeyframe.cs b/UIX/Microsoft/Iris/Animations/BaseFloatKeyframe.cs index 0d98b49..50bc180 100644 --- a/UIX/Microsoft/Iris/Animations/BaseFloatKeyframe.cs +++ b/UIX/Microsoft/Iris/Animations/BaseFloatKeyframe.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Animations ref AnimationArgs args) { float effectiveValue = this.GetEffectiveValue(targetObject, this._value, ref args); - animation.AddFloatKeyframe((BaseKeyframe)this, effectiveValue); + animation.AddFloatKeyframe(this, effectiveValue); } public float Value @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Animations set => this._value = value; } - public override object ObjectValue => (object)this.Value; + public override object ObjectValue => Value; public virtual float GetEffectiveValue( IAnimatable targetObject, diff --git a/UIX/Microsoft/Iris/Animations/BaseKeyframe.cs b/UIX/Microsoft/Iris/Animations/BaseKeyframe.cs index 37e1682..3db384d 100644 --- a/UIX/Microsoft/Iris/Animations/BaseKeyframe.cs +++ b/UIX/Microsoft/Iris/Animations/BaseKeyframe.cs @@ -72,7 +72,7 @@ namespace Microsoft.Iris.Animations public BaseKeyframe Clone() => (BaseKeyframe)this.MemberwiseClone(); - object ICloneable.Clone() => (object)this.Clone(); + object ICloneable.Clone() => this.Clone(); protected abstract void PopulateAnimationWorker( IAnimatable targetObject, @@ -126,7 +126,7 @@ namespace Microsoft.Iris.Animations if (this._relative != RelativeTo.Absolute) { stringBuilder.Append(" RelativeTo=\""); - stringBuilder.Append((object)this._relative); + stringBuilder.Append(_relative); stringBuilder.Append("\""); } stringBuilder.Append(" Value=\""); diff --git a/UIX/Microsoft/Iris/Animations/BaseRotationKeyframe.cs b/UIX/Microsoft/Iris/Animations/BaseRotationKeyframe.cs index 6bf685e..49d7b74 100644 --- a/UIX/Microsoft/Iris/Animations/BaseRotationKeyframe.cs +++ b/UIX/Microsoft/Iris/Animations/BaseRotationKeyframe.cs @@ -21,7 +21,7 @@ namespace Microsoft.Iris.Animations ref AnimationArgs args) { Rotation effectiveValue = this.GetEffectiveValue(targetObject, this._valueRotation, ref args); - animation.AddRotationKeyframe((BaseKeyframe)this, effectiveValue); + animation.AddRotationKeyframe(this, effectiveValue); } public Rotation Value @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Animations set => this._valueRotation = value; } - public override object ObjectValue => (object)this.Value; + public override object ObjectValue => Value; public virtual Rotation GetEffectiveValue( IAnimatable targetObject, diff --git a/UIX/Microsoft/Iris/Animations/BaseVector2Keyframe.cs b/UIX/Microsoft/Iris/Animations/BaseVector2Keyframe.cs index 44ae4ba..e38ae17 100644 --- a/UIX/Microsoft/Iris/Animations/BaseVector2Keyframe.cs +++ b/UIX/Microsoft/Iris/Animations/BaseVector2Keyframe.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Animations ref AnimationArgs args) { Vector2 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args); - animation.AddVector2Keyframe((BaseKeyframe)this, effectiveValue); + animation.AddVector2Keyframe(this, effectiveValue); } public Vector2 Value @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Animations set => this._valueVector = value; } - public override object ObjectValue => (object)this.Value; + public override object ObjectValue => Value; public virtual Vector2 GetEffectiveValue( IAnimatable targetObject, diff --git a/UIX/Microsoft/Iris/Animations/BaseVector3Keyframe.cs b/UIX/Microsoft/Iris/Animations/BaseVector3Keyframe.cs index aa0e0b1..9752efa 100644 --- a/UIX/Microsoft/Iris/Animations/BaseVector3Keyframe.cs +++ b/UIX/Microsoft/Iris/Animations/BaseVector3Keyframe.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Animations ref AnimationArgs args) { Vector3 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args); - animation.AddVector3Keyframe((BaseKeyframe)this, effectiveValue); + animation.AddVector3Keyframe(this, effectiveValue); } public Vector3 Value @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Animations set => this._valueVector = value; } - public override object ObjectValue => (object)this.Value; + public override object ObjectValue => Value; public virtual Vector3 GetEffectiveValue( IAnimatable targetObject, diff --git a/UIX/Microsoft/Iris/Animations/BaseVector4Keyframe.cs b/UIX/Microsoft/Iris/Animations/BaseVector4Keyframe.cs index 0f966d4..fc30334 100644 --- a/UIX/Microsoft/Iris/Animations/BaseVector4Keyframe.cs +++ b/UIX/Microsoft/Iris/Animations/BaseVector4Keyframe.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Animations ref AnimationArgs args) { Vector4 effectiveValue = this.GetEffectiveValue(targetObject, this._valueVector, ref args); - animation.AddVector4Keyframe((BaseKeyframe)this, effectiveValue); + animation.AddVector4Keyframe(this, effectiveValue); } public Vector4 Value @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Animations set => this._valueVector = value; } - public override object ObjectValue => (object)this.Value; + public override object ObjectValue => Value; public virtual Vector4 GetEffectiveValue( IAnimatable targetObject, diff --git a/UIX/Microsoft/Iris/Animations/EffectAnimation.cs b/UIX/Microsoft/Iris/Animations/EffectAnimation.cs index 60d294e..73e1848 100644 --- a/UIX/Microsoft/Iris/Animations/EffectAnimation.cs +++ b/UIX/Microsoft/Iris/Animations/EffectAnimation.cs @@ -13,7 +13,7 @@ namespace Microsoft.Iris.Animations AnimationTemplate IAnimationProvider.Build( ref AnimationArgs args) { - return (AnimationTemplate)this; + return this; } public bool CanCache => true; diff --git a/UIX/Microsoft/Iris/Animations/Interpolation.cs b/UIX/Microsoft/Iris/Animations/Interpolation.cs index a4c9cfd..031a4f8 100644 --- a/UIX/Microsoft/Iris/Animations/Interpolation.cs +++ b/UIX/Microsoft/Iris/Animations/Interpolation.cs @@ -73,20 +73,20 @@ namespace Microsoft.Iris.Animations str = "Cosine"; break; case InterpolationType.Bezier: - str = "Bezier, " + (object)this.BezierHandle1 + ", " + (object)this.BezierHandle2; + str = "Bezier, " + BezierHandle1 + ", " + BezierHandle2; break; case InterpolationType.EaseIn: - str = "EaseIn, " + (object)this.Weight + ", " + (object)this.EasePercent; + str = "EaseIn, " + Weight + ", " + EasePercent; break; case InterpolationType.EaseOut: - str = "EaseOut, " + (object)this.Weight + ", " + (object)this.EasePercent; + str = "EaseOut, " + Weight + ", " + EasePercent; break; default: str = "Linear"; break; } - if ((double)this.Weight != 1.0) - str = str + ", " + (object)this.Weight; + if (Weight != 1.0) + str = str + ", " + Weight; return str; } @@ -96,7 +96,7 @@ namespace Microsoft.Iris.Animations if (obj is Interpolation) { Interpolation interpolation = (Interpolation)obj; - flag = this._type == interpolation._type && (double)this._weight == (double)interpolation._weight && ((double)this._bezierHandle1 == (double)interpolation._bezierHandle1 && (double)this._bezierHandle2 == (double)interpolation._bezierHandle2) && (double)this._easePercent == (double)interpolation._easePercent; + flag = this._type == interpolation._type && _weight == (double)interpolation._weight && (_bezierHandle1 == (double)interpolation._bezierHandle1 && _bezierHandle2 == (double)interpolation._bezierHandle2) && _easePercent == (double)interpolation._easePercent; } return flag; } diff --git a/UIX/Microsoft/Iris/Animations/MergeAnimation.cs b/UIX/Microsoft/Iris/Animations/MergeAnimation.cs index d544ab8..1777600 100644 --- a/UIX/Microsoft/Iris/Animations/MergeAnimation.cs +++ b/UIX/Microsoft/Iris/Animations/MergeAnimation.cs @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Animations public AnimationTemplate Build(ref AnimationArgs args) { if (this._cacheAnimation != null) - return (AnimationTemplate)this._cacheAnimation; + return _cacheAnimation; Animation animation = new Animation(); animation.Type = this._type; animation.DebugID = "Merge("; @@ -73,13 +73,13 @@ namespace Microsoft.Iris.Animations } } animation.DebugID += ")"; - TransformAnimation.DumpAnimation((AnimationTemplate)animation, "Result"); + TransformAnimation.DumpAnimation(animation, "Result"); if (this.CanCache) this._cacheAnimation = animation; - return (AnimationTemplate)animation; + return animation; } - protected void ClearCache() => this._cacheAnimation = (Animation)null; + protected void ClearCache() => this._cacheAnimation = null; public bool CanCache { diff --git a/UIX/Microsoft/Iris/Animations/OrphanedVisualCollection.cs b/UIX/Microsoft/Iris/Animations/OrphanedVisualCollection.cs index bcf2c77..6bbfef7 100644 --- a/UIX/Microsoft/Iris/Animations/OrphanedVisualCollection.cs +++ b/UIX/Microsoft/Iris/Animations/OrphanedVisualCollection.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Animations public OrphanedVisualCollection(AnimationManager aniManager) { - this.DeclareOwner((object)aniManager); + this.DeclareOwner(aniManager); this._orphansList = new Vector(); this._sequenceList = new Vector(); this._animationManager = aniManager; @@ -32,22 +32,22 @@ namespace Microsoft.Iris.Animations foreach (ActiveSequence sequence in this._sequenceList) { sequence.Stop(); - sequence.Dispose((object)this); + sequence.Dispose(this); } this._sequenceList.Clear(); foreach (IVisual orphans in this._orphansList) { orphans.Remove(); - orphans.UnregisterUsage((object)this); + orphans.UnregisterUsage(this); } this._orphansList.Clear(); - this._animationManager = (AnimationManager)null; + this._animationManager = null; base.OnDispose(); } public void AddOrphan(IVisual visual) { - visual.RegisterUsage((object)this); + visual.RegisterUsage(this); this._orphansList.Add(visual); } @@ -61,20 +61,20 @@ namespace Microsoft.Iris.Animations public void RegisterAnimation(ActiveSequence aseq, bool transfer) { if (transfer) - aseq.TransferOwnership((object)this); + aseq.TransferOwnership(this); else - aseq.DeclareOwner((object)this); + aseq.DeclareOwner(this); this._sequenceList.Add(aseq); } - public void OnLayoutApplyComplete() => this.OnEventComplete((object)null, EventArgs.Empty); + public void OnLayoutApplyComplete() => this.OnEventComplete(null, EventArgs.Empty); private void OnDestroyAnimationComplete(object sender, EventArgs args) { ActiveSequence activeSequence = sender as ActiveSequence; activeSequence.AnimationCompleted -= new EventHandler(this.OnDestroyAnimationComplete); this._sequenceList.Remove(activeSequence); - activeSequence.Dispose((object)this); + activeSequence.Dispose(this); this.OnEventComplete(sender, args); } @@ -85,11 +85,11 @@ namespace Microsoft.Iris.Animations return; if (this._animationManager != null) this._animationManager.UnregisterAnimatedOrphans(this); - this.Dispose((object)this._animationManager); + this.Dispose(_animationManager); } public bool Waiting => this._countEventsRemaining > 0; - public override string ToString() => InvariantString.Format("Orphans(WaitCount={0}, OrphanCount={1})", this._sequenceList != null ? (object)this._sequenceList.Count.ToString() : (object)"None", (object)this._orphansList.Count); + public override string ToString() => InvariantString.Format("Orphans(WaitCount={0}, OrphanCount={1})", this._sequenceList != null ? this._sequenceList.Count.ToString() : "None", _orphansList.Count); } } diff --git a/UIX/Microsoft/Iris/Animations/PositionKeyframe.cs b/UIX/Microsoft/Iris/Animations/PositionKeyframe.cs index 82bfdf6..a03ad4a 100644 --- a/UIX/Microsoft/Iris/Animations/PositionKeyframe.cs +++ b/UIX/Microsoft/Iris/Animations/PositionKeyframe.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Animations if (UISession.Default.IsRtl) { Vector2 vector2 = new Vector2(0.0f, 0.0f); - IVisualContainer visualContainer1 = (IVisualContainer)null; + IVisualContainer visualContainer1 = null; if (targetObject is IVisualContainer visualContainer) { vector2 = visualContainer.Size; @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Animations } else if (relativeTo is SnapshotRelativeTo snapshotRelativeTo) { - RectangleF rectangleF = args.ViewItem.TransformFromAncestor((ViewItem)null, snapshotRelativeTo.Bounds); + RectangleF rectangleF = args.ViewItem.TransformFromAncestor(null, snapshotRelativeTo.Bounds); baseValueVector = baseValueVector + args.NewPosition + new Vector3(rectangleF.X, rectangleF.Y, 0.0f) * args.NewScale; } return baseValueVector; diff --git a/UIX/Microsoft/Iris/Animations/ReferenceAnimation.cs b/UIX/Microsoft/Iris/Animations/ReferenceAnimation.cs index 93f916a..17cfa8c 100644 --- a/UIX/Microsoft/Iris/Animations/ReferenceAnimation.cs +++ b/UIX/Microsoft/Iris/Animations/ReferenceAnimation.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Animations protected virtual AnimationTemplate BuildWorker(ref AnimationArgs args) => this._sourceAnimation.Build(ref args); - public override string ToString() => InvariantString.Format("{0}({1})", (object)this.GetType().Name, (object)this.Source); + public override string ToString() => InvariantString.Format("{0}({1})", this.GetType().Name, Source); public virtual bool CanCache => this._sourceAnimation == null || this._sourceAnimation.CanCache; } diff --git a/UIX/Microsoft/Iris/Animations/RelativeTo.cs b/UIX/Microsoft/Iris/Animations/RelativeTo.cs index 4d745f1..a68ceb3 100644 --- a/UIX/Microsoft/Iris/Animations/RelativeTo.cs +++ b/UIX/Microsoft/Iris/Animations/RelativeTo.cs @@ -83,13 +83,13 @@ namespace Microsoft.Iris.Animations string defaultSourceProperty, string defaultSourcePropertyMask) { - IAnimatable sourceObject = (IAnimatable)null; - string sourcePropertyName = (string)null; - string sourceMaskSpec = (string)null; + IAnimatable sourceObject = null; + string sourcePropertyName = null; + string sourceMaskSpec = null; bool flag = true; if (this._sourceProperty != null) { - sourceObject = this._sourceId == 0 ? this._sourceObject : (IAnimatable)Application.MapExternalAnimationInput(this._sourceId); + sourceObject = this._sourceId == 0 ? this._sourceObject : Application.MapExternalAnimationInput(this._sourceId); if (sourceObject != null) { sourcePropertyName = this._sourceProperty; @@ -105,22 +105,22 @@ namespace Microsoft.Iris.Animations AnimationInput animationInput1; if (this.Snapshot == SnapshotPolicy.Continuous) { - animationInput1 = (AnimationInput)new ContinuousAnimationInput(sourceObject, sourcePropertyName, sourceMaskSpec); + animationInput1 = new ContinuousAnimationInput(sourceObject, sourcePropertyName, sourceMaskSpec); } else { CapturedAnimationInput capturedAnimationInput = new CapturedAnimationInput(sourceObject, sourcePropertyName, sourceMaskSpec); if (this.Snapshot == SnapshotPolicy.OnLoop) capturedAnimationInput.RefreshOnRepeat = true; - animationInput1 = (AnimationInput)capturedAnimationInput; + animationInput1 = capturedAnimationInput; } AnimationInput animationInput2 = animationInput1; for (int index = 1; index < this._power; ++index) animationInput2 *= animationInput1; - if ((double)this._multiply != 1.0) - animationInput2 *= (AnimationInput)new ConstantAnimationInput(this._multiply); - if ((double)this._add != 0.0) - animationInput2 += (AnimationInput)new ConstantAnimationInput(this._add); + if (_multiply != 1.0) + animationInput2 *= new ConstantAnimationInput(this._multiply); + if (_add != 0.0) + animationInput2 += new ConstantAnimationInput(this._add); return animationInput2; } @@ -132,7 +132,7 @@ namespace Microsoft.Iris.Animations return "Current"; if (this == RelativeTo.s_currentSnapshotOnLoop) return "CurrentSnapshotOnLoop"; - return this == RelativeTo.s_final ? "Final" : string.Format("[Object = {0}, Property = {1}]", this._sourceObject != null ? (object)this._sourceObject : (object)this._sourceId, (object)this._sourceProperty); + return this == RelativeTo.s_final ? "Final" : string.Format("[Object = {0}, Property = {1}]", this._sourceObject != null ? _sourceObject : (object)this._sourceId, _sourceProperty); } } } diff --git a/UIX/Microsoft/Iris/Animations/RendererProperty.cs b/UIX/Microsoft/Iris/Animations/RendererProperty.cs index e301b95..88a946b 100644 --- a/UIX/Microsoft/Iris/Animations/RendererProperty.cs +++ b/UIX/Microsoft/Iris/Animations/RendererProperty.cs @@ -15,8 +15,8 @@ namespace Microsoft.Iris.Animations public RendererProperty(string property) { this._property = property; - this._sourceMask = (string)null; - this._targetMask = (string)null; + this._sourceMask = null; + this._targetMask = null; } public RendererProperty(string property, string sourceMask, string targetMask) diff --git a/UIX/Microsoft/Iris/Animations/RotateKeyframe.cs b/UIX/Microsoft/Iris/Animations/RotateKeyframe.cs index 3752e23..c8fd2db 100644 --- a/UIX/Microsoft/Iris/Animations/RotateKeyframe.cs +++ b/UIX/Microsoft/Iris/Animations/RotateKeyframe.cs @@ -22,7 +22,7 @@ namespace Microsoft.Iris.Animations { if (this.RelativeTo == RelativeTo.Final) baseValueRotation.AngleRadians += args.NewRotation.AngleRadians; - if (UISession.Default.IsRtl && (double)baseValueRotation.Axis.Y <= 0.0 && (double)baseValueRotation.Axis.X <= 0.0) + if (UISession.Default.IsRtl && baseValueRotation.Axis.Y <= 0.0 && baseValueRotation.Axis.X <= 0.0) baseValueRotation.AngleRadians = -baseValueRotation.AngleRadians; return baseValueRotation; } diff --git a/UIX/Microsoft/Iris/Animations/ScaleKeyframe.cs b/UIX/Microsoft/Iris/Animations/ScaleKeyframe.cs index 80cec0b..74171eb 100644 --- a/UIX/Microsoft/Iris/Animations/ScaleKeyframe.cs +++ b/UIX/Microsoft/Iris/Animations/ScaleKeyframe.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Animations baseValueVector *= args.NewScale; else if (relativeTo is SnapshotRelativeTo snapshotRelativeTo) { - RectangleF rectangleF = args.ViewItem.TransformFromAncestor((ViewItem)null, snapshotRelativeTo.Bounds); + RectangleF rectangleF = args.ViewItem.TransformFromAncestor(null, snapshotRelativeTo.Bounds); baseValueVector = baseValueVector * args.NewScale * new Vector3(rectangleF.Width / args.NewSize.X, rectangleF.Height / args.NewSize.Y, 0.0f); } return baseValueVector; @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Animations private float MagnifyDimension(float dimensionValue, float magnifyValue) { - if ((double)dimensionValue != 1.0) + if (dimensionValue != 1.0) dimensionValue *= magnifyValue; return dimensionValue; } diff --git a/UIX/Microsoft/Iris/Animations/SwitchAnimation.cs b/UIX/Microsoft/Iris/Animations/SwitchAnimation.cs index 11bcc21..684524f 100644 --- a/UIX/Microsoft/Iris/Animations/SwitchAnimation.cs +++ b/UIX/Microsoft/Iris/Animations/SwitchAnimation.cs @@ -40,16 +40,16 @@ namespace Microsoft.Iris.Animations public AnimationTemplate Build(ref AnimationArgs args) { - AnimationTemplate animationTemplate = (AnimationTemplate)null; + AnimationTemplate animationTemplate = null; if (this._optionsList != null) { - object obj = (object)null; + object obj = null; if (this._expressionObject != null) obj = this._expressionObject.ObjectValue; - string key = (string)null; + string key = null; if (obj != null) key = obj.ToString(); - IAnimationProvider animationProvider = (IAnimationProvider)null; + IAnimationProvider animationProvider = null; if (key != null && this._optionsList.ContainsKey(key)) animationProvider = this._optionsList[key]; if (animationProvider != null) diff --git a/UIX/Microsoft/Iris/Animations/TransformAnimation.cs b/UIX/Microsoft/Iris/Animations/TransformAnimation.cs index 34e70b3..61ba366 100644 --- a/UIX/Microsoft/Iris/Animations/TransformAnimation.cs +++ b/UIX/Microsoft/Iris/Animations/TransformAnimation.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Animations get => this._timeScaleValue; set { - if ((double)this._timeScaleValue == (double)value) + if (_timeScaleValue == (double)value) return; this._timeScaleValue = value; this.ClearCache(); @@ -40,7 +40,7 @@ namespace Microsoft.Iris.Animations get => this._timeOffsetValue; set { - if ((double)this._timeOffsetValue == (double)value) + if (_timeOffsetValue == (double)value) return; this._timeOffsetValue = value; this.ClearCache(); @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Animations get => this._magnitudeValue; set { - if ((double)this._magnitudeValue == (double)value) + if (_magnitudeValue == (double)value) return; this._magnitudeValue = value; this.ClearCache(); @@ -78,9 +78,9 @@ namespace Microsoft.Iris.Animations float timeScale = this.GetTimeScale(ref args); float delayTime = this.GetDelayTime(ref args); float magnitude = this.GetMagnitude(ref args); - bool flag1 = (double)timeScale != 1.0; - bool flag2 = (double)delayTime != 0.0; - bool flag3 = (double)magnitude != 1.0; + bool flag1 = timeScale != 1.0; + bool flag2 = delayTime != 0.0; + bool flag3 = magnitude != 1.0; int filter = (int)this._filter; AnimationTemplate anim1 = base.BuildWorker(ref args); TransformAnimation.DumpAnimation(anim1, "Source"); @@ -128,8 +128,8 @@ namespace Microsoft.Iris.Animations { if (this.ShouldApplyTransform(keyframe)) { - if ((double)keyframe.Time == 0.0) - arrayList.Add((object)keyframe.Clone()); + if (keyframe.Time == 0.0) + arrayList.Add(keyframe.Clone()); keyframe.Time += timeOffsetValue; } } @@ -171,6 +171,6 @@ namespace Microsoft.Iris.Animations protected override void OnSourceChanged() => this.ClearCache(); - protected void ClearCache() => this._cacheAnimation = (AnimationTemplate)null; + protected void ClearCache() => this._cacheAnimation = null; } } diff --git a/UIX/Microsoft/Iris/Animations/TransformByAttributeAnimation.cs b/UIX/Microsoft/Iris/Animations/TransformByAttributeAnimation.cs index ee3e15a..85676cf 100644 --- a/UIX/Microsoft/Iris/Animations/TransformByAttributeAnimation.cs +++ b/UIX/Microsoft/Iris/Animations/TransformByAttributeAnimation.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Animations get => this._maxTimeScaleValue; set { - if ((double)this._maxTimeScaleValue == (double)value) + if (_maxTimeScaleValue == (double)value) return; this._maxTimeScaleValue = value; this.ClearCache(); @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Animations get => this._maxTimeOffsetValue; set { - if ((double)this._maxTimeOffsetValue == (double)value) + if (_maxTimeOffsetValue == (double)value) return; this._maxTimeOffsetValue = value; this.ClearCache(); @@ -62,7 +62,7 @@ namespace Microsoft.Iris.Animations get => this._maxMagnitudeValue; set { - if ((double)this._maxMagnitudeValue == (double)value) + if (_maxMagnitudeValue == (double)value) return; this._maxMagnitudeValue = value; this.ClearCache(); @@ -74,7 +74,7 @@ namespace Microsoft.Iris.Animations get => this._overrideValue; set { - if (this._haveOverrideFlag && (double)this._overrideValue == (double)value) + if (this._haveOverrideFlag && _overrideValue == (double)value) return; this._overrideValue = value; this._haveOverrideFlag = true; @@ -97,12 +97,12 @@ namespace Microsoft.Iris.Animations protected override float GetTimeScale(ref AnimationArgs args) { float timeScale = base.GetTimeScale(ref args); - if ((double)timeScale == 0.0) + if (timeScale == 0.0) return 1f; float val1 = 1f + this.GetValue(ref args) * timeScale; - if ((double)this._maxTimeScaleValue != 0.0) + if (_maxTimeScaleValue != 0.0) val1 = Math.Min(val1, this._maxTimeScaleValue); - if ((double)val1 < 0.0) + if (val1 < 0.0) val1 = 0.0f; return val1; } @@ -110,12 +110,12 @@ namespace Microsoft.Iris.Animations protected override float GetDelayTime(ref AnimationArgs args) { float delayTime = base.GetDelayTime(ref args); - if ((double)delayTime == 0.0) + if (delayTime == 0.0) return 0.0f; float val1 = this.GetValue(ref args) * delayTime; - if ((double)this._maxTimeOffsetValue != 0.0) + if (_maxTimeOffsetValue != 0.0) val1 = Math.Min(val1, this._maxTimeOffsetValue); - if ((double)val1 < 0.0) + if (val1 < 0.0) val1 = 0.0f; return val1; } @@ -123,10 +123,10 @@ namespace Microsoft.Iris.Animations protected override float GetMagnitude(ref AnimationArgs args) { float magnitude = base.GetMagnitude(ref args); - if ((double)magnitude == 0.0) + if (magnitude == 0.0) return 1f; float val1 = 1f + this.GetValue(ref args) * magnitude; - if ((double)this._maxMagnitudeValue != 0.0) + if (_maxMagnitudeValue != 0.0) val1 = Math.Min(val1, this._maxMagnitudeValue); return val1; } @@ -146,7 +146,7 @@ namespace Microsoft.Iris.Animations switch (this._attrib) { case TransformAttribute.Index: - return (float)this.GetIndex(ref args); + return this.GetIndex(ref args); case TransformAttribute.Width: return args.NewSize.X; case TransformAttribute.Height: @@ -165,7 +165,7 @@ namespace Microsoft.Iris.Animations int num = 0; ViewItem viewItem = args.ViewItem; if (viewItem != null && viewItem.Parent != null) - num = viewItem.Parent.Children.IndexOf((Microsoft.Iris.Library.TreeNode)viewItem); + num = viewItem.Parent.Children.IndexOf(viewItem); return num; } diff --git a/UIX/Microsoft/Iris/Animations/ValueTransformer.cs b/UIX/Microsoft/Iris/Animations/ValueTransformer.cs index fc1b944..7a814f7 100644 --- a/UIX/Microsoft/Iris/Animations/ValueTransformer.cs +++ b/UIX/Microsoft/Iris/Animations/ValueTransformer.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Animations value /= this._divide; value += this._add; value -= this._subtract; - if ((double)this._mod != 3.40282346638529E+38) + if (_mod != 3.40282346638529E+38) value %= this._mod; if (this._absolute) value = Math.Abs(value); diff --git a/UIX/Microsoft/Iris/Application.cs b/UIX/Microsoft/Iris/Application.cs index 8a6e6b1..8183bff 100644 --- a/UIX/Microsoft/Iris/Application.cs +++ b/UIX/Microsoft/Iris/Application.cs @@ -151,7 +151,7 @@ namespace Microsoft.Iris Application.s_renderType = RenderingType.DX9; break; default: - throw new ArgumentException(InvariantString.Format("Unknown graphics type {0}", (object)graphicsType)); + throw new ArgumentException(InvariantString.Format("Unknown graphics type {0}", graphicsType)); } if (graphicsType == GraphicsDeviceType.Gdi) Application.s_EnableAnimations = false; @@ -165,7 +165,7 @@ namespace Microsoft.Iris Application.s_soundType = SoundType.DirectSound; break; default: - throw new ArgumentException(InvariantString.Format("Unknown sound type {0}", (object)soundType)); + throw new ArgumentException(InvariantString.Format("Unknown sound type {0}", soundType)); } Application.s_session.InitializeRenderingDevices(graphicsType, (GraphicsRenderingQuality)Application.s_renderingQuality, soundType); Application.s_renderingQuality = (RenderingQuality)Application.s_session.RenderSession.GraphicsDevice.RenderingQuality; @@ -256,7 +256,7 @@ namespace Microsoft.Iris throw new ArgumentNullException(nameof(name)); if (MarkupDataProvider.GetDataProvider(name) != null) throw new ArgumentException("Provider is already registered"); - MarkupDataProvider.RegisterDataProvider((IDataProvider)new AssemblyDataProviderWrapper(name, factory)); + MarkupDataProvider.RegisterDataProvider(new AssemblyDataProviderWrapper(name, factory)); } public static void Run(DeferredInvokeHandler initialLoadComplete) @@ -269,7 +269,7 @@ namespace Microsoft.Iris UIApplication.Run(); } - public static void Run() => Application.Run((DeferredInvokeHandler)null); + public static void Run() => Application.Run(null); public static event EventHandler ShuttingDown; @@ -280,12 +280,12 @@ namespace Microsoft.Iris UIDispatcher.VerifyOnApplicationThread(); Application.s_isShuttingDown = true; if (Application.ShuttingDown != null) - Application.ShuttingDown((object)null, EventArgs.Empty); + Application.ShuttingDown(null, EventArgs.Empty); MarkupSystem.Shutdown(); if (Application.s_initializationState == Application.InitializationState.FullyInitialized) { Application.s_session.Dispose(); - Application.s_session = (UISession)null; + Application.s_session = null; } if (Application.s_initializationState == Application.InitializationState.InitializedWithoutUI) RenderApi.ShutdownForToolOnly(); @@ -295,7 +295,7 @@ namespace Microsoft.Iris Application.s_initializationState = Application.InitializationState.NotInitialized; } - public static void DeferredInvoke(DeferredInvokeHandler method, DeferredInvokePriority priority) => Application.DeferredInvoke(method, (object)null, priority); + public static void DeferredInvoke(DeferredInvokeHandler method, DeferredInvokePriority priority) => Application.DeferredInvoke(method, null, priority); public static void DeferredInvoke(DeferredInvokeHandler method, object args) => Application.DeferredInvoke(method, args, DeferredInvokePriority.Normal); @@ -316,12 +316,12 @@ namespace Microsoft.Iris priority1 = DispatchPriority.Idle; break; default: - throw new ArgumentException(InvariantString.Format("Unknown DeferredInvokePriority {0}", (object)priority)); + throw new ArgumentException(InvariantString.Format("Unknown DeferredInvokePriority {0}", priority)); } DeferredCall.Post(priority1, DeferredInvokeProxy.Thunk(method), args); } - public static void DeferredInvoke(DeferredInvokeHandler method, TimeSpan delay) => Application.DeferredInvoke(method, (object)null, delay); + public static void DeferredInvoke(DeferredInvokeHandler method, TimeSpan delay) => Application.DeferredInvoke(method, null, delay); public static void DeferredInvoke(DeferredInvokeHandler method, object args, TimeSpan delay) { @@ -330,7 +330,7 @@ namespace Microsoft.Iris DeferredCall.Post(delay, DeferredInvokeProxy.Thunk(method), args); } - public static void DeferredInvoke(Thread thread, DeferredInvokeHandler method) => Application.DeferredInvoke(thread, method, (object)null); + public static void DeferredInvoke(Thread thread, DeferredInvokeHandler method) => Application.DeferredInvoke(thread, method, null); public static void DeferredInvoke(Thread thread, DeferredInvokeHandler method, object args) { @@ -361,10 +361,10 @@ namespace Microsoft.Iris throw new InvalidOperationException("Thread already has a dispatcher running"); if (initialWork == null) throw new ArgumentNullException(nameof(initialWork)); - UIApplication.StartArgs startArgs = (UIApplication.StartArgs)null; + UIApplication.StartArgs startArgs = null; if (initialWork != null) startArgs = new UIApplication.StartArgs(DeferredInvokeProxy.Thunk(initialWork), initialWorkArgs); - UIApplication.StartDispatcher((object)startArgs); + UIApplication.StartDispatcher(startArgs); } public static Thread StartWorkerThreadWithMessagePump(string threadName) => UIApplication.StartThreadWithDispatcher(threadName); @@ -382,7 +382,7 @@ namespace Microsoft.Iris if (Application.s_idToExternalAnimationInput == null) Application.s_idToExternalAnimationInput = new Dictionary(); SimpleAnimationPropertyMap animationPropertyMap = new SimpleAnimationPropertyMap(propertyNameToId); - IExternalAnimationInput externalAnimationInput = Application.s_session.RenderSession.AnimationSystem.CreateExternalAnimationInput((object)Application.s_idToExternalAnimationInput, (IAnimationPropertyMap)animationPropertyMap); + IExternalAnimationInput externalAnimationInput = Application.s_session.RenderSession.AnimationSystem.CreateExternalAnimationInput(s_idToExternalAnimationInput, animationPropertyMap); Application.s_idToExternalAnimationInput.Add((int)externalAnimationInput.UniqueId, externalAnimationInput); return (int)externalAnimationInput.UniqueId; } @@ -394,19 +394,19 @@ namespace Microsoft.Iris if (Application.s_idToExternalAnimationInput == null || !Application.s_idToExternalAnimationInput.TryGetValue(animationId, out externalAnimationInput)) return; Application.s_idToExternalAnimationInput.Remove(animationId); - externalAnimationInput.UnregisterUsage((object)Application.s_idToExternalAnimationInput); + externalAnimationInput.UnregisterUsage(s_idToExternalAnimationInput); IAnimationInputProvider animationInputProvider; if (Application.s_animationProviders == null || !Application.s_animationProviders.TryGetValue(animationId, out animationInputProvider)) return; Application.s_animationProviders.Remove(animationId); - animationInputProvider.UnregisterUsage((object)Application.s_idToExternalAnimationInput); + animationInputProvider.UnregisterUsage(s_idToExternalAnimationInput); } internal static IExternalAnimationInput MapExternalAnimationInput( int animationId) { UIDispatcher.VerifyOnApplicationThread(); - IExternalAnimationInput externalAnimationInput = (IExternalAnimationInput)null; + IExternalAnimationInput externalAnimationInput = null; if (Application.s_idToExternalAnimationInput != null) Application.s_idToExternalAnimationInput.TryGetValue(animationId, out externalAnimationInput); return externalAnimationInput; @@ -421,7 +421,7 @@ namespace Microsoft.Iris IAnimationInputProvider provider; if (Application.s_animationProviders == null || !Application.s_animationProviders.TryGetValue(animationId, out provider)) { - provider = Application.MapExternalAnimationInput(animationId).CreateProvider((object)Application.s_idToExternalAnimationInput); + provider = Application.MapExternalAnimationInput(animationId).CreateProvider(s_idToExternalAnimationInput); if (Application.s_animationProviders == null) Application.s_animationProviders = new Dictionary(); Application.s_animationProviders.Add(animationId, provider); @@ -465,7 +465,7 @@ namespace Microsoft.Iris graphicsType = GraphicsDeviceType.Direct3D9; break; default: - throw new ArgumentException(InvariantString.Format("Unknown rendering type {0}", (object)type)); + throw new ArgumentException(InvariantString.Format("Unknown rendering type {0}", type)); } if (type == RenderingType.Default && !Application.s_session.IsGraphicsDeviceRecommended(graphicsType) || !Application.s_session.IsGraphicsDeviceAvailable(graphicsType)) graphicsType = GraphicsDeviceType.Gdi; @@ -477,7 +477,7 @@ namespace Microsoft.Iris if (typeRequested == SoundType.None) return SoundDeviceType.None; if (typeRequested != SoundType.DirectSound) - throw new ArgumentException(InvariantString.Format("Unknown sound type {0}", (object)typeRequested)); + throw new ArgumentException(InvariantString.Format("Unknown sound type {0}", typeRequested)); return Application.s_session.IsSoundDeviceAvailable(SoundDeviceType.DirectSound8) ? SoundDeviceType.DirectSound8 : SoundDeviceType.None; } @@ -494,7 +494,7 @@ namespace Microsoft.Iris { for (int index = 0; index < publicKey2.Length; ++index) { - if ((int)publicKey1[index] != (int)publicKey2[index]) + if (publicKey1[index] != publicKey2[index]) { flag = false; break; diff --git a/UIX/Microsoft/Iris/ArrayListDataSet.cs b/UIX/Microsoft/Iris/ArrayListDataSet.cs index 5ee9210..3ddac70 100644 --- a/UIX/Microsoft/Iris/ArrayListDataSet.cs +++ b/UIX/Microsoft/Iris/ArrayListDataSet.cs @@ -11,12 +11,12 @@ namespace Microsoft.Iris public class ArrayListDataSet : ListDataSet { public ArrayListDataSet() - : this((IModelItemOwner)null) + : this(null) { } public ArrayListDataSet(IModelItemOwner owner) - : base(owner, (IList)new ArrayList()) + : base(owner, new ArrayList()) { } } diff --git a/UIX/Microsoft/Iris/AssemblyDataProviderWrapper.cs b/UIX/Microsoft/Iris/AssemblyDataProviderWrapper.cs index 546b191..b1dcd5b 100644 --- a/UIX/Microsoft/Iris/AssemblyDataProviderWrapper.cs +++ b/UIX/Microsoft/Iris/AssemblyDataProviderWrapper.cs @@ -21,10 +21,10 @@ namespace Microsoft.Iris public string Name => this._name; - public MarkupDataQuery Build(MarkupDataQuerySchema querySchema) => (MarkupDataQuery)new AssemblyMarkupDataQuery(querySchema, this); + public MarkupDataQuery Build(MarkupDataQuerySchema querySchema) => new AssemblyMarkupDataQuery(querySchema, this); - public IDataProviderQuery ConstructQuery(object queryTypeCookie) => (IDataProviderQuery)this._factory(queryTypeCookie); + public IDataProviderQuery ConstructQuery(object queryTypeCookie) => this._factory(queryTypeCookie); - public override string ToString() => string.Format("{0} ({1})", (object)this._name, (object)this._factory); + public override string ToString() => string.Format("{0} ({1})", _name, _factory); } } diff --git a/UIX/Microsoft/Iris/Audio/Sound.cs b/UIX/Microsoft/Iris/Audio/Sound.cs index fb0908d..3fa2531 100644 --- a/UIX/Microsoft/Iris/Audio/Sound.cs +++ b/UIX/Microsoft/Iris/Audio/Sound.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Audio set { this._systemSoundEvent = value; - this._source = (string)null; + this._source = null; } } @@ -45,8 +45,8 @@ namespace Microsoft.Iris.Audio if (!Environment.Instance.SoundEffectsEnabled) return; SoundManager soundManager = UISession.Default.SoundManager; - ISoundBuffer soundBuffer = (ISoundBuffer)null; - string source = (string)null; + ISoundBuffer soundBuffer = null; + string source = null; if (this._source != null) source = this._source; else if (this._systemSoundEvent != SystemSoundEvent.None) @@ -55,9 +55,9 @@ namespace Microsoft.Iris.Audio soundBuffer = soundManager.GetSoundBuffer(source); if (soundBuffer == null) return; - ISound sound = soundBuffer.CreateSound((object)this); + ISound sound = soundBuffer.CreateSound(this); sound.Play(); - sound.UnregisterUsage((object)this); + sound.UnregisterUsage(this); } } } diff --git a/UIX/Microsoft/Iris/BooleanChoice.cs b/UIX/Microsoft/Iris/BooleanChoice.cs index 74ae7c8..6ffad19 100644 --- a/UIX/Microsoft/Iris/BooleanChoice.cs +++ b/UIX/Microsoft/Iris/BooleanChoice.cs @@ -28,21 +28,21 @@ namespace Microsoft.Iris } public BooleanChoice(IModelItemOwner owner, string description) - : this(owner, description, (IList)null) + : this(owner, description, null) { } public BooleanChoice(IModelItemOwner owner) - : this(owner, (string)null, (IList)null) + : this(owner, null, null) { } public BooleanChoice() - : this((IModelItemOwner)null) + : this(null) { } - internal override Microsoft.Iris.ModelItems.Choice CreateInternalChoice() => (Microsoft.Iris.ModelItems.Choice)new Microsoft.Iris.ModelItems.BooleanChoice(); + internal override Microsoft.Iris.ModelItems.Choice CreateInternalChoice() => new Microsoft.Iris.ModelItems.BooleanChoice(); public bool Value { diff --git a/UIX/Microsoft/Iris/Choice.cs b/UIX/Microsoft/Iris/Choice.cs index 3ef8d32..662569c 100644 --- a/UIX/Microsoft/Iris/Choice.cs +++ b/UIX/Microsoft/Iris/Choice.cs @@ -44,12 +44,12 @@ namespace Microsoft.Iris => this.Initialize(); public Choice(IModelItemOwner owner) - : this(owner, (string)null) + : this(owner, null) { } public Choice() - : this((IModelItemOwner)null) + : this(null) { } @@ -59,28 +59,28 @@ namespace Microsoft.Iris if (disposing) { this._notifier.ClearListeners(); - this._choice.Dispose((object)this); - this._listeners.Dispose((object)this); + this._choice.Dispose(this); + this._listeners.Dispose(this); } - this._choice = (Microsoft.Iris.ModelItems.Choice)null; + this._choice = null; } - object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => (object)this; + object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => this; - object AssemblyObjectProxyHelper.IAssemblyProxyObject.AssemblyObject => (object)this; + object AssemblyObjectProxyHelper.IAssemblyProxyObject.AssemblyObject => this; public IList Options { get { using (this.ThreadValidator) - return (IList)AssemblyLoadResult.UnwrapObject((object)this._choice.Options); + return (IList)AssemblyLoadResult.UnwrapObject(_choice.Options); } set { using (this.ThreadValidator) { - IList potentialOptionsWrapped = (IList)AssemblyLoadResult.WrapObject((object)value); + IList potentialOptionsWrapped = (IList)AssemblyLoadResult.WrapObject(value); this.ValidateOptionsList(potentialOptionsWrapped, value); this._choice.Options = potentialOptionsWrapped; } @@ -249,32 +249,32 @@ namespace Microsoft.Iris add { using (this.ThreadValidator) - this.AddEventHandler(Choice.s_chosenChangedEvent, (Delegate)value); + this.AddEventHandler(Choice.s_chosenChangedEvent, value); } remove { using (this.ThreadValidator) - this.RemoveEventHandler(Choice.s_chosenChangedEvent, (Delegate)value); + this.RemoveEventHandler(Choice.s_chosenChangedEvent, value); } } private void Initialize() { this._choice = this.CreateInternalChoice(); - this._choice.DeclareOwner((object)this); + this._choice.DeclareOwner(this); Vector listeners = new Vector(9); DelegateListener.OnNotifyCallback callback = new DelegateListener.OnNotifyCallback(this.OnInternalChoicePropertyChanged); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.Options, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.DefaultIndex, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.ChosenIndex, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.ChosenValue, new DelegateListener.OnNotifyCallback(this.OnChosenValueChanged))); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.Value, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.HasSelection, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.Wrap, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.HasPreviousValue, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._choice, NotificationID.HasNextValue, callback)); + listeners.Add(new DelegateListener(_choice, NotificationID.Options, callback)); + listeners.Add(new DelegateListener(_choice, NotificationID.DefaultIndex, callback)); + listeners.Add(new DelegateListener(_choice, NotificationID.ChosenIndex, callback)); + listeners.Add(new DelegateListener(_choice, NotificationID.ChosenValue, new DelegateListener.OnNotifyCallback(this.OnChosenValueChanged))); + listeners.Add(new DelegateListener(_choice, NotificationID.Value, callback)); + listeners.Add(new DelegateListener(_choice, NotificationID.HasSelection, callback)); + listeners.Add(new DelegateListener(_choice, NotificationID.Wrap, callback)); + listeners.Add(new DelegateListener(_choice, NotificationID.HasPreviousValue, callback)); + listeners.Add(new DelegateListener(_choice, NotificationID.HasNextValue, callback)); this._listeners = new CodeListeners(listeners); - this._listeners.DeclareOwner((object)this); + this._listeners.DeclareOwner(this); } protected override void OnPropertyChanged(string property) @@ -316,7 +316,7 @@ namespace Microsoft.Iris private void FireChangedChosenEvent() { if (this.GetEventHandler(Choice.s_chosenChangedEvent) is EventHandler eventHandler) - eventHandler((object)this, EventArgs.Empty); + eventHandler(this, EventArgs.Empty); this.OnChosenChanged(); } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllConstructorSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllConstructorSchema.cs index 7448e56..f5cb06f 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllConstructorSchema.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllConstructorSchema.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.CodeModel.Cpp private uint _id; public DllConstructorSchema(DllTypeSchema owner, uint ID) - : base((TypeSchema)owner) + : base(owner) => this._id = ID; public bool Load(IntPtr constructor) => this.QueryForParameterTypes(constructor); @@ -33,10 +33,10 @@ namespace Microsoft.Iris.CodeModel.Cpp string str2 = ""; if (this._parameterTypes[index] != null) str2 = this._parameterTypes[index].Name; - str1 = string.Format("{0}{1}{2}", (object)str1, index > 0 ? (object)", " : (object)string.Empty, (object)str2); + str1 = string.Format("{0}{1}{2}", str1, index > 0 ? ", " : string.Empty, str2); } } - string.Format("0x{0:x8} {1}({2})", (object)this._id, (object)this.Owner.Name, (object)str1); + string.Format("0x{0:x8} {1}({2})", _id, Owner.Name, str1); } public override TypeSchema[] ParameterTypes => this._parameterTypes; @@ -56,7 +56,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { this._parameterTypes = new TypeSchema[count]; bool flag2 = false; - for (int index = 0; (long)index < (long)count; ++index) + for (int index = 0; index < count; ++index) { TypeSchema typeSchema = DllLoadResult.MapType(IDs[index]); if (typeSchema != null) diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumSchema.cs index 68d98f3..6a44432 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumSchema.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumSchema.cs @@ -33,7 +33,7 @@ namespace Microsoft.Iris.CodeModel.Cpp if (nameToValue.Key != null) val1 = Math.Max(val1, nameToValue.Key.Length); } - string.Format("{{0,{0}}} = 0x{{1:x8}}", (object)val1); + string.Format("{{0,{0}}} = 0x{{1:x8}}", val1); foreach (KeyValueEntry nameToValue in this.NameToValueMap) ; } @@ -67,7 +67,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { char* name1; bool flag = this.CheckNativeReturn(NativeApi.SpQueryEnumName(this._nativeSchema, out name1)); - name = !flag ? (string)null : new string(name1); + name = !flag ? null : new string(name1); return flag; } @@ -76,8 +76,8 @@ namespace Microsoft.Iris.CodeModel.Cpp private unsafe bool QueryNamesAndValues(out string[] names, out int[] values) { bool flag1 = false; - names = (string[])null; - values = (int[])null; + names = null; + values = null; uint valueCount; if (this.CheckNativeReturn(NativeApi.SpQueryEnumValueCount(this._nativeSchema, out valueCount))) { @@ -98,7 +98,7 @@ namespace Microsoft.Iris.CodeModel.Cpp values[index] = num; } else - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"Name"); + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "Name"); } else { @@ -121,13 +121,13 @@ namespace Microsoft.Iris.CodeModel.Cpp public object GetBoxedValue(int value) => this.EnumValueToObject(value); - protected override object EnumValueToObject(int value) => (object)new DllEnumProxy(this, value); + protected override object EnumValueToObject(int value) => new DllEnumProxy(this, value); protected override int ValueFromObject(object obj) => ((DllEnumProxy)obj).Value; public string InvokeToString(DllEnumProxy proxy) { - string str = (string)null; + string str = null; IntPtr result; if (this.CheckNativeReturn(NativeApi.SpInvokeEnumToString(this._nativeSchema, proxy.Value, out result))) str = DllProxyServices.GetString(result); diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllEventSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEventSchema.cs index 1308d23..e57c426 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllEventSchema.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEventSchema.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.CodeModel.Cpp private bool _isStatic; public DllEventSchema(DllTypeSchema owner, uint ID) - : base((TypeSchema)owner) + : base(owner) { } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllIntrinsicTypeSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllIntrinsicTypeSchema.cs index d8990af..009036b 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllIntrinsicTypeSchema.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllIntrinsicTypeSchema.cs @@ -15,10 +15,10 @@ namespace Microsoft.Iris.CodeModel.Cpp public DllIntrinsicTypeSchema(DllLoadResult owner, uint ID, TypeSchema equivalentType) : base(owner, ID) { - this._baseType = (TypeSchema)ObjectSchema.Type; - this._name = InvariantString.Format(" {0}", (object)equivalentType.Name); + this._baseType = ObjectSchema.Type; + this._name = InvariantString.Format(" {0}", equivalentType.Name); this._marshalAs = ID; - TypeSchema.RegisterOneWayEquivalence((TypeSchema)this, equivalentType); + TypeSchema.RegisterOneWayEquivalence(this, equivalentType); } } } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResult.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResult.cs index 3e93628..2d705e8 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResult.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResult.cs @@ -36,17 +36,17 @@ namespace Microsoft.Iris.CodeModel.Cpp private static void LoadIntrinsicTypeData() { DllLoadResult.s_intrinsicData = new Map(); - DllLoadResult.s_intrinsicData[4294967294U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)BooleanSchema.Type); - DllLoadResult.s_intrinsicData[4294967293U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)ByteSchema.Type); - DllLoadResult.s_intrinsicData[4294967292U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)DoubleSchema.Type); - DllLoadResult.s_intrinsicData[4294967285U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)ListSchema.Type, typeof(DllProxyList)); - DllLoadResult.s_intrinsicData[4294967284U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)ImageSchema.Type); - DllLoadResult.s_intrinsicData[4294967283U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)Int32Schema.Type); - DllLoadResult.s_intrinsicData[4294967282U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)Int64Schema.Type); - DllLoadResult.s_intrinsicData[4294967280U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)ObjectSchema.Type); - DllLoadResult.s_intrinsicData[4294967279U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)SingleSchema.Type); - DllLoadResult.s_intrinsicData[4294967278U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)StringSchema.Type); - DllLoadResult.s_intrinsicData[4294967277U] = new DllLoadResult.IntrinsicTypeData((TypeSchema)VoidSchema.Type); + DllLoadResult.s_intrinsicData[4294967294U] = new DllLoadResult.IntrinsicTypeData(BooleanSchema.Type); + DllLoadResult.s_intrinsicData[4294967293U] = new DllLoadResult.IntrinsicTypeData(ByteSchema.Type); + DllLoadResult.s_intrinsicData[4294967292U] = new DllLoadResult.IntrinsicTypeData(DoubleSchema.Type); + DllLoadResult.s_intrinsicData[4294967285U] = new DllLoadResult.IntrinsicTypeData(ListSchema.Type, typeof(DllProxyList)); + DllLoadResult.s_intrinsicData[4294967284U] = new DllLoadResult.IntrinsicTypeData(ImageSchema.Type); + DllLoadResult.s_intrinsicData[4294967283U] = new DllLoadResult.IntrinsicTypeData(Int32Schema.Type); + DllLoadResult.s_intrinsicData[4294967282U] = new DllLoadResult.IntrinsicTypeData(Int64Schema.Type); + DllLoadResult.s_intrinsicData[4294967280U] = new DllLoadResult.IntrinsicTypeData(ObjectSchema.Type); + DllLoadResult.s_intrinsicData[4294967279U] = new DllLoadResult.IntrinsicTypeData(SingleSchema.Type); + DllLoadResult.s_intrinsicData[4294967278U] = new DllLoadResult.IntrinsicTypeData(StringSchema.Type); + DllLoadResult.s_intrinsicData[4294967277U] = new DllLoadResult.IntrinsicTypeData(VoidSchema.Type); } public static void Shutdown() => DllProxyServices.Shutdown(); @@ -55,7 +55,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { if ((int)hr >= 0) return true; - ErrorManager.ReportError("Schema API failure: A method on '{0}' failed with code '0x{1:X8}'", (object)interfaceName, (object)hr); + ErrorManager.ReportError("Schema API failure: A method on '{0}' failed with code '0x{1:X8}'", interfaceName, hr); return false; } @@ -65,14 +65,14 @@ namespace Microsoft.Iris.CodeModel.Cpp public static LoadResult CurrentContext => DllLoadResult.s_objectContext; - public static void PopContext() => DllLoadResult.s_objectContext = (LoadResult)null; + public static void PopContext() => DllLoadResult.s_objectContext = null; public static TypeSchema MapType(uint typeID) { uint schemaComponent = UIXID.GetSchemaComponent(typeID); - TypeSchema typeSchema = (TypeSchema)null; - DllLoadResult dllLoadResult = (DllLoadResult)null; - if (schemaComponent != (uint)ushort.MaxValue) + TypeSchema typeSchema = null; + DllLoadResult dllLoadResult = null; + if (schemaComponent != ushort.MaxValue) { dllLoadResult = DllLoadResultFactory.GetLoadResultByID(schemaComponent); if (dllLoadResult != null) @@ -81,7 +81,7 @@ namespace Microsoft.Iris.CodeModel.Cpp else if (DllLoadResult.CurrentContext is DllLoadResult currentContext) typeSchema = currentContext.MapIntrinsicType(typeID); if (typeSchema == null) - ErrorManager.ReportError("Unable to find type with ID '0x{0:X8}' in '{1}'", (object)typeID, dllLoadResult != null ? (object)dllLoadResult.Uri : (object)string.Empty); + ErrorManager.ReportError("Unable to find type with ID '0x{0:X8}' in '{1}'", typeID, dllLoadResult != null ? dllLoadResult.Uri : string.Empty); return typeSchema; } @@ -93,7 +93,7 @@ namespace Microsoft.Iris.CodeModel.Cpp DllLoadResult.IntrinsicTypeData intrinsicTypeData; if (!this._intrinsicTypes.TryGetValue(typeID, out typeSchema) && DllLoadResult.s_intrinsicData.TryGetValue(typeID, out intrinsicTypeData)) { - typeSchema = !intrinsicTypeData.DemandCreateTypeSchema ? intrinsicTypeData.FrameworkEquivalent : (TypeSchema)new DllIntrinsicTypeSchema(this, typeID, intrinsicTypeData.FrameworkEquivalent); + typeSchema = !intrinsicTypeData.DemandCreateTypeSchema ? intrinsicTypeData.FrameworkEquivalent : new DllIntrinsicTypeSchema(this, typeID, intrinsicTypeData.FrameworkEquivalent); this._intrinsicTypes[typeID] = typeSchema; } return typeSchema; @@ -101,7 +101,7 @@ namespace Microsoft.Iris.CodeModel.Cpp private TypeSchema MapLocalType(uint typeID) { - TypeSchema typeSchema = (TypeSchema)null; + TypeSchema typeSchema = null; this._userDefinedTypes.TryGetValue(typeID, out typeSchema); return typeSchema; } @@ -172,11 +172,11 @@ namespace Microsoft.Iris.CodeModel.Cpp { if (type != IntPtr.Zero) { - this.StoreType((TypeSchema)new DllTypeSchema(this, ID, type), ID, true, idVerifier); + this.StoreType(new DllTypeSchema(this, ID, type), ID, true, idVerifier); flag = idVerifier.RegisterID(ID); } else - ErrorManager.ReportError("NULL object returned from {0}", (object)"IUIXSchema::GetType"); + ErrorManager.ReportError("NULL object returned from {0}", "IUIXSchema::GetType"); } return flag; } @@ -210,11 +210,11 @@ namespace Microsoft.Iris.CodeModel.Cpp { if (enumType != IntPtr.Zero) { - this.StoreType((TypeSchema)new DllEnumSchema((LoadResult)this, ID, enumType), ID, false, idVerifier); + this.StoreType(new DllEnumSchema(this, ID, enumType), ID, false, idVerifier); flag = idVerifier.RegisterID(ID); } else - ErrorManager.ReportError("NULL object returned from {0}", (object)"IUIXSchema::GetEnum"); + ErrorManager.ReportError("NULL object returned from {0}", "IUIXSchema::GetEnum"); } return flag; } @@ -261,14 +261,14 @@ namespace Microsoft.Iris.CodeModel.Cpp if (this._userDefinedTypes != null && this._userDefinedTypes.Count > 0) { foreach (DisposableObject disposableObject in this._userDefinedTypes.Values) - disposableObject.Dispose((object)this); + disposableObject.Dispose(this); } if (this._intrinsicTypes != null && this._intrinsicTypes.Count > 0) { foreach (TypeSchema typeSchema in this._intrinsicTypes.Values) { if (typeSchema is DllIntrinsicTypeSchema intrinsicTypeSchema) - intrinsicTypeSchema.Dispose((object)this); + intrinsicTypeSchema.Dispose(this); } } NativeApi.SpReleaseExternalObject(this._schema); @@ -286,7 +286,7 @@ namespace Microsoft.Iris.CodeModel.Cpp return typeSchema; } } - return (TypeSchema)null; + return null; } public override LoadResultStatus Status => this._status; @@ -297,7 +297,7 @@ namespace Microsoft.Iris.CodeModel.Cpp public static Type RuntimeTypeForMarshalAs(uint marshalAs) { - Type type = (Type)null; + Type type = null; if (marshalAs == uint.MaxValue) { type = typeof(DllProxyObject); @@ -317,7 +317,7 @@ namespace Microsoft.Iris.CodeModel.Cpp private Type _runtimeType; public IntrinsicTypeData(TypeSchema frameworkEquivalent) - : this(frameworkEquivalent, (Type)null) + : this(frameworkEquivalent, null) { } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResultFactory.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResultFactory.cs index 00c9a48..840b0f1 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResultFactory.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResultFactory.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { DllLoadResult dllLoadResult; if (DllLoadResultFactory.s_loadResultCache.TryGetValue(uri, out dllLoadResult)) - return (LoadResult)dllLoadResult; + return dllLoadResult; int length = uri.IndexOf('!'); string str; string qualifier; @@ -47,7 +47,7 @@ namespace Microsoft.Iris.CodeModel.Cpp else { str = uri.Substring("dll://".Length); - qualifier = (string)null; + qualifier = null; } DllLoadResultFactory loadResultFactory; if (!DllLoadResultFactory.s_dllFactoriesCache.TryGetValue(str, out loadResultFactory)) @@ -59,9 +59,9 @@ namespace Microsoft.Iris.CodeModel.Cpp if (loadResult != null) { DllLoadResultFactory.s_loadResultCache[uri] = loadResult; - DllLoadResultFactory.s_loadResultIDCache[(uint)loadResult.SchemaComponent] = loadResult; + DllLoadResultFactory.s_loadResultIDCache[loadResult.SchemaComponent] = loadResult; } - return (LoadResult)loadResult; + return loadResult; } private DllLoadResultFactory(string dllName) @@ -70,7 +70,7 @@ namespace Microsoft.Iris.CodeModel.Cpp int num = (int)NativeApi.SpLoadDll(this._dllName, out this._module); if ((int)NativeApi.SpCreateDllLoadResultFactory(this._module, out this._schemaFactory) >= 0) return; - ErrorManager.ReportError("Unable to create IUIXSchemaFactory from '{0}'", (object)dllName); + ErrorManager.ReportError("Unable to create IUIXSchemaFactory from '{0}'", dllName); } protected override void OnDispose() @@ -91,19 +91,19 @@ namespace Microsoft.Iris.CodeModel.Cpp private DllLoadResult GetLoadResult(string fullUri, string qualifier) { - DllLoadResult dllLoadResult = (DllLoadResult)null; + DllLoadResult dllLoadResult = null; IntPtr loadResult = IntPtr.Zero; if (this._schemaFactory != IntPtr.Zero) { if ((int)NativeApi.SpCreateDllLoadResult(this._schemaFactory, qualifier, out loadResult) < 0) - ErrorManager.ReportError("Unable to create IUIXSchema from '{0}'", (object)fullUri); + ErrorManager.ReportError("Unable to create IUIXSchema from '{0}'", fullUri); else if (loadResult != IntPtr.Zero) { dllLoadResult = new DllLoadResult(this, loadResult, fullUri); - this.RegisterUsage((object)dllLoadResult); + this.RegisterUsage(dllLoadResult); } else - ErrorManager.ReportError("NULL object returned from {0}", (object)"IUIXSchemaFactory::GetSchema"); + ErrorManager.ReportError("NULL object returned from {0}", "IUIXSchemaFactory::GetSchema"); } return dllLoadResult; } @@ -111,8 +111,8 @@ namespace Microsoft.Iris.CodeModel.Cpp public void NotifyLoadResultDisposed(DllLoadResult loadResult) { DllLoadResultFactory.s_loadResultCache.Remove(loadResult.Uri); - DllLoadResultFactory.s_loadResultIDCache.Remove((uint)loadResult.SchemaComponent); - this.UnregisterUsage((object)loadResult); + DllLoadResultFactory.s_loadResultIDCache.Remove(loadResult.SchemaComponent); + this.UnregisterUsage(loadResult); } } } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllMethodSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllMethodSchema.cs index 60cc521..e1932a3 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllMethodSchema.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllMethodSchema.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.CodeModel.Cpp private uint _id; public DllMethodSchema(DllTypeSchema owner, uint ID) - : base((TypeSchema)owner) + : base(owner) => this._id = ID; public bool Load(IntPtr method) => this.QueryMethodName(method) && this.QueryForParameterTypes(method) && this.QueryReturnType(method) && this.QueryIsStatic(method); @@ -44,10 +44,10 @@ namespace Microsoft.Iris.CodeModel.Cpp string str4 = ""; if (this._parameterTypes[index] != null) str4 = this._parameterTypes[index].Name; - str3 = string.Format("{0}{1}{2}", (object)str3, index > 0 ? (object)", " : (object)string.Empty, (object)str4); + str3 = string.Format("{0}{1}{2}", str3, index > 0 ? ", " : string.Empty, str4); } } - string.Format("0x{0:x8} {1}{2} {3}({4})", (object)this._id, (object)str1, (object)str2, (object)this.Name, (object)str3); + string.Format("0x{0:x8} {1}{2} {3}({4})", _id, str1, str2, Name, str3); } public override string Name => this._name; diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllPropertySchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllPropertySchema.cs index 48e4fe0..44c018f 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllPropertySchema.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllPropertySchema.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.CodeModel.Cpp private uint _id; public DllPropertySchema(DllTypeSchema owner, uint ID) - : base((TypeSchema)owner) + : base(owner) => this._id = ID; public bool Load(IntPtr property) => this.QueryPropertyName(property) && this.QueryPropertyType(property) && (this.QueryCanRead(property) && this.QueryCanWrite(property)) && this.QueryIsStatic(property) && this.QueryNotifiesOnChange(property); @@ -41,11 +41,11 @@ namespace Microsoft.Iris.CodeModel.Cpp str3 = "get;"; string str4 = string.Empty; if (this.CanWrite) - str4 = string.Format("{0}set;", this.CanRead ? (object)" " : (object)string.Empty); + str4 = string.Format("{0}set;", this.CanRead ? " " : string.Empty); string str5 = ""; if (!this.NotifiesOnChange) str5 = ""; - string.Format("0x{0:x8} {1}{2} {3} {{{4}{5}}} {6}", (object)this._id, (object)str1, (object)str2, (object)this.Name, (object)str3, (object)str4, (object)str5); + string.Format("0x{0:x8} {1}{2} {3} {{{4}{5}}} {6}", _id, str1, str2, Name, str3, str4, str5); } public override string Name => this._name; diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyHandleTable.cs index 691958a..46bb4c3 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyHandleTable.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyHandleTable.cs @@ -21,14 +21,14 @@ namespace Microsoft.Iris.CodeModel.Cpp { DllProxyObjectReference oldValue; this.ReleaseHandle(handle, out oldValue); - oldValue.Value = (object)null; + oldValue.Value = null; } protected bool LookupByHandleWorker(ulong handle, out object obj) { DllProxyObjectReference proxyObjectReference; bool flag = this.InternalLookupByHandle(handle, out proxyObjectReference); - obj = !flag ? (object)null : proxyObjectReference.Value; + obj = !flag ? null : proxyObjectReference.Value; return flag; } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyList.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyList.cs index 6eba4b3..4d9407b 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyList.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyList.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.CodeModel.Cpp NativeApi.SUCCEEDED(NativeApi.SpUIXListWantSlowDataRequests(this._interface, out this._wantSlowDataRequests)); if (!this._wantSlowDataRequests) return; - this._updater = new UpdateHelper((IVirtualList)this); + this._updater = new UpdateHelper(this); } protected override void OnDispose() @@ -115,17 +115,17 @@ namespace Microsoft.Iris.CodeModel.Cpp public void RequestItem(int index, ItemRequestCallback callback) { object obj = this[index]; - callback((object)this, index, obj); + callback(this, index, obj); } public unsafe object this[int index] { get { - object obj = (object)null; + object obj = null; UIXVariant inboundObject; if (NativeApi.SUCCEEDED(NativeApi.SpUIXListGetItem(this._interface, index, out inboundObject))) - obj = UIXVariant.GetValue(inboundObject, (LoadResult)this.OwningLoadResult); + obj = UIXVariant.GetValue(inboundObject, OwningLoadResult); return obj; } set @@ -139,9 +139,9 @@ namespace Microsoft.Iris.CodeModel.Cpp public object SyncRoot => (object)null; - IEnumerator IEnumerable.GetEnumerator() => (IEnumerator)this.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator(); - public StackIListEnumerator GetEnumerator() => new StackIListEnumerator((IList)this); + public StackIListEnumerator GetEnumerator() => new StackIListEnumerator(this); public event UIListContentsChangedHandler ContentsChanged { @@ -182,7 +182,7 @@ namespace Microsoft.Iris.CodeModel.Cpp if (!flag1) break; if (this._contentsChanged != null) - this._contentsChanged((IList)this, new UIListContentsChangedArgs(type, oldIndex, newIndex, count)); + this._contentsChanged(this, new UIListContentsChangedArgs(type, oldIndex, newIndex, count)); if (flag2) this.FireNotification(NotificationID.Count); if (this._updater == null) @@ -252,7 +252,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { bool flag = false; if (this._slowDataAcquireCompleteHandler != null) - flag = this._slowDataAcquireCompleteHandler((IVirtualList)this, index); + flag = this._slowDataAcquireCompleteHandler(this, index); if (flag) return; this._updater.NotifySlowDataAcquireComplete(index); @@ -305,11 +305,11 @@ namespace Microsoft.Iris.CodeModel.Cpp return; if (flag) { - int num1 = (int)NativeApi.SpUIXListRegisterCallbacks(this._interface, (IUIXListCallbacks)this); + int num1 = (int)NativeApi.SpUIXListRegisterCallbacks(this._interface, this); } else { - int num2 = (int)NativeApi.SpUIXListUnregisterCallbacks(this._interface, (IUIXListCallbacks)this); + int num2 = (int)NativeApi.SpUIXListUnregisterCallbacks(this._interface, this); if (this._updater != null) this._updater.Clear(); } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObject.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObject.cs index 81ee1d5..528d961 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObject.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObject.cs @@ -31,17 +31,17 @@ namespace Microsoft.Iris.CodeModel.Cpp DllProxyObject.s_pendingAppThreadRelease = true; GC.Collect(); GC.WaitForPendingFinalizers(); - foreach (IDisposableObject disposableObject in (DllProxyHandleTable)DllProxyObject.s_handleTable) - disposableObject.Dispose((object)disposableObject); + foreach (IDisposableObject disposableObject in s_handleTable) + disposableObject.Dispose(disposableObject); DllProxyObject.ReleaseFinalizedObjects(); } public static DllProxyObject Wrap(IntPtr nativeObject) { - DllProxyObject dllProxyObject = (DllProxyObject)null; + DllProxyObject dllProxyObject = null; uint typeID; if (!NativeApi.SUCCEEDED(NativeApi.SpGetTypeID(nativeObject, out typeID))) - return (DllProxyObject)null; + return null; TypeSchema type = DllLoadResult.MapType(typeID); if (type != null) { @@ -53,7 +53,7 @@ namespace Microsoft.Iris.CodeModel.Cpp private static DllProxyObject GetExistingProxy(IntPtr nativeObject) { - DllProxyObject dllProxyObject = (DllProxyObject)null; + DllProxyObject dllProxyObject = null; ulong state; NativeApi.SpGetStateCache(nativeObject, out state); if (state != 0UL && !DllProxyObject.s_handleTable.LookupByHandle(state, out dllProxyObject)) @@ -63,7 +63,7 @@ namespace Microsoft.Iris.CodeModel.Cpp private static DllProxyObject WrapNewObject(IntPtr nativeObject, TypeSchema type) { - DllProxyObject dllProxyObject = (DllProxyObject)null; + DllProxyObject dllProxyObject = null; uint marshalAs; IntPtr nativeImpl; if (DllProxyObject.DetermineProxyInterfaceForObject(nativeObject, type, out marshalAs, out nativeImpl)) @@ -80,7 +80,7 @@ namespace Microsoft.Iris.CodeModel.Cpp dllProxyObject = new DllProxyObject(); break; case 4294967285: - dllProxyObject = (DllProxyObject)new DllProxyList(); + dllProxyObject = new DllProxyList(); break; case uint.MaxValue: dllProxyObject = new DllProxyObject(); @@ -111,7 +111,7 @@ namespace Microsoft.Iris.CodeModel.Cpp else if (DllProxyObject.CheckNativeReturn(NativeApi.SpQueryForMarshalAsInterface(nativeObject, marshalAs, out nativeImpl)) && nativeImpl != IntPtr.Zero) flag = true; else - ErrorManager.ReportError("Object didn't implement expected interface '{0}'", (object)marshalAs); + ErrorManager.ReportError("Object didn't implement expected interface '{0}'", marshalAs); return flag; } @@ -138,7 +138,7 @@ namespace Microsoft.Iris.CodeModel.Cpp this._type = type; this._nativeObject = nativeObject; this.OwningLoadResult.RegisterProxyUsage(); - this._handle = DllProxyObject.s_handleTable.RegisterProxy((object)this); + this._handle = DllProxyObject.s_handleTable.RegisterProxy(this); NativeApi.SpSetStateCache(this._nativeObject, this._handle); NativeApi.SpAddRefExternalObject(this._nativeObject); this.LoadWorker(nativeObject, marshalAs); @@ -154,7 +154,7 @@ namespace Microsoft.Iris.CodeModel.Cpp DllProxyObject existingProxy = DllProxyObject.GetExistingProxy(nativeObject); if (existingProxy != null) { - string id1 = (string)null; + string id1 = null; if (existingProxy._type is DllTypeSchema type) id1 = type.MapChangeID(id); if (id1 != null) @@ -163,7 +163,7 @@ namespace Microsoft.Iris.CodeModel.Cpp } else { - ErrorManager.ReportError("Invalid UIXID '0x{0:X8}' passed to NotifyChange", (object)id); + ErrorManager.ReportError("Invalid UIXID '0x{0:X8}' passed to NotifyChange", id); hresult = new HRESULT(-2147024809); } } @@ -174,7 +174,7 @@ namespace Microsoft.Iris.CodeModel.Cpp public IntPtr NativeObject => this._nativeObject; - public TypeSchema TypeSchema => (TypeSchema)this._type; + public TypeSchema TypeSchema => _type; protected DllLoadResult OwningLoadResult => this._type.Owner as DllLoadResult; @@ -194,7 +194,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { this.OnDispose(); new DllProxyObject.AppThreadReleaseEntry(this._nativeObject, this._handle, this.OwningLoadResult).Release(); - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); } protected virtual void OnDispose() @@ -207,7 +207,7 @@ namespace Microsoft.Iris.CodeModel.Cpp lock (DllProxyObject.s_finalizeLock) { pendingReleases = DllProxyObject.s_pendingReleases; - DllProxyObject.s_pendingReleases = (Vector)null; + DllProxyObject.s_pendingReleases = null; DllProxyObject.s_pendingAppThreadRelease = false; } if (pendingReleases == null || pendingReleases.Count == 0) @@ -249,7 +249,7 @@ namespace Microsoft.Iris.CodeModel.Cpp this._nativeObject = nativeObject; this._releaseHandle = false; this._handle = 0UL; - this._loadResult = (DllLoadResult)null; + this._loadResult = null; } public void Release() diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectReference.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectReference.cs index e7ba76d..1801697 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectReference.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectReference.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { get { - object obj = (object)null; + object obj = null; if (this._reference.IsAllocated) obj = this._reference.Target; return obj; diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyServices.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyServices.cs index b23f1cc..a69cc0a 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyServices.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyServices.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { DllProxyObject.CreateHandleTable(); DllProxyServices.s_stringTable = new StringProxyHandleTable(); - int num = (int)NativeApi.SpRegisterNativeServicesCallbacks((IRawUIXServices)new DllProxyServices()); + int num = (int)NativeApi.SpRegisterNativeServicesCallbacks(new DllProxyServices()); } public static void Shutdown() @@ -31,7 +31,7 @@ namespace Microsoft.Iris.CodeModel.Cpp DllProxyObject.ReleaseOutstandingProxies(); NativeMarkupDataType.ReleaseOutstandingProxies(); NativeApi.SpUnregisterNativeServicesCallbacks(); - DllProxyServices.s_stringTable = (StringProxyHandleTable)null; + DllProxyServices.s_stringTable = null; } HRESULT IRawUIXServices.NotifyChangeForObject( @@ -47,7 +47,7 @@ namespace Microsoft.Iris.CodeModel.Cpp public static string GetString(IntPtr nativeStringObject) { - string str = (string)null; + string str = null; if (nativeStringObject != IntPtr.Zero) { ulong handle; @@ -105,7 +105,7 @@ namespace Microsoft.Iris.CodeModel.Cpp public static UIImage GetImage(IntPtr nativeImageObject) { - UIImage uiImage = (UIImage)null; + UIImage uiImage = null; if (nativeImageObject != IntPtr.Zero) { ulong handle; @@ -120,7 +120,7 @@ namespace Microsoft.Iris.CodeModel.Cpp public static MarkupDataQuery GetDataQuery(IntPtr nativeQuery) { - MarkupDataQuery markupDataQuery = (MarkupDataQuery)null; + MarkupDataQuery markupDataQuery = null; if (nativeQuery != IntPtr.Zero) { ulong frameworkQuery; @@ -133,7 +133,7 @@ namespace Microsoft.Iris.CodeModel.Cpp public static MarkupDataType GetDataType(IntPtr nativeObject) { - NativeMarkupDataType nativeMarkupDataType = (NativeMarkupDataType)null; + NativeMarkupDataType nativeMarkupDataType = null; if (nativeObject != IntPtr.Zero) { ulong frameworkQuery; @@ -148,7 +148,7 @@ namespace Microsoft.Iris.CodeModel.Cpp } NativeApi.SpReleaseExternalObject(nativeObject); } - return (MarkupDataType)nativeMarkupDataType; + return nativeMarkupDataType; } public static void CreateNativeImage(UIImage image, out IntPtr nativeObject) @@ -159,7 +159,7 @@ namespace Microsoft.Iris.CodeModel.Cpp DllProxyServices.Crash("Unable to allocate native image object"); } - private static ulong GetImageHandle(UIImage image, string source) => (ulong)GCHandle.ToIntPtr(GCHandle.Alloc((object)image)).ToInt64(); + private static ulong GetImageHandle(UIImage image, string source) => (ulong)GCHandle.ToIntPtr(GCHandle.Alloc(image)).ToInt64(); unsafe ulong IRawUIXServices.AllocateImageFromUri( string uri, @@ -169,7 +169,7 @@ namespace Microsoft.Iris.CodeModel.Cpp bool flippable; bool antialiasEdges; DllProxyServices.CrackDecodeParams(decodeParams, out maximumSize, out flippable, out antialiasEdges); - return DllProxyServices.GetImageHandle((UIImage)new UriImage(uri, Inset.Zero, maximumSize, flippable, antialiasEdges), uri); + return DllProxyServices.GetImageHandle(new UriImage(uri, Inset.Zero, maximumSize, flippable, antialiasEdges), uri); } unsafe ulong IRawUIXServices.AllocateImageFromBits( @@ -184,7 +184,7 @@ namespace Microsoft.Iris.CodeModel.Cpp bool antialiasEdges; DllProxyServices.CrackDecodeParams(decodeParams, out maximumSize, out flippable, out antialiasEdges); Size imageSize = new Size(imageInfo->width, imageInfo->height); - return DllProxyServices.GetImageHandle((UIImage)new RawImage(ID, imageSize, imageInfo->stride, surfaceFormat, imageInfo->bits, true, Inset.Zero, maximumSize, flippable, antialiasEdges), ID); + return DllProxyServices.GetImageHandle(new RawImage(ID, imageSize, imageInfo->stride, surfaceFormat, imageInfo->bits, true, Inset.Zero, maximumSize, flippable, antialiasEdges), ID); } unsafe void IRawUIXServices.RemoveCachedImage( @@ -224,7 +224,7 @@ namespace Microsoft.Iris.CodeModel.Cpp string providerName, IntPtr nativeFactoryCallback) { - MarkupDataProvider.RegisterDataProvider((IDataProvider)new NativeDataProviderWrapper(providerName, nativeFactoryCallback)); + MarkupDataProvider.RegisterDataProvider(new NativeDataProviderWrapper(providerName, nativeFactoryCallback)); } unsafe void IRawUIXServices.GetDataMapping( @@ -262,14 +262,14 @@ namespace Microsoft.Iris.CodeModel.Cpp string propertyName, UIXVariant.VariantType variantType) { - MarkupDataTypeBaseObject dataTypeBaseObject = (MarkupDataTypeBaseObject)null; + MarkupDataTypeBaseObject dataTypeBaseObject = null; switch (variantType) { case UIXVariant.VariantType.UIXDataQuery: - dataTypeBaseObject = (MarkupDataTypeBaseObject)NativeMarkupDataQuery.LookupByHandle(frameworkObjectHandle); + dataTypeBaseObject = NativeMarkupDataQuery.LookupByHandle(frameworkObjectHandle); break; case UIXVariant.VariantType.UIXDataType: - dataTypeBaseObject = (MarkupDataTypeBaseObject)NativeMarkupDataType.LookupByHandle(frameworkObjectHandle); + dataTypeBaseObject = NativeMarkupDataType.LookupByHandle(frameworkObjectHandle); break; } if (dataTypeBaseObject == null) diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchema.cs index 25cd99f..03399c0 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchema.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchema.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.CodeModel.Cpp public bool Load(UIXIDVerifier idVerifier) { - DllLoadResult.PushContext((LoadResult)this.OwnerLoadResult); + DllLoadResult.PushContext(OwnerLoadResult); bool flag = this.QueryTypeName() && this.QueryIsRuntimeImmutable() && (this.QueryBaseType() && this.QueryConstructors(idVerifier)) && (this.QueryProperties(idVerifier) && this.QueryMethods(idVerifier) && this.QueryEvents(idVerifier)) && this.QueryMarshalAs(); DllLoadResult.PopContext(); return flag; @@ -154,11 +154,11 @@ namespace Microsoft.Iris.CodeModel.Cpp flag = idVerifier.RegisterID(ID); } else - constructorSchema.Dispose((object)this); + constructorSchema.Dispose(this); NativeApi.SpReleaseExternalObject(constructor); } else - ErrorManager.ReportError("NULL object returned from {0}", (object)"IUIXType::GetConstructor"); + ErrorManager.ReportError("NULL object returned from {0}", "IUIXType::GetConstructor"); } return flag; } @@ -200,7 +200,7 @@ namespace Microsoft.Iris.CodeModel.Cpp NativeApi.SpReleaseExternalObject(property); } else - ErrorManager.ReportError("NULL object returned from {0}", (object)"IUIXType::GetProperty"); + ErrorManager.ReportError("NULL object returned from {0}", "IUIXType::GetProperty"); } return flag; } @@ -240,11 +240,11 @@ namespace Microsoft.Iris.CodeModel.Cpp flag = idVerifier.RegisterID(ID); } else - dllMethodSchema.Dispose((object)this); + dllMethodSchema.Dispose(this); NativeApi.SpReleaseExternalObject(method); } else - ErrorManager.ReportError("NULL object returned from {0}", (object)"IUIXType::GetMethod"); + ErrorManager.ReportError("NULL object returned from {0}", "IUIXType::GetMethod"); } return flag; } @@ -293,10 +293,10 @@ namespace Microsoft.Iris.CodeModel.Cpp case uint.MaxValue: return flag; case 4294967285: - TypeSchema.RegisterOneWayEquivalence((TypeSchema)this, (TypeSchema)ListSchema.Type); + TypeSchema.RegisterOneWayEquivalence(this, ListSchema.Type); goto case 4294967281; default: - ErrorManager.ReportError("Invalid MarshalAs '{0}' returned from IUIXType::MarshalAs", (object)this._marshalAs); + ErrorManager.ReportError("Invalid MarshalAs '{0}' returned from IUIXType::MarshalAs", _marshalAs); flag = false; goto case 4294967281; } @@ -316,7 +316,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { if (declaredMarshalAs != uint.MaxValue) { - ErrorManager.ReportError("Invalid MarshalAs '{0}' on type '{1}'. Only a single MarshalAs value is permitted through a type heirarchy, and '{2}' was already declared.", (object)declaredMarshalAs, (object)this.Name, (object)num); + ErrorManager.ReportError("Invalid MarshalAs '{0}' on type '{1}'. Only a single MarshalAs value is permitted through a type heirarchy, and '{2}' was already declared.", declaredMarshalAs, Name, num); flag = false; } else @@ -343,11 +343,11 @@ namespace Microsoft.Iris.CodeModel.Cpp flag = idVerifier.RegisterID(ID); } else - dllEventSchema.Dispose((object)this); + dllEventSchema.Dispose(this); NativeApi.SpReleaseExternalObject(eventObj); } else - ErrorManager.ReportError("NULL object returned from {0}", (object)"IUIXType::GetEvent"); + ErrorManager.ReportError("NULL object returned from {0}", "IUIXType::GetEvent"); } return flag; } @@ -361,20 +361,20 @@ namespace Microsoft.Iris.CodeModel.Cpp public string MapChangeID(uint id) { - string name = (string)null; + string name = null; DllTypeSchema dllTypeSchema = this; while (dllTypeSchema != null && !dllTypeSchema.MapChangeIDWorker(id, out name)) dllTypeSchema = dllTypeSchema._baseType as DllTypeSchema; if (name == null) - ErrorManager.ReportError("ChangeNotification received for ID '0x{0:X8}' which isn't a property or event on '{1}'", (object)id, (object)this.Name); + ErrorManager.ReportError("ChangeNotification received for ID '0x{0:X8}' which isn't a property or event on '{1}'", id, Name); return name; } private bool MapChangeIDWorker(uint id, out string name) { bool flag = false; - name = (string)null; - if ((int)UIXID.GetSchemaComponent(id) == (int)this.OwnerLoadResult.SchemaComponent) + name = null; + if ((int)UIXID.GetSchemaComponent(id) == OwnerLoadResult.SchemaComponent) { DllPropertySchema dllPropertySchema; if (this._properties != null && this._properties.TryGetValue(id, out dllPropertySchema)) @@ -395,12 +395,12 @@ namespace Microsoft.Iris.CodeModel.Cpp return flag; } - public override object ConstructDefault() => this.Construct(this._defaultConstructorID, (object[])null); + public override object ConstructDefault() => this.Construct(this._defaultConstructorID, null); public unsafe object Construct(uint constructorID, object[] parameters) { - DllProxyObject dllProxyObject = (DllProxyObject)null; - UIXVariant* uixVariantPtr = (UIXVariant*)null; + DllProxyObject dllProxyObject = null; + UIXVariant* uixVariantPtr = null; int count = 0; if (parameters != null) { @@ -416,10 +416,10 @@ namespace Microsoft.Iris.CodeModel.Cpp if (NativeApi.SUCCEEDED(hr)) dllProxyObject = DllProxyObject.Wrap(nativeObject); else - this.ReportError(hr, DllTypeSchema.ErrorContext.Construct, (object)this, watermark); + this.ReportError(hr, DllTypeSchema.ErrorContext.Construct, this, watermark); if ((IntPtr)uixVariantPtr != IntPtr.Zero) UIXVariant.CleanupMarshalledObjects(uixVariantPtr, count); - return (object)dllProxyObject; + return dllProxyObject; } public object GetPropertyValue(object instance, DllPropertySchema property) @@ -428,13 +428,13 @@ namespace Microsoft.Iris.CodeModel.Cpp if (!property.IsStatic) nativeObject = ((DllProxyObject)instance).NativeObject; ErrorWatermark watermark = ErrorManager.Watermark; - object obj = (object)null; + object obj = null; UIXVariant propertyValue1; uint propertyValue2 = NativeApi.SpGetPropertyValue(this._type, nativeObject, property.ID, out propertyValue1); if (NativeApi.SUCCEEDED(propertyValue2)) obj = UIXVariant.GetValue(propertyValue1, this.Owner); else - this.ReportError(propertyValue2, DllTypeSchema.ErrorContext.PropertyGet, (object)property, watermark); + this.ReportError(propertyValue2, DllTypeSchema.ErrorContext.PropertyGet, property, watermark); return obj; } @@ -449,21 +449,21 @@ namespace Microsoft.Iris.CodeModel.Cpp ErrorWatermark watermark = ErrorManager.Watermark; uint hr = NativeApi.SpSetPropertyValue(this._type, nativeObject, property.ID, uixVariantPtr); if (NativeApi.FAILED(hr)) - this.ReportError(hr, DllTypeSchema.ErrorContext.PropertySet, (object)property, watermark); + this.ReportError(hr, DllTypeSchema.ErrorContext.PropertySet, property, watermark); UIXVariant.CleanupMarshalledObject(uixVariantPtr); } public unsafe object InvokeMethod(object instance, DllMethodSchema method, object[] parameters) { - object obj = (object)null; - UIXVariant* uixVariantPtr = (UIXVariant*)null; + object obj = null; + UIXVariant* uixVariantPtr = null; int count = 0; if (parameters != null && parameters.Length > 0) { count = parameters.Length; // ISSUE: untyped stack allocation var uixVariantStack = stackalloc UIXVariant[sizeof(UIXVariant) * count]; - uixVariantPtr = (UIXVariant*)uixVariantStack; + uixVariantPtr = uixVariantStack; UIXVariant.MarshalObjectArray(parameters, uixVariantPtr); } IntPtr nativeObject = IntPtr.Zero; @@ -475,7 +475,7 @@ namespace Microsoft.Iris.CodeModel.Cpp if (NativeApi.SUCCEEDED(hr)) obj = UIXVariant.GetValue(returnValue, this.Owner); else - this.ReportError(hr, DllTypeSchema.ErrorContext.MethodInvoke, (object)method, watermark); + this.ReportError(hr, DllTypeSchema.ErrorContext.MethodInvoke, method, watermark); if ((IntPtr)uixVariantPtr != IntPtr.Zero) UIXVariant.CleanupMarshalledObjects(uixVariantPtr, count); return obj; @@ -483,14 +483,14 @@ namespace Microsoft.Iris.CodeModel.Cpp public string InvokeToString(DllProxyObject proxy) { - string str = (string)null; + string str = null; ErrorWatermark watermark = ErrorManager.Watermark; IntPtr nativeStringObject; uint hr = NativeApi.SpInvokeToString(this._type, proxy.NativeObject, out nativeStringObject); if (NativeApi.SUCCEEDED(hr)) str = DllProxyServices.GetString(nativeStringObject); else - this.ReportError(hr, DllTypeSchema.ErrorContext.ToString, (object)this, watermark); + this.ReportError(hr, DllTypeSchema.ErrorContext.ToString, this, watermark); return str; } @@ -509,23 +509,23 @@ namespace Microsoft.Iris.CodeModel.Cpp { case DllTypeSchema.ErrorContext.MethodInvoke: DllMethodSchema dllMethodSchema = (DllMethodSchema)context; - message = string.Format("Error 0x{0:X8} occurred invoking method {1}.{2} from {3}.", (object)hr, (object)dllMethodSchema.Owner.Name, (object)dllMethodSchema.Name, (object)dllMethodSchema.Owner.Owner.Uri); + message = string.Format("Error 0x{0:X8} occurred invoking method {1}.{2} from {3}.", hr, dllMethodSchema.Owner.Name, dllMethodSchema.Name, dllMethodSchema.Owner.Owner.Uri); break; case DllTypeSchema.ErrorContext.ToString: DllTypeSchema dllTypeSchema1 = (DllTypeSchema)context; - message = string.Format("Error 0x{0:X8} occurred invoking ToString on type {1} from {2}.", (object)hr, (object)dllTypeSchema1.Name, (object)dllTypeSchema1.Owner.Uri); + message = string.Format("Error 0x{0:X8} occurred invoking ToString on type {1} from {2}.", hr, dllTypeSchema1.Name, dllTypeSchema1.Owner.Uri); break; case DllTypeSchema.ErrorContext.PropertyGet: DllPropertySchema dllPropertySchema1 = (DllPropertySchema)context; - message = string.Format("Error 0x{0:X8} occurred reading property {1}.{2} from {3}.", (object)hr, (object)dllPropertySchema1.Owner.Name, (object)dllPropertySchema1.Name, (object)dllPropertySchema1.Owner.Owner.Uri); + message = string.Format("Error 0x{0:X8} occurred reading property {1}.{2} from {3}.", hr, dllPropertySchema1.Owner.Name, dllPropertySchema1.Name, dllPropertySchema1.Owner.Owner.Uri); break; case DllTypeSchema.ErrorContext.PropertySet: DllPropertySchema dllPropertySchema2 = (DllPropertySchema)context; - message = string.Format("Error 0x{0:X8} occurred writing property {1}.{2} from {3}.", (object)hr, (object)dllPropertySchema2.Owner.Name, (object)dllPropertySchema2.Name, (object)dllPropertySchema2.Owner.Owner.Uri); + message = string.Format("Error 0x{0:X8} occurred writing property {1}.{2} from {3}.", hr, dllPropertySchema2.Owner.Name, dllPropertySchema2.Name, dllPropertySchema2.Owner.Owner.Uri); break; case DllTypeSchema.ErrorContext.Construct: DllTypeSchema dllTypeSchema2 = (DllTypeSchema)context; - message = string.Format("Error 0x{0:X8} occurred constructing object of type {1} from {2}.", (object)hr, (object)dllTypeSchema2.Name, (object)dllTypeSchema2.Owner.Uri); + message = string.Format("Error 0x{0:X8} occurred constructing object of type {1} from {2}.", hr, dllTypeSchema2.Name, dllTypeSchema2.Owner.Uri); break; default: message = "Internal error"; diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchemaBase.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchemaBase.cs index 4929bfd..5de08ff 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchemaBase.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchemaBase.cs @@ -24,7 +24,7 @@ namespace Microsoft.Iris.CodeModel.Cpp protected uint _marshalAs; protected DllTypeSchemaBase(DllLoadResult owner, uint ID) - : base((LoadResult)owner) + : base(owner) => this._typeID = ID; protected override void OnDispose() @@ -35,29 +35,29 @@ namespace Microsoft.Iris.CodeModel.Cpp foreach (KeyValueEntry constructor in this._constructors) { if (constructor.Value != null) - constructor.Value.Dispose((object)this); + constructor.Value.Dispose(this); } - this._constructors = (Map)null; + this._constructors = null; } if (this._properties != null) { foreach (DllPropertySchema dllPropertySchema in this._properties.Values) - dllPropertySchema?.Dispose((object)this); - this._properties = (Map)null; + dllPropertySchema?.Dispose(this); + this._properties = null; } if (this._methods != null) { foreach (KeyValueEntry method in this._methods) { if (method.Value != null) - method.Value.Dispose((object)this); + method.Value.Dispose(this); } - this._methods = (Map)null; + this._methods = null; } if (this._events == null) return; foreach (DllEventSchema dllEventSchema in this._events.Values) - dllEventSchema?.Dispose((object)this); + dllEventSchema?.Dispose(this); } public override object ConstructDefault() => (object)null; @@ -70,10 +70,10 @@ namespace Microsoft.Iris.CodeModel.Cpp public override ConstructorSchema FindConstructor(TypeSchema[] parameters) { - DllConstructorSchema constructorSchema = (DllConstructorSchema)null; + DllConstructorSchema constructorSchema = null; if (this._constructors != null) this._constructors.TryGetValue(new MethodSignatureKey(parameters), out constructorSchema); - return (ConstructorSchema)constructorSchema; + return constructorSchema; } public override PropertySchema FindProperty(string name) @@ -83,7 +83,7 @@ namespace Microsoft.Iris.CodeModel.Cpp foreach (DllPropertySchema dllPropertySchema in this._properties.Values) { if (dllPropertySchema != null && dllPropertySchema.Name == name) - return (PropertySchema)dllPropertySchema; + return dllPropertySchema; } } if (this.Equivalents != null) @@ -95,16 +95,16 @@ namespace Microsoft.Iris.CodeModel.Cpp return property; } } - return (PropertySchema)null; + return null; } public override MethodSchema FindMethod(string name, TypeSchema[] parameters) { if (this._methods != null) { - DllMethodSchema dllMethodSchema = (DllMethodSchema)null; + DllMethodSchema dllMethodSchema = null; if (this._methods.TryGetValue(new MethodSignatureKey(name, parameters), out dllMethodSchema)) - return (MethodSchema)dllMethodSchema; + return dllMethodSchema; } if (this.Equivalents != null) { @@ -115,12 +115,12 @@ namespace Microsoft.Iris.CodeModel.Cpp return method; } } - return (MethodSchema)null; + return null; } public override EventSchema FindEvent(string name) { - DllEventSchema dllEventSchema1 = (DllEventSchema)null; + DllEventSchema dllEventSchema1 = null; if (this._events != null) { foreach (DllEventSchema dllEventSchema2 in this._events.Values) @@ -132,7 +132,7 @@ namespace Microsoft.Iris.CodeModel.Cpp } } } - return (EventSchema)dllEventSchema1; + return dllEventSchema1; } public override PropertySchema[] Properties @@ -166,7 +166,7 @@ namespace Microsoft.Iris.CodeModel.Cpp TypeSchema fromType, out object instance) { - instance = (object)null; + instance = null; return Result.Fail("Not implemented"); } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/NativeDataProviderWrapper.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/NativeDataProviderWrapper.cs index ca79320..41e821f 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/NativeDataProviderWrapper.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/NativeDataProviderWrapper.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.CodeModel.Cpp public string Name => this._name; - public MarkupDataQuery Build(MarkupDataQuerySchema querySchema) => (MarkupDataQuery)new NativeMarkupDataQuery(querySchema, this); + public MarkupDataQuery Build(MarkupDataQuerySchema querySchema) => new NativeMarkupDataQuery(querySchema, this); public IntPtr ConstructQuery( string providerName, @@ -36,6 +36,6 @@ namespace Microsoft.Iris.CodeModel.Cpp return query; } - public override string ToString() => string.Format("{0} ({1})", (object)this._name, (object)this._factory); + public override string ToString() => string.Format("{0} ({1})", _name, _factory); } } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable`1.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable`1.cs index 397c7f2..960118f 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable`1.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable`1.cs @@ -101,12 +101,12 @@ namespace Microsoft.Iris.CodeModel.Cpp uniquifier |= this._lifetimeCount & 1073741823U; handle = (ulong)uniquifier << 32; uint num = (uint)insertIndex; - handle |= (ulong)num; + handle |= num; } private void DecodeHandle(ulong handle, out int index, out uint uniquenessBits) { - index = (int)((long)handle & (long)uint.MaxValue); + index = (int)((long)handle & uint.MaxValue); ulong num = 18446744069414584320; uniquenessBits = (uint)((handle & num) >> 32); } @@ -120,7 +120,7 @@ namespace Microsoft.Iris.CodeModel.Cpp else { ProxyHandleTable.ListEntry[] listEntryArray = new ProxyHandleTable.ListEntry[this._entries.Length * 2]; - Array.Copy((Array)this._entries, (Array)listEntryArray, this._entries.Length); + Array.Copy(_entries, listEntryArray, this._entries.Length); this._entries = listEntryArray; } } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/StringProxyHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/StringProxyHandleTable.cs index 9be393e..d94c44a 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/StringProxyHandleTable.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/StringProxyHandleTable.cs @@ -53,7 +53,7 @@ namespace Microsoft.Iris.CodeModel.Cpp { string str; this.LookupByHandle(handle, out str); - stringPinState._gcHandle = GCHandle.Alloc((object)str, GCHandleType.Pinned); + stringPinState._gcHandle = GCHandle.Alloc(str, GCHandleType.Pinned); stringPinState._pinCount = 1; } StringProxyHandleTable.s_pinnedStrings[handle] = stringPinState; diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs index c9c6df4..aa074a3 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs @@ -39,6 +39,6 @@ namespace Microsoft.Iris.CodeModel.Cpp public static uint GetSchemaComponent(uint ID) => (ID & 4294901760U) >> 16; - public static uint GetLocalComponent(uint ID) => ID & (uint)ushort.MaxValue; + public static uint GetLocalComponent(uint ID) => ID & ushort.MaxValue; } } diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/UIXIDVerifier.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXIDVerifier.cs index 507bda7..26c95aa 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/UIXIDVerifier.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXIDVerifier.cs @@ -23,9 +23,9 @@ namespace Microsoft.Iris.CodeModel.Cpp private bool CheckForSchemaMatch(uint ID) { - bool flag = (int)UIXID.GetSchemaComponent(ID) == (int)this._loadResult.SchemaComponent; + bool flag = (int)UIXID.GetSchemaComponent(ID) == _loadResult.SchemaComponent; if (!flag) - ErrorManager.ReportError("Schema component on ID '0x{0:X8}' doesn't match schema's ID '0x{1:X8}' on '{2}'", (object)ID, (object)this._loadResult.SchemaComponent, (object)this._loadResult.Uri); + ErrorManager.ReportError("Schema component on ID '0x{0:X8}' doesn't match schema's ID '0x{1:X8}' on '{2}'", ID, _loadResult.SchemaComponent, _loadResult.Uri); return flag; } @@ -35,7 +35,7 @@ namespace Microsoft.Iris.CodeModel.Cpp bool flag = this._uniqueIDs.TryGetValue(ID, out num); if (flag && num == 0U) { - ErrorManager.ReportError("Duplicate ID '0x{0:X8}' found in schema from '{1}'", (object)ID, (object)this._loadResult.Uri); + ErrorManager.ReportError("Duplicate ID '0x{0:X8}' found in schema from '{1}'", ID, _loadResult.Uri); ++num; } this._uniqueIDs[ID] = num; diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/UIXVariant.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXVariant.cs index 2f436f1..c42450c 100644 --- a/UIX/Microsoft/Iris/CodeModel/Cpp/UIXVariant.cs +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXVariant.cs @@ -21,44 +21,44 @@ namespace Microsoft.Iris.CodeModel.Cpp switch (inboundObject._type) { case UIXVariant.VariantType.Empty: - return (object)null; + return null; case UIXVariant.VariantType.Bool: - return (object)(inboundObject._integer != 0L); + return inboundObject._integer != 0L; case UIXVariant.VariantType.Byte: - return (object)(byte)inboundObject._integer; + return (byte)inboundObject._integer; case UIXVariant.VariantType.Int32: - return (object)(int)inboundObject._integer; + return (int)inboundObject._integer; case UIXVariant.VariantType.Int64: - return (object)inboundObject._integer; + return inboundObject._integer; case UIXVariant.VariantType.Single: - return (object)inboundObject._float; + return inboundObject._float; case UIXVariant.VariantType.Double: - return (object)inboundObject._double; + return inboundObject._double; case UIXVariant.VariantType.Enum: return UIXVariant.GetEnumValue(inboundObject._enum._value, inboundObject._enum._type); case UIXVariant.VariantType.UIXObject: return UIXVariant.GetObjectValue(inboundObject._pointer, context); case UIXVariant.VariantType.UIXString: - return (object)DllProxyServices.GetString(inboundObject._pointer); + return DllProxyServices.GetString(inboundObject._pointer); case UIXVariant.VariantType.UIXImage: - return (object)DllProxyServices.GetImage(inboundObject._pointer); + return DllProxyServices.GetImage(inboundObject._pointer); case UIXVariant.VariantType.UIXDataQuery: - return (object)DllProxyServices.GetDataQuery(inboundObject._pointer); + return DllProxyServices.GetDataQuery(inboundObject._pointer); case UIXVariant.VariantType.UIXDataType: - return (object)DllProxyServices.GetDataType(inboundObject._pointer); + return DllProxyServices.GetDataType(inboundObject._pointer); default: - return (object)null; + return null; } } - private static object GetEnumValue(int enumValue, uint typeID) => DllLoadResult.MapType(typeID) is DllEnumSchema dllEnumSchema ? dllEnumSchema.GetBoxedValue(enumValue) : (object)null; + private static object GetEnumValue(int enumValue, uint typeID) => DllLoadResult.MapType(typeID) is DllEnumSchema dllEnumSchema ? dllEnumSchema.GetBoxedValue(enumValue) : null; private static object GetObjectValue(IntPtr value, LoadResult context) { - object obj = (object)null; + object obj = null; DllLoadResult.PushContext(context); if (value != IntPtr.Zero) - obj = (object)DllProxyObject.Wrap(value); + obj = DllProxyObject.Wrap(value); DllLoadResult.PopContext(); return obj; } @@ -80,10 +80,10 @@ namespace Microsoft.Iris.CodeModel.Cpp destination->SetIntegerValue(flag ? 1L : 0L, UIXVariant.VariantType.Bool); break; case byte num: - destination->SetIntegerValue((long)num, UIXVariant.VariantType.Byte); + destination->SetIntegerValue(num, UIXVariant.VariantType.Byte); break; case int num: - destination->SetIntegerValue((long)num, UIXVariant.VariantType.Int32); + destination->SetIntegerValue(num, UIXVariant.VariantType.Int32); break; case long num: destination->SetIntegerValue(num, UIXVariant.VariantType.Int64); diff --git a/UIX/Microsoft/Iris/Command.cs b/UIX/Microsoft/Iris/Command.cs index fb054e0..85c6c83 100644 --- a/UIX/Microsoft/Iris/Command.cs +++ b/UIX/Microsoft/Iris/Command.cs @@ -26,17 +26,17 @@ namespace Microsoft.Iris } public Command(IModelItemOwner owner, EventHandler invokedHandler) - : this(owner, (string)null, invokedHandler) + : this(owner, null, invokedHandler) { } public Command(IModelItemOwner owner) - : this(owner, (string)null, (EventHandler)null) + : this(owner, null, null) { } public Command() - : this((IModelItemOwner)null) + : this(null) { } @@ -102,7 +102,7 @@ namespace Microsoft.Iris return; this.FirePropertyChanged("Invoked"); if (this.GetEventHandler(Command.s_invokedEvent) is EventHandler eventHandler) - eventHandler((object)this, EventArgs.Empty); + eventHandler(this, EventArgs.Empty); this.OnInvoked(); } @@ -111,12 +111,12 @@ namespace Microsoft.Iris add { using (this.ThreadValidator) - this.AddEventHandler(Command.s_invokedEvent, (Delegate)value); + this.AddEventHandler(Command.s_invokedEvent, value); } remove { using (this.ThreadValidator) - this.RemoveEventHandler(Command.s_invokedEvent, (Delegate)value); + this.RemoveEventHandler(Command.s_invokedEvent, value); } } diff --git a/UIX/Microsoft/Iris/Data/Resource.cs b/UIX/Microsoft/Iris/Data/Resource.cs index ed12ec8..91c9191 100644 --- a/UIX/Microsoft/Iris/Data/Resource.cs +++ b/UIX/Microsoft/Iris/Data/Resource.cs @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Data public abstract string Identifier { get; } - public void Acquire() => this.Acquire((ResourceAcquisitionCompleteHandler)null); + public void Acquire() => this.Acquire(null); public void Acquire(ResourceAcquisitionCompleteHandler completeHandler) { @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Data if (this._status != ResourceStatus.Available) { this._status = ResourceStatus.Acquiring; - this._errorDetails = (string)null; + this._errorDetails = null; this.StartAcquisition(this._forceSynchronous); } else @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Data } } - public void Free() => this.Free((ResourceAcquisitionCompleteHandler)null); + public void Free() => this.Free(null); public void Free(ResourceAcquisitionCompleteHandler completeHandler) { @@ -110,7 +110,7 @@ namespace Microsoft.Iris.Data { this._status = ResourceStatus.Error; if (errorDetails == null) - errorDetails = string.Format("Failed to acquire resource '{0}'", (object)this.Identifier); + errorDetails = string.Format("Failed to acquire resource '{0}'", Identifier); this._errorDetails = errorDetails; } if (this._completeHandlers == null) @@ -127,7 +127,7 @@ namespace Microsoft.Iris.Data if (this._completeHandlers == null) return; this._completeHandlers(this); - this._completeHandlers = (ResourceAcquisitionCompleteHandler)null; + this._completeHandlers = null; } public override string ToString() => this._uri; diff --git a/UIX/Microsoft/Iris/Data/ResourceManager.cs b/UIX/Microsoft/Iris/Data/ResourceManager.cs index d8e5d7b..54dcd12 100644 --- a/UIX/Microsoft/Iris/Data/ResourceManager.cs +++ b/UIX/Microsoft/Iris/Data/ResourceManager.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Data public Resource GetResource(string uri, bool forceSynchronous) { - Resource resource = (Resource)null; + Resource resource = null; if (this._redirects != null) { foreach (ResourceManager.UriRedirect redirect in this._redirects) @@ -39,8 +39,8 @@ namespace Microsoft.Iris.Data { if (redirect.toPrefix.Equals("{ERROR}", StringComparison.OrdinalIgnoreCase)) { - ErrorManager.ReportError("Resource {0} not found, but should have been located by a markup redirect", (object)uri); - return (Resource)null; + ErrorManager.ReportError("Resource {0} not found, but should have been located by a markup redirect", uri); + return null; } resource = this.GetResourceWorker(redirect.toPrefix + uri.Substring(redirect.fromPrefix.Length), true); if (resource != null) @@ -49,7 +49,7 @@ namespace Microsoft.Iris.Data bool flag = resource.Status == ResourceStatus.Available; resource.Free(); if (!flag) - resource = (Resource)null; + resource = null; } } if (resource != null) @@ -63,20 +63,20 @@ namespace Microsoft.Iris.Data private Resource GetResourceWorker(string uri, bool forceSynchronous) { - Resource resource = (Resource)null; + Resource resource = null; string scheme; string hierarchicalPart; ResourceManager.ParseUri(uri, out scheme, out hierarchicalPart); if (string.IsNullOrEmpty(scheme) || string.IsNullOrEmpty(hierarchicalPart)) { - ErrorManager.ReportWarning("Invalid resource uri: '{0}'", (object)uri); - return (Resource)null; + ErrorManager.ReportWarning("Invalid resource uri: '{0}'", uri); + return null; } IResourceProvider resourceProvider; if (this._sourcesTable.TryGetValue(scheme, out resourceProvider)) resource = resourceProvider.GetResource(hierarchicalPart, uri, forceSynchronous); else - ErrorManager.ReportWarning("Invalid resource protocol: '{0}'", (object)scheme); + ErrorManager.ReportWarning("Invalid resource protocol: '{0}'", scheme); return resource; } @@ -90,7 +90,7 @@ namespace Microsoft.Iris.Data } else { - scheme = (string)null; + scheme = null; hierarchicalPart = uri; } } @@ -110,21 +110,21 @@ namespace Microsoft.Iris.Data ErrorWatermark watermark = ErrorManager.Watermark; Resource resource = ResourceManager.Instance.GetResource(uri, true); if (resource == null) - return (Resource)null; + return null; resource.Acquire(); if (resource.Status == ResourceStatus.Error) { if (resource.ErrorDetails != null) ErrorManager.ReportError(resource.ErrorDetails); else - ErrorManager.ReportError("Failed to acquire resource '{0}'", (object)uri); + ErrorManager.ReportError("Failed to acquire resource '{0}'", uri); } else if (resource.Status != ResourceStatus.Available) - ErrorManager.ReportError("Failed to acquire resource '{0}'. Resources that cannot be fetched synchronously are not valid in this context", (object)uri); + ErrorManager.ReportError("Failed to acquire resource '{0}'. Resources that cannot be fetched synchronously are not valid in this context", uri); if (watermark.ErrorsDetected) { resource.Free(); - resource = (Resource)null; + resource = null; } return resource; } diff --git a/UIX/Microsoft/Iris/Data/SingleArrayListCache.cs b/UIX/Microsoft/Iris/Data/SingleArrayListCache.cs index 7e7c2a6..7d8cb28 100644 --- a/UIX/Microsoft/Iris/Data/SingleArrayListCache.cs +++ b/UIX/Microsoft/Iris/Data/SingleArrayListCache.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Data public ArrayList Acquire() { ArrayList arrayList = this._list; - this._list = (ArrayList)null; + this._list = null; if (arrayList == null) arrayList = new ArrayList(); return arrayList; diff --git a/UIX/Microsoft/Iris/Data/StringUtility.cs b/UIX/Microsoft/Iris/Data/StringUtility.cs index 49a0f6f..c9c88b1 100644 --- a/UIX/Microsoft/Iris/Data/StringUtility.cs +++ b/UIX/Microsoft/Iris/Data/StringUtility.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Data public static string Unescape(string source, out int errorIndex, out string invalidSequence) { - invalidSequence = (string)null; + invalidSequence = null; errorIndex = -1; if (source.IndexOf('\\') == -1) return source; @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Data flag = StringUtility.ReadHexSequence(mode, source, ref index, length, out result); if (flag) { - if (result <= (uint)ushort.MaxValue) + if (result <= ushort.MaxValue) { ch2 = (char)result; break; @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Data string str; if (!flag) { - str = (string)null; + str = null; errorIndex = startIndex; invalidSequence = source.Substring(startIndex, index - startIndex); } @@ -162,11 +162,11 @@ namespace Microsoft.Iris.Data char ch = source[index]; uint num5; if (ch >= '0' && ch <= '9') - num5 = (uint)ch - 48U; + num5 = ch - 48U; else if (ch >= 'a' && ch <= 'f') - num5 = (uint)(10 + ((int)ch - 97)); + num5 = (uint)(10 + (ch - 97)); else if (ch >= 'A' && ch <= 'F') - num5 = (uint)(10 + ((int)ch - 65)); + num5 = (uint)(10 + (ch - 65)); else break; num4 = (num4 << 4) + num5; diff --git a/UIX/Microsoft/Iris/Data/UIListContentsChangedArgs.cs b/UIX/Microsoft/Iris/Data/UIListContentsChangedArgs.cs index 3085594..77a6fb6 100644 --- a/UIX/Microsoft/Iris/Data/UIListContentsChangedArgs.cs +++ b/UIX/Microsoft/Iris/Data/UIListContentsChangedArgs.cs @@ -40,6 +40,6 @@ namespace Microsoft.Iris.Data public int Count => this._count; - public override string ToString() => string.Format("{0} type: {1}, old: {2}, new: {3}, count: {4}", (object)base.ToString(), (object)this.Type, (object)this.OldIndex, (object)this.NewIndex, (object)this.Count); + public override string ToString() => string.Format("{0} type: {1}, old: {2}, new: {3}, count: {4}", base.ToString(), Type, OldIndex, NewIndex, Count); } } diff --git a/UIX/Microsoft/Iris/Data/UpdateHelper.cs b/UIX/Microsoft/Iris/Data/UpdateHelper.cs index 271c7c1..2b38db2 100644 --- a/UIX/Microsoft/Iris/Data/UpdateHelper.cs +++ b/UIX/Microsoft/Iris/Data/UpdateHelper.cs @@ -126,7 +126,7 @@ namespace Microsoft.Iris.Data if (this._itemDistanceComparer == null) this._itemDistanceComparer = new UpdateHelper.ItemDistanceComparer(); this._itemDistanceComparer.Initialize(this._lastInterestIndex, this._virtualList.Count); - this._itemsToUpdate.Sort((IComparer)this._itemDistanceComparer); + this._itemsToUpdate.Sort(_itemDistanceComparer); this._listIsDirty = false; } Stopwatch stopwatch = new Stopwatch(); diff --git a/UIX/Microsoft/Iris/DataProviderMapping.cs b/UIX/Microsoft/Iris/DataProviderMapping.cs index 4811643..0662e5d 100644 --- a/UIX/Microsoft/Iris/DataProviderMapping.cs +++ b/UIX/Microsoft/Iris/DataProviderMapping.cs @@ -19,9 +19,9 @@ namespace Microsoft.Iris private Type _assemblyPropertyType; private Type _assemblyAlternateType; - public object PropertyTypeCookie => (object)this._propertySchema.PropertyType; + public object PropertyTypeCookie => _propertySchema.PropertyType; - public object UnderlyingCollectionTypeCookie => (object)this._propertySchema.AlternateType; + public object UnderlyingCollectionTypeCookie => _propertySchema.AlternateType; public string PropertyName => this._propertySchema.Name; @@ -40,7 +40,7 @@ namespace Microsoft.Iris public object DefaultValue => this._defaultValue; internal DataProviderMapping(PropertySchema propertySchema, object defaultValue) - : this(propertySchema, (string)null, (string)null, defaultValue) + : this(propertySchema, null, null, defaultValue) { } @@ -63,7 +63,7 @@ namespace Microsoft.Iris internal static string GetCanonicalTypeName(TypeSchema typeSchema) { if (typeSchema == null) - return (string)null; + return null; return typeSchema == ListSchema.Type ? "List" : typeSchema.Name; } } diff --git a/UIX/Microsoft/Iris/DataProviderObject.cs b/UIX/Microsoft/Iris/DataProviderObject.cs index df27f7a..45e2cf2 100644 --- a/UIX/Microsoft/Iris/DataProviderObject.cs +++ b/UIX/Microsoft/Iris/DataProviderObject.cs @@ -57,13 +57,13 @@ namespace Microsoft.Iris { Dictionary dictionary = new Dictionary(dataMapping.Mappings.Length); foreach (MarkupDataMappingEntry mapping in dataMapping.Mappings) - dictionary[mapping.Property.Name] = new DataProviderMapping((PropertySchema)mapping.Property, mapping.Source, mapping.Target, AssemblyLoadResult.UnwrapObject(mapping.DefaultValue)); - dataMapping.AssemblyDataProviderCookie = (object)dictionary; + dictionary[mapping.Property.Name] = new DataProviderMapping(mapping.Property, mapping.Source, mapping.Target, AssemblyLoadResult.UnwrapObject(mapping.DefaultValue)); + dataMapping.AssemblyDataProviderCookie = dictionary; } this._mappings = (Dictionary)dataMapping.AssemblyDataProviderCookie; } } - return (IDictionary)this._mappings; + return _mappings; } } @@ -84,8 +84,8 @@ namespace Microsoft.Iris get { if (this._internalObject == null) - this._internalObject = (MarkupDataType)new AssemblyMarkupDataType(this._typeSchema, (IDataProviderObject)this); - return (object)this._internalObject; + this._internalObject = new AssemblyMarkupDataType(this._typeSchema, this); + return _internalObject; } } diff --git a/UIX/Microsoft/Iris/DataProviderQuery.cs b/UIX/Microsoft/Iris/DataProviderQuery.cs index 2f7fd17..1e5f54d 100644 --- a/UIX/Microsoft/Iris/DataProviderQuery.cs +++ b/UIX/Microsoft/Iris/DataProviderQuery.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris protected abstract void BeginExecute(); - public object ResultTypeCookie => (object)this._typeSchema.ResultType; + public object ResultTypeCookie => _typeSchema.ResultType; public object Result { @@ -68,7 +68,7 @@ namespace Microsoft.Iris this.FirePropertyChanged(nameof(Enabled)); if (!this._enabled || !this._isInvalid) return; - this.DeferredBeginExecute((object)null); + this.DeferredBeginExecute(null); } } @@ -87,7 +87,7 @@ namespace Microsoft.Iris return obj; } } - return (object)null; + return null; } public virtual void SetProperty(string propertyName, object value) @@ -122,7 +122,7 @@ namespace Microsoft.Iris this._internalQuery.FireNotificationThreadSafe(propertyName); bool invalidatesQuery = this._typeSchema.InvalidatesQuery(propertyName); if (this.PropertyChanged != null) - this.PropertyChanged((object)this, (PropertyChangedEventArgs)new DataProviderPropertyChangedEventArgs(propertyName, invalidatesQuery)); + this.PropertyChanged(this, new DataProviderPropertyChangedEventArgs(propertyName, invalidatesQuery)); if (this._isInvalid || !invalidatesQuery) return; this._isInvalid = true; @@ -183,7 +183,7 @@ namespace Microsoft.Iris this._isInvalid = true; } - object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => (object)this._internalQuery; + object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => _internalQuery; internal string ProviderName => this._typeSchema.ProviderName; @@ -194,11 +194,11 @@ namespace Microsoft.Iris this._initialized = true; if (!this._enabled) return; - this.DeferredBeginExecute((object)null); + this.DeferredBeginExecute(null); } public override string ToString() => this._typeSchema.Name; - private object SynchronizedPropertyStorage => (object)this._internalQuery; + private object SynchronizedPropertyStorage => _internalQuery; } } diff --git a/UIX/Microsoft/Iris/Drawing/Camera.cs b/UIX/Microsoft/Iris/Drawing/Camera.cs index ef33681..20b551a 100644 --- a/UIX/Microsoft/Iris/Drawing/Camera.cs +++ b/UIX/Microsoft/Iris/Drawing/Camera.cs @@ -33,9 +33,9 @@ namespace Microsoft.Iris.Drawing private IAnimationProvider _upAnimation; private IAnimationProvider _znAnimation; private NotifyService _notifier = new NotifyService(); - private IList _listeners = (IList)new ArrayList(); + private IList _listeners = new ArrayList(); - public Camera() => this._camera = UISession.Default.RenderSession.CreateCamera((object)this); + public Camera() => this._camera = UISession.Default.RenderSession.CreateCamera(this); protected override void OnDispose() { @@ -44,10 +44,10 @@ namespace Microsoft.Iris.Drawing if (activeAnimations != null) { foreach (DisposableObject disposableObject in activeAnimations) - disposableObject.Dispose((object)this); + disposableObject.Dispose(this); } - this._camera.UnregisterUsage((object)this); - this._camera = (ICamera)null; + this._camera.UnregisterUsage(this); + this._camera = null; } public void AddListener(Listener listener) => this._notifier.AddListener(listener); @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Drawing protected void FireNotification(string id) { this._notifier.Fire(id); - foreach (object listener in (IEnumerable)this._listeners) + foreach (object listener in _listeners) { if (listener is ViewItem viewItem) viewItem.MarkPaintInvalid(); @@ -94,7 +94,7 @@ namespace Microsoft.Iris.Drawing if (!(this._camera.Eye != value)) return; this.CameraEyeNoSend = value; - if (this._eyeAnimation == null || !this.PlayAnimation(this._eyeAnimation, (AnimationHandle)null)) + if (this._eyeAnimation == null || !this.PlayAnimation(this._eyeAnimation, null)) this.CameraEye = value; this.FireNotification(NotificationID.Eye); } @@ -126,7 +126,7 @@ namespace Microsoft.Iris.Drawing if (!(this._camera.At != value)) return; this.CameraAtNoSend = value; - if (this._atAnimation == null || !this.PlayAnimation(this._atAnimation, (AnimationHandle)null)) + if (this._atAnimation == null || !this.PlayAnimation(this._atAnimation, null)) this.CameraAt = value; this.FireNotification(NotificationID.At); } @@ -158,7 +158,7 @@ namespace Microsoft.Iris.Drawing if (!(this._camera.Up != value)) return; this.CameraUpNoSend = value; - if (this._upAnimation == null || !this.PlayAnimation(this._upAnimation, (AnimationHandle)null)) + if (this._upAnimation == null || !this.PlayAnimation(this._upAnimation, null)) this.CameraUp = value; this.FireNotification(NotificationID.Up); } @@ -187,10 +187,10 @@ namespace Microsoft.Iris.Drawing get => this._hasZnNoSend ? this._flZnNoSend : this._camera.Zn; set { - if ((double)this._camera.Zn == (double)value) + if (_camera.Zn == (double)value) return; this.CameraZnNoSend = value; - if (this._znAnimation == null || !this.PlayAnimation(this._znAnimation, (AnimationHandle)null)) + if (this._znAnimation == null || !this.PlayAnimation(this._znAnimation, null)) this.CameraZn = value; this.FireNotification(NotificationID.Zn); } @@ -216,7 +216,7 @@ namespace Microsoft.Iris.Drawing internal ICamera APICamera => this._camera; - IAnimatable IAnimatableOwner.AnimationTarget => (IAnimatable)this._camera; + IAnimatable IAnimatableOwner.AnimationTarget => _camera; public IAnimationProvider EyeAnimation { @@ -283,7 +283,7 @@ namespace Microsoft.Iris.Drawing return false; if (shouldPlayAnimation) { - this.PlayAnimation(anim, ref args, (EventHandler)null, animationHandle); + this.PlayAnimation(anim, ref args, null, animationHandle); } else { @@ -299,10 +299,10 @@ namespace Microsoft.Iris.Drawing EventHandler onCompleteHandler, AnimationHandle animationHandle) { - ActiveSequence instance = anim.CreateInstance((IAnimatable)this.APICamera, ref args); + ActiveSequence instance = anim.CreateInstance(APICamera, ref args); if (instance == null) return; - instance.DeclareOwner((object)this); + instance.DeclareOwner(this); if (onCompleteHandler != null) instance.AnimationCompleted += onCompleteHandler; animationHandle?.AssociateWithAnimationInstance(instance); @@ -334,7 +334,7 @@ namespace Microsoft.Iris.Drawing if (activeAnimations == null) return; ActiveTransitions activeTransitions = newSequence.GetActiveTransitions(); - StopCommandSet stopCommand = (StopCommandSet)null; + StopCommandSet stopCommand = null; foreach (ActiveSequence playingSequence in activeAnimations) this.StopAnimationIfOverlapping(playingSequence, newSequence, activeTransitions, ref stopCommand); } @@ -370,12 +370,12 @@ namespace Microsoft.Iris.Drawing activeAnimations.Remove(activeSequence); this.OnAnimationListChanged(); if (activeAnimations.Count == 0) - this._activeAnimations = (Vector)null; + this._activeAnimations = null; if (activeSequence.Template is Animation template) { int num = template.DisableMouseInput ? 1 : 0; } - activeSequence.Dispose((object)this); + activeSequence.Dispose(this); } private void StopActiveAnimations() @@ -392,11 +392,11 @@ namespace Microsoft.Iris.Drawing foreach (BaseKeyframe keyframe in anim.Keyframes) { BaseKeyframe baseKeyframe = baseKeyframeArray[(uint)keyframe.Type]; - if (baseKeyframe == null || (double)baseKeyframe.Time <= (double)keyframe.Time) + if (baseKeyframe == null || baseKeyframe.Time <= (double)keyframe.Time) baseKeyframeArray[(uint)keyframe.Type] = keyframe; } foreach (BaseKeyframe baseKeyframe in baseKeyframeArray) - baseKeyframe?.Apply((IAnimatableOwner)this, ref args); + baseKeyframe?.Apply(this, ref args); } private Vector GetActiveAnimations(bool createIfNone) => this.GetAnimationSequence(ref this._activeAnimations, createIfNone); @@ -405,7 +405,7 @@ namespace Microsoft.Iris.Drawing ref Vector currentAnimationsList, bool createIfNone) { - Vector vector = (Vector)null; + Vector vector = null; if (currentAnimationsList == null) { if (createIfNone) diff --git a/UIX/Microsoft/Iris/Drawing/Color.cs b/UIX/Microsoft/Iris/Drawing/Color.cs index e154da6..9d9545a 100644 --- a/UIX/Microsoft/Iris/Drawing/Color.cs +++ b/UIX/Microsoft/Iris/Drawing/Color.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Drawing private const int ARGBBlueShift = 0; private readonly uint value; - public Color(int red, int green, int blue) => this = Color.FromArgb((int)byte.MaxValue, red, green, blue); + public Color(int red, int green, int blue) => this = Color.FromArgb(byte.MaxValue, red, green, blue); public Color(float red, float green, float blue) => this = Color.FromArgb(1f, red, green, blue); @@ -30,34 +30,34 @@ namespace Microsoft.Iris.Drawing public byte R { - get => (byte)(this.Value >> 16 & (uint)byte.MaxValue); - set => this = Color.FromArgb((int)this.A, (int)value, (int)this.G, (int)this.B); + get => (byte)(this.Value >> 16 & byte.MaxValue); + set => this = Color.FromArgb(A, value, G, B); } public byte G { - get => (byte)(this.Value >> 8 & (uint)byte.MaxValue); - set => this = Color.FromArgb((int)this.A, (int)this.R, (int)value, (int)this.B); + get => (byte)(this.Value >> 8 & byte.MaxValue); + set => this = Color.FromArgb(A, R, value, B); } public byte B { - get => (byte)(this.Value & (uint)byte.MaxValue); - set => this = Color.FromArgb((int)this.A, (int)this.R, (int)this.G, (int)value); + get => (byte)(this.Value & byte.MaxValue); + set => this = Color.FromArgb(A, R, G, value); } public byte A { - get => (byte)(this.Value >> 24 & (uint)byte.MaxValue); - set => this = Color.FromArgb((int)value, (int)this.R, (int)this.G, (int)this.B); + get => (byte)(this.Value >> 24 & byte.MaxValue); + set => this = Color.FromArgb(value, R, G, B); } internal void GetArgb(out float a, out float r, out float g, out float b) { - a = (float)this.A / (float)byte.MaxValue; - r = (float)this.R / (float)byte.MaxValue; - g = (float)this.G / (float)byte.MaxValue; - b = (float)this.B / (float)byte.MaxValue; + a = A / (float)byte.MaxValue; + r = R / (float)byte.MaxValue; + g = G / (float)byte.MaxValue; + b = B / (float)byte.MaxValue; } internal uint Value => this.value; @@ -66,9 +66,9 @@ namespace Microsoft.Iris.Drawing { } - private static int ChannelFromFloat(float value) => (int)((double)value * (double)byte.MaxValue); + private static int ChannelFromFloat(float value) => (int)(value * (double)byte.MaxValue); - private static uint MakeArgb(byte alpha, byte red, byte green, byte blue) => (uint)((int)red << 16 | (int)green << 8 | (int)blue | (int)alpha << 24); + private static uint MakeArgb(byte alpha, byte red, byte green, byte blue) => (uint)(red << 16 | green << 8 | blue | alpha << 24); internal static Color FromArgb(uint argb) => new Color(argb); @@ -89,102 +89,102 @@ namespace Microsoft.Iris.Drawing return new Color(Color.MakeArgb((byte)alpha, baseColor.R, baseColor.G, baseColor.B)); } - internal static Color FromArgb(int red, int green, int blue) => Color.FromArgb((int)byte.MaxValue, red, green, blue); + internal static Color FromArgb(int red, int green, int blue) => Color.FromArgb(byte.MaxValue, red, green, blue); internal float GetValue() { - float num1 = (float)this.R / (float)byte.MaxValue; - float num2 = (float)this.G / (float)byte.MaxValue; - float num3 = (float)this.B / (float)byte.MaxValue; + float num1 = R / (float)byte.MaxValue; + float num2 = G / (float)byte.MaxValue; + float num3 = B / (float)byte.MaxValue; float num4 = num1; float num5 = num1; - if ((double)num2 > (double)num4) + if (num2 > (double)num4) num4 = num2; - if ((double)num3 > (double)num4) + if (num3 > (double)num4) num4 = num3; - if ((double)num2 < (double)num5) + if (num2 < (double)num5) num5 = num2; - if ((double)num3 < (double)num5) + if (num3 < (double)num5) num5 = num3; - return (float)(((double)num4 + (double)num5) / 2.0); + return (float)((num4 + (double)num5) / 2.0); } internal float GetHue() { - if ((int)this.R == (int)this.G && (int)this.G == (int)this.B) + if (R == G && G == B) return 0.0f; - float num1 = (float)this.R / (float)byte.MaxValue; - float num2 = (float)this.G / (float)byte.MaxValue; - float num3 = (float)this.B / (float)byte.MaxValue; + float num1 = R / (float)byte.MaxValue; + float num2 = G / (float)byte.MaxValue; + float num3 = B / (float)byte.MaxValue; float num4 = 0.0f; float num5 = num1; float num6 = num1; - if ((double)num2 > (double)num5) + if (num2 > (double)num5) num5 = num2; - if ((double)num3 > (double)num5) + if (num3 > (double)num5) num5 = num3; - if ((double)num2 < (double)num6) + if (num2 < (double)num6) num6 = num2; - if ((double)num3 < (double)num6) + if (num3 < (double)num6) num6 = num3; float num7 = num5 - num6; - if ((double)num1 == (double)num5) + if (num1 == (double)num5) num4 = (num2 - num3) / num7; - else if ((double)num2 == (double)num5) - num4 = (float)(2.0 + ((double)num3 - (double)num1) / (double)num7); - else if ((double)num3 == (double)num5) - num4 = (float)(4.0 + ((double)num1 - (double)num2) / (double)num7); + else if (num2 == (double)num5) + num4 = (float)(2.0 + (num3 - (double)num1) / num7); + else if (num3 == (double)num5) + num4 = (float)(4.0 + (num1 - (double)num2) / num7); float num8 = num4 * 60f; - if ((double)num8 < 0.0) + if (num8 < 0.0) num8 += 360f; return num8; } internal float GetSaturation() { - float num1 = (float)this.R / (float)byte.MaxValue; - float num2 = (float)this.G / (float)byte.MaxValue; - float num3 = (float)this.B / (float)byte.MaxValue; + float num1 = R / (float)byte.MaxValue; + float num2 = G / (float)byte.MaxValue; + float num3 = B / (float)byte.MaxValue; float num4 = 0.0f; float num5 = num1; float num6 = num1; - if ((double)num2 > (double)num5) + if (num2 > (double)num5) num5 = num2; - if ((double)num3 > (double)num5) + if (num3 > (double)num5) num5 = num3; - if ((double)num2 < (double)num6) + if (num2 < (double)num6) num6 = num2; - if ((double)num3 < (double)num6) + if (num3 < (double)num6) num6 = num3; - if ((double)num5 != (double)num6) - num4 = ((double)num5 + (double)num6) / 2.0 > 0.5 ? (float)(((double)num5 - (double)num6) / (2.0 - (double)num5 - (double)num6)) : (float)(((double)num5 - (double)num6) / ((double)num5 + (double)num6)); + if (num5 != (double)num6) + num4 = (num5 + (double)num6) / 2.0 > 0.5 ? (float)((num5 - (double)num6) / (2.0 - num5 - num6)) : (float)((num5 - (double)num6) / (num5 + (double)num6)); return num4; } internal static Color FromHSV(int nAlpha, float flHue, float flSaturation, float flValue) { - if ((double)flSaturation == 0.0) - return new Color(nAlpha, (int)((double)flValue * (double)byte.MaxValue), (int)((double)flValue * (double)byte.MaxValue), (int)((double)flValue * (double)byte.MaxValue)); + if (flSaturation == 0.0) + return new Color(nAlpha, (int)(flValue * (double)byte.MaxValue), (int)(flValue * (double)byte.MaxValue), (int)(flValue * (double)byte.MaxValue)); float num1 = flHue / 60f; - int num2 = (int)Math.Floor((double)num1) % 6; - float num3 = num1 - (float)num2; + int num2 = (int)Math.Floor(num1) % 6; + float num3 = num1 - num2; float num4 = flValue * (1f - flSaturation); - float num5 = flValue * (float)(1.0 - (double)num3 * (double)flSaturation); - float num6 = flValue * (float)(1.0 - (1.0 - (double)num3) * (double)flSaturation); + float num5 = flValue * (float)(1.0 - num3 * (double)flSaturation); + float num6 = flValue * (float)(1.0 - (1.0 - num3) * flSaturation); switch (num2) { case 0: - return new Color(nAlpha, (int)((double)flValue * (double)byte.MaxValue), (int)((double)num6 * (double)byte.MaxValue), (int)((double)num4 * (double)byte.MaxValue)); + return new Color(nAlpha, (int)(flValue * (double)byte.MaxValue), (int)(num6 * (double)byte.MaxValue), (int)(num4 * (double)byte.MaxValue)); case 1: - return new Color(nAlpha, (int)((double)num5 * (double)byte.MaxValue), (int)((double)flValue * (double)byte.MaxValue), (int)((double)num4 * (double)byte.MaxValue)); + return new Color(nAlpha, (int)(num5 * (double)byte.MaxValue), (int)(flValue * (double)byte.MaxValue), (int)(num4 * (double)byte.MaxValue)); case 2: - return new Color(nAlpha, (int)((double)num4 * (double)byte.MaxValue), (int)((double)flValue * (double)byte.MaxValue), (int)((double)num6 * (double)byte.MaxValue)); + return new Color(nAlpha, (int)(num4 * (double)byte.MaxValue), (int)(flValue * (double)byte.MaxValue), (int)(num6 * (double)byte.MaxValue)); case 3: - return new Color(nAlpha, (int)((double)num4 * (double)byte.MaxValue), (int)((double)num5 * (double)byte.MaxValue), (int)((double)flValue * (double)byte.MaxValue)); + return new Color(nAlpha, (int)(num4 * (double)byte.MaxValue), (int)(num5 * (double)byte.MaxValue), (int)(flValue * (double)byte.MaxValue)); case 4: - return new Color(nAlpha, (int)((double)num6 * (double)byte.MaxValue), (int)((double)num4 * (double)byte.MaxValue), (int)((double)flValue * (double)byte.MaxValue)); + return new Color(nAlpha, (int)(num6 * (double)byte.MaxValue), (int)(num4 * (double)byte.MaxValue), (int)(flValue * (double)byte.MaxValue)); case 5: - return new Color(nAlpha, (int)((double)flValue * (double)byte.MaxValue), (int)((double)num4 * (double)byte.MaxValue), (int)((double)num5 * (double)byte.MaxValue)); + return new Color(nAlpha, (int)(flValue * (double)byte.MaxValue), (int)(num4 * (double)byte.MaxValue), (int)(num5 * (double)byte.MaxValue)); default: return new Color(nAlpha, 0, 0, 0); } @@ -192,7 +192,7 @@ namespace Microsoft.Iris.Drawing internal int ToArgb() => (int)this.Value; - internal ColorF RenderConvert() => new ColorF((int)this.A, (int)this.R, (int)this.G, (int)this.B); + internal ColorF RenderConvert() => new ColorF(A, R, G, B); public override string ToString() { diff --git a/UIX/Microsoft/Iris/Drawing/Font.cs b/UIX/Microsoft/Iris/Drawing/Font.cs index cece2ec..d003569 100644 --- a/UIX/Microsoft/Iris/Drawing/Font.cs +++ b/UIX/Microsoft/Iris/Drawing/Font.cs @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Drawing public float AltFontSize { - get => (double)this._altFontHeight == 0.0 ? this._fontHeight : this._altFontHeight; + get => _altFontHeight == 0.0 ? this._fontHeight : this._altFontHeight; set => this._altFontHeight = value; } @@ -72,7 +72,7 @@ namespace Microsoft.Iris.Drawing set => this._fontName = value; } - public override bool Equals(object obj) => obj is Font font && this._fontName == font._fontName && ((double)this._fontHeight == (double)font._fontHeight && (double)this._altFontHeight == (double)font._altFontHeight) && this._fontStyle == font._fontStyle; + public override bool Equals(object obj) => obj is Font font && this._fontName == font._fontName && (_fontHeight == (double)font._fontHeight && _altFontHeight == (double)font._altFontHeight) && this._fontStyle == font._fontStyle; public override int GetHashCode() => this._fontName.GetHashCode() ^ this._fontHeight.GetHashCode() ^ this._altFontHeight.GetHashCode() ^ this._fontStyle.GetHashCode(); @@ -84,7 +84,7 @@ namespace Microsoft.Iris.Drawing stringBuilder.Append("\" "); stringBuilder.Append(this._fontHeight); stringBuilder.Append("pt "); - stringBuilder.Append((object)this._fontStyle); + stringBuilder.Append(_fontStyle); stringBuilder.Append("}"); return stringBuilder.ToString(); } diff --git a/UIX/Microsoft/Iris/Drawing/RawImage.cs b/UIX/Microsoft/Iris/Drawing/RawImage.cs index 9de5219..b2ef60c 100644 --- a/UIX/Microsoft/Iris/Drawing/RawImage.cs +++ b/UIX/Microsoft/Iris/Drawing/RawImage.cs @@ -68,18 +68,18 @@ namespace Microsoft.Iris.Drawing protected override ImageCacheItem GetCacheItem(out bool needAsyncLoad) { - ImageCache instance = (ImageCache)ScavengeImageCache.Instance; - ImageCacheItem imageCacheItem = (ImageCacheItem)null; + ImageCache instance = ScavengeImageCache.Instance; + ImageCacheItem imageCacheItem = null; string str = this.GetHashCode().ToString(); if (this._cacheItemKey == null) this._cacheItemKey = new RawImageItemKey(str); else - imageCacheItem = instance.Lookup((ImageCacheKey)this._cacheItemKey); + imageCacheItem = instance.Lookup(_cacheItemKey); if (imageCacheItem == null) { Size maxSize = UIImage.ClampSize(this._maximumSize); - imageCacheItem = (ImageCacheItem)new RawImageItem(UISession.Default.RenderSession, this, str, this._data, this._length, this._imageSize, this._stride, this._format, maxSize, this.IsFlipped, this._antialiasEdges); - instance.Add((ImageCacheKey)this._cacheItemKey, imageCacheItem); + imageCacheItem = new RawImageItem(UISession.Default.RenderSession, this, str, this._data, this._length, this._imageSize, this._stride, this._format, maxSize, this.IsFlipped, this._antialiasEdges); + instance.Add(_cacheItemKey, imageCacheItem); } needAsyncLoad = false; return imageCacheItem; diff --git a/UIX/Microsoft/Iris/Drawing/RawImageItem.cs b/UIX/Microsoft/Iris/Drawing/RawImageItem.cs index 5db5775..c29d236 100644 --- a/UIX/Microsoft/Iris/Drawing/RawImageItem.cs +++ b/UIX/Microsoft/Iris/Drawing/RawImageItem.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Drawing bool antialiasEdges) : base(renderSession, source, maxSize, flippable, antialiasEdges) { - this._oKeepAlive = (object)rawImage; + this._oKeepAlive = rawImage; this.SetSize(imageSize); this.SetBuffer(data, length); this._stride = stride; @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Drawing protected override void OnDispose() { - this._oKeepAlive = (object)null; + this._oKeepAlive = null; this.m_buffer = IntPtr.Zero; base.OnDispose(); } diff --git a/UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs b/UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs index ef1fc55..e06398b 100644 --- a/UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs +++ b/UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Drawing public override bool Equals(object obj) { - if (object.ReferenceEquals((object)this, obj)) + if (object.ReferenceEquals(this, obj)) return true; return obj is RawImageItemKey rawImageItemKey && this._uniqueId == rawImageItemKey._uniqueId; } diff --git a/UIX/Microsoft/Iris/Drawing/ResourceImageItem.cs b/UIX/Microsoft/Iris/Drawing/ResourceImageItem.cs index b3ecdef..a158b03 100644 --- a/UIX/Microsoft/Iris/Drawing/ResourceImageItem.cs +++ b/UIX/Microsoft/Iris/Drawing/ResourceImageItem.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Drawing if (this._resource != null) { this.FreeResource(); - this._resource = (Resource)null; + this._resource = null; } base.OnDispose(); } @@ -89,7 +89,7 @@ namespace Microsoft.Iris.Drawing ImageStatus status = this.Status; if (this.LoadCompleteHandler == null) return; - this.LoadCompleteHandler((object)this, status); + this.LoadCompleteHandler(this, status); } private bool IsResourceAvailable() => this._resource.Status == ResourceStatus.Available; @@ -128,7 +128,7 @@ namespace Microsoft.Iris.Drawing if (this._acquireCalled) { this._resource.Free(this._resourceAcquisitionHandler); - this._resourceAcquisitionHandler = (ResourceAcquisitionCompleteHandler)null; + this._resourceAcquisitionHandler = null; } this._acquireCalled = false; } @@ -139,7 +139,7 @@ namespace Microsoft.Iris.Drawing public override void ReleaseImage() { - this.LoadCompleteHandler = (ContentLoadCompleteHandler)null; + this.LoadCompleteHandler = null; base.ReleaseImage(); } diff --git a/UIX/Microsoft/Iris/Drawing/RichText.cs b/UIX/Microsoft/Iris/Drawing/RichText.cs index 8483389..392f1ca 100644 --- a/UIX/Microsoft/Iris/Drawing/RichText.cs +++ b/UIX/Microsoft/Iris/Drawing/RichText.cs @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Drawing private object _lock; public RichText(bool richTextMode) - : this(richTextMode, (IRichTextCallbacks)null) + : this(richTextMode, null) { } @@ -59,7 +59,7 @@ namespace Microsoft.Iris.Drawing { if (!inDispose) return; - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); lock (this._lock) { NativeApi.SpRichTextDestroyObject(this._rtoHandle); @@ -87,7 +87,7 @@ namespace Microsoft.Iris.Drawing { get { - string str = (string)null; + string str = null; int textLength = 0; lock (this._lock) { @@ -169,7 +169,7 @@ namespace Microsoft.Iris.Drawing public unsafe TextFlow Measure(string content, ref TextMeasureParams measureParams) { TextFlow textFlow = new TextFlow(); - GCHandle gcHandle = GCHandle.Alloc((object)textFlow); + GCHandle gcHandle = GCHandle.Alloc(textFlow); this._currentlyMeasuringText = content != null ? content : string.Empty; fixed (char* content1 = this._currentlyMeasuringText) fixed (char* chPtr = measureParams._textStyle.FontFace) @@ -192,7 +192,7 @@ namespace Microsoft.Iris.Drawing } } gcHandle.Free(); - this._currentlyMeasuringText = (string)null; + this._currentlyMeasuringText = null; return textFlow; } @@ -391,9 +391,9 @@ namespace Microsoft.Iris.Drawing if (dispatcherTimer == null) { dispatcherTimer = new DispatcherTimer(); - this._timers.Add((object)dispatcherTimer); + this._timers.Add(dispatcherTimer); } - dispatcherTimer.UserData = (object)id; + dispatcherTimer.UserData = id; dispatcherTimer.Interval = (int)timeout; dispatcherTimer.Tick += this._timerTickHandler; dispatcherTimer.Start(); @@ -405,7 +405,7 @@ namespace Microsoft.Iris.Drawing if (timer == null) return; this.DisposeTimer(timer); - this._timers.Remove((object)timer); + this._timers.Remove(timer); } private DispatcherTimer FindTimer(uint id) @@ -416,7 +416,7 @@ namespace Microsoft.Iris.Drawing if ((int)(uint)timer.UserData == (int)id) return timer; } - return (DispatcherTimer)null; + return null; } private void DisposeTimer(DispatcherTimer timer) @@ -440,13 +440,13 @@ namespace Microsoft.Iris.Drawing IntPtr dataPtr) { bool flag = false; - if (this._currentlyMeasuringText != null && (long)this._currentlyMeasuringText.Length == (long)nChars) + if (this._currentlyMeasuringText != null && _currentlyMeasuringText.Length == nChars) { flag = true; char* pointer = (char*)lpString.ToPointer(); - for (int index = 0; (long)index < (long)nChars; ++index) + for (int index = 0; index < nChars; ++index) { - if ((int)this._currentlyMeasuringText[index] != (int)pointer[index]) + if (this._currentlyMeasuringText[index] != pointer[index]) { flag = false; break; diff --git a/UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs b/UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs index 8aef67b..cc11dea 100644 --- a/UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs +++ b/UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs @@ -64,14 +64,14 @@ namespace Microsoft.Iris.Drawing this._flags |= 16; break; } - this._hashCode = this._samplingMode.GetHashCode() ^ this._content.GetHashCode() ^ this._srcSizeF.GetHashCode() ^ this._naturalSize.GetHashCode() ^ this._rasterizedOffset.GetHashCode() ^ this._fontFaceUniqueId.GetHashCode() ^ this._fontSize ^ this._fontWeight ^ this._flags ^ (int)this._rasterizerConfig ^ this._textColor.GetHashCode(); + this._hashCode = this._samplingMode.GetHashCode() ^ this._content.GetHashCode() ^ this._srcSizeF.GetHashCode() ^ this._naturalSize.GetHashCode() ^ this._rasterizedOffset.GetHashCode() ^ this._fontFaceUniqueId.GetHashCode() ^ this._fontSize ^ this._fontWeight ^ this._flags ^ _rasterizerConfig ^ this._textColor.GetHashCode(); } public override bool Equals(object obj) { - if (object.ReferenceEquals((object)this, obj)) + if (object.ReferenceEquals(this, obj)) return true; - return obj is RichTextInfoKey richTextInfoKey && this._hashCode == richTextInfoKey._hashCode && (this._fontFaceUniqueId == richTextInfoKey._fontFaceUniqueId && this._fontSize == richTextInfoKey._fontSize) && (this._fontWeight == richTextInfoKey._fontWeight && this._flags == richTextInfoKey._flags && ((int)this._rasterizerConfig == (int)richTextInfoKey._rasterizerConfig && this._samplingMode.Equals(richTextInfoKey._samplingMode))) && (this._srcSizeF.Equals(richTextInfoKey._srcSizeF) && this._naturalSize.Equals(richTextInfoKey._naturalSize) && (this._rasterizedOffset.Equals(richTextInfoKey._rasterizedOffset) && this._textColor.Equals(richTextInfoKey._textColor))) && this._content.Equals(richTextInfoKey._content); + return obj is RichTextInfoKey richTextInfoKey && this._hashCode == richTextInfoKey._hashCode && (this._fontFaceUniqueId == richTextInfoKey._fontFaceUniqueId && this._fontSize == richTextInfoKey._fontSize) && (this._fontWeight == richTextInfoKey._fontWeight && this._flags == richTextInfoKey._flags && (_rasterizerConfig == richTextInfoKey._rasterizerConfig && this._samplingMode.Equals(richTextInfoKey._samplingMode))) && (this._srcSizeF.Equals(richTextInfoKey._srcSizeF) && this._naturalSize.Equals(richTextInfoKey._naturalSize) && (this._rasterizedOffset.Equals(richTextInfoKey._rasterizedOffset) && this._textColor.Equals(richTextInfoKey._textColor))) && this._content.Equals(richTextInfoKey._content); } public override int GetHashCode() => this._hashCode; diff --git a/UIX/Microsoft/Iris/Drawing/Rotation.cs b/UIX/Microsoft/Iris/Drawing/Rotation.cs index 830cd2f..0a81cd4 100644 --- a/UIX/Microsoft/Iris/Drawing/Rotation.cs +++ b/UIX/Microsoft/Iris/Drawing/Rotation.cs @@ -40,15 +40,15 @@ namespace Microsoft.Iris.Drawing public int AngleDegrees { - get => (int)((double)this._angleRad * 180.0 / 3.14159274101257); - set => this._angleRad = (float)((double)value * 3.14159274101257 / 180.0); + get => (int)(_angleRad * 180.0 / 3.14159274101257); + set => this._angleRad = (float)(value * 3.14159274101257 / 180.0); } public override bool Equals(object obj) => obj is Rotation rotation && this == rotation; - public static bool operator ==(Rotation left, Rotation right) => left.Axis == right.Axis && (double)left.AngleRadians == (double)right.AngleRadians; + public static bool operator ==(Rotation left, Rotation right) => left.Axis == right.Axis && left.AngleRadians == (double)right.AngleRadians; - public static bool operator !=(Rotation left, Rotation right) => left.Axis != right.Axis || (double)left.AngleRadians != (double)right.AngleRadians; + public static bool operator !=(Rotation left, Rotation right) => left.Axis != right.Axis || left.AngleRadians != (double)right.AngleRadians; public override int GetHashCode() => this.Axis.GetHashCode() ^ this.AngleRadians.GetHashCode(); @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Drawing { StringBuilder stringBuilder = new StringBuilder(128); stringBuilder.Append("(Axis="); - stringBuilder.Append((object)this.Axis); + stringBuilder.Append(Axis); stringBuilder.Append(", Angle="); stringBuilder.Append(this.AngleRadians); stringBuilder.Append(")"); diff --git a/UIX/Microsoft/Iris/Drawing/ScavengeImageCache.cs b/UIX/Microsoft/Iris/Drawing/ScavengeImageCache.cs index 1c0c445..d37aeae 100644 --- a/UIX/Microsoft/Iris/Drawing/ScavengeImageCache.cs +++ b/UIX/Microsoft/Iris/Drawing/ScavengeImageCache.cs @@ -43,15 +43,15 @@ namespace Microsoft.Iris.Drawing TimeoutManager timeoutManager = this._session.Dispatcher.TimeoutManager; ScavengeImageCache.ScavengeCallback callback = this._callback; if (callback != null) - timeoutManager.CancelTimeout((QueueItem)callback); - this._callback = (ScavengeImageCache.ScavengeCallback)null; + timeoutManager.CancelTimeout(callback); + this._callback = null; base.OnDispose(); } protected override void ScheduleScavenge() { if (!this.CleanupPending) - DeferredCall.Post(DispatchPriority.Idle, ScavengeImageCache.s_dhReschedule, (object)this); + DeferredCall.Post(DispatchPriority.Idle, ScavengeImageCache.s_dhReschedule, this); base.ScheduleScavenge(); } @@ -62,11 +62,11 @@ namespace Microsoft.Iris.Drawing return; TimeoutManager timeoutManager = cache._session.Dispatcher.TimeoutManager; ScavengeImageCache.ScavengeCallback callback = cache._callback; - cache._callback = (ScavengeImageCache.ScavengeCallback)null; + cache._callback = null; if (callback != null) - timeoutManager.CancelTimeout((QueueItem)callback); + timeoutManager.CancelTimeout(callback); ScavengeImageCache.ScavengeCallback scavengeCallback = new ScavengeImageCache.ScavengeCallback(cache); - timeoutManager.SetTimeoutRelative((QueueItem)scavengeCallback, TimeSpan.FromSeconds(5.0)); + timeoutManager.SetTimeoutRelative(scavengeCallback, TimeSpan.FromSeconds(5.0)); cache._callback = scavengeCallback; } @@ -80,7 +80,7 @@ namespace Microsoft.Iris.Drawing { if (this._cache._callback != this) return; - this._cache._callback = (ScavengeImageCache.ScavengeCallback)null; + this._cache._callback = null; this._cache.CullObjects(); } } diff --git a/UIX/Microsoft/Iris/Drawing/SimpleText.cs b/UIX/Microsoft/Iris/Drawing/SimpleText.cs index d8a56c7..0daae10 100644 --- a/UIX/Microsoft/Iris/Drawing/SimpleText.cs +++ b/UIX/Microsoft/Iris/Drawing/SimpleText.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Drawing public void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); NativeApi.SpSimpleTextDestroyObject(this._stoHandle); this._stoHandle = Win32Api.HANDLE.NULL; } @@ -59,13 +59,13 @@ namespace Microsoft.Iris.Drawing switch (alignment) { case LineAlignment.Near: - wAlignment = (short)1; + wAlignment = 1; break; case LineAlignment.Center: - wAlignment = (short)3; + wAlignment = 3; break; case LineAlignment.Far: - wAlignment = (short)2; + wAlignment = 2; break; } IntPtr hGlyphRunInfo; diff --git a/UIX/Microsoft/Iris/Drawing/TextFlow.cs b/UIX/Microsoft/Iris/Drawing/TextFlow.cs index 783431d..bebdfee 100644 --- a/UIX/Microsoft/Iris/Drawing/TextFlow.cs +++ b/UIX/Microsoft/Iris/Drawing/TextFlow.cs @@ -35,12 +35,12 @@ namespace Microsoft.Iris.Drawing { if (this._runsList is TextRun runsList) { - runsList.UnregisterUsage((object)this); + runsList.UnregisterUsage(this); } else { foreach (SharedDisposableObject runs in (Vector)this._runsList) - runs.UnregisterUsage((object)this); + runs.UnregisterUsage(this); } } base.OnDispose(); @@ -104,9 +104,9 @@ namespace Microsoft.Iris.Drawing this._bounds = Rectangle.Union(this._bounds, run.LayoutBounds); if (this._runsList == null) { - this._runsList = (object)run; + this._runsList = run; this._lineBounds = new Vector(); - this._lineBounds.Add((object)run.RenderBounds); + this._lineBounds.Add(run.RenderBounds); } else { @@ -115,7 +115,7 @@ namespace Microsoft.Iris.Drawing object runsList = this._runsList; vector = new Vector(); vector.Add(runsList); - this._runsList = (object)vector; + this._runsList = vector; } if (run.UnderlineStyle != NativeApi.UnderlineStyle.None) { @@ -133,17 +133,17 @@ namespace Microsoft.Iris.Drawing } if (this._lineBounds.Count < run.Line) { - this._lineBounds.Add((object)run.RenderBounds); + this._lineBounds.Add(run.RenderBounds); } else { RectangleF lineBound = (RectangleF)this._lineBounds[run.Line - 1]; if ((int)lineBound.Y > (int)run.RenderBounds.Y || lineBound.IsEmpty) - this._lineBounds[run.Line - 1] = (object)run.RenderBounds; + this._lineBounds[run.Line - 1] = run.RenderBounds; } - vector.Add((object)run); + vector.Add(run); } - run.RegisterUsage((object)this); + run.RegisterUsage(this); } public void AddFit(TextRun run) @@ -166,7 +166,7 @@ namespace Microsoft.Iris.Drawing public void ResetFitTracking() { - this._lastFitRun = (TextRun)null; + this._lastFitRun = null; this._fitBounds = new Rectangle(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue); } @@ -182,15 +182,15 @@ namespace Microsoft.Iris.Drawing return; if (this._runsList is TextRun runsList) { - runsList.TextSprite = (ISprite)null; - runsList.HighlightSprite = (ISprite)null; + runsList.TextSprite = null; + runsList.HighlightSprite = null; } else { foreach (TextRun runs in (Vector)this._runsList) { - runs.TextSprite = (ISprite)null; - runs.HighlightSprite = (ISprite)null; + runs.TextSprite = null; + runs.HighlightSprite = null; } } } diff --git a/UIX/Microsoft/Iris/Drawing/TextImageCache.cs b/UIX/Microsoft/Iris/Drawing/TextImageCache.cs index ea5f738..d031667 100644 --- a/UIX/Microsoft/Iris/Drawing/TextImageCache.cs +++ b/UIX/Microsoft/Iris/Drawing/TextImageCache.cs @@ -43,15 +43,15 @@ namespace Microsoft.Iris.Drawing TimeoutManager timeoutManager = this._session.Dispatcher.TimeoutManager; TextImageCache.ScavengeCallback callback = this._callback; if (callback != null) - timeoutManager.CancelTimeout((QueueItem)callback); - this._callback = (TextImageCache.ScavengeCallback)null; + timeoutManager.CancelTimeout(callback); + this._callback = null; base.OnDispose(); } protected override void ScheduleScavenge() { if (!this.CleanupPending) - DeferredCall.Post(DispatchPriority.Idle, TextImageCache.s_dhReschedule, (object)this); + DeferredCall.Post(DispatchPriority.Idle, TextImageCache.s_dhReschedule, this); base.ScheduleScavenge(); } @@ -62,11 +62,11 @@ namespace Microsoft.Iris.Drawing return; TimeoutManager timeoutManager = cache._session.Dispatcher.TimeoutManager; TextImageCache.ScavengeCallback callback = cache._callback; - cache._callback = (TextImageCache.ScavengeCallback)null; + cache._callback = null; if (callback != null) - timeoutManager.CancelTimeout((QueueItem)callback); + timeoutManager.CancelTimeout(callback); TextImageCache.ScavengeCallback scavengeCallback = new TextImageCache.ScavengeCallback(cache); - timeoutManager.SetTimeoutRelative((QueueItem)scavengeCallback, TimeSpan.FromSeconds(5.0)); + timeoutManager.SetTimeoutRelative(scavengeCallback, TimeSpan.FromSeconds(5.0)); cache._callback = scavengeCallback; } @@ -80,7 +80,7 @@ namespace Microsoft.Iris.Drawing { if (this._cache._callback != this) return; - this._cache._callback = (TextImageCache.ScavengeCallback)null; + this._cache._callback = null; this._cache.CullObjects(); } } diff --git a/UIX/Microsoft/Iris/Drawing/TextImageItem.cs b/UIX/Microsoft/Iris/Drawing/TextImageItem.cs index 9241213..8471887 100644 --- a/UIX/Microsoft/Iris/Drawing/TextImageItem.cs +++ b/UIX/Microsoft/Iris/Drawing/TextImageItem.cs @@ -27,8 +27,8 @@ namespace Microsoft.Iris.Drawing : base(renderSession, run.Content) { this._run = run; - this._run.RegisterUsage((object)this); - this._dib = (Dib)null; + this._run.RegisterUsage(this); + this._dib = null; this._samplingModeName = samplingModeName; this._outlineFlag = outlineFlag; this._textColor = textColor; @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Drawing protected override void OnDispose() { - this._run.UnregisterUsage((object)this); + this._run.UnregisterUsage(this); this.ReleaseDib(); base.OnDispose(); } @@ -66,7 +66,7 @@ namespace Microsoft.Iris.Drawing if (this._dib == null) return; this._dib.Dispose(); - this._dib = (Dib)null; + this._dib = null; } } } diff --git a/UIX/Microsoft/Iris/Drawing/TextMeasureParams.cs b/UIX/Microsoft/Iris/Drawing/TextMeasureParams.cs index 51db5b6..1b55d61 100644 --- a/UIX/Microsoft/Iris/Drawing/TextMeasureParams.cs +++ b/UIX/Microsoft/Iris/Drawing/TextMeasureParams.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Drawing if (rangeStyleFontFace.IsAllocated) rangeStyleFontFace.Free(); } - this._formattedRangeStyleFontFaces = (GCHandle[])null; + this._formattedRangeStyleFontFaces = null; } public unsafe void SetContent(char* content) @@ -50,13 +50,13 @@ namespace Microsoft.Iris.Drawing switch (lineAlignment) { case LineAlignment.Near: - this._data._alignment = (byte)1; + this._data._alignment = 1; break; case LineAlignment.Center: - this._data._alignment = (byte)3; + this._data._alignment = 3; break; case LineAlignment.Far: - this._data._alignment = (byte)2; + this._data._alignment = 2; break; } this._textStyle = style; @@ -108,7 +108,7 @@ namespace Microsoft.Iris.Drawing string fontFace = style.FontFace; if (fontFace == null) return; - GCHandle gcHandle = GCHandle.Alloc((object)fontFace, GCHandleType.Pinned); + GCHandle gcHandle = GCHandle.Alloc(fontFace, GCHandleType.Pinned); this._formattedRangeStyles[index]._fontFace = (char*)gcHandle.AddrOfPinnedObject().ToPointer(); this._formattedRangeStyleFontFaces[index] = gcHandle; } diff --git a/UIX/Microsoft/Iris/Drawing/TextRun.cs b/UIX/Microsoft/Iris/Drawing/TextRun.cs index fbfb35f..e45b452 100644 --- a/UIX/Microsoft/Iris/Drawing/TextRun.cs +++ b/UIX/Microsoft/Iris/Drawing/TextRun.cs @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Drawing string content) { this._hGlyphRunInfo = hGlyphRunInfo; - this._hRasterizeRunPacket = new IntPtr((void*)runPacketPtr); + this._hRasterizeRunPacket = new IntPtr(runPacketPtr); this._layoutBounds = runPacketPtr->rcLayoutBounds; this._renderBounds = runPacketPtr->rcfRenderBounds; this._naturalX = runPacketPtr->naturalX; @@ -61,8 +61,8 @@ namespace Microsoft.Iris.Drawing this._fontFaceUniqueId = runPacketPtr->fontFaceUniqueId; this._lfHeight = runPacketPtr->lf.lfHeight; this._lfWeight = runPacketPtr->lf.lfWeight; - this.SetBit(TextRun.Bits.Italic, runPacketPtr->lf.lfItalic != (byte)0); - this.SetBit(TextRun.Bits.Underline, runPacketPtr->lf.lfUnderline != (byte)0); + this.SetBit(TextRun.Bits.Italic, runPacketPtr->lf.lfItalic != 0); + this.SetBit(TextRun.Bits.Underline, runPacketPtr->lf.lfUnderline != 0); this.SetBit(TextRun.Bits.Link, (runPacketPtr->dwEffects & 32) != 0); this._underlineBounds = runPacketPtr->rcUnderlineBounds; this._lineNumber = runPacketPtr->nLineNumber; @@ -96,7 +96,7 @@ namespace Microsoft.Iris.Drawing public Color Color => this._overrideColor != Color.Transparent ? this._overrideColor : this._runColor; - public bool Highlighted => this._highlightColor.A != (byte)0; + public bool Highlighted => this._highlightColor.A != 0; public Color HighlightColor => this._highlightColor; @@ -155,12 +155,12 @@ namespace Microsoft.Iris.Drawing { if (!(this._offsetPoint != offsetPoint)) return; - this._renderBounds.X -= (float)this._offsetPoint.X; - this._renderBounds.Y -= (float)this._offsetPoint.Y; + this._renderBounds.X -= _offsetPoint.X; + this._renderBounds.Y -= _offsetPoint.Y; this._layoutBounds.X -= this._offsetPoint.X; this._layoutBounds.Y -= this._offsetPoint.Y; - this._renderBounds.X += (float)offsetPoint.X; - this._renderBounds.Y += (float)offsetPoint.Y; + this._renderBounds.X += offsetPoint.X; + this._renderBounds.Y += offsetPoint.Y; this._layoutBounds.X += offsetPoint.X; this._layoutBounds.Y += offsetPoint.Y; this._offsetPoint = offsetPoint; @@ -186,16 +186,16 @@ namespace Microsoft.Iris.Drawing { if (this.TextSprite != null) { - container.RemoveChild((IVisual)this.TextSprite); - this.TextSprite = (ISprite)null; + container.RemoveChild(TextSprite); + this.TextSprite = null; } if (this.HighlightSprite == null) return; - container.RemoveChild((IVisual)this.HighlightSprite); - this.HighlightSprite = (ISprite)null; + container.RemoveChild(HighlightSprite); + this.HighlightSprite = null; } - private bool GetBit(TextRun.Bits lookupBit) => ((TextRun.Bits)this._bits & lookupBit) != (TextRun.Bits)0; + private bool GetBit(TextRun.Bits lookupBit) => ((TextRun.Bits)this._bits & lookupBit) != 0; private void SetBit(TextRun.Bits changeBit, bool value) => this._bits = value ? (byte)((TextRun.Bits)this._bits | changeBit) : (byte)((TextRun.Bits)this._bits & ~changeBit); diff --git a/UIX/Microsoft/Iris/Drawing/TextStyle.cs b/UIX/Microsoft/Iris/Drawing/TextStyle.cs index 0f55371..7d7b0f1 100644 --- a/UIX/Microsoft/Iris/Drawing/TextStyle.cs +++ b/UIX/Microsoft/Iris/Drawing/TextStyle.cs @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Drawing public float AltFontSize { - get => (double)this._altFontHeightPts == 0.0 ? this._fontHeightPts : this._altFontHeightPts; + get => _altFontHeightPts == 0.0 ? this._fontHeightPts : this._altFontHeightPts; set { this._flags[512] = true; @@ -195,7 +195,7 @@ namespace Microsoft.Iris.Drawing if (this._flags[64]) { stringBuilder.Append(" Color = "); - stringBuilder.Append((object)this.Color); + stringBuilder.Append(Color); } stringBuilder.Append(" }"); return stringBuilder.ToString(); @@ -239,7 +239,7 @@ namespace Microsoft.Iris.Drawing this._lineSpacing = from._lineSpacing; this._characterSpacing = from._characterSpacing; this._textColor = from._textColor; - this._fontFace = (char*)null; + this._fontFace = null; } } } diff --git a/UIX/Microsoft/Iris/Drawing/UIImage.cs b/UIX/Microsoft/Iris/Drawing/UIImage.cs index 229aac0..b8bf82a 100644 --- a/UIX/Microsoft/Iris/Drawing/UIImage.cs +++ b/UIX/Microsoft/Iris/Drawing/UIImage.cs @@ -60,14 +60,14 @@ namespace Microsoft.Iris.Drawing { if (this.LoadComplete == null) return; - this.LoadComplete((object)this, this.Status); + this.LoadComplete(this, this.Status); } protected void SetStatus(ImageStatus status) { this._status = status; if ((this._status == ImageStatus.Error || this._status == ImageStatus.Complete) && this.LoadComplete != null) - this.LoadComplete((object)this, this._status); + this.LoadComplete(this, this._status); this.FireNotification(NotificationID.Status); } diff --git a/UIX/Microsoft/Iris/Drawing/UriImage.cs b/UIX/Microsoft/Iris/Drawing/UriImage.cs index ee12d78..2a3fcaf 100644 --- a/UIX/Microsoft/Iris/Drawing/UriImage.cs +++ b/UIX/Microsoft/Iris/Drawing/UriImage.cs @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Drawing { resourceImageItem = new ResourceImageItem(UISession.Default.RenderSession, this.Source, UIImage.ClampSize(this._maximumSize), this.IsFlipped, this._antialiasEdges); resourceImageItem.LoadCompleteHandler += new ContentLoadCompleteHandler(this.OnLoadComplete); - ScavengeImageCache.Instance.Add(this._cacheKey, (ImageCacheItem)resourceImageItem); + ScavengeImageCache.Instance.Add(this._cacheKey, resourceImageItem); this.SetStatus(resourceImageItem.Status); this._contentSize = new Size(0, 0); } @@ -60,7 +60,7 @@ namespace Microsoft.Iris.Drawing return (ResourceImageItem)ScavengeImageCache.Instance.Lookup(this._cacheKey); } - protected override void OnImageAttributeChanged() => this._cacheKey = (ImageCacheKey)null; + protected override void OnImageAttributeChanged() => this._cacheKey = null; private void OnLoadComplete(object owner, ImageStatus status) { @@ -82,16 +82,16 @@ namespace Microsoft.Iris.Drawing } else { - resourceImageItem = (ResourceImageItem)null; + resourceImageItem = null; needAsyncLoad = false; } } else { - resourceImageItem = (ResourceImageItem)null; + resourceImageItem = null; needAsyncLoad = false; } - return (ImageCacheItem)resourceImageItem; + return resourceImageItem; } protected override void EnsureSizeMetrics() diff --git a/UIX/Microsoft/Iris/Error.cs b/UIX/Microsoft/Iris/Error.cs index 9f56cb0..477c149 100644 --- a/UIX/Microsoft/Iris/Error.cs +++ b/UIX/Microsoft/Iris/Error.cs @@ -23,9 +23,9 @@ namespace Microsoft.Iris str1 = str1.Substring(7); string str2; if (this.Line != -1) - str2 = string.Format("{0}({1},{2}) : {3} : {4}", (object)str1, (object)this.Line, (object)this.Column, this.Warning ? (object)"warning" : (object)"error", (object)this.Message); + str2 = string.Format("{0}({1},{2}) : {3} : {4}", str1, Line, Column, this.Warning ? "warning" : "error", Message); else - str2 = this.Context == null ? string.Format("{0} : {1}", this.Warning ? (object)"warning" : (object)"error", (object)this.Message) : string.Format("{0} : {1} : {2}", (object)str1, this.Warning ? (object)"warning" : (object)"error", (object)this.Message); + str2 = this.Context == null ? string.Format("{0} : {1}", this.Warning ? "warning" : "error", Message) : string.Format("{0} : {1} : {2}", str1, this.Warning ? "warning" : "error", Message); return str2; } } diff --git a/UIX/Microsoft/Iris/Group.cs b/UIX/Microsoft/Iris/Group.cs index 4da66b7..d15c4d6 100644 --- a/UIX/Microsoft/Iris/Group.cs +++ b/UIX/Microsoft/Iris/Group.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris private int _startIndex; internal Group(GroupedList groupedList, int startIndex, int count) - : base((IModelItemOwner)groupedList, true, (ItemCountHandler)null) + : base(groupedList, true, null) { this._groupedList = groupedList; this._startIndex = startIndex; @@ -54,6 +54,6 @@ namespace Microsoft.Iris source.NotifyRequestSlowData(sourceIndex); } - public override string ToString() => "Group [" + (object)this.StartIndex + "-" + (object)this.EndIndex + "]"; + public override string ToString() => "Group [" + StartIndex + "-" + EndIndex + "]"; } } diff --git a/UIX/Microsoft/Iris/GroupedList.cs b/UIX/Microsoft/Iris/GroupedList.cs index 17b7504..517a47f 100644 --- a/UIX/Microsoft/Iris/GroupedList.cs +++ b/UIX/Microsoft/Iris/GroupedList.cs @@ -46,7 +46,7 @@ namespace Microsoft.Iris if (this._source is INotifyList sourceNotifyA) sourceNotifyA.ContentsChanged -= new UIListContentsChangedHandler(this.SourceListModified); if (this._source is IVirtualList sourceVirtual && sourceVirtual.SlowDataRequestsEnabled) - sourceVirtual.SlowDataAcquireCompleteHandler = (SlowDataAcquireCompleteHandler)null; + sourceVirtual.SlowDataAcquireCompleteHandler = null; this._source = value; if (this._source is INotifyList sourceNotifyB) sourceNotifyB.ContentsChanged += new UIListContentsChangedHandler(this.SourceListModified); @@ -85,9 +85,9 @@ namespace Microsoft.Iris protected override object OnRequestItem(int index) { if (this._repairGroupsPending && index >= this._groups.Count) - return (object)null; + return null; this.EnsureGroup(index); - return index >= this._groups.Count ? (object)null : (object)this._groups[index]; + return index >= this._groups.Count ? null : (object)this._groups[index]; } private void ScheduleAdjustCount() @@ -181,7 +181,7 @@ namespace Microsoft.Iris protected override void OnDispose(bool disposing) { if (disposing) - this.SetSource((IList)null, 0, true); + this.SetSource(null, 0, true); base.OnDispose(disposing); } @@ -254,8 +254,8 @@ namespace Microsoft.Iris this._repairGroupsPending = false; for (int previousGroupIndex = -1; previousGroupIndex < this._groups.Count; ++previousGroupIndex) { - Group previousGroup = previousGroupIndex > -1 ? this._groups[previousGroupIndex] : (Group)null; - Group group = previousGroupIndex + 1 < this._groups.Count ? this._groups[previousGroupIndex + 1] : (Group)null; + Group previousGroup = previousGroupIndex > -1 ? this._groups[previousGroupIndex] : null; + Group group = previousGroupIndex + 1 < this._groups.Count ? this._groups[previousGroupIndex + 1] : null; int num1 = previousGroup != null ? previousGroup.EndIndex + 1 : 0; int num2 = group != null ? group.StartIndex - 1 : this.Source.Count - 1; if (group != null) @@ -268,7 +268,7 @@ namespace Microsoft.Iris if (this.TryMergeWithNext(previousGroupIndex)) --previousGroupIndex; } - this.AdjustCount((object)null); + this.AdjustCount(null); } private bool IsEqualToNext(int sourceIndex) => this.Comparer.Compare(this.Source[sourceIndex], this.Source[sourceIndex + 1]) == 0; @@ -336,7 +336,7 @@ namespace Microsoft.Iris return group; } - private Group GetLastGroup() => this._groups.Count <= 0 ? (Group)null : this._groups[this._groups.Count - 1]; + private Group GetLastGroup() => this._groups.Count <= 0 ? null : this._groups[this._groups.Count - 1]; private Group GetGroupForSourceIndex(int sourceIndex, out int groupIndex) { @@ -355,7 +355,7 @@ namespace Microsoft.Iris groupIndex = num1 + (num2 - num1) / 2; } --groupIndex; - return (Group)null; + return null; } public Group GetGroupForSourceIndex(int sourceIndex) => this.GetGroupForSourceIndex(sourceIndex, out int _); diff --git a/UIX/Microsoft/Iris/Image.cs b/UIX/Microsoft/Iris/Image.cs index 9bc2015..96883c4 100644 --- a/UIX/Microsoft/Iris/Image.cs +++ b/UIX/Microsoft/Iris/Image.cs @@ -57,7 +57,7 @@ namespace Microsoft.Iris { if (source == null) throw new ArgumentNullException(nameof(source)); - this._uiImage = (UIImage)new UriImage(source, inset, new Size(maximumWidth, maximumHeight), flippable, antialiasEdges); + this._uiImage = new UriImage(source, inset, new Size(maximumWidth, maximumHeight), flippable, antialiasEdges); } public Image( @@ -101,7 +101,7 @@ namespace Microsoft.Iris if (!ImageFormatUtils.RawImageFormatToSurfaceFormat(format, out surfaceFormat)) throw new ArgumentException(nameof(format)); uniqueID = "RAW:" + uniqueID; - this._uiImage = (UIImage)new RawImage(uniqueID, new Size(imageWidth, imageHeight), stride, surfaceFormat, data, false, Inset.Zero, new Size(maximumWidth, maximumHeight), flippable, anitaliasEdges); + this._uiImage = new RawImage(uniqueID, new Size(imageWidth, imageHeight), stride, surfaceFormat, data, false, Inset.Zero, new Size(maximumWidth, maximumHeight), flippable, anitaliasEdges); } public string Source => this._uiImage.Source; @@ -190,6 +190,6 @@ namespace Microsoft.Iris } } - object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => (object)this._uiImage; + object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => _uiImage; } } diff --git a/UIX/Microsoft/Iris/IndexedTree.cs b/UIX/Microsoft/Iris/IndexedTree.cs index 51b38b1..1312cd3 100644 --- a/UIX/Microsoft/Iris/IndexedTree.cs +++ b/UIX/Microsoft/Iris/IndexedTree.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris if (this._poolHead != null) { this._poolHead = this._poolHead.parent; - treeNode.parent = (IndexedTree.TreeNode)null; + treeNode.parent = null; } else treeNode = new IndexedTree.TreeNode(); @@ -45,8 +45,8 @@ namespace Microsoft.Iris private void ReclaimTreeNode(IndexedTree.TreeNode node) { node.parent = this._poolHead; - node.left = (IndexedTree.TreeNode)null; - node.right = (IndexedTree.TreeNode)null; + node.left = null; + node.right = null; this._poolHead = node; } @@ -59,7 +59,7 @@ namespace Microsoft.Iris { newValue = this.AcquireTreeNode(); newValue.delta = index; - newValue.parent = (IndexedTree.TreeNode)null; + newValue.parent = null; if (this._root != null) { this._root.parent = newValue; @@ -71,7 +71,7 @@ namespace Microsoft.Iris this._root.right.parent = newValue; newValue.right = this._root.right; newValue.right.delta = this._root.right.delta + this._root.delta - index; - this._root.right = (IndexedTree.TreeNode)null; + this._root.right = null; } } else @@ -82,7 +82,7 @@ namespace Microsoft.Iris this._root.left.parent = newValue; newValue.left = this._root.left; newValue.left.delta = this._root.left.delta + this._root.delta - index; - this._root.left = (IndexedTree.TreeNode)null; + this._root.left = null; } } this._root.delta -= index; @@ -153,7 +153,7 @@ namespace Microsoft.Iris lock (this._lockObj) { IndexedTree.TreeNode treeNode = this.Find(index); - data = treeNode == null ? (object)null : treeNode.data; + data = treeNode == null ? null : treeNode.data; return treeNode != null; } } @@ -219,7 +219,7 @@ namespace Microsoft.Iris public void Clear() { lock (this._lockObj) - this.SetRoot((IndexedTree.TreeNode)null); + this.SetRoot(null); } public bool Contains(int index) @@ -249,10 +249,10 @@ namespace Microsoft.Iris private IndexedTree.TreeNode Find(int index) { if (this._lastSearchedIndex == index && this._root != null) - return this._root.delta != index ? (IndexedTree.TreeNode)null : this._root; + return this._root.delta != index ? null : this._root; this._lastSearchedIndex = index; IndexedTree.TreeNode treeNode = this._root; - IndexedTree.TreeNode node = (IndexedTree.TreeNode)null; + IndexedTree.TreeNode node = null; int num = 0; bool flag = false; while (!flag && treeNode != null) @@ -267,7 +267,7 @@ namespace Microsoft.Iris if (node != null) this.Splay(node); this._lastSearchedIndex = index; - return !flag ? (IndexedTree.TreeNode)null : treeNode; + return !flag ? null : treeNode; } private void Splay(IndexedTree.TreeNode node) diff --git a/UIX/Microsoft/Iris/Input/HidDevice.cs b/UIX/Microsoft/Iris/Input/HidDevice.cs index 83712c5..d19b67a 100644 --- a/UIX/Microsoft/Iris/Input/HidDevice.cs +++ b/UIX/Microsoft/Iris/Input/HidDevice.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Input internal KeyCommandInfo OnRawInput(CommandCode command, ref RawHidData args) { - KeyCommandInfo keyCommandInfo = (KeyCommandInfo)null; + KeyCommandInfo keyCommandInfo = null; if (command != CommandCode.None) keyCommandInfo = KeyCommandInfo.Create(args._action, args._deviceType, command); return keyCommandInfo; diff --git a/UIX/Microsoft/Iris/Input/InputInfo.cs b/UIX/Microsoft/Iris/Input/InputInfo.cs index 1e87d8f..ed9751c 100644 --- a/UIX/Microsoft/Iris/Input/InputInfo.cs +++ b/UIX/Microsoft/Iris/Input/InputInfo.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Input protected void Initialize(InputEventType eventType) { this._eventType = eventType; - this._lockCount = (byte)0; + this._lockCount = 0; this._routeTruncated = false; this._handled = false; } @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Input protected virtual void Zombie() { - this._target = (ICookedInputSite)null; + this._target = null; this._eventType = InputEventType.Invalid; } @@ -59,14 +59,14 @@ namespace Microsoft.Iris.Input InputInfo.s_pools[(int)this.PoolType].RecycleInfo(this); } - private bool Poolable => this._lockCount == (byte)0; + private bool Poolable => this._lockCount == 0; public void Lock() => ++this._lockCount; public void Unlock() { --this._lockCount; - if (this._lockCount != (byte)0) + if (this._lockCount != 0) return; this.ReturnToPool(); } @@ -97,7 +97,7 @@ namespace Microsoft.Iris.Input public InputInfo GetPooledInfo() { - InputInfo inputInfo = (InputInfo)null; + InputInfo inputInfo = null; if (this._numEntries > 0) { inputInfo = this._maxEntries != 1 ? ((InputInfo[])this._storage)[this._numEntries - 1] : (InputInfo)this._storage; @@ -114,12 +114,12 @@ namespace Microsoft.Iris.Input info.Zombie(); if (this._maxEntries == 1) { - this._storage = (object)info; + this._storage = info; } else { if (this._storage == null) - this._storage = (object)new InputInfo[this._maxEntries]; + this._storage = (new InputInfo[this._maxEntries]); ((InputInfo[])this._storage)[this._numEntries] = info; } ++this._numEntries; diff --git a/UIX/Microsoft/Iris/Input/InputItem.cs b/UIX/Microsoft/Iris/Input/InputItem.cs index 73cdd3d..08fadd4 100644 --- a/UIX/Microsoft/Iris/Input/InputItem.cs +++ b/UIX/Microsoft/Iris/Input/InputItem.cs @@ -36,12 +36,12 @@ namespace Microsoft.Iris.Input private static InputItem AllocateFromPool() { - InputItem inputItem = (InputItem)null; + InputItem inputItem = null; if (InputItem.s_cache != null) { inputItem = InputItem.s_cache; InputItem.s_cache = (InputItem)inputItem._next; - inputItem._next = (QueueItem)null; + inputItem._next = null; --InputItem.s_cachedCount; } if (inputItem == null) @@ -55,15 +55,15 @@ namespace Microsoft.Iris.Input { if (returnInfoToo) this._info.ReturnToPool(); - this._manager = (InputManager)null; - this._target = (ICookedInputSite)null; - this._info = (InputInfo)null; - this._prev = (QueueItem)null; - this._next = (QueueItem)null; - this._owner = (QueueItem.Chain)null; + this._manager = null; + this._target = null; + this._info = null; + this._prev = null; + this._next = null; + this._owner = null; if (InputItem.s_cachedCount >= 5) return; - this._next = (QueueItem)InputItem.s_cache; + this._next = s_cache; InputItem.s_cache = this; ++InputItem.s_cachedCount; } @@ -72,7 +72,7 @@ namespace Microsoft.Iris.Input public InputInfo Info => this._info; - public override string ToString() => base.ToString() + " -> " + (object)this._info + " -> " + DebugHelpers.DEBUG_ObjectToString((object)this._target); + public override string ToString() => base.ToString() + " -> " + _info + " -> " + DebugHelpers.DEBUG_ObjectToString(_target); public override void Dispatch() { diff --git a/UIX/Microsoft/Iris/Input/InputManager.cs b/UIX/Microsoft/Iris/Input/InputManager.cs index f32e998..ac7155a 100644 --- a/UIX/Microsoft/Iris/Input/InputManager.cs +++ b/UIX/Microsoft/Iris/Input/InputManager.cs @@ -50,13 +50,13 @@ namespace Microsoft.Iris.Input this._refreshHitTargetHandler = new SimpleCallback(this.RefreshHitTargetHandler); } - internal void ConnectToRenderer() => this.Session.RenderSession.InputSystem.RegisterRawInputCallbacks((IRawInputCallbacks)this); + internal void ConnectToRenderer() => this.Session.RenderSession.InputSystem.RegisterRawInputCallbacks(this); internal void PrepareToShutDown() { - this.KeyCoalescePolicy = (KeyCoalesceFilter)null; + this.KeyCoalescePolicy = null; this.EndKeyCoalesce(); - this.InvalidKeyFocus = (InvalidKeyFocusHandler)null; + this.InvalidKeyFocus = null; this._inputDisabled = true; this.Session.RenderSession.InputSystem.UnregisterRawInputCallbacks(); this._inputQueue.PrepareToShutDown(); @@ -114,7 +114,7 @@ namespace Microsoft.Iris.Input this._keyFocusCanBeNull = value; if (value) return; - this._inputQueue.RevalidateInputSiteUsage((ICookedInputSite)null, false); + this._inputQueue.RevalidateInputSiteUsage(null, false); } } @@ -140,7 +140,7 @@ namespace Microsoft.Iris.Input this._physicalMouseOffset = value; if (this.MousePositionChanged == null) return; - this.MousePositionChanged((object)this, EventArgs.Empty); + this.MousePositionChanged(this, EventArgs.Empty); } } @@ -194,17 +194,17 @@ namespace Microsoft.Iris.Input public void HandleRawHidInput(ref RawHidData args) { - KeyActionInfo keyActionInfo = (KeyActionInfo)this.Remote.OnRawInput(HIDCommandMapping.Find(args._commandCode, args._usagePage), ref args); + KeyActionInfo keyActionInfo = this.Remote.OnRawInput(HIDCommandMapping.Find(args._commandCode, args._usagePage), ref args); if (keyActionInfo != null) - this._inputQueue.RawKeyAction((KeyInfo)keyActionInfo); + this._inputQueue.RawKeyAction(keyActionInfo); this.UpdateLastInputTime(); } public void HandleAppCommand(ref RawHidData args) { - KeyActionInfo keyActionInfo = (KeyActionInfo)this.Remote.OnRawInput(AppCommandMapping.Find(args._commandCode), ref args); + KeyActionInfo keyActionInfo = this.Remote.OnRawInput(AppCommandMapping.Find(args._commandCode), ref args); if (keyActionInfo != null) - this._inputQueue.RawKeyAction((KeyInfo)keyActionInfo); + this._inputQueue.RawKeyAction(keyActionInfo); this.UpdateLastInputTime(); } @@ -212,7 +212,7 @@ namespace Microsoft.Iris.Input { using (DataObject dataObject = new DataObject(args._pDataStream)) { - object data = (object)null; + object data = null; if (message == 0U) data = dataObject.GetExternalData(); this.Mouse.OnRawInput(message, modifiers, ref args, data); @@ -228,7 +228,7 @@ namespace Microsoft.Iris.Input if (this._ignoreHungKeyFocus && !knownDisabledFlag) { this.StopIgnoringHungKeyFocus(); - target = (ICookedInputSite)null; + target = null; recursiveFlag = false; } this._inputQueue.RevalidateInputSiteUsage(target, recursiveFlag); @@ -326,14 +326,14 @@ namespace Microsoft.Iris.Input if (!this._currentCoalesceUndelivered) { this._currentCoalesceUndelivered = true; - this._inputQueue.RawInputIdleItem((QueueItem)DeferredCall.Create(InputManager.s_deliverCoalescedKey, (object)this)); + this._inputQueue.RawInputIdleItem(DeferredCall.Create(InputManager.s_deliverCoalescedKey, this)); } return true; } private void EndKeyCoalesce() { - this.SetCoalesceKeyEvent((KeyStateInfo)null); + this.SetCoalesceKeyEvent(null); this._currentCoalesceUndelivered = false; } @@ -344,7 +344,7 @@ namespace Microsoft.Iris.Input return; inputManager._currentCoalesceUndelivered = false; ICookedInputSite instantaneousKeyFocus = inputManager._inputQueue.InstantaneousKeyFocus; - inputManager.DeliverInputWorker(instantaneousKeyFocus, (InputInfo)inputManager._currentCoalesceKeyEvent, EventRouteStages.All); + inputManager.DeliverInputWorker(instantaneousKeyFocus, inputManager._currentCoalesceKeyEvent, EventRouteStages.All); inputManager.SuspendInputUntil(DispatchPriority.Idle); } @@ -352,11 +352,11 @@ namespace Microsoft.Iris.Input { ICookedInputSite target = this.HitTestInput(info.RawSource, captureSite); if (!this.IsValidCookedInputSite(target)) - target = (ICookedInputSite)null; + target = null; IRawInputSite naturalHit = info.NaturalHit; - ICookedInputSite naturalTarget = (ICookedInputSite)null; + ICookedInputSite naturalTarget = null; if (naturalHit != null) - naturalTarget = naturalHit != info.RawSource ? (naturalHit is ITreeNode treeNode ? treeNode.Zone?.MapInput(naturalHit, (ICookedInputSite)null) : (ICookedInputSite)null) : target; + naturalTarget = naturalHit != info.RawSource ? (naturalHit is ITreeNode treeNode ? treeNode.Zone?.MapInput(naturalHit, null) : null) : target; info.SetMappedTargets(target, naturalTarget); } @@ -364,10 +364,10 @@ namespace Microsoft.Iris.Input IRawInputSite rawSource, ICookedInputSite targetRelative) { - ICookedInputSite cookedInputSite = (ICookedInputSite)null; + ICookedInputSite cookedInputSite = null; if (!this._inputDisabled) { - ITreeNode treeNode = (ITreeNode)null; + ITreeNode treeNode = null; if (targetRelative != null) treeNode = targetRelative as ITreeNode; else if (rawSource != null) @@ -423,7 +423,7 @@ namespace Microsoft.Iris.Input { if (this._inputQueue.PendingKeyFocus is ITreeNode pendingKeyFocus && pendingKeyFocus.Zone == null) { - this._inputQueue.RequestKeyFocus((ICookedInputSite)null, KeyFocusReason.Default); + this._inputQueue.RequestKeyFocus(null, KeyFocusReason.Default); if (this._keyFocusCanBeNull) return; } @@ -440,7 +440,7 @@ namespace Microsoft.Iris.Input return; if (this._keyFocusCanBeNull) { - this._inputQueue.RequestKeyFocus((ICookedInputSite)null, KeyFocusReason.Default); + this._inputQueue.RequestKeyFocus(null, KeyFocusReason.Default); } else { @@ -453,7 +453,7 @@ namespace Microsoft.Iris.Input private void StopIgnoringHungKeyFocus() { this._ignoreHungKeyFocus = false; - this._ignoreHungKeyFocusTarget = (ICookedInputSite)null; + this._ignoreHungKeyFocusTarget = null; } internal void RequestHostKeyFocus(ICookedInputSite target) @@ -493,7 +493,7 @@ namespace Microsoft.Iris.Input EventRouteStages stage = EventRouteStages.None; if (this.PreviewInput != null && (stages & EventRouteStages.Preview) != EventRouteStages.None) { - this.PreviewInput((object)this, new InputNotificationEventArgs(info, target, stage)); + this.PreviewInput(this, new InputNotificationEventArgs(info, target, stage)); if (info.Handled) stage = EventRouteStages.Preview; } @@ -523,7 +523,7 @@ namespace Microsoft.Iris.Input } InputNotificationHandler notificationHandler = !info.Handled ? this.UnhandledInput : this.HandledInput; if (notificationHandler != null) - notificationHandler((object)this, new InputNotificationEventArgs(info, target, stage)); + notificationHandler(this, new InputNotificationEventArgs(info, target, stage)); } if (inputZoneRouting.zone == null) return; @@ -553,7 +553,7 @@ namespace Microsoft.Iris.Input InputInfo info) { ITreeNode endpoint = null; - UIZone uiZone = (UIZone)null; + UIZone uiZone = null; if (finalTarget is ITreeNode) { endpoint = (ITreeNode)finalTarget; @@ -583,7 +583,7 @@ namespace Microsoft.Iris.Input if (mouseFocusInfo.State) newFocusInfo = deliveryInfo; InputManager.ProcessFocusUpdates(InputDeviceType.Mouse, ref this._mouseFocusZone, newFocusInfo, target as ITreeNode); - this._session.RootZone.UpdateCursor((UIClass)null); + this._session.RootZone.UpdateCursor(null); } if (mouseFocusInfo.State && target == mouseFocusInfo.Other) flag = false; @@ -615,7 +615,7 @@ namespace Microsoft.Iris.Input return; refCurrentFocusZone = newFocusInfo.zone; if (refCurrentFocusZone == null) - InputManager.UpdateZoneFocusStates(focusType, zone, (object)null, false, (ITreeNode)null); + InputManager.UpdateZoneFocusStates(focusType, zone, null, false, null); if (newFocusInfo.zone == null) return; InputManager.UpdateZoneFocusStates(focusType, newFocusInfo.zone, newFocusInfo.param, true, actualFocus); @@ -628,8 +628,8 @@ namespace Microsoft.Iris.Input bool deepFocusFlag, ITreeNode actualFocus) { - ITreeNode directFocusChild = (ITreeNode)null; - object obj = (object)null; + ITreeNode directFocusChild = null; + object obj = null; if (deepFocusFlag) { if (actualFocus != null && actualFocus.Zone == zone) diff --git a/UIX/Microsoft/Iris/Input/InputQueue.cs b/UIX/Microsoft/Iris/Input/InputQueue.cs index 14a6151..cb86353 100644 --- a/UIX/Microsoft/Iris/Input/InputQueue.cs +++ b/UIX/Microsoft/Iris/Input/InputQueue.cs @@ -92,11 +92,11 @@ namespace Microsoft.Iris.Input public void PrepareToShutDown() { - this.RequestKeyFocus((ICookedInputSite)null); + this.RequestKeyFocus(null); this.RawMouseLeave(); } - public void RawKeyAction(KeyInfo info) => this.PostItem(this.GenerateGenericInput((InputInfo)info)); + public void RawKeyAction(KeyInfo info) => this.PostItem(this.GenerateGenericInput(info)); public void RawMouseMove( IRawInputSite site, @@ -116,10 +116,10 @@ namespace Microsoft.Iris.Input public void RawMouseLeave() { - this.CancelMouseCapture((ICookedInputSite)null); + this.CancelMouseCapture(null); this._mouseWheelDelta = 0; - this._rawMouseSite = (IRawInputSite)null; - this._rawMouseNaturalSite = (IRawInputSite)null; + this._rawMouseSite = null; + this._rawMouseNaturalSite = null; this._rawMousePos.X = -1; this._rawMousePos.Y = -1; this._rawScreenPos.X = -1; @@ -136,7 +136,7 @@ namespace Microsoft.Iris.Input MouseButtons button, bool state) { - this.PostItem((QueueItem)this.GenerateMouseButton(site, naturalSite, this._rawMousePos.X, this._rawMousePos.Y, this._rawScreenPos.X, this._rawScreenPos.Y, modifiers, button, state, message)); + this.PostItem(this.GenerateMouseButton(site, naturalSite, this._rawMousePos.X, this._rawMousePos.Y, this._rawScreenPos.X, this._rawScreenPos.Y, modifiers, button, state, message)); } public void RawMouseWheel(InputModifiers modifiers, ref RawMouseData rawEventData) @@ -160,7 +160,7 @@ namespace Microsoft.Iris.Input this.SimulateDragDrop(dragSource, rawTargetSite, data, x, y, modifiers, DragOperation.Enter); } - public void SimulateDragOver(InputModifiers modifiers) => this.SimulateDragDrop(this._dragSource, this._rawDropTargetSite, (object)null, this._rawDragPoint.X, this._rawDragPoint.Y, modifiers, DragOperation.Over); + public void SimulateDragOver(InputModifiers modifiers) => this.SimulateDragDrop(this._dragSource, this._rawDropTargetSite, null, this._rawDragPoint.X, this._rawDragPoint.Y, modifiers, DragOperation.Over); public void SimulateDragOver( IRawInputSite rawTargetSite, @@ -168,7 +168,7 @@ namespace Microsoft.Iris.Input int y, InputModifiers modifiers) { - this.SimulateDragDrop(this._dragSource, rawTargetSite, (object)null, x, y, modifiers, DragOperation.Over); + this.SimulateDragDrop(this._dragSource, rawTargetSite, null, x, y, modifiers, DragOperation.Over); } public void SimulateDragEnd( @@ -176,10 +176,10 @@ namespace Microsoft.Iris.Input InputModifiers modifiers, DragOperation formOperation) { - this.PushFilterStack((QueueItem)this.GenerateDragDrop(this._dragSource, (IRawInputSite)null, this._rawDragPoint.X, this._rawDragPoint.Y, modifiers, DragOperation.DragComplete)); - this.SimulateDragDrop(this._dragSource, rawTargetSite, (object)null, this._rawDragPoint.X, this._rawDragPoint.Y, modifiers, formOperation); + this.PushFilterStack(this.GenerateDragDrop(this._dragSource, null, this._rawDragPoint.X, this._rawDragPoint.Y, modifiers, DragOperation.DragComplete)); + this.SimulateDragDrop(this._dragSource, rawTargetSite, null, this._rawDragPoint.X, this._rawDragPoint.Y, modifiers, formOperation); this.OnWake(); - this._dragSource = (ICookedInputSite)null; + this._dragSource = null; } private void SimulateDragDrop( @@ -195,7 +195,7 @@ namespace Microsoft.Iris.Input InputItem dragDropItem = this.GenerateDragDropItem(dragSource, rawTargetSite, data, x, y, modifiers, formOperation); if (dragDropItem == null) return; - this.PushFilterStack((QueueItem)dragDropItem); + this.PushFilterStack(dragDropItem); this.OnWake(); } @@ -215,11 +215,11 @@ namespace Microsoft.Iris.Input data = this._pendingDragData; formOperation = DragOperation.Enter; } - this._pendingDragData = (object)null; - InputItem dragDropItem = this.GenerateDragDropItem((ICookedInputSite)null, rawSite, data, x, y, modifiers, formOperation); + this._pendingDragData = null; + InputItem dragDropItem = this.GenerateDragDropItem(null, rawSite, data, x, y, modifiers, formOperation); if (dragDropItem == null) return; - this.PostItem((QueueItem)dragDropItem); + this.PostItem(dragDropItem); } else if (formOperation == DragOperation.Enter) { @@ -229,7 +229,7 @@ namespace Microsoft.Iris.Input { if (formOperation != DragOperation.Leave) return; - this._pendingDragData = (object)null; + this._pendingDragData = null; } } @@ -242,7 +242,7 @@ namespace Microsoft.Iris.Input InputModifiers modifiers, DragOperation formOperation) { - InputItem inputItem = (InputItem)null; + InputItem inputItem = null; IRawInputSite rawDropTargetSite = this._rawDropTargetSite; if (formOperation == DragOperation.Enter) this._dragData = data; @@ -261,22 +261,22 @@ namespace Microsoft.Iris.Input } } else - inputItem = this.GenerateDragDrop((ICookedInputSite)null, rawSite, x, y, modifiers, DragOperation.Over); + inputItem = this.GenerateDragDrop(null, rawSite, x, y, modifiers, DragOperation.Over); } else { inputItem = this.GenerateDragDrop(this._appDropTarget, rawSite, x, y, modifiers, DragOperation.Drop); - this._appDropTarget = (ICookedInputSite)null; + this._appDropTarget = null; } if (formOperation == DragOperation.Drop || formOperation == DragOperation.Leave) { this._dragOver = false; this._dragging = false; - this._rawDropTargetSite = (IRawInputSite)null; + this._rawDropTargetSite = null; this._rawDragPoint = new Point(); this._rawDragModifiers = InputModifiers.None; if (formOperation == DragOperation.Leave) - this._dragData = (object)null; + this._dragData = null; } return inputItem; } @@ -285,7 +285,7 @@ namespace Microsoft.Iris.Input { object dragData = this._dragData; if (!this._dragging) - this._dragData = (object)null; + this._dragData = null; return dragData; } @@ -349,7 +349,7 @@ namespace Microsoft.Iris.Input if (queueItem1 != queueItem2) { this.PushFilterStack(queueItem1); - queueItem1 = (QueueItem)null; + queueItem1 = null; } else break; @@ -395,7 +395,7 @@ namespace Microsoft.Iris.Input this.FinalizeMouseHit(inputItem, mouseActionInfo); break; } - item = (QueueItem)null; + item = null; break; case MouseButtonInfo mouseButtonInfo: if (this.IsAppMouseMove(mouseActionInfo)) @@ -403,7 +403,7 @@ namespace Microsoft.Iris.Input InputModifiers modifiers1 = mouseButtonInfo.Modifiers; InputModifiers modifiersForButtons = this.GetModifiersForButtons(mouseButtonInfo.Button); InputModifiers modifiers2 = !mouseButtonInfo.IsDown ? modifiers1 | modifiersForButtons : modifiers1 & ~modifiersForButtons; - return (QueueItem)this.GenerateMouseMove(mouseActionInfo.RawSource, mouseActionInfo.NaturalHit, mouseActionInfo.X, mouseActionInfo.Y, mouseButtonInfo.ScreenX, mouseButtonInfo.ScreenY, modifiers2); + return this.GenerateMouseMove(mouseActionInfo.RawSource, mouseActionInfo.NaturalHit, mouseActionInfo.X, mouseActionInfo.Y, mouseButtonInfo.ScreenX, mouseButtonInfo.ScreenY, modifiers2); } this.FinalizeMouseHit(inputItem, mouseActionInfo); this.UpdateMouseCapture(mouseActionInfo.RawSource, mouseActionInfo.Target, mouseButtonInfo.Modifiers); @@ -432,9 +432,9 @@ namespace Microsoft.Iris.Input case DragDropInfo dragDropInfo: if (dragDropInfo.Operation == DragOperation.Over) { - InputItem inputItemB = this.UpdateDragOver(this._inputManager.HitTestInput(this._rawDropTargetSite, (ICookedInputSite)null)); + InputItem inputItemB = this.UpdateDragOver(this._inputManager.HitTestInput(this._rawDropTargetSite, null)); if (inputItemB != null) - return (QueueItem)inputItemB; + return inputItemB; inputItemB.UpdateInputSite(this._appDropTarget); break; } @@ -476,21 +476,21 @@ namespace Microsoft.Iris.Input { if (this._mouseWheelDelta != 0) { - QueueItem mouseWheel = (QueueItem)this.GenerateMouseWheel(this._rawMouseSite, this._rawMouseNaturalSite, this._rawMousePos.X, this._rawMousePos.Y, this._rawScreenPos.X, this._rawScreenPos.Y, this._rawMouseModifiers, this._mouseWheelDelta); + QueueItem mouseWheel = this.GenerateMouseWheel(this._rawMouseSite, this._rawMouseNaturalSite, this._rawMousePos.X, this._rawMousePos.Y, this._rawScreenPos.X, this._rawScreenPos.Y, this._rawMouseModifiers, this._mouseWheelDelta); this._mouseWheelDelta = 0; return mouseWheel; } if (this._mouseMoved) { - QueueItem mouseMove = (QueueItem)this.GenerateMouseMove(this._rawMouseSite, this._rawMouseNaturalSite, this._rawMousePos.X, this._rawMousePos.Y, this._rawScreenPos.X, this._rawScreenPos.Y, this._rawMouseModifiers); + QueueItem mouseMove = this.GenerateMouseMove(this._rawMouseSite, this._rawMouseNaturalSite, this._rawMousePos.X, this._rawMousePos.Y, this._rawScreenPos.X, this._rawScreenPos.Y, this._rawMouseModifiers); this._mouseMoved = false; return mouseMove; } if (!this._dragOver) return this._inputIdleQueue.GetNextItem(); - InputItem dragDrop = this.GenerateDragDrop((ICookedInputSite)null, this._rawDropTargetSite, this._rawDragPoint.X, this._rawDragPoint.Y, this._rawDragModifiers, DragOperation.Over); + InputItem dragDrop = this.GenerateDragDrop(null, this._rawDropTargetSite, this._rawDragPoint.X, this._rawDragPoint.Y, this._rawDragModifiers, DragOperation.Over); this._dragOver = false; - return (QueueItem)dragDrop; + return dragDrop; } private void OnChildQueueWake(object sender, EventArgs args) => this.OnWake(); @@ -506,7 +506,7 @@ namespace Microsoft.Iris.Input private QueueItem CheckForInvalidKeyFocus() { - QueueItem queueItem = (QueueItem)null; + QueueItem queueItem = null; if (!this.IsValidInputSite(this._desiredKeyFocus) || !this._inputManager.IsValidKeyFocusSite(this._desiredKeyFocus)) { ++this._keyFocusRepairCount; @@ -526,7 +526,7 @@ namespace Microsoft.Iris.Input private QueueItem UpdateKeyFocus() { - QueueItem queueItem = (QueueItem)null; + QueueItem queueItem = null; if (this._revalidateKeyFocus || this._currentKeyFocus != this._desiredKeyFocus) { queueItem = this.CheckForInvalidKeyFocus(); @@ -535,15 +535,15 @@ namespace Microsoft.Iris.Input if (this._currentKeyFocus != null) { if (!this.IsValidInputSite(this._currentKeyFocus)) - this._currentKeyFocus = (ICookedInputSite)null; + this._currentKeyFocus = null; queueItem = this.GenerateKeyFocus(this._currentKeyFocus, false, this._desiredKeyFocus, this._desiredKeyFocusReason); - this._currentKeyFocus = (ICookedInputSite)null; + this._currentKeyFocus = null; } if (queueItem == null && this._desiredKeyFocus != null) { this._currentKeyFocus = this._desiredKeyFocus; if (!this.IsValidInputSite(this._lastCompletedKeyFocus)) - this._lastCompletedKeyFocus = (ICookedInputSite)null; + this._lastCompletedKeyFocus = null; queueItem = this.GenerateKeyFocus(this._currentKeyFocus, true, this._lastCompletedKeyFocus, this._desiredKeyFocusReason); } if (this._currentKeyFocus == this._desiredKeyFocus) @@ -560,7 +560,7 @@ namespace Microsoft.Iris.Input IRawInputSite site, Point clientOffset) { - QueueItem queueItem = (QueueItem)null; + QueueItem queueItem = null; if (this._revalidateMouseFocus || this._appMouseFocusTarget != target) { this._revalidateMouseFocus = false; @@ -569,10 +569,10 @@ namespace Microsoft.Iris.Input if (this._appMouseFocusTarget != null) { if (!this.IsValidInputSite(this._appMouseFocusTarget)) - this._appMouseFocusTarget = (ICookedInputSite)null; - queueItem = (QueueItem)this.GenerateMouseFocus(this._appMouseFocusTarget, this._appMouseFocusSite, this._appMousePos.X, this._appMousePos.Y, false, target); - this._appMouseFocusSite = (IRawInputSite)null; - this._appMouseFocusTarget = (ICookedInputSite)null; + this._appMouseFocusTarget = null; + queueItem = this.GenerateMouseFocus(this._appMouseFocusTarget, this._appMouseFocusSite, this._appMousePos.X, this._appMousePos.Y, false, target); + this._appMouseFocusSite = null; + this._appMouseFocusTarget = null; this._appMousePos.X = -1; this._appMousePos.Y = -1; } @@ -581,14 +581,14 @@ namespace Microsoft.Iris.Input this._appMouseFocusSite = site; this._appMouseFocusTarget = target; if (!this.IsValidInputSite(this._lastCompletedMouseFocus)) - this._lastCompletedMouseFocus = (ICookedInputSite)null; - queueItem = (QueueItem)this.GenerateMouseFocus(this._appMouseFocusTarget, this._appMouseFocusSite, clientOffset.X, clientOffset.Y, true, this._lastCompletedMouseFocus); + this._lastCompletedMouseFocus = null; + queueItem = this.GenerateMouseFocus(this._appMouseFocusTarget, this._appMouseFocusSite, clientOffset.X, clientOffset.Y, true, this._lastCompletedMouseFocus); } if (this._appMouseFocusTarget == target) this._lastCompletedMouseFocus = this._appMouseFocusTarget; } if (queueItem == null && this._appMouseFocusTarget != null) - queueItem = (QueueItem)this.GenerateMouseFocus(this._appMouseFocusTarget, this._appMouseFocusSite, clientOffset.X, clientOffset.Y, true, this._lastCompletedMouseFocus); + queueItem = this.GenerateMouseFocus(this._appMouseFocusTarget, this._appMouseFocusSite, clientOffset.X, clientOffset.Y, true, this._lastCompletedMouseFocus); } return queueItem; } @@ -599,7 +599,7 @@ namespace Microsoft.Iris.Input InputModifiers modifiers) { bool flag = (modifiers & InputModifiers.AllButtons) != InputModifiers.None; - ICookedInputSite cookedInputSite = (ICookedInputSite)null; + ICookedInputSite cookedInputSite = null; if (flag) cookedInputSite = target; if (this._appMouseFocusCapture == cookedInputSite) @@ -646,9 +646,9 @@ namespace Microsoft.Iris.Input else { this._appMouseFocusButtons = InputModifiers.None; - return (QueueItem)null; + return null; } - return (QueueItem)this.GenerateMouseButton(site, (IRawInputSite)null, x, y, this._rawScreenPos.X, this._rawScreenPos.Y, this._appMouseFocusButtons, button, false, message); + return this.GenerateMouseButton(site, null, x, y, this._rawScreenPos.X, this._rawScreenPos.Y, this._appMouseFocusButtons, button, false, message); } private InputItem UpdateDragOver(ICookedInputSite target) @@ -658,8 +658,8 @@ namespace Microsoft.Iris.Input if (this._appDropTarget != null) { ICookedInputSite appDropTarget = this._appDropTarget; - this._appDropTarget = (ICookedInputSite)null; - return this.GenerateDragDrop(appDropTarget, (IRawInputSite)null, this._rawDragPoint.X, this._rawDragPoint.Y, this._rawMouseModifiers, DragOperation.Leave); + this._appDropTarget = null; + return this.GenerateDragDrop(appDropTarget, null, this._rawDragPoint.X, this._rawDragPoint.Y, this._rawMouseModifiers, DragOperation.Leave); } if (target != null) { @@ -667,7 +667,7 @@ namespace Microsoft.Iris.Input return this.GenerateDragDrop(target, this._rawDropTargetSite, this._rawDragPoint.X, this._rawDragPoint.Y, this._rawDragModifiers, DragOperation.Enter); } } - return (InputItem)null; + return null; } private bool IsAppMouseMove(MouseActionInfo mouseInfo) => mouseInfo.Target != this._appMouseFocusTarget || mouseInfo.NaturalHit != this._appNaturalTarget || mouseInfo.X != this._appMousePos.X || mouseInfo.Y != this._appMousePos.Y; @@ -686,12 +686,12 @@ namespace Microsoft.Iris.Input { if (this._appMouseFocusCapture == null || cancelSite != this._appMouseFocusCapture && cancelSite != null) return; - this.UpdateMouseCapture(this._appMouseFocusCapture.RawInputSource, (ICookedInputSite)null, InputModifiers.None); + this.UpdateMouseCapture(this._appMouseFocusCapture.RawInputSource, null, InputModifiers.None); } - private QueueItem GenerateGenericInput(InputInfo info) => (QueueItem)InputItem.Create(this._inputManager, (ICookedInputSite)null, info); + private QueueItem GenerateGenericInput(InputInfo info) => InputItem.Create(this._inputManager, null, info); - private QueueItem GenerateInvalidKeyFocusCallback() => (QueueItem)DeferredCall.Create(this._invalidKeyFocusCallback); + private QueueItem GenerateInvalidKeyFocusCallback() => DeferredCall.Create(this._invalidKeyFocusCallback); private QueueItem GenerateKeyFocus( ICookedInputSite target, @@ -699,7 +699,7 @@ namespace Microsoft.Iris.Input ICookedInputSite other, KeyFocusReason reason) { - return (QueueItem)InputItem.Create(this._inputManager, target, (InputInfo)KeyFocusInfo.Create(focus, other, reason)); + return InputItem.Create(this._inputManager, target, KeyFocusInfo.Create(focus, other, reason)); } private InputItem GenerateMouseFocus( @@ -710,7 +710,7 @@ namespace Microsoft.Iris.Input bool focus, ICookedInputSite other) { - return InputItem.Create(this._inputManager, target, (InputInfo)MouseFocusInfo.Create(site, x, y, focus, other)); + return InputItem.Create(this._inputManager, target, MouseFocusInfo.Create(site, x, y, focus, other)); } private InputItem GenerateMouseMove( @@ -722,7 +722,7 @@ namespace Microsoft.Iris.Input int screenY, InputModifiers modifiers) { - return InputItem.Create(this._inputManager, (ICookedInputSite)null, (InputInfo)MouseMoveInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers)); + return InputItem.Create(this._inputManager, null, MouseMoveInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers)); } private InputItem GenerateMouseButton( @@ -737,7 +737,7 @@ namespace Microsoft.Iris.Input bool state, uint message) { - return InputItem.Create(this._inputManager, (ICookedInputSite)null, (InputInfo)MouseButtonInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers, button, state, message)); + return InputItem.Create(this._inputManager, null, MouseButtonInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers, button, state, message)); } private InputItem GenerateMouseWheel( @@ -750,7 +750,7 @@ namespace Microsoft.Iris.Input InputModifiers modifiers, int wheelDelta) { - return InputItem.Create(this._inputManager, (ICookedInputSite)null, (InputInfo)MouseWheelInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers, wheelDelta)); + return InputItem.Create(this._inputManager, null, MouseWheelInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers, wheelDelta)); } private InputItem GenerateDragDrop( @@ -761,7 +761,7 @@ namespace Microsoft.Iris.Input InputModifiers modifiers, DragOperation operation) { - InputInfo info = (InputInfo)DragDropInfo.Create(rawSite, x, y, modifiers, operation); + InputInfo info = DragDropInfo.Create(rawSite, x, y, modifiers, operation); return InputItem.Create(this._inputManager, cookedSite, info); } } diff --git a/UIX/Microsoft/Iris/Input/KeyActionInfo.cs b/UIX/Microsoft/Iris/Input/KeyActionInfo.cs index f14ddec..3bc0d60 100644 --- a/UIX/Microsoft/Iris/Input/KeyActionInfo.cs +++ b/UIX/Microsoft/Iris/Input/KeyActionInfo.cs @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Input InputEventType eventType, InputDeviceType deviceType) { - this.Initialize(action, eventType, deviceType, InputModifiers.None, 1U, false, 0U, 0, (ushort)0); + this.Initialize(action, eventType, deviceType, InputModifiers.None, 1U, false, 0U, 0, 0); } public KeyAction Action => this._action; diff --git a/UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs b/UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs index 31d3f83..a98f1a1 100644 --- a/UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs +++ b/UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs @@ -54,6 +54,6 @@ namespace Microsoft.Iris.Input protected override InputInfo.InfoType PoolType => KeyCharacterInfo.s_poolType; - public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", (object)this.GetType().Name, (object)this.Action, (object)this._character); + public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", this.GetType().Name, Action, _character); } } diff --git a/UIX/Microsoft/Iris/Input/KeyCommandInfo.cs b/UIX/Microsoft/Iris/Input/KeyCommandInfo.cs index aee7c83..ce070e9 100644 --- a/UIX/Microsoft/Iris/Input/KeyCommandInfo.cs +++ b/UIX/Microsoft/Iris/Input/KeyCommandInfo.cs @@ -39,6 +39,6 @@ namespace Microsoft.Iris.Input protected override InputInfo.InfoType PoolType => KeyCommandInfo.s_poolType; - public override string ToString() => InvariantString.Format("{0}({1}, Command={2})", (object)this.GetType().Name, (object)this.Action, (object)this._command); + public override string ToString() => InvariantString.Format("{0}({1}, Command={2})", this.GetType().Name, Action, _command); } } diff --git a/UIX/Microsoft/Iris/Input/KeyFocusInfo.cs b/UIX/Microsoft/Iris/Input/KeyFocusInfo.cs index 935bd59..d78745d 100644 --- a/UIX/Microsoft/Iris/Input/KeyFocusInfo.cs +++ b/UIX/Microsoft/Iris/Input/KeyFocusInfo.cs @@ -40,7 +40,7 @@ namespace Microsoft.Iris.Input protected override void Zombie() { base.Zombie(); - this._other = (ICookedInputSite)null; + this._other = null; } public bool State => this._state; diff --git a/UIX/Microsoft/Iris/Input/KeyStateInfo.cs b/UIX/Microsoft/Iris/Input/KeyStateInfo.cs index 1cd836b..8d1926f 100644 --- a/UIX/Microsoft/Iris/Input/KeyStateInfo.cs +++ b/UIX/Microsoft/Iris/Input/KeyStateInfo.cs @@ -58,6 +58,6 @@ namespace Microsoft.Iris.Input protected override InputInfo.InfoType PoolType => KeyStateInfo.s_poolType; - public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", (object)this.GetType().Name, (object)this.Action, (object)this._key); + public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", this.GetType().Name, Action, _key); } } diff --git a/UIX/Microsoft/Iris/Input/KeyboardDevice.cs b/UIX/Microsoft/Iris/Input/KeyboardDevice.cs index 6e3c1aa..3010f89 100644 --- a/UIX/Microsoft/Iris/Input/KeyboardDevice.cs +++ b/UIX/Microsoft/Iris/Input/KeyboardDevice.cs @@ -55,14 +55,14 @@ namespace Microsoft.Iris.Input return message == 2U || message == 5U ? this.OnRawKeyCharacter(message, ref args) : this.OnRawKeyState(message, modifiers, ref args); } - internal KeyInfo OnRawKeyCharacter(uint message, ref RawKeyboardData args) => (KeyInfo)KeyCharacterInfo.Create(KeyAction.Character, args._deviceType, this.Manager.Modifiers, args._repCount, (char)args._virtualKey, message == 5U, message, args._scanCode, args._flags); + internal KeyInfo OnRawKeyCharacter(uint message, ref RawKeyboardData args) => KeyCharacterInfo.Create(KeyAction.Character, args._deviceType, this.Manager.Modifiers, args._repCount, (char)args._virtualKey, message == 5U, message, args._scanCode, args._flags); internal KeyInfo OnRawKeyState( uint message, InputModifiers rawModifiers, ref RawKeyboardData args) { - KeyStateInfo keyStateInfo = (KeyStateInfo)null; + KeyStateInfo keyStateInfo = null; bool systemKey = false; KeyAction action; switch (message) @@ -80,14 +80,14 @@ namespace Microsoft.Iris.Input systemKey = true; goto case 1; default: - return (KeyInfo)null; + return null; } if (this.TrackKey(action, args._virtualKey, args._scanCode)) { InputModifiers modifiers = this.Manager.Modifiers & ~this.MapKeyToModifier(args._virtualKey); keyStateInfo = KeyStateInfo.Create(action, args._deviceType, modifiers, args._repCount, args._virtualKey, systemKey, message, args._scanCode, args._flags); } - return (KeyInfo)keyStateInfo; + return keyStateInfo; } public bool IsKeyDown(Keys key) @@ -150,7 +150,7 @@ namespace Microsoft.Iris.Input private bool TrackKeyDown(Keys vkey, int scanCode) { - KeyboardDevice.KeyState keyState1 = (KeyboardDevice.KeyState)null; + KeyboardDevice.KeyState keyState1 = null; for (int index = 0; index < this._keyStates.Length; ++index) { KeyboardDevice.KeyState keyState2 = (KeyboardDevice.KeyState)this._keyStates[index]; @@ -166,7 +166,7 @@ namespace Microsoft.Iris.Input } else { - this._keyStates[index] = (object)null; + this._keyStates[index] = null; keyState2.Dispose(); } } @@ -174,7 +174,7 @@ namespace Microsoft.Iris.Input if (keyState1 == null) { KeyboardDevice.KeyState keyState2 = new KeyboardDevice.KeyState(vkey, scanCode); - this._keyStates.Add((object)keyState2); + this._keyStates.Add(keyState2); keyState2.IsDown = true; } return true; @@ -182,7 +182,7 @@ namespace Microsoft.Iris.Input private bool TrackKeyUp(Keys vkey, int scanCode) { - KeyboardDevice.KeyState keyState1 = (KeyboardDevice.KeyState)null; + KeyboardDevice.KeyState keyState1 = null; bool flag = false; foreach (KeyboardDevice.KeyState keyState2 in this._keyStates) { diff --git a/UIX/Microsoft/Iris/Input/MouseActionInfo.cs b/UIX/Microsoft/Iris/Input/MouseActionInfo.cs index 79bfa74..249edb5 100644 --- a/UIX/Microsoft/Iris/Input/MouseActionInfo.cs +++ b/UIX/Microsoft/Iris/Input/MouseActionInfo.cs @@ -43,8 +43,8 @@ namespace Microsoft.Iris.Input protected override void Zombie() { base.Zombie(); - this._naturalHit = (IRawInputSite)null; - this._naturalTarget = (ICookedInputSite)null; + this._naturalHit = null; + this._naturalTarget = null; } public uint NativeMessageID => this._nativeMessageID; diff --git a/UIX/Microsoft/Iris/Input/MouseButtonInfo.cs b/UIX/Microsoft/Iris/Input/MouseButtonInfo.cs index 83808bc..86c7a3e 100644 --- a/UIX/Microsoft/Iris/Input/MouseButtonInfo.cs +++ b/UIX/Microsoft/Iris/Input/MouseButtonInfo.cs @@ -75,6 +75,6 @@ namespace Microsoft.Iris.Input protected override InputInfo.InfoType PoolType => MouseButtonInfo.s_poolType; - public override string ToString() => InvariantString.Format("{0}({1}, Button={2})", (object)this.GetType().Name, this._state ? (object)"Down" : (object)"Up", (object)this.Button); + public override string ToString() => InvariantString.Format("{0}({1}, Button={2})", this.GetType().Name, this._state ? "Down" : "Up", Button); } } diff --git a/UIX/Microsoft/Iris/Input/MouseDevice.cs b/UIX/Microsoft/Iris/Input/MouseDevice.cs index 813ae35..a222025 100644 --- a/UIX/Microsoft/Iris/Input/MouseDevice.cs +++ b/UIX/Microsoft/Iris/Input/MouseDevice.cs @@ -35,8 +35,8 @@ namespace Microsoft.Iris.Input public bool OnRawInput(uint message, InputModifiers modifiers, ref RawMouseData args) { - IRawInputSite visCapture = (IRawInputSite)args._visCapture; - IRawInputSite visNatural = (IRawInputSite)args._visNatural; + IRawInputSite visCapture = args._visCapture; + IRawInputSite visNatural = args._visNatural; this.Manager.HACK_UpdateSystemModifiers(modifiers); switch (message) { @@ -94,7 +94,7 @@ namespace Microsoft.Iris.Input { this.Manager.HACK_UpdateSystemModifiers(modifiers); this.Manager.MostRecentPhysicalMousePos = new Point(args._positionX, args._positionY); - IRawInputSite visCapture = (IRawInputSite)args._visCapture; + IRawInputSite visCapture = args._visCapture; DragOperation formOperation = (DragOperation)message; this.Manager.Queue.RawDragDrop(visCapture, data, args._positionX, args._positionY, modifiers, formOperation, args); return true; diff --git a/UIX/Microsoft/Iris/Input/MouseFocusInfo.cs b/UIX/Microsoft/Iris/Input/MouseFocusInfo.cs index 1e55cbf..55fa733 100644 --- a/UIX/Microsoft/Iris/Input/MouseFocusInfo.cs +++ b/UIX/Microsoft/Iris/Input/MouseFocusInfo.cs @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Input protected override void Zombie() { base.Zombie(); - this._other = (ICookedInputSite)null; + this._other = null; } public ICookedInputSite Other => this._other; diff --git a/UIX/Microsoft/Iris/Input/MouseInfo.cs b/UIX/Microsoft/Iris/Input/MouseInfo.cs index c1716f0..00437bb 100644 --- a/UIX/Microsoft/Iris/Input/MouseInfo.cs +++ b/UIX/Microsoft/Iris/Input/MouseInfo.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Input protected override void Zombie() { base.Zombie(); - this._rawSource = (IRawInputSite)null; + this._rawSource = null; } public IRawInputSite RawSource => this._rawSource; diff --git a/UIX/Microsoft/Iris/Input/MouseWheelInfo.cs b/UIX/Microsoft/Iris/Input/MouseWheelInfo.cs index ec7b876..c4fcc59 100644 --- a/UIX/Microsoft/Iris/Input/MouseWheelInfo.cs +++ b/UIX/Microsoft/Iris/Input/MouseWheelInfo.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Input return mouseWheelInfo; } - public override string ToString() => InvariantString.Format("{0}(Delta={1})", (object)this.GetType().Name, (object)this.WheelDelta); + public override string ToString() => InvariantString.Format("{0}(Delta={1})", this.GetType().Name, WheelDelta); protected override InputInfo.InfoType PoolType => MouseWheelInfo.s_poolType; } diff --git a/UIX/Microsoft/Iris/InputHandlers/ClickHandler.cs b/UIX/Microsoft/Iris/InputHandlers/ClickHandler.cs index e3f7790..c814c3e 100644 --- a/UIX/Microsoft/Iris/InputHandlers/ClickHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/ClickHandler.cs @@ -167,7 +167,7 @@ namespace Microsoft.Iris.InputHandlers } else if (this._clickTypeInProgress != clickType) this.CancelClick(ClickType.Any); - this.SetEventContext((ICookedInputSite)null, ref this._eventContext, NotificationID.EventContext); + this.SetEventContext(null, ref this._eventContext, NotificationID.EventContext); } private void EndClick(ICookedInputSite clickTarget, ClickType clickType) @@ -280,7 +280,7 @@ namespace Microsoft.Iris.InputHandlers this._repeatTimer.AutoRepeat = true; } this._repeatTimer.Interval = this.RepeatDelay; - this._repeatTimer.UserData = (object)clickInfo; + this._repeatTimer.UserData = clickInfo; this._repeatTimer.Enabled = true; } @@ -296,14 +296,14 @@ namespace Microsoft.Iris.InputHandlers if (flag) { this._repeatTimer.Enabled = false; - this._repeatTimer = (DispatcherTimer)null; + this._repeatTimer = null; this.StartRepeat(userData); this._repeatTimer.Interval = this.RepeatRate; } else { this._repeatTimer.Enabled = false; - this._repeatTimer = (DispatcherTimer)null; + this._repeatTimer = null; } } @@ -354,7 +354,7 @@ namespace Microsoft.Iris.InputHandlers { if (!this.ShouldHandleEvent(ClickType.Mouse)) return; - this.UpdateClickValidPosition(this.UI.HasDescendant((Microsoft.Iris.Library.TreeNode)(info.NaturalTarget as UIClass))); + this.UpdateClickValidPosition(this.UI.HasDescendant(info.NaturalTarget as UIClass)); } protected override void OnLoseMouseFocus(UIClass ui, MouseFocusInfo info) diff --git a/UIX/Microsoft/Iris/InputHandlers/DragDropHelper.cs b/UIX/Microsoft/Iris/InputHandlers/DragDropHelper.cs index 79580c4..cd8ab1d 100644 --- a/UIX/Microsoft/Iris/InputHandlers/DragDropHelper.cs +++ b/UIX/Microsoft/Iris/InputHandlers/DragDropHelper.cs @@ -86,7 +86,7 @@ namespace Microsoft.Iris.InputHandlers DragDropHelper._draggingInternally = false; if (action == DropAction.None) { - target = (IRawInputSite)null; + target = null; formOperation = DragOperation.Leave; } UISession.Default.InputManager.SimulateDragEnd(target, modifiers, formOperation); @@ -96,7 +96,7 @@ namespace Microsoft.Iris.InputHandlers public static void OnDragComplete() { DragDropHelper._sourceHandler.OnEndDrag(DragDropHelper._dropAction); - DragDropHelper._sourceHandler = (DragSourceHandler)null; + DragDropHelper._sourceHandler = null; DragDropHelper._dropAction = DropAction.None; } diff --git a/UIX/Microsoft/Iris/InputHandlers/DragHandler.cs b/UIX/Microsoft/Iris/InputHandlers/DragHandler.cs index 9847077..6a24f95 100644 --- a/UIX/Microsoft/Iris/InputHandlers/DragHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/DragHandler.cs @@ -54,7 +54,7 @@ namespace Microsoft.Iris.InputHandlers this.UI.MouseInteractive = true; if (this._relativeTo != null) return; - this.SetRelativeTo((ViewItem)null); + this.SetRelativeTo(null); } public BeginDragPolicy BeginDragPolicy @@ -109,7 +109,7 @@ namespace Microsoft.Iris.InputHandlers { Size screenDragSize = this.ScreenDragSize; Vector3 vector3 = this._relativeTo != null ? this._relativeTo.ComputeEffectiveScale() : Vector3.UnitVector; - return new Vector2((float)screenDragSize.Width / vector3.X, (float)screenDragSize.Height / vector3.Y); + return new Vector2(screenDragSize.Width / vector3.X, screenDragSize.Height / vector3.Y); } } @@ -179,7 +179,7 @@ namespace Microsoft.Iris.InputHandlers public ViewItem RelativeTo { - get => !this._hasRelativeTo ? (ViewItem)null : this._relativeTo; + get => !this._hasRelativeTo ? null : this._relativeTo; set { bool hasRelativeTo = this._hasRelativeTo; @@ -332,7 +332,7 @@ namespace Microsoft.Iris.InputHandlers if (!this.Dragging) return; Point client = this._relativeTo.ScreenToClient(this._screenEndPosition); - this.SetEndPosition(new Vector2((float)client.X, (float)client.Y)); + this.SetEndPosition(new Vector2(client.X, client.Y)); if (beginPosition != this.BeginPosition) this.FireNotification(NotificationID.BeginPosition); if (endPosition != this.EndPosition) @@ -380,8 +380,8 @@ namespace Microsoft.Iris.InputHandlers private Vector2 TransformToUI(Point uiPoint, UIClass reference) { - float x = (float)uiPoint.X; - float y = (float)uiPoint.Y; + float x = uiPoint.X; + float y = uiPoint.Y; if (reference != this.UI) { RectangleF rect = new RectangleF(x, y, 0.0f, 0.0f); @@ -392,7 +392,7 @@ namespace Microsoft.Iris.InputHandlers return new Vector2(x, y); } - private Vector2 NormalizeCoordinates(Vector2 pt) => this._lastKnownSize.Width == 0 || this._lastKnownSize.Height == 0 ? Vector2.Zero : new Vector2(pt.X / (float)this._lastKnownSize.Width, pt.Y / (float)this._lastKnownSize.Height); + private Vector2 NormalizeCoordinates(Vector2 pt) => this._lastKnownSize.Width == 0 || this._lastKnownSize.Height == 0 ? Vector2.Zero : new Vector2(pt.X / _lastKnownSize.Width, pt.Y / _lastKnownSize.Height); internal override CursorID GetCursor() => this._dragCursor != CursorID.NotSpecified && this.Dragging ? this._dragCursor : CursorID.NotSpecified; @@ -406,23 +406,23 @@ namespace Microsoft.Iris.InputHandlers public IList GetEventContexts() { - IList added = (IList)new List(); + IList added = new List(); RectangleF uiBounds; this.GetDragBounds(out RectangleF _, out uiBounds); - DragHandler.GetEventContexts(this.UI, added, (IList)null, RectangleF.Zero, uiBounds); + DragHandler.GetEventContexts(this.UI, added, null, RectangleF.Zero, uiBounds); return added; } public IList GetAddedEventContexts() { this.UpdateEventContexts(); - return (IList)this._addedContexts; + return _addedContexts; } public IList GetRemovedEventContexts() { this.UpdateEventContexts(); - return (IList)this._removedContexts; + return _removedContexts; } private void UpdateEventContexts() @@ -434,7 +434,7 @@ namespace Microsoft.Iris.InputHandlers return; this._addedContexts = new List(); this._removedContexts = new List(); - DragHandler.GetEventContexts(this.UI, (IList)this._addedContexts, (IList)this._removedContexts, this.TransformFromRelative(this._contextBounds), uiBounds); + DragHandler.GetEventContexts(this.UI, _addedContexts, _removedContexts, this.TransformFromRelative(this._contextBounds), uiBounds); this._contextBounds = relativeBounds; } diff --git a/UIX/Microsoft/Iris/InputHandlers/DragSourceHandler.cs b/UIX/Microsoft/Iris/InputHandlers/DragSourceHandler.cs index 8a9910b..e8235b5 100644 --- a/UIX/Microsoft/Iris/InputHandlers/DragSourceHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/DragSourceHandler.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.InputHandlers public override void OnZoneDetached() { if (this.Dragging) - this.EndDrag((IRawInputSite)null, InputModifiers.None, DropAction.None); + this.EndDrag(null, InputModifiers.None, DropAction.None); base.OnZoneDetached(); } @@ -191,7 +191,7 @@ namespace Microsoft.Iris.InputHandlers DragDropHelper.Requery(modifiers); break; case Keys.Escape: - this.EndDrag((IRawInputSite)null, keyStateInfo.Modifiers, DropAction.None); + this.EndDrag(null, keyStateInfo.Modifiers, DropAction.None); this._dragCanceled = true; break; } @@ -209,7 +209,7 @@ namespace Microsoft.Iris.InputHandlers { this._pendingDrag = false; if (this.Dragging) - this.EndDrag((IRawInputSite)null, DragDropHelper.Modifiers, DropAction.None); + this.EndDrag(null, DragDropHelper.Modifiers, DropAction.None); base.OnLoseKeyFocus(sender, info); } @@ -217,7 +217,7 @@ namespace Microsoft.Iris.InputHandlers { this._pendingDrag = false; if (this.Dragging) - this.EndDrag((IRawInputSite)null, DragDropHelper.Modifiers, DropAction.None); + this.EndDrag(null, DragDropHelper.Modifiers, DropAction.None); base.OnLoseMouseFocus(sender, info); } diff --git a/UIX/Microsoft/Iris/InputHandlers/DropTargetHandler.cs b/UIX/Microsoft/Iris/InputHandlers/DropTargetHandler.cs index c2e5bf9..06c1f15 100644 --- a/UIX/Microsoft/Iris/InputHandlers/DropTargetHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/DropTargetHandler.cs @@ -74,7 +74,7 @@ namespace Microsoft.Iris.InputHandlers { this.EndDrag(NotificationID.DragLeave); info.MarkHandled(); - this.SetEventContext((ICookedInputSite)null, ref this._eventContext, NotificationID.EventContext); + this.SetEventContext(null, ref this._eventContext, NotificationID.EventContext); } base.OnDragLeave(ui, info); } @@ -94,7 +94,7 @@ namespace Microsoft.Iris.InputHandlers this._dragging = false; this.FireNotification(NotificationID.Dragging); this.FireNotification(eventName); - DragDropHelper.TargetHandler = (DropTargetHandler)null; + DragDropHelper.TargetHandler = null; } public object GetValue() => DragDropHelper.GetValue(); diff --git a/UIX/Microsoft/Iris/InputHandlers/KeyHandler.cs b/UIX/Microsoft/Iris/InputHandlers/KeyHandler.cs index 14d8e07..7aabd1a 100644 --- a/UIX/Microsoft/Iris/InputHandlers/KeyHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/KeyHandler.cs @@ -112,7 +112,7 @@ namespace Microsoft.Iris.InputHandlers { if (this.TrackInvokedKeys == value) return; - this._invokedKeys = !value ? (ArrayList)null : new ArrayList(); + this._invokedKeys = !value ? null : new ArrayList(); this.FireNotification(NotificationID.TrackInvokedKeys); } } @@ -265,9 +265,9 @@ namespace Microsoft.Iris.InputHandlers this._command.Invoke(); if (!this.TrackInvokedKeys) return; - this._invokedKeys.Add((object)(KeyHandlerKey)key); + this._invokedKeys.Add((KeyHandlerKey)key); } - public override string ToString() => InvariantString.Format("{0}({1})", (object)this.GetType().Name, (object)this._key); + public override string ToString() => InvariantString.Format("{0}({1})", this.GetType().Name, _key); } } diff --git a/UIX/Microsoft/Iris/InputHandlers/ScrollingHandler.cs b/UIX/Microsoft/Iris/InputHandlers/ScrollingHandler.cs index dddfc5d..bfadadc 100644 --- a/UIX/Microsoft/Iris/InputHandlers/ScrollingHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/ScrollingHandler.cs @@ -247,7 +247,7 @@ namespace Microsoft.Iris.InputHandlers protected override void OnMouseWheel(UIClass ui, MouseWheelInfo info) { - if (!this._handleMouseWheelFlag || !this.ValidScrollModel || this.InputHasKeyModifiers((InputInfo)info)) + if (!this._handleMouseWheelFlag || !this.ValidScrollModel || this.InputHasKeyModifiers(info)) return; this._cumulativeMouseWheelDelta += -info.WheelDelta; if (Math.Abs(this._cumulativeMouseWheelDelta) >= 120) diff --git a/UIX/Microsoft/Iris/InputHandlers/ShortcutHandler.cs b/UIX/Microsoft/Iris/InputHandlers/ShortcutHandler.cs index bee0e1d..4d7fb9b 100644 --- a/UIX/Microsoft/Iris/InputHandlers/ShortcutHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/ShortcutHandler.cs @@ -89,6 +89,6 @@ namespace Microsoft.Iris.InputHandlers this._command.Invoke(); } - public override string ToString() => InvariantString.Format("{0}({1})", (object)this.GetType().Name, (object)this._shortcut); + public override string ToString() => InvariantString.Format("{0}({1})", this.GetType().Name, _shortcut); } } diff --git a/UIX/Microsoft/Iris/InputHandlers/TextEditingHandler.cs b/UIX/Microsoft/Iris/InputHandlers/TextEditingHandler.cs index a5cf6ed..dc21eff 100644 --- a/UIX/Microsoft/Iris/InputHandlers/TextEditingHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/TextEditingHandler.cs @@ -61,7 +61,7 @@ namespace Microsoft.Iris.InputHandlers public TextEditingHandler() { this._caretInfo = new CaretInfo(); - this._editControl = new RichText(true, (IRichTextCallbacks)this); + this._editControl = new RichText(true, this); this._maxLengthChangedHandler = new EventHandler(this.OnEditableTextMaxLengthChanged); this._readOnlyChangedHandler = new EventHandler(this.OnEditableTextReadOnlyChanged); this._valueChangedHandler = new EventHandler(this.OnEditableTextValueChanged); @@ -76,8 +76,8 @@ namespace Microsoft.Iris.InputHandlers this.UnregisterImeMessageHandler(); if (this._activationStateNotifier != null) this.UpdateActivationStateHandler(false); - this.HorizontalScrollModel = (TextScrollModel)null; - this.VerticalScrollModel = (TextScrollModel)null; + this.HorizontalScrollModel = null; + this.VerticalScrollModel = null; this._editControl.Dispose(); } @@ -181,8 +181,8 @@ namespace Microsoft.Iris.InputHandlers LayoutCompleteEventHandler completeEventHandler = new LayoutCompleteEventHandler(this.TextLayoutComplete); if (this._textDisplay != null) { - this._textDisplay.ExternalRasterizer = (RichText)null; - this._textDisplay.ExternalEditingHandler = (TextEditingHandler)null; + this._textDisplay.ExternalRasterizer = null; + this._textDisplay.ExternalEditingHandler = null; this._textDisplay.LayoutComplete -= completeEventHandler; } this._textDisplay = value; @@ -375,14 +375,14 @@ namespace Microsoft.Iris.InputHandlers { if (!this.ForwardKeyCharacterToRichEdit(info)) return false; - if (this._editControl.ForwardKeyCharacterNotification(info.NativeMessageID, (int)info.Character, info.ScanCode, (int)info.RepeatCount, (uint)info.Modifiers, info.KeyboardFlags)) + if (this._editControl.ForwardKeyCharacterNotification(info.NativeMessageID, info.Character, info.ScanCode, (int)info.RepeatCount, (uint)info.Modifiers, info.KeyboardFlags)) info.MarkHandled(); return true; } protected override void OnGainKeyFocus(UIClass ui, KeyFocusInfo info) { - RendererApi.IFC(NativeApi.SpRegisterImeCallbacks((IImeCallbacks)this, out this._ImeCallbackToken)); + RendererApi.IFC(NativeApi.SpRegisterImeCallbacks(this, out this._ImeCallbackToken)); this._editControl.NotifyOfFocusChange(true); if (this.Overtype) this.SelectAll(); @@ -413,24 +413,24 @@ namespace Microsoft.Iris.InputHandlers { if (add) { - this._activationStateNotifier = (Form)this.UI.Zone.Form; + this._activationStateNotifier = UI.Zone.Form; this._activationStateNotifier.ActivationChange += this._activationStateHandler; - this.OnActivationChanged((object)null, EventArgs.Empty); + this.OnActivationChanged(null, EventArgs.Empty); } else { this._activationStateNotifier.ActivationChange -= this._activationStateHandler; - this._activationStateNotifier = (Form)null; + this._activationStateNotifier = null; } } - protected override void OnMouseDoubleClick(UIClass ui, MouseButtonInfo info) => this.ForwardMouseInput((MouseActionInfo)info); + protected override void OnMouseDoubleClick(UIClass ui, MouseButtonInfo info) => this.ForwardMouseInput(info); - protected override void OnMouseMove(UIClass ui, MouseMoveInfo info) => this.ForwardMouseInput((MouseActionInfo)info); + protected override void OnMouseMove(UIClass ui, MouseMoveInfo info) => this.ForwardMouseInput(info); protected override void OnMousePrimaryDown(UIClass ui, MouseButtonInfo info) { - this._pendingPointerDown = (InputInfo)info; + this._pendingPointerDown = info; info.Lock(); if (!this.UI.DirectKeyFocus && this.HandlerStage == InputHandlerStage.Direct && this.UI.KeyFocusOnMouseDown) return; @@ -444,7 +444,7 @@ namespace Microsoft.Iris.InputHandlers this.MousePrimaryDown = true; MouseButtonInfo pendingPointerDown = (MouseButtonInfo)this._pendingPointerDown; this._savedMouseYPositionToWorkAroundRichEditBug = pendingPointerDown.Y; - this.ForwardMouseInput((MouseActionInfo)pendingPointerDown); + this.ForwardMouseInput(pendingPointerDown); this.ClearPendingPointerDown(); } @@ -453,24 +453,24 @@ namespace Microsoft.Iris.InputHandlers if (this._pendingPointerDown == null) return; this._pendingPointerDown.Unlock(); - this._pendingPointerDown = (InputInfo)null; + this._pendingPointerDown = null; } protected override void OnMousePrimaryUp(UIClass ui, MouseButtonInfo info) { this.MousePrimaryDown = false; - this.ForwardMouseInput((MouseActionInfo)info); + this.ForwardMouseInput(info); } - protected override void OnMouseSecondaryDown(UIClass ui, MouseButtonInfo info) => this.ForwardMouseInput((MouseActionInfo)info); + protected override void OnMouseSecondaryDown(UIClass ui, MouseButtonInfo info) => this.ForwardMouseInput(info); - protected override void OnMouseSecondaryUp(UIClass ui, MouseButtonInfo info) => this.ForwardMouseInput((MouseActionInfo)info); + protected override void OnMouseSecondaryUp(UIClass ui, MouseButtonInfo info) => this.ForwardMouseInput(info); protected override void OnMouseWheel(UIClass ui, MouseWheelInfo info) { if (!this._textDisplay.WordWrap) return; - this.ForwardMouseInput((MouseActionInfo)info); + this.ForwardMouseInput(info); } private bool ForwardMouseInput( @@ -484,8 +484,8 @@ namespace Microsoft.Iris.InputHandlers if (this.InputOffsetDirty) { Vector3 parentOffsetPxlVector; - ViewItem.GetAccumulatedOffsetAndScale((IZoneDisplayChild)this._textDisplay, (IZoneDisplayChild)this.UI.RootItem, out parentOffsetPxlVector, out Vector3 _); - this._inputOffset = new Point((int)Math.Floor((double)parentOffsetPxlVector.X), (int)Math.Floor((double)parentOffsetPxlVector.Y)); + ViewItem.GetAccumulatedOffsetAndScale(_textDisplay, UI.RootItem, out parentOffsetPxlVector, out Vector3 _); + this._inputOffset = new Point((int)Math.Floor(parentOffsetPxlVector.X), (int)Math.Floor(parentOffsetPxlVector.Y)); this.InputOffsetDirty = false; } int x = inputX - this._inputOffset.X; @@ -570,7 +570,7 @@ namespace Microsoft.Iris.InputHandlers get { this.CreateCommands(); - return (IUICommand)this._undoCommand; + return _undoCommand; } } @@ -581,7 +581,7 @@ namespace Microsoft.Iris.InputHandlers get { this.CreateCommands(); - return (IUICommand)this._cutCommand; + return _cutCommand; } } @@ -592,7 +592,7 @@ namespace Microsoft.Iris.InputHandlers get { this.CreateCommands(); - return (IUICommand)this._copyCommand; + return _copyCommand; } } @@ -603,7 +603,7 @@ namespace Microsoft.Iris.InputHandlers get { this.CreateCommands(); - return (IUICommand)this._pasteCommand; + return _pasteCommand; } } @@ -614,7 +614,7 @@ namespace Microsoft.Iris.InputHandlers get { this.CreateCommands(); - return (IUICommand)this._deleteCommand; + return _deleteCommand; } } @@ -625,13 +625,13 @@ namespace Microsoft.Iris.InputHandlers get { this.CreateCommands(); - return (IUICommand)this._selectAllCommand; + return _selectAllCommand; } } public void SelectAll() { - string str = this._editData != null ? this._editData.Value : (string)null; + string str = this._editData != null ? this._editData.Value : null; if (string.IsNullOrEmpty(str)) return; this.SelectionRange = new Range(0, str.Length); @@ -670,7 +670,7 @@ namespace Microsoft.Iris.InputHandlers { if (!Application.IsApplicationThread) { - Application.DeferredInvoke((DeferredInvokeHandler)(args => ((IRichTextCallbacks)args).TextChanged()), (object)this, Microsoft.Iris.DeferredInvokePriority.Normal); + Application.DeferredInvoke(args => ((IRichTextCallbacks)args).TextChanged(), this, Microsoft.Iris.DeferredInvokePriority.Normal); return new HRESULT(0); } if (this.GetBit(TextEditingHandler.Bits.CommandsCreated)) @@ -688,7 +688,7 @@ namespace Microsoft.Iris.InputHandlers { if (!Application.IsApplicationThread) { - Application.DeferredInvoke((DeferredInvokeHandler)(args => ((IRichTextCallbacks)args).InvalidateContent()), (object)this, Microsoft.Iris.DeferredInvokePriority.Normal); + Application.DeferredInvoke(args => ((IRichTextCallbacks)args).InvalidateContent(), this, Microsoft.Iris.DeferredInvokePriority.Normal); return new HRESULT(0); } if (this._textDisplay != null) @@ -950,7 +950,7 @@ namespace Microsoft.Iris.InputHandlers storage.DetachCallbacks(); storage = newDude; if (storage != null) - storage.AttachCallbacks((ITextScrollModelCallback)this); + storage.AttachCallbacks(this); this._editControl.SetScrollbars(this._horizontalScrollModel != null, this._verticalScrollModel != null); } @@ -1028,7 +1028,7 @@ namespace Microsoft.Iris.InputHandlers set => this.SetBit(TextEditingHandler.Bits.WindowIsActivated, value); } - private bool GetBit(TextEditingHandler.Bits lookupBit) => ((TextEditingHandler.Bits)this._bits & lookupBit) != (TextEditingHandler.Bits)0; + private bool GetBit(TextEditingHandler.Bits lookupBit) => ((TextEditingHandler.Bits)this._bits & lookupBit) != 0; private void SetBit(TextEditingHandler.Bits changeBit) { diff --git a/UIX/Microsoft/Iris/InputHandlers/TypingHandler.cs b/UIX/Microsoft/Iris/InputHandlers/TypingHandler.cs index 78a2de3..4e7d2d9 100644 --- a/UIX/Microsoft/Iris/InputHandlers/TypingHandler.cs +++ b/UIX/Microsoft/Iris/InputHandlers/TypingHandler.cs @@ -68,7 +68,7 @@ namespace Microsoft.Iris.InputHandlers protected override void OnKeyDown(UIClass ui, KeyStateInfo info) { - if (this.ShouldIgnoreInput((KeyActionInfo)info) || this._edit == null) + if (this.ShouldIgnoreInput(info) || this._edit == null) return; switch (info.Key) { @@ -111,7 +111,7 @@ namespace Microsoft.Iris.InputHandlers protected override void OnKeyCharacter(UIClass ui, KeyCharacterInfo info) { - if (this.ShouldIgnoreInput((KeyActionInfo)info) || this._edit == null) + if (this.ShouldIgnoreInput(info) || this._edit == null) return; switch (info.Character) { @@ -147,7 +147,7 @@ namespace Microsoft.Iris.InputHandlers protected override void OnKeyUp(UIClass ui, KeyStateInfo info) { - if (this.ShouldIgnoreInput((KeyActionInfo)info) || this._edit == null) + if (this.ShouldIgnoreInput(info) || this._edit == null) return; switch (info.Key) { diff --git a/UIX/Microsoft/Iris/IntRangedValue.cs b/UIX/Microsoft/Iris/IntRangedValue.cs index d7038c0..d42022d 100644 --- a/UIX/Microsoft/Iris/IntRangedValue.cs +++ b/UIX/Microsoft/Iris/IntRangedValue.cs @@ -26,25 +26,25 @@ namespace Microsoft.Iris public int Value { get => (int)base.Value; - set => base.Value = (float)value; + set => base.Value = value; } public int MinValue { get => (int)base.MinValue; - set => base.MinValue = (float)value; + set => base.MinValue = value; } public int MaxValue { get => (int)base.MaxValue; - set => base.MaxValue = (float)value; + set => base.MaxValue = value; } public int Step { get => (int)base.Step; - set => base.Step = (float)value; + set => base.Step = value; } internal override ModelItems.RangedValue CreateInternalRangedValue() => new ModelItems.IntRangedValue(); diff --git a/UIX/Microsoft/Iris/Layout/AreaOfInterest.cs b/UIX/Microsoft/Iris/Layout/AreaOfInterest.cs index 2673b05..c9d54c8 100644 --- a/UIX/Microsoft/Iris/Layout/AreaOfInterest.cs +++ b/UIX/Microsoft/Iris/Layout/AreaOfInterest.cs @@ -58,7 +58,7 @@ namespace Microsoft.Iris.Layout areasOfInterestList.Add(interest); } - public override string ToString() => InvariantString.Format("AreaOfInterest(\"{0}\", {1}, {2})", (object)this.Id, (object)this.Rectangle, (object)this.DisplayRectangle); + public override string ToString() => InvariantString.Format("AreaOfInterest(\"{0}\", {1}, {2})", Id, Rectangle, DisplayRectangle); public override int GetHashCode() => this._rectangle.GetHashCode() ^ this._displayRectangle.GetHashCode() ^ this._id.GetHashCode(); diff --git a/UIX/Microsoft/Iris/Layout/AreaOfInterestLayoutInput.cs b/UIX/Microsoft/Iris/Layout/AreaOfInterestLayoutInput.cs index 0f03cdd..040d81c 100644 --- a/UIX/Microsoft/Iris/Layout/AreaOfInterestLayoutInput.cs +++ b/UIX/Microsoft/Iris/Layout/AreaOfInterestLayoutInput.cs @@ -37,6 +37,6 @@ namespace Microsoft.Iris.Layout public static DataCookie Data => AreaOfInterestLayoutInput.s_dataProperty; - public override string ToString() => InvariantString.Format("{0}({1})", (object)this.GetType().Name, (object)this._id); + public override string ToString() => InvariantString.Format("{0}({1})", this.GetType().Name, _id); } } diff --git a/UIX/Microsoft/Iris/Layout/LayoutNodeEnumerator.cs b/UIX/Microsoft/Iris/Layout/LayoutNodeEnumerator.cs index 6920a66..8ac9439 100644 --- a/UIX/Microsoft/Iris/Layout/LayoutNodeEnumerator.cs +++ b/UIX/Microsoft/Iris/Layout/LayoutNodeEnumerator.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Layout public LayoutNodeEnumerator(ILayoutNode start) { this._start = start; - this._current = (ILayoutNode)null; + this._current = null; this._haventStartedYet = true; } @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Layout public void Reset() { - this._current = (ILayoutNode)null; + this._current = null; this._haventStartedYet = true; } } diff --git a/UIX/Microsoft/Iris/Layout/LayoutSlot.cs b/UIX/Microsoft/Iris/Layout/LayoutSlot.cs index d3a2f11..81e35cf 100644 --- a/UIX/Microsoft/Iris/Layout/LayoutSlot.cs +++ b/UIX/Microsoft/Iris/Layout/LayoutSlot.cs @@ -87,15 +87,15 @@ namespace Microsoft.Iris.Layout stringBuilder.Append(this.GetType().Name); stringBuilder.Append("("); stringBuilder.Append("Bounds="); - stringBuilder.Append((object)this._bounds); + stringBuilder.Append(_bounds); stringBuilder.Append(", Offset="); - stringBuilder.Append((object)this._offset); + stringBuilder.Append(_offset); stringBuilder.Append(", View="); - stringBuilder.Append((object)this._viewBounds); + stringBuilder.Append(_viewBounds); if (this._peripheralViewBounds != this._viewBounds) { stringBuilder.Append(", Peripheral="); - stringBuilder.Append((object)this._peripheralViewBounds); + stringBuilder.Append(_peripheralViewBounds); } stringBuilder.Append(")"); return stringBuilder.ToString(); diff --git a/UIX/Microsoft/Iris/Layout/SharedSize.cs b/UIX/Microsoft/Iris/Layout/SharedSize.cs index dcbe3d0..2ecc3b1 100644 --- a/UIX/Microsoft/Iris/Layout/SharedSize.cs +++ b/UIX/Microsoft/Iris/Layout/SharedSize.cs @@ -120,7 +120,7 @@ namespace Microsoft.Iris.Layout Size size2 = constraint; Size size3 = size1; Size size4 = minSize; - if ((policy & SharedSizePolicy.SharesWidth) != (SharedSizePolicy)0) + if ((policy & SharedSizePolicy.SharesWidth) != 0) { if (!this._accumulatingSize) { @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Layout size4.Width = Math.Max(size3.Width, size4.Width); } } - if ((policy & SharedSizePolicy.SharesHeight) != (SharedSizePolicy)0) + if ((policy & SharedSizePolicy.SharesHeight) != 0) { if (!this._accumulatingSize) { @@ -175,9 +175,9 @@ namespace Microsoft.Iris.Layout if (!this._accumulatingSize) return; Size size1 = this.Size; - if ((policy & SharedSizePolicy.ContributesToWidth) != (SharedSizePolicy)0 && size.Width > size1.Width) + if ((policy & SharedSizePolicy.ContributesToWidth) != 0 && size.Width > size1.Width) size1.Width = size.Width; - if ((policy & SharedSizePolicy.ContributesToHeight) != (SharedSizePolicy)0 && size.Height > size1.Height) + if ((policy & SharedSizePolicy.ContributesToHeight) != 0 && size.Height > size1.Height) size1.Height = size.Height; this.SetSize(size1, false); this.EnsureApplySize(); @@ -213,7 +213,7 @@ namespace Microsoft.Iris.Layout { SharedSizePolicy sharedSizePolicy = dependent.SharedSizePolicy; Size size2 = ((ILayoutNode)dependent).DesiredSize - dependent.Margins.Size; - if (size1.Width != size2.Width && (sharedSizePolicy & SharedSizePolicy.SharesWidth) != (SharedSizePolicy)0 || size1.Height != size2.Height && (sharedSizePolicy & SharedSizePolicy.SharesHeight) != (SharedSizePolicy)0) + if (size1.Width != size2.Width && (sharedSizePolicy & SharedSizePolicy.SharesWidth) != 0 || size1.Height != size2.Height && (sharedSizePolicy & SharedSizePolicy.SharesHeight) != 0) dependent.MarkLayoutInvalid(); } } diff --git a/UIX/Microsoft/Iris/Layouts/AnchorEdge.cs b/UIX/Microsoft/Iris/Layouts/AnchorEdge.cs index d7af56b..b869508 100644 --- a/UIX/Microsoft/Iris/Layouts/AnchorEdge.cs +++ b/UIX/Microsoft/Iris/Layouts/AnchorEdge.cs @@ -100,14 +100,14 @@ namespace Microsoft.Iris.Layouts stringBuilder.Append(", "); stringBuilder.Append(this._offsetValue); } - if ((double)this._maximumPercentValue > 0.0) + if (_maximumPercentValue > 0.0) { stringBuilder.Append(", MaximumPercent="); stringBuilder.Append(this._maximumPercentValue); stringBuilder.Append(", MaximumOffset="); stringBuilder.Append(this._maximumOffsetValue); } - if ((double)this._minimumPercentValue > 0.0) + if (_minimumPercentValue > 0.0) { stringBuilder.Append(", MinimumPercent="); stringBuilder.Append(this._minimumPercentValue); @@ -122,7 +122,7 @@ namespace Microsoft.Iris.Layouts { if ((object)lhs == null && (object)rhs == null) return true; - return (object)lhs != null && lhs.Equals((object)rhs); + return (object)lhs != null && lhs.Equals(rhs); } public static bool operator !=(AnchorEdge lhs, AnchorEdge rhs) => !(lhs == rhs); @@ -130,7 +130,7 @@ namespace Microsoft.Iris.Layouts public override bool Equals(object obj) { AnchorEdge anchorEdge = obj as AnchorEdge; - return (object)anchorEdge != null && this.Id == anchorEdge.Id && ((double)this.Percent == (double)anchorEdge.Percent && this.Offset == anchorEdge.Offset) && (this.MaximumSet == anchorEdge.MaximumSet && (double)this.MaximumPercent == (double)anchorEdge.MaximumPercent && (this.MaximumOffset == anchorEdge.MaximumOffset && this.MinimumSet == anchorEdge.MinimumSet)) && (double)this.MinimumPercent == (double)anchorEdge.MinimumPercent && this.MinimumOffset == anchorEdge.MinimumOffset; + return (object)anchorEdge != null && this.Id == anchorEdge.Id && (Percent == (double)anchorEdge.Percent && this.Offset == anchorEdge.Offset) && (this.MaximumSet == anchorEdge.MaximumSet && MaximumPercent == (double)anchorEdge.MaximumPercent && (this.MaximumOffset == anchorEdge.MaximumOffset && this.MinimumSet == anchorEdge.MinimumSet)) && MinimumPercent == (double)anchorEdge.MinimumPercent && this.MinimumOffset == anchorEdge.MinimumOffset; } public override int GetHashCode() => (this.Id != null ? this.Id.GetHashCode() : 0) ^ this.Percent.GetHashCode() ^ this.Offset << 8 ^ this.MaximumSet.GetHashCode() ^ this.MaximumPercent.GetHashCode() ^ this.MaximumOffset << 16 ^ this.MinimumSet.GetHashCode() ^ this.MinimumPercent.GetHashCode() ^ this.MinimumOffset << 24; diff --git a/UIX/Microsoft/Iris/Layouts/AnchorLayout.cs b/UIX/Microsoft/Iris/Layouts/AnchorLayout.cs index ab75d02..c5e4869 100644 --- a/UIX/Microsoft/Iris/Layouts/AnchorLayout.cs +++ b/UIX/Microsoft/Iris/Layouts/AnchorLayout.cs @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Layouts if (!(layoutNode.MeasureData is AnchorLayout.Packet packet)) { packet = new AnchorLayout.Packet(); - layoutNode.MeasureData = (object)packet; + layoutNode.MeasureData = packet; packet.ParentRecord = new AnchorLayout.Record("Parent", new Rectangle(Point.Zero, constraint), AnchorLayout.LayoutPhase.Done); packet.ParentActualRecord = new AnchorLayout.Record("ParentActual", Rectangle.Zero, AnchorLayout.LayoutPhase.Arrange); packet.AreaOfInterestRecord = new AnchorLayout.Record("Focus", Rectangle.Zero, AnchorLayout.LayoutPhase.Arrange); @@ -57,7 +57,7 @@ namespace Microsoft.Iris.Layouts { packet.ParentRecord.Bounds = new Rectangle(Point.Zero, constraint); packet.CircularitiesDetected = false; - packet.CircularityBreakerRecord = (AnchorLayout.Record)null; + packet.CircularityBreakerRecord = null; } packet.Subject = layoutNode; packet.Constraint = constraint; @@ -92,7 +92,7 @@ namespace Microsoft.Iris.Layouts { if (record.Phase == AnchorLayout.LayoutPhase.Untouched) { - packet.CircularityBreakerRecord = (AnchorLayout.Record)null; + packet.CircularityBreakerRecord = null; this.MeasureChild(packet, record); } } @@ -145,12 +145,12 @@ namespace Microsoft.Iris.Layouts { if (!allArrangePhase) { - ErrorManager.ReportError("All AnchorEdges must refer to actual positions on AnchorLayoutInput {0}.", (object)record.Input); + ErrorManager.ReportError("All AnchorEdges must refer to actual positions on AnchorLayoutInput {0}.", record.Input); record.Invalid = true; } if (record.Input.ContributesToHeight || record.Input.ContributesToWidth) { - ErrorManager.ReportError("AnchorLayoutInput {0} cannot contribute to width or height.", (object)record.Input); + ErrorManager.ReportError("AnchorLayoutInput {0} cannot contribute to width or height.", record.Input); record.Invalid = true; } record.Phase = AnchorLayout.LayoutPhase.Arrange; @@ -200,7 +200,7 @@ namespace Microsoft.Iris.Layouts ref bool allArrangePhase, ref bool anyArrangePhase) { - anchor = anchor != (AnchorEdge)null ? anchor : fallback; + anchor = anchor != null ? anchor : fallback; recordRef = this.GetReferenceRecord(packet, anchor.Id); if (recordRef == null) { @@ -251,11 +251,11 @@ namespace Microsoft.Iris.Layouts { size = desiredSize; int num; - if (near == (AnchorEdge)null && far == (AnchorEdge)null) + if (near == null && far == null) num = (nearValue + farValue - desiredSize) / 2; - else if (near != (AnchorEdge)null && far == (AnchorEdge)null) + else if (near != null && far == null) num = nearValue; - else if (near == (AnchorEdge)null && far != (AnchorEdge)null) + else if (near == null && far != null) { num = farValue - desiredSize; } @@ -274,7 +274,7 @@ namespace Microsoft.Iris.Layouts farValue = nearValue; } - private static int Weigh(int value, float percentValue) => (int)((double)value * (double)percentValue); + private static int Weigh(int value, float percentValue) => (int)(value * (double)percentValue); void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) { @@ -283,8 +283,8 @@ namespace Microsoft.Iris.Layouts return; measureData.ParentActualRecord.Bounds = new Rectangle(Point.Zero, slot.Bounds); measureData.AreaOfInterestRecord.Bounds = Rectangle.Zero; - Vector vector = (Vector)null; - AnchorLayout.Record record1 = (AnchorLayout.Record)null; + Vector vector = null; + AnchorLayout.Record record1 = null; foreach (AnchorLayout.Record record2 in measureData.Records) { if (record2.Phase != AnchorLayout.LayoutPhase.Arrange) @@ -316,10 +316,10 @@ namespace Microsoft.Iris.Layouts AnchorLayoutInput input = record2.Input; bool flag = false; AnchorLayout.Record recordRef; - int edge1 = this.ComputeEdge(measureData, "Left", input.Left, (AnchorEdge)null, Orientation.Horizontal, record2, out recordRef, ref flag, ref flag); - int edge2 = this.ComputeEdge(measureData, "Top", input.Top, (AnchorEdge)null, Orientation.Vertical, record2, out recordRef, ref flag, ref flag); - int edge3 = this.ComputeEdge(measureData, "Right", input.Right, (AnchorEdge)null, Orientation.Horizontal, record2, out recordRef, ref flag, ref flag); - int edge4 = this.ComputeEdge(measureData, "Bottom", input.Bottom, (AnchorEdge)null, Orientation.Vertical, record2, out recordRef, ref flag, ref flag); + int edge1 = this.ComputeEdge(measureData, "Left", input.Left, null, Orientation.Horizontal, record2, out recordRef, ref flag, ref flag); + int edge2 = this.ComputeEdge(measureData, "Top", input.Top, null, Orientation.Vertical, record2, out recordRef, ref flag, ref flag); + int edge3 = this.ComputeEdge(measureData, "Right", input.Right, null, Orientation.Horizontal, record2, out recordRef, ref flag, ref flag); + int edge4 = this.ComputeEdge(measureData, "Bottom", input.Bottom, null, Orientation.Vertical, record2, out recordRef, ref flag, ref flag); int width = edge3 - edge1; int height = edge4 - edge2; record2.LayoutNode.Measure(new Size(width, height)); @@ -346,8 +346,8 @@ namespace Microsoft.Iris.Layouts return record; } } - ErrorManager.ReportError("Anchor layout: {0} cannot find the '{1}' child", (object)this.GetType().Name, (object)id); - return (AnchorLayout.Record)null; + ErrorManager.ReportError("Anchor layout: {0} cannot find the '{1}' child", this.GetType().Name, id); + return null; } internal static DataCookie InputData => AnchorLayout.s_dataProperty; @@ -394,7 +394,7 @@ namespace Microsoft.Iris.Layouts this.Phase = phaseOverride; } - public override string ToString() => string.Format("AnchorLayout.Record({0}, Phase={1})", (object)this.ID, (object)this.Phase); + public override string ToString() => string.Format("AnchorLayout.Record({0}, Phase={1})", ID, Phase); } private class Packet @@ -409,7 +409,7 @@ namespace Microsoft.Iris.Layouts public bool CircularitiesDetected; public AnchorLayout.Record CircularityBreakerRecord; - public override string ToString() => string.Format("AnchorLayout.Packet({0})", (object)this.Subject); + public override string ToString() => string.Format("AnchorLayout.Packet({0})", Subject); } } } diff --git a/UIX/Microsoft/Iris/Layouts/AnchorLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/AnchorLayoutInput.cs index d87d909..fafd6c2 100644 --- a/UIX/Microsoft/Iris/Layouts/AnchorLayoutInput.cs +++ b/UIX/Microsoft/Iris/Layouts/AnchorLayoutInput.cs @@ -58,6 +58,6 @@ namespace Microsoft.Iris.Layouts internal static DataCookie Data => AnchorLayout.InputData; - public override string ToString() => InvariantString.Format("AnchorLayoutInput(Left={0}, Top={1}, Right={2}, Bottom={3}{4}{5})", (object)this.Left, (object)this.Top, (object)this.Right, (object)this.Bottom, this.ContributesToWidth ? (object)", ContributesToWidth=true" : (object)string.Empty, this.ContributesToHeight ? (object)", ContributesToHeight=true" : (object)string.Empty); + public override string ToString() => InvariantString.Format("AnchorLayoutInput(Left={0}, Top={1}, Right={2}, Bottom={3}{4}{5})", Left, Top, Right, Bottom, this.ContributesToWidth ? ", ContributesToWidth=true" : string.Empty, this.ContributesToHeight ? ", ContributesToHeight=true" : string.Empty); } } diff --git a/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs index 1e06aed..f48edaa 100644 --- a/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs +++ b/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs @@ -39,6 +39,6 @@ namespace Microsoft.Iris.Layouts } } - public override string ToString() => InvariantString.Format("{0}(Position={1})", (object)this.GetType().Name, (object)this.PositionString); + public override string ToString() => InvariantString.Format("{0}(Position={1})", this.GetType().Name, PositionString); } } diff --git a/UIX/Microsoft/Iris/Layouts/FlowLayout.cs b/UIX/Microsoft/Iris/Layouts/FlowLayout.cs index fbd388b..a237854 100644 --- a/UIX/Microsoft/Iris/Layouts/FlowLayout.cs +++ b/UIX/Microsoft/Iris/Layouts/FlowLayout.cs @@ -90,7 +90,7 @@ namespace Microsoft.Iris.Layouts if (!(layoutNode.MeasureData is FlowLayout.Packet packet)) { packet = new FlowLayout.Packet(); - layoutNode.MeasureData = (object)packet; + layoutNode.MeasureData = packet; } else packet.Clear(); @@ -165,7 +165,7 @@ namespace Microsoft.Iris.Layouts record?.Clear(); } for (int count1 = recordList.Count; count1 < count; ++count1) - recordList.Add((FlowLayout.Record)null); + recordList.Add(null); } private void CreateRecordsFromChildren(FlowLayout.Packet packet) @@ -224,7 +224,7 @@ namespace Microsoft.Iris.Layouts if (packet.Cache == null) { packet.Cache = new FlowSizeMemoryLayoutInput(); - packet.Subject.SetLayoutInput((ILayoutInput)packet.Cache, false); + packet.Subject.SetLayoutInput(packet.Cache, false); } else { @@ -296,7 +296,7 @@ namespace Microsoft.Iris.Layouts FlowLayout.Record record = packet.Records[index]; if (!FlowLayout.Record.IsNullOrEmpty(record)) { - if (ListUtility.IsNullOrEmpty((IVector)record.Nodes)) + if (ListUtility.IsNullOrEmpty(record.Nodes)) ++count; switch (missingItemPolicy) { @@ -318,8 +318,8 @@ namespace Microsoft.Iris.Layouts return; if (missingItemPolicy == MissingItemPolicy.SizeToAverage) { - a.Major = (int)Math.Round((double)a.Major / (double)count); - a.Minor = (int)Math.Round((double)a.Minor / (double)count); + a.Major = (int)Math.Round(a.Major / (double)count); + a.Minor = (int)Math.Round(a.Minor / (double)count); } for (int index = 0; index < packet.Records.Count; ++index) { @@ -424,7 +424,7 @@ namespace Microsoft.Iris.Layouts this.GetIndex(node, 0, packet.PotentialCount, out int _, out int _, out int _, out IndexType _); node.Measure(childConstraint); MajorMinor a = new MajorMinor(node.DesiredSize, this.Orientation); - record.Size = index <= 0 || a.Equals((object)record.Size) ? a : MajorMinor.Max(a, record.Size); + record.Size = index <= 0 || a.Equals(record.Size) ? a : MajorMinor.Max(a, record.Size); } packet.Cache.KnownSizes.ExpandTo(record.Index + 1); packet.Cache.KnownSizes[record.Index] = record.Size.ToSize(this.Orientation); @@ -454,7 +454,7 @@ namespace Microsoft.Iris.Layouts FlowLayout.Packet packet, FlowLayout.Record record) { - return packet.Dividers == null ? (FlowLayout.Record)null : packet.Dividers[record.Index]; + return packet.Dividers == null ? null : packet.Dividers[record.Index]; } private void HandleLastItem( @@ -467,7 +467,7 @@ namespace Microsoft.Iris.Layouts if (index == packet.Records.Count) return; FlowLayout.Record record = packet.Records[index]; - if (ListUtility.IsNullOrEmpty((IVector)record.Nodes)) + if (ListUtility.IsNullOrEmpty(record.Nodes)) return; Size size = (packet.Available - offset).ToSize(this.Orientation); foreach (ILayoutNode node in record.Nodes) @@ -601,7 +601,7 @@ namespace Microsoft.Iris.Layouts int num2 = -1; if (packet.AvailableDataIndices.Count < this._minimumSampleSizeValue) num2 = this._minimumSampleSizeValue; - Vector indiciesList = (Vector)null; + Vector indiciesList = null; for (int index = visibleOffscreen; index <= num1; ++index) { if (!IntListUtility.Contains(packet.AvailableVirtualIndices, index)) @@ -613,7 +613,7 @@ namespace Microsoft.Iris.Layouts break; } } - if (ListUtility.IsNullOrEmpty((IVector)indiciesList)) + if (ListUtility.IsNullOrEmpty(indiciesList)) return; packet.Subject.RequestSpecificChildren(indiciesList); } @@ -722,7 +722,7 @@ namespace Microsoft.Iris.Layouts this.Strip = 0; } - public override string ToString() => InvariantString.Format("Record[{0}] Size:{1}", (object)this.Index, (object)this.Size); + public override string ToString() => InvariantString.Format("Record[{0}] Size:{1}", Index, Size); } internal enum RecordSourceType diff --git a/UIX/Microsoft/Iris/Layouts/FlowSizeMemoryLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/FlowSizeMemoryLayoutInput.cs index fca5c81..28867a2 100644 --- a/UIX/Microsoft/Iris/Layouts/FlowSizeMemoryLayoutInput.cs +++ b/UIX/Microsoft/Iris/Layouts/FlowSizeMemoryLayoutInput.cs @@ -41,10 +41,10 @@ namespace Microsoft.Iris.Layouts stringBuilder.Append("["); stringBuilder.Append(num); stringBuilder.Append("]="); - stringBuilder.Append((object)size); + stringBuilder.Append(size); ++num; } - return InvariantString.Format("{0}({1})", (object)this.GetType().Name, (object)stringBuilder); + return InvariantString.Format("{0}({1})", this.GetType().Name, stringBuilder); } } } diff --git a/UIX/Microsoft/Iris/Layouts/GridLayout.cs b/UIX/Microsoft/Iris/Layouts/GridLayout.cs index d513dfa..67b3aa2 100644 --- a/UIX/Microsoft/Iris/Layouts/GridLayout.cs +++ b/UIX/Microsoft/Iris/Layouts/GridLayout.cs @@ -129,7 +129,7 @@ namespace Microsoft.Iris.Layouts Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) { GridLayout.GeneralFlowInfo generalFlowInfo = this.CalculateGeneralFlowInfo(layoutNode, constraint); - layoutNode.MeasureData = (object)generalFlowInfo; + layoutNode.MeasureData = generalFlowInfo; if (generalFlowInfo.itemsCount <= 0 || !generalFlowInfo.referenceExtent.IsEmpty) return generalFlowInfo.usedSize.ToSize(this.Orientation); layoutNode.RequestMoreChildren(1); @@ -212,7 +212,7 @@ namespace Microsoft.Iris.Layouts private Size GetReferenceSize(ILayoutNode layoutNode, Size constraint) { Size referenceSize = this.ReferenceSize; - if ((double)referenceSize.Width == 0.0 && this.Columns != 0) + if (referenceSize.Width == 0.0 && this.Columns != 0) { int num = (constraint.Width - this.Spacing.Width * (this.Columns - 1)) / this.Columns; if (num <= 0) @@ -220,7 +220,7 @@ namespace Microsoft.Iris.Layouts referenceSize.Width = num; constraint.Width = num; } - if ((double)referenceSize.Height == 0.0 && this.Rows != 0) + if (referenceSize.Height == 0.0 && this.Rows != 0) { int num = (constraint.Height - this.Spacing.Height * (this.Rows - 1)) / this.Rows; if (num <= 0) @@ -332,7 +332,7 @@ namespace Microsoft.Iris.Layouts out Vector indicesToDisplayList) { indicesInfo = this.GetIndexRange(layoutNode, generalInfo); - indicesToDisplayList = (Vector)null; + indicesToDisplayList = null; if (indicesInfo.nonEmptyRange) { indicesToDisplayList = layoutNode.GetSpecificChildrenRequestList(); @@ -534,7 +534,7 @@ namespace Microsoft.Iris.Layouts private static int DivideIntegers(int a, int b, bool roundUp) { - double num = (double)a / (double)b; + double num = a / (double)b; return roundUp ? (int)Math.Ceiling(num) : (int)Math.Floor(num); } diff --git a/UIX/Microsoft/Iris/Layouts/KeepAliveLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/KeepAliveLayoutInput.cs index 8cc160c..c5e21eb 100644 --- a/UIX/Microsoft/Iris/Layouts/KeepAliveLayoutInput.cs +++ b/UIX/Microsoft/Iris/Layouts/KeepAliveLayoutInput.cs @@ -26,6 +26,6 @@ namespace Microsoft.Iris.Layouts public static DataCookie Data => KeepAliveLayoutInput.s_dataProperty; - public override string ToString() => InvariantString.Format("{0}", (object)this.GetType().Name); + public override string ToString() => InvariantString.Format("{0}", this.GetType().Name); } } diff --git a/UIX/Microsoft/Iris/Layouts/MajorMinor.cs b/UIX/Microsoft/Iris/Layouts/MajorMinor.cs index 84cd2d9..c51fc21 100644 --- a/UIX/Microsoft/Iris/Layouts/MajorMinor.cs +++ b/UIX/Microsoft/Iris/Layouts/MajorMinor.cs @@ -43,9 +43,9 @@ namespace Microsoft.Iris.Layouts switch (o) { case Orientation.Horizontal: - return new SizeF((float)this.major, (float)this.minor); + return new SizeF(major, minor); default: - return new SizeF((float)this.minor, (float)this.major); + return new SizeF(minor, major); } } @@ -100,6 +100,6 @@ namespace Microsoft.Iris.Layouts public bool IsEmpty => this.Major == 0 || this.Minor == 0; - public override string ToString() => InvariantString.Format("(Major={0}, Minor={1})", (object)this.Major, (object)this.Minor); + public override string ToString() => InvariantString.Format("(Major={0}, Minor={1})", Major, Minor); } } diff --git a/UIX/Microsoft/Iris/Layouts/PopupLayout.cs b/UIX/Microsoft/Iris/Layouts/PopupLayout.cs index 63d12af..bdb763c 100644 --- a/UIX/Microsoft/Iris/Layouts/PopupLayout.cs +++ b/UIX/Microsoft/Iris/Layouts/PopupLayout.cs @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Layouts ViewItem viewItem = (ViewItem)layoutNode; if (layoutNode.LayoutChildrenCount > 0) { - RectangleF layoutBounds = new RectangleF(PointF.Zero, new SizeF((float)slot.Bounds.Width, (float)slot.Bounds.Height)); + RectangleF layoutBounds = new RectangleF(PointF.Zero, new SizeF(slot.Bounds.Width, slot.Bounds.Height)); foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) { if (!(layoutChild.GetLayoutInput(PopupLayout.s_dataProperty) is PopupLayoutInput layoutInput)) @@ -80,14 +80,14 @@ namespace Microsoft.Iris.Layouts RectangleF placementRect) { PlacementMode placement = layoutInput.Placement; - if (placement == null || ListUtility.IsNullOrEmpty((IList)placement.PopupPositions)) + if (placement == null || ListUtility.IsNullOrEmpty(placement.PopupPositions)) return Point.Zero; PointF[] interestPoints = PopupLayout.InterestPointsFromRect(placementRect); PointF[] childInterestPoints = this.GetChildInterestPoints(childNode); this.GetBounds(interestPoints); RectangleF bounds = this.GetBounds(childInterestPoints); - double width = (double)bounds.Width; - double height = (double)bounds.Height; + double width = bounds.Width; + double height = bounds.Height; bool flag1 = layoutInput.RespectMenuDropAlignment && Win32Api.GetMenuDropAlignment(); PointF bestPosition = PointF.Zero; float num1 = -1f; @@ -109,7 +109,7 @@ namespace Microsoft.Iris.Layouts num2 += 0.1f; if (!flag3) num2 += 0.1f; - if ((double)num2 - (double)num1 > 0.00999999977648258) + if (num2 - (double)num1 > 0.00999999977648258) { bestPosition = pos; num1 = num2; @@ -148,14 +148,14 @@ namespace Microsoft.Iris.Layouts } else { - rectangleF = placementTarget.BoundsRelativeToAncestor((ViewItem)null); + rectangleF = placementTarget.BoundsRelativeToAncestor(null); flag = true; PopupLayout.PlacementTargetInfo placementTargetInfo = new PopupLayout.PlacementTargetInfo(child, placementTarget, rectangleF); - DeferredCall.Post(DispatchPriority.LayoutSync, PopupLayout.s_checkForLayoutChanges, (object)placementTargetInfo); + DeferredCall.Post(DispatchPriority.LayoutSync, PopupLayout.s_checkForLayoutChanges, placementTargetInfo); } - rectangleF.Offset((float)layoutInput.Offset.X, (float)layoutInput.Offset.Y); + rectangleF.Offset(layoutInput.Offset.X, layoutInput.Offset.Y); if (flag) - rectangleF = layoutElement.TransformFromAncestor((ViewItem)null, rectangleF); + rectangleF = layoutElement.TransformFromAncestor(null, rectangleF); return rectangleF; } @@ -164,7 +164,7 @@ namespace Microsoft.Iris.Layouts PopupLayout.PlacementTargetInfo placementTargetInfo = (PopupLayout.PlacementTargetInfo)args; if (placementTargetInfo.placementTarget.IsDisposed || placementTargetInfo.child.IsDisposed) return; - RectangleF ancestor = placementTargetInfo.placementTarget.BoundsRelativeToAncestor((ViewItem)null); + RectangleF ancestor = placementTargetInfo.placementTarget.BoundsRelativeToAncestor(null); if (!(placementTargetInfo.bounds != ancestor)) return; placementTargetInfo.child.MarkLayoutInvalid(); @@ -173,7 +173,7 @@ namespace Microsoft.Iris.Layouts private PointF[] GetChildInterestPoints(ILayoutNode childNode) { Size desiredSize = childNode.DesiredSize; - return PopupLayout.InterestPointsFromRect(new RectangleF(0.0f, 0.0f, (float)desiredSize.Width, (float)desiredSize.Height)); + return PopupLayout.InterestPointsFromRect(new RectangleF(0.0f, 0.0f, desiredSize.Width, desiredSize.Height)); } private static PointF[] InterestPointsFromRect(RectangleF rect) => new PointF[5] @@ -195,13 +195,13 @@ namespace Microsoft.Iris.Layouts { float x2 = interestPoints[index].X; float y2 = interestPoints[index].Y; - if ((double)x2 < (double)x1) + if (x2 < (double)x1) x1 = x2; - if ((double)x2 > (double)num1) + if (x2 > (double)num1) num1 = x2; - if ((double)y2 < (double)y1) + if (y2 < (double)y1) y1 = y2; - if ((double)y2 > (double)num2) + if (y2 > (double)num2) num2 = y2; } return new RectangleF(x1, y1, num1 - x1, num2 - y1); @@ -222,11 +222,11 @@ namespace Microsoft.Iris.Layouts { Point physicalMousePos = UISession.Default.InputManager.MostRecentPhysicalMousePos; if (!placement.UsesTargetSize) - return new RectangleF((float)physicalMousePos.X, (float)physicalMousePos.Y, 0.0f, 0.0f); + return new RectangleF(physicalMousePos.X, physicalMousePos.Y, 0.0f, 0.0f); int height; int hotY; NativeApi.SpGetMouseCursorInfo(out height, out hotY); - return new RectangleF((float)physicalMousePos.X, (float)(physicalMousePos.Y - hotY - 1), 0.0f, (float)(height + 2)); + return new RectangleF(physicalMousePos.X, physicalMousePos.Y - hotY - 1, 0.0f, height + 2); } private void HookMousePositionChanged(ViewItem subject, bool hook) @@ -247,7 +247,7 @@ namespace Microsoft.Iris.Layouts this._followMouseSubjects.Remove(subject); if (this._followMouseSubjects.Count != 0) return; - this._followMouseSubjects = (Vector)null; + this._followMouseSubjects = null; UISession.Default.InputManager.MousePositionChanged -= new EventHandler(this.OnMousePositionChanged); } } diff --git a/UIX/Microsoft/Iris/Layouts/ScaleLayout.cs b/UIX/Microsoft/Iris/Layouts/ScaleLayout.cs index 839a5a7..e61f1ed 100644 --- a/UIX/Microsoft/Iris/Layouts/ScaleLayout.cs +++ b/UIX/Microsoft/Iris/Layouts/ScaleLayout.cs @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Layouts Size size = DefaultLayout.Measure(layoutNode, constraint1); SizeF sizeF = new SizeF(1f, 1f); if (!size.IsZero) - sizeF = new SizeF((float)constraint.Width / (float)size.Width, (float)constraint.Height / (float)size.Height); + sizeF = new SizeF(constraint.Width / (float)size.Width, constraint.Height / (float)size.Height); if (this._maintainAspectRatio) { float num = Math.Min(sizeF.Width, sizeF.Height); @@ -60,17 +60,17 @@ namespace Microsoft.Iris.Layouts } sizeF.Width = Math.Max(sizeF.Width, this.MinimumScale.X); sizeF.Height = Math.Max(sizeF.Height, this.MinimumScale.Y); - if ((double)this.MaximumScale.X != 0.0) + if (MaximumScale.X != 0.0) sizeF.Width = Math.Min(sizeF.Width, this.MaximumScale.X); - if ((double)this.MaximumScale.Y != 0.0) + if (MaximumScale.Y != 0.0) sizeF.Height = Math.Min(sizeF.Height, this.MaximumScale.Y); - layoutNode.MeasureData = (object)sizeF; - size.Width = (int)Math.Round((double)size.Width * (double)sizeF.Width); - size.Height = (int)Math.Round((double)size.Height * (double)sizeF.Height); + layoutNode.MeasureData = sizeF; + size.Width = (int)Math.Round(size.Width * (double)sizeF.Width); + size.Height = (int)Math.Round(size.Height * (double)sizeF.Height); return size; } - private int UnscaleConstraint(int constraint, float minScale) => (double)minScale == 0.0 ? 16777215 : Math.Min((int)Math.Round((double)constraint / (double)minScale), 16777215); + private int UnscaleConstraint(int constraint, float minScale) => minScale == 0.0 ? 16777215 : Math.Min((int)Math.Round(constraint / (double)minScale), 16777215); void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) { @@ -86,10 +86,10 @@ namespace Microsoft.Iris.Layouts private static Rectangle ScaleView(Rectangle view, SizeF scale) { - view.X = (int)Math.Round((double)view.X / (double)scale.Width); - view.Y = (int)Math.Round((double)view.Y / (double)scale.Height); - view.Width = (int)Math.Round((double)view.Width / (double)scale.Width); - view.Height = (int)Math.Round((double)view.Height / (double)scale.Height); + view.X = (int)Math.Round(view.X / (double)scale.Width); + view.Y = (int)Math.Round(view.Y / (double)scale.Height); + view.Width = (int)Math.Round(view.Width / (double)scale.Width); + view.Height = (int)Math.Round(view.Height / (double)scale.Height); return view; } } diff --git a/UIX/Microsoft/Iris/Layouts/ScrollIntoViewDisposition.cs b/UIX/Microsoft/Iris/Layouts/ScrollIntoViewDisposition.cs index 832cb2d..a05271e 100644 --- a/UIX/Microsoft/Iris/Layouts/ScrollIntoViewDisposition.cs +++ b/UIX/Microsoft/Iris/Layouts/ScrollIntoViewDisposition.cs @@ -124,17 +124,17 @@ namespace Microsoft.Iris.Layouts public override string ToString() { - string str1 = InvariantString.Format("{0}(", (object)this.GetType().Name); + string str1 = InvariantString.Format("{0}(", this.GetType().Name); string str2; if (!this._enabled) { - str2 = InvariantString.Format("{0}Disabled", (object)str1); + str2 = InvariantString.Format("{0}Disabled", str1); } else { - str2 = InvariantString.Format("{0}(BeginPadding={1}({2}), EndPadding={3}({4})", (object)str1, (object)this._beginPadding, (object)this._relativeBeginPadding, (object)this._endPadding, (object)this._relativeEndPadding); + str2 = InvariantString.Format("{0}(BeginPadding={1}({2}), EndPadding={3}({4})", str1, _beginPadding, _relativeBeginPadding, _endPadding, _relativeEndPadding); if (this.Locked) - str2 = InvariantString.Format("{0}, LockedPosition={1}, LockedAlignment={2}", (object)str2, (object)this._lockedPosition, (object)this._lockedAlignment); + str2 = InvariantString.Format("{0}, LockedPosition={1}, LockedAlignment={2}", str2, _lockedPosition, _lockedAlignment); } return str2 + ")"; } diff --git a/UIX/Microsoft/Iris/Layouts/ScrollingLayout.cs b/UIX/Microsoft/Iris/Layouts/ScrollingLayout.cs index facd4dc..a6b6b90 100644 --- a/UIX/Microsoft/Iris/Layouts/ScrollingLayout.cs +++ b/UIX/Microsoft/Iris/Layouts/ScrollingLayout.cs @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Layouts { Size infiniteConstraint = this.GetInfiniteConstraint(constraint); size = DefaultLayout.Measure(layoutNode, infiniteConstraint); - layoutNode.MeasureData = (object)size; + layoutNode.MeasureData = size; } else size = DefaultLayout.Measure(layoutNode, constraint); @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Layouts if (!(layoutNode.GetLayoutInput(ScrollingLayoutInput.Data) is ScrollingLayoutInput sli)) sli = new ScrollingLayoutInput(); int scrollAmount = sli.ScrollAmount; - ScrollingLayoutOutput scrollingLayoutOutput = (ScrollingLayoutOutput)null; + ScrollingLayoutOutput scrollingLayoutOutput = null; if (layoutNode.LayoutChildrenCount > 0) { if (sli.Enabled) @@ -84,7 +84,7 @@ namespace Microsoft.Iris.Layouts sli.SetScrollAmount(scrollAmount); if (scrollingLayoutOutput == null) return; - layoutNode.SetExtendedLayoutOutput((ExtendedLayoutOutput)scrollingLayoutOutput); + layoutNode.SetExtendedLayoutOutput(scrollingLayoutOutput); } private ScrollingLayoutOutput Arrange( @@ -133,7 +133,7 @@ namespace Microsoft.Iris.Layouts Rectangle areaOfInterestBounds = Rectangle.Zero; bool scrollAreaOfInterestIntoView = sli.ScrollIntoViewDisposition.Enabled; bool flag1 = false; - VisibleIndexRangeLayoutOutput rangeLayoutOutput = (VisibleIndexRangeLayoutOutput)null; + VisibleIndexRangeLayoutOutput rangeLayoutOutput = null; Rectangle rectangle1 = Rectangle.Zero; Rectangle bounds = new Rectangle(new MajorMinor(-scrollAmount, 0).ToPoint(this.Orientation), Size.Max(slot.Bounds, (Size)layoutNode.MeasureData)); foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) @@ -182,7 +182,7 @@ namespace Microsoft.Iris.Layouts int space1 = this.ItemToSpace(viewBounds.Size); int space2 = this.ItemToSpace(scrollableBounds.Size); int num1 = -(space1 - space2); - int num2 = (int)Math.Round((double)space1 * (double)sli.PageStep); + int num2 = (int)Math.Round(space1 * (double)sli.PageStep); int num3 = this.ItemToSpace(scrollableBounds.Location.ToSize()); int num4 = num3 + num1; if (num1 < 0) @@ -205,7 +205,7 @@ namespace Microsoft.Iris.Layouts float position = 0.0f; if (sli.GetPendingScrollPosition(out position)) { - int num5 = (int)Math2.Blend((double)num3, (double)num4, (double)position, false); + int num5 = (int)Math2.Blend(num3, num4, position, false); scrollAmount = num5; } int amount = 0; @@ -227,17 +227,17 @@ namespace Microsoft.Iris.Layouts float val2 = 1f; float num7 = 0.0f; float num8 = 1f; - float num9 = (float)num1; - float num10 = (float)scrollAmount; + float num9 = num1; + float num10 = scrollAmount; if (num2 > 0) { - val2 = (float)((double)num9 / (double)num2 + 1.0); - num6 = Math.Max(Math.Min((float)((double)num10 / (double)num2 + 1.0), val2), 0.0f); + val2 = (float)(num9 / (double)num2 + 1.0); + num6 = Math.Max(Math.Min((float)(num10 / (double)num2 + 1.0), val2), 0.0f); } if (num1 > 0) { - num7 = num10 / (float)space2; - num8 = (num10 + (float)space1) / (float)space2; + num7 = num10 / space2; + num8 = (num10 + space1) / space2; } return new ScrollingLayoutOutput() { @@ -293,10 +293,10 @@ namespace Microsoft.Iris.Layouts int num9 = num7 - num5; if (scrollIntoView.Locked) { - float num10 = (float)(num7 - num6); + float num10 = num7 - num6; float num11 = num10 * scrollIntoView.LockedPosition; float num12 = num10 * (1f - scrollIntoView.LockedPosition); - int num13 = num1 + (int)((double)space * (double)scrollIntoView.LockedAlignment); + int num13 = num1 + (int)(space * (double)scrollIntoView.LockedAlignment); num1 = num13 - (int)num11; num2 = num13 + (int)num12; } diff --git a/UIX/Microsoft/Iris/Layouts/ScrollingLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/ScrollingLayoutInput.cs index a1437c6..c3aefe6 100644 --- a/UIX/Microsoft/Iris/Layouts/ScrollingLayoutInput.cs +++ b/UIX/Microsoft/Iris/Layouts/ScrollingLayoutInput.cs @@ -86,7 +86,7 @@ namespace Microsoft.Iris.Layouts internal void OnLayoutComplete() { - this.SecondaryScrollIntoViewDisposition = (ScrollIntoViewDisposition)null; + this.SecondaryScrollIntoViewDisposition = null; this._havePendingScrollPosition = false; this._pendingPageCommands = 0; this._scrollAmount = this._pendingScrollAmount; @@ -114,6 +114,6 @@ namespace Microsoft.Iris.Layouts public static DataCookie Data => ScrollingLayoutInput.s_dataProperty; - public override string ToString() => InvariantString.Format("{0}(ScrollAmount={1}, PageAmount={2}, PageStep={3}, Disposition=({4}))", (object)this.GetType().Name, (object)this._pendingScrollAmount, (object)this._pendingPageCommands, (object)this._pageStep, (object)this._scrollIntoView); + public override string ToString() => InvariantString.Format("{0}(ScrollAmount={1}, PageAmount={2}, PageStep={3}, Disposition=({4}))", this.GetType().Name, _pendingScrollAmount, _pendingPageCommands, _pageStep, _scrollIntoView); } } diff --git a/UIX/Microsoft/Iris/Layouts/ScrollingLayoutOutput.cs b/UIX/Microsoft/Iris/Layouts/ScrollingLayoutOutput.cs index c41958f..a017ba0 100644 --- a/UIX/Microsoft/Iris/Layouts/ScrollingLayoutOutput.cs +++ b/UIX/Microsoft/Iris/Layouts/ScrollingLayoutOutput.cs @@ -81,6 +81,6 @@ namespace Microsoft.Iris.Layouts public static DataCookie DataCookie => ScrollingLayoutOutput.s_dataProperty; - public override string ToString() => InvariantString.Format("{0}(CanScrollNegative={1}, CanScrollPositive={2}, CurrentPage={3}, TotalPages={4})", (object)this.GetType().Name, (object)this._canScrollNegative, (object)this._canScrollPositive, (object)this._currentPage, (object)this._totalPages); + public override string ToString() => InvariantString.Format("{0}(CanScrollNegative={1}, CanScrollPositive={2}, CurrentPage={3}, TotalPages={4})", this.GetType().Name, _canScrollNegative, _canScrollPositive, _currentPage, _totalPages); } } diff --git a/UIX/Microsoft/Iris/Layouts/StackLayout.cs b/UIX/Microsoft/Iris/Layouts/StackLayout.cs index f914cc4..ace8b78 100644 --- a/UIX/Microsoft/Iris/Layouts/StackLayout.cs +++ b/UIX/Microsoft/Iris/Layouts/StackLayout.cs @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Layouts num += layoutInputForNode.MinimumSize.Width; } size1.Width = num; - layoutNode.MeasureData = (object)num; + layoutNode.MeasureData = num; } layoutNode.RequestMoreChildren(int.MaxValue); return size1; diff --git a/UIX/Microsoft/Iris/Library/AncestorEnumerator.cs b/UIX/Microsoft/Iris/Library/AncestorEnumerator.cs index c57b4bb..3818842 100644 --- a/UIX/Microsoft/Iris/Library/AncestorEnumerator.cs +++ b/UIX/Microsoft/Iris/Library/AncestorEnumerator.cs @@ -17,21 +17,21 @@ namespace Microsoft.Iris.Library internal AncestorEnumerator(TreeNode nodeStart) { this._nodeStart = nodeStart; - this._nodeCurrent = (TreeNode)null; + this._nodeCurrent = null; this._nodeNext = this._nodeStart; } - object IEnumerator.Current => (object)this._nodeCurrent; + object IEnumerator.Current => _nodeCurrent; public TreeNode Current => this._nodeCurrent; - IEnumerator IEnumerable.GetEnumerator() => (IEnumerator)this; + IEnumerator IEnumerable.GetEnumerator() => this; public AncestorEnumerator GetEnumerator() => this; public void Reset() { - this._nodeCurrent = (TreeNode)null; + this._nodeCurrent = null; this._nodeNext = this._nodeStart; } diff --git a/UIX/Microsoft/Iris/Library/DynamicData.cs b/UIX/Microsoft/Iris/Library/DynamicData.cs index 2dd0400..17e0b9e 100644 --- a/UIX/Microsoft/Iris/Library/DynamicData.cs +++ b/UIX/Microsoft/Iris/Library/DynamicData.cs @@ -24,7 +24,7 @@ namespace Microsoft.Iris.Library { uint key = DynamicData.GetKey(cookie); Delegate data = this._dataMap[key] as Delegate; - this._dataMap[key] = (object)Delegate.Combine(data, handlerToAdd); + this._dataMap[key] = Delegate.Combine(data, handlerToAdd); return (object)data == null; } @@ -32,11 +32,11 @@ namespace Microsoft.Iris.Library { uint key = DynamicData.GetKey(cookie); Delegate @delegate = Delegate.Remove(this._dataMap[key] as Delegate, handlerToRemove); - this._dataMap[key] = (object)@delegate; + this._dataMap[key] = @delegate; return (object)@delegate == null; } - public void RemoveEventHandlers(EventCookie cookie) => this._dataMap[DynamicData.GetKey(cookie)] = (object)null; + public void RemoveEventHandlers(EventCookie cookie) => this._dataMap[DynamicData.GetKey(cookie)] = null; private static uint GetKey(DataCookie cookie) => DataCookie.ToUInt32(cookie); diff --git a/UIX/Microsoft/Iris/Library/Math2.cs b/UIX/Microsoft/Iris/Library/Math2.cs index ef95fa9..154ba74 100644 --- a/UIX/Microsoft/Iris/Library/Math2.cs +++ b/UIX/Microsoft/Iris/Library/Math2.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Library return num; } - public static int RoundUp(float value) => (int)((double)value + 0.5); + public static int RoundUp(float value) => (int)(value + 0.5); public static int Clamp(int value, int min, int max) { @@ -29,15 +29,15 @@ namespace Microsoft.Iris.Library public static float Clamp(float value, float min, float max) { - if ((double)value < (double)min) + if (value < (double)min) return min; - return (double)value > (double)max ? max : value; + return value > (double)max ? max : value; } public static bool WithinEpsilon(float value1, float value2) { float num = value1 - value2; - return -9.99999974737875E-06 <= (double)num && (double)num <= 9.99999974737875E-06; + return -9.99999974737875E-06 <= num && num <= 9.99999974737875E-06; } public static double Blend(double a, double b, double weight, bool allowOutOfRangeWeights) => (1.0 - weight) * a + weight * b; diff --git a/UIX/Microsoft/Iris/Library/Result.cs b/UIX/Microsoft/Iris/Library/Result.cs index d42858b..aa9dd3f 100644 --- a/UIX/Microsoft/Iris/Library/Result.cs +++ b/UIX/Microsoft/Iris/Library/Result.cs @@ -8,7 +8,7 @@ namespace Microsoft.Iris.Library { internal struct Result { - public static Result Success = new Result((string)null); + public static Result Success = new Result(null); private string _error; public static Result Fail(string error) => new Result(error); diff --git a/UIX/Microsoft/Iris/Library/SharedDisposableObject.cs b/UIX/Microsoft/Iris/Library/SharedDisposableObject.cs index 28b74f6..d3307fc 100644 --- a/UIX/Microsoft/Iris/Library/SharedDisposableObject.cs +++ b/UIX/Microsoft/Iris/Library/SharedDisposableObject.cs @@ -10,7 +10,7 @@ namespace Microsoft.Iris.Library { private int _usageCount; - public SharedDisposableObject() => this.DeclareOwner((object)this); + public SharedDisposableObject() => this.DeclareOwner(this); protected override void OnDispose() => base.OnDispose(); @@ -21,7 +21,7 @@ namespace Microsoft.Iris.Library --this._usageCount; if (this._usageCount != 0) return; - this.Dispose((object)this); + this.Dispose(this); } } } diff --git a/UIX/Microsoft/Iris/Library/SmartMap.cs b/UIX/Microsoft/Iris/Library/SmartMap.cs index 3822786..907c495 100644 --- a/UIX/Microsoft/Iris/Library/SmartMap.cs +++ b/UIX/Microsoft/Iris/Library/SmartMap.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Library get { int index = this.IndexOf(key); - return index < 0 ? (object)null : this._listEntries[index].dataObject; + return index < 0 ? null : this._listEntries[index].dataObject; } set { @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Library { get { - uint[] numArray = (uint[])null; + uint[] numArray = null; if (this._listEntries != null) { numArray = new uint[this._listEntries.Length]; @@ -70,7 +70,7 @@ namespace Microsoft.Iris.Library { get { - object[] objArray = (object[])null; + object[] objArray = null; if (this._listEntries != null) { objArray = new object[this._listEntries.Length]; @@ -148,8 +148,8 @@ namespace Microsoft.Iris.Library { int length = this._listEntries.Length; entryArray = new SmartMap.Entry[length + 1]; - Array.Copy((Array)this._listEntries, (Array)entryArray, slotIndex); - Array.Copy((Array)this._listEntries, slotIndex, (Array)entryArray, slotIndex + 1, length - slotIndex); + Array.Copy(_listEntries, entryArray, slotIndex); + Array.Copy(_listEntries, slotIndex, entryArray, slotIndex + 1, length - slotIndex); } this._listEntries = entryArray; this._listEntries[slotIndex].key = key; @@ -162,12 +162,12 @@ namespace Microsoft.Iris.Library if (length > 0) { SmartMap.Entry[] entryArray = new SmartMap.Entry[length - 1]; - Array.Copy((Array)this._listEntries, (Array)entryArray, slotIndex); - Array.Copy((Array)this._listEntries, slotIndex + 1, (Array)entryArray, slotIndex, length - (slotIndex + 1)); + Array.Copy(_listEntries, entryArray, slotIndex); + Array.Copy(_listEntries, slotIndex + 1, entryArray, slotIndex, length - (slotIndex + 1)); this._listEntries = entryArray; } else - this._listEntries = (SmartMap.Entry[])null; + this._listEntries = null; } private struct Entry diff --git a/UIX/Microsoft/Iris/Library/TreeNode.cs b/UIX/Microsoft/Iris/Library/TreeNode.cs index 07d0347..7a518cf 100644 --- a/UIX/Microsoft/Iris/Library/TreeNode.cs +++ b/UIX/Microsoft/Iris/Library/TreeNode.cs @@ -30,19 +30,19 @@ namespace Microsoft.Iris.Library protected override void OnDispose() { base.OnDispose(); - this.ChangeParent((TreeNode)null); + this.ChangeParent(null); this.RemoveEventHandlers(TreeNode.s_deepParentChangeEvent); } public bool IsZoned => this._zone != null; - public void ChangeParent(TreeNode nodeNewParent) => this.ChangeParent(nodeNewParent, (TreeNode)null, TreeNode.LinkType.First); + public void ChangeParent(TreeNode nodeNewParent) => this.ChangeParent(nodeNewParent, null, TreeNode.LinkType.First); public void ChangeParent(TreeNode nodeNewParent, TreeNode nodeSibling, TreeNode.LinkType lt) { if (this._nodeParent == nodeNewParent) return; - UIZone zone = (UIZone)null; + UIZone zone = null; TreeNode nodeParent = this._nodeParent; if (this._nodeParent != null) { @@ -82,7 +82,7 @@ namespace Microsoft.Iris.Library public void RemoveAllChildren(bool disposeChildrenFlag) { while (this._nodeFirstChild != null) - this._nodeFirstChild.ChangeParent((TreeNode)null); + this._nodeFirstChild.ChangeParent(null); } protected virtual void OnZoneAttached() @@ -99,8 +99,8 @@ namespace Microsoft.Iris.Library public event EventHandler DeepParentChange { - add => this.AddEventHandler(TreeNode.s_deepParentChangeEvent, (Delegate)value); - remove => this.RemoveEventHandler(TreeNode.s_deepParentChangeEvent, (Delegate)value); + add => this.AddEventHandler(TreeNode.s_deepParentChangeEvent, value); + remove => this.RemoveEventHandler(TreeNode.s_deepParentChangeEvent, value); } public UIZone Zone => this._zone; @@ -113,7 +113,7 @@ namespace Microsoft.Iris.Library public abstract bool IsRoot { get; } - ITreeNode ITreeNode.Parent => (ITreeNode)this._nodeParent; + ITreeNode ITreeNode.Parent => _nodeParent; public TreeNode Parent => this._nodeParent; @@ -136,7 +136,7 @@ namespace Microsoft.Iris.Library public TreeNode FirstChild => this._nodeFirstChild; - public TreeNode LastChild => this._nodeFirstChild != null ? this._nodeFirstChild.LastSibling : (TreeNode)null; + public TreeNode LastChild => this._nodeFirstChild != null ? this._nodeFirstChild.LastSibling : null; public TreeNodeCollection Children => new TreeNodeCollection(this); @@ -222,9 +222,9 @@ namespace Microsoft.Iris.Library nodeChange._nodeNext._nodePrevious = nodeChange._nodePrevious; if (nodeChange._nodePrevious != null) nodeChange._nodePrevious._nodeNext = nodeChange._nodeNext; - nodeChange._nodeParent = (TreeNode)null; - nodeChange._nodeNext = (TreeNode)null; - nodeChange._nodePrevious = (TreeNode)null; + nodeChange._nodeParent = null; + nodeChange._nodeNext = null; + nodeChange._nodePrevious = null; } private void FireTreeChangeWorker() @@ -233,7 +233,7 @@ namespace Microsoft.Iris.Library child.FireTreeChangeWorker(); if (!(this.GetEventHandler(TreeNode.s_deepParentChangeEvent) is EventHandler eventHandler)) return; - eventHandler((object)this, EventArgs.Empty); + eventHandler(this, EventArgs.Empty); } protected object GetData(DataCookie cookie) => this._dataMap.GetData(cookie); diff --git a/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs b/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs index 0f43192..6f455a1 100644 --- a/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs +++ b/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Library object IList.this[int index] { - get => (object)this[index]; + get => this[index]; set { } @@ -44,24 +44,24 @@ namespace Microsoft.Iris.Library return treeNode; ++num; } - return (TreeNode)null; + return null; } set { } } - IEnumerator IEnumerable.GetEnumerator() => (IEnumerator)this.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => this.GetEnumerator(); public TreeNodeEnumerator GetEnumerator() => new TreeNodeEnumerator(this._nodeSubject); void ICollection.CopyTo(Array destList, int destIndex) { foreach (TreeNode treeNode in this) - destList.SetValue((object)treeNode, destIndex++); + destList.SetValue(treeNode, destIndex++); } - public void CopyTo(TreeNode[] destList, int destIndex) => ((ICollection)this).CopyTo((Array)destList, destIndex); + public void CopyTo(TreeNode[] destList, int destIndex) => ((ICollection)this).CopyTo(destList, destIndex); int IList.Add(object value) { @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Library return this._nodeSubject.ChildCount - 1; } - public void Add(TreeNode nodeChild) => nodeChild.ChangeParent(this._nodeSubject, (TreeNode)null, TreeNode.LinkType.Last); + public void Add(TreeNode nodeChild) => nodeChild.ChangeParent(this._nodeSubject, null, TreeNode.LinkType.Last); public void Clear() => this._nodeSubject.RemoveAllChildren(true); @@ -97,7 +97,7 @@ namespace Microsoft.Iris.Library public void Insert(int insertAtIndex, TreeNode nodeChild) { - TreeNode nodeSibling = (TreeNode)null; + TreeNode nodeSibling = null; TreeNode.LinkType lt = TreeNode.LinkType.Last; if (insertAtIndex < this.Count) { @@ -109,8 +109,8 @@ namespace Microsoft.Iris.Library void IList.Remove(object nodeChild) => this.Remove((TreeNode)nodeChild); - public void Remove(TreeNode nodeChild) => nodeChild.ChangeParent((TreeNode)null); + public void Remove(TreeNode nodeChild) => nodeChild.ChangeParent(null); - public void RemoveAt(int removeAtIndex) => this[removeAtIndex].ChangeParent((TreeNode)null); + public void RemoveAt(int removeAtIndex) => this[removeAtIndex].ChangeParent(null); } } diff --git a/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs b/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs index b2eac2f..393ae89 100644 --- a/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs +++ b/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs @@ -17,17 +17,17 @@ namespace Microsoft.Iris.Library internal TreeNodeEnumerator(TreeNode nodeParent) { this._nodeParent = nodeParent; - this._nodeCurrent = (TreeNode)null; + this._nodeCurrent = null; this._nodeNext = nodeParent.FirstChild; } - object IEnumerator.Current => (object)this._nodeCurrent; + object IEnumerator.Current => _nodeCurrent; public TreeNode Current => this._nodeCurrent; public void Reset() { - this._nodeCurrent = (TreeNode)null; + this._nodeCurrent = null; this._nodeNext = this._nodeParent.FirstChild; } diff --git a/UIX/Microsoft/Iris/ListDataSet.cs b/UIX/Microsoft/Iris/ListDataSet.cs index 70d33a2..7a783e8 100644 --- a/UIX/Microsoft/Iris/ListDataSet.cs +++ b/UIX/Microsoft/Iris/ListDataSet.cs @@ -17,12 +17,12 @@ namespace Microsoft.Iris private IList _sourceList; protected ListDataSet() - : this((IList)null) + : this(null) { } public ListDataSet(IList source) - : this((IModelItemOwner)null, source) + : this(null, source) { } @@ -43,7 +43,7 @@ namespace Microsoft.Iris { if (this._sourceList == value) return; - this._sourceList = !(this._sourceList is IVirtualList) ? value : throw new ArgumentException(InvariantString.Format("ListDataSet does not support IVirtualList. Cannot associate with source list: {0}", (object)value)); + this._sourceList = !(this._sourceList is IVirtualList) ? value : throw new ArgumentException(InvariantString.Format("ListDataSet does not support IVirtualList. Cannot associate with source list: {0}", value)); this.FirePropertyChanged(nameof(Source)); this.FirePropertyChanged("Count"); this.FireSetChanged(UIListContentsChangeType.Reset, -1, -1); @@ -74,7 +74,7 @@ namespace Microsoft.Iris get { using (this.ThreadValidator) - return this._sourceList == null ? (object)null : this._sourceList.SyncRoot; + return this._sourceList == null ? null : this._sourceList.SyncRoot; } } @@ -101,7 +101,7 @@ namespace Microsoft.Iris get { using (this.ThreadValidator) - return this._sourceList == null ? (object)null : this._sourceList[itemIndex]; + return this._sourceList == null ? null : this._sourceList[itemIndex]; } set { @@ -110,7 +110,7 @@ namespace Microsoft.Iris if (this._sourceList == null) throw new InvalidOperationException("Cannot use the this indexer without first specifying a Source for this ListDataSet."); if (itemIndex < 0 || itemIndex >= this.Count) - throw new ArgumentOutOfRangeException(nameof(itemIndex), (object)itemIndex, "Given index is out of the range of this list."); + throw new ArgumentOutOfRangeException(nameof(itemIndex), itemIndex, "Given index is out of the range of this list."); if (this._sourceList[itemIndex] == value) return; this._sourceList[itemIndex] = value; @@ -186,7 +186,7 @@ namespace Microsoft.Iris using (this.ThreadValidator) { if (this._sourceList == null) - throw new ArgumentException(InvariantString.Format("Empty list cannot remove item at index {0}", (object)index)); + throw new ArgumentException(InvariantString.Format("Empty list cannot remove item at index {0}", index)); object obj = this[index]; this._sourceList.RemoveAt(index); this.FireSetChanged(UIListContentsChangeType.Remove, index, -1); @@ -199,7 +199,7 @@ namespace Microsoft.Iris using (this.ThreadValidator) { if (this._sourceList == null) - throw new ArgumentException(InvariantString.Format("Empty list cannot move item from {0} to {1}", (object)oldIndex, (object)newIndex)); + throw new ArgumentException(InvariantString.Format("Empty list cannot move item from {0} to {1}", oldIndex, newIndex)); object obj = this[oldIndex]; if (this._sourceList is INotifyList sourceList) { @@ -222,22 +222,22 @@ namespace Microsoft.Iris throw new ArgumentNullException(nameof(indices)); if (newIndex < 0 || newIndex > this.Count) throw new ArgumentOutOfRangeException(nameof(newIndex), "newIndex must be greater than 0 and less than or equal to the size of the collection"); - int[] numArray = (int[])null; + int[] numArray = null; if (indices.IsReadOnly) numArray = new int[indices.Count]; int index1 = 0; - foreach (object index2 in (IEnumerable)indices) + foreach (object index2 in indices) { if (!(index2 is int num)) - throw new ArgumentException("indices[" + (object)index1 + "] does not contain an int", nameof(indices)); + throw new ArgumentException("indices[" + index1 + "] does not contain an int", nameof(indices)); if (num < 0 || num >= this.Count) - throw new ArgumentOutOfRangeException(nameof(indices), "indices[" + (object)index1 + "] must be greater than 0 and less than the size of the collection"); + throw new ArgumentOutOfRangeException(nameof(indices), "indices[" + index1 + "] must be greater than 0 and less than the size of the collection"); if (numArray != null) numArray[index1] = num; ++index1; } if (numArray != null) - indices = (IList)numArray; + indices = numArray; int num1 = newIndex; for (int index2 = 0; index2 < indices.Count; ++index2) { @@ -254,11 +254,11 @@ namespace Microsoft.Iris { int index5 = (int)indices[index4]; if (index3 < index5 && index5 <= newIndex) - indices[index4] = (object)(index5 - 1); + indices[index4] = index5 - 1; else if (newIndex <= index5 && index5 < index3) - indices[index4] = (object)(index5 + 1); + indices[index4] = index5 + 1; else if (index5 == index3) - indices[index4] = (object)newIndex; + indices[index4] = newIndex; } } ++newIndex; @@ -301,7 +301,7 @@ namespace Microsoft.Iris public void Sort() { using (this.ThreadValidator) - this.SortWorker((IComparer)null); + this.SortWorker(null); } private void SortWorker(IComparer cmp) @@ -328,12 +328,12 @@ namespace Microsoft.Iris add { using (this.ThreadValidator) - this.AddEventHandler(ListDataSet.s_listContentsChangedEvent, (Delegate)value); + this.AddEventHandler(ListDataSet.s_listContentsChangedEvent, value); } remove { using (this.ThreadValidator) - this.RemoveEventHandler(ListDataSet.s_listContentsChangedEvent, (Delegate)value); + this.RemoveEventHandler(ListDataSet.s_listContentsChangedEvent, value); } } @@ -342,12 +342,12 @@ namespace Microsoft.Iris add { using (this.ThreadValidator) - this.AddEventHandler(ListDataSet.s_listContentsChangedEvent, (Delegate)ListContentsChangedProxy.Thunk(value)); + this.AddEventHandler(ListDataSet.s_listContentsChangedEvent, ListContentsChangedProxy.Thunk(value)); } remove { using (this.ThreadValidator) - this.RemoveEventHandler(ListDataSet.s_listContentsChangedEvent, (Delegate)ListContentsChangedProxy.Thunk(value)); + this.RemoveEventHandler(ListDataSet.s_listContentsChangedEvent, ListContentsChangedProxy.Thunk(value)); } } @@ -357,7 +357,7 @@ namespace Microsoft.Iris if (eventHandler != null) { UIListContentsChangedArgs args = new UIListContentsChangedArgs(type, oldIndex, newIndex); - eventHandler((IList)this, args); + eventHandler(this, args); } this.FirePropertyChanged("ContentsChanged"); } diff --git a/UIX/Microsoft/Iris/Markup/AssemblyConstructorSchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyConstructorSchema.cs index b23ffe7..ec0c53b 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyConstructorSchema.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyConstructorSchema.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Markup AssemblyTypeSchema owner, ConstructorInfo constructorInfo, TypeSchema[] parameterTypes) - : base((TypeSchema)owner) + : base(owner) { this._constructorInfo = constructorInfo; this._parameterTypes = parameterTypes; @@ -31,9 +31,9 @@ namespace Microsoft.Iris.Markup object[] paramters = AssemblyLoadResult.UnwrapObjectList(parameters); AssemblyTypeSchema owner = (AssemblyTypeSchema)this.Owner; if (this._constructor == null) - this._constructor = ReflectionHelper.CreateMethodInvoke((MethodBase)this._constructorInfo); - object instance = this._constructor((object)null, paramters); - return AssemblyLoadResult.WrapObject((TypeSchema)owner, instance); + this._constructor = ReflectionHelper.CreateMethodInvoke(_constructorInfo); + object instance = this._constructor(null, paramters); + return AssemblyLoadResult.WrapObject(owner, instance); } } } diff --git a/UIX/Microsoft/Iris/Markup/AssemblyEventSchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyEventSchema.cs index c9f2974..432c6d1 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyEventSchema.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyEventSchema.cs @@ -13,7 +13,7 @@ namespace Microsoft.Iris.Markup private EventInfo _eventInfo; public AssemblyEventSchema(AssemblyTypeSchema owner, EventInfo eventInfo) - : base((TypeSchema)owner) + : base(owner) => this._eventInfo = eventInfo; public override string Name => this._eventInfo.Name; diff --git a/UIX/Microsoft/Iris/Markup/AssemblyLoadResult.cs b/UIX/Microsoft/Iris/Markup/AssemblyLoadResult.cs index 32e9545..deacc0c 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyLoadResult.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyLoadResult.cs @@ -35,17 +35,17 @@ namespace Microsoft.Iris.Markup private static LoadResult Create(string uri) { - LoadResult loadResult = (LoadResult)null; + LoadResult loadResult = null; string valueName = uri.Substring("assembly://".Length); if (valueName.IndexOf('/') == -1) { - ErrorManager.ReportError("Invalid assembly reference '{0}'. URI must contain a forward slash after the assembly name", (object)uri); - return (LoadResult)null; + ErrorManager.ReportError("Invalid assembly reference '{0}'. URI must contain a forward slash after the assembly name", uri); + return null; } string leftName; string rightName; AssemblyLoadResult.SplitAtLastWhack(valueName, out leftName, out rightName); - AssemblyName name = (AssemblyName)null; + AssemblyName name = null; try { name = new AssemblyName(leftName); @@ -66,9 +66,9 @@ namespace Microsoft.Iris.Markup Exception assemblyLoadException; Assembly assembly = AssemblyLoadResult.FindAssembly(name, out assemblyLoadException); if (assembly != null) - loadResult = (LoadResult)AssemblyLoadResult.MapAssembly(assembly, rightName); + loadResult = AssemblyLoadResult.MapAssembly(assembly, rightName); else if (assemblyLoadException != null) - ErrorManager.ReportError("Failure loading assembly: '{0}'", (object)assemblyLoadException.Message); + ErrorManager.ReportError("Failure loading assembly: '{0}'", assemblyLoadException.Message); else ErrorManager.ReportError("Failure loading assembly"); } @@ -82,87 +82,87 @@ namespace Microsoft.Iris.Markup Map typeCache1 = AssemblyLoadResult.s_typeCache; Type type1 = typeof(object); FrameworkCompatibleAssemblyPrimitiveTypeSchema primitiveTypeSchema; - AssemblyLoadResult.ObjectTypeSchema = (TypeSchema)(primitiveTypeSchema = new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)ObjectSchema.Type)); - TypeSchema typeA1 = (TypeSchema)primitiveTypeSchema; - typeCache1[(object)type1] = (object)primitiveTypeSchema; - TypeSchema.RegisterTwoWayEquivalence(typeA1, (TypeSchema)ObjectSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(void)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)VoidSchema.Type)), (TypeSchema)VoidSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(bool)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)BooleanSchema.Type)), (TypeSchema)BooleanSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(byte)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)ByteSchema.Type)), (TypeSchema)ByteSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(char)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)CharSchema.Type)), (TypeSchema)CharSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(double)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)DoubleSchema.Type)), (TypeSchema)DoubleSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(string)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)StringSchema.Type)), (TypeSchema)StringSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(float)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)SingleSchema.Type)), (TypeSchema)SingleSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(int)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)Int32Schema.Type)), (TypeSchema)Int32Schema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(long)] = (object)new FrameworkCompatibleAssemblyPrimitiveTypeSchema((TypeSchema)Int64Schema.Type)), (TypeSchema)Int64Schema.Type); + AssemblyLoadResult.ObjectTypeSchema = primitiveTypeSchema = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(ObjectSchema.Type); + TypeSchema typeA1 = primitiveTypeSchema; + typeCache1[type1] = primitiveTypeSchema; + TypeSchema.RegisterTwoWayEquivalence(typeA1, ObjectSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(void)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(VoidSchema.Type)), VoidSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(bool)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(BooleanSchema.Type)), BooleanSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(byte)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(ByteSchema.Type)), ByteSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(char)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(CharSchema.Type)), CharSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(double)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(DoubleSchema.Type)), DoubleSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(string)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(StringSchema.Type)), StringSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(float)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(SingleSchema.Type)), SingleSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(int)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(Int32Schema.Type)), Int32Schema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(long)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(Int64Schema.Type)), Int64Schema.Type); Map typeCache2 = AssemblyLoadResult.s_typeCache; Type type2 = typeof(IList); FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema1; - AssemblyLoadResult.ListTypeSchema = (TypeSchema)(assemblyTypeSchema1 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IList), typeof(IList), typeof(ArrayList))); - TypeSchema typeA2 = (TypeSchema)assemblyTypeSchema1; - typeCache2[(object)type2] = (object)assemblyTypeSchema1; - TypeSchema.RegisterTwoWayEquivalence(typeA2, (TypeSchema)ListSchema.Type); + AssemblyLoadResult.ListTypeSchema = assemblyTypeSchema1 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IList), typeof(IList), typeof(ArrayList)); + TypeSchema typeA2 = assemblyTypeSchema1; + typeCache2[type2] = assemblyTypeSchema1; + TypeSchema.RegisterTwoWayEquivalence(typeA2, ListSchema.Type); Map typeCache3 = AssemblyLoadResult.s_typeCache; Type type3 = typeof(IEnumerator); FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema2; - AssemblyLoadResult.EnumeratorTypeSchema = (TypeSchema)(assemblyTypeSchema2 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IEnumerator), typeof(IEnumerator))); - TypeSchema typeA3 = (TypeSchema)assemblyTypeSchema2; - typeCache3[(object)type3] = (object)assemblyTypeSchema2; - TypeSchema.RegisterTwoWayEquivalence(typeA3, (TypeSchema)EnumeratorSchema.Type); + AssemblyLoadResult.EnumeratorTypeSchema = assemblyTypeSchema2 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IEnumerator), typeof(IEnumerator)); + TypeSchema typeA3 = assemblyTypeSchema2; + typeCache3[type3] = assemblyTypeSchema2; + TypeSchema.RegisterTwoWayEquivalence(typeA3, EnumeratorSchema.Type); Map typeCache4 = AssemblyLoadResult.s_typeCache; Type type4 = typeof(IDictionary); FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema3; - AssemblyLoadResult.DictionaryTypeSchema = (TypeSchema)(assemblyTypeSchema3 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IDictionary), AssemblyObjectProxyHelper.ProxyDictionaryType, typeof(Dictionary))); - TypeSchema producer1 = (TypeSchema)assemblyTypeSchema3; - typeCache4[(object)type4] = (object)assemblyTypeSchema3; - TypeSchema.RegisterOneWayEquivalence(producer1, (TypeSchema)DictionarySchema.Type); + AssemblyLoadResult.DictionaryTypeSchema = assemblyTypeSchema3 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IDictionary), AssemblyObjectProxyHelper.ProxyDictionaryType, typeof(Dictionary)); + TypeSchema producer1 = assemblyTypeSchema3; + typeCache4[type4] = assemblyTypeSchema3; + TypeSchema.RegisterOneWayEquivalence(producer1, DictionarySchema.Type); Map typeCache5 = AssemblyLoadResult.s_typeCache; Type type5 = typeof(ICommand); FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema4; - AssemblyLoadResult.CommandTypeSchema = (TypeSchema)(assemblyTypeSchema4 = new FrameworkCompatibleAssemblyTypeSchema(typeof(ICommand), AssemblyObjectProxyHelper.ProxyCommandType)); - TypeSchema producer2 = (TypeSchema)assemblyTypeSchema4; - typeCache5[(object)type5] = (object)assemblyTypeSchema4; - TypeSchema.RegisterOneWayEquivalence(producer2, (TypeSchema)CommandSchema.Type); + AssemblyLoadResult.CommandTypeSchema = assemblyTypeSchema4 = new FrameworkCompatibleAssemblyTypeSchema(typeof(ICommand), AssemblyObjectProxyHelper.ProxyCommandType); + TypeSchema producer2 = assemblyTypeSchema4; + typeCache5[type5] = assemblyTypeSchema4; + TypeSchema.RegisterOneWayEquivalence(producer2, CommandSchema.Type); Map typeCache6 = AssemblyLoadResult.s_typeCache; Type type6 = typeof(IValueRange); FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema5; - AssemblyLoadResult.ValueRangeTypeSchema = (TypeSchema)(assemblyTypeSchema5 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IValueRange), AssemblyObjectProxyHelper.ProxyValueRangeType)); - TypeSchema producer3 = (TypeSchema)assemblyTypeSchema5; - typeCache6[(object)type6] = (object)assemblyTypeSchema5; - TypeSchema.RegisterOneWayEquivalence(producer3, (TypeSchema)ValueRangeSchema.Type); - TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(Group)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(Group), typeof(IUIGroup))), (TypeSchema)GroupSchema.Type); - TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(Image)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(Image), typeof(UIImage))), (TypeSchema)ImageSchema.Type); - TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(Type)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(Type), typeof(TypeSchema), (Type)null, AssemblyLoadResult.ObjectTypeSchema)), (TypeSchema)TypeSchemaDefinition.Type); - TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(VideoStream)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(VideoStream))), (TypeSchema)VideoStreamSchema.Type); + AssemblyLoadResult.ValueRangeTypeSchema = assemblyTypeSchema5 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IValueRange), AssemblyObjectProxyHelper.ProxyValueRangeType); + TypeSchema producer3 = assemblyTypeSchema5; + typeCache6[type6] = assemblyTypeSchema5; + TypeSchema.RegisterOneWayEquivalence(producer3, ValueRangeSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(Group)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Group), typeof(IUIGroup))), GroupSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(Image)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Image), typeof(UIImage))), ImageSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(Type)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Type), typeof(TypeSchema), null, AssemblyLoadResult.ObjectTypeSchema)), TypeSchemaDefinition.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(VideoStream)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(VideoStream))), VideoStreamSchema.Type); TypeSchema producer4; - AssemblyLoadResult.s_typeCache[(object)typeof(Microsoft.Iris.Choice)] = (object)(FrameworkCompatibleAssemblyTypeSchema)(producer4 = (TypeSchema)new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.Choice))); - TypeSchema.RegisterOneWayEquivalence(producer4, (TypeSchema)ChoiceSchema.Type); - TypeSchema.RegisterOneWayEquivalence(producer4, (TypeSchema)ValueRangeSchema.Type); - TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(Microsoft.Iris.BooleanChoice)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.BooleanChoice))), (TypeSchema)BooleanChoiceSchema.Type); + AssemblyLoadResult.s_typeCache[typeof(Microsoft.Iris.Choice)] = (FrameworkCompatibleAssemblyTypeSchema)(producer4 = new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.Choice))); + TypeSchema.RegisterOneWayEquivalence(producer4, ChoiceSchema.Type); + TypeSchema.RegisterOneWayEquivalence(producer4, ValueRangeSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(Microsoft.Iris.BooleanChoice)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.BooleanChoice))), BooleanChoiceSchema.Type); TypeSchema producer5; - AssemblyLoadResult.s_typeCache[(object)typeof(Microsoft.Iris.RangedValue)] = (object)(FrameworkCompatibleAssemblyTypeSchema)(producer5 = (TypeSchema)new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.RangedValue))); - TypeSchema.RegisterOneWayEquivalence(producer5, (TypeSchema)RangedValueSchema.Type); - TypeSchema.RegisterOneWayEquivalence(producer5, (TypeSchema)ValueRangeSchema.Type); - TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(Microsoft.Iris.IntRangedValue)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.IntRangedValue))), (TypeSchema)IntRangedValueSchema.Type); - TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(Microsoft.Iris.ByteRangedValue)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.ByteRangedValue))), (TypeSchema)ByteRangedValueSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(DataProviderQuery)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderQuery), typeof(MarkupDataQuery))), (TypeSchema)MarkupDataQueryInstanceSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(DataProviderObject)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderObject), typeof(MarkupDataType))), (TypeSchema)MarkupDataTypeInstanceSchema.Type); - TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[(object)typeof(DataProviderQueryStatus)] = (object)new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderQueryStatus))), UIXLoadResultExports.DataQueryStatusType); + AssemblyLoadResult.s_typeCache[typeof(Microsoft.Iris.RangedValue)] = (FrameworkCompatibleAssemblyTypeSchema)(producer5 = new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.RangedValue))); + TypeSchema.RegisterOneWayEquivalence(producer5, RangedValueSchema.Type); + TypeSchema.RegisterOneWayEquivalence(producer5, ValueRangeSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(Microsoft.Iris.IntRangedValue)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.IntRangedValue))), IntRangedValueSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(Microsoft.Iris.ByteRangedValue)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.ByteRangedValue))), ByteRangedValueSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(DataProviderQuery)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderQuery), typeof(MarkupDataQuery))), MarkupDataQueryInstanceSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(DataProviderObject)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderObject), typeof(MarkupDataType))), MarkupDataTypeInstanceSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(AssemblyLoadResult.s_typeCache[typeof(DataProviderQueryStatus)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderQueryStatus))), UIXLoadResultExports.DataQueryStatusType); } public static void Shutdown() { foreach (SharedDisposableObject disposableObject in AssemblyLoadResult.s_assemblyCache.Values) - disposableObject.UnregisterUsage((object)AssemblyLoadResult.s_assemblyCache); + disposableObject.UnregisterUsage(s_assemblyCache); AssemblyLoadResult.s_assemblyCache.Clear(); - AssemblyLoadResult.s_assemblyCache = (Map)null; + AssemblyLoadResult.s_assemblyCache = null; foreach (AssemblyTypeSchema assemblyTypeSchema in AssemblyLoadResult.s_typeCache.Values) { AssemblyLoadResult owner = (AssemblyLoadResult)assemblyTypeSchema.Owner; - assemblyTypeSchema.Dispose((object)owner); + assemblyTypeSchema.Dispose(owner); } AssemblyLoadResult.s_typeCache.Clear(); - AssemblyLoadResult.s_typeCache = (Map)null; + AssemblyLoadResult.s_typeCache = null; } public string Namespace => this._namespace; @@ -173,11 +173,11 @@ namespace Microsoft.Iris.Markup { Type type = this._assembly.GetType(this._namespacePrefix + name, false); if (type == null) - return (TypeSchema)null; + return null; if (type.IsVisible) - return (TypeSchema)AssemblyLoadResult.MapType(type); - ErrorManager.ReportError("Type '{0}' is not public in '{1}'", (object)name, (object)this._assembly); - return (TypeSchema)null; + return AssemblyLoadResult.MapType(type); + ErrorManager.ReportError("Type '{0}' is not public in '{1}'", name, _assembly); + return null; } public static AssemblyLoadResult MapAssembly(Assembly assembly, string ns) @@ -191,7 +191,7 @@ namespace Microsoft.Iris.Markup uri = uri + "/" + ns; assemblyLoadResult = new AssemblyLoadResult(assembly, ns, uri); AssemblyLoadResult.s_assemblyCache[key] = assemblyLoadResult; - assemblyLoadResult.RegisterUsage((object)AssemblyLoadResult.s_assemblyCache); + assemblyLoadResult.RegisterUsage(s_assemblyCache); } return assemblyLoadResult; } @@ -200,14 +200,14 @@ namespace Microsoft.Iris.Markup { object obj; AssemblyTypeSchema assemblyTypeSchema; - if (AssemblyLoadResult.s_typeCache.TryGetValue((object)type, out obj)) + if (AssemblyLoadResult.s_typeCache.TryGetValue(type, out obj)) { assemblyTypeSchema = (AssemblyTypeSchema)obj; } else { assemblyTypeSchema = AssemblyObjectProxyHelper.CreateProxySchema(type); - AssemblyLoadResult.s_typeCache[(object)type] = (object)assemblyTypeSchema; + AssemblyLoadResult.s_typeCache[type] = assemblyTypeSchema; } return assemblyTypeSchema; } @@ -227,7 +227,7 @@ namespace Microsoft.Iris.Markup } } } - return (Type)null; + return null; } internal static Type[] MapTypeList(TypeSchema[] typeSchemaList) @@ -237,7 +237,7 @@ namespace Microsoft.Iris.Markup { typeArray[index] = AssemblyLoadResult.MapType(typeSchemaList[index]); if (typeArray[index] == null) - return (Type[])null; + return null; } return typeArray; } @@ -247,23 +247,23 @@ namespace Microsoft.Iris.Markup TypeSchema[] typeSchemaArray = new TypeSchema[typeList.Length]; for (int index = 0; index < typeList.Length; ++index) { - typeSchemaArray[index] = (TypeSchema)AssemblyLoadResult.MapType(typeList[index]); + typeSchemaArray[index] = AssemblyLoadResult.MapType(typeList[index]); if (typeSchemaArray[index] == null) - return (TypeSchema[])null; + return null; } return typeSchemaArray; } internal static object WrapObject(TypeSchema typeSchema, object instance) => AssemblyObjectProxyHelper.WrapObject(typeSchema, instance); - internal static object WrapObject(object instance) => AssemblyObjectProxyHelper.WrapObject((TypeSchema)null, instance); + internal static object WrapObject(object instance) => AssemblyObjectProxyHelper.WrapObject(null, instance); internal static object UnwrapObject(object instance) => AssemblyObjectProxyHelper.UnwrapObject(instance); internal static object[] UnwrapObjectList(object[] instanceList) { if (instanceList == null) - return (object[])null; + return null; object[] objArray = new object[instanceList.Length]; for (int index = 0; index < objArray.Length; ++index) objArray[index] = AssemblyLoadResult.UnwrapObject(instanceList[index]); @@ -284,7 +284,7 @@ namespace Microsoft.Iris.Markup else { leftName = valueName; - rightName = (string)null; + rightName = null; } } @@ -292,28 +292,28 @@ namespace Microsoft.Iris.Markup AssemblyName name, out Exception assemblyLoadException) { - Assembly assembly = (Assembly)null; - assemblyLoadException = (Exception)null; + Assembly assembly = null; + assemblyLoadException = null; try { assembly = Assembly.Load(name); } catch (FileLoadException ex) { - assemblyLoadException = (Exception)ex; + assemblyLoadException = ex; } catch (BadImageFormatException ex) { - assemblyLoadException = (Exception)ex; + assemblyLoadException = ex; } catch (FileNotFoundException ex) { - assemblyLoadException = (Exception)ex; + assemblyLoadException = ex; } return assembly; } - public override string GetCompilerReferenceName() => base.GetCompilerReferenceName() ?? string.Format("{0}{1}/{2}", (object)"assembly://", (object)this._assembly.GetName().Name, (object)this._namespace); + public override string GetCompilerReferenceName() => base.GetCompilerReferenceName() ?? string.Format("{0}{1}/{2}", "assembly://", _assembly.GetName().Name, _namespace); internal Assembly Assembly => this._assembly; diff --git a/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataQuery.cs b/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataQuery.cs index b71e2d2..24d2041 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataQuery.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataQuery.cs @@ -15,9 +15,9 @@ namespace Microsoft.Iris.Markup public AssemblyMarkupDataQuery(MarkupDataQuerySchema type, AssemblyDataProviderWrapper provider) : base(type) { - this._externalQuery = provider.ConstructQuery((object)type); - this._externalQuery.DeclareOwner((object)this); - this._externalQuery.SetInternalObject((MarkupDataQuery)this); + this._externalQuery = provider.ConstructQuery(type); + this._externalQuery.DeclareOwner(this); + this._externalQuery.SetInternalObject(this); this.ApplyDefaultValues(); } @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Markup base.OnDispose(); if (this._externalQuery == null) return; - this._externalQuery.Dispose((object)this); + this._externalQuery.Dispose(this); } public override void Refresh() => this._externalQuery.Refresh(); @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Markup return true; } - protected override IDataProviderBaseObject ExternalAssemblyObject => (IDataProviderBaseObject)this._externalQuery; + protected override IDataProviderBaseObject ExternalAssemblyObject => _externalQuery; public override IntPtr ExternalNativeObject => IntPtr.Zero; } diff --git a/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataType.cs b/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataType.cs index 323ba89..ffa5c3a 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataType.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataType.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Markup return true; } - protected override IDataProviderBaseObject ExternalAssemblyObject => (IDataProviderBaseObject)this._externalObject; + protected override IDataProviderBaseObject ExternalAssemblyObject => _externalObject; public override IntPtr ExternalNativeObject => IntPtr.Zero; } diff --git a/UIX/Microsoft/Iris/Markup/AssemblyMethodSchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyMethodSchema.cs index b155baa..a3f3141 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyMethodSchema.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyMethodSchema.cs @@ -19,11 +19,11 @@ namespace Microsoft.Iris.Markup AssemblyTypeSchema owner, MethodInfo methodInfo, TypeSchema[] parameterTypes) - : base((TypeSchema)owner) + : base(owner) { this._methodInfo = methodInfo; this._parameterTypes = parameterTypes; - this._returnTypeSchema = (TypeSchema)AssemblyLoadResult.MapType(this._methodInfo.ReturnType); + this._returnTypeSchema = AssemblyLoadResult.MapType(this._methodInfo.ReturnType); } public override string Name => this._methodInfo.Name; @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Markup object target = AssemblyLoadResult.UnwrapObject(instance); object[] paramters = AssemblyLoadResult.UnwrapObjectList(parameters); if (this._method == null) - this._method = ReflectionHelper.CreateMethodInvoke((MethodBase)this._methodInfo); + this._method = ReflectionHelper.CreateMethodInvoke(_methodInfo); return AssemblyLoadResult.WrapObject(this._returnTypeSchema, this._method(target, paramters)); } } diff --git a/UIX/Microsoft/Iris/Markup/AssemblyObjectProxyHelper.cs b/UIX/Microsoft/Iris/Markup/AssemblyObjectProxyHelper.cs index 4481e9f..735e96a 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyObjectProxyHelper.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyObjectProxyHelper.cs @@ -26,13 +26,13 @@ namespace Microsoft.Iris.Markup AssemblyObjectProxyHelper.s_typeofString = typeof(string); AssemblyObjectProxyHelper.s_proxyTypeInfoTable = new AssemblyObjectProxyHelper.ProxyTypeInfo[7] { - new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (ICommand), typeof (AssemblyObjectProxyHelper.ProxyCommand), (TypeSchema) CommandSchema.Type), - new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IValueRange), typeof (AssemblyObjectProxyHelper.ProxyValueRange), (TypeSchema) ValueRangeSchema.Type), - new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IList), typeof (AssemblyObjectProxyHelper.ProxyList), (TypeSchema) ListSchema.Type), - new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IDictionary), typeof (AssemblyObjectProxyHelper.ProxyDictionary), (TypeSchema) DictionarySchema.Type), - new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IEnumerator), typeof (AssemblyObjectProxyHelper.ProxyListEnumerator), (TypeSchema) EnumeratorSchema.Type), - new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IDisposable), typeof (AssemblyObjectProxyHelper.ProxyObject), (TypeSchema) null), - new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (INotifyPropertyChanged), typeof (AssemblyObjectProxyHelper.ProxyObject), (TypeSchema) null) + new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (ICommand), typeof (AssemblyObjectProxyHelper.ProxyCommand), CommandSchema.Type), + new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IValueRange), typeof (AssemblyObjectProxyHelper.ProxyValueRange), ValueRangeSchema.Type), + new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IList), typeof (AssemblyObjectProxyHelper.ProxyList), ListSchema.Type), + new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IDictionary), typeof (AssemblyObjectProxyHelper.ProxyDictionary), DictionarySchema.Type), + new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IEnumerator), typeof (AssemblyObjectProxyHelper.ProxyListEnumerator), EnumeratorSchema.Type), + new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (IDisposable), typeof (AssemblyObjectProxyHelper.ProxyObject), null), + new AssemblyObjectProxyHelper.ProxyTypeInfo(typeof (INotifyPropertyChanged), typeof (AssemblyObjectProxyHelper.ProxyObject), null) }; } @@ -42,13 +42,13 @@ namespace Microsoft.Iris.Markup { if (proxyTypeInfo.type.IsAssignableFrom(assemblyType)) { - AssemblyTypeSchema assemblyTypeSchema = (AssemblyTypeSchema)new FrameworkCompatibleAssemblyTypeSchema(assemblyType, proxyTypeInfo.proxyType); + AssemblyTypeSchema assemblyTypeSchema = new FrameworkCompatibleAssemblyTypeSchema(assemblyType, proxyTypeInfo.proxyType); if (proxyTypeInfo.equivalents != null) assemblyTypeSchema.ShareEquivalents(proxyTypeInfo.equivalents); return assemblyTypeSchema; } } - return (AssemblyTypeSchema)new StandardAssemblyTypeSchema(assemblyType); + return new StandardAssemblyTypeSchema(assemblyType); } internal static Type ProxyListType => typeof(AssemblyObjectProxyHelper.ProxyList); @@ -62,32 +62,32 @@ namespace Microsoft.Iris.Markup internal static object WrapObject(TypeSchema typeSchema, object instance) { if (instance == null) - return (object)null; + return null; if (instance.GetType().IsPrimitive) return instance; switch (instance) { case Type type: - return (object)AssemblyLoadResult.MapType(type); + return AssemblyLoadResult.MapType(type); case AssemblyObjectProxyHelper.IFrameworkProxyObject frameworkProxyObject: return frameworkProxyObject.FrameworkObject; default: - AssemblyObjectProxyHelper.ProxyObject proxyObject = (AssemblyObjectProxyHelper.ProxyObject)null; + AssemblyObjectProxyHelper.ProxyObject proxyObject = null; bool isDisposable = instance is IDisposable; bool notifiesOnChange = instance is INotifyPropertyChanged; switch (instance) { case ICommand _: - proxyObject = (AssemblyObjectProxyHelper.ProxyObject)new AssemblyObjectProxyHelper.ProxyCommand(instance); + proxyObject = new AssemblyObjectProxyHelper.ProxyCommand(instance); break; case IValueRange _: - proxyObject = (AssemblyObjectProxyHelper.ProxyObject)new AssemblyObjectProxyHelper.ProxyValueRange(instance); + proxyObject = new AssemblyObjectProxyHelper.ProxyValueRange(instance); break; case IDictionary _: - proxyObject = (AssemblyObjectProxyHelper.ProxyObject)new AssemblyObjectProxyHelper.ProxyDictionary(instance); + proxyObject = new AssemblyObjectProxyHelper.ProxyDictionary(instance); break; case IList _: - proxyObject = !(instance is Group) ? (!(instance is IVirtualList) ? (!(instance is INotifyList) ? (AssemblyObjectProxyHelper.ProxyObject)new AssemblyObjectProxyHelper.ProxyList(instance) : (AssemblyObjectProxyHelper.ProxyObject)new AssemblyObjectProxyHelper.ProxyNotifyList(instance)) : (AssemblyObjectProxyHelper.ProxyObject)new AssemblyObjectProxyHelper.ProxyVirtualNotifyList(instance, instance is INotifyList)) : (AssemblyObjectProxyHelper.ProxyObject)new AssemblyObjectProxyHelper.ProxyGroup(instance, instance is INotifyList); + proxyObject = !(instance is Group) ? (!(instance is IVirtualList) ? (!(instance is INotifyList) ? new AssemblyObjectProxyHelper.ProxyList(instance) : new AssemblyObjectProxyHelper.ProxyNotifyList(instance)) : new AssemblyObjectProxyHelper.ProxyVirtualNotifyList(instance, instance is INotifyList)) : new AssemblyObjectProxyHelper.ProxyGroup(instance, instance is INotifyList); break; default: if (isDisposable || notifiesOnChange) @@ -100,14 +100,14 @@ namespace Microsoft.Iris.Markup if (proxyObject == null) return instance; proxyObject.SetIntrinsicState(isDisposable, notifiesOnChange); - return (object)proxyObject; + return proxyObject; } } internal static object UnwrapObject(object instance) { if (instance == null) - return (object)null; + return null; Type type = instance.GetType(); if (type.IsPrimitive || type == AssemblyObjectProxyHelper.s_typeofString) return instance; @@ -116,10 +116,10 @@ namespace Microsoft.Iris.Markup case AssemblyObjectProxyHelper.IAssemblyProxyObject assemblyProxyObject: return assemblyProxyObject.AssemblyObject; case IList uixList: - return (object)new AssemblyObjectProxyHelper.ReverseProxyList(uixList); + return new AssemblyObjectProxyHelper.ReverseProxyList(uixList); case IDictionary _: case IDisposable _: - return (object)new AssemblyObjectProxyHelper.WrappedFrameworkObject(instance); + return new AssemblyObjectProxyHelper.WrappedFrameworkObject(instance); default: return instance; } @@ -135,7 +135,7 @@ namespace Microsoft.Iris.Markup { this.type = type; this.proxyType = proxyType; - this.equivalents = (Vector)null; + this.equivalents = null; if (equivalence == null) return; this.equivalents = new Vector(1); @@ -197,7 +197,7 @@ namespace Microsoft.Iris.Markup base.OnOwnerDeclared(owner); if (!(this._assemblyObject is ModelItem assemblyObject)) return; - assemblyObject.Owner = (IModelItemOwner)this; + assemblyObject.Owner = this; } public void AddListener(Listener listener) @@ -235,7 +235,7 @@ namespace Microsoft.Iris.Markup public object AssemblyObject => this._assemblyObject; - public TypeSchema TypeSchema => (TypeSchema)AssemblyLoadResult.MapType(this._assemblyObject.GetType()); + public TypeSchema TypeSchema => AssemblyLoadResult.MapType(this._assemblyObject.GetType()); public override bool Equals(object rhs) { @@ -364,7 +364,7 @@ namespace Microsoft.Iris.Markup public object SyncRoot => this.ExternalList.SyncRoot; - public IEnumerator GetEnumerator() => (IEnumerator)new AssemblyObjectProxyHelper.ProxyListEnumerator((object)this.ExternalList.GetEnumerator()); + public IEnumerator GetEnumerator() => new AssemblyObjectProxyHelper.ProxyListEnumerator(this.ExternalList.GetEnumerator()); public bool CanSearch => this._canSearch; @@ -390,7 +390,7 @@ namespace Microsoft.Iris.Markup public object Current => AssemblyLoadResult.WrapObject(this._assemblyEnumerator.Current); - public object AssemblyObject => (object)this._assemblyEnumerator; + public object AssemblyObject => _assemblyEnumerator; } private class ProxyNotifyList : @@ -428,21 +428,21 @@ namespace Microsoft.Iris.Markup this._listContentsChangedHandler = new UIListContentsChangedHandler(this.OnListContentsChanged); this.ExternalNotifyList.ContentsChanged += this._listContentsChangedHandler; } - this._handlersAttachedToMe = Delegate.Combine(this._handlersAttachedToMe, (Delegate)value); + this._handlersAttachedToMe = Delegate.Combine(this._handlersAttachedToMe, value); } remove { if (!this._isNotifyList) return; - this._handlersAttachedToMe = Delegate.Remove(this._handlersAttachedToMe, (Delegate)value); + this._handlersAttachedToMe = Delegate.Remove(this._handlersAttachedToMe, value); if ((object)this._handlersAttachedToMe != null) return; this.ExternalNotifyList.ContentsChanged -= this._listContentsChangedHandler; - this._listContentsChangedHandler = (UIListContentsChangedHandler)null; + this._listContentsChangedHandler = null; } } - private void OnListContentsChanged(IList senderList, UIListContentsChangedArgs args) => ((UIListContentsChangedHandler)this._handlersAttachedToMe)((IList)this, args); + private void OnListContentsChanged(IList senderList, UIListContentsChangedArgs args) => ((UIListContentsChangedHandler)this._handlersAttachedToMe)(this, args); } private class ProxyVirtualNotifyList : @@ -467,7 +467,7 @@ namespace Microsoft.Iris.Markup { if (this._itemCallbacks == null) this._itemCallbacks = new Dictionary(); - this._itemCallbacks[(object)index] = (object)callback; + this._itemCallbacks[index] = callback; if (this._onItemGeneratedCallback == null) this._onItemGeneratedCallback = new ItemRequestCallback(this.OnItemGenerated); this.ExternalVirtualList.RequestItem(index, this._onItemGeneratedCallback); @@ -497,9 +497,9 @@ namespace Microsoft.Iris.Markup private void OnItemGenerated(object sender, int index, object item) { - ItemRequestCallback itemCallback = (ItemRequestCallback)this._itemCallbacks[(object)index]; - this._itemCallbacks.Remove((object)index); - itemCallback((object)this, index, AssemblyLoadResult.WrapObject(item)); + ItemRequestCallback itemCallback = (ItemRequestCallback)this._itemCallbacks[index]; + this._itemCallbacks.Remove(index); + itemCallback(this, index, AssemblyLoadResult.WrapObject(item)); } } @@ -584,7 +584,7 @@ namespace Microsoft.Iris.Markup public ReverseProxyList(IList uixList) => this._uixList = uixList; - public object FrameworkObject => (object)this._uixList; + public object FrameworkObject => _uixList; public int Add(object value) => this._uixList.Add(AssemblyLoadResult.WrapObject(value)); @@ -626,7 +626,7 @@ namespace Microsoft.Iris.Markup public object SyncRoot => this._uixList.SyncRoot; - public IEnumerator GetEnumerator() => (IEnumerator)new AssemblyObjectProxyHelper.ReverseProxyListEnumerator(this._uixList.GetEnumerator()); + public IEnumerator GetEnumerator() => new AssemblyObjectProxyHelper.ReverseProxyListEnumerator(this._uixList.GetEnumerator()); } private class ReverseProxyListEnumerator : @@ -643,7 +643,7 @@ namespace Microsoft.Iris.Markup public object Current => AssemblyLoadResult.UnwrapObject(this._uixEnumerator.Current); - public object FrameworkObject => (object)this._uixEnumerator; + public object FrameworkObject => _uixEnumerator; } } } diff --git a/UIX/Microsoft/Iris/Markup/AssemblyPropertySchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyPropertySchema.cs index deee15f..983f37d 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyPropertySchema.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyPropertySchema.cs @@ -18,10 +18,10 @@ namespace Microsoft.Iris.Markup private object[] _setMethodParams; public AssemblyPropertySchema(AssemblyTypeSchema owner, PropertyInfo propertyInfo) - : base((TypeSchema)owner) + : base(owner) { this._propertyInfo = propertyInfo; - this._propertyTypeSchema = (TypeSchema)AssemblyLoadResult.MapType(this._propertyInfo.PropertyType); + this._propertyTypeSchema = AssemblyLoadResult.MapType(this._propertyInfo.PropertyType); this._isStatic = (this._propertyInfo.GetGetMethod() ?? this._propertyInfo.GetSetMethod()).IsStatic; } @@ -56,8 +56,8 @@ namespace Microsoft.Iris.Markup { object target = AssemblyLoadResult.UnwrapObject(instance); if (this._getMethod == null) - this._getMethod = ReflectionHelper.CreateMethodInvoke((MethodBase)this._propertyInfo.GetGetMethod()); - return AssemblyLoadResult.WrapObject(this._propertyTypeSchema, this._getMethod(target, (object[])null)); + this._getMethod = ReflectionHelper.CreateMethodInvoke(this._propertyInfo.GetGetMethod()); + return AssemblyLoadResult.WrapObject(this._propertyTypeSchema, this._getMethod(target, null)); } public override void SetValue(ref object instance, object value) @@ -66,12 +66,12 @@ namespace Microsoft.Iris.Markup object obj1 = AssemblyLoadResult.UnwrapObject(value); if (this._setMethod == null) { - this._setMethod = ReflectionHelper.CreateMethodInvoke((MethodBase)this._propertyInfo.GetSetMethod()); + this._setMethod = ReflectionHelper.CreateMethodInvoke(this._propertyInfo.GetSetMethod()); this._setMethodParams = new object[1]; } this._setMethodParams[0] = obj1; object obj2 = this._setMethod(target, this._setMethodParams); - this._setMethodParams[0] = (object)null; + this._setMethodParams[0] = null; } } } diff --git a/UIX/Microsoft/Iris/Markup/AssemblyTypeSchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyTypeSchema.cs index e004009..4c9654e 100644 --- a/UIX/Microsoft/Iris/Markup/AssemblyTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/AssemblyTypeSchema.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Markup private Map s_methodInfosCache = new Map(); protected AssemblyTypeSchema(Type type, TypeSchema baseType) - : base((LoadResult)AssemblyLoadResult.MapAssembly(type.Assembly, type.Namespace)) + : base(AssemblyLoadResult.MapAssembly(type.Assembly, type.Namespace)) { this._type = type; this._baseType = baseType; @@ -40,13 +40,13 @@ namespace Microsoft.Iris.Markup { base.OnDispose(); foreach (KeyValueEntry keyValueEntry in this._constructorCache) - keyValueEntry.Value.Dispose((object)this); + keyValueEntry.Value.Dispose(this); foreach (KeyValueEntry keyValueEntry in this._propertyCache) - keyValueEntry.Value.Dispose((object)this); + keyValueEntry.Value.Dispose(this); foreach (KeyValueEntry keyValueEntry in this._methodCache) - keyValueEntry.Value.Dispose((object)this); + keyValueEntry.Value.Dispose(this); foreach (KeyValueEntry keyValueEntry in this._eventCache) - keyValueEntry.Value.Dispose((object)this); + keyValueEntry.Value.Dispose(this); } public override string Name @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Markup if (this._baseType == null && this != AssemblyLoadResult.ObjectTypeSchema) { if (this._type.BaseType != null) - this._baseType = (TypeSchema)AssemblyLoadResult.MapType(this._type.BaseType); + this._baseType = AssemblyLoadResult.MapType(this._type.BaseType); else if (this._type.IsInterface) this._baseType = AssemblyLoadResult.ObjectTypeSchema; } @@ -95,7 +95,7 @@ namespace Microsoft.Iris.Markup public override bool Disposable => this._isDisposable; - public override object ConstructDefault() => AssemblyLoadResult.WrapObject((TypeSchema)this, Activator.CreateInstance(this._type)); + public override object ConstructDefault() => AssemblyLoadResult.WrapObject(this, Activator.CreateInstance(this._type)); public override bool HasDefaultConstructor => this._type.IsValueType || this._type.GetConstructor(Type.EmptyTypes) != null; @@ -120,10 +120,10 @@ namespace Microsoft.Iris.Markup { foreach (ConstructorInfo constructorInfo in constructors) { - TypeSchema[] schemaParameters = (TypeSchema[])null; - if (this.CheckForMethodSignatureMatch((MethodBase)constructorInfo, (string)null, parameters, out schemaParameters)) + TypeSchema[] schemaParameters = null; + if (this.CheckForMethodSignatureMatch(constructorInfo, null, parameters, out schemaParameters)) { - constructorSchema = (ConstructorSchema)new AssemblyConstructorSchema(this, constructorInfo, schemaParameters); + constructorSchema = new AssemblyConstructorSchema(this, constructorInfo, schemaParameters); this._constructorCache[new MethodSignatureKey(schemaParameters)] = constructorSchema; break; } @@ -141,7 +141,7 @@ namespace Microsoft.Iris.Markup PropertyInfo propertyHelper = AssemblyTypeSchema.GetPropertyHelper(this._type, name); if (propertyHelper != null) { - propertySchema = (PropertySchema)new AssemblyPropertySchema(this, propertyHelper); + propertySchema = new AssemblyPropertySchema(this, propertyHelper); this._propertyCache[name] = propertySchema; } } @@ -150,7 +150,7 @@ namespace Microsoft.Iris.Markup private static PropertyInfo GetPropertyHelper(Type type, string name) { - PropertyInfo propertyInfo = (PropertyInfo)null; + PropertyInfo propertyInfo = null; try { propertyInfo = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public); @@ -184,7 +184,7 @@ namespace Microsoft.Iris.Markup MethodSchema methodSchema; if (!this._methodCache.TryGetValue(new MethodSignatureKey(name, parameters), out methodSchema)) { - MethodInfo[] methodInfoArray = (MethodInfo[])null; + MethodInfo[] methodInfoArray = null; if (!this.s_methodInfosCache.TryGetValue(this._type, out methodInfoArray)) { methodInfoArray = this._type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public); @@ -195,9 +195,9 @@ namespace Microsoft.Iris.Markup foreach (MethodInfo methodInfo in methodInfoArray) { TypeSchema[] schemaParameters; - if (this.CheckForMethodSignatureMatch((MethodBase)methodInfo, name, parameters, out schemaParameters)) + if (this.CheckForMethodSignatureMatch(methodInfo, name, parameters, out schemaParameters)) { - methodSchema = (MethodSchema)new AssemblyMethodSchema(this, methodInfo, schemaParameters); + methodSchema = new AssemblyMethodSchema(this, methodInfo, schemaParameters); this._methodCache[new MethodSignatureKey(name, schemaParameters)] = methodSchema; break; } @@ -213,7 +213,7 @@ namespace Microsoft.Iris.Markup TypeSchema[] parameters, out TypeSchema[] schemaParameters) { - schemaParameters = (TypeSchema[])null; + schemaParameters = null; if (name != null && candidateMember.Name != name) return false; ParameterInfo[] parameters1 = candidateMember.GetParameters(); @@ -222,7 +222,7 @@ namespace Microsoft.Iris.Markup TypeSchema[] typeSchemaArray = new TypeSchema[parameters1.Length]; for (int index = 0; index < parameters.Length; ++index) { - typeSchemaArray[index] = (TypeSchema)AssemblyLoadResult.MapType(parameters1[index].ParameterType); + typeSchemaArray[index] = AssemblyLoadResult.MapType(parameters1[index].ParameterType); if (!typeSchemaArray[index].IsAssignableFrom(parameters[index])) return false; } @@ -238,7 +238,7 @@ namespace Microsoft.Iris.Markup EventInfo eventInfo = this._type.GetEvent(name); if (eventInfo != null) { - eventSchema = (EventSchema)new AssemblyEventSchema(this, eventInfo); + eventSchema = new AssemblyEventSchema(this, eventInfo); this._eventCache[name] = eventSchema; } } @@ -257,7 +257,7 @@ namespace Microsoft.Iris.Markup { } } - return (object)null; + return null; } public override PropertySchema[] Properties => PropertySchema.EmptyList; @@ -272,7 +272,7 @@ namespace Microsoft.Iris.Markup instance = Enum.ToObject(this._type, (int)from); return Result.Success; } - instance = (object)null; + instance = null; return Result.Fail("Unimplemented"); } @@ -302,10 +302,10 @@ namespace Microsoft.Iris.Markup byte[] b = new byte[16]; for (int index = 0; index < 16; ++index) b[index] = reader.ReadByte(); - obj = (object)new Guid(b); + obj = new Guid(b); } else - obj = (object)null; + obj = null; return obj; } diff --git a/UIX/Microsoft/Iris/Markup/BooleanBoxes.cs b/UIX/Microsoft/Iris/Markup/BooleanBoxes.cs index 53bd503..8b3b1d5 100644 --- a/UIX/Microsoft/Iris/Markup/BooleanBoxes.cs +++ b/UIX/Microsoft/Iris/Markup/BooleanBoxes.cs @@ -8,8 +8,8 @@ namespace Microsoft.Iris.Markup { internal static class BooleanBoxes { - internal static object TrueBox = (object)true; - internal static object FalseBox = (object)false; + internal static object TrueBox = true; + internal static object FalseBox = false; internal static object Box(bool value) => value ? BooleanBoxes.TrueBox : BooleanBoxes.FalseBox; } diff --git a/UIX/Microsoft/Iris/Markup/ByteCodeReader.cs b/UIX/Microsoft/Iris/Markup/ByteCodeReader.cs index 387b10e..b21c197 100644 --- a/UIX/Microsoft/Iris/Markup/ByteCodeReader.cs +++ b/UIX/Microsoft/Iris/Markup/ByteCodeReader.cs @@ -80,9 +80,9 @@ namespace Microsoft.Iris.Markup public unsafe string ReadString() { - uint num1 = (uint)this.ReadUInt16(); - if (num1 == (uint)ushort.MaxValue) - return (string)null; + uint num1 = this.ReadUInt16(); + if (num1 == ushort.MaxValue) + return null; bool flag; uint num2; if (((int)num1 & 32768) != 0) @@ -98,16 +98,16 @@ namespace Microsoft.Iris.Markup } if (this.CurrentOffset + num2 > this.Size) this.ThrowReadError(); - char[] chArray = (long)num1 >= (long)ByteCodeReader.s_scratchCharArray.Length ? new char[num1] : ByteCodeReader.s_scratchCharArray; + char[] chArray = num1 >= s_scratchCharArray.Length ? new char[num1] : ByteCodeReader.s_scratchCharArray; byte* numPtr1 = (byte*)(_buffer.ToInt32() + (int)CurrentOffset); if (flag) { - for (int index = 0; (long)index < (long)num1; ++index) + for (int index = 0; index < num1; ++index) chArray[index] = (char)*numPtr1++; } else { - for (int index = 0; (long)index < (long)num1; ++index) + for (int index = 0; index < num1; ++index) { byte* numPtr2 = numPtr1; byte* numPtr3 = numPtr2 + 1; @@ -115,7 +115,7 @@ namespace Microsoft.Iris.Markup byte* numPtr4 = numPtr3; numPtr1 = numPtr4 + 1; byte num4 = *numPtr4; - chArray[index] = (char)((uint)num3 | (uint)num4 << 8); + chArray[index] = (char)(num3 | (uint)num4 << 8); } } _reader.BaseStream.Seek(num2, SeekOrigin.Current); diff --git a/UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs b/UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs index bc930e8..4dde483 100644 --- a/UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs +++ b/UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs @@ -36,7 +36,8 @@ namespace Microsoft.Iris.Markup public void WriteBool(bool value) { - this._scratch[0] = value ? (byte)1 : (byte)0; + this._scratch[0] = 0; + if (value) this._scratch[0] = 1; this.Write(this._scratch, 1U); } @@ -123,7 +124,7 @@ namespace Microsoft.Iris.Markup } else { - if (value.Length >= (int)short.MaxValue) + if (value.Length >= short.MaxValue) throw new ArgumentException("String too long"); bool flag = false; foreach (char ch in value) @@ -173,12 +174,12 @@ namespace Microsoft.Iris.Markup if (this._cbFreeInBlock == 0U) { this._currentBlock = new byte[4096]; - this._blockList.Add((object)this._currentBlock); + this._blockList.Add(_currentBlock); this._cbFreeInBlock = 4096U; } uint num1 = cbData <= this._cbFreeInBlock ? cbData : this._cbFreeInBlock; uint num2 = 4096U - this._cbFreeInBlock; - Marshal.Copy(new IntPtr((void*)pbData), this._currentBlock, (int)num2, (int)num1); + Marshal.Copy(new IntPtr(pbData), this._currentBlock, (int)num2, (int)num1); pbData += (int)num1; cbData -= num1; this._cbFreeInBlock -= num1; @@ -204,15 +205,15 @@ namespace Microsoft.Iris.Markup byte* numPtr = pointer; for (int index = 0; index < this._blockList.Count - 1; ++index) { - Marshal.Copy((byte[])this._blockList[index], 0, new IntPtr((void*)numPtr), 4096); + Marshal.Copy((byte[])this._blockList[index], 0, new IntPtr(numPtr), 4096); numPtr += 4096; } uint num = 4096U - this._cbFreeInBlock; if (this._currentBlock != null && num != 0U) - Marshal.Copy(this._currentBlock, 0, new IntPtr((void*)numPtr), (int)num); + Marshal.Copy(this._currentBlock, 0, new IntPtr(numPtr), (int)num); totalSize = this._totalSize; this._blockList.Clear(); - this._currentBlock = (byte[])null; + this._currentBlock = null; this._cbFreeInBlock = 0U; this._totalSize = 0U; return pointer; @@ -221,7 +222,7 @@ namespace Microsoft.Iris.Markup public unsafe ByteCodeReader CreateReader() { uint totalSize; - return new ByteCodeReader(new IntPtr((void*)this.ComposeFinalBuffer(out totalSize)), totalSize, true); + return new ByteCodeReader(new IntPtr(this.ComposeFinalBuffer(out totalSize)), totalSize, true); } } } diff --git a/UIX/Microsoft/Iris/Markup/ClassMethodSchema.cs b/UIX/Microsoft/Iris/Markup/ClassMethodSchema.cs index 86e2d38..bd0feb2 100644 --- a/UIX/Microsoft/Iris/Markup/ClassMethodSchema.cs +++ b/UIX/Microsoft/Iris/Markup/ClassMethodSchema.cs @@ -14,11 +14,11 @@ namespace Microsoft.Iris.Markup TypeSchema returnType, TypeSchema[] parameterTypes, string[] parameterNames) - : base((MarkupTypeSchema)owner, name, returnType, parameterTypes, parameterNames) + : base(owner, name, returnType, parameterTypes, parameterNames) { } - protected override IMarkupTypeBase GetMarkupTypeBase(object instance) => instance == null ? (IMarkupTypeBase)((ClassTypeSchema)this.Owner).SharedInstance : (IMarkupTypeBase)instance; + protected override IMarkupTypeBase GetMarkupTypeBase(object instance) => instance == null ? ((ClassTypeSchema)Owner).SharedInstance : (IMarkupTypeBase)instance; public override bool IsStatic => ((ClassTypeSchema)this.Owner).IsShared; } diff --git a/UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs b/UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs index aff138e..1157a67 100644 --- a/UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs @@ -25,17 +25,17 @@ namespace Microsoft.Iris.Markup base.OnDispose(); if (this._sharedInstance == null) return; - this._sharedInstance.Dispose((object)this); - this._sharedInstance = (Class)null; + this._sharedInstance.Dispose(this); + this._sharedInstance = null; } public override MarkupType MarkupType => MarkupType.Class; - protected override TypeSchema DefaultBase => (TypeSchema)ObjectSchema.Type; + protected override TypeSchema DefaultBase => ObjectSchema.Type; public override Type RuntimeType => typeof(Class); - public override object ConstructDefault() => this._isShared ? (object)this.SharedInstance : (object)this.ConstructNewInstance(); + public override object ConstructDefault() => this._isShared ? SharedInstance : this.ConstructNewInstance(); public override void InitializeInstance(ref object instance) => this.InitializeInstance((IMarkupTypeBase)instance); @@ -52,17 +52,17 @@ namespace Microsoft.Iris.Markup get { if (!this._isShared) - return (Class)null; + return null; if (this._sharedInstance == null) { this._sharedInstance = this.ConstructNewInstance(); - this._sharedInstance.DeclareOwner((object)this); - this.InitializeInstance((IMarkupTypeBase)this._sharedInstance); + this._sharedInstance.DeclareOwner(this); + this.InitializeInstance(_sharedInstance); } return this._sharedInstance; } } - protected virtual Class ConstructNewInstance() => new Class((MarkupTypeSchema)this); + protected virtual Class ConstructNewInstance() => new Class(this); } } diff --git a/UIX/Microsoft/Iris/Markup/CompiledMarkupLoadResult.cs b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoadResult.cs index 99d4a25..6cd38a5 100644 --- a/UIX/Microsoft/Iris/Markup/CompiledMarkupLoadResult.cs +++ b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoadResult.cs @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Markup { if (this._loader == null) return; - ErrorManager.EnterContext((object)this.ErrorContextUri); + ErrorManager.EnterContext(ErrorContextUri); this._loader.Depersist(currentPass); ErrorManager.ExitContext(); if (currentPass != LoadPass.Done) @@ -60,9 +60,9 @@ namespace Microsoft.Iris.Markup if (this._resource != null) { this._resource.Free(); - this._resource = (Resource)null; + this._resource = null; } - this._loader = (CompiledMarkupLoader)null; + this._loader = null; if (this.Status != LoadResultStatus.Loading) return; this.SetStatus(LoadResultStatus.Success); diff --git a/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs index 6d06596..a5dbd2c 100644 --- a/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs +++ b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Markup { foreach (MarkupTypeSchema markupTypeSchema in this._loadResultTarget.ExportTable) markupTypeSchema.Seal(); - this._reader = (ByteCodeReader)null; + this._reader = null; } foreach (LoadResult dependency in this._loadResultTarget.Dependencies) { @@ -148,7 +148,7 @@ namespace Microsoft.Iris.Markup if (this._binaryDataTable.SharedDependenciesTableWithBinaryDataTable == null) this._binaryDataTable.SharedDependenciesTableWithBinaryDataTable = new LoadResult[1] { - (LoadResult) this._binaryDataTableLoadResult + _binaryDataTableLoadResult }; this._loadResultTarget.SetDependenciesTable(this._binaryDataTable.SharedDependenciesTableWithBinaryDataTable); this._usingSharedDataTable = true; @@ -165,8 +165,8 @@ namespace Microsoft.Iris.Markup if (this._usingSharedDataTable) return; ushort num = this._reader.ReadUInt16(); - LoadResult[] dependenciesTable = new LoadResult[(int)num]; - for (ushort index = 0; (int)index < (int)num; ++index) + LoadResult[] dependenciesTable = new LoadResult[num]; + for (ushort index = 0; index < num; ++index) { this._reader.ReadBool(); string uri = this.ReadDataTableString(); @@ -176,7 +176,7 @@ namespace Microsoft.Iris.Markup this.ReportError("Import of '{0}' failed", uri); return; } - dependenciesTable[(int)index] = loadResult; + dependenciesTable[index] = loadResult; } this._loadResultTarget.SetDependenciesTable(dependenciesTable); } @@ -184,19 +184,19 @@ namespace Microsoft.Iris.Markup private void DepersistTypeExportDeclarations() { ushort num1 = this._reader.ReadUInt16(); - TypeSchema[] exportTable = new TypeSchema[(int)num1]; - for (int index = 0; index < (int)num1; ++index) + TypeSchema[] exportTable = new TypeSchema[num1]; + for (int index = 0; index < num1; ++index) { string name = this.ReadDataTableString(); - MarkupTypeSchema markupTypeSchema = MarkupTypeSchema.Build(this.MarkupTypeToDefinition((MarkupType)this._reader.ReadInt32()), (MarkupLoadResult)this._loadResultTarget, name); - exportTable[index] = (TypeSchema)markupTypeSchema; + MarkupTypeSchema markupTypeSchema = MarkupTypeSchema.Build(this.MarkupTypeToDefinition((MarkupType)this._reader.ReadInt32()), _loadResultTarget, name); + exportTable[index] = markupTypeSchema; } this._loadResultTarget.SetExportTable(exportTable); ushort num2 = this._reader.ReadUInt16(); - if (num2 <= (ushort)0) + if (num2 <= 0) return; - AliasMapping[] aliasTable = new AliasMapping[(int)num2]; - for (int index1 = 0; index1 < (int)num2; ++index1) + AliasMapping[] aliasTable = new AliasMapping[num2]; + for (int index1 = 0; index1 < num2; ++index1) { string alias = this.ReadDataTableString(); ushort index2 = this._reader.ReadUInt16(); @@ -214,10 +214,10 @@ namespace Microsoft.Iris.Markup MarkupImportTables importTables = new MarkupImportTables(); this._loadResultTarget.BinaryDataTable.SetImportTables(importTables); ushort num = this._reader.ReadUInt16(); - if (num <= (ushort)0) + if (num <= 0) return; - TypeSchema[] typeSchemaArray = new TypeSchema[(int)num]; - for (ushort index = 0; (int)index < (int)num; ++index) + TypeSchema[] typeSchemaArray = new TypeSchema[num]; + for (ushort index = 0; index < num; ++index) { LoadResult dependent = this.MapIndexToDependent(this._reader.ReadUInt16()); string name = this.ReadDataTableString(); @@ -225,7 +225,7 @@ namespace Microsoft.Iris.Markup if (type == null) this.ReportError("Import of {0} named '{1}' from '{2}' failed", "type", name, dependent.Uri); else - typeSchemaArray[(int)index] = type; + typeSchemaArray[index] = type; } importTables.TypeImports = typeSchemaArray; } @@ -237,12 +237,12 @@ namespace Microsoft.Iris.Markup { MarkupType markupType = markupTypeSchema.MarkupType; TypeSchema definition = this.MarkupTypeToDefinition(markupType); - uint typeDepth = (uint)this._reader.ReadUInt16(); + uint typeDepth = this._reader.ReadUInt16(); markupTypeSchema.SetTypeDepth(typeDepth); if (typeDepth > 1U) { ushort num = this._reader.ReadUInt16(); - TypeSchema typeSchema = typeImports[(int)num]; + TypeSchema typeSchema = typeImports[num]; markupTypeSchema.SetBaseType((MarkupTypeSchema)typeSchema); } uint offset1 = this._reader.ReadUInt32(); @@ -260,7 +260,7 @@ namespace Microsoft.Iris.Markup if (num1 > 0U) { SymbolReference[] symbolTable = new SymbolReference[num1]; - for (int index = 0; (long)index < (long)num1; ++index) + for (int index = 0; index < num1; ++index) { SymbolReference symbolReference = new SymbolReference(this.ReadDataTableString(), (SymbolOrigin)this._reader.ReadByte()); symbolTable[index] = symbolReference; @@ -273,10 +273,10 @@ namespace Microsoft.Iris.Markup if (markupType == MarkupType.UI) { ushort num2 = this._reader.ReadUInt16(); - if (num2 > (ushort)0) + if (num2 > 0) { - NamedContentRecord[] namedContentTable = new NamedContentRecord[(int)num2]; - for (int index = 0; index < (int)num2; ++index) + NamedContentRecord[] namedContentTable = new NamedContentRecord[num2]; + for (int index = 0; index < num2; ++index) { string name = this.ReadDataTableString(); uint offset4 = this._reader.ReadUInt32(); @@ -308,27 +308,27 @@ namespace Microsoft.Iris.Markup } } ushort num3 = this._reader.ReadUInt16(); - if (num3 > (ushort)0) + if (num3 > 0) { - PropertySchema[] properties = new PropertySchema[(int)num3]; - for (int index1 = 0; index1 < (int)num3; ++index1) + PropertySchema[] properties = new PropertySchema[num3]; + for (int index1 = 0; index1 < num3; ++index1) { string name = this.ReadDataTableString(); bool requiredForCreation = this._reader.ReadBool(); bool flag = this._reader.ReadBool(); - PropertyOverrideCriteriaTypeConstraint criteriaTypeConstraint = (PropertyOverrideCriteriaTypeConstraint)null; + PropertyOverrideCriteriaTypeConstraint criteriaTypeConstraint = null; if (flag) { ushort num2 = this._reader.ReadUInt16(); ushort num4 = this._reader.ReadUInt16(); - TypeSchema constraint = typeImports[(int)num2]; - criteriaTypeConstraint = new PropertyOverrideCriteriaTypeConstraint(typeImports[(int)num4], constraint); + TypeSchema constraint = typeImports[num2]; + criteriaTypeConstraint = new PropertyOverrideCriteriaTypeConstraint(typeImports[num4], constraint); } ushort num5 = this._reader.ReadUInt16(); - TypeSchema propertyType = typeImports[(int)num5]; + TypeSchema propertyType = typeImports[num5]; MarkupPropertySchema markupPropertySchema = MarkupPropertySchema.Build(definition, markupTypeSchema, name, propertyType); markupPropertySchema.SetRequiredForCreation(requiredForCreation); - markupPropertySchema.SetOverrideCriteria((PropertyOverrideCriteria)criteriaTypeConstraint); + markupPropertySchema.SetOverrideCriteria(criteriaTypeConstraint); if (markupType == MarkupType.DataType) { MarkupDataTypePropertySchema typePropertySchema = (MarkupDataTypePropertySchema)markupPropertySchema; @@ -346,7 +346,7 @@ namespace Microsoft.Iris.Markup if (index2 != ushort.MaxValue) queryPropertySchema.SetUnderlyingCollectionType(this.MapIndexToType(index2)); } - properties[index1] = (PropertySchema)markupPropertySchema; + properties[index1] = markupPropertySchema; } markupTypeSchema.SetPropertyList(properties); } @@ -367,21 +367,21 @@ namespace Microsoft.Iris.Markup return; MarkupImportTables importTables = this._loadResultTarget.ImportTables; ushort num1 = this._reader.ReadUInt16(); - if (num1 > (ushort)0) + if (num1 > 0) { - ConstructorSchema[] constructorSchemaArray = new ConstructorSchema[(int)num1]; - for (int index1 = 0; index1 < (int)num1; ++index1) + ConstructorSchema[] constructorSchemaArray = new ConstructorSchema[num1]; + for (int index1 = 0; index1 < num1; ++index1) { TypeSchema type = this.MapIndexToType(this._reader.ReadUInt16()); ushort num2 = this._reader.ReadUInt16(); TypeSchema[] parameters = TypeSchema.EmptyList; - if (num2 > (ushort)0) + if (num2 > 0) { - parameters = this.GetTempParameterArray((int)num2); - for (ushort index2 = 0; (int)index2 < (int)num2; ++index2) + parameters = this.GetTempParameterArray(num2); + for (ushort index2 = 0; index2 < num2; ++index2) { ushort index3 = this._reader.ReadUInt16(); - parameters[(int)index2] = this.MapIndexToType(index3); + parameters[index2] = this.MapIndexToType(index3); } } ConstructorSchema constructor = type.FindConstructor(parameters); @@ -393,10 +393,10 @@ namespace Microsoft.Iris.Markup importTables.ConstructorImports = constructorSchemaArray; } ushort num3 = this._reader.ReadUInt16(); - if (num3 > (ushort)0) + if (num3 > 0) { - PropertySchema[] propertySchemaArray = new PropertySchema[(int)num3]; - for (int index = 0; index < (int)num3; ++index) + PropertySchema[] propertySchemaArray = new PropertySchema[num3]; + for (int index = 0; index < num3; ++index) { TypeSchema type = this.MapIndexToType(this._reader.ReadUInt16()); string name = this.ReadDataTableString(); @@ -409,25 +409,25 @@ namespace Microsoft.Iris.Markup importTables.PropertyImports = propertySchemaArray; } ushort num4 = this._reader.ReadUInt16(); - if (num4 > (ushort)0) + if (num4 > 0) { - MethodSchema[] methodSchemaArray = new MethodSchema[(int)num4]; - for (int index1 = 0; index1 < (int)num4; ++index1) + MethodSchema[] methodSchemaArray = new MethodSchema[num4]; + for (int index1 = 0; index1 < num4; ++index1) { - MethodSchema methodSchema = (MethodSchema)null; + MethodSchema methodSchema = null; TypeSchema type = this.MapIndexToType(this._reader.ReadUInt16()); if (!this._reader.ReadBool()) { string name = this.ReadDataTableString(); ushort num2 = this._reader.ReadUInt16(); TypeSchema[] parameters = TypeSchema.EmptyList; - if (num2 > (ushort)0) + if (num2 > 0) { - parameters = this.GetTempParameterArray((int)num2); - for (ushort index2 = 0; (int)index2 < (int)num2; ++index2) + parameters = this.GetTempParameterArray(num2); + for (ushort index2 = 0; index2 < num2; ++index2) { ushort index3 = this._reader.ReadUInt16(); - parameters[(int)index2] = this.MapIndexToType(index3); + parameters[index2] = this.MapIndexToType(index3); } } methodSchema = type.FindMethod(name, parameters); @@ -443,7 +443,7 @@ namespace Microsoft.Iris.Markup { if (virtualMethod.VirtualId == num2) { - methodSchema = (MethodSchema)virtualMethod; + methodSchema = virtualMethod; break; } } @@ -456,10 +456,10 @@ namespace Microsoft.Iris.Markup importTables.MethodImports = methodSchemaArray; } ushort num5 = this._reader.ReadUInt16(); - if (num5 <= (ushort)0) + if (num5 <= 0) return; - EventSchema[] eventSchemaArray = new EventSchema[(int)num5]; - for (int index = 0; index < (int)num5; ++index) + EventSchema[] eventSchemaArray = new EventSchema[num5]; + for (int index = 0; index < num5; ++index) { TypeSchema type = this.MapIndexToType(this._reader.ReadUInt16()); string name = this.ReadDataTableString(); @@ -475,24 +475,24 @@ namespace Microsoft.Iris.Markup private void DepersistDataMappingsTable() { ushort num1 = this._reader.ReadUInt16(); - if (num1 <= (ushort)0) + if (num1 <= 0) return; - MarkupDataMapping[] dataMappingsTable = new MarkupDataMapping[(int)num1]; - for (int index1 = 0; index1 < (int)num1; ++index1) + MarkupDataMapping[] dataMappingsTable = new MarkupDataMapping[num1]; + for (int index1 = 0; index1 < num1; ++index1) { - MarkupDataMapping markupDataMapping = new MarkupDataMapping((string)null); + MarkupDataMapping markupDataMapping = new MarkupDataMapping(null); ushort index2 = this._reader.ReadUInt16(); markupDataMapping.TargetType = (MarkupDataTypeSchema)this.MapIndexToType(index2); markupDataMapping.Provider = this.ReadDataTableString(); ushort num2 = this._reader.ReadUInt16(); - markupDataMapping.Mappings = new MarkupDataMappingEntry[(int)num2]; - for (int index3 = 0; index3 < (int)num2; ++index3) + markupDataMapping.Mappings = new MarkupDataMappingEntry[num2]; + for (int index3 = 0; index3 < num2; ++index3) { MarkupDataMappingEntry dataMappingEntry = new MarkupDataMappingEntry(); dataMappingEntry.Source = this.ReadDataTableString(); dataMappingEntry.Target = this.ReadDataTableString(); ushort num3 = this._reader.ReadUInt16(); - dataMappingEntry.Property = (MarkupDataTypePropertySchema)this._loadResultTarget.ImportTables.PropertyImports[(int)num3]; + dataMappingEntry.Property = (MarkupDataTypePropertySchema)this._loadResultTarget.ImportTables.PropertyImports[num3]; dataMappingEntry.DefaultValue = !this._reader.ReadBool() ? MarkupDataProvider.GetDefaultValueForType(dataMappingEntry.Property.PropertyType) : dataMappingEntry.Property.PropertyType.DecodeBinary(this._reader); markupDataMapping.Mappings[index3] = dataMappingEntry; } @@ -522,13 +522,13 @@ namespace Microsoft.Iris.Markup if (num2 > 0U) { symbolTable = new SymbolRecord[num2]; - for (int index = 0; (long)index < (long)num2; ++index) + for (int index = 0; index < num2; ++index) { SymbolRecord symbolRecord = new SymbolRecord(); symbolRecord.Name = CompiledMarkupLoader.ReadDataTableString(reader, binaryDataTable); symbolRecord.SymbolOrigin = (SymbolOrigin)reader.ReadByte(); ushort num3 = reader.ReadUInt16(); - symbolRecord.Type = owner.ImportTables.TypeImports[(int)num3]; + symbolRecord.Type = owner.ImportTables.TypeImports[num3]; symbolTable[index] = symbolRecord; } } @@ -551,23 +551,23 @@ namespace Microsoft.Iris.Markup private void DepersistConstantsTable() { ushort num = this._reader.ReadUInt16(); - if (num <= (ushort)0) + if (num <= 0) return; - object[] runtimeList = new object[(int)num]; + object[] runtimeList = new object[num]; MarkupConstantsTable constantsTable = new MarkupConstantsTable(runtimeList); if (!this._reader.IsInFixedMemory) { - this._reader.CurrentOffset += (uint)(((int)num + 1) * 4); - for (int index = 0; index < (int)num; ++index) + this._reader.CurrentOffset += (uint)((num + 1) * 4); + for (int index = 0; index < num; ++index) { - object obj = CompiledMarkupLoader.DepersistConstant(this._reader, (MarkupLoadResult)this._loadResultTarget); + object obj = CompiledMarkupLoader.DepersistConstant(this._reader, _loadResultTarget); runtimeList[index] = obj; } } else { - ByteCodeReader constantsTableReader = new ByteCodeReader(this._reader.CurrentAddress, ByteCodeReader.ReadUInt32(this._reader.GetAddress(this._reader.CurrentOffset + (uint)num * 4U)), false); - constantsTable.SetConstantsTableReader(constantsTableReader, (MarkupLoadResult)this._loadResultTarget); + ByteCodeReader constantsTableReader = new ByteCodeReader(this._reader.CurrentAddress, ByteCodeReader.ReadUInt32(this._reader.GetAddress(this._reader.CurrentOffset + num * 4U)), false); + constantsTable.SetConstantsTableReader(constantsTableReader, _loadResultTarget); } this._loadResultTarget.BinaryDataTable.SetConstantsTable(constantsTable); } @@ -575,9 +575,9 @@ namespace Microsoft.Iris.Markup public static object DepersistConstant(ByteCodeReader reader, MarkupLoadResult loadResult) { ushort num = reader.ReadUInt16(); - TypeSchema typeImport = loadResult.ImportTables.TypeImports[(int)num]; + TypeSchema typeImport = loadResult.ImportTables.TypeImports[num]; MarkupConstantPersistMode constantPersistMode = (MarkupConstantPersistMode)reader.ReadByte(); - object instance = (object)null; + object instance = null; switch (constantPersistMode) { case MarkupConstantPersistMode.Binary: @@ -585,7 +585,7 @@ namespace Microsoft.Iris.Markup break; case MarkupConstantPersistMode.FromString: string str = CompiledMarkupLoader.ReadDataTableString(reader, loadResult.BinaryDataTable); - typeImport.TypeConverter((object)str, (TypeSchema)StringSchema.Type, out instance); + typeImport.TypeConverter(str, StringSchema.Type, out instance); break; case MarkupConstantPersistMode.Canonical: string name = CompiledMarkupLoader.ReadDataTableString(reader, loadResult.BinaryDataTable); @@ -599,15 +599,15 @@ namespace Microsoft.Iris.Markup ByteCodeReader reader) { ushort num = reader.ReadUInt16(); - ulong[] runtimeList = new ulong[(int)num]; - for (int index = 0; index < (int)num; ++index) + ulong[] runtimeList = new ulong[num]; + for (int index = 0; index < num; ++index) runtimeList[index] = reader.ReadUInt64(); return new MarkupLineNumberTable(runtimeList); } public static MarkupLineNumberTable DecodeLineNumberTable(IntPtr address) { - uint size = (uint)((int)ByteCodeReader.ReadUInt16(address) * 12 + 2); + uint size = (uint)(ByteCodeReader.ReadUInt16(address) * 12 + 2); return CompiledMarkupLoader.DecodeLineNumberTable(new ByteCodeReader(address, size, false)); } @@ -648,7 +648,7 @@ namespace Microsoft.Iris.Markup uint currentOffset = this._reader.CurrentOffset; this._reader.CurrentOffset = binaryDataTableOffset; int stringCount = this._reader.ReadInt32(); - this._binaryDataTable = new MarkupBinaryDataTable((string)null, stringCount); + this._binaryDataTable = new MarkupBinaryDataTable(null, stringCount); if (!this._reader.IsInFixedMemory) { this._reader.CurrentOffset += (uint)((stringCount + 1) * 4); @@ -671,19 +671,19 @@ namespace Microsoft.Iris.Markup switch (index) { case 65533: - loadResult = (LoadResult)this._loadResultTarget; + loadResult = _loadResultTarget; break; case 65534: - loadResult = (LoadResult)MarkupSystem.UIXGlobal; + loadResult = MarkupSystem.UIXGlobal; break; default: - loadResult = this._binaryDataTableLoadResult == null ? this._loadResultTarget.Dependencies[(int)index] : this._binaryDataTableLoadResult.Dependencies[(int)index]; + loadResult = this._binaryDataTableLoadResult == null ? this._loadResultTarget.Dependencies[index] : this._binaryDataTableLoadResult.Dependencies[index]; break; } return loadResult; } - private TypeSchema MapIndexToType(ushort index) => this._loadResultTarget.ImportTables.TypeImports[(int)index]; + private TypeSchema MapIndexToType(ushort index) => this._loadResultTarget.ImportTables.TypeImports[index]; private string ReadDataTableString() => this._binaryDataTable.GetStringByIndex(this._reader.ReadInt32()); @@ -699,9 +699,9 @@ namespace Microsoft.Iris.Markup { uint num = this._reader.ReadUInt32(); if (num <= 0U) - return (uint[])null; + return null; uint[] numArray = new uint[num]; - for (int index = 0; (long)index < (long)num; ++index) + for (int index = 0; index < num; ++index) numArray[index] = this._reader.ReadUInt32(); return numArray; } @@ -710,9 +710,9 @@ namespace Microsoft.Iris.Markup { uint num = this._reader.ReadUInt32(); if (num <= 0U) - return (string[])null; + return null; string[] strArray = new string[num]; - for (int index = 0; (long)index < (long)num; ++index) + for (int index = 0; index < num; ++index) strArray[index] = this.ReadDataTableString(); return strArray; } @@ -721,12 +721,12 @@ namespace Microsoft.Iris.Markup TypeSchema markupTypeDefinition, MarkupTypeSchema typeExport) { - MethodSchema[] methodSchemaArray = (MethodSchema[])null; + MethodSchema[] methodSchemaArray = null; ushort num1 = this._reader.ReadUInt16(); - if (num1 > (ushort)0) + if (num1 > 0) { - methodSchemaArray = new MethodSchema[(int)num1]; - for (int index1 = 0; index1 < (int)num1; ++index1) + methodSchemaArray = new MethodSchema[num1]; + for (int index1 = 0; index1 < num1; ++index1) { string name = this.ReadDataTableString(); TypeSchema type = this.MapIndexToType(this._reader.ReadUInt16()); @@ -735,7 +735,7 @@ namespace Microsoft.Iris.Markup if (num2 > 0U) { parameterTypes = new TypeSchema[num2]; - for (int index2 = 0; (long)index2 < (long)num2; ++index2) + for (int index2 = 0; index2 < num2; ++index2) { ushort index3 = this._reader.ReadUInt16(); parameterTypes[index2] = this.MapIndexToType(index3); @@ -748,7 +748,7 @@ namespace Microsoft.Iris.Markup MarkupMethodSchema markupMethodSchema = MarkupMethodSchema.Build(markupTypeDefinition, typeExport, name, type, parameterTypes, parameterNames, isVirtualThunk); markupMethodSchema.SetCodeOffset(codeOffset); markupMethodSchema.SetVirtualId(virtualId); - methodSchemaArray[index1] = (MethodSchema)markupMethodSchema; + methodSchemaArray[index1] = markupMethodSchema; } } return methodSchemaArray; @@ -759,15 +759,15 @@ namespace Microsoft.Iris.Markup switch (markupType) { case MarkupType.UI: - return (TypeSchema)UISchema.Type; + return UISchema.Type; case MarkupType.Effect: - return (TypeSchema)EffectSchema.Type; + return EffectSchema.Type; case MarkupType.DataType: - return (TypeSchema)DataTypeSchema.Type; + return DataTypeSchema.Type; case MarkupType.DataQuery: - return (TypeSchema)DataQuerySchema.Type; + return DataQuerySchema.Type; default: - return (TypeSchema)ClassSchema.Type; + return ClassSchema.Type; } } @@ -783,11 +783,11 @@ namespace Microsoft.Iris.Markup return this._typeSchemaArrays[index]; } - public void ReportError(string error, string param0, string param1, string param2) => this.ReportError(string.Format(error, (object)param0, (object)param1, (object)param2)); + public void ReportError(string error, string param0, string param1, string param2) => this.ReportError(string.Format(error, param0, param1, param2)); - public void ReportError(string error, string param0, string param1) => this.ReportError(string.Format(error, (object)param0, (object)param1)); + public void ReportError(string error, string param0, string param1) => this.ReportError(string.Format(error, param0, param1)); - public void ReportError(string error, string param0) => this.ReportError(string.Format(error, (object)param0)); + public void ReportError(string error, string param0) => this.ReportError(string.Format(error, param0)); public void ReportError(string error) { diff --git a/UIX/Microsoft/Iris/Markup/ConstructorSchema.cs b/UIX/Microsoft/Iris/Markup/ConstructorSchema.cs index b10dab2..feef60e 100644 --- a/UIX/Microsoft/Iris/Markup/ConstructorSchema.cs +++ b/UIX/Microsoft/Iris/Markup/ConstructorSchema.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Markup public ConstructorSchema(TypeSchema owner) { this._owner = owner; - this.DeclareOwner((object)owner); + this.DeclareOwner(owner); } public TypeSchema Owner => this._owner; diff --git a/UIX/Microsoft/Iris/Markup/DelegateListener.cs b/UIX/Microsoft/Iris/Markup/DelegateListener.cs index 6c853a2..6eedcb5 100644 --- a/UIX/Microsoft/Iris/Markup/DelegateListener.cs +++ b/UIX/Microsoft/Iris/Markup/DelegateListener.cs @@ -17,13 +17,13 @@ namespace Microsoft.Iris.Markup { this._watch = watch; this._onNotify = callback; - notifier.AddListener((Listener)this); + notifier.AddListener(this); } public override void Dispose() { base.Dispose(); - this._onNotify = (DelegateListener.OnNotifyCallback)null; + this._onNotify = null; } public override void OnNotify() diff --git a/UIX/Microsoft/Iris/Markup/EffectClassTypeSchema.cs b/UIX/Microsoft/Iris/Markup/EffectClassTypeSchema.cs index 5664f40..5815c56 100644 --- a/UIX/Microsoft/Iris/Markup/EffectClassTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/EffectClassTypeSchema.cs @@ -40,20 +40,20 @@ namespace Microsoft.Iris.Markup base.OnDispose(); if (this._effectTemplate == null) return; - this._effectTemplate.UnregisterUsage((object)this); - this._effectTemplate = (IEffectTemplate)null; + this._effectTemplate.UnregisterUsage(this); + this._effectTemplate = null; } - protected override TypeSchema DefaultBase => (TypeSchema)EffectInstanceSchema.Type; + protected override TypeSchema DefaultBase => EffectInstanceSchema.Type; public override Type RuntimeType => typeof(EffectClass); - public string DefaultElementSymbol => this._defaultElementSymbolIndex >= 0 ? this.SymbolReferenceTable[this._defaultElementSymbolIndex].Symbol : (string)null; + public string DefaultElementSymbol => this._defaultElementSymbolIndex >= 0 ? this.SymbolReferenceTable[this._defaultElementSymbolIndex].Symbol : null; protected override Class ConstructNewInstance() { this.EnsureEffectTemplate(); - return (Class)new EffectClass((MarkupTypeSchema)this, this._effectTemplate); + return new EffectClass(this, this._effectTemplate); } protected override bool RunInitialEvaluates(IMarkupTypeBase scriptHost) @@ -61,7 +61,7 @@ namespace Microsoft.Iris.Markup bool flag = true; if (this._instancePropertyAssignments != null && this._templateIndexBuilt >= 0) { - ErrorManager.EnterContext((object)this); + ErrorManager.EnterContext(this); flag = this.RunInitializeScript(scriptHost, this._instancePropertyAssignments[this._templateIndexBuilt]); ErrorManager.ExitContext(); } @@ -72,18 +72,18 @@ namespace Microsoft.Iris.Markup { if (this._effectTemplate != null) return; - this._effectTemplate = UISession.Default.RenderSession.CreateEffectTemplate((object)this, this.Name); - ErrorManager.EnterContext((object)this); - Class @class = new Class((MarkupTypeSchema)this); - @class.DeclareOwner((object)this); + this._effectTemplate = UISession.Default.RenderSession.CreateEffectTemplate(this, this.Name); + ErrorManager.EnterContext(this); + Class @class = new Class(this); + @class.DeclareOwner(this); this._templateIndexBuilt = -1; for (int index = 0; index < this._techniqueOffsets.Length; ++index) { - object obj = this.RunAtOffset((IMarkupTypeBase)@class, this._techniqueOffsets[index]); + object obj = this.RunAtOffset(@class, this._techniqueOffsets[index]); if (obj == Interpreter.ScriptError) { if (!ErrorManager.IgnoringErrors) - ErrorManager.ReportWarning("Script runtime failure: Scripting errors have prevented '{0}' from properly initializing and will affect its operation", (object)this.Name); + ErrorManager.ReportWarning("Script runtime failure: Scripting errors have prevented '{0}' from properly initializing and will affect its operation", Name); } else { @@ -100,7 +100,7 @@ namespace Microsoft.Iris.Markup } } } - @class.Dispose((object)this); + @class.Dispose(this); ErrorManager.ExitContext(); } diff --git a/UIX/Microsoft/Iris/Markup/EnumSchema.cs b/UIX/Microsoft/Iris/Markup/EnumSchema.cs index 180d074..1885f02 100644 --- a/UIX/Microsoft/Iris/Markup/EnumSchema.cs +++ b/UIX/Microsoft/Iris/Markup/EnumSchema.cs @@ -45,8 +45,8 @@ namespace Microsoft.Iris.Markup this._nameToValueMap = new Map(this._names.Length); for (int index = 0; index < this._names.Length; ++index) this._nameToValueMap[this._names[index]] = this._values[index]; - this._names = (string[])null; - this._values = (int[])null; + this._names = null; + this._values = null; } [Conditional("DEBUG")] @@ -81,7 +81,7 @@ namespace Microsoft.Iris.Markup public override string AlternateName => (string)null; - public override TypeSchema Base => (TypeSchema)ObjectSchema.Type; + public override TypeSchema Base => ObjectSchema.Type; public override bool Contractual => false; @@ -114,7 +114,7 @@ namespace Microsoft.Iris.Markup public override object FindCanonicalInstance(string name) { int num; - return this.NameToValue(name, out num) ? this.EnumValueToObject(num) : (object)null; + return this.NameToValue(name, out num) ? this.EnumValueToObject(num) : null; } public bool NameToValue(string name, out int value) => this.NameToValueMap.TryGetValue(name, out value); @@ -127,7 +127,7 @@ namespace Microsoft.Iris.Markup private Result ConvertFromString(string value, out object instance) { - instance = (object)null; + instance = null; int num1 = 0; if (this._isFlags && value.IndexOf(',') >= 0) { @@ -135,12 +135,12 @@ namespace Microsoft.Iris.Markup { int num2; if (!this.NameToValue(name, out num2)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)name, (object)this._name); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", name, _name); num1 |= num2; } } else if (!this.NameToValue(value, out num1)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)value, (object)this._name); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", value, _name); instance = this.EnumValueToObject(num1); return Result.Success; } @@ -160,7 +160,7 @@ namespace Microsoft.Iris.Markup } else { - instance = (object)null; + instance = null; result = Result.Fail("Unsupported"); } return result; @@ -184,7 +184,7 @@ namespace Microsoft.Iris.Markup case OperationType.RelationalNotEquals: return BooleanBoxes.Box(!flag); default: - return (object)null; + return null; } } diff --git a/UIX/Microsoft/Iris/Markup/EventSchema.cs b/UIX/Microsoft/Iris/Markup/EventSchema.cs index bf38b65..58e9a09 100644 --- a/UIX/Microsoft/Iris/Markup/EventSchema.cs +++ b/UIX/Microsoft/Iris/Markup/EventSchema.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Markup public EventSchema(TypeSchema owner) { this._owner = owner; - this.DeclareOwner((object)owner); + this.DeclareOwner(owner); } public TypeSchema Owner => this._owner; diff --git a/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyTypeSchema.cs b/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyTypeSchema.cs index f436bcd..e10a6bc 100644 --- a/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyTypeSchema.cs @@ -14,12 +14,12 @@ namespace Microsoft.Iris.Markup private Type _constructDefaultType; public FrameworkCompatibleAssemblyTypeSchema(Type assemblyType) - : this(assemblyType, assemblyType, (Type)null, (TypeSchema)null) + : this(assemblyType, assemblyType, null, null) { } public FrameworkCompatibleAssemblyTypeSchema(Type assemblyType, Type frameworkType) - : this(assemblyType, frameworkType, (Type)null, (TypeSchema)null) + : this(assemblyType, frameworkType, null, null) { } @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Markup Type assemblyType, Type frameworkType, Type constructDefaultType) - : this(assemblyType, frameworkType, constructDefaultType, (TypeSchema)null) + : this(assemblyType, frameworkType, constructDefaultType, null) { } @@ -46,6 +46,6 @@ namespace Microsoft.Iris.Markup public override bool HasDefaultConstructor => base.HasDefaultConstructor || this._constructDefaultType != null; - public override object ConstructDefault() => base.HasDefaultConstructor ? base.ConstructDefault() : AssemblyLoadResult.WrapObject((TypeSchema)this, Activator.CreateInstance(this._constructDefaultType)); + public override object ConstructDefault() => base.HasDefaultConstructor ? base.ConstructDefault() : AssemblyLoadResult.WrapObject(this, Activator.CreateInstance(this._constructDefaultType)); } } diff --git a/UIX/Microsoft/Iris/Markup/Int32Boxes.cs b/UIX/Microsoft/Iris/Markup/Int32Boxes.cs index 41c9ea7..6128589 100644 --- a/UIX/Microsoft/Iris/Markup/Int32Boxes.cs +++ b/UIX/Microsoft/Iris/Markup/Int32Boxes.cs @@ -8,8 +8,8 @@ namespace Microsoft.Iris.Markup { internal static class Int32Boxes { - internal static object ZeroBox = (object)0; - internal static object MinValueBox = (object)int.MinValue; - internal static object MaxValueBox = (object)int.MaxValue; + internal static object ZeroBox = 0; + internal static object MinValueBox = int.MinValue; + internal static object MaxValueBox = int.MaxValue; } } diff --git a/UIX/Microsoft/Iris/Markup/Int64Boxes.cs b/UIX/Microsoft/Iris/Markup/Int64Boxes.cs index 35ee591..c462b42 100644 --- a/UIX/Microsoft/Iris/Markup/Int64Boxes.cs +++ b/UIX/Microsoft/Iris/Markup/Int64Boxes.cs @@ -8,8 +8,8 @@ namespace Microsoft.Iris.Markup { internal static class Int64Boxes { - internal static object ZeroBox = (object)0L; - internal static object MinValueBox = (object)long.MinValue; - internal static object MaxValueBox = (object)long.MaxValue; + internal static object ZeroBox = 0L; + internal static object MinValueBox = long.MinValue; + internal static object MaxValueBox = long.MaxValue; } } diff --git a/UIX/Microsoft/Iris/Markup/Interpreter.cs b/UIX/Microsoft/Iris/Markup/Interpreter.cs index 2689b3c..3ad64af 100644 --- a/UIX/Microsoft/Iris/Markup/Interpreter.cs +++ b/UIX/Microsoft/Iris/Markup/Interpreter.cs @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Markup { case OpCode.ConstructObject: { - int num = (int)reader.ReadUInt16(); + int num = reader.ReadUInt16(); TypeSchema typeSchema = importTables.TypeImports[num]; object obj = typeSchema.ConstructDefault(); Interpreter.ReportErrorOnNull(obj, "Construction", typeSchema.Name); @@ -80,7 +80,7 @@ namespace Microsoft.Iris.Markup } case OpCode.ConstructObjectIndirect: { - int num2 = (int)reader.ReadUInt16(); + int num2 = reader.ReadUInt16(); TypeSchema typeSchema2 = importTables.TypeImports[num2]; TypeSchema typeSchema3 = (TypeSchema)stack.Pop(); if (!typeSchema2.IsAssignableFrom(typeSchema3)) @@ -111,9 +111,9 @@ namespace Microsoft.Iris.Markup } case OpCode.ConstructObjectParam: { - int num3 = (int)reader.ReadUInt16(); + int num3 = reader.ReadUInt16(); TypeSchema typeSchema4 = importTables.TypeImports[num3]; - int num4 = (int)reader.ReadUInt16(); + int num4 = reader.ReadUInt16(); ConstructorSchema constructorSchema = importTables.ConstructorImports[num4]; int i = constructorSchema.ParameterTypes.Length; object[] array = Interpreter.ParameterListAllocator.Alloc(i); @@ -133,9 +133,9 @@ namespace Microsoft.Iris.Markup } case OpCode.ConstructFromString: { - int num5 = (int)reader.ReadUInt16(); + int num5 = reader.ReadUInt16(); TypeSchema typeSchema5 = importTables.TypeImports[num5]; - int index = (int)reader.ReadUInt16(); + int index = reader.ReadUInt16(); string from = (string)constantsTable.Get(index); object obj4; typeSchema5.TypeConverter(from, StringSchema.Type, out obj4); @@ -149,7 +149,7 @@ namespace Microsoft.Iris.Markup } case OpCode.ConstructFromBinary: { - int num6 = (int)reader.ReadUInt16(); + int num6 = reader.ReadUInt16(); TypeSchema typeSchema6 = importTables.TypeImports[num6]; object obj5 = typeSchema6.DecodeBinary(reader); Interpreter.ReportErrorOnNull(obj5, "Construction", typeSchema6.Name); @@ -162,7 +162,7 @@ namespace Microsoft.Iris.Markup } case OpCode.InitializeInstance: { - int num7 = (int)reader.ReadUInt16(); + int num7 = reader.ReadUInt16(); TypeSchema typeSchema7 = importTables.TypeImports[num7]; object obj6 = stack.Pop(); typeSchema7.InitializeInstance(ref obj6); @@ -187,7 +187,7 @@ namespace Microsoft.Iris.Markup } case OpCode.LookupSymbol: { - int num8 = (int)reader.ReadUInt16(); + int num8 = reader.ReadUInt16(); SymbolReference symbolRef = symbolReferenceTable[num8]; object obj8 = context.ReadSymbol(symbolRef); stack.Push(obj8); @@ -200,7 +200,7 @@ namespace Microsoft.Iris.Markup case OpCode.WriteSymbolPeek: { object value = (opCode == OpCode.WriteSymbolPeek) ? stack.Peek() : stack.Pop(); - int num9 = (int)reader.ReadUInt16(); + int num9 = reader.ReadUInt16(); SymbolReference symbolRef2 = symbolReferenceTable[num9]; context.WriteSymbol(symbolRef2, value); if (Trace.IsCategoryEnabled(TraceCategory.Markup)) @@ -210,7 +210,7 @@ namespace Microsoft.Iris.Markup } case OpCode.ClearSymbol: { - int num10 = (int)reader.ReadUInt16(); + int num10 = reader.ReadUInt16(); SymbolReference symbolRef3 = symbolReferenceTable[num10]; context.ClearSymbol(symbolRef3); if (Trace.IsCategoryEnabled(TraceCategory.Markup)) @@ -227,7 +227,7 @@ namespace Microsoft.Iris.Markup { typeSchema9 = (TypeSchema)stack.Pop(); } - int num11 = (int)reader.ReadUInt16(); + int num11 = reader.ReadUInt16(); PropertySchema propertySchema = importTables.PropertyImports[num11]; object obj9 = stack.Pop(); object obj10 = stack.Pop(); @@ -262,7 +262,7 @@ namespace Microsoft.Iris.Markup } case OpCode.PropertyListAdd: { - int propertyIndex = (int)reader.ReadUInt16(); + int propertyIndex = reader.ReadUInt16(); object value2 = stack.Pop(); object collection = Interpreter.GetCollection(stack.Peek(), importTables, propertyIndex); Interpreter.ReportErrorOnNull(collection, "List Add"); @@ -277,8 +277,8 @@ namespace Microsoft.Iris.Markup } case OpCode.PropertyDictionaryAdd: { - int propertyIndex2 = (int)reader.ReadUInt16(); - int index2 = (int)reader.ReadUInt16(); + int propertyIndex2 = reader.ReadUInt16(); + int index2 = reader.ReadUInt16(); string key = (string)constantsTable.Get(index2); object value3 = stack.Pop(); object collection2 = Interpreter.GetCollection(stack.Peek(), importTables, propertyIndex2); @@ -295,7 +295,7 @@ namespace Microsoft.Iris.Markup case OpCode.PropertyAssign: case OpCode.PropertyAssignStatic: { - int num12 = (int)reader.ReadUInt16(); + int num12 = reader.ReadUInt16(); PropertySchema propertySchema3 = importTables.PropertyImports[num12]; object instance2 = null; if (opCode == OpCode.PropertyAssign) @@ -318,7 +318,7 @@ namespace Microsoft.Iris.Markup case OpCode.PropertyGetPeek: case OpCode.PropertyGetStatic: { - int num13 = (int)reader.ReadUInt16(); + int num13 = reader.ReadUInt16(); PropertySchema propertySchema4 = importTables.PropertyImports[num13]; object instance3 = null; if (opCode != OpCode.PropertyGetStatic) @@ -346,7 +346,7 @@ namespace Microsoft.Iris.Markup case OpCode.MethodInvokePushLastParam: case OpCode.MethodInvokeStaticPushLastParam: { - int num14 = (int)reader.ReadUInt16(); + int num14 = reader.ReadUInt16(); MethodSchema methodSchema = importTables.MethodImports[num14]; int j = methodSchema.ParameterTypes.Length; object[] array2 = Interpreter.ParameterListAllocator.Alloc(j); @@ -394,7 +394,7 @@ namespace Microsoft.Iris.Markup } case OpCode.VerifyTypeCast: { - int num15 = (int)reader.ReadUInt16(); + int num15 = reader.ReadUInt16(); TypeSchema typeSchema10 = importTables.TypeImports[num15]; object obj12 = stack.Peek(); if (obj12 != null) @@ -421,9 +421,9 @@ namespace Microsoft.Iris.Markup } case OpCode.ConvertType: { - int num16 = (int)reader.ReadUInt16(); + int num16 = reader.ReadUInt16(); TypeSchema typeSchema11 = importTables.TypeImports[num16]; - int num17 = (int)reader.ReadUInt16(); + int num17 = reader.ReadUInt16(); TypeSchema fromType = importTables.TypeImports[num17]; object obj13 = stack.Pop(); Interpreter.ReportErrorOnNull(obj13, "Type Conversion", typeSchema11.Name); @@ -444,7 +444,7 @@ namespace Microsoft.Iris.Markup } case OpCode.Operation: { - int num18 = (int)reader.ReadUInt16(); + int num18 = reader.ReadUInt16(); TypeSchema typeSchema12 = importTables.TypeImports[num18]; OperationType op = (OperationType)reader.ReadByte(); object right = null; @@ -465,7 +465,7 @@ namespace Microsoft.Iris.Markup } case OpCode.IsCheck: { - int num19 = (int)reader.ReadUInt16(); + int num19 = reader.ReadUInt16(); TypeSchema typeSchema13 = importTables.TypeImports[num19]; object obj16 = stack.Pop(); bool value6 = false; @@ -481,7 +481,7 @@ namespace Microsoft.Iris.Markup } case OpCode.As: { - int num20 = (int)reader.ReadUInt16(); + int num20 = reader.ReadUInt16(); TypeSchema typeSchema14 = importTables.TypeImports[num20]; object obj17 = stack.Peek(); if (obj17 != null && !typeSchema14.IsAssignableFrom(obj17)) @@ -496,7 +496,7 @@ namespace Microsoft.Iris.Markup } case OpCode.TypeOf: { - int num21 = (int)reader.ReadUInt16(); + int num21 = reader.ReadUInt16(); TypeSchema obj18 = importTables.TypeImports[num21]; stack.Push(obj18); break; @@ -506,7 +506,7 @@ namespace Microsoft.Iris.Markup break; case OpCode.PushConstant: { - int index3 = (int)reader.ReadUInt16(); + int index3 = reader.ReadUInt16(); object obj19 = constantsTable.Get(index3); stack.Push(obj19); break; @@ -551,8 +551,8 @@ namespace Microsoft.Iris.Markup ushort propertyIndex3 = reader.ReadUInt16(); ushort index4 = reader.ReadUInt16(); uint currentOffset2 = reader.ReadUInt32(); - string key2 = (string)constantsTable.Get((int)index4); - object collection3 = Interpreter.GetCollection(stack.Peek(), importTables, (int)propertyIndex3); + string key2 = (string)constantsTable.Get(index4); + object collection3 = Interpreter.GetCollection(stack.Peek(), importTables, propertyIndex3); Interpreter.ReportErrorOnNull(collection3, "Dictionary Contains"); if (!Interpreter.ErrorsDetected(watermark, ref result, ref flag)) { @@ -593,7 +593,7 @@ namespace Microsoft.Iris.Markup } case OpCode.ConstructListenerStorage: { - int listenerCount = (int)reader.ReadUInt16(); + int listenerCount = reader.ReadUInt16(); if (instance.Listeners == null) { MarkupListeners markupListeners = new MarkupListeners(listenerCount); @@ -612,9 +612,9 @@ namespace Microsoft.Iris.Markup case OpCode.Listen: case OpCode.DestructiveListen: { - int index5 = (int)reader.ReadUInt16(); + int index5 = reader.ReadUInt16(); ListenerType listenerType = (ListenerType)reader.ReadByte(); - int num22 = (int)reader.ReadUInt16(); + int num22 = reader.ReadUInt16(); uint scriptOffset = reader.ReadUInt32(); uint refreshOffset = uint.MaxValue; if (opCode == OpCode.DestructiveListen) diff --git a/UIX/Microsoft/Iris/Markup/InterpreterContext.cs b/UIX/Microsoft/Iris/Markup/InterpreterContext.cs index 6a0bc9b..ebb0817 100644 --- a/UIX/Microsoft/Iris/Markup/InterpreterContext.cs +++ b/UIX/Microsoft/Iris/Markup/InterpreterContext.cs @@ -43,11 +43,11 @@ namespace Microsoft.Iris.Markup public object ReadSymbol(SymbolReference symbolRef) { - object obj = (object)null; + object obj = null; switch (symbolRef.Origin) { case SymbolOrigin.ScopedLocal: - this._scopedLocals.TryGetValue((object)symbolRef.Symbol, out obj); + this._scopedLocals.TryGetValue(symbolRef.Symbol, out obj); break; case SymbolOrigin.Parameter: obj = this._parameterContext.ReadParameter(symbolRef.Symbol); @@ -66,7 +66,7 @@ namespace Microsoft.Iris.Markup case SymbolOrigin.ScopedLocal: if (this._scopedLocals == null) this._scopedLocals = new Map(); - this._scopedLocals[(object)symbolRef.Symbol] = value; + this._scopedLocals[symbolRef.Symbol] = value; break; case SymbolOrigin.Parameter: this._parameterContext.WriteParameter(symbolRef.Symbol, value); @@ -81,7 +81,7 @@ namespace Microsoft.Iris.Markup { if (symbolRef.Origin != SymbolOrigin.ScopedLocal) return; - this._scopedLocals.Remove((object)symbolRef.Symbol); + this._scopedLocals.Remove(symbolRef.Symbol); } public static InterpreterContext Acquire( @@ -90,7 +90,7 @@ namespace Microsoft.Iris.Markup uint initialBytecodeOffset, ParameterContext parameterContext) { - InterpreterContext interpreterContext = (InterpreterContext)null; + InterpreterContext interpreterContext = null; if (InterpreterContext.s_cache.Count != 0) interpreterContext = (InterpreterContext)InterpreterContext.s_cache.Pop(); if (interpreterContext == null) @@ -105,14 +105,14 @@ namespace Microsoft.Iris.Markup public static void Release(InterpreterContext context) { - context._instance = (IMarkupTypeBase)null; - context._type = (MarkupTypeSchema)null; - context._loadResult = (MarkupLoadResult)null; + context._instance = null; + context._type = null; + context._loadResult = null; context._initialBytecodeOffset = 0U; - context._parameterContext = new ParameterContext((string[])null, (object[])null); + context._parameterContext = new ParameterContext(null, null); if (context._scopedLocals != null) context._scopedLocals.Clear(); - InterpreterContext.s_cache.Push((object)context); + InterpreterContext.s_cache.Push(context); } public override string ToString() @@ -120,7 +120,7 @@ namespace Microsoft.Iris.Markup int line = 0; int column = 0; ((IErrorContextSource)this).GetErrorPosition(ref line, ref column); - return string.Format("{0} ({1}, {2})", (object)((IErrorContextSource)this).GetErrorContextDescription(), (object)line, (object)column); + return string.Format("{0} ({1}, {2})", ((IErrorContextSource)this).GetErrorContextDescription(), line, column); } } } diff --git a/UIX/Microsoft/Iris/Markup/Listener.cs b/UIX/Microsoft/Iris/Markup/Listener.cs index 272226f..63851a6 100644 --- a/UIX/Microsoft/Iris/Markup/Listener.cs +++ b/UIX/Microsoft/Iris/Markup/Listener.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup public override void Dispose() { - this._watch = (string)null; + this._watch = null; base.Dispose(); } diff --git a/UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs b/UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs index dce4b3b..d1e8031 100644 --- a/UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs +++ b/UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs @@ -15,8 +15,8 @@ namespace Microsoft.Iris.Markup protected ListenerNodeBase() { - this._next = (ListenerNodeBase)null; - this._prev = (ListenerNodeBase)null; + this._next = null; + this._prev = null; } public virtual void Dispose() @@ -47,16 +47,16 @@ namespace Microsoft.Iris.Markup { if (this._prev == this._next) { - this._prev._next = (ListenerNodeBase)null; - this._prev._prev = (ListenerNodeBase)null; + this._prev._next = null; + this._prev._prev = null; } else { this._prev._next = this._next; this._next._prev = this._prev; } - this._prev = (ListenerNodeBase)null; - this._next = (ListenerNodeBase)null; + this._prev = null; + this._next = null; } [Conditional("DEBUG")] diff --git a/UIX/Microsoft/Iris/Markup/Listeners.cs b/UIX/Microsoft/Iris/Markup/Listeners.cs index 766c503..abbd262 100644 --- a/UIX/Microsoft/Iris/Markup/Listeners.cs +++ b/UIX/Microsoft/Iris/Markup/Listeners.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Markup else this._listenerList.Capacity += listenerCount; for (int index = 0; index < listenerCount; ++index) - this._listenerList.Add((Listener)null); + this._listenerList.Add(null); } protected override void OnDispose() @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Markup base.OnDispose(); for (int index = 0; index < this._listenerList.Count; ++index) this._listenerList[index]?.Dispose(); - this._listenerList = (Vector)null; + this._listenerList = null; } } } diff --git a/UIX/Microsoft/Iris/Markup/LoadResult.cs b/UIX/Microsoft/Iris/Markup/LoadResult.cs index 3bdac62..daddcb0 100644 --- a/UIX/Microsoft/Iris/Markup/LoadResult.cs +++ b/UIX/Microsoft/Iris/Markup/LoadResult.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Markup if (((int)this._islandReferences & (int)islandId) != 0) return; if (this._islandReferences == 0U) - this.RegisterUsage((object)this); + this.RegisterUsage(this); this._islandReferences |= islandId; foreach (LoadResult dependency in this.Dependencies) { @@ -56,11 +56,11 @@ namespace Microsoft.Iris.Markup } if (this._islandReferences != 0U) return; - this.UnregisterUsage((object)this); + this.UnregisterUsage(this); foreach (LoadResult dependency in this.Dependencies) { if (dependency != this) - dependency.UnregisterUsage((object)this); + dependency.UnregisterUsage(this); } } @@ -72,15 +72,15 @@ namespace Microsoft.Iris.Markup { if (dependency != this) { - dependency.RegisterUsage((object)this); + dependency.RegisterUsage(this); dependency.AddReference(this._islandReferences); } } } - public void RegisterProxyUsage() => this.RegisterUsage((object)this); + public void RegisterProxyUsage() => this.RegisterUsage(this); - public void UnregisterProxyUsage() => this.UnregisterUsage((object)this); + public void UnregisterProxyUsage() => this.UnregisterUsage(this); public virtual void Load(LoadPass pass) { @@ -106,7 +106,7 @@ namespace Microsoft.Iris.Markup { if (name.Equals(this._compilerReferenceName, StringComparison.OrdinalIgnoreCase)) return; - ErrorManager.ReportWarning("Multiple names '{0}' and '{1}' used to refer to the same entity. The first name will be used for all references to this item within compiled UIB files", (object)this._compilerReferenceName, (object)name); + ErrorManager.ReportWarning("Multiple names '{0}' and '{1}' used to refer to the same entity. The first name will be used for all references to this item within compiled UIB files", _compilerReferenceName, name); } } diff --git a/UIX/Microsoft/Iris/Markup/LoadResultCache.cs b/UIX/Microsoft/Iris/Markup/LoadResultCache.cs index 65b6572..c1a02c9 100644 --- a/UIX/Microsoft/Iris/Markup/LoadResultCache.cs +++ b/UIX/Microsoft/Iris/Markup/LoadResultCache.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Markup public static void Write(string uri, LoadResult loadResult) { LoadResultCache.s_cache[uri] = loadResult; - loadResult.RegisterUsage((object)LoadResultCache.s_cache); + loadResult.RegisterUsage(s_cache); } public static void Remove(uint islandId) @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Markup loadResult.RemoveReferenceDeep(islandId); if (loadResult.IslandReferences == 0U) { - loadResult.UnregisterUsage((object)LoadResultCache.s_cache); + loadResult.UnregisterUsage(s_cache); vector.Add(keyValuePair.Key); } } @@ -49,7 +49,7 @@ namespace Microsoft.Iris.Markup foreach (LoadResult loadResult in LoadResultCache.s_cache.Values) { loadResult.RemoveAllReferences(); - loadResult.UnregisterUsage((object)LoadResultCache.s_cache); + loadResult.UnregisterUsage(s_cache); } LoadResultCache.s_cache.Clear(); } diff --git a/UIX/Microsoft/Iris/Markup/MarkupCompiler.cs b/UIX/Microsoft/Iris/Markup/MarkupCompiler.cs index 7ca2900..6cced92 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupCompiler.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupCompiler.cs @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Markup public static bool Compile(CompilerInput[] compilands, CompilerInput dataTableCompiland) { ErrorWatermark watermark1 = ErrorManager.Watermark; - MarkupBinaryDataTable markupBinaryDataTable = (MarkupBinaryDataTable)null; + MarkupBinaryDataTable markupBinaryDataTable = null; if (dataTableCompiland.SourceFileName != null) { markupBinaryDataTable = new MarkupBinaryDataTable(dataTableCompiland.SourceFileName); @@ -44,18 +44,18 @@ namespace Microsoft.Iris.Markup foreach (CompilerInput compiland in compilands) { if (compiland.SourceFileName.IndexOf("://", StringComparison.Ordinal) != -1) - ErrorManager.ReportError("'{0}' is not a valid filename", (object)compiland.SourceFileName); + ErrorManager.ReportError($"'{compiland.SourceFileName}' is not a valid filename"); string uri = "file://" + compiland.SourceFileName; LoadResult loadResult = MarkupSystem.ResolveLoadResult(uri, MarkupSystem.RootIslandId); if (loadResult != null && loadResult.Status != LoadResultStatus.Error) { if (!(loadResult is MarkupLoadResult markupLoadResult) || !markupLoadResult.IsSource) { - ErrorManager.ReportError("'{0}' is not markup, it cannot be compiled", (object)uri); + ErrorManager.ReportError($"'{uri}' is not markup, it cannot be compiled"); } else { - vector.Add((object)loadResult); + vector.Add(loadResult); if (compiland.IdentityUri != null) loadResult.SetCompilerReferenceName(compiland.IdentityUri); if (markupBinaryDataTable != null) @@ -85,21 +85,21 @@ namespace Microsoft.Iris.Markup ErrorWatermark watermark = ErrorManager.Watermark; IntPtr invalidHandleValue = Win32Api.INVALID_HANDLE_VALUE; ByteCodeReader reader = writer.CreateReader(); - reader.DeclareOwner((object)typeof(MarkupSystem)); + reader.DeclareOwner(typeof(MarkupSystem)); IntPtr file = Win32Api.CreateFile(outputFile, 1073741824U, 0U, IntPtr.Zero, 2U, 0U, IntPtr.Zero); if (file == Win32Api.INVALID_HANDLE_VALUE) - ErrorManager.ReportError("Unable to open output file '{0}'. Error code {1}", (object)outputFile, (object)Marshal.GetLastWin32Error()); + ErrorManager.ReportError("Unable to open output file '{0}'. Error code {1}", outputFile, Marshal.GetLastWin32Error()); if (!watermark.ErrorsDetected) { long size = 0; IntPtr intPtr = reader.ToIntPtr(out size); uint lpNumberOfBytesWritten = 0; if (!Win32Api.WriteFile(file, intPtr, (uint)size, out lpNumberOfBytesWritten, IntPtr.Zero)) - ErrorManager.ReportError("An error occurred while saving data to output file '{0}'. Error code {1}", (object)outputFile, (object)Marshal.GetLastWin32Error()); + ErrorManager.ReportError("An error occurred while saving data to output file '{0}'. Error code {1}", outputFile, Marshal.GetLastWin32Error()); } if (file != Win32Api.INVALID_HANDLE_VALUE) Win32Api.CloseHandle(file); - reader?.Dispose((object)typeof(MarkupSystem)); + reader?.Dispose(typeof(MarkupSystem)); } public static ByteCodeWriter Run( @@ -154,11 +154,11 @@ namespace Microsoft.Iris.Markup } else { - this._writer.WriteString((string)null); + this._writer.WriteString(null); this._usingSharedBinaryDataTable = false; this._binaryDataTable = this._loadResult.BinaryDataTable; if (this._binaryDataTable == null) - this._binaryDataTable = new MarkupBinaryDataTable((string)null, 0); + this._binaryDataTable = new MarkupBinaryDataTable(null, 0); this._binaryDataTableSectionOffsetFixup = this._writer.DataSize; this._writer.WriteUInt32(uint.MaxValue); } @@ -266,7 +266,7 @@ namespace Microsoft.Iris.Markup if (uiClassTypeSchema.NamedContentTable != null) num4 = (ushort)uiClassTypeSchema.NamedContentTable.Length; this._writer.WriteUInt16(num4); - if (num4 != (ushort)0) + if (num4 != 0) { foreach (NamedContentRecord namedContentRecord in uiClassTypeSchema.NamedContentTable) { @@ -394,14 +394,14 @@ namespace Microsoft.Iris.Markup this._writer.WriteUInt16(this._loadResult.DataMappingsTable.Length); foreach (MarkupDataMapping markupDataMapping in this._loadResult.DataMappingsTable) { - this._writer.WriteUInt16(this.MapTypeToIndex((TypeSchema)markupDataMapping.TargetType)); + this._writer.WriteUInt16(this.MapTypeToIndex(markupDataMapping.TargetType)); this.WriteDataTableString(markupDataMapping.Provider); this._writer.WriteUInt16(markupDataMapping.Mappings.Length); foreach (MarkupDataMappingEntry mapping in markupDataMapping.Mappings) { this.WriteDataTableString(mapping.Source); this.WriteDataTableString(mapping.Target); - this._writer.WriteUInt16(this.MapPropertyToIndex((PropertySchema)mapping.Property)); + this._writer.WriteUInt16(this.MapPropertyToIndex(mapping.Property)); if (mapping.DefaultValue != null && mapping.Property.PropertyType.SupportsBinaryEncoding) { this._writer.WriteBool(true); @@ -437,7 +437,7 @@ namespace Microsoft.Iris.Markup switch (constantPersistMode) { case MarkupConstantPersistMode.Binary: - this._loadResult.ImportTables.TypeImports[(int)index].EncodeBinary(this._writer, persist.Data); + this._loadResult.ImportTables.TypeImports[index].EncodeBinary(this._writer, persist.Data); break; case MarkupConstantPersistMode.FromString: case MarkupConstantPersistMode.Canonical: @@ -497,15 +497,15 @@ namespace Microsoft.Iris.Markup return 65534; if (dependent == this._loadResult) return 65533; - int num = this._usingSharedBinaryDataTable ? this._binaryDataTable.SourceMarkupImportTables.ImportedLoadResults.IndexOf((object)dependent) : Array.IndexOf(this._loadResult.Dependencies, dependent); + int num = this._usingSharedBinaryDataTable ? this._binaryDataTable.SourceMarkupImportTables.ImportedLoadResults.IndexOf(dependent) : Array.IndexOf(this._loadResult.Dependencies, dependent); return num >= 0 ? (ushort)num : ushort.MaxValue; } private ushort MapTypeToIndex(TypeSchema type) { - for (ushort index = 0; (int)index < (int)(ushort)this._loadResult.ImportTables.TypeImports.Length; ++index) + for (ushort index = 0; index < (ushort)this._loadResult.ImportTables.TypeImports.Length; ++index) { - TypeSchema typeImport = this._loadResult.ImportTables.TypeImports[(int)index]; + TypeSchema typeImport = this._loadResult.ImportTables.TypeImports[index]; if (type == typeImport) return index; } @@ -514,9 +514,9 @@ namespace Microsoft.Iris.Markup private ushort MapPropertyToIndex(PropertySchema property) { - for (ushort index = 0; (int)index < (int)(ushort)this._loadResult.ImportTables.PropertyImports.Length; ++index) + for (ushort index = 0; index < (ushort)this._loadResult.ImportTables.PropertyImports.Length; ++index) { - PropertySchema propertyImport = this._loadResult.ImportTables.PropertyImports[(int)index]; + PropertySchema propertyImport = this._loadResult.ImportTables.PropertyImports[index]; if (property == propertyImport) return index; } @@ -525,9 +525,9 @@ namespace Microsoft.Iris.Markup private ushort MapMethodToIndex(MethodSchema method) { - for (ushort index = 0; (int)index < (int)(ushort)this._loadResult.ImportTables.MethodImports.Length; ++index) + for (ushort index = 0; index < (ushort)this._loadResult.ImportTables.MethodImports.Length; ++index) { - MethodSchema methodImport = this._loadResult.ImportTables.MethodImports[(int)index]; + MethodSchema methodImport = this._loadResult.ImportTables.MethodImports[index]; if (method == methodImport) return index; } @@ -581,7 +581,7 @@ namespace Microsoft.Iris.Markup MarkupBinaryDataTable binaryDataTable) { SourceMarkupLoadResult markupLoadResult = new SourceMarkupLoadResult(binaryDataTable.Uri); - markupLoadResult.RegisterUsage((object)markupLoadResult); + markupLoadResult.RegisterUsage(markupLoadResult); binaryDataTable.ConstantsTable.PrepareForRuntimeUse(); MarkupImportTables importTables = binaryDataTable.SourceMarkupImportTables.PrepareImportTables(); Vector importedLoadResults = binaryDataTable.SourceMarkupImportTables.ImportedLoadResults; @@ -595,8 +595,8 @@ namespace Microsoft.Iris.Markup markupLoadResult.SetLineNumberTable(new MarkupLineNumberTable()); markupLoadResult.LineNumberTable.PrepareForRuntimeUse(); markupLoadResult.SetObjectSection(new ByteCodeWriter().CreateReader()); - ByteCodeWriter byteCodeWriter = MarkupCompiler.Run((MarkupLoadResult)markupLoadResult, (MarkupBinaryDataTable)null); - markupLoadResult.UnregisterUsage((object)markupLoadResult); + ByteCodeWriter byteCodeWriter = MarkupCompiler.Run(markupLoadResult, null); + markupLoadResult.UnregisterUsage(markupLoadResult); return byteCodeWriter; } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupConstantsTable.cs b/UIX/Microsoft/Iris/Markup/MarkupConstantsTable.cs index 73af8d5..6ad91b0 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupConstantsTable.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupConstantsTable.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Markup private ByteCodeReader _constantsTableReader; private MarkupLoadResult _loadResultOwner; - public MarkupConstantsTable() => this._lookupTable = new Dictionary((IEqualityComparer)new MarkupConstantsTable.MarkupConstantEqualityComparer()); + public MarkupConstantsTable() => this._lookupTable = new Dictionary(new MarkupConstantsTable.MarkupConstantEqualityComparer()); public MarkupConstantsTable(object[] runtimeList) => this._runtimeList = runtimeList; @@ -50,8 +50,8 @@ namespace Microsoft.Iris.Markup else { key.Persist.Mode = MarkupConstantPersistMode.Binary; - key.Persist.Data = (object)null; - key.Persist.Type = (TypeSchema)null; + key.Persist.Data = null; + key.Persist.Type = null; } int count; if (!this._lookupTable.TryGetValue(key, out count)) @@ -86,7 +86,7 @@ namespace Microsoft.Iris.Markup if (MarkupSystem.CompileMode) this._persistList[keyValuePair.Value] = keyValuePair.Key.Persist; } - this._lookupTable = (Dictionary)null; + this._lookupTable = null; } public MarkupConstantPersist[] PersistList => this._persistList; diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataMapping.cs b/UIX/Microsoft/Iris/Markup/MarkupDataMapping.cs index 1949221..4dda8b8 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataMapping.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataMapping.cs @@ -40,6 +40,6 @@ namespace Microsoft.Iris.Markup set => this._assemblyDataProviderCookie = value; } - public override string ToString() => string.Format("({0}, {1})", (object)this._provider, (object)this._targetType); + public override string ToString() => string.Format("({0}, {1})", _provider, _targetType); } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataProvider.cs b/UIX/Microsoft/Iris/Markup/MarkupDataProvider.cs index 8235643..007465b 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataProvider.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataProvider.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Markup if (!MarkupDataProvider.s_mappings.ContainsKey(key)) MarkupDataProvider.s_mappings[key] = mapping; else - ErrorManager.ReportError("Data mapping already defined for type '{0}', provider '{1}'", (object)mapping.TargetType.Name, (object)mapping.Provider); + ErrorManager.ReportError("Data mapping already defined for type '{0}', provider '{1}'", mapping.TargetType.Name, mapping.Provider); } public static void RemoveDataMapping(MarkupDataMapping mapping) @@ -37,10 +37,10 @@ namespace Microsoft.Iris.Markup MarkupDataMapping markupDataMapping; if (!MarkupDataProvider.s_mappings.TryGetValue(key, out markupDataMapping)) { - markupDataMapping = new MarkupDataMapping((string)null); + markupDataMapping = new MarkupDataMapping(null); markupDataMapping.Provider = providerName; markupDataMapping.TargetType = typeSchema; - markupDataMapping.Mappings = MarkupDataProvider.FillInDefaultMappings(typeSchema, (Map)null); + markupDataMapping.Mappings = MarkupDataProvider.FillInDefaultMappings(typeSchema, null); MarkupDataProvider.s_mappings[key] = markupDataMapping; } return markupDataMapping; @@ -51,10 +51,10 @@ namespace Microsoft.Iris.Markup public static IDataProvider GetDataProvider(string providerName) { IDataProvider dataProvider; - return MarkupDataProvider.s_providers.TryGetValue(providerName, out dataProvider) ? dataProvider : (IDataProvider)null; + return MarkupDataProvider.s_providers.TryGetValue(providerName, out dataProvider) ? dataProvider : null; } - public static object GetDefaultValueForType(TypeSchema type) => type.IsNullAssignable ? (object)null : type.ConstructDefault(); + public static object GetDefaultValueForType(TypeSchema type) => type.IsNullAssignable ? null : type.ConstructDefault(); public static MarkupDataMappingEntry[] FillInDefaultMappings( MarkupDataTypeSchema targetType, diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs index f6b82d6..3266518 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs @@ -11,23 +11,23 @@ namespace Microsoft.Iris.Markup private MarkupDataQuerySchema _owner; public MarkupDataQuery(MarkupDataQuerySchema type) - : base((MarkupTypeSchema)type) + : base(type) => this._owner = type; protected void ApplyDefaultValues() { - Map map = (Map)null; + Map map = null; for (MarkupDataQuerySchema owner = this._owner; owner != null; owner = owner.Base as MarkupDataQuerySchema) { foreach (MarkupDataQueryPropertySchema property in owner.Properties) { - if (property.DefaultValue != null && (map == null || !map.ContainsKey((object)property.Name))) + if (property.DefaultValue != null && (map == null || !map.ContainsKey(property.Name))) { - object instance = (object)this; + object instance = this; property.SetValue(ref instance, property.DefaultValue); if (map == null) map = new Map(); - map[(object)property.Name] = (object)null; + map[property.Name] = null; } } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQueryPreDefinedPropertySchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQueryPreDefinedPropertySchema.cs index 7c4d764..6637626 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataQueryPreDefinedPropertySchema.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQueryPreDefinedPropertySchema.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Markup string name, GetValueHandler getValueHandler, SetValueHandler setValueHandler) - : base((MarkupTypeSchema)owner, name, propertyType) + : base(owner, name, propertyType) { this.InvalidatesQuery = false; this._getValueHandler = getValueHandler; diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQueryRefreshMethodSchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQueryRefreshMethodSchema.cs index 78f7a74..1ac5a2c 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataQueryRefreshMethodSchema.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQueryRefreshMethodSchema.cs @@ -11,7 +11,7 @@ namespace Microsoft.Iris.Markup internal class MarkupDataQueryRefreshMethodSchema : MethodSchema { public MarkupDataQueryRefreshMethodSchema(MarkupDataQuerySchema owner) - : base((TypeSchema)owner) + : base(owner) { } @@ -19,14 +19,14 @@ namespace Microsoft.Iris.Markup public override TypeSchema[] ParameterTypes => TypeSchema.EmptyList; - public override TypeSchema ReturnType => (TypeSchema)VoidSchema.Type; + public override TypeSchema ReturnType => VoidSchema.Type; public override bool IsStatic => false; public override object Invoke(object instance, object[] parameters) { ((MarkupDataQuery)instance).Refresh(); - return (object)null; + return null; } } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQuerySchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQuerySchema.cs index 314fc39..cd6e702 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataQuerySchema.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQuerySchema.cs @@ -30,11 +30,11 @@ namespace Microsoft.Iris.Markup if (this._predefinedProperties != null) { foreach (DisposableObject predefinedProperty in this._predefinedProperties) - predefinedProperty.Dispose((object)this); + predefinedProperty.Dispose(this); } if (this._refreshMethod == null) return; - this._refreshMethod.Dispose((object)this); + this._refreshMethod.Dispose(this); } public override void BuildProperties() @@ -42,16 +42,16 @@ namespace Microsoft.Iris.Markup base.BuildProperties(); this._predefinedProperties = new MarkupDataQueryPreDefinedPropertySchema[3] { - this._resultProperty = new MarkupDataQueryPreDefinedPropertySchema(this, this._resultType != null ? this._resultType : (TypeSchema) ObjectSchema.Type, "Result", new GetValueHandler(MarkupDataQuerySchema.GetResultProperty), (SetValueHandler) null), - new MarkupDataQueryPreDefinedPropertySchema(this, UIXLoadResultExports.DataQueryStatusType, "Status", new GetValueHandler(MarkupDataQuerySchema.GetStatusProperty), (SetValueHandler) null), - new MarkupDataQueryPreDefinedPropertySchema(this, (TypeSchema) BooleanSchema.Type, "Enabled", new GetValueHandler(MarkupDataQuerySchema.GetEnabledProperty), new SetValueHandler(MarkupDataQuerySchema.SetEnabledProperty)) + this._resultProperty = new MarkupDataQueryPreDefinedPropertySchema(this, this._resultType != null ? this._resultType : ObjectSchema.Type, "Result", new GetValueHandler(MarkupDataQuerySchema.GetResultProperty), null), + new MarkupDataQueryPreDefinedPropertySchema(this, UIXLoadResultExports.DataQueryStatusType, "Status", new GetValueHandler(MarkupDataQuerySchema.GetStatusProperty), null), + new MarkupDataQueryPreDefinedPropertySchema(this, BooleanSchema.Type, "Enabled", new GetValueHandler(MarkupDataQuerySchema.GetEnabledProperty), new SetValueHandler(MarkupDataQuerySchema.SetEnabledProperty)) }; this._refreshMethod = new MarkupDataQueryRefreshMethodSchema(this); } public override MarkupType MarkupType => MarkupType.DataQuery; - protected override TypeSchema DefaultBase => (TypeSchema)MarkupDataQueryInstanceSchema.Type; + protected override TypeSchema DefaultBase => MarkupDataQueryInstanceSchema.Type; public override Type RuntimeType => typeof(MarkupDataQuery); @@ -59,9 +59,9 @@ namespace Microsoft.Iris.Markup { IDataProvider dataProvider = MarkupDataProvider.GetDataProvider(this._providerName); if (dataProvider != null) - return (object)dataProvider.Build(this); - ErrorManager.ReportError("Could not find provider '{0}'; verify that it has been registered", (object)this._providerName); - return (object)null; + return dataProvider.Build(this); + ErrorManager.ReportError("Could not find provider '{0}'; verify that it has been registered", _providerName); + return null; } public override PropertySchema FindProperty(string name) @@ -74,7 +74,7 @@ namespace Microsoft.Iris.Markup return base.FindProperty(name); } - public override MethodSchema FindMethod(string name, TypeSchema[] parameters) => this._refreshMethod.Name == name && parameters.Length == 0 ? (MethodSchema)this._refreshMethod : base.FindMethod(name, parameters); + public override MethodSchema FindMethod(string name, TypeSchema[] parameters) => this._refreshMethod.Name == name && parameters.Length == 0 ? _refreshMethod : base.FindMethod(name, parameters); public string ProviderName { @@ -92,9 +92,9 @@ namespace Microsoft.Iris.Markup private static object GetResultProperty(object instance) => ((MarkupDataQuery)instance).Result; - private static object GetStatusProperty(object instance) => (object)((MarkupDataQuery)instance).Status; + private static object GetStatusProperty(object instance) => ((MarkupDataQuery)instance).Status; - private static object GetEnabledProperty(object instance) => (object)((MarkupDataQuery)instance).Enabled; + private static object GetEnabledProperty(object instance) => ((MarkupDataQuery)instance).Enabled; private static void SetEnabledProperty(ref object instance, object value) => ((MarkupDataQuery)instance).Enabled = (bool)value; } diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataType.cs b/UIX/Microsoft/Iris/Markup/MarkupDataType.cs index d3eb774..7963532 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataType.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataType.cs @@ -9,7 +9,7 @@ namespace Microsoft.Iris.Markup internal abstract class MarkupDataType : MarkupDataTypeBaseObject { public MarkupDataType(MarkupDataTypeSchema type) - : base((MarkupTypeSchema)type) + : base(type) { } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataTypeBaseObject.cs b/UIX/Microsoft/Iris/Markup/MarkupDataTypeBaseObject.cs index 8b71506..a034e78 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataTypeBaseObject.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataTypeBaseObject.cs @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Markup protected virtual bool ExternalObjectGetProperty(string propertyName, out object value) { - value = (object)null; + value = null; return false; } @@ -60,7 +60,7 @@ namespace Microsoft.Iris.Markup protected abstract IDataProviderBaseObject ExternalAssemblyObject { get; } - object AssemblyObjectProxyHelper.IAssemblyProxyObject.AssemblyObject => (object)this.ExternalAssemblyObject; + object AssemblyObjectProxyHelper.IAssemblyProxyObject.AssemblyObject => ExternalAssemblyObject; public abstract IntPtr ExternalNativeObject { get; } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataTypeSchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataTypeSchema.cs index a472a81..7391aa5 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupDataTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupDataTypeSchema.cs @@ -16,11 +16,11 @@ namespace Microsoft.Iris.Markup { } - public override object ConstructDefault() => (object)new ProviderlessMarkupDataType(this); + public override object ConstructDefault() => new ProviderlessMarkupDataType(this); public override MarkupType MarkupType => MarkupType.DataType; - protected override TypeSchema DefaultBase => (TypeSchema)MarkupDataTypeInstanceSchema.Type; + protected override TypeSchema DefaultBase => MarkupDataTypeInstanceSchema.Type; public override Type RuntimeType => typeof(MarkupDataType); } diff --git a/UIX/Microsoft/Iris/Markup/MarkupEncoder.cs b/UIX/Microsoft/Iris/Markup/MarkupEncoder.cs index eaeef19..5b507bc 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupEncoder.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupEncoder.cs @@ -41,16 +41,16 @@ namespace Microsoft.Iris.Markup this.EncodeClass(parseResult.ClassList[index]); } ByteCodeReader reader = this._writer.CreateReader(); - this._writer = (ByteCodeWriter)null; + this._writer = null; return reader; } private void EncodeClass(ValidateClass cls) { - ValidateUI ui = (ValidateUI)null; + ValidateUI ui = null; if (cls.ObjectType == UISchema.Type) ui = (ValidateUI)cls; - ValidateEffect validateEffect = (ValidateEffect)null; + ValidateEffect validateEffect = null; if (cls.ObjectType == EffectSchema.Type) validateEffect = (ValidateEffect)cls; if (cls.IndirectedObject == null) @@ -149,7 +149,7 @@ namespace Microsoft.Iris.Markup this._writer.WriteUInt16(typeIndex); } - private void EncodeInitializeProperty(ValidateProperty property) => this.EncodeInitializeProperty(property, (ValidateObject)null); + private void EncodeInitializeProperty(ValidateProperty property) => this.EncodeInitializeProperty(property, null); private void EncodeInitializeProperty( ValidateProperty property, @@ -160,7 +160,7 @@ namespace Microsoft.Iris.Markup if (property.ValueApplyMode == ValueApplyMode.SingleValueSet) { this.EncodeObjectBySource(property.Value); - this.RecordLineNumber((Validate)property); + this.RecordLineNumber(property); if (dynamicConstructionType == null) { this._writer.WriteByte(OpCode.PropertyInitialize); @@ -189,7 +189,7 @@ namespace Microsoft.Iris.Markup { this._writer.WriteByte(OpCode.JumpIfDictionaryContains); this._writer.WriteUInt16((property.ValueApplyMode & ValueApplyMode.CollectionAdd) != ValueApplyMode.SingleValueSet ? property.FoundPropertyIndex : -1); - this._writer.WriteUInt16(this._constantsTable.Add((TypeSchema)StringSchema.Type, (object)next.Name, MarkupConstantPersistMode.Binary)); + this._writer.WriteUInt16(this._constantsTable.Add(StringSchema.Type, next.Name, MarkupConstantPersistMode.Binary)); fixUpLocation = this.GetOffset(); this._writer.WriteUInt32(uint.MaxValue); } @@ -198,7 +198,7 @@ namespace Microsoft.Iris.Markup { this._writer.WriteByte(OpCode.PropertyDictionaryAdd); this._writer.WriteUInt16((property.ValueApplyMode & ValueApplyMode.CollectionAdd) != ValueApplyMode.SingleValueSet ? property.FoundPropertyIndex : -1); - this._writer.WriteUInt16(this._constantsTable.Add((TypeSchema)StringSchema.Type, (object)next.Name, MarkupConstantPersistMode.Binary)); + this._writer.WriteUInt16(this._constantsTable.Add(StringSchema.Type, next.Name, MarkupConstantPersistMode.Binary)); } else { @@ -219,7 +219,7 @@ namespace Microsoft.Iris.Markup else { this.EncodeObjectBySource(dynamicConstructionType); - this.RecordLineNumber((Validate)property); + this.RecordLineNumber(property); this._writer.WriteByte(OpCode.PropertyInitializeIndirect); this._writer.WriteUInt16(property.FoundPropertyIndex); } @@ -240,7 +240,7 @@ namespace Microsoft.Iris.Markup this.EncodeCode((ValidateCode)obj); break; case ObjectSourceType.Expression: - this.EncodeExpression((ValidateExpression)obj, (ListenerEncodeMode)null); + this.EncodeExpression((ValidateExpression)obj, null); break; } } @@ -259,7 +259,7 @@ namespace Microsoft.Iris.Markup else { persistMode = MarkupConstantPersistMode.FromString; - persistData = (object)fromString.FromString; + persistData = fromString.FromString; } int rawValue = this._constantsTable.Add(fromString.ObjectType, fromString.FromStringInstance, persistMode, persistData); this._writer.WriteByte(OpCode.PushConstant); @@ -273,7 +273,7 @@ namespace Microsoft.Iris.Markup } else { - int rawValue = this._constantsTable.Add((TypeSchema)StringSchema.Type, (object)fromString.FromString, MarkupConstantPersistMode.FromString); + int rawValue = this._constantsTable.Add(StringSchema.Type, fromString.FromString, MarkupConstantPersistMode.FromString); this._writer.WriteByte(OpCode.ConstructFromString); this._writer.WriteUInt16(fromString.TypeHintIndex); this._writer.WriteUInt16(rawValue); @@ -282,7 +282,7 @@ namespace Microsoft.Iris.Markup private void EncodeCanonicalInstance(object instance, TypeSchema type, string memberName) { - int rawValue = this._constantsTable.Add(type, instance, MarkupConstantPersistMode.Canonical, (object)memberName); + int rawValue = this._constantsTable.Add(type, instance, MarkupConstantPersistMode.Canonical, memberName); this._writer.WriteByte(OpCode.PushConstant); this._writer.WriteUInt16(rawValue); } @@ -307,7 +307,7 @@ namespace Microsoft.Iris.Markup { uint offset = this.GetOffset(); code.TrackEncodingOffset(offset); - this.EncodeStatement((ValidateStatement)code.StatementCompound); + this.EncodeStatement(code.StatementCompound); if (code.ReturnStatements != null) { foreach (ValidateStatementReturn returnStatement in code.ReturnStatements) @@ -326,7 +326,7 @@ namespace Microsoft.Iris.Markup private void EncodeStatement(ValidateStatement statement) { - this.RecordLineNumber((Validate)statement); + this.RecordLineNumber(statement); if (statement.StatementType != StatementType.Compound) this.DeclareDebugPoint(statement.Line, statement.Column); switch (statement.StatementType) @@ -334,7 +334,7 @@ namespace Microsoft.Iris.Markup case StatementType.Assignment: ValidateStatementAssignment statementAssignment = (ValidateStatementAssignment)statement; if (statementAssignment.DeclaredScopedLocal != null) - this.EncodeStatement((ValidateStatement)statementAssignment.DeclaredScopedLocal); + this.EncodeStatement(statementAssignment.DeclaredScopedLocal); this.EncodeExpression(statementAssignment.RValue); this.EncodeExpression(statementAssignment.LValue); this._writer.WriteByte(OpCode.DiscardValue); @@ -364,7 +364,7 @@ namespace Microsoft.Iris.Markup this._writer.WriteUInt16(statementForEach.ScopedLocal.FoundTypeIndex); this._writer.WriteByte(OpCode.WriteSymbol); this._writer.WriteUInt16(statementForEach.ScopedLocal.FoundSymbolIndex); - this.EncodeStatement((ValidateStatement)statementForEach.StatementCompound); + this.EncodeStatement(statementForEach.StatementCompound); this._writer.WriteByte(OpCode.Jump); this._writer.WriteUInt32(offset1); this.FixUpJumpOffset(offset2); @@ -408,7 +408,7 @@ namespace Microsoft.Iris.Markup this._writer.WriteByte(OpCode.JumpIfFalse); uint offset7 = this.GetOffset(); this._writer.WriteUInt32(uint.MaxValue); - this.EncodeStatement((ValidateStatement)validateStatementIf.StatementCompound); + this.EncodeStatement(validateStatementIf.StatementCompound); this.FixUpJumpOffset(offset7); break; case StatementType.IfElse: @@ -457,13 +457,13 @@ namespace Microsoft.Iris.Markup } } - private void EncodeExpression(ValidateExpression expression) => this.EncodeExpression(expression, (ListenerEncodeMode)null); + private void EncodeExpression(ValidateExpression expression) => this.EncodeExpression(expression, null); private void EncodeExpression( ValidateExpression expression, ListenerEncodeMode listenerEncodeMode) { - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); expression.TrackEncodingOffset(this.GetOffset()); switch (expression.ExpressionType) { @@ -506,7 +506,7 @@ namespace Microsoft.Iris.Markup if (!flag3) return; OpCode opCode = validateExpressionCall.Usage != ExpressionUsage.RValue ? (flag2 ? OpCode.PropertyAssign : OpCode.PropertyAssignStatic) : (flag2 ? OpCode.PropertyGet : OpCode.PropertyGetStatic); - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); this._writer.WriteByte(opCode); this._writer.WriteUInt16(validateExpressionCall.FoundMemberIndex); return; @@ -516,7 +516,7 @@ namespace Microsoft.Iris.Markup for (ValidateParameter validateParameter = validateExpressionCall.ParameterList; validateParameter != null; validateParameter = validateParameter.Next) this.EncodeExpression(validateParameter.Expression); } - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); this._writer.WriteByte(validateExpressionCall.IsIndexAssignment ? (flag2 ? OpCode.MethodInvokePushLastParam : OpCode.MethodInvokeStaticPushLastParam) : (flag2 ? OpCode.MethodInvoke : OpCode.MethodInvokeStatic)); this._writer.WriteUInt16(validateExpressionCall.FoundMemberIndex); return; @@ -534,7 +534,7 @@ namespace Microsoft.Iris.Markup case ExpressionType.Cast: ValidateExpressionCast validateExpressionCast = (ValidateExpressionCast)expression; this.EncodeExpression(validateExpressionCast.Castee, listenerEncodeMode); - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); if (validateExpressionCast.FoundCastMethod == CastMethod.Cast) { this._writer.WriteByte(OpCode.VerifyTypeCast); @@ -556,7 +556,7 @@ namespace Microsoft.Iris.Markup { for (ValidateParameter validateParameter = validateExpressionNew.ParameterList; validateParameter != null; validateParameter = validateParameter.Next) this.EncodeExpression(validateParameter.Expression); - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); this._writer.WriteByte(OpCode.ConstructObjectParam); this._writer.WriteUInt16(validateExpressionNew.FoundConstructTypeIndex); this._writer.WriteUInt16(validateExpressionNew.FoundParameterizedConstructorIndex); @@ -569,14 +569,14 @@ namespace Microsoft.Iris.Markup uint fixUpLocation = uint.MaxValue; if (expressionOperation.FoundOperationTargetType == BooleanSchema.Type && (expressionOperation.Op == OperationType.LogicalAnd || expressionOperation.Op == OperationType.LogicalOr)) { - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); this._writer.WriteByte(expressionOperation.Op == OperationType.LogicalOr ? OpCode.JumpIfTruePeek : OpCode.JumpIfFalsePeek); fixUpLocation = this.GetOffset(); this._writer.WriteUInt32(uint.MaxValue); } if (expressionOperation.RightSide != null) this.EncodeExpression(expressionOperation.RightSide); - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); this._writer.WriteByte(OpCode.Operation); this._writer.WriteUInt16(expressionOperation.FoundOperationTargetTypeIndex); this._writer.WriteByte((byte)expressionOperation.Op); @@ -587,14 +587,14 @@ namespace Microsoft.Iris.Markup case ExpressionType.IsCheck: ValidateExpressionIsCheck expressionIsCheck = (ValidateExpressionIsCheck)expression; this.EncodeExpression(expressionIsCheck.Expression); - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); this._writer.WriteByte(OpCode.IsCheck); this._writer.WriteUInt16(expressionIsCheck.TypeIdentifier.FoundTypeIndex); break; case ExpressionType.As: ValidateExpressionAs validateExpressionAs = (ValidateExpressionAs)expression; this.EncodeExpression(validateExpressionAs.Expression); - this.RecordLineNumber((Validate)expression); + this.RecordLineNumber(expression); this._writer.WriteByte(OpCode.As); this._writer.WriteUInt16(validateExpressionAs.TypeIdentifier.FoundTypeIndex); break; @@ -756,7 +756,7 @@ namespace Microsoft.Iris.Markup { listenerEncodeMode.TriggerContainer = triggerRecord; this.EncodeExpression(triggerRecord.SourceExpression, listenerEncodeMode); - this._writer.WriteByte((byte)37); + this._writer.WriteByte(37); } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupError.cs b/UIX/Microsoft/Iris/Markup/MarkupError.cs index 9e4babc..e61aa5f 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupError.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupError.cs @@ -20,9 +20,9 @@ namespace Microsoft.Iris.Markup if (this._context == null || error.Line == -1) return; if (error.Column != -1) - this._context = string.Format("{0} ({1},{2})", (object)this._context, (object)error.Line, (object)error.Column); + this._context = string.Format("{0} ({1},{2})", _context, error.Line, error.Column); else - this._context = string.Format("{0} ({1})", (object)this._context, (object)error.Line); + this._context = string.Format("{0} ({1})", _context, error.Line); } public bool IsError => !this._error.Warning; diff --git a/UIX/Microsoft/Iris/Markup/MarkupLineNumberTable.cs b/UIX/Microsoft/Iris/Markup/MarkupLineNumberTable.cs index e7473fc..e99bb28 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupLineNumberTable.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupLineNumberTable.cs @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Markup this._runtimeList = new ulong[this._lookupTable.Count]; for (int index = 0; index < this._lookupTable.Count; ++index) this._runtimeList[index] = this._lookupTable[index]; - this._lookupTable = (Vector)null; + this._lookupTable = null; } public void Lookup(uint offset, out int line, out int column) @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Markup { } - private static ulong Pack(uint offset, int line, int column) => (ulong)((long)offset | (long)line << 22 | (long)column << 43); + private static ulong Pack(uint offset, int line, int column) => (ulong)(offset | (long)line << 22 | (long)column << 43); private static uint UnpackOffset(ulong value) => (uint)(value & 4194303UL); diff --git a/UIX/Microsoft/Iris/Markup/MarkupListener.cs b/UIX/Microsoft/Iris/Markup/MarkupListener.cs index 432bec7..a8ecb8f 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupListener.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupListener.cs @@ -25,12 +25,12 @@ namespace Microsoft.Iris.Markup this._scriptHost = scriptHost; this._scriptId = scriptId; this._watch = NotifyService.CanonicalizeString(this._watch); - notifier.AddListener((Listener)this); + notifier.AddListener(this); } public override void Dispose() { - this._scriptHost = (IMarkupTypeBase)null; + this._scriptHost = null; this._scriptId = uint.MaxValue; base.Dispose(); } @@ -45,6 +45,6 @@ namespace Microsoft.Iris.Markup this._scriptHost.ScheduleScriptRun(this._scriptId, false); } - public override string ToString() => string.Format("{0}{4}: {1}->0x{2:X8} on '{3}'", (object)this.GetType().Name, (object)this._watch, (object)this._scriptId, (object)this._scriptHost, (object)""); + public override string ToString() => string.Format("{0}{4}: {1}->0x{2:X8} on '{3}'", this.GetType().Name, _watch, _scriptId, _scriptHost, ""); } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupListeners.cs b/UIX/Microsoft/Iris/Markup/MarkupListeners.cs index ff9f1f6..cfa9c18 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupListeners.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupListeners.cs @@ -36,10 +36,10 @@ namespace Microsoft.Iris.Markup else { if (markupListener == null) - markupListener = (MarkupListener)new DestructiveListener(); + markupListener = new DestructiveListener(); ((DestructiveListener)markupListener).Reset(notifier, watch, scriptHost, scriptOffset, refreshOffset); } - this._listenerList[index] = (Listener)markupListener; + this._listenerList[index] = markupListener; } } } diff --git a/UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs b/UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs index 385ca80..e77e060 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs @@ -22,7 +22,7 @@ namespace Microsoft.Iris.Markup private MarkupDataMapping[] _dataMappingsTable; private LoadResultStatus _status; - public static LoadResult Create(string uri, Resource resource) => !CompiledMarkupLoader.IsUIB(resource) ? (LoadResult)new SourceMarkupLoadResult(resource, uri) : (LoadResult)new CompiledMarkupLoadResult(resource, uri); + public static LoadResult Create(string uri, Resource resource) => !CompiledMarkupLoader.IsUIB(resource) ? new SourceMarkupLoadResult(resource, uri) : (LoadResult)new CompiledMarkupLoadResult(resource, uri); public MarkupLoadResult(string uri) : base(uri) @@ -45,10 +45,10 @@ namespace Microsoft.Iris.Markup MarkupDataProvider.RemoveDataMapping(mapping); } if (this._reader != null) - this._reader.Dispose((object)this); + this._reader.Dispose(this); foreach (DisposableObject disposableObject in this._exportTable) - disposableObject.Dispose((object)this); - this._exportTable = (TypeSchema[])null; + disposableObject.Dispose(this); + this._exportTable = null; } public override TypeSchema FindType(string name) @@ -72,7 +72,7 @@ namespace Microsoft.Iris.Markup return typeSchema; } TypeSchema typeSchema1; - return this._resolvedAliases != null && this._resolvedAliases.TryGetValue(name, out typeSchema1) ? typeSchema1 : (TypeSchema)null; + return this._resolvedAliases != null && this._resolvedAliases.TryGetValue(name, out typeSchema1) ? typeSchema1 : null; } private TypeSchema ResolveAlias(string name) @@ -81,7 +81,7 @@ namespace Microsoft.Iris.Markup var markupLoadResult = this; while (num-- > 0) { - AliasMapping aliasMapping1 = (AliasMapping)null; + AliasMapping aliasMapping1 = null; if (markupLoadResult._aliasTable != null) { foreach (AliasMapping aliasMapping2 in markupLoadResult._aliasTable) @@ -107,8 +107,8 @@ namespace Microsoft.Iris.Markup break; } if (num <= 0) - ErrorManager.ReportError("Alias cycle detected: {0} {1}", (object)this.ToString(), (object)name); - return (TypeSchema)null; + ErrorManager.ReportError("Alias cycle detected: {0} {1}", this.ToString(), name); + return null; } public abstract bool IsSource { get; } @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Markup public void SetObjectSection(ByteCodeReader reader) { - reader.DeclareOwner((object)this); + reader.DeclareOwner(this); this._reader = reader; } diff --git a/UIX/Microsoft/Iris/Markup/MarkupMethodSchema.cs b/UIX/Microsoft/Iris/Markup/MarkupMethodSchema.cs index bc1bddc..a7a12c5 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupMethodSchema.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupMethodSchema.cs @@ -29,11 +29,11 @@ namespace Microsoft.Iris.Markup string[] parameterNames, bool isVirtualThunk) { - MarkupMethodSchema markupMethodSchema = (MarkupMethodSchema)null; + MarkupMethodSchema markupMethodSchema = null; if (markupTypeBase == ClassSchema.Type || markupTypeBase == EffectSchema.Type) - markupMethodSchema = (MarkupMethodSchema)new ClassMethodSchema((ClassTypeSchema)owner, name, returnType, parameterTypes, parameterNames); + markupMethodSchema = new ClassMethodSchema((ClassTypeSchema)owner, name, returnType, parameterTypes, parameterNames); else if (markupTypeBase == UISchema.Type) - markupMethodSchema = (MarkupMethodSchema)new UIClassMethodSchema((UIClassTypeSchema)owner, name, returnType, parameterTypes, parameterNames); + markupMethodSchema = new UIClassMethodSchema((UIClassTypeSchema)owner, name, returnType, parameterTypes, parameterNames); markupMethodSchema._isVirtualThunk = isVirtualThunk; return markupMethodSchema; } @@ -62,7 +62,7 @@ namespace Microsoft.Iris.Markup TypeSchema returnType, TypeSchema[] parameterTypes, string[] parameterNames) - : base((TypeSchema)owner) + : base(owner) { this._name = name; this._returnType = returnType; @@ -98,14 +98,14 @@ namespace Microsoft.Iris.Markup { IMarkupTypeBase markupTypeBase = this.GetMarkupTypeBase(instance); if (markupTypeBase == null) - return (object)null; + return null; return this._isVirtualThunk ? this.CallVirt(markupTypeBase, parameters) : this.CallDirect(markupTypeBase, parameters); } private object CallVirt(IMarkupTypeBase markupInstance, object[] parameters) { MarkupTypeSchema typeSchema = (MarkupTypeSchema)markupInstance.TypeSchema; - MarkupMethodSchema markupMethodSchema = (MarkupMethodSchema)null; + MarkupMethodSchema markupMethodSchema = null; while (true) { foreach (MarkupMethodSchema virtualMethod in typeSchema.VirtualMethods) diff --git a/UIX/Microsoft/Iris/Markup/MarkupPropertySchema.cs b/UIX/Microsoft/Iris/Markup/MarkupPropertySchema.cs index 162c5d8..b4c2974 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupPropertySchema.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupPropertySchema.cs @@ -22,16 +22,16 @@ namespace Microsoft.Iris.Markup TypeSchema propertyType) { if (markupTypeBase == ClassSchema.Type || markupTypeBase == EffectSchema.Type) - return (MarkupPropertySchema)new ClassPropertySchema(owner, name, propertyType); + return new ClassPropertySchema(owner, name, propertyType); if (markupTypeBase == UISchema.Type) - return (MarkupPropertySchema)new UIClassPropertySchema((UIClassTypeSchema)owner, name, propertyType); + return new UIClassPropertySchema((UIClassTypeSchema)owner, name, propertyType); if (markupTypeBase == DataTypeSchema.Type) - return (MarkupPropertySchema)new MarkupDataTypePropertySchema(owner, name, propertyType); - return markupTypeBase == DataQuerySchema.Type ? (MarkupPropertySchema)new MarkupDataQueryPropertySchema(owner, name, propertyType) : (MarkupPropertySchema)null; + return new MarkupDataTypePropertySchema(owner, name, propertyType); + return markupTypeBase == DataQuerySchema.Type ? new MarkupDataQueryPropertySchema(owner, name, propertyType) : null; } protected MarkupPropertySchema(MarkupTypeSchema owner, string name, TypeSchema propertyType) - : base((TypeSchema)owner) + : base(owner) { this._name = NotifyService.CanonicalizeString(name); this._propertyType = propertyType; diff --git a/UIX/Microsoft/Iris/Markup/MarkupServices.cs b/UIX/Microsoft/Iris/Markup/MarkupServices.cs index ccc19eb..cce4882 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupServices.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupServices.cs @@ -31,16 +31,16 @@ namespace Microsoft.Iris.Markup private void OnErrorBatch(IList errors) { - foreach (ErrorRecord error in (IEnumerable)errors) + foreach (ErrorRecord error in errors) { if (!error.Warning) this._warningsOnly = false; - this._errors.Add((object)new MarkupError(error)); + this._errors.Add(new MarkupError(error)); } this.FireNotification(NotificationID.ErrorsDetected); } - public IList Errors => (IList)this._errors; + public IList Errors => _errors; public bool WarningsOnly => this._warningsOnly; diff --git a/UIX/Microsoft/Iris/Markup/MarkupSystem.cs b/UIX/Microsoft/Iris/Markup/MarkupSystem.cs index 8f11364..dcb6cfc 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupSystem.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupSystem.cs @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Markup MarkupSystem.s_factoriesByExtension = new Vector(); MarkupSystem.s_rootIslandId = MarkupSystem.AllocateIslandId(); MarkupSystem.UIXGlobal = new UIXLoadResult("http://schemas.microsoft.com/2007/uix"); - MarkupSystem.UIXGlobal.RegisterUsage((object)typeof(MarkupSystem)); + MarkupSystem.UIXGlobal.RegisterUsage(typeof(MarkupSystem)); UIXLoadResult.InitializeStatics(); ValidateContext.InitializeStatics(); ValidateUI.InitializeStatics(); @@ -52,12 +52,12 @@ namespace Microsoft.Iris.Markup NativeMarkupDataQuery.InitializeStatics(); NativeMarkupDataType.InitializeStatics(); MarkupSystem.RootGlobal = new RootLoadResult("Root"); - MarkupSystem.RootGlobal.RegisterUsage((object)typeof(MarkupSystem)); + MarkupSystem.RootGlobal.RegisterUsage(typeof(MarkupSystem)); AssemblyLoadResult.Startup(); DllLoadResult.Startup(); - ResourceManager.Instance.RegisterSource("res", (IResourceProvider)DllResources.Instance); + ResourceManager.Instance.RegisterSource("res", DllResources.Instance); HttpResources.Startup(); - ResourceManager.Instance.RegisterSource("file", (IResourceProvider)FileResources.Instance); + ResourceManager.Instance.RegisterSource("file", FileResources.Instance); } public static void Shutdown() @@ -65,10 +65,10 @@ namespace Microsoft.Iris.Markup MarkupSystem.UnloadAll(); AssemblyLoadResult.Shutdown(); DllLoadResult.Shutdown(); - MarkupSystem.RootGlobal.UnregisterUsage((object)typeof(MarkupSystem)); - MarkupSystem.RootGlobal = (RootLoadResult)null; - MarkupSystem.UIXGlobal.UnregisterUsage((object)typeof(MarkupSystem)); - MarkupSystem.UIXGlobal = (UIXLoadResult)null; + MarkupSystem.RootGlobal.UnregisterUsage(typeof(MarkupSystem)); + MarkupSystem.RootGlobal = null; + MarkupSystem.UIXGlobal.UnregisterUsage(typeof(MarkupSystem)); + MarkupSystem.UIXGlobal = null; HttpResources.Shutdown(); if (MarkupSystem.s_factoriesByProtocol != null) MarkupSystem.s_factoriesByProtocol.Clear(); @@ -81,7 +81,7 @@ namespace Microsoft.Iris.Markup public static LoadResult Load(string uri, uint islandId) { - ErrorManager.EnterContext((object)uri); + ErrorManager.EnterContext(uri); LoadResult loadResult = MarkupSystem.ResolveLoadResult(uri, islandId); if (loadResult != null) { @@ -96,7 +96,7 @@ namespace Microsoft.Iris.Markup public static LoadResult ResolveLoadResult(string uri, uint islandId) { - ErrorManager.EnterContext((object)uri); + ErrorManager.EnterContext(uri); uri = MarkupSystem.ApplyImportRedirects(uri); LoadResult loadResult = LoadResultCache.Read(uri); if (loadResult == null) @@ -127,7 +127,7 @@ namespace Microsoft.Iris.Markup if (!flag) loadResult = MarkupSystem.CreateMarkupLoadResult(uri, ref cacheResult); if (loadResult == null) - loadResult = (LoadResult)new ErrorLoadResult(uri); + loadResult = new ErrorLoadResult(uri); if (cacheResult && loadResult.Cachable) { LoadResultCache.Write(uri, loadResult); @@ -144,8 +144,8 @@ namespace Microsoft.Iris.Markup { Resource resource = ResourceManager.AcquireResource(uri); if (resource == null) - return (LoadResult)null; - ErrorManager.EnterContext((object)resource.Uri); + return null; + ErrorManager.EnterContext(resource.Uri); LoadResult loadResult = LoadResultCache.Read(resource.Uri); if (loadResult != null) { @@ -156,7 +156,7 @@ namespace Microsoft.Iris.Markup { loadResult = MarkupLoadResult.Create(uri, resource); if (loadResult != null) - resource = (Resource)null; + resource = null; } resource?.Free(); ErrorManager.ExitContext(); @@ -194,7 +194,7 @@ namespace Microsoft.Iris.Markup } } if (flag) - MarkupSystem.s_factoriesByProtocol.Add((object)new MarkupSystem.Factory() + MarkupSystem.s_factoriesByProtocol.Add(new MarkupSystem.Factory() { key = protocol, handler = handler @@ -213,7 +213,7 @@ namespace Microsoft.Iris.Markup flag = false; } if (flag) - MarkupSystem.s_factoriesByExtension.Add((object)new MarkupSystem.Factory() + MarkupSystem.s_factoriesByExtension.Add(new MarkupSystem.Factory() { handler = handler, key = extension diff --git a/UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs b/UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs index f3e6c99..ad5b39f 100644 --- a/UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs @@ -45,18 +45,18 @@ namespace Microsoft.Iris.Markup string name) { if (markupTypeDefinition == ClassSchema.Type) - return (MarkupTypeSchema)new ClassTypeSchema(owner, name); + return new ClassTypeSchema(owner, name); if (markupTypeDefinition == UISchema.Type) - return (MarkupTypeSchema)new UIClassTypeSchema(owner, name); + return new UIClassTypeSchema(owner, name); if (markupTypeDefinition == EffectSchema.Type) - return (MarkupTypeSchema)new EffectClassTypeSchema(owner, name); + return new EffectClassTypeSchema(owner, name); if (markupTypeDefinition == DataTypeSchema.Type) - return (MarkupTypeSchema)new MarkupDataTypeSchema(owner, name); - return markupTypeDefinition == DataQuerySchema.Type ? (MarkupTypeSchema)new MarkupDataQuerySchema(owner, name) : (MarkupTypeSchema)null; + return new MarkupDataTypeSchema(owner, name); + return markupTypeDefinition == DataQuerySchema.Type ? new MarkupDataQuerySchema(owner, name) : null; } public MarkupTypeSchema(MarkupLoadResult owner, string name) - : base((LoadResult)owner) + : base(owner) { this._owner = owner; this._name = name; @@ -86,7 +86,7 @@ namespace Microsoft.Iris.Markup protected virtual void SealWorker() { this._sealed = true; - this._loadData = (object)null; + this._loadData = null; if (this._baseType == null) { this._typeDepth = 1U; @@ -104,18 +104,18 @@ namespace Microsoft.Iris.Markup { base.OnDispose(); foreach (DisposableObject property in this._properties) - property.Dispose((object)this); + property.Dispose(this); foreach (DisposableObject method in this._methods) - method.Dispose((object)this); + method.Dispose(this); foreach (DisposableObject virtualMethod in this._virtualMethods) - virtualMethod.Dispose((object)this); + virtualMethod.Dispose(this); } public override string Name => this._name; public override string AlternateName => (string)null; - public override TypeSchema Base => this._baseType == null ? this.DefaultBase : (TypeSchema)this._baseType; + public override TypeSchema Base => this._baseType == null ? this.DefaultBase : _baseType; public override bool Contractual => false; @@ -137,7 +137,7 @@ namespace Microsoft.Iris.Markup bool ignoreErrors, ParameterContext parameterContext) { - ErrorManager.EnterContext((object)markupType.TypeSchema.Owner.ErrorContextUri, ignoreErrors); + ErrorManager.EnterContext(markupType.TypeSchema.Owner.ErrorContextUri, ignoreErrors); MarkupTypeSchema markupTypeSchema = this; uint num = scriptId >> 27; while ((int)num != (int)markupTypeSchema._typeDepth) @@ -152,7 +152,7 @@ namespace Microsoft.Iris.Markup uint scriptOffset, ParameterContext parameterContext) { - object obj = (object)null; + object obj = null; if (markupType.ScriptEnabled) { InterpreterContext context = InterpreterContext.Acquire(markupType, this, scriptOffset, parameterContext); @@ -177,7 +177,7 @@ namespace Microsoft.Iris.Markup if (name == property.Name) return property; } - return (PropertySchema)null; + return null; } public override PropertySchema[] Properties => this._properties; @@ -186,7 +186,7 @@ namespace Microsoft.Iris.Markup public override MethodSchema FindMethod(string name, TypeSchema[] parameters) { - MethodSchema methodSchema = (MethodSchema)null; + MethodSchema methodSchema = null; if (this._methodLookupTable != null) this._methodLookupTable.TryGetValue(new MethodSignatureKey(name, parameters), out methodSchema); return methodSchema; @@ -210,7 +210,7 @@ namespace Microsoft.Iris.Markup IMarkupTypeBase classBase, bool shouldInitializeContent) { - ErrorManager.EnterContext((object)this); + ErrorManager.EnterContext(this); try { if (!this.RunInitializeScript(classBase, this._initializePropertiesOffset)) @@ -254,7 +254,7 @@ namespace Microsoft.Iris.Markup bool flag = true; if (scriptOffsets != null) { - ErrorManager.EnterContext((object)this, ignoreErrors); + ErrorManager.EnterContext(this, ignoreErrors); foreach (uint scriptOffset in scriptOffsets) { if (!this.RunInitializeScript(scriptHost, scriptOffset)) @@ -272,7 +272,7 @@ namespace Microsoft.Iris.Markup { if (scriptOffset == uint.MaxValue || this.RunAtOffset(scriptHost, scriptOffset) != Interpreter.ScriptError || ErrorManager.IgnoringErrors) return true; - ErrorManager.ReportWarning("Script runtime failure: Scripting errors have prevented '{0}' from properly initializing and will affect its operation", (object)this._name); + ErrorManager.ReportWarning("Script runtime failure: Scripting errors have prevented '{0}' from properly initializing and will affect its operation", _name); return false; } @@ -285,8 +285,8 @@ namespace Microsoft.Iris.Markup TypeSchema fromType, out object instance) { - instance = (object)null; - return Result.Fail("Type conversion is not available for '{0}'", (object)this._name); + instance = null; + return Result.Fail("Type conversion is not available for '{0}'", _name); } public override bool SupportsTypeConversion(TypeSchema fromType) => false; @@ -318,7 +318,7 @@ namespace Microsoft.Iris.Markup if (this._inheritableSymbolsTable == null) { if (this._addressOfInheritableSymbolsTable != IntPtr.Zero) - CompiledMarkupLoader.DecodeInheritableSymbolTable(this, (ByteCodeReader)null, this._addressOfInheritableSymbolsTable); + CompiledMarkupLoader.DecodeInheritableSymbolTable(this, null, this._addressOfInheritableSymbolsTable); else this._inheritableSymbolsTable = SymbolRecord.EmptyList; } diff --git a/UIX/Microsoft/Iris/Markup/MethodSchema.cs b/UIX/Microsoft/Iris/Markup/MethodSchema.cs index cb4eb07..d8f8ea2 100644 --- a/UIX/Microsoft/Iris/Markup/MethodSchema.cs +++ b/UIX/Microsoft/Iris/Markup/MethodSchema.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Markup public MethodSchema(TypeSchema owner) { this._owner = owner; - this.DeclareOwner((object)owner); + this.DeclareOwner(owner); } public TypeSchema Owner => this._owner; diff --git a/UIX/Microsoft/Iris/Markup/MethodSignatureKey.cs b/UIX/Microsoft/Iris/Markup/MethodSignatureKey.cs index 00af85d..5e0f9d6 100644 --- a/UIX/Microsoft/Iris/Markup/MethodSignatureKey.cs +++ b/UIX/Microsoft/Iris/Markup/MethodSignatureKey.cs @@ -12,7 +12,7 @@ namespace Microsoft.Iris.Markup private TypeSchema[] _parameters; public MethodSignatureKey(TypeSchema[] parameters) - : this((string)null, parameters) + : this(null, parameters) { } diff --git a/UIX/Microsoft/Iris/Markup/NativeMarkupDataQuery.cs b/UIX/Microsoft/Iris/Markup/NativeMarkupDataQuery.cs index ad8411c..6f1edd1 100644 --- a/UIX/Microsoft/Iris/Markup/NativeMarkupDataQuery.cs +++ b/UIX/Microsoft/Iris/Markup/NativeMarkupDataQuery.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Markup public NativeMarkupDataQuery(MarkupDataQuerySchema type, NativeDataProviderWrapper provider) : base(type) { - this._handleToMe = NativeMarkupDataQuery.s_handleTable.RegisterProxy((object)this); + this._handleToMe = NativeMarkupDataQuery.s_handleTable.RegisterProxy(this); this._typeHandle = type.UniqueId; this._resultTypeHandle = type.ResultType.UniqueId; this._externalQuery = provider.ConstructQuery(type.ProviderName, this._typeHandle, this._resultTypeHandle, this._handleToMe); diff --git a/UIX/Microsoft/Iris/Markup/NativeMarkupDataType.cs b/UIX/Microsoft/Iris/Markup/NativeMarkupDataType.cs index e2fdb6a..64fcdbd 100644 --- a/UIX/Microsoft/Iris/Markup/NativeMarkupDataType.cs +++ b/UIX/Microsoft/Iris/Markup/NativeMarkupDataType.cs @@ -35,7 +35,7 @@ namespace Microsoft.Iris.Markup : base(type) { this._externalObject = externalObject; - this._handleToMe = NativeMarkupDataType.s_handleTable.RegisterProxy((object)this); + this._handleToMe = NativeMarkupDataType.s_handleTable.RegisterProxy(this); this._typeHandle = type.UniqueId; NativeApi.SpAddRefExternalObject(this._externalObject); int num = (int)NativeApi.SpDataBaseObjectSetInternalHandle(this._externalObject, this._handleToMe); @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Markup protected override void OnDispose() { NativeMarkupDataType.ReleaseNativeObject(this._externalObject, this._handleToMe, this._typeHandle); - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); base.OnDispose(); } @@ -104,8 +104,8 @@ namespace Microsoft.Iris.Markup NativeMarkupDataType.s_pendingAppThreadRelease = true; GC.Collect(); GC.WaitForPendingFinalizers(); - foreach (IDisposableObject disposableObject in (DllProxyHandleTable)NativeMarkupDataType.s_handleTable) - disposableObject.Dispose((object)disposableObject); + foreach (IDisposableObject disposableObject in s_handleTable) + disposableObject.Dispose(disposableObject); NativeMarkupDataType.ReleaseFinalizedObjects(); } @@ -115,7 +115,7 @@ namespace Microsoft.Iris.Markup lock (NativeMarkupDataType.s_finalizeLock) { pendingReleases = NativeMarkupDataType.s_pendingReleases; - NativeMarkupDataType.s_pendingReleases = (Vector)null; + NativeMarkupDataType.s_pendingReleases = null; NativeMarkupDataType.s_pendingAppThreadRelease = false; } if (pendingReleases == null || pendingReleases.Count == 0) diff --git a/UIX/Microsoft/Iris/Markup/NotifyService.cs b/UIX/Microsoft/Iris/Markup/NotifyService.cs index 793a2d2..e09075f 100644 --- a/UIX/Microsoft/Iris/Markup/NotifyService.cs +++ b/UIX/Microsoft/Iris/Markup/NotifyService.cs @@ -21,7 +21,7 @@ namespace Microsoft.Iris.Markup for (ListenerNodeBase next = this._listenerRoot.Next; next != this._listenerRoot; next = next.Next) { Listener listener = (Listener)next; - if (object.ReferenceEquals((object)listener.Watch, (object)id)) + if (object.ReferenceEquals(listener.Watch, id)) listener.OnNotify(); } } @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Markup if (UIDispatcher.IsUIThread) this.Fire(id); else - DeferredCall.Post(DispatchPriority.AppEvent, new DeferredHandler(this.FireThreadSafeMarshalHandler), (object)id); + DeferredCall.Post(DispatchPriority.AppEvent, new DeferredHandler(this.FireThreadSafeMarshalHandler), id); } public void FireThreadSafeMarshalHandler(object arg) => this.Fire((string)arg); @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Markup { if (this._listenerRoot == null) this._listenerRoot = new ListenerRootNode(); - this._listenerRoot.AddPrevious((ListenerNodeBase)listener); + this._listenerRoot.AddPrevious(listener); } public void ClearListeners() @@ -53,18 +53,18 @@ namespace Microsoft.Iris.Markup while (this._listenerRoot.Next != null) this._listenerRoot.Next.Unlink(); this._listenerRoot.Dispose(); - this._listenerRoot = (ListenerRootNode)null; + this._listenerRoot = null; } public static string CanonicalizeString(string value) => NotifyService.GetCanonicalizedString(value, true); private static string GetCanonicalizedString(string value, bool addIfNotFound) { - object obj = (object)null; - if (!NotifyService.s_canonicalizedStrings.TryGetValue((object)value, out obj) && addIfNotFound) + object obj = null; + if (!NotifyService.s_canonicalizedStrings.TryGetValue(value, out obj) && addIfNotFound) { - NotifyService.s_canonicalizedStrings[(object)value] = (object)value; - obj = (object)value; + NotifyService.s_canonicalizedStrings[value] = value; + obj = value; } return (string)obj; } diff --git a/UIX/Microsoft/Iris/Markup/ParameterContext.cs b/UIX/Microsoft/Iris/Markup/ParameterContext.cs index 32716e7..60c60b2 100644 --- a/UIX/Microsoft/Iris/Markup/ParameterContext.cs +++ b/UIX/Microsoft/Iris/Markup/ParameterContext.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Markup if (this._parameterNames[index] == name) return this._parameterValues[index]; } - return (object)null; + return null; } public void WriteParameter(string name, object value) diff --git a/UIX/Microsoft/Iris/Markup/Parser.cs b/UIX/Microsoft/Iris/Markup/Parser.cs index 045dbe9..b889abc 100644 --- a/UIX/Microsoft/Iris/Markup/Parser.cs +++ b/UIX/Microsoft/Iris/Markup/Parser.cs @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Markup parseResult.XmlnsList.AppendToEnd(validateNamespace); } else - Parser.ReportError(xmlReader, "Unexpected attribute '{0}' on root tag", (object)name); + Parser.ReportError(xmlReader, "Unexpected attribute '{0}' on root tag", name); } } } @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Markup case NativeXmlNodeType.Element: if (flag) { - Parser.ReportError(xmlReader, "Script tag may not contain XML elements, found: '{0}'", (object)xmlReader.Name); + Parser.ReportError(xmlReader, "Script tag may not contain XML elements, found: '{0}'", xmlReader.Name); continue; } bool isEmptyElement = xmlReader.IsEmptyElement; @@ -78,7 +78,7 @@ namespace Microsoft.Iris.Markup if (prefix1 == "" && localName == "Script") { flag = true; - parseStack.Push((object)new Parser.ScriptBlock(xmlReader.LineNumber, xmlReader.LinePosition)); + parseStack.Push(new Parser.ScriptBlock(xmlReader.LineNumber, xmlReader.LinePosition)); if (xmlReader.ReadAttribute()) Parser.ReportError(xmlReader, "Script tag may not have XML attributes"); } @@ -96,9 +96,9 @@ namespace Microsoft.Iris.Markup objectTagValidator.AddProperty(property); } else - Parser.ReportError(xmlReader, "Property or Object tag may not have prefixed attributes: '{0}'", (object)xmlReader.Name); + Parser.ReportError(xmlReader, "Property or Object tag may not have prefixed attributes: '{0}'", xmlReader.Name); } - parseStack.Push((object)objectTagValidator); + parseStack.Push(objectTagValidator); if (additionalMetadata && !string.IsNullOrEmpty(str1)) { objectTagValidator.Metadata.Comments = str1; @@ -109,11 +109,11 @@ namespace Microsoft.Iris.Markup else { if (prefix1 != string.Empty) - Parser.ReportError(xmlReader, "Property tag may not be prefixed: '{0}'", (object)xmlReader.Name); + Parser.ReportError(xmlReader, "Property tag may not be prefixed: '{0}'", xmlReader.Name); if (localName == "Methods") { flag = true; - parseStack.Push((object)new Parser.ScriptBlock(xmlReader.LineNumber, xmlReader.LinePosition, Parser.CodeType.Methods)); + parseStack.Push(new Parser.ScriptBlock(xmlReader.LineNumber, xmlReader.LinePosition, Parser.CodeType.Methods)); if (xmlReader.ReadAttribute()) Parser.ReportError(xmlReader, "Script tag may not have XML attributes"); } @@ -129,9 +129,9 @@ namespace Microsoft.Iris.Markup Value = xmlReader.Value }); else - Parser.ReportError(xmlReader, "Property or Object tag may not have prefixed attributes: '{0}'", (object)xmlReader.Name); + Parser.ReportError(xmlReader, "Property or Object tag may not have prefixed attributes: '{0}'", xmlReader.Name); } - parseStack.Push((object)validateProperty); + parseStack.Push(validateProperty); } } if (isEmptyElement) @@ -145,7 +145,7 @@ namespace Microsoft.Iris.Markup case NativeXmlNodeType.CDATA: if (parseStack.Count == 0) { - Parser.ReportError(xmlReader, "Text/CDATA is not allowed under root tag ('{0}')", (object)xmlReader.Value.Trim()); + Parser.ReportError(xmlReader, "Text/CDATA is not allowed under root tag ('{0}')", xmlReader.Value.Trim()); continue; } switch (parseStack.Peek()) @@ -158,10 +158,10 @@ namespace Microsoft.Iris.Markup } if (validateProperty.Value is ValidateFromString) { - Parser.ReportError(xmlReader, "Property tag may only contain one Text/CDATA, found more text: '{0}'", (object)xmlReader.Value.Trim()); + Parser.ReportError(xmlReader, "Property tag may only contain one Text/CDATA, found more text: '{0}'", xmlReader.Value.Trim()); continue; } - Parser.ReportError(xmlReader, "Property tag already has objects, may not also add Text/CDATA: '{0}'", (object)xmlReader.Value.Trim()); + Parser.ReportError(xmlReader, "Property tag already has objects, may not also add Text/CDATA: '{0}'", xmlReader.Value.Trim()); continue; case Parser.ScriptBlock scriptBlock: if (scriptBlock.ValidateValue == null) @@ -169,24 +169,24 @@ namespace Microsoft.Iris.Markup scriptBlock.ValidateValue = Parser.ParseCode(owner, xmlReader, scriptBlock.CodeType); continue; } - Parser.ReportError(xmlReader, "Script tag may only contain one Text/CDATA, found more text: '{0}'", (object)xmlReader.Value.Trim()); + Parser.ReportError(xmlReader, "Script tag may only contain one Text/CDATA, found more text: '{0}'", xmlReader.Value.Trim()); continue; default: - Parser.ReportError(xmlReader, "Object tag may not contain Text/CDATA: '{0}'", (object)xmlReader.Value.Trim()); + Parser.ReportError(xmlReader, "Object tag may not contain Text/CDATA: '{0}'", xmlReader.Value.Trim()); continue; } case NativeXmlNodeType.Comment: - string str2 = (string)null; + string str2 = null; if (additionalMetadata) { str2 = xmlReader.Value; - str1 = str1 + (object)'\n' + str2; + str1 = str1 + '\n' + str2; } if (flag) { if (str2 == null) str2 = xmlReader.Value; - Parser.ReportError(xmlReader, "Script tag may not contain XML comments, found: '{0}'", (object)str2.Trim()); + Parser.ReportError(xmlReader, "Script tag may not contain XML comments, found: '{0}'", str2.Trim()); continue; } continue; @@ -256,10 +256,10 @@ namespace Microsoft.Iris.Markup if (flag) { ValidateObjectTag validateObjectTag = (ValidateObjectTag)validateObject; - ErrorManager.ReportError(validateObjectTag.Line, validateObjectTag.Column, "Unexpected root element '{0}', must be , or ", (object)validateObjectTag.TypeIdentifier.TypeName); + ErrorManager.ReportError(validateObjectTag.Line, validateObjectTag.Column, "Unexpected root element '{0}', must be , or ", validateObjectTag.TypeIdentifier.TypeName); break; } - ErrorManager.ReportError(scriptBlock.Line, scriptBlock.Column, "Unexpected root element '{0}', must be , or ", (object)"Script"); + ErrorManager.ReportError(scriptBlock.Line, scriptBlock.Column, "Unexpected root element '{0}', must be , or ", "Script"); break; } } @@ -302,7 +302,7 @@ namespace Microsoft.Iris.Markup fromString = fromString.Substring(1); expandEscapes = false; } - return (ValidateObject)new ValidateFromString(owner, fromString, expandEscapes, xmlReader.LineNumber, xmlReader.LinePosition); + return new ValidateFromString(owner, fromString, expandEscapes, xmlReader.LineNumber, xmlReader.LinePosition); } private static Validate ParseCode( @@ -310,13 +310,13 @@ namespace Microsoft.Iris.Markup NativeXmlReader xmlReader, Parser.CodeType codeType) { - Validate validate = (Validate)null; + Validate validate = null; if (Parser.s_lexTable == null) { - Parser.s_lexTable = (SSLexTable)new ParserLexTable(); - Parser.s_yaccTable = (SSYaccTable)new ParserYaccTable(); + Parser.s_lexTable = new ParserLexTable(); + Parser.s_yaccTable = new ParserYaccTable(); Parser.s_lex = new ParserLexClass(Parser.s_lexTable); - Parser.s_yacc = new ParserYaccClass(Parser.s_yaccTable, (SSLex)Parser.s_lex); + Parser.s_yacc = new ParserYaccClass(Parser.s_yaccTable, s_lex); } string prefix; switch (codeType) @@ -332,7 +332,7 @@ namespace Microsoft.Iris.Markup break; } SSLexUnicodeBufferConsumer unicodeBufferConsumer = xmlReader.LexConsumerForValueWithPrefix(prefix); - Parser.s_lex.Reset((SSLexConsumer)unicodeBufferConsumer); + Parser.s_lex.Reset(unicodeBufferConsumer); Parser.s_yacc.Reset(owner); Parser.s_parserActive = true; Parser.s_yacc.parse(); @@ -340,10 +340,10 @@ namespace Microsoft.Iris.Markup { validate = (Validate)Parser.s_yacc.treeRoot().Object; if (MarkupSystem.TrackAdditionalMetadata) - validate.Metadata.OriginalValue = (object)xmlReader.Value; + validate.Metadata.OriginalValue = xmlReader.Value; } - Parser.s_lex.Reset((SSLexConsumer)null); - Parser.s_yacc.Reset((SourceMarkupLoader)null); + Parser.s_lex.Reset(null); + Parser.s_yacc.Reset(null); Parser.s_parserActive = false; return validate; } diff --git a/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteriaTypeConstraint.cs b/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteriaTypeConstraint.cs index c6fba12..9003d6b 100644 --- a/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteriaTypeConstraint.cs +++ b/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteriaTypeConstraint.cs @@ -23,8 +23,8 @@ namespace Microsoft.Iris.Markup { PropertyOverrideCriteriaTypeConstraint criteriaTypeConstraint = (PropertyOverrideCriteriaTypeConstraint)baseCriteria; if (!criteriaTypeConstraint.Constraint.IsAssignableFrom(this._use)) - return Result.Fail(string.Format("Type parameter property '{0}' is of type '{1}' which is not compatible with the base type constraint '{2}'", (object)"Use", (object)this._use.Name, (object)criteriaTypeConstraint.Constraint.Name)); - return !criteriaTypeConstraint.Constraint.IsAssignableFrom(this._constraint) ? Result.Fail(string.Format("Type parameter property '{0}' is of type '{1}' which is not compatible with the base type constraint '{2}'", (object)"Constraint", (object)this._constraint.Name, (object)criteriaTypeConstraint.Constraint.Name)) : Result.Success; + return Result.Fail(string.Format("Type parameter property '{0}' is of type '{1}' which is not compatible with the base type constraint '{2}'", "Use", _use.Name, criteriaTypeConstraint.Constraint.Name)); + return !criteriaTypeConstraint.Constraint.IsAssignableFrom(this._constraint) ? Result.Fail(string.Format("Type parameter property '{0}' is of type '{1}' which is not compatible with the base type constraint '{2}'", "Constraint", _constraint.Name, criteriaTypeConstraint.Constraint.Name)) : Result.Success; } public TypeSchema Use => this._use; diff --git a/UIX/Microsoft/Iris/Markup/PropertySchema.cs b/UIX/Microsoft/Iris/Markup/PropertySchema.cs index b3b5da3..d1acdeb 100644 --- a/UIX/Microsoft/Iris/Markup/PropertySchema.cs +++ b/UIX/Microsoft/Iris/Markup/PropertySchema.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Markup public PropertySchema(TypeSchema owner) { this._owner = owner; - this.DeclareOwner((object)owner); + this.DeclareOwner(owner); } public TypeSchema Owner => this._owner; diff --git a/UIX/Microsoft/Iris/Markup/ProviderlessMarkupDataType.cs b/UIX/Microsoft/Iris/Markup/ProviderlessMarkupDataType.cs index 26a962c..390dd81 100644 --- a/UIX/Microsoft/Iris/Markup/ProviderlessMarkupDataType.cs +++ b/UIX/Microsoft/Iris/Markup/ProviderlessMarkupDataType.cs @@ -22,8 +22,8 @@ namespace Microsoft.Iris.Markup get { if (this._externalAssemblyObject == null) - this._externalAssemblyObject = (IDataProviderObject)new ProviderlessDataProviderObject((MarkupDataType)this, (MarkupDataTypeSchema)this.TypeSchema); - return (IDataProviderBaseObject)this._externalAssemblyObject; + this._externalAssemblyObject = new ProviderlessDataProviderObject(this, (MarkupDataTypeSchema)this.TypeSchema); + return _externalAssemblyObject; } } @@ -53,6 +53,6 @@ namespace Microsoft.Iris.Markup base.SetProperty(name, value); } - private object SynchronizedPropertyStorage => (object)this._storage; + private object SynchronizedPropertyStorage => _storage; } } diff --git a/UIX/Microsoft/Iris/Markup/ReflectionHelper.cs b/UIX/Microsoft/Iris/Markup/ReflectionHelper.cs index 62d1f1a..3714af5 100644 --- a/UIX/Microsoft/Iris/Markup/ReflectionHelper.cs +++ b/UIX/Microsoft/Iris/Markup/ReflectionHelper.cs @@ -66,7 +66,7 @@ namespace Microsoft.Iris.Markup Type cls; if (methodInfo != null) { - ilGenerator.EmitCall(methodInfo.IsStatic ? OpCodes.Call : OpCodes.Callvirt, methodInfo, (Type[])null); + ilGenerator.EmitCall(methodInfo.IsStatic ? OpCodes.Call : OpCodes.Callvirt, methodInfo, null); cls = methodInfo.ReturnType; } else diff --git a/UIX/Microsoft/Iris/Markup/SSLexUnicodeBufferConsumer.cs b/UIX/Microsoft/Iris/Markup/SSLexUnicodeBufferConsumer.cs index feeef53..cfaa5b9 100644 --- a/UIX/Microsoft/Iris/Markup/SSLexUnicodeBufferConsumer.cs +++ b/UIX/Microsoft/Iris/Markup/SSLexUnicodeBufferConsumer.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Markup public override bool getNext() => this.GetCharAt(this.m_index, out this.m_current); - public override unsafe string getSubstring(int start, int length) => start + length <= this._prefix.Length ? this._prefix.Substring(start, length) : NativeApi.PtrToStringUni(new IntPtr((void*)(this._buffer + start - this._prefix.Length)), length); + public override unsafe string getSubstring(int start, int length) => start + length <= this._prefix.Length ? this._prefix.Substring(start, length) : NativeApi.PtrToStringUni(new IntPtr(this._buffer + start - this._prefix.Length), length); public unsafe bool GetCharAt(int position, out char ch) { @@ -40,7 +40,7 @@ namespace Microsoft.Iris.Markup return true; } int index = position - this._prefix.Length; - if ((long)index < (long)this._length) + if (index < _length) { ch = this._buffer[index]; return true; diff --git a/UIX/Microsoft/Iris/Markup/ScriptRunScheduler.cs b/UIX/Microsoft/Iris/Markup/ScriptRunScheduler.cs index bfba55d..52529d9 100644 --- a/UIX/Microsoft/Iris/Markup/ScriptRunScheduler.cs +++ b/UIX/Microsoft/Iris/Markup/ScriptRunScheduler.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Markup if (this._pendingList == null) return; Vector pendingList = this._pendingList; - this._pendingList = (Vector)null; + this._pendingList = null; for (int index = 0; index < pendingList.Count; ++index) { ScriptRunScheduler.PendingScript pendingScript = pendingList[index]; @@ -70,7 +70,7 @@ namespace Microsoft.Iris.Markup if (this._lists.Count >= 128 || list.Capacity > 32) return; list.Clear(); - this._lists.Push((object)list); + this._lists.Push(list); } } } diff --git a/UIX/Microsoft/Iris/Markup/SourceMarkupLoadResult.cs b/UIX/Microsoft/Iris/Markup/SourceMarkupLoadResult.cs index cc0a556..5555f48 100644 --- a/UIX/Microsoft/Iris/Markup/SourceMarkupLoadResult.cs +++ b/UIX/Microsoft/Iris/Markup/SourceMarkupLoadResult.cs @@ -44,13 +44,13 @@ namespace Microsoft.Iris.Markup { if (this._doneWithLoader) return; - ErrorManager.EnterContext((object)this.ErrorContextUri); + ErrorManager.EnterContext(ErrorContextUri); this._loader.Validate(currentPass); ErrorManager.ExitContext(); if (currentPass != LoadPass.Done) return; if (!MarkupSystem.TrackAdditionalMetadata) - this._loader = (SourceMarkupLoader)null; + this._loader = null; this._doneWithLoader = true; } @@ -59,7 +59,7 @@ namespace Microsoft.Iris.Markup ValidateClass loadData = (ValidateClass)typeSchema.LoadData; if (loadData == null) return; - ErrorManager.EnterContext((object)this.ErrorContextUri); + ErrorManager.EnterContext(ErrorContextUri); loadData.Validate(currentPass); ErrorManager.ExitContext(); } @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Markup if (this._resource != null) { this._resource.Free(); - this._resource = (Resource)null; + this._resource = null; } if (this.Status == LoadResultStatus.Loading) this.SetStatus(LoadResultStatus.Success); diff --git a/UIX/Microsoft/Iris/Markup/SourceMarkupLoader.cs b/UIX/Microsoft/Iris/Markup/SourceMarkupLoader.cs index 0227b16..7dbd833 100644 --- a/UIX/Microsoft/Iris/Markup/SourceMarkupLoader.cs +++ b/UIX/Microsoft/Iris/Markup/SourceMarkupLoader.cs @@ -51,9 +51,9 @@ namespace Microsoft.Iris.Markup public LoadResult FindDependency(string prefix) { if (prefix == null) - return (LoadResult)MarkupSystem.UIXGlobal; + return MarkupSystem.UIXGlobal; object obj; - this._importedNamespaces.TryGetValue((object)prefix, out obj); + this._importedNamespaces.TryGetValue(prefix, out obj); return (LoadResult)obj; } @@ -73,7 +73,7 @@ namespace Microsoft.Iris.Markup } if (this._parseResult.Version != "http://schemas.microsoft.com/2007/uix") { - this.ReportError(string.Format("Unsupported version of markup: '{0}'", (object)this._parseResult.Version), -1, -1); + this.ReportError(string.Format("Unsupported version of markup: '{0}'", _parseResult.Version), -1, -1); return; } if (this._loadResultTarget.BinaryDataTable != null) @@ -88,7 +88,7 @@ namespace Microsoft.Iris.Markup LoadResult loadResult = validateNamespace.Validate(); if (loadResult != null) { - this._importedNamespaces[(object)validateNamespace.Prefix] = (object)loadResult; + this._importedNamespaces[validateNamespace.Prefix] = loadResult; this.TrackImportedLoadResult(loadResult); } } @@ -115,7 +115,7 @@ namespace Microsoft.Iris.Markup for (ValidateNamespace validateNamespace = this._parseResult.XmlnsList; validateNamespace != null; validateNamespace = validateNamespace.Next) { if (!this._referencedNamespaces.ContainsKey(validateNamespace.Prefix)) - ErrorManager.ReportWarning(validateNamespace.Line, validateNamespace.Column, "Unreferenced namespace {0}", (object)validateNamespace.Prefix); + ErrorManager.ReportWarning(validateNamespace.Line, validateNamespace.Column, "Unreferenced namespace {0}", validateNamespace.Prefix); } } } @@ -145,7 +145,7 @@ namespace Microsoft.Iris.Markup return; if (this.HasErrors) this._loadResultTarget.MarkLoadFailed(); - MarkupImportTables importTables = (MarkupImportTables)null; + MarkupImportTables importTables = null; if (this._importTables != null) { importTables = this._importTables.PrepareImportTables(); @@ -155,9 +155,9 @@ namespace Microsoft.Iris.Markup MarkupConstantsTable constantsTable = this._loadResultTarget.BinaryDataTable == null ? new MarkupConstantsTable() : this._loadResultTarget.BinaryDataTable.ConstantsTable; this._loadResultTarget.SetDataMappingsTable(this.PrepareDataMappingTable()); this._loadResultTarget.ValidationComplete(); - ByteCodeReader reader = (ByteCodeReader)null; + ByteCodeReader reader = null; if (!this.HasErrors) - reader = new MarkupEncoder(importTables, constantsTable, lineNumberTable).EncodeOBJECTSection(this._parseResult, this._loadResultTarget.Uri, (string)null); + reader = new MarkupEncoder(importTables, constantsTable, lineNumberTable).EncodeOBJECTSection(this._parseResult, this._loadResultTarget.Uri, null); if (!this._usingSharedBinaryDataTable) { constantsTable.PrepareForRuntimeUse(); @@ -169,16 +169,16 @@ namespace Microsoft.Iris.Markup this._loadResultTarget.SetObjectSection(reader); this._loadResultTarget.SetDependenciesTable(this.PrepareDependenciesTable()); if (!MarkupSystem.TrackAdditionalMetadata) - this._parseResult = (ParseResult)null; + this._parseResult = null; foreach (DisposableObject validateObject in this._validateObjects) - validateObject.Dispose((object)this); + validateObject.Dispose(this); } } public int RegisterExportedType(MarkupTypeSchema type) { int count = this._foundExportedTypes.Count; - this._foundExportedTypes.Add((object)type); + this._foundExportedTypes.Add(type); return count; } @@ -188,7 +188,7 @@ namespace Microsoft.Iris.Markup if (this._foundAliasMappings == null) this._foundAliasMappings = new Vector(); int count = this._foundAliasMappings.Count; - this._foundAliasMappings.Add((object)new AliasMapping(alias, loadResult, targetType)); + this._foundAliasMappings.Add(new AliasMapping(alias, loadResult, targetType)); return count; } @@ -212,8 +212,8 @@ namespace Microsoft.Iris.Markup public void TrackValidateObject(Microsoft.Iris.Markup.Validation.Validate validate) { - this._validateObjects.Add((object)validate); - validate.DeclareOwner((object)this); + this._validateObjects.Add(validate); + validate.DeclareOwner(this); } public void TrackImportedLoadResult(LoadResult loadResult) @@ -225,18 +225,18 @@ namespace Microsoft.Iris.Markup if ((LoadResult)this._importTables.ImportedLoadResults[index] == loadResult) return; } - this._importTables.ImportedLoadResults.Add((object)loadResult); + this._importTables.ImportedLoadResults.Add(loadResult); } public int TrackImportedType(TypeSchema type) { this.TrackImportedLoadResult(type.Owner); - return this.TrackImportedSchema(this._importTables.ImportedTypes, (object)type); + return this.TrackImportedSchema(this._importTables.ImportedTypes, type); } public int TrackImportedConstructor(ConstructorSchema constructor) { - int num = this.TrackImportedSchema(this._importTables.ImportedConstructors, (object)constructor); + int num = this.TrackImportedSchema(this._importTables.ImportedConstructors, constructor); this.TrackImportedType(constructor.Owner); foreach (TypeSchema parameterType in constructor.ParameterTypes) this.TrackImportedType(parameterType); @@ -245,14 +245,14 @@ namespace Microsoft.Iris.Markup public int TrackImportedProperty(PropertySchema property) { - int num = this.TrackImportedSchema(this._importTables.ImportedProperties, (object)property); + int num = this.TrackImportedSchema(this._importTables.ImportedProperties, property); this.TrackImportedType(property.Owner); return num; } public int TrackImportedMethod(MethodSchema method) { - int num = this.TrackImportedSchema(this._importTables.ImportedMethods, (object)method); + int num = this.TrackImportedSchema(this._importTables.ImportedMethods, method); this.TrackImportedType(method.Owner); foreach (TypeSchema parameterType in method.ParameterTypes) this.TrackImportedType(parameterType); @@ -261,7 +261,7 @@ namespace Microsoft.Iris.Markup public int TrackImportedEvent(EventSchema evt) { - int num = this.TrackImportedSchema(this._importTables.ImportedEvents, (object)evt); + int num = this.TrackImportedSchema(this._importTables.ImportedEvents, evt); this.TrackImportedType(evt.Owner); return num; } @@ -329,7 +329,7 @@ namespace Microsoft.Iris.Markup for (int index = 0; index < this._foundExportedTypes.Count; ++index) { MarkupTypeSchema foundExportedType = (MarkupTypeSchema)this._foundExportedTypes[index]; - typeSchemaArray[index] = (TypeSchema)foundExportedType; + typeSchemaArray[index] = foundExportedType; } } return typeSchemaArray; @@ -337,7 +337,7 @@ namespace Microsoft.Iris.Markup private AliasMapping[] PrepareAliasTable() { - AliasMapping[] aliasMappingArray = (AliasMapping[])null; + AliasMapping[] aliasMappingArray = null; if (this._foundAliasMappings != null) { aliasMappingArray = new AliasMapping[this._foundAliasMappings.Count]; @@ -349,8 +349,8 @@ namespace Microsoft.Iris.Markup private MarkupDataMapping[] PrepareDataMappingTable() { - MarkupDataMapping[] dataMappingTable = (MarkupDataMapping[])null; - int length = this.PrepareDataMappingTableHelper((MarkupDataMapping[])null); + MarkupDataMapping[] dataMappingTable = null; + int length = this.PrepareDataMappingTableHelper(null); if (length > 0) { dataMappingTable = new MarkupDataMapping[length]; @@ -394,7 +394,7 @@ namespace Microsoft.Iris.Markup { if (prefix == null) return; - this._referencedNamespaces[prefix] = (object)null; + this._referencedNamespaces[prefix] = null; } public ValidateObjectTag CreateObjectTagValidator( @@ -403,35 +403,35 @@ namespace Microsoft.Iris.Markup int offset, bool isRootTag) { - ValidateObjectTag validateObjectTag = (ValidateObjectTag)null; + ValidateObjectTag validateObjectTag = null; if (isRootTag) { if (typeIdentifier.TypeName == ClassSchema.Type.Name) - validateObjectTag = (ValidateObjectTag)new ValidateClass(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateClass(this, typeIdentifier, line, offset); else if (typeIdentifier.TypeName == UISchema.Type.Name) - validateObjectTag = (ValidateObjectTag)new ValidateUI(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateUI(this, typeIdentifier, line, offset); else if (typeIdentifier.TypeName == EffectSchema.Type.Name) - validateObjectTag = (ValidateObjectTag)new ValidateEffect(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateEffect(this, typeIdentifier, line, offset); else if (typeIdentifier.TypeName == AliasSchema.Type.Name) - validateObjectTag = (ValidateObjectTag)new ValidateAlias(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateAlias(this, typeIdentifier, line, offset); else if (typeIdentifier.TypeName == DataTypeSchema.Type.Name) - validateObjectTag = (ValidateObjectTag)new ValidateDataType(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateDataType(this, typeIdentifier, line, offset); else if (typeIdentifier.TypeName == DataQuerySchema.Type.Name) - validateObjectTag = (ValidateObjectTag)new ValidateDataQuery(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateDataQuery(this, typeIdentifier, line, offset); else if (typeIdentifier.TypeName == DataMappingSchema.Type.Name) - validateObjectTag = (ValidateObjectTag)new ValidateDataMapping(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateDataMapping(this, typeIdentifier, line, offset); } else if (typeIdentifier.Prefix == null) { if (typeIdentifier.TypeName == TypeConstraintSchema.Type.Name) { - validateObjectTag = (ValidateObjectTag)new ValidateTypeConstraint(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateTypeConstraint(this, typeIdentifier, line, offset); } else { TypeSchema type = MarkupSystem.UIXGlobal.FindType(typeIdentifier.TypeName); if (EffectElementSchema.Type.IsAssignableFrom(type)) - validateObjectTag = (ValidateObjectTag)new ValidateEffectElement(this, typeIdentifier, line, offset); + validateObjectTag = new ValidateEffectElement(this, typeIdentifier, line, offset); } } if (validateObjectTag == null) diff --git a/UIX/Microsoft/Iris/Markup/StandardAssemblyTypeSchema.cs b/UIX/Microsoft/Iris/Markup/StandardAssemblyTypeSchema.cs index 6da10b1..8ad33a2 100644 --- a/UIX/Microsoft/Iris/Markup/StandardAssemblyTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/StandardAssemblyTypeSchema.cs @@ -11,7 +11,7 @@ namespace Microsoft.Iris.Markup internal class StandardAssemblyTypeSchema : AssemblyTypeSchema { public StandardAssemblyTypeSchema(Type type) - : base(type, (TypeSchema)null) + : base(type, null) { } } diff --git a/UIX/Microsoft/Iris/Markup/TypeSchema.cs b/UIX/Microsoft/Iris/Markup/TypeSchema.cs index 8c6f0e6..bd4037e 100644 --- a/UIX/Microsoft/Iris/Markup/TypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/TypeSchema.cs @@ -24,7 +24,7 @@ namespace Microsoft.Iris.Markup this._owner = owner; this._id = ++TypeSchema.s_uniqueId; TypeSchema.s_idToTypeSchema[this._id] = this; - this.DeclareOwner((object)owner); + this.DeclareOwner(owner); } protected override void OnDispose() @@ -146,7 +146,7 @@ namespace Microsoft.Iris.Markup if (property != null) return property; } - return (PropertySchema)null; + return null; } public Vector FindRequiredPropertyNamesDeep() @@ -181,7 +181,7 @@ namespace Microsoft.Iris.Markup if (method != null) return method; } - return (MethodSchema)null; + return null; } public EventSchema FindEventDeep(string name) @@ -192,7 +192,7 @@ namespace Microsoft.Iris.Markup if (eventSchema != null) return eventSchema; } - return (EventSchema)null; + return null; } public bool SupportsOperationDeep(OperationType op) @@ -212,7 +212,7 @@ namespace Microsoft.Iris.Markup if (typeSchema.SupportsOperation(op)) return typeSchema.PerformOperation(left, right, op); } - return (object)null; + return null; } public static bool IsUnaryOperation(OperationType op) => op == OperationType.LogicalNot || op == OperationType.MathNegate || op == OperationType.PostIncrement || op == OperationType.PostDecrement; @@ -232,7 +232,7 @@ namespace Microsoft.Iris.Markup public void ShareEquivalents(Vector equivalents) => this._equivalents = equivalents; - public virtual string ErrorContextDescription => string.Format("{0} (Owner='{1}')", (object)this.Name, (object)(this.Owner.Uri ?? "Unavailable")); + public virtual string ErrorContextDescription => string.Format("{0} (Owner='{1}')", Name, this.Owner.Uri ?? "Unavailable"); public static string NameFromInstance(object instance) => !(instance is ISchemaInfo schemaInfo) ? instance.GetType().Name : schemaInfo.TypeSchema.Name; diff --git a/UIX/Microsoft/Iris/Markup/UIClassMethodSchema.cs b/UIX/Microsoft/Iris/Markup/UIClassMethodSchema.cs index 9525833..c7852a0 100644 --- a/UIX/Microsoft/Iris/Markup/UIClassMethodSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIClassMethodSchema.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Markup TypeSchema returnType, TypeSchema[] parameterTypes, string[] parameterNames) - : base((MarkupTypeSchema)owner, name, returnType, parameterTypes, parameterNames) + : base(owner, name, returnType, parameterTypes, parameterNames) { } @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Markup { if (!(instance is IMarkupTypeBase markupTypeBase)) { - markupTypeBase = (IMarkupTypeBase)((Host)instance).ChildUI; + markupTypeBase = ((Host)instance).ChildUI; if (markupTypeBase == null) ErrorManager.ReportError("Host '{0}' is currently not hosting a UI and therefore cannot invoke methods", instance); } diff --git a/UIX/Microsoft/Iris/Markup/UIClassPropertySchema.cs b/UIX/Microsoft/Iris/Markup/UIClassPropertySchema.cs index 9573557..aed3237 100644 --- a/UIX/Microsoft/Iris/Markup/UIClassPropertySchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIClassPropertySchema.cs @@ -11,7 +11,7 @@ namespace Microsoft.Iris.Markup internal class UIClassPropertySchema : MarkupPropertySchema { public UIClassPropertySchema(UIClassTypeSchema owner, string name, TypeSchema propertyType) - : base((MarkupTypeSchema)owner, name, propertyType) + : base(owner, name, propertyType) { } diff --git a/UIX/Microsoft/Iris/Markup/UIClassTypeSchema.cs b/UIX/Microsoft/Iris/Markup/UIClassTypeSchema.cs index a7cd999..c43a54e 100644 --- a/UIX/Microsoft/Iris/Markup/UIClassTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIClassTypeSchema.cs @@ -23,16 +23,16 @@ namespace Microsoft.Iris.Markup public override MarkupType MarkupType => MarkupType.UI; - protected override TypeSchema DefaultBase => (TypeSchema)HostSchema.Type; + protected override TypeSchema DefaultBase => HostSchema.Type; public override Type RuntimeType => typeof(Host); - public override object ConstructDefault() => (object)new Host(this); + public override object ConstructDefault() => new Host(this); object IDynamicConstructionSchema.ConstructDefault( TypeSchema replacedType) { - return (object)new Host((UIClassTypeSchema)replacedType, this); + return new Host((UIClassTypeSchema)replacedType, this); } public UIClass ConstructUI() => new UIClass(this); @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Markup IMarkupTypeBase markupType, ParameterContext parameterContext) { - ErrorManager.EnterContext((object)markupType.TypeSchema.Owner.ErrorContextUri); + ErrorManager.EnterContext(markupType.TypeSchema.Owner.ErrorContextUri); try { uint scriptOffset = uint.MaxValue; @@ -68,9 +68,9 @@ namespace Microsoft.Iris.Markup object obj = this.RunAtOffset(markupType, scriptOffset, parameterContext); if (obj != Interpreter.ScriptError) return (ViewItem)obj; - ErrorManager.ReportWarning("Script runtime failure: Scripting errors have prevented '{0}' named content from being constructed", (object)name); + ErrorManager.ReportWarning("Script runtime failure: Scripting errors have prevented '{0}' named content from being constructed", name); } - return (ViewItem)null; + return null; } finally { @@ -83,10 +83,10 @@ namespace Microsoft.Iris.Markup Host ownerHost = instance as Host; UIClass childUi = ownerHost.ChildUI; childUi.DeclareHost(ownerHost); - this.InitializeInstance((IMarkupTypeBase)ownerHost.ChildUI); + this.InitializeInstance(ownerHost.ChildUI); if (childUi.RootItem != null) - ownerHost.Children.Add((Microsoft.Iris.Library.TreeNode)childUi.RootItem); - childUi.DeclareOwner((object)ownerHost); + ownerHost.Children.Add(childUi.RootItem); + childUi.DeclareOwner(ownerHost); } public NamedContentRecord[] NamedContentTable => this._namedContentTable; diff --git a/UIX/Microsoft/Iris/Markup/UIX/AccessibleSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AccessibleSchema.cs index f3f6b76..aa2e4ae 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/AccessibleSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/AccessibleSchema.cs @@ -15,15 +15,15 @@ namespace Microsoft.Iris.Markup.UIX private static object GetEnabled(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).Enabled); - private static object GetDefaultAction(object instanceObj) => (object)((Accessible)instanceObj).DefaultAction; + private static object GetDefaultAction(object instanceObj) => ((Accessible)instanceObj).DefaultAction; private static void SetDefaultAction(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).DefaultAction = (string)valueObj; - private static object GetDefaultActionCommand(object instanceObj) => (object)((Accessible)instanceObj).DefaultActionCommand; + private static object GetDefaultActionCommand(object instanceObj) => ((Accessible)instanceObj).DefaultActionCommand; private static void SetDefaultActionCommand(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).DefaultActionCommand = (IUICommand)valueObj; - private static object GetDescription(object instanceObj) => (object)((Accessible)instanceObj).Description; + private static object GetDescription(object instanceObj) => ((Accessible)instanceObj).Description; private static void SetDescription(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).Description = (string)valueObj; @@ -31,11 +31,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetHasPopup(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).HasPopup = (bool)valueObj; - private static object GetHelp(object instanceObj) => (object)((Accessible)instanceObj).Help; + private static object GetHelp(object instanceObj) => ((Accessible)instanceObj).Help; private static void SetHelp(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).Help = (string)valueObj; - private static object GetHelpTopic(object instanceObj) => (object)((Accessible)instanceObj).HelpTopic; + private static object GetHelpTopic(object instanceObj) => ((Accessible)instanceObj).HelpTopic; private static void SetHelpTopic(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).HelpTopic = (int)valueObj; @@ -99,83 +99,83 @@ namespace Microsoft.Iris.Markup.UIX private static void SetIsUnavailable(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsUnavailable = (bool)valueObj; - private static object GetKeyboardShortcut(object instanceObj) => (object)((Accessible)instanceObj).KeyboardShortcut; + private static object GetKeyboardShortcut(object instanceObj) => ((Accessible)instanceObj).KeyboardShortcut; private static void SetKeyboardShortcut(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).KeyboardShortcut = (string)valueObj; - private static object GetName(object instanceObj) => (object)((Accessible)instanceObj).Name; + private static object GetName(object instanceObj) => ((Accessible)instanceObj).Name; private static void SetName(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).Name = (string)valueObj; - private static object GetRole(object instanceObj) => (object)((Accessible)instanceObj).Role; + private static object GetRole(object instanceObj) => ((Accessible)instanceObj).Role; private static void SetRole(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).Role = (AccRole)valueObj; - private static object GetValue(object instanceObj) => (object)((Accessible)instanceObj).Value; + private static object GetValue(object instanceObj) => ((Accessible)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).Value = (string)valueObj; - private static object Construct() => (object)new Accessible(); + private static object Construct() => new Accessible(); - public static void Pass1Initialize() => AccessibleSchema.Type = new UIXTypeSchema((short)0, "Accessible", (string)null, (short)153, typeof(Accessible), UIXTypeFlags.None); + public static void Pass1Initialize() => AccessibleSchema.Type = new UIXTypeSchema(0, "Accessible", null, 153, typeof(Accessible), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)0, "Enabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetEnabled), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)0, "DefaultAction", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetDefaultAction), new SetValueHandler(AccessibleSchema.SetDefaultAction), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)0, "DefaultActionCommand", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetDefaultActionCommand), new SetValueHandler(AccessibleSchema.SetDefaultActionCommand), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)0, "Description", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetDescription), new SetValueHandler(AccessibleSchema.SetDescription), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)0, "HasPopup", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetHasPopup), new SetValueHandler(AccessibleSchema.SetHasPopup), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)0, "Help", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetHelp), new SetValueHandler(AccessibleSchema.SetHelp), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)0, "HelpTopic", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetHelpTopic), new SetValueHandler(AccessibleSchema.SetHelpTopic), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)0, "IsAnimated", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsAnimated), new SetValueHandler(AccessibleSchema.SetIsAnimated), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)0, "IsBusy", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsBusy), new SetValueHandler(AccessibleSchema.SetIsBusy), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)0, "IsChecked", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsChecked), new SetValueHandler(AccessibleSchema.SetIsChecked), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)0, "IsCollapsed", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsCollapsed), new SetValueHandler(AccessibleSchema.SetIsCollapsed), false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)0, "IsDefault", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsDefault), new SetValueHandler(AccessibleSchema.SetIsDefault), false); - UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema((short)0, "IsExpanded", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsExpanded), new SetValueHandler(AccessibleSchema.SetIsExpanded), false); - UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema((short)0, "IsMarquee", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsMarquee), new SetValueHandler(AccessibleSchema.SetIsMarquee), false); - UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema((short)0, "IsMixed", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsMixed), new SetValueHandler(AccessibleSchema.SetIsMixed), false); - UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema((short)0, "IsMultiSelectable", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsMultiSelectable), new SetValueHandler(AccessibleSchema.SetIsMultiSelectable), false); - UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema((short)0, "IsPressed", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsPressed), new SetValueHandler(AccessibleSchema.SetIsPressed), false); - UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema((short)0, "IsProtected", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsProtected), new SetValueHandler(AccessibleSchema.SetIsProtected), false); - UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema((short)0, "IsSelectable", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsSelectable), new SetValueHandler(AccessibleSchema.SetIsSelectable), false); - UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema((short)0, "IsSelected", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsSelected), new SetValueHandler(AccessibleSchema.SetIsSelected), false); - UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema((short)0, "IsTraversed", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsTraversed), new SetValueHandler(AccessibleSchema.SetIsTraversed), false); - UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema((short)0, "IsUnavailable", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetIsUnavailable), new SetValueHandler(AccessibleSchema.SetIsUnavailable), false); - UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema((short)0, "KeyboardShortcut", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetKeyboardShortcut), new SetValueHandler(AccessibleSchema.SetKeyboardShortcut), false); - UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema((short)0, "Name", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetName), new SetValueHandler(AccessibleSchema.SetName), false); - UIXPropertySchema uixPropertySchema25 = new UIXPropertySchema((short)0, "Role", (short)1, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetRole), new SetValueHandler(AccessibleSchema.SetRole), false); - UIXPropertySchema uixPropertySchema26 = new UIXPropertySchema((short)0, "Value", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AccessibleSchema.GetValue), new SetValueHandler(AccessibleSchema.SetValue), false); - AccessibleSchema.Type.Initialize(new DefaultConstructHandler(AccessibleSchema.Construct), (ConstructorSchema[])null, new PropertySchema[26] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(0, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetEnabled), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(0, "DefaultAction", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetDefaultAction), new SetValueHandler(AccessibleSchema.SetDefaultAction), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(0, "DefaultActionCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetDefaultActionCommand), new SetValueHandler(AccessibleSchema.SetDefaultActionCommand), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(0, "Description", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetDescription), new SetValueHandler(AccessibleSchema.SetDescription), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(0, "HasPopup", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetHasPopup), new SetValueHandler(AccessibleSchema.SetHasPopup), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(0, "Help", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetHelp), new SetValueHandler(AccessibleSchema.SetHelp), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(0, "HelpTopic", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetHelpTopic), new SetValueHandler(AccessibleSchema.SetHelpTopic), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(0, "IsAnimated", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsAnimated), new SetValueHandler(AccessibleSchema.SetIsAnimated), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(0, "IsBusy", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsBusy), new SetValueHandler(AccessibleSchema.SetIsBusy), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(0, "IsChecked", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsChecked), new SetValueHandler(AccessibleSchema.SetIsChecked), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(0, "IsCollapsed", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsCollapsed), new SetValueHandler(AccessibleSchema.SetIsCollapsed), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(0, "IsDefault", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsDefault), new SetValueHandler(AccessibleSchema.SetIsDefault), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(0, "IsExpanded", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsExpanded), new SetValueHandler(AccessibleSchema.SetIsExpanded), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(0, "IsMarquee", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsMarquee), new SetValueHandler(AccessibleSchema.SetIsMarquee), false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(0, "IsMixed", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsMixed), new SetValueHandler(AccessibleSchema.SetIsMixed), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(0, "IsMultiSelectable", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsMultiSelectable), new SetValueHandler(AccessibleSchema.SetIsMultiSelectable), false); + UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema(0, "IsPressed", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsPressed), new SetValueHandler(AccessibleSchema.SetIsPressed), false); + UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema(0, "IsProtected", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsProtected), new SetValueHandler(AccessibleSchema.SetIsProtected), false); + UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema(0, "IsSelectable", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsSelectable), new SetValueHandler(AccessibleSchema.SetIsSelectable), false); + UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema(0, "IsSelected", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsSelected), new SetValueHandler(AccessibleSchema.SetIsSelected), false); + UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema(0, "IsTraversed", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsTraversed), new SetValueHandler(AccessibleSchema.SetIsTraversed), false); + UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema(0, "IsUnavailable", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetIsUnavailable), new SetValueHandler(AccessibleSchema.SetIsUnavailable), false); + UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema(0, "KeyboardShortcut", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetKeyboardShortcut), new SetValueHandler(AccessibleSchema.SetKeyboardShortcut), false); + UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema(0, "Name", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetName), new SetValueHandler(AccessibleSchema.SetName), false); + UIXPropertySchema uixPropertySchema25 = new UIXPropertySchema(0, "Role", 1, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetRole), new SetValueHandler(AccessibleSchema.SetRole), false); + UIXPropertySchema uixPropertySchema26 = new UIXPropertySchema(0, "Value", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AccessibleSchema.GetValue), new SetValueHandler(AccessibleSchema.SetValue), false); + AccessibleSchema.Type.Initialize(new DefaultConstructHandler(AccessibleSchema.Construct), null, new PropertySchema[26] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema13, - (PropertySchema) uixPropertySchema14, - (PropertySchema) uixPropertySchema15, - (PropertySchema) uixPropertySchema16, - (PropertySchema) uixPropertySchema17, - (PropertySchema) uixPropertySchema18, - (PropertySchema) uixPropertySchema19, - (PropertySchema) uixPropertySchema20, - (PropertySchema) uixPropertySchema21, - (PropertySchema) uixPropertySchema22, - (PropertySchema) uixPropertySchema23, - (PropertySchema) uixPropertySchema24, - (PropertySchema) uixPropertySchema25, - (PropertySchema) uixPropertySchema26 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema9, + uixPropertySchema10, + uixPropertySchema11, + uixPropertySchema12, + uixPropertySchema13, + uixPropertySchema14, + uixPropertySchema15, + uixPropertySchema16, + uixPropertySchema17, + uixPropertySchema18, + uixPropertySchema19, + uixPropertySchema20, + uixPropertySchema21, + uixPropertySchema22, + uixPropertySchema23, + uixPropertySchema24, + uixPropertySchema25, + uixPropertySchema26 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/AliasSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AliasSchema.cs index 712bad1..10d745f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/AliasSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/AliasSchema.cs @@ -14,15 +14,15 @@ namespace Microsoft.Iris.Markup.UIX { } - public static void Pass1Initialize() => AliasSchema.Type = new UIXTypeSchema((short)2, "Alias", (string)null, (short)-1, typeof(object), UIXTypeFlags.None); + public static void Pass1Initialize() => AliasSchema.Type = new UIXTypeSchema(2, "Alias", null, -1, typeof(object), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)2, "Type", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(AliasSchema.SetType), false); - AliasSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(2, "Type", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(AliasSchema.SetType), false); + AliasSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/AlphaKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AlphaKeyframeSchema.cs index e842f42..8727c83 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/AlphaKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/AlphaKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new AlphaKeyframe(); + private static object Construct() => new AlphaKeyframe(); - public static void Pass1Initialize() => AlphaKeyframeSchema.Type = new UIXTypeSchema((short)4, "AlphaKeyframe", (string)null, (short)130, typeof(AlphaKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => AlphaKeyframeSchema.Type = new UIXTypeSchema(4, "AlphaKeyframe", null, 130, typeof(AlphaKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)4, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AlphaKeyframeSchema.GetValue), new SetValueHandler(AlphaKeyframeSchema.SetValue), false); - AlphaKeyframeSchema.Type.Initialize(new DefaultConstructHandler(AlphaKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(4, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AlphaKeyframeSchema.GetValue), new SetValueHandler(AlphaKeyframeSchema.SetValue), false); + AlphaKeyframeSchema.Type.Initialize(new DefaultConstructHandler(AlphaKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/AnchorEdgeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AnchorEdgeSchema.cs index 39238ea..10a09ba 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/AnchorEdgeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/AnchorEdgeSchema.cs @@ -14,35 +14,35 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetId(object instanceObj) => (object)((AnchorEdge)instanceObj).Id; + private static object GetId(object instanceObj) => ((AnchorEdge)instanceObj).Id; private static void SetId(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).Id = (string)valueObj; - private static object GetPercent(object instanceObj) => (object)((AnchorEdge)instanceObj).Percent; + private static object GetPercent(object instanceObj) => ((AnchorEdge)instanceObj).Percent; private static void SetPercent(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).Percent = (float)valueObj; - private static object GetOffset(object instanceObj) => (object)((AnchorEdge)instanceObj).Offset; + private static object GetOffset(object instanceObj) => ((AnchorEdge)instanceObj).Offset; private static void SetOffset(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).Offset = (int)valueObj; - private static object GetMaximumPercent(object instanceObj) => (object)((AnchorEdge)instanceObj).MaximumPercent; + private static object GetMaximumPercent(object instanceObj) => ((AnchorEdge)instanceObj).MaximumPercent; private static void SetMaximumPercent(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).MaximumPercent = (float)valueObj; - private static object GetMaximumOffset(object instanceObj) => (object)((AnchorEdge)instanceObj).MaximumOffset; + private static object GetMaximumOffset(object instanceObj) => ((AnchorEdge)instanceObj).MaximumOffset; private static void SetMaximumOffset(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).MaximumOffset = (int)valueObj; - private static object GetMinimumPercent(object instanceObj) => (object)((AnchorEdge)instanceObj).MinimumPercent; + private static object GetMinimumPercent(object instanceObj) => ((AnchorEdge)instanceObj).MinimumPercent; private static void SetMinimumPercent(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).MinimumPercent = (float)valueObj; - private static object GetMinimumOffset(object instanceObj) => (object)((AnchorEdge)instanceObj).MinimumOffset; + private static object GetMinimumOffset(object instanceObj) => ((AnchorEdge)instanceObj).MinimumOffset; private static void SetMinimumOffset(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).MinimumOffset = (int)valueObj; - private static object Construct() => (object)new AnchorEdge(); + private static object Construct() => new AnchorEdge(); private static object ConstructIdPercent(object[] parameters) { @@ -58,14 +58,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = AnchorEdgeSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"AnchorEdge", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result1.Error); AnchorEdgeSchema.SetId(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"AnchorEdge", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result2.Error); AnchorEdgeSchema.SetPercent(ref instance, valueObj2); return result2; } @@ -85,19 +85,19 @@ namespace Microsoft.Iris.Markup.UIX { instance = AnchorEdgeSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"AnchorEdge", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result1.Error); AnchorEdgeSchema.SetId(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"AnchorEdge", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result2.Error); AnchorEdgeSchema.SetPercent(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], Int32Schema.Type, null, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"AnchorEdge", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result3.Error); AnchorEdgeSchema.SetOffset(ref instance, valueObj3); return result3; } @@ -110,7 +110,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -127,49 +127,49 @@ namespace Microsoft.Iris.Markup.UIX return result; break; default: - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"AnchorEdge"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "AnchorEdge"); break; } } return result; } - public static void Pass1Initialize() => AnchorEdgeSchema.Type = new UIXTypeSchema((short)6, "AnchorEdge", (string)null, (short)153, typeof(AnchorEdge), UIXTypeFlags.None); + public static void Pass1Initialize() => AnchorEdgeSchema.Type = new UIXTypeSchema(6, "AnchorEdge", null, 153, typeof(AnchorEdge), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)6, "Id", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorEdgeSchema.GetId), new SetValueHandler(AnchorEdgeSchema.SetId), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)6, "Percent", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorEdgeSchema.GetPercent), new SetValueHandler(AnchorEdgeSchema.SetPercent), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)6, "Offset", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorEdgeSchema.GetOffset), new SetValueHandler(AnchorEdgeSchema.SetOffset), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)6, "MaximumPercent", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorEdgeSchema.GetMaximumPercent), new SetValueHandler(AnchorEdgeSchema.SetMaximumPercent), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)6, "MaximumOffset", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorEdgeSchema.GetMaximumOffset), new SetValueHandler(AnchorEdgeSchema.SetMaximumOffset), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)6, "MinimumPercent", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorEdgeSchema.GetMinimumPercent), new SetValueHandler(AnchorEdgeSchema.SetMinimumPercent), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)6, "MinimumOffset", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorEdgeSchema.GetMinimumOffset), new SetValueHandler(AnchorEdgeSchema.SetMinimumOffset), false); - UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema((short)6, new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(6, "Id", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorEdgeSchema.GetId), new SetValueHandler(AnchorEdgeSchema.SetId), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(6, "Percent", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorEdgeSchema.GetPercent), new SetValueHandler(AnchorEdgeSchema.SetPercent), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(6, "Offset", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorEdgeSchema.GetOffset), new SetValueHandler(AnchorEdgeSchema.SetOffset), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(6, "MaximumPercent", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorEdgeSchema.GetMaximumPercent), new SetValueHandler(AnchorEdgeSchema.SetMaximumPercent), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(6, "MaximumOffset", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorEdgeSchema.GetMaximumOffset), new SetValueHandler(AnchorEdgeSchema.SetMaximumOffset), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(6, "MinimumPercent", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorEdgeSchema.GetMinimumPercent), new SetValueHandler(AnchorEdgeSchema.SetMinimumPercent), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(6, "MinimumOffset", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorEdgeSchema.GetMinimumOffset), new SetValueHandler(AnchorEdgeSchema.SetMinimumOffset), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(6, new short[2] { - (short) 208, - (short) 194 + 208, + 194 }, new ConstructHandler(AnchorEdgeSchema.ConstructIdPercent)); - UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema((short)6, new short[3] + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(6, new short[3] { - (short) 208, - (short) 194, - (short) 115 + 208, + 194, + 115 }, new ConstructHandler(AnchorEdgeSchema.ConstructIdPercentOffset)); AnchorEdgeSchema.Type.Initialize(new DefaultConstructHandler(AnchorEdgeSchema.Construct), new ConstructorSchema[2] { - (ConstructorSchema) constructorSchema1, - (ConstructorSchema) constructorSchema2 + constructorSchema1, + constructorSchema2 }, new PropertySchema[7] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(AnchorEdgeSchema.TryConvertFrom), new SupportsTypeConversionHandler(AnchorEdgeSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema7, + uixPropertySchema6, + uixPropertySchema3, + uixPropertySchema2 + }, null, null, null, new TypeConverterHandler(AnchorEdgeSchema.TryConvertFrom), new SupportsTypeConversionHandler(AnchorEdgeSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutInputSchema.cs index 957e86c..404e06a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutInputSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutInputSchema.cs @@ -13,19 +13,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetLeft(object instanceObj) => (object)((AnchorLayoutInput)instanceObj).Left; + private static object GetLeft(object instanceObj) => ((AnchorLayoutInput)instanceObj).Left; private static void SetLeft(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).Left = (AnchorEdge)valueObj; - private static object GetTop(object instanceObj) => (object)((AnchorLayoutInput)instanceObj).Top; + private static object GetTop(object instanceObj) => ((AnchorLayoutInput)instanceObj).Top; private static void SetTop(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).Top = (AnchorEdge)valueObj; - private static object GetRight(object instanceObj) => (object)((AnchorLayoutInput)instanceObj).Right; + private static object GetRight(object instanceObj) => ((AnchorLayoutInput)instanceObj).Right; private static void SetRight(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).Right = (AnchorEdge)valueObj; - private static object GetBottom(object instanceObj) => (object)((AnchorLayoutInput)instanceObj).Bottom; + private static object GetBottom(object instanceObj) => ((AnchorLayoutInput)instanceObj).Bottom; private static void SetBottom(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).Bottom = (AnchorEdge)valueObj; @@ -37,13 +37,13 @@ namespace Microsoft.Iris.Markup.UIX private static void SetContributesToHeight(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).ContributesToHeight = (bool)valueObj; - private static object Construct() => (object)new AnchorLayoutInput(); + private static object Construct() => new AnchorLayoutInput(); private static Result ConvertFromString(object valueObj, out object instanceObj) { string id = (string)valueObj; - instanceObj = (object)null; - instanceObj = (object)new AnchorLayoutInput() + instanceObj = null; + instanceObj = new AnchorLayoutInput() { Left = new AnchorEdge(id, 0.0f), Top = new AnchorEdge(id, 0.0f), @@ -61,7 +61,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = AnchorLayoutInputSchema.ConvertFromString(from, out instance); @@ -78,36 +78,36 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; AnchorLayoutInput parameter2 = (AnchorLayoutInput)parameters[1]; object instanceObj1; - return AnchorLayoutInputSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return AnchorLayoutInputSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => AnchorLayoutInputSchema.Type = new UIXTypeSchema((short)8, "AnchorLayoutInput", (string)null, (short)133, typeof(AnchorLayoutInput), UIXTypeFlags.None); + public static void Pass1Initialize() => AnchorLayoutInputSchema.Type = new UIXTypeSchema(8, "AnchorLayoutInput", null, 133, typeof(AnchorLayoutInput), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)8, "Left", (short)6, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutInputSchema.GetLeft), new SetValueHandler(AnchorLayoutInputSchema.SetLeft), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)8, "Top", (short)6, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutInputSchema.GetTop), new SetValueHandler(AnchorLayoutInputSchema.SetTop), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)8, "Right", (short)6, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutInputSchema.GetRight), new SetValueHandler(AnchorLayoutInputSchema.SetRight), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)8, "Bottom", (short)6, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutInputSchema.GetBottom), new SetValueHandler(AnchorLayoutInputSchema.SetBottom), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)8, "ContributesToWidth", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutInputSchema.GetContributesToWidth), new SetValueHandler(AnchorLayoutInputSchema.SetContributesToWidth), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)8, "ContributesToHeight", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutInputSchema.GetContributesToHeight), new SetValueHandler(AnchorLayoutInputSchema.SetContributesToHeight), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)8, "TryParse", new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(8, "Left", 6, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutInputSchema.GetLeft), new SetValueHandler(AnchorLayoutInputSchema.SetLeft), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(8, "Top", 6, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutInputSchema.GetTop), new SetValueHandler(AnchorLayoutInputSchema.SetTop), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(8, "Right", 6, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutInputSchema.GetRight), new SetValueHandler(AnchorLayoutInputSchema.SetRight), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(8, "Bottom", 6, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutInputSchema.GetBottom), new SetValueHandler(AnchorLayoutInputSchema.SetBottom), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(8, "ContributesToWidth", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutInputSchema.GetContributesToWidth), new SetValueHandler(AnchorLayoutInputSchema.SetContributesToWidth), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(8, "ContributesToHeight", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutInputSchema.GetContributesToHeight), new SetValueHandler(AnchorLayoutInputSchema.SetContributesToHeight), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(8, "TryParse", new short[2] { - (short) 208, - (short) 8 - }, (short)8, new InvokeHandler(AnchorLayoutInputSchema.CallTryParseStringAnchorLayoutInput), true); - AnchorLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(AnchorLayoutInputSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + 208, + 8 + }, 8, new InvokeHandler(AnchorLayoutInputSchema.CallTryParseStringAnchorLayoutInput), true); + AnchorLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(AnchorLayoutInputSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2 + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(AnchorLayoutInputSchema.TryConvertFrom), new SupportsTypeConversionHandler(AnchorLayoutInputSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, new TypeConverterHandler(AnchorLayoutInputSchema.TryConvertFrom), new SupportsTypeConversionHandler(AnchorLayoutInputSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutSchema.cs index cc48337..8cd959b 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutSchema.cs @@ -23,11 +23,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetSizeToVerticalChildren(ref object instanceObj, object valueObj) => ((AnchorLayout)instanceObj).SizeToVerticalChildren = (bool)valueObj; - private static object GetDefaultChildAlignment(object instanceObj) => (object)((AnchorLayout)instanceObj).DefaultChildAlignment; + private static object GetDefaultChildAlignment(object instanceObj) => ((AnchorLayout)instanceObj).DefaultChildAlignment; private static void SetDefaultChildAlignment(ref object instanceObj, object valueObj) => ((AnchorLayout)instanceObj).DefaultChildAlignment = (ItemAlignment)valueObj; - private static object Construct() => (object)new AnchorLayout(); + private static object Construct() => new AnchorLayout(); private static object ConstructSizeToHorizontalChildrenSizeToVerticalChildren( object[] parameters) @@ -44,14 +44,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = AnchorLayoutSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)BooleanSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], BooleanSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"AnchorLayout", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "AnchorLayout", result1.Error); AnchorLayoutSchema.SetSizeToHorizontalChildren(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)BooleanSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], BooleanSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"AnchorLayout", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "AnchorLayout", result2.Error); AnchorLayoutSchema.SetSizeToVerticalChildren(ref instance, valueObj2); return result2; } @@ -64,7 +64,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -75,32 +75,32 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"AnchorLayout"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "AnchorLayout"); } return result; } - public static void Pass1Initialize() => AnchorLayoutSchema.Type = new UIXTypeSchema((short)7, "AnchorLayout", (string)null, (short)132, typeof(AnchorLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => AnchorLayoutSchema.Type = new UIXTypeSchema(7, "AnchorLayout", null, 132, typeof(AnchorLayout), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)7, "SizeToHorizontalChildren", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutSchema.GetSizeToHorizontalChildren), new SetValueHandler(AnchorLayoutSchema.SetSizeToHorizontalChildren), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)7, "SizeToVerticalChildren", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutSchema.GetSizeToVerticalChildren), new SetValueHandler(AnchorLayoutSchema.SetSizeToVerticalChildren), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)7, "DefaultChildAlignment", (short)sbyte.MaxValue, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnchorLayoutSchema.GetDefaultChildAlignment), new SetValueHandler(AnchorLayoutSchema.SetDefaultChildAlignment), false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)7, new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(7, "SizeToHorizontalChildren", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutSchema.GetSizeToHorizontalChildren), new SetValueHandler(AnchorLayoutSchema.SetSizeToHorizontalChildren), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(7, "SizeToVerticalChildren", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutSchema.GetSizeToVerticalChildren), new SetValueHandler(AnchorLayoutSchema.SetSizeToVerticalChildren), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(7, "DefaultChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnchorLayoutSchema.GetDefaultChildAlignment), new SetValueHandler(AnchorLayoutSchema.SetDefaultChildAlignment), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(7, new short[2] { - (short) 15, - (short) 15 + 15, + 15 }, new ConstructHandler(AnchorLayoutSchema.ConstructSizeToHorizontalChildrenSizeToVerticalChildren)); AnchorLayoutSchema.Type.Initialize(new DefaultConstructHandler(AnchorLayoutSchema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(AnchorLayoutSchema.TryConvertFrom), new SupportsTypeConversionHandler(AnchorLayoutSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, new TypeConverterHandler(AnchorLayoutSchema.TryConvertFrom), new SupportsTypeConversionHandler(AnchorLayoutSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/AnimationHandleSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AnimationHandleSchema.cs index 9c1b8b1..b084657 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/AnimationHandleSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/AnimationHandleSchema.cs @@ -14,21 +14,21 @@ namespace Microsoft.Iris.Markup.UIX private static object GetPlaying(object instanceObj) => BooleanBoxes.Box(((AnimationHandle)instanceObj).Playing); - private static object Construct() => (object)new AnimationHandle(); + private static object Construct() => new AnimationHandle(); - public static void Pass1Initialize() => AnimationHandleSchema.Type = new UIXTypeSchema((short)11, "AnimationHandle", (string)null, (short)153, typeof(AnimationHandle), UIXTypeFlags.None); + public static void Pass1Initialize() => AnimationHandleSchema.Type = new UIXTypeSchema(11, "AnimationHandle", null, 153, typeof(AnimationHandle), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)11, "Playing", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(AnimationHandleSchema.GetPlaying), (SetValueHandler)null, false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)11, "Completed"); - AnimationHandleSchema.Type.Initialize(new DefaultConstructHandler(AnimationHandleSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(11, "Playing", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(AnimationHandleSchema.GetPlaying), null, false); + UIXEventSchema uixEventSchema = new UIXEventSchema(11, "Completed"); + AnimationHandleSchema.Type.Initialize(new DefaultConstructHandler(AnimationHandleSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, new EventSchema[1] + uixPropertySchema + }, null, new EventSchema[1] { - (EventSchema) uixEventSchema - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/AnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AnimationSchema.cs index 1815b7f..f2477fa 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/AnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/AnimationSchema.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Markup.UIX public static RangeValidator ValidateLoopValue = new RangeValidator(AnimationSchema.RangeValidateLoopValue); public static UIXTypeSchema Type; - private static object GetCenterPointPercent(object instanceObj) => (object)((Animation)instanceObj).CenterPointPercent; + private static object GetCenterPointPercent(object instanceObj) => ((Animation)instanceObj).CenterPointPercent; private static void SetCenterPointPercent(ref object instanceObj, object valueObj) => ((Animation)instanceObj).CenterPointPercent = (Vector3)valueObj; @@ -24,9 +24,9 @@ namespace Microsoft.Iris.Markup.UIX private static void SetDisableMouseInput(ref object instanceObj, object valueObj) => ((Animation)instanceObj).DisableMouseInput = (bool)valueObj; - private static object GetKeyframes(object instanceObj) => (object)((AnimationTemplate)instanceObj).Keyframes; + private static object GetKeyframes(object instanceObj) => ((AnimationTemplate)instanceObj).Keyframes; - private static object GetLoop(object instanceObj) => (object)((AnimationTemplate)instanceObj).Loop; + private static object GetLoop(object instanceObj) => ((AnimationTemplate)instanceObj).Loop; private static void SetLoop(ref object instanceObj, object valueObj) { @@ -39,41 +39,41 @@ namespace Microsoft.Iris.Markup.UIX animation.Loop = num; } - private static object GetRotationAxis(object instanceObj) => (object)((Animation)instanceObj).RotationAxis; + private static object GetRotationAxis(object instanceObj) => ((Animation)instanceObj).RotationAxis; private static void SetRotationAxis(ref object instanceObj, object valueObj) => ((Animation)instanceObj).RotationAxis = (Vector3)valueObj; - private static object GetType(object instanceObj) => (object)((Animation)instanceObj).Type; + private static object GetType(object instanceObj) => ((Animation)instanceObj).Type; private static void SetType(ref object instanceObj, object valueObj) => ((Animation)instanceObj).Type = (AnimationEventType)valueObj; - private static object Construct() => (object)new Animation(); + private static object Construct() => new Animation(); private static Result RangeValidateLoopValue(object value) { int num = (int)value; - return num < -1 ? Result.Fail("Expecting a value no smaller than {0}, but got {1}", (object)"-1", (object)num.ToString()) : Result.Success; + return num < -1 ? Result.Fail("Expecting a value no smaller than {0}, but got {1}", "-1", num.ToString()) : Result.Success; } - public static void Pass1Initialize() => AnimationSchema.Type = new UIXTypeSchema((short)9, "Animation", (string)null, (short)104, typeof(Animation), UIXTypeFlags.None); + public static void Pass1Initialize() => AnimationSchema.Type = new UIXTypeSchema(9, "Animation", null, 104, typeof(Animation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)9, "CenterPointPercent", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnimationSchema.GetCenterPointPercent), new SetValueHandler(AnimationSchema.SetCenterPointPercent), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)9, "DisableMouseInput", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnimationSchema.GetDisableMouseInput), new SetValueHandler(AnimationSchema.SetDisableMouseInput), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)9, "Keyframes", (short)138, (short)130, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnimationSchema.GetKeyframes), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)9, "Loop", (short)115, (short)-1, ExpressionRestriction.None, false, AnimationSchema.ValidateLoopValue, false, new GetValueHandler(AnimationSchema.GetLoop), new SetValueHandler(AnimationSchema.SetLoop), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)9, "RotationAxis", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnimationSchema.GetRotationAxis), new SetValueHandler(AnimationSchema.SetRotationAxis), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)9, "Type", (short)10, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(AnimationSchema.GetType), new SetValueHandler(AnimationSchema.SetType), false); - AnimationSchema.Type.Initialize(new DefaultConstructHandler(AnimationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(9, "CenterPointPercent", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnimationSchema.GetCenterPointPercent), new SetValueHandler(AnimationSchema.SetCenterPointPercent), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(9, "DisableMouseInput", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnimationSchema.GetDisableMouseInput), new SetValueHandler(AnimationSchema.SetDisableMouseInput), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(9, "Keyframes", 138, 130, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnimationSchema.GetKeyframes), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(9, "Loop", 115, -1, ExpressionRestriction.None, false, AnimationSchema.ValidateLoopValue, false, new GetValueHandler(AnimationSchema.GetLoop), new SetValueHandler(AnimationSchema.SetLoop), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(9, "RotationAxis", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnimationSchema.GetRotationAxis), new SetValueHandler(AnimationSchema.SetRotationAxis), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(9, "Type", 10, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(AnimationSchema.GetType), new SetValueHandler(AnimationSchema.SetType), false); + AnimationSchema.Type.Initialize(new DefaultConstructHandler(AnimationSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema6 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema6 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/BlendSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/BlendSchema.cs index 02ffc1d..5c67b3b 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/BlendSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/BlendSchema.cs @@ -12,39 +12,39 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetInput1(object instanceObj) => (object)((BlendElement)instanceObj).Input1; + private static object GetInput1(object instanceObj) => ((BlendElement)instanceObj).Input1; private static void SetInput1(ref object instanceObj, object valueObj) => ((BlendElement)instanceObj).Input1 = (EffectInput)valueObj; - private static object GetInput2(object instanceObj) => (object)((BlendElement)instanceObj).Input2; + private static object GetInput2(object instanceObj) => ((BlendElement)instanceObj).Input2; private static void SetInput2(ref object instanceObj, object valueObj) => ((BlendElement)instanceObj).Input2 = (EffectInput)valueObj; - private static object GetColorOperation(object instanceObj) => (object)((BlendElement)instanceObj).ColorOperation; + private static object GetColorOperation(object instanceObj) => ((BlendElement)instanceObj).ColorOperation; private static void SetColorOperation(ref object instanceObj, object valueObj) => ((BlendElement)instanceObj).ColorOperation = (ColorOperation)valueObj; - private static object GetAlphaOperation(object instanceObj) => (object)((BlendElement)instanceObj).AlphaOperation; + private static object GetAlphaOperation(object instanceObj) => ((BlendElement)instanceObj).AlphaOperation; private static void SetAlphaOperation(ref object instanceObj, object valueObj) => ((BlendElement)instanceObj).AlphaOperation = (AlphaOperation)valueObj; - private static object Construct() => (object)new BlendElement(); + private static object Construct() => new BlendElement(); - public static void Pass1Initialize() => BlendSchema.Type = new UIXTypeSchema((short)13, "Blend", (string)null, (short)77, typeof(BlendElement), UIXTypeFlags.None); + public static void Pass1Initialize() => BlendSchema.Type = new UIXTypeSchema(13, "Blend", null, 77, typeof(BlendElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)13, "Input1", (short)77, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(BlendSchema.GetInput1), new SetValueHandler(BlendSchema.SetInput1), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)13, "Input2", (short)77, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(BlendSchema.GetInput2), new SetValueHandler(BlendSchema.SetInput2), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)13, "ColorOperation", (short)38, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(BlendSchema.GetColorOperation), new SetValueHandler(BlendSchema.SetColorOperation), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)13, "AlphaOperation", (short)5, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(BlendSchema.GetAlphaOperation), new SetValueHandler(BlendSchema.SetAlphaOperation), false); - BlendSchema.Type.Initialize(new DefaultConstructHandler(BlendSchema.Construct), (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(13, "Input1", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(BlendSchema.GetInput1), new SetValueHandler(BlendSchema.SetInput1), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(13, "Input2", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(BlendSchema.GetInput2), new SetValueHandler(BlendSchema.SetInput2), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(13, "ColorOperation", 38, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(BlendSchema.GetColorOperation), new SetValueHandler(BlendSchema.SetColorOperation), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(13, "AlphaOperation", 5, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(BlendSchema.GetAlphaOperation), new SetValueHandler(BlendSchema.SetAlphaOperation), false); + BlendSchema.Type.Initialize(new DefaultConstructHandler(BlendSchema.Construct), null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema4, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/BlurSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/BlurSchema.cs index 786495b..e5b4b73 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/BlurSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/BlurSchema.cs @@ -12,33 +12,33 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetMode(object instanceObj) => (object)((GaussianBlurElement)instanceObj).Mode; + private static object GetMode(object instanceObj) => ((GaussianBlurElement)instanceObj).Mode; private static void SetMode(ref object instanceObj, object valueObj) => ((GaussianBlurElement)instanceObj).Mode = (GaussianBlurMode)valueObj; - private static object GetKernelRadius(object instanceObj) => (object)((GaussianBlurElement)instanceObj).KernelRadius; + private static object GetKernelRadius(object instanceObj) => ((GaussianBlurElement)instanceObj).KernelRadius; private static void SetKernelRadius(ref object instanceObj, object valueObj) => ((GaussianBlurElement)instanceObj).KernelRadius = (int)valueObj; - private static object GetBluriness(object instanceObj) => (object)((GaussianBlurElement)instanceObj).Bluriness; + private static object GetBluriness(object instanceObj) => ((GaussianBlurElement)instanceObj).Bluriness; private static void SetBluriness(ref object instanceObj, object valueObj) => ((GaussianBlurElement)instanceObj).Bluriness = (float)valueObj; - private static object Construct() => (object)new GaussianBlurElement(); + private static object Construct() => new GaussianBlurElement(); - public static void Pass1Initialize() => BlurSchema.Type = new UIXTypeSchema((short)14, "Blur", (string)null, (short)80, typeof(GaussianBlurElement), UIXTypeFlags.None); + public static void Pass1Initialize() => BlurSchema.Type = new UIXTypeSchema(14, "Blur", null, 80, typeof(GaussianBlurElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)14, "Mode", (short)96, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(BlurSchema.GetMode), new SetValueHandler(BlurSchema.SetMode), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)14, "KernelRadius", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(BlurSchema.GetKernelRadius), new SetValueHandler(BlurSchema.SetKernelRadius), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)14, "Bluriness", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(BlurSchema.GetBluriness), new SetValueHandler(BlurSchema.SetBluriness), false); - BlurSchema.Type.Initialize(new DefaultConstructHandler(BlurSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(14, "Mode", 96, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(BlurSchema.GetMode), new SetValueHandler(BlurSchema.SetMode), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(14, "KernelRadius", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(BlurSchema.GetKernelRadius), new SetValueHandler(BlurSchema.SetKernelRadius), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(14, "Bluriness", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(BlurSchema.GetBluriness), new SetValueHandler(BlurSchema.SetBluriness), false); + BlurSchema.Type.Initialize(new DefaultConstructHandler(BlurSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/BooleanChoiceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/BooleanChoiceSchema.cs index 1822261..b46bf12 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/BooleanChoiceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/BooleanChoiceSchema.cs @@ -23,17 +23,17 @@ namespace Microsoft.Iris.Markup.UIX uiBooleanChoice.ChosenIndex = 0; } - private static object Construct() => (object)new Microsoft.Iris.ModelItems.BooleanChoice(); + private static object Construct() => new Microsoft.Iris.ModelItems.BooleanChoice(); - public static void Pass1Initialize() => BooleanChoiceSchema.Type = new UIXTypeSchema((short)16, "BooleanChoice", (string)null, (short)28, typeof(IUIBooleanChoice), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => BooleanChoiceSchema.Type = new UIXTypeSchema(16, "BooleanChoice", null, 28, typeof(IUIBooleanChoice), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)16, "Value", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(BooleanChoiceSchema.GetValue), new SetValueHandler(BooleanChoiceSchema.SetValue), false); - BooleanChoiceSchema.Type.Initialize(new DefaultConstructHandler(BooleanChoiceSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(16, "Value", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(BooleanChoiceSchema.GetValue), new SetValueHandler(BooleanChoiceSchema.SetValue), false); + BooleanChoiceSchema.Type.Initialize(new DefaultConstructHandler(BooleanChoiceSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/BooleanSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/BooleanSchema.cs index cbe42a5..4435954 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/BooleanSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/BooleanSchema.cs @@ -25,10 +25,10 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; bool result; if (!bool.TryParse(str, out result)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"Boolean"); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Boolean"); instanceObj = BooleanBoxes.Box(result); return Result.Success; } @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromInt32(object valueObj, out object instanceObj) { int num = (int)valueObj; - instanceObj = (object)null; + instanceObj = null; bool flag = num != 0; instanceObj = BooleanBoxes.Box(flag); return Result.Success; @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromInt64(object valueObj, out object instanceObj) { long num = (long)valueObj; - instanceObj = (object)null; + instanceObj = null; bool flag = num != 0L; instanceObj = BooleanBoxes.Box(flag); return Result.Success; @@ -54,8 +54,8 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromSingle(object valueObj, out object instanceObj) { float num = (float)valueObj; - instanceObj = (object)null; - bool flag = (double)num != 0.0; + instanceObj = null; + bool flag = num != 0.0; instanceObj = BooleanBoxes.Box(flag); return Result.Success; } @@ -63,7 +63,7 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromDouble(object valueObj, out object instanceObj) { double num = (double)valueObj; - instanceObj = (object)null; + instanceObj = null; bool flag = num != 0.0; instanceObj = BooleanBoxes.Box(flag); return Result.Success; @@ -77,7 +77,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (DoubleSchema.Type.IsAssignableFrom(fromType)) { result = BooleanSchema.ConvertFromDouble(from, out instance); @@ -134,7 +134,7 @@ namespace Microsoft.Iris.Markup.UIX bool flag2 = (bool)rightObj; switch (op - 6) { - case (OperationType)0: + case 0: return BooleanBoxes.Box(flag1 && flag2); case OperationType.MathAdd: return BooleanBoxes.Box(flag1 || flag2); @@ -143,7 +143,7 @@ namespace Microsoft.Iris.Markup.UIX case OperationType.MathMultiply: return BooleanBoxes.Box(flag1 != flag2); default: - return (object)null; + return null; } } @@ -152,22 +152,22 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; bool parameter2 = (bool)parameters[1]; object instanceObj1; - return BooleanSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return BooleanSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => BooleanSchema.Type = new UIXTypeSchema((short)15, "Boolean", "bool", (short)153, typeof(bool), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => BooleanSchema.Type = new UIXTypeSchema(15, "Boolean", "bool", 153, typeof(bool), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)15, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(15, "TryParse", new short[2] { - (short) 208, - (short) 15 - }, (short)15, new InvokeHandler(BooleanSchema.CallTryParseStringBoolean), true); - BooleanSchema.Type.Initialize(new DefaultConstructHandler(BooleanSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[1] + 208, + 15 + }, 15, new InvokeHandler(BooleanSchema.CallTryParseStringBoolean), true); + BooleanSchema.Type.Initialize(new DefaultConstructHandler(BooleanSchema.Construct), null, null, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(BooleanSchema.TryConvertFrom), new SupportsTypeConversionHandler(BooleanSchema.IsConversionSupported), new EncodeBinaryHandler(BooleanSchema.EncodeBinary), new DecodeBinaryHandler(BooleanSchema.DecodeBinary), new PerformOperationHandler(BooleanSchema.ExecuteOperation), new SupportsOperationHandler(BooleanSchema.IsOperationSupported)); + uixMethodSchema + }, null, null, new TypeConverterHandler(BooleanSchema.TryConvertFrom), new SupportsTypeConversionHandler(BooleanSchema.IsConversionSupported), new EncodeBinaryHandler(BooleanSchema.EncodeBinary), new DecodeBinaryHandler(BooleanSchema.DecodeBinary), new PerformOperationHandler(BooleanSchema.ExecuteOperation), new SupportsOperationHandler(BooleanSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/BrightnessInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/BrightnessInstanceSchema.cs index 07c9cfd..27388fe 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/BrightnessInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/BrightnessInstanceSchema.cs @@ -20,25 +20,25 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Brightness, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => BrightnessInstanceSchema.Type = new UIXTypeSchema((short)18, "BrightnessInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => BrightnessInstanceSchema.Type = new UIXTypeSchema(18, "BrightnessInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)18, "Brightness", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(BrightnessInstanceSchema.SetBrightness), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)18, "PlayBrightnessAnimation", new short[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(18, "Brightness", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(BrightnessInstanceSchema.SetBrightness), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(18, "PlayBrightnessAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(BrightnessInstanceSchema.CallPlayBrightnessAnimationEffectFloatAnimation), false); - BrightnessInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + 75 + }, 240, new InvokeHandler(BrightnessInstanceSchema.CallPlayBrightnessAnimationEffectFloatAnimation), false); + BrightnessInstanceSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/BrightnessSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/BrightnessSchema.cs index b4d6951..40f5caf 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/BrightnessSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/BrightnessSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetBrightness(object instanceObj) => (object)((BrightnessElement)instanceObj).Brightness; + private static object GetBrightness(object instanceObj) => ((BrightnessElement)instanceObj).Brightness; private static void SetBrightness(ref object instanceObj, object valueObj) => ((BrightnessElement)instanceObj).Brightness = (float)valueObj; - private static object Construct() => (object)new BrightnessElement(); + private static object Construct() => new BrightnessElement(); - public static void Pass1Initialize() => BrightnessSchema.Type = new UIXTypeSchema((short)17, "Brightness", (string)null, (short)80, typeof(BrightnessElement), UIXTypeFlags.None); + public static void Pass1Initialize() => BrightnessSchema.Type = new UIXTypeSchema(17, "Brightness", null, 80, typeof(BrightnessElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)17, "Brightness", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(BrightnessSchema.GetBrightness), new SetValueHandler(BrightnessSchema.SetBrightness), false); - BrightnessSchema.Type.Initialize(new DefaultConstructHandler(BrightnessSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(17, "Brightness", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(BrightnessSchema.GetBrightness), new SetValueHandler(BrightnessSchema.SetBrightness), false); + BrightnessSchema.Type.Initialize(new DefaultConstructHandler(BrightnessSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ByteRangedValueSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ByteRangedValueSchema.cs index c1aa1a3..24d3346 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ByteRangedValueSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ByteRangedValueSchema.cs @@ -13,55 +13,55 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetMinValue(object instanceObj) => (object)(byte)((IUIRangedValue)instanceObj).MinValue; + private static object GetMinValue(object instanceObj) => (byte)((IUIRangedValue)instanceObj).MinValue; private static void SetMinValue(ref object instanceObj, object valueObj) { IUIByteRangedValue uiByteRangedValue = (IUIByteRangedValue)instanceObj; byte num = (byte)valueObj; - if ((double)num > (double)uiByteRangedValue.MaxValue) - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)num, (object)"MinValue"); + if (num > (double)uiByteRangedValue.MaxValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MinValue"); else - uiByteRangedValue.MinValue = (float)num; + uiByteRangedValue.MinValue = num; } - private static object GetMaxValue(object instanceObj) => (object)(byte)((IUIRangedValue)instanceObj).MaxValue; + private static object GetMaxValue(object instanceObj) => (byte)((IUIRangedValue)instanceObj).MaxValue; private static void SetMaxValue(ref object instanceObj, object valueObj) { IUIByteRangedValue uiByteRangedValue = (IUIByteRangedValue)instanceObj; byte num = (byte)valueObj; - if ((double)num < (double)uiByteRangedValue.MinValue) - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)num, (object)"MaxValue"); + if (num < (double)uiByteRangedValue.MinValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MaxValue"); else - uiByteRangedValue.MaxValue = (float)num; + uiByteRangedValue.MaxValue = num; } - private static object GetStep(object instanceObj) => (object)(byte)((IUIRangedValue)instanceObj).Step; + private static object GetStep(object instanceObj) => (byte)((IUIRangedValue)instanceObj).Step; - private static void SetStep(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Step = (float)(byte)valueObj; + private static void SetStep(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Step = (byte)valueObj; - private static object GetValue(object instanceObj) => (object)(byte)((IUIRangedValue)instanceObj).Value; + private static object GetValue(object instanceObj) => (byte)((IUIRangedValue)instanceObj).Value; - private static void SetValue(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Value = (float)(byte)valueObj; + private static void SetValue(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Value = (byte)valueObj; - private static object Construct() => (object)new Microsoft.Iris.ModelItems.ByteRangedValue(); + private static object Construct() => new Microsoft.Iris.ModelItems.ByteRangedValue(); - public static void Pass1Initialize() => ByteRangedValueSchema.Type = new UIXTypeSchema((short)20, "ByteRangedValue", (string)null, (short)168, typeof(IUIByteRangedValue), UIXTypeFlags.None); + public static void Pass1Initialize() => ByteRangedValueSchema.Type = new UIXTypeSchema(20, "ByteRangedValue", null, 168, typeof(IUIByteRangedValue), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)20, "MinValue", (short)19, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ByteRangedValueSchema.GetMinValue), new SetValueHandler(ByteRangedValueSchema.SetMinValue), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)20, "MaxValue", (short)19, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ByteRangedValueSchema.GetMaxValue), new SetValueHandler(ByteRangedValueSchema.SetMaxValue), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)20, "Step", (short)19, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ByteRangedValueSchema.GetStep), new SetValueHandler(ByteRangedValueSchema.SetStep), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)20, "Value", (short)19, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ByteRangedValueSchema.GetValue), new SetValueHandler(ByteRangedValueSchema.SetValue), false); - ByteRangedValueSchema.Type.Initialize(new DefaultConstructHandler(ByteRangedValueSchema.Construct), (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(20, "MinValue", 19, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ByteRangedValueSchema.GetMinValue), new SetValueHandler(ByteRangedValueSchema.SetMinValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(20, "MaxValue", 19, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ByteRangedValueSchema.GetMaxValue), new SetValueHandler(ByteRangedValueSchema.SetMaxValue), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(20, "Step", 19, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ByteRangedValueSchema.GetStep), new SetValueHandler(ByteRangedValueSchema.SetStep), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(20, "Value", 19, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ByteRangedValueSchema.GetValue), new SetValueHandler(ByteRangedValueSchema.SetValue), false); + ByteRangedValueSchema.Type.Initialize(new DefaultConstructHandler(ByteRangedValueSchema.Construct), null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema4 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ByteSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ByteSchema.cs index 78a373c..e494395 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ByteSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ByteSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)(byte)0; + private static object Construct() => (byte)0; private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) { @@ -22,63 +22,64 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteByte(num); } - private static object DecodeBinary(ByteCodeReader reader) => (object)reader.ReadByte(); + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadByte(); - private static object CallToStringString(object instanceObj, object[] parameters) => (object)((byte)instanceObj).ToString((string)parameters[0]); + private static object CallToStringString(object instanceObj, object[] parameters) => ((byte)instanceObj).ToString((string)parameters[0]); private static Result ConvertFromString(object valueObj, out object instanceObj) { string s = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; byte result; - if (!byte.TryParse(s, NumberStyles.Integer, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)s, (object)"Byte"); - instanceObj = (object)result; + if (!byte.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out result)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", s, "Byte"); + instanceObj = result; return Result.Success; } private static Result ConvertFromBoolean(object valueObj, out object instanceObj) { bool flag = (bool)valueObj; - instanceObj = (object)null; - byte num = flag ? (byte)1 : (byte)0; - instanceObj = (object)num; + instanceObj = null; + byte num = 0; + if (flag) num = 1; + instanceObj = num; return Result.Success; } private static Result ConvertFromInt32(object valueObj, out object instanceObj) { int num1 = (int)valueObj; - instanceObj = (object)null; + instanceObj = null; byte num2 = (byte)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } private static Result ConvertFromInt64(object valueObj, out object instanceObj) { long num1 = (long)valueObj; - instanceObj = (object)null; + instanceObj = null; byte num2 = (byte)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } private static Result ConvertFromSingle(object valueObj, out object instanceObj) { float num1 = (float)valueObj; - instanceObj = (object)null; + instanceObj = null; byte num2 = (byte)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } private static Result ConvertFromDouble(object valueObj, out object instanceObj) { double num1 = (double)valueObj; - instanceObj = (object)null; + instanceObj = null; byte num2 = (byte)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } @@ -90,7 +91,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (BooleanSchema.Type.IsAssignableFrom(fromType)) { result = ByteSchema.ConvertFromBoolean(from, out instance); @@ -158,29 +159,29 @@ namespace Microsoft.Iris.Markup.UIX switch (op) { case OperationType.MathAdd: - return (object)(byte)((uint)num1 + (uint)num2); + return (byte)(num1 + (uint)num2); case OperationType.MathSubtract: - return (object)(byte)((uint)num1 - (uint)num2); + return (byte)(num1 - (uint)num2); case OperationType.MathMultiply: - return (object)(byte)((uint)num1 * (uint)num2); + return (byte)(num1 * (uint)num2); case OperationType.MathDivide: - return (object)(byte)((uint)num1 / (uint)num2); + return (byte)(num1 / (uint)num2); case OperationType.MathModulus: - return (object)(byte)((uint)num1 % (uint)num2); + return (byte)(num1 % (uint)num2); case OperationType.RelationalEquals: - return BooleanBoxes.Box((int)num1 == (int)num2); + return BooleanBoxes.Box(num1 == num2); case OperationType.RelationalNotEquals: - return BooleanBoxes.Box((int)num1 != (int)num2); + return BooleanBoxes.Box(num1 != num2); case OperationType.RelationalLessThan: - return BooleanBoxes.Box((int)num1 < (int)num2); + return BooleanBoxes.Box(num1 < num2); case OperationType.RelationalGreaterThan: - return BooleanBoxes.Box((int)num1 > (int)num2); + return BooleanBoxes.Box(num1 > num2); case OperationType.RelationalLessThanEquals: - return BooleanBoxes.Box((int)num1 <= (int)num2); + return BooleanBoxes.Box(num1 <= num2); case OperationType.RelationalGreaterThanEquals: - return BooleanBoxes.Box((int)num1 >= (int)num2); + return BooleanBoxes.Box(num1 >= num2); default: - return (object)null; + return null; } } @@ -189,27 +190,27 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; byte parameter2 = (byte)parameters[1]; object instanceObj1; - return ByteSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return ByteSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => ByteSchema.Type = new UIXTypeSchema((short)19, "Byte", "byte", (short)153, typeof(byte), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => ByteSchema.Type = new UIXTypeSchema(19, "Byte", "byte", 153, typeof(byte), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)19, "ToString", new short[1] + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(19, "ToString", new short[1] { - (short) 208 - }, (short)208, new InvokeHandler(ByteSchema.CallToStringString), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)19, "TryParse", new short[2] + 208 + }, 208, new InvokeHandler(ByteSchema.CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(19, "TryParse", new short[2] { - (short) 208, - (short) 19 - }, (short)19, new InvokeHandler(ByteSchema.CallTryParseStringByte), true); - ByteSchema.Type.Initialize(new DefaultConstructHandler(ByteSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[2] + 208, + 19 + }, 19, new InvokeHandler(ByteSchema.CallTryParseStringByte), true); + ByteSchema.Type.Initialize(new DefaultConstructHandler(ByteSchema.Construct), null, null, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(ByteSchema.TryConvertFrom), new SupportsTypeConversionHandler(ByteSchema.IsConversionSupported), new EncodeBinaryHandler(ByteSchema.EncodeBinary), new DecodeBinaryHandler(ByteSchema.DecodeBinary), new PerformOperationHandler(ByteSchema.ExecuteOperation), new SupportsOperationHandler(ByteSchema.IsOperationSupported)); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(ByteSchema.TryConvertFrom), new SupportsTypeConversionHandler(ByteSchema.IsConversionSupported), new EncodeBinaryHandler(ByteSchema.EncodeBinary), new DecodeBinaryHandler(ByteSchema.DecodeBinary), new PerformOperationHandler(ByteSchema.ExecuteOperation), new SupportsOperationHandler(ByteSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/CameraAtKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CameraAtKeyframeSchema.cs index e79a7d4..1c5e6b9 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/CameraAtKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraAtKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseVector3Keyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseVector3Keyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseVector3Keyframe)instanceObj).Value = (Vector3)valueObj; - private static object Construct() => (object)new CameraAtKeyframe(); + private static object Construct() => new CameraAtKeyframe(); - public static void Pass1Initialize() => CameraAtKeyframeSchema.Type = new UIXTypeSchema((short)22, "CameraAtKeyframe", (string)null, (short)130, typeof(CameraAtKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => CameraAtKeyframeSchema.Type = new UIXTypeSchema(22, "CameraAtKeyframe", null, 130, typeof(CameraAtKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)22, "Value", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(CameraAtKeyframeSchema.GetValue), new SetValueHandler(CameraAtKeyframeSchema.SetValue), false); - CameraAtKeyframeSchema.Type.Initialize(new DefaultConstructHandler(CameraAtKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(22, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(CameraAtKeyframeSchema.GetValue), new SetValueHandler(CameraAtKeyframeSchema.SetValue), false); + CameraAtKeyframeSchema.Type.Initialize(new DefaultConstructHandler(CameraAtKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/CameraEyeKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CameraEyeKeyframeSchema.cs index 3c7eb5a..f66de7c 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/CameraEyeKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraEyeKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseVector3Keyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseVector3Keyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseVector3Keyframe)instanceObj).Value = (Vector3)valueObj; - private static object Construct() => (object)new CameraEyeKeyframe(); + private static object Construct() => new CameraEyeKeyframe(); - public static void Pass1Initialize() => CameraEyeKeyframeSchema.Type = new UIXTypeSchema((short)23, "CameraEyeKeyframe", (string)null, (short)130, typeof(CameraEyeKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => CameraEyeKeyframeSchema.Type = new UIXTypeSchema(23, "CameraEyeKeyframe", null, 130, typeof(CameraEyeKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)23, "Value", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(CameraEyeKeyframeSchema.GetValue), new SetValueHandler(CameraEyeKeyframeSchema.SetValue), false); - CameraEyeKeyframeSchema.Type.Initialize(new DefaultConstructHandler(CameraEyeKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(23, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(CameraEyeKeyframeSchema.GetValue), new SetValueHandler(CameraEyeKeyframeSchema.SetValue), false); + CameraEyeKeyframeSchema.Type.Initialize(new DefaultConstructHandler(CameraEyeKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/CameraSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CameraSchema.cs index 6b4e7dc..8184921 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/CameraSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraSchema.cs @@ -15,35 +15,35 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetEye(object instanceObj) => (object)((Camera)instanceObj).Eye; + private static object GetEye(object instanceObj) => ((Camera)instanceObj).Eye; private static void SetEye(ref object instanceObj, object valueObj) => ((Camera)instanceObj).Eye = (Vector3)valueObj; - private static object GetAt(object instanceObj) => (object)((Camera)instanceObj).At; + private static object GetAt(object instanceObj) => ((Camera)instanceObj).At; private static void SetAt(ref object instanceObj, object valueObj) => ((Camera)instanceObj).At = (Vector3)valueObj; - private static object GetUp(object instanceObj) => (object)((Camera)instanceObj).Up; + private static object GetUp(object instanceObj) => ((Camera)instanceObj).Up; private static void SetUp(ref object instanceObj, object valueObj) => ((Camera)instanceObj).Up = (Vector3)valueObj; - private static object GetZn(object instanceObj) => (object)((Camera)instanceObj).Zn; + private static object GetZn(object instanceObj) => ((Camera)instanceObj).Zn; private static void SetZn(ref object instanceObj, object valueObj) => ((Camera)instanceObj).Zn = (float)valueObj; - private static object GetEyeAnimation(object instanceObj) => (object)((Camera)instanceObj).EyeAnimation; + private static object GetEyeAnimation(object instanceObj) => ((Camera)instanceObj).EyeAnimation; private static void SetEyeAnimation(ref object instanceObj, object valueObj) => ((Camera)instanceObj).EyeAnimation = (IAnimationProvider)valueObj; - private static object GetAtAnimation(object instanceObj) => (object)((Camera)instanceObj).AtAnimation; + private static object GetAtAnimation(object instanceObj) => ((Camera)instanceObj).AtAnimation; private static void SetAtAnimation(ref object instanceObj, object valueObj) => ((Camera)instanceObj).AtAnimation = (IAnimationProvider)valueObj; - private static object GetUpAnimation(object instanceObj) => (object)((Camera)instanceObj).UpAnimation; + private static object GetUpAnimation(object instanceObj) => ((Camera)instanceObj).UpAnimation; private static void SetUpAnimation(ref object instanceObj, object valueObj) => ((Camera)instanceObj).UpAnimation = (IAnimationProvider)valueObj; - private static object GetZnAnimation(object instanceObj) => (object)((Camera)instanceObj).ZnAnimation; + private static object GetZnAnimation(object instanceObj) => ((Camera)instanceObj).ZnAnimation; private static void SetZnAnimation(ref object instanceObj, object valueObj) => ((Camera)instanceObj).ZnAnimation = (IAnimationProvider)valueObj; @@ -51,7 +51,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetPerspective(ref object instanceObj, object valueObj) => ((Camera)instanceObj).Perspective = (bool)valueObj; - private static object Construct() => (object)new Camera(); + private static object Construct() => new Camera(); private static object CallPlayAnimationIAnimation(object instanceObj, object[] parameters) { @@ -59,11 +59,11 @@ namespace Microsoft.Iris.Markup.UIX IAnimationProvider parameter = (IAnimationProvider)parameters[0]; if (parameter == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"animation"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; } - camera.PlayAnimation(parameter, (AnimationHandle)null); - return (object)null; + camera.PlayAnimation(parameter, null); + return null; } private static object CallPlayAnimationIAnimationAnimationHandle( @@ -75,56 +75,56 @@ namespace Microsoft.Iris.Markup.UIX AnimationHandle parameter2 = (AnimationHandle)parameters[1]; if (parameter1 == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"animation"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; } if (parameter2 == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"handle"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "handle"); + return null; } camera.PlayAnimation(parameter1, parameter2); - return (object)null; + return null; } - public static void Pass1Initialize() => CameraSchema.Type = new UIXTypeSchema((short)21, "Camera", (string)null, (short)153, typeof(Camera), UIXTypeFlags.None); + public static void Pass1Initialize() => CameraSchema.Type = new UIXTypeSchema(21, "Camera", null, 153, typeof(Camera), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)21, "Eye", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetEye), new SetValueHandler(CameraSchema.SetEye), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)21, "At", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetAt), new SetValueHandler(CameraSchema.SetAt), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)21, "Up", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetUp), new SetValueHandler(CameraSchema.SetUp), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)21, "Zn", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetZn), new SetValueHandler(CameraSchema.SetZn), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)21, "EyeAnimation", (short)104, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetEyeAnimation), new SetValueHandler(CameraSchema.SetEyeAnimation), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)21, "AtAnimation", (short)104, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetAtAnimation), new SetValueHandler(CameraSchema.SetAtAnimation), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)21, "UpAnimation", (short)104, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetUpAnimation), new SetValueHandler(CameraSchema.SetUpAnimation), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)21, "ZnAnimation", (short)104, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetZnAnimation), new SetValueHandler(CameraSchema.SetZnAnimation), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)21, "Perspective", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CameraSchema.GetPerspective), new SetValueHandler(CameraSchema.SetPerspective), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)21, "PlayAnimation", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(21, "Eye", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetEye), new SetValueHandler(CameraSchema.SetEye), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(21, "At", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetAt), new SetValueHandler(CameraSchema.SetAt), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(21, "Up", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetUp), new SetValueHandler(CameraSchema.SetUp), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(21, "Zn", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetZn), new SetValueHandler(CameraSchema.SetZn), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(21, "EyeAnimation", 104, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetEyeAnimation), new SetValueHandler(CameraSchema.SetEyeAnimation), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(21, "AtAnimation", 104, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetAtAnimation), new SetValueHandler(CameraSchema.SetAtAnimation), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(21, "UpAnimation", 104, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetUpAnimation), new SetValueHandler(CameraSchema.SetUpAnimation), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(21, "ZnAnimation", 104, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetZnAnimation), new SetValueHandler(CameraSchema.SetZnAnimation), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(21, "Perspective", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CameraSchema.GetPerspective), new SetValueHandler(CameraSchema.SetPerspective), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(21, "PlayAnimation", new short[1] { - (short) 104 - }, (short)240, new InvokeHandler(CameraSchema.CallPlayAnimationIAnimation), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)21, "PlayAnimation", new short[2] + 104 + }, 240, new InvokeHandler(CameraSchema.CallPlayAnimationIAnimation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(21, "PlayAnimation", new short[2] { - (short) 104, - (short) 11 - }, (short)240, new InvokeHandler(CameraSchema.CallPlayAnimationIAnimationAnimationHandle), false); - CameraSchema.Type.Initialize(new DefaultConstructHandler(CameraSchema.Construct), (ConstructorSchema[])null, new PropertySchema[9] + 104, + 11 + }, 240, new InvokeHandler(CameraSchema.CallPlayAnimationIAnimationAnimationHandle), false); + CameraSchema.Type.Initialize(new DefaultConstructHandler(CameraSchema.Construct), null, new PropertySchema[9] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema8 + uixPropertySchema2, + uixPropertySchema6, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema9, + uixPropertySchema3, + uixPropertySchema7, + uixPropertySchema4, + uixPropertySchema8 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/CameraUpKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CameraUpKeyframeSchema.cs index 2d96165..1a9fe48 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/CameraUpKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraUpKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseVector3Keyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseVector3Keyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseVector3Keyframe)instanceObj).Value = (Vector3)valueObj; - private static object Construct() => (object)new CameraUpKeyframe(); + private static object Construct() => new CameraUpKeyframe(); - public static void Pass1Initialize() => CameraUpKeyframeSchema.Type = new UIXTypeSchema((short)24, "CameraUpKeyframe", (string)null, (short)130, typeof(CameraUpKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => CameraUpKeyframeSchema.Type = new UIXTypeSchema(24, "CameraUpKeyframe", null, 130, typeof(CameraUpKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)24, "Value", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(CameraUpKeyframeSchema.GetValue), new SetValueHandler(CameraUpKeyframeSchema.SetValue), false); - CameraUpKeyframeSchema.Type.Initialize(new DefaultConstructHandler(CameraUpKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(24, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(CameraUpKeyframeSchema.GetValue), new SetValueHandler(CameraUpKeyframeSchema.SetValue), false); + CameraUpKeyframeSchema.Type.Initialize(new DefaultConstructHandler(CameraUpKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/CameraZnKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CameraZnKeyframeSchema.cs index d294eb0..653eb74 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/CameraZnKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraZnKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new CameraZnKeyframe(); + private static object Construct() => new CameraZnKeyframe(); - public static void Pass1Initialize() => CameraZnKeyframeSchema.Type = new UIXTypeSchema((short)25, "CameraZnKeyframe", (string)null, (short)130, typeof(CameraZnKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => CameraZnKeyframeSchema.Type = new UIXTypeSchema(25, "CameraZnKeyframe", null, 130, typeof(CameraZnKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)25, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(CameraZnKeyframeSchema.GetValue), new SetValueHandler(CameraZnKeyframeSchema.SetValue), false); - CameraZnKeyframeSchema.Type.Initialize(new DefaultConstructHandler(CameraZnKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(25, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(CameraZnKeyframeSchema.GetValue), new SetValueHandler(CameraZnKeyframeSchema.SetValue), false); + CameraZnKeyframeSchema.Type.Initialize(new DefaultConstructHandler(CameraZnKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/CaretInfoSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CaretInfoSchema.cs index 458a9ef..2aab6ff 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/CaretInfoSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/CaretInfoSchema.cs @@ -12,37 +12,37 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetBlinkTime(object instanceObj) => (object)((CaretInfo)instanceObj).BlinkTime; + private static object GetBlinkTime(object instanceObj) => ((CaretInfo)instanceObj).BlinkTime; - private static object GetIdealWidth(object instanceObj) => (object)((CaretInfo)instanceObj).IdealWidth; + private static object GetIdealWidth(object instanceObj) => ((CaretInfo)instanceObj).IdealWidth; private static void SetIdealWidth(ref object instanceObj, object valueObj) => ((CaretInfo)instanceObj).IdealWidth = (int)valueObj; private static object GetVisible(object instanceObj) => BooleanBoxes.Box(((CaretInfo)instanceObj).Visible); - private static object GetPosition(object instanceObj) => (object)((CaretInfo)instanceObj).Position; + private static object GetPosition(object instanceObj) => ((CaretInfo)instanceObj).Position; - private static object GetSuggestedSize(object instanceObj) => (object)((CaretInfo)instanceObj).SuggestedSize; + private static object GetSuggestedSize(object instanceObj) => ((CaretInfo)instanceObj).SuggestedSize; - private static object Construct() => (object)new CaretInfo(); + private static object Construct() => new CaretInfo(); - public static void Pass1Initialize() => CaretInfoSchema.Type = new UIXTypeSchema((short)26, "CaretInfo", (string)null, (short)153, typeof(CaretInfo), UIXTypeFlags.None); + public static void Pass1Initialize() => CaretInfoSchema.Type = new UIXTypeSchema(26, "CaretInfo", null, 153, typeof(CaretInfo), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)26, "BlinkTime", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CaretInfoSchema.GetBlinkTime), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)26, "IdealWidth", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CaretInfoSchema.GetIdealWidth), new SetValueHandler(CaretInfoSchema.SetIdealWidth), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)26, "Visible", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CaretInfoSchema.GetVisible), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)26, "Position", (short)158, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CaretInfoSchema.GetPosition), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)26, "SuggestedSize", (short)195, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CaretInfoSchema.GetSuggestedSize), (SetValueHandler)null, false); - CaretInfoSchema.Type.Initialize(new DefaultConstructHandler(CaretInfoSchema.Construct), (ConstructorSchema[])null, new PropertySchema[5] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(26, "BlinkTime", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CaretInfoSchema.GetBlinkTime), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(26, "IdealWidth", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CaretInfoSchema.GetIdealWidth), new SetValueHandler(CaretInfoSchema.SetIdealWidth), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(26, "Visible", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CaretInfoSchema.GetVisible), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(26, "Position", 158, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CaretInfoSchema.GetPosition), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(26, "SuggestedSize", 195, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CaretInfoSchema.GetSuggestedSize), null, false); + CaretInfoSchema.Type.Initialize(new DefaultConstructHandler(CaretInfoSchema.Construct), null, new PropertySchema[5] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema3 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/CharSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CharSchema.cs index 4367821..ceff0a2 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/CharSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/CharSchema.cs @@ -12,7 +12,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)char.MinValue; + private static object Construct() => char.MinValue; private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) { @@ -20,16 +20,16 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteChar(ch); } - private static object DecodeBinary(ByteCodeReader reader) => (object)reader.ReadChar(); + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadChar(); private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; if (str == null || str.Length != 1) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"Char"); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Char"); char ch = str[0]; - instanceObj = (object)ch; + instanceObj = ch; return Result.Success; } @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = CharSchema.ConvertFromString(from, out instance); @@ -70,11 +70,11 @@ namespace Microsoft.Iris.Markup.UIX switch (op) { case OperationType.RelationalEquals: - return BooleanBoxes.Box((int)ch1 == (int)ch2); + return BooleanBoxes.Box(ch1 == ch2); case OperationType.RelationalNotEquals: - return BooleanBoxes.Box((int)ch1 != (int)ch2); + return BooleanBoxes.Box(ch1 != ch2); default: - return (object)null; + return null; } } @@ -83,22 +83,22 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; char parameter2 = (char)parameters[1]; object instanceObj1; - return CharSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return CharSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => CharSchema.Type = new UIXTypeSchema((short)27, "Char", "char", (short)153, typeof(char), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => CharSchema.Type = new UIXTypeSchema(27, "Char", "char", 153, typeof(char), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)27, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(27, "TryParse", new short[2] { - (short) 208, - (short) 27 - }, (short)27, new InvokeHandler(CharSchema.CallTryParseStringChar), true); - CharSchema.Type.Initialize(new DefaultConstructHandler(CharSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[1] + 208, + 27 + }, 27, new InvokeHandler(CharSchema.CallTryParseStringChar), true); + CharSchema.Type.Initialize(new DefaultConstructHandler(CharSchema.Construct), null, null, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(CharSchema.TryConvertFrom), new SupportsTypeConversionHandler(CharSchema.IsConversionSupported), new EncodeBinaryHandler(CharSchema.EncodeBinary), new DecodeBinaryHandler(CharSchema.DecodeBinary), new PerformOperationHandler(CharSchema.ExecuteOperation), new SupportsOperationHandler(CharSchema.IsOperationSupported)); + uixMethodSchema + }, null, null, new TypeConverterHandler(CharSchema.TryConvertFrom), new SupportsTypeConversionHandler(CharSchema.IsConversionSupported), new EncodeBinaryHandler(CharSchema.EncodeBinary), new DecodeBinaryHandler(CharSchema.DecodeBinary), new PerformOperationHandler(CharSchema.ExecuteOperation), new SupportsOperationHandler(CharSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs index 2ef756e..b67c574 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Markup.UIX ErrorManager.ReportError(error); } - private static object GetChosenIndex(object instanceObj) => (object)((IUIChoice)instanceObj).ChosenIndex; + private static object GetChosenIndex(object instanceObj) => ((IUIChoice)instanceObj).ChosenIndex; private static void SetChosenIndex(ref object instanceObj, object valueObj) { @@ -41,11 +41,11 @@ namespace Microsoft.Iris.Markup.UIX ErrorManager.ReportError(error); } - private static object GetDefaultIndex(object instanceObj) => (object)((IUIChoice)instanceObj).DefaultIndex; + private static object GetDefaultIndex(object instanceObj) => ((IUIChoice)instanceObj).DefaultIndex; private static void SetDefaultIndex(ref object instanceObj, object valueObj) => ((IUIChoice)instanceObj).DefaultIndex = (int)valueObj; - private static object GetOptions(object instanceObj) => (object)((IUIChoice)instanceObj).Options; + private static object GetOptions(object instanceObj) => ((IUIChoice)instanceObj).Options; private static void SetOptions(ref object instanceObj, object valueObj) { @@ -68,87 +68,87 @@ namespace Microsoft.Iris.Markup.UIX private static object GetHasNextValue(object instanceObj) => BooleanBoxes.Box(((IUIValueRange)instanceObj).HasNextValue); - private static object Construct() => (object)new Microsoft.Iris.ModelItems.Choice(); + private static object Construct() => new Microsoft.Iris.ModelItems.Choice(); private static object CallPreviousValue(object instanceObj, object[] parameters) { ((IUIValueRange)instanceObj).PreviousValue(); - return (object)null; + return null; } private static object CallPreviousValueBoolean(object instanceObj, object[] parameters) { ((IUIChoice)instanceObj).PreviousValue((bool)parameters[0]); - return (object)null; + return null; } private static object CallNextValue(object instanceObj, object[] parameters) { ((IUIValueRange)instanceObj).NextValue(); - return (object)null; + return null; } private static object CallNextValueBoolean(object instanceObj, object[] parameters) { ((IUIChoice)instanceObj).NextValue((bool)parameters[0]); - return (object)null; + return null; } private static object CallDefaultValue(object instanceObj, object[] parameters) { ((IUIChoice)instanceObj).DefaultValue(); - return (object)null; + return null; } private static object CallClear(object instanceObj, object[] parameters) { ((IUIChoice)instanceObj).Clear(); - return (object)null; + return null; } - public static void Pass1Initialize() => ChoiceSchema.Type = new UIXTypeSchema((short)28, "Choice", (string)null, (short)231, typeof(IUIChoice), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => ChoiceSchema.Type = new UIXTypeSchema(28, "Choice", null, 231, typeof(IUIChoice), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)28, "ChosenValue", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ChoiceSchema.GetChosenValue), new SetValueHandler(ChoiceSchema.SetChosenValue), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)28, "ChosenIndex", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ChoiceSchema.GetChosenIndex), new SetValueHandler(ChoiceSchema.SetChosenIndex), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)28, "DefaultIndex", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ChoiceSchema.GetDefaultIndex), new SetValueHandler(ChoiceSchema.SetDefaultIndex), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)28, "Options", (short)138, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ChoiceSchema.GetOptions), new SetValueHandler(ChoiceSchema.SetOptions), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)28, "HasSelection", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ChoiceSchema.GetHasSelection), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)28, "Wrap", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ChoiceSchema.GetWrap), new SetValueHandler(ChoiceSchema.SetWrap), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)28, "HasPreviousValue", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ChoiceSchema.GetHasPreviousValue), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)28, "HasNextValue", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ChoiceSchema.GetHasNextValue), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)28, "PreviousValue", (short[])null, (short)240, new InvokeHandler(ChoiceSchema.CallPreviousValue), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)28, "PreviousValue", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(28, "ChosenValue", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ChoiceSchema.GetChosenValue), new SetValueHandler(ChoiceSchema.SetChosenValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(28, "ChosenIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ChoiceSchema.GetChosenIndex), new SetValueHandler(ChoiceSchema.SetChosenIndex), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(28, "DefaultIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ChoiceSchema.GetDefaultIndex), new SetValueHandler(ChoiceSchema.SetDefaultIndex), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(28, "Options", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ChoiceSchema.GetOptions), new SetValueHandler(ChoiceSchema.SetOptions), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(28, "HasSelection", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ChoiceSchema.GetHasSelection), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(28, "Wrap", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ChoiceSchema.GetWrap), new SetValueHandler(ChoiceSchema.SetWrap), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(28, "HasPreviousValue", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ChoiceSchema.GetHasPreviousValue), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(28, "HasNextValue", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ChoiceSchema.GetHasNextValue), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(28, "PreviousValue", null, 240, new InvokeHandler(ChoiceSchema.CallPreviousValue), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(28, "PreviousValue", new short[1] { - (short) 15 - }, (short)240, new InvokeHandler(ChoiceSchema.CallPreviousValueBoolean), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)28, "NextValue", (short[])null, (short)240, new InvokeHandler(ChoiceSchema.CallNextValue), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)28, "NextValue", new short[1] + 15 + }, 240, new InvokeHandler(ChoiceSchema.CallPreviousValueBoolean), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(28, "NextValue", null, 240, new InvokeHandler(ChoiceSchema.CallNextValue), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(28, "NextValue", new short[1] { - (short) 15 - }, (short)240, new InvokeHandler(ChoiceSchema.CallNextValueBoolean), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)28, "DefaultValue", (short[])null, (short)240, new InvokeHandler(ChoiceSchema.CallDefaultValue), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)28, "Clear", (short[])null, (short)240, new InvokeHandler(ChoiceSchema.CallClear), false); - ChoiceSchema.Type.Initialize(new DefaultConstructHandler(ChoiceSchema.Construct), (ConstructorSchema[])null, new PropertySchema[8] + 15 + }, 240, new InvokeHandler(ChoiceSchema.CallNextValueBoolean), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(28, "DefaultValue", null, 240, new InvokeHandler(ChoiceSchema.CallDefaultValue), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(28, "Clear", null, 240, new InvokeHandler(ChoiceSchema.CallClear), false); + ChoiceSchema.Type.Initialize(new DefaultConstructHandler(ChoiceSchema.Construct), null, new PropertySchema[8] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema6 + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema8, + uixPropertySchema7, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema6 }, new MethodSchema[6] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ClassSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ClassSchema.cs index 8d13fb3..f12ea4c 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ClassSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ClassSchema.cs @@ -23,29 +23,29 @@ namespace Microsoft.Iris.Markup.UIX Class @class = (Class)instanceObj; } - private static object GetProperties(object instanceObj) => (object)((Class)instanceObj).Storage; + private static object GetProperties(object instanceObj) => ((Class)instanceObj).Storage; - private static object GetLocals(object instanceObj) => (object)((Class)instanceObj).Storage; + private static object GetLocals(object instanceObj) => ((Class)instanceObj).Storage; private static object GetScripts(object instanceObj) => (object)null; - public static void Pass1Initialize() => ClassSchema.Type = new UIXTypeSchema((short)29, "Class", (string)null, (short)-1, typeof(Class), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => ClassSchema.Type = new UIXTypeSchema(29, "Class", null, -1, typeof(Class), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)29, "Shared", (short)15, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(ClassSchema.SetShared), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)29, "Base", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(ClassSchema.SetBase), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)29, "Properties", (short)58, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(ClassSchema.GetProperties), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)29, "Locals", (short)58, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(ClassSchema.GetLocals), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)29, "Scripts", (short)138, (short)240, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(ClassSchema.GetScripts), (SetValueHandler)null, false); - ClassSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[5] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(29, "Shared", 15, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(ClassSchema.SetShared), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(29, "Base", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(ClassSchema.SetBase), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(29, "Properties", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(ClassSchema.GetProperties), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(29, "Locals", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(ClassSchema.GetLocals), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(29, "Scripts", 138, 240, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(ClassSchema.GetScripts), null, false); + ClassSchema.Type.Initialize(null, null, new PropertySchema[5] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema3, + uixPropertySchema5, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ClassStateSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ClassStateSchema.cs index 499218f..7c471e6 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ClassStateSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ClassStateSchema.cs @@ -19,33 +19,33 @@ namespace Microsoft.Iris.Markup.UIX Class @class = (Class)instanceObj; object parameter = parameters[0]; if (parameter == null) - return (object)null; + return null; if (!(parameter is IDisposableObject disposable)) { - ErrorManager.ReportError("Attempt to dispose an object '{0}' that isn't disposable", (object)TypeSchema.NameFromInstance(parameter)); - return (object)null; + ErrorManager.ReportError("Attempt to dispose an object '{0}' that isn't disposable", TypeSchema.NameFromInstance(parameter)); + return null; } if (!@class.UnregisterDisposable(ref disposable)) { - ErrorManager.ReportError("Attempt to dispose an object '{0}' that '{1}' doesn't own", (object)TypeSchema.NameFromInstance((object)disposable), (object)@class.TypeSchema.Name); - return (object)null; + ErrorManager.ReportError("Attempt to dispose an object '{0}' that '{1}' doesn't own", TypeSchema.NameFromInstance(disposable), @class.TypeSchema.Name); + return null; } - disposable.Dispose((object)@class); - return (object)null; + disposable.Dispose(@class); + return null; } - public static void Pass1Initialize() => ClassStateSchema.Type = new UIXTypeSchema((short)30, "ClassState", (string)null, (short)-1, typeof(Class), UIXTypeFlags.None); + public static void Pass1Initialize() => ClassStateSchema.Type = new UIXTypeSchema(30, "ClassState", null, -1, typeof(Class), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)30, "DisposeOwnedObject", new short[1] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(30, "DisposeOwnedObject", new short[1] { - (short) 153 - }, (short)240, new InvokeHandler(ClassStateSchema.CallDisposeOwnedObjectObject), false); - ClassStateSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[1] + 153 + }, 240, new InvokeHandler(ClassStateSchema.CallDisposeOwnedObjectObject), false); + ClassStateSchema.Type.Initialize(null, null, null, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ClickHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ClickHandlerSchema.cs index c896a83..e9f0781 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ClickHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ClickHandlerSchema.cs @@ -18,15 +18,15 @@ namespace Microsoft.Iris.Markup.UIX private static object GetClicking(object instanceObj) => BooleanBoxes.Box(((ClickHandler)instanceObj).Clicking); - private static object GetClickCount(object instanceObj) => (object)((ClickHandler)instanceObj).ClickCount; + private static object GetClickCount(object instanceObj) => ((ClickHandler)instanceObj).ClickCount; private static void SetClickCount(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).ClickCount = (ClickCount)valueObj; - private static object GetClickType(object instanceObj) => (object)((ClickHandler)instanceObj).ClickType; + private static object GetClickType(object instanceObj) => ((ClickHandler)instanceObj).ClickType; private static void SetClickType(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).ClickType = (ClickType)valueObj; - private static object GetCommand(object instanceObj) => (object)((ClickHandler)instanceObj).Command; + private static object GetCommand(object instanceObj) => ((ClickHandler)instanceObj).Command; private static void SetCommand(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).Command = (IUICommand)valueObj; @@ -34,15 +34,15 @@ namespace Microsoft.Iris.Markup.UIX private static void SetHandle(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).Handle = (bool)valueObj; - private static object GetHandlerTransition(object instanceObj) => (object)((ModifierInputHandler)instanceObj).HandlerTransition; + private static object GetHandlerTransition(object instanceObj) => ((ModifierInputHandler)instanceObj).HandlerTransition; private static void SetHandlerTransition(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).HandlerTransition = (InputHandlerTransition)valueObj; - private static object GetRequiredModifiers(object instanceObj) => (object)((ModifierInputHandler)instanceObj).RequiredModifiers; + private static object GetRequiredModifiers(object instanceObj) => ((ModifierInputHandler)instanceObj).RequiredModifiers; private static void SetRequiredModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).RequiredModifiers = (InputHandlerModifiers)valueObj; - private static object GetDisallowedModifiers(object instanceObj) => (object)((ModifierInputHandler)instanceObj).DisallowedModifiers; + private static object GetDisallowedModifiers(object instanceObj) => ((ModifierInputHandler)instanceObj).DisallowedModifiers; private static void SetDisallowedModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).DisallowedModifiers = (InputHandlerModifiers)valueObj; @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetRepeat(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).Repeat = (bool)valueObj; - private static object GetRepeatDelay(object instanceObj) => (object)((ClickHandler)instanceObj).RepeatDelay; + private static object GetRepeatDelay(object instanceObj) => ((ClickHandler)instanceObj).RepeatDelay; private static void SetRepeatDelay(ref object instanceObj, object valueObj) { @@ -63,7 +63,7 @@ namespace Microsoft.Iris.Markup.UIX clickHandler.RepeatDelay = num; } - private static object GetRepeatRate(object instanceObj) => (object)((ClickHandler)instanceObj).RepeatRate; + private static object GetRepeatRate(object instanceObj) => ((ClickHandler)instanceObj).RepeatRate; private static void SetRepeatRate(ref object instanceObj, object valueObj) { @@ -76,51 +76,51 @@ namespace Microsoft.Iris.Markup.UIX clickHandler.RepeatRate = num; } - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; private static object GetEventContext(object instanceObj) => ((ClickHandler)instanceObj).EventContext; - private static object Construct() => (object)new ClickHandler(); + private static object Construct() => new ClickHandler(); - public static void Pass1Initialize() => ClickHandlerSchema.Type = new UIXTypeSchema((short)32, "ClickHandler", (string)null, (short)110, typeof(ClickHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => ClickHandlerSchema.Type = new UIXTypeSchema(32, "ClickHandler", null, 110, typeof(ClickHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)32, "Clicking", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetClicking), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)32, "ClickCount", (short)31, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetClickCount), new SetValueHandler(ClickHandlerSchema.SetClickCount), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)32, "ClickType", (short)33, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetClickType), new SetValueHandler(ClickHandlerSchema.SetClickType), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)32, "Command", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetCommand), new SetValueHandler(ClickHandlerSchema.SetCommand), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)32, "Handle", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetHandle), new SetValueHandler(ClickHandlerSchema.SetHandle), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)32, "HandlerTransition", (short)113, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetHandlerTransition), new SetValueHandler(ClickHandlerSchema.SetHandlerTransition), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)32, "RequiredModifiers", (short)111, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetRequiredModifiers), new SetValueHandler(ClickHandlerSchema.SetRequiredModifiers), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)32, "DisallowedModifiers", (short)111, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetDisallowedModifiers), new SetValueHandler(ClickHandlerSchema.SetDisallowedModifiers), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)32, "Repeat", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetRepeat), new SetValueHandler(ClickHandlerSchema.SetRepeat), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)32, "RepeatDelay", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ClickHandlerSchema.GetRepeatDelay), new SetValueHandler(ClickHandlerSchema.SetRepeatDelay), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)32, "RepeatRate", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ClickHandlerSchema.GetRepeatRate), new SetValueHandler(ClickHandlerSchema.SetRepeatRate), false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)32, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetHandlerStage), new SetValueHandler(ClickHandlerSchema.SetHandlerStage), false); - UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema((short)32, "EventContext", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClickHandlerSchema.GetEventContext), (SetValueHandler)null, false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)32, "Invoked"); - ClickHandlerSchema.Type.Initialize(new DefaultConstructHandler(ClickHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[13] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(32, "Clicking", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetClicking), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(32, "ClickCount", 31, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetClickCount), new SetValueHandler(ClickHandlerSchema.SetClickCount), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(32, "ClickType", 33, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetClickType), new SetValueHandler(ClickHandlerSchema.SetClickType), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(32, "Command", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetCommand), new SetValueHandler(ClickHandlerSchema.SetCommand), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(32, "Handle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetHandle), new SetValueHandler(ClickHandlerSchema.SetHandle), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(32, "HandlerTransition", 113, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetHandlerTransition), new SetValueHandler(ClickHandlerSchema.SetHandlerTransition), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(32, "RequiredModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetRequiredModifiers), new SetValueHandler(ClickHandlerSchema.SetRequiredModifiers), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(32, "DisallowedModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetDisallowedModifiers), new SetValueHandler(ClickHandlerSchema.SetDisallowedModifiers), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(32, "Repeat", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetRepeat), new SetValueHandler(ClickHandlerSchema.SetRepeat), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(32, "RepeatDelay", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ClickHandlerSchema.GetRepeatDelay), new SetValueHandler(ClickHandlerSchema.SetRepeatDelay), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(32, "RepeatRate", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ClickHandlerSchema.GetRepeatRate), new SetValueHandler(ClickHandlerSchema.SetRepeatRate), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(32, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetHandlerStage), new SetValueHandler(ClickHandlerSchema.SetHandlerStage), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(32, "EventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClickHandlerSchema.GetEventContext), null, false); + UIXEventSchema uixEventSchema = new UIXEventSchema(32, "Invoked"); + ClickHandlerSchema.Type.Initialize(new DefaultConstructHandler(ClickHandlerSchema.Construct), null, new PropertySchema[13] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema13, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema7 - }, (MethodSchema[])null, new EventSchema[1] + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema13, + uixPropertySchema5, + uixPropertySchema12, + uixPropertySchema6, + uixPropertySchema9, + uixPropertySchema10, + uixPropertySchema11, + uixPropertySchema7 + }, null, new EventSchema[1] { - (EventSchema) uixEventSchema - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ClipSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ClipSchema.cs index b63a951..b837bf1 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ClipSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ClipSchema.cs @@ -17,29 +17,29 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetChildren(object instanceObj) => (object)ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); + private static object GetChildren(object instanceObj) => ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); - private static object GetOrientation(object instanceObj) => (object)((Clip)instanceObj).Orientation; + private static object GetOrientation(object instanceObj) => ((Clip)instanceObj).Orientation; private static void SetOrientation(ref object instanceObj, object valueObj) => ((Clip)instanceObj).Orientation = (Orientation)valueObj; - private static object GetFadeSize(object instanceObj) => (object)((Clip)instanceObj).FadeSize; + private static object GetFadeSize(object instanceObj) => ((Clip)instanceObj).FadeSize; private static void SetFadeSize(ref object instanceObj, object valueObj) => ((Clip)instanceObj).FadeSize = (float)valueObj; - private static object GetNearOffset(object instanceObj) => (object)((Clip)instanceObj).NearOffset; + private static object GetNearOffset(object instanceObj) => ((Clip)instanceObj).NearOffset; private static void SetNearOffset(ref object instanceObj, object valueObj) => ((Clip)instanceObj).NearOffset = (float)valueObj; - private static object GetFarOffset(object instanceObj) => (object)((Clip)instanceObj).FarOffset; + private static object GetFarOffset(object instanceObj) => ((Clip)instanceObj).FarOffset; private static void SetFarOffset(ref object instanceObj, object valueObj) => ((Clip)instanceObj).FarOffset = (float)valueObj; - private static object GetNearPercent(object instanceObj) => (object)((Clip)instanceObj).NearPercent; + private static object GetNearPercent(object instanceObj) => ((Clip)instanceObj).NearPercent; private static void SetNearPercent(ref object instanceObj, object valueObj) => ((Clip)instanceObj).NearPercent = (float)valueObj; - private static object GetFarPercent(object instanceObj) => (object)((Clip)instanceObj).FarPercent; + private static object GetFarPercent(object instanceObj) => ((Clip)instanceObj).FarPercent; private static void SetFarPercent(ref object instanceObj, object valueObj) => ((Clip)instanceObj).FarPercent = (float)valueObj; @@ -51,11 +51,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetShowFar(ref object instanceObj, object valueObj) => ((Clip)instanceObj).ShowFar = (bool)valueObj; - private static object GetColorMask(object instanceObj) => (object)((Clip)instanceObj).ColorMask; + private static object GetColorMask(object instanceObj) => ((Clip)instanceObj).ColorMask; private static void SetColorMask(ref object instanceObj, object valueObj) => ((Clip)instanceObj).ColorMask = (Color)valueObj; - private static object GetFadeAmount(object instanceObj) => (object)((Clip)instanceObj).FadeAmount; + private static object GetFadeAmount(object instanceObj) => ((Clip)instanceObj).FadeAmount; private static void SetFadeAmount(ref object instanceObj, object valueObj) { @@ -68,37 +68,37 @@ namespace Microsoft.Iris.Markup.UIX clip.FadeAmount = num; } - private static object Construct() => (object)new Clip(); + private static object Construct() => new Clip(); - public static void Pass1Initialize() => ClipSchema.Type = new UIXTypeSchema((short)34, "Clip", (string)null, (short)239, typeof(Clip), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => ClipSchema.Type = new UIXTypeSchema(34, "Clip", null, 239, typeof(Clip), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)34, "Children", (short)138, (short)239, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetChildren), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)34, "Orientation", (short)154, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetOrientation), new SetValueHandler(ClipSchema.SetOrientation), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)34, "FadeSize", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetFadeSize), new SetValueHandler(ClipSchema.SetFadeSize), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)34, "NearOffset", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetNearOffset), new SetValueHandler(ClipSchema.SetNearOffset), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)34, "FarOffset", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetFarOffset), new SetValueHandler(ClipSchema.SetFarOffset), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)34, "NearPercent", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetNearPercent), new SetValueHandler(ClipSchema.SetNearPercent), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)34, "FarPercent", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetFarPercent), new SetValueHandler(ClipSchema.SetFarPercent), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)34, "ShowNear", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetShowNear), new SetValueHandler(ClipSchema.SetShowNear), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)34, "ShowFar", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetShowFar), new SetValueHandler(ClipSchema.SetShowFar), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)34, "ColorMask", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ClipSchema.GetColorMask), new SetValueHandler(ClipSchema.SetColorMask), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)34, "FadeAmount", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, true, new GetValueHandler(ClipSchema.GetFadeAmount), new SetValueHandler(ClipSchema.SetFadeAmount), false); - ClipSchema.Type.Initialize(new DefaultConstructHandler(ClipSchema.Construct), (ConstructorSchema[])null, new PropertySchema[11] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(34, "Children", 138, 239, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(ClipSchema.GetChildren), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(34, "Orientation", 154, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetOrientation), new SetValueHandler(ClipSchema.SetOrientation), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(34, "FadeSize", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetFadeSize), new SetValueHandler(ClipSchema.SetFadeSize), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(34, "NearOffset", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetNearOffset), new SetValueHandler(ClipSchema.SetNearOffset), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(34, "FarOffset", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetFarOffset), new SetValueHandler(ClipSchema.SetFarOffset), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(34, "NearPercent", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetNearPercent), new SetValueHandler(ClipSchema.SetNearPercent), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(34, "FarPercent", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetFarPercent), new SetValueHandler(ClipSchema.SetFarPercent), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(34, "ShowNear", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetShowNear), new SetValueHandler(ClipSchema.SetShowNear), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(34, "ShowFar", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetShowFar), new SetValueHandler(ClipSchema.SetShowFar), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(34, "ColorMask", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ClipSchema.GetColorMask), new SetValueHandler(ClipSchema.SetColorMask), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(34, "FadeAmount", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, true, new GetValueHandler(ClipSchema.GetFadeAmount), new SetValueHandler(ClipSchema.SetFadeAmount), false); + ClipSchema.Type.Initialize(new DefaultConstructHandler(ClipSchema.Construct), null, new PropertySchema[11] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema8 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema10, + uixPropertySchema11, + uixPropertySchema3, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema2, + uixPropertySchema9, + uixPropertySchema8 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ColorElementInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ColorElementInstanceSchema.cs index 9de7158..cb278e0 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ColorElementInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ColorElementInstanceSchema.cs @@ -21,25 +21,25 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Color, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => ColorElementInstanceSchema.Type = new UIXTypeSchema((short)37, "ColorElementInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => ColorElementInstanceSchema.Type = new UIXTypeSchema(37, "ColorElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)37, "Color", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(ColorElementInstanceSchema.SetColor), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)37, "PlayColorAnimation", new short[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(37, "Color", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(ColorElementInstanceSchema.SetColor), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(37, "PlayColorAnimation", new short[1] { - (short) 71 - }, (short)240, new InvokeHandler(ColorElementInstanceSchema.CallPlayColorAnimationEffectColorAnimation), false); - ColorElementInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + 71 + }, 240, new InvokeHandler(ColorElementInstanceSchema.CallPlayColorAnimationEffectColorAnimation), false); + ColorElementInstanceSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ColorElementSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ColorElementSchema.cs index 4e33b93..4dc54a6 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ColorElementSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ColorElementSchema.cs @@ -15,17 +15,17 @@ namespace Microsoft.Iris.Markup.UIX private static void SetColor(ref object instanceObj, object valueObj) => ((ColorElement)instanceObj).Color = ((Color)valueObj).RenderConvert(); - private static object Construct() => (object)new ColorElement(); + private static object Construct() => new ColorElement(); - public static void Pass1Initialize() => ColorElementSchema.Type = new UIXTypeSchema((short)36, "ColorElement", (string)null, (short)77, typeof(ColorElement), UIXTypeFlags.None); + public static void Pass1Initialize() => ColorElementSchema.Type = new UIXTypeSchema(36, "ColorElement", null, 77, typeof(ColorElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)36, "Color", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(ColorElementSchema.SetColor), false); - ColorElementSchema.Type.Initialize(new DefaultConstructHandler(ColorElementSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(36, "Color", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(ColorElementSchema.SetColor), false); + ColorElementSchema.Type.Initialize(new DefaultConstructHandler(ColorElementSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ColorSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ColorSchema.cs index c5467d7..ad6501c 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ColorSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ColorSchema.cs @@ -15,10 +15,10 @@ namespace Microsoft.Iris.Markup.UIX internal static class ColorSchema { private static Dictionary s_NameToColorMap; - private static readonly object s_Default = (object)new Color((int)byte.MaxValue, 0, 0, 0); + private static readonly object s_Default = new Color(byte.MaxValue, 0, 0, 0); public static UIXTypeSchema Type; - private static object GetAlpha(object instanceObj) => (object)(float)((double)((Color)instanceObj).A / (double)byte.MaxValue); + private static object GetAlpha(object instanceObj) => (float)(((Color)instanceObj).A / (double)byte.MaxValue); private static void SetAlpha(ref object instanceObj, object valueObj) { @@ -31,12 +31,12 @@ namespace Microsoft.Iris.Markup.UIX } else { - color.A = (byte)((double)num * (double)byte.MaxValue); - instanceObj = (object)color; + color.A = (byte)(num * (double)byte.MaxValue); + instanceObj = color; } } - private static object GetRed(object instanceObj) => (object)(float)((double)((Color)instanceObj).R / (double)byte.MaxValue); + private static object GetRed(object instanceObj) => (float)(((Color)instanceObj).R / (double)byte.MaxValue); private static void SetRed(ref object instanceObj, object valueObj) { @@ -49,12 +49,12 @@ namespace Microsoft.Iris.Markup.UIX } else { - color.R = (byte)((double)num * (double)byte.MaxValue); - instanceObj = (object)color; + color.R = (byte)(num * (double)byte.MaxValue); + instanceObj = color; } } - private static object GetGreen(object instanceObj) => (object)(float)((double)((Color)instanceObj).G / (double)byte.MaxValue); + private static object GetGreen(object instanceObj) => (float)(((Color)instanceObj).G / (double)byte.MaxValue); private static void SetGreen(ref object instanceObj, object valueObj) { @@ -67,12 +67,12 @@ namespace Microsoft.Iris.Markup.UIX } else { - color.G = (byte)((double)num * (double)byte.MaxValue); - instanceObj = (object)color; + color.G = (byte)(num * (double)byte.MaxValue); + instanceObj = color; } } - private static object GetBlue(object instanceObj) => (object)(float)((double)((Color)instanceObj).B / (double)byte.MaxValue); + private static object GetBlue(object instanceObj) => (float)(((Color)instanceObj).B / (double)byte.MaxValue); private static void SetBlue(ref object instanceObj, object valueObj) { @@ -85,49 +85,49 @@ namespace Microsoft.Iris.Markup.UIX } else { - color.B = (byte)((double)num * (double)byte.MaxValue); - instanceObj = (object)color; + color.B = (byte)(num * (double)byte.MaxValue); + instanceObj = color; } } - private static object GetA(object instanceObj) => (object)((Color)instanceObj).A; + private static object GetA(object instanceObj) => ((Color)instanceObj).A; private static void SetA(ref object instanceObj, object valueObj) { Color color = (Color)instanceObj; byte num = (byte)valueObj; color.A = num; - instanceObj = (object)color; + instanceObj = color; } - private static object GetR(object instanceObj) => (object)((Color)instanceObj).R; + private static object GetR(object instanceObj) => ((Color)instanceObj).R; private static void SetR(ref object instanceObj, object valueObj) { Color color = (Color)instanceObj; byte num = (byte)valueObj; color.R = num; - instanceObj = (object)color; + instanceObj = color; } - private static object GetG(object instanceObj) => (object)((Color)instanceObj).G; + private static object GetG(object instanceObj) => ((Color)instanceObj).G; private static void SetG(ref object instanceObj, object valueObj) { Color color = (Color)instanceObj; byte num = (byte)valueObj; color.G = num; - instanceObj = (object)color; + instanceObj = color; } - private static object GetB(object instanceObj) => (object)((Color)instanceObj).B; + private static object GetB(object instanceObj) => ((Color)instanceObj).B; private static void SetB(ref object instanceObj, object valueObj) { Color color = (Color)instanceObj; byte num = (byte)valueObj; color.B = num; - instanceObj = (object)color; + instanceObj = color; } private static object Construct() => ColorSchema.s_Default; @@ -148,24 +148,24 @@ namespace Microsoft.Iris.Markup.UIX { instance = ColorSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)SingleSchema.Type, SingleSchema.Validate0to1, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result1.Error); ColorSchema.SetAlpha(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, SingleSchema.Validate0to1, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result2.Error); ColorSchema.SetRed(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)SingleSchema.Type, SingleSchema.Validate0to1, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result3.Error); ColorSchema.SetGreen(ref instance, valueObj3); object valueObj4; - Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], (TypeSchema)SingleSchema.Type, SingleSchema.Validate0to1, out valueObj4); + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj4); if (result4.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result4.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result4.Error); ColorSchema.SetBlue(ref instance, valueObj4); return result4; } @@ -184,24 +184,24 @@ namespace Microsoft.Iris.Markup.UIX { instance = ColorSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)ByteSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], ByteSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result1.Error); ColorSchema.SetA(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)ByteSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], ByteSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result2.Error); ColorSchema.SetR(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)ByteSchema.Type, (RangeValidator)null, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], ByteSchema.Type, null, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result3.Error); ColorSchema.SetG(ref instance, valueObj3); object valueObj4; - Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], (TypeSchema)ByteSchema.Type, (RangeValidator)null, out valueObj4); + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], ByteSchema.Type, null, out valueObj4); if (result4.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result4.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result4.Error); ColorSchema.SetB(ref instance, valueObj4); return result4; } @@ -221,19 +221,19 @@ namespace Microsoft.Iris.Markup.UIX { instance = ColorSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)SingleSchema.Type, SingleSchema.Validate0to1, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result1.Error); ColorSchema.SetRed(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, SingleSchema.Validate0to1, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result2.Error); ColorSchema.SetGreen(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)SingleSchema.Type, SingleSchema.Validate0to1, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result3.Error); ColorSchema.SetBlue(ref instance, valueObj3); return result3; } @@ -251,19 +251,19 @@ namespace Microsoft.Iris.Markup.UIX { instance = ColorSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)ByteSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], ByteSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result1.Error); ColorSchema.SetR(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)ByteSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], ByteSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result2.Error); ColorSchema.SetG(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)ByteSchema.Type, (RangeValidator)null, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], ByteSchema.Type, null, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Color", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Color", result3.Error); ColorSchema.SetB(ref instance, valueObj3); return result3; } @@ -274,24 +274,24 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteUInt32(color.Value); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new Color(reader.ReadUInt32()); + private static object DecodeBinary(ByteCodeReader reader) => new Color(reader.ReadUInt32()); private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; uint num; if (!ColorSchema.s_NameToColorMap.TryGetValue(str.ToLowerInvariant(), out num)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"Color"); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Color"); Color color = new Color(num); - instanceObj = (object)color; + instanceObj = color; return Result.Success; } private static object FindCanonicalInstance(string name) { uint num; - return ColorSchema.s_NameToColorMap.TryGetValue(name.ToLowerInvariant(), out num) ? (object)new Color(num) : (object)null; + return ColorSchema.s_NameToColorMap.TryGetValue(name.ToLowerInvariant(), out num) ? new Color(num) : (object)null; } private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -302,7 +302,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result1 = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result1 = ColorSchema.ConvertFromString(from, out instance); @@ -331,7 +331,7 @@ namespace Microsoft.Iris.Markup.UIX return result1; break; default: - result1 = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Color"); + result1 = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Color"); break; } } @@ -343,7 +343,7 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; Color parameter2 = (Color)parameters[1]; object instanceObj1; - return ColorSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return ColorSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } static ColorSchema() => ColorSchema.s_NameToColorMap = new Dictionary(153) @@ -962,69 +962,69 @@ namespace Microsoft.Iris.Markup.UIX } }; - public static void Pass1Initialize() => ColorSchema.Type = new UIXTypeSchema((short)35, "Color", (string)null, (short)153, typeof(Color), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => ColorSchema.Type = new UIXTypeSchema(35, "Color", null, 153, typeof(Color), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)35, "Alpha", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(ColorSchema.GetAlpha), new SetValueHandler(ColorSchema.SetAlpha), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)35, "Red", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(ColorSchema.GetRed), new SetValueHandler(ColorSchema.SetRed), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)35, "Green", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(ColorSchema.GetGreen), new SetValueHandler(ColorSchema.SetGreen), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)35, "Blue", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(ColorSchema.GetBlue), new SetValueHandler(ColorSchema.SetBlue), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)35, "A", (short)19, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ColorSchema.GetA), new SetValueHandler(ColorSchema.SetA), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)35, "R", (short)19, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ColorSchema.GetR), new SetValueHandler(ColorSchema.SetR), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)35, "G", (short)19, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ColorSchema.GetG), new SetValueHandler(ColorSchema.SetG), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)35, "B", (short)19, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ColorSchema.GetB), new SetValueHandler(ColorSchema.SetB), false); - UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema((short)35, new short[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(35, "Alpha", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(ColorSchema.GetAlpha), new SetValueHandler(ColorSchema.SetAlpha), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(35, "Red", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(ColorSchema.GetRed), new SetValueHandler(ColorSchema.SetRed), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(35, "Green", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(ColorSchema.GetGreen), new SetValueHandler(ColorSchema.SetGreen), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(35, "Blue", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(ColorSchema.GetBlue), new SetValueHandler(ColorSchema.SetBlue), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(35, "A", 19, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ColorSchema.GetA), new SetValueHandler(ColorSchema.SetA), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(35, "R", 19, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ColorSchema.GetR), new SetValueHandler(ColorSchema.SetR), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(35, "G", 19, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ColorSchema.GetG), new SetValueHandler(ColorSchema.SetG), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(35, "B", 19, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ColorSchema.GetB), new SetValueHandler(ColorSchema.SetB), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(35, new short[4] { - (short) 194, - (short) 194, - (short) 194, - (short) 194 + 194, + 194, + 194, + 194 }, new ConstructHandler(ColorSchema.ConstructAlphaRedGreenBlue)); - UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema((short)35, new short[4] + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(35, new short[4] { - (short) 19, - (short) 19, - (short) 19, - (short) 19 + 19, + 19, + 19, + 19 }, new ConstructHandler(ColorSchema.ConstructARGB)); - UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema((short)35, new short[3] + UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema(35, new short[3] { - (short) 194, - (short) 194, - (short) 194 + 194, + 194, + 194 }, new ConstructHandler(ColorSchema.ConstructRedGreenBlue)); - UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema((short)35, new short[3] + UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema(35, new short[3] { - (short) 19, - (short) 19, - (short) 19 + 19, + 19, + 19 }, new ConstructHandler(ColorSchema.ConstructRGB)); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)35, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(35, "TryParse", new short[2] { - (short) 208, - (short) 35 - }, (short)35, new InvokeHandler(ColorSchema.CallTryParseStringColor), true); + 208, + 35 + }, 35, new InvokeHandler(ColorSchema.CallTryParseStringColor), true); ColorSchema.Type.Initialize(new DefaultConstructHandler(ColorSchema.Construct), new ConstructorSchema[4] { - (ConstructorSchema) constructorSchema1, - (ConstructorSchema) constructorSchema2, - (ConstructorSchema) constructorSchema3, - (ConstructorSchema) constructorSchema4 + constructorSchema1, + constructorSchema2, + constructorSchema3, + constructorSchema4 }, new PropertySchema[8] { - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema2 + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema8, + uixPropertySchema4, + uixPropertySchema7, + uixPropertySchema3, + uixPropertySchema6, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, new FindCanonicalInstanceHandler(ColorSchema.FindCanonicalInstance), new TypeConverterHandler(ColorSchema.TryConvertFrom), new SupportsTypeConversionHandler(ColorSchema.IsConversionSupported), new EncodeBinaryHandler(ColorSchema.EncodeBinary), new DecodeBinaryHandler(ColorSchema.DecodeBinary), (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, new FindCanonicalInstanceHandler(ColorSchema.FindCanonicalInstance), new TypeConverterHandler(ColorSchema.TryConvertFrom), new SupportsTypeConversionHandler(ColorSchema.IsConversionSupported), new EncodeBinaryHandler(ColorSchema.EncodeBinary), new DecodeBinaryHandler(ColorSchema.DecodeBinary), null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/CommandSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CommandSchema.cs index 6240468..b513351 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/CommandSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/CommandSchema.cs @@ -16,34 +16,34 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAvailable(ref object instanceObj, object valueObj) => ((IUICommand)instanceObj).Available = (bool)valueObj; - private static object GetPriority(object instanceObj) => (object)((IUICommand)instanceObj).Priority; + private static object GetPriority(object instanceObj) => ((IUICommand)instanceObj).Priority; private static void SetPriority(ref object instanceObj, object valueObj) => ((IUICommand)instanceObj).Priority = (InvokePriority)valueObj; - private static object Construct() => (object)new UICommand(); + private static object Construct() => new UICommand(); private static object CallInvoke(object instanceObj, object[] parameters) { ((IUICommand)instanceObj).Invoke(); - return (object)null; + return null; } - public static void Pass1Initialize() => CommandSchema.Type = new UIXTypeSchema((short)40, "Command", (string)null, (short)153, typeof(IUICommand), UIXTypeFlags.None); + public static void Pass1Initialize() => CommandSchema.Type = new UIXTypeSchema(40, "Command", null, 153, typeof(IUICommand), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)40, "Available", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CommandSchema.GetAvailable), new SetValueHandler(CommandSchema.SetAvailable), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)40, "Priority", (short)126, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(CommandSchema.GetPriority), new SetValueHandler(CommandSchema.SetPriority), false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)40, "Invoked"); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)40, "Invoke", (short[])null, (short)240, new InvokeHandler(CommandSchema.CallInvoke), false); - CommandSchema.Type.Initialize(new DefaultConstructHandler(CommandSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(40, "Available", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CommandSchema.GetAvailable), new SetValueHandler(CommandSchema.SetAvailable), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(40, "Priority", 126, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(CommandSchema.GetPriority), new SetValueHandler(CommandSchema.SetPriority), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(40, "Invoked"); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(40, "Invoke", null, 240, new InvokeHandler(CommandSchema.CallInvoke), false); + CommandSchema.Type.Initialize(new DefaultConstructHandler(CommandSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, new EventSchema[1] { (EventSchema)uixEventSchema }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, new EventSchema[1] { uixEventSchema }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ContrastInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ContrastInstanceSchema.cs index b508643..6323c0b 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ContrastInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ContrastInstanceSchema.cs @@ -31,25 +31,25 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Contrast, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => ContrastInstanceSchema.Type = new UIXTypeSchema((short)43, "ContrastInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => ContrastInstanceSchema.Type = new UIXTypeSchema(43, "ContrastInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)43, "Contrast", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, (GetValueHandler)null, new SetValueHandler(ContrastInstanceSchema.SetContrast), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)43, "PlayContrastAnimation", new short[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(43, "Contrast", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, null, new SetValueHandler(ContrastInstanceSchema.SetContrast), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(43, "PlayContrastAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(ContrastInstanceSchema.CallPlayContrastAnimationEffectFloatAnimation), false); - ContrastInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + 75 + }, 240, new InvokeHandler(ContrastInstanceSchema.CallPlayContrastAnimationEffectFloatAnimation), false); + ContrastInstanceSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ContrastSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ContrastSchema.cs index b9c1fda..b706297 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ContrastSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ContrastSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetContrast(object instanceObj) => (object)((ContrastElement)instanceObj).Contrast; + private static object GetContrast(object instanceObj) => ((ContrastElement)instanceObj).Contrast; private static void SetContrast(ref object instanceObj, object valueObj) { @@ -27,17 +27,17 @@ namespace Microsoft.Iris.Markup.UIX contrastElement.Contrast = num; } - private static object Construct() => (object)new ContrastElement(); + private static object Construct() => new ContrastElement(); - public static void Pass1Initialize() => ContrastSchema.Type = new UIXTypeSchema((short)42, "Contrast", (string)null, (short)80, typeof(ContrastElement), UIXTypeFlags.None); + public static void Pass1Initialize() => ContrastSchema.Type = new UIXTypeSchema(42, "Contrast", null, 80, typeof(ContrastElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)42, "Contrast", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(ContrastSchema.GetContrast), new SetValueHandler(ContrastSchema.SetContrast), false); - ContrastSchema.Type.Initialize(new DefaultConstructHandler(ContrastSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(42, "Contrast", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(ContrastSchema.GetContrast), new SetValueHandler(ContrastSchema.SetContrast), false); + ContrastSchema.Type.Initialize(new DefaultConstructHandler(ContrastSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DataMappingSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DataMappingSchema.cs index 7413147..5b3401d 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DataMappingSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DataMappingSchema.cs @@ -20,19 +20,19 @@ namespace Microsoft.Iris.Markup.UIX private static object GetMappings(object instanceObj) => (object)null; - public static void Pass1Initialize() => DataMappingSchema.Type = new UIXTypeSchema((short)45, "DataMapping", (string)null, (short)-1, typeof(object), UIXTypeFlags.None); + public static void Pass1Initialize() => DataMappingSchema.Type = new UIXTypeSchema(45, "DataMapping", null, -1, typeof(object), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)45, "TargetType", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(DataMappingSchema.SetTargetType), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)45, "Provider", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(DataMappingSchema.SetProvider), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)45, "Mappings", (short)138, (short)140, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(DataMappingSchema.GetMappings), (SetValueHandler)null, false); - DataMappingSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(45, "TargetType", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(DataMappingSchema.SetTargetType), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(45, "Provider", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(DataMappingSchema.SetProvider), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(45, "Mappings", 138, 140, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(DataMappingSchema.GetMappings), null, false); + DataMappingSchema.Type.Initialize(null, null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DataQuerySchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DataQuerySchema.cs index edfad47..b72ab1f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DataQuerySchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DataQuerySchema.cs @@ -20,17 +20,17 @@ namespace Microsoft.Iris.Markup.UIX MarkupDataQuery markupDataQuery = (MarkupDataQuery)instanceObj; } - public static void Pass1Initialize() => DataQuerySchema.Type = new UIXTypeSchema((short)46, "DataQuery", (string)null, (short)29, typeof(MarkupDataQuery), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => DataQuerySchema.Type = new UIXTypeSchema(46, "DataQuery", null, 29, typeof(MarkupDataQuery), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)46, "Provider", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(DataQuerySchema.SetProvider), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)46, "ResultType", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(DataQuerySchema.SetResultType), false); - DataQuerySchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(46, "Provider", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(DataQuerySchema.SetProvider), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(46, "ResultType", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(DataQuerySchema.SetResultType), false); + DataQuerySchema.Type.Initialize(null, null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DataTypeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DataTypeSchema.cs index 29a1588..eefbdb6 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DataTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DataTypeSchema.cs @@ -15,15 +15,15 @@ namespace Microsoft.Iris.Markup.UIX MarkupDataType markupDataType = (MarkupDataType)instanceObj; } - public static void Pass1Initialize() => DataTypeSchema.Type = new UIXTypeSchema((short)48, "DataType", (string)null, (short)29, typeof(MarkupDataType), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => DataTypeSchema.Type = new UIXTypeSchema(48, "DataType", null, 29, typeof(MarkupDataType), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)48, "Provider", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(DataTypeSchema.SetProvider), false); - DataTypeSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(48, "Provider", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(DataTypeSchema.SetProvider), false); + DataTypeSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DebugOutlinesSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DebugOutlinesSchema.cs index b2a91c0..6775947 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DebugOutlinesSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DebugOutlinesSchema.cs @@ -14,11 +14,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetRoot(object instanceObj) => (object)((DebugOutlines)instanceObj).Root; + private static object GetRoot(object instanceObj) => ((DebugOutlines)instanceObj).Root; private static void SetRoot(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).Root = (ViewItem)valueObj; - private static object GetEnabled(object instanceObj) => (object)DebugOutlines.Enabled; + private static object GetEnabled(object instanceObj) => DebugOutlines.Enabled; private static void SetEnabled(ref object instanceObj, object valueObj) { @@ -26,97 +26,97 @@ namespace Microsoft.Iris.Markup.UIX DebugOutlines.Enabled = (bool)valueObj; } - private static object GetOutlineLabel(object instanceObj) => (object)((DebugOutlines)instanceObj).OutlineLabel; + private static object GetOutlineLabel(object instanceObj) => ((DebugOutlines)instanceObj).OutlineLabel; private static void SetOutlineLabel(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).OutlineLabel = (DebugLabelFormat)valueObj; - private static object GetOutlineScope(object instanceObj) => (object)((DebugOutlines)instanceObj).OutlineScope; + private static object GetOutlineScope(object instanceObj) => ((DebugOutlines)instanceObj).OutlineScope; private static void SetOutlineScope(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).OutlineScope = (DebugOutlineScope)valueObj; - private static object GetOutlineColor(object instanceObj) => (object)((DebugOutlines)instanceObj).OutlineColor; + private static object GetOutlineColor(object instanceObj) => ((DebugOutlines)instanceObj).OutlineColor; private static void SetOutlineColor(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).OutlineColor = (Color)valueObj; - private static object GetHostOutlineColor(object instanceObj) => (object)((DebugOutlines)instanceObj).HostOutlineColor; + private static object GetHostOutlineColor(object instanceObj) => ((DebugOutlines)instanceObj).HostOutlineColor; private static void SetHostOutlineColor(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).HostOutlineColor = (Color)valueObj; - private static object GetTextColor(object instanceObj) => (object)((DebugOutlines)instanceObj).TextColor; + private static object GetTextColor(object instanceObj) => ((DebugOutlines)instanceObj).TextColor; private static void SetTextColor(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).TextColor = (Color)valueObj; - private static object GetTextFont(object instanceObj) => (object)((DebugOutlines)instanceObj).TextFont; + private static object GetTextFont(object instanceObj) => ((DebugOutlines)instanceObj).TextFont; private static void SetTextFont(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).TextFont = (Font)valueObj; - private static object GetMouseInteractiveImage(object instanceObj) => (object)((DebugOutlines)instanceObj).MouseInteractiveImage; + private static object GetMouseInteractiveImage(object instanceObj) => ((DebugOutlines)instanceObj).MouseInteractiveImage; private static void SetMouseInteractiveImage(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).MouseInteractiveImage = (UIImage)valueObj; - private static object GetMouseFocusImage(object instanceObj) => (object)((DebugOutlines)instanceObj).MouseFocusImage; + private static object GetMouseFocusImage(object instanceObj) => ((DebugOutlines)instanceObj).MouseFocusImage; private static void SetMouseFocusImage(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).MouseFocusImage = (UIImage)valueObj; - private static object GetKeyInteractiveImage(object instanceObj) => (object)((DebugOutlines)instanceObj).KeyInteractiveImage; + private static object GetKeyInteractiveImage(object instanceObj) => ((DebugOutlines)instanceObj).KeyInteractiveImage; private static void SetKeyInteractiveImage(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).KeyInteractiveImage = (UIImage)valueObj; - private static object GetKeyFocusImage(object instanceObj) => (object)((DebugOutlines)instanceObj).KeyFocusImage; + private static object GetKeyFocusImage(object instanceObj) => ((DebugOutlines)instanceObj).KeyFocusImage; private static void SetKeyFocusImage(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).KeyFocusImage = (UIImage)valueObj; - private static object Construct() => (object)new DebugOutlines(); + private static object Construct() => new DebugOutlines(); private static object CallNextScopeMode(object instanceObj, object[] parameters) { ((DebugOutlines)instanceObj).NextScopeMode(); - return (object)null; + return null; } private static object CallNextLabelMode(object instanceObj, object[] parameters) { ((DebugOutlines)instanceObj).NextLabelMode(); - return (object)null; + return null; } - public static void Pass1Initialize() => DebugOutlinesSchema.Type = new UIXTypeSchema((short)52, "DebugOutlines", (string)null, (short)239, typeof(DebugOutlines), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => DebugOutlinesSchema.Type = new UIXTypeSchema(52, "DebugOutlines", null, 239, typeof(DebugOutlines), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)52, "Root", (short)239, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetRoot), new SetValueHandler(DebugOutlinesSchema.SetRoot), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)52, "Enabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(DebugOutlinesSchema.GetEnabled), new SetValueHandler(DebugOutlinesSchema.SetEnabled), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)52, "OutlineLabel", (short)50, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetOutlineLabel), new SetValueHandler(DebugOutlinesSchema.SetOutlineLabel), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)52, "OutlineScope", (short)51, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetOutlineScope), new SetValueHandler(DebugOutlinesSchema.SetOutlineScope), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)52, "OutlineColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetOutlineColor), new SetValueHandler(DebugOutlinesSchema.SetOutlineColor), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)52, "HostOutlineColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetHostOutlineColor), new SetValueHandler(DebugOutlinesSchema.SetHostOutlineColor), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)52, "TextColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetTextColor), new SetValueHandler(DebugOutlinesSchema.SetTextColor), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)52, "TextFont", (short)93, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetTextFont), new SetValueHandler(DebugOutlinesSchema.SetTextFont), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)52, "MouseInteractiveImage", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetMouseInteractiveImage), new SetValueHandler(DebugOutlinesSchema.SetMouseInteractiveImage), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)52, "MouseFocusImage", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetMouseFocusImage), new SetValueHandler(DebugOutlinesSchema.SetMouseFocusImage), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)52, "KeyInteractiveImage", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetKeyInteractiveImage), new SetValueHandler(DebugOutlinesSchema.SetKeyInteractiveImage), false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)52, "KeyFocusImage", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DebugOutlinesSchema.GetKeyFocusImage), new SetValueHandler(DebugOutlinesSchema.SetKeyFocusImage), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)52, "NextScopeMode", (short[])null, (short)240, new InvokeHandler(DebugOutlinesSchema.CallNextScopeMode), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)52, "NextLabelMode", (short[])null, (short)240, new InvokeHandler(DebugOutlinesSchema.CallNextLabelMode), false); - DebugOutlinesSchema.Type.Initialize(new DefaultConstructHandler(DebugOutlinesSchema.Construct), (ConstructorSchema[])null, new PropertySchema[12] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(52, "Root", 239, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetRoot), new SetValueHandler(DebugOutlinesSchema.SetRoot), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(52, "Enabled", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(DebugOutlinesSchema.GetEnabled), new SetValueHandler(DebugOutlinesSchema.SetEnabled), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(52, "OutlineLabel", 50, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetOutlineLabel), new SetValueHandler(DebugOutlinesSchema.SetOutlineLabel), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(52, "OutlineScope", 51, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetOutlineScope), new SetValueHandler(DebugOutlinesSchema.SetOutlineScope), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(52, "OutlineColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetOutlineColor), new SetValueHandler(DebugOutlinesSchema.SetOutlineColor), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(52, "HostOutlineColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetHostOutlineColor), new SetValueHandler(DebugOutlinesSchema.SetHostOutlineColor), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(52, "TextColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetTextColor), new SetValueHandler(DebugOutlinesSchema.SetTextColor), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(52, "TextFont", 93, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetTextFont), new SetValueHandler(DebugOutlinesSchema.SetTextFont), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(52, "MouseInteractiveImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetMouseInteractiveImage), new SetValueHandler(DebugOutlinesSchema.SetMouseInteractiveImage), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(52, "MouseFocusImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetMouseFocusImage), new SetValueHandler(DebugOutlinesSchema.SetMouseFocusImage), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(52, "KeyInteractiveImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetKeyInteractiveImage), new SetValueHandler(DebugOutlinesSchema.SetKeyInteractiveImage), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(52, "KeyFocusImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DebugOutlinesSchema.GetKeyFocusImage), new SetValueHandler(DebugOutlinesSchema.SetKeyFocusImage), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(52, "NextScopeMode", null, 240, new InvokeHandler(DebugOutlinesSchema.CallNextScopeMode), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(52, "NextLabelMode", null, 240, new InvokeHandler(DebugOutlinesSchema.CallNextLabelMode), false); + DebugOutlinesSchema.Type.Initialize(new DefaultConstructHandler(DebugOutlinesSchema.Construct), null, new PropertySchema[12] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema8 + uixPropertySchema2, + uixPropertySchema6, + uixPropertySchema12, + uixPropertySchema11, + uixPropertySchema10, + uixPropertySchema9, + uixPropertySchema5, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema7, + uixPropertySchema8 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DebugSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DebugSchema.cs index 93788a2..cd6db1f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DebugSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DebugSchema.cs @@ -15,34 +15,34 @@ namespace Microsoft.Iris.Markup.UIX private static object CallTraceString(object instanceObj, object[] parameters) { - NativeApi.SpLogTrace((string)null, (string)parameters[0], 0); - return (object)null; + NativeApi.SpLogTrace(null, (string)parameters[0], 0); + return null; } private static object CallTraceStringObject(object instanceObj, object[] parameters) { - DebugSchema.Trace((string)parameters[0], parameters[1], (object)null, (object)null, (object)null, (object)null); - return (object)null; + DebugSchema.Trace((string)parameters[0], parameters[1], null, null, null, null); + return null; } private static object CallTraceStringObjectObject(object instanceObj, object[] parameters) { - DebugSchema.Trace((string)parameters[0], parameters[1], parameters[2], (object)null, (object)null, (object)null); - return (object)null; + DebugSchema.Trace((string)parameters[0], parameters[1], parameters[2], null, null, null); + return null; } private static object CallTraceStringObjectObjectObject(object instanceObj, object[] parameters) { - DebugSchema.Trace((string)parameters[0], parameters[1], parameters[2], parameters[3], (object)null, (object)null); - return (object)null; + DebugSchema.Trace((string)parameters[0], parameters[1], parameters[2], parameters[3], null, null); + return null; } private static object CallTraceStringObjectObjectObjectObject( object instanceObj, object[] parameters) { - DebugSchema.Trace((string)parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], (object)null); - return (object)null; + DebugSchema.Trace((string)parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], null); + return null; } private static object CallTraceStringObjectObjectObjectObjectObject( @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { DebugSchema.Trace((string)parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5]); - return (object)null; + return null; } private static void Trace( @@ -68,63 +68,63 @@ namespace Microsoft.Iris.Markup.UIX } catch (FormatException ex) { - message = string.Format("Invalid format for Debug.Trace [{0}].", (object)format); + message = string.Format("Invalid format for Debug.Trace [{0}].", format); } - NativeApi.SpLogTrace((string)null, message, 0); + NativeApi.SpLogTrace(null, message, 0); } - public static void Pass1Initialize() => DebugSchema.Type = new UIXTypeSchema((short)49, "Debug", (string)null, (short)153, typeof(object), UIXTypeFlags.Static); + public static void Pass1Initialize() => DebugSchema.Type = new UIXTypeSchema(49, "Debug", null, 153, typeof(object), UIXTypeFlags.Static); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)49, "Trace", new short[1] + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(49, "Trace", new short[1] { - (short) 208 - }, (short)240, new InvokeHandler(DebugSchema.CallTraceString), true); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)49, "Trace", new short[2] + 208 + }, 240, new InvokeHandler(DebugSchema.CallTraceString), true); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(49, "Trace", new short[2] { - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(DebugSchema.CallTraceStringObject), true); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)49, "Trace", new short[3] + 208, + 153 + }, 240, new InvokeHandler(DebugSchema.CallTraceStringObject), true); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(49, "Trace", new short[3] { - (short) 208, - (short) 153, - (short) 153 - }, (short)240, new InvokeHandler(DebugSchema.CallTraceStringObjectObject), true); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)49, "Trace", new short[4] + 208, + 153, + 153 + }, 240, new InvokeHandler(DebugSchema.CallTraceStringObjectObject), true); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(49, "Trace", new short[4] { - (short) 208, - (short) 153, - (short) 153, - (short) 153 - }, (short)240, new InvokeHandler(DebugSchema.CallTraceStringObjectObjectObject), true); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)49, "Trace", new short[5] + 208, + 153, + 153, + 153 + }, 240, new InvokeHandler(DebugSchema.CallTraceStringObjectObjectObject), true); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(49, "Trace", new short[5] { - (short) 208, - (short) 153, - (short) 153, - (short) 153, - (short) 153 - }, (short)240, new InvokeHandler(DebugSchema.CallTraceStringObjectObjectObjectObject), true); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)49, "Trace", new short[6] + 208, + 153, + 153, + 153, + 153 + }, 240, new InvokeHandler(DebugSchema.CallTraceStringObjectObjectObjectObject), true); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(49, "Trace", new short[6] { - (short) 208, - (short) 153, - (short) 153, - (short) 153, - (short) 153, - (short) 153 - }, (short)240, new InvokeHandler(DebugSchema.CallTraceStringObjectObjectObjectObjectObject), true); - DebugSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[6] + 208, + 153, + 153, + 153, + 153, + 153 + }, 240, new InvokeHandler(DebugSchema.CallTraceStringObjectObjectObjectObjectObject), true); + DebugSchema.Type.Initialize(null, null, null, new MethodSchema[6] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DefaultLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DefaultLayoutSchema.cs index 585ddb5..a30ec20 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DefaultLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DefaultLayoutSchema.cs @@ -12,10 +12,10 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)DefaultLayout.Instance; + private static object Construct() => DefaultLayout.Instance; - public static void Pass1Initialize() => DefaultLayoutSchema.Type = new UIXTypeSchema((short)53, "DefaultLayout", (string)null, (short)132, typeof(DefaultLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => DefaultLayoutSchema.Type = new UIXTypeSchema(53, "DefaultLayout", null, 132, typeof(DefaultLayout), UIXTypeFlags.Immutable); - public static void Pass2Initialize() => DefaultLayoutSchema.Type.Initialize(new DefaultConstructHandler(DefaultLayoutSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => DefaultLayoutSchema.Type.Initialize(new DefaultConstructHandler(DefaultLayoutSchema.Construct), null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DesaturateInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DesaturateInstanceSchema.cs index ebf8f72..6590865 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DesaturateInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DesaturateInstanceSchema.cs @@ -31,25 +31,25 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Desaturate, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => DesaturateInstanceSchema.Type = new UIXTypeSchema((short)55, "DesaturateInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => DesaturateInstanceSchema.Type = new UIXTypeSchema(55, "DesaturateInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)55, "Desaturate", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, (GetValueHandler)null, new SetValueHandler(DesaturateInstanceSchema.SetDesaturate), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)55, "PlayDesaturateAnimation", new short[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(55, "Desaturate", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, null, new SetValueHandler(DesaturateInstanceSchema.SetDesaturate), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(55, "PlayDesaturateAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(DesaturateInstanceSchema.CallPlayDesaturateAnimationEffectFloatAnimation), false); - DesaturateInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + 75 + }, 240, new InvokeHandler(DesaturateInstanceSchema.CallPlayDesaturateAnimationEffectFloatAnimation), false); + DesaturateInstanceSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DesaturateSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DesaturateSchema.cs index 2eab01d..550b3ef 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DesaturateSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DesaturateSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetDesaturate(object instanceObj) => (object)((DesaturateElement)instanceObj).Desaturate; + private static object GetDesaturate(object instanceObj) => ((DesaturateElement)instanceObj).Desaturate; private static void SetDesaturate(ref object instanceObj, object valueObj) { @@ -27,17 +27,17 @@ namespace Microsoft.Iris.Markup.UIX desaturateElement.Desaturate = num; } - private static object Construct() => (object)new DesaturateElement(); + private static object Construct() => new DesaturateElement(); - public static void Pass1Initialize() => DesaturateSchema.Type = new UIXTypeSchema((short)54, "Desaturate", (string)null, (short)80, typeof(DesaturateElement), UIXTypeFlags.None); + public static void Pass1Initialize() => DesaturateSchema.Type = new UIXTypeSchema(54, "Desaturate", null, 80, typeof(DesaturateElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)54, "Desaturate", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(DesaturateSchema.GetDesaturate), new SetValueHandler(DesaturateSchema.SetDesaturate), false); - DesaturateSchema.Type.Initialize(new DefaultConstructHandler(DesaturateSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(54, "Desaturate", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(DesaturateSchema.GetDesaturate), new SetValueHandler(DesaturateSchema.SetDesaturate), false); + DesaturateSchema.Type.Initialize(new DefaultConstructHandler(DesaturateSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DestinationElementInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DestinationElementInstanceSchema.cs index 058e33f..08946bf 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DestinationElementInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DestinationElementInstanceSchema.cs @@ -23,27 +23,27 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Downsample, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => DestinationElementInstanceSchema.Type = new UIXTypeSchema((short)57, "DestinationElementInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => DestinationElementInstanceSchema.Type = new UIXTypeSchema(57, "DestinationElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)57, "Downsample", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(DestinationElementInstanceSchema.SetDownsample), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)57, "UVOffset", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(DestinationElementInstanceSchema.SetUVOffset), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)57, "PlayDownsampleAnimation", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(57, "Downsample", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(DestinationElementInstanceSchema.SetDownsample), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(57, "UVOffset", 233, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(DestinationElementInstanceSchema.SetUVOffset), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(57, "PlayDownsampleAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(DestinationElementInstanceSchema.CallPlayDownsampleAnimationEffectFloatAnimation), false); - DestinationElementInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[2] + 75 + }, 240, new InvokeHandler(DestinationElementInstanceSchema.CallPlayDownsampleAnimationEffectFloatAnimation), false); + DestinationElementInstanceSchema.Type.Initialize(null, null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DestinationElementSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DestinationElementSchema.cs index c08161c..3d11e25 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DestinationElementSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DestinationElementSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetDownsample(object instanceObj) => (object)((DestinationElement)instanceObj).Downsample; + private static object GetDownsample(object instanceObj) => ((DestinationElement)instanceObj).Downsample; private static void SetDownsample(ref object instanceObj, object valueObj) { @@ -27,23 +27,23 @@ namespace Microsoft.Iris.Markup.UIX destinationElement.Downsample = num; } - private static object GetUVOffset(object instanceObj) => (object)((DestinationElement)instanceObj).UVOffset; + private static object GetUVOffset(object instanceObj) => ((DestinationElement)instanceObj).UVOffset; private static void SetUVOffset(ref object instanceObj, object valueObj) => ((DestinationElement)instanceObj).UVOffset = (Vector2)valueObj; - private static object Construct() => (object)new DestinationElement(); + private static object Construct() => new DestinationElement(); - public static void Pass1Initialize() => DestinationElementSchema.Type = new UIXTypeSchema((short)56, "DestinationElement", (string)null, (short)77, typeof(DestinationElement), UIXTypeFlags.None); + public static void Pass1Initialize() => DestinationElementSchema.Type = new UIXTypeSchema(56, "DestinationElement", null, 77, typeof(DestinationElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)56, "Downsample", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(DestinationElementSchema.GetDownsample), new SetValueHandler(DestinationElementSchema.SetDownsample), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)56, "UVOffset", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(DestinationElementSchema.GetUVOffset), new SetValueHandler(DestinationElementSchema.SetUVOffset), false); - DestinationElementSchema.Type.Initialize(new DefaultConstructHandler(DestinationElementSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(56, "Downsample", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(DestinationElementSchema.GetDownsample), new SetValueHandler(DestinationElementSchema.SetDownsample), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(56, "UVOffset", 233, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(DestinationElementSchema.GetUVOffset), new SetValueHandler(DestinationElementSchema.SetUVOffset), false); + DestinationElementSchema.Type.Initialize(new DefaultConstructHandler(DestinationElementSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DictionarySchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DictionarySchema.cs index 03c53da..507ce60 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DictionarySchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DictionarySchema.cs @@ -14,9 +14,9 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetSource(object instanceObj) => (object)(IDictionary)instanceObj; + private static object GetSource(object instanceObj) => (IDictionary)instanceObj; - private static object Construct() => (object)new Dictionary(); + private static object Construct() => new Dictionary(); private static object Callget_ItemObject(object instanceObj, object[] parameters) { @@ -24,8 +24,8 @@ namespace Microsoft.Iris.Markup.UIX object parameter = parameters[0]; if (parameter != null) return dictionary[parameter]; - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"key"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "key"); + return null; } private static object CallContainsObject(object instanceObj, object[] parameters) @@ -34,8 +34,8 @@ namespace Microsoft.Iris.Markup.UIX object parameter = parameters[0]; if (parameter != null) return BooleanBoxes.Box(dictionary.Contains(parameter)); - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"key"); - return (object)false; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "key"); + return false; } private static object Callset_ItemObjectObject(object instanceObj, object[] parameters) @@ -45,40 +45,40 @@ namespace Microsoft.Iris.Markup.UIX object parameter2 = parameters[1]; if (parameter1 == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"key"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "key"); + return null; } dictionary[parameter1] = parameter2; - return (object)null; + return null; } - public static void Pass1Initialize() => DictionarySchema.Type = new UIXTypeSchema((short)58, "Dictionary", (string)null, (short)153, typeof(IDictionary), UIXTypeFlags.None); + public static void Pass1Initialize() => DictionarySchema.Type = new UIXTypeSchema(58, "Dictionary", null, 153, typeof(IDictionary), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)58, "Source", (short)58, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DictionarySchema.GetSource), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)58, "get_Item", new short[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(58, "Source", 58, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DictionarySchema.GetSource), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(58, "get_Item", new short[1] { - (short) 153 - }, (short)153, new InvokeHandler(DictionarySchema.Callget_ItemObject), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)58, "Contains", new short[1] + 153 + }, 153, new InvokeHandler(DictionarySchema.Callget_ItemObject), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(58, "Contains", new short[1] { - (short) 153 - }, (short)15, new InvokeHandler(DictionarySchema.CallContainsObject), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)58, "set_Item", new short[2] + 153 + }, 15, new InvokeHandler(DictionarySchema.CallContainsObject), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(58, "set_Item", new short[2] { - (short) 153, - (short) 153 - }, (short)240, new InvokeHandler(DictionarySchema.Callset_ItemObjectObject), false); - DictionarySchema.Type.Initialize(new DefaultConstructHandler(DictionarySchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + 153, + 153 + }, 240, new InvokeHandler(DictionarySchema.Callset_ItemObjectObject), false); + DictionarySchema.Type.Initialize(new DefaultConstructHandler(DictionarySchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[3] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DockLayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DockLayoutInputSchema.cs index 5975094..7f95b79 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DockLayoutInputSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DockLayoutInputSchema.cs @@ -13,20 +13,20 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)DockLayoutInput.Client; + private static object Construct() => DockLayoutInput.Client; private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; DockLayoutInput instance = DockLayoutInputSchema.StringToInstance(str); if (instance == null) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"DockLayoutInput"); - instanceObj = (object)instance; + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "DockLayoutInput"); + instanceObj = instance; return Result.Success; } - private static object FindCanonicalInstance(string name) => (object)DockLayoutInputSchema.StringToInstance(name); + private static object FindCanonicalInstance(string name) => DockLayoutInputSchema.StringToInstance(name); private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = DockLayoutInputSchema.ConvertFromString(from, out instance); @@ -51,7 +51,7 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; DockLayoutInput parameter2 = (DockLayoutInput)parameters[1]; object instanceObj1; - return DockLayoutInputSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return DockLayoutInputSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } private static DockLayoutInput StringToInstance(string value) @@ -64,22 +64,22 @@ namespace Microsoft.Iris.Markup.UIX return DockLayoutInput.Right; if (value == "Bottom") return DockLayoutInput.Bottom; - return value == "Client" ? DockLayoutInput.Client : (DockLayoutInput)null; + return value == "Client" ? DockLayoutInput.Client : null; } - public static void Pass1Initialize() => DockLayoutInputSchema.Type = new UIXTypeSchema((short)60, "DockLayoutInput", (string)null, (short)133, typeof(DockLayoutInput), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => DockLayoutInputSchema.Type = new UIXTypeSchema(60, "DockLayoutInput", null, 133, typeof(DockLayoutInput), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)60, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(60, "TryParse", new short[2] { - (short) 208, - (short) 60 - }, (short)60, new InvokeHandler(DockLayoutInputSchema.CallTryParseStringDockLayoutInput), true); - DockLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(DockLayoutInputSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[1] + 208, + 60 + }, 60, new InvokeHandler(DockLayoutInputSchema.CallTryParseStringDockLayoutInput), true); + DockLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(DockLayoutInputSchema.Construct), null, null, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, new FindCanonicalInstanceHandler(DockLayoutInputSchema.FindCanonicalInstance), new TypeConverterHandler(DockLayoutInputSchema.TryConvertFrom), new SupportsTypeConversionHandler(DockLayoutInputSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, new FindCanonicalInstanceHandler(DockLayoutInputSchema.FindCanonicalInstance), new TypeConverterHandler(DockLayoutInputSchema.TryConvertFrom), new SupportsTypeConversionHandler(DockLayoutInputSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DockLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DockLayoutSchema.cs index 3e17aea..6961d45 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DockLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DockLayoutSchema.cs @@ -13,27 +13,27 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetDefaultLayoutInput(object instanceObj) => (object)((DockLayout)instanceObj).DefaultLayoutInput; + private static object GetDefaultLayoutInput(object instanceObj) => ((DockLayout)instanceObj).DefaultLayoutInput; private static void SetDefaultLayoutInput(ref object instanceObj, object valueObj) => ((DockLayout)instanceObj).DefaultLayoutInput = (DockLayoutInput)valueObj; - private static object GetDefaultChildAlignment(object instanceObj) => (object)((DockLayout)instanceObj).DefaultChildAlignment; + private static object GetDefaultChildAlignment(object instanceObj) => ((DockLayout)instanceObj).DefaultChildAlignment; private static void SetDefaultChildAlignment(ref object instanceObj, object valueObj) => ((DockLayout)instanceObj).DefaultChildAlignment = (ItemAlignment)valueObj; - private static object Construct() => (object)new DockLayout(); + private static object Construct() => new DockLayout(); - public static void Pass1Initialize() => DockLayoutSchema.Type = new UIXTypeSchema((short)59, "DockLayout", (string)null, (short)132, typeof(DockLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => DockLayoutSchema.Type = new UIXTypeSchema(59, "DockLayout", null, 132, typeof(DockLayout), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)59, "DefaultLayoutInput", (short)60, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(DockLayoutSchema.GetDefaultLayoutInput), new SetValueHandler(DockLayoutSchema.SetDefaultLayoutInput), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)59, "DefaultChildAlignment", (short)sbyte.MaxValue, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(DockLayoutSchema.GetDefaultChildAlignment), new SetValueHandler(DockLayoutSchema.SetDefaultChildAlignment), false); - DockLayoutSchema.Type.Initialize(new DefaultConstructHandler(DockLayoutSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(59, "DefaultLayoutInput", 60, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(DockLayoutSchema.GetDefaultLayoutInput), new SetValueHandler(DockLayoutSchema.SetDefaultLayoutInput), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(59, "DefaultChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(DockLayoutSchema.GetDefaultChildAlignment), new SetValueHandler(DockLayoutSchema.SetDefaultChildAlignment), false); + DockLayoutSchema.Type.Initialize(new DefaultConstructHandler(DockLayoutSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DoubleSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DoubleSchema.cs index e63c1a1..cdb53d8 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DoubleSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DoubleSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)0.0; + private static object Construct() => 0.0; private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) { @@ -22,65 +22,65 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteDouble(num); } - private static object DecodeBinary(ByteCodeReader reader) => (object)reader.ReadDouble(); + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadDouble(); private static Result ConvertFromString(object valueObj, out object instanceObj) { string s = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; double result; - if (!double.TryParse(s, NumberStyles.Float, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)s, (object)"Double"); - instanceObj = (object)result; + if (!double.TryParse(s, NumberStyles.Float, NumberFormatInfo.InvariantInfo, out result)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", s, "Double"); + instanceObj = result; return Result.Success; } private static Result ConvertFromBoolean(object valueObj, out object instanceObj) { bool flag = (bool)valueObj; - instanceObj = (object)null; + instanceObj = null; double num = flag ? 1.0 : 0.0; - instanceObj = (object)num; + instanceObj = num; return Result.Success; } private static Result ConvertFromByte(object valueObj, out object instanceObj) { byte num1 = (byte)valueObj; - instanceObj = (object)null; - double num2 = (double)num1; - instanceObj = (object)num2; + instanceObj = null; + double num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromInt32(object valueObj, out object instanceObj) { int num1 = (int)valueObj; - instanceObj = (object)null; - double num2 = (double)num1; - instanceObj = (object)num2; + instanceObj = null; + double num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromInt64(object valueObj, out object instanceObj) { long num1 = (long)valueObj; - instanceObj = (object)null; - double num2 = (double)num1; - instanceObj = (object)num2; + instanceObj = null; + double num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromSingle(object valueObj, out object instanceObj) { float num1 = (float)valueObj; - instanceObj = (object)null; - double num2 = (double)num1; - instanceObj = (object)num2; + instanceObj = null; + double num2 = num1; + instanceObj = num2; return Result.Success; } - private static object CallToStringString(object instanceObj, object[] parameters) => (object)((double)instanceObj).ToString((string)parameters[0]); + private static object CallToStringString(object instanceObj, object[] parameters) => ((double)instanceObj).ToString((string)parameters[0]); private static object CallIsNaNDouble(object instanceObj, object[] parameters) => BooleanBoxes.Box(double.IsNaN((double)parameters[0])); @@ -96,7 +96,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (BooleanSchema.Type.IsAssignableFrom(fromType)) { result = DoubleSchema.ConvertFromBoolean(from, out instance); @@ -162,20 +162,20 @@ namespace Microsoft.Iris.Markup.UIX { double num1 = (double)leftObj; if (op == OperationType.MathNegate) - return (object)-num1; + return -num1; double num2 = (double)rightObj; switch (op - 1) { - case (OperationType)0: - return (object)(num1 + num2); + case 0: + return num1 + num2; case OperationType.MathAdd: - return (object)(num1 - num2); + return num1 - num2; case OperationType.MathSubtract: - return (object)(num1 * num2); + return num1 * num2; case OperationType.MathMultiply: - return (object)(num1 / num2); + return num1 / num2; case OperationType.MathDivide: - return (object)(num1 % num2); + return num1 % num2; case OperationType.LogicalOr: return BooleanBoxes.Box(num1 == num2); case OperationType.RelationalEquals: @@ -189,7 +189,7 @@ namespace Microsoft.Iris.Markup.UIX case OperationType.RelationalLessThanEquals: return BooleanBoxes.Box(num1 >= num2); default: - return (object)null; + return null; } } @@ -198,42 +198,42 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; double parameter2 = (double)parameters[1]; object instanceObj1; - return DoubleSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return DoubleSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => DoubleSchema.Type = new UIXTypeSchema((short)61, "Double", "double", (short)153, typeof(double), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => DoubleSchema.Type = new UIXTypeSchema(61, "Double", "double", 153, typeof(double), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)61, "ToString", new short[1] + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(61, "ToString", new short[1] { - (short) 208 - }, (short)208, new InvokeHandler(DoubleSchema.CallToStringString), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)61, "IsNaN", new short[1] + 208 + }, 208, new InvokeHandler(DoubleSchema.CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(61, "IsNaN", new short[1] { - (short) 61 - }, (short)15, new InvokeHandler(DoubleSchema.CallIsNaNDouble), true); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)61, "IsNegativeInfinity", new short[1] + 61 + }, 15, new InvokeHandler(DoubleSchema.CallIsNaNDouble), true); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(61, "IsNegativeInfinity", new short[1] { - (short) 61 - }, (short)15, new InvokeHandler(DoubleSchema.CallIsNegativeInfinityDouble), true); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)61, "IsPositiveInfinity", new short[1] + 61 + }, 15, new InvokeHandler(DoubleSchema.CallIsNegativeInfinityDouble), true); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(61, "IsPositiveInfinity", new short[1] { - (short) 61 - }, (short)15, new InvokeHandler(DoubleSchema.CallIsPositiveInfinityDouble), true); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)61, "TryParse", new short[2] + 61 + }, 15, new InvokeHandler(DoubleSchema.CallIsPositiveInfinityDouble), true); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(61, "TryParse", new short[2] { - (short) 208, - (short) 61 - }, (short)61, new InvokeHandler(DoubleSchema.CallTryParseStringDouble), true); - DoubleSchema.Type.Initialize(new DefaultConstructHandler(DoubleSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[5] + 208, + 61 + }, 61, new InvokeHandler(DoubleSchema.CallTryParseStringDouble), true); + DoubleSchema.Type.Initialize(new DefaultConstructHandler(DoubleSchema.Construct), null, null, new MethodSchema[5] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(DoubleSchema.TryConvertFrom), new SupportsTypeConversionHandler(DoubleSchema.IsConversionSupported), new EncodeBinaryHandler(DoubleSchema.EncodeBinary), new DecodeBinaryHandler(DoubleSchema.DecodeBinary), new PerformOperationHandler(DoubleSchema.ExecuteOperation), new SupportsOperationHandler(DoubleSchema.IsOperationSupported)); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5 + }, null, null, new TypeConverterHandler(DoubleSchema.TryConvertFrom), new SupportsTypeConversionHandler(DoubleSchema.IsConversionSupported), new EncodeBinaryHandler(DoubleSchema.EncodeBinary), new DecodeBinaryHandler(DoubleSchema.DecodeBinary), new PerformOperationHandler(DoubleSchema.ExecuteOperation), new SupportsOperationHandler(DoubleSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DragHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DragHandlerSchema.cs index 39c52af..2513fc8 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DragHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DragHandlerSchema.cs @@ -14,25 +14,25 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetBeginDragPolicy(object instanceObj) => (object)((DragHandler)instanceObj).BeginDragPolicy; + private static object GetBeginDragPolicy(object instanceObj) => ((DragHandler)instanceObj).BeginDragPolicy; private static void SetBeginDragPolicy(ref object instanceObj, object valueObj) => ((DragHandler)instanceObj).BeginDragPolicy = (BeginDragPolicy)valueObj; private static object GetDragging(object instanceObj) => BooleanBoxes.Box(((DragHandler)instanceObj).Dragging); - private static object GetBeginPosition(object instanceObj) => (object)((DragHandler)instanceObj).BeginPosition; + private static object GetBeginPosition(object instanceObj) => ((DragHandler)instanceObj).BeginPosition; - private static object GetEndPosition(object instanceObj) => (object)((DragHandler)instanceObj).EndPosition; + private static object GetEndPosition(object instanceObj) => ((DragHandler)instanceObj).EndPosition; - private static object GetScreenDragSize(object instanceObj) => (object)((DragHandler)instanceObj).ScreenDragSize; + private static object GetScreenDragSize(object instanceObj) => ((DragHandler)instanceObj).ScreenDragSize; - private static object GetLocalDragSize(object instanceObj) => (object)((DragHandler)instanceObj).LocalDragSize; + private static object GetLocalDragSize(object instanceObj) => ((DragHandler)instanceObj).LocalDragSize; - private static object GetRelativeDragSize(object instanceObj) => (object)((DragHandler)instanceObj).RelativeDragSize; + private static object GetRelativeDragSize(object instanceObj) => ((DragHandler)instanceObj).RelativeDragSize; - private static object GetActiveModifiers(object instanceObj) => (object)((DragHandler)instanceObj).ActiveModifiers; + private static object GetActiveModifiers(object instanceObj) => ((DragHandler)instanceObj).ActiveModifiers; - private static object GetDragCursor(object instanceObj) => (object)((DragHandler)instanceObj).DragCursor; + private static object GetDragCursor(object instanceObj) => ((DragHandler)instanceObj).DragCursor; private static void SetDragCursor(ref object instanceObj, object valueObj) => ((DragHandler)instanceObj).DragCursor = (CursorID)valueObj; @@ -40,85 +40,85 @@ namespace Microsoft.Iris.Markup.UIX private static void SetCancelOnEscape(ref object instanceObj, object valueObj) => ((DragHandler)instanceObj).CancelOnEscape = (bool)valueObj; - private static object GetRelativeTo(object instanceObj) => (object)((DragHandler)instanceObj).RelativeTo; + private static object GetRelativeTo(object instanceObj) => ((DragHandler)instanceObj).RelativeTo; private static void SetRelativeTo(ref object instanceObj, object valueObj) => ((DragHandler)instanceObj).RelativeTo = (ViewItem)valueObj; - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; - private static object Construct() => (object)new DragHandler(); + private static object Construct() => new DragHandler(); private static object CallResetDragOrigin(object instanceObj, object[] parameters) { ((DragHandler)instanceObj).ResetDragOrigin(); - return (object)null; + return null; } private static object CallCancelDrag(object instanceObj, object[] parameters) { ((DragHandler)instanceObj).CancelDrag(); - return (object)null; + return null; } - private static object CallGetEventContexts(object instanceObj, object[] parameters) => (object)((DragHandler)instanceObj).GetEventContexts(); + private static object CallGetEventContexts(object instanceObj, object[] parameters) => ((DragHandler)instanceObj).GetEventContexts(); - private static object CallGetAddedEventContexts(object instanceObj, object[] parameters) => (object)((DragHandler)instanceObj).GetAddedEventContexts(); + private static object CallGetAddedEventContexts(object instanceObj, object[] parameters) => ((DragHandler)instanceObj).GetAddedEventContexts(); - private static object CallGetRemovedEventContexts(object instanceObj, object[] parameters) => (object)((DragHandler)instanceObj).GetRemovedEventContexts(); + private static object CallGetRemovedEventContexts(object instanceObj, object[] parameters) => ((DragHandler)instanceObj).GetRemovedEventContexts(); - public static void Pass1Initialize() => DragHandlerSchema.Type = new UIXTypeSchema((short)62, "DragHandler", (string)null, (short)110, typeof(DragHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => DragHandlerSchema.Type = new UIXTypeSchema(62, "DragHandler", null, 110, typeof(DragHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)62, "BeginDragPolicy", (short)12, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetBeginDragPolicy), new SetValueHandler(DragHandlerSchema.SetBeginDragPolicy), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)62, "Dragging", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetDragging), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)62, "BeginPosition", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetBeginPosition), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)62, "EndPosition", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetEndPosition), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)62, "ScreenDragSize", (short)195, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetScreenDragSize), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)62, "LocalDragSize", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetLocalDragSize), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)62, "RelativeDragSize", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetRelativeDragSize), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)62, "ActiveModifiers", (short)111, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetActiveModifiers), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)62, "DragCursor", (short)44, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetDragCursor), new SetValueHandler(DragHandlerSchema.SetDragCursor), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)62, "CancelOnEscape", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetCancelOnEscape), new SetValueHandler(DragHandlerSchema.SetCancelOnEscape), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)62, "RelativeTo", (short)239, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetRelativeTo), new SetValueHandler(DragHandlerSchema.SetRelativeTo), false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)62, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragHandlerSchema.GetHandlerStage), new SetValueHandler(DragHandlerSchema.SetHandlerStage), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)62, "ResetDragOrigin", (short[])null, (short)240, new InvokeHandler(DragHandlerSchema.CallResetDragOrigin), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)62, "CancelDrag", (short[])null, (short)240, new InvokeHandler(DragHandlerSchema.CallCancelDrag), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)62, "GetEventContexts", (short[])null, (short)138, new InvokeHandler(DragHandlerSchema.CallGetEventContexts), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)62, "GetAddedEventContexts", (short[])null, (short)138, new InvokeHandler(DragHandlerSchema.CallGetAddedEventContexts), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)62, "GetRemovedEventContexts", (short[])null, (short)138, new InvokeHandler(DragHandlerSchema.CallGetRemovedEventContexts), false); - UIXEventSchema uixEventSchema1 = new UIXEventSchema((short)62, "Started"); - UIXEventSchema uixEventSchema2 = new UIXEventSchema((short)62, "Canceled"); - UIXEventSchema uixEventSchema3 = new UIXEventSchema((short)62, "Ended"); - DragHandlerSchema.Type.Initialize(new DefaultConstructHandler(DragHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[12] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(62, "BeginDragPolicy", 12, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetBeginDragPolicy), new SetValueHandler(DragHandlerSchema.SetBeginDragPolicy), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(62, "Dragging", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetDragging), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(62, "BeginPosition", 233, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetBeginPosition), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(62, "EndPosition", 233, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetEndPosition), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(62, "ScreenDragSize", 195, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetScreenDragSize), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(62, "LocalDragSize", 233, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetLocalDragSize), null, false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(62, "RelativeDragSize", 233, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetRelativeDragSize), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(62, "ActiveModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetActiveModifiers), null, false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(62, "DragCursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetDragCursor), new SetValueHandler(DragHandlerSchema.SetDragCursor), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(62, "CancelOnEscape", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetCancelOnEscape), new SetValueHandler(DragHandlerSchema.SetCancelOnEscape), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(62, "RelativeTo", 239, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetRelativeTo), new SetValueHandler(DragHandlerSchema.SetRelativeTo), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(62, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragHandlerSchema.GetHandlerStage), new SetValueHandler(DragHandlerSchema.SetHandlerStage), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(62, "ResetDragOrigin", null, 240, new InvokeHandler(DragHandlerSchema.CallResetDragOrigin), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(62, "CancelDrag", null, 240, new InvokeHandler(DragHandlerSchema.CallCancelDrag), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(62, "GetEventContexts", null, 138, new InvokeHandler(DragHandlerSchema.CallGetEventContexts), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(62, "GetAddedEventContexts", null, 138, new InvokeHandler(DragHandlerSchema.CallGetAddedEventContexts), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(62, "GetRemovedEventContexts", null, 138, new InvokeHandler(DragHandlerSchema.CallGetRemovedEventContexts), false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(62, "Started"); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(62, "Canceled"); + UIXEventSchema uixEventSchema3 = new UIXEventSchema(62, "Ended"); + DragHandlerSchema.Type.Initialize(new DefaultConstructHandler(DragHandlerSchema.Construct), null, new PropertySchema[12] { - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema5 + uixPropertySchema8, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema10, + uixPropertySchema9, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema12, + uixPropertySchema6, + uixPropertySchema7, + uixPropertySchema11, + uixPropertySchema5 }, new MethodSchema[5] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5 + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5 }, new EventSchema[3] { - (EventSchema) uixEventSchema1, - (EventSchema) uixEventSchema2, - (EventSchema) uixEventSchema3 - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema1, + uixEventSchema2, + uixEventSchema3 + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DragSourceHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DragSourceHandlerSchema.cs index 1f13c07..d613540 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DragSourceHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DragSourceHandlerSchema.cs @@ -14,11 +14,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetAllowedDropActions(object instanceObj) => (object)((DragSourceHandler)instanceObj).AllowedDropActions; + private static object GetAllowedDropActions(object instanceObj) => ((DragSourceHandler)instanceObj).AllowedDropActions; private static void SetAllowedDropActions(ref object instanceObj, object valueObj) => ((DragSourceHandler)instanceObj).AllowedDropActions = (DropAction)valueObj; - private static object GetCurrentDropAction(object instanceObj) => (object)((DragSourceHandler)instanceObj).CurrentDropAction; + private static object GetCurrentDropAction(object instanceObj) => ((DragSourceHandler)instanceObj).CurrentDropAction; private static object GetValue(object instanceObj) => ((DragSourceHandler)instanceObj).Value; @@ -26,57 +26,57 @@ namespace Microsoft.Iris.Markup.UIX private static object GetDragging(object instanceObj) => BooleanBoxes.Box(((DragSourceHandler)instanceObj).Dragging); - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; - private static object GetMoveCursor(object instanceObj) => (object)((DragSourceHandler)instanceObj).MoveCursor; + private static object GetMoveCursor(object instanceObj) => ((DragSourceHandler)instanceObj).MoveCursor; private static void SetMoveCursor(ref object instanceObj, object valueObj) => ((DragSourceHandler)instanceObj).MoveCursor = (CursorID)valueObj; - private static object GetCopyCursor(object instanceObj) => (object)((DragSourceHandler)instanceObj).CopyCursor; + private static object GetCopyCursor(object instanceObj) => ((DragSourceHandler)instanceObj).CopyCursor; private static void SetCopyCursor(ref object instanceObj, object valueObj) => ((DragSourceHandler)instanceObj).CopyCursor = (CursorID)valueObj; - private static object GetCancelCursor(object instanceObj) => (object)((DragSourceHandler)instanceObj).CancelCursor; + private static object GetCancelCursor(object instanceObj) => ((DragSourceHandler)instanceObj).CancelCursor; private static void SetCancelCursor(ref object instanceObj, object valueObj) => ((DragSourceHandler)instanceObj).CancelCursor = (CursorID)valueObj; - private static object Construct() => (object)new DragSourceHandler(); + private static object Construct() => new DragSourceHandler(); - public static void Pass1Initialize() => DragSourceHandlerSchema.Type = new UIXTypeSchema((short)63, "DragSourceHandler", (string)null, (short)110, typeof(DragSourceHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => DragSourceHandlerSchema.Type = new UIXTypeSchema(63, "DragSourceHandler", null, 110, typeof(DragSourceHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)63, "AllowedDropActions", (short)64, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragSourceHandlerSchema.GetAllowedDropActions), new SetValueHandler(DragSourceHandlerSchema.SetAllowedDropActions), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)63, "CurrentDropAction", (short)64, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragSourceHandlerSchema.GetCurrentDropAction), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)63, "Value", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragSourceHandlerSchema.GetValue), new SetValueHandler(DragSourceHandlerSchema.SetValue), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)63, "Dragging", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragSourceHandlerSchema.GetDragging), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)63, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragSourceHandlerSchema.GetHandlerStage), new SetValueHandler(DragSourceHandlerSchema.SetHandlerStage), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)63, "MoveCursor", (short)44, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragSourceHandlerSchema.GetMoveCursor), new SetValueHandler(DragSourceHandlerSchema.SetMoveCursor), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)63, "CopyCursor", (short)44, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragSourceHandlerSchema.GetCopyCursor), new SetValueHandler(DragSourceHandlerSchema.SetCopyCursor), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)63, "CancelCursor", (short)44, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DragSourceHandlerSchema.GetCancelCursor), new SetValueHandler(DragSourceHandlerSchema.SetCancelCursor), false); - UIXEventSchema uixEventSchema1 = new UIXEventSchema((short)63, "Started"); - UIXEventSchema uixEventSchema2 = new UIXEventSchema((short)63, "Moved"); - UIXEventSchema uixEventSchema3 = new UIXEventSchema((short)63, "Copied"); - UIXEventSchema uixEventSchema4 = new UIXEventSchema((short)63, "Canceled"); - DragSourceHandlerSchema.Type.Initialize(new DefaultConstructHandler(DragSourceHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[8] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(63, "AllowedDropActions", 64, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragSourceHandlerSchema.GetAllowedDropActions), new SetValueHandler(DragSourceHandlerSchema.SetAllowedDropActions), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(63, "CurrentDropAction", 64, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragSourceHandlerSchema.GetCurrentDropAction), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(63, "Value", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragSourceHandlerSchema.GetValue), new SetValueHandler(DragSourceHandlerSchema.SetValue), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(63, "Dragging", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragSourceHandlerSchema.GetDragging), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(63, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragSourceHandlerSchema.GetHandlerStage), new SetValueHandler(DragSourceHandlerSchema.SetHandlerStage), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(63, "MoveCursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragSourceHandlerSchema.GetMoveCursor), new SetValueHandler(DragSourceHandlerSchema.SetMoveCursor), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(63, "CopyCursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragSourceHandlerSchema.GetCopyCursor), new SetValueHandler(DragSourceHandlerSchema.SetCopyCursor), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(63, "CancelCursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DragSourceHandlerSchema.GetCancelCursor), new SetValueHandler(DragSourceHandlerSchema.SetCancelCursor), false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(63, "Started"); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(63, "Moved"); + UIXEventSchema uixEventSchema3 = new UIXEventSchema(63, "Copied"); + UIXEventSchema uixEventSchema4 = new UIXEventSchema(63, "Canceled"); + DragSourceHandlerSchema.Type.Initialize(new DefaultConstructHandler(DragSourceHandlerSchema.Construct), null, new PropertySchema[8] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, new EventSchema[4] + uixPropertySchema1, + uixPropertySchema8, + uixPropertySchema7, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema3 + }, null, new EventSchema[4] { - (EventSchema) uixEventSchema1, - (EventSchema) uixEventSchema2, - (EventSchema) uixEventSchema3, - (EventSchema) uixEventSchema4 - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema1, + uixEventSchema2, + uixEventSchema3, + uixEventSchema4 + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/DropTargetHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DropTargetHandlerSchema.cs index 2952e9a..9465261 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/DropTargetHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/DropTargetHandlerSchema.cs @@ -13,51 +13,51 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetAllowedDropActions(object instanceObj) => (object)((DropTargetHandler)instanceObj).AllowedDropActions; + private static object GetAllowedDropActions(object instanceObj) => ((DropTargetHandler)instanceObj).AllowedDropActions; private static void SetAllowedDropActions(ref object instanceObj, object valueObj) => ((DropTargetHandler)instanceObj).AllowedDropActions = (DropAction)valueObj; private static object GetDragging(object instanceObj) => BooleanBoxes.Box(((DropTargetHandler)instanceObj).Dragging); - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; private static object GetEventContext(object instanceObj) => ((DropTargetHandler)instanceObj).EventContext; - private static object Construct() => (object)new DropTargetHandler(); + private static object Construct() => new DropTargetHandler(); private static object CallGetValue(object instanceObj, object[] parameters) => ((DropTargetHandler)instanceObj).GetValue(); - public static void Pass1Initialize() => DropTargetHandlerSchema.Type = new UIXTypeSchema((short)65, "DropTargetHandler", (string)null, (short)110, typeof(DropTargetHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => DropTargetHandlerSchema.Type = new UIXTypeSchema(65, "DropTargetHandler", null, 110, typeof(DropTargetHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)65, "AllowedDropActions", (short)64, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DropTargetHandlerSchema.GetAllowedDropActions), new SetValueHandler(DropTargetHandlerSchema.SetAllowedDropActions), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)65, "Dragging", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DropTargetHandlerSchema.GetDragging), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)65, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DropTargetHandlerSchema.GetHandlerStage), new SetValueHandler(DropTargetHandlerSchema.SetHandlerStage), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)65, "EventContext", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(DropTargetHandlerSchema.GetEventContext), (SetValueHandler)null, false); - UIXEventSchema uixEventSchema1 = new UIXEventSchema((short)65, "DragEnter"); - UIXEventSchema uixEventSchema2 = new UIXEventSchema((short)65, "DragOver"); - UIXEventSchema uixEventSchema3 = new UIXEventSchema((short)65, "DragLeave"); - UIXEventSchema uixEventSchema4 = new UIXEventSchema((short)65, "Dropped"); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)65, "GetValue", (short[])null, (short)153, new InvokeHandler(DropTargetHandlerSchema.CallGetValue), false); - DropTargetHandlerSchema.Type.Initialize(new DefaultConstructHandler(DropTargetHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(65, "AllowedDropActions", 64, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DropTargetHandlerSchema.GetAllowedDropActions), new SetValueHandler(DropTargetHandlerSchema.SetAllowedDropActions), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(65, "Dragging", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DropTargetHandlerSchema.GetDragging), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(65, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DropTargetHandlerSchema.GetHandlerStage), new SetValueHandler(DropTargetHandlerSchema.SetHandlerStage), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(65, "EventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(DropTargetHandlerSchema.GetEventContext), null, false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(65, "DragEnter"); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(65, "DragOver"); + UIXEventSchema uixEventSchema3 = new UIXEventSchema(65, "DragLeave"); + UIXEventSchema uixEventSchema4 = new UIXEventSchema(65, "Dropped"); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(65, "GetValue", null, 153, new InvokeHandler(DropTargetHandlerSchema.CallGetValue), false); + DropTargetHandlerSchema.Type.Initialize(new DefaultConstructHandler(DropTargetHandlerSchema.Construct), null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema3 + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema3 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema + uixMethodSchema }, new EventSchema[4] { - (EventSchema) uixEventSchema1, - (EventSchema) uixEventSchema2, - (EventSchema) uixEventSchema3, - (EventSchema) uixEventSchema4 - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema1, + uixEventSchema2, + uixEventSchema3, + uixEventSchema4 + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionInstanceSchema.cs index 9766383..8021d2a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionInstanceSchema.cs @@ -31,25 +31,25 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.EdgeLimit, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => EdgeDetectionInstanceSchema.Type = new UIXTypeSchema((short)67, "EdgeDetectionInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => EdgeDetectionInstanceSchema.Type = new UIXTypeSchema(67, "EdgeDetectionInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)67, "EdgeLimit", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, (GetValueHandler)null, new SetValueHandler(EdgeDetectionInstanceSchema.SetEdgeLimit), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)67, "PlayEdgeLimitAnimation", new short[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(67, "EdgeLimit", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, null, new SetValueHandler(EdgeDetectionInstanceSchema.SetEdgeLimit), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(67, "PlayEdgeLimitAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(EdgeDetectionInstanceSchema.CallPlayEdgeLimitAnimationEffectFloatAnimation), false); - EdgeDetectionInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + 75 + }, 240, new InvokeHandler(EdgeDetectionInstanceSchema.CallPlayEdgeLimitAnimationEffectFloatAnimation), false); + EdgeDetectionInstanceSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionSchema.cs index 8033c21..f197256 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetEdgeLimit(object instanceObj) => (object)((EdgeDetectionElement)instanceObj).EdgeLimit; + private static object GetEdgeLimit(object instanceObj) => ((EdgeDetectionElement)instanceObj).EdgeLimit; private static void SetEdgeLimit(ref object instanceObj, object valueObj) { @@ -27,17 +27,17 @@ namespace Microsoft.Iris.Markup.UIX detectionElement.EdgeLimit = num; } - private static object Construct() => (object)new EdgeDetectionElement(); + private static object Construct() => new EdgeDetectionElement(); - public static void Pass1Initialize() => EdgeDetectionSchema.Type = new UIXTypeSchema((short)66, "EdgeDetection", (string)null, (short)80, typeof(EdgeDetectionElement), UIXTypeFlags.None); + public static void Pass1Initialize() => EdgeDetectionSchema.Type = new UIXTypeSchema(66, "EdgeDetection", null, 80, typeof(EdgeDetectionElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)66, "EdgeLimit", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(EdgeDetectionSchema.GetEdgeLimit), new SetValueHandler(EdgeDetectionSchema.SetEdgeLimit), false); - EdgeDetectionSchema.Type.Initialize(new DefaultConstructHandler(EdgeDetectionSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(66, "EdgeLimit", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(EdgeDetectionSchema.GetEdgeLimit), new SetValueHandler(EdgeDetectionSchema.SetEdgeLimit), false); + EdgeDetectionSchema.Type.Initialize(new DefaultConstructHandler(EdgeDetectionSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EditableTextDataSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EditableTextDataSchema.cs index fd160e5..3e498bc 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EditableTextDataSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EditableTextDataSchema.cs @@ -14,11 +14,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((EditableTextData)instanceObj).Value; + private static object GetValue(object instanceObj) => ((EditableTextData)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((EditableTextData)instanceObj).Value = (string)valueObj; - private static object GetMaxLength(object instanceObj) => (object)((EditableTextData)instanceObj).MaxLength; + private static object GetMaxLength(object instanceObj) => ((EditableTextData)instanceObj).MaxLength; private static void SetMaxLength(ref object instanceObj, object valueObj) { @@ -35,32 +35,32 @@ namespace Microsoft.Iris.Markup.UIX private static void SetReadOnly(ref object instanceObj, object valueObj) => ((EditableTextData)instanceObj).ReadOnly = (bool)valueObj; - private static object Construct() => (object)new EditableTextData(); + private static object Construct() => new EditableTextData(); private static object CallSubmit(object instanceObj, object[] parameters) { ((EditableTextData)instanceObj).Submit(); - return (object)null; + return null; } - public static void Pass1Initialize() => EditableTextDataSchema.Type = new UIXTypeSchema((short)68, "EditableTextData", (string)null, (short)153, typeof(EditableTextData), UIXTypeFlags.None); + public static void Pass1Initialize() => EditableTextDataSchema.Type = new UIXTypeSchema(68, "EditableTextData", null, 153, typeof(EditableTextData), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)68, "Value", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(EditableTextDataSchema.GetValue), new SetValueHandler(EditableTextDataSchema.SetValue), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)68, "MaxLength", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(EditableTextDataSchema.GetMaxLength), new SetValueHandler(EditableTextDataSchema.SetMaxLength), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)68, "ReadOnly", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(EditableTextDataSchema.GetReadOnly), new SetValueHandler(EditableTextDataSchema.SetReadOnly), false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)68, "Submitted"); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)68, "Submit", (short[])null, (short)240, new InvokeHandler(EditableTextDataSchema.CallSubmit), false); - EditableTextDataSchema.Type.Initialize(new DefaultConstructHandler(EditableTextDataSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(68, "Value", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(EditableTextDataSchema.GetValue), new SetValueHandler(EditableTextDataSchema.SetValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(68, "MaxLength", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(EditableTextDataSchema.GetMaxLength), new SetValueHandler(EditableTextDataSchema.SetMaxLength), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(68, "ReadOnly", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(EditableTextDataSchema.GetReadOnly), new SetValueHandler(EditableTextDataSchema.SetReadOnly), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(68, "Submitted"); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(68, "Submit", null, 240, new InvokeHandler(EditableTextDataSchema.CallSubmit), false); + EditableTextDataSchema.Type.Initialize(new DefaultConstructHandler(EditableTextDataSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1 + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, new EventSchema[1] { (EventSchema)uixEventSchema }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, new EventSchema[1] { uixEventSchema }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectAnimationSchema.cs index 6370641..2fc78a1 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectAnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectAnimationSchema.cs @@ -12,19 +12,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetLoop(object instanceObj) => (object)((AnimationTemplate)instanceObj).Loop; + private static object GetLoop(object instanceObj) => ((AnimationTemplate)instanceObj).Loop; private static void SetLoop(ref object instanceObj, object valueObj) => ((AnimationTemplate)instanceObj).Loop = (int)valueObj; - public static void Pass1Initialize() => EffectAnimationSchema.Type = new UIXTypeSchema((short)70, "EffectAnimation", (string)null, (short)153, typeof(EffectAnimation), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectAnimationSchema.Type = new UIXTypeSchema(70, "EffectAnimation", null, 153, typeof(EffectAnimation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)70, "Loop", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectAnimationSchema.GetLoop), new SetValueHandler(EffectAnimationSchema.SetLoop), false); - EffectAnimationSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(70, "Loop", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectAnimationSchema.GetLoop), new SetValueHandler(EffectAnimationSchema.SetLoop), false); + EffectAnimationSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectColorAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectColorAnimationSchema.cs index 73613bf..e59379f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectColorAnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectColorAnimationSchema.cs @@ -12,19 +12,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetKeyframes(object instanceObj) => (object)((AnimationTemplate)instanceObj).Keyframes; + private static object GetKeyframes(object instanceObj) => ((AnimationTemplate)instanceObj).Keyframes; - private static object Construct() => (object)new EffectAnimation(); + private static object Construct() => new EffectAnimation(); - public static void Pass1Initialize() => EffectColorAnimationSchema.Type = new UIXTypeSchema((short)71, "EffectColorAnimation", (string)null, (short)70, typeof(EffectAnimation), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectColorAnimationSchema.Type = new UIXTypeSchema(71, "EffectColorAnimation", null, 70, typeof(EffectAnimation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)71, "Keyframes", (short)138, (short)72, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectColorAnimationSchema.GetKeyframes), (SetValueHandler)null, false); - EffectColorAnimationSchema.Type.Initialize(new DefaultConstructHandler(EffectColorAnimationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(71, "Keyframes", 138, 72, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectColorAnimationSchema.GetKeyframes), null, false); + EffectColorAnimationSchema.Type.Initialize(new DefaultConstructHandler(EffectColorAnimationSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectColorKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectColorKeyframeSchema.cs index ed37631..db6d035 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectColorKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectColorKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((EffectColorKeyframe)instanceObj).Color; + private static object GetValue(object instanceObj) => ((EffectColorKeyframe)instanceObj).Color; private static void SetValue(ref object instanceObj, object valueObj) => ((EffectColorKeyframe)instanceObj).Color = (Color)valueObj; - private static object Construct() => (object)new EffectColorKeyframe(); + private static object Construct() => new EffectColorKeyframe(); - public static void Pass1Initialize() => EffectColorKeyframeSchema.Type = new UIXTypeSchema((short)72, "EffectColorKeyframe", (string)null, (short)130, typeof(EffectColorKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectColorKeyframeSchema.Type = new UIXTypeSchema(72, "EffectColorKeyframe", null, 130, typeof(EffectColorKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)72, "Value", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectColorKeyframeSchema.GetValue), new SetValueHandler(EffectColorKeyframeSchema.SetValue), false); - EffectColorKeyframeSchema.Type.Initialize(new DefaultConstructHandler(EffectColorKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(72, "Value", 35, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectColorKeyframeSchema.GetValue), new SetValueHandler(EffectColorKeyframeSchema.SetValue), false); + EffectColorKeyframeSchema.Type.Initialize(new DefaultConstructHandler(EffectColorKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectElementInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectElementInstanceSchema.cs index 7f35cbd..d97f59c 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectElementInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectElementInstanceSchema.cs @@ -12,8 +12,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => EffectElementInstanceSchema.Type = new UIXTypeSchema((short)74, "EffectElementInstance", (string)null, (short)-1, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectElementInstanceSchema.Type = new UIXTypeSchema(74, "EffectElementInstance", null, -1, typeof(EffectElementWrapper), UIXTypeFlags.None); - public static void Pass2Initialize() => EffectElementInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => EffectElementInstanceSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectElementSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectElementSchema.cs index ac50223..496085e 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectElementSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectElementSchema.cs @@ -12,19 +12,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetName(object instanceObj) => (object)((EffectElement)instanceObj).Name; + private static object GetName(object instanceObj) => ((EffectElement)instanceObj).Name; private static void SetName(ref object instanceObj, object valueObj) => ((EffectElement)instanceObj).Name = (string)valueObj; - public static void Pass1Initialize() => EffectElementSchema.Type = new UIXTypeSchema((short)73, "EffectElement", (string)null, (short)-1, typeof(EffectElement), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectElementSchema.Type = new UIXTypeSchema(73, "EffectElement", null, -1, typeof(EffectElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)73, "Name", (short)208, (short)-1, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, false, new GetValueHandler(EffectElementSchema.GetName), new SetValueHandler(EffectElementSchema.SetName), false); - EffectElementSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(73, "Name", 208, -1, ExpressionRestriction.ReadOnly, false, null, false, new GetValueHandler(EffectElementSchema.GetName), new SetValueHandler(EffectElementSchema.SetName), false); + EffectElementSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectFloatAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectFloatAnimationSchema.cs index d98a39a..aa5d7cb 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectFloatAnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectFloatAnimationSchema.cs @@ -12,19 +12,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetKeyframes(object instanceObj) => (object)((AnimationTemplate)instanceObj).Keyframes; + private static object GetKeyframes(object instanceObj) => ((AnimationTemplate)instanceObj).Keyframes; - private static object Construct() => (object)new EffectAnimation(); + private static object Construct() => new EffectAnimation(); - public static void Pass1Initialize() => EffectFloatAnimationSchema.Type = new UIXTypeSchema((short)75, "EffectFloatAnimation", (string)null, (short)70, typeof(EffectAnimation), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectFloatAnimationSchema.Type = new UIXTypeSchema(75, "EffectFloatAnimation", null, 70, typeof(EffectAnimation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)75, "Keyframes", (short)138, (short)76, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectFloatAnimationSchema.GetKeyframes), (SetValueHandler)null, false); - EffectFloatAnimationSchema.Type.Initialize(new DefaultConstructHandler(EffectFloatAnimationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(75, "Keyframes", 138, 76, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectFloatAnimationSchema.GetKeyframes), null, false); + EffectFloatAnimationSchema.Type.Initialize(new DefaultConstructHandler(EffectFloatAnimationSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectFloatKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectFloatKeyframeSchema.cs index b2724c0..1ce0b4a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectFloatKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectFloatKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new EffectFloatKeyframe(); + private static object Construct() => new EffectFloatKeyframe(); - public static void Pass1Initialize() => EffectFloatKeyframeSchema.Type = new UIXTypeSchema((short)76, "EffectFloatKeyframe", (string)null, (short)130, typeof(EffectFloatKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectFloatKeyframeSchema.Type = new UIXTypeSchema(76, "EffectFloatKeyframe", null, 130, typeof(EffectFloatKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)76, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectFloatKeyframeSchema.GetValue), new SetValueHandler(EffectFloatKeyframeSchema.SetValue), false); - EffectFloatKeyframeSchema.Type.Initialize(new DefaultConstructHandler(EffectFloatKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(76, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectFloatKeyframeSchema.GetValue), new SetValueHandler(EffectFloatKeyframeSchema.SetValue), false); + EffectFloatKeyframeSchema.Type.Initialize(new DefaultConstructHandler(EffectFloatKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectInputSchema.cs index a18ee56..dd10796 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectInputSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectInputSchema.cs @@ -12,8 +12,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => EffectInputSchema.Type = new UIXTypeSchema((short)77, "EffectInput", (string)null, (short)73, typeof(EffectInput), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectInputSchema.Type = new UIXTypeSchema(77, "EffectInput", null, 73, typeof(EffectInput), UIXTypeFlags.None); - public static void Pass2Initialize() => EffectInputSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => EffectInputSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectInstanceSchema.cs index 2d08764..0f9dd66 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectInstanceSchema.cs @@ -12,8 +12,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => EffectInstanceSchema.Type = new UIXTypeSchema((short)78, "EffectInstance", (string)null, (short)153, typeof(EffectClass), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => EffectInstanceSchema.Type = new UIXTypeSchema(78, "EffectInstance", null, 153, typeof(EffectClass), UIXTypeFlags.Disposable); - public static void Pass2Initialize() => EffectInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => EffectInstanceSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectLayerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectLayerSchema.cs index e443073..4c33646 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectLayerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectLayerSchema.cs @@ -13,27 +13,27 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetInput(object instanceObj) => (object)((EffectLayer)instanceObj).Input; + private static object GetInput(object instanceObj) => ((EffectLayer)instanceObj).Input; private static void SetInput(ref object instanceObj, object valueObj) => ((EffectLayer)instanceObj).Input = (EffectInput)valueObj; - private static object GetOperations(object instanceObj) => (object)((EffectLayer)instanceObj).Operations; + private static object GetOperations(object instanceObj) => ((EffectLayer)instanceObj).Operations; private static void SetOperations(ref object instanceObj, object valueObj) => ((EffectLayer)instanceObj).Operations = (IList)valueObj; - private static object Construct() => (object)new EffectLayer(); + private static object Construct() => new EffectLayer(); - public static void Pass1Initialize() => EffectLayerSchema.Type = new UIXTypeSchema((short)79, "EffectLayer", (string)null, (short)77, typeof(EffectLayer), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectLayerSchema.Type = new UIXTypeSchema(79, "EffectLayer", null, 77, typeof(EffectLayer), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)79, "Input", (short)77, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectLayerSchema.GetInput), new SetValueHandler(EffectLayerSchema.SetInput), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)79, "Operations", (short)138, (short)80, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectLayerSchema.GetOperations), new SetValueHandler(EffectLayerSchema.SetOperations), false); - EffectLayerSchema.Type.Initialize(new DefaultConstructHandler(EffectLayerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(79, "Input", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectLayerSchema.GetInput), new SetValueHandler(EffectLayerSchema.SetInput), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(79, "Operations", 138, 80, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectLayerSchema.GetOperations), new SetValueHandler(EffectLayerSchema.SetOperations), false); + EffectLayerSchema.Type.Initialize(new DefaultConstructHandler(EffectLayerSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectOperationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectOperationSchema.cs index 6dab896..f4c4843 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectOperationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectOperationSchema.cs @@ -12,8 +12,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => EffectOperationSchema.Type = new UIXTypeSchema((short)80, "EffectOperation", (string)null, (short)73, typeof(EffectOperation), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectOperationSchema.Type = new UIXTypeSchema(80, "EffectOperation", null, 73, typeof(EffectOperation), UIXTypeFlags.None); - public static void Pass2Initialize() => EffectOperationSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => EffectOperationSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectSchema.cs index 3a798b6..8c0a9ff 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectSchema.cs @@ -14,15 +14,15 @@ namespace Microsoft.Iris.Markup.UIX private static object GetTechniques(object instanceObj) => (object)null; - public static void Pass1Initialize() => EffectSchema.Type = new UIXTypeSchema((short)69, "Effect", (string)null, (short)29, typeof(EffectClass), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => EffectSchema.Type = new UIXTypeSchema(69, "Effect", null, 29, typeof(EffectClass), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)69, "Techniques", (short)138, (short)77, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(EffectSchema.GetTechniques), (SetValueHandler)null, false); - EffectSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(69, "Techniques", 138, 77, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(EffectSchema.GetTechniques), null, false); + EffectSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectVector3AnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectVector3AnimationSchema.cs index ffbf6c0..9734c90 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectVector3AnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectVector3AnimationSchema.cs @@ -12,19 +12,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetKeyframes(object instanceObj) => (object)((AnimationTemplate)instanceObj).Keyframes; + private static object GetKeyframes(object instanceObj) => ((AnimationTemplate)instanceObj).Keyframes; - private static object Construct() => (object)new EffectAnimation(); + private static object Construct() => new EffectAnimation(); - public static void Pass1Initialize() => EffectVector3AnimationSchema.Type = new UIXTypeSchema((short)81, "EffectVector3Animation", (string)null, (short)70, typeof(EffectAnimation), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectVector3AnimationSchema.Type = new UIXTypeSchema(81, "EffectVector3Animation", null, 70, typeof(EffectAnimation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)81, "Keyframes", (short)138, (short)82, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectVector3AnimationSchema.GetKeyframes), (SetValueHandler)null, false); - EffectVector3AnimationSchema.Type.Initialize(new DefaultConstructHandler(EffectVector3AnimationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(81, "Keyframes", 138, 82, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectVector3AnimationSchema.GetKeyframes), null, false); + EffectVector3AnimationSchema.Type.Initialize(new DefaultConstructHandler(EffectVector3AnimationSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EffectVector3KeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EffectVector3KeyframeSchema.cs index 2a01eb5..d68344f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EffectVector3KeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectVector3KeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseVector3Keyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseVector3Keyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseVector3Keyframe)instanceObj).Value = (Vector3)valueObj; - private static object Construct() => (object)new EffectVector3Keyframe(); + private static object Construct() => new EffectVector3Keyframe(); - public static void Pass1Initialize() => EffectVector3KeyframeSchema.Type = new UIXTypeSchema((short)82, "EffectVector3Keyframe", (string)null, (short)130, typeof(EffectVector3Keyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => EffectVector3KeyframeSchema.Type = new UIXTypeSchema(82, "EffectVector3Keyframe", null, 130, typeof(EffectVector3Keyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)82, "Value", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EffectVector3KeyframeSchema.GetValue), new SetValueHandler(EffectVector3KeyframeSchema.SetValue), false); - EffectVector3KeyframeSchema.Type.Initialize(new DefaultConstructHandler(EffectVector3KeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(82, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EffectVector3KeyframeSchema.GetValue), new SetValueHandler(EffectVector3KeyframeSchema.SetValue), false); + EffectVector3KeyframeSchema.Type.Initialize(new DefaultConstructHandler(EffectVector3KeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EmbossInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EmbossInstanceSchema.cs index 69ddca8..36eaf12 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EmbossInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EmbossInstanceSchema.cs @@ -14,15 +14,15 @@ namespace Microsoft.Iris.Markup.UIX private static void SetDirection(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Direction", (int)valueObj); - public static void Pass1Initialize() => EmbossInstanceSchema.Type = new UIXTypeSchema((short)85, "EmbossInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => EmbossInstanceSchema.Type = new UIXTypeSchema(85, "EmbossInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)85, "Direction", (short)84, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(EmbossInstanceSchema.SetDirection), false); - EmbossInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(85, "Direction", 84, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(EmbossInstanceSchema.SetDirection), false); + EmbossInstanceSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EmbossSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EmbossSchema.cs index 243674d..ab9af92 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EmbossSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EmbossSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetDirection(object instanceObj) => (object)((EmbossElement)instanceObj).Direction; + private static object GetDirection(object instanceObj) => ((EmbossElement)instanceObj).Direction; private static void SetDirection(ref object instanceObj, object valueObj) => ((EmbossElement)instanceObj).Direction = (EmbossDirection)valueObj; - private static object Construct() => (object)new EmbossElement(); + private static object Construct() => new EmbossElement(); - public static void Pass1Initialize() => EmbossSchema.Type = new UIXTypeSchema((short)83, "Emboss", (string)null, (short)80, typeof(EmbossElement), UIXTypeFlags.None); + public static void Pass1Initialize() => EmbossSchema.Type = new UIXTypeSchema(83, "Emboss", null, 80, typeof(EmbossElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)83, "Direction", (short)84, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EmbossSchema.GetDirection), new SetValueHandler(EmbossSchema.SetDirection), false); - EmbossSchema.Type.Initialize(new DefaultConstructHandler(EmbossSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(83, "Direction", 84, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EmbossSchema.GetDirection), new SetValueHandler(EmbossSchema.SetDirection), false); + EmbossSchema.Type.Initialize(new DefaultConstructHandler(EmbossSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EnumeratorSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EnumeratorSchema.cs index 7eccc47..b482591 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EnumeratorSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EnumeratorSchema.cs @@ -19,24 +19,24 @@ namespace Microsoft.Iris.Markup.UIX private static object CallReset(object instanceObj, object[] parameters) { ((IEnumerator)instanceObj).Reset(); - return (object)null; + return null; } - public static void Pass1Initialize() => EnumeratorSchema.Type = new UIXTypeSchema((short)86, "Enumerator", (string)null, (short)153, typeof(IEnumerator), UIXTypeFlags.None); + public static void Pass1Initialize() => EnumeratorSchema.Type = new UIXTypeSchema(86, "Enumerator", null, 153, typeof(IEnumerator), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)86, "Current", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(EnumeratorSchema.GetCurrent), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)86, "MoveNext", (short[])null, (short)15, new InvokeHandler(EnumeratorSchema.CallMoveNext), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)86, "Reset", (short[])null, (short)240, new InvokeHandler(EnumeratorSchema.CallReset), false); - EnumeratorSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(86, "Current", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(EnumeratorSchema.GetCurrent), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(86, "MoveNext", null, 15, new InvokeHandler(EnumeratorSchema.CallMoveNext), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(86, "Reset", null, 240, new InvokeHandler(EnumeratorSchema.CallReset), false); + EnumeratorSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EnvironmentSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EnvironmentSchema.cs index dee9918..7d5a244 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EnvironmentSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EnvironmentSchema.cs @@ -16,17 +16,17 @@ namespace Microsoft.Iris.Markup.UIX private static object GetIsRightToLeft(object instanceObj) => BooleanBoxes.Box(((Environment)instanceObj).IsRightToLeft); - private static object GetColorScheme(object instanceObj) => (object)((Environment)instanceObj).ColorScheme; + private static object GetColorScheme(object instanceObj) => ((Environment)instanceObj).ColorScheme; - private static object GetAnimationSpeed(object instanceObj) => (object)((Environment)instanceObj).AnimationSpeed; + private static object GetAnimationSpeed(object instanceObj) => ((Environment)instanceObj).AnimationSpeed; private static void SetAnimationSpeed(ref object instanceObj, object valueObj) => ((Environment)instanceObj).AnimationSpeed = (float)valueObj; - private static object GetAnimationUpdatesPerSecond(object instanceObj) => (object)((Environment)instanceObj).AnimationUpdatesPerSecond; + private static object GetAnimationUpdatesPerSecond(object instanceObj) => ((Environment)instanceObj).AnimationUpdatesPerSecond; private static void SetAnimationUpdatesPerSecond(ref object instanceObj, object valueObj) => ((Environment)instanceObj).AnimationUpdatesPerSecond = (int)valueObj; - private static object GetDpiScale(object instanceObj) => (object)Environment.DpiScale; + private static object GetDpiScale(object instanceObj) => Environment.DpiScale; private static object GetGraphicsDeviceType(object instanceObj) { @@ -44,43 +44,43 @@ namespace Microsoft.Iris.Markup.UIX renderingType = RenderingType.Default; break; } - return (object)renderingType; + return renderingType; } - private static object Construct() => (object)Environment.Instance; + private static object Construct() => Environment.Instance; private static object CallAnimationAdvanceInt32(object instanceObj, object[] parameters) { ((Environment)instanceObj).AnimationAdvance((int)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => EnvironmentSchema.Type = new UIXTypeSchema((short)87, "Environment", (string)null, (short)153, typeof(Environment), UIXTypeFlags.None); + public static void Pass1Initialize() => EnvironmentSchema.Type = new UIXTypeSchema(87, "Environment", null, 153, typeof(Environment), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)87, "IsRightToLeft", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(EnvironmentSchema.GetIsRightToLeft), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)87, "ColorScheme", (short)39, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(EnvironmentSchema.GetColorScheme), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)87, "AnimationSpeed", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EnvironmentSchema.GetAnimationSpeed), new SetValueHandler(EnvironmentSchema.SetAnimationSpeed), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)87, "AnimationUpdatesPerSecond", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EnvironmentSchema.GetAnimationUpdatesPerSecond), new SetValueHandler(EnvironmentSchema.SetAnimationUpdatesPerSecond), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)87, "DpiScale", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EnvironmentSchema.GetDpiScale), (SetValueHandler)null, true); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)87, "GraphicsDeviceType", (short)98, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(EnvironmentSchema.GetGraphicsDeviceType), (SetValueHandler)null, true); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)87, "AnimationAdvance", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(87, "IsRightToLeft", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(EnvironmentSchema.GetIsRightToLeft), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(87, "ColorScheme", 39, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(EnvironmentSchema.GetColorScheme), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(87, "AnimationSpeed", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EnvironmentSchema.GetAnimationSpeed), new SetValueHandler(EnvironmentSchema.SetAnimationSpeed), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(87, "AnimationUpdatesPerSecond", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EnvironmentSchema.GetAnimationUpdatesPerSecond), new SetValueHandler(EnvironmentSchema.SetAnimationUpdatesPerSecond), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(87, "DpiScale", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EnvironmentSchema.GetDpiScale), null, true); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(87, "GraphicsDeviceType", 98, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(EnvironmentSchema.GetGraphicsDeviceType), null, true); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(87, "AnimationAdvance", new short[1] { - (short) 115 - }, (short)240, new InvokeHandler(EnvironmentSchema.CallAnimationAdvanceInt32), false); - EnvironmentSchema.Type.Initialize(new DefaultConstructHandler(EnvironmentSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + 115 + }, 240, new InvokeHandler(EnvironmentSchema.CallAnimationAdvanceInt32), false); + EnvironmentSchema.Type.Initialize(new DefaultConstructHandler(EnvironmentSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema1 + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema2, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema1 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/EventContextSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/EventContextSchema.cs index 0493575..83cdf8a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/EventContextSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/EventContextSchema.cs @@ -16,17 +16,17 @@ namespace Microsoft.Iris.Markup.UIX private static void SetValue(ref object instanceObj, object valueObj) => ((EventContext)instanceObj).Value = valueObj; - private static object Construct() => (object)new EventContext(); + private static object Construct() => new EventContext(); - public static void Pass1Initialize() => EventContextSchema.Type = new UIXTypeSchema((short)88, "EventContext", (string)null, (short)110, typeof(EventContext), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => EventContextSchema.Type = new UIXTypeSchema(88, "EventContext", null, 110, typeof(EventContext), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)88, "Value", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(EventContextSchema.GetValue), new SetValueHandler(EventContextSchema.SetValue), false); - EventContextSchema.Type.Initialize(new DefaultConstructHandler(EventContextSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(88, "Value", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(EventContextSchema.GetValue), new SetValueHandler(EventContextSchema.SetValue), false); + EventContextSchema.Type.Initialize(new DefaultConstructHandler(EventContextSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/FlowLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/FlowLayoutSchema.cs index 9a0a820..3b08ade 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/FlowLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/FlowLayoutSchema.cs @@ -14,11 +14,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetOrientation(object instanceObj) => (object)((FlowLayout)instanceObj).Orientation; + private static object GetOrientation(object instanceObj) => ((FlowLayout)instanceObj).Orientation; private static void SetOrientation(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).Orientation = (Orientation)valueObj; - private static object GetSpacing(object instanceObj) => (object)((FlowLayout)instanceObj).Spacing; + private static object GetSpacing(object instanceObj) => ((FlowLayout)instanceObj).Spacing; private static void SetSpacing(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).Spacing = (MajorMinor)valueObj; @@ -26,57 +26,57 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAllowWrap(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).AllowWrap = (bool)valueObj; - private static object GetStripAlignment(object instanceObj) => (object)((FlowLayout)instanceObj).StripAlignment; + private static object GetStripAlignment(object instanceObj) => ((FlowLayout)instanceObj).StripAlignment; private static void SetStripAlignment(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).StripAlignment = (StripAlignment)valueObj; - private static object GetRepeat(object instanceObj) => (object)((FlowLayout)instanceObj).Repeat; + private static object GetRepeat(object instanceObj) => ((FlowLayout)instanceObj).Repeat; private static void SetRepeat(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).Repeat = (RepeatPolicy)valueObj; - private static object GetRepeatGap(object instanceObj) => (object)((FlowLayout)instanceObj).RepeatGap; + private static object GetRepeatGap(object instanceObj) => ((FlowLayout)instanceObj).RepeatGap; private static void SetRepeatGap(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).RepeatGap = (MajorMinor)valueObj; - private static object GetMissingItemPolicy(object instanceObj) => (object)((FlowLayout)instanceObj).MissingItemPolicy; + private static object GetMissingItemPolicy(object instanceObj) => ((FlowLayout)instanceObj).MissingItemPolicy; private static void SetMissingItemPolicy(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).MissingItemPolicy = (MissingItemPolicy)valueObj; - private static object GetMinimumSampleSize(object instanceObj) => (object)((FlowLayout)instanceObj).MinimumSampleSize; + private static object GetMinimumSampleSize(object instanceObj) => ((FlowLayout)instanceObj).MinimumSampleSize; private static void SetMinimumSampleSize(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).MinimumSampleSize = (int)valueObj; - private static object GetDefaultChildAlignment(object instanceObj) => (object)((FlowLayout)instanceObj).DefaultChildAlignment; + private static object GetDefaultChildAlignment(object instanceObj) => ((FlowLayout)instanceObj).DefaultChildAlignment; private static void SetDefaultChildAlignment(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).DefaultChildAlignment = (ItemAlignment)valueObj; - private static object Construct() => (object)new FlowLayout(); + private static object Construct() => new FlowLayout(); - public static void Pass1Initialize() => FlowLayoutSchema.Type = new UIXTypeSchema((short)90, "FlowLayout", (string)null, (short)132, typeof(FlowLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => FlowLayoutSchema.Type = new UIXTypeSchema(90, "FlowLayout", null, 132, typeof(FlowLayout), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)90, "Orientation", (short)154, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetOrientation), new SetValueHandler(FlowLayoutSchema.SetOrientation), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)90, "Spacing", (short)139, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetSpacing), new SetValueHandler(FlowLayoutSchema.SetSpacing), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)90, "AllowWrap", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetAllowWrap), new SetValueHandler(FlowLayoutSchema.SetAllowWrap), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)90, "StripAlignment", (short)209, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetStripAlignment), new SetValueHandler(FlowLayoutSchema.SetStripAlignment), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)90, "Repeat", (short)172, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetRepeat), new SetValueHandler(FlowLayoutSchema.SetRepeat), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)90, "RepeatGap", (short)139, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetRepeatGap), new SetValueHandler(FlowLayoutSchema.SetRepeatGap), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)90, "MissingItemPolicy", (short)148, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetMissingItemPolicy), new SetValueHandler(FlowLayoutSchema.SetMissingItemPolicy), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)90, "MinimumSampleSize", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetMinimumSampleSize), new SetValueHandler(FlowLayoutSchema.SetMinimumSampleSize), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)90, "DefaultChildAlignment", (short)sbyte.MaxValue, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FlowLayoutSchema.GetDefaultChildAlignment), new SetValueHandler(FlowLayoutSchema.SetDefaultChildAlignment), false); - FlowLayoutSchema.Type.Initialize(new DefaultConstructHandler(FlowLayoutSchema.Construct), (ConstructorSchema[])null, new PropertySchema[9] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(90, "Orientation", 154, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetOrientation), new SetValueHandler(FlowLayoutSchema.SetOrientation), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(90, "Spacing", 139, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetSpacing), new SetValueHandler(FlowLayoutSchema.SetSpacing), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(90, "AllowWrap", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetAllowWrap), new SetValueHandler(FlowLayoutSchema.SetAllowWrap), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(90, "StripAlignment", 209, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetStripAlignment), new SetValueHandler(FlowLayoutSchema.SetStripAlignment), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(90, "Repeat", 172, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetRepeat), new SetValueHandler(FlowLayoutSchema.SetRepeat), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(90, "RepeatGap", 139, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetRepeatGap), new SetValueHandler(FlowLayoutSchema.SetRepeatGap), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(90, "MissingItemPolicy", 148, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetMissingItemPolicy), new SetValueHandler(FlowLayoutSchema.SetMissingItemPolicy), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(90, "MinimumSampleSize", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetMinimumSampleSize), new SetValueHandler(FlowLayoutSchema.SetMinimumSampleSize), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(90, "DefaultChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FlowLayoutSchema.GetDefaultChildAlignment), new SetValueHandler(FlowLayoutSchema.SetDefaultChildAlignment), false); + FlowLayoutSchema.Type.Initialize(new DefaultConstructHandler(FlowLayoutSchema.Construct), null, new PropertySchema[9] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema9, + uixPropertySchema8, + uixPropertySchema7, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema2, + uixPropertySchema4 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/FocusHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/FocusHandlerSchema.cs index d3567a7..5e46269 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/FocusHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/FocusHandlerSchema.cs @@ -13,19 +13,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetReason(object instanceObj) => (object)((FocusHandler)instanceObj).Reason; + private static object GetReason(object instanceObj) => ((FocusHandler)instanceObj).Reason; private static void SetReason(ref object instanceObj, object valueObj) => ((FocusHandler)instanceObj).Reason = (FocusChangeReason)valueObj; - private static object GetRequiredModifiers(object instanceObj) => (object)((ModifierInputHandler)instanceObj).RequiredModifiers; + private static object GetRequiredModifiers(object instanceObj) => ((ModifierInputHandler)instanceObj).RequiredModifiers; private static void SetRequiredModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).RequiredModifiers = (InputHandlerModifiers)valueObj; - private static object GetDisallowedModifiers(object instanceObj) => (object)((ModifierInputHandler)instanceObj).DisallowedModifiers; + private static object GetDisallowedModifiers(object instanceObj) => ((ModifierInputHandler)instanceObj).DisallowedModifiers; private static void SetDisallowedModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).DisallowedModifiers = (InputHandlerModifiers)valueObj; - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; @@ -33,33 +33,33 @@ namespace Microsoft.Iris.Markup.UIX private static object GetLostEventContext(object instanceObj) => ((FocusHandler)instanceObj).LostEventContext; - private static object Construct() => (object)new FocusHandler(); + private static object Construct() => new FocusHandler(); - public static void Pass1Initialize() => FocusHandlerSchema.Type = new UIXTypeSchema((short)92, "FocusHandler", (string)null, (short)110, typeof(FocusHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => FocusHandlerSchema.Type = new UIXTypeSchema(92, "FocusHandler", null, 110, typeof(FocusHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)92, "Reason", (short)91, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(FocusHandlerSchema.GetReason), new SetValueHandler(FocusHandlerSchema.SetReason), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)92, "RequiredModifiers", (short)111, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(FocusHandlerSchema.GetRequiredModifiers), new SetValueHandler(FocusHandlerSchema.SetRequiredModifiers), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)92, "DisallowedModifiers", (short)111, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(FocusHandlerSchema.GetDisallowedModifiers), new SetValueHandler(FocusHandlerSchema.SetDisallowedModifiers), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)92, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(FocusHandlerSchema.GetHandlerStage), new SetValueHandler(FocusHandlerSchema.SetHandlerStage), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)92, "GainedEventContext", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(FocusHandlerSchema.GetGainedEventContext), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)92, "LostEventContext", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(FocusHandlerSchema.GetLostEventContext), (SetValueHandler)null, false); - UIXEventSchema uixEventSchema1 = new UIXEventSchema((short)92, "GainedFocus"); - UIXEventSchema uixEventSchema2 = new UIXEventSchema((short)92, "LostFocus"); - FocusHandlerSchema.Type.Initialize(new DefaultConstructHandler(FocusHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(92, "Reason", 91, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(FocusHandlerSchema.GetReason), new SetValueHandler(FocusHandlerSchema.SetReason), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(92, "RequiredModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(FocusHandlerSchema.GetRequiredModifiers), new SetValueHandler(FocusHandlerSchema.SetRequiredModifiers), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(92, "DisallowedModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(FocusHandlerSchema.GetDisallowedModifiers), new SetValueHandler(FocusHandlerSchema.SetDisallowedModifiers), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(92, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(FocusHandlerSchema.GetHandlerStage), new SetValueHandler(FocusHandlerSchema.SetHandlerStage), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(92, "GainedEventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(FocusHandlerSchema.GetGainedEventContext), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(92, "LostEventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(FocusHandlerSchema.GetLostEventContext), null, false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(92, "GainedFocus"); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(92, "LostFocus"); + FocusHandlerSchema.Type.Initialize(new DefaultConstructHandler(FocusHandlerSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, new EventSchema[2] + uixPropertySchema3, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema1, + uixPropertySchema2 + }, null, new EventSchema[2] { - (EventSchema) uixEventSchema1, - (EventSchema) uixEventSchema2 - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema1, + uixEventSchema2 + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/FontSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/FontSchema.cs index 1c6b92b..5ecad17 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/FontSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/FontSchema.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Markup.UIX public static RangeValidator ValidateFontName = new RangeValidator(FontSchema.RangeValidateFontName); public static UIXTypeSchema Type; - private static object GetFontName(object instanceObj) => (object)((Font)instanceObj).FontName; + private static object GetFontName(object instanceObj) => ((Font)instanceObj).FontName; private static void SetFontName(ref object instanceObj, object valueObj) { @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Markup.UIX font.FontName = str; } - private static object GetFontSize(object instanceObj) => (object)((Font)instanceObj).FontSize; + private static object GetFontSize(object instanceObj) => ((Font)instanceObj).FontSize; private static void SetFontSize(ref object instanceObj, object valueObj) { @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Markup.UIX font.FontSize = num; } - private static object GetAltFontSize(object instanceObj) => (object)((Font)instanceObj).AltFontSize; + private static object GetAltFontSize(object instanceObj) => ((Font)instanceObj).AltFontSize; private static void SetAltFontSize(ref object instanceObj, object valueObj) { @@ -56,11 +56,11 @@ namespace Microsoft.Iris.Markup.UIX font.AltFontSize = num; } - private static object GetFontStyle(object instanceObj) => (object)((Font)instanceObj).FontStyle; + private static object GetFontStyle(object instanceObj) => ((Font)instanceObj).FontStyle; private static void SetFontStyle(ref object instanceObj, object valueObj) => ((Font)instanceObj).FontStyle = (FontStyles)valueObj; - private static object Construct() => (object)new Font(); + private static object Construct() => new Font(); private static object ConstructFontName(object[] parameters) { @@ -73,9 +73,9 @@ namespace Microsoft.Iris.Markup.UIX { instance = FontSchema.Construct(); object valueObj; - Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, FontSchema.ValidateFontName, out valueObj); + Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, FontSchema.ValidateFontName, out valueObj); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result.Error); FontSchema.SetFontName(ref instance, valueObj); return result; } @@ -94,14 +94,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = FontSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, FontSchema.ValidateFontName, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, FontSchema.ValidateFontName, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result1.Error); FontSchema.SetFontName(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result2.Error); FontSchema.SetFontSize(ref instance, valueObj2); return result2; } @@ -121,19 +121,19 @@ namespace Microsoft.Iris.Markup.UIX { instance = FontSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, FontSchema.ValidateFontName, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, FontSchema.ValidateFontName, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result1.Error); FontSchema.SetFontName(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result2.Error); FontSchema.SetFontSize(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result3.Error); FontSchema.SetAltFontSize(ref instance, valueObj3); return result3; } @@ -153,19 +153,19 @@ namespace Microsoft.Iris.Markup.UIX { instance = FontSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, FontSchema.ValidateFontName, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, FontSchema.ValidateFontName, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result1.Error); FontSchema.SetFontName(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result2.Error); FontSchema.SetFontSize(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], UIXLoadResultExports.FontStylesType, (RangeValidator)null, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], UIXLoadResultExports.FontStylesType, null, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result3.Error); FontSchema.SetFontStyle(ref instance, valueObj3); return result3; } @@ -186,24 +186,24 @@ namespace Microsoft.Iris.Markup.UIX { instance = FontSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, FontSchema.ValidateFontName, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, FontSchema.ValidateFontName, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result1.Error); FontSchema.SetFontName(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result2.Error); FontSchema.SetFontSize(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result3.Error); FontSchema.SetAltFontSize(ref instance, valueObj3); object valueObj4; - Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], UIXLoadResultExports.FontStylesType, (RangeValidator)null, out valueObj4); + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], UIXLoadResultExports.FontStylesType, null, out valueObj4); if (result4.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Font", (object)result4.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Font", result4.Error); FontSchema.SetFontStyle(ref instance, valueObj4); return result4; } @@ -213,12 +213,12 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; string parameter2 = (string)parameters[1]; if (string.IsNullOrEmpty(parameter1)) - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"moduleName"); + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "moduleName"); if (string.IsNullOrEmpty(parameter2)) - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"resourceName"); + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "resourceName"); if (!NativeApi.SpLoadFontResource(parameter1, parameter2)) - ErrorManager.ReportError("Font Resource {1} not found in module {0}", (object)parameter1, (object)parameter2); - return (object)null; + ErrorManager.ReportError("Font Resource {1} not found in module {0}", parameter1, parameter2); + return null; } private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -229,7 +229,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result1 = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -259,7 +259,7 @@ namespace Microsoft.Iris.Markup.UIX return result1; break; default: - result1 = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Font"); + result1 = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Font"); break; } } @@ -270,68 +270,68 @@ namespace Microsoft.Iris.Markup.UIX { string str = (string)value; if (str == null) - return Result.Fail("Script runtime failure: Invalid 'null' value for '{0}'", (object)"FontName"); - return str.Length > 31 ? Result.Fail("\"{0}\" cannot be longer than {1} characters", (object)str, (object)"31") : Result.Success; + return Result.Fail("Script runtime failure: Invalid 'null' value for '{0}'", "FontName"); + return str.Length > 31 ? Result.Fail("\"{0}\" cannot be longer than {1} characters", str, "31") : Result.Success; } - public static void Pass1Initialize() => FontSchema.Type = new UIXTypeSchema((short)93, "Font", (string)null, (short)153, typeof(Font), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => FontSchema.Type = new UIXTypeSchema(93, "Font", null, 153, typeof(Font), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)93, "FontName", (short)208, (short)-1, ExpressionRestriction.None, false, FontSchema.ValidateFontName, false, new GetValueHandler(FontSchema.GetFontName), new SetValueHandler(FontSchema.SetFontName), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)93, "FontSize", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(FontSchema.GetFontSize), new SetValueHandler(FontSchema.SetFontSize), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)93, "AltFontSize", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(FontSchema.GetAltFontSize), new SetValueHandler(FontSchema.SetAltFontSize), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)93, "FontStyle", (short)94, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(FontSchema.GetFontStyle), new SetValueHandler(FontSchema.SetFontStyle), false); - UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema((short)93, new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(93, "FontName", 208, -1, ExpressionRestriction.None, false, FontSchema.ValidateFontName, false, new GetValueHandler(FontSchema.GetFontName), new SetValueHandler(FontSchema.SetFontName), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(93, "FontSize", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(FontSchema.GetFontSize), new SetValueHandler(FontSchema.SetFontSize), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(93, "AltFontSize", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(FontSchema.GetAltFontSize), new SetValueHandler(FontSchema.SetAltFontSize), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(93, "FontStyle", 94, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(FontSchema.GetFontStyle), new SetValueHandler(FontSchema.SetFontStyle), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(93, new short[1] { - (short) 208 + 208 }, new ConstructHandler(FontSchema.ConstructFontName)); - UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema((short)93, new short[2] + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(93, new short[2] { - (short) 208, - (short) 194 + 208, + 194 }, new ConstructHandler(FontSchema.ConstructFontNameFontSize)); - UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema((short)93, new short[3] + UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema(93, new short[3] { - (short) 208, - (short) 194, - (short) 194 + 208, + 194, + 194 }, new ConstructHandler(FontSchema.ConstructFontNameFontSizeAltFontSize)); - UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema((short)93, new short[3] + UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema(93, new short[3] { - (short) 208, - (short) 194, - (short) 94 + 208, + 194, + 94 }, new ConstructHandler(FontSchema.ConstructFontNameFontSizeFontStyle)); - UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema((short)93, new short[4] + UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema(93, new short[4] { - (short) 208, - (short) 194, - (short) 194, - (short) 94 + 208, + 194, + 194, + 94 }, new ConstructHandler(FontSchema.ConstructFontNameFontSizeAltFontSizeFontStyle)); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)93, "LoadFontResource", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(93, "LoadFontResource", new short[2] { - (short) 208, - (short) 208 - }, (short)240, new InvokeHandler(FontSchema.CallLoadFontResourceStringString), true); + 208, + 208 + }, 240, new InvokeHandler(FontSchema.CallLoadFontResourceStringString), true); FontSchema.Type.Initialize(new DefaultConstructHandler(FontSchema.Construct), new ConstructorSchema[5] { - (ConstructorSchema) constructorSchema1, - (ConstructorSchema) constructorSchema2, - (ConstructorSchema) constructorSchema3, - (ConstructorSchema) constructorSchema4, - (ConstructorSchema) constructorSchema5 + constructorSchema1, + constructorSchema2, + constructorSchema3, + constructorSchema4, + constructorSchema5 }, new PropertySchema[4] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4 + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema4 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(FontSchema.TryConvertFrom), new SupportsTypeConversionHandler(FontSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, new TypeConverterHandler(FontSchema.TryConvertFrom), new SupportsTypeConversionHandler(FontSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/FormLayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/FormLayoutInputSchema.cs index 7350f1a..df13b34 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/FormLayoutInputSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/FormLayoutInputSchema.cs @@ -12,10 +12,10 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)new FormLayoutInput(); + private static object Construct() => new FormLayoutInput(); - public static void Pass1Initialize() => FormLayoutInputSchema.Type = new UIXTypeSchema((short)95, "FormLayoutInput", (string)null, (short)8, typeof(FormLayoutInput), UIXTypeFlags.None); + public static void Pass1Initialize() => FormLayoutInputSchema.Type = new UIXTypeSchema(95, "FormLayoutInput", null, 8, typeof(FormLayoutInput), UIXTypeFlags.None); - public static void Pass2Initialize() => FormLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(FormLayoutInputSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => FormLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(FormLayoutInputSchema.Construct), null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/GraphicSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/GraphicSchema.cs index d545ba1..440ed9f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/GraphicSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/GraphicSchema.cs @@ -15,83 +15,83 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetChildren(object instanceObj) => (object)ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); + private static object GetChildren(object instanceObj) => ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); - private static object GetContent(object instanceObj) => (object)((Graphic)instanceObj).Content; + private static object GetContent(object instanceObj) => ((Graphic)instanceObj).Content; private static void SetContent(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).Content = (UIImage)valueObj; - private static object GetPreloadContent(object instanceObj) => (object)((Graphic)instanceObj).PreloadContent; + private static object GetPreloadContent(object instanceObj) => ((Graphic)instanceObj).PreloadContent; private static void SetPreloadContent(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).PreloadContent = (UIImage)valueObj; - private static object GetEffect(object instanceObj) => (object)((ViewItem)instanceObj).Effect; + private static object GetEffect(object instanceObj) => ((ViewItem)instanceObj).Effect; private static void SetEffect(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Effect = (EffectClass)valueObj; - private static object GetAcquiringImage(object instanceObj) => (object)((Graphic)instanceObj).AcquiringImage; + private static object GetAcquiringImage(object instanceObj) => ((Graphic)instanceObj).AcquiringImage; private static void SetAcquiringImage(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).AcquiringImage = (UIImage)valueObj; - private static object GetErrorImage(object instanceObj) => (object)((Graphic)instanceObj).ErrorImage; + private static object GetErrorImage(object instanceObj) => ((Graphic)instanceObj).ErrorImage; private static void SetErrorImage(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).ErrorImage = (UIImage)valueObj; - private static object GetSizingPolicy(object instanceObj) => (object)((Graphic)instanceObj).SizingPolicy; + private static object GetSizingPolicy(object instanceObj) => ((Graphic)instanceObj).SizingPolicy; private static void SetSizingPolicy(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).SizingPolicy = (SizingPolicy)valueObj; - private static object GetStretchingPolicy(object instanceObj) => (object)((Graphic)instanceObj).StretchingPolicy; + private static object GetStretchingPolicy(object instanceObj) => ((Graphic)instanceObj).StretchingPolicy; private static void SetStretchingPolicy(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).StretchingPolicy = (StretchingPolicy)valueObj; - private static object GetHorizontalAlignment(object instanceObj) => (object)((Graphic)instanceObj).HorizontalAlignment; + private static object GetHorizontalAlignment(object instanceObj) => ((Graphic)instanceObj).HorizontalAlignment; private static void SetHorizontalAlignment(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).HorizontalAlignment = (StripAlignment)valueObj; - private static object GetVerticalAlignment(object instanceObj) => (object)((Graphic)instanceObj).VerticalAlignment; + private static object GetVerticalAlignment(object instanceObj) => ((Graphic)instanceObj).VerticalAlignment; private static void SetVerticalAlignment(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).VerticalAlignment = (StripAlignment)valueObj; - private static object Construct() => (object)new Graphic(); + private static object Construct() => new Graphic(); private static object CallCommitPreload(object instanceObj, object[] parameters) { ((Graphic)instanceObj).CommitPreload(); - return (object)null; + return null; } - public static void Pass1Initialize() => GraphicSchema.Type = new UIXTypeSchema((short)97, "Graphic", (string)null, (short)239, typeof(Graphic), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => GraphicSchema.Type = new UIXTypeSchema(97, "Graphic", null, 239, typeof(Graphic), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)97, "Children", (short)138, (short)239, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetChildren), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)97, "Content", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetContent), new SetValueHandler(GraphicSchema.SetContent), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)97, "PreloadContent", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetPreloadContent), new SetValueHandler(GraphicSchema.SetPreloadContent), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)97, "Effect", (short)78, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetEffect), new SetValueHandler(GraphicSchema.SetEffect), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)97, "AcquiringImage", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetAcquiringImage), new SetValueHandler(GraphicSchema.SetAcquiringImage), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)97, "ErrorImage", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetErrorImage), new SetValueHandler(GraphicSchema.SetErrorImage), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)97, "SizingPolicy", (short)199, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetSizingPolicy), new SetValueHandler(GraphicSchema.SetSizingPolicy), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)97, "StretchingPolicy", (short)207, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetStretchingPolicy), new SetValueHandler(GraphicSchema.SetStretchingPolicy), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)97, "HorizontalAlignment", (short)209, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetHorizontalAlignment), new SetValueHandler(GraphicSchema.SetHorizontalAlignment), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)97, "VerticalAlignment", (short)209, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GraphicSchema.GetVerticalAlignment), new SetValueHandler(GraphicSchema.SetVerticalAlignment), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)97, "CommitPreload", (short[])null, (short)240, new InvokeHandler(GraphicSchema.CallCommitPreload), false); - GraphicSchema.Type.Initialize(new DefaultConstructHandler(GraphicSchema.Construct), (ConstructorSchema[])null, new PropertySchema[10] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(97, "Children", 138, 239, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GraphicSchema.GetChildren), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(97, "Content", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetContent), new SetValueHandler(GraphicSchema.SetContent), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(97, "PreloadContent", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetPreloadContent), new SetValueHandler(GraphicSchema.SetPreloadContent), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(97, "Effect", 78, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetEffect), new SetValueHandler(GraphicSchema.SetEffect), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(97, "AcquiringImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetAcquiringImage), new SetValueHandler(GraphicSchema.SetAcquiringImage), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(97, "ErrorImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetErrorImage), new SetValueHandler(GraphicSchema.SetErrorImage), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(97, "SizingPolicy", 199, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetSizingPolicy), new SetValueHandler(GraphicSchema.SetSizingPolicy), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(97, "StretchingPolicy", 207, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetStretchingPolicy), new SetValueHandler(GraphicSchema.SetStretchingPolicy), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(97, "HorizontalAlignment", 209, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetHorizontalAlignment), new SetValueHandler(GraphicSchema.SetHorizontalAlignment), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(97, "VerticalAlignment", 209, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GraphicSchema.GetVerticalAlignment), new SetValueHandler(GraphicSchema.SetVerticalAlignment), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(97, "CommitPreload", null, 240, new InvokeHandler(GraphicSchema.CallCommitPreload), false); + GraphicSchema.Type.Initialize(new DefaultConstructHandler(GraphicSchema.Construct), null, new PropertySchema[10] { - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema10 + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema9, + uixPropertySchema3, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema10 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/GridLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/GridLayoutSchema.cs index bccf657..20075b6 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/GridLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/GridLayoutSchema.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetOrientation(object instanceObj) => (object)((GridLayout)instanceObj).Orientation; + private static object GetOrientation(object instanceObj) => ((GridLayout)instanceObj).Orientation; private static void SetOrientation(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).Orientation = (Orientation)valueObj; @@ -24,15 +24,15 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAllowWrap(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).AllowWrap = (bool)valueObj; - private static object GetReferenceSize(object instanceObj) => (object)((GridLayout)instanceObj).ReferenceSize; + private static object GetReferenceSize(object instanceObj) => ((GridLayout)instanceObj).ReferenceSize; private static void SetReferenceSize(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).ReferenceSize = (Size)valueObj; - private static object GetSpacing(object instanceObj) => (object)((GridLayout)instanceObj).Spacing; + private static object GetSpacing(object instanceObj) => ((GridLayout)instanceObj).Spacing; private static void SetSpacing(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).Spacing = (Size)valueObj; - private static object GetRows(object instanceObj) => (object)((GridLayout)instanceObj).Rows; + private static object GetRows(object instanceObj) => ((GridLayout)instanceObj).Rows; private static void SetRows(ref object instanceObj, object valueObj) { @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Markup.UIX gridLayout.Rows = num; } - private static object GetColumns(object instanceObj) => (object)((GridLayout)instanceObj).Columns; + private static object GetColumns(object instanceObj) => ((GridLayout)instanceObj).Columns; private static void SetColumns(ref object instanceObj, object valueObj) { @@ -58,45 +58,45 @@ namespace Microsoft.Iris.Markup.UIX gridLayout.Columns = num; } - private static object GetRepeat(object instanceObj) => (object)((GridLayout)instanceObj).Repeat; + private static object GetRepeat(object instanceObj) => ((GridLayout)instanceObj).Repeat; private static void SetRepeat(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).Repeat = (RepeatPolicy)valueObj; - private static object GetRepeatGap(object instanceObj) => (object)((GridLayout)instanceObj).RepeatGap; + private static object GetRepeatGap(object instanceObj) => ((GridLayout)instanceObj).RepeatGap; private static void SetRepeatGap(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).RepeatGap = (int)valueObj; - private static object GetDefaultChildAlignment(object instanceObj) => (object)((GridLayout)instanceObj).DefaultChildAlignment; + private static object GetDefaultChildAlignment(object instanceObj) => ((GridLayout)instanceObj).DefaultChildAlignment; private static void SetDefaultChildAlignment(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).DefaultChildAlignment = (ItemAlignment)valueObj; - private static object Construct() => (object)new GridLayout(); + private static object Construct() => new GridLayout(); - public static void Pass1Initialize() => GridLayoutSchema.Type = new UIXTypeSchema((short)99, "GridLayout", (string)null, (short)132, typeof(GridLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => GridLayoutSchema.Type = new UIXTypeSchema(99, "GridLayout", null, 132, typeof(GridLayout), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)99, "Orientation", (short)154, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(GridLayoutSchema.GetOrientation), new SetValueHandler(GridLayoutSchema.SetOrientation), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)99, "AllowWrap", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(GridLayoutSchema.GetAllowWrap), new SetValueHandler(GridLayoutSchema.SetAllowWrap), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)99, "ReferenceSize", (short)195, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(GridLayoutSchema.GetReferenceSize), new SetValueHandler(GridLayoutSchema.SetReferenceSize), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)99, "Spacing", (short)195, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(GridLayoutSchema.GetSpacing), new SetValueHandler(GridLayoutSchema.SetSpacing), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)99, "Rows", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(GridLayoutSchema.GetRows), new SetValueHandler(GridLayoutSchema.SetRows), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)99, "Columns", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(GridLayoutSchema.GetColumns), new SetValueHandler(GridLayoutSchema.SetColumns), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)99, "Repeat", (short)172, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(GridLayoutSchema.GetRepeat), new SetValueHandler(GridLayoutSchema.SetRepeat), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)99, "RepeatGap", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(GridLayoutSchema.GetRepeatGap), new SetValueHandler(GridLayoutSchema.SetRepeatGap), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)99, "DefaultChildAlignment", (short)sbyte.MaxValue, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(GridLayoutSchema.GetDefaultChildAlignment), new SetValueHandler(GridLayoutSchema.SetDefaultChildAlignment), false); - GridLayoutSchema.Type.Initialize(new DefaultConstructHandler(GridLayoutSchema.Construct), (ConstructorSchema[])null, new PropertySchema[9] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(99, "Orientation", 154, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GridLayoutSchema.GetOrientation), new SetValueHandler(GridLayoutSchema.SetOrientation), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(99, "AllowWrap", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GridLayoutSchema.GetAllowWrap), new SetValueHandler(GridLayoutSchema.SetAllowWrap), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(99, "ReferenceSize", 195, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GridLayoutSchema.GetReferenceSize), new SetValueHandler(GridLayoutSchema.SetReferenceSize), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(99, "Spacing", 195, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GridLayoutSchema.GetSpacing), new SetValueHandler(GridLayoutSchema.SetSpacing), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(99, "Rows", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(GridLayoutSchema.GetRows), new SetValueHandler(GridLayoutSchema.SetRows), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(99, "Columns", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(GridLayoutSchema.GetColumns), new SetValueHandler(GridLayoutSchema.SetColumns), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(99, "Repeat", 172, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GridLayoutSchema.GetRepeat), new SetValueHandler(GridLayoutSchema.SetRepeat), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(99, "RepeatGap", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GridLayoutSchema.GetRepeatGap), new SetValueHandler(GridLayoutSchema.SetRepeatGap), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(99, "DefaultChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GridLayoutSchema.GetDefaultChildAlignment), new SetValueHandler(GridLayoutSchema.SetDefaultChildAlignment), false); + GridLayoutSchema.Type.Initialize(new DefaultConstructHandler(GridLayoutSchema.Construct), null, new PropertySchema[9] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema6, + uixPropertySchema9, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema5, + uixPropertySchema4 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/GroupSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/GroupSchema.cs index 7123c75..765e37f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/GroupSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/GroupSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetStartIndex(object instanceObj) => (object)((IUIGroup)instanceObj).StartIndex; + private static object GetStartIndex(object instanceObj) => ((IUIGroup)instanceObj).StartIndex; - private static object GetEndIndex(object instanceObj) => (object)((IUIGroup)instanceObj).EndIndex; + private static object GetEndIndex(object instanceObj) => ((IUIGroup)instanceObj).EndIndex; - public static void Pass1Initialize() => GroupSchema.Type = new UIXTypeSchema((short)100, "Group", (string)null, (short)138, typeof(IUIGroup), UIXTypeFlags.None); + public static void Pass1Initialize() => GroupSchema.Type = new UIXTypeSchema(100, "Group", null, 138, typeof(IUIGroup), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)100, "StartIndex", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GroupSchema.GetStartIndex), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)100, "EndIndex", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(GroupSchema.GetEndIndex), (SetValueHandler)null, false); - GroupSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(100, "StartIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GroupSchema.GetStartIndex), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(100, "EndIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GroupSchema.GetEndIndex), null, false); + GroupSchema.Type.Initialize(null, null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/HostSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/HostSchema.cs index 8fbf92b..bff9cea 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/HostSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/HostSchema.cs @@ -18,11 +18,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetNewContentOnTop(ref object instanceObj, object valueObj) => ((Host)instanceObj).NewContentOnTop = (bool)valueObj; - private static object GetSource(object instanceObj) => (object)((Host)instanceObj).Source; + private static object GetSource(object instanceObj) => ((Host)instanceObj).Source; - private static object GetSourceType(object instanceObj) => (object)((Host)instanceObj).SourceType; + private static object GetSourceType(object instanceObj) => ((Host)instanceObj).SourceType; - private static object GetStatus(object instanceObj) => (object)((Host)instanceObj).Status; + private static object GetStatus(object instanceObj) => ((Host)instanceObj).Status; private static object GetInputEnabled(object instanceObj) => BooleanBoxes.Box(((Host)instanceObj).InputEnabled); @@ -32,30 +32,30 @@ namespace Microsoft.Iris.Markup.UIX private static void SetUnloadable(ref object instanceObj, object valueObj) => ((Host)instanceObj).Unloadable = (bool)valueObj; - private static object Construct() => (object)new Host(); + private static object Construct() => new Host(); private static object CallUnloadAll(object instanceObj, object[] parameters) { ((Host)instanceObj).UnloadAll(); - return (object)null; + return null; } private static object CallForceRefresh(object instanceObj, object[] parameters) { ((Host)instanceObj).ForceRefresh(); - return (object)null; + return null; } private static object CallForceRefreshBoolean(object instanceObj, object[] parameters) { ((Host)instanceObj).ForceRefresh((bool)parameters[0]); - return (object)null; + return null; } private static object CallRequestSourceString(object instanceObj, object[] parameters) { - ((Host)instanceObj).RequestSource((string)parameters[0], (TypeSchema)null, (Vector)null); - return (object)null; + ((Host)instanceObj).RequestSource((string)parameters[0], null, null); + return null; } private static object CallRequestSourceStringStringObject( @@ -66,10 +66,10 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; string parameter2 = (string)parameters[1]; object parameter3 = parameters[2]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.RequestSourceCallBuilder(instance, parameter1, (TypeSchema)null, 1); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, parameter1, null, 1); + return null; } private static object CallRequestSourceStringStringObjectStringObject( @@ -82,12 +82,12 @@ namespace Microsoft.Iris.Markup.UIX object parameter3 = parameters[2]; string parameter4 = (string)parameters[3]; object parameter5 = parameters[4]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.s_paramsList[2] = (object)parameter4; + HostSchema.s_paramsList[2] = parameter4; HostSchema.s_paramsList[3] = parameter5; - HostSchema.RequestSourceCallBuilder(instance, parameter1, (TypeSchema)null, 2); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, parameter1, null, 2); + return null; } private static object CallRequestSourceStringStringObjectStringObjectStringObject( @@ -102,14 +102,14 @@ namespace Microsoft.Iris.Markup.UIX object parameter5 = parameters[4]; string parameter6 = (string)parameters[5]; object parameter7 = parameters[6]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.s_paramsList[2] = (object)parameter4; + HostSchema.s_paramsList[2] = parameter4; HostSchema.s_paramsList[3] = parameter5; - HostSchema.s_paramsList[4] = (object)parameter6; + HostSchema.s_paramsList[4] = parameter6; HostSchema.s_paramsList[5] = parameter7; - HostSchema.RequestSourceCallBuilder(instance, parameter1, (TypeSchema)null, 3); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, parameter1, null, 3); + return null; } private static object CallRequestSourceStringStringObjectStringObjectStringObjectStringObject( @@ -126,16 +126,16 @@ namespace Microsoft.Iris.Markup.UIX object parameter7 = parameters[6]; string parameter8 = (string)parameters[7]; object parameter9 = parameters[8]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.s_paramsList[2] = (object)parameter4; + HostSchema.s_paramsList[2] = parameter4; HostSchema.s_paramsList[3] = parameter5; - HostSchema.s_paramsList[4] = (object)parameter6; + HostSchema.s_paramsList[4] = parameter6; HostSchema.s_paramsList[5] = parameter7; - HostSchema.s_paramsList[6] = (object)parameter8; + HostSchema.s_paramsList[6] = parameter8; HostSchema.s_paramsList[7] = parameter9; - HostSchema.RequestSourceCallBuilder(instance, parameter1, (TypeSchema)null, 4); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, parameter1, null, 4); + return null; } private static object CallRequestSourceStringStringObjectStringObjectStringObjectStringObjectStringObject( @@ -154,24 +154,24 @@ namespace Microsoft.Iris.Markup.UIX object parameter9 = parameters[8]; string parameter10 = (string)parameters[9]; object parameter11 = parameters[10]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.s_paramsList[2] = (object)parameter4; + HostSchema.s_paramsList[2] = parameter4; HostSchema.s_paramsList[3] = parameter5; - HostSchema.s_paramsList[4] = (object)parameter6; + HostSchema.s_paramsList[4] = parameter6; HostSchema.s_paramsList[5] = parameter7; - HostSchema.s_paramsList[6] = (object)parameter8; + HostSchema.s_paramsList[6] = parameter8; HostSchema.s_paramsList[7] = parameter9; - HostSchema.s_paramsList[8] = (object)parameter10; + HostSchema.s_paramsList[8] = parameter10; HostSchema.s_paramsList[9] = parameter11; - HostSchema.RequestSourceCallBuilder(instance, parameter1, (TypeSchema)null, 5); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, parameter1, null, 5); + return null; } private static object CallRequestSourceType(object instanceObj, object[] parameters) { - ((Host)instanceObj).RequestSource((string)null, (TypeSchema)parameters[0], (Vector)null); - return (object)null; + ((Host)instanceObj).RequestSource(null, (TypeSchema)parameters[0], null); + return null; } private static object CallRequestSourceTypeStringObject(object instanceObj, object[] parameters) @@ -180,10 +180,10 @@ namespace Microsoft.Iris.Markup.UIX TypeSchema parameter1 = (TypeSchema)parameters[0]; string parameter2 = (string)parameters[1]; object parameter3 = parameters[2]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.RequestSourceCallBuilder(instance, (string)null, parameter1, 1); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, null, parameter1, 1); + return null; } private static object CallRequestSourceTypeStringObjectStringObject( @@ -196,12 +196,12 @@ namespace Microsoft.Iris.Markup.UIX object parameter3 = parameters[2]; string parameter4 = (string)parameters[3]; object parameter5 = parameters[4]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.s_paramsList[2] = (object)parameter4; + HostSchema.s_paramsList[2] = parameter4; HostSchema.s_paramsList[3] = parameter5; - HostSchema.RequestSourceCallBuilder(instance, (string)null, parameter1, 2); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, null, parameter1, 2); + return null; } private static object CallRequestSourceTypeStringObjectStringObjectStringObject( @@ -216,14 +216,14 @@ namespace Microsoft.Iris.Markup.UIX object parameter5 = parameters[4]; string parameter6 = (string)parameters[5]; object parameter7 = parameters[6]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.s_paramsList[2] = (object)parameter4; + HostSchema.s_paramsList[2] = parameter4; HostSchema.s_paramsList[3] = parameter5; - HostSchema.s_paramsList[4] = (object)parameter6; + HostSchema.s_paramsList[4] = parameter6; HostSchema.s_paramsList[5] = parameter7; - HostSchema.RequestSourceCallBuilder(instance, (string)null, parameter1, 3); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, null, parameter1, 3); + return null; } private static object CallRequestSourceTypeStringObjectStringObjectStringObjectStringObject( @@ -240,16 +240,16 @@ namespace Microsoft.Iris.Markup.UIX object parameter7 = parameters[6]; string parameter8 = (string)parameters[7]; object parameter9 = parameters[8]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.s_paramsList[2] = (object)parameter4; + HostSchema.s_paramsList[2] = parameter4; HostSchema.s_paramsList[3] = parameter5; - HostSchema.s_paramsList[4] = (object)parameter6; + HostSchema.s_paramsList[4] = parameter6; HostSchema.s_paramsList[5] = parameter7; - HostSchema.s_paramsList[6] = (object)parameter8; + HostSchema.s_paramsList[6] = parameter8; HostSchema.s_paramsList[7] = parameter9; - HostSchema.RequestSourceCallBuilder(instance, (string)null, parameter1, 4); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, null, parameter1, 4); + return null; } private static object CallRequestSourceTypeStringObjectStringObjectStringObjectStringObjectStringObject( @@ -268,18 +268,18 @@ namespace Microsoft.Iris.Markup.UIX object parameter9 = parameters[8]; string parameter10 = (string)parameters[9]; object parameter11 = parameters[10]; - HostSchema.s_paramsList[0] = (object)parameter2; + HostSchema.s_paramsList[0] = parameter2; HostSchema.s_paramsList[1] = parameter3; - HostSchema.s_paramsList[2] = (object)parameter4; + HostSchema.s_paramsList[2] = parameter4; HostSchema.s_paramsList[3] = parameter5; - HostSchema.s_paramsList[4] = (object)parameter6; + HostSchema.s_paramsList[4] = parameter6; HostSchema.s_paramsList[5] = parameter7; - HostSchema.s_paramsList[6] = (object)parameter8; + HostSchema.s_paramsList[6] = parameter8; HostSchema.s_paramsList[7] = parameter9; - HostSchema.s_paramsList[8] = (object)parameter10; + HostSchema.s_paramsList[8] = parameter10; HostSchema.s_paramsList[9] = parameter11; - HostSchema.RequestSourceCallBuilder(instance, (string)null, parameter1, 5); - return (object)null; + HostSchema.RequestSourceCallBuilder(instance, null, parameter1, 5); + return null; } private static void RequestSourceCallBuilder( @@ -295,167 +295,167 @@ namespace Microsoft.Iris.Markup.UIX string name = (string)HostSchema.s_paramsList[index * 2]; object obj = HostSchema.s_paramsList[index * 2 + 1]; if (name == null) - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)("property" + index.ToString())); + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "property" + index.ToString()); else UIPropertyRecord.AddToList(vector, name, obj); } for (int index = 0; index < numPairs * 2; ++index) - HostSchema.s_paramsList[index] = (object)null; + HostSchema.s_paramsList[index] = null; if (watermark.ErrorsDetected) return; instance.RequestSource(source, type, vector); } - public static void Pass1Initialize() => HostSchema.Type = new UIXTypeSchema((short)101, "Host", (string)null, (short)239, typeof(Host), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => HostSchema.Type = new UIXTypeSchema(101, "Host", null, 239, typeof(Host), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)101, "NewContentOnTop", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(HostSchema.GetNewContentOnTop), new SetValueHandler(HostSchema.SetNewContentOnTop), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)101, "Source", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(HostSchema.GetSource), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)101, "SourceType", (short)225, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(HostSchema.GetSourceType), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)101, "Status", (short)102, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(HostSchema.GetStatus), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)101, "InputEnabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(HostSchema.GetInputEnabled), new SetValueHandler(HostSchema.SetInputEnabled), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)101, "Unloadable", (short)15, (short)-1, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, true, new GetValueHandler(HostSchema.GetUnloadable), new SetValueHandler(HostSchema.SetUnloadable), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)101, "UnloadAll", (short[])null, (short)240, new InvokeHandler(HostSchema.CallUnloadAll), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)101, "ForceRefresh", (short[])null, (short)240, new InvokeHandler(HostSchema.CallForceRefresh), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)101, "ForceRefresh", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(101, "NewContentOnTop", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(HostSchema.GetNewContentOnTop), new SetValueHandler(HostSchema.SetNewContentOnTop), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(101, "Source", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(HostSchema.GetSource), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(101, "SourceType", 225, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(HostSchema.GetSourceType), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(101, "Status", 102, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(HostSchema.GetStatus), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(101, "InputEnabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(HostSchema.GetInputEnabled), new SetValueHandler(HostSchema.SetInputEnabled), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(101, "Unloadable", 15, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(HostSchema.GetUnloadable), new SetValueHandler(HostSchema.SetUnloadable), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(101, "UnloadAll", null, 240, new InvokeHandler(HostSchema.CallUnloadAll), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(101, "ForceRefresh", null, 240, new InvokeHandler(HostSchema.CallForceRefresh), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(101, "ForceRefresh", new short[1] { - (short) 15 - }, (short)240, new InvokeHandler(HostSchema.CallForceRefreshBoolean), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)101, "RequestSource", new short[1] + 15 + }, 240, new InvokeHandler(HostSchema.CallForceRefreshBoolean), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(101, "RequestSource", new short[1] { - (short) 208 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceString), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)101, "RequestSource", new short[3] + 208 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceString), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(101, "RequestSource", new short[3] { - (short) 208, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObject), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)101, "RequestSource", new short[5] + 208, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObject), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(101, "RequestSource", new short[5] { - (short) 208, - (short) 208, - (short) 153, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObjectStringObject), false); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)101, "RequestSource", new short[7] + 208, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(101, "RequestSource", new short[7] { - (short) 208, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObjectStringObjectStringObject), false); - UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema((short)101, "RequestSource", new short[9] + 208, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(101, "RequestSource", new short[9] { - (short) 208, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObjectStringObjectStringObjectStringObject), false); - UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema((short)101, "RequestSource", new short[11] + 208, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObjectStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(101, "RequestSource", new short[11] { - (short) 208, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObjectStringObjectStringObjectStringObjectStringObject), false); - UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema((short)101, "RequestSource", new short[1] + 208, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceStringStringObjectStringObjectStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(101, "RequestSource", new short[1] { - (short) 225 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceType), false); - UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema((short)101, "RequestSource", new short[3] + 225 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceType), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(101, "RequestSource", new short[3] { - (short) 225, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObject), false); - UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema((short)101, "RequestSource", new short[5] + 225, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObject), false); + UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema(101, "RequestSource", new short[5] { - (short) 225, - (short) 208, - (short) 153, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObjectStringObject), false); - UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema((short)101, "RequestSource", new short[7] + 225, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema(101, "RequestSource", new short[7] { - (short) 225, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObjectStringObjectStringObject), false); - UIXMethodSchema uixMethodSchema14 = new UIXMethodSchema((short)101, "RequestSource", new short[9] + 225, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema14 = new UIXMethodSchema(101, "RequestSource", new short[9] { - (short) 225, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObjectStringObjectStringObjectStringObject), false); - UIXMethodSchema uixMethodSchema15 = new UIXMethodSchema((short)101, "RequestSource", new short[11] + 225, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObjectStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema15 = new UIXMethodSchema(101, "RequestSource", new short[11] { - (short) 225, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153, - (short) 208, - (short) 153 - }, (short)240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObjectStringObjectStringObjectStringObjectStringObject), false); - HostSchema.Type.Initialize(new DefaultConstructHandler(HostSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + 225, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(HostSchema.CallRequestSourceTypeStringObjectStringObjectStringObjectStringObjectStringObject), false); + HostSchema.Type.Initialize(new DefaultConstructHandler(HostSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema6 + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema6 }, new MethodSchema[15] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7, - (MethodSchema) uixMethodSchema8, - (MethodSchema) uixMethodSchema9, - (MethodSchema) uixMethodSchema10, - (MethodSchema) uixMethodSchema11, - (MethodSchema) uixMethodSchema12, - (MethodSchema) uixMethodSchema13, - (MethodSchema) uixMethodSchema14, - (MethodSchema) uixMethodSchema15 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8, + uixMethodSchema9, + uixMethodSchema10, + uixMethodSchema11, + uixMethodSchema12, + uixMethodSchema13, + uixMethodSchema14, + uixMethodSchema15 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/HwndHostSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/HwndHostSchema.cs index a202a95..663d5d0 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/HwndHostSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/HwndHostSchema.cs @@ -12,25 +12,25 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetHandle(object instanceObj) => (object)((HwndHost)instanceObj).Handle; + private static object GetHandle(object instanceObj) => ((HwndHost)instanceObj).Handle; - private static object GetChildHandle(object instanceObj) => (object)((HwndHost)instanceObj).ChildHandle; + private static object GetChildHandle(object instanceObj) => ((HwndHost)instanceObj).ChildHandle; private static void SetChildHandle(ref object instanceObj, object valueObj) => ((HwndHost)instanceObj).ChildHandle = (long)valueObj; - private static object Construct() => (object)new HwndHost(); + private static object Construct() => new HwndHost(); - public static void Pass1Initialize() => HwndHostSchema.Type = new UIXTypeSchema((short)103, "HwndHost", (string)null, (short)239, typeof(HwndHost), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => HwndHostSchema.Type = new UIXTypeSchema(103, "HwndHost", null, 239, typeof(HwndHost), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)103, "Handle", (short)116, (short)-1, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, true, new GetValueHandler(HwndHostSchema.GetHandle), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)103, "ChildHandle", (short)116, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(HwndHostSchema.GetChildHandle), new SetValueHandler(HwndHostSchema.SetChildHandle), false); - HwndHostSchema.Type.Initialize(new DefaultConstructHandler(HwndHostSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(103, "Handle", 116, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(HwndHostSchema.GetHandle), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(103, "ChildHandle", 116, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(HwndHostSchema.GetChildHandle), new SetValueHandler(HwndHostSchema.SetChildHandle), false); + HwndHostSchema.Type.Initialize(new DefaultConstructHandler(HwndHostSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/IAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/IAnimationSchema.cs index 20ab194..a385030 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/IAnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/IAnimationSchema.cs @@ -12,8 +12,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => IAnimationSchema.Type = new UIXTypeSchema((short)104, "IAnimation", (string)null, (short)153, typeof(IAnimationProvider), UIXTypeFlags.None); + public static void Pass1Initialize() => IAnimationSchema.Type = new UIXTypeSchema(104, "IAnimation", null, 153, typeof(IAnimationProvider), UIXTypeFlags.None); - public static void Pass2Initialize() => IAnimationSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => IAnimationSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ImageElementInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ImageElementInstanceSchema.cs index 3cd98ec..67e1566 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ImageElementInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ImageElementInstanceSchema.cs @@ -18,17 +18,17 @@ namespace Microsoft.Iris.Markup.UIX private static void SetUVOffset(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("UVOffset", (Vector2)valueObj); - public static void Pass1Initialize() => ImageElementInstanceSchema.Type = new UIXTypeSchema((short)107, "ImageElementInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => ImageElementInstanceSchema.Type = new UIXTypeSchema(107, "ImageElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)107, "Image", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(ImageElementInstanceSchema.SetImage), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)107, "UVOffset", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(ImageElementInstanceSchema.SetUVOffset), false); - ImageElementInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(107, "Image", 105, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(ImageElementInstanceSchema.SetImage), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(107, "UVOffset", 233, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(ImageElementInstanceSchema.SetUVOffset), false); + ImageElementInstanceSchema.Type.Initialize(null, null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ImageElementSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ImageElementSchema.cs index 68a458e..e7344a5 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ImageElementSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ImageElementSchema.cs @@ -15,23 +15,23 @@ namespace Microsoft.Iris.Markup.UIX private static void SetImage(ref object instanceObj, object valueObj) => ((ImageElement)instanceObj).Image = ((UIImage)valueObj)?.RenderImage; - private static object GetUVOffset(object instanceObj) => (object)((ImageElement)instanceObj).UVOffset; + private static object GetUVOffset(object instanceObj) => ((ImageElement)instanceObj).UVOffset; private static void SetUVOffset(ref object instanceObj, object valueObj) => ((ImageElement)instanceObj).UVOffset = (Vector2)valueObj; - private static object Construct() => (object)new ImageElement(); + private static object Construct() => new ImageElement(); - public static void Pass1Initialize() => ImageElementSchema.Type = new UIXTypeSchema((short)106, "ImageElement", (string)null, (short)77, typeof(ImageElement), UIXTypeFlags.None); + public static void Pass1Initialize() => ImageElementSchema.Type = new UIXTypeSchema(106, "ImageElement", null, 77, typeof(ImageElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)106, "Image", (short)105, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(ImageElementSchema.SetImage), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)106, "UVOffset", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ImageElementSchema.GetUVOffset), new SetValueHandler(ImageElementSchema.SetUVOffset), false); - ImageElementSchema.Type.Initialize(new DefaultConstructHandler(ImageElementSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(106, "Image", 105, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(ImageElementSchema.SetImage), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(106, "UVOffset", 233, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ImageElementSchema.GetUVOffset), new SetValueHandler(ImageElementSchema.SetUVOffset), false); + ImageElementSchema.Type.Initialize(new DefaultConstructHandler(ImageElementSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ImageSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ImageSchema.cs index 385f9ae..3b783c5 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ImageSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ImageSchema.cs @@ -16,15 +16,15 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetSource(object instanceObj) => (object)((UIImage)instanceObj).Source; + private static object GetSource(object instanceObj) => ((UIImage)instanceObj).Source; private static void SetSource(ref object instanceObj, object valueObj) => ((UIImage)instanceObj).Source = (string)valueObj; - private static object GetNineGrid(object instanceObj) => (object)((UIImage)instanceObj).NineGrid; + private static object GetNineGrid(object instanceObj) => ((UIImage)instanceObj).NineGrid; private static void SetNineGrid(ref object instanceObj, object valueObj) => ((UIImage)instanceObj).NineGrid = (Inset)valueObj; - private static object GetMaximumSize(object instanceObj) => (object)((UIImage)instanceObj).MaximumSize; + private static object GetMaximumSize(object instanceObj) => ((UIImage)instanceObj).MaximumSize; private static void SetMaximumSize(ref object instanceObj, object valueObj) { @@ -45,18 +45,18 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAntialiasEdges(ref object instanceObj, object valueObj) => ((UIImage)instanceObj).AntialiasEdges = (bool)valueObj; - private static object GetStatus(object instanceObj) => (object)((UIImage)instanceObj).Status; + private static object GetStatus(object instanceObj) => ((UIImage)instanceObj).Status; - private static object GetWidth(object instanceObj) => (object)((UIImage)instanceObj).Width; + private static object GetWidth(object instanceObj) => ((UIImage)instanceObj).Width; - private static object GetHeight(object instanceObj) => (object)((UIImage)instanceObj).Height; + private static object GetHeight(object instanceObj) => ((UIImage)instanceObj).Height; - private static object Construct() => (object)new UriImage(); + private static object Construct() => new UriImage(); private static object CallLoad(object instanceObj, object[] parameters) { ((UIImage)instanceObj).Load(); - return (object)null; + return null; } private static object ConstructSource(object[] parameters) @@ -70,9 +70,9 @@ namespace Microsoft.Iris.Markup.UIX { instance = ImageSchema.Construct(); object valueObj; - Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj); + Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result.Error); ImageSchema.SetSource(ref instance, valueObj); return result; } @@ -91,14 +91,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = ImageSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result1.Error); ImageSchema.SetSource(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)InsetSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], InsetSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result2.Error); ImageSchema.SetNineGrid(ref instance, valueObj2); return result2; } @@ -118,19 +118,19 @@ namespace Microsoft.Iris.Markup.UIX { instance = ImageSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result1.Error); ImageSchema.SetSource(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)InsetSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], InsetSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result2.Error); ImageSchema.SetNineGrid(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result3.Error); ImageSchema.SetMaximumSize(ref instance, valueObj3); return result3; } @@ -151,24 +151,24 @@ namespace Microsoft.Iris.Markup.UIX { instance = ImageSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result1.Error); ImageSchema.SetSource(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)InsetSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], InsetSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result2.Error); ImageSchema.SetNineGrid(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result3.Error); ImageSchema.SetMaximumSize(ref instance, valueObj3); object valueObj4; - Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], (TypeSchema)BooleanSchema.Type, (RangeValidator)null, out valueObj4); + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], BooleanSchema.Type, null, out valueObj4); if (result4.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result4.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result4.Error); ImageSchema.SetFlippable(ref instance, valueObj4); return result4; } @@ -191,29 +191,29 @@ namespace Microsoft.Iris.Markup.UIX { instance = ImageSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result1.Error); ImageSchema.SetSource(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)InsetSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], InsetSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result2.Error); ImageSchema.SetNineGrid(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result3.Error); ImageSchema.SetMaximumSize(ref instance, valueObj3); object valueObj4; - Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], (TypeSchema)BooleanSchema.Type, (RangeValidator)null, out valueObj4); + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], BooleanSchema.Type, null, out valueObj4); if (result4.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result4.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result4.Error); ImageSchema.SetFlippable(ref instance, valueObj4); object valueObj5; - Result result5 = UIXLoadResult.ValidateStringAsValue(splitString[4], (TypeSchema)BooleanSchema.Type, (RangeValidator)null, out valueObj5); + Result result5 = UIXLoadResult.ValidateStringAsValue(splitString[4], BooleanSchema.Type, null, out valueObj5); if (result5.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Image", (object)result5.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Image", result5.Error); ImageSchema.SetAntialiasEdges(ref instance, valueObj5); return result5; } @@ -226,7 +226,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -258,77 +258,77 @@ namespace Microsoft.Iris.Markup.UIX return result; break; default: - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Image"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Image"); break; } } return result; } - public static void Pass1Initialize() => ImageSchema.Type = new UIXTypeSchema((short)105, "Image", (string)null, (short)153, typeof(UIImage), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => ImageSchema.Type = new UIXTypeSchema(105, "Image", null, 153, typeof(UIImage), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)105, "Source", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ImageSchema.GetSource), new SetValueHandler(ImageSchema.SetSource), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)105, "NineGrid", (short)114, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ImageSchema.GetNineGrid), new SetValueHandler(ImageSchema.SetNineGrid), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)105, "MaximumSize", (short)195, (short)-1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, false, new GetValueHandler(ImageSchema.GetMaximumSize), new SetValueHandler(ImageSchema.SetMaximumSize), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)105, "Flippable", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ImageSchema.GetFlippable), new SetValueHandler(ImageSchema.SetFlippable), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)105, "AntialiasEdges", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ImageSchema.GetAntialiasEdges), new SetValueHandler(ImageSchema.SetAntialiasEdges), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)105, "Status", (short)108, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ImageSchema.GetStatus), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)105, "Width", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ImageSchema.GetWidth), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)105, "Height", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ImageSchema.GetHeight), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)105, "Load", (short[])null, (short)240, new InvokeHandler(ImageSchema.CallLoad), false); - UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema((short)105, new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(105, "Source", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ImageSchema.GetSource), new SetValueHandler(ImageSchema.SetSource), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(105, "NineGrid", 114, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ImageSchema.GetNineGrid), new SetValueHandler(ImageSchema.SetNineGrid), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(105, "MaximumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, false, new GetValueHandler(ImageSchema.GetMaximumSize), new SetValueHandler(ImageSchema.SetMaximumSize), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(105, "Flippable", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ImageSchema.GetFlippable), new SetValueHandler(ImageSchema.SetFlippable), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(105, "AntialiasEdges", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ImageSchema.GetAntialiasEdges), new SetValueHandler(ImageSchema.SetAntialiasEdges), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(105, "Status", 108, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ImageSchema.GetStatus), null, false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(105, "Width", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ImageSchema.GetWidth), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(105, "Height", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ImageSchema.GetHeight), null, false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(105, "Load", null, 240, new InvokeHandler(ImageSchema.CallLoad), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(105, new short[1] { - (short) 208 + 208 }, new ConstructHandler(ImageSchema.ConstructSource)); - UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema((short)105, new short[2] + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(105, new short[2] { - (short) 208, - (short) 114 + 208, + 114 }, new ConstructHandler(ImageSchema.ConstructSourceNineGrid)); - UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema((short)105, new short[3] + UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema(105, new short[3] { - (short) 208, - (short) 114, - (short) 195 + 208, + 114, + 195 }, new ConstructHandler(ImageSchema.ConstructSourceNineGridMaximumSize)); - UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema((short)105, new short[4] + UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema(105, new short[4] { - (short) 208, - (short) 114, - (short) 195, - (short) 15 + 208, + 114, + 195, + 15 }, new ConstructHandler(ImageSchema.ConstructSourceNineGridMaximumSizeFlippable)); - UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema((short)105, new short[5] + UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema(105, new short[5] { - (short) 208, - (short) 114, - (short) 195, - (short) 15, - (short) 15 + 208, + 114, + 195, + 15, + 15 }, new ConstructHandler(ImageSchema.ConstructSourceNineGridMaximumSizeFlippableAntialiasEdges)); ImageSchema.Type.Initialize(new DefaultConstructHandler(ImageSchema.Construct), new ConstructorSchema[5] { - (ConstructorSchema) constructorSchema1, - (ConstructorSchema) constructorSchema2, - (ConstructorSchema) constructorSchema3, - (ConstructorSchema) constructorSchema4, - (ConstructorSchema) constructorSchema5 + constructorSchema1, + constructorSchema2, + constructorSchema3, + constructorSchema4, + constructorSchema5 }, new PropertySchema[8] { - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema7 + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema6, + uixPropertySchema7 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(ImageSchema.TryConvertFrom), new SupportsTypeConversionHandler(ImageSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, new TypeConverterHandler(ImageSchema.TryConvertFrom), new SupportsTypeConversionHandler(ImageSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs index 2baf718..6caa4ea 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs @@ -12,27 +12,27 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((Index)instanceObj).Value; + private static object GetValue(object instanceObj) => ((Index)instanceObj).Value; - private static object GetSourceValue(object instanceObj) => (object)((Index)instanceObj).SourceValue; + private static object GetSourceValue(object instanceObj) => ((Index)instanceObj).SourceValue; - private static object CallGetContainerIndex(object instanceObj, object[] parameters) => (object)((Index)instanceObj).GetContainerIndex(); + private static object CallGetContainerIndex(object instanceObj, object[] parameters) => ((Index)instanceObj).GetContainerIndex(); - public static void Pass1Initialize() => IndexSchema.Type = new UIXTypeSchema((short)109, "Index", (string)null, (short)153, typeof(Index), UIXTypeFlags.None); + public static void Pass1Initialize() => IndexSchema.Type = new UIXTypeSchema(109, "Index", null, 153, typeof(Index), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)109, "Value", (short)115, (short)-1, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, true, new GetValueHandler(IndexSchema.GetValue), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)109, "SourceValue", (short)115, (short)-1, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, true, new GetValueHandler(IndexSchema.GetSourceValue), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)109, "GetContainerIndex", (short[])null, (short)109, new InvokeHandler(IndexSchema.CallGetContainerIndex), false); - IndexSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(109, "Value", 115, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(IndexSchema.GetValue), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(109, "SourceValue", 115, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(IndexSchema.GetSourceValue), null, false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(109, "GetContainerIndex", null, 109, new InvokeHandler(IndexSchema.CallGetContainerIndex), false); + IndexSchema.Type.Initialize(null, null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 + uixPropertySchema2, + uixPropertySchema1 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/InputHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InputHandlerSchema.cs index b6ac61f..be70f22 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/InputHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/InputHandlerSchema.cs @@ -12,7 +12,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetName(object instanceObj) => (object)((InputHandler)instanceObj).Name; + private static object GetName(object instanceObj) => ((InputHandler)instanceObj).Name; private static void SetName(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).Name = (string)valueObj; @@ -20,17 +20,17 @@ namespace Microsoft.Iris.Markup.UIX private static void SetEnabled(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).Enabled = (bool)valueObj; - public static void Pass1Initialize() => InputHandlerSchema.Type = new UIXTypeSchema((short)110, "InputHandler", (string)null, (short)-1, typeof(InputHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => InputHandlerSchema.Type = new UIXTypeSchema(110, "InputHandler", null, -1, typeof(InputHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)110, "Name", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(InputHandlerSchema.GetName), new SetValueHandler(InputHandlerSchema.SetName), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)110, "Enabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(InputHandlerSchema.GetEnabled), new SetValueHandler(InputHandlerSchema.SetEnabled), false); - InputHandlerSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(110, "Name", 208, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(InputHandlerSchema.GetName), new SetValueHandler(InputHandlerSchema.SetName), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(110, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(InputHandlerSchema.GetEnabled), new SetValueHandler(InputHandlerSchema.SetEnabled), false); + InputHandlerSchema.Type.Initialize(null, null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/InsetSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InsetSchema.cs index 622f0cd..05ee1eb 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/InsetSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/InsetSchema.cs @@ -14,47 +14,47 @@ namespace Microsoft.Iris.Markup.UIX { internal static class InsetSchema { - private static readonly object s_Default = (object)Inset.Zero; + private static readonly object s_Default = Inset.Zero; public static UIXTypeSchema Type; - private static object GetLeft(object instanceObj) => (object)((Inset)instanceObj).Left; + private static object GetLeft(object instanceObj) => ((Inset)instanceObj).Left; private static void SetLeft(ref object instanceObj, object valueObj) { Inset inset = (Inset)instanceObj; int num = (int)valueObj; inset.Left = num; - instanceObj = (object)inset; + instanceObj = inset; } - private static object GetTop(object instanceObj) => (object)((Inset)instanceObj).Top; + private static object GetTop(object instanceObj) => ((Inset)instanceObj).Top; private static void SetTop(ref object instanceObj, object valueObj) { Inset inset = (Inset)instanceObj; int num = (int)valueObj; inset.Top = num; - instanceObj = (object)inset; + instanceObj = inset; } - private static object GetRight(object instanceObj) => (object)((Inset)instanceObj).Right; + private static object GetRight(object instanceObj) => ((Inset)instanceObj).Right; private static void SetRight(ref object instanceObj, object valueObj) { Inset inset = (Inset)instanceObj; int num = (int)valueObj; inset.Right = num; - instanceObj = (object)inset; + instanceObj = inset; } - private static object GetBottom(object instanceObj) => (object)((Inset)instanceObj).Bottom; + private static object GetBottom(object instanceObj) => ((Inset)instanceObj).Bottom; private static void SetBottom(ref object instanceObj, object valueObj) { Inset inset = (Inset)instanceObj; int num = (int)valueObj; inset.Bottom = num; - instanceObj = (object)inset; + instanceObj = inset; } private static object Construct() => InsetSchema.s_Default; @@ -62,7 +62,7 @@ namespace Microsoft.Iris.Markup.UIX private static object ConstructInt32(object[] parameters) { int parameter = (int)parameters[0]; - return (object)new Inset(parameter, parameter, parameter, parameter); + return new Inset(parameter, parameter, parameter, parameter); } private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) @@ -74,16 +74,16 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteInt32(inset.Bottom); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new Inset(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32()); + private static object DecodeBinary(ByteCodeReader reader) => new Inset(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32()); private static Result ConvertFromString(object valueObj, out object instanceObj) { string s = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; int result; - if (!int.TryParse(s, NumberStyles.Integer, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result)) + if (!int.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out result)) return Result.Fail(""); - instanceObj = (object)new Inset() + instanceObj = new Inset() { Left = result, Top = result, @@ -96,8 +96,8 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromInt32(object valueObj, out object instanceObj) { int num = (int)valueObj; - instanceObj = (object)null; - instanceObj = (object)new Inset() + instanceObj = null; + instanceObj = new Inset() { Left = num, Top = num, @@ -110,14 +110,14 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromSingle(object valueObj, out object instanceObj) { float num1 = (float)valueObj; - instanceObj = (object)null; + instanceObj = null; Inset inset = new Inset(); int num2 = (int)num1; inset.Left = num2; inset.Top = num2; inset.Right = num2; inset.Bottom = num2; - instanceObj = (object)inset; + instanceObj = inset; return Result.Success; } @@ -137,24 +137,24 @@ namespace Microsoft.Iris.Markup.UIX { instance = InsetSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Inset", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Inset", result1.Error); InsetSchema.SetLeft(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Inset", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Inset", result2.Error); InsetSchema.SetTop(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], Int32Schema.Type, null, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Inset", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Inset", result3.Error); InsetSchema.SetRight(ref instance, valueObj3); object valueObj4; - Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj4); + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], Int32Schema.Type, null, out valueObj4); if (result4.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Inset", (object)result4.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Inset", result4.Error); InsetSchema.SetBottom(ref instance, valueObj4); return result4; } @@ -167,7 +167,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (Int32Schema.Type.IsAssignableFrom(fromType)) { result = InsetSchema.ConvertFromInt32(from, out instance); @@ -196,7 +196,7 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Inset"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Inset"); } return result; } @@ -220,20 +220,20 @@ namespace Microsoft.Iris.Markup.UIX { Inset inset1 = (Inset)leftObj; if (op == OperationType.MathNegate) - return (object)-inset1; + return -inset1; Inset inset2 = (Inset)rightObj; switch (op) { case OperationType.MathAdd: - return (object)(inset1 + inset2); + return inset1 + inset2; case OperationType.MathSubtract: - return (object)(inset1 - inset2); + return inset1 - inset2; case OperationType.RelationalEquals: return BooleanBoxes.Box(inset1 == inset2); case OperationType.RelationalNotEquals: return BooleanBoxes.Box(inset1 != inset2); default: - return (object)null; + return null; } } @@ -242,47 +242,47 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; Inset parameter2 = (Inset)parameters[1]; object instanceObj1; - return InsetSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return InsetSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => InsetSchema.Type = new UIXTypeSchema((short)114, "Inset", (string)null, (short)153, typeof(Inset), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => InsetSchema.Type = new UIXTypeSchema(114, "Inset", null, 153, typeof(Inset), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)114, "Left", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InsetSchema.GetLeft), new SetValueHandler(InsetSchema.SetLeft), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)114, "Top", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InsetSchema.GetTop), new SetValueHandler(InsetSchema.SetTop), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)114, "Right", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InsetSchema.GetRight), new SetValueHandler(InsetSchema.SetRight), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)114, "Bottom", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InsetSchema.GetBottom), new SetValueHandler(InsetSchema.SetBottom), false); - UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema((short)114, new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(114, "Left", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InsetSchema.GetLeft), new SetValueHandler(InsetSchema.SetLeft), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(114, "Top", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InsetSchema.GetTop), new SetValueHandler(InsetSchema.SetTop), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(114, "Right", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InsetSchema.GetRight), new SetValueHandler(InsetSchema.SetRight), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(114, "Bottom", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InsetSchema.GetBottom), new SetValueHandler(InsetSchema.SetBottom), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(114, new short[1] { - (short) 115 + 115 }, new ConstructHandler(InsetSchema.ConstructInt32)); - UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema((short)114, new short[4] + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(114, new short[4] { - (short) 115, - (short) 115, - (short) 115, - (short) 115 + 115, + 115, + 115, + 115 }, new ConstructHandler(InsetSchema.ConstructLeftTopRightBottom)); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)114, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(114, "TryParse", new short[2] { - (short) 208, - (short) 114 - }, (short)114, new InvokeHandler(InsetSchema.CallTryParseStringInset), true); + 208, + 114 + }, 114, new InvokeHandler(InsetSchema.CallTryParseStringInset), true); InsetSchema.Type.Initialize(new DefaultConstructHandler(InsetSchema.Construct), new ConstructorSchema[2] { - (ConstructorSchema) constructorSchema1, - (ConstructorSchema) constructorSchema2 + constructorSchema1, + constructorSchema2 }, new PropertySchema[4] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2 + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(InsetSchema.TryConvertFrom), new SupportsTypeConversionHandler(InsetSchema.IsConversionSupported), new EncodeBinaryHandler(InsetSchema.EncodeBinary), new DecodeBinaryHandler(InsetSchema.DecodeBinary), new PerformOperationHandler(InsetSchema.ExecuteOperation), new SupportsOperationHandler(InsetSchema.IsOperationSupported)); + uixMethodSchema + }, null, null, new TypeConverterHandler(InsetSchema.TryConvertFrom), new SupportsTypeConversionHandler(InsetSchema.IsConversionSupported), new EncodeBinaryHandler(InsetSchema.EncodeBinary), new DecodeBinaryHandler(InsetSchema.DecodeBinary), new PerformOperationHandler(InsetSchema.ExecuteOperation), new SupportsOperationHandler(InsetSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs b/UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs index cba4f97..412d2ba 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs @@ -28,65 +28,65 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteInt32(num); } - private static object DecodeBinary(ByteCodeReader reader) => (object)reader.ReadInt32(); + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadInt32(); private static Result ConvertFromString(object valueObj, out object instanceObj) { string s = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; int result; - if (!int.TryParse(s, NumberStyles.Integer, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)s, (object)"Int32"); - instanceObj = (object)result; + if (!int.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out result)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", s, "Int32"); + instanceObj = result; return Result.Success; } private static Result ConvertFromBoolean(object valueObj, out object instanceObj) { bool flag = (bool)valueObj; - instanceObj = (object)null; + instanceObj = null; int num = flag ? 1 : 0; - instanceObj = (object)num; + instanceObj = num; return Result.Success; } private static Result ConvertFromByte(object valueObj, out object instanceObj) { byte num1 = (byte)valueObj; - instanceObj = (object)null; - int num2 = (int)num1; - instanceObj = (object)num2; + instanceObj = null; + int num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromSingle(object valueObj, out object instanceObj) { float num1 = (float)valueObj; - instanceObj = (object)null; + instanceObj = null; int num2 = (int)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } private static Result ConvertFromInt64(object valueObj, out object instanceObj) { long num1 = (long)valueObj; - instanceObj = (object)null; + instanceObj = null; int num2 = (int)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } private static Result ConvertFromDouble(object valueObj, out object instanceObj) { double num1 = (double)valueObj; - instanceObj = (object)null; + instanceObj = null; int num2 = (int)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } - private static object CallToStringString(object instanceObj, object[] parameters) => (object)((int)instanceObj).ToString((string)parameters[0]); + private static object CallToStringString(object instanceObj, object[] parameters) => ((int)instanceObj).ToString((string)parameters[0]); private static bool IsConversionSupported(TypeSchema fromType) => BooleanSchema.Type.IsAssignableFrom(fromType) || ByteSchema.Type.IsAssignableFrom(fromType) || (DoubleSchema.Type.IsAssignableFrom(fromType) || Int64Schema.Type.IsAssignableFrom(fromType)) || (SingleSchema.Type.IsAssignableFrom(fromType) || StringSchema.Type.IsAssignableFrom(fromType) || fromType.IsEnum); @@ -96,7 +96,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (BooleanSchema.Type.IsAssignableFrom(fromType)) { result = Int32Schema.ConvertFromBoolean(from, out instance); @@ -135,7 +135,7 @@ namespace Microsoft.Iris.Markup.UIX } if (!fromType.IsEnum) return result; - instance = !(from is DllEnumProxy dllEnumProxy) ? (object)(int)from : (object)dllEnumProxy.Value; + instance = !(from is DllEnumProxy dllEnumProxy) ? (int)from : (object)dllEnumProxy.Value; return Result.Success; } @@ -165,20 +165,20 @@ namespace Microsoft.Iris.Markup.UIX { int num1 = (int)leftObj; if (op == OperationType.MathNegate) - return (object)-num1; + return -num1; int num2 = (int)rightObj; switch (op - 1) { - case (OperationType)0: - return (object)(num1 + num2); + case 0: + return num1 + num2; case OperationType.MathAdd: - return (object)(num1 - num2); + return num1 - num2; case OperationType.MathSubtract: - return (object)(num1 * num2); + return num1 * num2; case OperationType.MathMultiply: - return (object)(num1 / num2); + return num1 / num2; case OperationType.MathDivide: - return (object)(num1 % num2); + return num1 % num2; case OperationType.LogicalOr: return BooleanBoxes.Box(num1 == num2); case OperationType.RelationalEquals: @@ -192,7 +192,7 @@ namespace Microsoft.Iris.Markup.UIX case OperationType.RelationalLessThanEquals: return BooleanBoxes.Box(num1 >= num2); default: - return (object)null; + return null; } } @@ -201,39 +201,39 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; int parameter2 = (int)parameters[1]; object instanceObj1; - return Int32Schema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return Int32Schema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } private static Result RangeValidateNotNegative(object value) { int num = (int)value; - return num < 0 ? Result.Fail("Expecting a non-negative value, but got {0}", (object)num.ToString()) : Result.Success; + return num < 0 ? Result.Fail("Expecting a non-negative value, but got {0}", num.ToString()) : Result.Success; } - public static void Pass1Initialize() => Int32Schema.Type = new UIXTypeSchema((short)115, "Int32", "int", (short)153, typeof(int), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => Int32Schema.Type = new UIXTypeSchema(115, "Int32", "int", 153, typeof(int), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)115, "MinValue", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Int32Schema.GetMinValue), (SetValueHandler)null, true); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)115, "MaxValue", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Int32Schema.GetMaxValue), (SetValueHandler)null, true); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)115, "ToString", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(115, "MinValue", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Int32Schema.GetMinValue), null, true); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(115, "MaxValue", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Int32Schema.GetMaxValue), null, true); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(115, "ToString", new short[1] { - (short) 208 - }, (short)208, new InvokeHandler(Int32Schema.CallToStringString), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)115, "TryParse", new short[2] + 208 + }, 208, new InvokeHandler(Int32Schema.CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(115, "TryParse", new short[2] { - (short) 208, - (short) 115 - }, (short)115, new InvokeHandler(Int32Schema.CallTryParseStringInt32), true); - Int32Schema.Type.Initialize(new DefaultConstructHandler(Int32Schema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + 208, + 115 + }, 115, new InvokeHandler(Int32Schema.CallTryParseStringInt32), true); + Int32Schema.Type.Initialize(new DefaultConstructHandler(Int32Schema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 + uixPropertySchema2, + uixPropertySchema1 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(Int32Schema.TryConvertFrom), new SupportsTypeConversionHandler(Int32Schema.IsConversionSupported), new EncodeBinaryHandler(Int32Schema.EncodeBinary), new DecodeBinaryHandler(Int32Schema.DecodeBinary), new PerformOperationHandler(Int32Schema.ExecuteOperation), new SupportsOperationHandler(Int32Schema.IsOperationSupported)); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(Int32Schema.TryConvertFrom), new SupportsTypeConversionHandler(Int32Schema.IsConversionSupported), new EncodeBinaryHandler(Int32Schema.EncodeBinary), new DecodeBinaryHandler(Int32Schema.DecodeBinary), new PerformOperationHandler(Int32Schema.ExecuteOperation), new SupportsOperationHandler(Int32Schema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs b/UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs index e18a6cf..adbf907 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs @@ -26,65 +26,65 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteInt64(num); } - private static object DecodeBinary(ByteCodeReader reader) => (object)reader.ReadInt64(); + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadInt64(); private static Result ConvertFromString(object valueObj, out object instanceObj) { string s = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; long result; - if (!long.TryParse(s, NumberStyles.Integer, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)s, (object)"Int64"); - instanceObj = (object)result; + if (!long.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out result)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", s, "Int64"); + instanceObj = result; return Result.Success; } private static Result ConvertFromBoolean(object valueObj, out object instanceObj) { bool flag = (bool)valueObj; - instanceObj = (object)null; + instanceObj = null; long num = flag ? 1L : 0L; - instanceObj = (object)num; + instanceObj = num; return Result.Success; } private static Result ConvertFromByte(object valueObj, out object instanceObj) { byte num1 = (byte)valueObj; - instanceObj = (object)null; - long num2 = (long)num1; - instanceObj = (object)num2; + instanceObj = null; + long num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromSingle(object valueObj, out object instanceObj) { float num1 = (float)valueObj; - instanceObj = (object)null; + instanceObj = null; long num2 = (long)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } private static Result ConvertFromInt32(object valueObj, out object instanceObj) { int num1 = (int)valueObj; - instanceObj = (object)null; - long num2 = (long)num1; - instanceObj = (object)num2; + instanceObj = null; + long num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromDouble(object valueObj, out object instanceObj) { double num1 = (double)valueObj; - instanceObj = (object)null; + instanceObj = null; long num2 = (long)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } - private static object CallToStringString(object instanceObj, object[] parameters) => (object)((long)instanceObj).ToString((string)parameters[0]); + private static object CallToStringString(object instanceObj, object[] parameters) => ((long)instanceObj).ToString((string)parameters[0]); private static bool IsConversionSupported(TypeSchema fromType) => BooleanSchema.Type.IsAssignableFrom(fromType) || ByteSchema.Type.IsAssignableFrom(fromType) || (DoubleSchema.Type.IsAssignableFrom(fromType) || Int32Schema.Type.IsAssignableFrom(fromType)) || (SingleSchema.Type.IsAssignableFrom(fromType) || StringSchema.Type.IsAssignableFrom(fromType)); @@ -94,7 +94,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (BooleanSchema.Type.IsAssignableFrom(fromType)) { result = Int64Schema.ConvertFromBoolean(from, out instance); @@ -160,20 +160,20 @@ namespace Microsoft.Iris.Markup.UIX { long num1 = (long)leftObj; if (op == OperationType.MathNegate) - return (object)-num1; + return -num1; long num2 = (long)rightObj; switch (op - 1) { - case (OperationType)0: - return (object)(num1 + num2); + case 0: + return num1 + num2; case OperationType.MathAdd: - return (object)(num1 - num2); + return num1 - num2; case OperationType.MathSubtract: - return (object)(num1 * num2); + return num1 * num2; case OperationType.MathMultiply: - return (object)(num1 / num2); + return num1 / num2; case OperationType.MathDivide: - return (object)(num1 % num2); + return num1 % num2; case OperationType.LogicalOr: return BooleanBoxes.Box(num1 == num2); case OperationType.RelationalEquals: @@ -187,7 +187,7 @@ namespace Microsoft.Iris.Markup.UIX case OperationType.RelationalLessThanEquals: return BooleanBoxes.Box(num1 >= num2); default: - return (object)null; + return null; } } @@ -196,33 +196,33 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; long parameter2 = (long)parameters[1]; object instanceObj1; - return Int64Schema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return Int64Schema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => Int64Schema.Type = new UIXTypeSchema((short)116, "Int64", "long", (short)153, typeof(long), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => Int64Schema.Type = new UIXTypeSchema(116, "Int64", "long", 153, typeof(long), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)116, "MinValue", (short)116, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Int64Schema.GetMinValue), (SetValueHandler)null, true); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)116, "MaxValue", (short)116, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Int64Schema.GetMaxValue), (SetValueHandler)null, true); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)116, "ToString", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(116, "MinValue", 116, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Int64Schema.GetMinValue), null, true); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(116, "MaxValue", 116, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Int64Schema.GetMaxValue), null, true); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(116, "ToString", new short[1] { - (short) 208 - }, (short)208, new InvokeHandler(Int64Schema.CallToStringString), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)116, "TryParse", new short[2] + 208 + }, 208, new InvokeHandler(Int64Schema.CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(116, "TryParse", new short[2] { - (short) 208, - (short) 116 - }, (short)116, new InvokeHandler(Int64Schema.CallTryParseStringInt64), true); - Int64Schema.Type.Initialize(new DefaultConstructHandler(Int64Schema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + 208, + 116 + }, 116, new InvokeHandler(Int64Schema.CallTryParseStringInt64), true); + Int64Schema.Type.Initialize(new DefaultConstructHandler(Int64Schema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 + uixPropertySchema2, + uixPropertySchema1 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(Int64Schema.TryConvertFrom), new SupportsTypeConversionHandler(Int64Schema.IsConversionSupported), new EncodeBinaryHandler(Int64Schema.EncodeBinary), new DecodeBinaryHandler(Int64Schema.DecodeBinary), new PerformOperationHandler(Int64Schema.ExecuteOperation), new SupportsOperationHandler(Int64Schema.IsOperationSupported)); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(Int64Schema.TryConvertFrom), new SupportsTypeConversionHandler(Int64Schema.IsConversionSupported), new EncodeBinaryHandler(Int64Schema.EncodeBinary), new DecodeBinaryHandler(Int64Schema.DecodeBinary), new PerformOperationHandler(Int64Schema.ExecuteOperation), new SupportsOperationHandler(Int64Schema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/IntRangedValueSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/IntRangedValueSchema.cs index 4985f2c..1ea18d8 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/IntRangedValueSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/IntRangedValueSchema.cs @@ -13,55 +13,55 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetMinValue(object instanceObj) => (object)(int)((IUIRangedValue)instanceObj).MinValue; + private static object GetMinValue(object instanceObj) => (int)((IUIRangedValue)instanceObj).MinValue; private static void SetMinValue(ref object instanceObj, object valueObj) { IUIIntRangedValue uiIntRangedValue = (IUIIntRangedValue)instanceObj; int num = (int)valueObj; - if ((double)num > (double)uiIntRangedValue.MaxValue) - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)num, (object)"MinValue"); + if (num > (double)uiIntRangedValue.MaxValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MinValue"); else - uiIntRangedValue.MinValue = (float)num; + uiIntRangedValue.MinValue = num; } - private static object GetMaxValue(object instanceObj) => (object)(int)((IUIRangedValue)instanceObj).MaxValue; + private static object GetMaxValue(object instanceObj) => (int)((IUIRangedValue)instanceObj).MaxValue; private static void SetMaxValue(ref object instanceObj, object valueObj) { IUIIntRangedValue uiIntRangedValue = (IUIIntRangedValue)instanceObj; int num = (int)valueObj; - if ((double)num < (double)uiIntRangedValue.MinValue) - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)num, (object)"MaxValue"); + if (num < (double)uiIntRangedValue.MinValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MaxValue"); else - uiIntRangedValue.MaxValue = (float)num; + uiIntRangedValue.MaxValue = num; } - private static object GetStep(object instanceObj) => (object)(int)((IUIRangedValue)instanceObj).Step; + private static object GetStep(object instanceObj) => (int)((IUIRangedValue)instanceObj).Step; - private static void SetStep(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Step = (float)(int)valueObj; + private static void SetStep(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Step = (int)valueObj; - private static object GetValue(object instanceObj) => (object)(int)((IUIRangedValue)instanceObj).Value; + private static object GetValue(object instanceObj) => (int)((IUIRangedValue)instanceObj).Value; - private static void SetValue(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Value = (float)(int)valueObj; + private static void SetValue(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Value = (int)valueObj; - private static object Construct() => (object)new Microsoft.Iris.ModelItems.IntRangedValue(); + private static object Construct() => new Microsoft.Iris.ModelItems.IntRangedValue(); - public static void Pass1Initialize() => IntRangedValueSchema.Type = new UIXTypeSchema((short)117, "IntRangedValue", (string)null, (short)168, typeof(IUIIntRangedValue), UIXTypeFlags.None); + public static void Pass1Initialize() => IntRangedValueSchema.Type = new UIXTypeSchema(117, "IntRangedValue", null, 168, typeof(IUIIntRangedValue), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)117, "MinValue", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(IntRangedValueSchema.GetMinValue), new SetValueHandler(IntRangedValueSchema.SetMinValue), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)117, "MaxValue", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(IntRangedValueSchema.GetMaxValue), new SetValueHandler(IntRangedValueSchema.SetMaxValue), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)117, "Step", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(IntRangedValueSchema.GetStep), new SetValueHandler(IntRangedValueSchema.SetStep), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)117, "Value", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(IntRangedValueSchema.GetValue), new SetValueHandler(IntRangedValueSchema.SetValue), false); - IntRangedValueSchema.Type.Initialize(new DefaultConstructHandler(IntRangedValueSchema.Construct), (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(117, "MinValue", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(IntRangedValueSchema.GetMinValue), new SetValueHandler(IntRangedValueSchema.SetMinValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(117, "MaxValue", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(IntRangedValueSchema.GetMaxValue), new SetValueHandler(IntRangedValueSchema.SetMaxValue), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(117, "Step", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(IntRangedValueSchema.GetStep), new SetValueHandler(IntRangedValueSchema.SetStep), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(117, "Value", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(IntRangedValueSchema.GetValue), new SetValueHandler(IntRangedValueSchema.SetValue), false); + IntRangedValueSchema.Type.Initialize(new DefaultConstructHandler(IntRangedValueSchema.Construct), null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema4 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementInstanceSchema.cs index dff9527..c13d8a5 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementInstanceSchema.cs @@ -31,25 +31,25 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Value, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => InterpolateElementInstanceSchema.Type = new UIXTypeSchema((short)120, "InterpolateElementInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => InterpolateElementInstanceSchema.Type = new UIXTypeSchema(120, "InterpolateElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)120, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, (GetValueHandler)null, new SetValueHandler(InterpolateElementInstanceSchema.SetValue), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)120, "PlayValueAnimation", new short[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(120, "Value", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, null, new SetValueHandler(InterpolateElementInstanceSchema.SetValue), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(120, "PlayValueAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(InterpolateElementInstanceSchema.CallPlayValueAnimationEffectFloatAnimation), false); - InterpolateElementInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + 75 + }, 240, new InvokeHandler(InterpolateElementInstanceSchema.CallPlayValueAnimationEffectFloatAnimation), false); + InterpolateElementInstanceSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementSchema.cs index 925c058..8e778b2 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementSchema.cs @@ -14,15 +14,15 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetInput1(object instanceObj) => (object)((InterpolateElement)instanceObj).Input1; + private static object GetInput1(object instanceObj) => ((InterpolateElement)instanceObj).Input1; private static void SetInput1(ref object instanceObj, object valueObj) => ((InterpolateElement)instanceObj).Input1 = (EffectInput)valueObj; - private static object GetInput2(object instanceObj) => (object)((InterpolateElement)instanceObj).Input2; + private static object GetInput2(object instanceObj) => ((InterpolateElement)instanceObj).Input2; private static void SetInput2(ref object instanceObj, object valueObj) => ((InterpolateElement)instanceObj).Input2 = (EffectInput)valueObj; - private static object GetValue(object instanceObj) => (object)((InterpolateElement)instanceObj).Value; + private static object GetValue(object instanceObj) => ((InterpolateElement)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) { @@ -35,21 +35,21 @@ namespace Microsoft.Iris.Markup.UIX interpolateElement.Value = num; } - private static object Construct() => (object)new InterpolateElement(); + private static object Construct() => new InterpolateElement(); - public static void Pass1Initialize() => InterpolateElementSchema.Type = new UIXTypeSchema((short)119, "InterpolateElement", (string)null, (short)77, typeof(InterpolateElement), UIXTypeFlags.None); + public static void Pass1Initialize() => InterpolateElementSchema.Type = new UIXTypeSchema(119, "InterpolateElement", null, 77, typeof(InterpolateElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)119, "Input1", (short)77, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InterpolateElementSchema.GetInput1), new SetValueHandler(InterpolateElementSchema.SetInput1), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)119, "Input2", (short)77, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InterpolateElementSchema.GetInput2), new SetValueHandler(InterpolateElementSchema.SetInput2), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)119, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(InterpolateElementSchema.GetValue), new SetValueHandler(InterpolateElementSchema.SetValue), false); - InterpolateElementSchema.Type.Initialize(new DefaultConstructHandler(InterpolateElementSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(119, "Input1", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InterpolateElementSchema.GetInput1), new SetValueHandler(InterpolateElementSchema.SetInput1), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(119, "Input2", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InterpolateElementSchema.GetInput2), new SetValueHandler(InterpolateElementSchema.SetInput2), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(119, "Value", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(InterpolateElementSchema.GetValue), new SetValueHandler(InterpolateElementSchema.SetValue), false); + InterpolateElementSchema.Type.Initialize(new DefaultConstructHandler(InterpolateElementSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/InterpolationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InterpolationSchema.cs index 6f91008..4858a1c 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/InterpolationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/InterpolationSchema.cs @@ -15,11 +15,11 @@ namespace Microsoft.Iris.Markup.UIX public static RangeValidator ValidateEasePercent = new RangeValidator(InterpolationSchema.RangeValidateEasePercent); public static UIXTypeSchema Type; - private static object GetType(object instanceObj) => (object)((Interpolation)instanceObj).Type; + private static object GetType(object instanceObj) => ((Interpolation)instanceObj).Type; private static void SetType(ref object instanceObj, object valueObj) => ((Interpolation)instanceObj).Type = (InterpolationType)valueObj; - private static object GetWeight(object instanceObj) => (object)((Interpolation)instanceObj).Weight; + private static object GetWeight(object instanceObj) => ((Interpolation)instanceObj).Weight; private static void SetWeight(ref object instanceObj, object valueObj) { @@ -32,15 +32,15 @@ namespace Microsoft.Iris.Markup.UIX interpolation.Weight = num; } - private static object GetBezierHandle1(object instanceObj) => (object)((Interpolation)instanceObj).BezierHandle1; + private static object GetBezierHandle1(object instanceObj) => ((Interpolation)instanceObj).BezierHandle1; private static void SetBezierHandle1(ref object instanceObj, object valueObj) => ((Interpolation)instanceObj).BezierHandle1 = (float)valueObj; - private static object GetBezierHandle2(object instanceObj) => (object)((Interpolation)instanceObj).BezierHandle2; + private static object GetBezierHandle2(object instanceObj) => ((Interpolation)instanceObj).BezierHandle2; private static void SetBezierHandle2(ref object instanceObj, object valueObj) => ((Interpolation)instanceObj).BezierHandle2 = (float)valueObj; - private static object GetEasePercent(object instanceObj) => (object)((Interpolation)instanceObj).EasePercent; + private static object GetEasePercent(object instanceObj) => ((Interpolation)instanceObj).EasePercent; private static void SetEasePercent(ref object instanceObj, object valueObj) { @@ -53,7 +53,7 @@ namespace Microsoft.Iris.Markup.UIX interpolation.EasePercent = num; } - private static object Construct() => (object)new Interpolation(); + private static object Construct() => new Interpolation(); private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) { @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteSingle(interpolation.EasePercent); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new Interpolation() + private static object DecodeBinary(ByteCodeReader reader) => new Interpolation() { Type = (InterpolationType)reader.ReadInt32(), Weight = reader.ReadSingle(), @@ -77,23 +77,23 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; string[] strArray = str.Split(','); if (strArray.Length < 1) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"Interpolation"); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Interpolation"); Interpolation interpolation = new Interpolation(); - instanceObj = (object)interpolation; + instanceObj = interpolation; object valueObj1; - Result result = UIXLoadResult.ValidateStringAsValue(strArray[0], UIXLoadResultExports.InterpolationTypeType, (RangeValidator)null, out valueObj1); + Result result = UIXLoadResult.ValidateStringAsValue(strArray[0], UIXLoadResultExports.InterpolationTypeType, null, out valueObj1); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Interpolation", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); InterpolationSchema.SetType(ref instanceObj, valueObj1); if (strArray.Length == 2) { object valueObj2; - result = UIXLoadResult.ValidateStringAsValue(strArray[1], (TypeSchema)SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + result = UIXLoadResult.ValidateStringAsValue(strArray[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Interpolation", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); InterpolationSchema.SetWeight(ref instanceObj, valueObj2); } else if (strArray.Length == 3) @@ -101,33 +101,33 @@ namespace Microsoft.Iris.Markup.UIX if (interpolation.Type == InterpolationType.Bezier) { object valueObj2; - result = UIXLoadResult.ValidateStringAsValue(strArray[1], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj2); + result = UIXLoadResult.ValidateStringAsValue(strArray[1], SingleSchema.Type, null, out valueObj2); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Interpolation", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); InterpolationSchema.SetBezierHandle1(ref instanceObj, valueObj2); object valueObj3; - result = UIXLoadResult.ValidateStringAsValue(strArray[2], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj3); + result = UIXLoadResult.ValidateStringAsValue(strArray[2], SingleSchema.Type, null, out valueObj3); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Interpolation", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); InterpolationSchema.SetBezierHandle2(ref instanceObj, valueObj3); } else { object valueObj2; - result = UIXLoadResult.ValidateStringAsValue(strArray[1], (TypeSchema)SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + result = UIXLoadResult.ValidateStringAsValue(strArray[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Interpolation", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); InterpolationSchema.SetWeight(ref instanceObj, valueObj2); object valueObj3; - result = UIXLoadResult.ValidateStringAsValue(strArray[2], (TypeSchema)SingleSchema.Type, InterpolationSchema.ValidateEasePercent, out valueObj3); + result = UIXLoadResult.ValidateStringAsValue(strArray[2], SingleSchema.Type, InterpolationSchema.ValidateEasePercent, out valueObj3); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Interpolation", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); InterpolationSchema.SetEasePercent(ref instanceObj, valueObj3); } } else if (strArray.Length >= 4) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"Interpolation"); - instanceObj = (object)interpolation; + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Interpolation"); + instanceObj = interpolation; return Result.Success; } @@ -139,7 +139,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = InterpolationSchema.ConvertFromString(from, out instance); @@ -154,40 +154,40 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; Interpolation parameter2 = (Interpolation)parameters[1]; object instanceObj1; - return InterpolationSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return InterpolationSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } private static Result RangeValidateEasePercent(object value) { float num = (float)value; - return (double)num <= 0.0 || (double)num >= 1.0 ? Result.Fail("Expecting a value between {0} and {1} (exclusive), but got {2}", (object)"0.0", (object)"1.0", (object)num.ToString()) : Result.Success; + return num <= 0.0 || num >= 1.0 ? Result.Fail("Expecting a value between {0} and {1} (exclusive), but got {2}", "0.0", "1.0", num.ToString()) : Result.Success; } - public static void Pass1Initialize() => InterpolationSchema.Type = new UIXTypeSchema((short)121, "Interpolation", (string)null, (short)153, typeof(Interpolation), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => InterpolationSchema.Type = new UIXTypeSchema(121, "Interpolation", null, 153, typeof(Interpolation), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)121, "Type", (short)122, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InterpolationSchema.GetType), new SetValueHandler(InterpolationSchema.SetType), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)121, "Weight", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(InterpolationSchema.GetWeight), new SetValueHandler(InterpolationSchema.SetWeight), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)121, "BezierHandle1", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InterpolationSchema.GetBezierHandle1), new SetValueHandler(InterpolationSchema.SetBezierHandle1), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)121, "BezierHandle2", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(InterpolationSchema.GetBezierHandle2), new SetValueHandler(InterpolationSchema.SetBezierHandle2), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)121, "EasePercent", (short)194, (short)-1, ExpressionRestriction.None, false, InterpolationSchema.ValidateEasePercent, false, new GetValueHandler(InterpolationSchema.GetEasePercent), new SetValueHandler(InterpolationSchema.SetEasePercent), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)121, "TryParse", new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(121, "Type", 122, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InterpolationSchema.GetType), new SetValueHandler(InterpolationSchema.SetType), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(121, "Weight", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(InterpolationSchema.GetWeight), new SetValueHandler(InterpolationSchema.SetWeight), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(121, "BezierHandle1", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InterpolationSchema.GetBezierHandle1), new SetValueHandler(InterpolationSchema.SetBezierHandle1), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(121, "BezierHandle2", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(InterpolationSchema.GetBezierHandle2), new SetValueHandler(InterpolationSchema.SetBezierHandle2), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(121, "EasePercent", 194, -1, ExpressionRestriction.None, false, InterpolationSchema.ValidateEasePercent, false, new GetValueHandler(InterpolationSchema.GetEasePercent), new SetValueHandler(InterpolationSchema.SetEasePercent), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(121, "TryParse", new short[2] { - (short) 208, - (short) 121 - }, (short)121, new InvokeHandler(InterpolationSchema.CallTryParseStringInterpolation), true); - InterpolationSchema.Type.Initialize(new DefaultConstructHandler(InterpolationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[5] + 208, + 121 + }, 121, new InvokeHandler(InterpolationSchema.CallTryParseStringInterpolation), true); + InterpolationSchema.Type.Initialize(new DefaultConstructHandler(InterpolationSchema.Construct), null, new PropertySchema[5] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(InterpolationSchema.TryConvertFrom), new SupportsTypeConversionHandler(InterpolationSchema.IsConversionSupported), new EncodeBinaryHandler(InterpolationSchema.EncodeBinary), new DecodeBinaryHandler(InterpolationSchema.DecodeBinary), (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, new TypeConverterHandler(InterpolationSchema.TryConvertFrom), new SupportsTypeConversionHandler(InterpolationSchema.IsConversionSupported), new EncodeBinaryHandler(InterpolationSchema.EncodeBinary), new DecodeBinaryHandler(InterpolationSchema.DecodeBinary), null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/InvAlphaSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InvAlphaSchema.cs index 515d493..cf55912 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/InvAlphaSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/InvAlphaSchema.cs @@ -12,10 +12,10 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)new InvAlphaElement(); + private static object Construct() => new InvAlphaElement(); - public static void Pass1Initialize() => InvAlphaSchema.Type = new UIXTypeSchema((short)123, "InvAlpha", (string)null, (short)80, typeof(InvAlphaElement), UIXTypeFlags.None); + public static void Pass1Initialize() => InvAlphaSchema.Type = new UIXTypeSchema(123, "InvAlpha", null, 80, typeof(InvAlphaElement), UIXTypeFlags.None); - public static void Pass2Initialize() => InvAlphaSchema.Type.Initialize(new DefaultConstructHandler(InvAlphaSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => InvAlphaSchema.Type.Initialize(new DefaultConstructHandler(InvAlphaSchema.Construct), null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/InvColorSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InvColorSchema.cs index c1ea82e..4b49d63 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/InvColorSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/InvColorSchema.cs @@ -12,10 +12,10 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)new InvColorElement(); + private static object Construct() => new InvColorElement(); - public static void Pass1Initialize() => InvColorSchema.Type = new UIXTypeSchema((short)124, "InvColor", (string)null, (short)80, typeof(InvColorElement), UIXTypeFlags.None); + public static void Pass1Initialize() => InvColorSchema.Type = new UIXTypeSchema(124, "InvColor", null, 80, typeof(InvColorElement), UIXTypeFlags.None); - public static void Pass2Initialize() => InvColorSchema.Type.Initialize(new DefaultConstructHandler(InvColorSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => InvColorSchema.Type.Initialize(new DefaultConstructHandler(InvColorSchema.Construct), null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/InvertSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InvertSchema.cs index 9db25db..67ef829 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/InvertSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/InvertSchema.cs @@ -12,10 +12,10 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)new InvertElement(); + private static object Construct() => new InvertElement(); - public static void Pass1Initialize() => InvertSchema.Type = new UIXTypeSchema((short)125, "Invert", (string)null, (short)80, typeof(InvertElement), UIXTypeFlags.None); + public static void Pass1Initialize() => InvertSchema.Type = new UIXTypeSchema(125, "Invert", null, 80, typeof(InvertElement), UIXTypeFlags.None); - public static void Pass2Initialize() => InvertSchema.Type.Initialize(new DefaultConstructHandler(InvertSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => InvertSchema.Type.Initialize(new DefaultConstructHandler(InvertSchema.Construct), null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ItemAlignmentSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ItemAlignmentSchema.cs index 5c0d2a0..6482ef9 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ItemAlignmentSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ItemAlignmentSchema.cs @@ -13,35 +13,35 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetHorizontal(object instanceObj) => (object)((ItemAlignment)instanceObj).Horizontal; + private static object GetHorizontal(object instanceObj) => ((ItemAlignment)instanceObj).Horizontal; private static void SetHorizontal(ref object instanceObj, object valueObj) { ItemAlignment itemAlignment = (ItemAlignment)instanceObj; Alignment alignment = (Alignment)valueObj; itemAlignment.Horizontal = alignment; - instanceObj = (object)itemAlignment; + instanceObj = itemAlignment; } - private static object GetVertical(object instanceObj) => (object)((ItemAlignment)instanceObj).Vertical; + private static object GetVertical(object instanceObj) => ((ItemAlignment)instanceObj).Vertical; private static void SetVertical(ref object instanceObj, object valueObj) { ItemAlignment itemAlignment = (ItemAlignment)instanceObj; Alignment alignment = (Alignment)valueObj; itemAlignment.Vertical = alignment; - instanceObj = (object)itemAlignment; + instanceObj = itemAlignment; } - private static object Construct() => (object)ItemAlignment.Default; + private static object Construct() => ItemAlignment.Default; private static object ConstructAlignment(object[] parameters) { Alignment parameter = (Alignment)parameters[0]; - return (object)new ItemAlignment(parameter, parameter); + return new ItemAlignment(parameter, parameter); } - private static object ConstructAlignmentAlignment(object[] parameters) => (object)new ItemAlignment((Alignment)parameters[0], (Alignment)parameters[1]); + private static object ConstructAlignmentAlignment(object[] parameters) => new ItemAlignment((Alignment)parameters[0], (Alignment)parameters[1]); private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) { @@ -50,19 +50,19 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteByte((byte)itemAlignment.Vertical); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new ItemAlignment((Alignment)reader.ReadByte(), (Alignment)reader.ReadByte()); + private static object DecodeBinary(ByteCodeReader reader) => new ItemAlignment((Alignment)reader.ReadByte(), (Alignment)reader.ReadByte()); private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; Alignment alignment1; Alignment alignment2; if (str.IndexOf(',') >= 0) { string[] strArray = str.Split(','); if (strArray.Length != 2) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"ItemAlignment"); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "ItemAlignment"); Result alignment3 = ItemAlignmentSchema.ParseAlignment(strArray[0], out alignment1); if (alignment3.Failed) return alignment3; @@ -78,7 +78,7 @@ namespace Microsoft.Iris.Markup.UIX alignment2 = alignment1; } ItemAlignment itemAlignment = new ItemAlignment(alignment1, alignment2); - instanceObj = (object)itemAlignment; + instanceObj = itemAlignment; return Result.Success; } @@ -90,7 +90,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = ItemAlignmentSchema.ConvertFromString(from, out instance); @@ -105,7 +105,7 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; ItemAlignment parameter2 = (ItemAlignment)parameters[1]; object instanceObj1; - return ItemAlignmentSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return ItemAlignmentSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } private static Result ParseAlignment(string value, out Alignment alignment) @@ -115,46 +115,46 @@ namespace Microsoft.Iris.Markup.UIX if (value != "-") { object instance; - Result result = UIXLoadResultExports.AlignmentType.TypeConverter((object)value, (TypeSchema)StringSchema.Type, out instance); + Result result = UIXLoadResultExports.AlignmentType.TypeConverter(value, StringSchema.Type, out instance); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"ItemAlignment", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "ItemAlignment", result.Error); alignment = (Alignment)instance; } return Result.Success; } - public static void Pass1Initialize() => ItemAlignmentSchema.Type = new UIXTypeSchema((short)sbyte.MaxValue, "ItemAlignment", (string)null, (short)153, typeof(ItemAlignment), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => ItemAlignmentSchema.Type = new UIXTypeSchema(sbyte.MaxValue, "ItemAlignment", null, 153, typeof(ItemAlignment), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)sbyte.MaxValue, "Horizontal", (short)3, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ItemAlignmentSchema.GetHorizontal), new SetValueHandler(ItemAlignmentSchema.SetHorizontal), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)sbyte.MaxValue, "Vertical", (short)3, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ItemAlignmentSchema.GetVertical), new SetValueHandler(ItemAlignmentSchema.SetVertical), false); - UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema((short)sbyte.MaxValue, new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(sbyte.MaxValue, "Horizontal", 3, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ItemAlignmentSchema.GetHorizontal), new SetValueHandler(ItemAlignmentSchema.SetHorizontal), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(sbyte.MaxValue, "Vertical", 3, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ItemAlignmentSchema.GetVertical), new SetValueHandler(ItemAlignmentSchema.SetVertical), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(sbyte.MaxValue, new short[1] { - (short) 3 + 3 }, new ConstructHandler(ItemAlignmentSchema.ConstructAlignment)); - UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema((short)sbyte.MaxValue, new short[2] + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(sbyte.MaxValue, new short[2] { - (short) 3, - (short) 3 + 3, + 3 }, new ConstructHandler(ItemAlignmentSchema.ConstructAlignmentAlignment)); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)sbyte.MaxValue, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(sbyte.MaxValue, "TryParse", new short[2] { - (short) 208, - (short) sbyte.MaxValue - }, (short)sbyte.MaxValue, new InvokeHandler(ItemAlignmentSchema.CallTryParseStringItemAlignment), true); + 208, + sbyte.MaxValue + }, sbyte.MaxValue, new InvokeHandler(ItemAlignmentSchema.CallTryParseStringItemAlignment), true); ItemAlignmentSchema.Type.Initialize(new DefaultConstructHandler(ItemAlignmentSchema.Construct), new ConstructorSchema[2] { - (ConstructorSchema) constructorSchema1, - (ConstructorSchema) constructorSchema2 + constructorSchema1, + constructorSchema2 }, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(ItemAlignmentSchema.TryConvertFrom), new SupportsTypeConversionHandler(ItemAlignmentSchema.IsConversionSupported), new EncodeBinaryHandler(ItemAlignmentSchema.EncodeBinary), new DecodeBinaryHandler(ItemAlignmentSchema.DecodeBinary), (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, new TypeConverterHandler(ItemAlignmentSchema.TryConvertFrom), new SupportsTypeConversionHandler(ItemAlignmentSchema.IsConversionSupported), new EncodeBinaryHandler(ItemAlignmentSchema.EncodeBinary), new DecodeBinaryHandler(ItemAlignmentSchema.DecodeBinary), null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/KeyHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/KeyHandlerSchema.cs index 6758147..3723823 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/KeyHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/KeyHandlerSchema.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetCommand(object instanceObj) => (object)((KeyHandler)instanceObj).Command; + private static object GetCommand(object instanceObj) => ((KeyHandler)instanceObj).Command; private static void SetCommand(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).Command = (IUICommand)valueObj; @@ -28,19 +28,19 @@ namespace Microsoft.Iris.Markup.UIX private static void SetStopRoute(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).StopRoute = (bool)valueObj; - private static object GetKey(object instanceObj) => (object)((KeyHandler)instanceObj).Key; + private static object GetKey(object instanceObj) => ((KeyHandler)instanceObj).Key; private static void SetKey(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).Key = (KeyHandlerKey)valueObj; - private static object GetHandlerTransition(object instanceObj) => (object)((ModifierInputHandler)instanceObj).HandlerTransition; + private static object GetHandlerTransition(object instanceObj) => ((ModifierInputHandler)instanceObj).HandlerTransition; private static void SetHandlerTransition(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).HandlerTransition = (InputHandlerTransition)valueObj; - private static object GetRequiredModifiers(object instanceObj) => (object)((ModifierInputHandler)instanceObj).RequiredModifiers; + private static object GetRequiredModifiers(object instanceObj) => ((ModifierInputHandler)instanceObj).RequiredModifiers; private static void SetRequiredModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).RequiredModifiers = (InputHandlerModifiers)valueObj; - private static object GetDisallowedModifiers(object instanceObj) => (object)((ModifierInputHandler)instanceObj).DisallowedModifiers; + private static object GetDisallowedModifiers(object instanceObj) => ((ModifierInputHandler)instanceObj).DisallowedModifiers; private static void SetDisallowedModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).DisallowedModifiers = (InputHandlerModifiers)valueObj; @@ -54,20 +54,20 @@ namespace Microsoft.Iris.Markup.UIX private static void SetTrackInvokedKeys(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).TrackInvokedKeys = (bool)valueObj; - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; private static object GetEventContext(object instanceObj) => ((KeyHandler)instanceObj).EventContext; - private static object Construct() => (object)new KeyHandler(); + private static object Construct() => new KeyHandler(); private static object CallGetInvokedKeys(object instanceObj, object[] parameters) { KeyHandler keyHandler = (KeyHandler)instanceObj; ArrayList arrayList = new ArrayList(); - keyHandler.GetInvokedKeys((IList)arrayList); - return (object)arrayList; + keyHandler.GetInvokedKeys(arrayList); + return arrayList; } private static object CallGetInvokedKeysList(object instanceObj, object[] parameters) @@ -77,51 +77,51 @@ namespace Microsoft.Iris.Markup.UIX if (parameter != null) keyHandler.GetInvokedKeys(parameter); else - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"copyTo"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "copyTo"); + return null; } - public static void Pass1Initialize() => KeyHandlerSchema.Type = new UIXTypeSchema((short)128, "KeyHandler", (string)null, (short)110, typeof(KeyHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => KeyHandlerSchema.Type = new UIXTypeSchema(128, "KeyHandler", null, 110, typeof(KeyHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)128, "Command", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetCommand), new SetValueHandler(KeyHandlerSchema.SetCommand), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)128, "Handle", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetHandle), new SetValueHandler(KeyHandlerSchema.SetHandle), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)128, "StopRoute", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetStopRoute), new SetValueHandler(KeyHandlerSchema.SetStopRoute), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)128, "Key", (short)129, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetKey), new SetValueHandler(KeyHandlerSchema.SetKey), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)128, "HandlerTransition", (short)113, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetHandlerTransition), new SetValueHandler(KeyHandlerSchema.SetHandlerTransition), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)128, "RequiredModifiers", (short)111, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetRequiredModifiers), new SetValueHandler(KeyHandlerSchema.SetRequiredModifiers), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)128, "DisallowedModifiers", (short)111, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetDisallowedModifiers), new SetValueHandler(KeyHandlerSchema.SetDisallowedModifiers), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)128, "Pressing", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetPressing), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)128, "Repeat", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetRepeat), new SetValueHandler(KeyHandlerSchema.SetRepeat), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)128, "TrackInvokedKeys", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetTrackInvokedKeys), new SetValueHandler(KeyHandlerSchema.SetTrackInvokedKeys), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)128, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetHandlerStage), new SetValueHandler(KeyHandlerSchema.SetHandlerStage), false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)128, "EventContext", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(KeyHandlerSchema.GetEventContext), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)128, "GetInvokedKeys", (short[])null, (short)138, new InvokeHandler(KeyHandlerSchema.CallGetInvokedKeys), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)128, "GetInvokedKeys", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(128, "Command", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetCommand), new SetValueHandler(KeyHandlerSchema.SetCommand), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(128, "Handle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetHandle), new SetValueHandler(KeyHandlerSchema.SetHandle), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(128, "StopRoute", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetStopRoute), new SetValueHandler(KeyHandlerSchema.SetStopRoute), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(128, "Key", 129, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetKey), new SetValueHandler(KeyHandlerSchema.SetKey), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(128, "HandlerTransition", 113, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetHandlerTransition), new SetValueHandler(KeyHandlerSchema.SetHandlerTransition), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(128, "RequiredModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetRequiredModifiers), new SetValueHandler(KeyHandlerSchema.SetRequiredModifiers), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(128, "DisallowedModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetDisallowedModifiers), new SetValueHandler(KeyHandlerSchema.SetDisallowedModifiers), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(128, "Pressing", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetPressing), null, false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(128, "Repeat", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetRepeat), new SetValueHandler(KeyHandlerSchema.SetRepeat), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(128, "TrackInvokedKeys", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetTrackInvokedKeys), new SetValueHandler(KeyHandlerSchema.SetTrackInvokedKeys), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(128, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetHandlerStage), new SetValueHandler(KeyHandlerSchema.SetHandlerStage), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(128, "EventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(KeyHandlerSchema.GetEventContext), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(128, "GetInvokedKeys", null, 138, new InvokeHandler(KeyHandlerSchema.CallGetInvokedKeys), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(128, "GetInvokedKeys", new short[1] { - (short) 138 - }, (short)240, new InvokeHandler(KeyHandlerSchema.CallGetInvokedKeysList), false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)128, "Invoked"); - KeyHandlerSchema.Type.Initialize(new DefaultConstructHandler(KeyHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[12] + 138 + }, 240, new InvokeHandler(KeyHandlerSchema.CallGetInvokedKeysList), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(128, "Invoked"); + KeyHandlerSchema.Type.Initialize(new DefaultConstructHandler(KeyHandlerSchema.Construct), null, new PropertySchema[12] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema10 + uixPropertySchema1, + uixPropertySchema7, + uixPropertySchema12, + uixPropertySchema2, + uixPropertySchema11, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema9, + uixPropertySchema6, + uixPropertySchema3, + uixPropertySchema10 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, new EventSchema[1] { (EventSchema)uixEventSchema }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2 + }, new EventSchema[1] { uixEventSchema }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/KeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/KeyframeSchema.cs index 544849a..b085569 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/KeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/KeyframeSchema.cs @@ -12,31 +12,31 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetTime(object instanceObj) => (object)((BaseKeyframe)instanceObj).Time; + private static object GetTime(object instanceObj) => ((BaseKeyframe)instanceObj).Time; private static void SetTime(ref object instanceObj, object valueObj) => ((BaseKeyframe)instanceObj).Time = (float)valueObj; - private static object GetRelativeTo(object instanceObj) => (object)((BaseKeyframe)instanceObj).RelativeTo; + private static object GetRelativeTo(object instanceObj) => ((BaseKeyframe)instanceObj).RelativeTo; private static void SetRelativeTo(ref object instanceObj, object valueObj) => ((BaseKeyframe)instanceObj).RelativeTo = (RelativeTo)valueObj; - private static object GetInterpolation(object instanceObj) => (object)((BaseKeyframe)instanceObj).Interpolation; + private static object GetInterpolation(object instanceObj) => ((BaseKeyframe)instanceObj).Interpolation; private static void SetInterpolation(ref object instanceObj, object valueObj) => ((BaseKeyframe)instanceObj).Interpolation = (Interpolation)valueObj; - public static void Pass1Initialize() => KeyframeSchema.Type = new UIXTypeSchema((short)130, "Keyframe", (string)null, (short)153, typeof(BaseKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => KeyframeSchema.Type = new UIXTypeSchema(130, "Keyframe", null, 153, typeof(BaseKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)130, "Time", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(KeyframeSchema.GetTime), new SetValueHandler(KeyframeSchema.SetTime), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)130, "RelativeTo", (short)171, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(KeyframeSchema.GetRelativeTo), new SetValueHandler(KeyframeSchema.SetRelativeTo), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)130, "Interpolation", (short)121, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(KeyframeSchema.GetInterpolation), new SetValueHandler(KeyframeSchema.SetInterpolation), false); - KeyframeSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(130, "Time", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(KeyframeSchema.GetTime), new SetValueHandler(KeyframeSchema.SetTime), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(130, "RelativeTo", 171, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(KeyframeSchema.GetRelativeTo), new SetValueHandler(KeyframeSchema.SetRelativeTo), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(130, "Interpolation", 121, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(KeyframeSchema.GetInterpolation), new SetValueHandler(KeyframeSchema.SetInterpolation), false); + KeyframeSchema.Type.Initialize(null, null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/LayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/LayoutInputSchema.cs index 01cabee..7449ffa 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/LayoutInputSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/LayoutInputSchema.cs @@ -12,8 +12,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => LayoutInputSchema.Type = new UIXTypeSchema((short)133, "LayoutInput", (string)null, (short)153, typeof(ILayoutInput), UIXTypeFlags.None); + public static void Pass1Initialize() => LayoutInputSchema.Type = new UIXTypeSchema(133, "LayoutInput", null, 153, typeof(ILayoutInput), UIXTypeFlags.None); - public static void Pass2Initialize() => LayoutInputSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => LayoutInputSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/LayoutOutputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/LayoutOutputSchema.cs index 32a5c68..a829eaf 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/LayoutOutputSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/LayoutOutputSchema.cs @@ -12,17 +12,17 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetSize(object instanceObj) => (object)((LayoutOutput)instanceObj).Size; + private static object GetSize(object instanceObj) => ((LayoutOutput)instanceObj).Size; - public static void Pass1Initialize() => LayoutOutputSchema.Type = new UIXTypeSchema((short)134, "LayoutOutput", (string)null, (short)153, typeof(LayoutOutput), UIXTypeFlags.None); + public static void Pass1Initialize() => LayoutOutputSchema.Type = new UIXTypeSchema(134, "LayoutOutput", null, 153, typeof(LayoutOutput), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)134, "Size", (short)195, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(LayoutOutputSchema.GetSize), (SetValueHandler)null, false); - LayoutOutputSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(134, "Size", 195, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(LayoutOutputSchema.GetSize), null, false); + LayoutOutputSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/LayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/LayoutSchema.cs index 84d9635..866738d 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/LayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/LayoutSchema.cs @@ -20,12 +20,12 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; object obj; if (!LayoutSchema.s_NameToLayoutMap.TryGetValue(str.ToLowerInvariant(), out obj)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"Layout"); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Layout"); ILayout layout = (ILayout)obj; - instanceObj = (object)layout; + instanceObj = layout; return Result.Success; } @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = LayoutSchema.ConvertFromString(from, out instance); @@ -52,46 +52,46 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; ILayout parameter2 = (ILayout)parameters[1]; object instanceObj1; - return LayoutSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return LayoutSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } static LayoutSchema() { - LayoutSchema.s_NameToLayoutMap.Add("anchor", (object)new AnchorLayout()); - LayoutSchema.s_NameToLayoutMap.Add("default", (object)DefaultLayout.Instance); - LayoutSchema.s_NameToLayoutMap.Add("dock", (object)new DockLayout()); - LayoutSchema.s_NameToLayoutMap.Add("grid", (object)new GridLayout()); - LayoutSchema.s_NameToLayoutMap.Add("scale", (object)new ScaleLayout()); - LayoutSchema.s_NameToLayoutMap.Add("popup", (object)new PopupLayout()); - LayoutSchema.s_NameToLayoutMap.Add("stack", (object)new StackLayout()); - LayoutSchema.s_NameToLayoutMap.Add("form", (object)new AnchorLayout() + LayoutSchema.s_NameToLayoutMap.Add("anchor", new AnchorLayout()); + LayoutSchema.s_NameToLayoutMap.Add("default", DefaultLayout.Instance); + LayoutSchema.s_NameToLayoutMap.Add("dock", new DockLayout()); + LayoutSchema.s_NameToLayoutMap.Add("grid", new GridLayout()); + LayoutSchema.s_NameToLayoutMap.Add("scale", new ScaleLayout()); + LayoutSchema.s_NameToLayoutMap.Add("popup", new PopupLayout()); + LayoutSchema.s_NameToLayoutMap.Add("stack", new StackLayout()); + LayoutSchema.s_NameToLayoutMap.Add("form", new AnchorLayout() { SizeToHorizontalChildren = false, SizeToVerticalChildren = false }); - LayoutSchema.s_NameToLayoutMap.Add("horizontalflow", (object)new FlowLayout() + LayoutSchema.s_NameToLayoutMap.Add("horizontalflow", new FlowLayout() { Orientation = Orientation.Horizontal }); - LayoutSchema.s_NameToLayoutMap.Add("verticalflow", (object)new FlowLayout() + LayoutSchema.s_NameToLayoutMap.Add("verticalflow", new FlowLayout() { Orientation = Orientation.Vertical }); } - public static void Pass1Initialize() => LayoutSchema.Type = new UIXTypeSchema((short)132, "Layout", (string)null, (short)153, typeof(ILayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => LayoutSchema.Type = new UIXTypeSchema(132, "Layout", null, 153, typeof(ILayout), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)132, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(132, "TryParse", new short[2] { - (short) 208, - (short) 132 - }, (short)132, new InvokeHandler(LayoutSchema.CallTryParseStringLayout), true); - LayoutSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[1] + 208, + 132 + }, 132, new InvokeHandler(LayoutSchema.CallTryParseStringLayout), true); + LayoutSchema.Type.Initialize(null, null, null, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(LayoutSchema.TryConvertFrom), new SupportsTypeConversionHandler(LayoutSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, new TypeConverterHandler(LayoutSchema.TryConvertFrom), new SupportsTypeConversionHandler(LayoutSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/LightShaftInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/LightShaftInstanceSchema.cs index aa29228..932273c 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/LightShaftInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/LightShaftInstanceSchema.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Position, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayDecayAnimationEffectFloatAnimation( @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Decay, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayDensityAnimationEffectFloatAnimation( @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Density, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayIntensityAnimationEffectFloatAnimation( @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Intensity, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayFallOffAnimationEffectFloatAnimation( @@ -63,7 +63,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.FallOff, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayWeightAnimationEffectFloatAnimation( @@ -71,60 +71,60 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Weight, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => LightShaftInstanceSchema.Type = new UIXTypeSchema((short)136, "LightShaftInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => LightShaftInstanceSchema.Type = new UIXTypeSchema(136, "LightShaftInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)136, "Position", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(LightShaftInstanceSchema.SetPosition), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)136, "Decay", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(LightShaftInstanceSchema.SetDecay), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)136, "Density", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(LightShaftInstanceSchema.SetDensity), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)136, "FallOff", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(LightShaftInstanceSchema.SetFallOff), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)136, "Intensity", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(LightShaftInstanceSchema.SetIntensity), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)136, "Weight", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(LightShaftInstanceSchema.SetWeight), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)136, "PlayPositionAnimation", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(136, "Position", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(LightShaftInstanceSchema.SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(136, "Decay", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(LightShaftInstanceSchema.SetDecay), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(136, "Density", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(LightShaftInstanceSchema.SetDensity), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(136, "FallOff", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(LightShaftInstanceSchema.SetFallOff), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(136, "Intensity", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(LightShaftInstanceSchema.SetIntensity), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(136, "Weight", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(LightShaftInstanceSchema.SetWeight), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(136, "PlayPositionAnimation", new short[1] { - (short) 81 - }, (short)240, new InvokeHandler(LightShaftInstanceSchema.CallPlayPositionAnimationEffectVector3Animation), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)136, "PlayDecayAnimation", new short[1] + 81 + }, 240, new InvokeHandler(LightShaftInstanceSchema.CallPlayPositionAnimationEffectVector3Animation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(136, "PlayDecayAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(LightShaftInstanceSchema.CallPlayDecayAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)136, "PlayDensityAnimation", new short[1] + 75 + }, 240, new InvokeHandler(LightShaftInstanceSchema.CallPlayDecayAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(136, "PlayDensityAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(LightShaftInstanceSchema.CallPlayDensityAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)136, "PlayIntensityAnimation", new short[1] + 75 + }, 240, new InvokeHandler(LightShaftInstanceSchema.CallPlayDensityAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(136, "PlayIntensityAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(LightShaftInstanceSchema.CallPlayIntensityAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)136, "PlayFallOffAnimation", new short[1] + 75 + }, 240, new InvokeHandler(LightShaftInstanceSchema.CallPlayIntensityAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(136, "PlayFallOffAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(LightShaftInstanceSchema.CallPlayFallOffAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)136, "PlayWeightAnimation", new short[1] + 75 + }, 240, new InvokeHandler(LightShaftInstanceSchema.CallPlayFallOffAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(136, "PlayWeightAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(LightShaftInstanceSchema.CallPlayWeightAnimationEffectFloatAnimation), false); - LightShaftInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[6] + 75 + }, 240, new InvokeHandler(LightShaftInstanceSchema.CallPlayWeightAnimationEffectFloatAnimation), false); + LightShaftInstanceSchema.Type.Initialize(null, null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema6 + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema6 }, new MethodSchema[6] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/LightShaftSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/LightShaftSchema.cs index fb768dd..43217da 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/LightShaftSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/LightShaftSchema.cs @@ -14,11 +14,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetPosition(object instanceObj) => (object)((LightShaftElement)instanceObj).Position; + private static object GetPosition(object instanceObj) => ((LightShaftElement)instanceObj).Position; private static void SetPosition(ref object instanceObj, object valueObj) => ((LightShaftElement)instanceObj).Position = (Vector3)valueObj; - private static object GetDecay(object instanceObj) => (object)((LightShaftElement)instanceObj).Decay; + private static object GetDecay(object instanceObj) => ((LightShaftElement)instanceObj).Decay; private static void SetDecay(ref object instanceObj, object valueObj) { @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Markup.UIX lightShaftElement.Decay = num; } - private static object GetDensity(object instanceObj) => (object)((LightShaftElement)instanceObj).Density; + private static object GetDensity(object instanceObj) => ((LightShaftElement)instanceObj).Density; private static void SetDensity(ref object instanceObj, object valueObj) { @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Markup.UIX lightShaftElement.Density = num; } - private static object GetIntensity(object instanceObj) => (object)((LightShaftElement)instanceObj).Intensity; + private static object GetIntensity(object instanceObj) => ((LightShaftElement)instanceObj).Intensity; private static void SetIntensity(ref object instanceObj, object valueObj) { @@ -57,7 +57,7 @@ namespace Microsoft.Iris.Markup.UIX lightShaftElement.Intensity = num; } - private static object GetFallOff(object instanceObj) => (object)((LightShaftElement)instanceObj).FallOff; + private static object GetFallOff(object instanceObj) => ((LightShaftElement)instanceObj).FallOff; private static void SetFallOff(ref object instanceObj, object valueObj) { @@ -70,7 +70,7 @@ namespace Microsoft.Iris.Markup.UIX lightShaftElement.FallOff = num; } - private static object GetWeight(object instanceObj) => (object)((LightShaftElement)instanceObj).Weight; + private static object GetWeight(object instanceObj) => ((LightShaftElement)instanceObj).Weight; private static void SetWeight(ref object instanceObj, object valueObj) { @@ -83,27 +83,27 @@ namespace Microsoft.Iris.Markup.UIX lightShaftElement.Weight = num; } - private static object Construct() => (object)new LightShaftElement(); + private static object Construct() => new LightShaftElement(); - public static void Pass1Initialize() => LightShaftSchema.Type = new UIXTypeSchema((short)135, "LightShaft", (string)null, (short)80, typeof(LightShaftElement), UIXTypeFlags.None); + public static void Pass1Initialize() => LightShaftSchema.Type = new UIXTypeSchema(135, "LightShaft", null, 80, typeof(LightShaftElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)135, "Position", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(LightShaftSchema.GetPosition), new SetValueHandler(LightShaftSchema.SetPosition), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)135, "Decay", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(LightShaftSchema.GetDecay), new SetValueHandler(LightShaftSchema.SetDecay), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)135, "Density", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(LightShaftSchema.GetDensity), new SetValueHandler(LightShaftSchema.SetDensity), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)135, "Intensity", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(LightShaftSchema.GetIntensity), new SetValueHandler(LightShaftSchema.SetIntensity), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)135, "FallOff", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(LightShaftSchema.GetFallOff), new SetValueHandler(LightShaftSchema.SetFallOff), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)135, "Weight", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(LightShaftSchema.GetWeight), new SetValueHandler(LightShaftSchema.SetWeight), false); - LightShaftSchema.Type.Initialize(new DefaultConstructHandler(LightShaftSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(135, "Position", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(LightShaftSchema.GetPosition), new SetValueHandler(LightShaftSchema.SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(135, "Decay", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(LightShaftSchema.GetDecay), new SetValueHandler(LightShaftSchema.SetDecay), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(135, "Density", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(LightShaftSchema.GetDensity), new SetValueHandler(LightShaftSchema.SetDensity), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(135, "Intensity", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(LightShaftSchema.GetIntensity), new SetValueHandler(LightShaftSchema.SetIntensity), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(135, "FallOff", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(LightShaftSchema.GetFallOff), new SetValueHandler(LightShaftSchema.SetFallOff), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(135, "Weight", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(LightShaftSchema.GetWeight), new SetValueHandler(LightShaftSchema.SetWeight), false); + LightShaftSchema.Type.Initialize(new DefaultConstructHandler(LightShaftSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema6 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema6 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ListSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ListSchema.cs index 0418399..f3817c3 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ListSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ListSchema.cs @@ -15,13 +15,13 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetCount(object instanceObj) => (object)((ICollection)instanceObj).Count; + private static object GetCount(object instanceObj) => ((ICollection)instanceObj).Count; - private static object GetSource(object instanceObj) => (object)(IList)instanceObj; + private static object GetSource(object instanceObj) => (IList)instanceObj; - private static object GetCanSearch(object instanceObj) => (IList)instanceObj is IUIList uiList ? (object)uiList.CanSearch : (object)false; + private static object GetCanSearch(object instanceObj) => (IList)instanceObj is IUIList uiList ? uiList.CanSearch : (object)false; - private static object Construct() => (object)new NotifyList(); + private static object Construct() => new NotifyList(); private static object CallIsNullOrEmptyList(object instanceObj, object[] parameters) { @@ -35,8 +35,8 @@ namespace Microsoft.Iris.Markup.UIX int parameter = (int)parameters[0]; if (parameter >= 0 && parameter < list.Count) return list[parameter]; - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter, (object)"index"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter, "index"); + return null; } private static object Callset_ItemInt32Object(object instanceObj, object[] parameters) @@ -46,34 +46,34 @@ namespace Microsoft.Iris.Markup.UIX object parameter2 = parameters[1]; if (parameter1 < 0 || parameter1 >= list.Count) { - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter1, (object)"index"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter1, "index"); + return null; } list[parameter1] = parameter2; - return (object)null; + return null; } private static object CallClear(object instanceObj, object[] parameters) { ((IList)instanceObj).Clear(); - return (object)null; + return null; } private static object CallAddObject(object instanceObj, object[] parameters) { ((IList)instanceObj).Add(parameters[0]); - return (object)null; + return null; } private static object CallRemoveObject(object instanceObj, object[] parameters) { ((IList)instanceObj).Remove(parameters[0]); - return (object)null; + return null; } - private static object CallContainsObject(object instanceObj, object[] parameters) => (object)((IList)instanceObj).Contains(parameters[0]); + private static object CallContainsObject(object instanceObj, object[] parameters) => ((IList)instanceObj).Contains(parameters[0]); - private static object CallIndexOfObject(object instanceObj, object[] parameters) => (object)((IList)instanceObj).IndexOf(parameters[0]); + private static object CallIndexOfObject(object instanceObj, object[] parameters) => ((IList)instanceObj).IndexOf(parameters[0]); private static object CallInsertInt32Object(object instanceObj, object[] parameters) { @@ -82,11 +82,11 @@ namespace Microsoft.Iris.Markup.UIX object parameter2 = parameters[1]; if (parameter1 < 0 || parameter1 > list.Count) { - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter1, (object)"index"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter1, "index"); + return null; } list.Insert(parameter1, parameter2); - return (object)null; + return null; } private static object CallRemoveAtInt32(object instanceObj, object[] parameters) @@ -95,18 +95,18 @@ namespace Microsoft.Iris.Markup.UIX int parameter = (int)parameters[0]; if (parameter < 0 || parameter >= list.Count) { - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter, (object)"index"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter, "index"); + return null; } list.RemoveAt(parameter); - return (object)null; + return null; } private static object CallSearchForStringString(object instanceObj, object[] parameters) { IList list = (IList)instanceObj; string parameter = (string)parameters[0]; - return list is IUIList uiList ? (object)uiList.SearchForString(parameter) : (object)-1; + return list is IUIList uiList ? uiList.SearchForString(parameter) : (object)-1; } private static object CallMoveInt32Int32(object instanceObj, object[] parameters) @@ -116,13 +116,13 @@ namespace Microsoft.Iris.Markup.UIX int parameter2 = (int)parameters[1]; if (parameter1 < 0 || parameter1 >= list.Count) { - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter1, (object)"oldIndex"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter1, "oldIndex"); + return null; } if (parameter2 < 0 || parameter2 >= list.Count) { - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter2, (object)"newIndex"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter2, "newIndex"); + return null; } switch (list) { @@ -138,88 +138,88 @@ namespace Microsoft.Iris.Markup.UIX list.Insert(parameter2, obj); break; } - return (object)null; + return null; } - private static object CallGetEnumerator(object instanceObj, object[] parameters) => (object)((IEnumerable)instanceObj).GetEnumerator(); + private static object CallGetEnumerator(object instanceObj, object[] parameters) => ((IEnumerable)instanceObj).GetEnumerator(); - public static void Pass1Initialize() => ListSchema.Type = new UIXTypeSchema((short)138, "List", (string)null, (short)153, typeof(IList), UIXTypeFlags.None); + public static void Pass1Initialize() => ListSchema.Type = new UIXTypeSchema(138, "List", null, 153, typeof(IList), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)138, "Count", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ListSchema.GetCount), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)138, "Source", (short)138, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ListSchema.GetSource), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)138, "CanSearch", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ListSchema.GetCanSearch), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)138, "IsNullOrEmpty", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(138, "Count", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ListSchema.GetCount), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(138, "Source", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ListSchema.GetSource), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(138, "CanSearch", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ListSchema.GetCanSearch), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(138, "IsNullOrEmpty", new short[1] { - (short) 138 - }, (short)15, new InvokeHandler(ListSchema.CallIsNullOrEmptyList), true); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)138, "get_Item", new short[1] + 138 + }, 15, new InvokeHandler(ListSchema.CallIsNullOrEmptyList), true); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(138, "get_Item", new short[1] { - (short) 115 - }, (short)153, new InvokeHandler(ListSchema.Callget_ItemInt32), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)138, "set_Item", new short[2] + 115 + }, 153, new InvokeHandler(ListSchema.Callget_ItemInt32), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(138, "set_Item", new short[2] { - (short) 115, - (short) 153 - }, (short)240, new InvokeHandler(ListSchema.Callset_ItemInt32Object), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)138, "Clear", (short[])null, (short)240, new InvokeHandler(ListSchema.CallClear), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)138, "Add", new short[1] + 115, + 153 + }, 240, new InvokeHandler(ListSchema.Callset_ItemInt32Object), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(138, "Clear", null, 240, new InvokeHandler(ListSchema.CallClear), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(138, "Add", new short[1] { - (short) 153 - }, (short)240, new InvokeHandler(ListSchema.CallAddObject), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)138, "Remove", new short[1] + 153 + }, 240, new InvokeHandler(ListSchema.CallAddObject), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(138, "Remove", new short[1] { - (short) 153 - }, (short)240, new InvokeHandler(ListSchema.CallRemoveObject), false); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)138, "Contains", new short[1] + 153 + }, 240, new InvokeHandler(ListSchema.CallRemoveObject), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(138, "Contains", new short[1] { - (short) 153 - }, (short)15, new InvokeHandler(ListSchema.CallContainsObject), false); - UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema((short)138, "IndexOf", new short[1] + 153 + }, 15, new InvokeHandler(ListSchema.CallContainsObject), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(138, "IndexOf", new short[1] { - (short) 153 - }, (short)115, new InvokeHandler(ListSchema.CallIndexOfObject), false); - UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema((short)138, "Insert", new short[2] + 153 + }, 115, new InvokeHandler(ListSchema.CallIndexOfObject), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(138, "Insert", new short[2] { - (short) 115, - (short) 153 - }, (short)240, new InvokeHandler(ListSchema.CallInsertInt32Object), false); - UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema((short)138, "RemoveAt", new short[1] + 115, + 153 + }, 240, new InvokeHandler(ListSchema.CallInsertInt32Object), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(138, "RemoveAt", new short[1] { - (short) 115 - }, (short)240, new InvokeHandler(ListSchema.CallRemoveAtInt32), false); - UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema((short)138, "SearchForString", new short[1] + 115 + }, 240, new InvokeHandler(ListSchema.CallRemoveAtInt32), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(138, "SearchForString", new short[1] { - (short) 208 - }, (short)115, new InvokeHandler(ListSchema.CallSearchForStringString), false); - UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema((short)138, "Move", new short[2] + 208 + }, 115, new InvokeHandler(ListSchema.CallSearchForStringString), false); + UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema(138, "Move", new short[2] { - (short) 115, - (short) 115 - }, (short)240, new InvokeHandler(ListSchema.CallMoveInt32Int32), false); - UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema((short)138, "GetEnumerator", (short[])null, (short)86, new InvokeHandler(ListSchema.CallGetEnumerator), false); - ListSchema.Type.Initialize(new DefaultConstructHandler(ListSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + 115, + 115 + }, 240, new InvokeHandler(ListSchema.CallMoveInt32Int32), false); + UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema(138, "GetEnumerator", null, 86, new InvokeHandler(ListSchema.CallGetEnumerator), false); + ListSchema.Type.Initialize(new DefaultConstructHandler(ListSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[13] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7, - (MethodSchema) uixMethodSchema8, - (MethodSchema) uixMethodSchema9, - (MethodSchema) uixMethodSchema10, - (MethodSchema) uixMethodSchema11, - (MethodSchema) uixMethodSchema12, - (MethodSchema) uixMethodSchema13 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8, + uixMethodSchema9, + uixMethodSchema10, + uixMethodSchema11, + uixMethodSchema12, + uixMethodSchema13 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MajorMinorSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MajorMinorSchema.cs index b68fd34..59ff67f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MajorMinorSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MajorMinorSchema.cs @@ -14,27 +14,27 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetMajor(object instanceObj) => (object)((MajorMinor)instanceObj).Major; + private static object GetMajor(object instanceObj) => ((MajorMinor)instanceObj).Major; private static void SetMajor(ref object instanceObj, object valueObj) { MajorMinor majorMinor = (MajorMinor)instanceObj; int num = (int)valueObj; majorMinor.Major = num; - instanceObj = (object)majorMinor; + instanceObj = majorMinor; } - private static object GetMinor(object instanceObj) => (object)((MajorMinor)instanceObj).Minor; + private static object GetMinor(object instanceObj) => ((MajorMinor)instanceObj).Minor; private static void SetMinor(ref object instanceObj, object valueObj) { MajorMinor majorMinor = (MajorMinor)instanceObj; int num = (int)valueObj; majorMinor.Minor = num; - instanceObj = (object)majorMinor; + instanceObj = majorMinor; } - private static object Construct() => (object)MajorMinor.Zero; + private static object Construct() => MajorMinor.Zero; private static object ConstructMajorMinor(object[] parameters) { @@ -50,14 +50,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = MajorMinorSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"MajorMinor", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "MajorMinor", result1.Error); MajorMinorSchema.SetMajor(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"MajorMinor", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "MajorMinor", result2.Error); MajorMinorSchema.SetMinor(ref instance, valueObj2); return result2; } @@ -69,7 +69,7 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteInt32(majorMinor.Minor); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new MajorMinor(reader.ReadInt32(), reader.ReadInt32()); + private static object DecodeBinary(ByteCodeReader reader) => new MajorMinor(reader.ReadInt32(), reader.ReadInt32()); private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -79,7 +79,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -90,30 +90,30 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"MajorMinor"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "MajorMinor"); } return result; } - public static void Pass1Initialize() => MajorMinorSchema.Type = new UIXTypeSchema((short)139, "MajorMinor", (string)null, (short)153, typeof(MajorMinor), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => MajorMinorSchema.Type = new UIXTypeSchema(139, "MajorMinor", null, 153, typeof(MajorMinor), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)139, "Major", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MajorMinorSchema.GetMajor), new SetValueHandler(MajorMinorSchema.SetMajor), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)139, "Minor", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MajorMinorSchema.GetMinor), new SetValueHandler(MajorMinorSchema.SetMinor), false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)139, new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(139, "Major", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MajorMinorSchema.GetMajor), new SetValueHandler(MajorMinorSchema.SetMajor), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(139, "Minor", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MajorMinorSchema.GetMinor), new SetValueHandler(MajorMinorSchema.SetMinor), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(139, new short[2] { - (short) 115, - (short) 115 + 115, + 115 }, new ConstructHandler(MajorMinorSchema.ConstructMajorMinor)); MajorMinorSchema.Type.Initialize(new DefaultConstructHandler(MajorMinorSchema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(MajorMinorSchema.TryConvertFrom), new SupportsTypeConversionHandler(MajorMinorSchema.IsConversionSupported), new EncodeBinaryHandler(MajorMinorSchema.EncodeBinary), new DecodeBinaryHandler(MajorMinorSchema.DecodeBinary), (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, new TypeConverterHandler(MajorMinorSchema.TryConvertFrom), new SupportsTypeConversionHandler(MajorMinorSchema.IsConversionSupported), new EncodeBinaryHandler(MajorMinorSchema.EncodeBinary), new DecodeBinaryHandler(MajorMinorSchema.DecodeBinary), null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MappingSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MappingSchema.cs index b340737..8c4c287 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MappingSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MappingSchema.cs @@ -28,21 +28,21 @@ namespace Microsoft.Iris.Markup.UIX private static object Construct() => new object(); - public static void Pass1Initialize() => MappingSchema.Type = new UIXTypeSchema((short)140, "Mapping", (string)null, (short)-1, typeof(object), UIXTypeFlags.None); + public static void Pass1Initialize() => MappingSchema.Type = new UIXTypeSchema(140, "Mapping", null, -1, typeof(object), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)140, "Property", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(MappingSchema.SetProperty), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)140, "Source", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(MappingSchema.SetSource), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)140, "Target", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(MappingSchema.SetTarget), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)140, "DefaultValue", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(MappingSchema.SetDefaultValue), false); - MappingSchema.Type.Initialize(new DefaultConstructHandler(MappingSchema.Construct), (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(140, "Property", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(MappingSchema.SetProperty), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(140, "Source", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(MappingSchema.SetSource), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(140, "Target", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(MappingSchema.SetTarget), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(140, "DefaultValue", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(MappingSchema.SetDefaultValue), false); + MappingSchema.Type.Initialize(new DefaultConstructHandler(MappingSchema.Construct), null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MarkupDataQueryInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MarkupDataQueryInstanceSchema.cs index c979f18..44e5930 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MarkupDataQueryInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MarkupDataQueryInstanceSchema.cs @@ -10,7 +10,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetStatus(object instanceObj) => (object)((MarkupDataQuery)instanceObj).Status; + private static object GetStatus(object instanceObj) => ((MarkupDataQuery)instanceObj).Status; private static object GetResult(object instanceObj) => ((MarkupDataQuery)instanceObj).Result; @@ -21,26 +21,26 @@ namespace Microsoft.Iris.Markup.UIX private static object CallRefresh(object instanceObj, object[] parameters) { ((MarkupDataQuery)instanceObj).Refresh(); - return (object)null; + return null; } - public static void Pass1Initialize() => MarkupDataQueryInstanceSchema.Type = new UIXTypeSchema((short)142, "MarkupDataQueryInstance", (string)null, (short)153, typeof(MarkupDataQuery), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => MarkupDataQueryInstanceSchema.Type = new UIXTypeSchema(142, "MarkupDataQueryInstance", null, 153, typeof(MarkupDataQuery), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)142, "Status", (short)47, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(MarkupDataQueryInstanceSchema.GetStatus), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)142, "Result", (short)143, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(MarkupDataQueryInstanceSchema.GetResult), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)142, "Enabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(MarkupDataQueryInstanceSchema.GetEnabled), new SetValueHandler(MarkupDataQueryInstanceSchema.SetEnabled), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)142, "Refresh", (short[])null, (short)240, new InvokeHandler(MarkupDataQueryInstanceSchema.CallRefresh), false); - MarkupDataQueryInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(142, "Status", 47, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(MarkupDataQueryInstanceSchema.GetStatus), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(142, "Result", 143, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(MarkupDataQueryInstanceSchema.GetResult), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(142, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(MarkupDataQueryInstanceSchema.GetEnabled), new SetValueHandler(MarkupDataQueryInstanceSchema.SetEnabled), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(142, "Refresh", null, 240, new InvokeHandler(MarkupDataQueryInstanceSchema.CallRefresh), false); + MarkupDataQueryInstanceSchema.Type.Initialize(null, null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MarkupDataTypeInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MarkupDataTypeInstanceSchema.cs index e7edc0b..b0564ce 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MarkupDataTypeInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MarkupDataTypeInstanceSchema.cs @@ -10,8 +10,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => MarkupDataTypeInstanceSchema.Type = new UIXTypeSchema((short)143, "MarkupDataTypeInstance", (string)null, (short)153, typeof(MarkupDataType), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => MarkupDataTypeInstanceSchema.Type = new UIXTypeSchema(143, "MarkupDataTypeInstance", null, 153, typeof(MarkupDataType), UIXTypeFlags.Disposable); - public static void Pass2Initialize() => MarkupDataTypeInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => MarkupDataTypeInstanceSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MarkupErrorSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MarkupErrorSchema.cs index 677ef44..041ced5 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MarkupErrorSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MarkupErrorSchema.cs @@ -10,37 +10,37 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetContext(object instanceObj) => (object)((MarkupError)instanceObj).Context; + private static object GetContext(object instanceObj) => ((MarkupError)instanceObj).Context; - private static object GetMessage(object instanceObj) => (object)((MarkupError)instanceObj).Message; + private static object GetMessage(object instanceObj) => ((MarkupError)instanceObj).Message; - private static object GetUri(object instanceObj) => (object)((MarkupError)instanceObj).Uri; + private static object GetUri(object instanceObj) => ((MarkupError)instanceObj).Uri; - private static object GetLine(object instanceObj) => (object)((MarkupError)instanceObj).Line; + private static object GetLine(object instanceObj) => ((MarkupError)instanceObj).Line; - private static object GetColumn(object instanceObj) => (object)((MarkupError)instanceObj).Column; + private static object GetColumn(object instanceObj) => ((MarkupError)instanceObj).Column; private static object GetIsError(object instanceObj) => BooleanBoxes.Box(((MarkupError)instanceObj).IsError); - public static void Pass1Initialize() => MarkupErrorSchema.Type = new UIXTypeSchema((short)144, "MarkupError", (string)null, (short)153, typeof(MarkupError), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => MarkupErrorSchema.Type = new UIXTypeSchema(144, "MarkupError", null, 153, typeof(MarkupError), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)144, "Context", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MarkupErrorSchema.GetContext), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)144, "Message", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MarkupErrorSchema.GetMessage), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)144, "Uri", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MarkupErrorSchema.GetUri), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)144, "Line", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MarkupErrorSchema.GetLine), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)144, "Column", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MarkupErrorSchema.GetColumn), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)144, "IsError", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MarkupErrorSchema.GetIsError), (SetValueHandler)null, false); - MarkupErrorSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[6] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(144, "Context", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MarkupErrorSchema.GetContext), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(144, "Message", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MarkupErrorSchema.GetMessage), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(144, "Uri", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MarkupErrorSchema.GetUri), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(144, "Line", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MarkupErrorSchema.GetLine), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(144, "Column", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MarkupErrorSchema.GetColumn), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(144, "IsError", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MarkupErrorSchema.GetIsError), null, false); + MarkupErrorSchema.Type.Initialize(null, null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema6, + uixPropertySchema4, + uixPropertySchema2, + uixPropertySchema3 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MarkupSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MarkupSchema.cs index 1fd18d5..6d3b7e8 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MarkupSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MarkupSchema.cs @@ -12,45 +12,45 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetErrors(object instanceObj) => (object)((MarkupServices)instanceObj).Errors; + private static object GetErrors(object instanceObj) => ((MarkupServices)instanceObj).Errors; private static object GetWarningsOnly(object instanceObj) => BooleanBoxes.Box(((MarkupServices)instanceObj).WarningsOnly); - private static object Construct() => (object)MarkupServices.Instance; + private static object Construct() => MarkupServices.Instance; private static object CallClearErrors(object instanceObj, object[] parameters) { ((MarkupServices)instanceObj).ClearErrors(); - return (object)null; + return null; } private static object CallIsDisposedObject(object instanceObj, object[] parameters) { object parameter = parameters[0]; - return parameter == null ? (object)true : BooleanBoxes.Box(parameter is IDisposableObject disposableObject && disposableObject.IsDisposed); + return parameter == null ? true : BooleanBoxes.Box(parameter is IDisposableObject disposableObject && disposableObject.IsDisposed); } - public static void Pass1Initialize() => MarkupSchema.Type = new UIXTypeSchema((short)141, "Markup", (string)null, (short)153, typeof(MarkupServices), UIXTypeFlags.None); + public static void Pass1Initialize() => MarkupSchema.Type = new UIXTypeSchema(141, "Markup", null, 153, typeof(MarkupServices), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)141, "Errors", (short)138, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MarkupSchema.GetErrors), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)141, "WarningsOnly", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MarkupSchema.GetWarningsOnly), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)141, "ClearErrors", (short[])null, (short)240, new InvokeHandler(MarkupSchema.CallClearErrors), false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)141, "ErrorsDetected"); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)141, "IsDisposed", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(141, "Errors", 138, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MarkupSchema.GetErrors), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(141, "WarningsOnly", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MarkupSchema.GetWarningsOnly), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(141, "ClearErrors", null, 240, new InvokeHandler(MarkupSchema.CallClearErrors), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(141, "ErrorsDetected"); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(141, "IsDisposed", new short[1] { - (short) 153 - }, (short)15, new InvokeHandler(MarkupSchema.CallIsDisposedObject), true); - MarkupSchema.Type.Initialize(new DefaultConstructHandler(MarkupSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + 153 + }, 15, new InvokeHandler(MarkupSchema.CallIsDisposedObject), true); + MarkupSchema.Type.Initialize(new DefaultConstructHandler(MarkupSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, new EventSchema[1] { (EventSchema)uixEventSchema }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2 + }, new EventSchema[1] { uixEventSchema }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MathSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MathSchema.cs index 4c43c47..d88e6f6 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MathSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MathSchema.cs @@ -14,13 +14,13 @@ namespace Microsoft.Iris.Markup.UIX private static object CallMinInt32Int32(object instanceObj, object[] parameters) => (int)parameters[0] > (int)parameters[1] ? parameters[1] : parameters[0]; - private static object CallMinSingleSingle(object instanceObj, object[] parameters) => (double)(float)parameters[0] > (double)(float)parameters[1] ? parameters[1] : parameters[0]; + private static object CallMinSingleSingle(object instanceObj, object[] parameters) => (float)parameters[0] > (double)(float)parameters[1] ? parameters[1] : parameters[0]; private static object CallMinDoubleDouble(object instanceObj, object[] parameters) => (double)parameters[0] > (double)parameters[1] ? parameters[1] : parameters[0]; private static object CallMaxInt32Int32(object instanceObj, object[] parameters) => (int)parameters[0] < (int)parameters[1] ? parameters[1] : parameters[0]; - private static object CallMaxSingleSingle(object instanceObj, object[] parameters) => (double)(float)parameters[0] < (double)(float)parameters[1] ? parameters[1] : parameters[0]; + private static object CallMaxSingleSingle(object instanceObj, object[] parameters) => (float)parameters[0] < (double)(float)parameters[1] ? parameters[1] : parameters[0]; private static object CallMaxDoubleDouble(object instanceObj, object[] parameters) => (double)parameters[0] < (double)parameters[1] ? parameters[1] : parameters[0]; @@ -28,261 +28,261 @@ namespace Microsoft.Iris.Markup.UIX { int parameter = (int)parameters[0]; int num = Math.Abs(parameter); - return num != parameter ? (object)num : parameters[0]; + return num != parameter ? num : parameters[0]; } private static object CallAbsSingle(object instanceObj, object[] parameters) { float parameter = (float)parameters[0]; float num = Math.Abs(parameter); - return (double)num != (double)parameter ? (object)num : parameters[0]; + return num != (double)parameter ? num : parameters[0]; } private static object CallAbsDouble(object instanceObj, object[] parameters) { double parameter = (double)parameters[0]; double num = Math.Abs(parameter); - return num != parameter ? (object)num : parameters[0]; + return num != parameter ? num : parameters[0]; } private static object CallRoundSingle(object instanceObj, object[] parameters) { float parameter = (float)parameters[0]; - float num = (float)Math.Round((double)parameter); - return (double)num != (double)parameter ? (object)num : parameters[0]; + float num = (float)Math.Round(parameter); + return num != (double)parameter ? num : parameters[0]; } private static object CallRoundDouble(object instanceObj, object[] parameters) { double parameter = (double)parameters[0]; double num = Math.Round(parameter); - return num != parameter ? (object)num : parameters[0]; + return num != parameter ? num : parameters[0]; } private static object CallFloorSingle(object instanceObj, object[] parameters) { float parameter = (float)parameters[0]; - float num = (float)Math.Floor((double)parameter); - return (double)num != (double)parameter ? (object)num : parameters[0]; + float num = (float)Math.Floor(parameter); + return num != (double)parameter ? num : parameters[0]; } private static object CallFloorDouble(object instanceObj, object[] parameters) { double parameter = (double)parameters[0]; double num = Math.Floor(parameter); - return num != parameter ? (object)num : parameters[0]; + return num != parameter ? num : parameters[0]; } private static object CallCeilingSingle(object instanceObj, object[] parameters) { float parameter = (float)parameters[0]; - float num = (float)Math.Ceiling((double)parameter); - return (double)num != (double)parameter ? (object)num : parameters[0]; + float num = (float)Math.Ceiling(parameter); + return num != (double)parameter ? num : parameters[0]; } private static object CallCeilingDouble(object instanceObj, object[] parameters) { double parameter = (double)parameters[0]; double num = Math.Ceiling(parameter); - return num != parameter ? (object)num : parameters[0]; + return num != parameter ? num : parameters[0]; } - private static object CallAcosDouble(object instanceObj, object[] parameters) => (object)Math.Acos((double)parameters[0]); + private static object CallAcosDouble(object instanceObj, object[] parameters) => Math.Acos((double)parameters[0]); - private static object CallAsinDouble(object instanceObj, object[] parameters) => (object)Math.Asin((double)parameters[0]); + private static object CallAsinDouble(object instanceObj, object[] parameters) => Math.Asin((double)parameters[0]); - private static object CallAtanDouble(object instanceObj, object[] parameters) => (object)Math.Atan((double)parameters[0]); + private static object CallAtanDouble(object instanceObj, object[] parameters) => Math.Atan((double)parameters[0]); - private static object CallAtan2DoubleDouble(object instanceObj, object[] parameters) => (object)Math.Atan2((double)parameters[0], (double)parameters[1]); + private static object CallAtan2DoubleDouble(object instanceObj, object[] parameters) => Math.Atan2((double)parameters[0], (double)parameters[1]); - private static object CallCosDouble(object instanceObj, object[] parameters) => (object)Math.Cos((double)parameters[0]); + private static object CallCosDouble(object instanceObj, object[] parameters) => Math.Cos((double)parameters[0]); - private static object CallCoshDouble(object instanceObj, object[] parameters) => (object)Math.Cosh((double)parameters[0]); + private static object CallCoshDouble(object instanceObj, object[] parameters) => Math.Cosh((double)parameters[0]); - private static object CallSinDouble(object instanceObj, object[] parameters) => (object)Math.Sin((double)parameters[0]); + private static object CallSinDouble(object instanceObj, object[] parameters) => Math.Sin((double)parameters[0]); - private static object CallSinhDouble(object instanceObj, object[] parameters) => (object)Math.Sinh((double)parameters[0]); + private static object CallSinhDouble(object instanceObj, object[] parameters) => Math.Sinh((double)parameters[0]); - private static object CallTanDouble(object instanceObj, object[] parameters) => (object)Math.Tan((double)parameters[0]); + private static object CallTanDouble(object instanceObj, object[] parameters) => Math.Tan((double)parameters[0]); - private static object CallTanhDouble(object instanceObj, object[] parameters) => (object)Math.Tanh((double)parameters[0]); + private static object CallTanhDouble(object instanceObj, object[] parameters) => Math.Tanh((double)parameters[0]); - private static object CallSqrtDouble(object instanceObj, object[] parameters) => (object)Math.Sqrt((double)parameters[0]); + private static object CallSqrtDouble(object instanceObj, object[] parameters) => Math.Sqrt((double)parameters[0]); - private static object CallPowDoubleDouble(object instanceObj, object[] parameters) => (object)Math.Pow((double)parameters[0], (double)parameters[1]); + private static object CallPowDoubleDouble(object instanceObj, object[] parameters) => Math.Pow((double)parameters[0], (double)parameters[1]); - private static object CallLogDouble(object instanceObj, object[] parameters) => (object)Math.Log((double)parameters[0]); + private static object CallLogDouble(object instanceObj, object[] parameters) => Math.Log((double)parameters[0]); - private static object CallLogDoubleDouble(object instanceObj, object[] parameters) => (object)Math.Log((double)parameters[0], (double)parameters[1]); + private static object CallLogDoubleDouble(object instanceObj, object[] parameters) => Math.Log((double)parameters[0], (double)parameters[1]); - private static object CallLog10Double(object instanceObj, object[] parameters) => (object)Math.Log10((double)parameters[0]); + private static object CallLog10Double(object instanceObj, object[] parameters) => Math.Log10((double)parameters[0]); - public static void Pass1Initialize() => MathSchema.Type = new UIXTypeSchema((short)145, "Math", (string)null, (short)153, typeof(object), UIXTypeFlags.Static); + public static void Pass1Initialize() => MathSchema.Type = new UIXTypeSchema(145, "Math", null, 153, typeof(object), UIXTypeFlags.Static); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)145, "Min", new short[2] + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(145, "Min", new short[2] { - (short) 115, - (short) 115 - }, (short)115, new InvokeHandler(MathSchema.CallMinInt32Int32), true); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)145, "Min", new short[2] + 115, + 115 + }, 115, new InvokeHandler(MathSchema.CallMinInt32Int32), true); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(145, "Min", new short[2] { - (short) 194, - (short) 194 - }, (short)194, new InvokeHandler(MathSchema.CallMinSingleSingle), true); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)145, "Min", new short[2] + 194, + 194 + }, 194, new InvokeHandler(MathSchema.CallMinSingleSingle), true); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(145, "Min", new short[2] { - (short) 61, - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallMinDoubleDouble), true); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)145, "Max", new short[2] + 61, + 61 + }, 61, new InvokeHandler(MathSchema.CallMinDoubleDouble), true); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(145, "Max", new short[2] { - (short) 115, - (short) 115 - }, (short)115, new InvokeHandler(MathSchema.CallMaxInt32Int32), true); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)145, "Max", new short[2] + 115, + 115 + }, 115, new InvokeHandler(MathSchema.CallMaxInt32Int32), true); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(145, "Max", new short[2] { - (short) 194, - (short) 194 - }, (short)194, new InvokeHandler(MathSchema.CallMaxSingleSingle), true); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)145, "Max", new short[2] + 194, + 194 + }, 194, new InvokeHandler(MathSchema.CallMaxSingleSingle), true); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(145, "Max", new short[2] { - (short) 61, - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallMaxDoubleDouble), true); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)145, "Abs", new short[1] + 61, + 61 + }, 61, new InvokeHandler(MathSchema.CallMaxDoubleDouble), true); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(145, "Abs", new short[1] { - (short) 115 - }, (short)115, new InvokeHandler(MathSchema.CallAbsInt32), true); - UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema((short)145, "Abs", new short[1] + 115 + }, 115, new InvokeHandler(MathSchema.CallAbsInt32), true); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(145, "Abs", new short[1] { - (short) 194 - }, (short)194, new InvokeHandler(MathSchema.CallAbsSingle), true); - UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema((short)145, "Abs", new short[1] + 194 + }, 194, new InvokeHandler(MathSchema.CallAbsSingle), true); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(145, "Abs", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallAbsDouble), true); - UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema((short)145, "Round", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallAbsDouble), true); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(145, "Round", new short[1] { - (short) 194 - }, (short)194, new InvokeHandler(MathSchema.CallRoundSingle), true); - UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema((short)145, "Round", new short[1] + 194 + }, 194, new InvokeHandler(MathSchema.CallRoundSingle), true); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(145, "Round", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallRoundDouble), true); - UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema((short)145, "Floor", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallRoundDouble), true); + UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema(145, "Floor", new short[1] { - (short) 194 - }, (short)194, new InvokeHandler(MathSchema.CallFloorSingle), true); - UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema((short)145, "Floor", new short[1] + 194 + }, 194, new InvokeHandler(MathSchema.CallFloorSingle), true); + UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema(145, "Floor", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallFloorDouble), true); - UIXMethodSchema uixMethodSchema14 = new UIXMethodSchema((short)145, "Ceiling", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallFloorDouble), true); + UIXMethodSchema uixMethodSchema14 = new UIXMethodSchema(145, "Ceiling", new short[1] { - (short) 194 - }, (short)194, new InvokeHandler(MathSchema.CallCeilingSingle), true); - UIXMethodSchema uixMethodSchema15 = new UIXMethodSchema((short)145, "Ceiling", new short[1] + 194 + }, 194, new InvokeHandler(MathSchema.CallCeilingSingle), true); + UIXMethodSchema uixMethodSchema15 = new UIXMethodSchema(145, "Ceiling", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallCeilingDouble), true); - UIXMethodSchema uixMethodSchema16 = new UIXMethodSchema((short)145, "Acos", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallCeilingDouble), true); + UIXMethodSchema uixMethodSchema16 = new UIXMethodSchema(145, "Acos", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallAcosDouble), true); - UIXMethodSchema uixMethodSchema17 = new UIXMethodSchema((short)145, "Asin", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallAcosDouble), true); + UIXMethodSchema uixMethodSchema17 = new UIXMethodSchema(145, "Asin", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallAsinDouble), true); - UIXMethodSchema uixMethodSchema18 = new UIXMethodSchema((short)145, "Atan", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallAsinDouble), true); + UIXMethodSchema uixMethodSchema18 = new UIXMethodSchema(145, "Atan", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallAtanDouble), true); - UIXMethodSchema uixMethodSchema19 = new UIXMethodSchema((short)145, "Atan2", new short[2] + 61 + }, 61, new InvokeHandler(MathSchema.CallAtanDouble), true); + UIXMethodSchema uixMethodSchema19 = new UIXMethodSchema(145, "Atan2", new short[2] { - (short) 61, - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallAtan2DoubleDouble), true); - UIXMethodSchema uixMethodSchema20 = new UIXMethodSchema((short)145, "Cos", new short[1] + 61, + 61 + }, 61, new InvokeHandler(MathSchema.CallAtan2DoubleDouble), true); + UIXMethodSchema uixMethodSchema20 = new UIXMethodSchema(145, "Cos", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallCosDouble), true); - UIXMethodSchema uixMethodSchema21 = new UIXMethodSchema((short)145, "Cosh", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallCosDouble), true); + UIXMethodSchema uixMethodSchema21 = new UIXMethodSchema(145, "Cosh", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallCoshDouble), true); - UIXMethodSchema uixMethodSchema22 = new UIXMethodSchema((short)145, "Sin", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallCoshDouble), true); + UIXMethodSchema uixMethodSchema22 = new UIXMethodSchema(145, "Sin", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallSinDouble), true); - UIXMethodSchema uixMethodSchema23 = new UIXMethodSchema((short)145, "Sinh", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallSinDouble), true); + UIXMethodSchema uixMethodSchema23 = new UIXMethodSchema(145, "Sinh", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallSinhDouble), true); - UIXMethodSchema uixMethodSchema24 = new UIXMethodSchema((short)145, "Tan", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallSinhDouble), true); + UIXMethodSchema uixMethodSchema24 = new UIXMethodSchema(145, "Tan", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallTanDouble), true); - UIXMethodSchema uixMethodSchema25 = new UIXMethodSchema((short)145, "Tanh", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallTanDouble), true); + UIXMethodSchema uixMethodSchema25 = new UIXMethodSchema(145, "Tanh", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallTanhDouble), true); - UIXMethodSchema uixMethodSchema26 = new UIXMethodSchema((short)145, "Sqrt", new short[1] + 61 + }, 61, new InvokeHandler(MathSchema.CallTanhDouble), true); + UIXMethodSchema uixMethodSchema26 = new UIXMethodSchema(145, "Sqrt", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallSqrtDouble), true); - UIXMethodSchema uixMethodSchema27 = new UIXMethodSchema((short)145, "Pow", new short[2] + 61 + }, 61, new InvokeHandler(MathSchema.CallSqrtDouble), true); + UIXMethodSchema uixMethodSchema27 = new UIXMethodSchema(145, "Pow", new short[2] { - (short) 61, - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallPowDoubleDouble), true); - UIXMethodSchema uixMethodSchema28 = new UIXMethodSchema((short)145, "Log", new short[1] + 61, + 61 + }, 61, new InvokeHandler(MathSchema.CallPowDoubleDouble), true); + UIXMethodSchema uixMethodSchema28 = new UIXMethodSchema(145, "Log", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallLogDouble), true); - UIXMethodSchema uixMethodSchema29 = new UIXMethodSchema((short)145, "Log", new short[2] + 61 + }, 61, new InvokeHandler(MathSchema.CallLogDouble), true); + UIXMethodSchema uixMethodSchema29 = new UIXMethodSchema(145, "Log", new short[2] { - (short) 61, - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallLogDoubleDouble), true); - UIXMethodSchema uixMethodSchema30 = new UIXMethodSchema((short)145, "Log10", new short[1] + 61, + 61 + }, 61, new InvokeHandler(MathSchema.CallLogDoubleDouble), true); + UIXMethodSchema uixMethodSchema30 = new UIXMethodSchema(145, "Log10", new short[1] { - (short) 61 - }, (short)61, new InvokeHandler(MathSchema.CallLog10Double), true); - MathSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[30] + 61 + }, 61, new InvokeHandler(MathSchema.CallLog10Double), true); + MathSchema.Type.Initialize(null, null, null, new MethodSchema[30] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7, - (MethodSchema) uixMethodSchema8, - (MethodSchema) uixMethodSchema9, - (MethodSchema) uixMethodSchema10, - (MethodSchema) uixMethodSchema11, - (MethodSchema) uixMethodSchema12, - (MethodSchema) uixMethodSchema13, - (MethodSchema) uixMethodSchema14, - (MethodSchema) uixMethodSchema15, - (MethodSchema) uixMethodSchema16, - (MethodSchema) uixMethodSchema17, - (MethodSchema) uixMethodSchema18, - (MethodSchema) uixMethodSchema19, - (MethodSchema) uixMethodSchema20, - (MethodSchema) uixMethodSchema21, - (MethodSchema) uixMethodSchema22, - (MethodSchema) uixMethodSchema23, - (MethodSchema) uixMethodSchema24, - (MethodSchema) uixMethodSchema25, - (MethodSchema) uixMethodSchema26, - (MethodSchema) uixMethodSchema27, - (MethodSchema) uixMethodSchema28, - (MethodSchema) uixMethodSchema29, - (MethodSchema) uixMethodSchema30 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8, + uixMethodSchema9, + uixMethodSchema10, + uixMethodSchema11, + uixMethodSchema12, + uixMethodSchema13, + uixMethodSchema14, + uixMethodSchema15, + uixMethodSchema16, + uixMethodSchema17, + uixMethodSchema18, + uixMethodSchema19, + uixMethodSchema20, + uixMethodSchema21, + uixMethodSchema22, + uixMethodSchema23, + uixMethodSchema24, + uixMethodSchema25, + uixMethodSchema26, + uixMethodSchema27, + uixMethodSchema28, + uixMethodSchema29, + uixMethodSchema30 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MergeAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MergeAnimationSchema.cs index 53964fd..f702882 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MergeAnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MergeAnimationSchema.cs @@ -12,25 +12,25 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetSources(object instanceObj) => (object)((MergeAnimation)instanceObj).Sources; + private static object GetSources(object instanceObj) => ((MergeAnimation)instanceObj).Sources; - private static object GetType(object instanceObj) => (object)((MergeAnimation)instanceObj).Type; + private static object GetType(object instanceObj) => ((MergeAnimation)instanceObj).Type; private static void SetType(ref object instanceObj, object valueObj) => ((MergeAnimation)instanceObj).Type = (AnimationEventType)valueObj; - private static object Construct() => (object)new MergeAnimation(); + private static object Construct() => new MergeAnimation(); - public static void Pass1Initialize() => MergeAnimationSchema.Type = new UIXTypeSchema((short)147, "MergeAnimation", (string)null, (short)104, typeof(MergeAnimation), UIXTypeFlags.None); + public static void Pass1Initialize() => MergeAnimationSchema.Type = new UIXTypeSchema(147, "MergeAnimation", null, 104, typeof(MergeAnimation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)147, "Sources", (short)138, (short)104, ExpressionRestriction.NoAccess, false, (RangeValidator)null, false, new GetValueHandler(MergeAnimationSchema.GetSources), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)147, "Type", (short)10, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(MergeAnimationSchema.GetType), new SetValueHandler(MergeAnimationSchema.SetType), false); - MergeAnimationSchema.Type.Initialize(new DefaultConstructHandler(MergeAnimationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(147, "Sources", 138, 104, ExpressionRestriction.NoAccess, false, null, false, new GetValueHandler(MergeAnimationSchema.GetSources), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(147, "Type", 10, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(MergeAnimationSchema.GetType), new SetValueHandler(MergeAnimationSchema.SetType), false); + MergeAnimationSchema.Type.Initialize(new DefaultConstructHandler(MergeAnimationSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/MouseWheelHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MouseWheelHandlerSchema.cs index c5b4543..f5e766a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/MouseWheelHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/MouseWheelHandlerSchema.cs @@ -17,29 +17,29 @@ namespace Microsoft.Iris.Markup.UIX private static void SetHandle(ref object instanceObj, object valueObj) => ((MouseWheelHandler)instanceObj).Handle = (bool)valueObj; - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; - private static object Construct() => (object)new MouseWheelHandler(); + private static object Construct() => new MouseWheelHandler(); - public static void Pass1Initialize() => MouseWheelHandlerSchema.Type = new UIXTypeSchema((short)150, "MouseWheelHandler", (string)null, (short)110, typeof(MouseWheelHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => MouseWheelHandlerSchema.Type = new UIXTypeSchema(150, "MouseWheelHandler", null, 110, typeof(MouseWheelHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)150, "Handle", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(MouseWheelHandlerSchema.GetHandle), new SetValueHandler(MouseWheelHandlerSchema.SetHandle), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)150, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(MouseWheelHandlerSchema.GetHandlerStage), new SetValueHandler(MouseWheelHandlerSchema.SetHandlerStage), false); - UIXEventSchema uixEventSchema1 = new UIXEventSchema((short)150, "UpInvoked"); - UIXEventSchema uixEventSchema2 = new UIXEventSchema((short)150, "DownInvoked"); - MouseWheelHandlerSchema.Type.Initialize(new DefaultConstructHandler(MouseWheelHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(150, "Handle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(MouseWheelHandlerSchema.GetHandle), new SetValueHandler(MouseWheelHandlerSchema.SetHandle), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(150, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(MouseWheelHandlerSchema.GetHandlerStage), new SetValueHandler(MouseWheelHandlerSchema.SetHandlerStage), false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(150, "UpInvoked"); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(150, "DownInvoked"); + MouseWheelHandlerSchema.Type.Initialize(new DefaultConstructHandler(MouseWheelHandlerSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, new EventSchema[2] + uixPropertySchema1, + uixPropertySchema2 + }, null, new EventSchema[2] { - (EventSchema) uixEventSchema1, - (EventSchema) uixEventSchema2 - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema1, + uixEventSchema2 + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/NullSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/NullSchema.cs index 9b7aaa1..9c1fc29 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/NullSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/NullSchema.cs @@ -33,12 +33,12 @@ namespace Microsoft.Iris.Markup.UIX case OperationType.RelationalNotEquals: return BooleanBoxes.Box(obj1 != obj2); default: - return (object)null; + return null; } } - public static void Pass1Initialize() => NullSchema.Type = new UIXTypeSchema((short)152, "Null", (string)null, (short)-1, typeof(object), UIXTypeFlags.None); + public static void Pass1Initialize() => NullSchema.Type = new UIXTypeSchema(152, "Null", null, -1, typeof(object), UIXTypeFlags.None); - public static void Pass2Initialize() => NullSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, new PerformOperationHandler(NullSchema.ExecuteOperation), new SupportsOperationHandler(NullSchema.IsOperationSupported)); + public static void Pass2Initialize() => NullSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, new PerformOperationHandler(NullSchema.ExecuteOperation), new SupportsOperationHandler(NullSchema.IsOperationSupported)); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs index 793e810..76ecdfe 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs @@ -10,7 +10,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object CallToString(object instanceObj, object[] parameters) => (object)instanceObj.ToString(); + private static object CallToString(object instanceObj, object[] parameters) => instanceObj.ToString(); private static bool IsOperationSupported(OperationType op) { @@ -35,19 +35,19 @@ namespace Microsoft.Iris.Markup.UIX case OperationType.RelationalNotEquals: return BooleanBoxes.Box(!object.Equals(objA, objB)); default: - return (object)null; + return null; } } - public static void Pass1Initialize() => ObjectSchema.Type = new UIXTypeSchema((short)153, "Object", "object", (short)-1, typeof(object), UIXTypeFlags.None); + public static void Pass1Initialize() => ObjectSchema.Type = new UIXTypeSchema(153, "Object", "object", -1, typeof(object), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)153, "ToString", (short[])null, (short)208, new InvokeHandler(ObjectSchema.CallToString), false); - ObjectSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[1] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(153, "ToString", null, 208, new InvokeHandler(ObjectSchema.CallToString), false); + ObjectSchema.Type.Initialize(null, null, null, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, new PerformOperationHandler(ObjectSchema.ExecuteOperation), new SupportsOperationHandler(ObjectSchema.IsOperationSupported)); + uixMethodSchema + }, null, null, null, null, null, null, new PerformOperationHandler(ObjectSchema.ExecuteOperation), new SupportsOperationHandler(ObjectSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/OrientationKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/OrientationKeyframeSchema.cs index 20e8bb3..2f08e0b 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/OrientationKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/OrientationKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseRotationKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseRotationKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseRotationKeyframe)instanceObj).Value = (Rotation)valueObj; - private static object Construct() => (object)new OrientationKeyframe(); + private static object Construct() => new OrientationKeyframe(); - public static void Pass1Initialize() => OrientationKeyframeSchema.Type = new UIXTypeSchema((short)155, "OrientationKeyframe", (string)null, (short)130, typeof(OrientationKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => OrientationKeyframeSchema.Type = new UIXTypeSchema(155, "OrientationKeyframe", null, 130, typeof(OrientationKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)155, "Value", (short)176, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(OrientationKeyframeSchema.GetValue), new SetValueHandler(OrientationKeyframeSchema.SetValue), false); - OrientationKeyframeSchema.Type.Initialize(new DefaultConstructHandler(OrientationKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(155, "Value", 176, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(OrientationKeyframeSchema.GetValue), new SetValueHandler(OrientationKeyframeSchema.SetValue), false); + OrientationKeyframeSchema.Type.Initialize(new DefaultConstructHandler(OrientationKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PanelSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PanelSchema.cs index 8f32b2b..2274ca1 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PanelSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PanelSchema.cs @@ -13,19 +13,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetChildren(object instanceObj) => (object)ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); + private static object GetChildren(object instanceObj) => ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); - private static object Construct() => (object)new Panel(); + private static object Construct() => new Panel(); - public static void Pass1Initialize() => PanelSchema.Type = new UIXTypeSchema((short)156, "Panel", (string)null, (short)239, typeof(Panel), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => PanelSchema.Type = new UIXTypeSchema(156, "Panel", null, 239, typeof(Panel), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)156, "Children", (short)138, (short)239, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(PanelSchema.GetChildren), (SetValueHandler)null, false); - PanelSchema.Type.Initialize(new DefaultConstructHandler(PanelSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(156, "Children", 138, 239, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(PanelSchema.GetChildren), null, false); + PanelSchema.Type.Initialize(new DefaultConstructHandler(PanelSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PlacementModeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PlacementModeSchema.cs index 7a2202d..6f962b2 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PlacementModeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PlacementModeSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetPopupPositions(object instanceObj) => (object)new ArrayList((ICollection)((PlacementMode)instanceObj).PopupPositions); + private static object GetPopupPositions(object instanceObj) => new ArrayList(((PlacementMode)instanceObj).PopupPositions); private static void SetPopupPositions(ref object instanceObj, object valueObj) { @@ -26,24 +26,24 @@ namespace Microsoft.Iris.Markup.UIX placementMode.PopupPositions = popupPositionArray; } - private static object GetMouseTarget(object instanceObj) => (object)((PlacementMode)instanceObj).MouseTarget; + private static object GetMouseTarget(object instanceObj) => ((PlacementMode)instanceObj).MouseTarget; private static void SetMouseTarget(ref object instanceObj, object valueObj) => ((PlacementMode)instanceObj).MouseTarget = (MouseTarget)valueObj; - private static object Construct() => (object)new PlacementMode(); + private static object Construct() => new PlacementMode(); private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; PlacementMode instance = PlacementModeSchema.StringToInstance(str); if (instance == null) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"PlacementMode"); - instanceObj = (object)instance; + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "PlacementMode"); + instanceObj = instance; return Result.Success; } - private static object FindCanonicalInstance(string name) => (object)PlacementModeSchema.StringToInstance(name); + private static object FindCanonicalInstance(string name) => PlacementModeSchema.StringToInstance(name); private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -53,7 +53,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = PlacementModeSchema.ConvertFromString(from, out instance); @@ -68,7 +68,7 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; PlacementMode parameter2 = (PlacementMode)parameters[1]; object instanceObj1; - return PlacementModeSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return PlacementModeSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } private static PlacementMode StringToInstance(string value) @@ -91,28 +91,28 @@ namespace Microsoft.Iris.Markup.UIX return PlacementMode.MouseBottom; if (value == "FollowMouseOrigin") return PlacementMode.FollowMouseOrigin; - return value == "FollowMouseBottom" ? PlacementMode.FollowMouseBottom : (PlacementMode)null; + return value == "FollowMouseBottom" ? PlacementMode.FollowMouseBottom : null; } - public static void Pass1Initialize() => PlacementModeSchema.Type = new UIXTypeSchema((short)157, "PlacementMode", (string)null, (short)153, typeof(PlacementMode), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => PlacementModeSchema.Type = new UIXTypeSchema(157, "PlacementMode", null, 153, typeof(PlacementMode), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)157, "PopupPositions", (short)138, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PlacementModeSchema.GetPopupPositions), new SetValueHandler(PlacementModeSchema.SetPopupPositions), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)157, "MouseTarget", (short)149, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PlacementModeSchema.GetMouseTarget), new SetValueHandler(PlacementModeSchema.SetMouseTarget), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)157, "TryParse", new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(157, "PopupPositions", 138, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PlacementModeSchema.GetPopupPositions), new SetValueHandler(PlacementModeSchema.SetPopupPositions), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(157, "MouseTarget", 149, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PlacementModeSchema.GetMouseTarget), new SetValueHandler(PlacementModeSchema.SetMouseTarget), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(157, "TryParse", new short[2] { - (short) 208, - (short) 157 - }, (short)157, new InvokeHandler(PlacementModeSchema.CallTryParseStringPlacementMode), true); - PlacementModeSchema.Type.Initialize(new DefaultConstructHandler(PlacementModeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + 208, + 157 + }, 157, new InvokeHandler(PlacementModeSchema.CallTryParseStringPlacementMode), true); + PlacementModeSchema.Type.Initialize(new DefaultConstructHandler(PlacementModeSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 + uixPropertySchema2, + uixPropertySchema1 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, new FindCanonicalInstanceHandler(PlacementModeSchema.FindCanonicalInstance), new TypeConverterHandler(PlacementModeSchema.TryConvertFrom), new SupportsTypeConversionHandler(PlacementModeSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, new FindCanonicalInstanceHandler(PlacementModeSchema.FindCanonicalInstance), new TypeConverterHandler(PlacementModeSchema.TryConvertFrom), new SupportsTypeConversionHandler(PlacementModeSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PointLight2DInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PointLight2DInstanceSchema.cs index 5ff76c7..c59dccb 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PointLight2DInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PointLight2DInstanceSchema.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Position, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayRadiusAnimationEffectFloatAnimation( @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Radius, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayLightColorAnimationEffectColorAnimation( @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.LightColor, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayAmbientColorAnimationEffectColorAnimation( @@ -54,7 +54,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.AmbientColor, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayAttenuationAnimationEffectVector3Animation( @@ -62,53 +62,53 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Attenuation, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => PointLight2DInstanceSchema.Type = new UIXTypeSchema((short)160, "PointLight2DInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => PointLight2DInstanceSchema.Type = new UIXTypeSchema(160, "PointLight2DInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)160, "Position", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(PointLight2DInstanceSchema.SetPosition), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)160, "Radius", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(PointLight2DInstanceSchema.SetRadius), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)160, "LightColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(PointLight2DInstanceSchema.SetLightColor), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)160, "AmbientColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(PointLight2DInstanceSchema.SetAmbientColor), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)160, "Attenuation", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(PointLight2DInstanceSchema.SetAttenuation), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)160, "PlayPositionAnimation", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(160, "Position", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(PointLight2DInstanceSchema.SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(160, "Radius", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(PointLight2DInstanceSchema.SetRadius), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(160, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(PointLight2DInstanceSchema.SetLightColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(160, "AmbientColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(PointLight2DInstanceSchema.SetAmbientColor), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(160, "Attenuation", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(PointLight2DInstanceSchema.SetAttenuation), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(160, "PlayPositionAnimation", new short[1] { - (short) 81 - }, (short)240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayPositionAnimationEffectVector3Animation), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)160, "PlayRadiusAnimation", new short[1] + 81 + }, 240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayPositionAnimationEffectVector3Animation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(160, "PlayRadiusAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayRadiusAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)160, "PlayLightColorAnimation", new short[1] + 75 + }, 240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayRadiusAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(160, "PlayLightColorAnimation", new short[1] { - (short) 71 - }, (short)240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayLightColorAnimationEffectColorAnimation), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)160, "PlayAmbientColorAnimation", new short[1] + 71 + }, 240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayLightColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(160, "PlayAmbientColorAnimation", new short[1] { - (short) 71 - }, (short)240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayAmbientColorAnimationEffectColorAnimation), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)160, "PlayAttenuationAnimation", new short[1] + 71 + }, 240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayAmbientColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(160, "PlayAttenuationAnimation", new short[1] { - (short) 81 - }, (short)240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayAttenuationAnimationEffectVector3Animation), false); - PointLight2DInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[5] + 81 + }, 240, new InvokeHandler(PointLight2DInstanceSchema.CallPlayAttenuationAnimationEffectVector3Animation), false); + PointLight2DInstanceSchema.Type.Initialize(null, null, new PropertySchema[5] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[5] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PointLight2DSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PointLight2DSchema.cs index 2870055..1d1340b 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PointLight2DSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PointLight2DSchema.cs @@ -15,11 +15,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetPosition(object instanceObj) => (object)((PointLight2DElement)instanceObj).Position; + private static object GetPosition(object instanceObj) => ((PointLight2DElement)instanceObj).Position; private static void SetPosition(ref object instanceObj, object valueObj) => ((PointLight2DElement)instanceObj).Position = (Vector3)valueObj; - private static object GetRadius(object instanceObj) => (object)((PointLight2DElement)instanceObj).Radius; + private static object GetRadius(object instanceObj) => ((PointLight2DElement)instanceObj).Radius; private static void SetRadius(ref object instanceObj, object valueObj) { @@ -36,29 +36,29 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAmbientColor(ref object instanceObj, object valueObj) => ((PointLight2DElement)instanceObj).AmbientColor = ((Color)valueObj).RenderConvert(); - private static object GetAttenuation(object instanceObj) => (object)((PointLight2DElement)instanceObj).Attenuation; + private static object GetAttenuation(object instanceObj) => ((PointLight2DElement)instanceObj).Attenuation; private static void SetAttenuation(ref object instanceObj, object valueObj) => ((PointLight2DElement)instanceObj).Attenuation = (Vector3)valueObj; - private static object Construct() => (object)new PointLight2DElement(); + private static object Construct() => new PointLight2DElement(); - public static void Pass1Initialize() => PointLight2DSchema.Type = new UIXTypeSchema((short)159, "PointLight2D", (string)null, (short)77, typeof(PointLight2DElement), UIXTypeFlags.None); + public static void Pass1Initialize() => PointLight2DSchema.Type = new UIXTypeSchema(159, "PointLight2D", null, 77, typeof(PointLight2DElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)159, "Position", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PointLight2DSchema.GetPosition), new SetValueHandler(PointLight2DSchema.SetPosition), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)159, "Radius", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(PointLight2DSchema.GetRadius), new SetValueHandler(PointLight2DSchema.SetRadius), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)159, "LightColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(PointLight2DSchema.SetLightColor), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)159, "AmbientColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(PointLight2DSchema.SetAmbientColor), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)159, "Attenuation", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PointLight2DSchema.GetAttenuation), new SetValueHandler(PointLight2DSchema.SetAttenuation), false); - PointLight2DSchema.Type.Initialize(new DefaultConstructHandler(PointLight2DSchema.Construct), (ConstructorSchema[])null, new PropertySchema[5] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(159, "Position", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PointLight2DSchema.GetPosition), new SetValueHandler(PointLight2DSchema.SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(159, "Radius", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(PointLight2DSchema.GetRadius), new SetValueHandler(PointLight2DSchema.SetRadius), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(159, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(PointLight2DSchema.SetLightColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(159, "AmbientColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(PointLight2DSchema.SetAmbientColor), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(159, "Attenuation", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PointLight2DSchema.GetAttenuation), new SetValueHandler(PointLight2DSchema.SetAttenuation), false); + PointLight2DSchema.Type.Initialize(new DefaultConstructHandler(PointLight2DSchema.Construct), null, new PropertySchema[5] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PointSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PointSchema.cs index f839b02..57ba873 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PointSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PointSchema.cs @@ -14,27 +14,27 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetX(object instanceObj) => (object)((Point)instanceObj).X; + private static object GetX(object instanceObj) => ((Point)instanceObj).X; private static void SetX(ref object instanceObj, object valueObj) { Point point = (Point)instanceObj; int num = (int)valueObj; point.X = num; - instanceObj = (object)point; + instanceObj = point; } - private static object GetY(object instanceObj) => (object)((Point)instanceObj).Y; + private static object GetY(object instanceObj) => ((Point)instanceObj).Y; private static void SetY(ref object instanceObj, object valueObj) { Point point = (Point)instanceObj; int num = (int)valueObj; point.Y = num; - instanceObj = (object)point; + instanceObj = point; } - private static object Construct() => (object)Point.Zero; + private static object Construct() => Point.Zero; private static object ConstructXY(object[] parameters) { @@ -48,14 +48,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = PointSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Point", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Point", result1.Error); PointSchema.SetX(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Point", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Point", result2.Error); PointSchema.SetY(ref instance, valueObj2); return result2; } @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteInt32(point.Y); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new Point(reader.ReadInt32(), reader.ReadInt32()); + private static object DecodeBinary(ByteCodeReader reader) => new Point(reader.ReadInt32(), reader.ReadInt32()); private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -77,7 +77,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -88,7 +88,7 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Point"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Point"); } return result; } @@ -112,42 +112,42 @@ namespace Microsoft.Iris.Markup.UIX { Point point1 = (Point)leftObj; if (op == OperationType.MathNegate) - return (object)-point1; + return -point1; Point point2 = (Point)rightObj; switch (op) { case OperationType.MathAdd: - return (object)(point1 + point2); + return point1 + point2; case OperationType.MathSubtract: - return (object)(point1 - point2); + return point1 - point2; case OperationType.RelationalEquals: return BooleanBoxes.Box(point1 == point2); case OperationType.RelationalNotEquals: return BooleanBoxes.Box(point1 != point2); default: - return (object)null; + return null; } } - public static void Pass1Initialize() => PointSchema.Type = new UIXTypeSchema((short)158, "Point", (string)null, (short)153, typeof(Point), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => PointSchema.Type = new UIXTypeSchema(158, "Point", null, 153, typeof(Point), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)158, "X", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PointSchema.GetX), new SetValueHandler(PointSchema.SetX), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)158, "Y", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PointSchema.GetY), new SetValueHandler(PointSchema.SetY), false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)158, new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(158, "X", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PointSchema.GetX), new SetValueHandler(PointSchema.SetX), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(158, "Y", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PointSchema.GetY), new SetValueHandler(PointSchema.SetY), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(158, new short[2] { - (short) 115, - (short) 115 + 115, + 115 }, new ConstructHandler(PointSchema.ConstructXY)); PointSchema.Type.Initialize(new DefaultConstructHandler(PointSchema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(PointSchema.TryConvertFrom), new SupportsTypeConversionHandler(PointSchema.IsConversionSupported), new EncodeBinaryHandler(PointSchema.EncodeBinary), new DecodeBinaryHandler(PointSchema.DecodeBinary), new PerformOperationHandler(PointSchema.ExecuteOperation), new SupportsOperationHandler(PointSchema.IsOperationSupported)); + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, new TypeConverterHandler(PointSchema.TryConvertFrom), new SupportsTypeConversionHandler(PointSchema.IsConversionSupported), new EncodeBinaryHandler(PointSchema.EncodeBinary), new DecodeBinaryHandler(PointSchema.DecodeBinary), new PerformOperationHandler(PointSchema.ExecuteOperation), new SupportsOperationHandler(PointSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutInputSchema.cs index 6f3ac7e..6c2fbdb 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutInputSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutInputSchema.cs @@ -14,15 +14,15 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetPlacementTarget(object instanceObj) => (object)((PopupLayoutInput)instanceObj).PlacementTarget; + private static object GetPlacementTarget(object instanceObj) => ((PopupLayoutInput)instanceObj).PlacementTarget; private static void SetPlacementTarget(ref object instanceObj, object valueObj) => ((PopupLayoutInput)instanceObj).PlacementTarget = (ViewItem)valueObj; - private static object GetPlacement(object instanceObj) => (object)((PopupLayoutInput)instanceObj).Placement; + private static object GetPlacement(object instanceObj) => ((PopupLayoutInput)instanceObj).Placement; private static void SetPlacement(ref object instanceObj, object valueObj) => ((PopupLayoutInput)instanceObj).Placement = (PlacementMode)valueObj; - private static object GetOffset(object instanceObj) => (object)((PopupLayoutInput)instanceObj).Offset; + private static object GetOffset(object instanceObj) => ((PopupLayoutInput)instanceObj).Offset; private static void SetOffset(ref object instanceObj, object valueObj) => ((PopupLayoutInput)instanceObj).Offset = (Point)valueObj; @@ -42,31 +42,31 @@ namespace Microsoft.Iris.Markup.UIX private static object GetFlippedVertically(object instanceObj) => BooleanBoxes.Box(((PopupLayoutInput)instanceObj).FlippedVertically); - private static object Construct() => (object)new PopupLayoutInput(); + private static object Construct() => new PopupLayoutInput(); - public static void Pass1Initialize() => PopupLayoutInputSchema.Type = new UIXTypeSchema((short)162, "PopupLayoutInput", (string)null, (short)133, typeof(PopupLayoutInput), UIXTypeFlags.None); + public static void Pass1Initialize() => PopupLayoutInputSchema.Type = new UIXTypeSchema(162, "PopupLayoutInput", null, 133, typeof(PopupLayoutInput), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)162, "PlacementTarget", (short)239, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupLayoutInputSchema.GetPlacementTarget), new SetValueHandler(PopupLayoutInputSchema.SetPlacementTarget), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)162, "Placement", (short)157, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupLayoutInputSchema.GetPlacement), new SetValueHandler(PopupLayoutInputSchema.SetPlacement), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)162, "Offset", (short)158, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupLayoutInputSchema.GetOffset), new SetValueHandler(PopupLayoutInputSchema.SetOffset), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)162, "StayInBounds", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupLayoutInputSchema.GetStayInBounds), new SetValueHandler(PopupLayoutInputSchema.SetStayInBounds), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)162, "RespectMenuDropAlignment", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupLayoutInputSchema.GetRespectMenuDropAlignment), new SetValueHandler(PopupLayoutInputSchema.SetRespectMenuDropAlignment), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)162, "ConstrainToTarget", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupLayoutInputSchema.GetConstrainToTarget), new SetValueHandler(PopupLayoutInputSchema.SetConstrainToTarget), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)162, "FlippedHorizontally", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(PopupLayoutInputSchema.GetFlippedHorizontally), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)162, "FlippedVertically", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(PopupLayoutInputSchema.GetFlippedVertically), (SetValueHandler)null, false); - PopupLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(PopupLayoutInputSchema.Construct), (ConstructorSchema[])null, new PropertySchema[8] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(162, "PlacementTarget", 239, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupLayoutInputSchema.GetPlacementTarget), new SetValueHandler(PopupLayoutInputSchema.SetPlacementTarget), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(162, "Placement", 157, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupLayoutInputSchema.GetPlacement), new SetValueHandler(PopupLayoutInputSchema.SetPlacement), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(162, "Offset", 158, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupLayoutInputSchema.GetOffset), new SetValueHandler(PopupLayoutInputSchema.SetOffset), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(162, "StayInBounds", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupLayoutInputSchema.GetStayInBounds), new SetValueHandler(PopupLayoutInputSchema.SetStayInBounds), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(162, "RespectMenuDropAlignment", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupLayoutInputSchema.GetRespectMenuDropAlignment), new SetValueHandler(PopupLayoutInputSchema.SetRespectMenuDropAlignment), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(162, "ConstrainToTarget", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupLayoutInputSchema.GetConstrainToTarget), new SetValueHandler(PopupLayoutInputSchema.SetConstrainToTarget), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(162, "FlippedHorizontally", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(PopupLayoutInputSchema.GetFlippedHorizontally), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(162, "FlippedVertically", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(PopupLayoutInputSchema.GetFlippedVertically), null, false); + PopupLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(PopupLayoutInputSchema.Construct), null, new PropertySchema[8] { - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema6, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema4 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutSchema.cs index 666e7b7..1056764 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutSchema.cs @@ -12,10 +12,10 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)new PopupLayout(); + private static object Construct() => new PopupLayout(); - public static void Pass1Initialize() => PopupLayoutSchema.Type = new UIXTypeSchema((short)161, "PopupLayout", (string)null, (short)132, typeof(PopupLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => PopupLayoutSchema.Type = new UIXTypeSchema(161, "PopupLayout", null, 132, typeof(PopupLayout), UIXTypeFlags.Immutable); - public static void Pass2Initialize() => PopupLayoutSchema.Type.Initialize(new DefaultConstructHandler(PopupLayoutSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => PopupLayoutSchema.Type.Initialize(new DefaultConstructHandler(PopupLayoutSchema.Construct), null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PopupPositionSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PopupPositionSchema.cs index ca39cc3..6ff62d0 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PopupPositionSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PopupPositionSchema.cs @@ -12,51 +12,51 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetTarget(object instanceObj) => (object)((PopupPosition)instanceObj).Target; + private static object GetTarget(object instanceObj) => ((PopupPosition)instanceObj).Target; private static void SetTarget(ref object instanceObj, object valueObj) { PopupPosition popupPosition = (PopupPosition)instanceObj; InterestPoint interestPoint = (InterestPoint)valueObj; popupPosition.Target = interestPoint; - instanceObj = (object)popupPosition; + instanceObj = popupPosition; } - private static object GetPopup(object instanceObj) => (object)((PopupPosition)instanceObj).Popup; + private static object GetPopup(object instanceObj) => ((PopupPosition)instanceObj).Popup; private static void SetPopup(ref object instanceObj, object valueObj) { PopupPosition popupPosition = (PopupPosition)instanceObj; InterestPoint interestPoint = (InterestPoint)valueObj; popupPosition.Popup = interestPoint; - instanceObj = (object)popupPosition; + instanceObj = popupPosition; } - private static object GetFlipped(object instanceObj) => (object)((PopupPosition)instanceObj).Flipped; + private static object GetFlipped(object instanceObj) => ((PopupPosition)instanceObj).Flipped; private static void SetFlipped(ref object instanceObj, object valueObj) { PopupPosition popupPosition = (PopupPosition)instanceObj; FlipDirection flipDirection = (FlipDirection)valueObj; popupPosition.Flipped = flipDirection; - instanceObj = (object)popupPosition; + instanceObj = popupPosition; } - private static object Construct() => (object)new PopupPosition(); + private static object Construct() => new PopupPosition(); - public static void Pass1Initialize() => PopupPositionSchema.Type = new UIXTypeSchema((short)163, "PopupPosition", (string)null, (short)153, typeof(PopupPosition), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => PopupPositionSchema.Type = new UIXTypeSchema(163, "PopupPosition", null, 153, typeof(PopupPosition), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)163, "Target", (short)118, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupPositionSchema.GetTarget), new SetValueHandler(PopupPositionSchema.SetTarget), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)163, "Popup", (short)118, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupPositionSchema.GetPopup), new SetValueHandler(PopupPositionSchema.SetPopup), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)163, "Flipped", (short)89, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PopupPositionSchema.GetFlipped), new SetValueHandler(PopupPositionSchema.SetFlipped), false); - PopupPositionSchema.Type.Initialize(new DefaultConstructHandler(PopupPositionSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(163, "Target", 118, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupPositionSchema.GetTarget), new SetValueHandler(PopupPositionSchema.SetTarget), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(163, "Popup", 118, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupPositionSchema.GetPopup), new SetValueHandler(PopupPositionSchema.SetPopup), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(163, "Flipped", 89, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PopupPositionSchema.GetFlipped), new SetValueHandler(PopupPositionSchema.SetFlipped), false); + PopupPositionSchema.Type.Initialize(new DefaultConstructHandler(PopupPositionSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PositionKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PositionKeyframeSchema.cs index 55d9686..7e6a894 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PositionKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PositionKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseVector3Keyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseVector3Keyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseVector3Keyframe)instanceObj).Value = (Vector3)valueObj; - private static object Construct() => (object)new PositionKeyframe(); + private static object Construct() => new PositionKeyframe(); - public static void Pass1Initialize() => PositionKeyframeSchema.Type = new UIXTypeSchema((short)164, "PositionKeyframe", (string)null, (short)130, typeof(PositionKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => PositionKeyframeSchema.Type = new UIXTypeSchema(164, "PositionKeyframe", null, 130, typeof(PositionKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)164, "Value", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PositionKeyframeSchema.GetValue), new SetValueHandler(PositionKeyframeSchema.SetValue), false); - PositionKeyframeSchema.Type.Initialize(new DefaultConstructHandler(PositionKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(164, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PositionKeyframeSchema.GetValue), new SetValueHandler(PositionKeyframeSchema.SetValue), false); + PositionKeyframeSchema.Type.Initialize(new DefaultConstructHandler(PositionKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PositionXKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PositionXKeyframeSchema.cs index e47ab2e..016cb56 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PositionXKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PositionXKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new PositionXKeyframe(); + private static object Construct() => new PositionXKeyframe(); - public static void Pass1Initialize() => PositionXKeyframeSchema.Type = new UIXTypeSchema((short)165, "PositionXKeyframe", (string)null, (short)130, typeof(PositionXKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => PositionXKeyframeSchema.Type = new UIXTypeSchema(165, "PositionXKeyframe", null, 130, typeof(PositionXKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)165, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PositionXKeyframeSchema.GetValue), new SetValueHandler(PositionXKeyframeSchema.SetValue), false); - PositionXKeyframeSchema.Type.Initialize(new DefaultConstructHandler(PositionXKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(165, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PositionXKeyframeSchema.GetValue), new SetValueHandler(PositionXKeyframeSchema.SetValue), false); + PositionXKeyframeSchema.Type.Initialize(new DefaultConstructHandler(PositionXKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/PositionYKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PositionYKeyframeSchema.cs index 40ad6bf..7cd81e4 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/PositionYKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/PositionYKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new PositionYKeyframe(); + private static object Construct() => new PositionYKeyframe(); - public static void Pass1Initialize() => PositionYKeyframeSchema.Type = new UIXTypeSchema((short)166, "PositionYKeyframe", (string)null, (short)130, typeof(PositionYKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => PositionYKeyframeSchema.Type = new UIXTypeSchema(166, "PositionYKeyframe", null, 130, typeof(PositionYKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)166, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(PositionYKeyframeSchema.GetValue), new SetValueHandler(PositionYKeyframeSchema.SetValue), false); - PositionYKeyframeSchema.Type.Initialize(new DefaultConstructHandler(PositionYKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(166, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(PositionYKeyframeSchema.GetValue), new SetValueHandler(PositionYKeyframeSchema.SetValue), false); + PositionYKeyframeSchema.Type.Initialize(new DefaultConstructHandler(PositionYKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/RandomSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RandomSchema.cs index 4cb89fc..310f729 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/RandomSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/RandomSchema.cs @@ -13,20 +13,20 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)new Random(); + private static object Construct() => new Random(); - private static object ConstructInt32(object[] parameters) => (object)new Random((int)parameters[0]); + private static object ConstructInt32(object[] parameters) => new Random((int)parameters[0]); - private static object CallNext(object instanceObj, object[] parameters) => (object)((Random)instanceObj).Next(); + private static object CallNext(object instanceObj, object[] parameters) => ((Random)instanceObj).Next(); private static object CallNextInt32(object instanceObj, object[] parameters) { Random random = (Random)instanceObj; int parameter = (int)parameters[0]; if (parameter >= 0) - return (object)random.Next(parameter); - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter, (object)"maxValue"); - return (object)null; + return random.Next(parameter); + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter, "maxValue"); + return null; } private static object CallNextInt32Int32(object instanceObj, object[] parameters) @@ -35,74 +35,74 @@ namespace Microsoft.Iris.Markup.UIX int parameter1 = (int)parameters[0]; int parameter2 = (int)parameters[1]; if (parameter1 <= parameter2) - return (object)random.Next(parameter1, parameter2); - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter1, (object)"minValue"); - return (object)null; + return random.Next(parameter1, parameter2); + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter1, "minValue"); + return null; } - private static object CallNextDouble(object instanceObj, object[] parameters) => (object)((Random)instanceObj).NextDouble(); + private static object CallNextDouble(object instanceObj, object[] parameters) => ((Random)instanceObj).NextDouble(); private static object CallNextDoubleDoubleDouble(object instanceObj, object[] parameters) { Random random = (Random)instanceObj; double parameter1 = (double)parameters[0]; double parameter2 = (double)parameters[1]; - return (object)(random.NextDouble() * (parameter2 - parameter1) + parameter1); + return random.NextDouble() * (parameter2 - parameter1) + parameter1; } - private static object CallNextSingle(object instanceObj, object[] parameters) => (object)(float)((Random)instanceObj).NextDouble(); + private static object CallNextSingle(object instanceObj, object[] parameters) => (float)((Random)instanceObj).NextDouble(); private static object CallNextSingleSingleSingle(object instanceObj, object[] parameters) { Random random = (Random)instanceObj; float parameter1 = (float)parameters[0]; float parameter2 = (float)parameters[1]; - return (object)((float)(random.NextDouble() * ((double)parameter2 - (double)parameter1)) + parameter1); + return (float)(random.NextDouble() * (parameter2 - (double)parameter1)) + parameter1; } - public static void Pass1Initialize() => RandomSchema.Type = new UIXTypeSchema((short)167, "Random", (string)null, (short)153, typeof(Random), UIXTypeFlags.None); + public static void Pass1Initialize() => RandomSchema.Type = new UIXTypeSchema(167, "Random", null, 153, typeof(Random), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)167, new short[1] + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(167, new short[1] { - (short) 115 + 115 }, new ConstructHandler(RandomSchema.ConstructInt32)); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)167, "Next", (short[])null, (short)115, new InvokeHandler(RandomSchema.CallNext), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)167, "Next", new short[1] + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(167, "Next", null, 115, new InvokeHandler(RandomSchema.CallNext), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(167, "Next", new short[1] { - (short) 115 - }, (short)115, new InvokeHandler(RandomSchema.CallNextInt32), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)167, "Next", new short[2] + 115 + }, 115, new InvokeHandler(RandomSchema.CallNextInt32), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(167, "Next", new short[2] { - (short) 115, - (short) 115 - }, (short)115, new InvokeHandler(RandomSchema.CallNextInt32Int32), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)167, "NextDouble", (short[])null, (short)61, new InvokeHandler(RandomSchema.CallNextDouble), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)167, "NextDouble", new short[2] + 115, + 115 + }, 115, new InvokeHandler(RandomSchema.CallNextInt32Int32), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(167, "NextDouble", null, 61, new InvokeHandler(RandomSchema.CallNextDouble), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(167, "NextDouble", new short[2] { - (short) 61, - (short) 61 - }, (short)61, new InvokeHandler(RandomSchema.CallNextDoubleDoubleDouble), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)167, "NextSingle", (short[])null, (short)194, new InvokeHandler(RandomSchema.CallNextSingle), false); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)167, "NextSingle", new short[2] + 61, + 61 + }, 61, new InvokeHandler(RandomSchema.CallNextDoubleDoubleDouble), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(167, "NextSingle", null, 194, new InvokeHandler(RandomSchema.CallNextSingle), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(167, "NextSingle", new short[2] { - (short) 194, - (short) 194 - }, (short)194, new InvokeHandler(RandomSchema.CallNextSingleSingleSingle), false); + 194, + 194 + }, 194, new InvokeHandler(RandomSchema.CallNextSingleSingleSingle), false); RandomSchema.Type.Initialize(new DefaultConstructHandler(RandomSchema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema - }, (PropertySchema[])null, new MethodSchema[7] + constructorSchema + }, null, new MethodSchema[7] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/RangedValueSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RangedValueSchema.cs index 16bb5f6..087d87a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/RangedValueSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/RangedValueSchema.cs @@ -13,59 +13,59 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetMinValue(object instanceObj) => (object)((IUIRangedValue)instanceObj).MinValue; + private static object GetMinValue(object instanceObj) => ((IUIRangedValue)instanceObj).MinValue; private static void SetMinValue(ref object instanceObj, object valueObj) { IUIRangedValue uiRangedValue = (IUIRangedValue)instanceObj; float num = (float)valueObj; - if ((double)num > (double)uiRangedValue.MaxValue) - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)num, (object)"MinValue"); + if (num > (double)uiRangedValue.MaxValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MinValue"); else uiRangedValue.MinValue = num; } - private static object GetMaxValue(object instanceObj) => (object)((IUIRangedValue)instanceObj).MaxValue; + private static object GetMaxValue(object instanceObj) => ((IUIRangedValue)instanceObj).MaxValue; private static void SetMaxValue(ref object instanceObj, object valueObj) { IUIRangedValue uiRangedValue = (IUIRangedValue)instanceObj; float num = (float)valueObj; - if ((double)num < (double)uiRangedValue.MinValue) - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)num, (object)"MaxValue"); + if (num < (double)uiRangedValue.MinValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MaxValue"); else uiRangedValue.MaxValue = num; } - private static object GetStep(object instanceObj) => (object)((IUIRangedValue)instanceObj).Step; + private static object GetStep(object instanceObj) => ((IUIRangedValue)instanceObj).Step; private static void SetStep(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Step = (float)valueObj; - private static object GetRange(object instanceObj) => (object)((IUIRangedValue)instanceObj).Range; + private static object GetRange(object instanceObj) => ((IUIRangedValue)instanceObj).Range; - private static object GetValue(object instanceObj) => (object)((IUIRangedValue)instanceObj).Value; + private static object GetValue(object instanceObj) => ((IUIRangedValue)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new Microsoft.Iris.ModelItems.RangedValue(); + private static object Construct() => new Microsoft.Iris.ModelItems.RangedValue(); - public static void Pass1Initialize() => RangedValueSchema.Type = new UIXTypeSchema((short)168, "RangedValue", (string)null, (short)231, typeof(IUIRangedValue), UIXTypeFlags.None); + public static void Pass1Initialize() => RangedValueSchema.Type = new UIXTypeSchema(168, "RangedValue", null, 231, typeof(IUIRangedValue), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)168, "MinValue", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RangedValueSchema.GetMinValue), new SetValueHandler(RangedValueSchema.SetMinValue), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)168, "MaxValue", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RangedValueSchema.GetMaxValue), new SetValueHandler(RangedValueSchema.SetMaxValue), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)168, "Step", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RangedValueSchema.GetStep), new SetValueHandler(RangedValueSchema.SetStep), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)168, "Range", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RangedValueSchema.GetRange), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)168, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RangedValueSchema.GetValue), new SetValueHandler(RangedValueSchema.SetValue), false); - RangedValueSchema.Type.Initialize(new DefaultConstructHandler(RangedValueSchema.Construct), (ConstructorSchema[])null, new PropertySchema[5] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(168, "MinValue", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RangedValueSchema.GetMinValue), new SetValueHandler(RangedValueSchema.SetMinValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(168, "MaxValue", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RangedValueSchema.GetMaxValue), new SetValueHandler(RangedValueSchema.SetMaxValue), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(168, "Step", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RangedValueSchema.GetStep), new SetValueHandler(RangedValueSchema.SetStep), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(168, "Range", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RangedValueSchema.GetRange), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(168, "Value", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RangedValueSchema.GetValue), new SetValueHandler(RangedValueSchema.SetValue), false); + RangedValueSchema.Type.Initialize(new DefaultConstructHandler(RangedValueSchema.Construct), null, new PropertySchema[5] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema5 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema4, + uixPropertySchema3, + uixPropertySchema5 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/RectangleSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RectangleSchema.cs index e3ed252..c46a3c7 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/RectangleSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/RectangleSchema.cs @@ -15,86 +15,86 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetX(object instanceObj) => (object)((Rectangle)instanceObj).X; + private static object GetX(object instanceObj) => ((Rectangle)instanceObj).X; private static void SetX(ref object instanceObj, object valueObj) { Rectangle rectangle = (Rectangle)instanceObj; int num = (int)valueObj; rectangle.X = num; - instanceObj = (object)rectangle; + instanceObj = rectangle; } - private static object GetY(object instanceObj) => (object)((Rectangle)instanceObj).Y; + private static object GetY(object instanceObj) => ((Rectangle)instanceObj).Y; private static void SetY(ref object instanceObj, object valueObj) { Rectangle rectangle = (Rectangle)instanceObj; int num = (int)valueObj; rectangle.Y = num; - instanceObj = (object)rectangle; + instanceObj = rectangle; } - private static object GetWidth(object instanceObj) => (object)((Rectangle)instanceObj).Width; + private static object GetWidth(object instanceObj) => ((Rectangle)instanceObj).Width; private static void SetWidth(ref object instanceObj, object valueObj) { Rectangle rectangle = (Rectangle)instanceObj; int num = (int)valueObj; rectangle.Width = num; - instanceObj = (object)rectangle; + instanceObj = rectangle; } - private static object GetHeight(object instanceObj) => (object)((Rectangle)instanceObj).Height; + private static object GetHeight(object instanceObj) => ((Rectangle)instanceObj).Height; private static void SetHeight(ref object instanceObj, object valueObj) { Rectangle rectangle = (Rectangle)instanceObj; int num = (int)valueObj; rectangle.Height = num; - instanceObj = (object)rectangle; + instanceObj = rectangle; } - private static object GetLeft(object instanceObj) => (object)((Rectangle)instanceObj).Left; + private static object GetLeft(object instanceObj) => ((Rectangle)instanceObj).Left; - private static object GetTop(object instanceObj) => (object)((Rectangle)instanceObj).Top; + private static object GetTop(object instanceObj) => ((Rectangle)instanceObj).Top; - private static object GetRight(object instanceObj) => (object)((Rectangle)instanceObj).Right; + private static object GetRight(object instanceObj) => ((Rectangle)instanceObj).Right; - private static object GetBottom(object instanceObj) => (object)((Rectangle)instanceObj).Bottom; + private static object GetBottom(object instanceObj) => ((Rectangle)instanceObj).Bottom; - private static object Construct() => (object)Rectangle.Zero; + private static object Construct() => Rectangle.Zero; private static Result ConvertFromString(object valueObj, out object instanceObj) { string s = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; int result; - if (!int.TryParse(s, NumberStyles.Integer, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)s, (object)"Int32"); + if (!int.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out result)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", s, "Int32"); Rectangle rectangle1 = new Rectangle(); Rectangle rectangle2 = Rectangle.FromLTRB(result, result, result, result); - instanceObj = (object)rectangle2; + instanceObj = rectangle2; return Result.Success; } private static Result ConvertFromInt32(object valueObj, out object instanceObj) { int num1 = (int)valueObj; - instanceObj = (object)null; + instanceObj = null; int num2 = num1; Rectangle rectangle = Rectangle.FromLTRB(num2, num2, num2, num2); - instanceObj = (object)rectangle; + instanceObj = rectangle; return Result.Success; } private static Result ConvertFromSingle(object valueObj, out object instanceObj) { float num1 = (float)valueObj; - instanceObj = (object)null; + instanceObj = null; int num2 = (int)num1; Rectangle rectangle = Rectangle.FromLTRB(num2, num2, num2, num2); - instanceObj = (object)rectangle; + instanceObj = rectangle; return Result.Success; } @@ -107,7 +107,7 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteInt32(rectangle.Bottom); } - private static object DecodeBinary(ByteCodeReader reader) => (object)Rectangle.FromLTRB(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32()); + private static object DecodeBinary(ByteCodeReader reader) => Rectangle.FromLTRB(reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32(), reader.ReadInt32()); private static object CallContainsPoint(object instanceObj, object[] parameters) => BooleanBoxes.Box(((Rectangle)instanceObj).Contains((Point)parameters[0])); @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (Int32Schema.Type.IsAssignableFrom(fromType)) { result = RectangleSchema.ConvertFromInt32(from, out instance); @@ -164,7 +164,7 @@ namespace Microsoft.Iris.Markup.UIX case OperationType.RelationalNotEquals: return BooleanBoxes.Box(rectangle1 != rectangle2); default: - return (object)null; + return null; } } @@ -173,45 +173,45 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; Rectangle parameter2 = (Rectangle)parameters[1]; object instanceObj1; - return RectangleSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return RectangleSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => RectangleSchema.Type = new UIXTypeSchema((short)169, "Rectangle", (string)null, (short)153, typeof(Rectangle), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => RectangleSchema.Type = new UIXTypeSchema(169, "Rectangle", null, 153, typeof(Rectangle), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)169, "X", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RectangleSchema.GetX), new SetValueHandler(RectangleSchema.SetX), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)169, "Y", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RectangleSchema.GetY), new SetValueHandler(RectangleSchema.SetY), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)169, "Width", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RectangleSchema.GetWidth), new SetValueHandler(RectangleSchema.SetWidth), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)169, "Height", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RectangleSchema.GetHeight), new SetValueHandler(RectangleSchema.SetHeight), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)169, "Left", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RectangleSchema.GetLeft), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)169, "Top", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RectangleSchema.GetTop), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)169, "Right", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RectangleSchema.GetRight), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)169, "Bottom", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RectangleSchema.GetBottom), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)169, "Contains", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(169, "X", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RectangleSchema.GetX), new SetValueHandler(RectangleSchema.SetX), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(169, "Y", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RectangleSchema.GetY), new SetValueHandler(RectangleSchema.SetY), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(169, "Width", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RectangleSchema.GetWidth), new SetValueHandler(RectangleSchema.SetWidth), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(169, "Height", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RectangleSchema.GetHeight), new SetValueHandler(RectangleSchema.SetHeight), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(169, "Left", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RectangleSchema.GetLeft), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(169, "Top", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RectangleSchema.GetTop), null, false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(169, "Right", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RectangleSchema.GetRight), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(169, "Bottom", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RectangleSchema.GetBottom), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(169, "Contains", new short[1] { - (short) 158 - }, (short)15, new InvokeHandler(RectangleSchema.CallContainsPoint), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)169, "TryParse", new short[2] + 158 + }, 15, new InvokeHandler(RectangleSchema.CallContainsPoint), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(169, "TryParse", new short[2] { - (short) 208, - (short) 169 - }, (short)169, new InvokeHandler(RectangleSchema.CallTryParseStringRectangle), true); - RectangleSchema.Type.Initialize(new DefaultConstructHandler(RectangleSchema.Construct), (ConstructorSchema[])null, new PropertySchema[8] + 208, + 169 + }, 169, new InvokeHandler(RectangleSchema.CallTryParseStringRectangle), true); + RectangleSchema.Type.Initialize(new DefaultConstructHandler(RectangleSchema.Construct), null, new PropertySchema[8] { - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema8, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema6, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(RectangleSchema.TryConvertFrom), new SupportsTypeConversionHandler(RectangleSchema.IsConversionSupported), new EncodeBinaryHandler(RectangleSchema.EncodeBinary), new DecodeBinaryHandler(RectangleSchema.DecodeBinary), new PerformOperationHandler(RectangleSchema.ExecuteOperation), new SupportsOperationHandler(RectangleSchema.IsOperationSupported)); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(RectangleSchema.TryConvertFrom), new SupportsTypeConversionHandler(RectangleSchema.IsConversionSupported), new EncodeBinaryHandler(RectangleSchema.EncodeBinary), new DecodeBinaryHandler(RectangleSchema.DecodeBinary), new PerformOperationHandler(RectangleSchema.ExecuteOperation), new SupportsOperationHandler(RectangleSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/RelativeToSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RelativeToSchema.cs index 990d280..cd18cbc 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/RelativeToSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/RelativeToSchema.cs @@ -14,31 +14,31 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetSourceId(object instanceObj) => (object)((RelativeTo)instanceObj).SourceId; + private static object GetSourceId(object instanceObj) => ((RelativeTo)instanceObj).SourceId; private static void SetSourceId(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).SourceId = (int)valueObj; - private static object GetProperty(object instanceObj) => (object)((RelativeTo)instanceObj).Property; + private static object GetProperty(object instanceObj) => ((RelativeTo)instanceObj).Property; private static void SetProperty(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).Property = (string)valueObj; - private static object GetSnapshot(object instanceObj) => (object)((RelativeTo)instanceObj).Snapshot; + private static object GetSnapshot(object instanceObj) => ((RelativeTo)instanceObj).Snapshot; private static void SetSnapshot(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).Snapshot = (SnapshotPolicy)valueObj; - private static object GetPower(object instanceObj) => (object)((RelativeTo)instanceObj).Power; + private static object GetPower(object instanceObj) => ((RelativeTo)instanceObj).Power; private static void SetPower(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).Power = (int)valueObj; - private static object GetMultiply(object instanceObj) => (object)((RelativeTo)instanceObj).Multiply; + private static object GetMultiply(object instanceObj) => ((RelativeTo)instanceObj).Multiply; private static void SetMultiply(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).Multiply = (float)valueObj; - private static object GetAdd(object instanceObj) => (object)((RelativeTo)instanceObj).Add; + private static object GetAdd(object instanceObj) => ((RelativeTo)instanceObj).Add; private static void SetAdd(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).Add = (float)valueObj; - private static object Construct() => (object)new RelativeTo(); + private static object Construct() => new RelativeTo(); private static object ConstructSourceIdProperty(object[] parameters) { @@ -54,14 +54,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = RelativeToSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"RelativeTo", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "RelativeTo", result1.Error); RelativeToSchema.SetSourceId(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], StringSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"RelativeTo", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "RelativeTo", result2.Error); RelativeToSchema.SetProperty(ref instance, valueObj2); return result2; } @@ -69,15 +69,15 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromString(object valueObj, out object instanceObj) { string str = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; RelativeTo instance = RelativeToSchema.StringToInstance(str); if (instance == null) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str, (object)"RelativeTo"); - instanceObj = (object)instance; + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "RelativeTo"); + instanceObj = instance; return Result.Success; } - private static object FindCanonicalInstance(string name) => (object)RelativeToSchema.StringToInstance(name); + private static object FindCanonicalInstance(string name) => RelativeToSchema.StringToInstance(name); private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -87,7 +87,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = RelativeToSchema.ConvertFromString(from, out instance); @@ -104,7 +104,7 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"RelativeTo"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "RelativeTo"); } return result; } @@ -114,7 +114,7 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; RelativeTo parameter2 = (RelativeTo)parameters[1]; object instanceObj1; - return RelativeToSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return RelativeToSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } private static RelativeTo StringToInstance(string value) @@ -125,44 +125,44 @@ namespace Microsoft.Iris.Markup.UIX return RelativeTo.Current; if (value == "CurrentSnapshotOnLoop") return RelativeTo.CurrentSnapshotOnLoop; - return value == "Final" ? RelativeTo.Final : (RelativeTo)null; + return value == "Final" ? RelativeTo.Final : null; } - public static void Pass1Initialize() => RelativeToSchema.Type = new UIXTypeSchema((short)171, "RelativeTo", (string)null, (short)153, typeof(RelativeTo), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => RelativeToSchema.Type = new UIXTypeSchema(171, "RelativeTo", null, 153, typeof(RelativeTo), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)171, "SourceId", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RelativeToSchema.GetSourceId), new SetValueHandler(RelativeToSchema.SetSourceId), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)171, "Property", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RelativeToSchema.GetProperty), new SetValueHandler(RelativeToSchema.SetProperty), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)171, "Snapshot", (short)200, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RelativeToSchema.GetSnapshot), new SetValueHandler(RelativeToSchema.SetSnapshot), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)171, "Power", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RelativeToSchema.GetPower), new SetValueHandler(RelativeToSchema.SetPower), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)171, "Multiply", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RelativeToSchema.GetMultiply), new SetValueHandler(RelativeToSchema.SetMultiply), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)171, "Add", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RelativeToSchema.GetAdd), new SetValueHandler(RelativeToSchema.SetAdd), false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)171, new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(171, "SourceId", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RelativeToSchema.GetSourceId), new SetValueHandler(RelativeToSchema.SetSourceId), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(171, "Property", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RelativeToSchema.GetProperty), new SetValueHandler(RelativeToSchema.SetProperty), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(171, "Snapshot", 200, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RelativeToSchema.GetSnapshot), new SetValueHandler(RelativeToSchema.SetSnapshot), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(171, "Power", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RelativeToSchema.GetPower), new SetValueHandler(RelativeToSchema.SetPower), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(171, "Multiply", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RelativeToSchema.GetMultiply), new SetValueHandler(RelativeToSchema.SetMultiply), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(171, "Add", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RelativeToSchema.GetAdd), new SetValueHandler(RelativeToSchema.SetAdd), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(171, new short[2] { - (short) 115, - (short) 208 + 115, + 208 }, new ConstructHandler(RelativeToSchema.ConstructSourceIdProperty)); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)171, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(171, "TryParse", new short[2] { - (short) 208, - (short) 171 - }, (short)171, new InvokeHandler(RelativeToSchema.CallTryParseStringRelativeTo), true); + 208, + 171 + }, 171, new InvokeHandler(RelativeToSchema.CallTryParseStringRelativeTo), true); RelativeToSchema.Type.Initialize(new DefaultConstructHandler(RelativeToSchema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[6] { - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1 + uixPropertySchema6, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, new FindCanonicalInstanceHandler(RelativeToSchema.FindCanonicalInstance), new TypeConverterHandler(RelativeToSchema.TryConvertFrom), new SupportsTypeConversionHandler(RelativeToSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, new FindCanonicalInstanceHandler(RelativeToSchema.FindCanonicalInstance), new TypeConverterHandler(RelativeToSchema.TryConvertFrom), new SupportsTypeConversionHandler(RelativeToSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/RepeaterSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RepeaterSchema.cs index 75fae87..7055fe1 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/RepeaterSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/RepeaterSchema.cs @@ -14,19 +14,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetContentName(object instanceObj) => (object)((Repeater)instanceObj).ContentName; + private static object GetContentName(object instanceObj) => ((Repeater)instanceObj).ContentName; private static void SetContentName(ref object instanceObj, object valueObj) => ((Repeater)instanceObj).ContentName = (string)valueObj; - private static object GetDividerName(object instanceObj) => (object)((Repeater)instanceObj).DividerName; + private static object GetDividerName(object instanceObj) => ((Repeater)instanceObj).DividerName; private static void SetDividerName(ref object instanceObj, object valueObj) => ((Repeater)instanceObj).DividerName = (string)valueObj; - private static object GetSource(object instanceObj) => (object)((Repeater)instanceObj).Source; + private static object GetSource(object instanceObj) => ((Repeater)instanceObj).Source; private static void SetSource(ref object instanceObj, object valueObj) => ((Repeater)instanceObj).Source = (IList)valueObj; - private static object GetDefaultFocusIndex(object instanceObj) => (object)((Repeater)instanceObj).DefaultFocusIndex; + private static object GetDefaultFocusIndex(object instanceObj) => ((Repeater)instanceObj).DefaultFocusIndex; private static void SetDefaultFocusIndex(ref object instanceObj, object valueObj) => ((Repeater)instanceObj).DefaultFocusIndex = (int)valueObj; @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetDiscardOffscreenVisuals(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).DiscardOffscreenVisuals = (bool)valueObj; - private static object GetContentSelectors(object instanceObj) => (object)((Repeater)instanceObj).ContentSelectors; + private static object GetContentSelectors(object instanceObj) => ((Repeater)instanceObj).ContentSelectors; private static object GetMaintainFocusedItemOnSourceChanges(object instanceObj) => BooleanBoxes.Box(((Repeater)instanceObj).MaintainFocusedItemOnSourceChanges); @@ -55,58 +55,58 @@ namespace Microsoft.Iris.Markup.UIX ((Repeater)instanceObj).MaintainFocusedItemOnSourceChanges = (bool)valueObj; } - private static object Construct() => (object)new Repeater(); + private static object Construct() => new Repeater(); private static object CallNavigateIntoIndexInt32(object instanceObj, object[] parameters) { ((Repeater)instanceObj).NavigateIntoIndex((int)parameters[0]); - return (object)null; + return null; } private static object CallScrollIndexIntoViewInt32(object instanceObj, object[] parameters) { ((Repeater)instanceObj).ScrollIndexIntoView((int)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => RepeaterSchema.Type = new UIXTypeSchema((short)173, "Repeater", (string)null, (short)239, typeof(Repeater), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => RepeaterSchema.Type = new UIXTypeSchema(173, "Repeater", null, 239, typeof(Repeater), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)173, "ContentName", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RepeaterSchema.GetContentName), new SetValueHandler(RepeaterSchema.SetContentName), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)173, "DividerName", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RepeaterSchema.GetDividerName), new SetValueHandler(RepeaterSchema.SetDividerName), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)173, "Source", (short)138, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RepeaterSchema.GetSource), new SetValueHandler(RepeaterSchema.SetSource), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)173, "DefaultFocusIndex", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RepeaterSchema.GetDefaultFocusIndex), new SetValueHandler(RepeaterSchema.SetDefaultFocusIndex), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)173, "Content", (short)239, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(RepeaterSchema.SetContent), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)173, "Divider", (short)239, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(RepeaterSchema.SetDivider), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)173, "DiscardOffscreenVisuals", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RepeaterSchema.GetDiscardOffscreenVisuals), new SetValueHandler(RepeaterSchema.SetDiscardOffscreenVisuals), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)173, "ContentSelectors", (short)138, (short)227, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RepeaterSchema.GetContentSelectors), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)173, "MaintainFocusedItemOnSourceChanges", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(RepeaterSchema.GetMaintainFocusedItemOnSourceChanges), new SetValueHandler(RepeaterSchema.SetMaintainFocusedItemOnSourceChanges), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)173, "NavigateIntoIndex", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(173, "ContentName", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RepeaterSchema.GetContentName), new SetValueHandler(RepeaterSchema.SetContentName), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(173, "DividerName", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RepeaterSchema.GetDividerName), new SetValueHandler(RepeaterSchema.SetDividerName), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(173, "Source", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RepeaterSchema.GetSource), new SetValueHandler(RepeaterSchema.SetSource), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(173, "DefaultFocusIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RepeaterSchema.GetDefaultFocusIndex), new SetValueHandler(RepeaterSchema.SetDefaultFocusIndex), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(173, "Content", 239, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(RepeaterSchema.SetContent), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(173, "Divider", 239, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(RepeaterSchema.SetDivider), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(173, "DiscardOffscreenVisuals", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RepeaterSchema.GetDiscardOffscreenVisuals), new SetValueHandler(RepeaterSchema.SetDiscardOffscreenVisuals), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(173, "ContentSelectors", 138, 227, ExpressionRestriction.None, false, null, true, new GetValueHandler(RepeaterSchema.GetContentSelectors), null, false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(173, "MaintainFocusedItemOnSourceChanges", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(RepeaterSchema.GetMaintainFocusedItemOnSourceChanges), new SetValueHandler(RepeaterSchema.SetMaintainFocusedItemOnSourceChanges), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(173, "NavigateIntoIndex", new short[1] { - (short) 115 - }, (short)240, new InvokeHandler(RepeaterSchema.CallNavigateIntoIndexInt32), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)173, "ScrollIndexIntoView", new short[1] + 115 + }, 240, new InvokeHandler(RepeaterSchema.CallNavigateIntoIndexInt32), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(173, "ScrollIndexIntoView", new short[1] { - (short) 115 - }, (short)240, new InvokeHandler(RepeaterSchema.CallScrollIndexIntoViewInt32), false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)173, "FocusedItemDiscarded"); - RepeaterSchema.Type.Initialize(new DefaultConstructHandler(RepeaterSchema.Construct), (ConstructorSchema[])null, new PropertySchema[9] + 115 + }, 240, new InvokeHandler(RepeaterSchema.CallScrollIndexIntoViewInt32), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(173, "FocusedItemDiscarded"); + RepeaterSchema.Type.Initialize(new DefaultConstructHandler(RepeaterSchema.Construct), null, new PropertySchema[9] { - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema3 + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema8, + uixPropertySchema4, + uixPropertySchema7, + uixPropertySchema6, + uixPropertySchema2, + uixPropertySchema9, + uixPropertySchema3 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, new EventSchema[1] { (EventSchema)uixEventSchema }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2 + }, new EventSchema[1] { uixEventSchema }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/RotateKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RotateKeyframeSchema.cs index 937b8e4..17f9118 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/RotateKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/RotateKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseRotationKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseRotationKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseRotationKeyframe)instanceObj).Value = (Rotation)valueObj; - private static object Construct() => (object)new RotateKeyframe(); + private static object Construct() => new RotateKeyframe(); - public static void Pass1Initialize() => RotateKeyframeSchema.Type = new UIXTypeSchema((short)174, "RotateKeyframe", (string)null, (short)130, typeof(RotateKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => RotateKeyframeSchema.Type = new UIXTypeSchema(174, "RotateKeyframe", null, 130, typeof(RotateKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)174, "Value", (short)176, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RotateKeyframeSchema.GetValue), new SetValueHandler(RotateKeyframeSchema.SetValue), false); - RotateKeyframeSchema.Type.Initialize(new DefaultConstructHandler(RotateKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(174, "Value", 176, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RotateKeyframeSchema.GetValue), new SetValueHandler(RotateKeyframeSchema.SetValue), false); + RotateKeyframeSchema.Type.Initialize(new DefaultConstructHandler(RotateKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/RotateLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RotateLayoutSchema.cs index e7e8d30..087a8b5 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/RotateLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/RotateLayoutSchema.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Markup.UIX public static RangeValidator ValidateRightAngle = new RangeValidator(RotateLayoutSchema.RangeValidateRightAngle); public static UIXTypeSchema Type; - private static object GetAngleDegrees(object instanceObj) => (object)((RotateLayout)instanceObj).AngleDegrees; + private static object GetAngleDegrees(object instanceObj) => ((RotateLayout)instanceObj).AngleDegrees; private static void SetAngleDegrees(ref object instanceObj, object valueObj) { @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Markup.UIX rotateLayout.AngleDegrees = num; } - private static object Construct() => (object)new RotateLayout(); + private static object Construct() => new RotateLayout(); private static Result RangeValidateRightAngle(object value) { @@ -41,19 +41,19 @@ namespace Microsoft.Iris.Markup.UIX case 270: return Result.Success; default: - return Result.Fail("Expecting a value of 0, 90, 180, or 270, but got {0}", (object)num.ToString()); + return Result.Fail("Expecting a value of 0, 90, 180, or 270, but got {0}", num.ToString()); } } - public static void Pass1Initialize() => RotateLayoutSchema.Type = new UIXTypeSchema((short)175, "RotateLayout", (string)null, (short)132, typeof(RotateLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => RotateLayoutSchema.Type = new UIXTypeSchema(175, "RotateLayout", null, 132, typeof(RotateLayout), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)175, "AngleDegrees", (short)115, (short)-1, ExpressionRestriction.None, false, RotateLayoutSchema.ValidateRightAngle, false, new GetValueHandler(RotateLayoutSchema.GetAngleDegrees), new SetValueHandler(RotateLayoutSchema.SetAngleDegrees), false); - RotateLayoutSchema.Type.Initialize(new DefaultConstructHandler(RotateLayoutSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(175, "AngleDegrees", 115, -1, ExpressionRestriction.None, false, RotateLayoutSchema.ValidateRightAngle, false, new GetValueHandler(RotateLayoutSchema.GetAngleDegrees), new SetValueHandler(RotateLayoutSchema.SetAngleDegrees), false); + RotateLayoutSchema.Type.Initialize(new DefaultConstructHandler(RotateLayoutSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/RotationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RotationSchema.cs index ceca764..5c0a0b7 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/RotationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/RotationSchema.cs @@ -15,37 +15,37 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetAxis(object instanceObj) => (object)((Rotation)instanceObj).Axis; + private static object GetAxis(object instanceObj) => ((Rotation)instanceObj).Axis; private static void SetAxis(ref object instanceObj, object valueObj) { Rotation rotation = (Rotation)instanceObj; Vector3 vector3 = (Vector3)valueObj; rotation.Axis = vector3; - instanceObj = (object)rotation; + instanceObj = rotation; } - private static object GetAngleRadians(object instanceObj) => (object)((Rotation)instanceObj).AngleRadians; + private static object GetAngleRadians(object instanceObj) => ((Rotation)instanceObj).AngleRadians; private static void SetAngleRadians(ref object instanceObj, object valueObj) { Rotation rotation = (Rotation)instanceObj; float num = (float)valueObj; rotation.AngleRadians = num; - instanceObj = (object)rotation; + instanceObj = rotation; } - private static object GetAngleDegrees(object instanceObj) => (object)((Rotation)instanceObj).AngleDegrees; + private static object GetAngleDegrees(object instanceObj) => ((Rotation)instanceObj).AngleDegrees; private static void SetAngleDegrees(ref object instanceObj, object valueObj) { Rotation rotation = (Rotation)instanceObj; int num = (int)valueObj; rotation.AngleDegrees = num; - instanceObj = (object)rotation; + instanceObj = rotation; } - private static object Construct() => (object)Rotation.Default; + private static object Construct() => Rotation.Default; private static object ConstructAngleDegrees(object[] parameters) { @@ -87,50 +87,50 @@ namespace Microsoft.Iris.Markup.UIX private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) { Rotation rotation = (Rotation)instanceObj; - Vector3Schema.Type.EncodeBinary(writer, (object)rotation.Axis); + Vector3Schema.Type.EncodeBinary(writer, rotation.Axis); writer.WriteSingle(rotation.AngleRadians); } private static object DecodeBinary(ByteCodeReader reader) { Vector3 axis = (Vector3)Vector3Schema.Type.DecodeBinary(reader); - return (object)new Rotation(reader.ReadSingle(), axis); + return new Rotation(reader.ReadSingle(), axis); } private static Result ConvertFromString(object valueObj, out object instanceObj) { string str1 = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; Rotation rotation = Rotation.Default; string[] strArray = str1.Split(';'); if (strArray.Length != 2) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)str1, (object)"Rotation"); + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str1, "Rotation"); string str2 = strArray[1]; object instance1; - Result result1 = Vector3Schema.Type.TypeConverter((object)str2, (TypeSchema)StringSchema.Type, out instance1); + Result result1 = Vector3Schema.Type.TypeConverter(str2, StringSchema.Type, out instance1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Rotation", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Rotation", result1.Error); rotation.Axis = (Vector3)instance1; string str3 = strArray[0]; if (str3.EndsWith("rad", StringComparison.Ordinal)) { string str4 = str3.Substring(0, str3.Length - 3); object instance2; - Result result2 = SingleSchema.Type.TypeConverter((object)str4, (TypeSchema)StringSchema.Type, out instance2); + Result result2 = SingleSchema.Type.TypeConverter(str4, StringSchema.Type, out instance2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Rotation", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Rotation", result2.Error); rotation.AngleRadians = (float)instance2; } else if (str3.EndsWith("deg", StringComparison.Ordinal)) { string str4 = str3.Substring(0, str3.Length - 3); object instance2; - Result result2 = Int32Schema.Type.TypeConverter((object)str4, (TypeSchema)StringSchema.Type, out instance2); + Result result2 = Int32Schema.Type.TypeConverter(str4, StringSchema.Type, out instance2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Rotation", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Rotation", result2.Error); rotation.AngleDegrees = (int)instance2; } - instanceObj = (object)rotation; + instanceObj = rotation; return Result.Success; } @@ -142,7 +142,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { result = RotationSchema.ConvertFromString(from, out instance); @@ -157,59 +157,59 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; Rotation parameter2 = (Rotation)parameters[1]; object instanceObj1; - return RotationSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return RotationSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } - public static void Pass1Initialize() => RotationSchema.Type = new UIXTypeSchema((short)176, "Rotation", (string)null, (short)153, typeof(Rotation), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => RotationSchema.Type = new UIXTypeSchema(176, "Rotation", null, 153, typeof(Rotation), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)176, "Axis", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RotationSchema.GetAxis), new SetValueHandler(RotationSchema.SetAxis), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)176, "AngleRadians", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RotationSchema.GetAngleRadians), new SetValueHandler(RotationSchema.SetAngleRadians), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)176, "AngleDegrees", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(RotationSchema.GetAngleDegrees), new SetValueHandler(RotationSchema.SetAngleDegrees), false); - UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema((short)176, new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(176, "Axis", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RotationSchema.GetAxis), new SetValueHandler(RotationSchema.SetAxis), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(176, "AngleRadians", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RotationSchema.GetAngleRadians), new SetValueHandler(RotationSchema.SetAngleRadians), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(176, "AngleDegrees", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(RotationSchema.GetAngleDegrees), new SetValueHandler(RotationSchema.SetAngleDegrees), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(176, new short[1] { - (short) 115 + 115 }, new ConstructHandler(RotationSchema.ConstructAngleDegrees)); - UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema((short)176, new short[1] + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(176, new short[1] { - (short) 194 + 194 }, new ConstructHandler(RotationSchema.ConstructAngleRadians)); - UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema((short)176, new short[2] + UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema(176, new short[2] { - (short) 115, - (short) 234 + 115, + 234 }, new ConstructHandler(RotationSchema.ConstructAngleDegreesAxis)); - UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema((short)176, new short[2] + UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema(176, new short[2] { - (short) 194, - (short) 234 + 194, + 234 }, new ConstructHandler(RotationSchema.ConstructAngleRadiansAxis)); - UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema((short)176, new short[1] + UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema(176, new short[1] { - (short) 234 + 234 }, new ConstructHandler(RotationSchema.ConstructAxis)); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)176, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(176, "TryParse", new short[2] { - (short) 208, - (short) 176 - }, (short)176, new InvokeHandler(RotationSchema.CallTryParseStringRotation), true); + 208, + 176 + }, 176, new InvokeHandler(RotationSchema.CallTryParseStringRotation), true); RotationSchema.Type.Initialize(new DefaultConstructHandler(RotationSchema.Construct), new ConstructorSchema[5] { - (ConstructorSchema) constructorSchema1, - (ConstructorSchema) constructorSchema2, - (ConstructorSchema) constructorSchema3, - (ConstructorSchema) constructorSchema4, - (ConstructorSchema) constructorSchema5 + constructorSchema1, + constructorSchema2, + constructorSchema3, + constructorSchema4, + constructorSchema5 }, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(RotationSchema.TryConvertFrom), new SupportsTypeConversionHandler(RotationSchema.IsConversionSupported), new EncodeBinaryHandler(RotationSchema.EncodeBinary), new DecodeBinaryHandler(RotationSchema.DecodeBinary), (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, new TypeConverterHandler(RotationSchema.TryConvertFrom), new SupportsTypeConversionHandler(RotationSchema.IsConversionSupported), new EncodeBinaryHandler(RotationSchema.EncodeBinary), new DecodeBinaryHandler(RotationSchema.DecodeBinary), null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SavedKeyFocusSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SavedKeyFocusSchema.cs index dc232e9..7749d1b 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SavedKeyFocusSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SavedKeyFocusSchema.cs @@ -12,8 +12,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => SavedKeyFocusSchema.Type = new UIXTypeSchema((short)177, "SavedKeyFocus", (string)null, (short)153, typeof(SavedKeyFocus), UIXTypeFlags.None); + public static void Pass1Initialize() => SavedKeyFocusSchema.Type = new UIXTypeSchema(177, "SavedKeyFocus", null, 153, typeof(SavedKeyFocus), UIXTypeFlags.None); - public static void Pass2Initialize() => SavedKeyFocusSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => SavedKeyFocusSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ScaleKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ScaleKeyframeSchema.cs index de5092b..c0144a0 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ScaleKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ScaleKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseVector3Keyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseVector3Keyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseVector3Keyframe)instanceObj).Value = (Vector3)valueObj; - private static object Construct() => (object)new ScaleKeyframe(); + private static object Construct() => new ScaleKeyframe(); - public static void Pass1Initialize() => ScaleKeyframeSchema.Type = new UIXTypeSchema((short)178, "ScaleKeyframe", (string)null, (short)130, typeof(ScaleKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => ScaleKeyframeSchema.Type = new UIXTypeSchema(178, "ScaleKeyframe", null, 130, typeof(ScaleKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)178, "Value", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ScaleKeyframeSchema.GetValue), new SetValueHandler(ScaleKeyframeSchema.SetValue), false); - ScaleKeyframeSchema.Type.Initialize(new DefaultConstructHandler(ScaleKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(178, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ScaleKeyframeSchema.GetValue), new SetValueHandler(ScaleKeyframeSchema.SetValue), false); + ScaleKeyframeSchema.Type.Initialize(new DefaultConstructHandler(ScaleKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ScaleLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ScaleLayoutSchema.cs index b51fbbd..2933c44 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ScaleLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ScaleLayoutSchema.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetMinimumScale(object instanceObj) => (object)((ScaleLayout)instanceObj).MinimumScale; + private static object GetMinimumScale(object instanceObj) => ((ScaleLayout)instanceObj).MinimumScale; private static void SetMinimumScale(ref object instanceObj, object valueObj) { @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Markup.UIX scaleLayout.MinimumScale = vector2; } - private static object GetMaximumScale(object instanceObj) => (object)((ScaleLayout)instanceObj).MaximumScale; + private static object GetMaximumScale(object instanceObj) => ((ScaleLayout)instanceObj).MaximumScale; private static void SetMaximumScale(ref object instanceObj, object valueObj) { @@ -45,21 +45,21 @@ namespace Microsoft.Iris.Markup.UIX private static void SetMaintainAspectRatio(ref object instanceObj, object valueObj) => ((ScaleLayout)instanceObj).MaintainAspectRatio = (bool)valueObj; - private static object Construct() => (object)new ScaleLayout(); + private static object Construct() => new ScaleLayout(); - public static void Pass1Initialize() => ScaleLayoutSchema.Type = new UIXTypeSchema((short)179, "ScaleLayout", (string)null, (short)132, typeof(ScaleLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => ScaleLayoutSchema.Type = new UIXTypeSchema(179, "ScaleLayout", null, 132, typeof(ScaleLayout), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)179, "MinimumScale", (short)233, (short)-1, ExpressionRestriction.None, false, Vector2Schema.ValidateNotNegative, false, new GetValueHandler(ScaleLayoutSchema.GetMinimumScale), new SetValueHandler(ScaleLayoutSchema.SetMinimumScale), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)179, "MaximumScale", (short)233, (short)-1, ExpressionRestriction.None, false, Vector2Schema.ValidateNotNegative, false, new GetValueHandler(ScaleLayoutSchema.GetMaximumScale), new SetValueHandler(ScaleLayoutSchema.SetMaximumScale), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)179, "MaintainAspectRatio", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ScaleLayoutSchema.GetMaintainAspectRatio), new SetValueHandler(ScaleLayoutSchema.SetMaintainAspectRatio), false); - ScaleLayoutSchema.Type.Initialize(new DefaultConstructHandler(ScaleLayoutSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(179, "MinimumScale", 233, -1, ExpressionRestriction.None, false, Vector2Schema.ValidateNotNegative, false, new GetValueHandler(ScaleLayoutSchema.GetMinimumScale), new SetValueHandler(ScaleLayoutSchema.SetMinimumScale), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(179, "MaximumScale", 233, -1, ExpressionRestriction.None, false, Vector2Schema.ValidateNotNegative, false, new GetValueHandler(ScaleLayoutSchema.GetMaximumScale), new SetValueHandler(ScaleLayoutSchema.SetMaximumScale), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(179, "MaintainAspectRatio", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ScaleLayoutSchema.GetMaintainAspectRatio), new SetValueHandler(ScaleLayoutSchema.SetMaintainAspectRatio), false); + ScaleLayoutSchema.Type.Initialize(new DefaultConstructHandler(ScaleLayoutSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ScaleXKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ScaleXKeyframeSchema.cs index 0c26c10..ff948d6 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ScaleXKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ScaleXKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new ScaleXKeyframe(); + private static object Construct() => new ScaleXKeyframe(); - public static void Pass1Initialize() => ScaleXKeyframeSchema.Type = new UIXTypeSchema((short)180, "ScaleXKeyframe", (string)null, (short)130, typeof(ScaleXKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => ScaleXKeyframeSchema.Type = new UIXTypeSchema(180, "ScaleXKeyframe", null, 130, typeof(ScaleXKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)180, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ScaleXKeyframeSchema.GetValue), new SetValueHandler(ScaleXKeyframeSchema.SetValue), false); - ScaleXKeyframeSchema.Type.Initialize(new DefaultConstructHandler(ScaleXKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(180, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ScaleXKeyframeSchema.GetValue), new SetValueHandler(ScaleXKeyframeSchema.SetValue), false); + ScaleXKeyframeSchema.Type.Initialize(new DefaultConstructHandler(ScaleXKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ScaleYKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ScaleYKeyframeSchema.cs index 9c7f641..ba963f7 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ScaleYKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ScaleYKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new ScaleYKeyframe(); + private static object Construct() => new ScaleYKeyframe(); - public static void Pass1Initialize() => ScaleYKeyframeSchema.Type = new UIXTypeSchema((short)181, "ScaleYKeyframe", (string)null, (short)130, typeof(ScaleYKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => ScaleYKeyframeSchema.Type = new UIXTypeSchema(181, "ScaleYKeyframe", null, 130, typeof(ScaleYKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)181, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ScaleYKeyframeSchema.GetValue), new SetValueHandler(ScaleYKeyframeSchema.SetValue), false); - ScaleYKeyframeSchema.Type.Initialize(new DefaultConstructHandler(ScaleYKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(181, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ScaleYKeyframeSchema.GetValue), new SetValueHandler(ScaleYKeyframeSchema.SetValue), false); + ScaleYKeyframeSchema.Type.Initialize(new DefaultConstructHandler(ScaleYKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ScrollModelBaseSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ScrollModelBaseSchema.cs index bc38642..1aff71a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ScrollModelBaseSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ScrollModelBaseSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetScrollStep(object instanceObj) => (object)((ScrollModelBase)instanceObj).ScrollStep; + private static object GetScrollStep(object instanceObj) => ((ScrollModelBase)instanceObj).ScrollStep; private static void SetScrollStep(ref object instanceObj, object valueObj) { @@ -31,107 +31,107 @@ namespace Microsoft.Iris.Markup.UIX private static object GetCanScrollDown(object instanceObj) => BooleanBoxes.Box(((ScrollModelBase)instanceObj).CanScrollDown); - private static object GetCurrentPage(object instanceObj) => (object)((ScrollModelBase)instanceObj).CurrentPage; + private static object GetCurrentPage(object instanceObj) => ((ScrollModelBase)instanceObj).CurrentPage; - private static object GetTotalPages(object instanceObj) => (object)((ScrollModelBase)instanceObj).TotalPages; + private static object GetTotalPages(object instanceObj) => ((ScrollModelBase)instanceObj).TotalPages; - private static object GetViewNear(object instanceObj) => (object)((ScrollModelBase)instanceObj).ViewNear; + private static object GetViewNear(object instanceObj) => ((ScrollModelBase)instanceObj).ViewNear; - private static object GetViewFar(object instanceObj) => (object)((ScrollModelBase)instanceObj).ViewFar; + private static object GetViewFar(object instanceObj) => ((ScrollModelBase)instanceObj).ViewFar; private static object CallScrollInt32(object instanceObj, object[] parameters) { ((ScrollModelBase)instanceObj).Scroll((int)parameters[0]); - return (object)null; + return null; } private static object CallScrollUp(object instanceObj, object[] parameters) { ((ScrollModelBase)instanceObj).ScrollUp(); - return (object)null; + return null; } private static object CallScrollDown(object instanceObj, object[] parameters) { ((ScrollModelBase)instanceObj).ScrollDown(); - return (object)null; + return null; } private static object CallPageUp(object instanceObj, object[] parameters) { ((ScrollModelBase)instanceObj).PageUp(); - return (object)null; + return null; } private static object CallPageDown(object instanceObj, object[] parameters) { ((ScrollModelBase)instanceObj).PageDown(); - return (object)null; + return null; } private static object CallHome(object instanceObj, object[] parameters) { ((ScrollModelBase)instanceObj).Home(); - return (object)null; + return null; } private static object CallEnd(object instanceObj, object[] parameters) { ((ScrollModelBase)instanceObj).End(); - return (object)null; + return null; } private static object CallScrollToPositionSingle(object instanceObj, object[] parameters) { ((ScrollModelBase)instanceObj).ScrollToPosition((float)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => ScrollModelBaseSchema.Type = new UIXTypeSchema((short)183, "ScrollModelBase", (string)null, (short)153, typeof(ScrollModelBase), UIXTypeFlags.None); + public static void Pass1Initialize() => ScrollModelBaseSchema.Type = new UIXTypeSchema(183, "ScrollModelBase", null, 153, typeof(ScrollModelBase), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)183, "ScrollStep", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ScrollModelBaseSchema.GetScrollStep), new SetValueHandler(ScrollModelBaseSchema.SetScrollStep), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)183, "CanScrollUp", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelBaseSchema.GetCanScrollUp), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)183, "CanScrollDown", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelBaseSchema.GetCanScrollDown), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)183, "CurrentPage", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelBaseSchema.GetCurrentPage), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)183, "TotalPages", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelBaseSchema.GetTotalPages), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)183, "ViewNear", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelBaseSchema.GetViewNear), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)183, "ViewFar", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelBaseSchema.GetViewFar), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)183, "Scroll", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(183, "ScrollStep", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ScrollModelBaseSchema.GetScrollStep), new SetValueHandler(ScrollModelBaseSchema.SetScrollStep), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(183, "CanScrollUp", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelBaseSchema.GetCanScrollUp), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(183, "CanScrollDown", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelBaseSchema.GetCanScrollDown), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(183, "CurrentPage", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelBaseSchema.GetCurrentPage), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(183, "TotalPages", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelBaseSchema.GetTotalPages), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(183, "ViewNear", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelBaseSchema.GetViewNear), null, false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(183, "ViewFar", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelBaseSchema.GetViewFar), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(183, "Scroll", new short[1] { - (short) 115 - }, (short)240, new InvokeHandler(ScrollModelBaseSchema.CallScrollInt32), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)183, "ScrollUp", (short[])null, (short)240, new InvokeHandler(ScrollModelBaseSchema.CallScrollUp), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)183, "ScrollDown", (short[])null, (short)240, new InvokeHandler(ScrollModelBaseSchema.CallScrollDown), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)183, "PageUp", (short[])null, (short)240, new InvokeHandler(ScrollModelBaseSchema.CallPageUp), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)183, "PageDown", (short[])null, (short)240, new InvokeHandler(ScrollModelBaseSchema.CallPageDown), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)183, "Home", (short[])null, (short)240, new InvokeHandler(ScrollModelBaseSchema.CallHome), false); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)183, "End", (short[])null, (short)240, new InvokeHandler(ScrollModelBaseSchema.CallEnd), false); - UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema((short)183, "ScrollToPosition", new short[1] + 115 + }, 240, new InvokeHandler(ScrollModelBaseSchema.CallScrollInt32), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(183, "ScrollUp", null, 240, new InvokeHandler(ScrollModelBaseSchema.CallScrollUp), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(183, "ScrollDown", null, 240, new InvokeHandler(ScrollModelBaseSchema.CallScrollDown), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(183, "PageUp", null, 240, new InvokeHandler(ScrollModelBaseSchema.CallPageUp), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(183, "PageDown", null, 240, new InvokeHandler(ScrollModelBaseSchema.CallPageDown), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(183, "Home", null, 240, new InvokeHandler(ScrollModelBaseSchema.CallHome), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(183, "End", null, 240, new InvokeHandler(ScrollModelBaseSchema.CallEnd), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(183, "ScrollToPosition", new short[1] { - (short) 194 - }, (short)240, new InvokeHandler(ScrollModelBaseSchema.CallScrollToPositionSingle), false); - ScrollModelBaseSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[7] + 194 + }, 240, new InvokeHandler(ScrollModelBaseSchema.CallScrollToPositionSingle), false); + ScrollModelBaseSchema.Type.Initialize(null, null, new PropertySchema[7] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema6 + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema6 }, new MethodSchema[8] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7, - (MethodSchema) uixMethodSchema8 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ScrollModelSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ScrollModelSchema.cs index 2871a77..624c0b5 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ScrollModelSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ScrollModelSchema.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetEnabled(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).Enabled = (bool)valueObj; - private static object GetPageStep(object instanceObj) => (object)((ScrollModel)instanceObj).PageStep; + private static object GetPageStep(object instanceObj) => ((ScrollModel)instanceObj).PageStep; private static void SetPageStep(ref object instanceObj, object valueObj) { @@ -36,19 +36,19 @@ namespace Microsoft.Iris.Markup.UIX private static void SetPageSizedScrollStep(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).PageSizedScrollStep = (bool)valueObj; - private static object GetBeginPadding(object instanceObj) => (object)((ScrollModel)instanceObj).BeginPadding; + private static object GetBeginPadding(object instanceObj) => ((ScrollModel)instanceObj).BeginPadding; private static void SetBeginPadding(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).BeginPadding = (int)valueObj; - private static object GetEndPadding(object instanceObj) => (object)((ScrollModel)instanceObj).EndPadding; + private static object GetEndPadding(object instanceObj) => ((ScrollModel)instanceObj).EndPadding; private static void SetEndPadding(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).EndPadding = (int)valueObj; - private static object GetBeginPaddingRelativeTo(object instanceObj) => (object)((ScrollModel)instanceObj).BeginPaddingRelativeTo; + private static object GetBeginPaddingRelativeTo(object instanceObj) => ((ScrollModel)instanceObj).BeginPaddingRelativeTo; private static void SetBeginPaddingRelativeTo(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).BeginPaddingRelativeTo = (RelativeEdge)valueObj; - private static object GetEndPaddingRelativeTo(object instanceObj) => (object)((ScrollModel)instanceObj).EndPaddingRelativeTo; + private static object GetEndPaddingRelativeTo(object instanceObj) => ((ScrollModel)instanceObj).EndPaddingRelativeTo; private static void SetEndPaddingRelativeTo(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).EndPaddingRelativeTo = (RelativeEdge)valueObj; @@ -56,59 +56,59 @@ namespace Microsoft.Iris.Markup.UIX private static void SetLocked(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).Locked = (bool)valueObj; - private static object GetLockedPosition(object instanceObj) => (object)((ScrollModel)instanceObj).LockedPosition; + private static object GetLockedPosition(object instanceObj) => ((ScrollModel)instanceObj).LockedPosition; private static void SetLockedPosition(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).LockedPosition = (float)valueObj; - private static object GetLockedAlignment(object instanceObj) => (object)((ScrollModel)instanceObj).LockedAlignment; + private static object GetLockedAlignment(object instanceObj) => ((ScrollModel)instanceObj).LockedAlignment; private static void SetLockedAlignment(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).LockedAlignment = (float)valueObj; - private static object GetContentPositioningBehavior(object instanceObj) => (object)((ScrollModel)instanceObj).ContentPositioningBehavior; + private static object GetContentPositioningBehavior(object instanceObj) => ((ScrollModel)instanceObj).ContentPositioningBehavior; private static void SetContentPositioningBehavior(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).ContentPositioningBehavior = (ContentPositioningPolicy)valueObj; - private static object Construct() => (object)new ScrollModel(); + private static object Construct() => new ScrollModel(); private static object CallScrollFocusIntoView(object instanceObj, object[] parameters) { ((ScrollModel)instanceObj).ScrollFocusIntoView(); - return (object)null; + return null; } - public static void Pass1Initialize() => ScrollModelSchema.Type = new UIXTypeSchema((short)182, "ScrollModel", (string)null, (short)183, typeof(ScrollModel), UIXTypeFlags.None); + public static void Pass1Initialize() => ScrollModelSchema.Type = new UIXTypeSchema(182, "ScrollModel", null, 183, typeof(ScrollModel), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)182, "Enabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetEnabled), new SetValueHandler(ScrollModelSchema.SetEnabled), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)182, "PageStep", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(ScrollModelSchema.GetPageStep), new SetValueHandler(ScrollModelSchema.SetPageStep), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)182, "PageSizedScrollStep", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetPageSizedScrollStep), new SetValueHandler(ScrollModelSchema.SetPageSizedScrollStep), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)182, "BeginPadding", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetBeginPadding), new SetValueHandler(ScrollModelSchema.SetBeginPadding), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)182, "EndPadding", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetEndPadding), new SetValueHandler(ScrollModelSchema.SetEndPadding), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)182, "BeginPaddingRelativeTo", (short)170, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetBeginPaddingRelativeTo), new SetValueHandler(ScrollModelSchema.SetBeginPaddingRelativeTo), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)182, "EndPaddingRelativeTo", (short)170, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetEndPaddingRelativeTo), new SetValueHandler(ScrollModelSchema.SetEndPaddingRelativeTo), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)182, "Locked", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetLocked), new SetValueHandler(ScrollModelSchema.SetLocked), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)182, "LockedPosition", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetLockedPosition), new SetValueHandler(ScrollModelSchema.SetLockedPosition), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)182, "LockedAlignment", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetLockedAlignment), new SetValueHandler(ScrollModelSchema.SetLockedAlignment), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)182, "ContentPositioningBehavior", (short)41, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollModelSchema.GetContentPositioningBehavior), new SetValueHandler(ScrollModelSchema.SetContentPositioningBehavior), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)182, "ScrollFocusIntoView", (short[])null, (short)240, new InvokeHandler(ScrollModelSchema.CallScrollFocusIntoView), false); - ScrollModelSchema.Type.Initialize(new DefaultConstructHandler(ScrollModelSchema.Construct), (ConstructorSchema[])null, new PropertySchema[11] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(182, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetEnabled), new SetValueHandler(ScrollModelSchema.SetEnabled), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(182, "PageStep", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(ScrollModelSchema.GetPageStep), new SetValueHandler(ScrollModelSchema.SetPageStep), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(182, "PageSizedScrollStep", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetPageSizedScrollStep), new SetValueHandler(ScrollModelSchema.SetPageSizedScrollStep), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(182, "BeginPadding", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetBeginPadding), new SetValueHandler(ScrollModelSchema.SetBeginPadding), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(182, "EndPadding", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetEndPadding), new SetValueHandler(ScrollModelSchema.SetEndPadding), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(182, "BeginPaddingRelativeTo", 170, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetBeginPaddingRelativeTo), new SetValueHandler(ScrollModelSchema.SetBeginPaddingRelativeTo), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(182, "EndPaddingRelativeTo", 170, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetEndPaddingRelativeTo), new SetValueHandler(ScrollModelSchema.SetEndPaddingRelativeTo), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(182, "Locked", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetLocked), new SetValueHandler(ScrollModelSchema.SetLocked), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(182, "LockedPosition", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetLockedPosition), new SetValueHandler(ScrollModelSchema.SetLockedPosition), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(182, "LockedAlignment", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetLockedAlignment), new SetValueHandler(ScrollModelSchema.SetLockedAlignment), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(182, "ContentPositioningBehavior", 41, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollModelSchema.GetContentPositioningBehavior), new SetValueHandler(ScrollModelSchema.SetContentPositioningBehavior), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(182, "ScrollFocusIntoView", null, 240, new InvokeHandler(ScrollModelSchema.CallScrollFocusIntoView), false); + ScrollModelSchema.Type.Initialize(new DefaultConstructHandler(ScrollModelSchema.Construct), null, new PropertySchema[11] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2 + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema11, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema10, + uixPropertySchema9, + uixPropertySchema3, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ScrollerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ScrollerSchema.cs index 0e6a3d3..229fedc 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ScrollerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ScrollerSchema.cs @@ -15,11 +15,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetScrollModel(object instanceObj) => (object)((Scroller)instanceObj).ScrollModel; + private static object GetScrollModel(object instanceObj) => ((Scroller)instanceObj).ScrollModel; private static void SetScrollModel(ref object instanceObj, object valueObj) => ((Scroller)instanceObj).ScrollModel = (ScrollModel)valueObj; - private static object GetPrefetch(object instanceObj) => (object)((Scroller)instanceObj).Prefetch; + private static object GetPrefetch(object instanceObj) => ((Scroller)instanceObj).Prefetch; private static void SetPrefetch(ref object instanceObj, object valueObj) { @@ -32,19 +32,19 @@ namespace Microsoft.Iris.Markup.UIX scroller.Prefetch = num; } - private static object Construct() => (object)new Scroller(); + private static object Construct() => new Scroller(); - public static void Pass1Initialize() => ScrollerSchema.Type = new UIXTypeSchema((short)184, "Scroller", (string)null, (short)34, typeof(Scroller), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => ScrollerSchema.Type = new UIXTypeSchema(184, "Scroller", null, 34, typeof(Scroller), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)184, "ScrollModel", (short)182, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollerSchema.GetScrollModel), new SetValueHandler(ScrollerSchema.SetScrollModel), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)184, "Prefetch", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ScrollerSchema.GetPrefetch), new SetValueHandler(ScrollerSchema.SetPrefetch), false); - ScrollerSchema.Type.Initialize(new DefaultConstructHandler(ScrollerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(184, "ScrollModel", 182, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollerSchema.GetScrollModel), new SetValueHandler(ScrollerSchema.SetScrollModel), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(184, "Prefetch", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ScrollerSchema.GetPrefetch), new SetValueHandler(ScrollerSchema.SetPrefetch), false); + ScrollerSchema.Type.Initialize(new DefaultConstructHandler(ScrollerSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ScrollingHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ScrollingHandlerSchema.cs index 424243e..33c55e8 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ScrollingHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ScrollingHandlerSchema.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetHandleMouseWheel(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).HandleMouseWheel = (bool)valueObj; - private static object GetScrollModel(object instanceObj) => (object)((ScrollingHandler)instanceObj).ScrollModel; + private static object GetScrollModel(object instanceObj) => ((ScrollingHandler)instanceObj).ScrollModel; private static void SetScrollModel(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).ScrollModel = (ScrollModel)valueObj; @@ -42,35 +42,35 @@ namespace Microsoft.Iris.Markup.UIX private static void SetUseFocusBehavior(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).UseFocusBehavior = (bool)valueObj; - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; - private static object Construct() => (object)new ScrollingHandler(); + private static object Construct() => new ScrollingHandler(); - public static void Pass1Initialize() => ScrollingHandlerSchema.Type = new UIXTypeSchema((short)185, "ScrollingHandler", (string)null, (short)110, typeof(ScrollingHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => ScrollingHandlerSchema.Type = new UIXTypeSchema(185, "ScrollingHandler", null, 110, typeof(ScrollingHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)185, "HandleDirectionalKeys", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandleDirectionalKeys), new SetValueHandler(ScrollingHandlerSchema.SetHandleDirectionalKeys), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)185, "HandlePageKeys", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandlePageKeys), new SetValueHandler(ScrollingHandlerSchema.SetHandlePageKeys), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)185, "HandleHomeEndKeys", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandleHomeEndKeys), new SetValueHandler(ScrollingHandlerSchema.SetHandleHomeEndKeys), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)185, "HandlePageCommands", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandlePageCommands), new SetValueHandler(ScrollingHandlerSchema.SetHandlePageCommands), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)185, "HandleMouseWheel", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandleMouseWheel), new SetValueHandler(ScrollingHandlerSchema.SetHandleMouseWheel), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)185, "ScrollModel", (short)182, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollingHandlerSchema.GetScrollModel), new SetValueHandler(ScrollingHandlerSchema.SetScrollModel), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)185, "UseFocusBehavior", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollingHandlerSchema.GetUseFocusBehavior), new SetValueHandler(ScrollingHandlerSchema.SetUseFocusBehavior), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)185, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandlerStage), new SetValueHandler(ScrollingHandlerSchema.SetHandlerStage), false); - ScrollingHandlerSchema.Type.Initialize(new DefaultConstructHandler(ScrollingHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[8] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(185, "HandleDirectionalKeys", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandleDirectionalKeys), new SetValueHandler(ScrollingHandlerSchema.SetHandleDirectionalKeys), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(185, "HandlePageKeys", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandlePageKeys), new SetValueHandler(ScrollingHandlerSchema.SetHandlePageKeys), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(185, "HandleHomeEndKeys", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandleHomeEndKeys), new SetValueHandler(ScrollingHandlerSchema.SetHandleHomeEndKeys), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(185, "HandlePageCommands", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandlePageCommands), new SetValueHandler(ScrollingHandlerSchema.SetHandlePageCommands), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(185, "HandleMouseWheel", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandleMouseWheel), new SetValueHandler(ScrollingHandlerSchema.SetHandleMouseWheel), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(185, "ScrollModel", 182, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollingHandlerSchema.GetScrollModel), new SetValueHandler(ScrollingHandlerSchema.SetScrollModel), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(185, "UseFocusBehavior", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollingHandlerSchema.GetUseFocusBehavior), new SetValueHandler(ScrollingHandlerSchema.SetUseFocusBehavior), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(185, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ScrollingHandlerSchema.GetHandlerStage), new SetValueHandler(ScrollingHandlerSchema.SetHandlerStage), false); + ScrollingHandlerSchema.Type.Initialize(new DefaultConstructHandler(ScrollingHandlerSchema.Construct), null, new PropertySchema[8] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema7 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema2, + uixPropertySchema8, + uixPropertySchema6, + uixPropertySchema7 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SelectionManagerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SelectionManagerSchema.cs index c1b3e2e..024ec95 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SelectionManagerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SelectionManagerSchema.cs @@ -14,43 +14,43 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetCount(object instanceObj) => (object)((SelectionManager)instanceObj).Count; + private static object GetCount(object instanceObj) => ((SelectionManager)instanceObj).Count; - private static object GetSourceList(object instanceObj) => (object)((SelectionManager)instanceObj).SourceList; + private static object GetSourceList(object instanceObj) => ((SelectionManager)instanceObj).SourceList; private static void SetSourceList(ref object instanceObj, object valueObj) => ((SelectionManager)instanceObj).SourceList = (IList)valueObj; - private static object GetAnchor(object instanceObj) => (object)((SelectionManager)instanceObj).Anchor; + private static object GetAnchor(object instanceObj) => ((SelectionManager)instanceObj).Anchor; private static void SetAnchor(ref object instanceObj, object valueObj) => ((SelectionManager)instanceObj).Anchor = (int)valueObj; - private static object GetSelectedIndices(object instanceObj) => (object)((SelectionManager)instanceObj).SelectedIndices; + private static object GetSelectedIndices(object instanceObj) => ((SelectionManager)instanceObj).SelectedIndices; - private static object GetSelectedItems(object instanceObj) => (object)((SelectionManager)instanceObj).SelectedItems; + private static object GetSelectedItems(object instanceObj) => ((SelectionManager)instanceObj).SelectedItems; private static object GetSingleSelect(object instanceObj) => BooleanBoxes.Box(((SelectionManager)instanceObj).SingleSelect); private static void SetSingleSelect(ref object instanceObj, object valueObj) => ((SelectionManager)instanceObj).SingleSelect = (bool)valueObj; - private static object GetSelectedIndex(object instanceObj) => (object)((SelectionManager)instanceObj).SelectedIndex; + private static object GetSelectedIndex(object instanceObj) => ((SelectionManager)instanceObj).SelectedIndex; private static void SetSelectedIndex(ref object instanceObj, object valueObj) => ((SelectionManager)instanceObj).SelectedIndex = (int)valueObj; private static object GetSelectedItem(object instanceObj) => ((SelectionManager)instanceObj).SelectedItem; - private static object Construct() => (object)new SelectionManager(); + private static object Construct() => new SelectionManager(); - private static object CallIsSelectedInt32(object instanceObj, object[] parameters) => (object)((SelectionManager)instanceObj).IsSelected((int)parameters[0]); + private static object CallIsSelectedInt32(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).IsSelected((int)parameters[0]); - private static object CallIsRangeSelectedInt32Int32(object instanceObj, object[] parameters) => (object)((SelectionManager)instanceObj).IsRangeSelected((int)parameters[0], (int)parameters[1]); + private static object CallIsRangeSelectedInt32Int32(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).IsRangeSelected((int)parameters[0], (int)parameters[1]); private static object CallClear(object instanceObj, object[] parameters) { ((SelectionManager)instanceObj).Clear(); - return (object)null; + return null; } - private static object CallSelectInt32Boolean(object instanceObj, object[] parameters) => (object)((SelectionManager)instanceObj).Select((int)parameters[0], (bool)parameters[1]); + private static object CallSelectInt32Boolean(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).Select((int)parameters[0], (bool)parameters[1]); private static object CallSelectListBoolean(object instanceObj, object[] parameters) { @@ -59,21 +59,21 @@ namespace Microsoft.Iris.Markup.UIX bool parameter2 = (bool)parameters[1]; if (parameter1 == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"indices"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "indices"); + return null; } - foreach (object obj in (IEnumerable)parameter1) + foreach (object obj in parameter1) { if (!(obj is int)) { - ErrorManager.ReportError("Script runtime failure: Invalid value '{0}' within list '{1}'", obj, (object)"indices"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid value '{0}' within list '{1}'", obj, "indices"); + return null; } } - return (object)selectionManager.Select(parameter1, parameter2); + return selectionManager.Select(parameter1, parameter2); } - private static object CallToggleSelectInt32(object instanceObj, object[] parameters) => (object)((SelectionManager)instanceObj).ToggleSelect((int)parameters[0]); + private static object CallToggleSelectInt32(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).ToggleSelect((int)parameters[0]); private static object CallToggleSelectList(object instanceObj, object[] parameters) { @@ -81,116 +81,116 @@ namespace Microsoft.Iris.Markup.UIX IList parameter = (IList)parameters[0]; if (parameter == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"items"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "items"); + return null; } - foreach (object obj in (IEnumerable)parameter) + foreach (object obj in parameter) { if (!(obj is int)) { - ErrorManager.ReportError("Script runtime failure: Invalid value '{0}' within list '{1}'", obj, (object)"items"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid value '{0}' within list '{1}'", obj, "items"); + return null; } } - return (object)selectionManager.ToggleSelect(parameter); + return selectionManager.ToggleSelect(parameter); } - private static object CallSelectRangeInt32Int32(object instanceObj, object[] parameters) => (object)((SelectionManager)instanceObj).SelectRange((int)parameters[0], (int)parameters[1]); + private static object CallSelectRangeInt32Int32(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).SelectRange((int)parameters[0], (int)parameters[1]); - private static object CallSelectRangeFromAnchorInt32(object instanceObj, object[] parameters) => (object)((SelectionManager)instanceObj).SelectRangeFromAnchor((int)parameters[0]); + private static object CallSelectRangeFromAnchorInt32(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).SelectRangeFromAnchor((int)parameters[0]); private static object CallSelectRangeFromAnchorInt32Int32( object instanceObj, object[] parameters) { - return (object)((SelectionManager)instanceObj).SelectRangeFromAnchor((int)parameters[0], (int)parameters[1]); + return ((SelectionManager)instanceObj).SelectRangeFromAnchor((int)parameters[0], (int)parameters[1]); } - private static object CallToggleSelectRangeInt32Int32(object instanceObj, object[] parameters) => (object)((SelectionManager)instanceObj).ToggleSelectRange((int)parameters[0], (int)parameters[1]); + private static object CallToggleSelectRangeInt32Int32(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).ToggleSelectRange((int)parameters[0], (int)parameters[1]); - public static void Pass1Initialize() => SelectionManagerSchema.Type = new UIXTypeSchema((short)186, "SelectionManager", (string)null, (short)153, typeof(SelectionManager), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => SelectionManagerSchema.Type = new UIXTypeSchema(186, "SelectionManager", null, 153, typeof(SelectionManager), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)186, "Count", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(SelectionManagerSchema.GetCount), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)186, "SourceList", (short)138, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(SelectionManagerSchema.GetSourceList), new SetValueHandler(SelectionManagerSchema.SetSourceList), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)186, "Anchor", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(SelectionManagerSchema.GetAnchor), new SetValueHandler(SelectionManagerSchema.SetAnchor), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)186, "SelectedIndices", (short)138, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(SelectionManagerSchema.GetSelectedIndices), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)186, "SelectedItems", (short)138, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(SelectionManagerSchema.GetSelectedItems), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)186, "SingleSelect", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(SelectionManagerSchema.GetSingleSelect), new SetValueHandler(SelectionManagerSchema.SetSingleSelect), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)186, "SelectedIndex", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(SelectionManagerSchema.GetSelectedIndex), new SetValueHandler(SelectionManagerSchema.SetSelectedIndex), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)186, "SelectedItem", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(SelectionManagerSchema.GetSelectedItem), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)186, "IsSelected", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(186, "Count", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(SelectionManagerSchema.GetCount), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(186, "SourceList", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(SelectionManagerSchema.GetSourceList), new SetValueHandler(SelectionManagerSchema.SetSourceList), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(186, "Anchor", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(SelectionManagerSchema.GetAnchor), new SetValueHandler(SelectionManagerSchema.SetAnchor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(186, "SelectedIndices", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(SelectionManagerSchema.GetSelectedIndices), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(186, "SelectedItems", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(SelectionManagerSchema.GetSelectedItems), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(186, "SingleSelect", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(SelectionManagerSchema.GetSingleSelect), new SetValueHandler(SelectionManagerSchema.SetSingleSelect), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(186, "SelectedIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(SelectionManagerSchema.GetSelectedIndex), new SetValueHandler(SelectionManagerSchema.SetSelectedIndex), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(186, "SelectedItem", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(SelectionManagerSchema.GetSelectedItem), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(186, "IsSelected", new short[1] { - (short) 115 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallIsSelectedInt32), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)186, "IsRangeSelected", new short[2] + 115 + }, 15, new InvokeHandler(SelectionManagerSchema.CallIsSelectedInt32), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(186, "IsRangeSelected", new short[2] { - (short) 115, - (short) 115 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallIsRangeSelectedInt32Int32), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)186, "Clear", (short[])null, (short)240, new InvokeHandler(SelectionManagerSchema.CallClear), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)186, "Select", new short[2] + 115, + 115 + }, 15, new InvokeHandler(SelectionManagerSchema.CallIsRangeSelectedInt32Int32), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(186, "Clear", null, 240, new InvokeHandler(SelectionManagerSchema.CallClear), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(186, "Select", new short[2] { - (short) 115, - (short) 15 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallSelectInt32Boolean), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)186, "Select", new short[2] + 115, + 15 + }, 15, new InvokeHandler(SelectionManagerSchema.CallSelectInt32Boolean), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(186, "Select", new short[2] { - (short) 138, - (short) 15 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallSelectListBoolean), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)186, "ToggleSelect", new short[1] + 138, + 15 + }, 15, new InvokeHandler(SelectionManagerSchema.CallSelectListBoolean), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(186, "ToggleSelect", new short[1] { - (short) 115 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallToggleSelectInt32), false); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)186, "ToggleSelect", new short[1] + 115 + }, 15, new InvokeHandler(SelectionManagerSchema.CallToggleSelectInt32), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(186, "ToggleSelect", new short[1] { - (short) 138 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallToggleSelectList), false); - UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema((short)186, "SelectRange", new short[2] + 138 + }, 15, new InvokeHandler(SelectionManagerSchema.CallToggleSelectList), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(186, "SelectRange", new short[2] { - (short) 115, - (short) 115 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallSelectRangeInt32Int32), false); - UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema((short)186, "SelectRangeFromAnchor", new short[1] + 115, + 115 + }, 15, new InvokeHandler(SelectionManagerSchema.CallSelectRangeInt32Int32), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(186, "SelectRangeFromAnchor", new short[1] { - (short) 115 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallSelectRangeFromAnchorInt32), false); - UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema((short)186, "SelectRangeFromAnchor", new short[2] + 115 + }, 15, new InvokeHandler(SelectionManagerSchema.CallSelectRangeFromAnchorInt32), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(186, "SelectRangeFromAnchor", new short[2] { - (short) 115, - (short) 115 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallSelectRangeFromAnchorInt32Int32), false); - UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema((short)186, "ToggleSelectRange", new short[2] + 115, + 115 + }, 15, new InvokeHandler(SelectionManagerSchema.CallSelectRangeFromAnchorInt32Int32), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(186, "ToggleSelectRange", new short[2] { - (short) 115, - (short) 115 - }, (short)15, new InvokeHandler(SelectionManagerSchema.CallToggleSelectRangeInt32Int32), false); - SelectionManagerSchema.Type.Initialize(new DefaultConstructHandler(SelectionManagerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[8] + 115, + 115 + }, 15, new InvokeHandler(SelectionManagerSchema.CallToggleSelectRangeInt32Int32), false); + SelectionManagerSchema.Type.Initialize(new DefaultConstructHandler(SelectionManagerSchema.Construct), null, new PropertySchema[8] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema2 + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema7, + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema2 }, new MethodSchema[11] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7, - (MethodSchema) uixMethodSchema8, - (MethodSchema) uixMethodSchema9, - (MethodSchema) uixMethodSchema10, - (MethodSchema) uixMethodSchema11 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8, + uixMethodSchema9, + uixMethodSchema10, + uixMethodSchema11 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SelectionRangeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SelectionRangeSchema.cs index 4fe99be..401b019 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SelectionRangeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SelectionRangeSchema.cs @@ -14,29 +14,29 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetBegin(object instanceObj) => (object)((Range)instanceObj).Begin; + private static object GetBegin(object instanceObj) => ((Range)instanceObj).Begin; private static void SetBegin(ref object instanceObj, object valueObj) { Range range = (Range)instanceObj; int num = (int)valueObj; range.Begin = num; - instanceObj = (object)range; + instanceObj = range; } - private static object GetEnd(object instanceObj) => (object)((Range)instanceObj).End; + private static object GetEnd(object instanceObj) => ((Range)instanceObj).End; private static void SetEnd(ref object instanceObj, object valueObj) { Range range = (Range)instanceObj; int num = (int)valueObj; range.End = num; - instanceObj = (object)range; + instanceObj = range; } private static object GetIsEmpty(object instanceObj) => BooleanBoxes.Box(((Range)instanceObj).IsEmpty); - private static object Construct() => (object)new Range(0, 0); + private static object Construct() => new Range(0, 0); private static object ConstructBeginEnd(object[] parameters) { @@ -50,14 +50,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = SelectionRangeSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"SelectionRange", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "SelectionRange", result1.Error); SelectionRangeSchema.SetBegin(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"SelectionRange", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "SelectionRange", result2.Error); SelectionRangeSchema.SetEnd(ref instance, valueObj2); return result2; } @@ -70,7 +70,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -81,32 +81,32 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"SelectionRange"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "SelectionRange"); } return result; } - public static void Pass1Initialize() => SelectionRangeSchema.Type = new UIXTypeSchema((short)187, "SelectionRange", (string)null, (short)153, typeof(Range), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => SelectionRangeSchema.Type = new UIXTypeSchema(187, "SelectionRange", null, 153, typeof(Range), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)187, "Begin", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SelectionRangeSchema.GetBegin), new SetValueHandler(SelectionRangeSchema.SetBegin), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)187, "End", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SelectionRangeSchema.GetEnd), new SetValueHandler(SelectionRangeSchema.SetEnd), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)187, "IsEmpty", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SelectionRangeSchema.GetIsEmpty), (SetValueHandler)null, false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)187, new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(187, "Begin", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SelectionRangeSchema.GetBegin), new SetValueHandler(SelectionRangeSchema.SetBegin), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(187, "End", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SelectionRangeSchema.GetEnd), new SetValueHandler(SelectionRangeSchema.SetEnd), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(187, "IsEmpty", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SelectionRangeSchema.GetIsEmpty), null, false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(187, new short[2] { - (short) 115, - (short) 115 + 115, + 115 }, new ConstructHandler(SelectionRangeSchema.ConstructBeginEnd)); SelectionRangeSchema.Type.Initialize(new DefaultConstructHandler(SelectionRangeSchema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[3] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(SelectionRangeSchema.TryConvertFrom), new SupportsTypeConversionHandler(SelectionRangeSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 + }, null, null, null, new TypeConverterHandler(SelectionRangeSchema.TryConvertFrom), new SupportsTypeConversionHandler(SelectionRangeSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SepiaInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SepiaInstanceSchema.cs index 0371942..f9f2e80 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SepiaInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SepiaInstanceSchema.cs @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.LightColor, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayDarkColorAnimationEffectColorAnimation( @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.DarkColor, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayDesaturateAnimationEffectFloatAnimation( @@ -63,7 +63,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Desaturate, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayToneAnimationEffectFloatAnimation( @@ -71,46 +71,46 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Tone, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => SepiaInstanceSchema.Type = new UIXTypeSchema((short)189, "SepiaInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => SepiaInstanceSchema.Type = new UIXTypeSchema(189, "SepiaInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)189, "LightColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SepiaInstanceSchema.SetLightColor), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)189, "DarkColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SepiaInstanceSchema.SetDarkColor), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)189, "Desaturate", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, (GetValueHandler)null, new SetValueHandler(SepiaInstanceSchema.SetDesaturate), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)189, "Tone", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, (GetValueHandler)null, new SetValueHandler(SepiaInstanceSchema.SetTone), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)189, "PlayLightColorAnimation", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(189, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SepiaInstanceSchema.SetLightColor), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(189, "DarkColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SepiaInstanceSchema.SetDarkColor), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(189, "Desaturate", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, null, new SetValueHandler(SepiaInstanceSchema.SetDesaturate), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(189, "Tone", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, null, new SetValueHandler(SepiaInstanceSchema.SetTone), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(189, "PlayLightColorAnimation", new short[1] { - (short) 71 - }, (short)240, new InvokeHandler(SepiaInstanceSchema.CallPlayLightColorAnimationEffectColorAnimation), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)189, "PlayDarkColorAnimation", new short[1] + 71 + }, 240, new InvokeHandler(SepiaInstanceSchema.CallPlayLightColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(189, "PlayDarkColorAnimation", new short[1] { - (short) 71 - }, (short)240, new InvokeHandler(SepiaInstanceSchema.CallPlayDarkColorAnimationEffectColorAnimation), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)189, "PlayDesaturateAnimation", new short[1] + 71 + }, 240, new InvokeHandler(SepiaInstanceSchema.CallPlayDarkColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(189, "PlayDesaturateAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(SepiaInstanceSchema.CallPlayDesaturateAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)189, "PlayToneAnimation", new short[1] + 75 + }, 240, new InvokeHandler(SepiaInstanceSchema.CallPlayDesaturateAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(189, "PlayToneAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(SepiaInstanceSchema.CallPlayToneAnimationEffectFloatAnimation), false); - SepiaInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[4] + 75 + }, 240, new InvokeHandler(SepiaInstanceSchema.CallPlayToneAnimationEffectFloatAnimation), false); + SepiaInstanceSchema.Type.Initialize(null, null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema4 + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema4 }, new MethodSchema[4] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SepiaSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SepiaSchema.cs index 63fe2a1..a928d2b 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SepiaSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SepiaSchema.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetDarkColor(ref object instanceObj, object valueObj) => ((SepiaElement)instanceObj).DarkColor = ((Color)valueObj).RenderConvert(); - private static object GetDesaturate(object instanceObj) => (object)((SepiaElement)instanceObj).Desaturate; + private static object GetDesaturate(object instanceObj) => ((SepiaElement)instanceObj).Desaturate; private static void SetDesaturate(ref object instanceObj, object valueObj) { @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Markup.UIX sepiaElement.Desaturate = num; } - private static object GetTone(object instanceObj) => (object)((SepiaElement)instanceObj).Tone; + private static object GetTone(object instanceObj) => ((SepiaElement)instanceObj).Tone; private static void SetTone(ref object instanceObj, object valueObj) { @@ -45,23 +45,23 @@ namespace Microsoft.Iris.Markup.UIX sepiaElement.Tone = num; } - private static object Construct() => (object)new SepiaElement(); + private static object Construct() => new SepiaElement(); - public static void Pass1Initialize() => SepiaSchema.Type = new UIXTypeSchema((short)188, "Sepia", (string)null, (short)80, typeof(SepiaElement), UIXTypeFlags.None); + public static void Pass1Initialize() => SepiaSchema.Type = new UIXTypeSchema(188, "Sepia", null, 80, typeof(SepiaElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)188, "LightColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SepiaSchema.SetLightColor), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)188, "DarkColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SepiaSchema.SetDarkColor), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)188, "Desaturate", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SepiaSchema.GetDesaturate), new SetValueHandler(SepiaSchema.SetDesaturate), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)188, "Tone", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SepiaSchema.GetTone), new SetValueHandler(SepiaSchema.SetTone), false); - SepiaSchema.Type.Initialize(new DefaultConstructHandler(SepiaSchema.Construct), (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(188, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SepiaSchema.SetLightColor), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(188, "DarkColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SepiaSchema.SetDarkColor), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(188, "Desaturate", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SepiaSchema.GetDesaturate), new SetValueHandler(SepiaSchema.SetDesaturate), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(188, "Tone", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SepiaSchema.GetTone), new SetValueHandler(SepiaSchema.SetTone), false); + SepiaSchema.Type.Initialize(new DefaultConstructHandler(SepiaSchema.Construct), null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema4 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema4 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SharedSizeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SharedSizeSchema.cs index ed04d61..a919215 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SharedSizeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SharedSizeSchema.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetMaximumSize(object instanceObj) => (object)((SharedSize)instanceObj).MaximumSize; + private static object GetMaximumSize(object instanceObj) => ((SharedSize)instanceObj).MaximumSize; private static void SetMaximumSize(ref object instanceObj, object valueObj) { @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Markup.UIX sharedSize.MaximumSize = size; } - private static object GetMinimumSize(object instanceObj) => (object)((SharedSize)instanceObj).MinimumSize; + private static object GetMinimumSize(object instanceObj) => ((SharedSize)instanceObj).MinimumSize; private static void SetMinimumSize(ref object instanceObj, object valueObj) { @@ -41,7 +41,7 @@ namespace Microsoft.Iris.Markup.UIX sharedSize.MinimumSize = size; } - private static object GetSize(object instanceObj) => (object)((SharedSize)instanceObj).Size; + private static object GetSize(object instanceObj) => ((SharedSize)instanceObj).Size; private static void SetSize(ref object instanceObj, object valueObj) { @@ -54,31 +54,31 @@ namespace Microsoft.Iris.Markup.UIX sharedSize.Size = size; } - private static object Construct() => (object)new SharedSize(); + private static object Construct() => new SharedSize(); private static object CallAutoSize(object instanceObj, object[] parameters) { ((SharedSize)instanceObj).AutoSize(); - return (object)null; + return null; } - public static void Pass1Initialize() => SharedSizeSchema.Type = new UIXTypeSchema((short)190, "SharedSize", (string)null, (short)153, typeof(SharedSize), UIXTypeFlags.None); + public static void Pass1Initialize() => SharedSizeSchema.Type = new UIXTypeSchema(190, "SharedSize", null, 153, typeof(SharedSize), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)190, "MaximumSize", (short)195, (short)-1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(SharedSizeSchema.GetMaximumSize), new SetValueHandler(SharedSizeSchema.SetMaximumSize), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)190, "MinimumSize", (short)195, (short)-1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(SharedSizeSchema.GetMinimumSize), new SetValueHandler(SharedSizeSchema.SetMinimumSize), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)190, "Size", (short)195, (short)-1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(SharedSizeSchema.GetSize), new SetValueHandler(SharedSizeSchema.SetSize), false); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)190, "AutoSize", (short[])null, (short)240, new InvokeHandler(SharedSizeSchema.CallAutoSize), false); - SharedSizeSchema.Type.Initialize(new DefaultConstructHandler(SharedSizeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(190, "MaximumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(SharedSizeSchema.GetMaximumSize), new SetValueHandler(SharedSizeSchema.SetMaximumSize), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(190, "MinimumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(SharedSizeSchema.GetMinimumSize), new SetValueHandler(SharedSizeSchema.SetMinimumSize), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(190, "Size", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(SharedSizeSchema.GetSize), new SetValueHandler(SharedSizeSchema.SetSize), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(190, "AutoSize", null, 240, new InvokeHandler(SharedSizeSchema.CallAutoSize), false); + SharedSizeSchema.Type.Initialize(new DefaultConstructHandler(SharedSizeSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3 + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ShortcutHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ShortcutHandlerSchema.cs index f7679fa..38abef9 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ShortcutHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ShortcutHandlerSchema.cs @@ -14,11 +14,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetShortcut(object instanceObj) => (object)((ShortcutHandler)instanceObj).Shortcut; + private static object GetShortcut(object instanceObj) => ((ShortcutHandler)instanceObj).Shortcut; private static void SetShortcut(ref object instanceObj, object valueObj) => ((ShortcutHandler)instanceObj).Shortcut = (ShortcutHandlerCommand)valueObj; - private static object GetCommand(object instanceObj) => (object)((ShortcutHandler)instanceObj).Command; + private static object GetCommand(object instanceObj) => ((ShortcutHandler)instanceObj).Command; private static void SetCommand(ref object instanceObj, object valueObj) => ((ShortcutHandler)instanceObj).Command = (IUICommand)valueObj; @@ -26,31 +26,31 @@ namespace Microsoft.Iris.Markup.UIX private static void SetHandle(ref object instanceObj, object valueObj) => ((ShortcutHandler)instanceObj).Handle = (bool)valueObj; - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; - private static object Construct() => (object)new ShortcutHandler(); + private static object Construct() => new ShortcutHandler(); - public static void Pass1Initialize() => ShortcutHandlerSchema.Type = new UIXTypeSchema((short)192, "ShortcutHandler", (string)null, (short)110, typeof(ShortcutHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => ShortcutHandlerSchema.Type = new UIXTypeSchema(192, "ShortcutHandler", null, 110, typeof(ShortcutHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)192, "Shortcut", (short)193, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ShortcutHandlerSchema.GetShortcut), new SetValueHandler(ShortcutHandlerSchema.SetShortcut), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)192, "Command", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ShortcutHandlerSchema.GetCommand), new SetValueHandler(ShortcutHandlerSchema.SetCommand), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)192, "Handle", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ShortcutHandlerSchema.GetHandle), new SetValueHandler(ShortcutHandlerSchema.SetHandle), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)192, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ShortcutHandlerSchema.GetHandlerStage), new SetValueHandler(ShortcutHandlerSchema.SetHandlerStage), false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)192, "Invoked"); - ShortcutHandlerSchema.Type.Initialize(new DefaultConstructHandler(ShortcutHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(192, "Shortcut", 193, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ShortcutHandlerSchema.GetShortcut), new SetValueHandler(ShortcutHandlerSchema.SetShortcut), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(192, "Command", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ShortcutHandlerSchema.GetCommand), new SetValueHandler(ShortcutHandlerSchema.SetCommand), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(192, "Handle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ShortcutHandlerSchema.GetHandle), new SetValueHandler(ShortcutHandlerSchema.SetHandle), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(192, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ShortcutHandlerSchema.GetHandlerStage), new SetValueHandler(ShortcutHandlerSchema.SetHandlerStage), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(192, "Invoked"); + ShortcutHandlerSchema.Type.Initialize(new DefaultConstructHandler(ShortcutHandlerSchema.Construct), null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, new EventSchema[1] + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema1 + }, null, new EventSchema[1] { - (EventSchema) uixEventSchema - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SingleSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SingleSchema.cs index b0bc994..7689aab 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SingleSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SingleSchema.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Markup.UIX public static RangeValidator ValidateNotZero = new RangeValidator(SingleSchema.RangeValidateNotZero); public static UIXTypeSchema Type; - private static object Construct() => (object)0.0f; + private static object Construct() => 0.0f; private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) { @@ -25,65 +25,65 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteSingle(num); } - private static object DecodeBinary(ByteCodeReader reader) => (object)reader.ReadSingle(); + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadSingle(); private static Result ConvertFromString(object valueObj, out object instanceObj) { string s = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; float result; - if (!float.TryParse(s, NumberStyles.Float, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result)) - return Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)s, (object)"Single"); - instanceObj = (object)result; + if (!float.TryParse(s, NumberStyles.Float, NumberFormatInfo.InvariantInfo, out result)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", s, "Single"); + instanceObj = result; return Result.Success; } private static Result ConvertFromBoolean(object valueObj, out object instanceObj) { bool flag = (bool)valueObj; - instanceObj = (object)null; + instanceObj = null; float num = flag ? 1f : 0.0f; - instanceObj = (object)num; + instanceObj = num; return Result.Success; } private static Result ConvertFromByte(object valueObj, out object instanceObj) { byte num1 = (byte)valueObj; - instanceObj = (object)null; - float num2 = (float)num1; - instanceObj = (object)num2; + instanceObj = null; + float num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromInt32(object valueObj, out object instanceObj) { int num1 = (int)valueObj; - instanceObj = (object)null; - float num2 = (float)num1; - instanceObj = (object)num2; + instanceObj = null; + float num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromInt64(object valueObj, out object instanceObj) { long num1 = (long)valueObj; - instanceObj = (object)null; - float num2 = (float)num1; - instanceObj = (object)num2; + instanceObj = null; + float num2 = num1; + instanceObj = num2; return Result.Success; } private static Result ConvertFromDouble(object valueObj, out object instanceObj) { double num1 = (double)valueObj; - instanceObj = (object)null; + instanceObj = null; float num2 = (float)num1; - instanceObj = (object)num2; + instanceObj = num2; return Result.Success; } - private static object CallToStringString(object instanceObj, object[] parameters) => (object)((float)instanceObj).ToString((string)parameters[0]); + private static object CallToStringString(object instanceObj, object[] parameters) => ((float)instanceObj).ToString((string)parameters[0]); private static bool IsConversionSupported(TypeSchema fromType) => BooleanSchema.Type.IsAssignableFrom(fromType) || ByteSchema.Type.IsAssignableFrom(fromType) || (DoubleSchema.Type.IsAssignableFrom(fromType) || Int32Schema.Type.IsAssignableFrom(fromType)) || (Int64Schema.Type.IsAssignableFrom(fromType) || StringSchema.Type.IsAssignableFrom(fromType)); @@ -93,7 +93,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (BooleanSchema.Type.IsAssignableFrom(fromType)) { result = SingleSchema.ConvertFromBoolean(from, out instance); @@ -159,34 +159,34 @@ namespace Microsoft.Iris.Markup.UIX { float num1 = (float)leftObj; if (op == OperationType.MathNegate) - return (object)(float)-(double)num1; + return (float)-num1; float num2 = (float)rightObj; switch (op - 1) { - case (OperationType)0: - return (object)(float)((double)num1 + (double)num2); + case 0: + return (float)(num1 + (double)num2); case OperationType.MathAdd: - return (object)(float)((double)num1 - (double)num2); + return (float)(num1 - (double)num2); case OperationType.MathSubtract: - return (object)(float)((double)num1 * (double)num2); + return (float)(num1 * (double)num2); case OperationType.MathMultiply: - return (object)(float)((double)num1 / (double)num2); + return (float)(num1 / (double)num2); case OperationType.MathDivide: - return (object)(float)((double)num1 % (double)num2); + return (float)(num1 % (double)num2); case OperationType.LogicalOr: - return BooleanBoxes.Box((double)num1 == (double)num2); + return BooleanBoxes.Box(num1 == (double)num2); case OperationType.RelationalEquals: - return BooleanBoxes.Box((double)num1 != (double)num2); + return BooleanBoxes.Box(num1 != (double)num2); case OperationType.RelationalNotEquals: - return BooleanBoxes.Box((double)num1 < (double)num2); + return BooleanBoxes.Box(num1 < (double)num2); case OperationType.RelationalLessThan: - return BooleanBoxes.Box((double)num1 > (double)num2); + return BooleanBoxes.Box(num1 > (double)num2); case OperationType.RelationalGreaterThan: - return BooleanBoxes.Box((double)num1 <= (double)num2); + return BooleanBoxes.Box(num1 <= (double)num2); case OperationType.RelationalLessThanEquals: - return BooleanBoxes.Box((double)num1 >= (double)num2); + return BooleanBoxes.Box(num1 >= (double)num2); default: - return (object)null; + return null; } } @@ -195,45 +195,45 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; float parameter2 = (float)parameters[1]; object instanceObj1; - return SingleSchema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return SingleSchema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } private static Result RangeValidate0to1(object value) { float num = (float)value; - return (double)num < 0.0 || (double)num > 1.0 ? Result.Fail("Expecting a value between {0} and {1}, but got {2}", (object)"0.0", (object)"1.0", (object)num.ToString()) : Result.Success; + return num < 0.0 || num > 1.0 ? Result.Fail("Expecting a value between {0} and {1}, but got {2}", "0.0", "1.0", num.ToString()) : Result.Success; } private static Result RangeValidateNotNegative(object value) { float num = (float)value; - return (double)num < 0.0 ? Result.Fail("Expecting a non-negative value, but got {0}", (object)num.ToString()) : Result.Success; + return num < 0.0 ? Result.Fail("Expecting a non-negative value, but got {0}", num.ToString()) : Result.Success; } private static Result RangeValidateNotZero(object value) { float num = (float)value; - return (double)num == 0.0 ? Result.Fail("Specified value '{0}' is not valid", (object)num.ToString()) : Result.Success; + return num == 0.0 ? Result.Fail("Specified value '{0}' is not valid", num.ToString()) : Result.Success; } - public static void Pass1Initialize() => SingleSchema.Type = new UIXTypeSchema((short)194, "Single", "float", (short)153, typeof(float), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => SingleSchema.Type = new UIXTypeSchema(194, "Single", "float", 153, typeof(float), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)194, "ToString", new short[1] + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(194, "ToString", new short[1] { - (short) 208 - }, (short)208, new InvokeHandler(SingleSchema.CallToStringString), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)194, "TryParse", new short[2] + 208 + }, 208, new InvokeHandler(SingleSchema.CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(194, "TryParse", new short[2] { - (short) 208, - (short) 194 - }, (short)194, new InvokeHandler(SingleSchema.CallTryParseStringSingle), true); - SingleSchema.Type.Initialize(new DefaultConstructHandler(SingleSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, new MethodSchema[2] + 208, + 194 + }, 194, new InvokeHandler(SingleSchema.CallTryParseStringSingle), true); + SingleSchema.Type.Initialize(new DefaultConstructHandler(SingleSchema.Construct), null, null, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(SingleSchema.TryConvertFrom), new SupportsTypeConversionHandler(SingleSchema.IsConversionSupported), new EncodeBinaryHandler(SingleSchema.EncodeBinary), new DecodeBinaryHandler(SingleSchema.DecodeBinary), new PerformOperationHandler(SingleSchema.ExecuteOperation), new SupportsOperationHandler(SingleSchema.IsOperationSupported)); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(SingleSchema.TryConvertFrom), new SupportsTypeConversionHandler(SingleSchema.IsConversionSupported), new EncodeBinaryHandler(SingleSchema.EncodeBinary), new DecodeBinaryHandler(SingleSchema.DecodeBinary), new PerformOperationHandler(SingleSchema.ExecuteOperation), new SupportsOperationHandler(SingleSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SizeKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SizeKeyframeSchema.cs index aa24d0f..6af4459 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SizeKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SizeKeyframeSchema.cs @@ -13,21 +13,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseVector2Keyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseVector2Keyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseVector2Keyframe)instanceObj).Value = (Vector2)valueObj; - private static object Construct() => (object)new SizeKeyframe(); + private static object Construct() => new SizeKeyframe(); - public static void Pass1Initialize() => SizeKeyframeSchema.Type = new UIXTypeSchema((short)196, "SizeKeyframe", (string)null, (short)130, typeof(SizeKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => SizeKeyframeSchema.Type = new UIXTypeSchema(196, "SizeKeyframe", null, 130, typeof(SizeKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)196, "Value", (short)233, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SizeKeyframeSchema.GetValue), new SetValueHandler(SizeKeyframeSchema.SetValue), false); - SizeKeyframeSchema.Type.Initialize(new DefaultConstructHandler(SizeKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(196, "Value", 233, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SizeKeyframeSchema.GetValue), new SetValueHandler(SizeKeyframeSchema.SetValue), false); + SizeKeyframeSchema.Type.Initialize(new DefaultConstructHandler(SizeKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SizeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SizeSchema.cs index caa4f2e..886d65d 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SizeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SizeSchema.cs @@ -15,27 +15,27 @@ namespace Microsoft.Iris.Markup.UIX public static RangeValidator ValidateNotNegative = new RangeValidator(SizeSchema.RangeValidateNotNegative); public static UIXTypeSchema Type; - private static object GetWidth(object instanceObj) => (object)((Size)instanceObj).Width; + private static object GetWidth(object instanceObj) => ((Size)instanceObj).Width; private static void SetWidth(ref object instanceObj, object valueObj) { Size size = (Size)instanceObj; int num = (int)valueObj; size.Width = num; - instanceObj = (object)size; + instanceObj = size; } - private static object GetHeight(object instanceObj) => (object)((Size)instanceObj).Height; + private static object GetHeight(object instanceObj) => ((Size)instanceObj).Height; private static void SetHeight(ref object instanceObj, object valueObj) { Size size = (Size)instanceObj; int num = (int)valueObj; size.Height = num; - instanceObj = (object)size; + instanceObj = size; } - private static object Construct() => (object)Size.Zero; + private static object Construct() => Size.Zero; private static object ConstructWidthHeight(object[] parameters) { @@ -51,14 +51,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = SizeSchema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Size", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Size", result1.Error); SizeSchema.SetWidth(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)Int32Schema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Size", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Size", result2.Error); SizeSchema.SetHeight(ref instance, valueObj2); return result2; } @@ -70,7 +70,7 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteInt32(size.Height); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new Size(reader.ReadInt32(), reader.ReadInt32()); + private static object DecodeBinary(ByteCodeReader reader) => new Size(reader.ReadInt32(), reader.ReadInt32()); private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -80,7 +80,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -91,7 +91,7 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Size"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Size"); } return result; } @@ -99,28 +99,28 @@ namespace Microsoft.Iris.Markup.UIX private static Result RangeValidateNotNegative(object value) { Size size = (Size)value; - return size.Width < 0 || size.Height < 0 ? Result.Fail("Expecting a non-negative value, but got {0}", (object)size.ToString()) : Result.Success; + return size.Width < 0 || size.Height < 0 ? Result.Fail("Expecting a non-negative value, but got {0}", size.ToString()) : Result.Success; } - public static void Pass1Initialize() => SizeSchema.Type = new UIXTypeSchema((short)195, "Size", (string)null, (short)153, typeof(Size), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => SizeSchema.Type = new UIXTypeSchema(195, "Size", null, 153, typeof(Size), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)195, "Width", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SizeSchema.GetWidth), new SetValueHandler(SizeSchema.SetWidth), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)195, "Height", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SizeSchema.GetHeight), new SetValueHandler(SizeSchema.SetHeight), false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)195, new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(195, "Width", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SizeSchema.GetWidth), new SetValueHandler(SizeSchema.SetWidth), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(195, "Height", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SizeSchema.GetHeight), new SetValueHandler(SizeSchema.SetHeight), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(195, new short[2] { - (short) 115, - (short) 115 + 115, + 115 }, new ConstructHandler(SizeSchema.ConstructWidthHeight)); SizeSchema.Type.Initialize(new DefaultConstructHandler(SizeSchema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(SizeSchema.TryConvertFrom), new SupportsTypeConversionHandler(SizeSchema.IsConversionSupported), new EncodeBinaryHandler(SizeSchema.EncodeBinary), new DecodeBinaryHandler(SizeSchema.DecodeBinary), (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, new TypeConverterHandler(SizeSchema.TryConvertFrom), new SupportsTypeConversionHandler(SizeSchema.IsConversionSupported), new EncodeBinaryHandler(SizeSchema.EncodeBinary), new DecodeBinaryHandler(SizeSchema.DecodeBinary), null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SizeXKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SizeXKeyframeSchema.cs index db99f94..c50a27e 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SizeXKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SizeXKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new SizeXKeyframe(); + private static object Construct() => new SizeXKeyframe(); - public static void Pass1Initialize() => SizeXKeyframeSchema.Type = new UIXTypeSchema((short)197, "SizeXKeyframe", (string)null, (short)130, typeof(SizeXKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => SizeXKeyframeSchema.Type = new UIXTypeSchema(197, "SizeXKeyframe", null, 130, typeof(SizeXKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)197, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SizeXKeyframeSchema.GetValue), new SetValueHandler(SizeXKeyframeSchema.SetValue), false); - SizeXKeyframeSchema.Type.Initialize(new DefaultConstructHandler(SizeXKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(197, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SizeXKeyframeSchema.GetValue), new SetValueHandler(SizeXKeyframeSchema.SetValue), false); + SizeXKeyframeSchema.Type.Initialize(new DefaultConstructHandler(SizeXKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SizeYKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SizeYKeyframeSchema.cs index 2a6d032..eac24fe 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SizeYKeyframeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SizeYKeyframeSchema.cs @@ -12,21 +12,21 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetValue(object instanceObj) => (object)((BaseFloatKeyframe)instanceObj).Value; + private static object GetValue(object instanceObj) => ((BaseFloatKeyframe)instanceObj).Value; private static void SetValue(ref object instanceObj, object valueObj) => ((BaseFloatKeyframe)instanceObj).Value = (float)valueObj; - private static object Construct() => (object)new SizeYKeyframe(); + private static object Construct() => new SizeYKeyframe(); - public static void Pass1Initialize() => SizeYKeyframeSchema.Type = new UIXTypeSchema((short)198, "SizeYKeyframe", (string)null, (short)130, typeof(SizeYKeyframe), UIXTypeFlags.None); + public static void Pass1Initialize() => SizeYKeyframeSchema.Type = new UIXTypeSchema(198, "SizeYKeyframe", null, 130, typeof(SizeYKeyframe), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)198, "Value", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SizeYKeyframeSchema.GetValue), new SetValueHandler(SizeYKeyframeSchema.SetValue), false); - SizeYKeyframeSchema.Type.Initialize(new DefaultConstructHandler(SizeYKeyframeSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(198, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SizeYKeyframeSchema.GetValue), new SetValueHandler(SizeYKeyframeSchema.SetValue), false); + SizeYKeyframeSchema.Type.Initialize(new DefaultConstructHandler(SizeYKeyframeSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SoundSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SoundSchema.cs index a59f292..b8ad24a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SoundSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SoundSchema.cs @@ -15,15 +15,15 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetSource(object instanceObj) => (object)((Sound)instanceObj).Source; + private static object GetSource(object instanceObj) => ((Sound)instanceObj).Source; private static void SetSource(ref object instanceObj, object valueObj) => ((Sound)instanceObj).Source = (string)valueObj; - private static object GetSystemSoundEvent(object instanceObj) => (object)((Sound)instanceObj).SystemSoundEvent; + private static object GetSystemSoundEvent(object instanceObj) => ((Sound)instanceObj).SystemSoundEvent; private static void SetSystemSoundEvent(ref object instanceObj, object valueObj) => ((Sound)instanceObj).SystemSoundEvent = (SystemSoundEvent)valueObj; - private static object Construct() => (object)new Sound(); + private static object Construct() => new Sound(); private static object ConstructSource(object[] parameters) { @@ -36,9 +36,9 @@ namespace Microsoft.Iris.Markup.UIX { instance = SoundSchema.Construct(); object valueObj; - Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)StringSchema.Type, (RangeValidator)null, out valueObj); + Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj); if (result.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Sound", (object)result.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Sound", result.Error); SoundSchema.SetSource(ref instance, valueObj); return result; } @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Markup.UIX private static object CallPlay(object instanceObj, object[] parameters) { ((Sound)instanceObj).Play(); - return (object)null; + return null; } private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -57,7 +57,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -68,33 +68,33 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Sound"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Sound"); } return result; } - public static void Pass1Initialize() => SoundSchema.Type = new UIXTypeSchema((short)201, "Sound", (string)null, (short)153, typeof(Sound), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => SoundSchema.Type = new UIXTypeSchema(201, "Sound", null, 153, typeof(Sound), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)201, "Source", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SoundSchema.GetSource), new SetValueHandler(SoundSchema.SetSource), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)201, "SystemSoundEvent", (short)211, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SoundSchema.GetSystemSoundEvent), new SetValueHandler(SoundSchema.SetSystemSoundEvent), false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)201, new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(201, "Source", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SoundSchema.GetSource), new SetValueHandler(SoundSchema.SetSource), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(201, "SystemSoundEvent", 211, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SoundSchema.GetSystemSoundEvent), new SetValueHandler(SoundSchema.SetSystemSoundEvent), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(201, new short[1] { - (short) 208 + 208 }, new ConstructHandler(SoundSchema.ConstructSource)); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)201, "Play", (short[])null, (short)240, new InvokeHandler(SoundSchema.CallPlay), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(201, "Play", null, 240, new InvokeHandler(SoundSchema.CallPlay), false); SoundSchema.Type.Initialize(new DefaultConstructHandler(SoundSchema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(SoundSchema.TryConvertFrom), new SupportsTypeConversionHandler(SoundSchema.IsConversionSupported), (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema + }, null, null, new TypeConverterHandler(SoundSchema.TryConvertFrom), new SupportsTypeConversionHandler(SoundSchema.IsConversionSupported), null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DInstanceSchema.cs index a03f27b..7e6b9de 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DInstanceSchema.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Position, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayDirectionAngleAnimationEffectFloatAnimation( @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.DirectionAngle, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayLightColorAnimationEffectColorAnimation( @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.LightColor, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayAmbientColorAnimationEffectColorAnimation( @@ -60,7 +60,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.AmbientColor, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayInnerConeAngleAnimationEffectFloatAnimation( @@ -68,7 +68,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.InnerConeAngle, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayOuterConeAngleAnimationEffectFloatAnimation( @@ -76,7 +76,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.OuterConeAngle, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayIntensityAnimationEffectFloatAnimation( @@ -84,7 +84,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Intensity, (EffectAnimation)parameters[0]); - return (object)null; + return null; } private static object CallPlayAttenuationAnimationEffectVector3Animation( @@ -92,74 +92,74 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Attenuation, (EffectAnimation)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => SpotLight2DInstanceSchema.Type = new UIXTypeSchema((short)203, "SpotLight2DInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => SpotLight2DInstanceSchema.Type = new UIXTypeSchema(203, "SpotLight2DInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)203, "Position", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DInstanceSchema.SetPosition), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)203, "DirectionAngle", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DInstanceSchema.SetDirectionAngle), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)203, "LightColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DInstanceSchema.SetLightColor), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)203, "AmbientColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DInstanceSchema.SetAmbientColor), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)203, "InnerConeAngle", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DInstanceSchema.SetInnerConeAngle), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)203, "OuterConeAngle", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DInstanceSchema.SetOuterConeAngle), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)203, "Intensity", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DInstanceSchema.SetIntensity), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)203, "Attenuation", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DInstanceSchema.SetAttenuation), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)203, "PlayPositionAnimation", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(203, "Position", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DInstanceSchema.SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(203, "DirectionAngle", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DInstanceSchema.SetDirectionAngle), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(203, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DInstanceSchema.SetLightColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(203, "AmbientColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DInstanceSchema.SetAmbientColor), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(203, "InnerConeAngle", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DInstanceSchema.SetInnerConeAngle), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(203, "OuterConeAngle", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DInstanceSchema.SetOuterConeAngle), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(203, "Intensity", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DInstanceSchema.SetIntensity), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(203, "Attenuation", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DInstanceSchema.SetAttenuation), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(203, "PlayPositionAnimation", new short[1] { - (short) 81 - }, (short)240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayPositionAnimationEffectVector3Animation), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)203, "PlayDirectionAngleAnimation", new short[1] + 81 + }, 240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayPositionAnimationEffectVector3Animation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(203, "PlayDirectionAngleAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayDirectionAngleAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)203, "PlayLightColorAnimation", new short[1] + 75 + }, 240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayDirectionAngleAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(203, "PlayLightColorAnimation", new short[1] { - (short) 71 - }, (short)240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayLightColorAnimationEffectColorAnimation), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)203, "PlayAmbientColorAnimation", new short[1] + 71 + }, 240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayLightColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(203, "PlayAmbientColorAnimation", new short[1] { - (short) 71 - }, (short)240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayAmbientColorAnimationEffectColorAnimation), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)203, "PlayInnerConeAngleAnimation", new short[1] + 71 + }, 240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayAmbientColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(203, "PlayInnerConeAngleAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayInnerConeAngleAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)203, "PlayOuterConeAngleAnimation", new short[1] + 75 + }, 240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayInnerConeAngleAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(203, "PlayOuterConeAngleAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayOuterConeAngleAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)203, "PlayIntensityAnimation", new short[1] + 75 + }, 240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayOuterConeAngleAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(203, "PlayIntensityAnimation", new short[1] { - (short) 75 - }, (short)240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayIntensityAnimationEffectFloatAnimation), false); - UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema((short)203, "PlayAttenuationAnimation", new short[1] + 75 + }, 240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayIntensityAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(203, "PlayAttenuationAnimation", new short[1] { - (short) 81 - }, (short)240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayAttenuationAnimationEffectVector3Animation), false); - SpotLight2DInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[8] + 81 + }, 240, new InvokeHandler(SpotLight2DInstanceSchema.CallPlayAttenuationAnimationEffectVector3Animation), false); + SpotLight2DInstanceSchema.Type.Initialize(null, null, new PropertySchema[8] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema1 + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema2, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema3, + uixPropertySchema6, + uixPropertySchema1 }, new MethodSchema[8] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7, - (MethodSchema) uixMethodSchema8 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DSchema.cs index f933eab..e464f73 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DSchema.cs @@ -15,11 +15,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetPosition(object instanceObj) => (object)((SpotLight2DElement)instanceObj).Position; + private static object GetPosition(object instanceObj) => ((SpotLight2DElement)instanceObj).Position; private static void SetPosition(ref object instanceObj, object valueObj) => ((SpotLight2DElement)instanceObj).Position = (Vector3)valueObj; - private static object GetDirectionAngle(object instanceObj) => (object)((SpotLight2DElement)instanceObj).DirectionAngle; + private static object GetDirectionAngle(object instanceObj) => ((SpotLight2DElement)instanceObj).DirectionAngle; private static void SetDirectionAngle(ref object instanceObj, object valueObj) => ((SpotLight2DElement)instanceObj).DirectionAngle = (float)valueObj; @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAmbientColor(ref object instanceObj, object valueObj) => ((SpotLight2DElement)instanceObj).AmbientColor = ((Color)valueObj).RenderConvert(); - private static object GetInnerConeAngle(object instanceObj) => (object)((SpotLight2DElement)instanceObj).InnerConeAngle; + private static object GetInnerConeAngle(object instanceObj) => ((SpotLight2DElement)instanceObj).InnerConeAngle; private static void SetInnerConeAngle(ref object instanceObj, object valueObj) { @@ -40,7 +40,7 @@ namespace Microsoft.Iris.Markup.UIX spotLight2Delement.InnerConeAngle = num; } - private static object GetOuterConeAngle(object instanceObj) => (object)((SpotLight2DElement)instanceObj).OuterConeAngle; + private static object GetOuterConeAngle(object instanceObj) => ((SpotLight2DElement)instanceObj).OuterConeAngle; private static void SetOuterConeAngle(ref object instanceObj, object valueObj) { @@ -53,7 +53,7 @@ namespace Microsoft.Iris.Markup.UIX spotLight2Delement.OuterConeAngle = num; } - private static object GetIntensity(object instanceObj) => (object)((SpotLight2DElement)instanceObj).Intensity; + private static object GetIntensity(object instanceObj) => ((SpotLight2DElement)instanceObj).Intensity; private static void SetIntensity(ref object instanceObj, object valueObj) { @@ -66,35 +66,35 @@ namespace Microsoft.Iris.Markup.UIX spotLight2Delement.Intensity = num; } - private static object GetAttenuation(object instanceObj) => (object)((SpotLight2DElement)instanceObj).Attenuation; + private static object GetAttenuation(object instanceObj) => ((SpotLight2DElement)instanceObj).Attenuation; private static void SetAttenuation(ref object instanceObj, object valueObj) => ((SpotLight2DElement)instanceObj).Attenuation = (Vector3)valueObj; - private static object Construct() => (object)new SpotLight2DElement(); + private static object Construct() => new SpotLight2DElement(); - public static void Pass1Initialize() => SpotLight2DSchema.Type = new UIXTypeSchema((short)202, "SpotLight2D", (string)null, (short)77, typeof(SpotLight2DElement), UIXTypeFlags.None); + public static void Pass1Initialize() => SpotLight2DSchema.Type = new UIXTypeSchema(202, "SpotLight2D", null, 77, typeof(SpotLight2DElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)202, "Position", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SpotLight2DSchema.GetPosition), new SetValueHandler(SpotLight2DSchema.SetPosition), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)202, "DirectionAngle", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SpotLight2DSchema.GetDirectionAngle), new SetValueHandler(SpotLight2DSchema.SetDirectionAngle), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)202, "LightColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DSchema.SetLightColor), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)202, "AmbientColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(SpotLight2DSchema.SetAmbientColor), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)202, "InnerConeAngle", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SpotLight2DSchema.GetInnerConeAngle), new SetValueHandler(SpotLight2DSchema.SetInnerConeAngle), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)202, "OuterConeAngle", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SpotLight2DSchema.GetOuterConeAngle), new SetValueHandler(SpotLight2DSchema.SetOuterConeAngle), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)202, "Intensity", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SpotLight2DSchema.GetIntensity), new SetValueHandler(SpotLight2DSchema.SetIntensity), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)202, "Attenuation", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SpotLight2DSchema.GetAttenuation), new SetValueHandler(SpotLight2DSchema.SetAttenuation), false); - SpotLight2DSchema.Type.Initialize(new DefaultConstructHandler(SpotLight2DSchema.Construct), (ConstructorSchema[])null, new PropertySchema[8] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(202, "Position", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SpotLight2DSchema.GetPosition), new SetValueHandler(SpotLight2DSchema.SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(202, "DirectionAngle", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SpotLight2DSchema.GetDirectionAngle), new SetValueHandler(SpotLight2DSchema.SetDirectionAngle), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(202, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DSchema.SetLightColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(202, "AmbientColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SpotLight2DSchema.SetAmbientColor), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(202, "InnerConeAngle", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SpotLight2DSchema.GetInnerConeAngle), new SetValueHandler(SpotLight2DSchema.SetInnerConeAngle), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(202, "OuterConeAngle", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SpotLight2DSchema.GetOuterConeAngle), new SetValueHandler(SpotLight2DSchema.SetOuterConeAngle), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(202, "Intensity", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(SpotLight2DSchema.GetIntensity), new SetValueHandler(SpotLight2DSchema.SetIntensity), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(202, "Attenuation", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SpotLight2DSchema.GetAttenuation), new SetValueHandler(SpotLight2DSchema.SetAttenuation), false); + SpotLight2DSchema.Type.Initialize(new DefaultConstructHandler(SpotLight2DSchema.Construct), null, new PropertySchema[8] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema2, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema3, + uixPropertySchema6, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/StackLayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/StackLayoutInputSchema.cs index 398b5b1..e2056e4 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/StackLayoutInputSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/StackLayoutInputSchema.cs @@ -13,27 +13,27 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetPriority(object instanceObj) => (object)((StackLayoutInput)instanceObj).Priority; + private static object GetPriority(object instanceObj) => ((StackLayoutInput)instanceObj).Priority; private static void SetPriority(ref object instanceObj, object valueObj) => ((StackLayoutInput)instanceObj).Priority = (StackPriority)valueObj; - private static object GetMinimumSize(object instanceObj) => (object)((StackLayoutInput)instanceObj).MinimumSize; + private static object GetMinimumSize(object instanceObj) => ((StackLayoutInput)instanceObj).MinimumSize; private static void SetMinimumSize(ref object instanceObj, object valueObj) => ((StackLayoutInput)instanceObj).MinimumSize = (Size)valueObj; - private static object Construct() => (object)new StackLayoutInput(); + private static object Construct() => new StackLayoutInput(); - public static void Pass1Initialize() => StackLayoutInputSchema.Type = new UIXTypeSchema((short)205, "StackLayoutInput", (string)null, (short)133, typeof(StackLayoutInput), UIXTypeFlags.None); + public static void Pass1Initialize() => StackLayoutInputSchema.Type = new UIXTypeSchema(205, "StackLayoutInput", null, 133, typeof(StackLayoutInput), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)205, "Priority", (short)206, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(StackLayoutInputSchema.GetPriority), new SetValueHandler(StackLayoutInputSchema.SetPriority), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)205, "MinimumSize", (short)195, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(StackLayoutInputSchema.GetMinimumSize), new SetValueHandler(StackLayoutInputSchema.SetMinimumSize), false); - StackLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(StackLayoutInputSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(205, "Priority", 206, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(StackLayoutInputSchema.GetPriority), new SetValueHandler(StackLayoutInputSchema.SetPriority), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(205, "MinimumSize", 195, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(StackLayoutInputSchema.GetMinimumSize), new SetValueHandler(StackLayoutInputSchema.SetMinimumSize), false); + StackLayoutInputSchema.Type.Initialize(new DefaultConstructHandler(StackLayoutInputSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/StackLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/StackLayoutSchema.cs index d58239c..eed65b3 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/StackLayoutSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/StackLayoutSchema.cs @@ -12,10 +12,10 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)new StackLayout(); + private static object Construct() => new StackLayout(); - public static void Pass1Initialize() => StackLayoutSchema.Type = new UIXTypeSchema((short)204, "StackLayout", (string)null, (short)132, typeof(StackLayout), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => StackLayoutSchema.Type = new UIXTypeSchema(204, "StackLayout", null, 132, typeof(StackLayout), UIXTypeFlags.Immutable); - public static void Pass2Initialize() => StackLayoutSchema.Type.Initialize(new DefaultConstructHandler(StackLayoutSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => StackLayoutSchema.Type.Initialize(new DefaultConstructHandler(StackLayoutSchema.Construct), null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/StringSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/StringSchema.cs index 26cd49f..0e3a4df 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/StringSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/StringSchema.cs @@ -13,9 +13,9 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetLength(object instanceObj) => (object)((string)instanceObj).Length; + private static object GetLength(object instanceObj) => ((string)instanceObj).Length; - private static object Construct() => (object)string.Empty; + private static object Construct() => string.Empty; private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) { @@ -23,14 +23,14 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteString(str); } - private static object DecodeBinary(ByteCodeReader reader) => (object)reader.ReadString(); + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadString(); private static Result ConvertFromObject(object valueObj, out object instanceObj) { object obj = valueObj; - instanceObj = (object)null; - string str = obj == null ? (string)null : obj.ToString(); - instanceObj = (object)str; + instanceObj = null; + string str = obj == null ? null : obj.ToString(); + instanceObj = str; return Result.Success; } @@ -41,9 +41,9 @@ namespace Microsoft.Iris.Markup.UIX string str = (string)instanceObj; int parameter = (int)parameters[0]; if (parameter >= 0 && parameter <= str.Length) - return (object)str.Substring(parameter); - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter, (object)"startIndex"); - return (object)null; + return str.Substring(parameter); + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter, "startIndex"); + return null; } private static object CallSubstringInt32Int32(object instanceObj, object[] parameters) @@ -53,26 +53,26 @@ namespace Microsoft.Iris.Markup.UIX int parameter2 = (int)parameters[1]; if (parameter1 < 0 || parameter1 > str.Length) { - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter1, (object)"startIndex"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter1, "startIndex"); + return null; } if (parameter2 >= 0 && parameter1 + parameter2 >= 0 && parameter1 + parameter2 <= str.Length) - return (object)str.Substring(parameter1, parameter2); - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)parameter2, (object)"length"); - return (object)null; + return str.Substring(parameter1, parameter2); + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter2, "length"); + return null; } - private static object CallTrim(object instanceObj, object[] parameters) => (object)((string)instanceObj).Trim(); + private static object CallTrim(object instanceObj, object[] parameters) => ((string)instanceObj).Trim(); - private static object CallToLower(object instanceObj, object[] parameters) => (object)((string)instanceObj).ToLowerInvariant(); + private static object CallToLower(object instanceObj, object[] parameters) => ((string)instanceObj).ToLowerInvariant(); - private static object CallToUpper(object instanceObj, object[] parameters) => (object)((string)instanceObj).ToUpperInvariant(); + private static object CallToUpper(object instanceObj, object[] parameters) => ((string)instanceObj).ToUpperInvariant(); private static object CallFormatObject(object instanceObj, object[] parameters) { string format = (string)instanceObj; object parameter = parameters[0]; - return (object)string.Format(format, parameters); + return string.Format(format, parameters); } private static object CallFormatObjectObject(object instanceObj, object[] parameters) @@ -80,7 +80,7 @@ namespace Microsoft.Iris.Markup.UIX string format = (string)instanceObj; object parameter1 = parameters[0]; object parameter2 = parameters[1]; - return (object)string.Format(format, parameters); + return string.Format(format, parameters); } private static object CallFormatObjectObjectObject(object instanceObj, object[] parameters) @@ -89,7 +89,7 @@ namespace Microsoft.Iris.Markup.UIX object parameter1 = parameters[0]; object parameter2 = parameters[1]; object parameter3 = parameters[2]; - return (object)string.Format(format, parameters); + return string.Format(format, parameters); } private static object CallFormatObjectObjectObjectObject( @@ -101,7 +101,7 @@ namespace Microsoft.Iris.Markup.UIX object parameter2 = parameters[1]; object parameter3 = parameters[2]; object parameter4 = parameters[3]; - return (object)string.Format(format, parameters); + return string.Format(format, parameters); } private static object CallFormatObjectObjectObjectObjectObject( @@ -114,7 +114,7 @@ namespace Microsoft.Iris.Markup.UIX object parameter3 = parameters[2]; object parameter4 = parameters[3]; object parameter5 = parameters[4]; - return (object)string.Format(format, parameters); + return string.Format(format, parameters); } private static bool IsConversionSupported(TypeSchema fromType) => ObjectSchema.Type.IsAssignableFrom(fromType); @@ -125,7 +125,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (ObjectSchema.Type.IsAssignableFrom(fromType)) { result = StringSchema.ConvertFromObject(from, out instance); @@ -155,84 +155,84 @@ namespace Microsoft.Iris.Markup.UIX switch (op) { case OperationType.MathAdd: - return (object)(str1 + str2); + return str1 + str2; case OperationType.RelationalEquals: return BooleanBoxes.Box(str1 == str2); case OperationType.RelationalNotEquals: return BooleanBoxes.Box(str1 != str2); default: - return (object)null; + return null; } } - public static void Pass1Initialize() => StringSchema.Type = new UIXTypeSchema((short)208, "String", "string", (short)153, typeof(string), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => StringSchema.Type = new UIXTypeSchema(208, "String", "string", 153, typeof(string), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)208, "Length", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(StringSchema.GetLength), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)208, "IsNullOrEmpty", new short[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(208, "Length", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(StringSchema.GetLength), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(208, "IsNullOrEmpty", new short[1] { - (short) 208 - }, (short)15, new InvokeHandler(StringSchema.CallIsNullOrEmptyString), true); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)208, "Substring", new short[1] + 208 + }, 15, new InvokeHandler(StringSchema.CallIsNullOrEmptyString), true); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(208, "Substring", new short[1] { - (short) 115 - }, (short)208, new InvokeHandler(StringSchema.CallSubstringInt32), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)208, "Substring", new short[2] + 115 + }, 208, new InvokeHandler(StringSchema.CallSubstringInt32), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(208, "Substring", new short[2] { - (short) 115, - (short) 115 - }, (short)208, new InvokeHandler(StringSchema.CallSubstringInt32Int32), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)208, "Trim", (short[])null, (short)208, new InvokeHandler(StringSchema.CallTrim), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)208, "ToLower", (short[])null, (short)208, new InvokeHandler(StringSchema.CallToLower), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)208, "ToUpper", (short[])null, (short)208, new InvokeHandler(StringSchema.CallToUpper), false); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)208, "Format", new short[1] + 115, + 115 + }, 208, new InvokeHandler(StringSchema.CallSubstringInt32Int32), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(208, "Trim", null, 208, new InvokeHandler(StringSchema.CallTrim), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(208, "ToLower", null, 208, new InvokeHandler(StringSchema.CallToLower), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(208, "ToUpper", null, 208, new InvokeHandler(StringSchema.CallToUpper), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(208, "Format", new short[1] { - (short) 153 - }, (short)208, new InvokeHandler(StringSchema.CallFormatObject), false); - UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema((short)208, "Format", new short[2] + 153 + }, 208, new InvokeHandler(StringSchema.CallFormatObject), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(208, "Format", new short[2] { - (short) 153, - (short) 153 - }, (short)208, new InvokeHandler(StringSchema.CallFormatObjectObject), false); - UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema((short)208, "Format", new short[3] + 153, + 153 + }, 208, new InvokeHandler(StringSchema.CallFormatObjectObject), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(208, "Format", new short[3] { - (short) 153, - (short) 153, - (short) 153 - }, (short)208, new InvokeHandler(StringSchema.CallFormatObjectObjectObject), false); - UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema((short)208, "Format", new short[4] + 153, + 153, + 153 + }, 208, new InvokeHandler(StringSchema.CallFormatObjectObjectObject), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(208, "Format", new short[4] { - (short) 153, - (short) 153, - (short) 153, - (short) 153 - }, (short)208, new InvokeHandler(StringSchema.CallFormatObjectObjectObjectObject), false); - UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema((short)208, "Format", new short[5] + 153, + 153, + 153, + 153 + }, 208, new InvokeHandler(StringSchema.CallFormatObjectObjectObjectObject), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(208, "Format", new short[5] { - (short) 153, - (short) 153, - (short) 153, - (short) 153, - (short) 153 - }, (short)208, new InvokeHandler(StringSchema.CallFormatObjectObjectObjectObjectObject), false); - StringSchema.Type.Initialize(new DefaultConstructHandler(StringSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + 153, + 153, + 153, + 153, + 153 + }, 208, new InvokeHandler(StringSchema.CallFormatObjectObjectObjectObjectObject), false); + StringSchema.Type.Initialize(new DefaultConstructHandler(StringSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema + uixPropertySchema }, new MethodSchema[11] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7, - (MethodSchema) uixMethodSchema8, - (MethodSchema) uixMethodSchema9, - (MethodSchema) uixMethodSchema10, - (MethodSchema) uixMethodSchema11 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(StringSchema.TryConvertFrom), new SupportsTypeConversionHandler(StringSchema.IsConversionSupported), new EncodeBinaryHandler(StringSchema.EncodeBinary), new DecodeBinaryHandler(StringSchema.DecodeBinary), new PerformOperationHandler(StringSchema.ExecuteOperation), new SupportsOperationHandler(StringSchema.IsOperationSupported)); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8, + uixMethodSchema9, + uixMethodSchema10, + uixMethodSchema11 + }, null, null, new TypeConverterHandler(StringSchema.TryConvertFrom), new SupportsTypeConversionHandler(StringSchema.IsConversionSupported), new EncodeBinaryHandler(StringSchema.EncodeBinary), new DecodeBinaryHandler(StringSchema.DecodeBinary), new PerformOperationHandler(StringSchema.ExecuteOperation), new SupportsOperationHandler(StringSchema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/SwitchAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SwitchAnimationSchema.cs index 2d05dc6..c5bb277 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/SwitchAnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/SwitchAnimationSchema.cs @@ -13,31 +13,31 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetExpression(object instanceObj) => (object)((SwitchAnimation)instanceObj).Expression; + private static object GetExpression(object instanceObj) => ((SwitchAnimation)instanceObj).Expression; private static void SetExpression(ref object instanceObj, object valueObj) => ((SwitchAnimation)instanceObj).Expression = (IUIValueRange)valueObj; - private static object GetOptions(object instanceObj) => (object)((SwitchAnimation)instanceObj).Options; + private static object GetOptions(object instanceObj) => ((SwitchAnimation)instanceObj).Options; - private static object GetType(object instanceObj) => (object)((SwitchAnimation)instanceObj).Type; + private static object GetType(object instanceObj) => ((SwitchAnimation)instanceObj).Type; private static void SetType(ref object instanceObj, object valueObj) => ((SwitchAnimation)instanceObj).Type = (AnimationEventType)valueObj; - private static object Construct() => (object)new SwitchAnimation(); + private static object Construct() => new SwitchAnimation(); - public static void Pass1Initialize() => SwitchAnimationSchema.Type = new UIXTypeSchema((short)210, "SwitchAnimation", (string)null, (short)104, typeof(SwitchAnimation), UIXTypeFlags.None); + public static void Pass1Initialize() => SwitchAnimationSchema.Type = new UIXTypeSchema(210, "SwitchAnimation", null, 104, typeof(SwitchAnimation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)210, "Expression", (short)231, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SwitchAnimationSchema.GetExpression), new SetValueHandler(SwitchAnimationSchema.SetExpression), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)210, "Options", (short)58, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(SwitchAnimationSchema.GetOptions), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)210, "Type", (short)10, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(SwitchAnimationSchema.GetType), new SetValueHandler(SwitchAnimationSchema.SetType), false); - SwitchAnimationSchema.Type.Initialize(new DefaultConstructHandler(SwitchAnimationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(210, "Expression", 231, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SwitchAnimationSchema.GetExpression), new SetValueHandler(SwitchAnimationSchema.SetExpression), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(210, "Options", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(SwitchAnimationSchema.GetOptions), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(210, "Type", 10, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(SwitchAnimationSchema.GetType), new SetValueHandler(SwitchAnimationSchema.SetType), false); + SwitchAnimationSchema.Type.Initialize(new DefaultConstructHandler(SwitchAnimationSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TextEditingHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TextEditingHandlerSchema.cs index 69fc9c0..322b9c9 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TextEditingHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TextEditingHandlerSchema.cs @@ -25,9 +25,9 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAcceptsTab(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).AcceptsTab = (bool)valueObj; - private static object GetCaretInfo(object instanceObj) => (object)((TextEditingHandler)instanceObj).CaretInfo; + private static object GetCaretInfo(object instanceObj) => ((TextEditingHandler)instanceObj).CaretInfo; - private static object GetEditableTextData(object instanceObj) => (object)((TextEditingHandler)instanceObj).EditableTextData; + private static object GetEditableTextData(object instanceObj) => ((TextEditingHandler)instanceObj).EditableTextData; private static void SetEditableTextData(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).EditableTextData = (EditableTextData)valueObj; @@ -35,11 +35,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetOvertype(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).Overtype = (bool)valueObj; - private static object GetTextDisplay(object instanceObj) => (object)((TextEditingHandler)instanceObj).TextDisplay; + private static object GetTextDisplay(object instanceObj) => ((TextEditingHandler)instanceObj).TextDisplay; private static void SetTextDisplay(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).TextDisplay = (Text)valueObj; - private static object GetSelectionRange(object instanceObj) => (object)((TextEditingHandler)instanceObj).SelectionRange; + private static object GetSelectionRange(object instanceObj) => ((TextEditingHandler)instanceObj).SelectionRange; private static void SetSelectionRange(ref object instanceObj, object valueObj) { @@ -49,29 +49,29 @@ namespace Microsoft.Iris.Markup.UIX if (textEditingHandler.EditableTextData != null && textEditingHandler.EditableTextData.Value != null) num = textEditingHandler.EditableTextData.Value.Length; if (range.Begin < 0 || range.Begin > num) - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)range.Begin, (object)"SelectionRange.Begin"); + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", range.Begin, "SelectionRange.Begin"); if (range.End < 0 || range.End > num) - ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", (object)range.End, (object)"SelectionRange.End"); + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", range.End, "SelectionRange.End"); textEditingHandler.SelectionRange = range; } - private static object GetCopyCommand(object instanceObj) => (object)((TextEditingHandler)instanceObj).CopyCommand; + private static object GetCopyCommand(object instanceObj) => ((TextEditingHandler)instanceObj).CopyCommand; - private static object GetCutCommand(object instanceObj) => (object)((TextEditingHandler)instanceObj).CutCommand; + private static object GetCutCommand(object instanceObj) => ((TextEditingHandler)instanceObj).CutCommand; - private static object GetDeleteCommand(object instanceObj) => (object)((TextEditingHandler)instanceObj).DeleteCommand; + private static object GetDeleteCommand(object instanceObj) => ((TextEditingHandler)instanceObj).DeleteCommand; - private static object GetPasteCommand(object instanceObj) => (object)((TextEditingHandler)instanceObj).PasteCommand; + private static object GetPasteCommand(object instanceObj) => ((TextEditingHandler)instanceObj).PasteCommand; - private static object GetSelectAllCommand(object instanceObj) => (object)((TextEditingHandler)instanceObj).SelectAllCommand; + private static object GetSelectAllCommand(object instanceObj) => ((TextEditingHandler)instanceObj).SelectAllCommand; - private static object GetUndoCommand(object instanceObj) => (object)((TextEditingHandler)instanceObj).UndoCommand; + private static object GetUndoCommand(object instanceObj) => ((TextEditingHandler)instanceObj).UndoCommand; - private static object GetHorizontalScrollModel(object instanceObj) => (object)((TextEditingHandler)instanceObj).HorizontalScrollModel; + private static object GetHorizontalScrollModel(object instanceObj) => ((TextEditingHandler)instanceObj).HorizontalScrollModel; private static void SetHorizontalScrollModel(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).HorizontalScrollModel = (TextScrollModel)valueObj; - private static object GetVerticalScrollModel(object instanceObj) => (object)((TextEditingHandler)instanceObj).VerticalScrollModel; + private static object GetVerticalScrollModel(object instanceObj) => ((TextEditingHandler)instanceObj).VerticalScrollModel; private static void SetVerticalScrollModel(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).VerticalScrollModel = (TextScrollModel)valueObj; @@ -79,125 +79,125 @@ namespace Microsoft.Iris.Markup.UIX private static void SetDetectUrls(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).DetectUrls = (bool)valueObj; - private static object GetLinkColor(object instanceObj) => (object)((TextEditingHandler)instanceObj).LinkColor; + private static object GetLinkColor(object instanceObj) => ((TextEditingHandler)instanceObj).LinkColor; private static void SetLinkColor(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).LinkColor = (Color)valueObj; - private static object GetLinkClickedParameter(object instanceObj) => (object)((TextEditingHandler)instanceObj).LinkClickedParameter; + private static object GetLinkClickedParameter(object instanceObj) => ((TextEditingHandler)instanceObj).LinkClickedParameter; private static object GetInImeCompositionMode(object instanceObj) => BooleanBoxes.Box(((TextEditingHandler)instanceObj).InImeCompositionMode); private static void SetInImeCompositionMode(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).InImeCompositionMode = (bool)valueObj; - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; - private static object Construct() => (object)new TextEditingHandler(); + private static object Construct() => new TextEditingHandler(); private static object CallCopy(object instanceObj, object[] parameters) { ((TextEditingHandler)instanceObj).Copy(); - return (object)null; + return null; } private static object CallCut(object instanceObj, object[] parameters) { ((TextEditingHandler)instanceObj).Cut(); - return (object)null; + return null; } private static object CallDelete(object instanceObj, object[] parameters) { ((TextEditingHandler)instanceObj).Delete(); - return (object)null; + return null; } private static object CallPaste(object instanceObj, object[] parameters) { ((TextEditingHandler)instanceObj).Paste(); - return (object)null; + return null; } private static object CallSelectAll(object instanceObj, object[] parameters) { ((TextEditingHandler)instanceObj).SelectAll(); - return (object)null; + return null; } private static object CallUndo(object instanceObj, object[] parameters) { ((TextEditingHandler)instanceObj).Undo(); - return (object)null; + return null; } - public static void Pass1Initialize() => TextEditingHandlerSchema.Type = new UIXTypeSchema((short)214, "TextEditingHandler", (string)null, (short)110, typeof(TextEditingHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => TextEditingHandlerSchema.Type = new UIXTypeSchema(214, "TextEditingHandler", null, 110, typeof(TextEditingHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)214, "AcceptsEnter", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetAcceptsEnter), new SetValueHandler(TextEditingHandlerSchema.SetAcceptsEnter), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)214, "AcceptsTab", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetAcceptsTab), new SetValueHandler(TextEditingHandlerSchema.SetAcceptsTab), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)214, "CaretInfo", (short)26, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetCaretInfo), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)214, "EditableTextData", (short)68, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetEditableTextData), new SetValueHandler(TextEditingHandlerSchema.SetEditableTextData), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)214, "Overtype", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetOvertype), new SetValueHandler(TextEditingHandlerSchema.SetOvertype), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)214, "TextDisplay", (short)212, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetTextDisplay), new SetValueHandler(TextEditingHandlerSchema.SetTextDisplay), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)214, "SelectionRange", (short)187, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetSelectionRange), new SetValueHandler(TextEditingHandlerSchema.SetSelectionRange), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)214, "CopyCommand", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetCopyCommand), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)214, "CutCommand", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetCutCommand), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)214, "DeleteCommand", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetDeleteCommand), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)214, "PasteCommand", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetPasteCommand), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)214, "SelectAllCommand", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetSelectAllCommand), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema((short)214, "UndoCommand", (short)40, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetUndoCommand), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema((short)214, "HorizontalScrollModel", (short)218, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetHorizontalScrollModel), new SetValueHandler(TextEditingHandlerSchema.SetHorizontalScrollModel), false); - UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema((short)214, "VerticalScrollModel", (short)218, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetVerticalScrollModel), new SetValueHandler(TextEditingHandlerSchema.SetVerticalScrollModel), false); - UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema((short)214, "DetectUrls", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetDetectUrls), new SetValueHandler(TextEditingHandlerSchema.SetDetectUrls), false); - UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema((short)214, "LinkColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetLinkColor), new SetValueHandler(TextEditingHandlerSchema.SetLinkColor), false); - UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema((short)214, "LinkClickedParameter", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetLinkClickedParameter), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema((short)214, "InImeCompositionMode", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetInImeCompositionMode), new SetValueHandler(TextEditingHandlerSchema.SetInImeCompositionMode), false); - UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema((short)214, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextEditingHandlerSchema.GetHandlerStage), new SetValueHandler(TextEditingHandlerSchema.SetHandlerStage), false); - UIXEventSchema uixEventSchema1 = new UIXEventSchema((short)214, "TypingInputRejected"); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)214, "Copy", (short[])null, (short)240, new InvokeHandler(TextEditingHandlerSchema.CallCopy), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)214, "Cut", (short[])null, (short)240, new InvokeHandler(TextEditingHandlerSchema.CallCut), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)214, "Delete", (short[])null, (short)240, new InvokeHandler(TextEditingHandlerSchema.CallDelete), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)214, "Paste", (short[])null, (short)240, new InvokeHandler(TextEditingHandlerSchema.CallPaste), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)214, "SelectAll", (short[])null, (short)240, new InvokeHandler(TextEditingHandlerSchema.CallSelectAll), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)214, "Undo", (short[])null, (short)240, new InvokeHandler(TextEditingHandlerSchema.CallUndo), false); - UIXEventSchema uixEventSchema2 = new UIXEventSchema((short)214, "LinkClicked"); - TextEditingHandlerSchema.Type.Initialize(new DefaultConstructHandler(TextEditingHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[20] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(214, "AcceptsEnter", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetAcceptsEnter), new SetValueHandler(TextEditingHandlerSchema.SetAcceptsEnter), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(214, "AcceptsTab", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetAcceptsTab), new SetValueHandler(TextEditingHandlerSchema.SetAcceptsTab), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(214, "CaretInfo", 26, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetCaretInfo), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(214, "EditableTextData", 68, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetEditableTextData), new SetValueHandler(TextEditingHandlerSchema.SetEditableTextData), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(214, "Overtype", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetOvertype), new SetValueHandler(TextEditingHandlerSchema.SetOvertype), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(214, "TextDisplay", 212, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetTextDisplay), new SetValueHandler(TextEditingHandlerSchema.SetTextDisplay), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(214, "SelectionRange", 187, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetSelectionRange), new SetValueHandler(TextEditingHandlerSchema.SetSelectionRange), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(214, "CopyCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetCopyCommand), null, false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(214, "CutCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetCutCommand), null, false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(214, "DeleteCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetDeleteCommand), null, false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(214, "PasteCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetPasteCommand), null, false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(214, "SelectAllCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetSelectAllCommand), null, false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(214, "UndoCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetUndoCommand), null, false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(214, "HorizontalScrollModel", 218, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetHorizontalScrollModel), new SetValueHandler(TextEditingHandlerSchema.SetHorizontalScrollModel), false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(214, "VerticalScrollModel", 218, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetVerticalScrollModel), new SetValueHandler(TextEditingHandlerSchema.SetVerticalScrollModel), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(214, "DetectUrls", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetDetectUrls), new SetValueHandler(TextEditingHandlerSchema.SetDetectUrls), false); + UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema(214, "LinkColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetLinkColor), new SetValueHandler(TextEditingHandlerSchema.SetLinkColor), false); + UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema(214, "LinkClickedParameter", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetLinkClickedParameter), null, false); + UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema(214, "InImeCompositionMode", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetInImeCompositionMode), new SetValueHandler(TextEditingHandlerSchema.SetInImeCompositionMode), false); + UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema(214, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextEditingHandlerSchema.GetHandlerStage), new SetValueHandler(TextEditingHandlerSchema.SetHandlerStage), false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(214, "TypingInputRejected"); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(214, "Copy", null, 240, new InvokeHandler(TextEditingHandlerSchema.CallCopy), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(214, "Cut", null, 240, new InvokeHandler(TextEditingHandlerSchema.CallCut), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(214, "Delete", null, 240, new InvokeHandler(TextEditingHandlerSchema.CallDelete), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(214, "Paste", null, 240, new InvokeHandler(TextEditingHandlerSchema.CallPaste), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(214, "SelectAll", null, 240, new InvokeHandler(TextEditingHandlerSchema.CallSelectAll), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(214, "Undo", null, 240, new InvokeHandler(TextEditingHandlerSchema.CallUndo), false); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(214, "LinkClicked"); + TextEditingHandlerSchema.Type.Initialize(new DefaultConstructHandler(TextEditingHandlerSchema.Construct), null, new PropertySchema[20] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema16, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema20, - (PropertySchema) uixPropertySchema14, - (PropertySchema) uixPropertySchema19, - (PropertySchema) uixPropertySchema18, - (PropertySchema) uixPropertySchema17, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema13, - (PropertySchema) uixPropertySchema15 + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema8, + uixPropertySchema9, + uixPropertySchema10, + uixPropertySchema16, + uixPropertySchema4, + uixPropertySchema20, + uixPropertySchema14, + uixPropertySchema19, + uixPropertySchema18, + uixPropertySchema17, + uixPropertySchema5, + uixPropertySchema11, + uixPropertySchema12, + uixPropertySchema7, + uixPropertySchema6, + uixPropertySchema13, + uixPropertySchema15 }, new MethodSchema[6] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6 + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6 }, new EventSchema[2] { - (EventSchema) uixEventSchema1, - (EventSchema) uixEventSchema2 - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema1, + uixEventSchema2 + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TextFragmentSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TextFragmentSchema.cs index 173c1e5..c524f0f 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TextFragmentSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TextFragmentSchema.cs @@ -12,29 +12,29 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetRuns(object instanceObj) => (object)((TextFragment)instanceObj).Runs; + private static object GetRuns(object instanceObj) => ((TextFragment)instanceObj).Runs; - private static object GetTagName(object instanceObj) => (object)((TextFragment)instanceObj).TagName; + private static object GetTagName(object instanceObj) => ((TextFragment)instanceObj).TagName; - private static object GetContent(object instanceObj) => (object)((TextFragment)instanceObj).Content; + private static object GetContent(object instanceObj) => ((TextFragment)instanceObj).Content; - private static object GetAttributes(object instanceObj) => (object)((TextFragment)instanceObj).Attributes; + private static object GetAttributes(object instanceObj) => ((TextFragment)instanceObj).Attributes; - public static void Pass1Initialize() => TextFragmentSchema.Type = new UIXTypeSchema((short)215, "TextFragment", (string)null, (short)153, typeof(TextFragment), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => TextFragmentSchema.Type = new UIXTypeSchema(215, "TextFragment", null, 153, typeof(TextFragment), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)215, "Runs", (short)138, (short)216, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, false, new GetValueHandler(TextFragmentSchema.GetRuns), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)215, "TagName", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TextFragmentSchema.GetTagName), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)215, "Content", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TextFragmentSchema.GetContent), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)215, "Attributes", (short)58, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TextFragmentSchema.GetAttributes), (SetValueHandler)null, false); - TextFragmentSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(215, "Runs", 138, 216, ExpressionRestriction.ReadOnly, false, null, false, new GetValueHandler(TextFragmentSchema.GetRuns), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(215, "TagName", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TextFragmentSchema.GetTagName), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(215, "Content", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TextFragmentSchema.GetContent), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(215, "Attributes", 58, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TextFragmentSchema.GetAttributes), null, false); + TextFragmentSchema.Type.Initialize(null, null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema4, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TextRunDataSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TextRunDataSchema.cs index f3a6ed4..1456cf2 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TextRunDataSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TextRunDataSchema.cs @@ -12,29 +12,29 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetPosition(object instanceObj) => (object)((TextRunData)instanceObj).Position; + private static object GetPosition(object instanceObj) => ((TextRunData)instanceObj).Position; - private static object GetSize(object instanceObj) => (object)((TextRunData)instanceObj).Size; + private static object GetSize(object instanceObj) => ((TextRunData)instanceObj).Size; - private static object GetColor(object instanceObj) => (object)((TextRunData)instanceObj).Color; + private static object GetColor(object instanceObj) => ((TextRunData)instanceObj).Color; - private static object GetLineNumber(object instanceObj) => (object)((TextRunData)instanceObj).LineNumber; + private static object GetLineNumber(object instanceObj) => ((TextRunData)instanceObj).LineNumber; - public static void Pass1Initialize() => TextRunDataSchema.Type = new UIXTypeSchema((short)216, "TextRunData", (string)null, (short)153, typeof(TextRunData), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => TextRunDataSchema.Type = new UIXTypeSchema(216, "TextRunData", null, 153, typeof(TextRunData), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)216, "Position", (short)158, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TextRunDataSchema.GetPosition), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)216, "Size", (short)195, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TextRunDataSchema.GetSize), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)216, "Color", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TextRunDataSchema.GetColor), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)216, "LineNumber", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TextRunDataSchema.GetLineNumber), (SetValueHandler)null, false); - TextRunDataSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(216, "Position", 158, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TextRunDataSchema.GetPosition), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(216, "Size", 195, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TextRunDataSchema.GetSize), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(216, "Color", 35, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TextRunDataSchema.GetColor), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(216, "LineNumber", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TextRunDataSchema.GetLineNumber), null, false); + TextRunDataSchema.Type.Initialize(null, null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TextRunRendererSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TextRunRendererSchema.cs index 66cfe17..75b7669 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TextRunRendererSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TextRunRendererSchema.cs @@ -14,33 +14,33 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetData(object instanceObj) => (object)((TextRunRenderer)instanceObj).Data; + private static object GetData(object instanceObj) => ((TextRunRenderer)instanceObj).Data; private static void SetData(ref object instanceObj, object valueObj) => ((TextRunRenderer)instanceObj).Data = (TextRunData)valueObj; - private static object GetColor(object instanceObj) => (object)((TextRunRenderer)instanceObj).Color; + private static object GetColor(object instanceObj) => ((TextRunRenderer)instanceObj).Color; private static void SetColor(ref object instanceObj, object valueObj) => ((TextRunRenderer)instanceObj).Color = (Color)valueObj; - private static object GetEffect(object instanceObj) => (object)((ViewItem)instanceObj).Effect; + private static object GetEffect(object instanceObj) => ((ViewItem)instanceObj).Effect; private static void SetEffect(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Effect = (EffectClass)valueObj; - private static object Construct() => (object)new TextRunRenderer(); + private static object Construct() => new TextRunRenderer(); - public static void Pass1Initialize() => TextRunRendererSchema.Type = new UIXTypeSchema((short)217, "TextRunRenderer", (string)null, (short)239, typeof(TextRunRenderer), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => TextRunRendererSchema.Type = new UIXTypeSchema(217, "TextRunRenderer", null, 239, typeof(TextRunRenderer), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)217, "Data", (short)216, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextRunRendererSchema.GetData), new SetValueHandler(TextRunRendererSchema.SetData), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)217, "Color", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextRunRendererSchema.GetColor), new SetValueHandler(TextRunRendererSchema.SetColor), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)217, "Effect", (short)78, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextRunRendererSchema.GetEffect), new SetValueHandler(TextRunRendererSchema.SetEffect), false); - TextRunRendererSchema.Type.Initialize(new DefaultConstructHandler(TextRunRendererSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(217, "Data", 216, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextRunRendererSchema.GetData), new SetValueHandler(TextRunRendererSchema.SetData), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(217, "Color", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextRunRendererSchema.GetColor), new SetValueHandler(TextRunRendererSchema.SetColor), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(217, "Effect", 78, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextRunRendererSchema.GetEffect), new SetValueHandler(TextRunRendererSchema.SetEffect), false); + TextRunRendererSchema.Type.Initialize(new DefaultConstructHandler(TextRunRendererSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema3 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TextSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TextSchema.cs index 1965a54..43f375a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TextSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TextSchema.cs @@ -17,15 +17,15 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetContent(object instanceObj) => (object)((Text)instanceObj).Content; + private static object GetContent(object instanceObj) => ((Text)instanceObj).Content; private static void SetContent(ref object instanceObj, object valueObj) => ((Text)instanceObj).Content = (string)valueObj; - private static object GetFont(object instanceObj) => (object)((Text)instanceObj).Font; + private static object GetFont(object instanceObj) => ((Text)instanceObj).Font; private static void SetFont(ref object instanceObj, object valueObj) => ((Text)instanceObj).Font = (Font)valueObj; - private static object GetColor(object instanceObj) => (object)((Text)instanceObj).Color; + private static object GetColor(object instanceObj) => ((Text)instanceObj).Color; private static void SetColor(ref object instanceObj, object valueObj) => ((Text)instanceObj).Color = (Color)valueObj; @@ -33,7 +33,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetWordWrap(ref object instanceObj, object valueObj) => ((Text)instanceObj).WordWrap = (bool)valueObj; - private static object GetMaximumLines(object instanceObj) => (object)((Text)instanceObj).MaximumLines; + private static object GetMaximumLines(object instanceObj) => ((Text)instanceObj).MaximumLines; private static void SetMaximumLines(ref object instanceObj, object valueObj) { @@ -46,15 +46,15 @@ namespace Microsoft.Iris.Markup.UIX text.MaximumLines = num; } - private static object GetLineAlignment(object instanceObj) => (object)((Text)instanceObj).LineAlignment; + private static object GetLineAlignment(object instanceObj) => ((Text)instanceObj).LineAlignment; private static void SetLineAlignment(ref object instanceObj, object valueObj) => ((Text)instanceObj).LineAlignment = (LineAlignment)valueObj; - private static object GetLineSpacing(object instanceObj) => (object)((Text)instanceObj).LineSpacing; + private static object GetLineSpacing(object instanceObj) => ((Text)instanceObj).LineSpacing; private static void SetLineSpacing(ref object instanceObj, object valueObj) => ((Text)instanceObj).LineSpacing = (float)valueObj; - private static object GetCharacterSpacing(object instanceObj) => (object)((Text)instanceObj).CharacterSpacing; + private static object GetCharacterSpacing(object instanceObj) => ((Text)instanceObj).CharacterSpacing; private static void SetCharacterSpacing(ref object instanceObj, object valueObj) => ((Text)instanceObj).CharacterSpacing = (float)valueObj; @@ -62,23 +62,23 @@ namespace Microsoft.Iris.Markup.UIX private static void SetEnableKerning(ref object instanceObj, object valueObj) => ((Text)instanceObj).EnableKerning = (bool)valueObj; - private static object GetLastLineBounds(object instanceObj) => (object)((Text)instanceObj).LastLineBounds; + private static object GetLastLineBounds(object instanceObj) => ((Text)instanceObj).LastLineBounds; - private static object GetFadeSize(object instanceObj) => (object)((Text)instanceObj).FadeSize; + private static object GetFadeSize(object instanceObj) => ((Text)instanceObj).FadeSize; private static void SetFadeSize(ref object instanceObj, object valueObj) => ((Text)instanceObj).FadeSize = (float)valueObj; - private static object GetStyle(object instanceObj) => (object)((Text)instanceObj).Style; + private static object GetStyle(object instanceObj) => ((Text)instanceObj).Style; private static void SetStyle(ref object instanceObj, object valueObj) => ((Text)instanceObj).Style = (TextStyle)valueObj; - private static object GetNamedStyles(object instanceObj) => (object)((Text)instanceObj).NamedStyles; + private static object GetNamedStyles(object instanceObj) => ((Text)instanceObj).NamedStyles; private static void SetNamedStyles(ref object instanceObj, object valueObj) => ((Text)instanceObj).NamedStyles = (IDictionary)valueObj; - private static object GetFragments(object instanceObj) => (object)((Text)instanceObj).Fragments; + private static object GetFragments(object instanceObj) => ((Text)instanceObj).Fragments; - private static object GetTextSharpness(object instanceObj) => (object)((Text)instanceObj).TextSharpness; + private static object GetTextSharpness(object instanceObj) => ((Text)instanceObj).TextSharpness; private static void SetTextSharpness(ref object instanceObj, object valueObj) => ((Text)instanceObj).TextSharpness = (TextSharpness)valueObj; @@ -88,11 +88,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetContributesToWidth(ref object instanceObj, object valueObj) => ((Text)instanceObj).ContributesToWidth = (bool)valueObj; - private static object GetBoundsType(object instanceObj) => (object)((Text)instanceObj).BoundsType; + private static object GetBoundsType(object instanceObj) => ((Text)instanceObj).BoundsType; private static void SetBoundsType(ref object instanceObj, object valueObj) => ((Text)instanceObj).BoundsType = (TextBounds)valueObj; - private static object GetEffect(object instanceObj) => (object)((ViewItem)instanceObj).Effect; + private static object GetEffect(object instanceObj) => ((ViewItem)instanceObj).Effect; private static void SetEffect(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Effect = (EffectClass)valueObj; @@ -100,11 +100,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetDisableIme(ref object instanceObj, object valueObj) => ((Text)instanceObj).DisableIme = (bool)valueObj; - private static object GetHighlightColor(object instanceObj) => (object)((Text)instanceObj).HighlightColor; + private static object GetHighlightColor(object instanceObj) => ((Text)instanceObj).HighlightColor; private static void SetHighlightColor(ref object instanceObj, object valueObj) => ((Text)instanceObj).HighlightColor = (Color)valueObj; - private static object GetTextHighlightColor(object instanceObj) => (object)((Text)instanceObj).TextHighlightColor; + private static object GetTextHighlightColor(object instanceObj) => ((Text)instanceObj).TextHighlightColor; private static void SetTextHighlightColor(ref object instanceObj, object valueObj) => ((Text)instanceObj).TextHighlightColor = (Color)valueObj; @@ -112,67 +112,67 @@ namespace Microsoft.Iris.Markup.UIX private static void SetUsePasswordMask(ref object instanceObj, object valueObj) => ((Text)instanceObj).UsePasswordMask = (bool)valueObj; - private static object GetPasswordMask(object instanceObj) => (object)((Text)instanceObj).PasswordMask; + private static object GetPasswordMask(object instanceObj) => ((Text)instanceObj).PasswordMask; private static void SetPasswordMask(ref object instanceObj, object valueObj) => ((Text)instanceObj).PasswordMask = (char)valueObj; - private static object Construct() => (object)new Text(); + private static object Construct() => new Text(); - public static void Pass1Initialize() => TextSchema.Type = new UIXTypeSchema((short)212, "Text", (string)null, (short)239, typeof(Text), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => TextSchema.Type = new UIXTypeSchema(212, "Text", null, 239, typeof(Text), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)212, "Content", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetContent), new SetValueHandler(TextSchema.SetContent), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)212, "Font", (short)93, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetFont), new SetValueHandler(TextSchema.SetFont), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)212, "Color", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetColor), new SetValueHandler(TextSchema.SetColor), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)212, "WordWrap", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetWordWrap), new SetValueHandler(TextSchema.SetWordWrap), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)212, "MaximumLines", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(TextSchema.GetMaximumLines), new SetValueHandler(TextSchema.SetMaximumLines), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)212, "LineAlignment", (short)137, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetLineAlignment), new SetValueHandler(TextSchema.SetLineAlignment), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)212, "LineSpacing", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetLineSpacing), new SetValueHandler(TextSchema.SetLineSpacing), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)212, "CharacterSpacing", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetCharacterSpacing), new SetValueHandler(TextSchema.SetCharacterSpacing), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)212, "EnableKerning", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetEnableKerning), new SetValueHandler(TextSchema.SetEnableKerning), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)212, "LastLineBounds", (short)169, (short)-1, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetLastLineBounds), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)212, "FadeSize", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetFadeSize), new SetValueHandler(TextSchema.SetFadeSize), false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)212, "Style", (short)220, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetStyle), new SetValueHandler(TextSchema.SetStyle), false); - UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema((short)212, "NamedStyles", (short)58, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetNamedStyles), new SetValueHandler(TextSchema.SetNamedStyles), false); - UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema((short)212, "Fragments", (short)138, (short)215, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetFragments), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema((short)212, "TextSharpness", (short)219, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetTextSharpness), new SetValueHandler(TextSchema.SetTextSharpness), false); - UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema((short)212, "Clipped", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetClipped), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema((short)212, "ContributesToWidth", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetContributesToWidth), new SetValueHandler(TextSchema.SetContributesToWidth), false); - UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema((short)212, "BoundsType", (short)213, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetBoundsType), new SetValueHandler(TextSchema.SetBoundsType), false); - UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema((short)212, "Effect", (short)78, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetEffect), new SetValueHandler(TextSchema.SetEffect), false); - UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema((short)212, "DisableIme", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetDisableIme), new SetValueHandler(TextSchema.SetDisableIme), false); - UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema((short)212, "HighlightColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetHighlightColor), new SetValueHandler(TextSchema.SetHighlightColor), false); - UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema((short)212, "TextHighlightColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetTextHighlightColor), new SetValueHandler(TextSchema.SetTextHighlightColor), false); - UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema((short)212, "UsePasswordMask", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetUsePasswordMask), new SetValueHandler(TextSchema.SetUsePasswordMask), false); - UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema((short)212, "PasswordMask", (short)27, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextSchema.GetPasswordMask), new SetValueHandler(TextSchema.SetPasswordMask), false); - TextSchema.Type.Initialize(new DefaultConstructHandler(TextSchema.Construct), (ConstructorSchema[])null, new PropertySchema[24] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(212, "Content", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetContent), new SetValueHandler(TextSchema.SetContent), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(212, "Font", 93, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetFont), new SetValueHandler(TextSchema.SetFont), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(212, "Color", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetColor), new SetValueHandler(TextSchema.SetColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(212, "WordWrap", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetWordWrap), new SetValueHandler(TextSchema.SetWordWrap), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(212, "MaximumLines", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(TextSchema.GetMaximumLines), new SetValueHandler(TextSchema.SetMaximumLines), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(212, "LineAlignment", 137, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetLineAlignment), new SetValueHandler(TextSchema.SetLineAlignment), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(212, "LineSpacing", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetLineSpacing), new SetValueHandler(TextSchema.SetLineSpacing), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(212, "CharacterSpacing", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetCharacterSpacing), new SetValueHandler(TextSchema.SetCharacterSpacing), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(212, "EnableKerning", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetEnableKerning), new SetValueHandler(TextSchema.SetEnableKerning), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(212, "LastLineBounds", 169, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(TextSchema.GetLastLineBounds), null, false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(212, "FadeSize", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetFadeSize), new SetValueHandler(TextSchema.SetFadeSize), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(212, "Style", 220, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetStyle), new SetValueHandler(TextSchema.SetStyle), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(212, "NamedStyles", 58, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetNamedStyles), new SetValueHandler(TextSchema.SetNamedStyles), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(212, "Fragments", 138, 215, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(TextSchema.GetFragments), null, false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(212, "TextSharpness", 219, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetTextSharpness), new SetValueHandler(TextSchema.SetTextSharpness), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(212, "Clipped", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetClipped), null, false); + UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema(212, "ContributesToWidth", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetContributesToWidth), new SetValueHandler(TextSchema.SetContributesToWidth), false); + UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema(212, "BoundsType", 213, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetBoundsType), new SetValueHandler(TextSchema.SetBoundsType), false); + UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema(212, "Effect", 78, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetEffect), new SetValueHandler(TextSchema.SetEffect), false); + UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema(212, "DisableIme", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetDisableIme), new SetValueHandler(TextSchema.SetDisableIme), false); + UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema(212, "HighlightColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetHighlightColor), new SetValueHandler(TextSchema.SetHighlightColor), false); + UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema(212, "TextHighlightColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetTextHighlightColor), new SetValueHandler(TextSchema.SetTextHighlightColor), false); + UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema(212, "UsePasswordMask", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetUsePasswordMask), new SetValueHandler(TextSchema.SetUsePasswordMask), false); + UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema(212, "PasswordMask", 27, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextSchema.GetPasswordMask), new SetValueHandler(TextSchema.SetPasswordMask), false); + TextSchema.Type.Initialize(new DefaultConstructHandler(TextSchema.Construct), null, new PropertySchema[24] { - (PropertySchema) uixPropertySchema18, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema16, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema17, - (PropertySchema) uixPropertySchema20, - (PropertySchema) uixPropertySchema19, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema14, - (PropertySchema) uixPropertySchema21, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema13, - (PropertySchema) uixPropertySchema24, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema22, - (PropertySchema) uixPropertySchema15, - (PropertySchema) uixPropertySchema23, - (PropertySchema) uixPropertySchema4 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema18, + uixPropertySchema8, + uixPropertySchema16, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema17, + uixPropertySchema20, + uixPropertySchema19, + uixPropertySchema9, + uixPropertySchema11, + uixPropertySchema2, + uixPropertySchema14, + uixPropertySchema21, + uixPropertySchema10, + uixPropertySchema6, + uixPropertySchema7, + uixPropertySchema5, + uixPropertySchema13, + uixPropertySchema24, + uixPropertySchema12, + uixPropertySchema22, + uixPropertySchema15, + uixPropertySchema23, + uixPropertySchema4 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TextScrollModelSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TextScrollModelSchema.cs index 5c68e59..0445d30 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TextScrollModelSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TextScrollModelSchema.cs @@ -12,10 +12,10 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object Construct() => (object)new TextScrollModel(); + private static object Construct() => new TextScrollModel(); - public static void Pass1Initialize() => TextScrollModelSchema.Type = new UIXTypeSchema((short)218, "TextScrollModel", (string)null, (short)183, typeof(TextScrollModel), UIXTypeFlags.None); + public static void Pass1Initialize() => TextScrollModelSchema.Type = new UIXTypeSchema(218, "TextScrollModel", null, 183, typeof(TextScrollModel), UIXTypeFlags.None); - public static void Pass2Initialize() => TextScrollModelSchema.Type.Initialize(new DefaultConstructHandler(TextScrollModelSchema.Construct), (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => TextScrollModelSchema.Type.Initialize(new DefaultConstructHandler(TextScrollModelSchema.Construct), null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TextStyleSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TextStyleSchema.cs index e811b7b..fd152a1 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TextStyleSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TextStyleSchema.cs @@ -15,7 +15,7 @@ namespace Microsoft.Iris.Markup.UIX public static RangeValidator ValidateFontFace = new RangeValidator(TextStyleSchema.RangeValidateFontFace); public static UIXTypeSchema Type; - private static object GetFontFace(object instanceObj) => (object)((TextStyle)instanceObj).FontFace; + private static object GetFontFace(object instanceObj) => ((TextStyle)instanceObj).FontFace; private static void SetFontFace(ref object instanceObj, object valueObj) { @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Markup.UIX textStyle.FontFace = str; } - private static object GetFontSize(object instanceObj) => (object)((TextStyle)instanceObj).FontSize; + private static object GetFontSize(object instanceObj) => ((TextStyle)instanceObj).FontSize; private static void SetFontSize(ref object instanceObj, object valueObj) { @@ -53,11 +53,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetUnderline(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).Underline = (bool)valueObj; - private static object GetColor(object instanceObj) => (object)((TextStyle)instanceObj).Color; + private static object GetColor(object instanceObj) => ((TextStyle)instanceObj).Color; private static void SetColor(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).Color = (Color)valueObj; - private static object GetLineSpacing(object instanceObj) => (object)((TextStyle)instanceObj).LineSpacing; + private static object GetLineSpacing(object instanceObj) => ((TextStyle)instanceObj).LineSpacing; private static void SetLineSpacing(ref object instanceObj, object valueObj) { @@ -74,7 +74,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetEnableKerning(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).EnableKerning = (bool)valueObj; - private static object GetCharacterSpacing(object instanceObj) => (object)((TextStyle)instanceObj).CharacterSpacing; + private static object GetCharacterSpacing(object instanceObj) => ((TextStyle)instanceObj).CharacterSpacing; private static void SetCharacterSpacing(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).CharacterSpacing = (float)valueObj; @@ -82,41 +82,41 @@ namespace Microsoft.Iris.Markup.UIX private static void SetFragment(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).Fragment = (bool)valueObj; - private static object Construct() => (object)new TextStyle(); + private static object Construct() => new TextStyle(); private static Result RangeValidateFontFace(object value) { string str = (string)value; - return str.Length > 31 ? Result.Fail("\"{0}\" cannot be longer than {1} characters", (object)str, (object)"31") : Result.Success; + return str.Length > 31 ? Result.Fail("\"{0}\" cannot be longer than {1} characters", str, "31") : Result.Success; } - public static void Pass1Initialize() => TextStyleSchema.Type = new UIXTypeSchema((short)220, "TextStyle", (string)null, (short)153, typeof(TextStyle), UIXTypeFlags.None); + public static void Pass1Initialize() => TextStyleSchema.Type = new UIXTypeSchema(220, "TextStyle", null, 153, typeof(TextStyle), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)220, "FontFace", (short)208, (short)-1, ExpressionRestriction.None, false, TextStyleSchema.ValidateFontFace, true, new GetValueHandler(TextStyleSchema.GetFontFace), new SetValueHandler(TextStyleSchema.SetFontFace), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)220, "FontSize", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(TextStyleSchema.GetFontSize), new SetValueHandler(TextStyleSchema.SetFontSize), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)220, "Bold", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextStyleSchema.GetBold), new SetValueHandler(TextStyleSchema.SetBold), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)220, "Italic", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextStyleSchema.GetItalic), new SetValueHandler(TextStyleSchema.SetItalic), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)220, "Underline", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextStyleSchema.GetUnderline), new SetValueHandler(TextStyleSchema.SetUnderline), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)220, "Color", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextStyleSchema.GetColor), new SetValueHandler(TextStyleSchema.SetColor), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)220, "LineSpacing", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(TextStyleSchema.GetLineSpacing), new SetValueHandler(TextStyleSchema.SetLineSpacing), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)220, "EnableKerning", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextStyleSchema.GetEnableKerning), new SetValueHandler(TextStyleSchema.SetEnableKerning), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)220, "CharacterSpacing", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextStyleSchema.GetCharacterSpacing), new SetValueHandler(TextStyleSchema.SetCharacterSpacing), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)220, "Fragment", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TextStyleSchema.GetFragment), new SetValueHandler(TextStyleSchema.SetFragment), false); - TextStyleSchema.Type.Initialize(new DefaultConstructHandler(TextStyleSchema.Construct), (ConstructorSchema[])null, new PropertySchema[10] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(220, "FontFace", 208, -1, ExpressionRestriction.None, false, TextStyleSchema.ValidateFontFace, true, new GetValueHandler(TextStyleSchema.GetFontFace), new SetValueHandler(TextStyleSchema.SetFontFace), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(220, "FontSize", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(TextStyleSchema.GetFontSize), new SetValueHandler(TextStyleSchema.SetFontSize), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(220, "Bold", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextStyleSchema.GetBold), new SetValueHandler(TextStyleSchema.SetBold), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(220, "Italic", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextStyleSchema.GetItalic), new SetValueHandler(TextStyleSchema.SetItalic), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(220, "Underline", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextStyleSchema.GetUnderline), new SetValueHandler(TextStyleSchema.SetUnderline), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(220, "Color", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextStyleSchema.GetColor), new SetValueHandler(TextStyleSchema.SetColor), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(220, "LineSpacing", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(TextStyleSchema.GetLineSpacing), new SetValueHandler(TextStyleSchema.SetLineSpacing), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(220, "EnableKerning", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextStyleSchema.GetEnableKerning), new SetValueHandler(TextStyleSchema.SetEnableKerning), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(220, "CharacterSpacing", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextStyleSchema.GetCharacterSpacing), new SetValueHandler(TextStyleSchema.SetCharacterSpacing), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(220, "Fragment", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TextStyleSchema.GetFragment), new SetValueHandler(TextStyleSchema.SetFragment), false); + TextStyleSchema.Type.Initialize(new DefaultConstructHandler(TextStyleSchema.Construct), null, new PropertySchema[10] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema5 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema3, + uixPropertySchema9, + uixPropertySchema6, + uixPropertySchema8, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema10, + uixPropertySchema4, + uixPropertySchema7, + uixPropertySchema5 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TimerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TimerSchema.cs index 7f81332..4fcd3ed 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TimerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TimerSchema.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetInterval(object instanceObj) => (object)((UITimer)instanceObj).Interval; + private static object GetInterval(object instanceObj) => ((UITimer)instanceObj).Interval; private static void SetInterval(ref object instanceObj, object valueObj) { @@ -35,40 +35,40 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAutoRepeat(ref object instanceObj, object valueObj) => ((UITimer)instanceObj).AutoRepeat = (bool)valueObj; - private static object Construct() => (object)new UITimer(); + private static object Construct() => new UITimer(); private static object CallStart(object instanceObj, object[] parameters) { ((UITimer)instanceObj).Start(); - return (object)null; + return null; } private static object CallStop(object instanceObj, object[] parameters) { ((UITimer)instanceObj).Stop(); - return (object)null; + return null; } - public static void Pass1Initialize() => TimerSchema.Type = new UIXTypeSchema((short)221, "Timer", (string)null, (short)153, typeof(UITimer), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => TimerSchema.Type = new UIXTypeSchema(221, "Timer", null, 153, typeof(UITimer), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)221, "Interval", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(TimerSchema.GetInterval), new SetValueHandler(TimerSchema.SetInterval), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)221, "Enabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TimerSchema.GetEnabled), new SetValueHandler(TimerSchema.SetEnabled), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)221, "AutoRepeat", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TimerSchema.GetAutoRepeat), new SetValueHandler(TimerSchema.SetAutoRepeat), false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)221, "Tick"); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)221, "Start", (short[])null, (short)240, new InvokeHandler(TimerSchema.CallStart), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)221, "Stop", (short[])null, (short)240, new InvokeHandler(TimerSchema.CallStop), false); - TimerSchema.Type.Initialize(new DefaultConstructHandler(TimerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(221, "Interval", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(TimerSchema.GetInterval), new SetValueHandler(TimerSchema.SetInterval), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(221, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TimerSchema.GetEnabled), new SetValueHandler(TimerSchema.SetEnabled), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(221, "AutoRepeat", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TimerSchema.GetAutoRepeat), new SetValueHandler(TimerSchema.SetAutoRepeat), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(221, "Tick"); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(221, "Start", null, 240, new InvokeHandler(TimerSchema.CallStart), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(221, "Stop", null, 240, new InvokeHandler(TimerSchema.CallStop), false); + TimerSchema.Type.Initialize(new DefaultConstructHandler(TimerSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, new EventSchema[1] { (EventSchema)uixEventSchema }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2 + }, new EventSchema[1] { uixEventSchema }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TransformAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TransformAnimationSchema.cs index 17be66f..6ae1966 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TransformAnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TransformAnimationSchema.cs @@ -12,49 +12,49 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetDelay(object instanceObj) => (object)((TransformAnimation)instanceObj).Delay; + private static object GetDelay(object instanceObj) => ((TransformAnimation)instanceObj).Delay; private static void SetDelay(ref object instanceObj, object valueObj) => ((TransformAnimation)instanceObj).Delay = (float)valueObj; - private static object GetFilter(object instanceObj) => (object)((TransformAnimation)instanceObj).Filter; + private static object GetFilter(object instanceObj) => ((TransformAnimation)instanceObj).Filter; private static void SetFilter(ref object instanceObj, object valueObj) => ((TransformAnimation)instanceObj).Filter = (KeyframeFilter)valueObj; - private static object GetMagnitude(object instanceObj) => (object)((TransformAnimation)instanceObj).Magnitude; + private static object GetMagnitude(object instanceObj) => ((TransformAnimation)instanceObj).Magnitude; private static void SetMagnitude(ref object instanceObj, object valueObj) => ((TransformAnimation)instanceObj).Magnitude = (float)valueObj; - private static object GetTimeScale(object instanceObj) => (object)((TransformAnimation)instanceObj).TimeScale; + private static object GetTimeScale(object instanceObj) => ((TransformAnimation)instanceObj).TimeScale; private static void SetTimeScale(ref object instanceObj, object valueObj) => ((TransformAnimation)instanceObj).TimeScale = (float)valueObj; - private static object GetSource(object instanceObj) => (object)((ReferenceAnimation)instanceObj).Source; + private static object GetSource(object instanceObj) => ((ReferenceAnimation)instanceObj).Source; private static void SetSource(ref object instanceObj, object valueObj) => ((ReferenceAnimation)instanceObj).Source = (IAnimationProvider)valueObj; - private static object GetType(object instanceObj) => (object)((ReferenceAnimation)instanceObj).Type; + private static object GetType(object instanceObj) => ((ReferenceAnimation)instanceObj).Type; - private static object Construct() => (object)new TransformAnimation(); + private static object Construct() => new TransformAnimation(); - public static void Pass1Initialize() => TransformAnimationSchema.Type = new UIXTypeSchema((short)222, "TransformAnimation", (string)null, (short)104, typeof(TransformAnimation), UIXTypeFlags.None); + public static void Pass1Initialize() => TransformAnimationSchema.Type = new UIXTypeSchema(222, "TransformAnimation", null, 104, typeof(TransformAnimation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)222, "Delay", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformAnimationSchema.GetDelay), new SetValueHandler(TransformAnimationSchema.SetDelay), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)222, "Filter", (short)131, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformAnimationSchema.GetFilter), new SetValueHandler(TransformAnimationSchema.SetFilter), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)222, "Magnitude", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformAnimationSchema.GetMagnitude), new SetValueHandler(TransformAnimationSchema.SetMagnitude), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)222, "TimeScale", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformAnimationSchema.GetTimeScale), new SetValueHandler(TransformAnimationSchema.SetTimeScale), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)222, "Source", (short)104, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformAnimationSchema.GetSource), new SetValueHandler(TransformAnimationSchema.SetSource), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)222, "Type", (short)10, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformAnimationSchema.GetType), (SetValueHandler)null, false); - TransformAnimationSchema.Type.Initialize(new DefaultConstructHandler(TransformAnimationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(222, "Delay", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformAnimationSchema.GetDelay), new SetValueHandler(TransformAnimationSchema.SetDelay), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(222, "Filter", 131, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformAnimationSchema.GetFilter), new SetValueHandler(TransformAnimationSchema.SetFilter), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(222, "Magnitude", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformAnimationSchema.GetMagnitude), new SetValueHandler(TransformAnimationSchema.SetMagnitude), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(222, "TimeScale", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformAnimationSchema.GetTimeScale), new SetValueHandler(TransformAnimationSchema.SetTimeScale), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(222, "Source", 104, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformAnimationSchema.GetSource), new SetValueHandler(TransformAnimationSchema.SetSource), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(222, "Type", 10, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformAnimationSchema.GetType), null, false); + TransformAnimationSchema.Type.Initialize(new DefaultConstructHandler(TransformAnimationSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema6 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema6 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TransformByAttributeAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TransformByAttributeAnimationSchema.cs index f532787..eab6299 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TransformByAttributeAnimationSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TransformByAttributeAnimationSchema.cs @@ -12,51 +12,51 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetAttribute(object instanceObj) => (object)((TransformByAttributeAnimation)instanceObj).Attribute; + private static object GetAttribute(object instanceObj) => ((TransformByAttributeAnimation)instanceObj).Attribute; private static void SetAttribute(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).Attribute = (TransformAttribute)valueObj; - private static object GetMaxTimeScale(object instanceObj) => (object)((TransformByAttributeAnimation)instanceObj).MaxTimeScale; + private static object GetMaxTimeScale(object instanceObj) => ((TransformByAttributeAnimation)instanceObj).MaxTimeScale; private static void SetMaxTimeScale(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).MaxTimeScale = (float)valueObj; - private static object GetMaxDelay(object instanceObj) => (object)((TransformByAttributeAnimation)instanceObj).MaxDelay; + private static object GetMaxDelay(object instanceObj) => ((TransformByAttributeAnimation)instanceObj).MaxDelay; private static void SetMaxDelay(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).MaxDelay = (float)valueObj; - private static object GetMaxMagnitude(object instanceObj) => (object)((TransformByAttributeAnimation)instanceObj).MaxMagnitude; + private static object GetMaxMagnitude(object instanceObj) => ((TransformByAttributeAnimation)instanceObj).MaxMagnitude; private static void SetMaxMagnitude(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).MaxMagnitude = (float)valueObj; - private static object GetOverride(object instanceObj) => (object)((TransformByAttributeAnimation)instanceObj).Override; + private static object GetOverride(object instanceObj) => ((TransformByAttributeAnimation)instanceObj).Override; private static void SetOverride(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).Override = (float)valueObj; - private static object GetValueTransformer(object instanceObj) => (object)((TransformByAttributeAnimation)instanceObj).ValueTransformer; + private static object GetValueTransformer(object instanceObj) => ((TransformByAttributeAnimation)instanceObj).ValueTransformer; private static void SetValueTransformer(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).ValueTransformer = (ValueTransformer)valueObj; - private static object Construct() => (object)new TransformByAttributeAnimation(); + private static object Construct() => new TransformByAttributeAnimation(); - public static void Pass1Initialize() => TransformByAttributeAnimationSchema.Type = new UIXTypeSchema((short)224, "TransformByAttributeAnimation", (string)null, (short)222, typeof(TransformByAttributeAnimation), UIXTypeFlags.None); + public static void Pass1Initialize() => TransformByAttributeAnimationSchema.Type = new UIXTypeSchema(224, "TransformByAttributeAnimation", null, 222, typeof(TransformByAttributeAnimation), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)224, "Attribute", (short)223, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetAttribute), new SetValueHandler(TransformByAttributeAnimationSchema.SetAttribute), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)224, "MaxTimeScale", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetMaxTimeScale), new SetValueHandler(TransformByAttributeAnimationSchema.SetMaxTimeScale), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)224, "MaxDelay", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetMaxDelay), new SetValueHandler(TransformByAttributeAnimationSchema.SetMaxDelay), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)224, "MaxMagnitude", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetMaxMagnitude), new SetValueHandler(TransformByAttributeAnimationSchema.SetMaxMagnitude), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)224, "Override", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetOverride), new SetValueHandler(TransformByAttributeAnimationSchema.SetOverride), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)224, "ValueTransformer", (short)232, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetValueTransformer), new SetValueHandler(TransformByAttributeAnimationSchema.SetValueTransformer), false); - TransformByAttributeAnimationSchema.Type.Initialize(new DefaultConstructHandler(TransformByAttributeAnimationSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(224, "Attribute", 223, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetAttribute), new SetValueHandler(TransformByAttributeAnimationSchema.SetAttribute), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(224, "MaxTimeScale", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetMaxTimeScale), new SetValueHandler(TransformByAttributeAnimationSchema.SetMaxTimeScale), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(224, "MaxDelay", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetMaxDelay), new SetValueHandler(TransformByAttributeAnimationSchema.SetMaxDelay), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(224, "MaxMagnitude", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetMaxMagnitude), new SetValueHandler(TransformByAttributeAnimationSchema.SetMaxMagnitude), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(224, "Override", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetOverride), new SetValueHandler(TransformByAttributeAnimationSchema.SetOverride), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(224, "ValueTransformer", 232, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TransformByAttributeAnimationSchema.GetValueTransformer), new SetValueHandler(TransformByAttributeAnimationSchema.SetValueTransformer), false); + TransformByAttributeAnimationSchema.Type.Initialize(new DefaultConstructHandler(TransformByAttributeAnimationSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema6 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema2, + uixPropertySchema5, + uixPropertySchema6 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TypeConstraintSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TypeConstraintSchema.cs index 0007507..e17583d 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TypeConstraintSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TypeConstraintSchema.cs @@ -10,27 +10,27 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetType(object instanceObj) => (object)((TypeConstraint)instanceObj).Type; + private static object GetType(object instanceObj) => ((TypeConstraint)instanceObj).Type; private static void SetType(ref object instanceObj, object valueObj) => ((TypeConstraint)instanceObj).Type = (TypeSchema)valueObj; - private static object GetConstraint(object instanceObj) => (object)((TypeConstraint)instanceObj).Constraint; + private static object GetConstraint(object instanceObj) => ((TypeConstraint)instanceObj).Constraint; private static void SetConstraint(ref object instanceObj, object valueObj) => ((TypeConstraint)instanceObj).Constraint = (TypeSchema)valueObj; - private static object Construct() => (object)new TypeConstraint(); + private static object Construct() => new TypeConstraint(); - public static void Pass1Initialize() => TypeConstraintSchema.Type = new UIXTypeSchema((short)226, "TypeConstraint", (string)null, (short)153, typeof(TypeConstraint), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => TypeConstraintSchema.Type = new UIXTypeSchema(226, "TypeConstraint", null, 153, typeof(TypeConstraint), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)226, "Type", (short)225, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TypeConstraintSchema.GetType), new SetValueHandler(TypeConstraintSchema.SetType), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)226, "Constraint", (short)225, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(TypeConstraintSchema.GetConstraint), new SetValueHandler(TypeConstraintSchema.SetConstraint), false); - TypeConstraintSchema.Type.Initialize(new DefaultConstructHandler(TypeConstraintSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(226, "Type", 225, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TypeConstraintSchema.GetType), new SetValueHandler(TypeConstraintSchema.SetType), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(226, "Constraint", 225, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(TypeConstraintSchema.GetConstraint), new SetValueHandler(TypeConstraintSchema.SetConstraint), false); + TypeConstraintSchema.Type.Initialize(new DefaultConstructHandler(TypeConstraintSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TypeSchemaDefinition.cs b/UIX/Microsoft/Iris/Markup/UIX/TypeSchemaDefinition.cs index f5a217c..09800ac 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TypeSchemaDefinition.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TypeSchemaDefinition.cs @@ -10,8 +10,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => TypeSchemaDefinition.Type = new UIXTypeSchema((short)225, "Type", (string)null, (short)153, typeof(TypeSchema), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => TypeSchemaDefinition.Type = new UIXTypeSchema(225, "Type", null, 153, typeof(TypeSchema), UIXTypeFlags.Immutable); - public static void Pass2Initialize() => TypeSchemaDefinition.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => TypeSchemaDefinition.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TypeSelectorSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TypeSelectorSchema.cs index 374f18f..0e2ef7b 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TypeSelectorSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TypeSelectorSchema.cs @@ -12,27 +12,27 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetType(object instanceObj) => (object)((TypeSelector)instanceObj).Type; + private static object GetType(object instanceObj) => ((TypeSelector)instanceObj).Type; private static void SetType(ref object instanceObj, object valueObj) => ((TypeSelector)instanceObj).Type = (TypeSchema)valueObj; - private static object GetContentName(object instanceObj) => (object)((TypeSelector)instanceObj).ContentName; + private static object GetContentName(object instanceObj) => ((TypeSelector)instanceObj).ContentName; private static void SetContentName(ref object instanceObj, object valueObj) => ((TypeSelector)instanceObj).ContentName = (string)valueObj; - private static object Construct() => (object)new TypeSelector(); + private static object Construct() => new TypeSelector(); - public static void Pass1Initialize() => TypeSelectorSchema.Type = new UIXTypeSchema((short)227, "TypeSelector", (string)null, (short)153, typeof(TypeSelector), UIXTypeFlags.None); + public static void Pass1Initialize() => TypeSelectorSchema.Type = new UIXTypeSchema(227, "TypeSelector", null, 153, typeof(TypeSelector), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)227, "Type", (short)225, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TypeSelectorSchema.GetType), new SetValueHandler(TypeSelectorSchema.SetType), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)227, "ContentName", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TypeSelectorSchema.GetContentName), new SetValueHandler(TypeSelectorSchema.SetContentName), false); - TypeSelectorSchema.Type.Initialize(new DefaultConstructHandler(TypeSelectorSchema.Construct), (ConstructorSchema[])null, new PropertySchema[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(227, "Type", 225, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TypeSelectorSchema.GetType), new SetValueHandler(TypeSelectorSchema.SetType), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(227, "ContentName", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TypeSelectorSchema.GetContentName), new SetValueHandler(TypeSelectorSchema.SetContentName), false); + TypeSelectorSchema.Type.Initialize(new DefaultConstructHandler(TypeSelectorSchema.Construct), null, new PropertySchema[2] { - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/TypingHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/TypingHandlerSchema.cs index 57e2d0d..fc95d56 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/TypingHandlerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/TypingHandlerSchema.cs @@ -14,11 +14,11 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetEditableTextData(object instanceObj) => (object)((TypingHandler)instanceObj).EditableTextData; + private static object GetEditableTextData(object instanceObj) => ((TypingHandler)instanceObj).EditableTextData; private static void SetEditableTextData(ref object instanceObj, object valueObj) => ((TypingHandler)instanceObj).EditableTextData = (EditableTextData)valueObj; - private static object GetHandlerStage(object instanceObj) => (object)((InputHandler)instanceObj).HandlerStage; + private static object GetHandlerStage(object instanceObj) => ((InputHandler)instanceObj).HandlerStage; private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; @@ -30,27 +30,27 @@ namespace Microsoft.Iris.Markup.UIX private static void SetTreatEscapeAsBackspace(ref object instanceObj, object valueObj) => ((TypingHandler)instanceObj).TreatEscapeAsBackspace = (bool)valueObj; - private static object Construct() => (object)new TypingHandler(); + private static object Construct() => new TypingHandler(); - public static void Pass1Initialize() => TypingHandlerSchema.Type = new UIXTypeSchema((short)228, "TypingHandler", (string)null, (short)110, typeof(TypingHandler), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => TypingHandlerSchema.Type = new UIXTypeSchema(228, "TypingHandler", null, 110, typeof(TypingHandler), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)228, "EditableTextData", (short)68, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TypingHandlerSchema.GetEditableTextData), new SetValueHandler(TypingHandlerSchema.SetEditableTextData), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)228, "HandlerStage", (short)112, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TypingHandlerSchema.GetHandlerStage), new SetValueHandler(TypingHandlerSchema.SetHandlerStage), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)228, "SubmitOnEnter", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TypingHandlerSchema.GetSubmitOnEnter), new SetValueHandler(TypingHandlerSchema.SetSubmitOnEnter), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)228, "TreatEscapeAsBackspace", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(TypingHandlerSchema.GetTreatEscapeAsBackspace), new SetValueHandler(TypingHandlerSchema.SetTreatEscapeAsBackspace), false); - UIXEventSchema uixEventSchema = new UIXEventSchema((short)228, "TypingInputRejected"); - TypingHandlerSchema.Type.Initialize(new DefaultConstructHandler(TypingHandlerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[4] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(228, "EditableTextData", 68, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TypingHandlerSchema.GetEditableTextData), new SetValueHandler(TypingHandlerSchema.SetEditableTextData), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(228, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TypingHandlerSchema.GetHandlerStage), new SetValueHandler(TypingHandlerSchema.SetHandlerStage), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(228, "SubmitOnEnter", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TypingHandlerSchema.GetSubmitOnEnter), new SetValueHandler(TypingHandlerSchema.SetSubmitOnEnter), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(228, "TreatEscapeAsBackspace", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(TypingHandlerSchema.GetTreatEscapeAsBackspace), new SetValueHandler(TypingHandlerSchema.SetTreatEscapeAsBackspace), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(228, "TypingInputRejected"); + TypingHandlerSchema.Type.Initialize(new DefaultConstructHandler(TypingHandlerSchema.Construct), null, new PropertySchema[4] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4 - }, (MethodSchema[])null, new EventSchema[1] + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4 + }, null, new EventSchema[1] { - (EventSchema) uixEventSchema - }, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixEventSchema + }, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/UISchema.cs b/UIX/Microsoft/Iris/Markup/UIX/UISchema.cs index 74b5012..ee4e5d0 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/UISchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/UISchema.cs @@ -12,13 +12,13 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetProperties(object instanceObj) => (object)((UIClass)instanceObj).Storage; + private static object GetProperties(object instanceObj) => ((UIClass)instanceObj).Storage; - private static object GetLocals(object instanceObj) => (object)((UIClass)instanceObj).Storage; + private static object GetLocals(object instanceObj) => ((UIClass)instanceObj).Storage; - private static object GetInput(object instanceObj) => (object)((UIClass)instanceObj).EnsureInputHandlerStorage(); + private static object GetInput(object instanceObj) => ((UIClass)instanceObj).EnsureInputHandlerStorage(); - private static object GetContent(object instanceObj) => (object)((UIClass)instanceObj).RootItem; + private static object GetContent(object instanceObj) => ((UIClass)instanceObj).RootItem; private static void SetContent(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).SetRootItem((ViewItem)valueObj); @@ -33,27 +33,27 @@ namespace Microsoft.Iris.Markup.UIX private static object GetScripts(object instanceObj) => (object)null; - public static void Pass1Initialize() => UISchema.Type = new UIXTypeSchema((short)229, "UI", (string)null, (short)-1, typeof(UIClass), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => UISchema.Type = new UIXTypeSchema(229, "UI", null, -1, typeof(UIClass), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)229, "Properties", (short)58, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(UISchema.GetProperties), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)229, "Locals", (short)58, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(UISchema.GetLocals), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)229, "Input", (short)138, (short)110, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(UISchema.GetInput), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)229, "Content", (short)239, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(UISchema.GetContent), new SetValueHandler(UISchema.SetContent), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)229, "Flippable", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UISchema.GetFlippable), new SetValueHandler(UISchema.SetFlippable), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)229, "Base", (short)208, (short)-1, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(UISchema.SetBase), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)229, "Scripts", (short)138, (short)240, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(UISchema.GetScripts), (SetValueHandler)null, false); - UISchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[7] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(229, "Properties", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(UISchema.GetProperties), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(229, "Locals", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(UISchema.GetLocals), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(229, "Input", 138, 110, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(UISchema.GetInput), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(229, "Content", 239, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(UISchema.GetContent), new SetValueHandler(UISchema.SetContent), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(229, "Flippable", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UISchema.GetFlippable), new SetValueHandler(UISchema.SetFlippable), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(229, "Base", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(UISchema.SetBase), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(229, "Scripts", 138, 240, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(UISchema.GetScripts), null, false); + UISchema.Type.Initialize(null, null, new PropertySchema[7] { - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema7 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema6, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema7 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/UIStateSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/UIStateSchema.cs index 492ea88..0e0565a 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/UIStateSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/UIStateSchema.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetCreateInterestOnFocus(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).CreateInterestOnFocus = (bool)valueObj; - private static object GetCursor(object instanceObj) => (object)((UIClass)instanceObj).Cursor; + private static object GetCursor(object instanceObj) => ((UIClass)instanceObj).Cursor; private static void SetCursor(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).Cursor = (CursorID)valueObj; @@ -28,11 +28,11 @@ namespace Microsoft.Iris.Markup.UIX private static object GetDirectMouseFocus(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).DirectMouseFocus); - private static object GetFocusInterestTarget(object instanceObj) => (object)((UIClass)instanceObj).FocusInterestTarget; + private static object GetFocusInterestTarget(object instanceObj) => ((UIClass)instanceObj).FocusInterestTarget; private static void SetFocusInterestTarget(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).FocusInterestTarget = (ViewItem)valueObj; - private static object GetFocusInterestTargetMargins(object instanceObj) => (object)((UIClass)instanceObj).FocusInterestTargetMargins; + private static object GetFocusInterestTargetMargins(object instanceObj) => ((UIClass)instanceObj).FocusInterestTargetMargins; private static void SetFocusInterestTargetMargins(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).FocusInterestTargetMargins = (Inset)valueObj; @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Markup.UIX private static object GetMouseFocus(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).MouseFocus); - private static object GetMouseInteractive(object instanceObj) => (object)((UIClass)instanceObj).MouseInteractive; + private static object GetMouseInteractive(object instanceObj) => ((UIClass)instanceObj).MouseInteractive; private static void SetMouseInteractive(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).SetMouseInteractive((bool)valueObj, true); @@ -66,7 +66,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAllowDoubleClicks(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).AllowDoubleClicks = (bool)valueObj; - private static object GetPaintOrder(object instanceObj) => (object)(int)((UIClass)instanceObj).PaintOrder; + private static object GetPaintOrder(object instanceObj) => (int)((UIClass)instanceObj).PaintOrder; private static void SetPaintOrder(ref object instanceObj, object valueObj) { @@ -84,86 +84,86 @@ namespace Microsoft.Iris.Markup.UIX UIClass uiClass = (UIClass)instanceObj; object parameter = parameters[0]; if (parameter == null) - return (object)null; + return null; if (!(parameter is IDisposableObject disposable)) { - ErrorManager.ReportError("Attempt to dispose an object '{0}' that isn't disposable", (object)TypeSchema.NameFromInstance(parameter)); - return (object)null; + ErrorManager.ReportError("Attempt to dispose an object '{0}' that isn't disposable", TypeSchema.NameFromInstance(parameter)); + return null; } if (!uiClass.UnregisterDisposable(ref disposable)) { - ErrorManager.ReportError("Attempt to dispose an object '{0}' that '{1}' doesn't own", (object)TypeSchema.NameFromInstance((object)disposable), (object)uiClass.TypeSchema.Name); - return (object)null; + ErrorManager.ReportError("Attempt to dispose an object '{0}' that '{1}' doesn't own", TypeSchema.NameFromInstance(disposable), uiClass.TypeSchema.Name); + return null; } - disposable.Dispose((object)uiClass); - return (object)null; + disposable.Dispose(uiClass); + return null; } private static object CallNavigateInto(object instanceObj, object[] parameters) { ((UIClass)instanceObj).NavigateInto(); - return (object)null; + return null; } private static object CallNavigateIntoBoolean(object instanceObj, object[] parameters) { ((UIClass)instanceObj).NavigateInto((bool)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => UIStateSchema.Type = new UIXTypeSchema((short)230, "UIState", (string)null, (short)-1, typeof(UIClass), UIXTypeFlags.None); + public static void Pass1Initialize() => UIStateSchema.Type = new UIXTypeSchema(230, "UIState", null, -1, typeof(UIClass), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)230, "CreateInterestOnFocus", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetCreateInterestOnFocus), new SetValueHandler(UIStateSchema.SetCreateInterestOnFocus), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)230, "Cursor", (short)44, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetCursor), new SetValueHandler(UIStateSchema.SetCursor), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)230, "DirectKeyFocus", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetDirectKeyFocus), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)230, "DirectMouseFocus", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetDirectMouseFocus), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)230, "FocusInterestTarget", (short)239, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetFocusInterestTarget), new SetValueHandler(UIStateSchema.SetFocusInterestTarget), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)230, "FocusInterestTargetMargins", (short)114, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetFocusInterestTargetMargins), new SetValueHandler(UIStateSchema.SetFocusInterestTargetMargins), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)230, "KeyFocus", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetKeyFocus), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)230, "KeyFocusOnMouseDown", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetKeyFocusOnMouseDown), new SetValueHandler(UIStateSchema.SetKeyFocusOnMouseDown), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)230, "KeyFocusOnMouseEnter", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetKeyFocusOnMouseEnter), new SetValueHandler(UIStateSchema.SetKeyFocusOnMouseEnter), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)230, "KeyInteractive", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetKeyInteractive), new SetValueHandler(UIStateSchema.SetKeyInteractive), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)230, "MouseFocus", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetMouseFocus), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)230, "MouseInteractive", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetMouseInteractive), new SetValueHandler(UIStateSchema.SetMouseInteractive), false); - UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema((short)230, "Enabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetEnabled), new SetValueHandler(UIStateSchema.SetEnabled), false); - UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema((short)230, "FullyEnabled", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetFullyEnabled), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema((short)230, "AllowDoubleClicks", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(UIStateSchema.GetAllowDoubleClicks), new SetValueHandler(UIStateSchema.SetAllowDoubleClicks), false); - UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema((short)230, "PaintOrder", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(UIStateSchema.GetPaintOrder), new SetValueHandler(UIStateSchema.SetPaintOrder), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)230, "DisposeOwnedObject", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(230, "CreateInterestOnFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetCreateInterestOnFocus), new SetValueHandler(UIStateSchema.SetCreateInterestOnFocus), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(230, "Cursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetCursor), new SetValueHandler(UIStateSchema.SetCursor), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(230, "DirectKeyFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetDirectKeyFocus), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(230, "DirectMouseFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetDirectMouseFocus), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(230, "FocusInterestTarget", 239, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetFocusInterestTarget), new SetValueHandler(UIStateSchema.SetFocusInterestTarget), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(230, "FocusInterestTargetMargins", 114, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetFocusInterestTargetMargins), new SetValueHandler(UIStateSchema.SetFocusInterestTargetMargins), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(230, "KeyFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetKeyFocus), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(230, "KeyFocusOnMouseDown", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetKeyFocusOnMouseDown), new SetValueHandler(UIStateSchema.SetKeyFocusOnMouseDown), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(230, "KeyFocusOnMouseEnter", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetKeyFocusOnMouseEnter), new SetValueHandler(UIStateSchema.SetKeyFocusOnMouseEnter), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(230, "KeyInteractive", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetKeyInteractive), new SetValueHandler(UIStateSchema.SetKeyInteractive), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(230, "MouseFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetMouseFocus), null, false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(230, "MouseInteractive", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetMouseInteractive), new SetValueHandler(UIStateSchema.SetMouseInteractive), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(230, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetEnabled), new SetValueHandler(UIStateSchema.SetEnabled), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(230, "FullyEnabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetFullyEnabled), null, false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(230, "AllowDoubleClicks", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(UIStateSchema.GetAllowDoubleClicks), new SetValueHandler(UIStateSchema.SetAllowDoubleClicks), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(230, "PaintOrder", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(UIStateSchema.GetPaintOrder), new SetValueHandler(UIStateSchema.SetPaintOrder), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(230, "DisposeOwnedObject", new short[1] { - (short) 153 - }, (short)240, new InvokeHandler(UIStateSchema.CallDisposeOwnedObjectObject), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)230, "NavigateInto", (short[])null, (short)240, new InvokeHandler(UIStateSchema.CallNavigateInto), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)230, "NavigateInto", new short[1] + 153 + }, 240, new InvokeHandler(UIStateSchema.CallDisposeOwnedObjectObject), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(230, "NavigateInto", null, 240, new InvokeHandler(UIStateSchema.CallNavigateInto), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(230, "NavigateInto", new short[1] { - (short) 15 - }, (short)240, new InvokeHandler(UIStateSchema.CallNavigateIntoBoolean), false); - UIStateSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[16] + 15 + }, 240, new InvokeHandler(UIStateSchema.CallNavigateIntoBoolean), false); + UIStateSchema.Type.Initialize(null, null, new PropertySchema[16] { - (PropertySchema) uixPropertySchema15, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema13, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema14, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema16 + uixPropertySchema15, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema13, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema14, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema9, + uixPropertySchema10, + uixPropertySchema11, + uixPropertySchema12, + uixPropertySchema16 }, new MethodSchema[3] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ValueRangeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ValueRangeSchema.cs index 82d18f5..9c561c3 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ValueRangeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ValueRangeSchema.cs @@ -21,34 +21,34 @@ namespace Microsoft.Iris.Markup.UIX private static object CallPreviousValue(object instanceObj, object[] parameters) { ((IUIValueRange)instanceObj).PreviousValue(); - return (object)null; + return null; } private static object CallNextValue(object instanceObj, object[] parameters) { ((IUIValueRange)instanceObj).NextValue(); - return (object)null; + return null; } - public static void Pass1Initialize() => ValueRangeSchema.Type = new UIXTypeSchema((short)231, "ValueRange", (string)null, (short)153, typeof(IUIValueRange), UIXTypeFlags.None); + public static void Pass1Initialize() => ValueRangeSchema.Type = new UIXTypeSchema(231, "ValueRange", null, 153, typeof(IUIValueRange), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)231, "ObjectValue", (short)153, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ValueRangeSchema.GetObjectValue), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)231, "HasPreviousValue", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ValueRangeSchema.GetHasPreviousValue), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)231, "HasNextValue", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ValueRangeSchema.GetHasNextValue), (SetValueHandler)null, false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)231, "PreviousValue", (short[])null, (short)240, new InvokeHandler(ValueRangeSchema.CallPreviousValue), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)231, "NextValue", (short[])null, (short)240, new InvokeHandler(ValueRangeSchema.CallNextValue), false); - ValueRangeSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(231, "ObjectValue", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ValueRangeSchema.GetObjectValue), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(231, "HasPreviousValue", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ValueRangeSchema.GetHasPreviousValue), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(231, "HasNextValue", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ValueRangeSchema.GetHasNextValue), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(231, "PreviousValue", null, 240, new InvokeHandler(ValueRangeSchema.CallPreviousValue), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(231, "NextValue", null, 240, new InvokeHandler(ValueRangeSchema.CallNextValue), false); + ValueRangeSchema.Type.Initialize(null, null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema1 + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 }, new MethodSchema[2] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ValueTransformerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ValueTransformerSchema.cs index c1e53ea..c971957 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ValueTransformerSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ValueTransformerSchema.cs @@ -14,19 +14,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetAdd(object instanceObj) => (object)((ValueTransformer)instanceObj).Add; + private static object GetAdd(object instanceObj) => ((ValueTransformer)instanceObj).Add; private static void SetAdd(ref object instanceObj, object valueObj) => ((ValueTransformer)instanceObj).Add = (float)valueObj; - private static object GetSubtract(object instanceObj) => (object)((ValueTransformer)instanceObj).Subtract; + private static object GetSubtract(object instanceObj) => ((ValueTransformer)instanceObj).Subtract; private static void SetSubtract(ref object instanceObj, object valueObj) => ((ValueTransformer)instanceObj).Subtract = (float)valueObj; - private static object GetMultiply(object instanceObj) => (object)((ValueTransformer)instanceObj).Multiply; + private static object GetMultiply(object instanceObj) => ((ValueTransformer)instanceObj).Multiply; private static void SetMultiply(ref object instanceObj, object valueObj) => ((ValueTransformer)instanceObj).Multiply = (float)valueObj; - private static object GetDivide(object instanceObj) => (object)((ValueTransformer)instanceObj).Divide; + private static object GetDivide(object instanceObj) => ((ValueTransformer)instanceObj).Divide; private static void SetDivide(ref object instanceObj, object valueObj) { @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Markup.UIX valueTransformer.Divide = num; } - private static object GetMod(object instanceObj) => (object)((ValueTransformer)instanceObj).Mod; + private static object GetMod(object instanceObj) => ((ValueTransformer)instanceObj).Mod; private static void SetMod(ref object instanceObj, object valueObj) { @@ -56,27 +56,27 @@ namespace Microsoft.Iris.Markup.UIX private static void SetAbsolute(ref object instanceObj, object valueObj) => ((ValueTransformer)instanceObj).Absolute = (bool)valueObj; - private static object Construct() => (object)new ValueTransformer(); + private static object Construct() => new ValueTransformer(); - public static void Pass1Initialize() => ValueTransformerSchema.Type = new UIXTypeSchema((short)232, "ValueTransformer", (string)null, (short)153, typeof(ValueTransformer), UIXTypeFlags.None); + public static void Pass1Initialize() => ValueTransformerSchema.Type = new UIXTypeSchema(232, "ValueTransformer", null, 153, typeof(ValueTransformer), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)232, "Add", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ValueTransformerSchema.GetAdd), new SetValueHandler(ValueTransformerSchema.SetAdd), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)232, "Subtract", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ValueTransformerSchema.GetSubtract), new SetValueHandler(ValueTransformerSchema.SetSubtract), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)232, "Multiply", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ValueTransformerSchema.GetMultiply), new SetValueHandler(ValueTransformerSchema.SetMultiply), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)232, "Divide", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotZero, false, new GetValueHandler(ValueTransformerSchema.GetDivide), new SetValueHandler(ValueTransformerSchema.SetDivide), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)232, "Mod", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.ValidateNotZero, false, new GetValueHandler(ValueTransformerSchema.GetMod), new SetValueHandler(ValueTransformerSchema.SetMod), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)232, "Absolute", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ValueTransformerSchema.GetAbsolute), new SetValueHandler(ValueTransformerSchema.SetAbsolute), false); - ValueTransformerSchema.Type.Initialize(new DefaultConstructHandler(ValueTransformerSchema.Construct), (ConstructorSchema[])null, new PropertySchema[6] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(232, "Add", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ValueTransformerSchema.GetAdd), new SetValueHandler(ValueTransformerSchema.SetAdd), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(232, "Subtract", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ValueTransformerSchema.GetSubtract), new SetValueHandler(ValueTransformerSchema.SetSubtract), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(232, "Multiply", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ValueTransformerSchema.GetMultiply), new SetValueHandler(ValueTransformerSchema.SetMultiply), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(232, "Divide", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotZero, false, new GetValueHandler(ValueTransformerSchema.GetDivide), new SetValueHandler(ValueTransformerSchema.SetDivide), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(232, "Mod", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotZero, false, new GetValueHandler(ValueTransformerSchema.GetMod), new SetValueHandler(ValueTransformerSchema.SetMod), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(232, "Absolute", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ValueTransformerSchema.GetAbsolute), new SetValueHandler(ValueTransformerSchema.SetAbsolute), false); + ValueTransformerSchema.Type.Initialize(new DefaultConstructHandler(ValueTransformerSchema.Construct), null, new PropertySchema[6] { - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema6, + uixPropertySchema1, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema3, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/Vector2Schema.cs b/UIX/Microsoft/Iris/Markup/UIX/Vector2Schema.cs index 49dde43..293995c 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/Vector2Schema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/Vector2Schema.cs @@ -17,27 +17,27 @@ namespace Microsoft.Iris.Markup.UIX public static RangeValidator ValidateNotNegative = new RangeValidator(Vector2Schema.RangeValidateNotNegative); public static UIXTypeSchema Type; - private static object GetX(object instanceObj) => (object)((Vector2)instanceObj).X; + private static object GetX(object instanceObj) => ((Vector2)instanceObj).X; private static void SetX(ref object instanceObj, object valueObj) { Vector2 vector2 = (Vector2)instanceObj; float num = (float)valueObj; vector2.X = num; - instanceObj = (object)vector2; + instanceObj = vector2; } - private static object GetY(object instanceObj) => (object)((Vector2)instanceObj).Y; + private static object GetY(object instanceObj) => ((Vector2)instanceObj).Y; private static void SetY(ref object instanceObj, object valueObj) { Vector2 vector2 = (Vector2)instanceObj; float num = (float)valueObj; vector2.Y = num; - instanceObj = (object)vector2; + instanceObj = vector2; } - private static object Construct() => (object)Vector2.Zero; + private static object Construct() => Vector2.Zero; private static object ConstructXY(object[] parameters) { @@ -51,14 +51,14 @@ namespace Microsoft.Iris.Markup.UIX { instance = Vector2Schema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], SingleSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Vector2", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Vector2", result1.Error); Vector2Schema.SetX(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Vector2", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Vector2", result2.Error); Vector2Schema.SetY(ref instance, valueObj2); return result2; } @@ -70,25 +70,25 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteSingle(vector2.Y); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new Vector2(reader.ReadSingle(), reader.ReadSingle()); + private static object DecodeBinary(ByteCodeReader reader) => new Vector2(reader.ReadSingle(), reader.ReadSingle()); private static Result ConvertFromSize(object valueObj, out object instanceObj) { Size size = (Size)valueObj; - instanceObj = (object)null; - Vector2 vector2 = new Vector2((float)size.Width, (float)size.Height); - instanceObj = (object)vector2; + instanceObj = null; + Vector2 vector2 = new Vector2(size.Width, size.Height); + instanceObj = vector2; return Result.Success; } private static Result ConvertFromString(object valueObj, out object instanceObj) { string s = (string)valueObj; - instanceObj = (object)null; + instanceObj = null; float result; - if (!float.TryParse(s, NumberStyles.Float, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result)) + if (!float.TryParse(s, NumberStyles.Float, NumberFormatInfo.InvariantInfo, out result)) return Result.Fail(""); - instanceObj = (object)new Vector2() + instanceObj = new Vector2() { X = result, Y = result @@ -99,8 +99,8 @@ namespace Microsoft.Iris.Markup.UIX private static Result ConvertFromSingle(object valueObj, out object instanceObj) { float num = (float)valueObj; - instanceObj = (object)null; - instanceObj = (object)new Vector2() + instanceObj = null; + instanceObj = new Vector2() { X = num, Y = num @@ -116,7 +116,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (SingleSchema.Type.IsAssignableFrom(fromType)) { result = Vector2Schema.ConvertFromSingle(from, out instance); @@ -145,7 +145,7 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Vector2"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Vector2"); } return result; } @@ -171,24 +171,24 @@ namespace Microsoft.Iris.Markup.UIX { Vector2 vector2_1 = (Vector2)leftObj; if (op == OperationType.MathNegate) - return (object)-vector2_1; + return -vector2_1; Vector2 vector2_2 = (Vector2)rightObj; switch (op - 1) { - case (OperationType)0: - return (object)(vector2_1 + vector2_2); + case 0: + return vector2_1 + vector2_2; case OperationType.MathAdd: - return (object)(vector2_1 - vector2_2); + return vector2_1 - vector2_2; case OperationType.MathSubtract: - return (object)(vector2_1 * vector2_2); + return vector2_1 * vector2_2; case OperationType.MathMultiply: - return (object)(vector2_1 / vector2_2); + return vector2_1 / vector2_2; case OperationType.LogicalOr: return BooleanBoxes.Box(vector2_1 == vector2_2); case OperationType.RelationalEquals: return BooleanBoxes.Box(vector2_1 != vector2_2); default: - return (object)null; + return null; } } @@ -197,42 +197,42 @@ namespace Microsoft.Iris.Markup.UIX string parameter1 = (string)parameters[0]; Vector2 parameter2 = (Vector2)parameters[1]; object instanceObj1; - return Vector2Schema.ConvertFromString((object)parameter1, out instanceObj1).Failed ? (object)parameter2 : instanceObj1; + return Vector2Schema.ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; } private static Result RangeValidateNotNegative(object value) { Vector2 vector2 = (Vector2)value; - return (double)vector2.X < 0.0 || (double)vector2.Y < 0.0 ? Result.Fail("Expecting a non-negative value, but got {0}", (object)vector2.ToString()) : Result.Success; + return vector2.X < 0.0 || vector2.Y < 0.0 ? Result.Fail("Expecting a non-negative value, but got {0}", vector2.ToString()) : Result.Success; } - public static void Pass1Initialize() => Vector2Schema.Type = new UIXTypeSchema((short)233, "Vector2", (string)null, (short)153, typeof(Vector2), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => Vector2Schema.Type = new UIXTypeSchema(233, "Vector2", null, 153, typeof(Vector2), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)233, "X", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Vector2Schema.GetX), new SetValueHandler(Vector2Schema.SetX), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)233, "Y", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Vector2Schema.GetY), new SetValueHandler(Vector2Schema.SetY), false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)233, new short[2] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(233, "X", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Vector2Schema.GetX), new SetValueHandler(Vector2Schema.SetX), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(233, "Y", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Vector2Schema.GetY), new SetValueHandler(Vector2Schema.SetY), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(233, new short[2] { - (short) 194, - (short) 194 + 194, + 194 }, new ConstructHandler(Vector2Schema.ConstructXY)); - UIXMethodSchema uixMethodSchema = new UIXMethodSchema((short)233, "TryParse", new short[2] + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(233, "TryParse", new short[2] { - (short) 208, - (short) 233 - }, (short)233, new InvokeHandler(Vector2Schema.CallTryParseStringVector2), true); + 208, + 233 + }, 233, new InvokeHandler(Vector2Schema.CallTryParseStringVector2), true); Vector2Schema.Type.Initialize(new DefaultConstructHandler(Vector2Schema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[2] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2 + uixPropertySchema1, + uixPropertySchema2 }, new MethodSchema[1] { - (MethodSchema) uixMethodSchema - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(Vector2Schema.TryConvertFrom), new SupportsTypeConversionHandler(Vector2Schema.IsConversionSupported), new EncodeBinaryHandler(Vector2Schema.EncodeBinary), new DecodeBinaryHandler(Vector2Schema.DecodeBinary), new PerformOperationHandler(Vector2Schema.ExecuteOperation), new SupportsOperationHandler(Vector2Schema.IsOperationSupported)); + uixMethodSchema + }, null, null, new TypeConverterHandler(Vector2Schema.TryConvertFrom), new SupportsTypeConversionHandler(Vector2Schema.IsConversionSupported), new EncodeBinaryHandler(Vector2Schema.EncodeBinary), new DecodeBinaryHandler(Vector2Schema.DecodeBinary), new PerformOperationHandler(Vector2Schema.ExecuteOperation), new SupportsOperationHandler(Vector2Schema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/Vector3Schema.cs b/UIX/Microsoft/Iris/Markup/UIX/Vector3Schema.cs index 4f46ddd..47f4146 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/Vector3Schema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/Vector3Schema.cs @@ -14,37 +14,37 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetX(object instanceObj) => (object)((Vector3)instanceObj).X; + private static object GetX(object instanceObj) => ((Vector3)instanceObj).X; private static void SetX(ref object instanceObj, object valueObj) { Vector3 vector3 = (Vector3)instanceObj; float num = (float)valueObj; vector3.X = num; - instanceObj = (object)vector3; + instanceObj = vector3; } - private static object GetY(object instanceObj) => (object)((Vector3)instanceObj).Y; + private static object GetY(object instanceObj) => ((Vector3)instanceObj).Y; private static void SetY(ref object instanceObj, object valueObj) { Vector3 vector3 = (Vector3)instanceObj; float num = (float)valueObj; vector3.Y = num; - instanceObj = (object)vector3; + instanceObj = vector3; } - private static object GetZ(object instanceObj) => (object)((Vector3)instanceObj).Z; + private static object GetZ(object instanceObj) => ((Vector3)instanceObj).Z; private static void SetZ(ref object instanceObj, object valueObj) { Vector3 vector3 = (Vector3)instanceObj; float num = (float)valueObj; vector3.Z = num; - instanceObj = (object)vector3; + instanceObj = vector3; } - private static object Construct() => (object)Vector3.Zero; + private static object Construct() => Vector3.Zero; private static object ConstructXYZ(object[] parameters) { @@ -59,19 +59,19 @@ namespace Microsoft.Iris.Markup.UIX { instance = Vector3Schema.Construct(); object valueObj1; - Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj1); + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], SingleSchema.Type, null, out valueObj1); if (result1.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Vector3", (object)result1.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Vector3", result1.Error); Vector3Schema.SetX(ref instance, valueObj1); object valueObj2; - Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj2); + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, null, out valueObj2); if (result2.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Vector3", (object)result2.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Vector3", result2.Error); Vector3Schema.SetY(ref instance, valueObj2); object valueObj3; - Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], (TypeSchema)SingleSchema.Type, (RangeValidator)null, out valueObj3); + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, null, out valueObj3); if (result3.Failed) - return Result.Fail("Problem converting '{0}' ({1})", (object)"Vector3", (object)result3.Error); + return Result.Fail("Problem converting '{0}' ({1})", "Vector3", result3.Error); Vector3Schema.SetZ(ref instance, valueObj3); return result3; } @@ -84,7 +84,7 @@ namespace Microsoft.Iris.Markup.UIX writer.WriteSingle(vector3.Z); } - private static object DecodeBinary(ByteCodeReader reader) => (object)new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); + private static object DecodeBinary(ByteCodeReader reader) => new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); @@ -94,7 +94,7 @@ namespace Microsoft.Iris.Markup.UIX out object instance) { Result result = Result.Fail("Unsupported"); - instance = (object)null; + instance = null; if (StringSchema.Type.IsAssignableFrom(fromType)) { string[] splitString = StringUtility.SplitAndTrim(',', (string)from); @@ -105,7 +105,7 @@ namespace Microsoft.Iris.Markup.UIX return result; } else - result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", (object)from.ToString(), (object)"Vector3"); + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Vector3"); } return result; } @@ -131,49 +131,49 @@ namespace Microsoft.Iris.Markup.UIX { Vector3 vector3_1 = (Vector3)leftObj; if (op == OperationType.MathNegate) - return (object)-vector3_1; + return -vector3_1; Vector3 vector3_2 = (Vector3)rightObj; switch (op - 1) { - case (OperationType)0: - return (object)(vector3_1 + vector3_2); + case 0: + return vector3_1 + vector3_2; case OperationType.MathAdd: - return (object)(vector3_1 - vector3_2); + return vector3_1 - vector3_2; case OperationType.MathSubtract: - return (object)(vector3_1 * vector3_2); + return vector3_1 * vector3_2; case OperationType.MathMultiply: - return (object)(vector3_1 / vector3_2); + return vector3_1 / vector3_2; case OperationType.LogicalOr: return BooleanBoxes.Box(vector3_1 == vector3_2); case OperationType.RelationalEquals: return BooleanBoxes.Box(vector3_1 != vector3_2); default: - return (object)null; + return null; } } - public static void Pass1Initialize() => Vector3Schema.Type = new UIXTypeSchema((short)234, "Vector3", (string)null, (short)153, typeof(Vector3), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => Vector3Schema.Type = new UIXTypeSchema(234, "Vector3", null, 153, typeof(Vector3), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)234, "X", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Vector3Schema.GetX), new SetValueHandler(Vector3Schema.SetX), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)234, "Y", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Vector3Schema.GetY), new SetValueHandler(Vector3Schema.SetY), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)234, "Z", (short)194, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(Vector3Schema.GetZ), new SetValueHandler(Vector3Schema.SetZ), false); - UIXConstructorSchema constructorSchema = new UIXConstructorSchema((short)234, new short[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(234, "X", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Vector3Schema.GetX), new SetValueHandler(Vector3Schema.SetX), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(234, "Y", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Vector3Schema.GetY), new SetValueHandler(Vector3Schema.SetY), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(234, "Z", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(Vector3Schema.GetZ), new SetValueHandler(Vector3Schema.SetZ), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(234, new short[3] { - (short) 194, - (short) 194, - (short) 194 + 194, + 194, + 194 }, new ConstructHandler(Vector3Schema.ConstructXYZ)); Vector3Schema.Type.Initialize(new DefaultConstructHandler(Vector3Schema.Construct), new ConstructorSchema[1] { - (ConstructorSchema) constructorSchema + constructorSchema }, new PropertySchema[3] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema3 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, new TypeConverterHandler(Vector3Schema.TryConvertFrom), new SupportsTypeConversionHandler(Vector3Schema.IsConversionSupported), new EncodeBinaryHandler(Vector3Schema.EncodeBinary), new DecodeBinaryHandler(Vector3Schema.DecodeBinary), new PerformOperationHandler(Vector3Schema.ExecuteOperation), new SupportsOperationHandler(Vector3Schema.IsOperationSupported)); + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 + }, null, null, null, new TypeConverterHandler(Vector3Schema.TryConvertFrom), new SupportsTypeConversionHandler(Vector3Schema.IsConversionSupported), new EncodeBinaryHandler(Vector3Schema.EncodeBinary), new DecodeBinaryHandler(Vector3Schema.DecodeBinary), new PerformOperationHandler(Vector3Schema.ExecuteOperation), new SupportsOperationHandler(Vector3Schema.IsOperationSupported)); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/VideoElementInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/VideoElementInstanceSchema.cs index c1c8a74..85372df 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/VideoElementInstanceSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/VideoElementInstanceSchema.cs @@ -15,15 +15,15 @@ namespace Microsoft.Iris.Markup.UIX private static void SetVideoStream(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Video", (IUIVideoStream)valueObj); - public static void Pass1Initialize() => VideoElementInstanceSchema.Type = new UIXTypeSchema((short)237, "VideoElementInstance", (string)null, (short)74, typeof(EffectElementWrapper), UIXTypeFlags.None); + public static void Pass1Initialize() => VideoElementInstanceSchema.Type = new UIXTypeSchema(237, "VideoElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)237, "VideoStream", (short)238, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(VideoElementInstanceSchema.SetVideoStream), false); - VideoElementInstanceSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(237, "VideoStream", 238, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(VideoElementInstanceSchema.SetVideoStream), false); + VideoElementInstanceSchema.Type.Initialize(null, null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/VideoElementSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/VideoElementSchema.cs index 6c883f5..c5612d8 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/VideoElementSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/VideoElementSchema.cs @@ -21,17 +21,17 @@ namespace Microsoft.Iris.Markup.UIX videoElement.VideoStream = videoStream.RenderStream; } - private static object Construct() => (object)new VideoElement(); + private static object Construct() => new VideoElement(); - public static void Pass1Initialize() => VideoElementSchema.Type = new UIXTypeSchema((short)236, "VideoElement", (string)null, (short)77, typeof(VideoElement), UIXTypeFlags.None); + public static void Pass1Initialize() => VideoElementSchema.Type = new UIXTypeSchema(236, "VideoElement", null, 77, typeof(VideoElement), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)236, "VideoStream", (short)238, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, (GetValueHandler)null, new SetValueHandler(VideoElementSchema.SetVideoStream), false); - VideoElementSchema.Type.Initialize(new DefaultConstructHandler(VideoElementSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(236, "VideoStream", 238, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(VideoElementSchema.SetVideoStream), false); + VideoElementSchema.Type.Initialize(new DefaultConstructHandler(VideoElementSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/VideoSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/VideoSchema.cs index fe1cb80..69a469d 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/VideoSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/VideoSchema.cs @@ -15,31 +15,31 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetChildren(object instanceObj) => (object)ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); + private static object GetChildren(object instanceObj) => ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); - private static object GetVideoStream(object instanceObj) => (object)((Video)instanceObj).VideoStream; + private static object GetVideoStream(object instanceObj) => ((Video)instanceObj).VideoStream; private static void SetVideoStream(ref object instanceObj, object valueObj) => ((Video)instanceObj).VideoStream = (IUIVideoStream)valueObj; - private static object GetLetterboxColor(object instanceObj) => (object)((Video)instanceObj).LetterboxColor; + private static object GetLetterboxColor(object instanceObj) => ((Video)instanceObj).LetterboxColor; private static void SetLetterboxColor(ref object instanceObj, object valueObj) => ((Video)instanceObj).LetterboxColor = (Color)valueObj; - private static object Construct() => (object)new Video(); + private static object Construct() => new Video(); - public static void Pass1Initialize() => VideoSchema.Type = new UIXTypeSchema((short)235, "Video", (string)null, (short)239, typeof(Video), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => VideoSchema.Type = new UIXTypeSchema(235, "Video", null, 239, typeof(Video), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)235, "Children", (short)138, (short)239, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(VideoSchema.GetChildren), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)235, "VideoStream", (short)238, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(VideoSchema.GetVideoStream), new SetValueHandler(VideoSchema.SetVideoStream), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)235, "LetterboxColor", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(VideoSchema.GetLetterboxColor), new SetValueHandler(VideoSchema.SetLetterboxColor), false); - VideoSchema.Type.Initialize(new DefaultConstructHandler(VideoSchema.Construct), (ConstructorSchema[])null, new PropertySchema[3] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(235, "Children", 138, 239, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(VideoSchema.GetChildren), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(235, "VideoStream", 238, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(VideoSchema.GetVideoStream), new SetValueHandler(VideoSchema.SetVideoStream), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(235, "LetterboxColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(VideoSchema.GetLetterboxColor), new SetValueHandler(VideoSchema.SetLetterboxColor), false); + VideoSchema.Type.Initialize(new DefaultConstructHandler(VideoSchema.Construct), null, new PropertySchema[3] { - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema2 - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema2 + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/VideoStreamSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/VideoStreamSchema.cs index 1991eae..9718dd2 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/VideoStreamSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/VideoStreamSchema.cs @@ -10,19 +10,19 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetStreamID(object instanceObj) => (object)((VideoStream)instanceObj).StreamID; + private static object GetStreamID(object instanceObj) => ((VideoStream)instanceObj).StreamID; - private static object Construct() => (object)new VideoStream(); + private static object Construct() => new VideoStream(); - public static void Pass1Initialize() => VideoStreamSchema.Type = new UIXTypeSchema((short)238, "VideoStream", (string)null, (short)153, typeof(VideoStream), UIXTypeFlags.Immutable); + public static void Pass1Initialize() => VideoStreamSchema.Type = new UIXTypeSchema(238, "VideoStream", null, 153, typeof(VideoStream), UIXTypeFlags.Immutable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema = new UIXPropertySchema((short)238, "StreamID", (short)115, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(VideoStreamSchema.GetStreamID), (SetValueHandler)null, false); - VideoStreamSchema.Type.Initialize(new DefaultConstructHandler(VideoStreamSchema.Construct), (ConstructorSchema[])null, new PropertySchema[1] + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(238, "StreamID", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(VideoStreamSchema.GetStreamID), null, false); + VideoStreamSchema.Type.Initialize(new DefaultConstructHandler(VideoStreamSchema.Construct), null, new PropertySchema[1] { - (PropertySchema) uixPropertySchema - }, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixPropertySchema + }, null, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/ViewItemSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ViewItemSchema.cs index 3a8251d..4f85de6 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/ViewItemSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/ViewItemSchema.cs @@ -21,7 +21,7 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetAlpha(object instanceObj) => (object)((ViewItem)instanceObj).Alpha; + private static object GetAlpha(object instanceObj) => ((ViewItem)instanceObj).Alpha; private static void SetAlpha(ref object instanceObj, object valueObj) { @@ -34,17 +34,17 @@ namespace Microsoft.Iris.Markup.UIX viewItem.Alpha = num; } - private static object GetAnimations(object instanceObj) => (object)ViewItemSchema.ListProxy.GetAnimation((ViewItem)instanceObj); + private static object GetAnimations(object instanceObj) => ViewItemSchema.ListProxy.GetAnimation((ViewItem)instanceObj); - private static object GetCenterPointPercent(object instanceObj) => (object)((ViewItem)instanceObj).CenterPointPercent; + private static object GetCenterPointPercent(object instanceObj) => ((ViewItem)instanceObj).CenterPointPercent; private static void SetCenterPointPercent(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).CenterPointPercent = (Vector3)valueObj; - private static object GetDebugOutline(object instanceObj) => (object)((ViewItem)instanceObj).DebugOutline; + private static object GetDebugOutline(object instanceObj) => ((ViewItem)instanceObj).DebugOutline; private static void SetDebugOutline(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).DebugOutline = (Color)valueObj; - private static object GetFocusOrder(object instanceObj) => (object)((ViewItem)instanceObj).FocusOrder; + private static object GetFocusOrder(object instanceObj) => ((ViewItem)instanceObj).FocusOrder; private static void SetFocusOrder(ref object instanceObj, object valueObj) { @@ -57,15 +57,15 @@ namespace Microsoft.Iris.Markup.UIX viewItem.FocusOrder = num; } - private static object GetAlignment(object instanceObj) => (object)((ViewItem)instanceObj).Alignment; + private static object GetAlignment(object instanceObj) => ((ViewItem)instanceObj).Alignment; private static void SetAlignment(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Alignment = (ItemAlignment)valueObj; - private static object GetChildAlignment(object instanceObj) => (object)((ViewItem)instanceObj).ChildAlignment; + private static object GetChildAlignment(object instanceObj) => ((ViewItem)instanceObj).ChildAlignment; private static void SetChildAlignment(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).ChildAlignment = (ItemAlignment)valueObj; - private static object GetLayout(object instanceObj) => (object)((ViewItem)instanceObj).Layout; + private static object GetLayout(object instanceObj) => ((ViewItem)instanceObj).Layout; private static void SetLayout(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Layout = (ILayout)valueObj; @@ -74,14 +74,14 @@ namespace Microsoft.Iris.Markup.UIX ViewItem viewItem = (ViewItem)instanceObj; ILayoutInput layoutInput = (ILayoutInput)valueObj; if (layoutInput == null) - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"LayoutInput"); + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "LayoutInput"); else viewItem.LayoutInput = layoutInput; } - private static object GetLayoutOutput(object instanceObj) => (object)((ViewItem)instanceObj).LayoutOutput; + private static object GetLayoutOutput(object instanceObj) => ((ViewItem)instanceObj).LayoutOutput; - private static object GetMargins(object instanceObj) => (object)((ViewItem)instanceObj).Margins; + private static object GetMargins(object instanceObj) => ((ViewItem)instanceObj).Margins; private static void SetMargins(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Margins = (Inset)valueObj; @@ -113,31 +113,31 @@ namespace Microsoft.Iris.Markup.UIX private static void SetMouseInteractive(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).MouseInteractive = (bool)valueObj; - private static object GetName(object instanceObj) => (object)((ViewItem)instanceObj).Name; + private static object GetName(object instanceObj) => ((ViewItem)instanceObj).Name; private static void SetName(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Name = (string)valueObj; - private static object GetNavigation(object instanceObj) => (object)((ViewItem)instanceObj).Navigation; + private static object GetNavigation(object instanceObj) => ((ViewItem)instanceObj).Navigation; private static void SetNavigation(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Navigation = (NavigationPolicies)valueObj; - private static object GetPadding(object instanceObj) => (object)((ViewItem)instanceObj).Padding; + private static object GetPadding(object instanceObj) => ((ViewItem)instanceObj).Padding; private static void SetPadding(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Padding = (Inset)valueObj; - private static object GetRotation(object instanceObj) => (object)((ViewItem)instanceObj).Rotation; + private static object GetRotation(object instanceObj) => ((ViewItem)instanceObj).Rotation; private static void SetRotation(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Rotation = (Rotation)valueObj; - private static object GetScale(object instanceObj) => (object)((ViewItem)instanceObj).Scale; + private static object GetScale(object instanceObj) => ((ViewItem)instanceObj).Scale; private static void SetScale(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Scale = (Vector3)valueObj; - private static object GetSharedSize(object instanceObj) => (object)((ViewItem)instanceObj).SharedSize; + private static object GetSharedSize(object instanceObj) => ((ViewItem)instanceObj).SharedSize; private static void SetSharedSize(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).SharedSize = (SharedSize)valueObj; - private static object GetSharedSizePolicy(object instanceObj) => (object)((ViewItem)instanceObj).SharedSizePolicy; + private static object GetSharedSizePolicy(object instanceObj) => ((ViewItem)instanceObj).SharedSizePolicy; private static void SetSharedSizePolicy(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).SharedSizePolicy = (SharedSizePolicy)valueObj; @@ -145,11 +145,11 @@ namespace Microsoft.Iris.Markup.UIX private static void SetVisible(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Visible = (bool)valueObj; - private static object GetBackground(object instanceObj) => (object)((ViewItem)instanceObj).Background; + private static object GetBackground(object instanceObj) => ((ViewItem)instanceObj).Background; private static void SetBackground(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Background = (Color)valueObj; - private static object GetCamera(object instanceObj) => (object)((ViewItem)instanceObj).Camera; + private static object GetCamera(object instanceObj) => ((ViewItem)instanceObj).Camera; private static void SetCamera(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Camera = (Camera)valueObj; @@ -159,11 +159,11 @@ namespace Microsoft.Iris.Markup.UIX IAnimationProvider parameter = (IAnimationProvider)parameters[0]; if (parameter == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"animation"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; } viewItem.AttachAnimation(parameter); - return (object)null; + return null; } private static object CallAttachAnimationIAnimationAnimationHandle( @@ -175,16 +175,16 @@ namespace Microsoft.Iris.Markup.UIX AnimationHandle parameter2 = (AnimationHandle)parameters[1]; if (parameter1 == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"animation"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; } if (parameter2 == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"handle"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "handle"); + return null; } viewItem.AttachAnimation(parameter1, parameter2); - return (object)null; + return null; } private static object CallDetachAnimationAnimationEventType( @@ -192,7 +192,7 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((ViewItem)instanceObj).DetachAnimation((AnimationEventType)parameters[0]); - return (object)null; + return null; } private static object CallPlayAnimationIAnimation(object instanceObj, object[] parameters) @@ -201,11 +201,11 @@ namespace Microsoft.Iris.Markup.UIX IAnimationProvider parameter = (IAnimationProvider)parameters[0]; if (parameter == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"animation"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; } - viewItem.PlayAnimation(parameter, (AnimationHandle)null); - return (object)null; + viewItem.PlayAnimation(parameter, null); + return null; } private static object CallPlayAnimationIAnimationAnimationHandle( @@ -217,16 +217,16 @@ namespace Microsoft.Iris.Markup.UIX AnimationHandle parameter2 = (AnimationHandle)parameters[1]; if (parameter1 == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"animation"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; } if (parameter2 == null) { - ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", (object)"handle"); - return (object)null; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "handle"); + return null; } viewItem.PlayAnimation(parameter1, parameter2); - return (object)null; + return null; } private static object CallPlayAnimationAnimationEventType( @@ -234,137 +234,137 @@ namespace Microsoft.Iris.Markup.UIX object[] parameters) { ((ViewItem)instanceObj).PlayAnimation((AnimationEventType)parameters[0]); - return (object)null; + return null; } private static object CallForceContentChange(object instanceObj, object[] parameters) { ((ViewItem)instanceObj).ForceContentChange(); - return (object)null; + return null; } - private static object CallSnapshotPosition(object instanceObj, object[] parameters) => (object)((ViewItem)instanceObj).SnapshotPosition(); + private static object CallSnapshotPosition(object instanceObj, object[] parameters) => ((ViewItem)instanceObj).SnapshotPosition(); private static object CallNavigateInto(object instanceObj, object[] parameters) { ((ViewItem)instanceObj).NavigateInto(); - return (object)null; + return null; } private static object CallNavigateIntoBoolean(object instanceObj, object[] parameters) { ((ViewItem)instanceObj).NavigateInto((bool)parameters[0]); - return (object)null; + return null; } private static object CallScrollIntoView(object instanceObj, object[] parameters) { ((ViewItem)instanceObj).ScrollIntoView(); - return (object)null; + return null; } - public static void Pass1Initialize() => ViewItemSchema.Type = new UIXTypeSchema((short)239, "ViewItem", (string)null, (short)-1, typeof(ViewItem), UIXTypeFlags.Disposable); + public static void Pass1Initialize() => ViewItemSchema.Type = new UIXTypeSchema(239, "ViewItem", null, -1, typeof(ViewItem), UIXTypeFlags.Disposable); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)239, "Alpha", (short)194, (short)-1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, true, new GetValueHandler(ViewItemSchema.GetAlpha), new SetValueHandler(ViewItemSchema.SetAlpha), false); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)239, "Animations", (short)138, (short)104, ExpressionRestriction.NoAccess, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetAnimations), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)239, "CenterPointPercent", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetCenterPointPercent), new SetValueHandler(ViewItemSchema.SetCenterPointPercent), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)239, "DebugOutline", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetDebugOutline), new SetValueHandler(ViewItemSchema.SetDebugOutline), false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)239, "FocusOrder", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ViewItemSchema.GetFocusOrder), new SetValueHandler(ViewItemSchema.SetFocusOrder), false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)239, "Alignment", (short)sbyte.MaxValue, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetAlignment), new SetValueHandler(ViewItemSchema.SetAlignment), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)239, "ChildAlignment", (short)sbyte.MaxValue, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetChildAlignment), new SetValueHandler(ViewItemSchema.SetChildAlignment), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)239, "Layout", (short)132, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetLayout), new SetValueHandler(ViewItemSchema.SetLayout), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)239, "LayoutInput", (short)133, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, (GetValueHandler)null, new SetValueHandler(ViewItemSchema.SetLayoutInput), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)239, "LayoutOutput", (short)134, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(ViewItemSchema.GetLayoutOutput), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)239, "Margins", (short)114, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetMargins), new SetValueHandler(ViewItemSchema.SetMargins), false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)239, "MaximumSize", (short)195, (short)-1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(ViewItemSchema.GetMaximumSize), new SetValueHandler(ViewItemSchema.SetMaximumSize), false); - UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema((short)239, "MinimumSize", (short)195, (short)-1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(ViewItemSchema.GetMinimumSize), new SetValueHandler(ViewItemSchema.SetMinimumSize), false); - UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema((short)239, "MouseInteractive", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetMouseInteractive), new SetValueHandler(ViewItemSchema.SetMouseInteractive), false); - UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema((short)239, "Name", (short)208, (short)-1, ExpressionRestriction.ReadOnly, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetName), new SetValueHandler(ViewItemSchema.SetName), false); - UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema((short)239, "Navigation", (short)151, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetNavigation), new SetValueHandler(ViewItemSchema.SetNavigation), false); - UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema((short)239, "Padding", (short)114, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetPadding), new SetValueHandler(ViewItemSchema.SetPadding), false); - UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema((short)239, "Rotation", (short)176, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetRotation), new SetValueHandler(ViewItemSchema.SetRotation), false); - UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema((short)239, "Scale", (short)234, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetScale), new SetValueHandler(ViewItemSchema.SetScale), false); - UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema((short)239, "SharedSize", (short)190, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetSharedSize), new SetValueHandler(ViewItemSchema.SetSharedSize), false); - UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema((short)239, "SharedSizePolicy", (short)191, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetSharedSizePolicy), new SetValueHandler(ViewItemSchema.SetSharedSizePolicy), false); - UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema((short)239, "Visible", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetVisible), new SetValueHandler(ViewItemSchema.SetVisible), false); - UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema((short)239, "Background", (short)35, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetBackground), new SetValueHandler(ViewItemSchema.SetBackground), false); - UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema((short)239, "Camera", (short)21, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(ViewItemSchema.GetCamera), new SetValueHandler(ViewItemSchema.SetCamera), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)239, "AttachAnimation", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(239, "Alpha", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, true, new GetValueHandler(ViewItemSchema.GetAlpha), new SetValueHandler(ViewItemSchema.SetAlpha), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(239, "Animations", 138, 104, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(ViewItemSchema.GetAnimations), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(239, "CenterPointPercent", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetCenterPointPercent), new SetValueHandler(ViewItemSchema.SetCenterPointPercent), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(239, "DebugOutline", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetDebugOutline), new SetValueHandler(ViewItemSchema.SetDebugOutline), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(239, "FocusOrder", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(ViewItemSchema.GetFocusOrder), new SetValueHandler(ViewItemSchema.SetFocusOrder), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(239, "Alignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetAlignment), new SetValueHandler(ViewItemSchema.SetAlignment), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(239, "ChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetChildAlignment), new SetValueHandler(ViewItemSchema.SetChildAlignment), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(239, "Layout", 132, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetLayout), new SetValueHandler(ViewItemSchema.SetLayout), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(239, "LayoutInput", 133, -1, ExpressionRestriction.None, false, null, true, null, new SetValueHandler(ViewItemSchema.SetLayoutInput), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(239, "LayoutOutput", 134, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(ViewItemSchema.GetLayoutOutput), null, false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(239, "Margins", 114, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetMargins), new SetValueHandler(ViewItemSchema.SetMargins), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(239, "MaximumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(ViewItemSchema.GetMaximumSize), new SetValueHandler(ViewItemSchema.SetMaximumSize), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(239, "MinimumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(ViewItemSchema.GetMinimumSize), new SetValueHandler(ViewItemSchema.SetMinimumSize), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(239, "MouseInteractive", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetMouseInteractive), new SetValueHandler(ViewItemSchema.SetMouseInteractive), false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(239, "Name", 208, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(ViewItemSchema.GetName), new SetValueHandler(ViewItemSchema.SetName), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(239, "Navigation", 151, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetNavigation), new SetValueHandler(ViewItemSchema.SetNavigation), false); + UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema(239, "Padding", 114, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetPadding), new SetValueHandler(ViewItemSchema.SetPadding), false); + UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema(239, "Rotation", 176, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetRotation), new SetValueHandler(ViewItemSchema.SetRotation), false); + UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema(239, "Scale", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetScale), new SetValueHandler(ViewItemSchema.SetScale), false); + UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema(239, "SharedSize", 190, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetSharedSize), new SetValueHandler(ViewItemSchema.SetSharedSize), false); + UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema(239, "SharedSizePolicy", 191, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetSharedSizePolicy), new SetValueHandler(ViewItemSchema.SetSharedSizePolicy), false); + UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema(239, "Visible", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetVisible), new SetValueHandler(ViewItemSchema.SetVisible), false); + UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema(239, "Background", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetBackground), new SetValueHandler(ViewItemSchema.SetBackground), false); + UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema(239, "Camera", 21, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(ViewItemSchema.GetCamera), new SetValueHandler(ViewItemSchema.SetCamera), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(239, "AttachAnimation", new short[1] { - (short) 104 - }, (short)240, new InvokeHandler(ViewItemSchema.CallAttachAnimationIAnimation), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)239, "AttachAnimation", new short[2] + 104 + }, 240, new InvokeHandler(ViewItemSchema.CallAttachAnimationIAnimation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(239, "AttachAnimation", new short[2] { - (short) 104, - (short) 11 - }, (short)240, new InvokeHandler(ViewItemSchema.CallAttachAnimationIAnimationAnimationHandle), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)239, "DetachAnimation", new short[1] + 104, + 11 + }, 240, new InvokeHandler(ViewItemSchema.CallAttachAnimationIAnimationAnimationHandle), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(239, "DetachAnimation", new short[1] { - (short) 10 - }, (short)240, new InvokeHandler(ViewItemSchema.CallDetachAnimationAnimationEventType), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)239, "PlayAnimation", new short[1] + 10 + }, 240, new InvokeHandler(ViewItemSchema.CallDetachAnimationAnimationEventType), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(239, "PlayAnimation", new short[1] { - (short) 104 - }, (short)240, new InvokeHandler(ViewItemSchema.CallPlayAnimationIAnimation), false); - UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema((short)239, "PlayAnimation", new short[2] + 104 + }, 240, new InvokeHandler(ViewItemSchema.CallPlayAnimationIAnimation), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(239, "PlayAnimation", new short[2] { - (short) 104, - (short) 11 - }, (short)240, new InvokeHandler(ViewItemSchema.CallPlayAnimationIAnimationAnimationHandle), false); - UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema((short)239, "PlayAnimation", new short[1] + 104, + 11 + }, 240, new InvokeHandler(ViewItemSchema.CallPlayAnimationIAnimationAnimationHandle), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(239, "PlayAnimation", new short[1] { - (short) 10 - }, (short)240, new InvokeHandler(ViewItemSchema.CallPlayAnimationAnimationEventType), false); - UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema((short)239, "ForceContentChange", (short[])null, (short)240, new InvokeHandler(ViewItemSchema.CallForceContentChange), false); - UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema((short)239, "SnapshotPosition", (short[])null, (short)171, new InvokeHandler(ViewItemSchema.CallSnapshotPosition), false); - UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema((short)239, "NavigateInto", (short[])null, (short)240, new InvokeHandler(ViewItemSchema.CallNavigateInto), false); - UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema((short)239, "NavigateInto", new short[1] + 10 + }, 240, new InvokeHandler(ViewItemSchema.CallPlayAnimationAnimationEventType), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(239, "ForceContentChange", null, 240, new InvokeHandler(ViewItemSchema.CallForceContentChange), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(239, "SnapshotPosition", null, 171, new InvokeHandler(ViewItemSchema.CallSnapshotPosition), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(239, "NavigateInto", null, 240, new InvokeHandler(ViewItemSchema.CallNavigateInto), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(239, "NavigateInto", new short[1] { - (short) 15 - }, (short)240, new InvokeHandler(ViewItemSchema.CallNavigateIntoBoolean), false); - UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema((short)239, "ScrollIntoView", (short[])null, (short)240, new InvokeHandler(ViewItemSchema.CallScrollIntoView), false); - ViewItemSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, new PropertySchema[24] + 15 + }, 240, new InvokeHandler(ViewItemSchema.CallNavigateIntoBoolean), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(239, "ScrollIntoView", null, 240, new InvokeHandler(ViewItemSchema.CallScrollIntoView), false); + ViewItemSchema.Type.Initialize(null, null, new PropertySchema[24] { - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema23, - (PropertySchema) uixPropertySchema24, - (PropertySchema) uixPropertySchema3, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema13, - (PropertySchema) uixPropertySchema14, - (PropertySchema) uixPropertySchema15, - (PropertySchema) uixPropertySchema16, - (PropertySchema) uixPropertySchema17, - (PropertySchema) uixPropertySchema18, - (PropertySchema) uixPropertySchema19, - (PropertySchema) uixPropertySchema20, - (PropertySchema) uixPropertySchema21, - (PropertySchema) uixPropertySchema22 + uixPropertySchema6, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema23, + uixPropertySchema24, + uixPropertySchema3, + uixPropertySchema7, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema8, + uixPropertySchema9, + uixPropertySchema10, + uixPropertySchema11, + uixPropertySchema12, + uixPropertySchema13, + uixPropertySchema14, + uixPropertySchema15, + uixPropertySchema16, + uixPropertySchema17, + uixPropertySchema18, + uixPropertySchema19, + uixPropertySchema20, + uixPropertySchema21, + uixPropertySchema22 }, new MethodSchema[11] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4, - (MethodSchema) uixMethodSchema5, - (MethodSchema) uixMethodSchema6, - (MethodSchema) uixMethodSchema7, - (MethodSchema) uixMethodSchema8, - (MethodSchema) uixMethodSchema9, - (MethodSchema) uixMethodSchema10, - (MethodSchema) uixMethodSchema11 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8, + uixMethodSchema9, + uixMethodSchema10, + uixMethodSchema11 + }, null, null, null, null, null, null, null, null); } internal class ListProxy : IList, ICollection, IEnumerable @@ -376,13 +376,13 @@ namespace Microsoft.Iris.Markup.UIX public static IList GetChildren(ViewItem subject) { ViewItemSchema.ListProxy.s_shared.SetSubject(subject, ViewItemSchema.ListProxyMode.Children); - return (IList)ViewItemSchema.ListProxy.s_shared; + return s_shared; } public static IList GetAnimation(ViewItem subject) { ViewItemSchema.ListProxy.s_shared.SetSubject(subject, ViewItemSchema.ListProxyMode.Animation); - return (IList)ViewItemSchema.ListProxy.s_shared; + return s_shared; } public int Add(object value) @@ -400,7 +400,7 @@ namespace Microsoft.Iris.Markup.UIX } break; } - this._subject = (ViewItem)null; + this._subject = null; return 0; } diff --git a/UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs index 97d09a0..57e57b0 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs @@ -10,8 +10,8 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - public static void Pass1Initialize() => VoidSchema.Type = new UIXTypeSchema((short)240, "Void", "void", (short)-1, typeof(void), UIXTypeFlags.None); + public static void Pass1Initialize() => VoidSchema.Type = new UIXTypeSchema(240, "Void", "void", -1, typeof(void), UIXTypeFlags.None); - public static void Pass2Initialize() => VoidSchema.Type.Initialize((DefaultConstructHandler)null, (ConstructorSchema[])null, (PropertySchema[])null, (MethodSchema[])null, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + public static void Pass2Initialize() => VoidSchema.Type.Initialize(null, null, null, null, null, null, null, null, null, null, null, null); } } diff --git a/UIX/Microsoft/Iris/Markup/UIX/WindowSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/WindowSchema.cs index a4dc8a9..a026fff 100644 --- a/UIX/Microsoft/Iris/Markup/UIX/WindowSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIX/WindowSchema.cs @@ -15,13 +15,13 @@ namespace Microsoft.Iris.Markup.UIX { public static UIXTypeSchema Type; - private static object GetMainWindow(object instanceObj) => (object)UISession.Default.Form; + private static object GetMainWindow(object instanceObj) => UISession.Default.Form; - private static object GetCaption(object instanceObj) => (object)((UIForm)instanceObj).Caption; + private static object GetCaption(object instanceObj) => ((UIForm)instanceObj).Caption; private static void SetCaption(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).Caption = (string)valueObj; - private static object GetWindowState(object instanceObj) => (object)((Form)instanceObj).WindowState; + private static object GetWindowState(object instanceObj) => ((Form)instanceObj).WindowState; private static void SetWindowState(ref object instanceObj, object valueObj) => ((Form)instanceObj).WindowState = (Microsoft.Iris.WindowState)valueObj; @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Markup.UIX private static void SetHideMouseOnIdle(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).HideMouseOnIdle = (bool)valueObj; - private static object GetMouseIdleTimeout(object instanceObj) => (object)((UIForm)instanceObj).MouseIdleTimeout; + private static object GetMouseIdleTimeout(object instanceObj) => ((UIForm)instanceObj).MouseIdleTimeout; private static void SetMouseIdleTimeout(ref object instanceObj, object valueObj) { @@ -62,15 +62,15 @@ namespace Microsoft.Iris.Markup.UIX private static void SetPreventInterruption(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).PreventInterruption = (bool)valueObj; - private static object GetMaximizeMode(object instanceObj) => (object)((UIForm)instanceObj).MaximizeMode; + private static object GetMaximizeMode(object instanceObj) => ((UIForm)instanceObj).MaximizeMode; private static void SetMaximizeMode(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).MaximizeMode = (MaximizeMode)valueObj; - private static object GetClientSize(object instanceObj) => (object)((Form)instanceObj).ClientSize; + private static object GetClientSize(object instanceObj) => ((Form)instanceObj).ClientSize; private static void SetClientSize(ref object instanceObj, object valueObj) => ((Form)instanceObj).ClientSize = (Size)valueObj; - private static object GetPosition(object instanceObj) => (object)((Form)instanceObj).Position; + private static object GetPosition(object instanceObj) => ((Form)instanceObj).Position; private static void SetPosition(ref object instanceObj, object valueObj) => ((Form)instanceObj).Position = (Point)valueObj; @@ -78,78 +78,78 @@ namespace Microsoft.Iris.Markup.UIX private static void SetVisible(ref object instanceObj, object valueObj) => ((Form)instanceObj).Visible = (bool)valueObj; - private static object Construct() => (object)UISession.Default.Form; + private static object Construct() => UISession.Default.Form; private static object CallClose(object instanceObj, object[] parameters) { ((UIForm)instanceObj).Close(); - return (object)null; + return null; } private static object CallForceClose(object instanceObj, object[] parameters) { ((Form)instanceObj).ForceClose(); - return (object)null; + return null; } - private static object CallSaveKeyFocus(object instanceObj, object[] parameters) => (object)((UIForm)instanceObj).SaveKeyFocus(); + private static object CallSaveKeyFocus(object instanceObj, object[] parameters) => ((UIForm)instanceObj).SaveKeyFocus(); private static object CallRestoreKeyFocusSavedKeyFocus(object instanceObj, object[] parameters) { ((UIForm)instanceObj).RestoreKeyFocus((SavedKeyFocus)parameters[0]); - return (object)null; + return null; } - public static void Pass1Initialize() => WindowSchema.Type = new UIXTypeSchema((short)241, "Window", (string)null, (short)153, typeof(UIForm), UIXTypeFlags.None); + public static void Pass1Initialize() => WindowSchema.Type = new UIXTypeSchema(241, "Window", null, 153, typeof(UIForm), UIXTypeFlags.None); public static void Pass2Initialize() { - UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema((short)241, "MainWindow", (short)241, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, false, new GetValueHandler(WindowSchema.GetMainWindow), (SetValueHandler)null, true); - UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema((short)241, "Caption", (short)208, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetCaption), new SetValueHandler(WindowSchema.SetCaption), false); - UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema((short)241, "WindowState", (short)242, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetWindowState), new SetValueHandler(WindowSchema.SetWindowState), false); - UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema((short)241, "Active", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetActive), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema((short)241, "MouseActive", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetMouseActive), (SetValueHandler)null, false); - UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema((short)241, "ShowWindowFrame", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetShowWindowFrame), new SetValueHandler(WindowSchema.SetShowWindowFrame), false); - UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema((short)241, "HideMouseOnIdle", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetHideMouseOnIdle), new SetValueHandler(WindowSchema.SetHideMouseOnIdle), false); - UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema((short)241, "MouseIdleTimeout", (short)115, (short)-1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(WindowSchema.GetMouseIdleTimeout), new SetValueHandler(WindowSchema.SetMouseIdleTimeout), false); - UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema((short)241, "AlwaysOnTop", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetAlwaysOnTop), new SetValueHandler(WindowSchema.SetAlwaysOnTop), false); - UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema((short)241, "ShowInTaskbar", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetShowInTaskbar), new SetValueHandler(WindowSchema.SetShowInTaskbar), false); - UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema((short)241, "PreventInterruption", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetPreventInterruption), new SetValueHandler(WindowSchema.SetPreventInterruption), false); - UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema((short)241, "MaximizeMode", (short)146, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetMaximizeMode), new SetValueHandler(WindowSchema.SetMaximizeMode), false); - UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema((short)241, "ClientSize", (short)195, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetClientSize), new SetValueHandler(WindowSchema.SetClientSize), false); - UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema((short)241, "Position", (short)158, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetPosition), new SetValueHandler(WindowSchema.SetPosition), false); - UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema((short)241, "Visible", (short)15, (short)-1, ExpressionRestriction.None, false, (RangeValidator)null, true, new GetValueHandler(WindowSchema.GetVisible), new SetValueHandler(WindowSchema.SetVisible), false); - UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema((short)241, "Close", (short[])null, (short)240, new InvokeHandler(WindowSchema.CallClose), false); - UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema((short)241, "ForceClose", (short[])null, (short)240, new InvokeHandler(WindowSchema.CallForceClose), false); - UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema((short)241, "SaveKeyFocus", (short[])null, (short)177, new InvokeHandler(WindowSchema.CallSaveKeyFocus), false); - UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema((short)241, "RestoreKeyFocus", new short[1] + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(241, "MainWindow", 241, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(WindowSchema.GetMainWindow), null, true); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(241, "Caption", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetCaption), new SetValueHandler(WindowSchema.SetCaption), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(241, "WindowState", 242, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetWindowState), new SetValueHandler(WindowSchema.SetWindowState), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(241, "Active", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetActive), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(241, "MouseActive", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetMouseActive), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(241, "ShowWindowFrame", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetShowWindowFrame), new SetValueHandler(WindowSchema.SetShowWindowFrame), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(241, "HideMouseOnIdle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetHideMouseOnIdle), new SetValueHandler(WindowSchema.SetHideMouseOnIdle), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(241, "MouseIdleTimeout", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(WindowSchema.GetMouseIdleTimeout), new SetValueHandler(WindowSchema.SetMouseIdleTimeout), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(241, "AlwaysOnTop", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetAlwaysOnTop), new SetValueHandler(WindowSchema.SetAlwaysOnTop), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(241, "ShowInTaskbar", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetShowInTaskbar), new SetValueHandler(WindowSchema.SetShowInTaskbar), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(241, "PreventInterruption", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetPreventInterruption), new SetValueHandler(WindowSchema.SetPreventInterruption), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(241, "MaximizeMode", 146, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetMaximizeMode), new SetValueHandler(WindowSchema.SetMaximizeMode), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(241, "ClientSize", 195, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetClientSize), new SetValueHandler(WindowSchema.SetClientSize), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(241, "Position", 158, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetPosition), new SetValueHandler(WindowSchema.SetPosition), false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(241, "Visible", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(WindowSchema.GetVisible), new SetValueHandler(WindowSchema.SetVisible), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(241, "Close", null, 240, new InvokeHandler(WindowSchema.CallClose), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(241, "ForceClose", null, 240, new InvokeHandler(WindowSchema.CallForceClose), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(241, "SaveKeyFocus", null, 177, new InvokeHandler(WindowSchema.CallSaveKeyFocus), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(241, "RestoreKeyFocus", new short[1] { - (short) 177 - }, (short)240, new InvokeHandler(WindowSchema.CallRestoreKeyFocusSavedKeyFocus), false); - WindowSchema.Type.Initialize(new DefaultConstructHandler(WindowSchema.Construct), (ConstructorSchema[])null, new PropertySchema[15] + 177 + }, 240, new InvokeHandler(WindowSchema.CallRestoreKeyFocusSavedKeyFocus), false); + WindowSchema.Type.Initialize(new DefaultConstructHandler(WindowSchema.Construct), null, new PropertySchema[15] { - (PropertySchema) uixPropertySchema4, - (PropertySchema) uixPropertySchema9, - (PropertySchema) uixPropertySchema2, - (PropertySchema) uixPropertySchema13, - (PropertySchema) uixPropertySchema7, - (PropertySchema) uixPropertySchema1, - (PropertySchema) uixPropertySchema12, - (PropertySchema) uixPropertySchema5, - (PropertySchema) uixPropertySchema8, - (PropertySchema) uixPropertySchema14, - (PropertySchema) uixPropertySchema11, - (PropertySchema) uixPropertySchema10, - (PropertySchema) uixPropertySchema6, - (PropertySchema) uixPropertySchema15, - (PropertySchema) uixPropertySchema3 + uixPropertySchema4, + uixPropertySchema9, + uixPropertySchema2, + uixPropertySchema13, + uixPropertySchema7, + uixPropertySchema1, + uixPropertySchema12, + uixPropertySchema5, + uixPropertySchema8, + uixPropertySchema14, + uixPropertySchema11, + uixPropertySchema10, + uixPropertySchema6, + uixPropertySchema15, + uixPropertySchema3 }, new MethodSchema[4] { - (MethodSchema) uixMethodSchema1, - (MethodSchema) uixMethodSchema2, - (MethodSchema) uixMethodSchema3, - (MethodSchema) uixMethodSchema4 - }, (EventSchema[])null, (FindCanonicalInstanceHandler)null, (TypeConverterHandler)null, (SupportsTypeConversionHandler)null, (EncodeBinaryHandler)null, (DecodeBinaryHandler)null, (PerformOperationHandler)null, (SupportsOperationHandler)null); + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4 + }, null, null, null, null, null, null, null, null); } } } diff --git a/UIX/Microsoft/Iris/Markup/UIXEnumData.cs b/UIX/Microsoft/Iris/Markup/UIXEnumData.cs index 31b3541..d727c94 100644 --- a/UIX/Microsoft/Iris/Markup/UIXEnumData.cs +++ b/UIX/Microsoft/Iris/Markup/UIXEnumData.cs @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Markup public static Map GetClickTypeEnumData() => new Map(12) { - ["Any"] = (int)sbyte.MaxValue, + ["Any"] = sbyte.MaxValue, ["EnterKey"] = 16, ["GamePad"] = 96, ["GamePadA"] = 32, @@ -395,7 +395,7 @@ namespace Microsoft.Iris.Markup ["F13"] = 124, ["F14"] = 125, ["F15"] = 126, - ["F16"] = (int)sbyte.MaxValue, + ["F16"] = sbyte.MaxValue, ["F17"] = 128, ["F18"] = 129, ["F19"] = 130, @@ -812,7 +812,7 @@ namespace Microsoft.Iris.Markup case 242: return UIXEnumData.GetWindowStateEnumData(); default: - return (Map)null; + return null; } } } diff --git a/UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs b/UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs index bb3a6ae..842e2a6 100644 --- a/UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs @@ -13,11 +13,11 @@ namespace Microsoft.Iris.Markup private short _typeID; public UIXEnumSchema(short typeID, string name, Type runtimeType, bool isFlags) - : base((LoadResult)MarkupSystem.UIXGlobal) + : base(MarkupSystem.UIXGlobal) { this._typeID = typeID; - this.Initialize(name, runtimeType, isFlags, (string[])null, (int[])null); - UIXTypes.RegisterTypeForID(typeID, (TypeSchema)this); + this.Initialize(name, runtimeType, isFlags, null, null); + UIXTypes.RegisterTypeForID(typeID, this); } protected override void InitializeNameToValueMap() => this._nameToValueMap = UIXEnumData.GetDataForType(this._typeID); diff --git a/UIX/Microsoft/Iris/Markup/UIXLoadResult.cs b/UIX/Microsoft/Iris/Markup/UIXLoadResult.cs index 095189e..6ff811f 100644 --- a/UIX/Microsoft/Iris/Markup/UIXLoadResult.cs +++ b/UIX/Microsoft/Iris/Markup/UIXLoadResult.cs @@ -26,8 +26,8 @@ namespace Microsoft.Iris.Markup { base.OnDispose(); foreach (DisposableObject disposableObject in this.ExportTable) - disposableObject.Dispose((object)this); - this.SetExportTable((TypeSchema[])null); + disposableObject.Dispose(this); + this.SetExportTable(null); } public override TypeSchema FindType(string name) @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Markup if (typeSchema.Name == name || typeSchema.AlternateName == name) return typeSchema; } - return (TypeSchema)null; + return null; } public override LoadResultStatus Status => LoadResultStatus.Success; @@ -49,7 +49,7 @@ namespace Microsoft.Iris.Markup RangeValidator validator, out object value) { - Result result = propertyType.TypeConverter((object)inline_, (TypeSchema)StringSchema.Type, out value); + Result result = propertyType.TypeConverter(inline_, StringSchema.Type, out value); if (result.Failed || validator == null) return result; result = validator(value); diff --git a/UIX/Microsoft/Iris/Markup/UIXLoadResultExports.cs b/UIX/Microsoft/Iris/Markup/UIXLoadResultExports.cs index 82dddb6..99bb5bc 100644 --- a/UIX/Microsoft/Iris/Markup/UIXLoadResultExports.cs +++ b/UIX/Microsoft/Iris/Markup/UIXLoadResultExports.cs @@ -80,57 +80,57 @@ namespace Microsoft.Iris.Markup public static void InitializeStatics() { UIXLoadResultExports.ExportTable = new TypeSchema[243]; - UIXLoadResultExports.AccessibleRoleType = (TypeSchema)new UIXEnumSchema((short)1, "AccessibleRole", typeof(AccRole), false); - UIXLoadResultExports.AlignmentType = (TypeSchema)new UIXEnumSchema((short)3, "Alignment", typeof(Alignment), false); - UIXLoadResultExports.AlphaOperationType = (TypeSchema)new UIXEnumSchema((short)5, "AlphaOperation", typeof(AlphaOperation), false); - UIXLoadResultExports.AnimationEventTypeType = (TypeSchema)new UIXEnumSchema((short)10, "AnimationEventType", typeof(AnimationEventType), false); - UIXLoadResultExports.BeginDragPolicyType = (TypeSchema)new UIXEnumSchema((short)12, "BeginDragPolicy", typeof(BeginDragPolicy), false); - UIXLoadResultExports.ClickCountType = (TypeSchema)new UIXEnumSchema((short)31, "ClickCount", typeof(ClickCount), false); - UIXLoadResultExports.ClickTypeType = (TypeSchema)new UIXEnumSchema((short)33, "ClickType", typeof(ClickType), true); - UIXLoadResultExports.ColorOperationType = (TypeSchema)new UIXEnumSchema((short)38, "ColorOperation", typeof(ColorOperation), false); - UIXLoadResultExports.ColorSchemeType = (TypeSchema)new UIXEnumSchema((short)39, "ColorScheme", typeof(ColorScheme), false); - UIXLoadResultExports.ContentPositioningPolicyType = (TypeSchema)new UIXEnumSchema((short)41, "ContentPositioningPolicy", typeof(ContentPositioningPolicy), false); - UIXLoadResultExports.CursorType = (TypeSchema)new UIXEnumSchema((short)44, "Cursor", typeof(CursorID), false); - UIXLoadResultExports.DataQueryStatusType = (TypeSchema)new UIXEnumSchema((short)47, "DataQueryStatus", typeof(DataProviderQueryStatus), false); - UIXLoadResultExports.DebugLabelFormatType = (TypeSchema)new UIXEnumSchema((short)50, "DebugLabelFormat", typeof(DebugLabelFormat), false); - UIXLoadResultExports.DebugOutlineScopeType = (TypeSchema)new UIXEnumSchema((short)51, "DebugOutlineScope", typeof(DebugOutlineScope), false); - UIXLoadResultExports.DropActionType = (TypeSchema)new UIXEnumSchema((short)64, "DropAction", typeof(DropAction), true); - UIXLoadResultExports.EmbossDirectionType = (TypeSchema)new UIXEnumSchema((short)84, "EmbossDirection", typeof(EmbossDirection), false); - UIXLoadResultExports.FlipDirectionType = (TypeSchema)new UIXEnumSchema((short)89, "FlipDirection", typeof(FlipDirection), true); - UIXLoadResultExports.FocusChangeReasonType = (TypeSchema)new UIXEnumSchema((short)91, "FocusChangeReason", typeof(FocusChangeReason), true); - UIXLoadResultExports.FontStylesType = (TypeSchema)new UIXEnumSchema((short)94, "FontStyles", typeof(FontStyles), true); - UIXLoadResultExports.GaussianBlurModeType = (TypeSchema)new UIXEnumSchema((short)96, "GaussianBlurMode", typeof(GaussianBlurMode), false); - UIXLoadResultExports.GraphicsDeviceTypeType = (TypeSchema)new UIXEnumSchema((short)98, "GraphicsDeviceType", typeof(RenderingType), false); - UIXLoadResultExports.HostStatusType = (TypeSchema)new UIXEnumSchema((short)102, "HostStatus", typeof(HostStatus), false); - UIXLoadResultExports.ImageStatusType = (TypeSchema)new UIXEnumSchema((short)108, "ImageStatus", typeof(ImageStatus), false); - UIXLoadResultExports.InputHandlerModifiersType = (TypeSchema)new UIXEnumSchema((short)111, "InputHandlerModifiers", typeof(InputHandlerModifiers), true); - UIXLoadResultExports.InputHandlerStageType = (TypeSchema)new UIXEnumSchema((short)112, "InputHandlerStage", typeof(InputHandlerStage), true); - UIXLoadResultExports.InputHandlerTransitionType = (TypeSchema)new UIXEnumSchema((short)113, "InputHandlerTransition", typeof(InputHandlerTransition), false); - UIXLoadResultExports.InterestPointType = (TypeSchema)new UIXEnumSchema((short)118, "InterestPoint", typeof(InterestPoint), false); - UIXLoadResultExports.InterpolationTypeType = (TypeSchema)new UIXEnumSchema((short)122, "InterpolationType", typeof(InterpolationType), false); - UIXLoadResultExports.InvokePriorityType = (TypeSchema)new UIXEnumSchema((short)126, "InvokePriority", typeof(InvokePriority), false); - UIXLoadResultExports.KeyHandlerKeyType = (TypeSchema)new UIXEnumSchema((short)129, "KeyHandlerKey", typeof(KeyHandlerKey), false); - UIXLoadResultExports.KeyframeFilterType = (TypeSchema)new UIXEnumSchema((short)131, "KeyframeFilter", typeof(KeyframeFilter), false); - UIXLoadResultExports.LineAlignmentType = (TypeSchema)new UIXEnumSchema((short)137, "LineAlignment", typeof(LineAlignment), false); - UIXLoadResultExports.MaximizeModeType = (TypeSchema)new UIXEnumSchema((short)146, "MaximizeMode", typeof(MaximizeMode), false); - UIXLoadResultExports.MissingItemPolicyType = (TypeSchema)new UIXEnumSchema((short)148, "MissingItemPolicy", typeof(MissingItemPolicy), false); - UIXLoadResultExports.MouseTargetType = (TypeSchema)new UIXEnumSchema((short)149, "MouseTarget", typeof(MouseTarget), false); - UIXLoadResultExports.NavigationPoliciesType = (TypeSchema)new UIXEnumSchema((short)151, "NavigationPolicies", typeof(NavigationPolicies), true); - UIXLoadResultExports.OrientationType = (TypeSchema)new UIXEnumSchema((short)154, "Orientation", typeof(Orientation), false); - UIXLoadResultExports.RelativeEdgeType = (TypeSchema)new UIXEnumSchema((short)170, "RelativeEdge", typeof(RelativeEdge), false); - UIXLoadResultExports.RepeatPolicyType = (TypeSchema)new UIXEnumSchema((short)172, "RepeatPolicy", typeof(RepeatPolicy), false); - UIXLoadResultExports.SharedSizePolicyType = (TypeSchema)new UIXEnumSchema((short)191, "SharedSizePolicy", typeof(SharedSizePolicy), true); - UIXLoadResultExports.ShortcutHandlerCommandType = (TypeSchema)new UIXEnumSchema((short)193, "ShortcutHandlerCommand", typeof(ShortcutHandlerCommand), false); - UIXLoadResultExports.SizingPolicyType = (TypeSchema)new UIXEnumSchema((short)199, "SizingPolicy", typeof(SizingPolicy), false); - UIXLoadResultExports.SnapshotPolicyType = (TypeSchema)new UIXEnumSchema((short)200, "SnapshotPolicy", typeof(SnapshotPolicy), false); - UIXLoadResultExports.StackPriorityType = (TypeSchema)new UIXEnumSchema((short)206, "StackPriority", typeof(StackPriority), false); - UIXLoadResultExports.StretchingPolicyType = (TypeSchema)new UIXEnumSchema((short)207, "StretchingPolicy", typeof(StretchingPolicy), false); - UIXLoadResultExports.StripAlignmentType = (TypeSchema)new UIXEnumSchema((short)209, "StripAlignment", typeof(StripAlignment), false); - UIXLoadResultExports.SystemSoundEventType = (TypeSchema)new UIXEnumSchema((short)211, "SystemSoundEvent", typeof(SystemSoundEvent), false); - UIXLoadResultExports.TextBoundsType = (TypeSchema)new UIXEnumSchema((short)213, "TextBounds", typeof(TextBounds), true); - UIXLoadResultExports.TextSharpnessType = (TypeSchema)new UIXEnumSchema((short)219, "TextSharpness", typeof(TextSharpness), false); - UIXLoadResultExports.TransformAttributeType = (TypeSchema)new UIXEnumSchema((short)223, "TransformAttribute", typeof(TransformAttribute), false); - UIXLoadResultExports.WindowStateType = (TypeSchema)new UIXEnumSchema((short)242, "WindowState", typeof(Microsoft.Iris.WindowState), false); + UIXLoadResultExports.AccessibleRoleType = new UIXEnumSchema(1, "AccessibleRole", typeof(AccRole), false); + UIXLoadResultExports.AlignmentType = new UIXEnumSchema(3, "Alignment", typeof(Alignment), false); + UIXLoadResultExports.AlphaOperationType = new UIXEnumSchema(5, "AlphaOperation", typeof(AlphaOperation), false); + UIXLoadResultExports.AnimationEventTypeType = new UIXEnumSchema(10, "AnimationEventType", typeof(AnimationEventType), false); + UIXLoadResultExports.BeginDragPolicyType = new UIXEnumSchema(12, "BeginDragPolicy", typeof(BeginDragPolicy), false); + UIXLoadResultExports.ClickCountType = new UIXEnumSchema(31, "ClickCount", typeof(ClickCount), false); + UIXLoadResultExports.ClickTypeType = new UIXEnumSchema(33, "ClickType", typeof(ClickType), true); + UIXLoadResultExports.ColorOperationType = new UIXEnumSchema(38, "ColorOperation", typeof(ColorOperation), false); + UIXLoadResultExports.ColorSchemeType = new UIXEnumSchema(39, "ColorScheme", typeof(ColorScheme), false); + UIXLoadResultExports.ContentPositioningPolicyType = new UIXEnumSchema(41, "ContentPositioningPolicy", typeof(ContentPositioningPolicy), false); + UIXLoadResultExports.CursorType = new UIXEnumSchema(44, "Cursor", typeof(CursorID), false); + UIXLoadResultExports.DataQueryStatusType = new UIXEnumSchema(47, "DataQueryStatus", typeof(DataProviderQueryStatus), false); + UIXLoadResultExports.DebugLabelFormatType = new UIXEnumSchema(50, "DebugLabelFormat", typeof(DebugLabelFormat), false); + UIXLoadResultExports.DebugOutlineScopeType = new UIXEnumSchema(51, "DebugOutlineScope", typeof(DebugOutlineScope), false); + UIXLoadResultExports.DropActionType = new UIXEnumSchema(64, "DropAction", typeof(DropAction), true); + UIXLoadResultExports.EmbossDirectionType = new UIXEnumSchema(84, "EmbossDirection", typeof(EmbossDirection), false); + UIXLoadResultExports.FlipDirectionType = new UIXEnumSchema(89, "FlipDirection", typeof(FlipDirection), true); + UIXLoadResultExports.FocusChangeReasonType = new UIXEnumSchema(91, "FocusChangeReason", typeof(FocusChangeReason), true); + UIXLoadResultExports.FontStylesType = new UIXEnumSchema(94, "FontStyles", typeof(FontStyles), true); + UIXLoadResultExports.GaussianBlurModeType = new UIXEnumSchema(96, "GaussianBlurMode", typeof(GaussianBlurMode), false); + UIXLoadResultExports.GraphicsDeviceTypeType = new UIXEnumSchema(98, "GraphicsDeviceType", typeof(RenderingType), false); + UIXLoadResultExports.HostStatusType = new UIXEnumSchema(102, "HostStatus", typeof(HostStatus), false); + UIXLoadResultExports.ImageStatusType = new UIXEnumSchema(108, "ImageStatus", typeof(ImageStatus), false); + UIXLoadResultExports.InputHandlerModifiersType = new UIXEnumSchema(111, "InputHandlerModifiers", typeof(InputHandlerModifiers), true); + UIXLoadResultExports.InputHandlerStageType = new UIXEnumSchema(112, "InputHandlerStage", typeof(InputHandlerStage), true); + UIXLoadResultExports.InputHandlerTransitionType = new UIXEnumSchema(113, "InputHandlerTransition", typeof(InputHandlerTransition), false); + UIXLoadResultExports.InterestPointType = new UIXEnumSchema(118, "InterestPoint", typeof(InterestPoint), false); + UIXLoadResultExports.InterpolationTypeType = new UIXEnumSchema(122, "InterpolationType", typeof(InterpolationType), false); + UIXLoadResultExports.InvokePriorityType = new UIXEnumSchema(126, "InvokePriority", typeof(InvokePriority), false); + UIXLoadResultExports.KeyHandlerKeyType = new UIXEnumSchema(129, "KeyHandlerKey", typeof(KeyHandlerKey), false); + UIXLoadResultExports.KeyframeFilterType = new UIXEnumSchema(131, "KeyframeFilter", typeof(KeyframeFilter), false); + UIXLoadResultExports.LineAlignmentType = new UIXEnumSchema(137, "LineAlignment", typeof(LineAlignment), false); + UIXLoadResultExports.MaximizeModeType = new UIXEnumSchema(146, "MaximizeMode", typeof(MaximizeMode), false); + UIXLoadResultExports.MissingItemPolicyType = new UIXEnumSchema(148, "MissingItemPolicy", typeof(MissingItemPolicy), false); + UIXLoadResultExports.MouseTargetType = new UIXEnumSchema(149, "MouseTarget", typeof(MouseTarget), false); + UIXLoadResultExports.NavigationPoliciesType = new UIXEnumSchema(151, "NavigationPolicies", typeof(NavigationPolicies), true); + UIXLoadResultExports.OrientationType = new UIXEnumSchema(154, "Orientation", typeof(Orientation), false); + UIXLoadResultExports.RelativeEdgeType = new UIXEnumSchema(170, "RelativeEdge", typeof(RelativeEdge), false); + UIXLoadResultExports.RepeatPolicyType = new UIXEnumSchema(172, "RepeatPolicy", typeof(RepeatPolicy), false); + UIXLoadResultExports.SharedSizePolicyType = new UIXEnumSchema(191, "SharedSizePolicy", typeof(SharedSizePolicy), true); + UIXLoadResultExports.ShortcutHandlerCommandType = new UIXEnumSchema(193, "ShortcutHandlerCommand", typeof(ShortcutHandlerCommand), false); + UIXLoadResultExports.SizingPolicyType = new UIXEnumSchema(199, "SizingPolicy", typeof(SizingPolicy), false); + UIXLoadResultExports.SnapshotPolicyType = new UIXEnumSchema(200, "SnapshotPolicy", typeof(SnapshotPolicy), false); + UIXLoadResultExports.StackPriorityType = new UIXEnumSchema(206, "StackPriority", typeof(StackPriority), false); + UIXLoadResultExports.StretchingPolicyType = new UIXEnumSchema(207, "StretchingPolicy", typeof(StretchingPolicy), false); + UIXLoadResultExports.StripAlignmentType = new UIXEnumSchema(209, "StripAlignment", typeof(StripAlignment), false); + UIXLoadResultExports.SystemSoundEventType = new UIXEnumSchema(211, "SystemSoundEvent", typeof(SystemSoundEvent), false); + UIXLoadResultExports.TextBoundsType = new UIXEnumSchema(213, "TextBounds", typeof(TextBounds), true); + UIXLoadResultExports.TextSharpnessType = new UIXEnumSchema(219, "TextSharpness", typeof(TextSharpness), false); + UIXLoadResultExports.TransformAttributeType = new UIXEnumSchema(223, "TransformAttribute", typeof(TransformAttribute), false); + UIXLoadResultExports.WindowStateType = new UIXEnumSchema(242, "WindowState", typeof(Microsoft.Iris.WindowState), false); AccessibleSchema.Pass1Initialize(); AliasSchema.Pass1Initialize(); AlphaKeyframeSchema.Pass1Initialize(); diff --git a/UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs b/UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs index 4684836..c5e01e2 100644 --- a/UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs +++ b/UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Markup short baseTypeID, Type instanceType, UIXTypeFlags flags) - : base((LoadResult)MarkupSystem.UIXGlobal) + : base(MarkupSystem.UIXGlobal) { this._typeID = typeID; this._baseTypeID = baseTypeID; @@ -47,7 +47,7 @@ namespace Microsoft.Iris.Markup this._alternateName = alternateName; this._instanceType = instanceType; this._flags = flags; - UIXTypes.RegisterTypeForID(typeID, (TypeSchema)this); + UIXTypes.RegisterTypeForID(typeID, this); } public void Initialize( @@ -90,13 +90,13 @@ namespace Microsoft.Iris.Markup { base.OnDispose(); foreach (DisposableObject constructor in this._constructors) - constructor.Dispose((object)this); + constructor.Dispose(this); foreach (DisposableObject property in this._properties) - property.Dispose((object)this); + property.Dispose(this); foreach (DisposableObject method in this._methods) - method.Dispose((object)this); + method.Dispose(this); foreach (DisposableObject disposableObject in this._events) - disposableObject.Dispose((object)this); + disposableObject.Dispose(this); } public override string Name => this._name; @@ -107,7 +107,7 @@ namespace Microsoft.Iris.Markup { get { - if (this._baseTypeID != (short)-1 && this._baseType == null) + if (this._baseTypeID != -1 && this._baseType == null) this._baseType = UIXTypes.MapIDToType(this._baseTypeID); return this._baseType; } @@ -156,7 +156,7 @@ namespace Microsoft.Iris.Markup return constructor; } } - return (ConstructorSchema)null; + return null; } public override PropertySchema FindProperty(string name) @@ -167,7 +167,7 @@ namespace Microsoft.Iris.Markup if (name == property.Name) return property; } - return (PropertySchema)null; + return null; } public override ConstructorSchema[] Constructors => this._constructors; @@ -202,7 +202,7 @@ namespace Microsoft.Iris.Markup } } } - return (MethodSchema)null; + return null; } public override EventSchema FindEvent(string name) @@ -213,10 +213,10 @@ namespace Microsoft.Iris.Markup if (name == eventSchema.Name) return eventSchema; } - return (EventSchema)null; + return null; } - public override object FindCanonicalInstance(string name) => this._findCanonicalInstance != null ? this._findCanonicalInstance(name) : (object)null; + public override object FindCanonicalInstance(string name) => this._findCanonicalInstance != null ? this._findCanonicalInstance(name) : null; public override Result TypeConverter( object from, @@ -234,11 +234,11 @@ namespace Microsoft.Iris.Markup public override bool SupportsBinaryEncoding => this._encodeBinary != null; - public override int FindTypeHint => (int)this._typeID; + public override int FindTypeHint => _typeID; public override object PerformOperation(object left, object right, OperationType op) { - object obj = (object)null; + object obj = null; if (this._performOperation != null) obj = this._performOperation(left, right, op); return obj; diff --git a/UIX/Microsoft/Iris/Markup/UIXTypes.cs b/UIX/Microsoft/Iris/Markup/UIXTypes.cs index 5f9cc48..23a558a 100644 --- a/UIX/Microsoft/Iris/Markup/UIXTypes.cs +++ b/UIX/Microsoft/Iris/Markup/UIXTypes.cs @@ -8,7 +8,7 @@ namespace Microsoft.Iris.Markup { internal static class UIXTypes { - public static TypeSchema MapIDToType(short ID) => ID != (short)-1 ? UIXLoadResultExports.ExportTable[(int)ID] : (TypeSchema)null; + public static TypeSchema MapIDToType(short ID) => ID != -1 ? UIXLoadResultExports.ExportTable[ID] : null; public static TypeSchema[] MapIDsToTypes(short[] IDs) { @@ -21,11 +21,11 @@ namespace Microsoft.Iris.Markup { typeSchemaArray = new TypeSchema[IDs.Length]; for (int index = 0; index < IDs.Length; ++index) - typeSchemaArray[index] = UIXLoadResultExports.ExportTable[(int)IDs[index]]; + typeSchemaArray[index] = UIXLoadResultExports.ExportTable[IDs[index]]; } return typeSchemaArray; } - public static void RegisterTypeForID(short ID, TypeSchema type) => UIXLoadResultExports.ExportTable[(int)ID] = type; + public static void RegisterTypeForID(short ID, TypeSchema type) => UIXLoadResultExports.ExportTable[ID] = type; } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/TypeRestriction.cs b/UIX/Microsoft/Iris/Markup/Validation/TypeRestriction.cs index 26dd78f..d05b6cc 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/TypeRestriction.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/TypeRestriction.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Markup.Validation public static TypeRestriction NotVoid; public TypeRestriction(TypeSchema primary) - : this(primary, (TypeSchema)null) + : this(primary, null) { } @@ -35,8 +35,8 @@ namespace Microsoft.Iris.Markup.Validation public static void InitializeStatics() { - TypeRestriction.None = new TypeRestriction((TypeSchema)null, (TypeSchema)null, true); - TypeRestriction.NotVoid = new TypeRestriction((TypeSchema)VoidSchema.Type, (TypeSchema)null, false); + TypeRestriction.None = new TypeRestriction(null, null, true); + TypeRestriction.NotVoid = new TypeRestriction(VoidSchema.Type, null, false); } public TypeSchema Primary => this._primary; @@ -56,8 +56,8 @@ namespace Microsoft.Iris.Markup.Validation string str2 = this._primary.Name; if (str1 == str2) { - str1 = str1 + " (" + (object)checkType.Owner + ")"; - str2 = str2 + " (" + (object)this._primary.Owner + ")"; + str1 = str1 + " (" + checkType.Owner + ")"; + str2 = str2 + " (" + _primary.Owner + ")"; } subject.ReportError(errorMessage, str1, str2); return false; diff --git a/UIX/Microsoft/Iris/Markup/Validation/Validate.cs b/UIX/Microsoft/Iris/Markup/Validation/Validate.cs index 99e1e45..c492d39 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/Validate.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/Validate.cs @@ -59,14 +59,14 @@ namespace Microsoft.Iris.Markup.Validation string param2, string param3) { - this.ReportError(string.Format(error, (object)param0, (object)param1, (object)param2, (object)param3)); + this.ReportError(string.Format(error, param0, param1, param2, param3)); } - public void ReportError(string error, string param0, string param1, string param2) => this.ReportError(string.Format(error, (object)param0, (object)param1, (object)param2)); + public void ReportError(string error, string param0, string param1, string param2) => this.ReportError(string.Format(error, param0, param1, param2)); - public void ReportError(string error, string param0, string param1) => this.ReportError(string.Format(error, (object)param0, (object)param1)); + public void ReportError(string error, string param0, string param1) => this.ReportError(string.Format(error, param0, param1)); - public void ReportError(string error, string param0) => this.ReportError(string.Format(error, (object)param0)); + public void ReportError(string error, string param0) => this.ReportError(string.Format(error, param0)); public void ReportError(string error) { diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateAlias.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateAlias.cs index 51bacaf..49d0e21 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateAlias.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateAlias.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Markup.Validation this._currentValidationPass = currentPass; if (this._currentValidationPass == LoadPass.DeclareTypes) { - ValidateContext context = new ValidateContext((ValidateClass)null, (MarkupTypeSchema)null, this._currentValidationPass); + ValidateContext context = new ValidateContext(null, null, this._currentValidationPass); this.Validate(TypeRestriction.None, context); this._aliasName = this.GetInlinePropertyValueNoValidate("Name"); string propertyValueNoValidate = this.GetInlinePropertyValueNoValidate("Type"); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateClass.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateClass.cs index f014c82..5e51a7c 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateClass.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateClass.cs @@ -29,7 +29,7 @@ namespace Microsoft.Iris.Markup.Validation private string _previewName; private static Map s_classReservedSymbols = new Map(1); - public static void InitializeStatics() => ValidateClass.s_classReservedSymbols["Class"] = (TypeSchema)ClassStateSchema.Type; + public static void InitializeStatics() => ValidateClass.s_classReservedSymbols["Class"] = ClassStateSchema.Type; public ValidateClass( SourceMarkupLoader owner, @@ -94,9 +94,9 @@ namespace Microsoft.Iris.Markup.Validation { if (this.Owner.IsTypeNameTaken(this.PreviewName)) this.ReportError("Type '{0}' was specified more than once", this.PreviewName); - this._typeExport = MarkupTypeSchema.Build(this.ObjectType, (MarkupLoadResult)this.Owner.LoadResultTarget, this.PreviewName); + this._typeExport = MarkupTypeSchema.Build(this.ObjectType, Owner.LoadResultTarget, this.PreviewName); this._typeExportIndex = this.Owner.RegisterExportedType(this._typeExport); - this._typeExport.LoadData = (object)this; + this._typeExport.LoadData = this; } } @@ -130,7 +130,7 @@ namespace Microsoft.Iris.Markup.Validation if (!this.HasErrors) { bool flag = false; - for (TypeSchema typeSchema = (TypeSchema)foundType; typeSchema is MarkupTypeSchema; typeSchema = typeSchema.Base) + for (TypeSchema typeSchema = foundType; typeSchema is MarkupTypeSchema; typeSchema = typeSchema.Base) { if (typeSchema == this._typeExport) { @@ -171,7 +171,7 @@ namespace Microsoft.Iris.Markup.Validation ValidateProperty property2 = this.FindProperty("Shared", true); if (property2 != null) { - property2.Validate((ValidateObjectTag)this, context); + property2.Validate(this, context); if (property2.HasErrors) this.MarkHasErrors(); else if (property2.IsFromStringValue) @@ -219,7 +219,7 @@ namespace Microsoft.Iris.Markup.Validation else if (this._typeExport != null) { MarkupPropertySchema propertyExport = MarkupPropertySchema.Build(this.ObjectType, this._typeExport, propertyValueNoValidate, next.ObjectType); - properties[length2] = (PropertySchema)propertyExport; + properties[length2] = propertyExport; ++length2; next.PropertySchemaExport = propertyExport; propertyExport.SetRequiredForCreation(next.PropertyIsRequiredForCreation); @@ -230,7 +230,7 @@ namespace Microsoft.Iris.Markup.Validation if (length2 != properties.Length) { PropertySchema[] propertySchemaArray = new PropertySchema[length2]; - Array.Copy((Array)properties, (Array)propertySchemaArray, length2); + Array.Copy(properties, propertySchemaArray, length2); properties = propertySchemaArray; } if (this._typeExport != null) @@ -296,7 +296,7 @@ namespace Microsoft.Iris.Markup.Validation return; MethodSchema[] virtualMethods = new MethodSchema[this._foundVirtualMethods.Count]; for (int index = 0; index < virtualMethods.Length; ++index) - virtualMethods[index] = (MethodSchema)this._foundVirtualMethods[index]; + virtualMethods[index] = this._foundVirtualMethods[index]; this._typeExport.SetVirtualMethodList(virtualMethods); } @@ -318,7 +318,7 @@ namespace Microsoft.Iris.Markup.Validation foreach (SymbolRecord symbolRecord in typeExport.InheritableSymbolsTable) { if (symbolRecord.SymbolOrigin == SymbolOrigin.Locals || symbolRecord.SymbolOrigin == SymbolOrigin.Properties) - map[(object)symbolRecord.Name] = (object)null; + map[symbolRecord.Name] = null; } } } @@ -377,7 +377,7 @@ namespace Microsoft.Iris.Markup.Validation public Vector ActionList => this._actionList; - public ArrayList MethodList => this._foundMethods == null ? (ArrayList)null : this._foundMethods.Methods; + public ArrayList MethodList => this._foundMethods == null ? null : this._foundMethods.Methods; public string PreviewName => this._previewName; @@ -387,6 +387,6 @@ namespace Microsoft.Iris.Markup.Validation public ValidateProperty FoundPropertiesValidateProperty => this._foundPropertiesValidateProperty; - public override string ToString() => this.Name != null ? string.Format("ClassTag : {0}", (object)this.Name) : "Not validated :" + this._previewName; + public override string ToString() => this.Name != null ? string.Format("ClassTag : {0}", Name) : "Not validated :" + this._previewName; } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateCode.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateCode.cs index 6663491..364b9a4 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateCode.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateCode.cs @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Markup.Validation ValidateStatementReturn returnStatement = this._returnStatements[index]; if (returnStatement.HasErrors) return; - TypeSchema type = (TypeSchema)VoidSchema.Type; + TypeSchema type = VoidSchema.Type; ValidateExpression expression = returnStatement.Expression; if (expression != null) type = expression.ObjectType; @@ -65,15 +65,15 @@ namespace Microsoft.Iris.Markup.Validation } } else - this._returnType = (TypeSchema)VoidSchema.Type; + this._returnType = VoidSchema.Type; string errorMessage = "'{0}' cannot be used in this context (expecting types compatible with '{1}')"; if (typeRestriction.Primary == VoidSchema.Type && typeRestriction.Secondary == null) errorMessage = "Return values are not supported for this code block (currently returning '{0}')"; else if (this._returnStatements.Count == 0) errorMessage = "Code block must have at least one return statement of type '{0}'"; - if (!typeRestriction.Check((ValidateObject)this, errorMessage, this._returnType)) + if (!typeRestriction.Check(this, errorMessage, this._returnType)) return; - ValidateStatementReturn validateStatementReturn = (ValidateStatementReturn)null; + ValidateStatementReturn validateStatementReturn = null; ValidateStatement validateStatement = this._statementCompound.StatementList; if (validateStatement != null) { @@ -152,7 +152,7 @@ namespace Microsoft.Iris.Markup.Validation public ValidateCode Next { get => (ValidateCode)base.Next; - set => base.Next = (ValidateObject)value; + set => base.Next = value; } } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateContext.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateContext.cs index 378a3b6..9299032 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateContext.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateContext.cs @@ -92,7 +92,7 @@ namespace Microsoft.Iris.Markup.Validation out ExpressionRestriction expressionRestriction, out TypeSchema baseTypeOrigin) { - baseTypeOrigin = (TypeSchema)null; + baseTypeOrigin = null; TypeSchema type = this.ResolveSymbol(this._symbolTable, name, out origin, out expressionRestriction); if (type == null && searchBaseTypes) { @@ -104,7 +104,7 @@ namespace Microsoft.Iris.Markup.Validation type = this.ResolveSymbol(markupTypeSchema.InheritableSymbolsTable, name, out origin, out expressionRestriction); if (type != null) { - baseTypeOrigin = (TypeSchema)markupTypeSchema; + baseTypeOrigin = markupTypeSchema; break; } } @@ -119,7 +119,7 @@ namespace Microsoft.Iris.Markup.Validation } if (type == null && name == "this" && this._owner.ObjectType == ClassSchema.Type) { - type = (TypeSchema)this._owner.TypeExport; + type = _owner.TypeExport; origin = SymbolOrigin.Reserved; expressionRestriction = ExpressionRestriction.ReadOnly; } @@ -155,7 +155,7 @@ namespace Microsoft.Iris.Markup.Validation } origin = SymbolOrigin.None; expressionRestriction = ExpressionRestriction.None; - return (TypeSchema)null; + return null; } private TypeSchema ResolveSymbol( @@ -185,7 +185,7 @@ namespace Microsoft.Iris.Markup.Validation } origin = SymbolOrigin.None; expressionRestriction = ExpressionRestriction.None; - return (TypeSchema)null; + return null; } public void DeclareReservedSymbols(Map reservedSymbols) @@ -216,7 +216,7 @@ namespace Microsoft.Iris.Markup.Validation string name3 = name2 + "Instance"; typeSchema1 = MarkupSystem.UIXGlobal.FindType(name3); if (typeSchema1 == null) - result = Result.Fail(string.Format("Element '{0}' has no properties that can be changed dynamically and therefore cannot be named", (object)name2)); + result = Result.Fail(string.Format("Element '{0}' has no properties that can be changed dynamically and therefore cannot be named", name2)); else this._owner.Owner.TrackImportedType(typeSchema1); } @@ -230,7 +230,7 @@ namespace Microsoft.Iris.Markup.Validation if (this._currentScope == SymbolOrigin.Properties && origin == SymbolOrigin.Properties) { if (!typeSchema2.IsAssignableFrom(typeSchema1)) - result = Result.Fail(string.Format("Property '{0}' exists in base class '{1}' with type '{2}' and type override '{3}' does not match", (object)name1, (object)baseTypeOrigin.Name, (object)typeSchema2.Name, (object)typeSchema1.Name)); + result = Result.Fail(string.Format("Property '{0}' exists in base class '{1}' with type '{2}' and type override '{3}' does not match", name1, baseTypeOrigin.Name, typeSchema2.Name, typeSchema1.Name)); else if (objectTag.PropertyOverrideCriteria != null) { MarkupPropertySchema propertyDeep = (MarkupPropertySchema)this._baseType.FindPropertyDeep(objectTag.Name); @@ -240,20 +240,20 @@ namespace Microsoft.Iris.Markup.Validation else if (this._currentScope != SymbolOrigin.Content || origin != SymbolOrigin.Content) { if (this._currentScope == origin) - result = Result.Fail("Name \"{0}\" (also defined in base class '{1}') cannot be overridden (tried to override {2}, but can only override Properties and Content)", (object)name1, (object)baseTypeOrigin.Name, (object)origin.ToString()); + result = Result.Fail("Name \"{0}\" (also defined in base class '{1}') cannot be overridden (tried to override {2}, but can only override Properties and Content)", name1, baseTypeOrigin.Name, origin.ToString()); else - result = Result.Fail(string.Format("Name \"{0}\" (located in {1}) cannot override the same name within base class '{2}' (located in {3}) since overrides cannot cross section types", (object)name1, (object)this._currentScope.ToString(), (object)baseTypeOrigin.Name, (object)origin.ToString())); + result = Result.Fail(string.Format("Name \"{0}\" (located in {1}) cannot override the same name within base class '{2}' (located in {3}) since overrides cannot cross section types", name1, this._currentScope.ToString(), baseTypeOrigin.Name, origin.ToString())); } } else if (origin != SymbolOrigin.Reserved) - result = Result.Fail("Name \"{0}\" is already in use (type '{1}') located in '{2}'", (object)name1, (object)typeSchema2.Name, (object)origin.ToString()); + result = Result.Fail("Name \"{0}\" is already in use (type '{1}') located in '{2}'", name1, typeSchema2.Name, origin.ToString()); } if (!result.Failed) { if (this.IsNameReserved(name1)) - result = Result.Fail("Name \"{0}\" is reserved and cannot be used.", (object)name1); + result = Result.Fail("Name \"{0}\" is reserved and cannot be used.", name1); else if (!ValidateContext.IsValidSymbolName(name1)) - result = Result.Fail("Invalid name \"{0}\". Valid names must begin with either an alphabetic character or an underscore and can otherwise contain only alphabetic, numeric, or underscore characters", (object)name1); + result = Result.Fail("Invalid name \"{0}\". Valid names must begin with either an alphabetic character or an underscore and can otherwise contain only alphabetic, numeric, or underscore characters", name1); } if (!result.Failed && typeSchema1 != null) this._symbolTable.Add(new SymbolRecord() @@ -360,7 +360,7 @@ namespace Microsoft.Iris.Markup.Validation foreach (SymbolRecord methodParameterRecord in this._methodParameterRecords) this._symbolTable.Remove(methodParameterRecord); this._methodParameterRecords.Clear(); - this._currentMethod = (ValidateMethod)null; + this._currentMethod = null; } public Result NotifyMethodFound(string name) @@ -371,7 +371,7 @@ namespace Microsoft.Iris.Markup.Validation this._symbolTable.Add(new SymbolRecord() { Name = name, - Type = (TypeSchema)null, + Type = null, SymbolOrigin = SymbolOrigin.Methods }); return Result.Success; @@ -409,27 +409,27 @@ namespace Microsoft.Iris.Markup.Validation SymbolOrigin origin; TypeSchema typeSchema = this.ResolveSymbol(name, out origin, out ExpressionRestriction _); if (typeSchema != null) - return Result.Fail("Name \"{0}\" is already in use (type '{1}') located in '{2}'", (object)name, (object)typeSchema.Name, (object)origin.ToString()); + return Result.Fail("Name \"{0}\" is already in use (type '{1}') located in '{2}'", name, typeSchema.Name, origin.ToString()); if (!bypassReservedNameCheck) { if (this.IsNameReserved(name)) - return Result.Fail("Name \"{0}\" is reserved and cannot be used.", (object)name); + return Result.Fail("Name \"{0}\" is reserved and cannot be used.", name); if (!ValidateContext.IsValidSymbolName(name)) - return Result.Fail("Invalid name \"{0}\". Valid names must begin with either an alphabetic character or an underscore and can otherwise contain only alphabetic, numeric, or underscore characters", (object)name); + return Result.Fail("Invalid name \"{0}\". Valid names must begin with either an alphabetic character or an underscore and can otherwise contain only alphabetic, numeric, or underscore characters", name); } return Result.Success; } public void NotifyScopedLocalFrameEnter(ValidateStatementLoop statementLoop) { - this._scopedLocalFrameStack.Add((Vector)null); + this._scopedLocalFrameStack.Add(null); if (statementLoop == null) return; this._loopFramesStack.Push(this._scopedLocalFrameStack.Count); this._loopStatementStack.Push(statementLoop); } - public void NotifyScopedLocalFrameEnter() => this.NotifyScopedLocalFrameEnter((ValidateStatementLoop)null); + public void NotifyScopedLocalFrameEnter() => this.NotifyScopedLocalFrameEnter(null); public Result NotifyScopedLocal(string name, TypeSchema type) => this.NotifyScopedLocal(name, type, false, SymbolOrigin.ScopedLocal); @@ -467,7 +467,7 @@ namespace Microsoft.Iris.Markup.Validation } Vector scopedLocalFrame = this._scopedLocalFrameStack[this._scopedLocalFrameStack.Count - 1]; this._scopedLocalFrameStack.RemoveAt(this._scopedLocalFrameStack.Count - 1); - Vector vector = (Vector)null; + Vector vector = null; if (scopedLocalFrame != null) { vector = new Vector(); @@ -479,12 +479,12 @@ namespace Microsoft.Iris.Markup.Validation vector.Add(num); } } - return vector == null || vector.Count <= 0 ? (Vector)null : vector; + return vector == null || vector.Count <= 0 ? null : vector; } private Vector GetImmediateFrameUnwindList(SourceMarkupLoader owner, bool stopAtLoop) { - Vector vector = (Vector)null; + Vector vector = null; int num1 = stopAtLoop ? this._loopFramesStack.Peek() : 0; for (int index = this._scopedLocalFrameStack.Count - 1; index >= num1; --index) { @@ -501,14 +501,14 @@ namespace Microsoft.Iris.Markup.Validation } } } - return vector == null || vector.Count <= 0 ? (Vector)null : vector; + return vector == null || vector.Count <= 0 ? null : vector; } public Vector GetImmediateFrameUnwindList(SourceMarkupLoader owner) => this.GetImmediateFrameUnwindList(owner, false); public Vector GetLoopUnwindList(SourceMarkupLoader owner) => this.GetImmediateFrameUnwindList(owner, true); - public ValidateStatementLoop EnclosingLoop => this._loopStatementStack.Count <= 0 ? (ValidateStatementLoop)null : this._loopStatementStack.Peek(); + public ValidateStatementLoop EnclosingLoop => this._loopStatementStack.Count <= 0 ? null : this._loopStatementStack.Peek(); public int TrackSymbolUsage(string symbol, SymbolOrigin origin) { @@ -553,7 +553,7 @@ namespace Microsoft.Iris.Markup.Validation public Vector StopDeclaredTriggerTracking() { Vector triggerTrackingList = this._declaredTriggerTrackingList; - this._declaredTriggerTrackingList = (Vector)null; + this._declaredTriggerTrackingList = null; return triggerTrackingList; } @@ -573,7 +573,7 @@ namespace Microsoft.Iris.Markup.Validation } else flag = false; - this._notifierTrackingRoot = (ValidateExpression)null; + this._notifierTrackingRoot = null; return flag; } @@ -589,7 +589,7 @@ namespace Microsoft.Iris.Markup.Validation public Vector TriggerList => this._triggerList; - public PropertySchema GetActivePropertyScope() => this._propertyScopeStack.Count == 0 ? (PropertySchema)null : this._propertyScopeStack.Peek().property; + public PropertySchema GetActivePropertyScope() => this._propertyScopeStack.Count == 0 ? null : this._propertyScopeStack.Peek().property; public NameUsage GetActiveNameUsage() { diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateDataMapping.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateDataMapping.cs index 9066e38..9d83131 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateDataMapping.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateDataMapping.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Markup.Validation if (this._currentValidationPass >= currentPass) return; this._currentValidationPass = currentPass; - ValidateContext context = new ValidateContext((ValidateClass)null, (MarkupTypeSchema)null, this._currentValidationPass); + ValidateContext context = new ValidateContext(null, null, this._currentValidationPass); this.Validate(TypeRestriction.None, context); if (this._currentValidationPass != LoadPass.Full) return; @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Markup.Validation case MarkupDataTypeSchema _: markupDataTypeSchema = (MarkupDataTypeSchema)typeSchemaProperty; string stringProperty1 = this.ExtractStringProperty("Provider", true); - MarkupDataMappingEntry[] mappingEntries = (MarkupDataMappingEntry[])null; + MarkupDataMappingEntry[] mappingEntries = null; ValidateProperty property = this.FindProperty("Mappings"); if (property != null && property.IsObjectTagValue) { @@ -63,7 +63,7 @@ namespace Microsoft.Iris.Markup.Validation dataMappingEntry.Property = propertyDeep; dataMappingEntry.Source = stringProperty3; dataMappingEntry.Target = stringProperty4; - dataMappingEntry.DefaultValue = ValidateDataMapping.ConvertDefaultValue((Microsoft.Iris.Markup.Validation.Validate)this, propertyDeep.PropertyType, stringProperty5); + dataMappingEntry.DefaultValue = ValidateDataMapping.ConvertDefaultValue(this, propertyDeep.PropertyType, stringProperty5); if (!entries.ContainsKey(stringProperty2)) entries[stringProperty2] = dataMappingEntry; else @@ -75,11 +75,11 @@ namespace Microsoft.Iris.Markup.Validation } mappingEntries = MarkupDataProvider.FillInDefaultMappings(markupDataTypeSchema, entries); foreach (MarkupDataMappingEntry dataMappingEntry in mappingEntries) - this.Owner.TrackImportedProperty((PropertySchema)dataMappingEntry.Property); + this.Owner.TrackImportedProperty(dataMappingEntry.Property); } if (stringProperty1 == null || markupDataTypeSchema == null) break; - ValidateDataMapping.AddDataMappingProviderList(ref this._foundDataMappingSet, (MarkupLoadResult)this.Owner.LoadResultTarget, this.Name, markupDataTypeSchema, stringProperty1, mappingEntries); + ValidateDataMapping.AddDataMappingProviderList(ref this._foundDataMappingSet, Owner.LoadResultTarget, this.Name, markupDataTypeSchema, stringProperty1, mappingEntries); break; default: this.ReportError("TargetType for DataMapping must be a markup-defined DataType, {0} is not valid", typeSchemaProperty.Name); @@ -131,12 +131,12 @@ namespace Microsoft.Iris.Markup.Validation TypeSchema type, string valueString) { - object instance = (object)null; + object instance = null; if (valueString != null) { - if (type.SupportsTypeConversion((TypeSchema)StringSchema.Type)) + if (type.SupportsTypeConversion(StringSchema.Type)) { - Result result = type.TypeConverter((object)valueString, (TypeSchema)StringSchema.Type, out instance); + Result result = type.TypeConverter(valueString, StringSchema.Type, out instance); if (result.Failed) validate.ReportError(result.Error); } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateDataQuery.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateDataQuery.cs index d1df363..73aa291 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateDataQuery.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateDataQuery.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.Markup.Validation MarkupPropertySchema propertyExport) { string stringProperty = objectTag.ExtractStringProperty("DefaultValue", false); - object obj = ValidateDataMapping.ConvertDefaultValue((Validate)this, propertyExport.PropertyType, stringProperty); + object obj = ValidateDataMapping.ConvertDefaultValue(this, propertyExport.PropertyType, stringProperty); ((MarkupDataQueryPropertySchema)propertyExport).DefaultValue = obj; bool flag; if (objectTag.ExtractBooleanProperty("InvalidatesQuery", context, false, out flag)) diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateDataType.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateDataType.cs index fc70dc7..46eba69 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateDataType.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateDataType.cs @@ -49,7 +49,7 @@ namespace Microsoft.Iris.Markup.Validation this._foundInlineMappings = new Map(); this._foundInlineMappings[propertyExport.Name] = new MarkupDataMappingEntry() { - DefaultValue = ValidateDataMapping.ConvertDefaultValue((Validate)this, propertyExport.PropertyType, stringProperty1), + DefaultValue = ValidateDataMapping.ConvertDefaultValue(this, propertyExport.PropertyType, stringProperty1), Source = stringProperty2, Target = stringProperty3, Property = (MarkupDataTypePropertySchema)propertyExport @@ -71,9 +71,9 @@ namespace Microsoft.Iris.Markup.Validation this._foundInlineMappings = new Map(); MarkupDataTypeSchema typeExport = (MarkupDataTypeSchema)this.TypeExport; MarkupDataMappingEntry[] mappingEntries = MarkupDataProvider.FillInDefaultMappings(typeExport, this._foundInlineMappings); - ValidateDataMapping.AddDataMappingProviderList(ref this._foundDataMappingSet, (MarkupLoadResult)this.Owner.LoadResultTarget, (string)null, typeExport, this._provider, mappingEntries); + ValidateDataMapping.AddDataMappingProviderList(ref this._foundDataMappingSet, Owner.LoadResultTarget, null, typeExport, this._provider, mappingEntries); foreach (MarkupDataMappingEntry dataMappingEntry in mappingEntries) - this.Owner.TrackImportedProperty((PropertySchema)dataMappingEntry.Property); + this.Owner.TrackImportedProperty(dataMappingEntry.Property); } public Vector FoundDataMappingSet => this._foundDataMappingSet; diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateEffect.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateEffect.cs index 6b36856..aa5c8fa 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateEffect.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateEffect.cs @@ -116,7 +116,7 @@ namespace Microsoft.Iris.Markup.Validation private string GetEffectElementName(ValidateExpressionCall call) { ValidateExpression target = call.Target; - return EffectElementInstanceSchema.Type.IsAssignableFrom(target.ObjectType) && target.ExpressionType == ExpressionType.Symbol ? ((ValidateExpressionSymbol)target).Symbol : (string)null; + return EffectElementInstanceSchema.Type.IsAssignableFrom(target.ObjectType) && target.ExpressionType == ExpressionType.Symbol ? ((ValidateExpressionSymbol)target).Symbol : null; } private void TrackDynamicElementAssignment(string elementName, string propertyName) => this.TrackDynamicElementAssignment(EffectElementWrapper.MakeEffectPropertyName(elementName, propertyName)); @@ -127,7 +127,7 @@ namespace Microsoft.Iris.Markup.Validation { if (this._foundDynamicElementAssignments == null) this._foundDynamicElementAssignments = new Dictionary(); - this._foundDynamicElementAssignments[dynamicPropertyName] = (object)null; + this._foundDynamicElementAssignments[dynamicPropertyName] = null; } public void TrackInstanceProperty( diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpression.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpression.cs index 5cd9806..ec5cd81 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpression.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpression.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Markup.Validation protected void DeclareEvaluationType(TypeSchema evaluationType, TypeRestriction typeRestriction) { - if (!typeRestriction.Check((ValidateObject)this, evaluationType)) + if (!typeRestriction.Check(this, evaluationType)) return; this._evaluationType = evaluationType; } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionBaseClass.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionBaseClass.cs index 7fd395c..8399618 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionBaseClass.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionBaseClass.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Markup.Validation this.ReportError("Expression cannot be used as the target an assignment (related symbol: '{0}')", "this"); if (context.CurrentMethod == null || !context.CurrentMethod.HasOverrideKeyword) this.ReportError("'base' keyword can only be used in an override method"); - this.DeclareEvaluationType((TypeSchema)context.Owner.TypeExport, TypeRestriction.None); + this.DeclareEvaluationType(context.Owner.TypeExport, TypeRestriction.None); } } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCall.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCall.cs index da1d598..3456d05 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCall.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCall.cs @@ -49,7 +49,7 @@ namespace Microsoft.Iris.Markup.Validation this._parameterList = parameterList; } - public ValidateExpression Target => !this._foundTargetIsStatic ? this._target : (ValidateExpression)null; + public ValidateExpression Target => !this._foundTargetIsStatic ? this._target : null; public string MemberName => this._memberName; @@ -153,7 +153,7 @@ namespace Microsoft.Iris.Markup.Validation this._foundMemberType = SchemaType.Event; this._foundMemberIndex = this.Owner.TrackImportedEvent(eventDeep); expressionRestriction = ExpressionRestriction.ReadOnly; - this.DeclareEvaluationType((TypeSchema)VoidSchema.Type, typeRestriction); + this.DeclareEvaluationType(VoidSchema.Type, typeRestriction); this.DeclareNotifies(context); } } @@ -212,15 +212,15 @@ namespace Microsoft.Iris.Markup.Validation private void ValidateBaseCall(TypeRestriction typeRestriction, ValidateContext context) { - MarkupMethodSchema markupMethodSchema = context.CurrentMethod != null ? context.CurrentMethod.FoundBaseMethod : (MarkupMethodSchema)null; + MarkupMethodSchema markupMethodSchema = context.CurrentMethod != null ? context.CurrentMethod.FoundBaseMethod : null; if (markupMethodSchema != null) { if (this._parameterList == null || this._memberName != markupMethodSchema.Name) this.ReportError("'base' keyword can only be used to call the base virtual method inside an override"); - else if (new MethodSignatureKey(markupMethodSchema.Name, markupMethodSchema.ParameterTypes).Equals((object)new MethodSignatureKey(this._memberName, this._foundParameterTypes))) + else if (new MethodSignatureKey(markupMethodSchema.Name, markupMethodSchema.ParameterTypes).Equals(new MethodSignatureKey(this._memberName, this._foundParameterTypes))) { this._foundMemberType = SchemaType.Method; - this._foundMemberIndex = this.Owner.TrackImportedMethod((MethodSchema)markupMethodSchema); + this._foundMemberIndex = this.Owner.TrackImportedMethod(markupMethodSchema); this.DeclareEvaluationType(markupMethodSchema.ReturnType, typeRestriction); } else @@ -244,7 +244,7 @@ namespace Microsoft.Iris.Markup.Validation ++length; } if (this.HasErrors) - return (TypeSchema[])null; + return null; typeSchemaArray = new TypeSchema[length]; int index = 0; for (ValidateParameter validateParameter = this._parameterList; validateParameter != null; validateParameter = validateParameter.Next) diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCast.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCast.cs index 0d9a6cc..5e9853a 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCast.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCast.cs @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Markup.Validation else { ValidateExpressionSymbol expressionSymbol = (ValidateExpressionSymbol)typeCastExpression; - this._typeCast = new ValidateTypeIdentifier(owner, (string)null, expressionSymbol.Symbol, expressionSymbol.Line, expressionSymbol.Column); + this._typeCast = new ValidateTypeIdentifier(owner, null, expressionSymbol.Symbol, expressionSymbol.Line, expressionSymbol.Column); } this._castee = castee; } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionConstant.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionConstant.cs index e67705e..b32676d 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionConstant.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionConstant.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.Markup.Validation int column) : base(owner, line, column, ExpressionType.Constant) { - this._constantInline = (string)null; + this._constantInline = null; this._constantType = ConstantType.Boolean; this._foundConstant = BooleanBoxes.Box(constantValue); } @@ -53,43 +53,43 @@ namespace Microsoft.Iris.Markup.Validation case ConstantType.String: int errorIndex; string invalidSequence; - this._foundConstant = (object)StringUtility.Unescape(this._constantInline, out errorIndex, out invalidSequence); + this._foundConstant = StringUtility.Unescape(this._constantInline, out errorIndex, out invalidSequence); if (this._foundConstant == null) - this.ReportErrorWithAdjustedPosition(string.Format("Invalid escape sequence '{0}' in string literal", (object)invalidSequence), 0, errorIndex + 1); - evaluationType = (TypeSchema)StringSchema.Type; + this.ReportErrorWithAdjustedPosition(string.Format("Invalid escape sequence '{0}' in string literal", invalidSequence), 0, errorIndex + 1); + evaluationType = StringSchema.Type; break; case ConstantType.StringLiteral: - this._foundConstant = (object)this._constantInline; + this._foundConstant = _constantInline; this._constantType = ConstantType.String; - evaluationType = (TypeSchema)StringSchema.Type; + evaluationType = StringSchema.Type; break; case ConstantType.Integer: - Result result1 = Int32Schema.Type.TypeConverter((object)this._constantInline, (TypeSchema)StringSchema.Type, out this._foundConstant); + Result result1 = Int32Schema.Type.TypeConverter(_constantInline, StringSchema.Type, out this._foundConstant); if (result1.Failed) this.ReportError(result1.Error); - evaluationType = (TypeSchema)Int32Schema.Type; + evaluationType = Int32Schema.Type; break; case ConstantType.LongInteger: - Result result2 = Int64Schema.Type.TypeConverter((object)this._constantInline, (TypeSchema)StringSchema.Type, out this._foundConstant); + Result result2 = Int64Schema.Type.TypeConverter(_constantInline, StringSchema.Type, out this._foundConstant); if (result2.Failed) this.ReportError(result2.Error); - evaluationType = (TypeSchema)Int64Schema.Type; + evaluationType = Int64Schema.Type; break; case ConstantType.Float: - Result result3 = SingleSchema.Type.TypeConverter((object)this._constantInline, (TypeSchema)StringSchema.Type, out this._foundConstant); + Result result3 = SingleSchema.Type.TypeConverter(_constantInline, StringSchema.Type, out this._foundConstant); if (result3.Failed) this.ReportError(result3.Error); - evaluationType = (TypeSchema)SingleSchema.Type; + evaluationType = SingleSchema.Type; break; case ConstantType.Boolean: - evaluationType = (TypeSchema)BooleanSchema.Type; + evaluationType = BooleanSchema.Type; break; case ConstantType.Null: - this._foundConstant = (object)null; - evaluationType = (TypeSchema)NullSchema.Type; + this._foundConstant = null; + evaluationType = NullSchema.Type; break; default: - evaluationType = (TypeSchema)null; + evaluationType = null; break; } this.DeclareEvaluationType(evaluationType, typeRestriction); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionDeclareTrigger.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionDeclareTrigger.cs index 1a8b7f0..694599a 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionDeclareTrigger.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionDeclareTrigger.cs @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Markup.Validation } finally { - ValidateExpressionDeclareTrigger.StopNotifierTracking((Microsoft.Iris.Markup.Validation.Validate)this, context, this._expression); + ValidateExpressionDeclareTrigger.StopNotifierTracking(this, context, this._expression); } if (this._expression.HasErrors) this.MarkHasErrors(); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIndex.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIndex.cs index a06ad1b..4c59653 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIndex.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIndex.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Markup.Validation this._index = index; } - public ValidateExpression CallExpression => (ValidateExpression)this._call; + public ValidateExpression CallExpression => _call; public override void Validate(TypeRestriction typeRestriction, ValidateContext context) { @@ -45,7 +45,7 @@ namespace Microsoft.Iris.Markup.Validation this._index.AppendToEnd(new ValidateParameter(this.Owner, this._assignmentValue, this._assignmentValue.Line, this._assignmentValue.Column)); this._call = new ValidateExpressionCall(this.Owner, this._indexee, "set_Item", this._index, this.Line, this.Column); this._call.SetAsIndexAssignment(); - this._call.Validate(new TypeRestriction((TypeSchema)VoidSchema.Type), context); + this._call.Validate(new TypeRestriction(VoidSchema.Type), context); if (this._call.HasErrors) this.MarkHasErrors(); else diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIsCheck.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIsCheck.cs index 09b342e..e54f3ff 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIsCheck.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIsCheck.cs @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Markup.Validation this._typeIdentifier.Validate(); if (this._typeIdentifier.HasErrors) this.MarkHasErrors(); - this.DeclareEvaluationType((TypeSchema)BooleanSchema.Type, typeRestriction); + this.DeclareEvaluationType(BooleanSchema.Type, typeRestriction); } } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionList.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionList.cs index e16a254..005d8e7 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionList.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionList.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Markup.Validation : base(owner, line, column, ExpressionType.List) => this._expressionList = new ArrayList(); - public void AppendToEnd(ValidateExpression expression) => this._expressionList.Add((object)expression); + public void AppendToEnd(ValidateExpression expression) => this._expressionList.Add(expression); public ArrayList Expressions => this._expressionList; @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Markup.Validation } } else - this.DeclareEvaluationType((TypeSchema)VoidSchema.Type, typeRestriction); + this.DeclareEvaluationType(VoidSchema.Type, typeRestriction); if (this.ObjectType == null) this.MarkHasErrors(); else diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionNew.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionNew.cs index 72d5610..9dff649 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionNew.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionNew.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.Markup.Validation : base(owner, line, column, ExpressionType.New) { if (parameterList == ValidateParameter.EmptyList) - parameterList = (ValidateParameter)null; + parameterList = null; this._constructType = constructType; this._parameterList = parameterList; } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionOperation.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionOperation.cs index 04a752b..7f7c6ff 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionOperation.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionOperation.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Markup.Validation private static string GetOperationToken(OperationType op) { - string str = (string)null; + string str = null; switch (op) { case OperationType.MathAdd: @@ -111,7 +111,7 @@ namespace Microsoft.Iris.Markup.Validation { if (this._leftSide.ObjectType == NullSchema.Type && this._rightSide.ObjectType.IsNullAssignable || this._rightSide.ObjectType == NullSchema.Type && this._leftSide.ObjectType.IsNullAssignable) { - this._foundOperationTargetType = (TypeSchema)NullSchema.Type; + this._foundOperationTargetType = NullSchema.Type; } else { @@ -150,7 +150,7 @@ namespace Microsoft.Iris.Markup.Validation case OperationType.RelationalGreaterThanEquals: case OperationType.RelationalIs: case OperationType.LogicalNot: - this.DeclareEvaluationType((TypeSchema)BooleanSchema.Type, typeRestriction); + this.DeclareEvaluationType(BooleanSchema.Type, typeRestriction); break; } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionSymbol.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionSymbol.cs index 5524116..0817514 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionSymbol.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionSymbol.cs @@ -32,7 +32,7 @@ namespace Microsoft.Iris.Markup.Validation { if (allowTypeSymbols) { - ValidateTypeIdentifier validateTypeIdentifier = new ValidateTypeIdentifier(this.Owner, (string)null, this._symbol, this.Line, this.Column); + ValidateTypeIdentifier validateTypeIdentifier = new ValidateTypeIdentifier(this.Owner, null, this._symbol, this.Line, this.Column); validateTypeIdentifier.Validate(); if (validateTypeIdentifier.HasErrors) { diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTernary.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTernary.cs index 81a29f8..d1d9897 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTernary.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTernary.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Markup.Validation { if (this.Usage == ExpressionUsage.LValue) this.ReportError("Expression cannot be used as the target an assignment (related symbol: '{0}')", "Ternary"); - this._condition.Validate(new TypeRestriction((TypeSchema)BooleanSchema.Type), context); + this._condition.Validate(new TypeRestriction(BooleanSchema.Type), context); if (this._condition.HasErrors) this.MarkHasErrors(); this._trueClause.Validate(typeRestriction, context); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionThis.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionThis.cs index 6bd1ae2..41884a4 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionThis.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionThis.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Markup.Validation { if (this.Usage == ExpressionUsage.LValue) this.ReportError("Expression cannot be used as the target an assignment (related symbol: '{0}')", "this"); - this.DeclareEvaluationType((TypeSchema)context.Owner.TypeExport, TypeRestriction.None); + this.DeclareEvaluationType(context.Owner.TypeExport, TypeRestriction.None); } } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTypeOf.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTypeOf.cs index 40c0313..367e3c5 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTypeOf.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTypeOf.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Markup.Validation this._typeIdentifier.Validate(); if (this._typeIdentifier.HasErrors) this.MarkHasErrors(); - this.DeclareEvaluationType((TypeSchema)TypeSchemaDefinition.Type, typeRestriction); + this.DeclareEvaluationType(TypeSchemaDefinition.Type, typeRestriction); } } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateFromString.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateFromString.cs index a5d2be9..ae257e3 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateFromString.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateFromString.cs @@ -37,7 +37,7 @@ namespace Microsoft.Iris.Markup.Validation public override void Validate(TypeRestriction typeRestriction, ValidateContext context) { this._typeHint = typeRestriction.Primary; - if (!this._typeHint.SupportsTypeConversion((TypeSchema)StringSchema.Type)) + if (!this._typeHint.SupportsTypeConversion(StringSchema.Type)) { this.ReportError("String conversion is not available for '{0}'", this._typeHint.Name); } @@ -53,7 +53,7 @@ namespace Microsoft.Iris.Markup.Validation return; } } - Result result = this._typeHint.TypeConverter((object)this._fromString, (TypeSchema)StringSchema.Type, out this._fromStringInstance); + Result result = this._typeHint.TypeConverter(_fromString, StringSchema.Type, out this._fromStringInstance); if (result.Failed) this.ReportError(result.Error); else @@ -65,6 +65,6 @@ namespace Microsoft.Iris.Markup.Validation public int TypeHintIndex => this._typeHintIndex; - public override string ToString() => this._typeHint != null ? string.Format("FromString : '{0}' {1}", (object)this._fromString, (object)this._typeHint) : "Unavailable"; + public override string ToString() => this._typeHint != null ? string.Format("FromString : '{0}' {1}", _fromString, _typeHint) : "Unavailable"; } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateMethod.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateMethod.cs index 57fec6a..5a492c3 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateMethod.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateMethod.cs @@ -147,7 +147,7 @@ namespace Microsoft.Iris.Markup.Validation markupTypeSchema = markupTypeSchema.Base as MarkupTypeSchema; } while (deep && markupTypeSchema != null); - return (MarkupMethodSchema)null; + return null; } public static bool IsExactMatch(MarkupMethodSchema method, MarkupMethodSchema methodCheck) @@ -188,7 +188,7 @@ namespace Microsoft.Iris.Markup.Validation str += parameter.FoundType.ToString() + " " + parameter.Name; } } - return string.Format("{0} {1}({2})", (object)this._methodName, (object)this._returnType.FoundType, (object)str); + return string.Format("{0} {1}({2})", _methodName, _returnType.FoundType, str); } } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateMethodList.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateMethodList.cs index 7289ce3..1ec3769 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateMethodList.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateMethodList.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Markup.Validation : base(owner, line, column) => this._methodList = new ArrayList(); - public void AppendToEnd(ValidateMethod expression) => this._methodList.Add((object)expression); + public void AppendToEnd(ValidateMethod expression) => this._methodList.Add(expression); public ArrayList Methods => this._methodList; @@ -61,12 +61,12 @@ namespace Microsoft.Iris.Markup.Validation { if (!method.HasVirtualKeyword) { - methodSchemaArray[index] = (MethodSchema)method.MethodExport; + methodSchemaArray[index] = method.MethodExport; } else { MarkupMethodSchema markupMethodSchema = MarkupMethodSchema.BuildVirtualThunk(validateOwner.ObjectType, method.MethodExport); - methodSchemaArray[index] = (MethodSchema)markupMethodSchema; + methodSchemaArray[index] = markupMethodSchema; markupMethodSchema.SetVirtualId(num); method.MethodExport.SetVirtualId(num); ++num; diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateNamespace.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateNamespace.cs index af25de9..04c109e 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateNamespace.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateNamespace.cs @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Markup.Validation public LoadResult Validate() { if (this._uri == "Me") - return (LoadResult)this.Owner.LoadResultTarget; + return Owner.LoadResultTarget; LoadResult loadResult = MarkupSystem.ResolveLoadResult(this._uri, this.Owner.LoadResultTarget.IslandReferences); if (loadResult == null || loadResult is ErrorLoadResult) this.ReportError("Unable to load '{0}' (xmlns prefix '{1}')", this._uri, this._prefix); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateObjectTag.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateObjectTag.cs index 65e6428..1254604 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateObjectTag.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateObjectTag.cs @@ -39,7 +39,7 @@ namespace Microsoft.Iris.Markup.Validation public ValidateObjectTag Next { get => (ValidateObjectTag)base.Next; - set => base.Next = (ValidateObject)value; + set => base.Next = value; } public void AddProperty(ValidateProperty property) @@ -115,7 +115,7 @@ namespace Microsoft.Iris.Markup.Validation } else { - if (context.CurrentPass != LoadPass.Full || !typeRestriction.Check((ValidateObject)this, this._foundType)) + if (context.CurrentPass != LoadPass.Full || !typeRestriction.Check(this, this._foundType)) return; if (!this._foundType.HasDefaultConstructor && !this.ForceAbstractAsConcrete && this.FindProperty(this._foundType.Name) == null) { @@ -234,7 +234,7 @@ namespace Microsoft.Iris.Markup.Validation public ValidateProperty FindProperty(string propertyName, bool remove) { ValidateProperty validateProperty1 = this._propertyList; - ValidateProperty validateProperty2 = (ValidateProperty)null; + ValidateProperty validateProperty2 = null; for (; validateProperty1 != null; validateProperty1 = validateProperty1.Next) { if (propertyName == validateProperty1.PropertyName) @@ -245,19 +245,19 @@ namespace Microsoft.Iris.Markup.Validation validateProperty2.Next = validateProperty1.Next; if (validateProperty1 == this._propertyList) this._propertyList = validateProperty1.Next; - validateProperty1.Next = (ValidateProperty)null; + validateProperty1.Next = null; } return validateProperty1; } validateProperty2 = validateProperty1; } - return (ValidateProperty)null; + return null; } public void RemoveProperty(ValidateProperty propertyRemove) { ValidateProperty validateProperty1 = this._propertyList; - ValidateProperty validateProperty2 = (ValidateProperty)null; + ValidateProperty validateProperty2 = null; for (; validateProperty1 != null; validateProperty1 = validateProperty1.Next) { if (validateProperty1 == propertyRemove) @@ -266,7 +266,7 @@ namespace Microsoft.Iris.Markup.Validation validateProperty2.Next = validateProperty1.Next; if (validateProperty1 == this._propertyList) this._propertyList = validateProperty1.Next; - validateProperty1.Next = (ValidateProperty)null; + validateProperty1.Next = null; break; } validateProperty2 = validateProperty1; @@ -276,7 +276,7 @@ namespace Microsoft.Iris.Markup.Validation public string GetInlinePropertyValueNoValidate(string propertyName) { ValidateProperty property = this.FindProperty(propertyName); - return property != null && property.IsFromStringValue ? ((ValidateFromString)property.Value).FromString : (string)null; + return property != null && property.IsFromStringValue ? ((ValidateFromString)property.Value).FromString : null; } public void MovePropertyToFront(string propertyName) @@ -291,7 +291,7 @@ namespace Microsoft.Iris.Markup.Validation public void AddStringProperty(string propertyName, string value) { ValidateFromString validateFromString = new ValidateFromString(this.Owner, value, false, this.Line, this.Column); - ValidateProperty validateProperty = new ValidateProperty(this.Owner, propertyName, (ValidateObject)validateFromString, this.Line, this.Column); + ValidateProperty validateProperty = new ValidateProperty(this.Owner, propertyName, validateFromString, this.Line, this.Column); if (this._propertyList == null) this._propertyList = validateProperty; else @@ -312,7 +312,7 @@ namespace Microsoft.Iris.Markup.Validation ValidateExpression validateExpression = (ValidateExpression)property.Value; if (validateExpression.ExpressionType == ExpressionType.TypeOf) { - validateExpression.Validate(new TypeRestriction((TypeSchema)TypeSchemaDefinition.Type), context); + validateExpression.Validate(new TypeRestriction(TypeSchemaDefinition.Type), context); if (!validateExpression.HasErrors) return ((ValidateExpressionTypeOf)validateExpression).TypeIdentifier.FoundType; this.MarkHasErrors(); @@ -327,7 +327,7 @@ namespace Microsoft.Iris.Markup.Validation } else if (required) this.ReportError("Property '{0}' must be specified", propertyName); - return (TypeSchema)null; + return null; } public bool ExtractBooleanProperty( @@ -342,7 +342,7 @@ namespace Microsoft.Iris.Markup.Validation if (property.IsFromStringValue) { ValidateFromString validateFromString = (ValidateFromString)property.Value; - validateFromString.Validate(new TypeRestriction((TypeSchema)BooleanSchema.Type), context); + validateFromString.Validate(new TypeRestriction(BooleanSchema.Type), context); if (!validateFromString.HasErrors) { value = (bool)validateFromString.FromStringInstance; @@ -370,7 +370,7 @@ namespace Microsoft.Iris.Markup.Validation } else if (required) this.ReportError("Property '{0}' must be specified", propertyName); - return (string)null; + return null; } public TypeSchema FoundType => this._foundType; @@ -383,14 +383,14 @@ namespace Microsoft.Iris.Markup.Validation { string str = ""; if (this._name != null) - str += string.Format("Name='{0}'", (object)this._name); + str += string.Format("Name='{0}'", _name); if (this._indirectedObject != null) { if (this._name != null) str += ", "; - str += string.Format("Indirected=[{0}]", (object)this._indirectedObject.ToString()); + str += string.Format("Indirected=[{0}]", this._indirectedObject.ToString()); } - return string.Format("Tag : {0} {1}", (object)this._typeIdentifier, (object)str); + return string.Format("Tag : {0} {1}", _typeIdentifier, str); } } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateParameter.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateParameter.cs index 7b53288..bff8b83 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateParameter.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateParameter.cs @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Markup.Validation public void Validate(ValidateContext context, bool voidAcceptable) { - this._expression.Validate(!voidAcceptable ? new TypeRestriction((TypeSchema)ObjectSchema.Type) : new TypeRestriction((TypeSchema)ObjectSchema.Type, (TypeSchema)VoidSchema.Type), context); + this._expression.Validate(!voidAcceptable ? new TypeRestriction(ObjectSchema.Type) : new TypeRestriction(ObjectSchema.Type, VoidSchema.Type), context); if (this._expression.HasErrors) this.MarkHasErrors(); else diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateParameterDefinitionList.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateParameterDefinitionList.cs index 5862269..a2ac278 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateParameterDefinitionList.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateParameterDefinitionList.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.Markup.Validation : base(owner, line, column) => this._paramDefinitionList = new ArrayList(); - public void AppendToEnd(ValidateParameterDefinition expression) => this._paramDefinitionList.Add((object)expression); + public void AppendToEnd(ValidateParameterDefinition expression) => this._paramDefinitionList.Add(expression); public ArrayList Parameters => this._paramDefinitionList; @@ -24,7 +24,7 @@ namespace Microsoft.Iris.Markup.Validation { foreach (ValidateParameterDefinition paramDefinition in this._paramDefinitionList) { - paramDefinition.Validate((ValidateCode)null, context); + paramDefinition.Validate(null, context); if (paramDefinition.HasErrors) this.MarkHasErrors(); } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateProperty.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateProperty.cs index 944172d..f1845b4 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateProperty.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateProperty.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Markup.Validation private ValidateProperty _next; public ValidateProperty(SourceMarkupLoader owner, string propertyName, int line, int column) - : this(owner, propertyName, (ValidateObject)null, line, column) + : this(owner, propertyName, null, line, column) { } @@ -157,13 +157,13 @@ namespace Microsoft.Iris.Markup.Validation } else { - TypeSchema primary = this._foundProperty.AlternateType ?? (TypeSchema)ObjectSchema.Type; + TypeSchema primary = this._foundProperty.AlternateType ?? ObjectSchema.Type; this._valueApplyMode = !flag1 ? ValueApplyMode.MultiValueList : ValueApplyMode.MultiValueDictionary; if (this._foundProperty.CanWrite && this._foundProperty.PropertyType.HasDefaultConstructor) this._valueApplyMode |= ValueApplyMode.CollectionPopulateAndSet; else this._valueApplyMode |= ValueApplyMode.CollectionAdd; - for (ValidateObject validateObject = this._value; validateObject != null; validateObject = validateObject.ObjectSourceType != ObjectSourceType.ObjectTag ? (ValidateObject)null : (ValidateObject)((ValidateObjectTag)validateObject).Next) + for (ValidateObject validateObject = this._value; validateObject != null; validateObject = validateObject.ObjectSourceType != ObjectSourceType.ObjectTag ? null : (ValidateObject)((ValidateObjectTag)validateObject).Next) { ++this._valueCount; TypeRestriction typeRestriction = !flag3 ? new TypeRestriction(primary, this._foundProperty.PropertyType) : new TypeRestriction(primary); @@ -236,7 +236,7 @@ namespace Microsoft.Iris.Markup.Validation else { ValidateFromString validateFromString = (ValidateFromString)this._value; - validateFromString.Validate(new TypeRestriction((TypeSchema)StringSchema.Type), context); + validateFromString.Validate(new TypeRestriction(StringSchema.Type), context); if (validateFromString.HasErrors) this.MarkHasErrors(); else @@ -263,7 +263,7 @@ namespace Microsoft.Iris.Markup.Validation } if (flag) return; - this._value.Validate(new TypeRestriction(targetObject.ObjectType, (TypeSchema)TypeSchemaDefinition.Type), context); + this._value.Validate(new TypeRestriction(targetObject.ObjectType, TypeSchemaDefinition.Type), context); if (this._value.HasErrors) this.MarkHasErrors(); else if (targetObject.ObjectType.IsAssignableFrom(this._value.ObjectType)) @@ -282,7 +282,7 @@ namespace Microsoft.Iris.Markup.Validation { if (targetObject.PropertySchemaExport != null && context.Owner.TypeExport != null) { - PropertySchema propertySchema = (PropertySchema)null; + PropertySchema propertySchema = null; if (context.Owner.TypeExport.MarkupTypeBase != null) propertySchema = context.Owner.TypeExport.MarkupTypeBase.FindPropertyDeep(targetObject.PropertySchemaExport.Name); if (result && propertySchema == null) @@ -344,15 +344,15 @@ namespace Microsoft.Iris.Markup.Validation for (ValidateObjectTag validateObjectTag = (ValidateObjectTag)this._value; validateObjectTag != null; validateObjectTag = next) { next = validateObjectTag.Next; - validateObjectTag.Next = (ValidateObjectTag)null; + validateObjectTag.Next = null; if (validateObjectTag != this._value) { validateObjectTag.Next = (ValidateObjectTag)this._value; - this._value = (ValidateObject)validateObjectTag; + this._value = validateObjectTag; } } } - public override string ToString() => this._value != null ? string.Format("{0} = {1}", (object)this._propertyName, (object)this._value.ToString()) : "Unavailable"; + public override string ToString() => this._value != null ? string.Format("{0} = {1}", _propertyName, this._value.ToString()) : "Unavailable"; } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateScripts.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateScripts.cs index 21ca626..04e50f2 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateScripts.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateScripts.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.Markup.Validation int num = 0; while (next != null) { - next.Validate(new TypeRestriction((TypeSchema)VoidSchema.Type), context); + next.Validate(new TypeRestriction(VoidSchema.Type), context); if (!next.HasErrors) { context.RegisterAction(next); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementAttribute.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementAttribute.cs index 15dcd6a..4a6c03c 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementAttribute.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementAttribute.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.Markup.Validation : base(owner, line, column, StatementType.Attribute) { if (parameterList == ValidateParameter.EmptyList) - parameterList = (ValidateParameter)null; + parameterList = null; this._attributeName = attributeName; this._parameterList = parameterList; } @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Markup.Validation ValidateExpressionDeclareTrigger.StartNotifierTracking(context, parameterList.Expression); parameterList.Expression.MakeDeclareTriggerUsage(); parameterList.Validate(context, true); - ValidateExpressionDeclareTrigger.StopNotifierTracking((Microsoft.Iris.Markup.Validation.Validate)this, context, parameterList.Expression); + ValidateExpressionDeclareTrigger.StopNotifierTracking(this, context, parameterList.Expression); if (parameterList.HasErrors) this.MarkHasErrors(); else if (context.IsTrackingDeclaredTriggers) diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementBreak.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementBreak.cs index 8603bde..29b8b79 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementBreak.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementBreak.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.Markup.Validation protected override void OnDispose() { - this._loopStatement = (ValidateStatementLoop)null; + this._loopStatement = null; base.OnDispose(); } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementForEach.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementForEach.cs index f49d4d0..17df523 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementForEach.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementForEach.cs @@ -48,14 +48,14 @@ namespace Microsoft.Iris.Markup.Validation public override void Validate(ValidateCode container, ValidateContext context) { - context.NotifyScopedLocalFrameEnter((ValidateStatementLoop)this); + context.NotifyScopedLocalFrameEnter(this); try { this._scopedLocal.Validate(container, context); if (this._scopedLocal.HasErrors) this.MarkHasErrors(); this._scopedLocal.HasInitialAssignment = true; - this._expression.Validate(new TypeRestriction((TypeSchema)ListSchema.Type), context); + this._expression.Validate(new TypeRestriction(ListSchema.Type), context); if (this._expression.HasErrors) { this.MarkHasErrors(); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIf.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIf.cs index 8e1d111..1b53620 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIf.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIf.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Markup.Validation public override void Validate(ValidateCode container, ValidateContext context) { - this._condition.Validate(new TypeRestriction((TypeSchema)BooleanSchema.Type), context); + this._condition.Validate(new TypeRestriction(BooleanSchema.Type), context); if (this._condition.HasErrors) this.MarkHasErrors(); this._statementCompound.Validate(container, context); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIfElse.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIfElse.cs index 5f9a460..bbd48e3 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIfElse.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIfElse.cs @@ -30,13 +30,13 @@ namespace Microsoft.Iris.Markup.Validation public ValidateExpression Condition => this._condition; - public ValidateStatement StatementCompoundTrue => (ValidateStatement)this._statementCompoundTrue; + public ValidateStatement StatementCompoundTrue => _statementCompoundTrue; - public ValidateStatement StatementCompoundFalse => (ValidateStatement)this._statementCompoundFalse; + public ValidateStatement StatementCompoundFalse => _statementCompoundFalse; public override void Validate(ValidateCode container, ValidateContext context) { - this._condition.Validate(new TypeRestriction((TypeSchema)BooleanSchema.Type), context); + this._condition.Validate(new TypeRestriction(BooleanSchema.Type), context); if (this._condition.HasErrors) this.MarkHasErrors(); this._statementCompoundTrue.Validate(container, context); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementReturn.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementReturn.cs index 174c267..3d2fe1d 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementReturn.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementReturn.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Markup.Validation { if (this._expression != null) { - this._expression.Validate(new TypeRestriction((TypeSchema)ObjectSchema.Type), context); + this._expression.Validate(new TypeRestriction(ObjectSchema.Type), context); if (this._expression.HasErrors) this.MarkHasErrors(); } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementWhile.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementWhile.cs index 75fcbaf..8065c2f 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementWhile.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateStatementWhile.cs @@ -36,10 +36,10 @@ namespace Microsoft.Iris.Markup.Validation public override void Validate(ValidateCode container, ValidateContext context) { - context.NotifyScopedLocalFrameEnter((ValidateStatementLoop)this); + context.NotifyScopedLocalFrameEnter(this); try { - this._condition.Validate(new TypeRestriction((TypeSchema)BooleanSchema.Type), context); + this._condition.Validate(new TypeRestriction(BooleanSchema.Type), context); if (this._condition.HasErrors) this.MarkHasErrors(); this._body.Validate(container, context); diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateTypeConstraint.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateTypeConstraint.cs index b76b8f0..cc6d175 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateTypeConstraint.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateTypeConstraint.cs @@ -57,6 +57,6 @@ namespace Microsoft.Iris.Markup.Validation } } - public override PropertyOverrideCriteria PropertyOverrideCriteria => (PropertyOverrideCriteria)new PropertyOverrideCriteriaTypeConstraint(this._foundUseType, this._foundConstraintType); + public override PropertyOverrideCriteria PropertyOverrideCriteria => new PropertyOverrideCriteriaTypeConstraint(this._foundUseType, this._foundConstraintType); } } diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateTypeIdentifier.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateTypeIdentifier.cs index 80ee487..bf7e6e4 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateTypeIdentifier.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateTypeIdentifier.cs @@ -24,7 +24,7 @@ namespace Microsoft.Iris.Markup.Validation this._prefix = prefix; this._typeName = typeName; if (this._prefix == string.Empty) - this._prefix = (string)null; + this._prefix = null; owner.NotifyTypeIdentifierFound(this._prefix, this._typeName); } @@ -48,7 +48,7 @@ namespace Microsoft.Iris.Markup.Validation return; string fromString = ((ValidateFromString)property.Value).FromString; ValidateTypeIdentifier typeIdentifier = new ValidateTypeIdentifier(property.Owner, fromString, property.Line, property.Column); - property.Value = (ValidateObject)new ValidateExpressionTypeOf(property.Owner, typeIdentifier, property.Line, property.Column); + property.Value = new ValidateExpressionTypeOf(property.Owner, typeIdentifier, property.Line, property.Column); } public string Prefix => this._prefix; diff --git a/UIX/Microsoft/Iris/Markup/Validation/ValidateUI.cs b/UIX/Microsoft/Iris/Markup/Validation/ValidateUI.cs index 5ebe673..c5b03d1 100644 --- a/UIX/Microsoft/Iris/Markup/Validation/ValidateUI.cs +++ b/UIX/Microsoft/Iris/Markup/Validation/ValidateUI.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.Markup.Validation private NamedContentRecord[] _namedContentTable; private static Map s_uiReservedSymbols = new Map(1); - public new static void InitializeStatics() => ValidateUI.s_uiReservedSymbols["UI"] = (TypeSchema)UIStateSchema.Type; + public new static void InitializeStatics() => ValidateUI.s_uiReservedSymbols["UI"] = UIStateSchema.Type; public ValidateUI( SourceMarkupLoader owner, @@ -58,15 +58,15 @@ namespace Microsoft.Iris.Markup.Validation if (this._foundNamedContentProperties != null) { context.NotifyScopedLocalFrameEnter(); - context.NotifyScopedLocal("RepeatedItem", (TypeSchema)ObjectSchema.Type, true, SymbolOrigin.Parameter); - context.NotifyScopedLocal("RepeatedItemIndex", (TypeSchema)IndexSchema.Type, true, SymbolOrigin.Parameter); + context.NotifyScopedLocal("RepeatedItem", ObjectSchema.Type, true, SymbolOrigin.Parameter); + context.NotifyScopedLocal("RepeatedItemIndex", IndexSchema.Type, true, SymbolOrigin.Parameter); this._namedContentTable = new NamedContentRecord[this._foundNamedContentProperties.Count]; for (int index = 0; index < this._foundNamedContentProperties.Count; ++index) { if (index >= this._namedContentTable.Length) { NamedContentRecord[] namedContentRecordArray = new NamedContentRecord[this._foundNamedContentProperties.Count]; - this._namedContentTable.CopyTo((Array)namedContentRecordArray, 0); + this._namedContentTable.CopyTo(namedContentRecordArray, 0); this._namedContentTable = namedContentRecordArray; } this.ValidateNamedContent(this._foundNamedContentProperties[index], context, index); @@ -121,7 +121,7 @@ namespace Microsoft.Iris.Markup.Validation if (property == null) return; string str1 = this.FoundBaseType == null ? "0" : this.FoundBaseType.LocallyUniqueId; - string str2 = string.Format("#Inline{0}{1}.{2}", (object)contentAttribute, (object)str1, (object)this._inlineContentIndex++); + string str2 = string.Format("#Inline{0}{1}.{2}", contentAttribute, str1, this._inlineContentIndex++); property.RepurposeProperty("Content", new PropertyAttribute("Name", str2)); if (repeater.FindProperty(contentNameAttribute) == null) repeater.AddStringProperty(contentNameAttribute, str2); @@ -160,7 +160,7 @@ namespace Microsoft.Iris.Markup.Validation else { namedContentProperty.AllowPropertyAttributes(); - namedContentProperty.Validate((ValidateObjectTag)this, context); + namedContentProperty.Validate(this, context); if (namedContentProperty.HasErrors) this.MarkHasErrors(); NamedContentRecord namedContentRecord = new NamedContentRecord(propertyAttributeList.Value); diff --git a/UIX/Microsoft/Iris/ModelItem.cs b/UIX/Microsoft/Iris/ModelItem.cs index ed7aad1..f597467 100644 --- a/UIX/Microsoft/Iris/ModelItem.cs +++ b/UIX/Microsoft/Iris/ModelItem.cs @@ -35,20 +35,20 @@ namespace Microsoft.Iris public ModelItem(IModelItemOwner owner, string description) { - ThreadSafety.InitializeObject((IThreadSafeObject)this); + ThreadSafety.InitializeObject(this); this._dataMap = new DynamicData(); this._dataMap.Create(); - this.SetData(ModelItem.s_descriptionProperty, (object)description); + this.SetData(ModelItem.s_descriptionProperty, description); this.Owner = owner; } public ModelItem(IModelItemOwner owner) - : this(owner, (string)null) + : this(owner, null) { } public ModelItem() - : this((IModelItemOwner)null) + : this(null) { } @@ -71,11 +71,11 @@ namespace Microsoft.Iris { if (disposeMode == ModelItemDisposeMode.RemoveOwnerReference) this._owner.UnregisterObject(this); - this._owner = (IModelItemOwner)null; + this._owner = null; } try { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.OnDispose(true); } finally @@ -96,7 +96,7 @@ namespace Microsoft.Iris { } - protected ThreadSafetyBlock ThreadValidator => new ThreadSafetyBlock((IThreadSafeObject)this); + protected ThreadSafetyBlock ThreadValidator => new ThreadSafetyBlock(this); Thread IThreadSafeObject.Affinity { @@ -149,7 +149,7 @@ namespace Microsoft.Iris { if (!(this.Description != value)) return; - this.SetData(ModelItem.s_descriptionProperty, (object)value); + this.SetData(ModelItem.s_descriptionProperty, value); this.FirePropertyChanged(nameof(Description)); } } @@ -171,7 +171,7 @@ namespace Microsoft.Iris { if (!(this.UniqueId != value)) return; - this.SetData(ModelItem.s_uniqueIdProperty, (object)value); + this.SetData(ModelItem.s_uniqueIdProperty, value); this.FirePropertyChanged(nameof(UniqueId)); } } @@ -186,8 +186,8 @@ namespace Microsoft.Iris IDictionary dictionary = (IDictionary)this.GetData(ModelItem.s_extraDataProperty); if (dictionary == null) { - dictionary = (IDictionary)new HybridDictionary(); - this.SetData(ModelItem.s_extraDataProperty, (object)dictionary); + dictionary = new HybridDictionary(); + this.SetData(ModelItem.s_extraDataProperty, dictionary); } return dictionary; } @@ -199,12 +199,12 @@ namespace Microsoft.Iris add { using (this.ThreadValidator) - this.AddEventHandler(ModelItem.s_propertyChangedEvent, (Delegate)value); + this.AddEventHandler(ModelItem.s_propertyChangedEvent, value); } remove { using (this.ThreadValidator) - this.RemoveEventHandler(ModelItem.s_propertyChangedEvent, (Delegate)value); + this.RemoveEventHandler(ModelItem.s_propertyChangedEvent, value); } } @@ -217,7 +217,7 @@ namespace Microsoft.Iris this.OnPropertyChanged(property); if (!(this.GetEventHandler(ModelItem.s_propertyChangedEvent) is PropertyChangedEventHandler eventHandler)) return; - eventHandler((object)this, new PropertyChangedEventArgs(property)); + eventHandler(this, new PropertyChangedEventArgs(property)); } } @@ -249,7 +249,7 @@ namespace Microsoft.Iris throw new ArgumentNullException(nameof(item)); Vector ownedObjects = this.GetOwnedObjects(false); if (ownedObjects == null || !ownedObjects.Contains(item)) - throw new ArgumentException(InvariantString.Format("Cannot unregister an object that was never registered. Owner \"{0}\" was unable to identify \"{1}\".", (object)this, (object)item)); + throw new ArgumentException(InvariantString.Format("Cannot unregister an object that was never registered. Owner \"{0}\" was unable to identify \"{1}\".", this, item)); ownedObjects.Remove(item); } } @@ -261,7 +261,7 @@ namespace Microsoft.Iris return; foreach (ModelItem modelItem in ownedObjects) modelItem.Dispose(ModelItemDisposeMode.KeepOwnerReference); - this.SetData(ModelItem.s_ownedObjectsProperty, (object)null); + this.SetData(ModelItem.s_ownedObjectsProperty, null); } private Vector GetOwnedObjects(bool createIfNoneFlag) @@ -270,7 +270,7 @@ namespace Microsoft.Iris if (vector == null && createIfNoneFlag) { vector = new Vector(); - this.SetData(ModelItem.s_ownedObjectsProperty, (object)vector); + this.SetData(ModelItem.s_ownedObjectsProperty, vector); } return vector; } @@ -291,7 +291,7 @@ namespace Microsoft.Iris { if (this.Selected == value) return; - this.SetData(ModelItem.s_selectedProperty, (object)value); + this.SetData(ModelItem.s_selectedProperty, value); this.FirePropertyChanged(nameof(Selected)); } } @@ -303,7 +303,7 @@ namespace Microsoft.Iris { string name = this.GetType().Name; string description = this.Description; - return description != null ? InvariantString.Format("{0}:\"{1}\"", (object)name, (object)description) : name; + return description != null ? InvariantString.Format("{0}:\"{1}\"", name, description) : name; } } diff --git a/UIX/Microsoft/Iris/ModelItems/BooleanChoice.cs b/UIX/Microsoft/Iris/ModelItems/BooleanChoice.cs index 8f45717..8f614ff 100644 --- a/UIX/Microsoft/Iris/ModelItems/BooleanChoice.cs +++ b/UIX/Microsoft/Iris/ModelItems/BooleanChoice.cs @@ -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; } } diff --git a/UIX/Microsoft/Iris/ModelItems/ByteRangedValue.cs b/UIX/Microsoft/Iris/ModelItems/ByteRangedValue.cs index d482a48..17a20d7 100644 --- a/UIX/Microsoft/Iris/ModelItems/ByteRangedValue.cs +++ b/UIX/Microsoft/Iris/ModelItems/ByteRangedValue.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.ModelItems INotifyObject { public ByteRangedValue() - : base(0.0f, (float)byte.MaxValue, 1f) + : base(0.0f, byte.MaxValue, 1f) { } } diff --git a/UIX/Microsoft/Iris/ModelItems/CaretInfo.cs b/UIX/Microsoft/Iris/ModelItems/CaretInfo.cs index 907a228..155e49c 100644 --- a/UIX/Microsoft/Iris/ModelItems/CaretInfo.cs +++ b/UIX/Microsoft/Iris/ModelItems/CaretInfo.cs @@ -87,7 +87,7 @@ namespace Microsoft.Iris.ModelItems int num = Win32Api.GetCaretBlinkTime(); if (num < 0) num = 0; - return (float)num / 1000f; + return num / 1000f; } } } diff --git a/UIX/Microsoft/Iris/ModelItems/Choice.cs b/UIX/Microsoft/Iris/ModelItems/Choice.cs index e4edbef..5500e90 100644 --- a/UIX/Microsoft/Iris/ModelItems/Choice.cs +++ b/UIX/Microsoft/Iris/ModelItems/Choice.cs @@ -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 { diff --git a/UIX/Microsoft/Iris/ModelItems/EditableTextData.cs b/UIX/Microsoft/Iris/ModelItems/EditableTextData.cs index 61daf6d..77016a0 100644 --- a/UIX/Microsoft/Iris/ModelItems/EditableTextData.cs +++ b/UIX/Microsoft/Iris/ModelItems/EditableTextData.cs @@ -53,7 +53,7 @@ namespace Microsoft.Iris.ModelItems { if (eventToFire == null) return; - eventToFire((object)this, EventArgs.Empty); + eventToFire(this, EventArgs.Empty); } public bool ReadOnly diff --git a/UIX/Microsoft/Iris/ModelItems/IntRangedValue.cs b/UIX/Microsoft/Iris/ModelItems/IntRangedValue.cs index 45968e2..c10744d 100644 --- a/UIX/Microsoft/Iris/ModelItems/IntRangedValue.cs +++ b/UIX/Microsoft/Iris/ModelItems/IntRangedValue.cs @@ -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) { } } diff --git a/UIX/Microsoft/Iris/ModelItems/NotifyList.cs b/UIX/Microsoft/Iris/ModelItems/NotifyList.cs index d3f0794..e068867 100644 --- a/UIX/Microsoft/Iris/ModelItems/NotifyList.cs +++ b/UIX/Microsoft/Iris/ModelItems/NotifyList.cs @@ -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)); } } } diff --git a/UIX/Microsoft/Iris/ModelItems/Range.cs b/UIX/Microsoft/Iris/ModelItems/Range.cs index de6d6ba..3c0aea6 100644 --- a/UIX/Microsoft/Iris/ModelItems/Range.cs +++ b/UIX/Microsoft/Iris/ModelItems/Range.cs @@ -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); } } diff --git a/UIX/Microsoft/Iris/ModelItems/RangedValue.cs b/UIX/Microsoft/Iris/ModelItems/RangedValue.cs index 621f7c7..a17642b 100644 --- a/UIX/Microsoft/Iris/ModelItems/RangedValue.cs +++ b/UIX/Microsoft/Iris/ModelItems/RangedValue.cs @@ -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; diff --git a/UIX/Microsoft/Iris/ModelItems/ScrollModel.cs b/UIX/Microsoft/Iris/ModelItems/ScrollModel.cs index 764acdb..7444258 100644 --- a/UIX/Microsoft/Iris/ModelItems/ScrollModel.cs +++ b/UIX/Microsoft/Iris/ModelItems/ScrollModel.cs @@ -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) { diff --git a/UIX/Microsoft/Iris/ModelItems/SelectionManager.cs b/UIX/Microsoft/Iris/ModelItems/SelectionManager.cs index dac8cfd..15646a6 100644 --- a/UIX/Microsoft/Iris/ModelItems/SelectionManager.cs +++ b/UIX/Microsoft/Iris/ModelItems/SelectionManager.cs @@ -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(); + originalList = new List(); foreach (int original in (List)((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); } } } diff --git a/UIX/Microsoft/Iris/ModelItems/TextScrollModel.cs b/UIX/Microsoft/Iris/ModelItems/TextScrollModel.cs index bd1b3ba..e193565 100644 --- a/UIX/Microsoft/Iris/ModelItems/TextScrollModel.cs +++ b/UIX/Microsoft/Iris/ModelItems/TextScrollModel.cs @@ -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; diff --git a/UIX/Microsoft/Iris/ModelItems/UITimer.cs b/UIX/Microsoft/Iris/ModelItems/UITimer.cs index 7499458..047ba0e 100644 --- a/UIX/Microsoft/Iris/ModelItems/UITimer.cs +++ b/UIX/Microsoft/Iris/ModelItems/UITimer.cs @@ -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() { diff --git a/UIX/Microsoft/Iris/Navigation/FindFromPointWorker.cs b/UIX/Microsoft/Iris/Navigation/FindFromPointWorker.cs index 482efc6..2d5aa95 100644 --- a/UIX/Microsoft/Iris/Navigation/FindFromPointWorker.cs +++ b/UIX/Microsoft/Iris/Navigation/FindFromPointWorker.cs @@ -27,8 +27,8 @@ namespace Microsoft.Iris.Navigation public bool FindFromPoint(PointF pt, out INavigationSite result) { - result = (INavigationSite)null; - FindFromPointWorker.FindFromPointInfo itemA = (FindFromPointWorker.FindFromPointInfo)null; + result = null; + FindFromPointWorker.FindFromPointInfo itemA = null; if (this._candidatesList == null) { this._candidatesList = new List(); @@ -50,7 +50,7 @@ namespace Microsoft.Iris.Navigation private void CollectChildrenToSearch(INavigationSite originSite, bool preferContainerFocus) { - foreach (INavigationSite child in (IEnumerable)originSite.Children) + foreach (INavigationSite child in originSite.Children) { if (child.Visible) { @@ -117,9 +117,9 @@ namespace Microsoft.Iris.Navigation num3 = num1; break; } - if ((double)num3 < 0.0) + if (num3 < 0.0) return -1; - if ((double)num3 > 0.0) + if (num3 > 0.0) return 1; } bool flag1 = rectangleF1.Contains(comparePoint); @@ -130,17 +130,17 @@ namespace Microsoft.Iris.Navigation PointF pointF2 = new PointF(Math.Abs(center2.X - comparePoint.X), Math.Abs(center2.Y - comparePoint.Y)); float num4 = pointF1.X + pointF1.Y; float num5 = pointF2.X + pointF2.Y; - if ((double)num4 < (double)num5) + if (num4 < (double)num5) return -1; - if ((double)num5 < (double)num4) + if (num5 < (double)num4) return 1; - if ((double)center1.X < (double)center2.X) + if (center1.X < (double)center2.X) return -1; - if ((double)center2.X < (double)center1.X) + if (center2.X < (double)center1.X) return 1; - if ((double)center1.Y < (double)center2.Y) + if (center1.Y < (double)center2.Y) return -1; - return (double)center2.Y < (double)center1.Y ? 1 : 0; + return center2.Y < (double)center1.Y ? 1 : 0; } public class FindFromPointInfo diff --git a/UIX/Microsoft/Iris/Navigation/NavigationFlow.cs b/UIX/Microsoft/Iris/Navigation/NavigationFlow.cs index 0f75283..73b8bdd 100644 --- a/UIX/Microsoft/Iris/Navigation/NavigationFlow.cs +++ b/UIX/Microsoft/Iris/Navigation/NavigationFlow.cs @@ -44,7 +44,7 @@ namespace Microsoft.Iris.Navigation RectangleF startRectangleF, bool enteringFlag) { - List navigationItemList = (List)null; + List navigationItemList = null; Map> partitions = this.PartitionChildren(allChildrenList); if (partitions.Keys.Count > 0) { @@ -56,19 +56,19 @@ namespace Microsoft.Iris.Navigation foreach (float key in keys) { NavigationItem areaForPartition = this.CreateAreaForPartition(partitions[key]); - if (areaForPartition != (NavigationItem)null) + if (areaForPartition != null) navigationItemList.Add(areaForPartition); } } } - return (IList)navigationItemList; + return navigationItemList; } private Map> PartitionChildren( IList allChildrenList) { Map> map = new Map>(); - foreach (NavigationItem allChildren in (IEnumerable)allChildrenList) + foreach (NavigationItem allChildren in allChildrenList) { float key = 0.0f; switch (this._orientationValue) @@ -102,7 +102,7 @@ namespace Microsoft.Iris.Navigation break; } } - return vector.Count <= 0 ? (float[])null : vector.ToArray(); + return vector.Count <= 0 ? null : vector.ToArray(); } private bool PartitionIsPotentialCandidate( @@ -127,18 +127,18 @@ namespace Microsoft.Iris.Navigation num2 = startRectangleF.Right; break; } - return (double)num1 <= (double)key && (double)key <= (double)num2; + return num1 <= (double)key && key <= (double)num2; } switch (this.SearchDirection) { case Direction.North: - return (double)key < (double)startRectangleF.Top; + return key < (double)startRectangleF.Top; case Direction.South: - return (double)key > (double)startRectangleF.Bottom; + return key > (double)startRectangleF.Bottom; case Direction.East: - return (double)key > (double)startRectangleF.Right; + return key > (double)startRectangleF.Right; case Direction.West: - return (double)key < (double)startRectangleF.Left; + return key < (double)startRectangleF.Left; default: return false; } @@ -156,14 +156,14 @@ namespace Microsoft.Iris.Navigation originValue = startRectangleF.Center.X; break; } - Array.Sort(keys, (IComparer)new NavigationFlow.CompareItemDistance(originValue)); + Array.Sort(keys, new NavigationFlow.CompareItemDistance(originValue)); } private NavigationItem CreateAreaForPartition(List partition) { - NavigationItem navigationItem = (NavigationItem)null; + NavigationItem navigationItem = null; if (partition != null && partition.Count > 0) - navigationItem = NavigationItem.CreateAreaForSite((INavigationSite)new TransientNavigationSite(partition[0].ToString(), this.Subject, (ICollection)partition, this._modeForNewSites, Vector3.Zero, Vector3.Zero), this.SearchDirection, false, true); + navigationItem = NavigationItem.CreateAreaForSite(new TransientNavigationSite(partition[0].ToString(), this.Subject, partition, this._modeForNewSites, Vector3.Zero, Vector3.Zero), this.SearchDirection, false, true); return navigationItem; } @@ -194,14 +194,14 @@ namespace Microsoft.Iris.Navigation int IComparer.Compare(float leftValue, float rightValue) { leftValue -= this._originValue; - if ((double)leftValue < 0.0) + if (leftValue < 0.0) leftValue *= -1f; rightValue -= this._originValue; - if ((double)rightValue < 0.0) + if (rightValue < 0.0) rightValue *= -1f; - if ((double)leftValue < (double)rightValue) + if (leftValue < (double)rightValue) return -1; - return (double)rightValue < (double)leftValue ? 1 : 0; + return rightValue < (double)leftValue ? 1 : 0; } } } diff --git a/UIX/Microsoft/Iris/Navigation/NavigationItem.cs b/UIX/Microsoft/Iris/Navigation/NavigationItem.cs index 2fd800d..5f95f82 100644 --- a/UIX/Microsoft/Iris/Navigation/NavigationItem.cs +++ b/UIX/Microsoft/Iris/Navigation/NavigationItem.cs @@ -38,12 +38,12 @@ namespace Microsoft.Iris.Navigation { ArrayList childrenList = new ArrayList(); this.FindNavigableChildren(this.Subject, childrenList); - IList list = (IList)null; + IList list = null; if (childrenList.Count > 0) { - list = this.ComputeSearchOrder((IList)childrenList, startRectangleF, enteringFlag); + list = this.ComputeSearchOrder(childrenList, startRectangleF, enteringFlag); if (list != null && list.Count == 0) - list = (IList)null; + list = null; } return list; } @@ -55,7 +55,7 @@ namespace Microsoft.Iris.Navigation private void FindNavigableChildren(INavigationSite parentSite, ArrayList childrenList) { - foreach (INavigationSite child in (IEnumerable)parentSite.Children) + foreach (INavigationSite child in parentSite.Children) { if (child.Visible) { @@ -63,9 +63,9 @@ namespace Microsoft.Iris.Navigation if (NavigationItem.IsPreferFocusOrderContainer(child)) searchDirection = Direction.Next; NavigationItem itemForSite = NavigationItem.CreateItemForSite(child, searchDirection, false); - if (itemForSite != (NavigationItem)null) + if (itemForSite != null) { - int num = childrenList.Add((object)itemForSite); + int num = childrenList.Add(itemForSite); itemForSite.RawChildOrder = num; } else @@ -78,7 +78,7 @@ namespace Microsoft.Iris.Navigation { get { - if (this._parentItem == (NavigationItem)null && !NavigationItem.IsBoundingSite(this._subjectSite, this._searchDirection)) + if (this._parentItem == null && !NavigationItem.IsBoundingSite(this._subjectSite, this._searchDirection)) { INavigationSite parent = this._subjectSite.Parent; if (parent != null) @@ -109,7 +109,7 @@ namespace Microsoft.Iris.Navigation public override bool Equals(object rhs) { NavigationItem navigationItem = rhs as NavigationItem; - return !(navigationItem == (NavigationItem)null) && this.Subject.Equals((object)navigationItem.Subject); + return !(navigationItem == null) && this.Subject.Equals(navigationItem.Subject); } public static bool operator ==(NavigationItem lhs, NavigationItem rhs) @@ -118,16 +118,16 @@ namespace Microsoft.Iris.Navigation bool flag2 = (object)rhs == null; if (flag1 && flag2) return true; - return !flag1 && !flag2 && lhs.Subject.Equals((object)rhs.Subject); + return !flag1 && !flag2 && lhs.Subject.Equals(rhs.Subject); } public static bool operator !=(NavigationItem lhs, NavigationItem rhs) => !(lhs == rhs); - public override string ToString() => this.GetType().Name + "[" + (object)this._subjectSite + "]"; + public override string ToString() => this.GetType().Name + "[" + _subjectSite + "]"; protected static int CompareFocusOrder(NavigationItem niA, NavigationItem niB) { - if (niA == (NavigationItem)null || niB == (NavigationItem)null) + if (niA == null || niB == null) return 0; int num = NavigationItem.CompareFocusRanks(niA.FocusRank, niB.FocusRank); if (num != 0) @@ -158,15 +158,15 @@ namespace Microsoft.Iris.Navigation while (true) { NavigationItem parent = navigationItem1.Parent; - if (!(parent == (NavigationItem)null)) + if (!(parent == null)) { IList childrenToSearch = parent.GetChildrenToSearch(startRectangleF, false); if (childrenToSearch != null) { - for (int index = childrenToSearch.IndexOf((object)navigationItem1) + 1; index < childrenToSearch.Count; ++index) + for (int index = childrenToSearch.IndexOf(navigationItem1) + 1; index < childrenToSearch.Count; ++index) { NavigationItem navigationItem2 = (childrenToSearch[index] as NavigationItem).SearchDownTree(startRectangleF, true, excludeStickyContainerSite, excludeStickyDestinationSite); - if (navigationItem2 != (NavigationItem)null) + if (navigationItem2 != null) return navigationItem2; } } @@ -175,7 +175,7 @@ namespace Microsoft.Iris.Navigation else break; } - return (NavigationItem)null; + return null; } internal NavigationItem SearchDownTree( @@ -193,9 +193,9 @@ namespace Microsoft.Iris.Navigation if (site != null && site != exclueStickyDestinationSite) { NavigationItem itemForSite = NavigationItem.CreateItemForSite(site, this.SearchDirection, false); - if (itemForSite != (NavigationItem)null && itemForSite.CheckDestination(startRectangleF)) + if (itemForSite != null && itemForSite.CheckDestination(startRectangleF)) return itemForSite; - NavigationItem.SetGroupFocusId(this.Subject, (object)null); + NavigationItem.SetGroupFocusId(this.Subject, null); } } } @@ -209,15 +209,15 @@ namespace Microsoft.Iris.Navigation if (childrenToSearch != null) { int num = 0; - foreach (NavigationItem navigationItem1 in (IEnumerable)childrenToSearch) + foreach (NavigationItem navigationItem1 in childrenToSearch) { NavigationItem navigationItem2 = navigationItem1.SearchDownTree(startRectangleF, depthFirst, excludeStickyContainerSite, exclueStickyDestinationSite); - if (navigationItem2 != (NavigationItem)null) + if (navigationItem2 != null) return navigationItem2; ++num; } } - return depthFirst && this.CheckDestination(startRectangleF) ? this : (NavigationItem)null; + return depthFirst && this.CheckDestination(startRectangleF) ? this : null; } internal static void RememberFocus(INavigationSite focusSite) @@ -230,7 +230,7 @@ namespace Microsoft.Iris.Navigation internal static void ClearFocus(INavigationSite startSite) { for (INavigationSite groupSite = startSite; groupSite != null; groupSite = groupSite.Parent) - NavigationItem.SetGroupFocusId(groupSite, (object)null); + NavigationItem.SetGroupFocusId(groupSite, null); } internal static NavigationItem CreateItemForSite( @@ -256,9 +256,9 @@ namespace Microsoft.Iris.Navigation bool mustUseThisSiteFlag) { if (site == null) - return (NavigationItem)null; + return null; if (!site.Visible) - return (NavigationItem)null; + return null; if (site.Navigability != NavigationClass.None) mustUseThisSiteFlag = true; return NavigationItem.CreateAreaForSiteWorker(site, searchDirection, false, mustUseThisSiteFlag); @@ -271,15 +271,15 @@ namespace Microsoft.Iris.Navigation bool mustUseThisSiteFlag) { if (targetSite == null) - return (NavigationItem)null; + return null; if (!targetSite.Visible) - return (NavigationItem)null; + return null; INavigationSite governSite; NavigationOrientation containerOrientation = NavigationItem.ComputeGoverningContainerOrientation(targetSite, searchDirection, searchAncestorsFlag || mustUseThisSiteFlag, out governSite); if (governSite != targetSite && !mustUseThisSiteFlag) { if (!searchAncestorsFlag) - return (NavigationItem)null; + return null; targetSite = governSite; } switch (searchDirection) @@ -292,12 +292,12 @@ namespace Microsoft.Iris.Navigation { case NavigationOrientation.Horizontal: case NavigationOrientation.Vertical: - return (NavigationItem)new NavigationStrip(targetSite, searchDirection, containerOrientation); + return new NavigationStrip(targetSite, searchDirection, containerOrientation); case NavigationOrientation.FlowHorizontal: case NavigationOrientation.FlowVertical: - return (NavigationItem)new NavigationFlow(targetSite, searchDirection, containerOrientation); + return new NavigationFlow(targetSite, searchDirection, containerOrientation); case NavigationOrientation.Free: - return (NavigationItem)new NavigationSpace(targetSite, searchDirection); + return new NavigationSpace(targetSite, searchDirection); } break; case Direction.Previous: @@ -309,11 +309,11 @@ namespace Microsoft.Iris.Navigation case NavigationOrientation.Vertical: case NavigationOrientation.FlowVertical: case NavigationOrientation.Free: - return (NavigationItem)new NavigationOrder(targetSite, searchDirection); + return new NavigationOrder(targetSite, searchDirection); } break; } - return (NavigationItem)null; + return null; } private static NavigationOrientation ComputeGoverningContainerOrientation( @@ -516,7 +516,7 @@ namespace Microsoft.Iris.Navigation private static object GetGroupFocusId(INavigationSite groupSite) { - object obj = (object)null; + object obj = null; if (NavigationItem.IsRememberFocus(groupSite)) obj = groupSite.StateCache; return obj; @@ -559,7 +559,7 @@ namespace Microsoft.Iris.Navigation case Direction.Previous: case Direction.Next: NavigationItem parent = this.Parent; - if (parent == (NavigationItem)null) + if (parent == null) return this.s_emptyFocusRankList; int num1 = 0; INavigationSite navigationSite1 = this.Subject; diff --git a/UIX/Microsoft/Iris/Navigation/NavigationOrder.cs b/UIX/Microsoft/Iris/Navigation/NavigationOrder.cs index 8c3dc17..9d72810 100644 --- a/UIX/Microsoft/Iris/Navigation/NavigationOrder.cs +++ b/UIX/Microsoft/Iris/Navigation/NavigationOrder.cs @@ -30,10 +30,10 @@ namespace Microsoft.Iris.Navigation this._orderModifierValue = -1; NavigationItem[] navigationItemArray = new NavigationItem[allChildrenList.Count]; int num = 0; - foreach (NavigationItem allChildren in (IEnumerable)allChildrenList) + foreach (NavigationItem allChildren in allChildrenList) navigationItemArray[num++] = allChildren; - Array.Sort((Array)navigationItemArray, (IComparer)this); - return (IList)navigationItemArray; + Array.Sort(navigationItemArray, this); + return navigationItemArray; } int IComparer.Compare(object a, object b) => this._orderModifierValue * NavigationItem.CompareFocusOrder((NavigationItem)a, (NavigationItem)b); diff --git a/UIX/Microsoft/Iris/Navigation/NavigationServices.cs b/UIX/Microsoft/Iris/Navigation/NavigationServices.cs index f4a0d49..46f1197 100644 --- a/UIX/Microsoft/Iris/Navigation/NavigationServices.cs +++ b/UIX/Microsoft/Iris/Navigation/NavigationServices.cs @@ -27,10 +27,10 @@ namespace Microsoft.Iris.Navigation out INavigationSite resultSite) { INavigationSite navigationSite1 = originSite; - Microsoft.Iris.Debug.Trace.IsCategoryEnabled(TraceCategory.Navigation, (byte)2); + Microsoft.Iris.Debug.Trace.IsCategoryEnabled(TraceCategory.Navigation, 2); if (startRectangleF.IsEmpty && !NavigationServices.GetDefaultOutboundStartRect(originSite, out startRectangleF)) { - resultSite = (INavigationSite)null; + resultSite = null; return false; } NavigationServices.ProcessDirectionalMemory(ref startRectangleF, searchDirection); @@ -38,12 +38,12 @@ namespace Microsoft.Iris.Navigation if (parentTabGroup != null) navigationSite1 = parentTabGroup; INavigationSite boundingSite = NavigationServices.FindBoundingSite(navigationSite1, searchDirection); - INavigationSite navigationSite2 = (INavigationSite)null; + INavigationSite navigationSite2 = null; NavigationItem itemForSite1 = NavigationItem.CreateItemForSite(navigationSite1, searchDirection, false); - if (itemForSite1 != (NavigationItem)null) + if (itemForSite1 != null) { - NavigationItem navigationItem1 = itemForSite1.SearchUpTree(startRectangleF, (INavigationSite)null, (INavigationSite)null); - if (navigationItem1 != (NavigationItem)null) + NavigationItem navigationItem1 = itemForSite1.SearchUpTree(startRectangleF, null, null); + if (navigationItem1 != null) navigationSite2 = navigationItem1.Subject; if (navigationSite2 == null && boundingSite != null && NavigationItem.IsWrappingSite(boundingSite, searchDirection)) { @@ -53,14 +53,14 @@ namespace Microsoft.Iris.Navigation RectangleF excludeRectangleF = new RectangleF(positionPxlVector.X, positionPxlVector.Y, sizePxlVector.X, sizePxlVector.Y); NavigationServices.AdjustStartRectForSimulatedEntry(searchDirection, excludeRectangleF, ref startRectangleF); NavigationItem itemForSite2 = NavigationItem.CreateItemForSite(boundingSite, searchDirection, true); - if (itemForSite2 != (NavigationItem)null) + if (itemForSite2 != null) { NavigationItem navigationItem2 = itemForSite2.SearchDownTree(startRectangleF, true, boundingSite, originSite); - if (navigationItem2 != (NavigationItem)null) + if (navigationItem2 != null) navigationSite2 = navigationItem2.Subject; } if (navigationSite2 == originSite) - navigationSite2 = (INavigationSite)null; + navigationSite2 = null; } } bool flag = navigationSite2 != null; @@ -92,19 +92,19 @@ namespace Microsoft.Iris.Navigation RectangleF startRectangleF, out INavigationSite resultSite) { - Microsoft.Iris.Debug.Trace.IsCategoryEnabled(TraceCategory.Navigation, (byte)2); + Microsoft.Iris.Debug.Trace.IsCategoryEnabled(TraceCategory.Navigation, 2); if (startRectangleF.IsEmpty && !NavigationServices.GetDefaultInboundStartRect(originSite, searchDirection, out startRectangleF)) { - resultSite = (INavigationSite)null; + resultSite = null; return false; } NavigationServices.ProcessDirectionalMemory(ref startRectangleF, searchDirection); - INavigationSite navigationSite = (INavigationSite)null; + INavigationSite navigationSite = null; NavigationItem itemForSite = NavigationItem.CreateItemForSite(originSite, searchDirection, true); - if (itemForSite != (NavigationItem)null) + if (itemForSite != null) { - NavigationItem navigationItem = itemForSite.SearchDownTree(startRectangleF, true, (INavigationSite)null, (INavigationSite)null); - if (navigationItem != (NavigationItem)null) + NavigationItem navigationItem = itemForSite.SearchDownTree(startRectangleF, true, null, null); + if (navigationItem != null) navigationSite = navigationItem.Subject; } bool flag = navigationSite != null; @@ -230,13 +230,13 @@ namespace Microsoft.Iris.Navigation for (; targetSite != null; targetSite = targetSite.Parent) { if (NavigationItem.IsBoundingSite(targetSite, searchDirection)) - return (INavigationSite)null; + return null; if (NavigationItem.IsTabGroup(targetSite)) break; } return targetSite; default: - return (INavigationSite)null; + return null; } } @@ -267,10 +267,10 @@ namespace Microsoft.Iris.Navigation { int num = branchSite.IsLogicalJunction ? 1 : 0; if (branchSite.Navigability != NavigationClass.None) - InvariantString.Format(", Class: {0}", (object)branchSite.Navigability); + InvariantString.Format(", Class: {0}", branchSite.Navigability); if (branchSite.Mode != NavigationPolicies.None) - InvariantString.Format(", Mode: {0}", (object)branchSite.Mode); - foreach (INavigationSite child in (IEnumerable)branchSite.Children) + InvariantString.Format(", Mode: {0}", branchSite.Mode); + foreach (INavigationSite child in branchSite.Children) ; } diff --git a/UIX/Microsoft/Iris/Navigation/NavigationSpace.cs b/UIX/Microsoft/Iris/Navigation/NavigationSpace.cs index 3d731e2..077ea72 100644 --- a/UIX/Microsoft/Iris/Navigation/NavigationSpace.cs +++ b/UIX/Microsoft/Iris/Navigation/NavigationSpace.cs @@ -26,17 +26,17 @@ namespace Microsoft.Iris.Navigation bool enteringFlag) { ArrayList arrayList = new ArrayList(allChildrenList.Count); - foreach (NavigationItem allChildren in (IEnumerable)allChildrenList) + foreach (NavigationItem allChildren in allChildrenList) { NavigationSpace.CandidateInfo candidateInfo = this.AnalyzeCandidate(allChildren, startRectangleF); if (candidateInfo != null) - arrayList.Add((object)candidateInfo); + arrayList.Add(candidateInfo); } - arrayList.Sort((IComparer)this); + arrayList.Sort(this); NavigationItem[] navigationItemArray = new NavigationItem[arrayList.Count]; for (int index = 0; index < arrayList.Count; ++index) navigationItemArray[index] = ((NavigationSpace.CandidateInfo)arrayList[index]).item; - return (IList)navigationItemArray; + return navigationItemArray; } private NavigationSpace.CandidateInfo AnalyzeCandidate( @@ -55,11 +55,11 @@ namespace Microsoft.Iris.Navigation goto case Direction.Previous; case Direction.South: yDeltaValue = location.Top - originRectangleF.Bottom; - toleranceValue = (float)((double)originRectangleF.Height / 2.0 * -1.0); + toleranceValue = (float)(originRectangleF.Height / 2.0 * -1.0); goto case Direction.Previous; case Direction.East: xDeltaValue = location.Left - originRectangleF.Right; - toleranceValue = (float)((double)originRectangleF.Width / 2.0 * -1.0); + toleranceValue = (float)(originRectangleF.Width / 2.0 * -1.0); goto case Direction.Previous; case Direction.West: xDeltaValue = location.Right - originRectangleF.Left; @@ -72,12 +72,12 @@ namespace Microsoft.Iris.Navigation { case Direction.North: case Direction.South: - if ((double)location.Right <= (double)originRectangleF.Left) + if (location.Right <= (double)originRectangleF.Left) { xDeltaValue = location.Right - originRectangleF.Left; break; } - if ((double)location.Left >= (double)originRectangleF.Right) + if (location.Left >= (double)originRectangleF.Right) { xDeltaValue = location.Left - originRectangleF.Right; break; @@ -86,12 +86,12 @@ namespace Microsoft.Iris.Navigation break; case Direction.East: case Direction.West: - if ((double)location.Bottom <= (double)originRectangleF.Top) + if (location.Bottom <= (double)originRectangleF.Top) { yDeltaValue = location.Bottom - originRectangleF.Top; break; } - if ((double)location.Top >= (double)originRectangleF.Bottom) + if (location.Top >= (double)originRectangleF.Bottom) { yDeltaValue = location.Top - originRectangleF.Bottom; break; @@ -101,7 +101,7 @@ namespace Microsoft.Iris.Navigation } NavigationSpace.Rank rank = this.ComputeRank(xDeltaValue, yDeltaValue, overlapValue, toleranceValue); if (rank > NavigationSpace.Rank.Fair) - return (NavigationSpace.CandidateInfo)null; + return null; switch (this.SearchDirection) { case Direction.North: @@ -113,7 +113,7 @@ namespace Microsoft.Iris.Navigation xDeltaValue -= toleranceValue; break; } - float weightedFacingDistance = (float)((double)xDeltaValue * (double)xDeltaValue + (double)yDeltaValue * (double)yDeltaValue) - overlapValue; + float weightedFacingDistance = (float)(xDeltaValue * (double)xDeltaValue + yDeltaValue * (double)yDeltaValue) - overlapValue; float centerDistance = 0.0f; float positionOrder = 0.0f; switch (this.SearchDirection) @@ -129,12 +129,12 @@ namespace Microsoft.Iris.Navigation break; case Direction.Previous: case Direction.Next: - positionOrder = (float)((double)location.Left + (double)location.Width / 2.0 + ((double)location.Top + (double)location.Height / 2.0)); + positionOrder = (float)(location.Left + location.Width / 2.0 + (location.Top + location.Height / 2.0)); break; } return new NavigationSpace.CandidateInfo(candidateItem, rank, weightedFacingDistance, centerDistance, positionOrder); default: - return (NavigationSpace.CandidateInfo)null; + return null; } } @@ -147,40 +147,40 @@ namespace Microsoft.Iris.Navigation switch (this.SearchDirection) { case Direction.North: - if ((double)yDeltaValue > (double)toleranceValue) + if (yDeltaValue > (double)toleranceValue) return NavigationSpace.Rank.Poor; break; case Direction.South: - if ((double)yDeltaValue < (double)toleranceValue) + if (yDeltaValue < (double)toleranceValue) return NavigationSpace.Rank.Poor; break; case Direction.East: - if ((double)xDeltaValue < (double)toleranceValue) + if (xDeltaValue < (double)toleranceValue) return NavigationSpace.Rank.Poor; break; case Direction.West: - if ((double)xDeltaValue > (double)toleranceValue) + if (xDeltaValue > (double)toleranceValue) return NavigationSpace.Rank.Poor; break; } - if ((double)overlapValue > 0.0) + if (overlapValue > 0.0) return NavigationSpace.Rank.Ideal; switch (this.SearchDirection) { case Direction.North: - if ((double)yDeltaValue > 0.0) + if (yDeltaValue > 0.0) return NavigationSpace.Rank.Fair; break; case Direction.South: - if ((double)yDeltaValue < 0.0) + if (yDeltaValue < 0.0) return NavigationSpace.Rank.Fair; break; case Direction.East: - if ((double)xDeltaValue < 0.0) + if (xDeltaValue < 0.0) return NavigationSpace.Rank.Fair; break; case Direction.West: - if ((double)xDeltaValue > 0.0) + if (xDeltaValue > 0.0) return NavigationSpace.Rank.Fair; break; } @@ -190,12 +190,12 @@ namespace Microsoft.Iris.Navigation { case Direction.North: case Direction.South: - if ((double)xDeltaValue >= (double)yDeltaValue) + if (xDeltaValue >= (double)yDeltaValue) return NavigationSpace.Rank.Fair; break; case Direction.East: case Direction.West: - if ((double)yDeltaValue >= (double)xDeltaValue) + if (yDeltaValue >= (double)xDeltaValue) return NavigationSpace.Rank.Fair; break; } @@ -210,19 +210,19 @@ namespace Microsoft.Iris.Navigation if (num1 != 0) return num1; float num2 = candidateInfo1.weightedFacingDistance - candidateInfo2.weightedFacingDistance; - if ((double)num2 < 0.0) + if (num2 < 0.0) return -1; - if ((double)num2 > 0.0) + if (num2 > 0.0) return 1; float num3 = candidateInfo1.centerDistance - candidateInfo2.centerDistance; - if ((double)num3 < 0.0) + if (num3 < 0.0) return -1; - if ((double)num3 > 0.0) + if (num3 > 0.0) return 1; float num4 = candidateInfo1.positionOrder - candidateInfo2.positionOrder; - if ((double)num4 < 0.0) + if (num4 < 0.0) return -1; - return (double)num4 > 0.0 ? 1 : 0; + return num4 > 0.0 ? 1 : 0; } private class CandidateInfo diff --git a/UIX/Microsoft/Iris/Navigation/NavigationStrip.cs b/UIX/Microsoft/Iris/Navigation/NavigationStrip.cs index 175afeb..dbe88f2 100644 --- a/UIX/Microsoft/Iris/Navigation/NavigationStrip.cs +++ b/UIX/Microsoft/Iris/Navigation/NavigationStrip.cs @@ -35,15 +35,15 @@ namespace Microsoft.Iris.Navigation NavigationOrientation searchOrientation = this.SearchOrientation; bool flag = searchOrientation == this._orientationValue; if (!enteringFlag && !flag) - return (IList)null; + return null; ArrayList arrayList = new ArrayList(allChildrenList.Count); PointF center = startRectangleF.Center; - foreach (NavigationItem allChildren in (IEnumerable)allChildrenList) + foreach (NavigationItem allChildren in allChildrenList) { if (this.IsCandidateInSearchDirection(allChildren.Position - center)) - arrayList.Add((object)allChildren); + arrayList.Add(allChildren); } - NavigationStrip.CompareFunction compareMethod = (NavigationStrip.CompareFunction)null; + NavigationStrip.CompareFunction compareMethod = null; float paramValue = 0.0f; if (flag) { @@ -84,8 +84,8 @@ namespace Microsoft.Iris.Navigation break; } } - arrayList.Sort((IComparer)new NavigationStrip.ItemComparer(compareMethod, paramValue)); - return (IList)arrayList; + arrayList.Sort(new NavigationStrip.ItemComparer(compareMethod, paramValue)); + return arrayList; } private NavigationOrientation SearchOrientation @@ -111,19 +111,19 @@ namespace Microsoft.Iris.Navigation switch (this.SearchDirection) { case Direction.North: - if ((double)deltaExtent.Height >= 0.0) + if (deltaExtent.Height >= 0.0) return false; break; case Direction.South: - if ((double)deltaExtent.Height <= 0.0) + if (deltaExtent.Height <= 0.0) return false; break; case Direction.East: - if ((double)deltaExtent.Width <= 0.0) + if (deltaExtent.Width <= 0.0) return false; break; case Direction.West: - if ((double)deltaExtent.Width >= 0.0) + if (deltaExtent.Width >= 0.0) return false; break; } @@ -137,9 +137,9 @@ namespace Microsoft.Iris.Navigation { float num1 = niA.Position.X * orderValue; float num2 = niB.Position.X * orderValue; - if ((double)num1 < (double)num2) + if (num1 < (double)num2) return -1; - return (double)num1 > (double)num2 ? 1 : 0; + return num1 > (double)num2 ? 1 : 0; } private static int CompareOrderVertical( @@ -149,9 +149,9 @@ namespace Microsoft.Iris.Navigation { float num1 = niA.Position.Y * orderValue; float num2 = niB.Position.Y * orderValue; - if ((double)num1 < (double)num2) + if (num1 < (double)num2) return -1; - return (double)num1 > (double)num2 ? 1 : 0; + return num1 > (double)num2 ? 1 : 0; } private static int CompareDistanceHorizontal( @@ -160,14 +160,14 @@ namespace Microsoft.Iris.Navigation float originValue) { float num1 = niA.Position.X - originValue; - if ((double)num1 < 0.0) + if (num1 < 0.0) num1 *= -1f; float num2 = niB.Position.X - originValue; - if ((double)num2 < 0.0) + if (num2 < 0.0) num2 *= -1f; - if ((double)num1 < (double)num2) + if (num1 < (double)num2) return -1; - return (double)num1 > (double)num2 ? 1 : 0; + return num1 > (double)num2 ? 1 : 0; } private static int CompareDistanceVertical( @@ -176,14 +176,14 @@ namespace Microsoft.Iris.Navigation float originValue) { float num1 = niA.Position.Y - originValue; - if ((double)num1 < 0.0) + if (num1 < 0.0) num1 *= -1f; float num2 = niB.Position.Y - originValue; - if ((double)num2 < 0.0) + if (num2 < 0.0) num2 *= -1f; - if ((double)num1 < (double)num2) + if (num1 < (double)num2) return -1; - return (double)num1 > (double)num2 ? 1 : 0; + return num1 > (double)num2 ? 1 : 0; } private delegate int CompareFunction(NavigationItem a, NavigationItem b, float param); diff --git a/UIX/Microsoft/Iris/Navigation/TransientNavigationSite.cs b/UIX/Microsoft/Iris/Navigation/TransientNavigationSite.cs index 97e4fac..3e4a24c 100644 --- a/UIX/Microsoft/Iris/Navigation/TransientNavigationSite.cs +++ b/UIX/Microsoft/Iris/Navigation/TransientNavigationSite.cs @@ -72,12 +72,12 @@ namespace Microsoft.Iris.Navigation INavigationSite INavigationSite.LookupChildById( object uniqueIdObject) { - foreach (INavigationSite child in (IEnumerable)this._children) + foreach (INavigationSite child in _children) { if (child != null && child.UniqueId != null && child.UniqueId.Equals(uniqueIdObject)) return child; } - return (INavigationSite)null; + return null; } public override string ToString() => this._descriptionName; diff --git a/UIX/Microsoft/Iris/OS/CLR/StandardOleMarshalObject.cs b/UIX/Microsoft/Iris/OS/CLR/StandardOleMarshalObject.cs index 3c105b5..69b1e79 100644 --- a/UIX/Microsoft/Iris/OS/CLR/StandardOleMarshalObject.cs +++ b/UIX/Microsoft/Iris/OS/CLR/StandardOleMarshalObject.cs @@ -21,7 +21,7 @@ namespace Microsoft.Iris.OS.CLR private IntPtr GetStdMarshaller(ref Guid riid, int dwDestContext, int mshlflags) { IntPtr ppMarshal = IntPtr.Zero; - IntPtr iunknownForObject = Marshal.GetIUnknownForObject((object)this); + IntPtr iunknownForObject = Marshal.GetIUnknownForObject(this); if (iunknownForObject != IntPtr.Zero) { try diff --git a/UIX/Microsoft/Iris/OS/DataObject.cs b/UIX/Microsoft/Iris/OS/DataObject.cs index 3195898..70bd093 100644 --- a/UIX/Microsoft/Iris/OS/DataObject.cs +++ b/UIX/Microsoft/Iris/OS/DataObject.cs @@ -19,20 +19,20 @@ namespace Microsoft.Iris.OS public object GetExternalData() { - object obj = (object)null; + object obj = null; if (this._dataStream != IntPtr.Zero) { try { - this._data = (string[])null; + this._data = null; RendererApi.IFC(new HRESULT(NativeApi.SpExtractDroppedFileNames(this._dataStream, new NativeApi.ExtractDroppedFileNamesCallback(this.ExtractDroppedFileNamesCallback)))); - obj = (object)this._data; + obj = _data; } catch (COMException ex) { } } - this._data = (string[])null; + this._data = null; return obj; } diff --git a/UIX/Microsoft/Iris/OS/DllResource.cs b/UIX/Microsoft/Iris/OS/DllResource.cs index d7e06e7..4e6a3c3 100644 --- a/UIX/Microsoft/Iris/OS/DllResource.cs +++ b/UIX/Microsoft/Iris/OS/DllResource.cs @@ -27,9 +27,9 @@ namespace Microsoft.Iris.OS protected override void StartAcquisition(bool forceSynchronous) { - string errorDetails = (string)null; + string errorDetails = null; if (this._buffer == IntPtr.Zero && !NativeApi.SpLoadBinaryResource(this._dll, this._identifier, !DllResources.StaticDllResourcesOnly, out this._buffer, out this._length)) - errorDetails = string.Format("Resource not found: res://{0}!{1}", (object)this._dll, (object)this._identifier); + errorDetails = string.Format("Resource not found: res://{0}!{1}", _dll, _identifier); this.NotifyAcquisitionComplete(this._buffer, this._length, false, errorDetails); } diff --git a/UIX/Microsoft/Iris/OS/DllResources.cs b/UIX/Microsoft/Iris/OS/DllResources.cs index a7e0bc3..8973f24 100644 --- a/UIX/Microsoft/Iris/OS/DllResources.cs +++ b/UIX/Microsoft/Iris/OS/DllResources.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.OS public Resource GetResource(string hierarchicalPart, string uri, bool forceSynchronous) { - Resource resource = (Resource)null; + Resource resource = null; string host; string identifier; DllResources.ParseResource(hierarchicalPart, out host, out identifier); @@ -42,19 +42,19 @@ namespace Microsoft.Iris.OS { string fullPath = this.GetFullPath(host); if (fullPath != null) - resource = (Resource)new DllResource(uri, fullPath, identifier); + resource = new DllResource(uri, fullPath, identifier); } if (resource == null) - ErrorManager.ReportError("Invalid resource uri: '{0}'", (object)uri); + ErrorManager.ReportError("Invalid resource uri: '{0}'", uri); return resource; } public string GetFullPath(string moduleName) { - string str = (string)null; + string str = null; if (!this._shortNameToFullPath.TryGetValue(moduleName, out str)) { - AssemblyName name = (AssemblyName)null; + AssemblyName name = null; try { name = new AssemblyName(moduleName); @@ -65,7 +65,7 @@ namespace Microsoft.Iris.OS catch (IOException ex) { } - Assembly assembly = (Assembly)null; + Assembly assembly = null; if (name != null) assembly = AssemblyLoadResult.FindAssembly(name, out Exception _); str = assembly == null ? moduleName : assembly.Location; @@ -79,7 +79,7 @@ namespace Microsoft.Iris.OS int length = resource.IndexOf('!'); if (length == -1) { - host = (string)null; + host = null; identifier = resource; } else diff --git a/UIX/Microsoft/Iris/OS/FileResource.cs b/UIX/Microsoft/Iris/OS/FileResource.cs index 14ae503..14fcf3d 100644 --- a/UIX/Microsoft/Iris/OS/FileResource.cs +++ b/UIX/Microsoft/Iris/OS/FileResource.cs @@ -38,14 +38,14 @@ namespace Microsoft.Iris.OS private void OnFileDownloadComplete(IntPtr handle, int error, uint length, IntPtr context) { IntPtr buffer = IntPtr.Zero; - string errorDetails = (string)null; + string errorDetails = null; if (error == 0) buffer = NativeApi.DownloadGetBuffer(this._handle); else - errorDetails = string.Format("Failed to complete download from '{0}'", (object)this._filePath); + errorDetails = string.Format("Failed to complete download from '{0}'", _filePath); int num = (int)NativeApi.SpDownloadClose(this._handle); this._handle = IntPtr.Zero; - this._pendingCallback = (NativeApi.DownloadCompleteHandler)null; + this._pendingCallback = null; this.NotifyAcquisitionComplete(buffer, length, true, errorDetails); } @@ -53,11 +53,11 @@ namespace Microsoft.Iris.OS { IntPtr num1 = IntPtr.Zero; uint num2 = 0; - string errorDetails = (string)null; + string errorDetails = null; IntPtr file = Win32Api.CreateFile(this._filePath, 2147483648U, 1U, IntPtr.Zero, 3U, 0U, IntPtr.Zero); if (file == Win32Api.INVALID_HANDLE_VALUE) { - errorDetails = string.Format("File not found: '{0}'", (object)this._filePath); + errorDetails = string.Format("File not found: '{0}'", _filePath); } else { @@ -84,7 +84,7 @@ namespace Microsoft.Iris.OS return; int num = (int)NativeApi.SpDownloadClose(this._handle); this._handle = IntPtr.Zero; - this._pendingCallback = (NativeApi.DownloadCompleteHandler)null; + this._pendingCallback = null; } } } diff --git a/UIX/Microsoft/Iris/OS/FileResources.cs b/UIX/Microsoft/Iris/OS/FileResources.cs index b318977..b868678 100644 --- a/UIX/Microsoft/Iris/OS/FileResources.cs +++ b/UIX/Microsoft/Iris/OS/FileResources.cs @@ -14,6 +14,6 @@ namespace Microsoft.Iris.OS public static FileResources Instance => FileResources.s_instance; - public Resource GetResource(string hierarchicalPart, string uri, bool forceSynchronous) => (Resource)new FileResource(uri, hierarchicalPart, forceSynchronous); + public Resource GetResource(string hierarchicalPart, string uri, bool forceSynchronous) => new FileResource(uri, hierarchicalPart, forceSynchronous); } } diff --git a/UIX/Microsoft/Iris/OS/HttpResource.cs b/UIX/Microsoft/Iris/OS/HttpResource.cs index 5ba9f5d..dd8ac20 100644 --- a/UIX/Microsoft/Iris/OS/HttpResource.cs +++ b/UIX/Microsoft/Iris/OS/HttpResource.cs @@ -30,25 +30,25 @@ namespace Microsoft.Iris.OS private void OnHttpDownloadComplete(IntPtr handle, int error, uint length, IntPtr context) { IntPtr buffer = IntPtr.Zero; - string errorDetails = (string)null; + string errorDetails = null; switch (error) { case 0: buffer = NativeApi.DownloadGetBuffer(this._handle); break; case 1: - errorDetails = string.Format("Invalid URI: '{0}'", (object)this._uri); + errorDetails = string.Format("Invalid URI: '{0}'", _uri); break; case 2: - errorDetails = string.Format("Unable to connect to web host: '{0}'", (object)this._uri); + errorDetails = string.Format("Unable to connect to web host: '{0}'", _uri); break; default: - errorDetails = string.Format("Failed to complete download from '{0}'", (object)this._uri); + errorDetails = string.Format("Failed to complete download from '{0}'", _uri); break; } int num = (int)NativeApi.SpDownloadClose(this._handle); this._handle = IntPtr.Zero; - this._pendingCallback = (NativeApi.DownloadCompleteHandler)null; + this._pendingCallback = null; this.NotifyAcquisitionComplete(buffer, length, true, errorDetails); } @@ -58,7 +58,7 @@ namespace Microsoft.Iris.OS return; int num = (int)NativeApi.SpDownloadClose(this._handle); this._handle = IntPtr.Zero; - this._pendingCallback = (NativeApi.DownloadCompleteHandler)null; + this._pendingCallback = null; } } } diff --git a/UIX/Microsoft/Iris/OS/HttpResources.cs b/UIX/Microsoft/Iris/OS/HttpResources.cs index 34ecc08..067b490 100644 --- a/UIX/Microsoft/Iris/OS/HttpResources.cs +++ b/UIX/Microsoft/Iris/OS/HttpResources.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.OS public static void Startup() { - ResourceManager.Instance.RegisterSource("http", (IResourceProvider)HttpResources.s_instance); + ResourceManager.Instance.RegisterSource("http", s_instance); NativeApi.SpHttpStartup(); } @@ -37,7 +37,7 @@ namespace Microsoft.Iris.OS HttpResources.s_activationChangeHandler = new EventHandler(HttpResources.OnActivationChanged); UISession.Default.Form.ActivationChange += HttpResources.s_activationChangeHandler; } - return (Resource)new HttpResource(url, forceSynchronous); + return new HttpResource(url, forceSynchronous); } } } diff --git a/UIX/Microsoft/Iris/OS/NativeXmlReader.cs b/UIX/Microsoft/Iris/OS/NativeXmlReader.cs index 00c4825..ae7e39e 100644 --- a/UIX/Microsoft/Iris/OS/NativeXmlReader.cs +++ b/UIX/Microsoft/Iris/OS/NativeXmlReader.cs @@ -28,7 +28,7 @@ namespace Microsoft.Iris.OS public NativeXmlReader(string content, bool isFragment) : this(false) { - this._gcHandle = GCHandle.Alloc((object)content, GCHandleType.Pinned); + this._gcHandle = GCHandle.Alloc(content, GCHandleType.Pinned); this.Init(this._gcHandle.AddrOfPinnedObject(), content.Length * 2, isFragment); } @@ -204,7 +204,7 @@ namespace Microsoft.Iris.OS private void ThrowXmlException(uint hr) { - string message = (string)null; + string message = null; switch (hr) { case 3222069277: diff --git a/UIX/Microsoft/Iris/OS/Win32Api.cs b/UIX/Microsoft/Iris/OS/Win32Api.cs index 96978dd..38c962e 100644 --- a/UIX/Microsoft/Iris/OS/Win32Api.cs +++ b/UIX/Microsoft/Iris/OS/Win32Api.cs @@ -121,7 +121,7 @@ namespace Microsoft.Iris.OS case 1170: throw new ArgumentOutOfRangeException(); default: - Marshal.ThrowExceptionForHR((int)lastWin32Error & (int)ushort.MaxValue | 458752 | int.MinValue); + Marshal.ThrowExceptionForHR((int)lastWin32Error & ushort.MaxValue | 458752 | int.MinValue); break; } } @@ -211,8 +211,8 @@ namespace Microsoft.Iris.OS private static string DumpMessageWorker(uint uMsg) { Win32Api.InitMessageDump(); - if ((long)uMsg >= (long)Win32Api.s_rgsMessageNames.Length) - return (string)null; + if (uMsg >= s_rgsMessageNames.Length) + return null; string rgsMessageName = Win32Api.s_rgsMessageNames[uMsg]; if (rgsMessageName != null) return rgsMessageName; @@ -224,7 +224,7 @@ namespace Microsoft.Iris.OS if (rgsMessageName != null) break; } - return rgsMessageName == null ? (string)null : InvariantString.Format("{0} + {1}", (object)rgsMessageName, (object)(uint)((int)uMsg - (int)num)); + return rgsMessageName == null ? null : InvariantString.Format("{0} + {1}", rgsMessageName, (uint)((int)uMsg - (int)num)); } private static void InitMessageDump() @@ -375,7 +375,7 @@ namespace Microsoft.Iris.OS public int pt_x; public int pt_y; - public override string ToString() => InvariantString.Format("{0} -> {1}, wp=0x{2,0:x} lp=0x{3,0:x}", (object)Win32Api.DumpMessage(this.message), (object)this.hwnd, (object)this.wParam, (object)this.lParam); + public override string ToString() => InvariantString.Format("{0} -> {1}, wp=0x{2,0:x} lp=0x{3,0:x}", Win32Api.DumpMessage(this.message), hwnd, wParam, lParam); } public struct KEYBDINPUT diff --git a/UIX/Microsoft/Iris/PropertySet.cs b/UIX/Microsoft/Iris/PropertySet.cs index 4a8a2c8..34b6360 100644 --- a/UIX/Microsoft/Iris/PropertySet.cs +++ b/UIX/Microsoft/Iris/PropertySet.cs @@ -20,12 +20,12 @@ namespace Microsoft.Iris } public PropertySet(IModelItemOwner owner) - : this(owner, (string)null) + : this(owner, null) { } public PropertySet() - : this((IModelItemOwner)null) + : this(null) { } @@ -34,7 +34,7 @@ namespace Microsoft.Iris get { using (this.ThreadValidator) - return (IDictionary)this; + return this; } } @@ -45,7 +45,7 @@ namespace Microsoft.Iris using (this.ThreadValidator) { object obj; - return this._valuesTable.TryGetValue(key, out obj) ? obj : (object)null; + return this._valuesTable.TryGetValue(key, out obj) ? obj : null; } } set @@ -102,7 +102,7 @@ namespace Microsoft.Iris IDictionaryEnumerator IDictionary.GetEnumerator() { using (this.ThreadValidator) - return (IDictionaryEnumerator)this._valuesTable.GetEnumerator(); + return this._valuesTable.GetEnumerator(); } bool IDictionary.IsFixedSize => false; @@ -114,7 +114,7 @@ namespace Microsoft.Iris get { using (this.ThreadValidator) - return (ICollection)this._valuesTable.Keys; + return _valuesTable.Keys; } } @@ -123,7 +123,7 @@ namespace Microsoft.Iris get { using (this.ThreadValidator) - return (ICollection)this._valuesTable.Values; + return _valuesTable.Values; } } @@ -149,14 +149,14 @@ namespace Microsoft.Iris get { using (this.ThreadValidator) - return (object)this._valuesTable; + return _valuesTable; } } IEnumerator IEnumerable.GetEnumerator() { using (this.ThreadValidator) - return (IEnumerator)this._valuesTable.GetEnumerator(); + return this._valuesTable.GetEnumerator(); } private void NotifyEntryChange(object key) => this.FirePropertyChanged("#" + key.ToString()); diff --git a/UIX/Microsoft/Iris/Queues/Dispatcher.cs b/UIX/Microsoft/Iris/Queues/Dispatcher.cs index 7ad23b8..8b88c24 100644 --- a/UIX/Microsoft/Iris/Queues/Dispatcher.cs +++ b/UIX/Microsoft/Iris/Queues/Dispatcher.cs @@ -29,7 +29,7 @@ namespace Microsoft.Iris.Queues public void FinalStopDispatch() { this.LeaveDispatch(); - this._feeder = (Feeder)null; + this._feeder = null; } public void Dispose() @@ -97,7 +97,7 @@ namespace Microsoft.Iris.Queues --this._enterCount; bool isRoot = this._enterCount == 0U; if (isRoot) - Dispatcher.s_threadDispatcher = (Dispatcher)null; + Dispatcher.s_threadDispatcher = null; Dispatcher.s_interconnect.LeaveDispatch(this, isRoot); } diff --git a/UIX/Microsoft/Iris/Queues/Feeder.cs b/UIX/Microsoft/Iris/Queues/Feeder.cs index e11eb4c..ba5072f 100644 --- a/UIX/Microsoft/Iris/Queues/Feeder.cs +++ b/UIX/Microsoft/Iris/Queues/Feeder.cs @@ -22,7 +22,7 @@ namespace Microsoft.Iris.Queues this._dispatcher.NotifyFeederItems(); } - public void LeaveDispatch(Dispatcher dispatcher) => this._dispatcher = (Dispatcher)null; + public void LeaveDispatch(Dispatcher dispatcher) => this._dispatcher = null; public void PostItem(QueueItem item, int priority) { @@ -49,7 +49,7 @@ namespace Microsoft.Iris.Queues lock (this) { QueueItem.FIFO[] fifos = this._fifos; - this._fifos = (QueueItem.FIFO[])null; + this._fifos = null; this._hasItems = false; return fifos; } diff --git a/UIX/Microsoft/Iris/Queues/PriorityQueue.cs b/UIX/Microsoft/Iris/Queues/PriorityQueue.cs index d477bb6..e427273 100644 --- a/UIX/Microsoft/Iris/Queues/PriorityQueue.cs +++ b/UIX/Microsoft/Iris/Queues/PriorityQueue.cs @@ -70,7 +70,7 @@ namespace Microsoft.Iris.Queues Queue queue = queues[priority]; if (queue == null) { - queue = (Queue)new SimpleQueue(); + queue = new SimpleQueue(); queues[priority] = queue; } PriorityQueue.WakeProxy wakeProxy = new PriorityQueue.WakeProxy(this, priority, queue); @@ -124,7 +124,7 @@ namespace Microsoft.Iris.Queues int subsetMask = 0; for (int index = 0; index < priorities.Length; ++index) subsetMask |= 1 << priorities[index]; - return (Queue)new PriorityQueue.SubsetQueue(this, subsetMask, ignoreLocks); + return new PriorityQueue.SubsetQueue(this, subsetMask, ignoreLocks); } public override QueueItem GetNextItem() => this.GetNextItemWorker(this._allQueues, false); @@ -132,7 +132,7 @@ namespace Microsoft.Iris.Queues private QueueItem GetNextItemWorker(int subsetMask, bool ignoreLocks) { int mask = this.BeginReadLoop(subsetMask, ignoreLocks); - QueueItem queueItem = (QueueItem)null; + QueueItem queueItem = null; while (mask != 0) { int lowestBit = PriorityQueue.FindLowestBit(mask); @@ -202,12 +202,12 @@ namespace Microsoft.Iris.Queues private static int FindLowestBit(int mask) { int num = 0; - if ((mask & (int)ushort.MaxValue) == 0) + if ((mask & ushort.MaxValue) == 0) { num += 16; mask >>= 16; } - if ((mask & (int)byte.MaxValue) == 0) + if ((mask & byte.MaxValue) == 0) { num += 8; mask >>= 8; diff --git a/UIX/Microsoft/Iris/Queues/Queue.cs b/UIX/Microsoft/Iris/Queues/Queue.cs index 8bc373e..fbfe618 100644 --- a/UIX/Microsoft/Iris/Queues/Queue.cs +++ b/UIX/Microsoft/Iris/Queues/Queue.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Queues { if (this.Wake == null) return; - this.Wake((object)this, EventArgs.Empty); + this.Wake(this, EventArgs.Empty); } public virtual void Dispose() diff --git a/UIX/Microsoft/Iris/Queues/QueueItem.cs b/UIX/Microsoft/Iris/Queues/QueueItem.cs index 2ccb30a..c59aee3 100644 --- a/UIX/Microsoft/Iris/Queues/QueueItem.cs +++ b/UIX/Microsoft/Iris/Queues/QueueItem.cs @@ -36,14 +36,14 @@ namespace Microsoft.Iris.Queues protected void Link(QueueItem item, QueueItem anchor, bool before) { - this.UpdateOwners(item, item, (QueueItem.Chain)null, this); + this.UpdateOwners(item, item, null, this); this.LinkItems(item, item, anchor, before); } protected void Unlink(QueueItem item) { this.UnlinkItems(item, item); - this.UpdateOwners(item, item, this, (QueueItem.Chain)null); + this.UpdateOwners(item, item, this, null); } protected void TransferFromChain( @@ -94,8 +94,8 @@ namespace Microsoft.Iris.Queues first._prev._next = last._next; last._next._prev = first._prev; } - first._prev = (QueueItem)null; - last._next = (QueueItem)null; + first._prev = null; + last._next = null; } private void UpdateOwners( @@ -127,7 +127,7 @@ namespace Microsoft.Iris.Queues public ChainEnumerator(QueueItem tail) { - this._currentItem = (QueueItem)null; + this._currentItem = null; this._stopItem = tail; } @@ -137,14 +137,14 @@ namespace Microsoft.Iris.Queues { if (this._stopItem == null) { - this._currentItem = (QueueItem)null; + this._currentItem = null; return false; } if (this._currentItem != null) { if (this._currentItem == this._stopItem) { - this._currentItem = this._stopItem = (QueueItem)null; + this._currentItem = this._stopItem = null; return false; } this._currentItem = this._currentItem._next; @@ -164,7 +164,7 @@ namespace Microsoft.Iris.Queues { get { - QueueItem queueItem = (QueueItem)null; + QueueItem queueItem = null; if (this._tail != null) queueItem = this._tail._next; return queueItem; @@ -193,8 +193,8 @@ namespace Microsoft.Iris.Queues QueueItem tail = items._tail; if (tail == null) return false; - this.TransferFromChain((QueueItem.Chain)items, items.Head, tail, this._tail, false); - items._tail = (QueueItem)null; + this.TransferFromChain(items, items.Head, tail, this._tail, false); + items._tail = null; this._tail = tail; return flag; } @@ -203,7 +203,7 @@ namespace Microsoft.Iris.Queues { this.ValidateRemove(item); if (item == this._tail) - this._tail = QueueItem.Chain.IsOnlyChild(this._tail) ? (QueueItem)null : QueueItem.Chain.PrevItem(this._tail); + this._tail = QueueItem.Chain.IsOnlyChild(this._tail) ? null : QueueItem.Chain.PrevItem(this._tail); this.Unlink(item); } @@ -242,7 +242,7 @@ namespace Microsoft.Iris.Queues { this._top = top._next; if (this._top == top) - this._top = (QueueItem)null; + this._top = null; this.Unlink(top); } return top; diff --git a/UIX/Microsoft/Iris/RangedValue.cs b/UIX/Microsoft/Iris/RangedValue.cs index 240e618..af65379 100644 --- a/UIX/Microsoft/Iris/RangedValue.cs +++ b/UIX/Microsoft/Iris/RangedValue.cs @@ -34,12 +34,12 @@ namespace Microsoft.Iris => this.Initialize(); public RangedValue(IModelItemOwner owner) - : this(owner, (string)null) + : this(owner, null) { } public RangedValue() - : this((IModelItemOwner)null) + : this(null) { } @@ -78,7 +78,7 @@ namespace Microsoft.Iris set { using (this.ThreadValidator) - this._rangedValue.MinValue = (double)value <= (double)this.MaxValue ? value : throw new ArgumentException(InvariantString.Format("MinValue must be less than or equal to MaxValue. Value Supplied was {0}, MaxValue is {1}", (object)value, (object)this.MaxValue)); + this._rangedValue.MinValue = value <= (double)this.MaxValue ? value : throw new ArgumentException(InvariantString.Format("MinValue must be less than or equal to MaxValue. Value Supplied was {0}, MaxValue is {1}", value, MaxValue)); } } @@ -92,7 +92,7 @@ namespace Microsoft.Iris set { using (this.ThreadValidator) - this._rangedValue.MaxValue = (double)value >= (double)this.MinValue ? value : throw new ArgumentException(InvariantString.Format("MaxValue must be greater than or equal to MinValue. Value Supplied was {0}, MinValue is {1}", (object)value, (object)this.MinValue)); + this._rangedValue.MaxValue = value >= (double)this.MinValue ? value : throw new ArgumentException(InvariantString.Format("MaxValue must be greater than or equal to MinValue. Value Supplied was {0}, MinValue is {1}", value, MinValue)); } } @@ -155,29 +155,29 @@ namespace Microsoft.Iris if (disposing) { this._notifier.ClearListeners(); - this._listeners.Dispose((object)this); + this._listeners.Dispose(this); } - this._rangedValue = (Microsoft.Iris.ModelItems.RangedValue)null; + this._rangedValue = null; } - object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => (object)this; + object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => this; - object AssemblyObjectProxyHelper.IAssemblyProxyObject.AssemblyObject => (object)this; + object AssemblyObjectProxyHelper.IAssemblyProxyObject.AssemblyObject => this; private void Initialize() { this._rangedValue = this.CreateInternalRangedValue(); Vector listeners = new Vector(7); DelegateListener.OnNotifyCallback callback = new DelegateListener.OnNotifyCallback(this.OnInternalPropertyChanged); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._rangedValue, NotificationID.MinValue, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._rangedValue, NotificationID.MaxValue, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._rangedValue, NotificationID.Step, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._rangedValue, NotificationID.Range, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._rangedValue, NotificationID.Value, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._rangedValue, NotificationID.HasPreviousValue, callback)); - listeners.Add((Listener)new DelegateListener((INotifyObject)this._rangedValue, NotificationID.HasNextValue, callback)); + listeners.Add(new DelegateListener(_rangedValue, NotificationID.MinValue, callback)); + listeners.Add(new DelegateListener(_rangedValue, NotificationID.MaxValue, callback)); + listeners.Add(new DelegateListener(_rangedValue, NotificationID.Step, callback)); + listeners.Add(new DelegateListener(_rangedValue, NotificationID.Range, callback)); + listeners.Add(new DelegateListener(_rangedValue, NotificationID.Value, callback)); + listeners.Add(new DelegateListener(_rangedValue, NotificationID.HasPreviousValue, callback)); + listeners.Add(new DelegateListener(_rangedValue, NotificationID.HasNextValue, callback)); this._listeners = new CodeListeners(listeners); - this._listeners.DeclareOwner((object)this); + this._listeners.DeclareOwner(this); } internal virtual Microsoft.Iris.ModelItems.RangedValue CreateInternalRangedValue() => new Microsoft.Iris.ModelItems.RangedValue(); diff --git a/UIX/Microsoft/Iris/RenderAPI/Audio/SoundData.cs b/UIX/Microsoft/Iris/RenderAPI/Audio/SoundData.cs index 6a8ce9f..4799b63 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Audio/SoundData.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Audio/SoundData.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.RenderAPI.Audio public void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } @@ -93,17 +93,17 @@ namespace Microsoft.Iris.RenderAPI.Audio this._soundHandle = ExtensionsApi.HSpSound.NULL; } - public static string GetCacheKey(string stSource) => InvariantString.Format("SND|{0}", (object)stSource); + public static string GetCacheKey(string stSource) => InvariantString.Format("SND|{0}", stSource); SoundDataFormat ISoundData.Format => (SoundDataFormat)this._soundInfo.Header.wFormatTag; - uint ISoundData.ChannelCount => (uint)this._soundInfo.Header.nChannels; + uint ISoundData.ChannelCount => _soundInfo.Header.nChannels; uint ISoundData.SampleRate => this._soundInfo.Header.nSamplesPerSec; - uint ISoundData.SampleSize => (uint)this._soundInfo.Header.wBitsPerSample; + uint ISoundData.SampleSize => _soundInfo.Header.wBitsPerSample; - uint ISoundData.SampleCount => this._soundInfo.Header.cbDataSize * 8U / (uint)this._soundInfo.Header.wBitsPerSample; + uint ISoundData.SampleCount => this._soundInfo.Header.cbDataSize * 8U / _soundInfo.Header.wBitsPerSample; IntPtr ISoundData.AcquireContent() { diff --git a/UIX/Microsoft/Iris/RenderAPI/Audio/SoundManager.cs b/UIX/Microsoft/Iris/RenderAPI/Audio/SoundManager.cs index bedfd12..4a2186a 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Audio/SoundManager.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Audio/SoundManager.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.RenderAPI.Audio public void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } @@ -42,7 +42,7 @@ namespace Microsoft.Iris.RenderAPI.Audio foreach (SoundManager.SoundContent soundContent in this._dictContent.Values) { if (soundContent.soundBuffer != null) - soundContent.soundBuffer.UnregisterUsage((object)this); + soundContent.soundBuffer.UnregisterUsage(this); if (soundContent.soundData != null) { soundContent.soundData.Unload(); @@ -51,9 +51,9 @@ namespace Microsoft.Iris.RenderAPI.Audio } this._dictContent.Clear(); } - this._dictContent = (Dictionary)null; - this._renderSession = (IRenderSession)null; - this._uiSession = (UISession)null; + this._dictContent = null; + this._renderSession = null; + this._uiSession = null; } internal string GetSystemSoundEventSource(SystemSoundEvent systemSoundEvent) @@ -61,7 +61,7 @@ namespace Microsoft.Iris.RenderAPI.Audio if (this._systemSoundEventTable == null) this._systemSoundEventTable = new SystemSoundEventTable(); string filePath = this._systemSoundEventTable.GetFilePath(systemSoundEvent); - return string.IsNullOrEmpty(filePath) ? (string)null : string.Format("file://{0}", (object)filePath); + return string.IsNullOrEmpty(filePath) ? null : string.Format("file://{0}", filePath); } public void SetVolume(float flVolume) @@ -87,14 +87,14 @@ namespace Microsoft.Iris.RenderAPI.Audio { Resource resource = ResourceManager.Instance.GetResource(source); if (resource == null) - return (ISoundBuffer)null; + return null; soundContent = new SoundManager.SoundContent(); soundContent.soundData = new SoundData(cacheKey, resource); soundContent.soundData.Load(); flag = true; } if (soundContent.soundBuffer == null && soundContent.soundData.IsAvailable && this._renderSession.SoundDevice != null) - soundContent.soundBuffer = this._renderSession.SoundDevice.CreateSoundBuffer((object)this, (ISoundData)soundContent.soundData); + soundContent.soundBuffer = this._renderSession.SoundDevice.CreateSoundBuffer(this, soundContent.soundData); if (flag) this._dictContent[cacheKey] = soundContent; return soundContent.soundBuffer; diff --git a/UIX/Microsoft/Iris/RenderAPI/Audio/SystemSoundEventTable.cs b/UIX/Microsoft/Iris/RenderAPI/Audio/SystemSoundEventTable.cs index 5b30a0e..0ad83c8 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Audio/SystemSoundEventTable.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Audio/SystemSoundEventTable.cs @@ -58,7 +58,7 @@ namespace Microsoft.Iris.RenderAPI.Audio RegistryKey registryKey2 = registryKey1.OpenSubKey(systemSound.RegistrySubKey + "\\.Current"); if (registryKey2 != null) { - registryKey2.ReadString((string)null, out systemSound.FilePath); + registryKey2.ReadString(null, out systemSound.FilePath); registryKey2.Close(); } } diff --git a/UIX/Microsoft/Iris/RenderAPI/Drawing/Dib.cs b/UIX/Microsoft/Iris/RenderAPI/Drawing/Dib.cs index 490af38..7fc7116 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Drawing/Dib.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Drawing/Dib.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.RenderAPI.Drawing public void Dispose() { - GC.SuppressFinalize((object)this); + GC.SuppressFinalize(this); this.Dispose(true); } diff --git a/UIX/Microsoft/Iris/RenderAPI/Drawing/EdgeFade.cs b/UIX/Microsoft/Iris/RenderAPI/Drawing/EdgeFade.cs index 9d49209..300783c 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Drawing/EdgeFade.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Drawing/EdgeFade.cs @@ -25,7 +25,7 @@ namespace Microsoft.Iris.RenderAPI.Drawing public EdgeFade() { this._orientation = Orientation.Horizontal; - this._maskColor = Color.FromArgb((int)byte.MaxValue, 0, 0, 0); + this._maskColor = Color.FromArgb(byte.MaxValue, 0, 0, 0); this._fadeAmountValue = 1f; } @@ -35,13 +35,13 @@ namespace Microsoft.Iris.RenderAPI.Drawing { if (this._minFadeGradient != null) { - this._minFadeGradient.UnregisterUsage((object)this); - this._minFadeGradient = (IGradient)null; + this._minFadeGradient.UnregisterUsage(this); + this._minFadeGradient = null; } if (this._maxFadeGradient == null) return; - this._maxFadeGradient.UnregisterUsage((object)this); - this._maxFadeGradient = (IGradient)null; + this._maxFadeGradient.UnregisterUsage(this); + this._maxFadeGradient = null; } public float FadeSize @@ -49,7 +49,7 @@ namespace Microsoft.Iris.RenderAPI.Drawing get => this._fadeSizeValue; set { - if ((double)this._fadeSizeValue == (double)value) + if (_fadeSizeValue == (double)value) return; this._fadeSizeValue = value; this.UpdateFades(true); @@ -61,9 +61,9 @@ namespace Microsoft.Iris.RenderAPI.Drawing get => this._fadeAmountValue; set { - if ((double)value < 0.0 || (double)value > 1.0) - throw new ArgumentOutOfRangeException(nameof(value), (object)value, "FadeAmount must be between 0.0 and 1.0."); - if ((double)this._fadeAmountValue == (double)value) + if (value < 0.0 || value > 1.0) + throw new ArgumentOutOfRangeException(nameof(value), value, "FadeAmount must be between 0.0 and 1.0."); + if (_fadeAmountValue == (double)value) return; this._fadeAmountValue = value; this.UpdateFades(true); @@ -75,7 +75,7 @@ namespace Microsoft.Iris.RenderAPI.Drawing get => this._minOffsetValue; set { - if ((double)this._minOffsetValue == (double)value) + if (_minOffsetValue == (double)value) return; this._minOffsetValue = value; this.UpdateFades(true); @@ -87,7 +87,7 @@ namespace Microsoft.Iris.RenderAPI.Drawing get => this._maxOffsetValue; set { - if ((double)this._maxOffsetValue == (double)value) + if (_maxOffsetValue == (double)value) return; this._maxOffsetValue = value; this.UpdateFades(true); @@ -134,7 +134,7 @@ namespace Microsoft.Iris.RenderAPI.Drawing visContainer.AddGradient(this._maxFadeGradient); } - internal bool NeedFades => (double)this._fadeSizeValue != 0.0 && (double)this._fadeAmountValue != 0.0; + internal bool NeedFades => _fadeSizeValue != 0.0 && _fadeAmountValue != 0.0; private void CreateFades(IRenderSession renderSession) { @@ -142,13 +142,13 @@ namespace Microsoft.Iris.RenderAPI.Drawing return; if (this._minFadeGradient == null) { - this._minFadeGradient = renderSession.CreateGradient((object)this); + this._minFadeGradient = renderSession.CreateGradient(this); this._minFadeGradient.Orientation = this._orientation; this._minFadeGradient.ColorMask = this._maskColor.RenderConvert(); } if (this._maxFadeGradient != null) return; - this._maxFadeGradient = renderSession.CreateGradient((object)this); + this._maxFadeGradient = renderSession.CreateGradient(this); this._maxFadeGradient.Orientation = this._orientation; this._maxFadeGradient.ColorMask = this._maskColor.RenderConvert(); } @@ -185,7 +185,7 @@ namespace Microsoft.Iris.RenderAPI.Drawing flPosition1 = -this._maxOffsetValue; flPosition2 = -this._minOffsetValue; } - if ((double)this.FadeSize > 0.0) + if (FadeSize > 0.0) { this._minFadeGradient.AddValue(flPosition1, flValue2, RelativeSpace.Min); this._minFadeGradient.AddValue(flPosition1 + this.FadeSize, flValue1, RelativeSpace.Min); diff --git a/UIX/Microsoft/Iris/RenderAPI/Drawing/PointF.cs b/UIX/Microsoft/Iris/RenderAPI/Drawing/PointF.cs index bdc0ab1..f8dc80b 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Drawing/PointF.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Drawing/PointF.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.RenderAPI.Drawing this.y = y; } - internal bool IsZero => (double)this.X == 0.0 && (double)this.Y == 0.0; + internal bool IsZero => X == 0.0 && Y == 0.0; public float X { @@ -37,23 +37,23 @@ namespace Microsoft.Iris.RenderAPI.Drawing set => this.y = value; } - public static PointF operator +(PointF pt, Size sz) => new PointF(pt.X + (float)sz.Width, pt.Y + (float)sz.Height); + public static PointF operator +(PointF pt, Size sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height); public static PointF operator +(PointF pt, SizeF sz) => new PointF(pt.X + sz.Width, pt.Y + sz.Height); - public static PointF operator -(PointF pt, Size sz) => new PointF(pt.X - (float)sz.Width, pt.Y - (float)sz.Height); + public static PointF operator -(PointF pt, Size sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height); public static PointF operator -(PointF pt, SizeF sz) => new PointF(pt.X - sz.Width, pt.Y - sz.Height); public static SizeF operator -(PointF pt1, PointF pt2) => new SizeF(pt1.X - pt2.X, pt1.Y - pt2.Y); - public static bool operator ==(PointF left, PointF right) => (double)left.X == (double)right.X && (double)left.Y == (double)right.Y; + public static bool operator ==(PointF left, PointF right) => left.X == (double)right.X && left.Y == (double)right.Y; public static bool operator !=(PointF left, PointF right) => !(left == right); public Point ToPoint() => new Point((int)this.x, (int)this.y); - public override bool Equals(object obj) => obj is PointF pointF && (double)pointF.X == (double)this.X && (double)pointF.Y == (double)this.Y; + public override bool Equals(object obj) => obj is PointF pointF && pointF.X == (double)this.X && pointF.Y == (double)this.Y; public override int GetHashCode() => this.x.GetHashCode() ^ this.y.GetHashCode(); @@ -61,9 +61,9 @@ namespace Microsoft.Iris.RenderAPI.Drawing { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.Append("(X="); - stringBuilder.Append(this.X.ToString((IFormatProvider)NumberFormatInfo.InvariantInfo)); + stringBuilder.Append(this.X.ToString(NumberFormatInfo.InvariantInfo)); stringBuilder.Append(", Y="); - stringBuilder.Append(this.Y.ToString((IFormatProvider)NumberFormatInfo.InvariantInfo)); + stringBuilder.Append(this.Y.ToString(NumberFormatInfo.InvariantInfo)); stringBuilder.Append(")"); return stringBuilder.ToString(); } diff --git a/UIX/Microsoft/Iris/RenderAPI/Drawing/RectangleF.cs b/UIX/Microsoft/Iris/RenderAPI/Drawing/RectangleF.cs index b20cfa8..c152238 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Drawing/RectangleF.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Drawing/RectangleF.cs @@ -39,15 +39,15 @@ namespace Microsoft.Iris.RenderAPI.Drawing public RectangleF(Point location, Microsoft.Iris.Render.Size size) { - this.x = (float)location.X; - this.y = (float)location.Y; - this.width = (float)size.Width; - this.height = (float)size.Height; + this.x = location.X; + this.y = location.Y; + this.width = size.Width; + this.height = size.Height; } public static RectangleF FromLTRB(float left, float top, float right, float bottom) => new RectangleF(left, top, right - left, bottom - top); - public static RectangleF FromRectangle(Rectangle r) => new RectangleF((float)r.X, (float)r.Y, (float)r.Width, (float)r.Height); + public static RectangleF FromRectangle(Rectangle r) => new RectangleF(r.X, r.Y, r.Width, r.Height); public PointF Location { @@ -103,17 +103,17 @@ namespace Microsoft.Iris.RenderAPI.Drawing public bool IsEmpty => Math2.WithinEpsilon(this.width, 0.0f) || Math2.WithinEpsilon(this.height, 0.0f); - public override bool Equals(object obj) => obj is RectangleF rectangleF && (double)rectangleF.X == (double)this.X && ((double)rectangleF.Y == (double)this.Y && (double)rectangleF.Width == (double)this.Width) && (double)rectangleF.Height == (double)this.Height; + public override bool Equals(object obj) => obj is RectangleF rectangleF && rectangleF.X == (double)this.X && (rectangleF.Y == (double)this.Y && rectangleF.Width == (double)this.Width) && rectangleF.Height == (double)this.Height; - public static bool operator ==(RectangleF left, RectangleF right) => (double)left.X == (double)right.X && (double)left.Y == (double)right.Y && (double)left.Width == (double)right.Width && (double)left.Height == (double)right.Height; + public static bool operator ==(RectangleF left, RectangleF right) => left.X == (double)right.X && left.Y == (double)right.Y && left.Width == (double)right.Width && left.Height == (double)right.Height; public static bool operator !=(RectangleF left, RectangleF right) => !(left == right); - public bool Contains(float x, float y) => (double)this.X <= (double)x && (double)x < (double)this.X + (double)this.Width && (double)this.Y <= (double)y && (double)y < (double)this.Y + (double)this.Height; + public bool Contains(float x, float y) => X <= (double)x && x < X + (double)this.Width && Y <= (double)y && y < Y + (double)this.Height; public bool Contains(PointF pt) => this.Contains(pt.X, pt.Y); - public bool Contains(RectangleF rect) => (double)this.X <= (double)rect.X && (double)rect.X + (double)rect.Width <= (double)this.X + (double)this.Width && (double)this.Y <= (double)rect.Y && (double)rect.Y + (double)rect.Height <= (double)this.Y + (double)this.Height; + public bool Contains(RectangleF rect) => X <= (double)rect.X && rect.X + (double)rect.Width <= X + (double)this.Width && Y <= (double)rect.Y && rect.Y + (double)rect.Height <= Y + (double)this.Height; public override int GetHashCode() => (int)(uint)this.X ^ ((int)(uint)this.Y << 13 | (int)((uint)this.Y >> 19)) ^ ((int)(uint)this.Width << 26 | (int)((uint)this.Width >> 6)) ^ ((int)(uint)this.Height << 7 | (int)((uint)this.Height >> 25)); @@ -149,10 +149,10 @@ namespace Microsoft.Iris.RenderAPI.Drawing float num1 = Math.Min(a.X + a.Width, b.X + b.Width); float y = Math.Max(a.Y, b.Y); float num2 = Math.Min(a.Y + a.Height, b.Y + b.Height); - return (double)num1 >= (double)x && (double)num2 >= (double)y ? new RectangleF(x, y, num1 - x, num2 - y) : RectangleF.Zero; + return num1 >= (double)x && num2 >= (double)y ? new RectangleF(x, y, num1 - x, num2 - y) : RectangleF.Zero; } - public bool IntersectsWith(RectangleF rect) => (double)this.Left < (double)rect.Right && (double)this.Top < (double)rect.Bottom && (double)this.Right > (double)rect.Left && (double)this.Bottom > (double)rect.Top; + public bool IntersectsWith(RectangleF rect) => Left < (double)rect.Right && Top < (double)rect.Bottom && Right > (double)rect.Left && Bottom > (double)rect.Top; public static RectangleF Union(RectangleF a, RectangleF b) { @@ -191,13 +191,13 @@ namespace Microsoft.Iris.RenderAPI.Drawing { StringBuilder stringBuilder = new StringBuilder(128); stringBuilder.Append("(X="); - stringBuilder.Append(this.X.ToString((IFormatProvider)NumberFormatInfo.InvariantInfo)); + stringBuilder.Append(this.X.ToString(NumberFormatInfo.InvariantInfo)); stringBuilder.Append(", Y="); - stringBuilder.Append(this.Y.ToString((IFormatProvider)NumberFormatInfo.InvariantInfo)); + stringBuilder.Append(this.Y.ToString(NumberFormatInfo.InvariantInfo)); stringBuilder.Append(", Width="); - stringBuilder.Append(this.Width.ToString((IFormatProvider)NumberFormatInfo.InvariantInfo)); + stringBuilder.Append(this.Width.ToString(NumberFormatInfo.InvariantInfo)); stringBuilder.Append(", Height="); - stringBuilder.Append(this.Height.ToString((IFormatProvider)NumberFormatInfo.InvariantInfo)); + stringBuilder.Append(this.Height.ToString(NumberFormatInfo.InvariantInfo)); stringBuilder.Append(")"); return stringBuilder.ToString(); } diff --git a/UIX/Microsoft/Iris/RenderAPI/Drawing/SizeF.cs b/UIX/Microsoft/Iris/RenderAPI/Drawing/SizeF.cs index c199ca9..6196482 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Drawing/SizeF.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Drawing/SizeF.cs @@ -39,13 +39,13 @@ namespace Microsoft.Iris.RenderAPI.Drawing public static SizeF operator -(SizeF sz1, SizeF sz2) => new SizeF(sz1.Width - sz2.Width, sz1.Height - sz2.Height); - public static bool operator ==(SizeF sz1, SizeF sz2) => (double)sz1.Width == (double)sz2.Width && (double)sz1.Height == (double)sz2.Height; + public static bool operator ==(SizeF sz1, SizeF sz2) => sz1.Width == (double)sz2.Width && sz1.Height == (double)sz2.Height; public static bool operator !=(SizeF sz1, SizeF sz2) => !(sz1 == sz2); public PointF ToPointF() => new PointF(this.Width, this.Height); - internal bool IsZero => (double)this.Width == 0.0 && (double)this.Height == 0.0; + internal bool IsZero => Width == 0.0 && Height == 0.0; public float Width { @@ -72,9 +72,9 @@ namespace Microsoft.Iris.RenderAPI.Drawing return sizeF; } - public override bool Equals(object obj) => obj is SizeF sizeF && (double)sizeF.Width == (double)this.Width && (double)sizeF.Height == (double)this.Height; + public override bool Equals(object obj) => obj is SizeF sizeF && sizeF.Width == (double)this.Width && sizeF.Height == (double)this.Height; - public bool Equals(SizeF comp) => (double)comp.Width == (double)this.Width && (double)comp.Height == (double)this.Height; + public bool Equals(SizeF comp) => comp.Width == (double)this.Width && comp.Height == (double)this.Height; public override int GetHashCode() => this.width.GetHashCode() ^ this.height.GetHashCode(); @@ -86,9 +86,9 @@ namespace Microsoft.Iris.RenderAPI.Drawing { StringBuilder stringBuilder = new StringBuilder(32); stringBuilder.Append("(Width="); - stringBuilder.Append(this.Width.ToString((IFormatProvider)NumberFormatInfo.InvariantInfo)); + stringBuilder.Append(this.Width.ToString(NumberFormatInfo.InvariantInfo)); stringBuilder.Append(", Height="); - stringBuilder.Append(this.Height.ToString((IFormatProvider)NumberFormatInfo.InvariantInfo)); + stringBuilder.Append(this.Height.ToString(NumberFormatInfo.InvariantInfo)); stringBuilder.Append(")"); return stringBuilder.ToString(); } diff --git a/UIX/Microsoft/Iris/RenderAPI/HRESULT.cs b/UIX/Microsoft/Iris/RenderAPI/HRESULT.cs index a9618b1..adcef5a 100644 --- a/UIX/Microsoft/Iris/RenderAPI/HRESULT.cs +++ b/UIX/Microsoft/Iris/RenderAPI/HRESULT.cs @@ -24,7 +24,7 @@ namespace Microsoft.Iris.RenderAPI public override int GetHashCode() => this.hr; - public override string ToString() => "hr:" + this.hr.ToString("X", (IFormatProvider)CultureInfo.InvariantCulture); + public override string ToString() => "hr:" + this.hr.ToString("X", CultureInfo.InvariantCulture); public bool IsError() => this.hr < 0; diff --git a/UIX/Microsoft/Iris/RenderAPI/Memory.cs b/UIX/Microsoft/Iris/RenderAPI/Memory.cs index 906bebb..2cbfa2a 100644 --- a/UIX/Microsoft/Iris/RenderAPI/Memory.cs +++ b/UIX/Microsoft/Iris/RenderAPI/Memory.cs @@ -29,7 +29,7 @@ namespace Microsoft.Iris.RenderAPI byte* numPtr = (byte*)pointer; int num3 = cbZero - num1 * 4; while (num3-- > 0) - *numPtr++ = (byte)0; + *numPtr++ = 0; } public static unsafe void Copy(IntPtr pvDest, IntPtr pvSrc, int cbCopy) @@ -62,17 +62,17 @@ namespace Microsoft.Iris.RenderAPI while (num1-- > 0) { uint num2 = *pointer2++; - *pointer1++ = (uint)((int)((num2 & 4278190080U) >> 8) | ((int)num2 & 16711680) << 8 | (int)((num2 & 65280U) >> 8) | ((int)num2 & (int)byte.MaxValue) << 8); + *pointer1++ = (uint)((int)((num2 & 4278190080U) >> 8) | ((int)num2 & 16711680) << 8 | (int)((num2 & 65280U) >> 8) | ((int)num2 & byte.MaxValue) << 8); } if (cbConvert % 4 == 0) break; ushort* numPtr1 = (ushort*)pointer1; ushort* numPtr2 = (ushort*)pointer1; - ushort* numPtr3 = (ushort*)(numPtr2 + 2); + ushort* numPtr3 = numPtr2 + 2; ushort num3 = *numPtr2; ushort* numPtr4 = numPtr1; - ushort* numPtr5 = (ushort*)(numPtr4 + 2); - int num4 = (int)(ushort)(((int)num3 & 65280) >> 8 | ((int)num3 & (int)byte.MaxValue) << 8); + ushort* numPtr5 = numPtr4 + 2; + int num4 = (ushort)((num3 & 65280) >> 8 | (num3 & byte.MaxValue) << 8); *numPtr4 = (ushort)num4; break; case 32: @@ -82,12 +82,12 @@ namespace Microsoft.Iris.RenderAPI while (num5-- > 0) { uint num2 = *pointer4++; - *pointer3++ = (uint)((int)((num2 & 4278190080U) >> 24) | (int)((num2 & 16711680U) >> 8) | ((int)num2 & 65280) << 8 | ((int)num2 & (int)byte.MaxValue) << 24); + *pointer3++ = (uint)((int)((num2 & 4278190080U) >> 24) | (int)((num2 & 16711680U) >> 8) | ((int)num2 & 65280) << 8 | ((int)num2 & byte.MaxValue) << 24); } break; } } - public static uint ConvertEndian(uint src) => (uint)((int)((src & 4278190080U) >> 24) | (int)((src & 16711680U) >> 8) | ((int)src & 65280) << 8 | ((int)src & (int)byte.MaxValue) << 24); + public static uint ConvertEndian(uint src) => (uint)((int)((src & 4278190080U) >> 24) | (int)((src & 16711680U) >> 8) | ((int)src & 65280) << 8 | ((int)src & byte.MaxValue) << 24); } } diff --git a/UIX/Microsoft/Iris/RenderAPI/RenderException.cs b/UIX/Microsoft/Iris/RenderAPI/RenderException.cs index 55e7127..131da3a 100644 --- a/UIX/Microsoft/Iris/RenderAPI/RenderException.cs +++ b/UIX/Microsoft/Iris/RenderAPI/RenderException.cs @@ -47,7 +47,7 @@ namespace Microsoft.Iris.RenderAPI public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); - info.AddValue("m_code", (object)this.m_code); + info.AddValue("m_code", m_code); } public enum ErrorCode diff --git a/UIX/Microsoft/Iris/RenderAPI/VideoPlayback/LinearVideoStretch.cs b/UIX/Microsoft/Iris/RenderAPI/VideoPlayback/LinearVideoStretch.cs index 8841712..cad4f17 100644 --- a/UIX/Microsoft/Iris/RenderAPI/VideoPlayback/LinearVideoStretch.cs +++ b/UIX/Microsoft/Iris/RenderAPI/VideoPlayback/LinearVideoStretch.cs @@ -23,7 +23,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback { RectangleF rectangleF1; RectangleF rectangleF2; - if ((double)(rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width) < (double)(rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height)) + if (rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width < (double)(rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height)) { float num1 = rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width; float height = rcfBoundSrcVideoPxl.Height * num1; @@ -58,7 +58,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback LinearVideoStretch.ApplyPillarboxAdjustment(ref rcfBoundSrcVideoPxl, rcfBoundDestViewPxl); RectangleF rectangleF1; RectangleF rectangleF2; - if ((double)(rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width) < (double)(rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height)) + if (rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width < (double)(rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height)) { float num1 = rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height; float width = rcfBoundDestViewPxl.Width / num1; @@ -105,10 +105,10 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback ref RectangleF rcfBoundSrcVideoPxl, RectangleF rcfBoundDestViewPxl) { - if ((double)Math.Abs(rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width - rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height) >= 0.1 || (double)rcfBoundDestViewPxl.Width / (double)rcfBoundDestViewPxl.Height <= 1.5 || (double)rcfBoundSrcVideoPxl.Width / (double)rcfBoundSrcVideoPxl.Height <= 1.5) + if (Math.Abs(rcfBoundDestViewPxl.Width / rcfBoundSrcVideoPxl.Width - rcfBoundDestViewPxl.Height / rcfBoundSrcVideoPxl.Height) >= 0.1 || rcfBoundDestViewPxl.Width / (double)rcfBoundDestViewPxl.Height <= 1.5 || rcfBoundSrcVideoPxl.Width / (double)rcfBoundSrcVideoPxl.Height <= 1.5) return; - float num = (float)((double)rcfBoundSrcVideoPxl.Height * 4.0 / 3.0); - rcfBoundSrcVideoPxl.X += (float)(((double)rcfBoundSrcVideoPxl.Width - (double)num) / 2.0); + float num = (float)(rcfBoundSrcVideoPxl.Height * 4.0 / 3.0); + rcfBoundSrcVideoPxl.X += (float)((rcfBoundSrcVideoPxl.Width - (double)num) / 2.0); rcfBoundSrcVideoPxl.Width = num; } } diff --git a/UIX/Microsoft/Iris/RenderAPI/VideoPlayback/VideoPresentationBuilder.cs b/UIX/Microsoft/Iris/RenderAPI/VideoPlayback/VideoPresentationBuilder.cs index c0e7a8e..45da270 100644 --- a/UIX/Microsoft/Iris/RenderAPI/VideoPlayback/VideoPresentationBuilder.cs +++ b/UIX/Microsoft/Iris/RenderAPI/VideoPlayback/VideoPresentationBuilder.cs @@ -92,7 +92,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback public BasicVideoPresentation BuildPresentation() { BasicVideoGeometry geometry = new BasicVideoGeometry(); - if ((double)this.m_rcfInputDestViewPxl.Width > 0.0 && (double)this.m_rcfInputDestViewPxl.Height > 0.0) + if (m_rcfInputDestViewPxl.Width > 0.0 && m_rcfInputDestViewPxl.Height > 0.0) { RectangleF rcfBoundSrcVideoPxl; RectangleF rcfBoundDestViewPxl; @@ -117,18 +117,18 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback float right = geometry.arrcfDestView[index].Right; float top = geometry.arrcfDestView[index].Top; float bottom = geometry.arrcfDestView[index].Bottom; - if ((double)Math.Abs(geometry.arrcfDestView[index].Top - geometry.rcfDestViewBounds.Top) < (double)num2) + if (Math.Abs(geometry.arrcfDestView[index].Top - geometry.rcfDestViewBounds.Top) < (double)num2) top = rcfDestViewBounds.Top; - if ((double)Math.Abs(geometry.arrcfDestView[index].Bottom - geometry.rcfDestViewBounds.Bottom) < (double)num2) + if (Math.Abs(geometry.arrcfDestView[index].Bottom - geometry.rcfDestViewBounds.Bottom) < (double)num2) bottom = rcfDestViewBounds.Bottom; - if ((double)Math.Abs(geometry.arrcfDestView[index].Left - geometry.rcfDestViewBounds.Left) < (double)num2) + if (Math.Abs(geometry.arrcfDestView[index].Left - geometry.rcfDestViewBounds.Left) < (double)num2) left = rcfDestViewBounds.Left; - if ((double)Math.Abs(geometry.arrcfDestView[index].Right - geometry.rcfDestViewBounds.Right) < (double)num2) + if (Math.Abs(geometry.arrcfDestView[index].Right - geometry.rcfDestViewBounds.Right) < (double)num2) right = rcfDestViewBounds.Right; geometry.arrcfDestView[index] = new RectangleF(left, top, right - left, bottom - top); } geometry.rcfDestViewBounds = rcfDestViewBounds; - if ((double)this.m_sizefOriginalSource.Width > 0.0 && (double)this.m_sizefOriginalSource.Height > 0.0) + if (m_sizefOriginalSource.Width > 0.0 && m_sizefOriginalSource.Height > 0.0) { float num3 = this.m_sizefOriginalSource.Width / geometry.rcfSrcVideoBounds.Width; float num4 = this.m_sizefOriginalSource.Height / geometry.rcfSrcVideoBounds.Height; @@ -151,7 +151,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback private static RectangleF ConvertToSquare(RectangleF rcfSrc, float flWidthAdjust) { - if ((double)flWidthAdjust == 1.0) + if (flWidthAdjust == 1.0) return rcfSrc; float x = rcfSrc.Left * flWidthAdjust; float num = rcfSrc.Right * flWidthAdjust; @@ -160,7 +160,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback private static RectangleF ConvertFromSquare(RectangleF rcfSrc, float flWidthAdjust) { - if ((double)flWidthAdjust == 1.0) + if (flWidthAdjust == 1.0) return rcfSrc; float x = rcfSrc.Left / flWidthAdjust; float num = rcfSrc.Right / flWidthAdjust; @@ -169,7 +169,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback private static void ConvertFromSquare(RectangleF[] arrcf, float flWidthAdjust) { - if (arrcf == null || (double)flWidthAdjust == 1.0) + if (arrcf == null || flWidthAdjust == 1.0) return; for (int index = 0; index < arrcf.Length; ++index) { @@ -191,13 +191,13 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback for (int index = 1; index < arrcfStrips.Length; ++index) { RectangleF arrcfStrip = arrcfStrips[index]; - if ((double)left > (double)arrcfStrip.Left) + if (left > (double)arrcfStrip.Left) left = arrcfStrip.Left; - if ((double)top > (double)arrcfStrip.Top) + if (top > (double)arrcfStrip.Top) top = arrcfStrip.Top; - if ((double)right < (double)arrcfStrip.Right) + if (right < (double)arrcfStrip.Right) right = arrcfStrip.Right; - if ((double)bottom < (double)arrcfStrip.Bottom) + if (bottom < (double)arrcfStrip.Bottom) bottom = arrcfStrip.Bottom; } return new RectangleF(left, top, right - left, bottom - top); @@ -205,9 +205,9 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback private static void ApplyOverscanFactor(ref RectangleF rcf, float flOverscanPer) { - if ((double)flOverscanPer > 50.0) + if (flOverscanPer > 50.0) flOverscanPer = 50f; - SizeF sizeF = new SizeF((float)((double)rcf.Width * (double)flOverscanPer / 100.0), (float)((double)rcf.Height * (double)flOverscanPer / 100.0)); + SizeF sizeF = new SizeF((float)(rcf.Width * (double)flOverscanPer / 100.0), (float)(rcf.Height * (double)flOverscanPer / 100.0)); rcf.X += sizeF.Width / 2f; rcf.Y += sizeF.Height / 2f; rcf.Width -= sizeF.Width; @@ -230,7 +230,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback flSrcWidthMultiplier = flDstWidthMultiplier = 1f; float flOverscanPer1 = 0.0f; float flOverscanPer2 = 0.0f; - if ((double)this.m_flInputDisplayOverscanPer > 0.0 || (double)this.m_flInputContentOverscanPer > 0.0) + if (m_flInputDisplayOverscanPer > 0.0 || m_flInputContentOverscanPer > 0.0) { switch (this.m_nDisplayMode) { @@ -278,7 +278,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback } } rcfBoundSrcVideoPxl.Size = this.m_sizefOriginalSource; - if ((double)rcfBoundSrcVideoPxl.Width > 0.0 && (double)rcfBoundSrcVideoPxl.Height > 0.0) + if (rcfBoundSrcVideoPxl.Width > 0.0 && rcfBoundSrcVideoPxl.Height > 0.0) { float num = rcfBoundSrcVideoPxl.Height * this.m_sizefInputContentAspect.Width / this.m_sizefInputContentAspect.Height; flSrcWidthMultiplier = num / rcfBoundSrcVideoPxl.Width; @@ -290,7 +290,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback rcfBoundSrcVideoPxl.Height = 1f; } rcfBoundDestViewPxl = this.m_rcfInputDestViewPxl; - if ((double)rcfBoundDestViewPxl.Width > 0.0 && (double)rcfBoundDestViewPxl.Height > 0.0) + if (rcfBoundDestViewPxl.Width > 0.0 && rcfBoundDestViewPxl.Height > 0.0) { float num = rcfBoundDestViewPxl.Height * this.m_sizefInputDestAspect.Width / this.m_sizefInputDestAspect.Height; flDstWidthMultiplier = num / rcfBoundDestViewPxl.Width; @@ -311,7 +311,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback rcfContent.Intersect(inputDestViewPxl); if (!rcfContent.IsEmpty) { - if ((double)inputDestViewPxl.Left < (double)rcfContent.Left) + if (inputDestViewPxl.Left < (double)rcfContent.Left) { RectangleF rectangleF = new RectangleF(inputDestViewPxl.Left, inputDestViewPxl.Top, rcfContent.Left - inputDestViewPxl.Left, inputDestViewPxl.Height); inputDestViewPxl.Width -= rcfContent.Left - inputDestViewPxl.Left; @@ -322,7 +322,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback ++length; } } - if ((double)inputDestViewPxl.Right > (double)rcfContent.Right) + if (inputDestViewPxl.Right > (double)rcfContent.Right) { RectangleF rectangleF = new RectangleF(rcfContent.Right, inputDestViewPxl.Top, inputDestViewPxl.Right - rcfContent.Right, inputDestViewPxl.Height); inputDestViewPxl.Width = rcfContent.Right - inputDestViewPxl.X; @@ -332,7 +332,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback ++length; } } - if ((double)inputDestViewPxl.Top < (double)rcfContent.Top) + if (inputDestViewPxl.Top < (double)rcfContent.Top) { RectangleF rectangleF = new RectangleF(inputDestViewPxl.Left, inputDestViewPxl.Top, inputDestViewPxl.Width, rcfContent.Top - inputDestViewPxl.Top); inputDestViewPxl.Height -= rcfContent.Top - inputDestViewPxl.Top; @@ -343,7 +343,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback ++length; } } - if ((double)inputDestViewPxl.Bottom > (double)rcfContent.Bottom) + if (inputDestViewPxl.Bottom > (double)rcfContent.Bottom) { RectangleF rectangleF = new RectangleF(inputDestViewPxl.Left, rcfContent.Bottom, inputDestViewPxl.Width, inputDestViewPxl.Bottom - rcfContent.Bottom); inputDestViewPxl.Height = rcfContent.Bottom - inputDestViewPxl.Y; @@ -361,7 +361,7 @@ namespace Microsoft.Iris.RenderAPI.VideoPlayback } RectangleF[] rectangleFArray2 = new RectangleF[length]; if (length > 0) - Array.Copy((Array)rectangleFArray1, (Array)rectangleFArray2, length); + Array.Copy(rectangleFArray1, rectangleFArray2, length); return rectangleFArray2; } } diff --git a/UIX/Microsoft/Iris/Session/DeferredCall.cs b/UIX/Microsoft/Iris/Session/DeferredCall.cs index d7e8325..3a9b3c0 100644 --- a/UIX/Microsoft/Iris/Session/DeferredCall.cs +++ b/UIX/Microsoft/Iris/Session/DeferredCall.cs @@ -18,7 +18,7 @@ namespace Microsoft.Iris.Session private Delegate _target; private object _param; private EventArgs _args; - private static DeferredCall s_cachedList = (DeferredCall)null; + private static DeferredCall s_cachedList = null; private static int s_cachedCount = 0; private static object s_cacheLock = new object(); @@ -28,14 +28,14 @@ namespace Microsoft.Iris.Session private static DeferredCall AllocateFromCache() { - DeferredCall deferredCall = (DeferredCall)null; + DeferredCall deferredCall = null; lock (DeferredCall.s_cacheLock) { if (DeferredCall.s_cachedList != null) { deferredCall = DeferredCall.s_cachedList; DeferredCall.s_cachedList = (DeferredCall)deferredCall._next; - deferredCall._next = (QueueItem)null; + deferredCall._next = null; --DeferredCall.s_cachedCount; } } @@ -48,7 +48,7 @@ namespace Microsoft.Iris.Session { DeferredCall deferredCall = DeferredCall.AllocateFromCache(); deferredCall._callType = DeferredCall.CallType.Simple; - deferredCall._target = (Delegate)callback; + deferredCall._target = callback; return deferredCall; } @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Session { DeferredCall deferredCall = DeferredCall.AllocateFromCache(); deferredCall._callType = DeferredCall.CallType.OneParam; - deferredCall._target = (Delegate)handler; + deferredCall._target = handler; deferredCall._param = param; return deferredCall; } @@ -68,7 +68,7 @@ namespace Microsoft.Iris.Session { DeferredCall deferredCall = DeferredCall.AllocateFromCache(); deferredCall._callType = DeferredCall.CallType.Event; - deferredCall._target = (Delegate)handler; + deferredCall._target = handler; deferredCall._param = sender; deferredCall._args = args; return deferredCall; @@ -78,7 +78,7 @@ namespace Microsoft.Iris.Session { DeferredCall deferredCall = DeferredCall.AllocateFromCache(); deferredCall._callType = DeferredCall.CallType.RenderItem; - deferredCall._param = (object)item; + deferredCall._param = item; return deferredCall; } @@ -102,17 +102,17 @@ namespace Microsoft.Iris.Session throw new InvalidOperationException(); } this._callType = DeferredCall.CallType.None; - this._target = (Delegate)null; - this._param = (object)null; - this._args = (EventArgs)null; - this._prev = (QueueItem)null; - this._next = (QueueItem)null; - this._owner = (QueueItem.Chain)null; + this._target = null; + this._param = null; + this._args = null; + this._prev = null; + this._next = null; + this._owner = null; lock (DeferredCall.s_cacheLock) { if (DeferredCall.s_cachedCount >= 100) return; - this._next = (QueueItem)DeferredCall.s_cachedList; + this._next = s_cachedList; DeferredCall.s_cachedList = this; ++DeferredCall.s_cachedCount; } @@ -120,31 +120,31 @@ namespace Microsoft.Iris.Session public static void Post(DispatchPriority priority, SimpleCallback callback) { - QueueItem queueItem = (QueueItem)DeferredCall.Create(callback); + QueueItem queueItem = DeferredCall.Create(callback); UIDispatcher.Post(priority, queueItem); } public static void Post(Thread thread, DispatchPriority priority, SimpleCallback callback) { - QueueItem queueItem = (QueueItem)DeferredCall.Create(callback); + QueueItem queueItem = DeferredCall.Create(callback); UIDispatcher.Post(thread, priority, queueItem); } public static void Post(DispatchPriority priority, DeferredHandler handler) { - QueueItem queueItem = (QueueItem)DeferredCall.Create(handler, (object)null); + QueueItem queueItem = DeferredCall.Create(handler, null); UIDispatcher.Post(priority, queueItem); } public static void Post(DispatchPriority priority, DeferredHandler handler, object param) { - QueueItem queueItem = (QueueItem)DeferredCall.Create(handler, param); + QueueItem queueItem = DeferredCall.Create(handler, param); UIDispatcher.Post(priority, queueItem); } public static void Post(TimeSpan delay, DeferredHandler handler, object param) { - QueueItem queueItem = (QueueItem)DeferredCall.Create(handler, param); + QueueItem queueItem = DeferredCall.Create(handler, param); UIDispatcher.Post(delay, queueItem); } @@ -154,7 +154,7 @@ namespace Microsoft.Iris.Session DeferredHandler handler, object param) { - QueueItem queueItem = (QueueItem)DeferredCall.Create(handler, param); + QueueItem queueItem = DeferredCall.Create(handler, param); UIDispatcher.Post(thread, priority, queueItem); } diff --git a/UIX/Microsoft/Iris/Session/DispatcherTimer.cs b/UIX/Microsoft/Iris/Session/DispatcherTimer.cs index ea27f4e..63d316e 100644 --- a/UIX/Microsoft/Iris/Session/DispatcherTimer.cs +++ b/UIX/Microsoft/Iris/Session/DispatcherTimer.cs @@ -31,7 +31,7 @@ namespace Microsoft.Iris.Session } public DispatcherTimer() - : this((ITimerOwner)null) + : this(null) { } @@ -52,7 +52,7 @@ namespace Microsoft.Iris.Session public int Interval { get => (int)this.TimeSpanInterval.TotalMilliseconds; - set => this.TimeSpanInterval = TimeSpan.FromMilliseconds((double)value); + set => this.TimeSpanInterval = TimeSpan.FromMilliseconds(value); } public bool Enabled @@ -113,8 +113,8 @@ namespace Microsoft.Iris.Session { if (this._callback == null) return; - this._timeoutManager.CancelTimeout((QueueItem)this._callback); - this._callback = (DispatcherTimer.TimerCallback)null; + this._timeoutManager.CancelTimeout(_callback); + this._callback = null; } private void FireEnabledChange(bool wasEnabled) @@ -129,7 +129,7 @@ namespace Microsoft.Iris.Session string str = " one-shot"; if (this._autoRepeat) str = " repeating"; - return "[" + (object)this.Interval + str + "] -> " + DebugHelpers.DEBUG_ObjectToString((object)this.Tick); + return "[" + Interval + str + "] -> " + DebugHelpers.DEBUG_ObjectToString(Tick); } public event EventHandler Tick; @@ -139,7 +139,7 @@ namespace Microsoft.Iris.Session if (this._callback == null) return; TimeSpan timeSpan1 = this._interval; - TimeSpan timeSpan2 = TimeSpan.FromMilliseconds((double)(currentTimeInMilliseconds - this._timeBase)); + TimeSpan timeSpan2 = TimeSpan.FromMilliseconds(currentTimeInMilliseconds - this._timeBase); if (timeSpan2 >= timeSpan1) { long ticks = timeSpan1.Ticks; @@ -147,7 +147,7 @@ namespace Microsoft.Iris.Session timeSpan1 = TimeSpan.FromTicks(ticks * ((timeSpan2.Ticks + ticks / 2L) / ticks)); } this._timeBase += (long)timeSpan1.TotalMilliseconds; - this._timeoutManager.SetTimeoutRelative((QueueItem)this._callback, TimeSpan.FromMilliseconds((double)(this._timeBase - currentTimeInMilliseconds))); + this._timeoutManager.SetTimeoutRelative(_callback, TimeSpan.FromMilliseconds(this._timeBase - currentTimeInMilliseconds)); } private void CallTickHandlers(DispatcherTimer.TimerCallback callback) @@ -160,11 +160,11 @@ namespace Microsoft.Iris.Session } else { - this._callback = (DispatcherTimer.TimerCallback)null; + this._callback = null; this.FireEnabledChange(true); } if (this.Tick != null) - this.Tick(this._owner != null ? (object)this._owner : (object)this, EventArgs.Empty); + this.Tick(this._owner != null ? _owner : (object)this, EventArgs.Empty); this.FireNotification(NotificationID.Tick); } @@ -190,7 +190,7 @@ namespace Microsoft.Iris.Session string str = ""; if (!this._timer.CallbackValid(this)) str = "CANCELED "; - return str + this.GetType().Name + " -> " + (object)this._timer; + return str + this.GetType().Name + " -> " + _timer; } } @@ -211,7 +211,7 @@ namespace Microsoft.Iris.Session private static void Refresh() { int tickCount = Environment.TickCount; - long num = tickCount < DispatcherTimer.SystemTickCount.s_lastTickCount ? (long)(int.MaxValue - DispatcherTimer.SystemTickCount.s_lastTickCount + tickCount) : (long)(tickCount - DispatcherTimer.SystemTickCount.s_lastTickCount); + long num = tickCount < DispatcherTimer.SystemTickCount.s_lastTickCount ? int.MaxValue - DispatcherTimer.SystemTickCount.s_lastTickCount + tickCount : tickCount - DispatcherTimer.SystemTickCount.s_lastTickCount; DispatcherTimer.SystemTickCount.s_tickCount += num; DispatcherTimer.SystemTickCount.s_lastTickCount = tickCount; } diff --git a/UIX/Microsoft/Iris/Session/EffectManager.cs b/UIX/Microsoft/Iris/Session/EffectManager.cs index f6e175e..76ccf64 100644 --- a/UIX/Microsoft/Iris/Session/EffectManager.cs +++ b/UIX/Microsoft/Iris/Session/EffectManager.cs @@ -32,20 +32,20 @@ namespace Microsoft.Iris.Session { if (this._effectTemplateColor != null) { - this._effectTemplateColor.UnregisterUsage((object)this); - this._effectTemplateColor = (IEffectTemplate)null; + this._effectTemplateColor.UnregisterUsage(this); + this._effectTemplateColor = null; } if (this._effectTemplateImage != null) { - this._effectTemplateImage.UnregisterUsage((object)this); - this._effectTemplateImage = (IEffectTemplate)null; + this._effectTemplateImage.UnregisterUsage(this); + this._effectTemplateImage = null; } if (this._effectTemplateImageWithColor != null) { - this._effectTemplateImageWithColor.UnregisterUsage((object)this); - this._effectTemplateImageWithColor = (IEffectTemplate)null; + this._effectTemplateImageWithColor.UnregisterUsage(this); + this._effectTemplateImageWithColor = null; } - this._renderSession = (IRenderSession)null; + this._renderSession = null; } this._fDisposed = true; } @@ -56,10 +56,10 @@ namespace Microsoft.Iris.Session { if (this._effectTemplateColor == null) { - this._effectTemplateColor = this._renderSession.CreateEffectTemplate((object)this, "ColorEffect"); + this._effectTemplateColor = this._renderSession.CreateEffectTemplate(this, "ColorEffect"); ColorElement colorElement = new ColorElement("ColorElem"); this._effectTemplateColor.AddEffectProperty("ColorElem.Color"); - this._effectTemplateColor.Build((EffectInput)colorElement); + this._effectTemplateColor.Build(colorElement); } return this._effectTemplateColor; } @@ -71,10 +71,10 @@ namespace Microsoft.Iris.Session { if (this._effectTemplateImage == null) { - this._effectTemplateImage = this._renderSession.CreateEffectTemplate((object)this, "ImageEffect"); - ImageElement imageElement = new ImageElement("ImageElem", (IImage)null); + this._effectTemplateImage = this._renderSession.CreateEffectTemplate(this, "ImageEffect"); + ImageElement imageElement = new ImageElement("ImageElem", null); this._effectTemplateImage.AddEffectProperty("ImageElem.Image"); - this._effectTemplateImage.Build((EffectInput)imageElement); + this._effectTemplateImage.Build(imageElement); } return this._effectTemplateImage; } diff --git a/UIX/Microsoft/Iris/Session/ErrorManager.cs b/UIX/Microsoft/Iris/Session/ErrorManager.cs index 7ccf1d2..07d91f0 100644 --- a/UIX/Microsoft/Iris/Session/ErrorManager.cs +++ b/UIX/Microsoft/Iris/Session/ErrorManager.cs @@ -38,7 +38,7 @@ namespace Microsoft.Iris.Session { get { - string str = (string)null; + string str = null; if (ErrorManager.s_contextStack.Count != 0) str = ErrorManager.s_contextStack.Peek().ToString(); return str; @@ -65,7 +65,7 @@ namespace Microsoft.Iris.Session public static IList GetErrors() { IList errors = ErrorManager.s_errors; - ErrorManager.s_errors = (IList)null; + ErrorManager.s_errors = null; return errors; } @@ -126,7 +126,7 @@ namespace Microsoft.Iris.Session { if (!ErrorManager.IgnoringErrors) { - string str = (string)null; + string str = null; if (ErrorManager.s_contextStack.Count != 0) { ErrorManager.Context context = ErrorManager.s_contextStack.Peek(); @@ -141,8 +141,8 @@ namespace Microsoft.Iris.Session errorRecord.Warning = warning; errorRecord.Message = message; if (ErrorManager.s_errors == null) - ErrorManager.s_errors = (IList)new ArrayList(); - ErrorManager.s_errors.Add((object)errorRecord); + ErrorManager.s_errors = new ArrayList(); + ErrorManager.s_errors.Add(errorRecord); ErrorManager.QueueNotify(); } if (warning) @@ -157,7 +157,7 @@ namespace Microsoft.Iris.Session string format, object param) { - string message = (string)null; + string message = null; if (!ErrorManager.IgnoringErrors) message = string.Format(format, param); ErrorManager.TrackReportWorker(line, column, warning, message); @@ -171,7 +171,7 @@ namespace Microsoft.Iris.Session object param1, object param2) { - string message = (string)null; + string message = null; if (!ErrorManager.IgnoringErrors) message = string.Format(format, param1, param2); ErrorManager.TrackReportWorker(line, column, warning, message); @@ -186,7 +186,7 @@ namespace Microsoft.Iris.Session object param2, object param3) { - string message = (string)null; + string message = null; if (!ErrorManager.IgnoringErrors) message = string.Format(format, param1, param2, param3); ErrorManager.TrackReportWorker(line, column, warning, message); @@ -202,7 +202,7 @@ namespace Microsoft.Iris.Session object param3, object param4) { - string message = (string)null; + string message = null; if (!ErrorManager.IgnoringErrors) message = string.Format(format, param1, param2, param3, param4); ErrorManager.TrackReportWorker(line, column, warning, message); @@ -219,7 +219,7 @@ namespace Microsoft.Iris.Session object param4, object param5) { - string message = (string)null; + string message = null; if (!ErrorManager.IgnoringErrors) message = string.Format(format, param1, param2, param3, param4, param5); ErrorManager.TrackReportWorker(line, column, warning, message); @@ -258,7 +258,7 @@ namespace Microsoft.Iris.Session public Context(object contextObject, bool ignoreErrors) { this._contextObject = contextObject; - this._callback = (IErrorContextSource)null; + this._callback = null; this._ignoreErrors = ignoreErrors; this._errorCountOnEnter = ErrorManager.s_totalErrorsReported; } @@ -266,7 +266,7 @@ namespace Microsoft.Iris.Session public Context(IErrorContextSource contextSource) { this._callback = contextSource; - this._contextObject = (object)null; + this._contextObject = null; this._ignoreErrors = false; this._errorCountOnEnter = ErrorManager.s_totalErrorsReported; } @@ -275,7 +275,7 @@ namespace Microsoft.Iris.Session { get { - string str = (string)null; + string str = null; if (this._callback != null) str = this._callback.GetErrorContextDescription(); else if (this._contextObject != null) diff --git a/UIX/Microsoft/Iris/Session/Form.cs b/UIX/Microsoft/Iris/Session/Form.cs index 2641ab4..67f05ec 100644 --- a/UIX/Microsoft/Iris/Session/Form.cs +++ b/UIX/Microsoft/Iris/Session/Form.cs @@ -49,10 +49,10 @@ namespace Microsoft.Iris.Session this.InternalWindow.MonitorChangedEvent += new MonitorChangedHandler(this.OnMonitorChanged); this.InternalWindow.ActivationChangeEvent += new ActivationChangeHandler(this.OnActivationChange); this.InternalWindow.SessionConnectEvent += new SessionConnectHandler(this.OnSessionConnect); - this.InternalWindow.BackgroundColor = new ColorF((int)byte.MaxValue, 0, 0, 0); + this.InternalWindow.BackgroundColor = new ColorF(byte.MaxValue, 0, 0, 0); session.RegisterHost(this); this.m_mapShutdownHooks = new SmartMap(); - this.m_nextShutdownHookId = (ushort)1; + this.m_nextShutdownHookId = 1; this._processRefreshFocus = new SimpleCallback(this.ProcessRefreshFocus); DeferredCall.Post(DispatchPriority.Housekeeping, new SimpleCallback(this.InitializeWindow)); } @@ -186,7 +186,7 @@ namespace Microsoft.Iris.Session { if (this.NativeSetFocus == null) return; - this.NativeSetFocus(sender, (EventArgs)args); + this.NativeSetFocus(sender, args); } public bool SetDefaultKeyFocus() @@ -260,8 +260,8 @@ namespace Microsoft.Iris.Session out string identifier, out Inset nineGrid) { - host = (string)null; - identifier = (string)null; + host = null; + identifier = null; nineGrid = new Inset(); if (!(uiimage is UriImage uriImage)) return; @@ -351,7 +351,7 @@ namespace Microsoft.Iris.Session { if (this.ActivationChange == null) return; - this.ActivationChange((object)this, EventArgs.Empty); + this.ActivationChange(this, EventArgs.Empty); } protected virtual void OnLoad() @@ -362,7 +362,7 @@ namespace Microsoft.Iris.Session { if (this.SessionConnect == null) return; - this.SessionConnect((object)this, fIsConnected); + this.SessionConnect(this, fIsConnected); } public event FormSessionConnectHandler SessionConnect; @@ -448,12 +448,12 @@ namespace Microsoft.Iris.Session { Form.ShutdownHookInfo shutdownHookInfo = new Form.ShutdownHookInfo(hookName); uint key; - if (this.m_mapShutdownHooks.Lookup((object)shutdownHookInfo, out key)) + if (this.m_mapShutdownHooks.Lookup(shutdownHookInfo, out key)) shutdownHookInfo = (Form.ShutdownHookInfo)this.m_mapShutdownHooks[key]; else if (fCanAdd) - this.m_mapShutdownHooks[(uint)this.m_nextShutdownHookId++] = (object)shutdownHookInfo; + this.m_mapShutdownHooks[this.m_nextShutdownHookId++] = shutdownHookInfo; else - shutdownHookInfo = (Form.ShutdownHookInfo)null; + shutdownHookInfo = null; return shutdownHookInfo; } diff --git a/UIX/Microsoft/Iris/Session/TimeoutManager.cs b/UIX/Microsoft/Iris/Session/TimeoutManager.cs index a7c8763..dde4fce 100644 --- a/UIX/Microsoft/Iris/Session/TimeoutManager.cs +++ b/UIX/Microsoft/Iris/Session/TimeoutManager.cs @@ -43,7 +43,7 @@ namespace Microsoft.Iris.Session long num2 = ticks / 10000L; if (ticks % 10000L > 0L) ++num2; - if (num2 < (long)uint.MaxValue) + if (num2 < uint.MaxValue) num1 = (uint)num2; } else @@ -53,7 +53,7 @@ namespace Microsoft.Iris.Session } } - public void SetTimeoutAbsolute(QueueItem item, DateTime when) => this.SetTimeoutWorker(TimeoutManager.TimeNow, (QueueItem)null, item, when, false); + public void SetTimeoutAbsolute(QueueItem item, DateTime when) => this.SetTimeoutWorker(TimeoutManager.TimeNow, null, item, when, false); public static void SetTimeoutAbsolute(Thread thread, QueueItem item, DateTime when) { @@ -64,7 +64,7 @@ namespace Microsoft.Iris.Session public void SetTimeoutRelative(QueueItem item, TimeSpan delay) { DateTime timeNow = TimeoutManager.TimeNow; - this.SetTimeoutWorker(timeNow, (QueueItem)null, item, timeNow + delay, true); + this.SetTimeoutWorker(timeNow, null, item, timeNow + delay, true); } public static void SetTimeoutRelative(Thread thread, QueueItem item, TimeSpan delay) @@ -76,7 +76,7 @@ namespace Microsoft.Iris.Session public void CancelTimeout(QueueItem item) { if (!UIDispatcher.IsUIThread) - DeferredCall.Post(DispatchPriority.Normal, TimeoutManager._cancelTimeoutInterthread, (object)item); + DeferredCall.Post(DispatchPriority.Normal, TimeoutManager._cancelTimeoutInterthread, item); else this._pending.RemoveItem(item); } @@ -129,7 +129,7 @@ namespace Microsoft.Iris.Session bool isRelative) { if (thread == Thread.CurrentThread) - TimeoutManager.DeliverToCurrentThread(currentTime, (QueueItem)null, item, when, isRelative); + TimeoutManager.DeliverToCurrentThread(currentTime, null, item, when, isRelative); else UIDispatcher.Post(thread, DispatchPriority.Normal, TimeoutManager.PendingList.GetInterthreadItem(item, when, isRelative)); } @@ -150,7 +150,7 @@ namespace Microsoft.Iris.Session { DateTime timeNow = TimeoutManager.TimeNow; long milliseconds = DispatcherTimer.SystemTickCount.Milliseconds; - DateTime dateTime = this._lastSystemTime + TimeSpan.FromMilliseconds((double)(milliseconds - this._lastSystemMilliseconds)); + DateTime dateTime = this._lastSystemTime + TimeSpan.FromMilliseconds(milliseconds - this._lastSystemMilliseconds); this._lastSystemTime = timeNow; this._lastSystemMilliseconds = milliseconds; if (Math.Abs((timeNow - dateTime).TotalSeconds) <= 30.0) @@ -162,7 +162,7 @@ namespace Microsoft.Iris.Session { get { - TimeoutManager timeoutManager = (TimeoutManager)null; + TimeoutManager timeoutManager = null; UIDispatcher currentDispatcher = UIDispatcher.CurrentDispatcher; if (currentDispatcher != null) timeoutManager = currentDispatcher.TimeoutManager; @@ -182,13 +182,13 @@ namespace Microsoft.Iris.Session public bool NextItemIs(QueueItem innerItem) { - QueueItem queueItem = (QueueItem)null; + QueueItem queueItem = null; if (this._head != null) queueItem = this._head.innerItem; return queueItem == innerItem; } - public void AddItem(QueueItem innerItem, DateTime expireTime, bool isRelative) => this.AddWorker((TimeoutManager.PendingList.PendingItem)null, innerItem, expireTime, isRelative); + public void AddItem(QueueItem innerItem, DateTime expireTime, bool isRelative) => this.AddWorker(null, innerItem, expireTime, isRelative); public void AddItemInternal(QueueItem outerItem) { @@ -201,7 +201,7 @@ namespace Microsoft.Iris.Session DateTime expireTime, bool isRelative) { - return (QueueItem)new TimeoutManager.PendingList.PendingItem(innerItem, expireTime, isRelative); + return new TimeoutManager.PendingList.PendingItem(innerItem, expireTime, isRelative); } public void ShiftRelativeTimeouts(TimeSpan spanTime) @@ -235,7 +235,7 @@ namespace Microsoft.Iris.Session public QueueItem RemoveNextExpired(DateTime threshold) { - QueueItem queueItem = (QueueItem)null; + QueueItem queueItem = null; TimeoutManager.PendingList.PendingItem head = this._head; if (head != null && head.expireTime <= threshold) { @@ -247,7 +247,7 @@ namespace Microsoft.Iris.Session public QueueItem.Chain.ChainEnumerator GetEnumerator() { - QueueItem tail = (QueueItem)this._head; + QueueItem tail = _head; if (tail != null) tail = QueueItem.Chain.PrevItem(tail); return new QueueItem.Chain.ChainEnumerator(tail); @@ -260,8 +260,8 @@ namespace Microsoft.Iris.Session bool isRelative) { QueueItem.Chain.ValidateAdd(innerItem); - TimeoutManager.PendingList.PendingItem pendingItem1 = (TimeoutManager.PendingList.PendingItem)null; - TimeoutManager.PendingList.PendingItem pendingItem2 = (TimeoutManager.PendingList.PendingItem)null; + TimeoutManager.PendingList.PendingItem pendingItem1 = null; + TimeoutManager.PendingList.PendingItem pendingItem2 = null; if (this._head != null) { foreach (TimeoutManager.PendingList.PendingItem pendingItem3 in this) @@ -276,8 +276,8 @@ namespace Microsoft.Iris.Session } if (outerItem == null) outerItem = new TimeoutManager.PendingList.PendingItem(innerItem, expireTime, isRelative); - this.Link(innerItem, (QueueItem)null, false); - this.Link((QueueItem)outerItem, (QueueItem)pendingItem2, true); + this.Link(innerItem, null, false); + this.Link(outerItem, pendingItem2, true); if (this._head != pendingItem1) return; this._head = outerItem; @@ -286,8 +286,8 @@ namespace Microsoft.Iris.Session private void RemoveWorker(TimeoutManager.PendingList.PendingItem outerItem) { if (this._head == outerItem) - this._head = QueueItem.Chain.IsOnlyChild((QueueItem)this._head) ? (TimeoutManager.PendingList.PendingItem)null : QueueItem.Chain.NextItem((QueueItem)this._head) as TimeoutManager.PendingList.PendingItem; - this.Unlink((QueueItem)outerItem); + this._head = QueueItem.Chain.IsOnlyChild(_head) ? null : QueueItem.Chain.NextItem(_head) as TimeoutManager.PendingList.PendingItem; + this.Unlink(outerItem); this.Unlink(outerItem.innerItem); } @@ -304,7 +304,7 @@ namespace Microsoft.Iris.Session this.isRelative = isRelative; } - public override void Dispatch() => TimeoutManager.DeliverToCurrentThread(TimeoutManager.TimeNow, (QueueItem)this, this.innerItem, this.expireTime, this.isRelative); + public override void Dispatch() => TimeoutManager.DeliverToCurrentThread(TimeoutManager.TimeNow, this, this.innerItem, this.expireTime, this.isRelative); } } } diff --git a/UIX/Microsoft/Iris/Session/UIApplication.cs b/UIX/Microsoft/Iris/Session/UIApplication.cs index 68dea70..3b29022 100644 --- a/UIX/Microsoft/Iris/Session/UIApplication.cs +++ b/UIX/Microsoft/Iris/Session/UIApplication.cs @@ -20,7 +20,7 @@ namespace Microsoft.Iris.Session set => UIApplication.s_applicationName = value; } - public static void Run() => UIDispatcher.CurrentDispatcher.Run((LoopCondition)null); + public static void Run() => UIDispatcher.CurrentDispatcher.Run(null); public static void DoEvents(LoopCondition loop) => UIDispatcher.CurrentDispatcher.Run(loop); @@ -56,7 +56,7 @@ namespace Microsoft.Iris.Session thread.Name = threadName; thread.SetApartmentState(ApartmentState.STA); thread.IsBackground = true; - thread.Start((object)new UIApplication.StartArgs(registeredEvent)); + thread.Start(new UIApplication.StartArgs(registeredEvent)); registeredEvent.WaitOne(); registeredEvent.Close(); return thread; @@ -71,15 +71,15 @@ namespace Microsoft.Iris.Session if (startArgs.registeredEvent != null) { startArgs.registeredEvent.Set(); - startArgs.registeredEvent = (ManualResetEvent)null; + startArgs.registeredEvent = null; } if (startArgs.initialWork != null) { DeferredCall.Post(currentThread, DispatchPriority.AppEvent, startArgs.initialWork, startArgs.initialWorkArgs); - startArgs.initialWork = (DeferredHandler)null; - startArgs.initialWorkArgs = (object)null; + startArgs.initialWork = null; + startArgs.initialWorkArgs = null; } - uiDispatcher.Run((LoopCondition)null); + uiDispatcher.Run(null); } } @@ -99,7 +99,7 @@ namespace Microsoft.Iris.Session this._worker = workerMethod; } - public void BeginInvoke() => this._worker.BeginInvoke(this._args, new AsyncCallback(this.AsyncInvokeCompleted), (object)null); + public void BeginInvoke() => this._worker.BeginInvoke(this._args, new AsyncCallback(this.AsyncInvokeCompleted), null); private void AsyncInvokeCompleted(IAsyncResult result) { diff --git a/UIX/Microsoft/Iris/Session/UIDispatcher.cs b/UIX/Microsoft/Iris/Session/UIDispatcher.cs index 3596762..28e2a46 100644 --- a/UIX/Microsoft/Iris/Session/UIDispatcher.cs +++ b/UIX/Microsoft/Iris/Session/UIDispatcher.cs @@ -27,7 +27,7 @@ namespace Microsoft.Iris.Session private bool _shutdown; internal UIDispatcher(bool isMainUIThread) - : this((UISession)null, (TimeoutHandler)null, 0U, isMainUIThread) + : this(null, null, 0U, isMainUIThread) { } @@ -42,7 +42,7 @@ namespace Microsoft.Iris.Session this._timeoutManager = new TimeoutManager(); Queue[] queues = new Queue[17]; if (parentSession != null) - queues[6] = (Queue)parentSession.InputManager.Queue; + queues[6] = parentSession.InputManager.Queue; this._masterQueue = new PriorityQueue(queues); this._masterQueue.LoopHook = new PriorityQueue.HookProc(this.CheckInterthreadItems); this.SetQueueDrainHook(DispatchPriority.Normal, new PriorityQueue.HookProc(this.CheckLoopCondition)); @@ -81,7 +81,7 @@ namespace Microsoft.Iris.Session this.ShutDown(false); if (UIDispatcher.s_mainUIThread == Thread.CurrentThread) { - UIDispatcher.s_mainUIThread = (Thread)null; + UIDispatcher.s_mainUIThread = null; UIDispatcher.s_exiting = true; } if (this._masterQueue != null) @@ -138,10 +138,10 @@ namespace Microsoft.Iris.Session priority1 = DispatchPriority.Idle; break; } - UIDispatcher.Post(priority1, (QueueItem)DeferredCall.Create(item)); + UIDispatcher.Post(priority1, DeferredCall.Create(item)); } else - UIDispatcher.Post(delay, (QueueItem)DeferredCall.Create(item)); + UIDispatcher.Post(delay, DeferredCall.Create(item)); } public static void Post(DateTime when, QueueItem item) @@ -174,7 +174,7 @@ namespace Microsoft.Iris.Session public static void Post(Thread thread, DispatchPriority priority, QueueItem item) => Dispatcher.PostItem_AnyThread(thread, item, (int)priority); - public void Run(LoopCondition condition) => this.MainLoop((Queue)this._masterQueue, condition); + public void Run(LoopCondition condition) => this.MainLoop(_masterQueue, condition); public void StopCurrentMessageLoop() => this._messageLoop.QuitPending = true; @@ -188,7 +188,7 @@ namespace Microsoft.Iris.Session public void RPCYield(LoopCondition condition) => this.MainLoop(this._rpcYieldQueue, condition); - public void DoHousekeeping() => this.MainLoop(this._cleanupQueue, (LoopCondition)null); + public void DoHousekeeping() => this.MainLoop(this._cleanupQueue, null); private void SetQueueLock(DispatchPriority priority, bool value) => this._masterQueue.SetLock((int)priority, value); @@ -223,7 +223,7 @@ namespace Microsoft.Iris.Session private void DoBatchFlush(out bool didWork, out bool abort) { - this.SetQueueDrainHook(DispatchPriority.RenderSync, (PriorityQueue.HookProc)null); + this.SetQueueDrainHook(DispatchPriority.RenderSync, null); this.UISession.FlushBatch(); didWork = true; abort = false; diff --git a/UIX/Microsoft/Iris/Session/UISession.cs b/UIX/Microsoft/Iris/Session/UISession.cs index a4b00b1..5cec4fd 100644 --- a/UIX/Microsoft/Iris/Session/UISession.cs +++ b/UIX/Microsoft/Iris/Session/UISession.cs @@ -46,7 +46,7 @@ namespace Microsoft.Iris.Session private static readonly DeferredHandler s_deferredPlaySystemSound = new DeferredHandler(UISession.DeferredPlaySystemSound); public UISession() - : this((EventHandler)null, (TimeoutHandler)null, 0U) + : this(null, null, 0U) { } @@ -67,7 +67,7 @@ namespace Microsoft.Iris.Session int pdwDefaultLayout; Win32Api.IFWIN32(Win32Api.GetProcessDefaultLayout(out pdwDefaultLayout)); this._rtl = pdwDefaultLayout == 1; - this._engine = RenderApi.CreateEngine(IrisEngineInfo.CreateLocal(), (IRenderHost)this.Dispatcher); + this._engine = RenderApi.CreateEngine(IrisEngineInfo.CreateLocal(), Dispatcher); this._session = this._engine.Session; TextImageCache.Initialize(this); ScavengeImageCache.Initialize(this); @@ -112,27 +112,27 @@ namespace Microsoft.Iris.Session if (this._soundManager != null) { this._soundManager.Dispose(); - this._soundManager = (SoundManager)null; + this._soundManager = null; } if (this._animationManager != null) { this._animationManager.Dispose(); - this._animationManager = (AnimationManager)null; + this._animationManager = null; } if (this._form != null) this._form.Visible = false; this._inputManager.PrepareToShutDown(); - this._queueSyncLayoutComplete = (SimpleQueue)null; - this._form = (Form)null; + this._queueSyncLayoutComplete = null; + this._form = null; this._dispatcher.ShutDown(true); - UISession.s_theOnlySession = (UISession)null; + UISession.s_theOnlySession = null; this._effectManager.Dispose(); - this._effectManager = (EffectManager)null; + this._effectManager = null; if (this._engine != null) { this._engine.Dispose(); - this._engine = (IRenderEngine)null; - this._session = (IRenderSession)null; + this._engine = null; + this._session = null; } TextImageCache.Uninitialize(this); ScavengeImageCache.Uninitialize(this); @@ -140,7 +140,7 @@ namespace Microsoft.Iris.Session if (RenderApi.DebugModule == null) return; RenderApi.DebugModule.Dispose(); - RenderApi.DebugModule = (IDebug)null; + RenderApi.DebugModule = null; } internal bool IsValid => UISession.s_theOnlySession == this; @@ -167,7 +167,7 @@ namespace Microsoft.Iris.Session { get { - UIZone uiZone = (UIZone)null; + UIZone uiZone = null; if (this._form != null) uiZone = this._form.Zone; return uiZone; @@ -243,7 +243,7 @@ namespace Microsoft.Iris.Session this._session.GraphicsDevice.RenderNowIfPossible(); } - internal void EnqueueSyncLayoutCompleteHandler(object snd, EventHandler eh) => this._queueSyncLayoutComplete.PostItem((QueueItem)DeferredCall.Create(eh, snd, EventArgs.Empty)); + internal void EnqueueSyncLayoutCompleteHandler(object snd, EventHandler eh) => this._queueSyncLayoutComplete.PostItem(DeferredCall.Create(eh, snd, EventArgs.Empty)); private void ProcessInitialization() { @@ -252,7 +252,7 @@ namespace Microsoft.Iris.Session if (!this.IsValid || !this._initRequestedFlag) return; this._initRequestedFlag = false; - this.RootZone?.ProcessUiTask(UiTask.Initialization, (object)null); + this.RootZone?.ProcessUiTask(UiTask.Initialization, null); } } @@ -267,7 +267,7 @@ namespace Microsoft.Iris.Session if (rootZone == null) return; this._layingOut = true; - rootZone.ProcessUiTask(UiTask.LayoutComputation, (object)null); + rootZone.ProcessUiTask(UiTask.LayoutComputation, null); QueueItem nextItem; while ((nextItem = this._queueSyncLayoutComplete.GetNextItem()) != null) nextItem.Dispatch(); @@ -282,7 +282,7 @@ namespace Microsoft.Iris.Session if (!this.IsValid || !this._applyLayoutRequestedFlag) return; this._applyLayoutRequestedFlag = false; - this.RootZone?.ProcessUiTask(UiTask.LayoutApplication, (object)null); + this.RootZone?.ProcessUiTask(UiTask.LayoutApplication, null); } } @@ -293,7 +293,7 @@ namespace Microsoft.Iris.Session if (!this.IsValid || !this._paintRequestedFlag) return; this._paintRequestedFlag = false; - this.RootZone?.ProcessUiTask(UiTask.Painting, (object)null); + this.RootZone?.ProcessUiTask(UiTask.Painting, null); } } @@ -318,9 +318,9 @@ namespace Microsoft.Iris.Session { UISession.PlaySoundArgs playSoundArgs = new UISession.PlaySoundArgs(this, stSoundSource); if (!UIDispatcher.IsUIThread) - DeferredCall.Post(DispatchPriority.High, UISession.s_deferredPlaySound, (object)playSoundArgs); + DeferredCall.Post(DispatchPriority.High, UISession.s_deferredPlaySound, playSoundArgs); else - UISession.DeferredPlaySound((object)playSoundArgs); + UISession.DeferredPlaySound(playSoundArgs); } private static void DeferredPlaySound(object argsObject) @@ -335,9 +335,9 @@ namespace Microsoft.Iris.Session { UISession.PlaySystemSoundArgs playSystemSoundArgs = new UISession.PlaySystemSoundArgs(this, systemSoundEvent); if (!UIDispatcher.IsUIThread) - DeferredCall.Post(DispatchPriority.High, UISession.s_deferredPlaySystemSound, (object)playSystemSoundArgs); + DeferredCall.Post(DispatchPriority.High, UISession.s_deferredPlaySystemSound, playSystemSoundArgs); else - UISession.DeferredPlaySystemSound((object)playSystemSoundArgs); + UISession.DeferredPlaySystemSound(playSystemSoundArgs); } private static void DeferredPlaySystemSound(object argsObject) @@ -374,12 +374,12 @@ namespace Microsoft.Iris.Session public static IDisposable Enter(string task) { if (UISession.TaskReentrancyDetection.s_currentTask != null) - InvariantString.Format("REENTRANCY DETECTED! Attempt to process task '{0}' while already processing '{1}'.", (object)UISession.TaskReentrancyDetection.s_currentTask, (object)task); + InvariantString.Format("REENTRANCY DETECTED! Attempt to process task '{0}' while already processing '{1}'.", s_currentTask, task); UISession.TaskReentrancyDetection.s_currentTask = task; - return (IDisposable)UISession.TaskReentrancyDetection.s_currentTaskClearer; + return s_currentTaskClearer; } - void IDisposable.Dispose() => UISession.TaskReentrancyDetection.s_currentTask = (string)null; + void IDisposable.Dispose() => UISession.TaskReentrancyDetection.s_currentTask = null; } private class PlaySoundArgs diff --git a/UIX/Microsoft/Iris/Timer.cs b/UIX/Microsoft/Iris/Timer.cs index 2b20731..b0639fd 100644 --- a/UIX/Microsoft/Iris/Timer.cs +++ b/UIX/Microsoft/Iris/Timer.cs @@ -18,16 +18,16 @@ namespace Microsoft.Iris : base(owner, description) { UIDispatcher.VerifyOnApplicationThread(); - this._dispatcherTimer = new DispatcherTimer((ITimerOwner)this); + this._dispatcherTimer = new DispatcherTimer(this); } public Timer(IModelItemOwner owner) - : this(owner, (string)null) + : this(owner, null) { } public Timer() - : this((IModelItemOwner)null) + : this(null) { } @@ -43,7 +43,7 @@ namespace Microsoft.Iris void ITimerOwner.OnTimerPropertyChanged(string id) { - if (object.ReferenceEquals((object)id, (object)NotificationID.Interval)) + if (object.ReferenceEquals(id, NotificationID.Interval)) this.FirePropertyChanged("TimeSpanInterval"); this.FirePropertyChanged(id); } diff --git a/UIX/Microsoft/Iris/UI/Class.cs b/UIX/Microsoft/Iris/UI/Class.cs index 415454b..73c9833 100644 --- a/UIX/Microsoft/Iris/UI/Class.cs +++ b/UIX/Microsoft/Iris/UI/Class.cs @@ -39,20 +39,20 @@ namespace Microsoft.Iris.UI protected override void OnDispose() { - this._typeSchema.RunFinalEvaluates((IMarkupTypeBase)this); + this._typeSchema.RunFinalEvaluates(this); base.OnDispose(); this._scriptEnabled = false; if (this._listeners != null) { - this._listeners.Dispose((object)this); - this._listeners = (MarkupListeners)null; + this._listeners.Dispose(this); + this._listeners = null; } this._notifier.ClearListeners(); this._storage.Clear(); if (this._disposables == null) return; for (int index = 0; index < this._disposables.Count; ++index) - this._disposables[index].Dispose((object)this); + this._disposables[index].Dispose(this); } public void RegisterDisposable(IDisposableObject disposable) @@ -77,7 +77,7 @@ namespace Microsoft.Iris.UI return false; } - public TypeSchema TypeSchema => (TypeSchema)this._typeSchema; + public TypeSchema TypeSchema => _typeSchema; public virtual void NotifyInitialized() { @@ -87,17 +87,17 @@ namespace Microsoft.Iris.UI public virtual object ReadSymbol(SymbolReference symbolRef) { - object obj = (object)null; + object obj = null; switch (symbolRef.Origin) { case SymbolOrigin.Properties: case SymbolOrigin.Locals: - obj = this._storage[(object)symbolRef.Symbol]; + obj = this._storage[symbolRef.Symbol]; break; case SymbolOrigin.Reserved: if (symbolRef.Symbol == nameof(Class) || symbolRef.Symbol == "this") { - obj = (object)this; + obj = this; break; } break; @@ -107,13 +107,13 @@ namespace Microsoft.Iris.UI public virtual void WriteSymbol(SymbolReference symbolRef, object value) => this.SetProperty(symbolRef.Symbol, value); - public virtual object GetProperty(string name) => this._storage[(object)name]; + public virtual object GetProperty(string name) => this._storage[name]; public virtual void SetProperty(string name, object value) { - if (this._storage.ContainsKey((object)name) && Utility.IsEqual(this._storage[(object)name], value)) + if (this._storage.ContainsKey(name) && Utility.IsEqual(this._storage[name], value)) return; - this._storage[(object)name] = value; + this._storage[name] = value; this._notifier.Fire(name); } @@ -128,22 +128,22 @@ namespace Microsoft.Iris.UI public void ScheduleScriptRun(uint scriptId, bool ignoreErrors) { if (!this._scriptRunScheduler.Pending) - DeferredCall.Post(DispatchPriority.Script, Class.s_executePendingScriptsHandler, (object)this); + DeferredCall.Post(DispatchPriority.Script, Class.s_executePendingScriptsHandler, this); this._scriptRunScheduler.ScheduleRun(scriptId, ignoreErrors); } private static void ExecutePendingScripts(object args) { Class @class = (Class)args; - @class._scriptRunScheduler.Execute((IMarkupTypeBase)@class); + @class._scriptRunScheduler.Execute(@class); } - public object RunScript(uint scriptId, bool ignoreErrors, ParameterContext parameterContext) => this._typeSchema.Run((IMarkupTypeBase)this, scriptId, ignoreErrors, parameterContext); + public object RunScript(uint scriptId, bool ignoreErrors, ParameterContext parameterContext) => this._typeSchema.Run(this, scriptId, ignoreErrors, parameterContext); public void NotifyScriptErrors() { this._scriptEnabled = false; - ErrorManager.ReportWarning("Script runtime failure: Scripting has been disabled for '{0}' due to runtime scripting errors", (object)this._typeSchema.Name); + ErrorManager.ReportWarning("Script runtime failure: Scripting has been disabled for '{0}' due to runtime scripting errors", _typeSchema.Name); } public bool ScriptEnabled => this._scriptEnabled; diff --git a/UIX/Microsoft/Iris/UI/EffectClass.cs b/UIX/Microsoft/Iris/UI/EffectClass.cs index c0ef1c3..b83a48a 100644 --- a/UIX/Microsoft/Iris/UI/EffectClass.cs +++ b/UIX/Microsoft/Iris/UI/EffectClass.cs @@ -30,11 +30,11 @@ namespace Microsoft.Iris.UI if (this._activeAnimations != null) { foreach (DisposableObject activeAnimation in this._activeAnimations) - activeAnimation.Dispose((object)this); + activeAnimation.Dispose(this); this._activeAnimations.Clear(); } foreach (EffectClass.EffectAndOwner effectAndOwner in this._effectsInUse) - effectAndOwner.Effect.UnregisterUsage((object)this); + effectAndOwner.Effect.UnregisterUsage(this); this._effectsInUse.Clear(); } @@ -42,10 +42,10 @@ namespace Microsoft.Iris.UI public IEffect CreateRenderEffect(object owner) { - IEffect effect = (IEffect)null; + IEffect effect = null; if (this._effectTemplate != null && this._effectTemplate.IsBuilt) { - effect = this._effectTemplate.CreateInstance((object)this); + effect = this._effectTemplate.CreateInstance(this); this._effectsInUse.Add(new EffectClass.EffectAndOwner(effect, owner)); effect.RegisterUsage(owner); } @@ -62,7 +62,7 @@ namespace Microsoft.Iris.UI object owner, IImage initialImage) { - IEffect effect1 = (IEffect)null; + IEffect effect1 = null; if (effect != null) { effect1 = effect.CreateRenderEffect(owner); @@ -85,7 +85,7 @@ namespace Microsoft.Iris.UI { if (this._effectsInUse[index].Owner == owner) { - this._effectsInUse[index].Effect.UnregisterUsage((object)this); + this._effectsInUse[index].Effect.UnregisterUsage(this); this._effectsInUse.RemoveAt(index); } } @@ -96,7 +96,7 @@ namespace Microsoft.Iris.UI IEffect effectInstance, IImage image) { - string stPropertyName = (string)null; + string stPropertyName = null; if (effect != null && effect._effectTemplate == effectInstance.Template) { if (effect.DefaultImageElement != null) @@ -125,9 +125,9 @@ namespace Microsoft.Iris.UI foreach (EffectClass.EffectAndOwner effectAndOwner in this._effectsInUse) { AnimationArgs args = new AnimationArgs(); - ActiveSequence instance = animation.CreateInstance((IAnimatable)effectAndOwner.Effect, property, ref args); + ActiveSequence instance = animation.CreateInstance(effectAndOwner.Effect, property, ref args); instance?.Play(); - instance.DeclareOwner((object)this); + instance.DeclareOwner(this); instance.AnimationCompleted += new EventHandler(this.OnAnimationComplete); this._activeAnimations.Add(instance); } @@ -138,10 +138,10 @@ namespace Microsoft.Iris.UI ActiveSequence activeSequence = (ActiveSequence)sender; activeSequence.AnimationCompleted -= new EventHandler(this.OnAnimationComplete); this._activeAnimations.Remove(activeSequence); - activeSequence.Dispose((object)this); + activeSequence.Dispose(this); } - public override object ReadSymbol(SymbolReference symbolRef) => symbolRef.Origin == SymbolOrigin.Techniques ? (object)new EffectElementWrapper(this, symbolRef.Symbol) : base.ReadSymbol(symbolRef); + public override object ReadSymbol(SymbolReference symbolRef) => symbolRef.Origin == SymbolOrigin.Techniques ? new EffectElementWrapper(this, symbolRef.Symbol) : base.ReadSymbol(symbolRef); private struct EffectAndOwner { diff --git a/UIX/Microsoft/Iris/UI/EffectElementWrapper.cs b/UIX/Microsoft/Iris/UI/EffectElementWrapper.cs index 20d39c0..baebc44 100644 --- a/UIX/Microsoft/Iris/UI/EffectElementWrapper.cs +++ b/UIX/Microsoft/Iris/UI/EffectElementWrapper.cs @@ -23,19 +23,19 @@ namespace Microsoft.Iris.UI this._elementName = elementName; } - public void SetProperty(string propertyName, int value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue((object)value, EffectValueType.Int)); + public void SetProperty(string propertyName, int value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Int)); - public void SetProperty(string propertyName, float value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue((object)value, EffectValueType.Float)); + public void SetProperty(string propertyName, float value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Float)); - public void SetProperty(string propertyName, UIImage value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue((object)value, EffectValueType.UIImage)); + public void SetProperty(string propertyName, UIImage value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.UIImage)); - public void SetProperty(string propertyName, IUIVideoStream value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue((object)value, EffectValueType.IUIVideoStream)); + public void SetProperty(string propertyName, IUIVideoStream value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.IUIVideoStream)); - public void SetProperty(string propertyName, Color value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue((object)value, EffectValueType.Color)); + public void SetProperty(string propertyName, Color value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Color)); - public void SetProperty(string propertyName, Vector2 value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue((object)value, EffectValueType.Vector2)); + public void SetProperty(string propertyName, Vector2 value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Vector2)); - public void SetProperty(string propertyName, Vector3 value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue((object)value, EffectValueType.Vector3)); + public void SetProperty(string propertyName, Vector3 value) => this._class.SetRenderEffectProperty(this.MakeEffectPropertyName(propertyName), new EffectValue(value, EffectValueType.Vector3)); public void PlayAnimation(EffectProperty property, EffectAnimation animation) => this._class.PlayAnimation(this.MakeEffectPropertyName(property), animation); diff --git a/UIX/Microsoft/Iris/UI/Environment.cs b/UIX/Microsoft/Iris/UI/Environment.cs index 981fe2a..d175a52 100644 --- a/UIX/Microsoft/Iris/UI/Environment.cs +++ b/UIX/Microsoft/Iris/UI/Environment.cs @@ -19,7 +19,7 @@ namespace Microsoft.Iris.UI private bool _soundEffectsEnabledFlag; private ColorScheme _currentColorScheme; private static Environment s_instance; - private static float s_dpiScale = Math.Max(1f, (float)NativeApi.SpGetDpi() / 96f); + private static float s_dpiScale = Math.Max(1f, NativeApi.SpGetDpi() / 96f); private Environment() => this._soundEffectsEnabledFlag = true; diff --git a/UIX/Microsoft/Iris/UI/InputHandler.cs b/UIX/Microsoft/Iris/UI/InputHandler.cs index ed4a2cc..8fe766e 100644 --- a/UIX/Microsoft/Iris/UI/InputHandler.cs +++ b/UIX/Microsoft/Iris/UI/InputHandler.cs @@ -57,7 +57,7 @@ namespace Microsoft.Iris.UI protected override void OnDispose() { base.OnDispose(); - this._ui = (UIClass)null; + this._ui = null; } protected override void OnOwnerDeclared(object owner) @@ -296,7 +296,7 @@ namespace Microsoft.Iris.UI ref WeakReference context, string contextName) { - object obj = context != null ? context.Target : (object)null; + object obj = context != null ? context.Target : null; object eventContext = this.GetEventContext(source); if (eventContext == obj) return; @@ -306,14 +306,14 @@ namespace Microsoft.Iris.UI protected object CheckEventContext(ref WeakReference context) { - object obj = (object)null; + object obj = null; if (context != null) { obj = context.Target; if (obj is IDisposableObject disposableObject && disposableObject.IsDisposed) { - context = (WeakReference)null; - obj = (object)null; + context = null; + obj = null; } } return obj; @@ -322,7 +322,7 @@ namespace Microsoft.Iris.UI protected object GetEventContext(ICookedInputSite clickTarget) { if (!(clickTarget is UIClass uiClass) || !uiClass.IsValid) - return (object)null; + return null; object eventContext; for (eventContext = uiClass.GetEventContext(); eventContext == null && uiClass != this.UI; eventContext = uiClass.GetEventContext()) uiClass = uiClass.Parent; diff --git a/UIX/Microsoft/Iris/UI/InputHandlerList.cs b/UIX/Microsoft/Iris/UI/InputHandlerList.cs index f4956a5..1b15e64 100644 --- a/UIX/Microsoft/Iris/UI/InputHandlerList.cs +++ b/UIX/Microsoft/Iris/UI/InputHandlerList.cs @@ -12,6 +12,6 @@ namespace Microsoft.Iris.UI { internal class InputHandlerList : List { - public StackIListReverseEnumerator GetEnumerator() => new StackIListReverseEnumerator((IList)this); + public StackIListReverseEnumerator GetEnumerator() => new StackIListReverseEnumerator(this); } } diff --git a/UIX/Microsoft/Iris/UI/RootLoadResult.cs b/UIX/Microsoft/Iris/UI/RootLoadResult.cs index 7f6a874..37729fc 100644 --- a/UIX/Microsoft/Iris/UI/RootLoadResult.cs +++ b/UIX/Microsoft/Iris/UI/RootLoadResult.cs @@ -14,13 +14,13 @@ namespace Microsoft.Iris.UI public RootLoadResult(string name) : base(name) - => this.RootType = new UIClassTypeSchema((MarkupLoadResult)this, name); + => this.RootType = new UIClassTypeSchema(this, name); protected override void OnDispose() { base.OnDispose(); - this.RootType.Dispose((object)this); - this.RootType = (UIClassTypeSchema)null; + this.RootType.Dispose(this); + this.RootType = null; } public override TypeSchema FindType(string name) => (TypeSchema)null; diff --git a/UIX/Microsoft/Iris/UI/RootUI.cs b/UIX/Microsoft/Iris/UI/RootUI.cs index 2a91c49..c2a0365 100644 --- a/UIX/Microsoft/Iris/UI/RootUI.cs +++ b/UIX/Microsoft/Iris/UI/RootUI.cs @@ -14,7 +14,7 @@ namespace Microsoft.Iris.UI public RootUI(UIZone zone) : base(MarkupSystem.RootGlobal.RootType) { - this.DeclareOwner((object)zone); + this.DeclareOwner(zone); this.PropagateZone(zone); this.NotifyInitialized(); } @@ -27,7 +27,7 @@ namespace Microsoft.Iris.UI UIClass ui, Accessible data) { - return (AccessibleProxy)new RootAccessibleProxy(ui, data); + return new RootAccessibleProxy(ui, data); } } } diff --git a/UIX/Microsoft/Iris/UI/UIClass.cs b/UIX/Microsoft/Iris/UI/UIClass.cs index ab165f6..6996be3 100644 --- a/UIX/Microsoft/Iris/UI/UIClass.cs +++ b/UIX/Microsoft/Iris/UI/UIClass.cs @@ -100,28 +100,28 @@ namespace Microsoft.Iris.UI protected override void OnDispose() { - this._typeSchema.RunFinalEvaluates((IMarkupTypeBase)this); + this._typeSchema.RunFinalEvaluates(this); base.OnDispose(); if (this.Initialized) AccessibleProxy.NotifyDestroyed(this); this.SetBit(UIClass.Bits.ScriptEnabled, false); if (this._listeners != null) { - this._listeners.Dispose((object)this); - this._listeners = (MarkupListeners)null; + this._listeners.Dispose(this); + this._listeners = null; } this._notifier.ClearListeners(); if (this._rootItem != null) { this.DisposeViewItemTree(this._rootItem); - this._rootItem = (ViewItem)null; + this._rootItem = null; } this.DisposeInputHandlers(); this._storage.Clear(); if (this._disposables != null) { for (int index = 0; index < this._disposables.Count; ++index) - this._disposables[index].Dispose((object)this); + this._disposables[index].Dispose(this); } this.RemoveEventHandlers(UIClass.s_descendantMouseFocusChangedEvent); this.RemoveEventHandlers(UIClass.s_descendantKeyFocusChangedEvent); @@ -132,7 +132,7 @@ namespace Microsoft.Iris.UI if (this._inputHandlers == null) return; foreach (DisposableObject inputHandler in this._inputHandlers) - inputHandler.Dispose((object)this); + inputHandler.Dispose(this); } internal void DisposeViewItemTree(ViewItem item) @@ -145,7 +145,7 @@ namespace Microsoft.Iris.UI nextSibling = (ViewItem)viewItem.NextSibling; this.DisposeViewItemTree(viewItem); } - item.Dispose((object)this); + item.Dispose(this); } internal void DestroyVisualTree(ViewItem subjectItem) => this.DestroyVisualTree(subjectItem, false); @@ -269,7 +269,7 @@ namespace Microsoft.Iris.UI if (data == null) data = new Accessible(); accessibleProxy = this.OnCreateAccessibleProxy(this, data); - this.SetData(UIClass.s_accProxyProperty, (object)accessibleProxy); + this.SetData(UIClass.s_accProxyProperty, accessibleProxy); this.SetBit(UIClass.Bits.HasAccProxy, true); } return accessibleProxy; @@ -352,9 +352,9 @@ namespace Microsoft.Iris.UI { UIClass keyFocusDescendant = this.KeyFocusDescendant; if (keyFocusDescendant != null && keyFocusDescendant.RootItem != null) - return (object)new UIClass.SavedFocusState(keyFocusDescendant.RootItem); + return new UIClass.SavedFocusState(keyFocusDescendant.RootItem); } - return (object)null; + return null; } internal void RestoreKeyFocus(object obj) => this.RestoreKeyFocus(obj, true); @@ -371,7 +371,7 @@ namespace Microsoft.Iris.UI if (resultItem == null) break; UIClass ui = resultItem.UI; - if (!this.HasDescendant((Microsoft.Iris.Library.TreeNode)ui) || !ui.IsKeyFocusable()) + if (!this.HasDescendant(ui) || !ui.IsKeyFocusable()) break; resultItem.NavigateInto(focusState.FocusIsDefault); break; @@ -386,7 +386,7 @@ namespace Microsoft.Iris.UI private UIClass.DeferredKeyFocusRestoreHelper PendingFocusRestore { get => this.GetData(UIClass.s_pendingFocusRestoreProperty) as UIClass.DeferredKeyFocusRestoreHelper; - set => this.SetData(UIClass.s_pendingFocusRestoreProperty, (object)value); + set => this.SetData(UIClass.s_pendingFocusRestoreProperty, value); } private static bool CheckHandled(InputInfo info, InputHandler inputHandler) => info.Handled; @@ -431,7 +431,7 @@ namespace Microsoft.Iris.UI { if (this._inputHandlers == null) this._inputHandlers = new InputHandlerList(); - return (IList)this._inputHandlers; + return _inputHandlers; } internal bool Visible => this.IsRoot || this._ownerHost.HasVisual; @@ -453,7 +453,7 @@ namespace Microsoft.Iris.UI { if (!this.ChangeBit(UIClass.Bits.Enabled, value)) return; - this.UpdateMouseHandling((ViewItem)null); + this.UpdateMouseHandling(null); this.RevalidateUsage(true, !value); this.FireNotification(NotificationID.Enabled); if (!this.IsZoned || this.Parent != null && !this.Parent.FullyEnabled) @@ -517,7 +517,7 @@ namespace Microsoft.Iris.UI { if (this.FocusInterestTarget == value) return; - this.SetData(UIClass.s_focusInterestTargetProperty, (object)value); + this.SetData(UIClass.s_focusInterestTargetProperty, value); this.FireNotification(NotificationID.FocusInterestTarget); } } @@ -533,7 +533,7 @@ namespace Microsoft.Iris.UI { if (!(this.FocusInterestTargetMargins != value)) return; - this.SetData(UIClass.s_focusInterestTargetMarginsProperty, (object)value); + this.SetData(UIClass.s_focusInterestTargetMarginsProperty, value); this.FireNotification(NotificationID.FocusInterestTargetMargins); } } @@ -552,7 +552,7 @@ namespace Microsoft.Iris.UI { if (this.Cursor == value) return; - this.SetData(UIClass.s_cursorProperty, (object)value); + this.SetData(UIClass.s_cursorProperty, value); this.FireNotification(NotificationID.Cursor); if (!this.IsZoned || this.OverrideCursor != CursorID.NotSpecified) return; @@ -575,7 +575,7 @@ namespace Microsoft.Iris.UI CursorID overrideCursor = this.OverrideCursor; if (overrideCursor == value) return; - this.SetData(UIClass.s_cursorOverrideProperty, (object)value); + this.SetData(UIClass.s_cursorOverrideProperty, value); if (!this.IsZoned || overrideCursor == CursorID.NotSpecified && value == this.Cursor) return; this.Zone.UpdateCursor(this); @@ -645,7 +645,7 @@ namespace Microsoft.Iris.UI { if (!this.ChangeBit(UIClass.Bits.RawInputDisabled, !enableFlag)) return; - this.UpdateMouseHandling((ViewItem)null); + this.UpdateMouseHandling(null); this.RevalidateUsage(true, !enableFlag); } @@ -655,7 +655,7 @@ namespace Microsoft.Iris.UI public bool IsEligibleForInput(out UIClass failurePoint) { - failurePoint = (UIClass)null; + failurePoint = null; UIClass uiClass = this; while (true) { @@ -673,7 +673,7 @@ namespace Microsoft.Iris.UI } return false; label_5: - failurePoint = (UIClass)null; + failurePoint = null; return this.IsZoned; } @@ -691,12 +691,12 @@ namespace Microsoft.Iris.UI return; if (value && this._rootItem != null && !this.HasMouseInteractiveContent()) this._rootItem.MouseInteractive = true; - this.UpdateMouseHandling((ViewItem)null); + this.UpdateMouseHandling(null); this.RevalidateUsage(false, !value); this.FireNotification(NotificationID.MouseInteractive); if (!DebugOutlines.Enabled) return; - DebugOutlines.NotifyInteractivityChange((ViewItem)this.Host); + DebugOutlines.NotifyInteractivityChange(Host); } public bool IsMouseFocusable() => this.MouseInteractive && this.IsEligibleForInput(); @@ -712,7 +712,7 @@ namespace Microsoft.Iris.UI this.FireNotification(NotificationID.KeyInteractive); if (!DebugOutlines.Enabled) return; - DebugOutlines.NotifyInteractivityChange((ViewItem)this.Host); + DebugOutlines.NotifyInteractivityChange(Host); } } @@ -729,11 +729,11 @@ namespace Microsoft.Iris.UI public UIClass FindKeyFocusableAncestor() { if (!this.IsValid) - return (UIClass)null; + return null; UIClass uiClass; for (uiClass = this; uiClass != null; uiClass = uiClass.Parent) { - UIClass failurePoint = (UIClass)null; + UIClass failurePoint = null; if (uiClass.KeyInteractive && uiClass.IsEligibleForInput(out failurePoint)) return uiClass; if (failurePoint != null) @@ -752,7 +752,7 @@ namespace Microsoft.Iris.UI { if (!this.IsKeyFocusable()) return; - this.UISession.InputManager.Queue.RequestKeyFocus((ICookedInputSite)this, keyfocusReason); + this.UISession.InputManager.Queue.RequestKeyFocus(this, keyfocusReason); } public bool IsValid => !this.IsDisposed; @@ -766,7 +766,7 @@ namespace Microsoft.Iris.UI case InputDeviceType.Mouse: return UIClass.s_updateMouseFocusStates; default: - return (FocusStateHandler)null; + return null; } } @@ -774,7 +774,7 @@ namespace Microsoft.Iris.UI { if (!this.IsZoned) return; - this.UISession.InputManager.RevalidateInputSiteUsage((ICookedInputSite)this, recursiveFlag, knownDisabledFlag); + this.UISession.InputManager.RevalidateInputSiteUsage(this, recursiveFlag, knownDisabledFlag); } internal void OnInputEnabledChanged() @@ -782,7 +782,7 @@ namespace Microsoft.Iris.UI if (!this.IsZoned) return; this.RevalidateUsage(true, !this.InputEnabled); - this.UpdateMouseHandling((ViewItem)null); + this.UpdateMouseHandling(null); if (!this.Enabled || this.Parent != null && !this.Parent.FullyEnabled) return; this.NotifyFullyEnabledChange(); @@ -792,9 +792,9 @@ namespace Microsoft.Iris.UI { get { - IRawInputSite rawInputSite = (IRawInputSite)null; + IRawInputSite rawInputSite = null; if (this._rootItem != null) - rawInputSite = (IRawInputSite)this._rootItem.RendererVisual; + rawInputSite = _rootItem.RendererVisual; return rawInputSite; } } @@ -907,7 +907,7 @@ namespace Microsoft.Iris.UI private void OnGainKeyFocus() { - NavigationServices.SeedDefaultFocus((INavigationSite)this.RootItem); + NavigationServices.SeedDefaultFocus(RootItem); if (this.CreateInterestOnFocus) { this.SetAreaOfInterest(AreaOfInterestID.Focus); @@ -965,7 +965,7 @@ namespace Microsoft.Iris.UI return; recipient.FireNotification(NotificationID.DirectKeyFocus); if (DebugOutlines.Enabled) - DebugOutlines.NotifyInteractivityChange((ViewItem)recipient.Host); + DebugOutlines.NotifyInteractivityChange(recipient.Host); if (!directFocusFlag) return; AccessibleProxy.NotifyFocus(recipient); @@ -973,8 +973,8 @@ namespace Microsoft.Iris.UI public event InputEventHandler DescendentKeyFocusChange { - add => this.AddEventHandler(UIClass.s_descendantKeyFocusChangedEvent, (Delegate)value); - remove => this.RemoveEventHandler(UIClass.s_descendantKeyFocusChangedEvent, (Delegate)value); + add => this.AddEventHandler(UIClass.s_descendantKeyFocusChangedEvent, value); + remove => this.RemoveEventHandler(UIClass.s_descendantKeyFocusChangedEvent, value); } private static void UpdateMouseFocusStates( @@ -989,13 +989,13 @@ namespace Microsoft.Iris.UI recipient.FireNotification(NotificationID.DirectMouseFocus); if (!DebugOutlines.Enabled) return; - DebugOutlines.NotifyInteractivityChange((ViewItem)recipient.Host); + DebugOutlines.NotifyInteractivityChange(recipient.Host); } public event InputEventHandler DescendentMouseFocusChange { - add => this.AddEventHandler(UIClass.s_descendantMouseFocusChangedEvent, (Delegate)value); - remove => this.RemoveEventHandler(UIClass.s_descendantMouseFocusChangedEvent, (Delegate)value); + add => this.AddEventHandler(UIClass.s_descendantMouseFocusChangedEvent, value); + remove => this.RemoveEventHandler(UIClass.s_descendantMouseFocusChangedEvent, value); } private void DeliverCodeNotifications(InputInfo info) @@ -1040,8 +1040,8 @@ namespace Microsoft.Iris.UI if (flag3) subjectItem.CreateVisual(this.Zone.Session.RenderSession); Rectangle layoutBounds = subjectItem.LayoutBounds; - Vector2 vector2 = new Vector2((float)layoutBounds.Width, (float)layoutBounds.Height); - Vector3 vector3_1 = new Vector3((float)layoutBounds.X, (float)layoutBounds.Y, 0.0f); + Vector2 vector2 = new Vector2(layoutBounds.Width, layoutBounds.Height); + Vector3 vector3_1 = new Vector3(layoutBounds.X, layoutBounds.Y, 0.0f); Vector3 vector3_2 = subjectItem.LayoutScale * subjectItem.Scale; Rotation layoutRotation = subjectItem.LayoutRotation; Vector3 oldScaleVector; @@ -1088,7 +1088,7 @@ namespace Microsoft.Iris.UI { if (this._rootItem != null) return this.FindNextFocusablePeerWorker(this._rootItem, searchDirection, startRectangleF, out resultUI); - resultUI = (UIClass)null; + resultUI = null; return false; } @@ -1099,8 +1099,8 @@ namespace Microsoft.Iris.UI out UIClass resultUI) { INavigationSite resultSite; - bool nextPeer = NavigationServices.FindNextPeer((INavigationSite)startItem, searchDirection, startRectangleF, out resultSite); - resultUI = (UIClass)null; + bool nextPeer = NavigationServices.FindNextPeer(startItem, searchDirection, startRectangleF, out resultSite); + resultUI = null; if (resultSite != null && resultSite is ViewItem viewItem) resultUI = viewItem.UI; return nextPeer; @@ -1112,8 +1112,8 @@ namespace Microsoft.Iris.UI out UIClass resultUI) { INavigationSite resultSite; - bool nextWithin = NavigationServices.FindNextWithin((INavigationSite)this._rootItem, searchDirection, startRectangleF, out resultSite); - resultUI = (UIClass)null; + bool nextWithin = NavigationServices.FindNextWithin(_rootItem, searchDirection, startRectangleF, out resultSite); + resultUI = null; if (resultSite != null && resultSite is ViewItem viewItem) resultUI = viewItem.UI; return nextWithin; @@ -1181,7 +1181,7 @@ namespace Microsoft.Iris.UI return this.NavigateDirection(direction, reason); } - public TypeSchema TypeSchema => (TypeSchema)this._typeSchema; + public TypeSchema TypeSchema => _typeSchema; public void NotifyInitialized() { @@ -1206,21 +1206,21 @@ namespace Microsoft.Iris.UI public object ReadSymbol(SymbolReference symbolRef) { - object obj = (object)null; + object obj = null; switch (symbolRef.Origin) { case SymbolOrigin.Properties: case SymbolOrigin.Locals: - obj = this._storage[(object)symbolRef.Symbol]; + obj = this._storage[symbolRef.Symbol]; break; case SymbolOrigin.Input: if (this._inputHandlers != null) { foreach (InputHandler inputHandler in this._inputHandlers) { - if (inputHandler.Name != null && object.ReferenceEquals((object)inputHandler.Name, (object)symbolRef.Symbol)) + if (inputHandler.Name != null && object.ReferenceEquals(inputHandler.Name, symbolRef.Symbol)) { - obj = (object)inputHandler; + obj = inputHandler; break; } } @@ -1228,12 +1228,12 @@ namespace Microsoft.Iris.UI } break; case SymbolOrigin.Content: - obj = (object)this.FindViewItemByName(this.RootItem, symbolRef.Symbol); + obj = this.FindViewItemByName(this.RootItem, symbolRef.Symbol); break; case SymbolOrigin.Reserved: if (symbolRef.Symbol == "UI") { - obj = (object)this; + obj = this; break; } break; @@ -1243,10 +1243,10 @@ namespace Microsoft.Iris.UI public ViewItem FindViewItemByName(ViewItem item, string name) { - if (object.ReferenceEquals((object)item.Name, (object)name)) + if (object.ReferenceEquals(item.Name, name)) return item; if (item.HideNamedChildren) - return (ViewItem)null; + return null; foreach (ViewItem child in item.Children) { if (child.UI == this) @@ -1256,28 +1256,28 @@ namespace Microsoft.Iris.UI return viewItemByName; } } - return (ViewItem)null; + return null; } public void WriteSymbol(SymbolReference symbolRef, object value) { string symbol = symbolRef.Symbol; - if (this._storage.ContainsKey((object)symbol) && Utility.IsEqual(this._storage[(object)symbol], value)) + if (this._storage.ContainsKey(symbol) && Utility.IsEqual(this._storage[symbol], value)) return; - this._storage[(object)symbol] = value; + this._storage[symbol] = value; if (symbolRef.Origin != SymbolOrigin.Properties && symbolRef.Origin != SymbolOrigin.Locals) return; bool surfaceViaHost = symbolRef.Origin == SymbolOrigin.Properties; this.FireNotification(symbol, surfaceViaHost); } - public object GetProperty(string name) => this._storage[(object)name]; + public object GetProperty(string name) => this._storage[name]; public void SetProperty(string name, object value) { - if (this._storage.ContainsKey((object)name) && Utility.IsEqual(this._storage[(object)name], value)) + if (this._storage.ContainsKey(name) && Utility.IsEqual(this._storage[name], value)) return; - this._storage[(object)name] = value; + this._storage[name] = value; this.FireNotification(name, true); } @@ -1292,23 +1292,23 @@ namespace Microsoft.Iris.UI public void ScheduleScriptRun(uint scriptId, bool ignoreErrors) { if (!this._scriptRunScheduler.Pending) - DeferredCall.Post(DispatchPriority.Script, UIClass.s_executePendingScriptsHandler, (object)this); + DeferredCall.Post(DispatchPriority.Script, UIClass.s_executePendingScriptsHandler, this); this._scriptRunScheduler.ScheduleRun(scriptId, ignoreErrors); } private static void ExecutePendingScripts(object args) { UIClass uiClass = (UIClass)args; - uiClass._scriptRunScheduler.Execute((IMarkupTypeBase)uiClass); + uiClass._scriptRunScheduler.Execute(uiClass); } - public object RunScript(uint scriptId, bool ignoreErrors, ParameterContext parameterContext) => this._typeSchema.Run((IMarkupTypeBase)this, scriptId, ignoreErrors, parameterContext); + public object RunScript(uint scriptId, bool ignoreErrors, ParameterContext parameterContext) => this._typeSchema.Run(this, scriptId, ignoreErrors, parameterContext); public void NotifyScriptErrors() { this.SetBit(UIClass.Bits.ScriptEnabled, false); this._ownerHost.NotifyChildUIScriptErrors(); - ErrorManager.ReportWarning("Script runtime failure: Scripting has been disabled for '{0}' due to runtime scripting errors", (object)this._typeSchema.Name); + ErrorManager.ReportWarning("Script runtime failure: Scripting has been disabled for '{0}' due to runtime scripting errors", _typeSchema.Name); } public bool ScriptEnabled => this.GetBit(UIClass.Bits.ScriptEnabled); @@ -1329,7 +1329,7 @@ namespace Microsoft.Iris.UI string contentName, ParameterContext parameterContext) { - return this._typeSchema.ConstructNamedContent(contentName, (IMarkupTypeBase)this, parameterContext); + return this._typeSchema.ConstructNamedContent(contentName, this, parameterContext); } private bool GetBit(UIClass.Bits lookupBit) => this._bits[(int)lookupBit]; @@ -1374,7 +1374,7 @@ namespace Microsoft.Iris.UI return false; } - public object GetEventContext() => this._eventContext != null ? this._eventContext.Value : (object)null; + public object GetEventContext() => this._eventContext != null ? this._eventContext.Value : null; internal void SetEventContext(EventContext eventContext) => this._eventContext = eventContext; @@ -1419,11 +1419,11 @@ namespace Microsoft.Iris.UI { if (!this._ui.IsZoned || this._ui.PendingFocusRestore != this) return; - this._ui.PendingFocusRestore = (UIClass.DeferredKeyFocusRestoreHelper)null; + this._ui.PendingFocusRestore = null; InputManager inputManager = this._ui.UISession.InputManager; if (!inputManager.RawKeyFocusIsDefault && inputManager.RawKeyFocus != this._lastFocus || (faultedInItem == null || faultedInItem.IsDisposed)) return; - this._ui.RestoreKeyFocus((object)this._focusState); + this._ui.RestoreKeyFocus(_focusState); } } diff --git a/UIX/Microsoft/Iris/UI/UIForm.cs b/UIX/Microsoft/Iris/UI/UIForm.cs index c30871c..fbfc6f6 100644 --- a/UIX/Microsoft/Iris/UI/UIForm.cs +++ b/UIX/Microsoft/Iris/UI/UIForm.cs @@ -60,7 +60,7 @@ namespace Microsoft.Iris.UI private void OnInitialize() { UIZone newZone = new UIZone(this); - newZone.DeclareOwner((object)this); + newZone.DeclareOwner(this); this.AttachChildZone(newZone); newZone.RootViewItem.RequestSource(this._initialSource, this._initialProperties); } @@ -237,7 +237,7 @@ namespace Microsoft.Iris.UI this.Zone.RootViewItem.RequestSource(source, properties); } - public SavedKeyFocus SaveKeyFocus() => this.Zone != null && this.Zone.RootUI != null ? new SavedKeyFocus(this.Zone.RootUI.SaveKeyFocus()) : (SavedKeyFocus)null; + public SavedKeyFocus SaveKeyFocus() => this.Zone != null && this.Zone.RootUI != null ? new SavedKeyFocus(this.Zone.RootUI.SaveKeyFocus()) : null; public void RestoreKeyFocus(SavedKeyFocus state) { @@ -318,8 +318,8 @@ namespace Microsoft.Iris.UI private void DeliverIntialLoadCompleteCallback() { - DeferredCall.Post(DispatchPriority.Idle, this._initialLoadComplete, (object)null); - this._initialLoadComplete = (DeferredHandler)null; + DeferredCall.Post(DispatchPriority.Idle, this._initialLoadComplete, null); + this._initialLoadComplete = null; } public void SetInitialLoadCompleteCallback(DeferredHandler callback) => this._initialLoadComplete = callback; @@ -341,7 +341,7 @@ namespace Microsoft.Iris.UI protected override void OnDestroy() { base.OnDestroy(); - this.Zone.Dispose((object)this); + this.Zone.Dispose(this); this.Session.InputManager.InvalidKeyFocus -= new InvalidKeyFocusHandler(this.OnInvalidKeyFocus); this.Session.Dispatcher.StopCurrentMessageLoop(); NativeApi.SpDestroyNotifyWindow(); @@ -365,10 +365,10 @@ namespace Microsoft.Iris.UI { AccessibleProxy.AccessibilityActive = true; AccObjectID accObjectId = (AccObjectID)lparam; - object accPtr1 = (object)null; + object accPtr1 = null; if (accObjectId == AccObjectID.Client) { - accPtr1 = (object)this.Zone.RootUI.AccessibleProxy; + accPtr1 = Zone.RootUI.AccessibleProxy; RootAccessibleProxy rootAccessibleProxy = (RootAccessibleProxy)accPtr1; if (rootAccessibleProxy.ClientBridge == null) { @@ -378,7 +378,7 @@ namespace Microsoft.Iris.UI } } else if (accObjectId > AccObjectID.Window) - accPtr1 = (object)AccessibleProxy.AccessibleProxyFromID((int)accObjectId); + accPtr1 = AccessibleProxy.AccessibleProxyFromID((int)accObjectId); if (accPtr1 == null) return IntPtr.Zero; Guid iidIaccessible = AccessibleProxy.IID_IAccessible; diff --git a/UIX/Microsoft/Iris/UI/UIZone.cs b/UIX/Microsoft/Iris/UI/UIZone.cs index 75e16e4..b51692d 100644 --- a/UIX/Microsoft/Iris/UI/UIZone.cs +++ b/UIX/Microsoft/Iris/UI/UIZone.cs @@ -44,8 +44,8 @@ namespace Microsoft.Iris.UI this._form = form; this._scale = Vector3.UnitVector; this._rootUI = new Microsoft.Iris.UI.RootUI(this); - this._rootViewItem = new RootViewItem(this, (UIClass)this._rootUI, (Microsoft.Iris.Session.Form)form); - this._rootUI.SetRootItem((ViewItem)this._rootViewItem); + this._rootViewItem = new RootViewItem(this, _rootUI, form); + this._rootUI.SetRootItem(_rootViewItem); this._cachedInputDeliveryData = new UIZone.InputDeliveryData(); this._cachedUIClassStorage = new UIClass[4][]; this._cachedUIClassStorageIndex = this._cachedUIClassStorage.Length - 1; @@ -54,8 +54,8 @@ namespace Microsoft.Iris.UI protected override void OnDispose() { base.OnDispose(); - this._rootUI.Dispose((object)this); - this._rootUI = (Microsoft.Iris.UI.RootUI)null; + this._rootUI.Dispose(this); + this._rootUI = null; } public UISession Session => this._parentSession; @@ -64,7 +64,7 @@ namespace Microsoft.Iris.UI public RootViewItem RootViewItem => this._rootViewItem; - public UIClass RootUI => (UIClass)this._rootUI; + public UIClass RootUI => _rootUI; public bool ZonePhysicalVisible => this._physicalVisible; @@ -78,7 +78,7 @@ namespace Microsoft.Iris.UI IRawInputSite rawSource, ICookedInputSite targetRelative) { - UIClass uiClass = (UIClass)null; + UIClass uiClass = null; if (targetRelative != null) uiClass = targetRelative as UIClass; else if (rawSource != null && rawSource.OwnerData is ViewItem ownerData) @@ -88,8 +88,8 @@ namespace Microsoft.Iris.UI uiClass = ui; } if (uiClass != null && !uiClass.IsMouseFocusable()) - uiClass = (UIClass)null; - return (ICookedInputSite)uiClass; + uiClass = null; + return uiClass; } public object PrepareInputForDelivery( @@ -103,7 +103,7 @@ namespace Microsoft.Iris.UI inputDeliveryData.eventRoute = this.ComputeEventRoute((UIClass)endpoint, out inputDeliveryData.routingLength); if (inputDeliveryData.eventRoute != null) --inputDeliveryData.routingLength; - return (object)inputDeliveryData; + return inputDeliveryData; } public void UpdateInputFocusStates( @@ -150,7 +150,7 @@ namespace Microsoft.Iris.UI if (this._form == null) return; UIClass uiClass = this.Session.InputManager.Queue.CurrentMouseFocus as UIClass; - if (changedUI != null && !this.IsChildADescendant((ITreeNode)changedUI, (ITreeNode)uiClass)) + if (changedUI != null && !this.IsChildADescendant(changedUI, uiClass)) return; CursorID cursorId = CursorID.NotSpecified; if (uiClass != null && uiClass.Zone == this) @@ -241,7 +241,7 @@ namespace Microsoft.Iris.UI RectangleF startRectangleF, bool defaultFlag) { - UIClass rootUi = (UIClass)this._rootUI; + UIClass rootUi = _rootUI; return rootUi != null && rootUi.InboundKeyNavigation(searchDirection, startRectangleF, defaultFlag); } @@ -272,7 +272,7 @@ namespace Microsoft.Iris.UI this.DeliverInitializations(); break; case UiTask.LayoutComputation: - ILayoutNode rootViewItem1 = (ILayoutNode)this._rootViewItem; + ILayoutNode rootViewItem1 = _rootViewItem; if (rootViewItem1 == null) break; ScrollingLayout.ResetScrollFocusIntoView(); @@ -290,7 +290,7 @@ namespace Microsoft.Iris.UI this._rootViewItem.ResetLayoutInvalid(); break; case UiTask.LayoutApplication: - ViewItem rootViewItem2 = (ViewItem)this._rootViewItem; + ViewItem rootViewItem2 = _rootViewItem; if (rootViewItem2 == null) break; bool zonePhysicalVisible = this.ZonePhysicalVisible; @@ -374,7 +374,7 @@ namespace Microsoft.Iris.UI private UIZone.InputDeliveryData GetInputDeliveryData() { UIZone.InputDeliveryData inputDeliveryData = this._cachedInputDeliveryData; - this._cachedInputDeliveryData = (UIZone.InputDeliveryData)null; + this._cachedInputDeliveryData = null; if (inputDeliveryData == null) inputDeliveryData = new UIZone.InputDeliveryData(); return inputDeliveryData; @@ -385,13 +385,13 @@ namespace Microsoft.Iris.UI if (param == null) return; UIZone.InputDeliveryData inputDeliveryData = (UIZone.InputDeliveryData)param; - inputDeliveryData.target = (UIClass)null; - inputDeliveryData.sourceInputInfo = (InputInfo)null; + inputDeliveryData.target = null; + inputDeliveryData.sourceInputInfo = null; if (!inputDeliveryData.eventRouteCached) this.RecycleUIClassArray(inputDeliveryData.eventRoute); else inputDeliveryData.eventRouteCached = false; - inputDeliveryData.eventRoute = (UIClass[])null; + inputDeliveryData.eventRoute = null; inputDeliveryData.routingLength = 0; inputDeliveryData.routeTruncated = false; this._cachedInputDeliveryData = inputDeliveryData; @@ -399,11 +399,11 @@ namespace Microsoft.Iris.UI private UIClass[] GetUIClassArray(int requiredLength) { - UIClass[] uiClassArray = (UIClass[])null; + UIClass[] uiClassArray = null; if (this._cachedUIClassStorageIndex >= 0) { uiClassArray = this._cachedUIClassStorage[this._cachedUIClassStorageIndex]; - this._cachedUIClassStorage[this._cachedUIClassStorageIndex] = (UIClass[])null; + this._cachedUIClassStorage[this._cachedUIClassStorageIndex] = null; --this._cachedUIClassStorageIndex; } if (uiClassArray == null || uiClassArray.Length < requiredLength) @@ -416,7 +416,7 @@ namespace Microsoft.Iris.UI if (storage == null || this._cachedUIClassStorageIndex >= this._cachedUIClassStorage.Length - 1) return; ++this._cachedUIClassStorageIndex; - Array.Clear((Array)storage, 0, storage.Length); + Array.Clear(storage, 0, storage.Length); this._cachedUIClassStorage[this._cachedUIClassStorageIndex] = storage; } @@ -424,7 +424,7 @@ namespace Microsoft.Iris.UI { entriesCount = 0; if (endpoint == null) - return (UIClass[])null; + return null; for (UIClass uiClass = endpoint; uiClass != null; uiClass = uiClass.Parent) ++entriesCount; UIClass[] uiClassArray = this.GetUIClassArray(entriesCount); @@ -445,7 +445,7 @@ namespace Microsoft.Iris.UI if (updateProc == null) return; UIClass[] uiClassArray1 = refCurrentFocusRouteList; - UIClass[] uiClassArray2 = (UIClass[])null; + UIClass[] uiClassArray2 = null; UIZone.InputDeliveryData inputDeliveryData = (UIZone.InputDeliveryData)param; if (inputDeliveryData != null) uiClassArray2 = inputDeliveryData.eventRoute; @@ -456,7 +456,7 @@ namespace Microsoft.Iris.UI inputDeliveryData.eventRouteCached = true; UIClass[] removedFromRoute = this.FindControlsRemovedFromRoute(uiClassArray1, uiClassArray2); if (removedFromRoute != null) - UIZone.UpdateControlFocusStates(removedFromRoute, false, (ITreeNode)null, updateProc); + UIZone.UpdateControlFocusStates(removedFromRoute, false, null, updateProc); this.RecycleUIClassArray(uiClassArray1); if (removedFromRoute != uiClassArray1) this.RecycleUIClassArray(removedFromRoute); @@ -469,7 +469,7 @@ namespace Microsoft.Iris.UI UIClass[] oldRouteList, UIClass[] newRouteList) { - UIClass[] uiClassArray = (UIClass[])null; + UIClass[] uiClassArray = null; if (oldRouteList != null) { if (newRouteList != null && newRouteList.Length > 0) @@ -537,7 +537,7 @@ namespace Microsoft.Iris.UI while (this._needFullyEnabledNotificationsFlag) { this._needFullyEnabledNotificationsFlag = false; - UIClass rootUi = (UIClass)this._rootUI; + UIClass rootUi = _rootUI; if (rootUi != null) rootUi.DeliverFullyEnabled(true); else @@ -546,7 +546,7 @@ namespace Microsoft.Iris.UI if (this._needScaleNotificationsFlag) { this._needScaleNotificationsFlag = false; - ViewItem rootViewItem = (ViewItem)this._rootViewItem; + ViewItem rootViewItem = _rootViewItem; if (rootViewItem != null) rootViewItem.DeliverEffectiveScaleChange(false); else @@ -577,7 +577,7 @@ namespace Microsoft.Iris.UI this.ImplementUiTask(task, param); } - public override string ToString() => this.GetType().Name + "[" + (object)this._form + "]"; + public override string ToString() => this.GetType().Name + "[" + _form + "]"; private class InputDeliveryData { diff --git a/UIX/Microsoft/Iris/UI/ViewItem.cs b/UIX/Microsoft/Iris/UI/ViewItem.cs index 81671f8..805da27 100644 --- a/UIX/Microsoft/Iris/UI/ViewItem.cs +++ b/UIX/Microsoft/Iris/UI/ViewItem.cs @@ -109,7 +109,7 @@ namespace Microsoft.Iris.UI this._bits = new BitVector32(); this._bits2 = new BitVector32(); this.SetBit(ViewItem.Bits.LayoutInputVisible, true); - this._layout = (ILayout)DefaultLayout.Instance; + this._layout = DefaultLayout.Instance; this._backgroundColor = Color.Transparent; } @@ -132,24 +132,24 @@ namespace Microsoft.Iris.UI if (activeAnimations != null) { foreach (DisposableObject disposableObject in activeAnimations) - disposableObject.Dispose((object)this); + disposableObject.Dispose(this); } Vector idleAnimations = this.GetIdleAnimations(false); if (idleAnimations != null) { foreach (DisposableObject disposableObject in idleAnimations) - disposableObject.Dispose((object)this); + disposableObject.Dispose(this); } - this.Effect?.DoneWithRenderEffects((object)this); - this._ownerUI = (UIClass)null; - this._layout = (ILayout)null; + this.Effect?.DoneWithRenderEffects(this); + this._ownerUI = null; + this._layout = null; if (!this.GetBit(ViewItem.Bits2.HasCamera)) return; Camera data = (Camera)this.GetData(ViewItem.s_cameraProperty); if (data == null) return; - this.SetData(ViewItem.s_cameraProperty, (object)null); - data.UnregisterUsage((object)this); + this.SetData(ViewItem.s_cameraProperty, null); + data.UnregisterUsage(this); } protected void FireNotification(string id) => this._notifier.Fire(id); @@ -158,9 +158,9 @@ namespace Microsoft.Iris.UI public bool HasVisual => this._container != null; - public IVisual RendererVisual => (IVisual)this._container; + public IVisual RendererVisual => _container; - IAnimatable IAnimatableOwner.AnimationTarget => (IAnimatable)this._container; + IAnimatable IAnimatableOwner.AnimationTarget => _container; public virtual Color Background { @@ -182,9 +182,9 @@ namespace Microsoft.Iris.UI { if (this._container != null) { - orphans.AddOrphan((IVisual)this._container); - this._container.UnregisterUsage((object)this); - this._container = (IVisualContainer)null; + orphans.AddOrphan(_container); + this._container.UnregisterUsage(this); + this._container = null; } this.DisposeBackgroundContent(false); } @@ -197,14 +197,14 @@ namespace Microsoft.Iris.UI bool bit = this.GetBit(ViewItem.Bits2.HasSizeNoSend); this._container.SetSize(value, bit); if (bit) - this.SetDynamicValue((object)value, true, ViewItem.Bits2.HasSizeNoSend, ViewItem.s_sizeNoSendProperty, nameof(VisualSize)); + this.SetDynamicValue(value, true, ViewItem.Bits2.HasSizeNoSend, ViewItem.s_sizeNoSendProperty, nameof(VisualSize)); this.MarkPaintInvalid(); } } private Vector2 VisualSizeNoSend { - set => this.SetDynamicValue((object)value, false, ViewItem.Bits2.HasSizeNoSend, ViewItem.s_sizeNoSendProperty, "VisualSize"); + set => this.SetDynamicValue(value, false, ViewItem.Bits2.HasSizeNoSend, ViewItem.s_sizeNoSendProperty, "VisualSize"); } public Vector3 VisualPosition @@ -216,13 +216,13 @@ namespace Microsoft.Iris.UI this._container.SetPosition(value, bit); if (!bit) return; - this.SetDynamicValue((object)value, true, ViewItem.Bits2.HasPositionNoSend, ViewItem.s_positionNoSendProperty, nameof(VisualPosition)); + this.SetDynamicValue(value, true, ViewItem.Bits2.HasPositionNoSend, ViewItem.s_positionNoSendProperty, nameof(VisualPosition)); } } private Vector3 VisualPositionNoSend { - set => this.SetDynamicValue((object)value, false, ViewItem.Bits2.HasPositionNoSend, ViewItem.s_positionNoSendProperty, "VisualPosition"); + set => this.SetDynamicValue(value, false, ViewItem.Bits2.HasPositionNoSend, ViewItem.s_positionNoSendProperty, "VisualPosition"); } public Vector3 VisualScale @@ -234,13 +234,13 @@ namespace Microsoft.Iris.UI this._container.SetScale(value, bit); if (!bit) return; - this.SetDynamicValue((object)value, true, ViewItem.Bits2.HasScaleNoSend, ViewItem.s_scaleNoSendProperty, nameof(VisualScale)); + this.SetDynamicValue(value, true, ViewItem.Bits2.HasScaleNoSend, ViewItem.s_scaleNoSendProperty, nameof(VisualScale)); } } private Vector3 VisualScaleNoSend { - set => this.SetDynamicValue((object)value, false, ViewItem.Bits2.HasScaleNoSend, ViewItem.s_scaleNoSendProperty, "VisualScale"); + set => this.SetDynamicValue(value, false, ViewItem.Bits2.HasScaleNoSend, ViewItem.s_scaleNoSendProperty, "VisualScale"); } public Rotation VisualRotation @@ -258,13 +258,13 @@ namespace Microsoft.Iris.UI this._container.SetRotation(new AxisAngle(value.Axis, value.AngleRadians), bit); if (!bit) return; - this.SetDynamicValue((object)value, true, ViewItem.Bits2.HasRotationNoSend, ViewItem.s_rotationNoSendProperty, nameof(VisualRotation)); + this.SetDynamicValue(value, true, ViewItem.Bits2.HasRotationNoSend, ViewItem.s_rotationNoSendProperty, nameof(VisualRotation)); } } private Rotation VisualRotationNoSend { - set => this.SetDynamicValue((object)value, false, ViewItem.Bits2.HasRotationNoSend, ViewItem.s_rotationNoSendProperty, "VisualRotation"); + set => this.SetDynamicValue(value, false, ViewItem.Bits2.HasRotationNoSend, ViewItem.s_rotationNoSendProperty, "VisualRotation"); } public float VisualAlpha @@ -276,7 +276,7 @@ namespace Microsoft.Iris.UI bool bit = this.GetBit(ViewItem.Bits2.HasAlphaNoSend); this._container.SetAlpha(value, bit); if (bit) - this.SetDynamicValue((object)value, true, ViewItem.Bits2.HasAlphaNoSend, ViewItem.s_alphaNoSendProperty, nameof(VisualAlpha)); + this.SetDynamicValue(value, true, ViewItem.Bits2.HasAlphaNoSend, ViewItem.s_alphaNoSendProperty, nameof(VisualAlpha)); if (fullyVisible == this.FullyVisible) return; this.OnVisibilityChange(); @@ -288,7 +288,7 @@ namespace Microsoft.Iris.UI set { bool fullyVisible = this.FullyVisible; - this.SetDynamicValue((object)value, false, ViewItem.Bits2.HasAlphaNoSend, ViewItem.s_alphaNoSendProperty, "VisualAlpha"); + this.SetDynamicValue(value, false, ViewItem.Bits2.HasAlphaNoSend, ViewItem.s_alphaNoSendProperty, "VisualAlpha"); if (fullyVisible == this.FullyVisible) return; this.OnVisibilityChange(); @@ -315,7 +315,7 @@ namespace Microsoft.Iris.UI string stTracePropertyName) { if (fValueIsDefault) - this.SetData(cookie, (object)null); + this.SetData(cookie, null); else this.SetData(cookie, value); this.SetBit(bit, !fValueIsDefault); @@ -354,7 +354,7 @@ namespace Microsoft.Iris.UI this.Zone.ScheduleUiTask(UiTask.Painting); if (!(this.GetEventHandler(ViewItem.s_paintInvalidEvent) is EventHandler eventHandler)) return; - eventHandler((object)this, EventArgs.Empty); + eventHandler(this, EventArgs.Empty); } private void MarkPaintChildrenInvalid() @@ -395,7 +395,7 @@ namespace Microsoft.Iris.UI { if (!this.HasVisual || !this.Visible) return false; - return (double)this.VisualAlpha > 0.0 || this.GetBit(ViewItem.Bits2.IsAlphaAnimationPlaying); + return VisualAlpha > 0.0 || this.GetBit(ViewItem.Bits2.IsAlphaAnimationPlaying); } } @@ -424,7 +424,7 @@ namespace Microsoft.Iris.UI { if (this.GetEventHandler(ViewItem.s_paintEvent) is ViewItem.PaintHandler eventHandler) eventHandler(this); - bool flag = visible && this._backgroundColor.A != (byte)0; + bool flag = visible && this._backgroundColor.A != 0; if (flag && this._backgroundSprite == null) this.CreateBackgroundContent(); else if (!flag && this._backgroundSprite != null) @@ -436,14 +436,14 @@ namespace Microsoft.Iris.UI public event ViewItem.PaintHandler Paint { - add => this.AddEventHandler(ViewItem.s_paintEvent, (Delegate)value); - remove => this.RemoveEventHandler(ViewItem.s_paintEvent, (Delegate)value); + add => this.AddEventHandler(ViewItem.s_paintEvent, value); + remove => this.RemoveEventHandler(ViewItem.s_paintEvent, value); } public event EventHandler PaintInvalid { - add => this.AddEventHandler(ViewItem.s_paintInvalidEvent, (Delegate)value); - remove => this.RemoveEventHandler(ViewItem.s_paintInvalidEvent, (Delegate)value); + add => this.AddEventHandler(ViewItem.s_paintInvalidEvent, value); + remove => this.RemoveEventHandler(ViewItem.s_paintInvalidEvent, value); } protected virtual void DisposeAllContent() => this.DisposeBackgroundContent(true); @@ -454,19 +454,19 @@ namespace Microsoft.Iris.UI return; if (removeFromTree) this._backgroundSprite.Remove(); - this._backgroundSprite.UnregisterUsage((object)this); - this._backgroundSprite = (ISprite)null; + this._backgroundSprite.UnregisterUsage(this); + this._backgroundSprite = null; } private void CreateBackgroundContent() { - this._backgroundSprite = UISession.Default.RenderSession.CreateSprite((object)this, (object)this); - this.VisualContainer.AddChild((IVisual)this._backgroundSprite, (IVisual)null, VisualOrder.Last); - IEffect colorFillEffect = EffectManager.CreateColorFillEffect((object)this, this._backgroundColor); + this._backgroundSprite = UISession.Default.RenderSession.CreateSprite(this, this); + this.VisualContainer.AddChild(_backgroundSprite, null, VisualOrder.Last); + IEffect colorFillEffect = EffectManager.CreateColorFillEffect(this, this._backgroundColor); this._backgroundSprite.Effect = colorFillEffect; this._backgroundSprite.RelativeSize = true; this._backgroundSprite.Size = Vector2.UnitVector; - colorFillEffect.UnregisterUsage((object)this); + colorFillEffect.UnregisterUsage(this); } public Vector3 Scale @@ -488,12 +488,12 @@ namespace Microsoft.Iris.UI return; if (value != Vector3.UnitVector) { - this.SetData(ViewItem.s_scaleProperty, (object)value); + this.SetData(ViewItem.s_scaleProperty, value); this.SetBit(ViewItem.Bits.HasScale, true); } else if (this.GetBit(ViewItem.Bits.HasScale)) { - this.SetData(ViewItem.s_scaleProperty, (object)null); + this.SetData(ViewItem.s_scaleProperty, null); this.SetBit(ViewItem.Bits.HasScale, false); } if (this.HasVisual) @@ -523,10 +523,10 @@ namespace Microsoft.Iris.UI set { float alpha = this.Alpha; - if ((double)value == (double)alpha) + if (value == (double)alpha) return; bool flag = Math2.WithinEpsilon(value, 1f); - object obj = flag ? (object)null : (object)value; + object obj = flag ? null : (object)value; this.SetData(ViewItem.s_alphaProperty, obj); this.SetBit(ViewItem.Bits2.HasAlpha, !flag); if (this.HasVisual) @@ -537,7 +537,7 @@ namespace Microsoft.Iris.UI NewAlpha = value }; this.ApplyAnimatableValue(AnimationEventType.Alpha, ref args); - if ((double)alpha == 0.0 || (double)value == 0.0) + if (alpha == 0.0 || value == 0.0) this.OnVisibilityChange(); } this.FireNotification(NotificationID.Alpha); @@ -548,7 +548,7 @@ namespace Microsoft.Iris.UI { get { - Camera camera = (Camera)null; + Camera camera = null; if (this.GetBit(ViewItem.Bits2.HasCamera)) camera = (Camera)this.GetData(ViewItem.s_cameraProperty); return camera; @@ -558,12 +558,12 @@ namespace Microsoft.Iris.UI if (value == this.Camera) return; bool flag = value == null; - object obj = flag ? (object)(Camera)null : (object)value; + object obj = flag ? null : (object)value; this.SetData(ViewItem.s_cameraProperty, obj); this.SetBit(ViewItem.Bits2.HasCamera, !flag); - value?.RegisterUsage((object)this); + value?.RegisterUsage(this); if (this._container != null) - this._container.Camera = value == null ? (ICamera)null : value.APICamera; + this._container.Camera = value == null ? null : value.APICamera; this.FireNotification(NotificationID.Camera); } } @@ -582,7 +582,7 @@ namespace Microsoft.Iris.UI if (!(value != this.Rotation)) return; bool flag = value == Rotation.Default; - object obj = flag ? (object)null : (object)value; + object obj = flag ? null : (object)value; this.SetData(ViewItem.s_rotationProperty, obj); this.SetBit(ViewItem.Bits2.HasRotation, !flag); this.FireNotification(NotificationID.Rotation); @@ -604,7 +604,7 @@ namespace Microsoft.Iris.UI if (!(value != this.CenterPointPercent)) return; bool flag = value == new Vector3(); - object obj = flag ? (object)null : (object)value; + object obj = flag ? null : (object)value; this.SetData(ViewItem.s_centerPointPercentProperty, obj); this.SetBit(ViewItem.Bits2.HasCenterPointPercent, !flag); if (this.HasVisual) @@ -627,7 +627,7 @@ namespace Microsoft.Iris.UI if ((int)value == (int)this.Layer) return; bool flag = value == 0U; - object obj = flag ? (object)null : (object)value; + object obj = flag ? null : (object)value; this.SetData(ViewItem.s_layerProperty, obj); this.SetBit(ViewItem.Bits2.HasLayer, !flag); if (!this.HasVisual) @@ -638,14 +638,14 @@ namespace Microsoft.Iris.UI public EffectClass Effect { - get => this.GetBit(ViewItem.Bits2.HasEffect) ? (EffectClass)this.GetData(ViewItem.s_effectProperty) : (EffectClass)null; + get => this.GetBit(ViewItem.Bits2.HasEffect) ? (EffectClass)this.GetData(ViewItem.s_effectProperty) : null; set { EffectClass effect = this.Effect; if (effect == value) return; - effect?.DoneWithRenderEffects((object)this); - this.SetData(ViewItem.s_effectProperty, (object)value); + effect?.DoneWithRenderEffects(this); + this.SetData(ViewItem.s_effectProperty, value); this.SetBit(ViewItem.Bits2.HasEffect, value != null); this.OnEffectChanged(); this.MarkPaintInvalid(); @@ -754,7 +754,7 @@ namespace Microsoft.Iris.UI { if (!(this.Alignment != value)) return; - this.SetLayoutData(ViewItem.s_alignmentProperty, ViewItem.Bits.LayoutAlignment, (object)value, (object)ItemAlignment.Default); + this.SetLayoutData(ViewItem.s_alignmentProperty, ViewItem.Bits.LayoutAlignment, value, ItemAlignment.Default); this.FireNotification(NotificationID.Alignment); } } @@ -766,7 +766,7 @@ namespace Microsoft.Iris.UI { if (!(this.ChildAlignment != value)) return; - this.SetLayoutData(ViewItem.s_childAlignmentProperty, ViewItem.Bits.LayoutChildAlignment, (object)value, (object)ItemAlignment.Default); + this.SetLayoutData(ViewItem.s_childAlignmentProperty, ViewItem.Bits.LayoutChildAlignment, value, ItemAlignment.Default); this.FireNotification(NotificationID.ChildAlignment); } } @@ -785,14 +785,14 @@ namespace Microsoft.Iris.UI public SharedSize SharedSize { - get => this.GetBit(ViewItem.Bits.LayoutInputSharedSize) ? (SharedSize)this.GetData(ViewItem.s_sharedSizeProperty) : (SharedSize)null; + get => this.GetBit(ViewItem.Bits.LayoutInputSharedSize) ? (SharedSize)this.GetData(ViewItem.s_sharedSizeProperty) : null; set { SharedSize sharedSize = this.SharedSize; if (sharedSize == value) return; sharedSize?.Unregister(this); - this.SetLayoutData(ViewItem.s_sharedSizeProperty, ViewItem.Bits.LayoutInputSharedSize, (object)value, (object)null); + this.SetLayoutData(ViewItem.s_sharedSizeProperty, ViewItem.Bits.LayoutInputSharedSize, value, null); value?.Register(this); this.FireNotification(NotificationID.SharedSize); } @@ -805,7 +805,7 @@ namespace Microsoft.Iris.UI { if (this.SharedSizePolicy == value) return; - this.SetLayoutData(ViewItem.s_sharedSizePolicyProperty, ViewItem.Bits.LayoutInputSharedSizePolicy, (object)value, (object)SharedSizePolicy.Default); + this.SetLayoutData(ViewItem.s_sharedSizePolicyProperty, ViewItem.Bits.LayoutInputSharedSizePolicy, value, SharedSizePolicy.Default); this.FireNotification(NotificationID.SharedSizePolicy); } } @@ -817,7 +817,7 @@ namespace Microsoft.Iris.UI { if (!(this.Margins != value)) return; - this.SetLayoutData(ViewItem.s_marginsProperty, ViewItem.Bits.LayoutInputMargins, (object)value, (object)Inset.Zero); + this.SetLayoutData(ViewItem.s_marginsProperty, ViewItem.Bits.LayoutInputMargins, value, Inset.Zero); this.FireNotification(NotificationID.Margins); } } @@ -829,7 +829,7 @@ namespace Microsoft.Iris.UI { if (!(this.Padding != value)) return; - this.SetLayoutData(ViewItem.s_paddingProperty, ViewItem.Bits.LayoutInputPadding, (object)value, (object)Inset.Zero); + this.SetLayoutData(ViewItem.s_paddingProperty, ViewItem.Bits.LayoutInputPadding, value, Inset.Zero); this.FireNotification(NotificationID.Padding); } } @@ -855,7 +855,7 @@ namespace Microsoft.Iris.UI this.SetBit(changeBit, true); break; case 2: - this.SetData(changeProperty, (object)null); + this.SetData(changeProperty, null); this.SetBit(changeBit, false); break; case 3: @@ -893,7 +893,7 @@ namespace Microsoft.Iris.UI { if (this.GetData(inputID) == newValue) return; - this.SetData(inputID, (object)newValue); + this.SetData(inputID, newValue); if (!invalidateLayout) return; this.MarkLayoutInvalid(); @@ -904,7 +904,7 @@ namespace Microsoft.Iris.UI get { if (this.ChangeBit(ViewItem.Bits2.HasLayoutOutput, true)) - this.SetData(ViewItem.s_layoutOutputProperty, (object)new LayoutOutput(this.LayoutSize)); + this.SetData(ViewItem.s_layoutOutputProperty, new LayoutOutput(this.LayoutSize)); return (LayoutOutput)this.GetData(ViewItem.s_layoutOutputProperty); } } @@ -983,7 +983,7 @@ namespace Microsoft.Iris.UI if (this.UISession.InputManager.Queue.PendingKeyFocus is UIClass pendingKeyFocus) { ViewItem rootItem = pendingKeyFocus.RootItem; - if (this.HasDescendant((Microsoft.Iris.Library.TreeNode)rootItem)) + if (this.HasDescendant(rootItem)) { Vector3 positionPxlVector; Vector3 sizePxlVector; @@ -1051,13 +1051,13 @@ namespace Microsoft.Iris.UI { add { - if (!this.AddEventHandler(ViewItem.s_deepLayoutChangeEvent, (Delegate)value)) + if (!this.AddEventHandler(ViewItem.s_deepLayoutChangeEvent, value)) return; this.EnableDeepLayoutNotifications(true); } remove { - if (!this.RemoveEventHandler(ViewItem.s_deepLayoutChangeEvent, (Delegate)value)) + if (!this.RemoveEventHandler(ViewItem.s_deepLayoutChangeEvent, value)) return; this.EnableDeepLayoutNotifications(false); } @@ -1120,7 +1120,7 @@ namespace Microsoft.Iris.UI get { this.BuildLayoutChildren(); - ILayoutNode start = (ILayoutNode)null; + ILayoutNode start = null; if (this._visibleChildCount > 0) { start = (ILayoutNode)this.FirstChild; @@ -1170,8 +1170,8 @@ namespace Microsoft.Iris.UI { DataCookie outputId = newDataOutput.OutputID; ExtendedLayoutOutput extendedLayoutOutput1 = this._extendedOutputs; - ExtendedLayoutOutput extendedLayoutOutput2 = (ExtendedLayoutOutput)null; - ExtendedLayoutOutput extendedLayoutOutput3 = (ExtendedLayoutOutput)null; + ExtendedLayoutOutput extendedLayoutOutput2 = null; + ExtendedLayoutOutput extendedLayoutOutput3 = null; for (; extendedLayoutOutput1 != null; extendedLayoutOutput1 = extendedLayoutOutput3) { extendedLayoutOutput3 = extendedLayoutOutput1.nextOutput; @@ -1187,7 +1187,7 @@ namespace Microsoft.Iris.UI newDataOutput.nextOutput = extendedLayoutOutput3; if (extendedLayoutOutput1 == null) return; - extendedLayoutOutput1.nextOutput = (ExtendedLayoutOutput)null; + extendedLayoutOutput1.nextOutput = null; } void ILayoutNode.AddAreaOfInterest(AreaOfInterest interest) => AreaOfInterest.AddAreaOfInterest(interest, ref this._externallySetAreasOfInterest); @@ -1202,7 +1202,7 @@ namespace Microsoft.Iris.UI if (!(this.GetExtendedLayoutOutput(VisibleIndexRangeLayoutOutput.DataCookie) is VisibleIndexRangeLayoutOutput rangeLayoutOutput)) { rangeLayoutOutput = new VisibleIndexRangeLayoutOutput(); - ((ILayoutNode)this).SetExtendedLayoutOutput((ExtendedLayoutOutput)rangeLayoutOutput); + ((ILayoutNode)this).SetExtendedLayoutOutput(rangeLayoutOutput); } rangeLayoutOutput.Initialize(beginVisible, endVisible, beginVisibleOffscreen, endVisibleOffscreen, focusedItem); } @@ -1244,7 +1244,7 @@ namespace Microsoft.Iris.UI this.MarkHidden(); return Size.Zero; } - Size sz2 = this.Layout.Measure((ILayoutNode)this, constraint); + Size sz2 = this.Layout.Measure(this, constraint); Size size3 = Size.Max(Size.Min(constraint, sz2), minimumSize); Size size4 = size3; if (!size3.IsZero) @@ -1269,12 +1269,12 @@ namespace Microsoft.Iris.UI this._alignedSize = Size.Zero; this._measureAlignment = Point.Zero; this._visible = Visibility.Visible; - this._externallySetAreasOfInterest = (Vector)null; - this._ownedAreasOfInterest = (AreaOfInterestID)0; - this._containedAreasOfInterest = (AreaOfInterestID)0; - this._extendedOutputs = (ExtendedLayoutOutput)null; + this._externallySetAreasOfInterest = null; + this._ownedAreasOfInterest = 0; + this._containedAreasOfInterest = 0; + this._extendedOutputs = null; this._requestedCount = 0; - this._requestedIndices = (Vector)null; + this._requestedIndices = null; this.ResetArrangeInfo(); } @@ -1342,7 +1342,7 @@ namespace Microsoft.Iris.UI else { this._location = new Rectangle(x, y, width, height); - bool flag = KeepAliveLayoutInput.ShouldKeepVisible((ILayoutNode)this); + bool flag = KeepAliveLayoutInput.ShouldKeepVisible(this); if (!flag && this.Parent != null) { ViewItem parent = this.Parent; @@ -1362,7 +1362,7 @@ namespace Microsoft.Iris.UI Point pos = new Point(-(num3 + offset.X), -(num4 + offset.Y)); Rectangle viewBounds = Rectangle.Offset(parentSlot.View, pos); Rectangle viewPeripheralBounds = Rectangle.Offset(parentSlot.PeripheralView, pos); - this.Layout.Arrange((ILayoutNode)this, new LayoutSlot(extent, offset, viewBounds, viewPeripheralBounds)); + this.Layout.Arrange(this, new LayoutSlot(extent, offset, viewBounds, viewPeripheralBounds)); } this.ProcessAreasOfInterest(processChildren); Rectangle location = this._location; @@ -1383,9 +1383,9 @@ namespace Microsoft.Iris.UI private void ResetArrangeInfo() { this.Arranged = false; - this._externallySetAreasOfInterest = (Vector)null; - this._ownedAreasOfInterest = (AreaOfInterestID)0; - this._containedAreasOfInterest = (AreaOfInterestID)0; + this._externallySetAreasOfInterest = null; + this._ownedAreasOfInterest = 0; + this._containedAreasOfInterest = 0; this.Committed = false; } @@ -1428,7 +1428,7 @@ namespace Microsoft.Iris.UI private void ProcessAreasOfInterest(bool processChildren) { - this._ownedAreasOfInterest = (AreaOfInterestID)0; + this._ownedAreasOfInterest = 0; AreaOfInterestLayoutInput layoutInput = (AreaOfInterestLayoutInput)this.GetLayoutInput(AreaOfInterestLayoutInput.Data); if (layoutInput != null) this._ownedAreasOfInterest = layoutInput.Id; @@ -1439,18 +1439,18 @@ namespace Microsoft.Iris.UI foreach (AreaOfInterest areaOfInterest in this._externallySetAreasOfInterest) this._ownedAreasOfInterest |= areaOfInterest.Id; } - this._containedAreasOfInterest = (AreaOfInterestID)0; + this._containedAreasOfInterest = 0; if (!processChildren) return; foreach (ViewItem layoutChild in this.LayoutChildren) this._containedAreasOfInterest |= layoutChild._ownedAreasOfInterest | layoutChild._containedAreasOfInterest; } - bool ILayoutNode.ContainsAreaOfInterest(AreaOfInterestID id) => (this._ownedAreasOfInterest & id) != (AreaOfInterestID)0 || (this._containedAreasOfInterest & id) != (AreaOfInterestID)0; + bool ILayoutNode.ContainsAreaOfInterest(AreaOfInterestID id) => (this._ownedAreasOfInterest & id) != 0 || (this._containedAreasOfInterest & id) != 0; bool ILayoutNode.TryGetAreaOfInterest(AreaOfInterestID id, out AreaOfInterest area) { - if ((this._ownedAreasOfInterest & id) != (AreaOfInterestID)0) + if ((this._ownedAreasOfInterest & id) != 0) { AreaOfInterestLayoutInput layoutInput = (AreaOfInterestLayoutInput)this.GetLayoutInput(AreaOfInterestLayoutInput.Data); if (layoutInput != null && layoutInput.Id == id) @@ -1475,7 +1475,7 @@ namespace Microsoft.Iris.UI } } } - else if ((this._containedAreasOfInterest & id) != (AreaOfInterestID)0) + else if ((this._containedAreasOfInterest & id) != 0) { foreach (ILayoutNode layoutChild in this.LayoutChildren) { @@ -1608,7 +1608,7 @@ namespace Microsoft.Iris.UI { if (this.GetEventHandler(ViewItem.s_deepLayoutChangeEvent) is EventHandler eventHandler) { - eventHandler((object)this, EventArgs.Empty); + eventHandler(this, EventArgs.Empty); selfApplyParams.anyDeepChangesDelivered = true; } else @@ -1624,13 +1624,13 @@ namespace Microsoft.Iris.UI public void OnScaleChange(Vector3 oldScaleVector, Vector3 newScaleVector) => this.NotifyEffectiveScaleChange(false); - public void SetAreaOfInterest(AreaOfInterestID id, Inset margins) => this.SetLayoutInput((ILayoutInput)new AreaOfInterestLayoutInput(id, margins)); + public void SetAreaOfInterest(AreaOfInterestID id, Inset margins) => this.SetLayoutInput(new AreaOfInterestLayoutInput(id, margins)); public void ClearAreaOfInterest(AreaOfInterestID id) { if (!(this.GetLayoutInput(AreaOfInterestLayoutInput.Data) is AreaOfInterestLayoutInput layoutInput) || layoutInput.Id != id) return; - this.SetLayoutInput(AreaOfInterestLayoutInput.Data, (ILayoutInput)null); + this.SetLayoutInput(AreaOfInterestLayoutInput.Data, null); } bool ITrackableUIElement.IsUIVisible => this.IsVisibleToRenderer; @@ -1679,7 +1679,7 @@ namespace Microsoft.Iris.UI flag = this.PlayAnimation(animation, ref args, UIClass.ShouldPlayAnimation(animation), this.GetAnimationHandle(type)); bool applyNow = !flag; if (applyNow) - this.StopOverlappingAnimations((ActiveSequence)null, ActiveSequence.ConvertToActiveTransition(type)); + this.StopOverlappingAnimations(null, ActiveSequence.ConvertToActiveTransition(type)); this.SetVisualValue(type, ref args, applyNow); } @@ -1749,7 +1749,7 @@ namespace Microsoft.Iris.UI return false; if (shouldPlayAnimation) { - this.PlayAnimation(anim, ref args, (EventHandler)null, animationHandle); + this.PlayAnimation(anim, ref args, null, animationHandle); } else { @@ -1765,10 +1765,10 @@ namespace Microsoft.Iris.UI EventHandler onCompleteHandler, AnimationHandle animationHandle) { - ActiveSequence instance = anim.CreateInstance((IAnimatable)this.RendererVisual, ref args); + ActiveSequence instance = anim.CreateInstance(RendererVisual, ref args); if (instance == null) return; - instance.DeclareOwner((object)this); + instance.DeclareOwner(this); if (onCompleteHandler != null) instance.AnimationCompleted += onCompleteHandler; animationHandle?.AssociateWithAnimationInstance(instance); @@ -1781,7 +1781,7 @@ namespace Microsoft.Iris.UI public void PlayShowAnimation() { - IAnimationProvider ab = (IAnimationProvider)null; + IAnimationProvider ab = null; if (this.GetBit(ViewItem.Bits2.InsideContentChange)) { ab = this.GetAnimation(AnimationEventType.ContentChangeShow); @@ -1797,7 +1797,7 @@ namespace Microsoft.Iris.UI public void PlayHideAnimation(OrphanedVisualCollection orphans) { - IAnimationProvider animationProvider = (IAnimationProvider)null; + IAnimationProvider animationProvider = null; if (this.GetBit(ViewItem.Bits2.InsideContentChange)) animationProvider = this.GetAnimation(AnimationEventType.ContentChangeHide); if (animationProvider == null) @@ -1810,7 +1810,7 @@ namespace Microsoft.Iris.UI return; if (animationTemplate.Loop == -1) animationTemplate.Loop = 0; - ActiveSequence instance = animationTemplate.CreateInstance((IAnimatable)this.RendererVisual, ref args); + ActiveSequence instance = animationTemplate.CreateInstance(RendererVisual, ref args); if (instance == null) return; orphans.RegisterWaitForAnimation(instance, false); @@ -1822,11 +1822,11 @@ namespace Microsoft.Iris.UI { Vector activeAnimations = this.GetActiveAnimations(false); this.TransferAnimationsList(orphans, activeAnimations, new EventHandler(this.OnAnimationComplete)); - this.SetData(ViewItem.s_activeAnimationsProperty, (object)null); + this.SetData(ViewItem.s_activeAnimationsProperty, null); this.SetBit(ViewItem.Bits.ActiveAnimations, false); Vector idleAnimations = this.GetIdleAnimations(false); this.TransferAnimationsList(orphans, idleAnimations, new EventHandler(this.OnIdleAnimationComplete)); - this.SetData(ViewItem.s_idleAnimationsProperty, (object)null); + this.SetData(ViewItem.s_idleAnimationsProperty, null); this.SetBit(ViewItem.Bits.IdleAnimations, false); this.OnAnimationListChanged(); } @@ -1848,19 +1848,19 @@ namespace Microsoft.Iris.UI } } - public Dictionary GetAnimationSet() => !this.GetBit(ViewItem.Bits.AnimationBuilders) ? (Dictionary)null : (Dictionary)this.GetData(ViewItem.s_animationBuildersProperty); + public Dictionary GetAnimationSet() => !this.GetBit(ViewItem.Bits.AnimationBuilders) ? null : (Dictionary)this.GetData(ViewItem.s_animationBuildersProperty); public IAnimationProvider GetAnimation(AnimationEventType type) { Dictionary animationSet = this.GetAnimationSet(); if (animationSet == null) - return (IAnimationProvider)null; + return null; IAnimationProvider animationProvider; animationSet.TryGetValue(type, out animationProvider); return animationProvider; } - public RelativeTo SnapshotPosition() => (RelativeTo)new SnapshotRelativeTo(this.BoundsRelativeToAncestor((ViewItem)null)); + public RelativeTo SnapshotPosition() => new SnapshotRelativeTo(this.BoundsRelativeToAncestor(null)); public void AttachAnimation(IAnimationProvider animation) => this.SetAnimationData(animation.Type, animation); @@ -1872,17 +1872,17 @@ namespace Microsoft.Iris.UI public void DetachAnimation(AnimationEventType type) { - this.SetAnimationData(type, (IAnimationProvider)null); - this.SetAnimationHandle(type, (AnimationHandle)null); + this.SetAnimationData(type, null); + this.SetAnimationHandle(type, null); } - private Dictionary GetAnimationHandleSet() => !this.GetBit(ViewItem.Bits2.AnimationHandles) ? (Dictionary)null : (Dictionary)this.GetData(ViewItem.s_animationHandlesProperty); + private Dictionary GetAnimationHandleSet() => !this.GetBit(ViewItem.Bits2.AnimationHandles) ? null : (Dictionary)this.GetData(ViewItem.s_animationHandlesProperty); public AnimationHandle GetAnimationHandle(AnimationEventType type) { Dictionary animationHandleSet = this.GetAnimationHandleSet(); if (animationHandleSet == null) - return (AnimationHandle)null; + return null; AnimationHandle animationHandle; animationHandleSet.TryGetValue(type, out animationHandle); return animationHandle; @@ -1895,7 +1895,7 @@ namespace Microsoft.Iris.UI if (dictionary == null && flag) { dictionary = new Dictionary(); - this.SetData(ViewItem.s_animationHandlesProperty, (object)dictionary); + this.SetData(ViewItem.s_animationHandlesProperty, dictionary); this.SetBit(ViewItem.Bits2.AnimationHandles, true); } if (dictionary == null) @@ -1909,7 +1909,7 @@ namespace Microsoft.Iris.UI dictionary.Remove(type); if (dictionary.Count != 0) return; - this.SetData(ViewItem.s_animationHandlesProperty, (object)null); + this.SetData(ViewItem.s_animationHandlesProperty, null); this.SetBit(ViewItem.Bits2.AnimationHandles, false); } } @@ -1940,7 +1940,7 @@ namespace Microsoft.Iris.UI Vector activeAnimations = this.GetActiveAnimations(false); if (activeAnimations == null) return; - StopCommandSet stopCommand = (StopCommandSet)null; + StopCommandSet stopCommand = null; foreach (ActiveSequence playingSequence in activeAnimations) this.StopAnimationIfOverlapping(playingSequence, newSequence, newTransitions, ref stopCommand); } @@ -1951,7 +1951,7 @@ namespace Microsoft.Iris.UI ActiveTransitions newTransitions, ref StopCommandSet stopCommand) { - IAnimatable animatable = (IAnimatable)this.VisualContainer; + IAnimatable animatable = VisualContainer; if (newSequence != null) animatable = newSequence.Target; if (playingSequence.Target == animatable) @@ -1980,13 +1980,13 @@ namespace Microsoft.Iris.UI this.OnAnimationListChanged(); if (activeAnimations.Count == 0) { - this.SetData(ViewItem.s_activeAnimationsProperty, (object)null); + this.SetData(ViewItem.s_activeAnimationsProperty, null); this.SetBit(ViewItem.Bits.ActiveAnimations, false); this.TryToPlayIdleAnimation(); } if (activeSequence.Template is Animation template && template.DisableMouseInput) this.UI.UpdateMouseHandling(this); - activeSequence.Dispose((object)this); + activeSequence.Dispose(this); } private void OnIdleAnimationComplete(object sender, EventArgs args) @@ -1998,10 +1998,10 @@ namespace Microsoft.Iris.UI this.OnAnimationListChanged(); if (idleAnimations.Count == 0) { - this.SetData(ViewItem.s_idleAnimationsProperty, (object)null); + this.SetData(ViewItem.s_idleAnimationsProperty, null); this.SetBit(ViewItem.Bits.IdleAnimations, false); } - activeSequence.Dispose((object)this); + activeSequence.Dispose(this); } private bool TryToPlayIdleAnimation() @@ -2009,7 +2009,7 @@ namespace Microsoft.Iris.UI if (!this.HasVisual) return false; Vector idleAnimations = this.GetIdleAnimations(false); - ActiveSequence playingSequence = (ActiveSequence)null; + ActiveSequence playingSequence = null; if (idleAnimations != null) playingSequence = idleAnimations[idleAnimations.Count - 1]; IAnimationProvider animation = this.GetAnimation(AnimationEventType.Idle); @@ -2024,16 +2024,16 @@ namespace Microsoft.Iris.UI this.ApplyFinalAnimationState(anim, ref args); return false; } - ActiveSequence instance = anim.CreateInstance((IAnimatable)this.RendererVisual, ref args); + ActiveSequence instance = anim.CreateInstance(RendererVisual, ref args); if (instance == null) return false; - instance.DeclareOwner((object)this); + instance.DeclareOwner(this); if (playingSequence != null && playingSequence.Playing) { ActiveTransitions activeTransitions = instance.GetActiveTransitions(); - StopCommandSet stopCommand = (StopCommandSet)null; + StopCommandSet stopCommand = null; if (this.StopAnimationIfOverlapping(playingSequence, instance, activeTransitions, ref stopCommand)) - playingSequence = (ActiveSequence)null; + playingSequence = null; } instance.Play(); if (playingSequence != null && playingSequence.Template.Loop == -1) @@ -2069,11 +2069,11 @@ namespace Microsoft.Iris.UI foreach (BaseKeyframe keyframe in anim.Keyframes) { BaseKeyframe baseKeyframe = baseKeyframeArray[(uint)keyframe.Type]; - if (baseKeyframe == null || (double)baseKeyframe.Time <= (double)keyframe.Time) + if (baseKeyframe == null || baseKeyframe.Time <= (double)keyframe.Time) baseKeyframeArray[(uint)keyframe.Type] = keyframe; } foreach (BaseKeyframe baseKeyframe in baseKeyframeArray) - baseKeyframe?.Apply((IAnimatableOwner)this, ref args); + baseKeyframe?.Apply(this, ref args); } private void SetAnimationData(AnimationEventType type, IAnimationProvider anim) @@ -2083,7 +2083,7 @@ namespace Microsoft.Iris.UI if (dictionary == null && flag) { dictionary = new Dictionary(); - this.SetData(ViewItem.s_animationBuildersProperty, (object)dictionary); + this.SetData(ViewItem.s_animationBuildersProperty, dictionary); this.SetBit(ViewItem.Bits.AnimationBuilders, true); } if (dictionary != null) @@ -2097,7 +2097,7 @@ namespace Microsoft.Iris.UI dictionary.Remove(type); if (dictionary.Count == 0) { - this.SetData(ViewItem.s_animationBuildersProperty, (object)null); + this.SetData(ViewItem.s_animationBuildersProperty, null); this.SetBit(ViewItem.Bits.AnimationBuilders, false); } } @@ -2123,13 +2123,13 @@ namespace Microsoft.Iris.UI DataCookie dynamicProperty, bool createIfNone) { - Vector vector = (Vector)null; + Vector vector = null; if (!this.GetBit(propertyHint)) { if (createIfNone) { vector = new Vector(); - this.SetData(dynamicProperty, (object)vector); + this.SetData(dynamicProperty, vector); this.SetBit(propertyHint, true); } } @@ -2140,7 +2140,7 @@ namespace Microsoft.Iris.UI private void OnAnimationListChanged() { - if (!this.ChangeBit(ViewItem.Bits2.IsAlphaAnimationPlaying, ViewItem.DoesAnimationListContainAnimationType(this.GetActiveAnimations(false), ActiveTransitions.Alpha) || ViewItem.DoesAnimationListContainAnimationType(this.GetIdleAnimations(false), ActiveTransitions.Alpha)) || (double)this.Alpha != 0.0) + if (!this.ChangeBit(ViewItem.Bits2.IsAlphaAnimationPlaying, ViewItem.DoesAnimationListContainAnimationType(this.GetActiveAnimations(false), ActiveTransitions.Alpha) || ViewItem.DoesAnimationListContainAnimationType(this.GetIdleAnimations(false), ActiveTransitions.Alpha)) || Alpha != 0.0) return; this.OnVisibilityChange(); } @@ -2204,13 +2204,13 @@ namespace Microsoft.Iris.UI { if (this._container != null) return; - this.VisualContainer = renderSession.CreateVisualContainer((object)this, (object)this); + this.VisualContainer = renderSession.CreateVisualContainer(this, this); } internal void CreateVisual(IRenderSession renderSession) { this.CreateVisualContainer(renderSession); - this.AddVisualToParent(renderSession, (IVisual)this._container); + this.AddVisualToParent(renderSession, _container); this.VisualScale = this.Scale; this.VisualAlpha = this.Alpha; this.VisualRotation = this.Rotation; @@ -2232,7 +2232,7 @@ namespace Microsoft.Iris.UI while (viewItem != null && !viewItem.HasVisual); ViewItem parent = this.Parent; VisualOrder nOrder = parent.GetVisualOrder(); - IVisual vSibling = (IVisual)null; + IVisual vSibling = null; if (viewItem != null) { vSibling = viewItem.RendererVisual; @@ -2240,7 +2240,7 @@ namespace Microsoft.Iris.UI } if (vSibling == null) { - vSibling = (IVisual)parent.ContentVisual; + vSibling = parent.ContentVisual; nOrder = vSibling == null ? nOrder : VisualOrder.Before; } parent.VisualContainer.AddChild(visual, vSibling, nOrder); @@ -2295,7 +2295,7 @@ namespace Microsoft.Iris.UI out Vector3 positionPxlVector, out Vector3 sizePxlVector) { - return this.ComputeBounds((IZoneDisplayChild)null, out positionPxlVector, out sizePxlVector); + return this.ComputeBounds(null, out positionPxlVector, out sizePxlVector); } private bool ComputeBounds( @@ -2309,7 +2309,7 @@ namespace Microsoft.Iris.UI return false; Vector3 parentOffsetPxlVector; Vector3 scaleVector; - ViewItem.GetAccumulatedOffsetAndScale((IZoneDisplayChild)this, ancestor, out parentOffsetPxlVector, out scaleVector); + ViewItem.GetAccumulatedOffsetAndScale(this, ancestor, out parentOffsetPxlVector, out scaleVector); positionPxlVector = parentOffsetPxlVector; Vector2 visualSize = this.VisualSize; sizePxlVector = new Vector3(visualSize.X, visualSize.Y, 0.0f) * scaleVector; @@ -2339,7 +2339,7 @@ namespace Microsoft.Iris.UI if (arrayList[index] is ViewItem viewItem && !viewItem.HasVisual) { Point layoutPosition = viewItem.LayoutPosition; - vector3_1 = new Vector3((float)layoutPosition.X, (float)layoutPosition.Y, 0.0f); + vector3_1 = new Vector3(layoutPosition.X, layoutPosition.Y, 0.0f); } else if (zoneDisplayChild != null) { @@ -2358,7 +2358,7 @@ namespace Microsoft.Iris.UI { Vector3 parentOffsetPxlVector; Vector3 scaleVector; - ViewItem.GetAccumulatedOffsetAndScale((IZoneDisplayChild)this, (IZoneDisplayChild)ancestor, out parentOffsetPxlVector, out scaleVector); + ViewItem.GetAccumulatedOffsetAndScale(this, ancestor, out parentOffsetPxlVector, out scaleVector); rect.X -= parentOffsetPxlVector.X; rect.Y -= parentOffsetPxlVector.Y; rect.X /= scaleVector.X; @@ -2372,7 +2372,7 @@ namespace Microsoft.Iris.UI { Vector3 parentOffsetPxlVector; Vector3 scaleVector; - ViewItem.GetAccumulatedOffsetAndScale((IZoneDisplayChild)this, (IZoneDisplayChild)ancestor, out parentOffsetPxlVector, out scaleVector); + ViewItem.GetAccumulatedOffsetAndScale(this, ancestor, out parentOffsetPxlVector, out scaleVector); rect.X *= scaleVector.X; rect.Y *= scaleVector.Y; rect.Width *= scaleVector.X; @@ -2386,7 +2386,7 @@ namespace Microsoft.Iris.UI { Vector3 parentOffsetPxlVector; Vector3 scaleVector; - ViewItem.GetAccumulatedOffsetAndScale((IZoneDisplayChild)this, (IZoneDisplayChild)ancestor, out parentOffsetPxlVector, out scaleVector); + ViewItem.GetAccumulatedOffsetAndScale(this, ancestor, out parentOffsetPxlVector, out scaleVector); Vector2 vector2 = this.HasVisual ? this.VisualSize : Vector2.Zero; return new RectangleF(parentOffsetPxlVector.X, parentOffsetPxlVector.Y, vector2.X * scaleVector.X, vector2.Y * scaleVector.Y); } @@ -2394,12 +2394,12 @@ namespace Microsoft.Iris.UI public Point ScreenToClient(Point screenPoint) { this.Zone.Form.ScreenToClient(ref screenPoint); - return this.TransformFromAncestor((ViewItem)null, new RectangleF(screenPoint, Size.Zero)).Location.ToPoint(); + return this.TransformFromAncestor(null, new RectangleF(screenPoint, Size.Zero)).Location.ToPoint(); } - public Point WindowToClient(Point windowPoint) => this.TransformFromAncestor((ViewItem)null, new RectangleF(windowPoint, Size.Zero)).Location.ToPoint(); + public Point WindowToClient(Point windowPoint) => this.TransformFromAncestor(null, new RectangleF(windowPoint, Size.Zero)).Location.ToPoint(); - public Point ClientToWindow(Point clientPoint) => this.TransformToAncestor((ViewItem)null, new RectangleF(clientPoint, Size.Zero)).Location.ToPoint(); + public Point ClientToWindow(Point clientPoint) => this.TransformToAncestor(null, new RectangleF(clientPoint, Size.Zero)).Location.ToPoint(); public Point ClientToScreen(Point clientPoint) { @@ -2418,7 +2418,7 @@ namespace Microsoft.Iris.UI ViewItem parent; for (ViewItem viewItem = this; viewItem != itemStop; viewItem = parent) { - pathList.Add((object)viewItem); + pathList.Add(viewItem); parent = viewItem.Parent; if (parent == null) { @@ -2433,7 +2433,7 @@ namespace Microsoft.Iris.UI protected virtual void OnLayoutComplete(ViewItem sender) { if (this.GetEventHandler(ViewItem.s_layoutCompleteEvent) is LayoutCompleteEventHandler eventHandler) - eventHandler((object)sender); + eventHandler(sender); if (!this.GetBit(ViewItem.Bits2.HasLayoutOutput)) return; this.LayoutOutput.OnLayoutComplete(this.LayoutSize); @@ -2450,11 +2450,11 @@ namespace Microsoft.Iris.UI public event LayoutCompleteEventHandler LayoutComplete { - add => this.AddEventHandler(ViewItem.s_layoutCompleteEvent, (Delegate)value); - remove => this.RemoveEventHandler(ViewItem.s_layoutCompleteEvent, (Delegate)value); + add => this.AddEventHandler(ViewItem.s_layoutCompleteEvent, value); + remove => this.RemoveEventHandler(ViewItem.s_layoutCompleteEvent, value); } - internal void ClearStickyFocus() => NavigationServices.ClearDefaultFocus((INavigationSite)this); + internal void ClearStickyFocus() => NavigationServices.ClearDefaultFocus(this); public void ScrollIntoView() { @@ -2462,7 +2462,7 @@ namespace Microsoft.Iris.UI return; this.SetBit(ViewItem.Bits2.PendingScrollIntoView, true); this.LockVisible(true); - DeferredCall.Post(DispatchPriority.LayoutSync, ViewItem.s_scrollIntoViewCleanup, (object)this); + DeferredCall.Post(DispatchPriority.LayoutSync, ViewItem.s_scrollIntoViewCleanup, this); } private static void CleanUpAfterScrollIntoView(object obj) => ((ViewItem)obj).CleanUpAfterScrollIntoView(); @@ -2494,7 +2494,7 @@ namespace Microsoft.Iris.UI if (aliveLayoutInput == null) { aliveLayoutInput = new KeepAliveLayoutInput(); - this.SetLayoutInput((ILayoutInput)aliveLayoutInput, invalidateLayout); + this.SetLayoutInput(aliveLayoutInput, invalidateLayout); } ++aliveLayoutInput.Count; } @@ -2505,7 +2505,7 @@ namespace Microsoft.Iris.UI --layoutInput.Count; if (layoutInput.Count != 0) return; - this.SetLayoutInput(KeepAliveLayoutInput.Data, (ILayoutInput)null, false); + this.SetLayoutInput(KeepAliveLayoutInput.Data, null, false); } public void NavigateInto() => this.NavigateInto(false); @@ -2535,7 +2535,7 @@ namespace Microsoft.Iris.UI this.SetBit(ViewItem.Bits.PendingNavigateInto, false); this.SetBit(ViewItem.Bits.PendingNavigateIntoScheduled, false); INavigationSite resultSite; - if (!NavigationServices.FindNextWithin((INavigationSite)this, Direction.Next, RectangleF.Zero, out resultSite) || resultSite == null || !(resultSite is ViewItem viewItem)) + if (!NavigationServices.FindNextWithin(this, Direction.Next, RectangleF.Zero, out resultSite) || resultSite == null || !(resultSite is ViewItem viewItem)) return; viewItem.UI.NotifyNavigationDestination(this.GetBit(ViewItem.Bits.PendingNavigateIntoIsDefault) ? KeyFocusReason.Default : KeyFocusReason.Other); } @@ -2557,7 +2557,7 @@ namespace Microsoft.Iris.UI { if (value != NavigationPolicies.None) { - this.SetData(ViewItem.s_navModeProperty, (object)value); + this.SetData(ViewItem.s_navModeProperty, value); this.SetBit(ViewItem.Bits.HasNavMode, true); this.FireNotification(NotificationID.Navigation); } @@ -2565,7 +2565,7 @@ namespace Microsoft.Iris.UI { if (!this.GetBit(ViewItem.Bits.HasNavMode)) return; - this.SetData(ViewItem.s_navModeProperty, (object)null); + this.SetData(ViewItem.s_navModeProperty, null); this.SetBit(ViewItem.Bits.HasNavMode, false); this.FireNotification(NotificationID.Navigation); } @@ -2591,7 +2591,7 @@ namespace Microsoft.Iris.UI { if (value != int.MaxValue) { - this.SetData(ViewItem.s_focusOrderProperty, (object)value); + this.SetData(ViewItem.s_focusOrderProperty, value); this.SetBit(ViewItem.Bits.HasFocusOrder, true); this.FireNotification(NotificationID.FocusOrder); } @@ -2599,14 +2599,14 @@ namespace Microsoft.Iris.UI { if (!this.GetBit(ViewItem.Bits.HasFocusOrder)) return; - this.SetData(ViewItem.s_focusOrderProperty, (object)null); + this.SetData(ViewItem.s_focusOrderProperty, null); this.SetBit(ViewItem.Bits.HasFocusOrder, false); this.FireNotification(NotificationID.FocusOrder); } } } - object INavigationSite.UniqueId => (object)this.IDPath; + object INavigationSite.UniqueId => IDPath; public ViewItemID[] IDPath { @@ -2616,7 +2616,7 @@ namespace Microsoft.Iris.UI for (ViewItem viewItem = this; viewItem.Parent != null; viewItem = viewItem.Parent) ++length; if (length == 0) - return (ViewItemID[])null; + return null; ViewItemID[] viewItemIdArray = new ViewItemID[length]; int index = length - 1; for (ViewItem childItem = this; childItem.Parent != null; childItem = childItem.Parent) @@ -2628,9 +2628,9 @@ namespace Microsoft.Iris.UI } } - INavigationSite INavigationSite.Parent => (INavigationSite)this.Parent; + INavigationSite INavigationSite.Parent => Parent; - ICollection INavigationSite.Children => (ICollection)this.Children; + ICollection INavigationSite.Children => Children; bool INavigationSite.Visible => this.IsVisibleToRenderer; @@ -2669,7 +2669,7 @@ namespace Microsoft.Iris.UI out ViewItemID failedComponent) { FindChildResult findChildResult = FindChildResult.Failure; - resultItem = (ViewItem)this.Zone.RootViewItem; + resultItem = Zone.RootViewItem; failedComponent = new ViewItemID(); for (int index = 0; index < parts.Length; ++index) { @@ -2691,10 +2691,10 @@ namespace Microsoft.Iris.UI INavigationSite INavigationSite.LookupChildById( object uniqueIDObject) { - INavigationSite navigationSite = (INavigationSite)null; + INavigationSite navigationSite = null; ViewItem resultItem; if (uniqueIDObject is ViewItemID[] parts && this.FindChildFromPath(parts, out resultItem, out ViewItemID _) == FindChildResult.Success) - navigationSite = (INavigationSite)resultItem; + navigationSite = resultItem; return navigationSite; } @@ -2704,7 +2704,7 @@ namespace Microsoft.Iris.UI ViewItemID part, out ViewItem resultItem) { - resultItem = (ViewItem)null; + resultItem = null; if (part.IDValid && !part.StringPartValid) { foreach (ViewItem child in this.Children) @@ -2725,7 +2725,7 @@ namespace Microsoft.Iris.UI private uint GetBitAsUInt(ViewItem.Bits lookupBit) => ((ViewItem.Bits)this._bits.Data & lookupBit) == ~(ViewItem.Bits.PendingNavigateInto | ViewItem.Bits.PendingNavigateIntoIsDefault | ViewItem.Bits.PendingNavigateIntoScheduled | ViewItem.Bits.ClipMouse | ViewItem.Bits.MouseInteractive | ViewItem.Bits.PaintInvalid | ViewItem.Bits.HasScale | ViewItem.Bits.ScaleChanged | ViewItem.Bits.LayoutInputMaxSize | ViewItem.Bits.LayoutInputMinSize | ViewItem.Bits.LayoutInputMargins | ViewItem.Bits.LayoutInputPadding | ViewItem.Bits.LayoutInputVisible | ViewItem.Bits.LayoutAlignment | ViewItem.Bits.LayoutChildAlignment | ViewItem.Bits.LayoutInputSharedSize | ViewItem.Bits.LayoutInputSharedSizePolicy | ViewItem.Bits.OutputSelfDirty | ViewItem.Bits.OutputTreeDirty | ViewItem.Bits.LayoutInvalid | ViewItem.Bits.ActiveAnimations | ViewItem.Bits.AnimationBuilders | ViewItem.Bits.IdleAnimations | ViewItem.Bits.HasNavMode | ViewItem.Bits.HasFocusOrder | ViewItem.Bits.DeepLayoutNotifySelf | ViewItem.Bits.DeepLayoutNotifyTree | ViewItem.Bits.Unused1 | ViewItem.Bits.Unused2 | ViewItem.Bits.Unused3 | ViewItem.Bits.Unused4 | ViewItem.Bits.Unused5) ? 0U : 1U; - protected uint GetBitAsUInt(ViewItem.Bits2 lookupBit) => ((ViewItem.Bits2)this._bits2.Data & lookupBit) == (ViewItem.Bits2)0 ? 0U : 1U; + protected uint GetBitAsUInt(ViewItem.Bits2 lookupBit) => ((ViewItem.Bits2)this._bits2.Data & lookupBit) == 0 ? 0U : 1U; private void SetBit(ViewItem.Bits changeBit, bool value) => this._bits[(int)changeBit] = value; @@ -2757,7 +2757,7 @@ namespace Microsoft.Iris.UI if (!((string)this.GetData(ViewItem.s_nameProperty) != value)) return; string str = NotifyService.CanonicalizeString(value); - this.SetData(ViewItem.s_nameProperty, (object)str); + this.SetData(ViewItem.s_nameProperty, str); } } @@ -2772,7 +2772,7 @@ namespace Microsoft.Iris.UI { if (!(this.DebugOutline != value)) return; - this.SetData(ViewItem.s_debugOutlineProperty, (object)value); + this.SetData(ViewItem.s_debugOutlineProperty, value); this.FireNotification(NotificationID.DebugOutline); } } diff --git a/UIX/Microsoft/Iris/UI/ViewItemID.cs b/UIX/Microsoft/Iris/UI/ViewItemID.cs index 166285a..04f13d5 100644 --- a/UIX/Microsoft/Iris/UI/ViewItemID.cs +++ b/UIX/Microsoft/Iris/UI/ViewItemID.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.UI public ViewItemID(int id) { this._id = id; - this._stringPart = (string)null; + this._stringPart = null; } public ViewItemID(string stringPart) @@ -44,7 +44,7 @@ namespace Microsoft.Iris.UI { if (!this.StringPartValid) return this._id.ToString(); - return !this.IDValid ? this._stringPart : InvariantString.Format("{0} {1}", (object)this._stringPart, (object)this._id); + return !this.IDValid ? this._stringPart : InvariantString.Format("{0} {1}", _stringPart, _id); } } } diff --git a/UIX/Microsoft/Iris/VideoStream.cs b/UIX/Microsoft/Iris/VideoStream.cs index 027fa39..78727e6 100644 --- a/UIX/Microsoft/Iris/VideoStream.cs +++ b/UIX/Microsoft/Iris/VideoStream.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris this._clients = new ArrayList(); if (UISession.Default.RenderSession.GraphicsDevice.IsVideoComposited) { - this._renderStream = UISession.Default.RenderSession.CreateVideoStream((object)this); + this._renderStream = UISession.Default.RenderSession.CreateVideoStream(this); this._renderStream.InvalidateContentEvent += new InvalidateContentHandler(this.OnRenderVideoStreamChange); } this._presentationBuilder = new VideoPresentationBuilder(); @@ -61,10 +61,10 @@ namespace Microsoft.Iris if (this._renderStream != null) { this._renderStream.InvalidateContentEvent -= new InvalidateContentHandler(this.OnRenderVideoStreamChange); - this._renderStream.UnregisterUsage((object)this); - this._renderStream = (IVideoStream)null; + this._renderStream.UnregisterUsage(this); + this._renderStream = null; } - this._presentationBuilder = (VideoPresentationBuilder)null; + this._presentationBuilder = null; this._clients.Clear(); } @@ -87,7 +87,7 @@ namespace Microsoft.Iris set { UIDispatcher.VerifyOnApplicationThread(); - if ((double)value < 0.0 || (double)value > 0.5) + if (value < 0.0 || value > 0.5) throw new ArgumentException("Valdid range for content overscan is [0, .5]"); if (Math2.WithinEpsilon(this._contentOverscanPer, value)) return; @@ -183,7 +183,7 @@ namespace Microsoft.Iris void IUIVideoStream.RegisterPortal(IUIVideoPortal portal) { portal.PortalChange += new EventHandler(this.OnVideoClientChange); - this._clients.Add((object)portal); + this._clients.Add(portal); portal.OnStreamChange(true); this.Invalidate(false); } @@ -191,9 +191,9 @@ namespace Microsoft.Iris void IUIVideoStream.RevokePortal(IUIVideoPortal portal) { portal.PortalChange -= new EventHandler(this.OnVideoClientChange); - if (this._clients.Contains((object)portal)) + if (this._clients.Contains(portal)) { - this._clients.Remove((object)portal); + this._clients.Remove(portal); } else { @@ -206,11 +206,11 @@ namespace Microsoft.Iris BasicVideoPresentation IUIVideoStream.GetPresentation( IUIVideoPortal portal) { - BasicVideoPresentation videoPresentation = (BasicVideoPresentation)null; + BasicVideoPresentation videoPresentation = null; if (!this._disposed) { this._presentationBuilder.CompleteDestination = RectangleF.FromRectangle(portal.LogicalContentRect); - this._presentationBuilder.DestinationAspectRatio = new SizeF((float)portal.LogicalContentRect.Width, (float)portal.LogicalContentRect.Height); + this._presentationBuilder.DestinationAspectRatio = new SizeF(portal.LogicalContentRect.Width, portal.LogicalContentRect.Height); videoPresentation = this._presentationBuilder.BuildPresentation(); } return videoPresentation; @@ -225,7 +225,7 @@ namespace Microsoft.Iris { if (client.IsUIVisible) { - Rectangle rectangle2 = client.EstimatePosition((IZoneDisplayChild)null); + Rectangle rectangle2 = client.EstimatePosition(null); int num2 = rectangle2.Width * rectangle2.Height; if (num2 > num1) { @@ -254,7 +254,7 @@ namespace Microsoft.Iris { if (this._deferredInvalidate) return; - DeferredCall.Post(DispatchPriority.AppEvent, new DeferredHandler(this.InvalidateWorker), (object)streamChange); + DeferredCall.Post(DispatchPriority.AppEvent, new DeferredHandler(this.InvalidateWorker), streamChange); this._deferredInvalidate = true; } @@ -264,8 +264,8 @@ namespace Microsoft.Iris bool flag = this._srcAspect.Width > 0 && this._srcAspect.Height > 0 && this._srcVideo.Width >= 0 && this._srcVideo.Height >= 0; if (fFormatChanged && flag) { - this._presentationBuilder.SourceDimensions = new SizeF((float)this._srcVideo.Width, (float)this._srcVideo.Height); - this._presentationBuilder.ContentAspectRatio = new SizeF((float)this._srcAspect.Width, (float)this._srcAspect.Height); + this._presentationBuilder.SourceDimensions = new SizeF(_srcVideo.Width, _srcVideo.Height); + this._presentationBuilder.ContentAspectRatio = new SizeF(_srcAspect.Width, _srcAspect.Height); this._presentationBuilder.ContentOverscanFactor = this._contentOverscanPer * 100f; } this._isRendering = false; @@ -283,7 +283,7 @@ namespace Microsoft.Iris { if (this.DisplayDetailsChanged == null) return; - this.DisplayDetailsChanged((object)this, EventArgs.Empty); + this.DisplayDetailsChanged(this, EventArgs.Empty); } } } diff --git a/UIX/Microsoft/Iris/ViewItems/Clip.cs b/UIX/Microsoft/Iris/ViewItems/Clip.cs index 3b1a81a..0486c07 100644 --- a/UIX/Microsoft/Iris/ViewItems/Clip.cs +++ b/UIX/Microsoft/Iris/ViewItems/Clip.cs @@ -36,7 +36,7 @@ namespace Microsoft.Iris.ViewItems protected override void OnDispose() { this._edgefade.Dispose(); - this._edgefade = (EdgeFade)null; + this._edgefade = null; base.OnDispose(); } @@ -62,7 +62,7 @@ namespace Microsoft.Iris.ViewItems get => this._edgefade.FadeSize; set { - if ((double)this.FadeSize == (double)value) + if (FadeSize == (double)value) return; this._edgefade.FadeSize = value; this.MarkPaintInvalid(); @@ -75,7 +75,7 @@ namespace Microsoft.Iris.ViewItems get => this._nearOffset; set { - if ((double)this._nearOffset == (double)value) + if (_nearOffset == (double)value) return; this._nearOffset = value; this.MarkPaintInvalid(); @@ -88,7 +88,7 @@ namespace Microsoft.Iris.ViewItems get => this._farOffset; set { - if ((double)this._farOffset == (double)value) + if (_farOffset == (double)value) return; this._farOffset = value; this.MarkPaintInvalid(); @@ -101,7 +101,7 @@ namespace Microsoft.Iris.ViewItems get => this._nearPercent; set { - if ((double)this._nearPercent == (double)value) + if (_nearPercent == (double)value) return; this._nearPercent = value; this.MarkPaintInvalid(); @@ -114,7 +114,7 @@ namespace Microsoft.Iris.ViewItems get => this._farPercent; set { - if ((double)this._farPercent == (double)value) + if (_farPercent == (double)value) return; this._farPercent = value; this.MarkPaintInvalid(); @@ -165,7 +165,7 @@ namespace Microsoft.Iris.ViewItems get => this._edgefade.FadeAmount; set { - if ((double)this._edgefade.FadeAmount == (double)value) + if (_edgefade.FadeAmount == (double)value) return; this._edgefade.FadeAmount = value; this.MarkPaintInvalid(); diff --git a/UIX/Microsoft/Iris/ViewItems/ContentViewItem.cs b/UIX/Microsoft/Iris/ViewItems/ContentViewItem.cs index d588de6..4e76893 100644 --- a/UIX/Microsoft/Iris/ViewItems/ContentViewItem.cs +++ b/UIX/Microsoft/Iris/ViewItems/ContentViewItem.cs @@ -31,18 +31,18 @@ namespace Microsoft.Iris.ViewItems return; if (removeFromTree) this._contents.Remove(); - this._contents.UnregisterUsage((object)this); - this._contents = (ISprite)null; + this._contents.UnregisterUsage(this); + this._contents = null; } protected virtual void CreateContent() { ISprite contentVisual = this.ContentVisual; - this._contents = UISession.Default.RenderSession.CreateSprite((object)this, (object)this); + this._contents = UISession.Default.RenderSession.CreateSprite(this, this); if (contentVisual != null) - this.VisualContainer.AddChild((IVisual)this._contents, (IVisual)contentVisual, VisualOrder.Before); + this.VisualContainer.AddChild(_contents, contentVisual, VisualOrder.Before); else - this.VisualContainer.AddChild((IVisual)this._contents, (IVisual)null, VisualOrder.Last); + this.VisualContainer.AddChild(_contents, null, VisualOrder.Last); } public override void OrphanVisuals(OrphanedVisualCollection orphans) diff --git a/UIX/Microsoft/Iris/ViewItems/CountLayoutInput.cs b/UIX/Microsoft/Iris/ViewItems/CountLayoutInput.cs index ebf1d44..f2d1cb0 100644 --- a/UIX/Microsoft/Iris/ViewItems/CountLayoutInput.cs +++ b/UIX/Microsoft/Iris/ViewItems/CountLayoutInput.cs @@ -26,6 +26,6 @@ namespace Microsoft.Iris.ViewItems public static DataCookie Data => CountLayoutInput.s_dataProperty; - public override string ToString() => InvariantString.Format("{0}(Count={1})", (object)this.GetType().Name, (object)this._count); + public override string ToString() => InvariantString.Format("{0}(Count={1})", this.GetType().Name, _count); } } diff --git a/UIX/Microsoft/Iris/ViewItems/Graphic.cs b/UIX/Microsoft/Iris/ViewItems/Graphic.cs index cb41928..c0c2936 100644 --- a/UIX/Microsoft/Iris/ViewItems/Graphic.cs +++ b/UIX/Microsoft/Iris/ViewItems/Graphic.cs @@ -45,21 +45,21 @@ namespace Microsoft.Iris.ViewItems { if (Graphic.s_AcquiringDefaultImage != null) return; - Graphic.s_AcquiringDefaultImage = (UIImage)new UriImage(Graphic.s_AcquiringDefaultImageUri, new Inset(3, 3, 53, 53), Size.Zero, false); + Graphic.s_AcquiringDefaultImage = new UriImage(Graphic.s_AcquiringDefaultImageUri, new Inset(3, 3, 53, 53), Size.Zero, false); Graphic.s_AcquiringDefaultImage.Load(); - Graphic.s_ErrorDefaultImage = (UIImage)new UriImage(Graphic.s_ErrorDefaultImageUri, new Inset(3, 3, 53, 53), Size.Zero, false); + Graphic.s_ErrorDefaultImage = new UriImage(Graphic.s_ErrorDefaultImageUri, new Inset(3, 3, 53, 53), Size.Zero, false); Graphic.s_ErrorDefaultImage.Load(); } protected override void OnDispose() { - this.ReleaseInUseImage(this._contentImage, (UIImage)null); - this.ReleaseInUseImage(this._preloadImage, (UIImage)null); + this.ReleaseInUseImage(this._contentImage, null); + this.ReleaseInUseImage(this._preloadImage, null); this.ReleaseInUseImage(this.AcquiringImage, Graphic.s_AcquiringDefaultImage); this.ReleaseInUseImage(this.ErrorImage, Graphic.s_ErrorDefaultImage); - this._preloadImage = (UIImage)null; - this._contentImage = (UIImage)null; - this.AsyncLoadCompleteHandler = (ContentLoadCompleteHandler)null; + this._preloadImage = null; + this._contentImage = null; + this.AsyncLoadCompleteHandler = null; base.OnDispose(); } @@ -67,7 +67,7 @@ namespace Microsoft.Iris.ViewItems { if (this._contents == null) return; - this._contents.Effect = (IEffect)null; + this._contents.Effect = null; } public UIImage Content @@ -80,12 +80,12 @@ namespace Microsoft.Iris.ViewItems if (this._contentImage != null) { this.RemoveAsyncLoadCompleteHandler(this._contentImage); - this._contentImage.RemoveUser((object)this); + this._contentImage.RemoveUser(this); } this._contentImage = value; if (this._contentImage != null) { - this._contentImage.AddUser((object)this); + this._contentImage.AddUser(this); this._contentImage.Load(); if (this._contentImage.Status == ImageStatus.Loading || this._contentImage.Status == ImageStatus.PendingLoad) this.AttachAsyncLoadCompleteHandler(this._contentImage); @@ -113,11 +113,11 @@ namespace Microsoft.Iris.ViewItems set { if (this._preloadImage != null) - this._preloadImage.RemoveUser((object)this); + this._preloadImage.RemoveUser(this); this._preloadImage = value; if (this._preloadImage == null) return; - this._preloadImage.AddUser((object)this); + this._preloadImage.AddUser(this); this._preloadImage.Load(); } } @@ -125,7 +125,7 @@ namespace Microsoft.Iris.ViewItems private UIImage GetStatusImage(DataCookie cookie, UIImage defaultImage) { object data = this.GetData(cookie); - return data != null ? (data != Graphic.s_NullImage ? (UIImage)data : (UIImage)null) : defaultImage; + return data != null ? (data != Graphic.s_NullImage ? (UIImage)data : null) : defaultImage; } private void SetStatusImage( @@ -140,11 +140,11 @@ namespace Microsoft.Iris.ViewItems object obj; if (value != null) { - obj = (object)value; + obj = value; value.Load(); if (value.Status == ImageStatus.Loading || value.Status == ImageStatus.PendingLoad) this.AttachAsyncLoadCompleteHandler(value); - value.AddUser((object)this); + value.AddUser(this); } else obj = Graphic.s_NullImage; @@ -184,7 +184,7 @@ namespace Microsoft.Iris.ViewItems this.RemoveAsyncLoadCompleteHandler(image); if (image == null || image == defaultImage) return; - image.RemoveUser((object)this); + image.RemoveUser(this); } private void NotifyContentChange() @@ -216,7 +216,7 @@ namespace Microsoft.Iris.ViewItems return; if (value == SizingPolicy.SizeToChildren) { - this.Layout = (ILayout)DefaultLayout.Instance; + this.Layout = DefaultLayout.Instance; } else { @@ -225,7 +225,7 @@ namespace Microsoft.Iris.ViewItems this.UpdateMaintainAspectRatioOnLayout(imageLayout); imageLayout.MinimumSize = this.MinimumSize; imageLayout.Fill = value == SizingPolicy.SizeToConstraint; - this.Layout = (ILayout)imageLayout; + this.Layout = imageLayout; } this.FireNotification(NotificationID.SizingPolicy); } @@ -308,7 +308,7 @@ namespace Microsoft.Iris.ViewItems private ContentLoadCompleteHandler AsyncLoadCompleteHandler { get => (ContentLoadCompleteHandler)this.GetData(Graphic.s_pendingLoadCompleteHandlerProperty); - set => this.SetData(Graphic.s_pendingLoadCompleteHandlerProperty, (object)value); + set => this.SetData(Graphic.s_pendingLoadCompleteHandlerProperty, value); } public void CommitPreload() => this.Content = this.PreloadContent; @@ -322,8 +322,8 @@ namespace Microsoft.Iris.ViewItems return; if (this._contents.Effect == null) { - this._contents.Effect = EffectClass.CreateImageRenderEffectWithFallback(this.Effect, (object)this, (IImage)null); - this._contents.Effect.UnregisterUsage((object)this); + this._contents.Effect = EffectClass.CreateImageRenderEffectWithFallback(this.Effect, this, null); + this._contents.Effect.UnregisterUsage(this); } this.UpdateEffectContents(); this.UpdateCoordinateMaps(); @@ -356,13 +356,13 @@ namespace Microsoft.Iris.ViewItems case 2: case 3: RectangleF rectangleF = new RectangleF(Point.Zero, size); - CoordMap coordMap = (CoordMap)null; + CoordMap coordMap = null; if (source != rectangleF) { - float flValue1 = source.Left / (float)size.Width; - float flValue2 = source.Right / (float)size.Width; - float flValue3 = source.Top / (float)size.Height; - float flValue4 = source.Bottom / (float)size.Height; + float flValue1 = source.Left / size.Width; + float flValue2 = source.Right / size.Width; + float flValue3 = source.Top / size.Height; + float flValue4 = source.Bottom / size.Height; coordMap = new CoordMap(); coordMap.AddValue(0.0f, flValue1, Orientation.Horizontal); coordMap.AddValue(0.0f, flValue3, Orientation.Vertical); @@ -377,7 +377,7 @@ namespace Microsoft.Iris.ViewItems case 1: this._contents.RelativeSize = true; this._contents.Size = Vector2.UnitVector; - this._contents.SetCoordMap(0, (CoordMap)null); + this._contents.SetCoordMap(0, null); break; } } @@ -420,12 +420,12 @@ namespace Microsoft.Iris.ViewItems size1 = Size.LargestFit(size2, size1); break; } - float dimensionOffset1 = this.CalculateDimensionOffset((float)size1.Width, (float)originalSourceSize.Width, this._horizontalAlignment); - float dimensionOffset2 = this.CalculateDimensionOffset((float)size2.Width, (float)layoutSize.Width, this._horizontalAlignment); - float dimensionOffset3 = this.CalculateDimensionOffset((float)size1.Height, (float)originalSourceSize.Height, this._verticalAlignment); - float dimensionOffset4 = this.CalculateDimensionOffset((float)size2.Height, (float)layoutSize.Height, this._verticalAlignment); - source = new RectangleF(dimensionOffset1, dimensionOffset3, (float)size1.Width, (float)size1.Height); - destination = new RectangleF(dimensionOffset2, dimensionOffset4, (float)size2.Width, (float)size2.Height); + float dimensionOffset1 = this.CalculateDimensionOffset(size1.Width, originalSourceSize.Width, this._horizontalAlignment); + float dimensionOffset2 = this.CalculateDimensionOffset(size2.Width, layoutSize.Width, this._horizontalAlignment); + float dimensionOffset3 = this.CalculateDimensionOffset(size1.Height, originalSourceSize.Height, this._verticalAlignment); + float dimensionOffset4 = this.CalculateDimensionOffset(size2.Height, layoutSize.Height, this._verticalAlignment); + source = new RectangleF(dimensionOffset1, dimensionOffset3, size1.Width, size1.Height); + destination = new RectangleF(dimensionOffset2, dimensionOffset4, size2.Width, size2.Height); } } } diff --git a/UIX/Microsoft/Iris/ViewItems/Host.cs b/UIX/Microsoft/Iris/ViewItems/Host.cs index 9edc0e4..0cce3e5 100644 --- a/UIX/Microsoft/Iris/ViewItems/Host.cs +++ b/UIX/Microsoft/Iris/ViewItems/Host.cs @@ -34,7 +34,7 @@ namespace Microsoft.Iris.ViewItems private static DeferredHandler s_startRequestHandler = new DeferredHandler(Host.StartSourceRequest); public Host() - : this((UIClassTypeSchema)null, (UIClassTypeSchema)null) + : this(null, null) { } @@ -52,23 +52,23 @@ namespace Microsoft.Iris.ViewItems if (this._typeCurrent == null) return; this.SetChildUI(this._typeCurrent.ConstructUI()); - this._lastRequestedSource = this.SourceFromType((TypeSchema)this._typeCurrent); + this._lastRequestedSource = this.SourceFromType(_typeCurrent); } private string SourceFromType(TypeSchema type) => type.Owner.Uri + "#" + type.Name; - public TypeSchema TypeSchema => (TypeSchema)this._typeCurrent; + public TypeSchema TypeSchema => _typeCurrent; protected override void OnDispose() { base.OnDispose(); this.Cancel(); if (this._childUI != null) - this.SetChildUI((UIClass)null); + this.SetChildUI(null); if (this._heldInitialUIDisposables != null) { foreach (DisposableObject initialUiDisposable in this._heldInitialUIDisposables) - initialUiDisposable.Dispose((object)this); + initialUiDisposable.Dispose(this); } if (!this.Unloadable) return; @@ -83,12 +83,12 @@ namespace Microsoft.Iris.ViewItems UIClass uiClass = (UIClass)owner; if (this.ChildUI == null) return; - uiClass.Children.Add((Microsoft.Iris.Library.TreeNode)this.ChildUI); + uiClass.Children.Add(ChildUI); } - public void RequestSource(string source, Vector properties) => this.RequestSource(source, (TypeSchema)null, properties); + public void RequestSource(string source, Vector properties) => this.RequestSource(source, null, properties); - public void RequestSource(TypeSchema type, Vector properties) => this.RequestSource((string)null, type, properties); + public void RequestSource(TypeSchema type, Vector properties) => this.RequestSource(null, type, properties); public void RequestSource(string source, TypeSchema type, Vector properties) { @@ -96,7 +96,7 @@ namespace Microsoft.Iris.ViewItems { if (!HostSchema.Type.IsAssignableFrom(type)) { - ErrorManager.ReportError("RequestSource failed: Referrenced type '{0}' is not a UI", (object)type.Name); + ErrorManager.ReportError("RequestSource failed: Referrenced type '{0}' is not a UI", type.Name); return; } source = this.SourceFromType(type); @@ -109,7 +109,7 @@ namespace Microsoft.Iris.ViewItems hostRequestPacket.Properties = properties; this._pendingHostRequest = hostRequestPacket; this._lastRequestedSource = source; - DeferredCall.Post(DispatchPriority.High, Host.s_startRequestHandler, (object)hostRequestPacket); + DeferredCall.Post(DispatchPriority.High, Host.s_startRequestHandler, hostRequestPacket); } public void Cancel() @@ -117,7 +117,7 @@ namespace Microsoft.Iris.ViewItems if (this._pendingHostRequest != null) { this._pendingHostRequest.Clear(); - this._pendingHostRequest = (HostRequestPacket)null; + this._pendingHostRequest = null; } this.RevokePendingLoadNotification(); } @@ -132,12 +132,12 @@ namespace Microsoft.Iris.ViewItems UIClassTypeSchema type = hostRequestPacket.Type; Vector properties = hostRequestPacket.Properties; host.Cancel(); - ErrorManager.EnterContext((object)source); + ErrorManager.EnterContext(source); try { host.SetStatus(HostStatus.LoadingSource); - LoadResult loadResult = (LoadResult)null; - string uiToCreate = (string)null; + LoadResult loadResult = null; + string uiToCreate = null; if (type == null && source != null) loadResult = MarkupSystem.Load(Host.CrackSourceUri(source, out uiToCreate), host.InheritedIslandId); host.CompleteSourceRequest(source, type, properties, loadResult, uiToCreate); @@ -155,7 +155,7 @@ namespace Microsoft.Iris.ViewItems LoadResult loadResult, string uiToCreate) { - ErrorManager.EnterContext((object)requestedSource); + ErrorManager.EnterContext(requestedSource); ErrorWatermark watermark = ErrorManager.Watermark; bool flag = true; this.ForceContentChange(); @@ -165,28 +165,28 @@ namespace Microsoft.Iris.ViewItems { if (this._typeRestriction != null) this.HoldChildUIPropertyValues(); - this.SetChildUI((UIClass)null); + this.SetChildUI(null); this._typeCurrent = this._typeRestriction; this.FireNotification(NotificationID.SourceType); } this._dynamicHost = true; - UIClassTypeSchema uiClassTypeSchema = (UIClassTypeSchema)null; - Vector vector = (Vector)null; + UIClassTypeSchema uiClassTypeSchema = null; + Vector vector = null; if (requestedSource != null) { if (requestedType == null) { if (loadResult == null || loadResult.Status == LoadResultStatus.Error) { - ErrorManager.ReportError("RequestSource failed: Unable to load '{0}'", (object)requestedSource); + ErrorManager.ReportError("RequestSource failed: Unable to load '{0}'", requestedSource); } else { TypeSchema type = loadResult.FindType(uiToCreate); if (type == null) - ErrorManager.ReportError("RequestSource failed: Unable to find '{0}' within '{1}'", (object)uiToCreate, (object)requestedSource); + ErrorManager.ReportError("RequestSource failed: Unable to find '{0}' within '{1}'", uiToCreate, requestedSource); else if (!HostSchema.Type.IsAssignableFrom(type)) - ErrorManager.ReportError("RequestSource failed: Referrenced type '{0}' is not a UI", (object)uiToCreate); + ErrorManager.ReportError("RequestSource failed: Referrenced type '{0}' is not a UI", uiToCreate); else requestedType = (UIClassTypeSchema)type; } @@ -194,9 +194,9 @@ namespace Microsoft.Iris.ViewItems if (requestedType != null) { uiClassTypeSchema = requestedType; - if (this._typeRestriction != null && !this._typeRestriction.IsAssignableFrom((TypeSchema)uiClassTypeSchema)) - ErrorManager.ReportError("RequestSource failed: Found '{0}' within '{1}', but, it is not a '{2}'", (object)uiToCreate, (object)requestedSource, (object)this._typeRestriction.Name); - vector = this.NegotiateNewChildUIPropertyValues((TypeSchema)uiClassTypeSchema, properties); + if (this._typeRestriction != null && !this._typeRestriction.IsAssignableFrom(uiClassTypeSchema)) + ErrorManager.ReportError("RequestSource failed: Found '{0}' within '{1}', but, it is not a '{2}'", uiToCreate, requestedSource, _typeRestriction.Name); + vector = this.NegotiateNewChildUIPropertyValues(uiClassTypeSchema, properties); } } if (watermark.ErrorsDetected) @@ -211,14 +211,14 @@ namespace Microsoft.Iris.ViewItems UIClass childUi = host.ChildUI; foreach (UIPropertyRecord uiPropertyRecord in vector) { - object instance = (object)host; + object instance = host; uiPropertyRecord.Schema.SetValue(ref instance, uiPropertyRecord.Value); } - this._heldUIProperties = (Vector)null; + this._heldUIProperties = null; this.SetChildUI(childUi); - object instance1 = (object)this; + object instance1 = this; uiClassTypeSchema.InitializeInstance(ref instance1); - this.UI.Children.Add((Microsoft.Iris.Library.TreeNode)childUi); + this.UI.Children.Add(childUi); this._typeCurrent = uiClassTypeSchema; this.FireNotification(NotificationID.Source); this.FireNotification(NotificationID.SourceType); @@ -243,14 +243,14 @@ namespace Microsoft.Iris.ViewItems private void DeliverLoadCompleteNotification() { if (this.NotifyForLatestLoad() && this.ChildUI != null && this.ChildUI.RootItem != null) - this._loadNotify((ViewItem)this, this.ChildUI.RootItem); + this._loadNotify(this, this.ChildUI.RootItem); this.RevokePendingLoadNotification(); } private void RevokePendingLoadNotification() { - this._loadNotify = (ChildFaultedInDelegate)null; - this._loadNotifyURI = (string)null; + this._loadNotify = null; + this._loadNotifyURI = null; } private void HoldChildUIPropertyValues() @@ -258,12 +258,12 @@ namespace Microsoft.Iris.ViewItems if (this._typeRestriction == null) return; this._heldUIProperties = new Vector(); - for (TypeSchema typeRestriction = (TypeSchema)this._typeRestriction; typeRestriction != HostSchema.Type; typeRestriction = typeRestriction.Base) + for (TypeSchema typeRestriction = _typeRestriction; typeRestriction != HostSchema.Type; typeRestriction = typeRestriction.Base) { foreach (PropertySchema property1 in typeRestriction.Properties) { string name = property1.Name; - if (this._childUI.Storage.ContainsKey((object)name) && !UIPropertyRecord.IsInList(this._heldUIProperties, name)) + if (this._childUI.Storage.ContainsKey(name) && !UIPropertyRecord.IsInList(this._heldUIProperties, name)) { object property2 = this._childUI.GetProperty(name); UIPropertyRecord.AddToList(this._heldUIProperties, name, property2); @@ -275,7 +275,7 @@ namespace Microsoft.Iris.ViewItems if (this._heldInitialUIDisposables == null) this._heldInitialUIDisposables = new Vector(); this._heldInitialUIDisposables.Add(disposable); - disposable.TransferOwnership((object)this); + disposable.TransferOwnership(this); } } } @@ -300,14 +300,14 @@ namespace Microsoft.Iris.ViewItems { uiPropertyRecord.Schema = replacementType.FindPropertyDeep(uiPropertyRecord.Name); if (uiPropertyRecord.Schema == null) - ErrorManager.ReportError("Runtime UI replacement to '{0}' failed since a property named '{1}' was specified but doesn't exist on '{0}'", (object)replacementType.Name, (object)uiPropertyRecord.Name); + ErrorManager.ReportError("Runtime UI replacement to '{0}' failed since a property named '{1}' was specified but doesn't exist on '{0}'", replacementType.Name, uiPropertyRecord.Name); else if (!uiPropertyRecord.Schema.PropertyType.IsAssignableFrom(uiPropertyRecord.Value)) - ErrorManager.ReportError("Runtime UI replacement to '{0}' failed since the value specified ({1}) for the '{2}' property is incompatible (type expected is '{3}')", (object)replacementType.Name, uiPropertyRecord.Value, (object)uiPropertyRecord.Name, (object)uiPropertyRecord.Schema.PropertyType.Name); + ErrorManager.ReportError("Runtime UI replacement to '{0}' failed since the value specified ({1}) for the '{2}' property is incompatible (type expected is '{3}')", replacementType.Name, uiPropertyRecord.Value, uiPropertyRecord.Name, uiPropertyRecord.Schema.PropertyType.Name); } foreach (string name in replacementType.FindRequiredPropertyNamesDeep()) { if (!UIPropertyRecord.IsInList(list, name)) - ErrorManager.ReportError("Runtime UI replacement to '{0}' failed since required property '{1}' was never provided a value", (object)replacementType.Name, (object)name); + ErrorManager.ReportError("Runtime UI replacement to '{0}' failed since required property '{1}' was never provided a value", replacementType.Name, name); } return list; } @@ -318,7 +318,7 @@ namespace Microsoft.Iris.ViewItems ViewItemID part, out ViewItem resultItem) { - resultItem = (ViewItem)null; + resultItem = null; FindChildResult findChildResult = FindChildResult.Failure; if (part.StringPartValid && !part.IDValid) { @@ -341,7 +341,7 @@ namespace Microsoft.Iris.ViewItems public string Source => this._lastRequestedSource; - public TypeSchema SourceType => (TypeSchema)this._typeCurrent; + public TypeSchema SourceType => _typeCurrent; public bool Unloadable { @@ -368,7 +368,7 @@ namespace Microsoft.Iris.ViewItems { MarkupSystem.UnloadIsland(this._islandId); if (requestSourceToNull) - this.RequestSource((string)null, (TypeSchema)null, (Vector)null); + this.RequestSource(null, null, null); return true; } ErrorManager.ReportError("UnloadAll may only be called on Unloadable hosts"); @@ -392,17 +392,17 @@ namespace Microsoft.Iris.ViewItems if (unloadMarkup) { string lastRequestedSource = this._lastRequestedSource; - this.RequestSource((string)null, (TypeSchema)null, (Vector)null); + this.RequestSource(null, null, null); DeferredCall.Post(DispatchPriority.High, new SimpleCallback(this.DeferredUnloadAll)); - DeferredCall.Post(DispatchPriority.High, new DeferredHandler(this.DeferredRequestSource), (object)lastRequestedSource); + DeferredCall.Post(DispatchPriority.High, new DeferredHandler(this.DeferredRequestSource), lastRequestedSource); } else - this.RequestSource(this._lastRequestedSource, (Vector)null); + this.RequestSource(this._lastRequestedSource, null); } private void DeferredUnloadAll() => this.UnloadAll(false); - private void DeferredRequestSource(object objLastRequestedSource) => this.RequestSource((string)objLastRequestedSource, (Vector)null); + private void DeferredRequestSource(object objLastRequestedSource) => this.RequestSource((string)objLastRequestedSource, null); public HostStatus Status => this._status; @@ -432,16 +432,16 @@ namespace Microsoft.Iris.ViewItems private void SetChildUI(UIClass childUI) { - LoadResult loadResult = (LoadResult)null; + LoadResult loadResult = null; if (this._childUI != null) { loadResult = this._childUI.TypeSchema.Owner; - this._childUI.Dispose((object)this); + this._childUI.Dispose(this); } if (this._dynamicHost) { - loadResult?.UnregisterUsage((object)this); - childUI?.TypeSchema.Owner.RegisterUsage((object)this); + loadResult?.UnregisterUsage(this); + childUI?.TypeSchema.Owner.RegisterUsage(this); } this._childUI = childUI; } diff --git a/UIX/Microsoft/Iris/ViewItems/HostRequestPacket.cs b/UIX/Microsoft/Iris/ViewItems/HostRequestPacket.cs index e8d3f32..cae3324 100644 --- a/UIX/Microsoft/Iris/ViewItems/HostRequestPacket.cs +++ b/UIX/Microsoft/Iris/ViewItems/HostRequestPacket.cs @@ -17,10 +17,10 @@ namespace Microsoft.Iris.ViewItems public void Clear() { - this.Host = (Host)null; - this.Source = (string)null; - this.Type = (UIClassTypeSchema)null; - this.Properties = (Vector)null; + this.Host = null; + this.Source = null; + this.Type = null; + this.Properties = null; } } } diff --git a/UIX/Microsoft/Iris/ViewItems/HwndHost.cs b/UIX/Microsoft/Iris/ViewItems/HwndHost.cs index 5e59c08..346e924 100644 --- a/UIX/Microsoft/Iris/ViewItems/HwndHost.cs +++ b/UIX/Microsoft/Iris/ViewItems/HwndHost.cs @@ -30,7 +30,7 @@ namespace Microsoft.Iris.ViewItems this._window.OnHandleChanged += new EventHandler(this.OnHandleChanged); renderWindow.ForwardMessageEvent += new ForwardMessageHandler(this.OnForwardMessage); this._backgroundColor = Color.White; - this._window.BackgroundColor = new ColorF((int)byte.MaxValue, (int)byte.MaxValue, (int)byte.MaxValue); + this._window.BackgroundColor = new ColorF(byte.MaxValue, byte.MaxValue, byte.MaxValue); } protected override void OnDispose() @@ -42,7 +42,7 @@ namespace Microsoft.Iris.ViewItems { this._window.OnHandleChanged -= new EventHandler(this.OnHandleChanged); this._window.Dispose(); - this._window = (IHwndHostWindow)null; + this._window = null; } ((ITrackableUIElementEvents)this).UIChange -= new EventHandler(this.OnUIChange); base.OnDispose(); @@ -95,7 +95,7 @@ namespace Microsoft.Iris.ViewItems msg.wParam = wParam; msg.lParam = lParam; Win32Api.MSG* msgPtr = &msg; - Win32Api.SendMessage(this._childHwndIntPtr, 895U, IntPtr.Zero, (IntPtr)(void*)msgPtr); + Win32Api.SendMessage(this._childHwndIntPtr, 895U, IntPtr.Zero, (IntPtr)msgPtr); } private void OnUIChange(object sender, EventArgs args) @@ -104,9 +104,9 @@ namespace Microsoft.Iris.ViewItems return; Vector3 parentOffsetPxlVector; Vector3 scaleVector; - ViewItem.GetAccumulatedOffsetAndScale((IZoneDisplayChild)this, (IZoneDisplayChild)null, out parentOffsetPxlVector, out scaleVector); + ViewItem.GetAccumulatedOffsetAndScale(this, null, out parentOffsetPxlVector, out scaleVector); Vector2 visualSize = this.VisualSize; - this._window.ClientPosition = new Point((int)Math.Round((double)parentOffsetPxlVector.X), (int)Math.Round((double)parentOffsetPxlVector.Y)); + this._window.ClientPosition = new Point((int)Math.Round(parentOffsetPxlVector.X), (int)Math.Round(parentOffsetPxlVector.Y)); this._window.WindowSize = new Size(Math2.RoundUp(scaleVector.X * visualSize.X), Math2.RoundUp(scaleVector.Y * visualSize.Y)); this._window.Visible = this.FullyVisible; } diff --git a/UIX/Microsoft/Iris/ViewItems/ImageLayout.cs b/UIX/Microsoft/Iris/ViewItems/ImageLayout.cs index 7d9ac7c..7f56a15 100644 --- a/UIX/Microsoft/Iris/ViewItems/ImageLayout.cs +++ b/UIX/Microsoft/Iris/ViewItems/ImageLayout.cs @@ -64,10 +64,10 @@ namespace Microsoft.Iris.ViewItems public static Size SmallestFillingFit(Size source, Size bounds) { - float num = (float)source.Width / (float)source.Height; - Size size = new Size(bounds.Width, (int)Math.Ceiling((double)bounds.Width / (double)num)); + float num = source.Width / (float)source.Height; + Size size = new Size(bounds.Width, (int)Math.Ceiling(bounds.Width / (double)num)); if (size.Height < bounds.Height) - size = new Size((int)Math.Ceiling((double)bounds.Height * (double)num), bounds.Height); + size = new Size((int)Math.Ceiling(bounds.Height * (double)num), bounds.Height); return size; } diff --git a/UIX/Microsoft/Iris/ViewItems/Index.cs b/UIX/Microsoft/Iris/ViewItems/Index.cs index 1022519..0039724 100644 --- a/UIX/Microsoft/Iris/ViewItems/Index.cs +++ b/UIX/Microsoft/Iris/ViewItems/Index.cs @@ -42,12 +42,12 @@ namespace Microsoft.Iris.ViewItems public Index GetContainerIndex() { - ViewItem viewItem = (ViewItem)this._repeater; + ViewItem viewItem = _repeater; while (!(viewItem.Parent is Repeater)) { viewItem = viewItem.Parent; if (viewItem == null) - return (Index)null; + return null; } return ((IndexLayoutInput)viewItem.GetLayoutInput(IndexLayoutInput.Data)).Index; } diff --git a/UIX/Microsoft/Iris/ViewItems/IndexLayoutInput.cs b/UIX/Microsoft/Iris/ViewItems/IndexLayoutInput.cs index c6aefb3..1c5d719 100644 --- a/UIX/Microsoft/Iris/ViewItems/IndexLayoutInput.cs +++ b/UIX/Microsoft/Iris/ViewItems/IndexLayoutInput.cs @@ -29,6 +29,6 @@ namespace Microsoft.Iris.ViewItems public static DataCookie Data => IndexLayoutInput.s_dataProperty; - public override string ToString() => InvariantString.Format("{0}(Index={1}, Type={2})", (object)this.GetType().Name, (object)this.Index, (object)this._type); + public override string ToString() => InvariantString.Format("{0}(Index={1}, Type={2})", this.GetType().Name, Index, _type); } } diff --git a/UIX/Microsoft/Iris/ViewItems/Repeater.cs b/UIX/Microsoft/Iris/ViewItems/Repeater.cs index 6da93f0..136ac0e 100644 --- a/UIX/Microsoft/Iris/ViewItems/Repeater.cs +++ b/UIX/Microsoft/Iris/ViewItems/Repeater.cs @@ -115,7 +115,7 @@ namespace Microsoft.Iris.ViewItems if (this._source is INotifyList sourceA) sourceA.ContentsChanged -= new UIListContentsChangedHandler(this.QueueListContentsChanged); if (this._source is IVirtualList sourceB) - sourceB.RepeaterHost = (Repeater)null; + sourceB.RepeaterHost = null; } this._source = value; if (value != null) @@ -214,14 +214,14 @@ namespace Microsoft.Iris.ViewItems if (this._itemsCount == value) return; this._itemsCount = value; - this.SetLayoutInput((ILayoutInput)new CountLayoutInput(this._itemsCount)); + this.SetLayoutInput(new CountLayoutInput(this._itemsCount)); } } private void RebuildChildren() { if (this.HasVisual) - this.UI.DestroyVisualTree((ViewItem)this, true); + this.UI.DestroyVisualTree(this, true); if (this._repeatedViewItems != null) { UIClass keyFocusDescendant = this.UI.KeyFocusDescendant; @@ -231,8 +231,8 @@ namespace Microsoft.Iris.ViewItems this._repeatedViewItems = new Vector(); this._outstandingDataIndexRequests = new Vector(); this._pendingIndexRequest = new int?(); - this._lastMouseFocusedItem = (ViewItem)null; - this._lastKeyFocusedItem = (ViewItem)null; + this._lastMouseFocusedItem = null; + this._lastKeyFocusedItem = null; int num = 0; if (this._source != null) num = this._source.Count; @@ -258,7 +258,7 @@ namespace Microsoft.Iris.ViewItems } else { - if (Microsoft.Iris.Debug.Trace.IsCategoryEnabled(TraceCategory.Repeating, (byte)5)) + if (Microsoft.Iris.Debug.Trace.IsCategoryEnabled(TraceCategory.Repeating, 5)) { int num = this._pendingIndexRequest.HasValue ? 1 : 0; } @@ -289,10 +289,10 @@ namespace Microsoft.Iris.ViewItems private Vector GetLayoutRepeatRequests() { if (this.LayoutRequestedCount == 0 && this.LayoutRequestedIndices == null) - return (Vector)null; + return null; int layoutRequestedCount = this.LayoutRequestedCount; Vector requestedIndices = this.LayoutRequestedIndices; - Vector indicesToRequest = (Vector)null; + Vector indicesToRequest = null; if (layoutRequestedCount > 0) indicesToRequest = this.GetMissingIndices(layoutRequestedCount); if (requestedIndices != null) @@ -305,9 +305,9 @@ namespace Microsoft.Iris.ViewItems private Vector GetMissingIndices(int howManyMoreCount) { - Vector indicesToRequest = (Vector)null; + Vector indicesToRequest = null; int dataStartIndex = 0; - if (!ListUtility.IsNullOrEmpty((IVector)this._repeatedViewItems)) + if (!ListUtility.IsNullOrEmpty(_repeatedViewItems)) { foreach (Repeater.RepeatedViewItemSet repeatedViewItem in this._repeatedViewItems) { @@ -365,7 +365,7 @@ namespace Microsoft.Iris.ViewItems bool flag = false; ListUtility.GetWrappedIndex(virtualIndex, this._source.Count, out dataIndex, out generationValue); if (!ListUtility.IsValidIndex(this._source, dataIndex)) - dataItemObject = (object)null; + dataItemObject = null; else if (this._source is IVirtualList source && !source.IsItemAvailable(dataIndex)) { if (!this._outstandingDataIndexRequests.Contains(dataIndex)) @@ -373,7 +373,7 @@ namespace Microsoft.Iris.ViewItems this._outstandingDataIndexRequests.Add(dataIndex); source.RequestItem(dataIndex, this.QueryHandler); } - dataItemObject = (object)null; + dataItemObject = null; } else { @@ -399,7 +399,7 @@ namespace Microsoft.Iris.ViewItems flag = !this.HasDataIndexBeenRepeated(dataIndex); } Index index = new Index(virtualIndex, dataIndex, this); - ErrorManager.EnterContext((object)this.UI.TypeSchema); + ErrorManager.EnterContext(UI.TypeSchema); try { ViewItem repeatedItem; @@ -440,11 +440,11 @@ namespace Microsoft.Iris.ViewItems ParameterContext parameterContext = new ParameterContext(Repeater.s_repeatedItemParameters, new object[2] { dataItemObject, - (object) index + index }); - string contentTypeName = (string)null; + string contentTypeName = null; this.GetContentTypeForRepeatedItem(dataItemObject, out contentTypeName); - repeatedItem = (ViewItem)null; + repeatedItem = null; if (!string.IsNullOrEmpty(contentTypeName)) { repeatedItem = this.UI.ConstructNamedContent(contentTypeName, parameterContext); @@ -453,23 +453,23 @@ namespace Microsoft.Iris.ViewItems if (contentTypeName[0] == '#') ErrorManager.ReportError("Repeater unable to create inline content"); else - ErrorManager.ReportError("Repeater failed to find content to repeat. ContentName was '{0}'", (object)contentTypeName); + ErrorManager.ReportError("Repeater failed to find content to repeat. ContentName was '{0}'", contentTypeName); } } else ErrorManager.ReportError("Repeater has no content to repeat"); - dividerItem = (ViewItem)null; + dividerItem = null; if (index.SourceValue != 0 && this._dividerName != null) { dividerItem = this.UI.ConstructNamedContent(this._dividerName, parameterContext); if (dividerItem == null) - ErrorManager.ReportError("Repeater failed to find divider content to repeat (DividerName was '{0}')", (object)this._dividerName); + ErrorManager.ReportError("Repeater failed to find divider content to repeat (DividerName was '{0}')", _dividerName); } if (repeatedItem != null) - repeatedItem.SetLayoutInput((ILayoutInput)new IndexLayoutInput(index, IndexType.Content)); + repeatedItem.SetLayoutInput(new IndexLayoutInput(index, IndexType.Content)); if (dividerItem == null) return; - dividerItem.SetLayoutInput((ILayoutInput)new IndexLayoutInput(index, IndexType.Divider)); + dividerItem.SetLayoutInput(new IndexLayoutInput(index, IndexType.Divider)); } private void RequestRepeatOfIndexUpdate() @@ -498,7 +498,7 @@ namespace Microsoft.Iris.ViewItems private void OnDescendentMouseFocusChange(UIClass sender, InputInfo inputInfo) { MouseFocusInfo mouseFocusInfo = (MouseFocusInfo)inputInfo; - ViewItem childFromDescendant = this.GetDirectChildFromDescendant(mouseFocusInfo.State ? mouseFocusInfo.Target as UIClass : (UIClass)null); + ViewItem childFromDescendant = this.GetDirectChildFromDescendant(mouseFocusInfo.State ? mouseFocusInfo.Target as UIClass : null); if (childFromDescendant == this._lastMouseFocusedItem) return; this.UpdateKeepAliveState(ref this._lastMouseFocusedItem, childFromDescendant, this._lastKeyFocusedItem); @@ -530,7 +530,7 @@ namespace Microsoft.Iris.ViewItems private ViewItem GetDirectChildFromDescendant(UIClass ui) { - ViewItem viewItem = (ViewItem)null; + ViewItem viewItem = null; if (ui != null) { viewItem = ui.RootItem; @@ -549,7 +549,7 @@ namespace Microsoft.Iris.ViewItems if (!viewItem.IsOffscreen) return; Repeater.RepeatedViewItemSet repeatedInstance = this.GetRepeatedInstance(virtualIndex); - DeferredCall.Post(DispatchPriority.Housekeeping, new DeferredHandler(this.DeferredDisposeViewItem), (object)repeatedInstance); + DeferredCall.Post(DispatchPriority.Housekeeping, new DeferredHandler(this.DeferredDisposeViewItem), repeatedInstance); this._repeatedViewItems.Remove(repeatedInstance); viewItem.LayoutComplete -= this._repeatedItemLayoutComplete; int dataIndex = repeatedInstance.DataIndex; @@ -571,13 +571,13 @@ namespace Microsoft.Iris.ViewItems ref UIClass keyFocusDescendant) { if (viewItemSet.Repeated == this._lastKeyFocusedItem) - this._lastKeyFocusedItem = (ViewItem)null; + this._lastKeyFocusedItem = null; if (viewItemSet.Repeated == this._lastMouseFocusedItem) - this._lastMouseFocusedItem = (ViewItem)null; + this._lastMouseFocusedItem = null; viewItemSet.DisposeViewItems(); if (keyFocusDescendant == null || keyFocusDescendant.IsValid) return; - keyFocusDescendant = (UIClass)null; + keyFocusDescendant = null; this.FireNotification(NotificationID.FocusedItemDiscarded); } @@ -641,7 +641,7 @@ namespace Microsoft.Iris.ViewItems private void QueueListContentsChanged(IList senderList, UIListContentsChangedArgs args) { RepeaterListContentsChangedArgs contentsChangedArgs = new RepeaterListContentsChangedArgs(args, this, this._sourceGeneration); - DeferredCall.Post(DispatchPriority.Normal, Repeater.s_listContentsChangedHandler, (object)contentsChangedArgs); + DeferredCall.Post(DispatchPriority.Normal, Repeater.s_listContentsChangedHandler, contentsChangedArgs); } private static void AsyncListContentsChangedHandler(object args) @@ -659,7 +659,7 @@ namespace Microsoft.Iris.ViewItems int newIndex = args.NewIndex; int count = args.Count; int? nullable = new int?(); - IndexLayoutInput indexLayoutInput = (IndexLayoutInput)null; + IndexLayoutInput indexLayoutInput = null; if (this._lastKeyFocusedItem != null) { indexLayoutInput = this._lastKeyFocusedItem.GetLayoutInput(IndexLayoutInput.Data) as IndexLayoutInput; @@ -677,7 +677,7 @@ namespace Microsoft.Iris.ViewItems break; case UIListContentsChangeType.Remove: Vector repeatedInstances1 = this.GetAllRepeatedInstances(oldIndex); - if (!ListUtility.IsNullOrEmpty((IVector)repeatedInstances1)) + if (!ListUtility.IsNullOrEmpty(repeatedInstances1)) { foreach (Repeater.RepeatedViewItemSet viewItemSet in repeatedInstances1) { @@ -707,7 +707,7 @@ namespace Microsoft.Iris.ViewItems break; case UIListContentsChangeType.Modified: Vector repeatedInstances2 = this.GetAllRepeatedInstances(oldIndex); - if (!ListUtility.IsNullOrEmpty((IVector)repeatedInstances2)) + if (!ListUtility.IsNullOrEmpty(repeatedInstances2)) { foreach (Repeater.RepeatedViewItemSet viewItemSet in repeatedInstances2) { @@ -721,8 +721,8 @@ namespace Microsoft.Iris.ViewItems this.RebuildChildren(); break; } - if (nullable.HasValue && nullable.Value != indexLayoutInput.Index.Value && (this.UI.KeyFocus && this.UI.KeyFocusDescendant != null) && this.HasDescendant((Microsoft.Iris.Library.TreeNode)this.UI.KeyFocusDescendant.RootItem)) - NavigationServices.SeedDefaultFocus((INavigationSite)this._lastKeyFocusedItem); + if (nullable.HasValue && nullable.Value != indexLayoutInput.Index.Value && (this.UI.KeyFocus && this.UI.KeyFocusDescendant != null) && this.HasDescendant(UI.KeyFocusDescendant.RootItem)) + NavigationServices.SeedDefaultFocus(_lastKeyFocusedItem); if (!this._maintainFocusScreenLocation || !flag || this._focusNeedsRepairing) return; RectangleF descendantFocusRect = this.GetDescendantFocusRect(); @@ -730,7 +730,7 @@ namespace Microsoft.Iris.ViewItems return; this._focusNeedsRepairing = true; bool keyFocusIsDefault = this.UISession.InputManager.Queue.PendingKeyFocusIsDefault; - DeferredCall.Post(DispatchPriority.LayoutSync, new DeferredHandler(this.PatchUpFocus), (object)new Repeater.FocusRepairArgs(descendantFocusRect, keyFocusIsDefault)); + DeferredCall.Post(DispatchPriority.LayoutSync, new DeferredHandler(this.PatchUpFocus), new Repeater.FocusRepairArgs(descendantFocusRect, keyFocusIsDefault)); this.UI.UISession.InputManager.SuspendInputUntil(DispatchPriority.LayoutSync); } @@ -741,7 +741,7 @@ namespace Microsoft.Iris.ViewItems this._focusNeedsRepairing = false; Repeater.FocusRepairArgs focusRepairArgs = (Repeater.FocusRepairArgs)focusArgs; INavigationSite result; - if (!NavigationServices.FindFromPoint((INavigationSite)this, focusRepairArgs.focusBounds.Center, out result) || result == null || !(result is ViewItem viewItem)) + if (!NavigationServices.FindFromPoint(this, focusRepairArgs.focusBounds.Center, out result) || result == null || !(result is ViewItem viewItem)) return; viewItem.UI.NotifyNavigationDestination(focusRepairArgs.focusIsDefault ? KeyFocusReason.Default : KeyFocusReason.Other); } @@ -789,7 +789,7 @@ namespace Microsoft.Iris.ViewItems private Vector GetAllRepeatedInstances(int dataIndex) { - Vector vector = (Vector)null; + Vector vector = null; foreach (Repeater.RepeatedViewItemSet repeatedViewItem in this._repeatedViewItems) { if (repeatedViewItem.DataIndex == dataIndex) @@ -812,7 +812,7 @@ namespace Microsoft.Iris.ViewItems return repeatedViewItem; } } - return (Repeater.RepeatedViewItemSet)null; + return null; } private int GetIndexOfClosestRepeatedItem(int virtualIndex) @@ -913,7 +913,7 @@ namespace Microsoft.Iris.ViewItems ViewItem viewItem = itemFinal.Repeated; if (itemFinal.Divider != null && lt == Microsoft.Iris.Library.TreeNode.LinkType.Before) viewItem = itemFinal.Divider; - item.Repeated.MoveNode((Microsoft.Iris.Library.TreeNode)viewItem, lt); + item.Repeated.MoveNode(viewItem, lt); if (this.DividerName != null) { ViewItem divider = item.Divider; @@ -925,15 +925,15 @@ namespace Microsoft.Iris.ViewItems return false; divider = repeatedViewItem.Divider; item.Divider = repeatedViewItem.Divider; - repeatedViewItem.Divider = (ViewItem)null; + repeatedViewItem.Divider = null; } if (itemFinal.Divider == null) { repeated = itemFinal.Repeated; itemFinal.Divider = item.Divider; - item.Divider = (ViewItem)null; + item.Divider = null; } - divider?.MoveNode((Microsoft.Iris.Library.TreeNode)repeated, Microsoft.Iris.Library.TreeNode.LinkType.Before); + divider?.MoveNode(repeated, Microsoft.Iris.Library.TreeNode.LinkType.Before); } return true; } @@ -944,7 +944,7 @@ namespace Microsoft.Iris.ViewItems ViewItemID part, out ViewItem resultItem) { - resultItem = (ViewItem)null; + resultItem = null; FindChildResult findChildResult = FindChildResult.Failure; if (part.IDValid && part.StringPartValid && part.StringPart == Repeater.c_childIDSentinel) { @@ -1031,7 +1031,7 @@ namespace Microsoft.Iris.ViewItems internal ViewItem GetRepeatedItemForVirtualIndex(int index) { - ViewItem viewItem = (ViewItem)null; + ViewItem viewItem = null; Repeater.RepeatedViewItemSet repeatedInstance = this.GetRepeatedInstance(index); if (repeatedInstance != null) viewItem = repeatedInstance.Repeated; @@ -1047,7 +1047,7 @@ namespace Microsoft.Iris.ViewItems { Repeater.RepeatedViewItemSet repeatedViewItem = this._repeatedViewItems[index]; } - if (!Microsoft.Iris.Debug.Trace.IsCategoryEnabled(TraceCategory.Repeating, (byte)((uint)level + 1U))) + if (!Microsoft.Iris.Debug.Trace.IsCategoryEnabled(TraceCategory.Repeating, (byte)(level + 1U))) return; foreach (ViewItem child in this.Children) ; @@ -1135,10 +1135,10 @@ namespace Microsoft.Iris.ViewItems public string ToString(string dataName) { - string str = (string)null; + string str = null; if (this._dividerItem != null) - str = InvariantString.Format(", Divider({0})", (object)this._dividerItem.GetType().Name); - return InvariantString.Format("[{0},{1}] {2} ({3} {4})", (object)this.VirtualIndex, (object)this.DataIndex, (object)dataName, (object)this._repeatedItem.GetType().Name, (object)str); + str = InvariantString.Format(", Divider({0})", _dividerItem.GetType().Name); + return InvariantString.Format("[{0},{1}] {2} ({3} {4})", VirtualIndex, DataIndex, dataName, _repeatedItem.GetType().Name, str); } } @@ -1174,10 +1174,10 @@ namespace Microsoft.Iris.ViewItems private void CallFaultInHandler() { - ViewItem childItem = (ViewItem)null; + ViewItem childItem = null; if (!this._repeater.IsDisposed) childItem = this._repeater.GetRepeatedItemForVirtualIndex(this._virtualIndex); - this._faultInHandler((ViewItem)this._repeater, childItem); + this._faultInHandler(_repeater, childItem); } } diff --git a/UIX/Microsoft/Iris/ViewItems/RepeaterContentSelector.cs b/UIX/Microsoft/Iris/ViewItems/RepeaterContentSelector.cs index 5074914..f11e586 100644 --- a/UIX/Microsoft/Iris/ViewItems/RepeaterContentSelector.cs +++ b/UIX/Microsoft/Iris/ViewItems/RepeaterContentSelector.cs @@ -16,7 +16,7 @@ namespace Microsoft.Iris.ViewItems public RepeaterContentSelector(Repeater ownerRepeater) { this._ownerRepeater = ownerRepeater; - this._selectorsList = (IList)new ArrayList(); + this._selectorsList = new ArrayList(); } public IList Selectors => this._selectorsList; @@ -27,7 +27,7 @@ namespace Microsoft.Iris.ViewItems { if (itemObject == null) return; - foreach (TypeSelector selectors in (IEnumerable)this._selectorsList) + foreach (TypeSelector selectors in _selectorsList) { if (selectors.IsMatch(itemObject, this._ownerRepeater)) { diff --git a/UIX/Microsoft/Iris/ViewItems/RootViewItem.cs b/UIX/Microsoft/Iris/ViewItems/RootViewItem.cs index c7ab370..6452ad1 100644 --- a/UIX/Microsoft/Iris/ViewItems/RootViewItem.cs +++ b/UIX/Microsoft/Iris/ViewItems/RootViewItem.cs @@ -17,7 +17,7 @@ namespace Microsoft.Iris.ViewItems public RootViewItem(UIZone zone, UIClass rootUI, Form form) { - this.DeclareOwner((object)rootUI); + this.DeclareOwner(rootUI); this.PropagateZone(zone); IVisualContainer rootVisual = form.RootVisual; rootVisual.MouseOptions = MouseOptions.Traversable; @@ -27,8 +27,8 @@ namespace Microsoft.Iris.ViewItems internal void ApplyRootLayoutOutput(bool parentFullyVisibleFlag, out bool visibilityChangeFlag) { Rectangle layoutBounds = this.LayoutBounds; - this.VisualPosition = new Vector3((float)layoutBounds.Left, (float)layoutBounds.Top, 0.0f); - this.VisualSize = new Vector2((float)layoutBounds.Width, (float)layoutBounds.Height); + this.VisualPosition = new Vector3(layoutBounds.Left, layoutBounds.Top, 0.0f); + this.VisualSize = new Vector2(layoutBounds.Width, layoutBounds.Height); this.VisualScale = this.LayoutScale; if (this.LayoutVisible) parentFullyVisibleFlag = false; diff --git a/UIX/Microsoft/Iris/ViewItems/Scroller.cs b/UIX/Microsoft/Iris/ViewItems/Scroller.cs index 8cac721..98d5be0 100644 --- a/UIX/Microsoft/Iris/ViewItems/Scroller.cs +++ b/UIX/Microsoft/Iris/ViewItems/Scroller.cs @@ -18,13 +18,13 @@ namespace Microsoft.Iris.ViewItems public Scroller() { - this.Layout = (ILayout)new ScrollingLayout(this.Orientation, 50); + this.Layout = new ScrollingLayout(this.Orientation, 50); this.ScrollModel = new ScrollModel(); } protected override void OnDispose() { - this.ScrollModel = (ScrollModel)null; + this.ScrollModel = null; base.OnDispose(); } @@ -43,11 +43,11 @@ namespace Microsoft.Iris.ViewItems if (this._model == value) return; if (this._model != null) - this._model.DetachFromViewItem((ViewItem)this); + this._model.DetachFromViewItem(this); this._model = value; if (this._model != null) { - this._model.AttachToViewItem((ViewItem)this); + this._model.AttachToViewItem(this); this._model.ScrollOrientation = this.Orientation; } this.FireNotification(NotificationID.ScrollModel); diff --git a/UIX/Microsoft/Iris/ViewItems/Text.cs b/UIX/Microsoft/Iris/ViewItems/Text.cs index 46defdf..ef53352 100644 --- a/UIX/Microsoft/Iris/ViewItems/Text.cs +++ b/UIX/Microsoft/Iris/ViewItems/Text.cs @@ -74,7 +74,7 @@ namespace Microsoft.Iris.ViewItems public Text() { - this.Layout = (ILayout)this; + this.Layout = this; this._font = Microsoft.Iris.ViewItems.Text.s_defaultFont; this._textColor = Color.Black; this._textHighlightColor = Color.White; @@ -113,8 +113,8 @@ namespace Microsoft.Iris.ViewItems { if (this._flow == null) return; - this._flow.Dispose((object)this); - this._flow = (TextFlow)null; + this._flow.Dispose(this); + this._flow = null; } public static void Initialize() @@ -126,17 +126,17 @@ namespace Microsoft.Iris.ViewItems if (Microsoft.Iris.ViewItems.Text.s_sharedOversampledRasterizer != null) { Microsoft.Iris.ViewItems.Text.s_sharedOversampledRasterizer.Dispose(); - Microsoft.Iris.ViewItems.Text.s_sharedOversampledRasterizer = (RichText)null; + Microsoft.Iris.ViewItems.Text.s_sharedOversampledRasterizer = null; } if (Microsoft.Iris.ViewItems.Text.s_sharedNonOversampledRasterizer != null) { Microsoft.Iris.ViewItems.Text.s_sharedNonOversampledRasterizer.Dispose(); - Microsoft.Iris.ViewItems.Text.s_sharedNonOversampledRasterizer = (RichText)null; + Microsoft.Iris.ViewItems.Text.s_sharedNonOversampledRasterizer = null; } if (Microsoft.Iris.ViewItems.Text.s_sharedSimpleTextRasterizer == null) return; Microsoft.Iris.ViewItems.Text.s_sharedSimpleTextRasterizer.Dispose(); - Microsoft.Iris.ViewItems.Text.s_sharedSimpleTextRasterizer = (SimpleText)null; + Microsoft.Iris.ViewItems.Text.s_sharedSimpleTextRasterizer = null; } private static SimpleText SharedSimpleTextRasterizer @@ -193,8 +193,8 @@ namespace Microsoft.Iris.ViewItems } else this._content = value; - this._parsedContent = (string)null; - this._parsedContentMarkedRanges = (ArrayList)null; + this._parsedContent = null; + this._parsedContentMarkedRanges = null; this.OnDisplayedContentChange(); this.FireNotification(NotificationID.Content); } @@ -345,7 +345,7 @@ namespace Microsoft.Iris.ViewItems get => this._passwordChar; set { - if ((int)this._passwordChar == (int)value) + if (_passwordChar == value) return; this._passwordChar = value; if (this.UsePasswordMask) @@ -390,7 +390,7 @@ namespace Microsoft.Iris.ViewItems get => !this.GetBit(Microsoft.Iris.ViewItems.Text.Bits.LineSpacingSet) ? 0.0f : this._lineSpacing; set { - if ((double)this.LineSpacing == (double)value) + if (LineSpacing == (double)value) return; this._lineSpacing = value; this.SetBit(Microsoft.Iris.ViewItems.Text.Bits.LineSpacingSet); @@ -405,7 +405,7 @@ namespace Microsoft.Iris.ViewItems get => !this.GetBit(Microsoft.Iris.ViewItems.Text.Bits.CharacterSpacingSet) ? 0.0f : this._characterSpacing; set { - if ((double)this.CharacterSpacing == (double)value) + if (CharacterSpacing == (double)value) return; this._characterSpacing = value; this.SetBit(Microsoft.Iris.ViewItems.Text.Bits.CharacterSpacingSet); @@ -435,7 +435,7 @@ namespace Microsoft.Iris.ViewItems get => this._fadeSize; set { - if ((double)this._fadeSize == (double)value) + if (_fadeSize == (double)value) return; this._fadeSize = value; this.InvalidateGradients(); @@ -473,7 +473,7 @@ namespace Microsoft.Iris.ViewItems } } - public IList Fragments => (IList)this._fragments; + public IList Fragments => _fragments; public bool DisableIme { @@ -675,8 +675,8 @@ namespace Microsoft.Iris.ViewItems this.TextFitsHeight = !flag2; if (!this.TextFitsHeight && this._flow.HasVisibleRuns) { - this._lastLineExtentLeft = (float)this._flow.FirstFitRunOnFinalLine.LayoutBounds.Left; - this._lastLineExtentRight = (float)this._flow.LastFitRun.LayoutBounds.Right; + this._lastLineExtentLeft = _flow.FirstFitRunOnFinalLine.LayoutBounds.Left; + this._lastLineExtentRight = _flow.LastFitRun.LayoutBounds.Right; } else this._lastLineExtentLeft = this._lastLineExtentRight = 0.0f; @@ -772,15 +772,15 @@ namespace Microsoft.Iris.ViewItems Size constraint = new Size(boundingWidth, boundingHeight); this.DisposeFlow(); this._flow = Microsoft.Iris.ViewItems.Text.SharedSimpleTextRasterizer.Measure(this._content, alignment, effectiveTextStyle, constraint); - this._flow.DeclareOwner((object)this); + this._flow.DeclareOwner(this); } private void DoRichEditMeasure(int boundingWidth, int boundingHeight, LineAlignment alignment) { TextMeasureParams measureParams = new TextMeasureParams(); measureParams.Initialize(); - float width = Math.Min((float)boundingWidth, 4095f); - float height = Math.Min((float)boundingHeight, 8191f); + float width = Math.Min(boundingWidth, 4095f); + float height = Math.Min(boundingHeight, 8191f); measureParams.SetConstraint(new SizeF(width, height)); TextStyle effectiveTextStyle = this.GetEffectiveTextStyle(); string empty = string.Empty; @@ -817,7 +817,7 @@ namespace Microsoft.Iris.ViewItems this.DisposeFlow(); this._flow = this._richTextRasterizer.Measure(content, ref measureParams); measureParams.Dispose(); - this._flow.DeclareOwner((object)this); + this._flow.DeclareOwner(this); this.UpdateFragmentsAfterLayout = true; } @@ -827,7 +827,7 @@ namespace Microsoft.Iris.ViewItems { if (!this.GetBit(Microsoft.Iris.ViewItems.Text.Bits.FastMeasureValid)) { - bool flag = this.UsingSharedRasterizer && !this.WordWrap && (this._namedStyles == null && (double)this._scale == 1.0) && (this.TextSharpness == TextSharpness.Sharp && !this.UsePasswordMask) && !this.Zone.Session.IsRtl; + bool flag = this.UsingSharedRasterizer && !this.WordWrap && (this._namedStyles == null && _scale == 1.0) && (this.TextSharpness == TextSharpness.Sharp && !this.UsePasswordMask) && !this.Zone.Session.IsRtl; if (flag) flag = Microsoft.Iris.ViewItems.Text.SharedSimpleTextRasterizer.CanMeasure(this.Content, this.GetEffectiveTextStyle()); this.SetBit(Microsoft.Iris.ViewItems.Text.Bits.FastMeasurePossible, flag); @@ -843,7 +843,7 @@ namespace Microsoft.Iris.ViewItems Font font = this._font ?? Microsoft.Iris.ViewItems.Text.s_defaultFont; textStyle.FontFace = font.FontName; textStyle.FontSize = font.FontSize; - if ((double)font.AltFontSize != (double)font.FontSize) + if (font.AltFontSize != (double)font.FontSize) textStyle.AltFontSize = font.AltFontSize; if ((font.FontStyle & FontStyles.Bold) != FontStyles.None) textStyle.Bold = true; @@ -865,14 +865,14 @@ namespace Microsoft.Iris.ViewItems protected override void OnLayoutComplete(ViewItem sender) { - ArrayList arrayList = (ArrayList)null; + ArrayList arrayList = null; if (this.UpdateFragmentsAfterLayout) { if (this._namedStyles != null) arrayList = this.AnnotateFragments(); bool flag = false; if (this._fragments != null || arrayList != null) - flag = this.TextLayoutInvalid || !Microsoft.Iris.ViewItems.Text.AreFragmentListsEquivalent((IList)this._fragments, (IList)arrayList); + flag = this.TextLayoutInvalid || !Microsoft.Iris.ViewItems.Text.AreFragmentListsEquivalent(_fragments, arrayList); if (flag) { this.UnregisterFragmentUsage(); @@ -920,7 +920,7 @@ namespace Microsoft.Iris.ViewItems measureParams.AllocateFormattedRanges(this._parsedContentMarkedRanges.Count, this._namedStyles.Count); TextStyle[] array = new TextStyle[this._namedStyles.Count]; int index1 = 0; - foreach (TextStyle style in (IEnumerable)this._namedStyles.Values) + foreach (TextStyle style in _namedStyles.Values) { measureParams.SetFormattedRangeStyle(index1, style); array[index1] = style; @@ -930,9 +930,9 @@ namespace Microsoft.Iris.ViewItems for (int index2 = 0; index2 < this._parsedContentMarkedRanges.Count; ++index2) { Microsoft.Iris.ViewItems.Text.MarkedRange contentMarkedRange = (Microsoft.Iris.ViewItems.Text.MarkedRange)this._parsedContentMarkedRanges[index2]; - if (this._namedStyles.Contains((object)contentMarkedRange.tagName)) + if (this._namedStyles.Contains(contentMarkedRange.tagName)) { - TextStyle namedStyle = this._namedStyles[(object)contentMarkedRange.tagName] as TextStyle; + TextStyle namedStyle = this._namedStyles[contentMarkedRange.tagName] as TextStyle; contentMarkedRange.cachedStyle = namedStyle; if (namedStyle != null) { @@ -943,14 +943,14 @@ namespace Microsoft.Iris.ViewItems } } else - contentMarkedRange.cachedStyle = (TextStyle)null; + contentMarkedRange.cachedStyle = null; } } } private ArrayList AnnotateFragments() { - ArrayList arrayList = (ArrayList)null; + ArrayList arrayList = null; if (this._parsedContentMarkedRanges != null && this._flow != null) { for (int firstVisibleIndex = this._flow.FirstVisibleIndex; firstVisibleIndex <= this._flow.LastVisibleIndex; ++firstVisibleIndex) @@ -959,7 +959,7 @@ namespace Microsoft.Iris.ViewItems textRun.IsFragment = false; if (textRun.RunColor.A != byte.MaxValue) { - Microsoft.Iris.ViewItems.Text.MarkedRange markedRange = (Microsoft.Iris.ViewItems.Text.MarkedRange)null; + Microsoft.Iris.ViewItems.Text.MarkedRange markedRange = null; for (int index = 0; index < this._parsedContentMarkedRanges.Count; ++index) { Microsoft.Iris.ViewItems.Text.MarkedRange contentMarkedRange = (Microsoft.Iris.ViewItems.Text.MarkedRange)this._parsedContentMarkedRanges[index]; @@ -975,12 +975,12 @@ namespace Microsoft.Iris.ViewItems textRun.IsFragment = true; if (markedRange.fragment == null) { - markedRange.fragment = new TextFragment(markedRange.tagName, (IDictionary)markedRange.attributes, this); + markedRange.fragment = new TextFragment(markedRange.tagName, markedRange.attributes, this); if (arrayList == null) arrayList = new ArrayList(); - arrayList.Add((object)markedRange.fragment); + arrayList.Add(markedRange.fragment); } - markedRange.fragment.InternalRuns.Add((object)new TextRunData(textRun, this.IsOnLastLine(textRun), this, this._lineAlignmentOffset)); + markedRange.fragment.InternalRuns.Add(new TextRunData(textRun, this.IsOnLastLine(textRun), this, this._lineAlignmentOffset)); } } } @@ -996,8 +996,8 @@ namespace Microsoft.Iris.ViewItems { if (fragment.Runs != null) { - foreach (TextRunData run in (IEnumerable)fragment.Runs) - run.Run.RegisterUsage((object)this); + foreach (TextRunData run in fragment.Runs) + run.Run.RegisterUsage(this); } } } @@ -1010,11 +1010,11 @@ namespace Microsoft.Iris.ViewItems { if (fragment.Runs != null) { - foreach (TextRunData run in (IEnumerable)fragment.Runs) - run.Run.UnregisterUsage((object)this); + foreach (TextRunData run in fragment.Runs) + run.Run.UnregisterUsage(this); } } - this._fragments = (ArrayList)null; + this._fragments = null; } private void ResetMarkedRanges() @@ -1022,7 +1022,7 @@ namespace Microsoft.Iris.ViewItems if (this._parsedContentMarkedRanges == null) return; for (int index = 0; index < this._parsedContentMarkedRanges.Count; ++index) - ((Microsoft.Iris.ViewItems.Text.MarkedRange)this._parsedContentMarkedRanges[index]).fragment = (TextFragment)null; + ((Microsoft.Iris.ViewItems.Text.MarkedRange)this._parsedContentMarkedRanges[index]).fragment = null; } private static string ParseMarkedUpText(string content, ArrayList markedRanges) @@ -1034,7 +1034,7 @@ namespace Microsoft.Iris.ViewItems { using (NativeXmlReader nativeXmlReader = new NativeXmlReader(content, true)) { - Microsoft.Iris.ViewItems.Text.MarkedRange markedRange1 = (Microsoft.Iris.ViewItems.Text.MarkedRange)null; + Microsoft.Iris.ViewItems.Text.MarkedRange markedRange1 = null; NativeXmlNodeType nodeType; while (nativeXmlReader.Read(out nodeType)) { @@ -1049,15 +1049,15 @@ namespace Microsoft.Iris.ViewItems markedRange2.firstCharacter = stringBuilder.Length; markedRange2.lastCharacter = int.MaxValue; markedRange2.rangeID = ++num; - arrayList.Add((object)markedRange2); - markedRanges.Add((object)markedRange2); + arrayList.Add(markedRange2); + markedRanges.Add(markedRange2); markedRange2.parentRange = markedRange1; markedRange1 = markedRange2; while (nativeXmlReader.ReadAttribute()) { if (markedRange1.attributes == null) markedRange1.attributes = new Dictionary(); - markedRange1.attributes[(object)nativeXmlReader.Name] = (object)nativeXmlReader.Value; + markedRange1.attributes[nativeXmlReader.Name] = nativeXmlReader.Value; } continue; } @@ -1095,7 +1095,7 @@ namespace Microsoft.Iris.ViewItems catch (NativeXmlException ex) { markedRanges.Clear(); - stringBuilder = (StringBuilder)null; + stringBuilder = null; } if (stringBuilder == null) return content; @@ -1110,7 +1110,7 @@ namespace Microsoft.Iris.ViewItems if (this.TextFitsWidth && this.TextFitsHeight) flag1 = false; float fadeSize = this.FadeSize; - if (!flag1 || (double)fadeSize <= 0.0) + if (!flag1 || fadeSize <= 0.0) return; if (!this.WordWrap) { @@ -1133,17 +1133,17 @@ namespace Microsoft.Iris.ViewItems else flPosition = fadeSize; } - IGradient gradient = this.UISession.RenderSession.CreateGradient((object)this); + IGradient gradient = this.UISession.RenderSession.CreateGradient(this); gradient.Orientation = Orientation.Horizontal; - if ((double)flPosition > 0.0) + if (flPosition > 0.0) { gradient.AddValue(-1f, 0.0f, RelativeSpace.Min); gradient.AddValue(flPosition, 1f, RelativeSpace.Min); } - if ((double)num > 0.0) + if (num > 0.0) { - gradient.AddValue((float)this._slotSize.Width - num, 1f, RelativeSpace.Min); - gradient.AddValue((float)(this._slotSize.Width + 1), 0.0f, RelativeSpace.Min); + gradient.AddValue(_slotSize.Width - num, 1f, RelativeSpace.Min); + gradient.AddValue(this._slotSize.Width + 1, 0.0f, RelativeSpace.Min); } gradientClipLeftRight = gradient; } @@ -1157,7 +1157,7 @@ namespace Microsoft.Iris.ViewItems { if (this._flow.LastFitRun != null) { - flPosition2 = (float)this._flow.LastFitRun.LayoutBounds.Width; + flPosition2 = _flow.LastFitRun.LayoutBounds.Width; flPosition1 = flPosition2 - fadeSize; } } @@ -1166,8 +1166,8 @@ namespace Microsoft.Iris.ViewItems flPosition2 = 0.0f; flPosition1 = flPosition2 + fadeSize; } - IGradient gradient = this.UISession.RenderSession.CreateGradient((object)this); - gradient.ColorMask = new ColorF((int)byte.MaxValue, 0, 0, 0); + IGradient gradient = this.UISession.RenderSession.CreateGradient(this); + gradient.ColorMask = new ColorF(byte.MaxValue, 0, 0, 0); gradient.Orientation = Orientation.Horizontal; gradient.AddValue(flPosition1, 1f, RelativeSpace.Min); gradient.AddValue(flPosition2, 0.0f, RelativeSpace.Min); @@ -1182,14 +1182,14 @@ namespace Microsoft.Iris.ViewItems private void ResetCachedScaleState() { this.IgnoreEffectiveScaleChanges = false; - this._recentScaleChanges = (Vector)null; + this._recentScaleChanges = null; } private void CreateVisuals(IVisualContainer topVisual, IRenderSession renderSession) { VisualOrder nOrder = VisualOrder.First; - IGradient gradientClipLeftRight = (IGradient)null; - IGradient gradientMultiLine = (IGradient)null; + IGradient gradientClipLeftRight = null; + IGradient gradientMultiLine = null; this.CreateFadeGradientsHelper(ref gradientClipLeftRight, ref gradientMultiLine); TextRun textRun = this.UISession.IsRtl ? this._flow.FirstFitRunOnFinalLine : this._flow.LastFitRun; for (int firstVisibleIndex = this._flow.FirstVisibleIndex; firstVisibleIndex <= this._flow.LastVisibleIndex; ++firstVisibleIndex) @@ -1201,28 +1201,28 @@ namespace Microsoft.Iris.ViewItems IImage imageForRun = Microsoft.Iris.ViewItems.Text.GetImageForRun(this.UISession, run, effectiveColor); if (imageForRun != null) { - float x = run.RenderBounds.Left + (float)this._lineAlignmentOffset; + float x = run.RenderBounds.Left + _lineAlignmentOffset; if (run.Highlighted) { RectangleF lineBound = (RectangleF)this._flow.LineBounds[run.Line - 1]; - ISprite sprite = renderSession.CreateSprite((object)this, (object)this); - sprite.Effect = EffectManager.CreateColorFillEffect((object)this, this._backHighlightColor); - sprite.Effect.UnregisterUsage((object)this); + ISprite sprite = renderSession.CreateSprite(this, this); + sprite.Effect = EffectManager.CreateColorFillEffect(this, this._backHighlightColor); + sprite.Effect.UnregisterUsage(this); sprite.Position = new Vector3(x, lineBound.Top, 0.0f); sprite.Size = new Vector2(run.RenderBounds.Width, lineBound.Height); - topVisual.AddChild((IVisual)sprite, (IVisual)null, nOrder); - sprite.UnregisterUsage((object)this); + topVisual.AddChild(sprite, null, nOrder); + sprite.UnregisterUsage(this); run.HighlightSprite = sprite; } - ISprite sprite1 = renderSession.CreateSprite((object)this, (object)this); - sprite1.Effect = EffectClass.CreateImageRenderEffectWithFallback(this.Effect, (object)this, imageForRun); - sprite1.Effect.UnregisterUsage((object)this); + ISprite sprite1 = renderSession.CreateSprite(this, this); + sprite1.Effect = EffectClass.CreateImageRenderEffectWithFallback(this.Effect, this, imageForRun); + sprite1.Effect.UnregisterUsage(this); sprite1.Position = new Vector3(x, run.RenderBounds.Top, 0.0f); sprite1.Size = new Vector2(run.RenderBounds.Width, run.RenderBounds.Height); if (gradientMultiLine != null && run == textRun) sprite1.AddGradient(gradientMultiLine); - topVisual.AddChild((IVisual)sprite1, (IVisual)null, nOrder); - sprite1.UnregisterUsage((object)this); + topVisual.AddChild(sprite1, null, nOrder); + sprite1.UnregisterUsage(this); run.TextSprite = sprite1; } } @@ -1230,8 +1230,8 @@ namespace Microsoft.Iris.ViewItems topVisual.RemoveAllGradients(); if (gradientClipLeftRight != null) topVisual.AddGradient(gradientClipLeftRight); - gradientClipLeftRight?.UnregisterUsage((object)this); - gradientMultiLine?.UnregisterUsage((object)this); + gradientClipLeftRight?.UnregisterUsage(this); + gradientMultiLine?.UnregisterUsage(this); } private Color GetEffectiveColor(TextRun run) @@ -1258,7 +1258,7 @@ namespace Microsoft.Iris.ViewItems { if (removeFromTree) this.VisualContainer.RemoveAllChildren(); - this.Effect?.DoneWithRenderEffects((object)this); + this.Effect?.DoneWithRenderEffects(this); if (this._flow == null) return; this._flow.ClearSprites(); @@ -1320,7 +1320,7 @@ namespace Microsoft.Iris.ViewItems this.MarkScaleDirty(); } - private bool ScaleDifferenceIsGreaterThanThreshold(float oldScale, float newScale) => (double)Math.Abs(oldScale - newScale) > 0.00999999977648258; + private bool ScaleDifferenceIsGreaterThanThreshold(float oldScale, float newScale) => Math.Abs(oldScale - newScale) > 0.00999999977648258; private void MarkTextLayoutInvalid() { @@ -1334,16 +1334,16 @@ namespace Microsoft.Iris.ViewItems internal static IImage GetImageForRun(UISession session, TextRun run, Color textColor) { if (string.IsNullOrEmpty(run.Content)) - return (IImage)null; + return null; string str = "aa"; bool flag = false; RichTextInfoKey richTextInfoKey = new RichTextInfoKey(run, str, flag, textColor); - ImageCache instance = (ImageCache)TextImageCache.Instance; - ImageCacheItem imageCacheItem = instance.Lookup((ImageCacheKey)richTextInfoKey); + ImageCache instance = TextImageCache.Instance; + ImageCacheItem imageCacheItem = instance.Lookup(richTextInfoKey); if (imageCacheItem == null) { - imageCacheItem = (ImageCacheItem)new TextImageItem(session.RenderSession, run, str, flag, textColor); - instance.Add((ImageCacheKey)richTextInfoKey, imageCacheItem); + imageCacheItem = new TextImageItem(session.RenderSession, run, str, flag, textColor); + instance.Add(richTextInfoKey, imageCacheItem); } return imageCacheItem.RenderImage; } @@ -1409,7 +1409,7 @@ namespace Microsoft.Iris.ViewItems set => this.SetBit(Microsoft.Iris.ViewItems.Text.Bits.IgnoreEffectiveScaleChanges, value); } - private bool GetBit(Microsoft.Iris.ViewItems.Text.Bits lookupBit) => ((Microsoft.Iris.ViewItems.Text.Bits)this._bits & lookupBit) != (Microsoft.Iris.ViewItems.Text.Bits)0; + private bool GetBit(Microsoft.Iris.ViewItems.Text.Bits lookupBit) => ((Microsoft.Iris.ViewItems.Text.Bits)this._bits & lookupBit) != 0; private void SetBit(Microsoft.Iris.ViewItems.Text.Bits changeBit, bool value) => this._bits = value ? (uint)((Microsoft.Iris.ViewItems.Text.Bits)this._bits | changeBit) : (uint)((Microsoft.Iris.ViewItems.Text.Bits)this._bits & ~changeBit); diff --git a/UIX/Microsoft/Iris/ViewItems/TextFlowRenderingHelper.cs b/UIX/Microsoft/Iris/ViewItems/TextFlowRenderingHelper.cs index a59b60f..745eaa8 100644 --- a/UIX/Microsoft/Iris/ViewItems/TextFlowRenderingHelper.cs +++ b/UIX/Microsoft/Iris/ViewItems/TextFlowRenderingHelper.cs @@ -35,13 +35,13 @@ namespace Microsoft.Iris.ViewItems visContainer.RemoveAllGradients(); if (this._gradientMultiLine != null) { - this._gradientMultiLine.UnregisterUsage((object)this); - this._gradientMultiLine = (IGradient)null; + this._gradientMultiLine.UnregisterUsage(this); + this._gradientMultiLine = null; } if (this._gradientClipLeftRight == null) return; - this._gradientClipLeftRight.UnregisterUsage((object)this); - this._gradientClipLeftRight = (IGradient)null; + this._gradientClipLeftRight.UnregisterUsage(this); + this._gradientClipLeftRight = null; } } } diff --git a/UIX/Microsoft/Iris/ViewItems/TextFragment.cs b/UIX/Microsoft/Iris/ViewItems/TextFragment.cs index 745c06f..a47b7a6 100644 --- a/UIX/Microsoft/Iris/ViewItems/TextFragment.cs +++ b/UIX/Microsoft/Iris/ViewItems/TextFragment.cs @@ -22,7 +22,7 @@ namespace Microsoft.Iris.ViewItems this._textViewItem = textViewItem; } - public IList Runs => (IList)this._runs; + public IList Runs => _runs; public string TagName => this._tagName; @@ -30,7 +30,7 @@ namespace Microsoft.Iris.ViewItems { get { - string str = (string)null; + string str = null; if (this._runs != null) { foreach (TextRunData run in this._runs) diff --git a/UIX/Microsoft/Iris/ViewItems/TextRunData.cs b/UIX/Microsoft/Iris/ViewItems/TextRunData.cs index e389aa3..24b241a 100644 --- a/UIX/Microsoft/Iris/ViewItems/TextRunData.cs +++ b/UIX/Microsoft/Iris/ViewItems/TextRunData.cs @@ -54,7 +54,7 @@ namespace Microsoft.Iris.ViewItems this.PaintInvalid(); } - public override string ToString() => string.Format("[ Text = {0}, Position = {1}, Size = {2} ]", (object)this._textRun.Content, (object)this._position, (object)this._size); + public override string ToString() => string.Format("[ Text = {0}, Position = {1}, Size = {2} ]", _textRun.Content, _position, _size); public event PaintInvalidEventHandler PaintInvalid; } diff --git a/UIX/Microsoft/Iris/ViewItems/TextRunRenderer.cs b/UIX/Microsoft/Iris/ViewItems/TextRunRenderer.cs index f675e57..f5b8a5f 100644 --- a/UIX/Microsoft/Iris/ViewItems/TextRunRenderer.cs +++ b/UIX/Microsoft/Iris/ViewItems/TextRunRenderer.cs @@ -22,14 +22,14 @@ namespace Microsoft.Iris.ViewItems public TextRunRenderer() { - this.Layout = (ILayout)this; + this.Layout = this; this._renderingHelper = new TextFlowRenderingHelper(); this._paintHandler = new PaintInvalidEventHandler(this.OnRunPaintInvalid); } protected override void OnDispose() { - this.Data = (TextRunData)null; + this.Data = null; base.OnDispose(); } @@ -43,13 +43,13 @@ namespace Microsoft.Iris.ViewItems if (this._data != null) { this._data.PaintInvalid -= this._paintHandler; - this._data.Run.UnregisterUsage((object)this); + this._data.Run.UnregisterUsage(this); } this._data = value; if (this._data != null) { this._data.PaintInvalid += this._paintHandler; - this._data.Run.RegisterUsage((object)this); + this._data.Run.RegisterUsage(this); } this.FireNotification(NotificationID.Data); } @@ -84,7 +84,7 @@ namespace Microsoft.Iris.ViewItems { if (this._contents == null) return; - this._contents.Effect = (IEffect)null; + this._contents.Effect = null; } protected override void OnPaint(bool visible) @@ -96,11 +96,11 @@ namespace Microsoft.Iris.ViewItems Text textViewItem = this._data.TextViewItem; if (!run.Visible) return; - IImage imageForRun = Text.GetImageForRun(this.UISession, this._data.Run, this._color.A != (byte)0 ? this._color : this._data.Color); + IImage imageForRun = Text.GetImageForRun(this.UISession, this._data.Run, this._color.A != 0 ? this._color : this._data.Color); if (this._contents.Effect == null) { - this._contents.Effect = EffectClass.CreateImageRenderEffectWithFallback(this.Effect, (object)this, (IImage)null); - this._contents.Effect.UnregisterUsage((object)this); + this._contents.Effect = EffectClass.CreateImageRenderEffectWithFallback(this.Effect, this, null); + this._contents.Effect.UnregisterUsage(this); } EffectClass.SetDefaultEffectProperty(this.Effect, this._contents.Effect, imageForRun); this._contents.RelativeSize = true; diff --git a/UIX/Microsoft/Iris/ViewItems/UIPropertyRecord.cs b/UIX/Microsoft/Iris/ViewItems/UIPropertyRecord.cs index c09d192..c93f3eb 100644 --- a/UIX/Microsoft/Iris/ViewItems/UIPropertyRecord.cs +++ b/UIX/Microsoft/Iris/ViewItems/UIPropertyRecord.cs @@ -29,7 +29,7 @@ namespace Microsoft.Iris.ViewItems if (uiPropertyRecord.Name == name) return uiPropertyRecord; } - return (UIPropertyRecord)null; + return null; } public static bool IsInList(Vector list, string name) => UIPropertyRecord.FindInList(list, name) != null; diff --git a/UIX/Microsoft/Iris/ViewItems/Video.cs b/UIX/Microsoft/Iris/ViewItems/Video.cs index fca4d80..0598f49 100644 --- a/UIX/Microsoft/Iris/ViewItems/Video.cs +++ b/UIX/Microsoft/Iris/ViewItems/Video.cs @@ -31,8 +31,8 @@ namespace Microsoft.Iris.ViewItems protected override void OnDispose() { if (this._videoStream != null) - this._videoStream.RevokePortal((IUIVideoPortal)this); - this._videoStream = (IUIVideoStream)null; + this._videoStream.RevokePortal(this); + this._videoStream = null; ((ITrackableUIElementEvents)this).UIChange -= new EventHandler(this.OnUIChange); base.OnDispose(); } @@ -46,10 +46,10 @@ namespace Microsoft.Iris.ViewItems return; this.ForceContentChange(); if (this._videoStream != null) - this._videoStream.RevokePortal((IUIVideoPortal)this); + this._videoStream.RevokePortal(this); this._videoStream = value; if (this._videoStream != null) - this._videoStream.RegisterPortal((IUIVideoPortal)this); + this._videoStream.RegisterPortal(this); this.FireNotification(NotificationID.VideoStream); } } @@ -76,13 +76,13 @@ namespace Microsoft.Iris.ViewItems if (!UISession.Default.RenderSession.GraphicsDevice.IsVideoComposited) return; IRenderSession renderSession = UISession.Default.RenderSession; - VideoElement videoElement = new VideoElement("VideoElement", (IVideoStream)null); - IEffectTemplate effectTemplate = renderSession.CreateEffectTemplate((object)this, nameof(Video)); - effectTemplate.Build((EffectInput)videoElement); - IEffect instance = effectTemplate.CreateInstance((object)this); + VideoElement videoElement = new VideoElement("VideoElement", null); + IEffectTemplate effectTemplate = renderSession.CreateEffectTemplate(this, nameof(Video)); + effectTemplate.Build(videoElement); + IEffect instance = effectTemplate.CreateInstance(this); this._contents.Effect = instance; - instance.UnregisterUsage((object)this); - effectTemplate.UnregisterUsage((object)this); + instance.UnregisterUsage(this); + effectTemplate.UnregisterUsage(this); this._contents.Effect.SetProperty("VideoElement.Video", (this._videoStream as Microsoft.Iris.VideoStream).RenderStream); this.CreateBorderSprites(renderSession); } @@ -96,9 +96,9 @@ namespace Microsoft.Iris.ViewItems { if (removeFromTree) letterBoxSprite.Remove(); - letterBoxSprite.UnregisterUsage((object)this); + letterBoxSprite.UnregisterUsage(this); } - this._letterBoxSprites = (ISprite[])null; + this._letterBoxSprites = null; } protected override void OnPaint(bool visible) @@ -106,7 +106,7 @@ namespace Microsoft.Iris.ViewItems base.OnPaint(visible); if (this._contents == null || !UISession.Default.RenderSession.GraphicsDevice.IsVideoComposited) return; - BasicVideoPresentation presentation = this._videoStream.GetPresentation((IUIVideoPortal)this); + BasicVideoPresentation presentation = this._videoStream.GetPresentation(this); this._contents.Position = new Vector3(presentation.DisplayedDestination.Left, presentation.DisplayedDestination.Top, 0.0f); this._contents.Size = new Vector2(presentation.DisplayedDestination.Size.Width, presentation.DisplayedDestination.Size.Height); BasicVideoGeometry geometry = presentation.GetGeometry(); @@ -127,15 +127,15 @@ namespace Microsoft.Iris.ViewItems private void CreateBorderSprites(IRenderSession renderSession) { this._letterBoxSprites = new ISprite[2]; - IEffect colorFillEffect = EffectManager.CreateColorFillEffect((object)this, this.LetterboxColor); + IEffect colorFillEffect = EffectManager.CreateColorFillEffect(this, this.LetterboxColor); for (int index = 0; index < 2; ++index) { - ISprite sprite = renderSession.CreateSprite((object)this, (object)this); + ISprite sprite = renderSession.CreateSprite(this, this); sprite.Effect = colorFillEffect; - this.VisualContainer.AddChild((IVisual)sprite, (IVisual)this.ContentVisual, VisualOrder.Before); + this.VisualContainer.AddChild(sprite, ContentVisual, VisualOrder.Before); this._letterBoxSprites[index] = sprite; } - colorFillEffect.UnregisterUsage((object)this); + colorFillEffect.UnregisterUsage(this); } Rectangle IUIVideoPortal.LogicalContentRect => this.HasVisual ? new Rectangle(0.0f, 0.0f, this.VisualSize.X, this.VisualSize.Y) : Rectangle.Zero; diff --git a/UIX/Microsoft/Iris/ViewItems/VisibleIndexRangeLayoutOutput.cs b/UIX/Microsoft/Iris/ViewItems/VisibleIndexRangeLayoutOutput.cs index b0125ac..8c1aba5 100644 --- a/UIX/Microsoft/Iris/ViewItems/VisibleIndexRangeLayoutOutput.cs +++ b/UIX/Microsoft/Iris/ViewItems/VisibleIndexRangeLayoutOutput.cs @@ -46,6 +46,6 @@ namespace Microsoft.Iris.ViewItems public static DataCookie DataCookie => VisibleIndexRangeLayoutOutput.s_dataProperty; - public override string ToString() => InvariantString.Format("{0} (BeginVisibleOffscreen={1}, EndVisibleOffscreen={2})", (object)this.GetType().Name, (object)this._beginVisibleOffscreen, (object)this._endVisibleOffscreen); + public override string ToString() => InvariantString.Format("{0} (BeginVisibleOffscreen={1}, EndVisibleOffscreen={2})", this.GetType().Name, _beginVisibleOffscreen, _endVisibleOffscreen); } } diff --git a/UIX/Microsoft/Iris/VirtualList.cs b/UIX/Microsoft/Iris/VirtualList.cs index 3c87086..77e24f7 100644 --- a/UIX/Microsoft/Iris/VirtualList.cs +++ b/UIX/Microsoft/Iris/VirtualList.cs @@ -40,22 +40,22 @@ namespace Microsoft.Iris this._itemCountHandler = countHandler; this._storeQueryResults = true; if (enableSlowDataRequests) - this._updater = new UpdateHelper((IVirtualList)this); + this._updater = new UpdateHelper(this); this._releaseBehavior = ReleaseBehavior.KeepReference; } public VirtualList(bool enableSlowDataRequests) - : this((IModelItemOwner)null, enableSlowDataRequests, (ItemCountHandler)null) + : this(null, enableSlowDataRequests, null) { } public VirtualList(ItemCountHandler countHandler) - : this((IModelItemOwner)null, false, countHandler) + : this(null, false, countHandler) { } public VirtualList() - : this((IModelItemOwner)null, false, (ItemCountHandler)null) + : this(null, false, null) { } @@ -68,7 +68,7 @@ namespace Microsoft.Iris if (this._itemCountHandler != null) { ItemCountHandler itemCountHandler = this._itemCountHandler; - this._itemCountHandler = (ItemCountHandler)null; + this._itemCountHandler = null; itemCountHandler(this); } return this._count; @@ -81,7 +81,7 @@ namespace Microsoft.Iris if (this._count < 0) throw new ArgumentException("Must specify a non-negative Count"); this.EnsureNotInCallback("Invalid to set count on virtual list while inside a GetItem callback"); - this._itemCountHandler = (ItemCountHandler)null; + this._itemCountHandler = null; if (this._count == value && this._countInitialized) return; this._countInitialized = true; @@ -126,7 +126,7 @@ namespace Microsoft.Iris get { using (this.ThreadValidator) - return (object)null; + return null; } } @@ -301,7 +301,7 @@ namespace Microsoft.Iris this.ValidateIndex(index); if (this.IsItemAvailable(index)) { - callback((object)this, index, this[index]); + callback(this, index, this[index]); } else { @@ -312,7 +312,7 @@ namespace Microsoft.Iris object obj = this._requestItemHandler == null ? this.OnRequestItem(index) : this._requestItemHandler(this, index); if (this._storeQueryResults) this.ModifiedWorker(index, true, obj); - callback((object)this, index, obj); + callback(this, index, obj); } finally { @@ -336,7 +336,7 @@ namespace Microsoft.Iris int count = this.UnsafeGetCount(); if (!ListUtility.IsValidIndex(index, count)) throw new IndexOutOfRangeException(); - item = (object)null; + item = null; if (!this._items.Contains(index)) return false; item = this._items[index]; @@ -347,7 +347,7 @@ namespace Microsoft.Iris { using (this.ThreadValidator) { - object obj = (object)null; + object obj = null; if (this.IsItemAvailable(index)) obj = this._items[index]; return obj; @@ -368,7 +368,7 @@ namespace Microsoft.Iris throw new InvalidOperationException("VirtualList is not configured for slow data notifications"); bool flag = false; if (this._slowDataAcquireCompleteHandler != null) - flag = this._slowDataAcquireCompleteHandler((IVirtualList)this, index); + flag = this._slowDataAcquireCompleteHandler(this, index); if (flag) return; this._updater.NotifySlowDataAcquireComplete(index); @@ -473,7 +473,7 @@ namespace Microsoft.Iris public IEnumerator GetEnumerator() { using (this.ThreadValidator) - return (IEnumerator)new StackIListEnumerator((IList)this); + return new StackIListEnumerator(this); } public bool Contains(object item) @@ -525,8 +525,8 @@ namespace Microsoft.Iris { this.EnsureNotInCallback("Invalid to remove item {0} from a VirtualList while inside a GetItem callback", index); if (index < 0 || index >= this._count) - throw new ArgumentException(InvariantString.Format("Invalid index '{0}' passed to RemoveAt", (object)index)); - object obj = (object)null; + throw new ArgumentException(InvariantString.Format("Invalid index '{0}' passed to RemoveAt", index)); + object obj = null; if (this._items.Contains(index)) { obj = this._items[index]; @@ -553,13 +553,13 @@ namespace Microsoft.Iris public void Insert(int index) { using (this.ThreadValidator) - this.InsertWorker(index, false, (object)null); + this.InsertWorker(index, false, null); } public int Add() { using (this.ThreadValidator) - return this.AddWorker(false, (object)null); + return this.AddWorker(false, null); } public int Add(object item) @@ -590,7 +590,7 @@ namespace Microsoft.Iris throw new ArgumentException("count should be non-negative"); if (count <= 0) return; - this.InsertRangeWorker(index, (IList)null, count); + this.InsertRangeWorker(index, null, count); } } @@ -616,7 +616,7 @@ namespace Microsoft.Iris throw new ArgumentException("count should be non-negative"); if (count <= 0) return; - this.AddRangeWorker((IList)null, count); + this.AddRangeWorker(null, count); } } @@ -655,7 +655,7 @@ namespace Microsoft.Iris public void Modified(int index) { using (this.ThreadValidator) - this.ModifiedWorker(index, false, (object)null); + this.ModifiedWorker(index, false, null); } [Conditional("DEBUG")] @@ -680,7 +680,7 @@ namespace Microsoft.Iris if (this._updater != null) { this._updater.Dispose(); - this._updater = (UpdateHelper)null; + this._updater = null; } this._items.Clear(); } @@ -699,7 +699,7 @@ namespace Microsoft.Iris if (obj is IDisposable disposable) disposable.Dispose(); else if (obj != VirtualList.UnavailableItem) - throw new InvalidOperationException(InvariantString.Format("VirtualList {0} was configured with the {1} ReleaseBehavior. This is only valid if the contents of the list implement IDisposable. Unable to dispose object: {2}.", (object)this, (object)this._releaseBehavior, obj)); + throw new InvalidOperationException(InvariantString.Format("VirtualList {0} was configured with the {1} ReleaseBehavior. This is only valid if the contents of the list implement IDisposable. Unable to dispose object: {2}.", this, _releaseBehavior, obj)); } private void InsertWorker(int index, bool setValue, object obj) @@ -776,12 +776,12 @@ namespace Microsoft.Iris add { using (this.ThreadValidator) - this.AddEventHandler(VirtualList.s_listContentsChangedEvent, (Delegate)value); + this.AddEventHandler(VirtualList.s_listContentsChangedEvent, value); } remove { using (this.ThreadValidator) - this.RemoveEventHandler(VirtualList.s_listContentsChangedEvent, (Delegate)value); + this.RemoveEventHandler(VirtualList.s_listContentsChangedEvent, value); } } @@ -790,12 +790,12 @@ namespace Microsoft.Iris add { using (this.ThreadValidator) - this.AddEventHandler(VirtualList.s_listContentsChangedEvent, (Delegate)ListContentsChangedProxy.Thunk(value)); + this.AddEventHandler(VirtualList.s_listContentsChangedEvent, ListContentsChangedProxy.Thunk(value)); } remove { using (this.ThreadValidator) - this.RemoveEventHandler(VirtualList.s_listContentsChangedEvent, (Delegate)ListContentsChangedProxy.Thunk(value)); + this.RemoveEventHandler(VirtualList.s_listContentsChangedEvent, ListContentsChangedProxy.Thunk(value)); } } @@ -812,7 +812,7 @@ namespace Microsoft.Iris if (eventHandler != null) { UIListContentsChangedArgs args = new UIListContentsChangedArgs(type, oldIndex, newIndex, count); - eventHandler((IList)this, args); + eventHandler(this, args); } this.FirePropertyChanged("ContentsChanged"); } @@ -826,7 +826,7 @@ namespace Microsoft.Iris private void EnsureNotInCallback(int indexToVerify, string message, int param) { if (this._callbackIndexesList.Contains(indexToVerify)) - throw new InvalidOperationException(InvariantString.Format(message, (object)param)); + throw new InvalidOperationException(InvariantString.Format(message, param)); } private void EnsureNotInCallback(string message) @@ -838,7 +838,7 @@ namespace Microsoft.Iris private void EnsureNotInCallback(string message, int param) { if (this._callbackIndexesList.Count > 0) - throw new InvalidOperationException(InvariantString.Format(message, (object)param)); + throw new InvalidOperationException(InvariantString.Format(message, param)); } } } diff --git a/UIX/Microsoft/Iris/Window.cs b/UIX/Microsoft/Iris/Window.cs index e057f68..d03c146 100644 --- a/UIX/Microsoft/Iris/Window.cs +++ b/UIX/Microsoft/Iris/Window.cs @@ -114,7 +114,7 @@ namespace Microsoft.Iris FormPlacement finalPlacement = this._form.FinalPlacement; if (finalPlacement.ShowState == 2U && disallowMinimized) finalPlacement.ShowState = 1U; - return InvariantString.Format("{0},{1},{2},{3},{4},{5},{6}", (object)finalPlacement.ShowState, (object)finalPlacement.NormalPosition.X, (object)finalPlacement.NormalPosition.Y, (object)finalPlacement.NormalPosition.Width, (object)finalPlacement.NormalPosition.Height, (object)finalPlacement.MaximizedLocation.X, (object)finalPlacement.MaximizedLocation.Y); + return InvariantString.Format("{0},{1},{2},{3},{4},{5},{6}", finalPlacement.ShowState, finalPlacement.NormalPosition.X, finalPlacement.NormalPosition.Y, finalPlacement.NormalPosition.Width, finalPlacement.NormalPosition.Height, finalPlacement.MaximizedLocation.X, finalPlacement.MaximizedLocation.Y); } public void SetSavedInitialPosition(string cookie) => this.SetSavedInitialPositionWorker(cookie, 0U); @@ -149,9 +149,9 @@ namespace Microsoft.Iris try { FormPlacement formPlacement; - formPlacement.ShowState = uint.Parse(strArray[0], (IFormatProvider)NumberFormatInfo.InvariantInfo); - formPlacement.NormalPosition = new Rectangle(int.Parse(strArray[1], (IFormatProvider)NumberFormatInfo.InvariantInfo), int.Parse(strArray[2], (IFormatProvider)NumberFormatInfo.InvariantInfo), int.Parse(strArray[3], (IFormatProvider)NumberFormatInfo.InvariantInfo), int.Parse(strArray[4], (IFormatProvider)NumberFormatInfo.InvariantInfo)); - formPlacement.MaximizedLocation = new Point(int.Parse(strArray[5], (IFormatProvider)NumberFormatInfo.InvariantInfo), int.Parse(strArray[6], (IFormatProvider)NumberFormatInfo.InvariantInfo)); + formPlacement.ShowState = uint.Parse(strArray[0], NumberFormatInfo.InvariantInfo); + formPlacement.NormalPosition = new Rectangle(int.Parse(strArray[1], NumberFormatInfo.InvariantInfo), int.Parse(strArray[2], NumberFormatInfo.InvariantInfo), int.Parse(strArray[3], NumberFormatInfo.InvariantInfo), int.Parse(strArray[4], NumberFormatInfo.InvariantInfo)); + formPlacement.MaximizedLocation = new Point(int.Parse(strArray[5], NumberFormatInfo.InvariantInfo), int.Parse(strArray[6], NumberFormatInfo.InvariantInfo)); if (showStateOverride != 0U) formPlacement.ShowState = showStateOverride; if (formPlacement.NormalPosition.Width != 0) @@ -319,14 +319,14 @@ namespace Microsoft.Iris } } - public void RequestLoad(string source) => this.RequestLoad(source, (PropertyValue[])null); + public void RequestLoad(string source) => this.RequestLoad(source, null); public void RequestLoad(string source, PropertyValue[] properties) { UIDispatcher.VerifyOnApplicationThread(); if (source == null) throw new ArgumentNullException(nameof(source)); - Vector properties1 = (Vector)null; + Vector properties1 = null; if (properties != null) { properties1 = new Vector(properties.Length); @@ -369,7 +369,7 @@ namespace Microsoft.Iris public object SaveKeyFocus() { UIDispatcher.VerifyOnApplicationThread(); - return (object)this._form.SaveKeyFocus(); + return this._form.SaveKeyFocus(); } public void RestoreKeyFocus(object handle) @@ -398,7 +398,7 @@ namespace Microsoft.Iris if (this.CloseRequested == null) return; WindowCloseRequestedEventArgs args = new WindowCloseRequestedEventArgs(); - this.CloseRequested((object)this, args); + this.CloseRequested(this, args); block = args.Block; } @@ -419,7 +419,7 @@ namespace Microsoft.Iris { if (this.PropertyChanged == null) return; - this.PropertyChanged((object)this, new PropertyChangedEventArgs(propertyName)); + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } diff --git a/UIX/Microsoft/Iris/WindowColor.cs b/UIX/Microsoft/Iris/WindowColor.cs index a490bd0..33ed243 100644 --- a/UIX/Microsoft/Iris/WindowColor.cs +++ b/UIX/Microsoft/Iris/WindowColor.cs @@ -39,14 +39,14 @@ namespace Microsoft.Iris private static void CheckByte(int value, string name) { - if (value < 0 || value > (int)byte.MaxValue) - throw new ArgumentException(string.Format("Invalid value ({0}) for {1} color channel. Expecting a value between 0 and 255.", (object)value, (object)name)); + if (value < 0 || value > byte.MaxValue) + throw new ArgumentException(string.Format("Invalid value ({0}) for {1} color channel. Expecting a value between 0 and 255.", value, name)); } private static void CheckFloat(float value, string name) { - if ((double)value < 0.0 || (double)value > 1.0) - throw new ArgumentException(string.Format("Invalid value ({0}) for {1} color channel. Expecting a value between 0.0 and 1.0.", (object)value, (object)name)); + if (value < 0.0 || value > 1.0) + throw new ArgumentException(string.Format("Invalid value ({0}) for {1} color channel. Expecting a value between 0.0 and 1.0.", value, name)); } } } diff --git a/UIX/ParserLexClass.cs b/UIX/ParserLexClass.cs index 31db817..d9e454b 100644 --- a/UIX/ParserLexClass.cs +++ b/UIX/ParserLexClass.cs @@ -76,7 +76,7 @@ internal class ParserLexClass : SSLex public const int ParserLexTokenCodeBlockDisambiguator = 116; public ParserLexClass(SSLexTable q_table) - : base(q_table, (SSLexConsumer)null) + : base(q_table, null) { } diff --git a/UIX/ParserLexTable.cs b/UIX/ParserLexTable.cs index 1b8e556..074c5b3 100644 --- a/UIX/ParserLexTable.cs +++ b/UIX/ParserLexTable.cs @@ -197,7 +197,7 @@ internal class ParserLexTable : SSLexTable 34, 8, 35, - (int) ushort.MaxValue, + ushort.MaxValue, 2, 1, 36, @@ -1665,7 +1665,7 @@ internal class ParserLexTable : SSLexTable 49, 114, 114, - (int) sbyte.MaxValue, + sbyte.MaxValue, 115, 122, 49, @@ -1940,7 +1940,7 @@ internal class ParserLexTable : SSLexTable 34, 38, 35, - (int) ushort.MaxValue, + ushort.MaxValue, 140 }; private int[] m_rows1 = new int[34] @@ -1965,7 +1965,7 @@ internal class ParserLexTable : SSLexTable 42, 6, 43, - (int) ushort.MaxValue, + ushort.MaxValue, 1, -1, -1, @@ -1996,7 +1996,7 @@ internal class ParserLexTable : SSLexTable 13, 4, 14, - (int) ushort.MaxValue, + ushort.MaxValue, 1, -1, -1, diff --git a/UIX/ParserYaccClass.cs b/UIX/ParserYaccClass.cs index cb7a8eb..b374a20 100644 --- a/UIX/ParserYaccClass.cs +++ b/UIX/ParserYaccClass.cs @@ -111,119 +111,119 @@ internal class ParserYaccClass : SSYacc switch (q_prod) { case 1: - return this.ReturnObject((object)new ValidateCode(this.Owner, new ValidateStatementCompound(this.Owner, (ValidateStatement)this.FromProduction(1), this.CurrentLine, this.CurrentColumn), this.CurrentLine, this.CurrentColumn)); + return this.ReturnObject(new ValidateCode(this.Owner, new ValidateStatementCompound(this.Owner, (ValidateStatement)this.FromProduction(1), this.CurrentLine, this.CurrentColumn), this.CurrentLine, this.CurrentColumn)); case 2: return this.ReturnObject(this.FromProduction(2)); case 3: return this.ReturnObject(this.FromProduction(1)); case 4: - return this.ReturnObject((object)new ValidateMethodList(this.Owner, this.CurrentLine, this.CurrentColumn)); + return this.ReturnObject(new ValidateMethodList(this.Owner, this.CurrentLine, this.CurrentColumn)); case 5: ValidateMethodList validateMethodList = (ValidateMethodList)this.FromProduction(0); ValidateMethod expression1 = (ValidateMethod)this.FromProduction(1); validateMethodList.AppendToEnd(expression1); - return this.ReturnObject((object)validateMethodList); + return this.ReturnObject(validateMethodList); case 6: - return this.ReturnObject((object)new Vector()); + return this.ReturnObject(new Vector()); case 7: Vector vector = (Vector)this.FromProduction(0); MethodSpecifier methodSpecifier = (MethodSpecifier)this.FromProduction(1); vector.Add(methodSpecifier); - return this.ReturnObject((object)vector); + return this.ReturnObject(vector); case 8: - return this.ReturnObject((object)MethodSpecifier.Virtual); + return this.ReturnObject(MethodSpecifier.Virtual); case 9: - return this.ReturnObject((object)MethodSpecifier.Override); + return this.ReturnObject(MethodSpecifier.Override); case 10: - return this.ReturnObject((object)this.ConstructValidateMethod(true)); + return this.ReturnObject(this.ConstructValidateMethod(true)); case 11: - return this.ReturnObject((object)new ValidateParameterDefinitionList(this.Owner, this.CurrentLine, this.CurrentColumn)); + return this.ReturnObject(new ValidateParameterDefinitionList(this.Owner, this.CurrentLine, this.CurrentColumn)); case 12: - return this.ReturnObject((object)(ValidateParameterDefinitionList)this.FromProduction(0)); + return this.ReturnObject((ValidateParameterDefinitionList)this.FromProduction(0)); case 13: ValidateParameterDefinition expression2 = (ValidateParameterDefinition)this.FromProduction(0); ValidateParameterDefinitionList parameterDefinitionList1 = new ValidateParameterDefinitionList(this.Owner, expression2.Line, expression2.Column); parameterDefinitionList1.AppendToEnd(expression2); - return this.ReturnObject((object)parameterDefinitionList1); + return this.ReturnObject(parameterDefinitionList1); case 14: ValidateParameterDefinitionList parameterDefinitionList2 = (ValidateParameterDefinitionList)this.FromProduction(0); ValidateParameterDefinition expression3 = (ValidateParameterDefinition)this.FromProduction(2); parameterDefinitionList2.AppendToEnd(expression3); - return this.ReturnObject((object)parameterDefinitionList2); + return this.ReturnObject(parameterDefinitionList2); case 15: ValidateTypeIdentifier typeIdentifier1 = (ValidateTypeIdentifier)this.FromProduction(0); string name = this.FromTerminal(1); - return this.ReturnObject((object)new ValidateParameterDefinition(this.Owner, this.Line(1), this.Column(1), name, typeIdentifier1)); + return this.ReturnObject(new ValidateParameterDefinition(this.Owner, this.Line(1), this.Column(1), name, typeIdentifier1)); case 16: - return this.ReturnObject((object)new ValidateExpressionList(this.Owner, this.CurrentLine, this.CurrentColumn)); + return this.ReturnObject(new ValidateExpressionList(this.Owner, this.CurrentLine, this.CurrentColumn)); case 17: return this.ReturnObject(this.FromProduction(0)); case 18: ValidateExpression expression4 = (ValidateExpression)this.FromProduction(0); ValidateExpressionList validateExpressionList1 = new ValidateExpressionList(this.Owner, expression4.Line, expression4.Column); validateExpressionList1.AppendToEnd(expression4); - return this.ReturnObject((object)validateExpressionList1); + return this.ReturnObject(validateExpressionList1); case 19: ValidateExpressionList validateExpressionList2 = (ValidateExpressionList)this.FromProduction(0); ValidateExpression expression5 = (ValidateExpression)this.FromProduction(2); validateExpressionList2.AppendToEnd(expression5); - return this.ReturnObject((object)validateExpressionList2); + return this.ReturnObject(validateExpressionList2); case 20: ValidateTypeIdentifier typeIdentifier2 = (ValidateTypeIdentifier)this.FromProduction(0); - return this.ReturnObject((object)new ValidateStatementScopedLocal(this.Owner, this.FromTerminal(1), typeIdentifier2, this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateStatementScopedLocal(this.Owner, this.FromTerminal(1), typeIdentifier2, this.Line(1), this.Column(1))); case 21: ValidateTypeIdentifier typeIdentifier3 = (ValidateTypeIdentifier)this.FromProduction(0); string str = this.FromTerminal(1); - return this.ReturnObject((object)new ValidateStatementAssignment(this.Owner, new ValidateStatementScopedLocal(this.Owner, str, typeIdentifier3, this.Line(1), this.Column(1)), (ValidateExpression)new ValidateExpressionSymbol(this.Owner, str, this.Line(1), this.Column(1)), (ValidateExpression)this.FromProduction(3), this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateStatementAssignment(this.Owner, new ValidateStatementScopedLocal(this.Owner, str, typeIdentifier3, this.Line(1), this.Column(1)), new ValidateExpressionSymbol(this.Owner, str, this.Line(1), this.Column(1)), (ValidateExpression)this.FromProduction(3), this.Line(1), this.Column(1))); case 22: return this.ReturnObject(this.FromProduction(0)); case 23: ValidateExpressionList validateExpressionList3 = (ValidateExpressionList)this.FromProduction(0); - return this.ReturnObject((object)new ValidateStatementExpression(this.Owner, (ValidateExpression)validateExpressionList3, validateExpressionList3.Line, validateExpressionList3.Column)); + return this.ReturnObject(new ValidateStatementExpression(this.Owner, validateExpressionList3, validateExpressionList3.Line, validateExpressionList3.Column)); case 24: - return this.ReturnObject((object)new ValidateStatementIf(this.Owner, (ValidateExpression)this.FromProduction(2), ValidateStatementCompound.Encapsulate((ValidateStatement)this.FromProduction(4)), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementIf(this.Owner, (ValidateExpression)this.FromProduction(2), ValidateStatementCompound.Encapsulate((ValidateStatement)this.FromProduction(4)), this.Line(0), this.Column(0))); case 25: ValidateExpression condition1 = (ValidateExpression)this.FromProduction(2); ValidateStatement statement1 = (ValidateStatement)this.FromProduction(4); ValidateStatement statement2 = (ValidateStatement)this.FromProduction(6); ValidateStatementCompound statementCompoundTrue = ValidateStatementCompound.Encapsulate(statement1); ValidateStatementCompound statementCompoundFalse = ValidateStatementCompound.Encapsulate(statement2); - return this.ReturnObject((object)new ValidateStatementIfElse(this.Owner, condition1, statementCompoundTrue, statementCompoundFalse, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementIfElse(this.Owner, condition1, statementCompoundTrue, statementCompoundFalse, this.Line(0), this.Column(0))); case 26: ValidateTypeIdentifier typeIdentifier4 = (ValidateTypeIdentifier)this.FromProduction(2); - return this.ReturnObject((object)new ValidateStatementForEach(this.Owner, new ValidateStatementScopedLocal(this.Owner, this.FromTerminal(3), typeIdentifier4, this.Line(3), this.Column(3)), (ValidateExpression)this.FromProduction(5), ValidateStatementCompound.Encapsulate((ValidateStatement)this.FromProduction(7)), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementForEach(this.Owner, new ValidateStatementScopedLocal(this.Owner, this.FromTerminal(3), typeIdentifier4, this.Line(3), this.Column(3)), (ValidateExpression)this.FromProduction(5), ValidateStatementCompound.Encapsulate((ValidateStatement)this.FromProduction(7)), this.Line(0), this.Column(0))); case 27: ValidateExpression condition2 = (ValidateExpression)this.FromProduction(2); - return this.ReturnObject((object)new ValidateStatementWhile(this.Owner, (ValidateStatement)this.FromProduction(4), condition2, false, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementWhile(this.Owner, (ValidateStatement)this.FromProduction(4), condition2, false, this.Line(0), this.Column(0))); case 28: - return this.ReturnObject((object)new ValidateStatementWhile(this.Owner, (ValidateStatement)this.FromProduction(1), (ValidateExpression)this.FromProduction(4), true, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementWhile(this.Owner, (ValidateStatement)this.FromProduction(1), (ValidateExpression)this.FromProduction(4), true, this.Line(0), this.Column(0))); case 29: ValidateStatement statementList1 = (ValidateStatement)this.FromProduction(2); ValidateExpression condition3 = (ValidateExpression)this.FromProduction(4); ValidateExpression expression6 = (ValidateExpression)this.FromProduction(6); ValidateStatement statementList2 = (ValidateStatement)this.FromProduction(8); ValidateStatementExpression statementExpression = new ValidateStatementExpression(this.Owner, expression6, expression6.Line, expression6.Column); - statementList2.AppendToEnd((ValidateStatement)statementExpression); - ValidateStatementWhile validateStatementWhile = new ValidateStatementWhile(this.Owner, (ValidateStatement)new ValidateStatementCompound(this.Owner, statementList2, statementList2.Line, statementList2.Column), condition3, false, this.Line(0), this.Column(0)); - statementList1.AppendToEnd((ValidateStatement)validateStatementWhile); - return this.ReturnObject((object)new ValidateStatementCompound(this.Owner, statementList1, this.Line(0), this.Column(0))); + statementList2.AppendToEnd(statementExpression); + ValidateStatementWhile validateStatementWhile = new ValidateStatementWhile(this.Owner, new ValidateStatementCompound(this.Owner, statementList2, statementList2.Line, statementList2.Column), condition3, false, this.Line(0), this.Column(0)); + statementList1.AppendToEnd(validateStatementWhile); + return this.ReturnObject(new ValidateStatementCompound(this.Owner, statementList1, this.Line(0), this.Column(0))); case 30: return this.ReturnObject(this.FromProduction(0)); case 31: ValidateExpression expression7 = (ValidateExpression)this.FromProduction(0); - return this.ReturnObject((object)new ValidateStatementExpression(this.Owner, expression7, expression7.Line, expression7.Column)); + return this.ReturnObject(new ValidateStatementExpression(this.Owner, expression7, expression7.Line, expression7.Column)); case 32: - return this.ReturnObject((object)new ValidateStatementReturn(this.Owner, (ValidateExpression)null, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementReturn(this.Owner, null, this.Line(0), this.Column(0))); case 33: - return this.ReturnObject((object)new ValidateStatementReturn(this.Owner, (ValidateExpression)this.FromProduction(1), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementReturn(this.Owner, (ValidateExpression)this.FromProduction(1), this.Line(0), this.Column(0))); case 34: - return this.ReturnObject((object)new ValidateStatementBreak(this.Owner, false, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementBreak(this.Owner, false, this.Line(0), this.Column(0))); case 35: - return this.ReturnObject((object)new ValidateStatementBreak(this.Owner, true, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementBreak(this.Owner, true, this.Line(0), this.Column(0))); case 36: - return this.ReturnObject((object)new ValidateStatementAttribute(this.Owner, this.FromTerminal(1), (ValidateParameter)this.FromProduction(3), this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateStatementAttribute(this.Owner, this.FromTerminal(1), (ValidateParameter)this.FromProduction(3), this.Line(1), this.Column(1))); case 37: - return this.ReturnObject((object)new ValidateStatementCompound(this.Owner, (ValidateStatement)this.FromProduction(1), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateStatementCompound(this.Owner, (ValidateStatement)this.FromProduction(1), this.Line(0), this.Column(0))); case 38: ValidateStatement validateStatement1 = (ValidateStatement)this.FromProduction(0); ValidateStatement validateStatement2 = (ValidateStatement)this.FromProduction(1); @@ -231,121 +231,121 @@ internal class ParserYaccClass : SSYacc validateStatement1.AppendToEnd(validateStatement2); else validateStatement1 = validateStatement2; - return this.ReturnObject((object)validateStatement1); + return this.ReturnObject(validateStatement1); case 39: - return this.ReturnObject((object)null); + return this.ReturnObject(null); case 40: - return this.ReturnObject((object)new ValidateExpressionCall(this.Owner, (ValidateExpression)this.FromProduction(0), this.FromTerminal(2), (ValidateParameter)this.FromProduction(4), this.Line(2), this.Column(2))); + return this.ReturnObject(new ValidateExpressionCall(this.Owner, (ValidateExpression)this.FromProduction(0), this.FromTerminal(2), (ValidateParameter)this.FromProduction(4), this.Line(2), this.Column(2))); case 41: string memberName = this.FromTerminal(0); ValidateParameter parameterList = (ValidateParameter)this.FromProduction(2); - return this.ReturnObject((object)new ValidateExpressionCall(this.Owner, (ValidateExpression)new ValidateExpressionThis(this.Owner, this.Line(0), this.Column(0)), memberName, parameterList, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionCall(this.Owner, new ValidateExpressionThis(this.Owner, this.Line(0), this.Column(0)), memberName, parameterList, this.Line(0), this.Column(0))); case 42: - return this.ReturnObject((object)new ValidateExpressionCall(this.Owner, (ValidateExpression)this.FromProduction(0), this.FromTerminal(2), (ValidateParameter)null, this.Line(2), this.Column(2))); + return this.ReturnObject(new ValidateExpressionCall(this.Owner, (ValidateExpression)this.FromProduction(0), this.FromTerminal(2), null, this.Line(2), this.Column(2))); case 43: - return this.ReturnObject((object)new ValidateExpressionCall(this.Owner, new ValidateTypeIdentifier(this.Owner, this.FromTerminal(0), this.FromTerminal(2), this.Line(0), this.Column(0)), this.FromTerminal(4), (ValidateParameter)null, this.Line(4), this.Column(4))); + return this.ReturnObject(new ValidateExpressionCall(this.Owner, new ValidateTypeIdentifier(this.Owner, this.FromTerminal(0), this.FromTerminal(2), this.Line(0), this.Column(0)), this.FromTerminal(4), null, this.Line(4), this.Column(4))); case 44: - return this.ReturnObject((object)new ValidateExpressionCall(this.Owner, new ValidateTypeIdentifier(this.Owner, this.FromTerminal(0), this.FromTerminal(2), this.Line(0), this.Column(0)), this.FromTerminal(4), (ValidateParameter)this.FromProduction(6), this.Line(4), this.Column(4))); + return this.ReturnObject(new ValidateExpressionCall(this.Owner, new ValidateTypeIdentifier(this.Owner, this.FromTerminal(0), this.FromTerminal(2), this.Line(0), this.Column(0)), this.FromTerminal(4), (ValidateParameter)this.FromProduction(6), this.Line(4), this.Column(4))); case 45: - return this.ReturnObject((object)new ValidateExpressionIndex(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateParameter)this.FromProduction(2), this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateExpressionIndex(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateParameter)this.FromProduction(2), this.Line(1), this.Column(1))); case 46: - return this.ReturnObject((object)new ValidateExpressionNew(this.Owner, (ValidateTypeIdentifier)this.FromProduction(1), (ValidateParameter)this.FromProduction(3), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionNew(this.Owner, (ValidateTypeIdentifier)this.FromProduction(1), (ValidateParameter)this.FromProduction(3), this.Line(0), this.Column(0))); case 47: - return this.ReturnObject((object)new ValidateExpressionSymbol(this.Owner, this.FromTerminal(0), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionSymbol(this.Owner, this.FromTerminal(0), this.Line(0), this.Column(0))); case 48: - return this.ReturnObject((object)new ValidateExpressionConstant(this.Owner, this.FromTerminalTrim(0, 1, 1), ConstantType.String, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionConstant(this.Owner, this.FromTerminalTrim(0, 1, 1), ConstantType.String, this.Line(0), this.Column(0))); case 49: - return this.ReturnObject((object)new ValidateExpressionConstant(this.Owner, this.FromTerminalTrim(0, 2, 1), ConstantType.StringLiteral, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionConstant(this.Owner, this.FromTerminalTrim(0, 2, 1), ConstantType.StringLiteral, this.Line(0), this.Column(0))); case 50: - return this.ReturnObject((object)new ValidateExpressionConstant(this.Owner, this.FromTerminal(0), ConstantType.Integer, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionConstant(this.Owner, this.FromTerminal(0), ConstantType.Integer, this.Line(0), this.Column(0))); case 51: - return this.ReturnObject((object)new ValidateExpressionConstant(this.Owner, this.FromTerminalTrim(0, 0, 1), ConstantType.LongInteger, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionConstant(this.Owner, this.FromTerminalTrim(0, 0, 1), ConstantType.LongInteger, this.Line(0), this.Column(0))); case 52: - return this.ReturnObject((object)new ValidateExpressionConstant(this.Owner, this.FromTerminal(0), ConstantType.Float, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionConstant(this.Owner, this.FromTerminal(0), ConstantType.Float, this.Line(0), this.Column(0))); case 53: - return this.ReturnObject((object)new ValidateExpressionConstant(this.Owner, true, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionConstant(this.Owner, true, this.Line(0), this.Column(0))); case 54: - return this.ReturnObject((object)new ValidateExpressionConstant(this.Owner, false, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionConstant(this.Owner, false, this.Line(0), this.Column(0))); case 55: - return this.ReturnObject((object)new ValidateExpressionConstant(this.Owner, (string)null, ConstantType.Null, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionConstant(this.Owner, null, ConstantType.Null, this.Line(0), this.Column(0))); case 56: - return this.ReturnObject((object)new ValidateExpressionThis(this.Owner, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionThis(this.Owner, this.Line(0), this.Column(0))); case 57: - return this.ReturnObject((object)new ValidateExpressionBaseClass(this.Owner, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionBaseClass(this.Owner, this.Line(0), this.Column(0))); case 58: - return this.ReturnObject((object)new ValidateExpressionTypeOf(this.Owner, (ValidateTypeIdentifier)this.FromProduction(2), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionTypeOf(this.Owner, (ValidateTypeIdentifier)this.FromProduction(2), this.Line(0), this.Column(0))); case 59: - return this.ReturnObject((object)(ValidateExpression)this.FromProduction(1)); + return this.ReturnObject((ValidateExpression)this.FromProduction(1)); case 60: - return this.ReturnObject((object)new ValidateExpressionDeclareTrigger(this.Owner, (ValidateExpression)this.FromProduction(1), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionDeclareTrigger(this.Owner, (ValidateExpression)this.FromProduction(1), this.Line(0), this.Column(0))); case 61: - return this.ReturnObject((object)this.ConstructValidateExpressionUnaryOperation(OperationType.LogicalNot)); + return this.ReturnObject(this.ConstructValidateExpressionUnaryOperation(OperationType.LogicalNot)); case 62: - return this.ReturnObject((object)this.ConstructValidateExpressionUnaryOperation(OperationType.MathNegate)); + return this.ReturnObject(this.ConstructValidateExpressionUnaryOperation(OperationType.MathNegate)); case 63: - return this.ReturnObject((object)this.ConstructValidateExpressionPostUnaryOperation(OperationType.PostIncrement)); + return this.ReturnObject(this.ConstructValidateExpressionPostUnaryOperation(OperationType.PostIncrement)); case 64: - return this.ReturnObject((object)this.ConstructValidateExpressionPostUnaryOperation(OperationType.PostDecrement)); + return this.ReturnObject(this.ConstructValidateExpressionPostUnaryOperation(OperationType.PostDecrement)); case 65: string prefix = this.FromTerminal(1); string typeName = this.FromTerminal(3); ValidateExpression castee = (ValidateExpression)this.FromProduction(5); - return this.ReturnObject((object)new ValidateExpressionCast(this.Owner, new ValidateTypeIdentifier(this.Owner, prefix, typeName, this.Line(1), this.Column(1)), castee, this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionCast(this.Owner, new ValidateTypeIdentifier(this.Owner, prefix, typeName, this.Line(1), this.Column(1)), castee, this.Line(0), this.Column(0))); case 66: - return this.ReturnObject((object)new ValidateExpressionCast(this.Owner, (ValidateExpression)this.FromProduction(1), (ValidateExpression)this.FromProduction(3), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateExpressionCast(this.Owner, (ValidateExpression)this.FromProduction(1), (ValidateExpression)this.FromProduction(3), this.Line(0), this.Column(0))); case 67: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.MathMultiply)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.MathMultiply)); case 68: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.MathDivide)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.MathDivide)); case 69: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.MathModulus)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.MathModulus)); case 70: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.MathAdd)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.MathAdd)); case 71: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.MathSubtract)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.MathSubtract)); case 72: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.RelationalLessThan)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.RelationalLessThan)); case 73: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.RelationalGreaterThan)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.RelationalGreaterThan)); case 74: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.RelationalLessThanEquals)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.RelationalLessThanEquals)); case 75: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.RelationalGreaterThanEquals)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.RelationalGreaterThanEquals)); case 76: - return this.ReturnObject((object)new ValidateExpressionIsCheck(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateTypeIdentifier)this.FromProduction(2), this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateExpressionIsCheck(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateTypeIdentifier)this.FromProduction(2), this.Line(1), this.Column(1))); case 77: - return this.ReturnObject((object)new ValidateExpressionAs(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateTypeIdentifier)this.FromProduction(2), this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateExpressionAs(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateTypeIdentifier)this.FromProduction(2), this.Line(1), this.Column(1))); case 78: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.RelationalEquals)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.RelationalEquals)); case 79: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.RelationalNotEquals)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.RelationalNotEquals)); case 80: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.LogicalAnd)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.LogicalAnd)); case 81: - return this.ReturnObject((object)this.ConstructValidateExpressionOperation(OperationType.LogicalOr)); + return this.ReturnObject(this.ConstructValidateExpressionOperation(OperationType.LogicalOr)); case 82: - return this.ReturnObject((object)new ValidateExpressionNullCoalescing(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateExpression)this.FromProduction(2), this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateExpressionNullCoalescing(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateExpression)this.FromProduction(2), this.Line(1), this.Column(1))); case 83: - return this.ReturnObject((object)new ValidateExpressionTernary(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateExpression)this.FromProduction(2), (ValidateExpression)this.FromProduction(4), this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateExpressionTernary(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateExpression)this.FromProduction(2), (ValidateExpression)this.FromProduction(4), this.Line(1), this.Column(1))); case 84: - return this.ReturnObject((object)new ValidateExpressionAssignment(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateExpression)this.FromProduction(2), this.Line(1), this.Column(1))); + return this.ReturnObject(new ValidateExpressionAssignment(this.Owner, (ValidateExpression)this.FromProduction(0), (ValidateExpression)this.FromProduction(2), this.Line(1), this.Column(1))); case 85: - return this.ReturnObject((object)ValidateParameter.EmptyList); + return this.ReturnObject(ValidateParameter.EmptyList); case 86: - return this.ReturnObject((object)(ValidateParameter)this.FromProduction(0)); + return this.ReturnObject((ValidateParameter)this.FromProduction(0)); case 87: ValidateExpression expression8 = (ValidateExpression)this.FromProduction(0); - return this.ReturnObject((object)new ValidateParameter(this.Owner, expression8, expression8.Line, expression8.Column)); + return this.ReturnObject(new ValidateParameter(this.Owner, expression8, expression8.Line, expression8.Column)); case 88: ValidateParameter validateParameter1 = (ValidateParameter)this.FromProduction(0); ValidateExpression expression9 = (ValidateExpression)this.FromProduction(2); ValidateParameter validateParameter2 = new ValidateParameter(this.Owner, expression9, expression9.Line, expression9.Column); validateParameter1.AppendToEnd(validateParameter2); - return this.ReturnObject((object)validateParameter1); + return this.ReturnObject(validateParameter1); case 89: - return this.ReturnObject((object)new ValidateTypeIdentifier(this.Owner, this.FromTerminal(0), this.FromTerminal(2), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateTypeIdentifier(this.Owner, this.FromTerminal(0), this.FromTerminal(2), this.Line(0), this.Column(0))); case 90: - return this.ReturnObject((object)new ValidateTypeIdentifier(this.Owner, (string)null, this.FromTerminal(0), this.Line(0), this.Column(0))); + return this.ReturnObject(new ValidateTypeIdentifier(this.Owner, null, this.FromTerminal(0), this.Line(0), this.Column(0))); default: return this.stackElement(); } @@ -362,13 +362,13 @@ internal class ParserYaccClass : SSYacc private ValidateExpressionOperation ConstructValidateExpressionUnaryOperation( OperationType op) { - return new ValidateExpressionOperation(this.Owner, (ValidateExpression)this.FromProduction(1), op, (ValidateExpression)null, this.Line(0), this.Column(0)); + return new ValidateExpressionOperation(this.Owner, (ValidateExpression)this.FromProduction(1), op, null, this.Line(0), this.Column(0)); } private ValidateExpressionOperation ConstructValidateExpressionPostUnaryOperation( OperationType op) { - return new ValidateExpressionOperation(this.Owner, (ValidateExpression)this.FromProduction(0), op, (ValidateExpression)null, this.Line(1), this.Column(1)); + return new ValidateExpressionOperation(this.Owner, (ValidateExpression)this.FromProduction(0), op, null, this.Line(1), this.Column(1)); } private ValidateMethod ConstructValidateMethod(bool hasBody) @@ -377,7 +377,7 @@ internal class ParserYaccClass : SSYacc ValidateTypeIdentifier returnType = (ValidateTypeIdentifier)this.FromProduction(1); Vector specifiers = (Vector)this.FromProduction(0); ValidateParameterDefinitionList paramList = (ValidateParameterDefinitionList)this.FromProduction(4); - ValidateCode body = new ValidateCode(this.Owner, new ValidateStatementCompound(this.Owner, hasBody ? (ValidateStatement)this.FromProduction(7) : (ValidateStatement)null, this.Line(6), this.Column(6)), this.Line(6), this.Column(6)); + ValidateCode body = new ValidateCode(this.Owner, new ValidateStatementCompound(this.Owner, hasBody ? (ValidateStatement)this.FromProduction(7) : null, this.Line(6), this.Column(6)), this.Line(6), this.Column(6)); return new ValidateMethod(this.Owner, this.Line(2), this.Column(2), methodName, returnType, specifiers, paramList, body); } diff --git a/UIX/ParserYaccTable.cs b/UIX/ParserYaccTable.cs index aab14ee..219063c 100644 --- a/UIX/ParserYaccTable.cs +++ b/UIX/ParserYaccTable.cs @@ -1965,7 +1965,7 @@ internal class ParserYaccTable : SSYaccTable 0, 0, 16387, - (int) sbyte.MaxValue, + sbyte.MaxValue, 1, 0, 29, diff --git a/UIX/SSVParseLib/SSLex.cs b/UIX/SSVParseLib/SSLex.cs index 85f150f..d63c0e8 100644 --- a/UIX/SSVParseLib/SSLex.cs +++ b/UIX/SSVParseLib/SSLex.cs @@ -38,7 +38,7 @@ namespace SSVParseLib public virtual bool error(SSLexLexeme q_lexeme) { this.m_hasErrors = true; - string message = string.Format("Syntax Error: Unexpected character encountered: '{0}'", (object)this.m_currentChar[0]); + string message = string.Format("Syntax Error: Unexpected character encountered: '{0}'", this.m_currentChar[0]); ErrorManager.ReportError(q_lexeme.line(), q_lexeme.offset() + q_lexeme.length() - 1, message); return true; } @@ -49,7 +49,7 @@ namespace SSVParseLib public SSLexLexeme next() { - SSLexLexeme ssLexLexeme = (SSLexLexeme)null; + SSLexLexeme ssLexLexeme = null; while (true) { SSLexMark? q_mark; @@ -66,7 +66,7 @@ namespace SSVParseLib { flag = true; this.m_currentChar[0] = this.m_consumer.getCurrent(); - this.m_state = this.m_table.lookup(this.m_state, (int)this.m_currentChar[0]); + this.m_state = this.m_table.lookup(this.m_state, this.m_currentChar[0]); if (this.m_state != -1) { SSLexFinalState ssLexFinalState = this.m_table.lookupFinal(this.m_state); @@ -111,7 +111,7 @@ namespace SSVParseLib if (!this.error(ssLexLexeme)) { this.m_consumer.flushLexeme(); - ssLexLexeme = (SSLexLexeme)null; + ssLexLexeme = null; } else break; @@ -131,7 +131,7 @@ namespace SSVParseLib this.m_table.findKeyword(ssLexLexeme); this.m_consumer.flushLexeme(q_mark.Value); if (!this.complete(ssLexLexeme)) - ssLexLexeme = (SSLexLexeme)null; + ssLexLexeme = null; else break; } diff --git a/UIX/SSVParseLib/SSLexTable.cs b/UIX/SSVParseLib/SSLexTable.cs index f0eeae2..2093e5d 100644 --- a/UIX/SSVParseLib/SSLexTable.cs +++ b/UIX/SSVParseLib/SSLexTable.cs @@ -23,7 +23,7 @@ namespace SSVParseLib public SSLexTable() { this.m_stack = new Stack(); - this.m_subTables = (SSLexSubtable[])null; + this.m_subTables = null; } public void findKeyword(SSLexLexeme z_lexeme) => throw new Exception("Code has been disabled."); @@ -31,10 +31,10 @@ namespace SSVParseLib public void gotoSubtable(int q_index) { this.m_stack.Pop(); - this.m_stack.Push((object)this.m_subTables[q_index]); + this.m_stack.Push(this.m_subTables[q_index]); } - public void pushSubtable(int q_index) => this.m_stack.Push((object)this.m_subTables[q_index]); + public void pushSubtable(int q_index) => this.m_stack.Push(this.m_subTables[q_index]); public void popSubtable() => this.m_stack.Pop(); diff --git a/UIX/SSVParseLib/SSYacc.cs b/UIX/SSVParseLib/SSYacc.cs index 885e2d7..690def3 100644 --- a/UIX/SSVParseLib/SSYacc.cs +++ b/UIX/SSVParseLib/SSYacc.cs @@ -64,7 +64,7 @@ namespace SSVParseLib this.m_table = q_table; this.m_stack = new SSYaccStack(5, 5); this.m_lexemeCache = new SSYaccCache(); - this.Reset((SourceMarkupLoader)null); + this.Reset(null); } public void Reset(SourceMarkupLoader owner) @@ -77,14 +77,14 @@ namespace SSVParseLib this.m_action = 0; this.m_endOfInput = false; this.m_hasErrors = false; - this.m_larLookahead = (SSLexLexeme)null; + this.m_larLookahead = null; this.m_leftside = 0; - this.m_lexSubtable = (SSLexSubtable)null; - this.m_lookahead = (SSLexLexeme)null; + this.m_lexSubtable = null; + this.m_lookahead = null; this.m_production = 0; this.m_productionSize = 0; this.m_state = 0; - this.m_endLexeme = (SSLexLexeme)null; + this.m_endLexeme = null; this.m_element = new SSYaccStackElement(); this.m_treeRoot = new SSYaccStackElement(); this.m_stack.Clear(); @@ -114,10 +114,10 @@ namespace SSVParseLib string str = q_look.GetValue(this.m_lex); int line = q_look.line(); int column = q_look.offset(); - string message = string.Format("Syntax Error: Unexpected character encountered: '{0}'", (object)str); + string message = string.Format("Syntax Error: Unexpected character encountered: '{0}'", str); if (str == "eof") { - message = string.Format("Unexpected end of script (script beginning at line {0}, column {1})", (object)line, (object)column); + message = string.Format("Unexpected end of script (script beginning at line {0}, column {1})", line, column); line = this.m_lex.consumer().line(); column = this.m_lex.consumer().offset(); } @@ -196,14 +196,14 @@ namespace SSVParseLib public SSLexLexeme getLexemeCache() { - SSLexLexeme ssLexLexeme = (SSLexLexeme)null; + SSLexLexeme ssLexLexeme = null; if (this.m_cache != -1 && this.m_lexemeCache.hasElements()) ssLexLexeme = (SSLexLexeme)this.m_lexemeCache.Dequeue(); if (ssLexLexeme == null) { this.m_cache = -1; ssLexLexeme = this.nextLexeme() ?? this.m_endLexeme; - this.m_lexemeCache.Enqueue((object)ssLexLexeme); + this.m_lexemeCache.Enqueue(ssLexLexeme); } return ssLexLexeme; } diff --git a/UIX/SSVParseLib/SSYaccCache.cs b/UIX/SSVParseLib/SSYaccCache.cs index bb896b1..2969a1a 100644 --- a/UIX/SSVParseLib/SSYaccCache.cs +++ b/UIX/SSVParseLib/SSYaccCache.cs @@ -14,7 +14,7 @@ namespace SSVParseLib public SSLexLexeme remove() { - SSLexLexeme ssLexLexeme = (SSLexLexeme)null; + SSLexLexeme ssLexLexeme = null; if (this.Count != 0) ssLexLexeme = (SSLexLexeme)this.Dequeue(); return ssLexLexeme; diff --git a/UIX/SSVParseLib/SSYaccTable.cs b/UIX/SSVParseLib/SSYaccTable.cs index 377783d..08be4fb 100644 --- a/UIX/SSVParseLib/SSYaccTable.cs +++ b/UIX/SSVParseLib/SSYaccTable.cs @@ -15,7 +15,7 @@ namespace SSVParseLib protected SSYaccTableProd[] m_prods; private SSLexSubtable[] m_lexSubtables; - public SSYaccTable() => this.m_lexSubtables = (SSLexSubtable[])null; + public SSYaccTable() => this.m_lexSubtables = null; public SSYaccTableRow lookupRow(int q_state) => this.m_rows[q_state]; diff --git a/UIX/SSVParseLib/SSYaccTableRow.cs b/UIX/SSVParseLib/SSYaccTableRow.cs index c96254b..6ad386f 100644 --- a/UIX/SSVParseLib/SSYaccTableRow.cs +++ b/UIX/SSVParseLib/SSYaccTableRow.cs @@ -42,7 +42,7 @@ namespace SSVParseLib if (this.m_entries[index].token() == q_index) return this.m_entries[index]; } - return (SSYaccTableRowEntry)null; + return null; } public SSYaccTableRowEntry lookupGoto(int q_index) @@ -52,7 +52,7 @@ namespace SSVParseLib if (this.m_entries[action].token() == q_index) return this.m_entries[action]; } - return (SSYaccTableRowEntry)null; + return null; } public bool hasError() => this.m_error; diff --git a/UIXControls/CodeDialogManager.cs b/UIXControls/CodeDialogManager.cs index 08b2aba..fab22af 100644 --- a/UIXControls/CodeDialogManager.cs +++ b/UIXControls/CodeDialogManager.cs @@ -23,9 +23,9 @@ namespace UIXControls internal void ShowCodeDialog(DialogHelper dialog) { - if (this._pendingCodeDialogs.Contains((object)dialog)) + if (this._pendingCodeDialogs.Contains(dialog)) return; - this._pendingCodeDialogs.Add((object)dialog); + this._pendingCodeDialogs.Add(dialog); } public event EventHandler WindowCloseRequested; @@ -37,14 +37,14 @@ namespace UIXControls { args.BlockCloseRequest(); if (this.WindowCloseRequested != null) - this.WindowCloseRequested((object)this, EventArgs.Empty); + this.WindowCloseRequested(this, EventArgs.Empty); this.FirePropertyChanged("WindowCloseRequested"); } public void WindowCloseWasNotBlocked() { if (this.WindowCloseNotBlocked != null) - this.WindowCloseNotBlocked((object)this, EventArgs.Empty); + this.WindowCloseNotBlocked(this, EventArgs.Empty); this.FirePropertyChanged("WindowCloseNotBlocked"); } } diff --git a/UIXControls/DialogHelper.cs b/UIXControls/DialogHelper.cs index 762c027..994a605 100644 --- a/UIXControls/DialogHelper.cs +++ b/UIXControls/DialogHelper.cs @@ -43,7 +43,7 @@ namespace UIXControls } public DialogHelper() - : this((string)null) + : this(null) { } diff --git a/UIXControls/MenuItemCommand.cs b/UIXControls/MenuItemCommand.cs index 52c9e0f..680ff68 100644 --- a/UIXControls/MenuItemCommand.cs +++ b/UIXControls/MenuItemCommand.cs @@ -18,7 +18,7 @@ namespace UIXControls } public MenuItemCommand(string description) - : base((IModelItemOwner)null, description, (EventHandler)null) + : base(null, description, null) { } @@ -36,6 +36,6 @@ namespace UIXControls public virtual bool ShouldHide() => this.Hidden; - public override string ToString() => string.Format("{0}:\"{1}\", Available = {2}, Hidden = {3}", (object)this.GetType().Name, (object)this.Description, (object)this.Available, (object)this.Hidden); + public override string ToString() => string.Format("{0}:\"{1}\", Available = {2}, Hidden = {3}", this.GetType().Name, Description, Available, Hidden); } } diff --git a/UIXControls/MessageBox.cs b/UIXControls/MessageBox.cs index 22c2898..bf0dac2 100644 --- a/UIXControls/MessageBox.cs +++ b/UIXControls/MessageBox.cs @@ -46,7 +46,7 @@ namespace UIXControls string message, EventHandler okCommandHandler) { - MessageBox dialog = new MessageBox(title, message, okCommandHandler, (EventHandler)null, (EventHandler)null, (EventHandler)null, (BooleanChoice)null); + MessageBox dialog = new MessageBox(title, message, okCommandHandler, null, null, null, null); MessageBox.ShowCodeDialog(dialog); return dialog; } @@ -57,7 +57,7 @@ namespace UIXControls EventHandler yesCommandHandler, EventHandler noCommandHandler) { - MessageBox dialog = new MessageBox(title, message, (EventHandler)null, yesCommandHandler, noCommandHandler, (EventHandler)null, (BooleanChoice)null); + MessageBox dialog = new MessageBox(title, message, null, yesCommandHandler, noCommandHandler, null, null); MessageBox.ShowCodeDialog(dialog); return dialog; } @@ -70,7 +70,7 @@ namespace UIXControls EventHandler noCommandHandler, EventHandler cancelCommandHandler) { - MessageBox dialog = new MessageBox(title, message, okCommandHandler, yesCommandHandler, noCommandHandler, cancelCommandHandler, (BooleanChoice)null); + MessageBox dialog = new MessageBox(title, message, okCommandHandler, yesCommandHandler, noCommandHandler, cancelCommandHandler, null); MessageBox.ShowCodeDialog(dialog); return dialog; } @@ -96,14 +96,14 @@ namespace UIXControls Command noCommand, BooleanChoice doNotAskMeAgain) { - MessageBox dialog = new MessageBox(title, message, (string)null, false, (Command)null, yesCommand, noCommand, (EventHandler)null, doNotAskMeAgain); + MessageBox dialog = new MessageBox(title, message, null, false, null, yesCommand, noCommand, null, doNotAskMeAgain); MessageBox.ShowCodeDialog(dialog); return dialog; } public static MessageBox ShowYesNo(string title, string message, Command yesCommand) { - MessageBox dialog = new MessageBox(title, message, DialogHelper.DialogNo, false, (Command)null, yesCommand, (Command)null, (EventHandler)null, (BooleanChoice)null); + MessageBox dialog = new MessageBox(title, message, DialogHelper.DialogNo, false, null, yesCommand, null, null, null); MessageBox.ShowCodeDialog(dialog); return dialog; } @@ -114,7 +114,7 @@ namespace UIXControls Command okCommand, BooleanChoice doNotAskMeAgain) { - MessageBox dialog = new MessageBox(title, message, (string)null, false, okCommand, (Command)null, (Command)null, (EventHandler)null, doNotAskMeAgain); + MessageBox dialog = new MessageBox(title, message, null, false, okCommand, null, null, null, doNotAskMeAgain); MessageBox.ShowCodeDialog(dialog); return dialog; } @@ -126,7 +126,7 @@ namespace UIXControls string cancelText, bool isOKDefault) { - MessageBox dialog = new MessageBox(title, message, cancelText, isOKDefault, okCommand, (Command)null, (Command)null, (EventHandler)null, (BooleanChoice)null); + MessageBox dialog = new MessageBox(title, message, cancelText, isOKDefault, okCommand, null, null, null, null); MessageBox.ShowCodeDialog(dialog); return dialog; } @@ -139,7 +139,7 @@ namespace UIXControls EventHandler cancelCommand, bool isOKDefault) { - MessageBox dialog = new MessageBox(title, message, cancelText, isOKDefault, okCommand, (Command)null, (Command)null, cancelCommand, (BooleanChoice)null); + MessageBox dialog = new MessageBox(title, message, cancelText, isOKDefault, okCommand, null, null, cancelCommand, null); MessageBox.ShowCodeDialog(dialog); return dialog; } @@ -161,7 +161,7 @@ namespace UIXControls } public MessageBox() - : this((string)null, (string)null) + : this(null, null) { } @@ -196,17 +196,17 @@ namespace UIXControls } if (okCommandHandler != null) { - this._okCommand = new Command((IModelItemOwner)this, DialogHelper.DialogOk, okCommandHandler); + this._okCommand = new Command(this, DialogHelper.DialogOk, okCommandHandler); this._okCommand.Invoked += eventHandler; } if (yesCommandHandler != null) { - this._yesCommand = new Command((IModelItemOwner)this, DialogHelper.DialogYes, yesCommandHandler); + this._yesCommand = new Command(this, DialogHelper.DialogYes, yesCommandHandler); this._yesCommand.Invoked += eventHandler; } if (noCommandHandler != null) { - this._noCommand = new Command((IModelItemOwner)this, DialogHelper.DialogNo, noCommandHandler); + this._noCommand = new Command(this, DialogHelper.DialogNo, noCommandHandler); this._noCommand.Invoked += eventHandler; } if (cancelCommandHandler == null) @@ -257,6 +257,6 @@ namespace UIXControls private void OnInvoked(object sender, EventArgs args) => this.Hide(); - protected static void ShowCodeDialog(MessageBox dialog) => CodeDialogManager.Instance.ShowCodeDialog((DialogHelper)dialog); + protected static void ShowCodeDialog(MessageBox dialog) => CodeDialogManager.Instance.ShowCodeDialog(dialog); } } diff --git a/UIXControls/OSInfo.cs b/UIXControls/OSInfo.cs index 8e52dfd..f130d48 100644 --- a/UIXControls/OSInfo.cs +++ b/UIXControls/OSInfo.cs @@ -15,7 +15,7 @@ namespace UIXControls private static int s_defaultKeyDelay = OSInfo.GetDefaultKeyDelay(); private static int s_defaultKeyRepeat = OSInfo.GetDefaultKeyRepeat(); - public static bool IsCapsLockOn() => ((int)OSInfo.GetKeyState(20U) & 1) != 0; + public static bool IsCapsLockOn() => (OSInfo.GetKeyState(20U) & 1) != 0; [DllImport("user32.dll")] private static extern ushort GetKeyState(uint nVirtKey); diff --git a/UIXControls/RegistryHelper.cs b/UIXControls/RegistryHelper.cs index fa6b2ad..a033fd3 100644 --- a/UIXControls/RegistryHelper.cs +++ b/UIXControls/RegistryHelper.cs @@ -26,14 +26,14 @@ namespace UIXControls { if (string.IsNullOrEmpty(RegistryHelper.SettingsRegistryPath)) return; - Registry.SetValue(RegistryHelper.SettingsRegistryPath, keyName, (object)value); + Registry.SetValue(RegistryHelper.SettingsRegistryPath, keyName, value); } public static string GetString(string keyName, string defaultValue) { - string str = (string)null; + string str = null; if (!string.IsNullOrEmpty(RegistryHelper.SettingsRegistryPath)) - str = Registry.GetValue(RegistryHelper.SettingsRegistryPath, keyName, (object)defaultValue) as string; + str = Registry.GetValue(RegistryHelper.SettingsRegistryPath, keyName, defaultValue) as string; return str ?? defaultValue; } @@ -41,28 +41,28 @@ namespace UIXControls { if (string.IsNullOrEmpty(RegistryHelper.SettingsRegistryPath)) return; - Registry.SetValue(RegistryHelper.SettingsRegistryPath, keyName, (object)value); + Registry.SetValue(RegistryHelper.SettingsRegistryPath, keyName, value); } - public static int GetInt(string keyName, int min, int max, int defaultValue) => string.IsNullOrEmpty(keyName) || string.IsNullOrEmpty(RegistryHelper.SettingsRegistryPath) || (!(Registry.GetValue(RegistryHelper.SettingsRegistryPath, keyName, (object)defaultValue) is int num) || num < min || num > max) ? defaultValue : num; + public static int GetInt(string keyName, int min, int max, int defaultValue) => string.IsNullOrEmpty(keyName) || string.IsNullOrEmpty(RegistryHelper.SettingsRegistryPath) || (!(Registry.GetValue(RegistryHelper.SettingsRegistryPath, keyName, defaultValue) is int num) || num < min || num > max) ? defaultValue : num; private static void SaveList(string keyName, IList values, RegistryHelper.ToStringer toString) { if (string.IsNullOrEmpty(RegistryHelper.SettingsRegistryPath)) return; StringBuilder stringBuilder = new StringBuilder(); - foreach (object obj in (IEnumerable)values) + foreach (object obj in values) { if (stringBuilder.Length > 0) stringBuilder.Append(';'); stringBuilder.Append(toString(obj)); } - Registry.SetValue(RegistryHelper.SettingsRegistryPath, keyName, (object)stringBuilder.ToString()); + Registry.SetValue(RegistryHelper.SettingsRegistryPath, keyName, stringBuilder.ToString()); } - public static void SaveIntList(string keyName, IList values) => RegistryHelper.SaveList(keyName, values, (RegistryHelper.ToStringer)(value => ((int)value).ToString((IFormatProvider)NumberFormatInfo.InvariantInfo))); + public static void SaveIntList(string keyName, IList values) => RegistryHelper.SaveList(keyName, values, value => ((int)value).ToString(NumberFormatInfo.InvariantInfo)); - public static void SaveFloatList(string keyName, IList values) => RegistryHelper.SaveList(keyName, values, (RegistryHelper.ToStringer)(value => ((float)value).ToString((IFormatProvider)NumberFormatInfo.InvariantInfo))); + public static void SaveFloatList(string keyName, IList values) => RegistryHelper.SaveList(keyName, values, value => ((float)value).ToString(NumberFormatInfo.InvariantInfo)); private static IList GetList( string keyName, @@ -70,42 +70,42 @@ namespace UIXControls RegistryHelper.TryParser tryParse) { if (string.IsNullOrEmpty(RegistryHelper.SettingsRegistryPath)) - return (IList)null; - string str = Registry.GetValue(RegistryHelper.SettingsRegistryPath, keyName, (object)null) as string; + return null; + string str = Registry.GetValue(RegistryHelper.SettingsRegistryPath, keyName, null) as string; if (string.IsNullOrEmpty(str)) - return (IList)null; + return null; string[] strArray = str.Split(';'); if (strArray.Length != expectedCount) - return (IList)null; + return null; ArrayList arrayList = new ArrayList(expectedCount); for (int index = 0; index < expectedCount; ++index) { object obj; if (!tryParse(strArray[index], out obj)) - return (IList)null; + return null; arrayList.Add(obj); } - return (IList)arrayList; + return arrayList; } - public static IList GetIntList(string keyName, int expectedCount) => RegistryHelper.GetList(keyName, expectedCount, (RegistryHelper.TryParser)((string s, out object value) => + public static IList GetIntList(string keyName, int expectedCount) => RegistryHelper.GetList(keyName, expectedCount, (string s, out object value) => { int result; - bool flag = int.TryParse(s, NumberStyles.Integer, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result); - value = (object)result; + bool flag = int.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out result); + value = result; return flag; - })); + }); public static IList GetPositiveIntList(string keyName, int expectedCount) { IList list = RegistryHelper.GetIntList(keyName, expectedCount); if (list != null) { - foreach (int num in (IEnumerable)list) + foreach (int num in list) { if (num <= 0) { - list = (IList)null; + list = null; break; } } @@ -119,11 +119,11 @@ namespace UIXControls if (list != null) { BitArray bitArray = new BitArray(expectedCount); - foreach (int index in (IEnumerable)list) + foreach (int index in list) { if (index < 0 || index >= expectedCount || bitArray[index]) { - list = (IList)null; + list = null; break; } bitArray[index] = true; @@ -132,13 +132,13 @@ namespace UIXControls return list; } - public static IList GetFloatList(string keyName, int expectedCount) => RegistryHelper.GetList(keyName, expectedCount, (RegistryHelper.TryParser)((string s, out object value) => + public static IList GetFloatList(string keyName, int expectedCount) => RegistryHelper.GetList(keyName, expectedCount, (string s, out object value) => { float result; - bool flag = float.TryParse(s, NumberStyles.Float, (IFormatProvider)NumberFormatInfo.InvariantInfo, out result); - value = (object)result; + bool flag = float.TryParse(s, NumberStyles.Float, NumberFormatInfo.InvariantInfo, out result); + value = result; return flag; - })); + }); public static IList GetPositionList(string keyName, int expectedCount) { @@ -146,11 +146,11 @@ namespace UIXControls if (list != null) { float num1 = 0.0f; - foreach (float num2 in (IEnumerable)list) + foreach (float num2 in list) { - if ((double)num2 < (double)num1 || (double)num2 > 1.0) + if (num2 < (double)num1 || num2 > 1.0) { - list = (IList)null; + list = null; break; } num1 = num2;