From 1198cc8a66d1eff2fe108be69916ad35a3e3300e Mon Sep 17 00:00:00 2001 From: Joshua Askharoun Date: Thu, 3 Mar 2022 08:14:05 -0600 Subject: [PATCH] Add project files. --- MicrosoftIris.sln | 25 + UIX/.gitattributes | 63 + UIX/.gitignore | 340 + UIX/AssemblyInfo.cs | 24 + .../Iris/Accessibility/AccChildID.cs | 13 + UIX/Microsoft/Iris/Accessibility/AccEvents.cs | 55 + .../Iris/Accessibility/AccNavDirs.cs | 22 + .../Iris/Accessibility/AccObjectID.cs | 24 + UIX/Microsoft/Iris/Accessibility/AccRole.cs | 77 + .../Iris/Accessibility/AccSelFlags.cs | 22 + UIX/Microsoft/Iris/Accessibility/AccStates.cs | 49 + .../Iris/Accessibility/Accessible.cs | 478 + .../Iris/Accessibility/AccessibleChildren.cs | 98 + .../Iris/Accessibility/AccessibleProperty.cs | 37 + .../Iris/Accessibility/AccessibleProxy.cs | 549 + .../Iris/Accessibility/RootAccessibleProxy.cs | 53 + UIX/Microsoft/Iris/AggregateList.cs | 197 + .../Iris/Animations/ActiveSequence.cs | 309 + .../Iris/Animations/ActiveTransitions.cs | 33 + .../Iris/Animations/AlphaKeyframe.cs | 34 + UIX/Microsoft/Iris/Animations/Animation.cs | 152 + .../Iris/Animations/AnimationArgs.cs | 108 + .../Iris/Animations/AnimationCompleteArgs.cs | 19 + .../Iris/Animations/AnimationEventType.cs | 24 + .../Iris/Animations/AnimationHandle.cs | 47 + .../Iris/Animations/AnimationManager.cs | 141 + .../Iris/Animations/AnimationProxy.cs | 339 + .../Iris/Animations/AnimationSystem.cs | 81 + .../Iris/Animations/AnimationTemplate.cs | 208 + .../Iris/Animations/AnimationType.cs | 35 + .../Iris/Animations/BaseFloatKeyframe.cs | 50 + UIX/Microsoft/Iris/Animations/BaseKeyframe.cs | 139 + .../Animations/BaseMultiplyFloatKeyframe.cs | 15 + .../Animations/BaseMultiplyVector3Keyframe.cs | 31 + .../Iris/Animations/BaseRotationKeyframe.cs | 51 + .../Iris/Animations/BaseVector2Keyframe.cs | 50 + .../Iris/Animations/BaseVector3Keyframe.cs | 50 + .../Iris/Animations/BaseVector4Keyframe.cs | 50 + .../Iris/Animations/CameraAtKeyframe.cs | 25 + .../Iris/Animations/CameraEyeKeyframe.cs | 25 + .../Iris/Animations/CameraUpKeyframe.cs | 25 + .../Iris/Animations/CameraZnKeyframe.cs | 28 + .../Iris/Animations/EffectAnimation.cs | 21 + .../Iris/Animations/EffectColorKeyframe.cs | 26 + .../Iris/Animations/EffectFloatKeyframe.cs | 17 + .../Iris/Animations/EffectVector3Keyframe.cs | 19 + .../Iris/Animations/IAnimatableOwner.cs | 15 + .../Iris/Animations/IAnimationProvider.cs | 17 + .../Iris/Animations/Interpolation.cs | 106 + .../Iris/Animations/InterpolationType.cs | 21 + .../Iris/Animations/KeyframeFilter.cs | 18 + .../Iris/Animations/MergeAnimation.cs | 97 + .../Iris/Animations/NonIntensiveAnimation.cs | 12 + .../Iris/Animations/OrientationKeyframe.cs | 13 + .../Animations/OrphanedVisualCollection.cs | 95 + .../Iris/Animations/PositionKeyframe.cs | 66 + .../Iris/Animations/PositionXKeyframe.cs | 31 + .../Iris/Animations/PositionYKeyframe.cs | 31 + .../Iris/Animations/ReferenceAnimation.cs | 41 + UIX/Microsoft/Iris/Animations/RelativeTo.cs | 138 + .../Iris/Animations/RendererProperty.cs | 35 + .../Iris/Animations/RotateKeyframe.cs | 34 + .../Iris/Animations/ScaleKeyframe.cs | 60 + .../Iris/Animations/ScaleXKeyframe.cs | 31 + .../Iris/Animations/ScaleYKeyframe.cs | 31 + UIX/Microsoft/Iris/Animations/SizeKeyframe.cs | 28 + .../Iris/Animations/SizeXKeyframe.cs | 26 + .../Iris/Animations/SizeYKeyframe.cs | 26 + .../Iris/Animations/SnapshotPolicy.cs | 15 + .../Iris/Animations/SnapshotRelativeTo.cs | 21 + UIX/Microsoft/Iris/Animations/StopCommand.cs | 15 + .../Iris/Animations/StopCommandSet.cs | 47 + .../Iris/Animations/SwitchAnimation.cs | 63 + .../Iris/Animations/TransformAnimation.cs | 176 + .../Iris/Animations/TransformAttribute.cs | 17 + .../TransformByAttributeAnimation.cs | 174 + .../Iris/Animations/ValueTransformer.cs | 76 + UIX/Microsoft/Iris/Application.cs | 519 + UIX/Microsoft/Iris/ArrayListDataSet.cs | 23 + .../Iris/AssemblyDataProviderWrapper.cs | 30 + UIX/Microsoft/Iris/Audio/Sound.cs | 63 + UIX/Microsoft/Iris/BooleanChoice.cs | 68 + UIX/Microsoft/Iris/ByteRangedValue.cs | 52 + UIX/Microsoft/Iris/Choice.cs | 342 + .../CodeModel/Cpp/DllConstructorSchema.cs | 83 + .../Iris/CodeModel/Cpp/DllEnumProxy.cs | 36 + .../Iris/CodeModel/Cpp/DllEnumSchema.cs | 141 + .../Iris/CodeModel/Cpp/DllEventSchema.cs | 51 + .../Iris/CodeModel/Cpp/DllInterfaceProxy.cs | 25 + .../CodeModel/Cpp/DllIntrinsicTypeSchema.cs | 24 + .../Iris/CodeModel/Cpp/DllLoadResult.cs | 337 + .../CodeModel/Cpp/DllLoadResultFactory.cs | 118 + .../Iris/CodeModel/Cpp/DllMethodSchema.cs | 128 + .../Iris/CodeModel/Cpp/DllPropertySchema.cs | 165 + .../Iris/CodeModel/Cpp/DllProxyHandleTable.cs | 61 + .../Iris/CodeModel/Cpp/DllProxyList.cs | 319 + .../Iris/CodeModel/Cpp/DllProxyObject.cs | 272 + .../Cpp/DllProxyObjectHandleTable.cs | 19 + .../CodeModel/Cpp/DllProxyObjectReference.cs | 42 + .../Iris/CodeModel/Cpp/DllProxyServices.cs | 311 + .../Iris/CodeModel/Cpp/DllTypeSchema.cs | 548 + .../Iris/CodeModel/Cpp/DllTypeSchemaBase.cs | 215 + .../Cpp/MarkupDataQueryHandleTable.cs | 21 + .../Cpp/MarkupDataTypeHandleTable.cs | 21 + .../Cpp/NativeDataProviderWrapper.cs | 41 + .../CodeModel/Cpp/NativeTraceCategories.cs | 19 + .../Iris/CodeModel/Cpp/ProxyHandleTable.cs | 28 + .../Iris/CodeModel/Cpp/ProxyHandleTable`1.cs | 207 + .../Iris/CodeModel/Cpp/StringPinState.cs | 16 + .../CodeModel/Cpp/StringProxyHandleTable.cs | 76 + .../CodeModel/Cpp/TypeSchemaHandleTable.cs | 21 + UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs | 44 + .../Iris/CodeModel/Cpp/UIXIDVerifier.cs | 45 + .../Iris/CodeModel/Cpp/UIXVariant.cs | 267 + UIX/Microsoft/Iris/Command.cs | 127 + UIX/Microsoft/Iris/CompilerInput.cs | 15 + UIX/Microsoft/Iris/Data/INotifyList.cs | 17 + UIX/Microsoft/Iris/Data/IResourceProvider.cs | 13 + UIX/Microsoft/Iris/Data/IVirtualList.cs | 30 + UIX/Microsoft/Iris/Data/IntListUtility.cs | 37 + .../Iris/Data/ItemRequestCallback.cs | 10 + UIX/Microsoft/Iris/Data/ListUtility.cs | 80 + UIX/Microsoft/Iris/Data/Resource.cs | 135 + .../ResourceAcquisitionCompleteHandler.cs | 10 + UIX/Microsoft/Iris/Data/ResourceManager.cs | 138 + UIX/Microsoft/Iris/Data/ResourceStatus.cs | 16 + .../Iris/Data/SingleArrayListCache.cs | 30 + .../Data/SlowDataAcquireCompleteHandler.cs | 10 + UIX/Microsoft/Iris/Data/StringUtility.cs | 180 + .../Iris/Data/UIListContentsChangeType.cs | 21 + .../Iris/Data/UIListContentsChangedArgs.cs | 45 + .../Iris/Data/UIListContentsChangedHandler.cs | 14 + UIX/Microsoft/Iris/Data/UpdateHelper.cs | 192 + UIX/Microsoft/Iris/DataProviderMapping.cs | 70 + UIX/Microsoft/Iris/DataProviderObject.cs | 94 + .../DataProviderPropertyChangedEventArgs.cs | 21 + UIX/Microsoft/Iris/DataProviderQuery.cs | 204 + .../Iris/DataProviderQueryFactory.cs | 10 + UIX/Microsoft/Iris/DataProviderQueryStatus.cs | 17 + UIX/Microsoft/Iris/DeferredInvokeHandler.cs | 10 + UIX/Microsoft/Iris/DeferredInvokePriority.cs | 14 + UIX/Microsoft/Iris/DeferredInvokeProxy.cs | 22 + UIX/Microsoft/Iris/Drawing/Camera.cs | 448 + UIX/Microsoft/Iris/Drawing/Color.cs | 227 + .../Drawing/ContentLoadCompleteHandler.cs | 10 + UIX/Microsoft/Iris/Drawing/EditCursorType.cs | 14 + UIX/Microsoft/Iris/Drawing/Font.cs | 92 + UIX/Microsoft/Iris/Drawing/FontStyles.cs | 19 + UIX/Microsoft/Iris/Drawing/ImageStatus.cs | 16 + UIX/Microsoft/Iris/Drawing/RawImage.cs | 92 + UIX/Microsoft/Iris/Drawing/RawImageItem.cs | 49 + UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs | 29 + .../Iris/Drawing/ResourceImageItem.cs | 154 + UIX/Microsoft/Iris/Drawing/RichText.cs | 463 + UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs | 79 + UIX/Microsoft/Iris/Drawing/Rotation.cs | 66 + .../Iris/Drawing/ScavengeImageCache.cs | 88 + .../Iris/Drawing/ScrollbarEnableFlags.cs | 16 + UIX/Microsoft/Iris/Drawing/ScrollbarType.cs | 15 + UIX/Microsoft/Iris/Drawing/SimpleText.cs | 87 + UIX/Microsoft/Iris/Drawing/TextFlow.cs | 198 + UIX/Microsoft/Iris/Drawing/TextImageCache.cs | 88 + UIX/Microsoft/Iris/Drawing/TextImageItem.cs | 72 + .../Iris/Drawing/TextMeasureParams.cs | 153 + UIX/Microsoft/Iris/Drawing/TextRun.cs | 211 + UIX/Microsoft/Iris/Drawing/TextStyle.cs | 246 + UIX/Microsoft/Iris/Drawing/UIImage.cs | 194 + UIX/Microsoft/Iris/Drawing/UriImage.cs | 114 + UIX/Microsoft/Iris/Error.cs | 32 + UIX/Microsoft/Iris/ErrorReportHandler.cs | 10 + UIX/Microsoft/Iris/Group.cs | 59 + UIX/Microsoft/Iris/GroupedList.cs | 380 + UIX/Microsoft/Iris/ICommand.cs | 24 + UIX/Microsoft/Iris/IDataProvider.cs | 17 + UIX/Microsoft/Iris/IDataProviderBaseObject.cs | 15 + UIX/Microsoft/Iris/IDataProviderObject.cs | 12 + UIX/Microsoft/Iris/IDataProviderQuery.cs | 29 + UIX/Microsoft/Iris/IModelItem.cs | 20 + UIX/Microsoft/Iris/IModelItemOwner.cs | 15 + UIX/Microsoft/Iris/ISearchableList.cs | 13 + UIX/Microsoft/Iris/IThreadSafeObject.cs | 15 + UIX/Microsoft/Iris/IValueRange.cs | 23 + UIX/Microsoft/Iris/Image.cs | 195 + UIX/Microsoft/Iris/ImageFormatUtils.cs | 37 + UIX/Microsoft/Iris/ImageInset.cs | 36 + .../Iris/ImageLoadCompleteHandler.cs | 10 + UIX/Microsoft/Iris/IndexedTree.cs | 444 + UIX/Microsoft/Iris/Input/AppCommandMapping.cs | 54 + UIX/Microsoft/Iris/Input/CommandCode.cs | 98 + UIX/Microsoft/Iris/Input/DragDropInfo.cs | 70 + UIX/Microsoft/Iris/Input/DragOperation.cs | 17 + UIX/Microsoft/Iris/Input/HIDCommandMapping.cs | 76 + UIX/Microsoft/Iris/Input/HidDevice.cs | 24 + UIX/Microsoft/Iris/Input/ICookedInputSite.cs | 17 + UIX/Microsoft/Iris/Input/IInputCustomFocus.cs | 13 + UIX/Microsoft/Iris/Input/InputDevice.cs | 17 + UIX/Microsoft/Iris/Input/InputEventType.cs | 34 + UIX/Microsoft/Iris/Input/InputInfo.cs | 146 + UIX/Microsoft/Iris/Input/InputItem.cs | 89 + UIX/Microsoft/Iris/Input/InputManager.cs | 653 + UIX/Microsoft/Iris/Input/InputQueue.cs | 768 + UIX/Microsoft/Iris/Input/KeyActionInfo.cs | 71 + UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs | 59 + UIX/Microsoft/Iris/Input/KeyCommandInfo.cs | 44 + UIX/Microsoft/Iris/Input/KeyFocusInfo.cs | 54 + UIX/Microsoft/Iris/Input/KeyFocusReason.cs | 20 + UIX/Microsoft/Iris/Input/KeyInfo.cs | 12 + UIX/Microsoft/Iris/Input/KeyStateInfo.cs | 63 + UIX/Microsoft/Iris/Input/KeyboardDevice.cs | 285 + UIX/Microsoft/Iris/Input/MouseActionInfo.cs | 72 + UIX/Microsoft/Iris/Input/MouseButtonInfo.cs | 80 + UIX/Microsoft/Iris/Input/MouseDevice.cs | 103 + UIX/Microsoft/Iris/Input/MouseFocusInfo.cs | 57 + UIX/Microsoft/Iris/Input/MouseInfo.cs | 35 + UIX/Microsoft/Iris/Input/MouseMoveInfo.cs | 35 + UIX/Microsoft/Iris/Input/MouseWheelInfo.cs | 41 + .../Iris/InputHandlers/BeginDragPolicy.cs | 14 + .../Iris/InputHandlers/Characters.cs | 46 + .../Iris/InputHandlers/ClickCount.cs | 14 + .../Iris/InputHandlers/ClickHandler.cs | 482 + UIX/Microsoft/Iris/InputHandlers/ClickType.cs | 27 + .../Iris/InputHandlers/DragDropHelper.cs | 105 + .../Iris/InputHandlers/DragHandler.cs | 473 + .../Iris/InputHandlers/DragSourceHandler.cs | 279 + .../Iris/InputHandlers/DropAction.cs | 19 + .../Iris/InputHandlers/DropTargetHandler.cs | 102 + .../Iris/InputHandlers/EventContext.cs | 30 + .../Iris/InputHandlers/FocusChangeReason.cs | 21 + .../Iris/InputHandlers/FocusHandler.cs | 81 + .../Iris/InputHandlers/KeyHandler.cs | 273 + .../Iris/InputHandlers/KeyHandlerKey.cs | 155 + .../InputHandlers/ModifierInputHandler.cs | 63 + .../Iris/InputHandlers/MouseWheelHandler.cs | 51 + .../Iris/InputHandlers/ScrollingHandler.cs | 366 + .../Iris/InputHandlers/ShortcutHandler.cs | 94 + .../InputHandlers/ShortcutHandlerCommand.cs | 41 + .../Iris/InputHandlers/TextEditingHandler.cs | 1113 ++ .../Iris/InputHandlers/TypingHandler.cs | 224 + UIX/Microsoft/Iris/IntRangedValue.cs | 52 + UIX/Microsoft/Iris/InvokePolicy.cs | 15 + UIX/Microsoft/Iris/ItemCountHandler.cs | 10 + UIX/Microsoft/Iris/Key.cs | 16 + UIX/Microsoft/Iris/Layout/Alignment.cs | 17 + UIX/Microsoft/Iris/Layout/AreaOfInterest.cs | 93 + UIX/Microsoft/Iris/Layout/AreaOfInterestID.cs | 20 + .../Iris/Layout/AreaOfInterestLayoutInput.cs | 42 + .../Iris/Layout/ExtendedLayoutOutput.cs | 19 + UIX/Microsoft/Iris/Layout/ILayout.cs | 19 + UIX/Microsoft/Iris/Layout/ILayoutInput.cs | 15 + UIX/Microsoft/Iris/Layout/ILayoutNode.cs | 78 + UIX/Microsoft/Iris/Layout/ItemAlignment.cs | 54 + .../Iris/Layout/LayoutCompleteEventHandler.cs | 10 + UIX/Microsoft/Iris/Layout/LayoutConstants.cs | 13 + .../Iris/Layout/LayoutNodeEnumerator.cs | 44 + UIX/Microsoft/Iris/Layout/LayoutSlot.cs | 104 + UIX/Microsoft/Iris/Layout/SharedSize.cs | 222 + UIX/Microsoft/Iris/Layout/SharedSizePolicy.cs | 22 + UIX/Microsoft/Iris/Layout/Visibility.cs | 15 + UIX/Microsoft/Iris/Layouts/AnchorEdge.cs | 142 + UIX/Microsoft/Iris/Layouts/AnchorLayout.cs | 415 + .../Iris/Layouts/AnchorLayoutInput.cs | 63 + .../Iris/Layouts/ContentPositioningPolicy.cs | 14 + UIX/Microsoft/Iris/Layouts/DefaultLayout.cs | 46 + UIX/Microsoft/Iris/Layouts/DockLayout.cs | 124 + UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs | 44 + UIX/Microsoft/Iris/Layouts/FlipDirection.cs | 19 + UIX/Microsoft/Iris/Layouts/FlowLayout.cs | 790 + .../Iris/Layouts/FlowSizeMemoryLayoutInput.cs | 50 + UIX/Microsoft/Iris/Layouts/FormLayoutInput.cs | 12 + UIX/Microsoft/Iris/Layouts/GridLayout.cs | 650 + UIX/Microsoft/Iris/Layouts/InterestPoint.cs | 18 + .../Iris/Layouts/KeepAliveLayoutInput.cs | 31 + UIX/Microsoft/Iris/Layouts/MajorMinor.cs | 105 + .../Iris/Layouts/MissingItemPolicy.cs | 16 + UIX/Microsoft/Iris/Layouts/MouseTarget.cs | 15 + UIX/Microsoft/Iris/Layouts/PlacementMode.cs | 242 + UIX/Microsoft/Iris/Layouts/PopupLayout.cs | 288 + .../Iris/Layouts/PopupLayoutInput.cs | 120 + UIX/Microsoft/Iris/Layouts/PopupPosition.cs | 40 + UIX/Microsoft/Iris/Layouts/RelativeEdge.cs | 14 + UIX/Microsoft/Iris/Layouts/RepeatPolicy.cs | 16 + UIX/Microsoft/Iris/Layouts/RotateLayout.cs | 75 + UIX/Microsoft/Iris/Layouts/ScaleLayout.cs | 96 + .../Iris/Layouts/ScrollIntoViewDisposition.cs | 142 + UIX/Microsoft/Iris/Layouts/ScrollingLayout.cs | 333 + .../Iris/Layouts/ScrollingLayoutInput.cs | 119 + .../Iris/Layouts/ScrollingLayoutOutput.cs | 86 + UIX/Microsoft/Iris/Layouts/StackLayout.cs | 100 + .../Iris/Layouts/StackLayoutInput.cs | 34 + UIX/Microsoft/Iris/Layouts/StackPriority.cs | 15 + UIX/Microsoft/Iris/Layouts/StripAlignment.cs | 15 + .../Iris/Library/AncestorEnumerator.cs | 47 + UIX/Microsoft/Iris/Library/Bits.cs | 79 + UIX/Microsoft/Iris/Library/DataCookie.cs | 41 + .../Library/DisposableNotifyObjectBase.cs | 25 + .../Iris/Library/DisposableObject.cs | 38 + UIX/Microsoft/Iris/Library/DynamicData.cs | 45 + UIX/Microsoft/Iris/Library/EventCookie.cs | 41 + UIX/Microsoft/Iris/Library/ExpandableArray.cs | 161 + .../Iris/Library/IDisposableObject.cs | 19 + .../Iris/Library/IDisposableOwner.cs | 15 + UIX/Microsoft/Iris/Library/ITreeNode.cs | 17 + UIX/Microsoft/Iris/Library/KeyAllocator.cs | 17 + UIX/Microsoft/Iris/Library/Math2.cs | 45 + .../Iris/Library/NotifyObjectBase.cs | 25 + UIX/Microsoft/Iris/Library/Result.cs | 30 + .../Iris/Library/SharedDisposableObject.cs | 27 + UIX/Microsoft/Iris/Library/SmartMap.cs | 179 + .../Iris/Library/StackIListEnumerator.cs | 31 + .../Library/StackIListReverseEnumerator.cs | 30 + UIX/Microsoft/Iris/Library/TreeNode.cs | 261 + .../Iris/Library/TreeNodeCollection.cs | 116 + .../Iris/Library/TreeNodeEnumerator.cs | 43 + UIX/Microsoft/Iris/Library/Utility.cs | 13 + UIX/Microsoft/Iris/ListContentsChangeType.cs | 21 + UIX/Microsoft/Iris/ListContentsChangedArgs.cs | 43 + .../Iris/ListContentsChangedHandler.cs | 12 + .../Iris/ListContentsChangedProxy.cs | 65 + UIX/Microsoft/Iris/ListDataSet.cs | 365 + UIX/Microsoft/Iris/Markup/AliasMapping.cs | 22 + .../Iris/Markup/AssemblyConstructorSchema.cs | 39 + .../Iris/Markup/AssemblyEventSchema.cs | 21 + .../Iris/Markup/AssemblyLoadResult.cs | 356 + .../Iris/Markup/AssemblyMarkupDataQuery.cs | 74 + .../Iris/Markup/AssemblyMarkupDataType.cs | 37 + .../Iris/Markup/AssemblyMethodSchema.cs | 46 + .../Iris/Markup/AssemblyObjectProxyHelper.cs | 649 + .../Iris/Markup/AssemblyPropertySchema.cs | 77 + .../Iris/Markup/AssemblyTypeSchema.cs | 340 + UIX/Microsoft/Iris/Markup/BooleanBoxes.cs | 16 + UIX/Microsoft/Iris/Markup/ByteCodeReader.cs | 314 + UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs | 228 + .../Iris/Markup/ClassMethodSchema.cs | 25 + .../Iris/Markup/ClassPropertySchema.cs | 32 + UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs | 68 + UIX/Microsoft/Iris/Markup/CodeListeners.cs | 16 + .../Iris/Markup/CompilationMessage.cs | 22 + .../Iris/Markup/CompiledMarkupLoadResult.cs | 71 + .../Iris/Markup/CompiledMarkupLoader.cs | 807 + UIX/Microsoft/Iris/Markup/ConstructHandler.cs | 10 + .../Iris/Markup/ConstructorSchema.cs | 28 + .../Iris/Markup/CreateLoadResultHandler.cs | 10 + .../Iris/Markup/DecodeBinaryHandler.cs | 10 + .../Iris/Markup/DefaultConstructHandler.cs | 10 + UIX/Microsoft/Iris/Markup/DelegateListener.cs | 37 + .../Iris/Markup/DestructiveListener.cs | 30 + .../Iris/Markup/EffectClassTypeSchema.cs | 123 + .../Iris/Markup/EncodeBinaryHandler.cs | 10 + UIX/Microsoft/Iris/Markup/EnumSchema.cs | 211 + UIX/Microsoft/Iris/Markup/ErrorLoadResult.cs | 20 + UIX/Microsoft/Iris/Markup/EventSchema.cs | 26 + .../Iris/Markup/ExpressionRestriction.cs | 15 + .../Markup/FastReflectionInvokeHandler.cs | 10 + .../Markup/FindCanonicalInstanceHandler.cs | 10 + ...rkCompatibleAssemblyPrimitiveTypeSchema.cs | 42 + .../FrameworkCompatibleAssemblyTypeSchema.cs | 51 + UIX/Microsoft/Iris/Markup/GetValueHandler.cs | 10 + .../Iris/Markup/IDynamicConstructionSchema.cs | 13 + UIX/Microsoft/Iris/Markup/IMarkupTypeBase.cs | 38 + UIX/Microsoft/Iris/Markup/INotifyObject.cs | 13 + UIX/Microsoft/Iris/Markup/ISchemaInfo.cs | 13 + UIX/Microsoft/Iris/Markup/Int32Boxes.cs | 15 + UIX/Microsoft/Iris/Markup/Int64Boxes.cs | 15 + UIX/Microsoft/Iris/Markup/Interpreter.cs | 1647 ++ .../Iris/Markup/InterpreterContext.cs | 129 + UIX/Microsoft/Iris/Markup/InvokeHandler.cs | 10 + UIX/Microsoft/Iris/Markup/Listener.cs | 25 + .../Iris/Markup/ListenerEncodeMode.cs | 33 + UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs | 67 + UIX/Microsoft/Iris/Markup/ListenerRootNode.cs | 13 + UIX/Microsoft/Iris/Markup/ListenerType.cs | 15 + UIX/Microsoft/Iris/Markup/Listeners.cs | 37 + UIX/Microsoft/Iris/Markup/LoadPass.cs | 17 + UIX/Microsoft/Iris/Markup/LoadResult.cs | 117 + UIX/Microsoft/Iris/Markup/LoadResultCache.cs | 57 + UIX/Microsoft/Iris/Markup/LoadResultStatus.cs | 15 + UIX/Microsoft/Iris/Markup/ManagedXmlReader.cs | 379 + .../Iris/Markup/MarkupBinaryDataTable.cs | 79 + UIX/Microsoft/Iris/Markup/MarkupCompiler.cs | 603 + .../Iris/Markup/MarkupConstantPersist.cs | 15 + .../Iris/Markup/MarkupConstantPersistMode.cs | 15 + .../Iris/Markup/MarkupConstantsTable.cs | 127 + .../Iris/Markup/MarkupDataMapping.cs | 45 + .../Iris/Markup/MarkupDataMappingEntry.cs | 40 + .../Iris/Markup/MarkupDataProvider.cs | 100 + UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs | 44 + ...MarkupDataQueryPreDefinedPropertySchema.cs | 35 + .../Markup/MarkupDataQueryPropertySchema.cs | 39 + .../MarkupDataQueryRefreshMethodSchema.cs | 32 + .../Iris/Markup/MarkupDataQuerySchema.cs | 101 + UIX/Microsoft/Iris/Markup/MarkupDataType.cs | 16 + .../Iris/Markup/MarkupDataTypeBaseObject.cs | 67 + .../Markup/MarkupDataTypePropertySchema.cs | 25 + .../Iris/Markup/MarkupDataTypeSchema.cs | 27 + .../Iris/Markup/MarkupDebugHelper.cs | 33 + UIX/Microsoft/Iris/Markup/MarkupEncoder.cs | 903 + UIX/Microsoft/Iris/Markup/MarkupError.cs | 40 + .../Iris/Markup/MarkupImportTables.cs | 17 + .../Iris/Markup/MarkupLineNumberTable.cs | 78 + UIX/Microsoft/Iris/Markup/MarkupListener.cs | 50 + UIX/Microsoft/Iris/Markup/MarkupListeners.cs | 45 + UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs | 180 + .../Iris/Markup/MarkupMethodSchema.cs | 131 + .../Iris/Markup/MarkupPropertySchema.cs | 66 + UIX/Microsoft/Iris/Markup/MarkupServices.cs | 57 + UIX/Microsoft/Iris/Markup/MarkupSystem.cs | 261 + UIX/Microsoft/Iris/Markup/MarkupType.cs | 18 + UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs | 389 + UIX/Microsoft/Iris/Markup/MethodSchema.cs | 34 + .../Iris/Markup/MethodSignatureKey.cs | 46 + .../Iris/Markup/NamedContentRecord.cs | 18 + .../Iris/Markup/NativeCodeModelMessage.cs | 31 + .../Iris/Markup/NativeMarkupDataQuery.cs | 123 + .../Iris/Markup/NativeMarkupDataType.cs | 164 + UIX/Microsoft/Iris/Markup/NotificationID.cs | 314 + UIX/Microsoft/Iris/Markup/NotifyService.cs | 75 + UIX/Microsoft/Iris/Markup/ObjectSourceType.cs | 16 + UIX/Microsoft/Iris/Markup/OpCode.cs | 59 + UIX/Microsoft/Iris/Markup/OperationType.cs | 30 + UIX/Microsoft/Iris/Markup/ParameterContext.cs | 44 + UIX/Microsoft/Iris/Markup/ParseResult.cs | 23 + UIX/Microsoft/Iris/Markup/Parser.cs | 381 + .../Iris/Markup/PerformOperationHandler.cs | 10 + .../Iris/Markup/PropertyOverrideCriteria.cs | 15 + .../PropertyOverrideCriteriaTypeConstraint.cs | 34 + UIX/Microsoft/Iris/Markup/PropertySchema.cs | 48 + .../Iris/Markup/ProviderlessMarkupDataType.cs | 58 + UIX/Microsoft/Iris/Markup/RangeValidator.cs | 12 + UIX/Microsoft/Iris/Markup/ReflectionHelper.cs | 94 + UIX/Microsoft/Iris/Markup/RuntimeMessage.cs | 81 + .../Iris/Markup/SSLexUnicodeBufferConsumer.cs | 78 + UIX/Microsoft/Iris/Markup/SchemaType.cs | 19 + .../Iris/Markup/ScriptRunScheduler.cs | 77 + UIX/Microsoft/Iris/Markup/SetValueHandler.cs | 10 + .../Iris/Markup/SourceMarkupImportTables.cs | 59 + .../Iris/Markup/SourceMarkupLoadResult.cs | 84 + .../Iris/Markup/SourceMarkupLoader.cs | 450 + .../Iris/Markup/StandardAssemblyTypeSchema.cs | 18 + .../Iris/Markup/SupportsOperationHandler.cs | 10 + .../Markup/SupportsTypeConversionHandler.cs | 10 + UIX/Microsoft/Iris/Markup/SymbolOrigin.cs | 22 + UIX/Microsoft/Iris/Markup/SymbolRecord.cs | 16 + UIX/Microsoft/Iris/Markup/SymbolReference.cs | 24 + UIX/Microsoft/Iris/Markup/TypeConstraint.cs | 26 + .../Iris/Markup/TypeConverterHandler.cs | 15 + UIX/Microsoft/Iris/Markup/TypeSchema.cs | 248 + UIX/Microsoft/Iris/Markup/UIB.cs | 17 + .../Iris/Markup/UIClassMethodSchema.cs | 35 + .../Iris/Markup/UIClassPropertySchema.cs | 22 + .../Iris/Markup/UIClassTypeSchema.cs | 96 + .../Iris/Markup/UIX/AccessibleSchema.cs | 181 + UIX/Microsoft/Iris/Markup/UIX/AliasSchema.cs | 28 + .../Iris/Markup/UIX/AlphaKeyframeSchema.cs | 32 + .../Iris/Markup/UIX/AnchorEdgeSchema.cs | 175 + .../Markup/UIX/AnchorLayoutInputSchema.cs | 113 + .../Iris/Markup/UIX/AnchorLayoutSchema.cs | 106 + .../Iris/Markup/UIX/AnimationHandleSchema.cs | 34 + .../Iris/Markup/UIX/AnimationSchema.cs | 79 + UIX/Microsoft/Iris/Markup/UIX/BlendSchema.cs | 50 + UIX/Microsoft/Iris/Markup/UIX/BlurSchema.cs | 44 + .../Iris/Markup/UIX/BooleanChoiceSchema.cs | 39 + .../Iris/Markup/UIX/BooleanSchema.cs | 173 + .../Markup/UIX/BrightnessInstanceSchema.cs | 44 + .../Iris/Markup/UIX/BrightnessSchema.cs | 32 + .../Iris/Markup/UIX/ByteRangedValueSchema.cs | 67 + UIX/Microsoft/Iris/Markup/UIX/ByteSchema.cs | 216 + .../Iris/Markup/UIX/CameraAtKeyframeSchema.cs | 33 + .../Markup/UIX/CameraEyeKeyframeSchema.cs | 33 + UIX/Microsoft/Iris/Markup/UIX/CameraSchema.cs | 130 + .../Iris/Markup/UIX/CameraUpKeyframeSchema.cs | 33 + .../Iris/Markup/UIX/CameraZnKeyframeSchema.cs | 32 + .../Iris/Markup/UIX/CaretInfoSchema.cs | 48 + UIX/Microsoft/Iris/Markup/UIX/CharSchema.cs | 104 + UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs | 154 + UIX/Microsoft/Iris/Markup/UIX/ClassSchema.cs | 51 + .../Iris/Markup/UIX/ClassStateSchema.cs | 51 + .../Iris/Markup/UIX/ClickHandlerSchema.cs | 126 + UIX/Microsoft/Iris/Markup/UIX/ClipSchema.cs | 104 + .../Markup/UIX/ColorElementInstanceSchema.cs | 45 + .../Iris/Markup/UIX/ColorElementSchema.cs | 31 + UIX/Microsoft/Iris/Markup/UIX/ColorSchema.cs | 1030 ++ .../Iris/Markup/UIX/CommandSchema.cs | 49 + .../Iris/Markup/UIX/ContrastInstanceSchema.cs | 55 + .../Iris/Markup/UIX/ContrastSchema.cs | 43 + .../Iris/Markup/UIX/DataMappingSchema.cs | 38 + .../Iris/Markup/UIX/DataQuerySchema.cs | 36 + .../Iris/Markup/UIX/DataTypeSchema.cs | 29 + .../Iris/Markup/UIX/DebugOutlinesSchema.cs | 122 + UIX/Microsoft/Iris/Markup/UIX/DebugSchema.cs | 130 + .../Iris/Markup/UIX/DefaultLayoutSchema.cs | 21 + .../Markup/UIX/DesaturateInstanceSchema.cs | 55 + .../Iris/Markup/UIX/DesaturateSchema.cs | 43 + .../UIX/DestinationElementInstanceSchema.cs | 49 + .../Markup/UIX/DestinationElementSchema.cs | 49 + .../Iris/Markup/UIX/DictionarySchema.cs | 84 + .../Iris/Markup/UIX/DockLayoutInputSchema.cs | 85 + .../Iris/Markup/UIX/DockLayoutSchema.cs | 39 + UIX/Microsoft/Iris/Markup/UIX/DoubleSchema.cs | 239 + .../Iris/Markup/UIX/DragHandlerSchema.cs | 124 + .../Markup/UIX/DragSourceHandlerSchema.cs | 82 + .../Markup/UIX/DropTargetHandlerSchema.cs | 63 + .../Markup/UIX/EdgeDetectionInstanceSchema.cs | 55 + .../Iris/Markup/UIX/EdgeDetectionSchema.cs | 43 + .../Iris/Markup/UIX/EditableTextDataSchema.cs | 66 + .../Iris/Markup/UIX/EffectAnimationSchema.cs | 30 + .../Markup/UIX/EffectColorAnimationSchema.cs | 30 + .../Markup/UIX/EffectColorKeyframeSchema.cs | 33 + .../Markup/UIX/EffectElementInstanceSchema.cs | 19 + .../Iris/Markup/UIX/EffectElementSchema.cs | 30 + .../Markup/UIX/EffectFloatAnimationSchema.cs | 30 + .../Markup/UIX/EffectFloatKeyframeSchema.cs | 32 + .../Iris/Markup/UIX/EffectInputSchema.cs | 19 + .../Iris/Markup/UIX/EffectInstanceSchema.cs | 19 + .../Iris/Markup/UIX/EffectLayerSchema.cs | 39 + .../Iris/Markup/UIX/EffectOperationSchema.cs | 19 + UIX/Microsoft/Iris/Markup/UIX/EffectSchema.cs | 28 + .../UIX/EffectVector3AnimationSchema.cs | 30 + .../Markup/UIX/EffectVector3KeyframeSchema.cs | 33 + .../Iris/Markup/UIX/EmbossInstanceSchema.cs | 28 + UIX/Microsoft/Iris/Markup/UIX/EmbossSchema.cs | 32 + .../Iris/Markup/UIX/EnumeratorSchema.cs | 42 + .../Iris/Markup/UIX/EnvironmentSchema.cs | 86 + .../Iris/Markup/UIX/EventContextSchema.cs | 32 + .../Iris/Markup/UIX/FlowLayoutSchema.cs | 82 + .../Iris/Markup/UIX/FocusHandlerSchema.cs | 65 + UIX/Microsoft/Iris/Markup/UIX/FontSchema.cs | 337 + .../Iris/Markup/UIX/FormLayoutInputSchema.cs | 21 + .../Iris/Markup/UIX/GraphicSchema.cs | 97 + .../Iris/Markup/UIX/GridLayoutSchema.cs | 102 + UIX/Microsoft/Iris/Markup/UIX/GroupSchema.cs | 32 + UIX/Microsoft/Iris/Markup/UIX/HostSchema.cs | 461 + .../Iris/Markup/UIX/HwndHostSchema.cs | 36 + .../Iris/Markup/UIX/IAnimationSchema.cs | 19 + .../Markup/UIX/ImageElementInstanceSchema.cs | 34 + .../Iris/Markup/UIX/ImageElementSchema.cs | 37 + UIX/Microsoft/Iris/Markup/UIX/ImageSchema.cs | 334 + UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs | 38 + .../Iris/Markup/UIX/InputHandlerSchema.cs | 36 + UIX/Microsoft/Iris/Markup/UIX/InsetSchema.cs | 288 + UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs | 239 + UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs | 228 + .../Iris/Markup/UIX/IntRangedValueSchema.cs | 67 + .../UIX/InterpolateElementInstanceSchema.cs | 55 + .../Markup/UIX/InterpolateElementSchema.cs | 55 + .../Iris/Markup/UIX/InterpolationSchema.cs | 193 + .../Iris/Markup/UIX/InvAlphaSchema.cs | 21 + .../Iris/Markup/UIX/InvColorSchema.cs | 21 + UIX/Microsoft/Iris/Markup/UIX/InvertSchema.cs | 21 + .../Iris/Markup/UIX/ItemAlignmentSchema.cs | 160 + .../Iris/Markup/UIX/KeyHandlerSchema.cs | 127 + .../Iris/Markup/UIX/KeyframeSchema.cs | 42 + .../Iris/Markup/UIX/LayoutInputSchema.cs | 19 + .../Iris/Markup/UIX/LayoutOutputSchema.cs | 28 + UIX/Microsoft/Iris/Markup/UIX/LayoutSchema.cs | 97 + .../Markup/UIX/LightShaftInstanceSchema.cs | 130 + .../Iris/Markup/UIX/LightShaftSchema.cs | 109 + UIX/Microsoft/Iris/Markup/UIX/ListSchema.cs | 225 + .../Iris/Markup/UIX/MajorMinorSchema.cs | 119 + .../Iris/Markup/UIX/MappingSchema.cs | 48 + .../UIX/MarkupDataQueryInstanceSchema.cs | 46 + .../UIX/MarkupDataTypeInstanceSchema.cs | 17 + .../Iris/Markup/UIX/MarkupErrorSchema.cs | 46 + UIX/Microsoft/Iris/Markup/UIX/MarkupSchema.cs | 56 + UIX/Microsoft/Iris/Markup/UIX/MathSchema.cs | 288 + .../Iris/Markup/UIX/MergeAnimationSchema.cs | 36 + .../Markup/UIX/MouseWheelHandlerSchema.cs | 45 + UIX/Microsoft/Iris/Markup/UIX/NullSchema.cs | 44 + UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs | 53 + .../Markup/UIX/OrientationKeyframeSchema.cs | 33 + UIX/Microsoft/Iris/Markup/UIX/PanelSchema.cs | 31 + .../Iris/Markup/UIX/PlacementModeSchema.cs | 118 + .../Markup/UIX/PointLight2DInstanceSchema.cs | 114 + .../Iris/Markup/UIX/PointLight2DSchema.cs | 64 + UIX/Microsoft/Iris/Markup/UIX/PointSchema.cs | 153 + .../Iris/Markup/UIX/PopupLayoutInputSchema.cs | 72 + .../Iris/Markup/UIX/PopupLayoutSchema.cs | 21 + .../Iris/Markup/UIX/PopupPositionSchema.cs | 62 + .../Iris/Markup/UIX/PositionKeyframeSchema.cs | 33 + .../Markup/UIX/PositionXKeyframeSchema.cs | 32 + .../Markup/UIX/PositionYKeyframeSchema.cs | 32 + UIX/Microsoft/Iris/Markup/UIX/RandomSchema.cs | 108 + .../Iris/Markup/UIX/RangedValueSchema.cs | 71 + .../Iris/Markup/UIX/RectangleSchema.cs | 217 + .../Iris/Markup/UIX/RelativeToSchema.cs | 168 + .../Iris/Markup/UIX/RepeaterSchema.cs | 112 + .../Iris/Markup/UIX/RotateKeyframeSchema.cs | 33 + .../Iris/Markup/UIX/RotateLayoutSchema.cs | 59 + .../Iris/Markup/UIX/RotationSchema.cs | 215 + .../Iris/Markup/UIX/SavedKeyFocusSchema.cs | 19 + .../Iris/Markup/UIX/ScaleKeyframeSchema.cs | 33 + .../Iris/Markup/UIX/ScaleLayoutSchema.cs | 65 + .../Iris/Markup/UIX/ScaleXKeyframeSchema.cs | 32 + .../Iris/Markup/UIX/ScaleYKeyframeSchema.cs | 32 + .../Iris/Markup/UIX/ScrollModelBaseSchema.cs | 137 + .../Iris/Markup/UIX/ScrollModelSchema.cs | 114 + .../Iris/Markup/UIX/ScrollerSchema.cs | 50 + .../Iris/Markup/UIX/ScrollingHandlerSchema.cs | 76 + .../Iris/Markup/UIX/SelectionManagerSchema.cs | 196 + .../Iris/Markup/UIX/SelectionRangeSchema.cs | 112 + .../Iris/Markup/UIX/SepiaInstanceSchema.cs | 116 + UIX/Microsoft/Iris/Markup/UIX/SepiaSchema.cs | 67 + .../Iris/Markup/UIX/SharedSizeSchema.cs | 84 + .../Iris/Markup/UIX/ShortcutHandlerSchema.cs | 56 + UIX/Microsoft/Iris/Markup/UIX/SingleSchema.cs | 239 + .../Iris/Markup/UIX/SizeKeyframeSchema.cs | 33 + UIX/Microsoft/Iris/Markup/UIX/SizeSchema.cs | 126 + .../Iris/Markup/UIX/SizeXKeyframeSchema.cs | 32 + .../Iris/Markup/UIX/SizeYKeyframeSchema.cs | 32 + UIX/Microsoft/Iris/Markup/UIX/SoundSchema.cs | 100 + .../Markup/UIX/SpotLight2DInstanceSchema.cs | 165 + .../Iris/Markup/UIX/SpotLight2DSchema.cs | 100 + .../Iris/Markup/UIX/StackLayoutInputSchema.cs | 39 + .../Iris/Markup/UIX/StackLayoutSchema.cs | 21 + UIX/Microsoft/Iris/Markup/UIX/StringSchema.cs | 238 + .../Iris/Markup/UIX/SwitchAnimationSchema.cs | 43 + .../Markup/UIX/TextEditingHandlerSchema.cs | 203 + .../Iris/Markup/UIX/TextFragmentSchema.cs | 40 + .../Iris/Markup/UIX/TextRunDataSchema.cs | 40 + .../Iris/Markup/UIX/TextRunRendererSchema.cs | 46 + UIX/Microsoft/Iris/Markup/UIX/TextSchema.cs | 178 + .../Iris/Markup/UIX/TextScrollModelSchema.cs | 21 + .../Iris/Markup/UIX/TextStyleSchema.cs | 122 + UIX/Microsoft/Iris/Markup/UIX/TimerSchema.cs | 74 + .../Markup/UIX/TransformAnimationSchema.cs | 60 + .../TransformByAttributeAnimationSchema.cs | 62 + .../Iris/Markup/UIX/TypeConstraintSchema.cs | 36 + .../Iris/Markup/UIX/TypeSchemaDefinition.cs | 17 + .../Iris/Markup/UIX/TypeSelectorSchema.cs | 38 + .../Iris/Markup/UIX/TypingHandlerSchema.cs | 56 + UIX/Microsoft/Iris/Markup/UIX/UISchema.cs | 59 + .../Iris/Markup/UIX/UIStateSchema.cs | 169 + .../Iris/Markup/UIX/ValueRangeSchema.cs | 54 + .../Iris/Markup/UIX/ValueTransformerSchema.cs | 82 + .../Iris/Markup/UIX/Vector2Schema.cs | 238 + .../Iris/Markup/UIX/Vector3Schema.cs | 179 + .../Markup/UIX/VideoElementInstanceSchema.cs | 29 + .../Iris/Markup/UIX/VideoElementSchema.cs | 37 + UIX/Microsoft/Iris/Markup/UIX/VideoSchema.cs | 45 + .../Iris/Markup/UIX/VideoStreamSchema.cs | 28 + .../Iris/Markup/UIX/ViewItemSchema.cs | 456 + UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs | 17 + UIX/Microsoft/Iris/Markup/UIX/WindowSchema.cs | 155 + .../Iris/Markup/UIXConstructorSchema.cs | 28 + UIX/Microsoft/Iris/Markup/UIXEnumData.cs | 819 + UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs | 27 + UIX/Microsoft/Iris/Markup/UIXEventSchema.cs | 19 + UIX/Microsoft/Iris/Markup/UIXLoadResult.cs | 59 + .../Iris/Markup/UIXLoadResultExports.cs | 520 + UIX/Microsoft/Iris/Markup/UIXMethodSchema.cs | 43 + .../Iris/Markup/UIXPropertySchema.cs | 72 + UIX/Microsoft/Iris/Markup/UIXTypeFlags.cs | 16 + UIX/Microsoft/Iris/Markup/UIXTypeID.cs | 256 + UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs | 255 + UIX/Microsoft/Iris/Markup/UIXTypes.cs | 31 + UIX/Microsoft/Iris/Markup/ValidateMessage.cs | 155 + .../Iris/Markup/Validation/CastMethod.cs | 14 + .../Iris/Markup/Validation/ConstantType.cs | 20 + .../Iris/Markup/Validation/ExpressionType.cs | 29 + .../Iris/Markup/Validation/ExpressionUsage.cs | 15 + .../Iris/Markup/Validation/MethodSpecifier.cs | 14 + .../Iris/Markup/Validation/NameUsage.cs | 17 + .../Markup/Validation/PropertyAttribute.cs | 25 + .../Iris/Markup/Validation/StatementType.cs | 23 + .../Validation/SymbolResolutionDirective.cs | 14 + .../Iris/Markup/Validation/TriggerRecord.cs | 14 + .../Iris/Markup/Validation/TypeRestriction.cs | 66 + .../Iris/Markup/Validation/Validate.cs | 83 + .../Iris/Markup/Validation/ValidateAlias.cs | 67 + .../Iris/Markup/Validation/ValidateClass.cs | 392 + .../Iris/Markup/Validation/ValidateCode.cs | 158 + .../Iris/Markup/Validation/ValidateContext.cs | 629 + .../Markup/Validation/ValidateDataMapping.cs | 166 + .../Markup/Validation/ValidateDataQuery.cs | 53 + .../Markup/Validation/ValidateDataType.cs | 81 + .../Iris/Markup/Validation/ValidateEffect.cs | 177 + .../Validation/ValidateEffectElement.cs | 40 + .../Markup/Validation/ValidateExpression.cs | 58 + .../Markup/Validation/ValidateExpressionAs.cs | 47 + .../ValidateExpressionAssignment.cs | 55 + .../Validation/ValidateExpressionBaseClass.cs | 25 + .../Validation/ValidateExpressionCall.cs | 269 + .../Validation/ValidateExpressionCast.cs | 120 + .../Validation/ValidateExpressionConstant.cs | 106 + .../ValidateExpressionDeclareTrigger.cs | 76 + .../Validation/ValidateExpressionIndex.cs | 58 + .../Validation/ValidateExpressionIsCheck.cs | 45 + .../Validation/ValidateExpressionList.cs | 56 + .../Validation/ValidateExpressionNew.cs | 109 + .../ValidateExpressionNullCoalescing.cs | 60 + .../Validation/ValidateExpressionOperation.cs | 163 + .../Validation/ValidateExpressionSymbol.cs | 75 + .../Validation/ValidateExpressionTernary.cs | 60 + .../Validation/ValidateExpressionThis.cs | 23 + .../Validation/ValidateExpressionTypeOf.cs | 37 + .../Markup/Validation/ValidateFromString.cs | 70 + .../Markup/Validation/ValidateMetadata.cs | 14 + .../Iris/Markup/Validation/ValidateMethod.cs | 194 + .../Markup/Validation/ValidateMethodList.cs | 82 + .../Markup/Validation/ValidateNamespace.cs | 57 + .../Iris/Markup/Validation/ValidateObject.cs | 44 + .../Markup/Validation/ValidateObjectTag.cs | 396 + .../Markup/Validation/ValidateParameter.cs | 63 + .../Validation/ValidateParameterDefinition.cs | 42 + .../ValidateParameterDefinitionList.cs | 33 + .../Markup/Validation/ValidateProperty.cs | 358 + .../Iris/Markup/Validation/ValidateScripts.cs | 49 + .../Markup/Validation/ValidateStatement.cs | 42 + .../Validation/ValidateStatementAssignment.cs | 59 + .../Validation/ValidateStatementAttribute.cs | 100 + .../Validation/ValidateStatementBreak.cs | 48 + .../Validation/ValidateStatementCompound.cs | 52 + .../Validation/ValidateStatementExpression.cs | 33 + .../Validation/ValidateStatementForEach.cs | 92 + .../Markup/Validation/ValidateStatementIf.cs | 43 + .../Validation/ValidateStatementIfElse.cs | 51 + .../Validation/ValidateStatementLoop.cs | 26 + .../Validation/ValidateStatementReturn.cs | 52 + .../ValidateStatementScopedLocal.cs | 70 + .../Validation/ValidateStatementWhile.cs | 56 + .../Validation/ValidateTypeConstraint.cs | 62 + .../Validation/ValidateTypeIdentifier.cs | 83 + .../Iris/Markup/Validation/ValidateUI.cs | 175 + .../Iris/Markup/Validation/ValueApplyMode.cs | 20 + UIX/Microsoft/Iris/MaximizeMode.cs | 14 + UIX/Microsoft/Iris/ModelItem.cs | 328 + UIX/Microsoft/Iris/ModelItemDisposeMode.cs | 14 + .../Iris/ModelItems/BooleanChoice.cs | 43 + .../Iris/ModelItems/ByteRangedValue.cs | 23 + UIX/Microsoft/Iris/ModelItems/CaretInfo.cs | 94 + UIX/Microsoft/Iris/ModelItems/Choice.cs | 278 + UIX/Microsoft/Iris/ModelItems/Clipboard.cs | 20 + .../Iris/ModelItems/EditableTextData.cs | 93 + .../ModelItems/ITextScrollModelCallback.cs | 21 + .../Iris/ModelItems/IUIBooleanChoice.cs | 15 + .../Iris/ModelItems/IUIByteRangedValue.cs | 14 + UIX/Microsoft/Iris/ModelItems/IUIChoice.cs | 41 + UIX/Microsoft/Iris/ModelItems/IUICommand.cs | 17 + UIX/Microsoft/Iris/ModelItems/IUIGroup.cs | 17 + .../Iris/ModelItems/IUIIntRangedValue.cs | 14 + UIX/Microsoft/Iris/ModelItems/IUIList.cs | 19 + .../Iris/ModelItems/IUIRangedValue.cs | 23 + .../Iris/ModelItems/IUIValueRange.cs | 21 + .../Iris/ModelItems/IntRangedValue.cs | 23 + .../Iris/ModelItems/InvokePriority.cs | 14 + UIX/Microsoft/Iris/ModelItems/LayoutOutput.cs | 33 + UIX/Microsoft/Iris/ModelItems/NotifyList.cs | 111 + UIX/Microsoft/Iris/ModelItems/Range.cs | 79 + UIX/Microsoft/Iris/ModelItems/RangedValue.cs | 134 + UIX/Microsoft/Iris/ModelItems/ScrollModel.cs | 908 + .../Iris/ModelItems/ScrollModelBase.cs | 43 + .../Iris/ModelItems/SelectionManager.cs | 536 + .../Iris/ModelItems/TextScrollModel.cs | 247 + UIX/Microsoft/Iris/ModelItems/UICommand.cs | 60 + UIX/Microsoft/Iris/ModelItems/UITimer.cs | 56 + .../Iris/Navigation/FindFromPointWorker.cs | 158 + .../Iris/Navigation/INavigationSite.cs | 38 + .../Iris/Navigation/NavigationClass.cs | 14 + .../Iris/Navigation/NavigationFlow.cs | 208 + .../Iris/Navigation/NavigationItem.cs | 623 + .../Iris/Navigation/NavigationOrder.cs | 41 + .../Iris/Navigation/NavigationOrientation.cs | 19 + .../Iris/Navigation/NavigationPolicies.cs | 35 + .../Iris/Navigation/NavigationServices.cs | 298 + .../Iris/Navigation/NavigationSpace.cs | 259 + .../Iris/Navigation/NavigationStrip.cs | 205 + .../Navigation/TransientNavigationSite.cs | 85 + UIX/Microsoft/Iris/OS/CLR/NativeMethods.cs | 18 + .../Iris/OS/CLR/StandardOleMarshalObject.cs | 120 + .../Iris/OS/CLR/UnsafeNativeMethods.cs | 95 + UIX/Microsoft/Iris/OS/COMResult.cs | 21 + UIX/Microsoft/Iris/OS/DataObject.cs | 57 + UIX/Microsoft/Iris/OS/DllResource.cs | 42 + UIX/Microsoft/Iris/OS/DllResources.cs | 92 + UIX/Microsoft/Iris/OS/FileResource.cs | 90 + UIX/Microsoft/Iris/OS/FileResources.cs | 19 + UIX/Microsoft/Iris/OS/HttpResource.cs | 64 + UIX/Microsoft/Iris/OS/HttpResources.cs | 43 + UIX/Microsoft/Iris/OS/IImeCallbacks.cs | 21 + UIX/Microsoft/Iris/OS/IRawUIXServices.cs | 76 + UIX/Microsoft/Iris/OS/IRichTextCallbacks.cs | 69 + UIX/Microsoft/Iris/OS/IUIXListCallbacks.cs | 22 + UIX/Microsoft/Iris/OS/NativeApi.cs | 942 + UIX/Microsoft/Iris/OS/NativeXmlException.cs | 31 + UIX/Microsoft/Iris/OS/NativeXmlNodeType.cs | 23 + UIX/Microsoft/Iris/OS/NativeXmlReader.cs | 456 + UIX/Microsoft/Iris/OS/Win32Api.cs | 398 + UIX/Microsoft/Iris/ObjectPropertyPair.cs | 24 + UIX/Microsoft/Iris/PropertySet.cs | 166 + UIX/Microsoft/Iris/PropertyValue.cs | 26 + .../Iris/ProviderlessDataProviderObject.cs | 35 + UIX/Microsoft/Iris/Queues/Dispatcher.cs | 193 + UIX/Microsoft/Iris/Queues/Feeder.cs | 70 + UIX/Microsoft/Iris/Queues/Interconnect.cs | 54 + UIX/Microsoft/Iris/Queues/PriorityQueue.cs | 256 + UIX/Microsoft/Iris/Queues/Queue.cs | 28 + UIX/Microsoft/Iris/Queues/QueueItem.cs | 254 + UIX/Microsoft/Iris/Queues/SimpleQueue.cs | 45 + UIX/Microsoft/Iris/RangedValue.cs | 205 + UIX/Microsoft/Iris/RawImageFormat.cs | 15 + UIX/Microsoft/Iris/ReleaseBehavior.cs | 15 + .../Iris/RenderAPI/Audio/SoundData.cs | 126 + .../Iris/RenderAPI/Audio/SoundManager.cs | 109 + .../Iris/RenderAPI/Audio/SystemSoundEvent.cs | 42 + .../RenderAPI/Audio/SystemSoundEventTable.cs | 83 + UIX/Microsoft/Iris/RenderAPI/Drawing/Dib.cs | 51 + .../Iris/RenderAPI/Drawing/EdgeFade.cs | 205 + .../Iris/RenderAPI/Drawing/PointF.cs | 71 + .../Iris/RenderAPI/Drawing/RectangleF.cs | 205 + UIX/Microsoft/Iris/RenderAPI/Drawing/SizeF.cs | 96 + UIX/Microsoft/Iris/RenderAPI/HRESULT.cs | 42 + UIX/Microsoft/Iris/RenderAPI/Memory.cs | 93 + .../Iris/RenderAPI/RenderException.cs | 93 + UIX/Microsoft/Iris/RenderAPI/RendererApi.cs | 101 + .../VideoPlayback/BasicVideoGeometry.cs | 21 + .../VideoPlayback/BasicVideoPresentation.cs | 30 + .../RenderAPI/VideoPlayback/IUIVideoPortal.cs | 23 + .../RenderAPI/VideoPlayback/IUIVideoStream.cs | 17 + .../VideoPlayback/LinearVideoStretch.cs | 115 + .../VideoPlayback/VideoDisplayMode.cs | 16 + .../VideoPlayback/VideoOverscanMode.cs | 15 + .../VideoPlayback/VideoPresentationBuilder.cs | 368 + .../VideoPlayback/VideoZoomHandler.cs | 16 + UIX/Microsoft/Iris/RenderingQuality.cs | 14 + UIX/Microsoft/Iris/RenderingType.cs | 15 + UIX/Microsoft/Iris/RequestItemHandler.cs | 10 + UIX/Microsoft/Iris/RequestSlowDataHandler.cs | 10 + UIX/Microsoft/Iris/Session/DeferredCall.cs | 200 + UIX/Microsoft/Iris/Session/DeferredHandler.cs | 10 + UIX/Microsoft/Iris/Session/Direction.cs | 18 + .../Iris/Session/DispatchPriority.cs | 30 + UIX/Microsoft/Iris/Session/DispatcherTimer.cs | 220 + UIX/Microsoft/Iris/Session/EffectManager.cs | 98 + UIX/Microsoft/Iris/Session/ErrorManager.cs | 306 + UIX/Microsoft/Iris/Session/ErrorRecord.cs | 17 + UIX/Microsoft/Iris/Session/ErrorWatermark.cs | 17 + .../Iris/Session/EventRouteStages.cs | 22 + UIX/Microsoft/Iris/Session/Form.cs | 509 + .../Iris/Session/FormSessionConnectHandler.cs | 10 + .../Iris/Session/IErrorContextSource.cs | 15 + UIX/Microsoft/Iris/Session/IModalSession.cs | 13 + UIX/Microsoft/Iris/Session/ITimerOwner.cs | 13 + .../Iris/Session/ITrackableUIElement.cs | 17 + .../Iris/Session/ITrackableUIElementEvents.cs | 15 + .../Iris/Session/IZoneDisplayChild.cs | 13 + .../Iris/Session/InputDeliveryStatus.cs | 14 + .../Session/InputNotificationEventArgs.cs | 33 + .../Iris/Session/InputNotificationHandler.cs | 10 + .../Iris/Session/InvalidKeyFocusHandler.cs | 12 + .../Iris/Session/KeyCoalesceFilter.cs | 12 + UIX/Microsoft/Iris/Session/LoopCondition.cs | 10 + .../Iris/Session/NotifyErrorBatch.cs | 12 + UIX/Microsoft/Iris/Session/SimpleCallback.cs | 10 + UIX/Microsoft/Iris/Session/StaticServices.cs | 17 + UIX/Microsoft/Iris/Session/TimeoutHandler.cs | 10 + UIX/Microsoft/Iris/Session/TimeoutManager.cs | 311 + UIX/Microsoft/Iris/Session/TransformSet.cs | 18 + UIX/Microsoft/Iris/Session/UIApplication.cs | 126 + UIX/Microsoft/Iris/Session/UIDispatcher.cs | 336 + UIX/Microsoft/Iris/Session/UISession.cs | 409 + UIX/Microsoft/Iris/Session/UiTask.cs | 16 + UIX/Microsoft/Iris/SessionConnectedHandler.cs | 10 + .../Iris/SimpleAnimationPropertyMap.cs | 27 + UIX/Microsoft/Iris/SoundType.cs | 14 + UIX/Microsoft/Iris/ThreadSafety.cs | 21 + UIX/Microsoft/Iris/ThreadSafetyBlock.cs | 45 + UIX/Microsoft/Iris/Timer.cs | 135 + .../Iris/UI/ChildFaultedInDelegate.cs | 10 + UIX/Microsoft/Iris/UI/Class.cs | 158 + UIX/Microsoft/Iris/UI/ColorScheme.cs | 15 + UIX/Microsoft/Iris/UI/EffectClass.cs | 158 + UIX/Microsoft/Iris/UI/EffectElementWrapper.cs | 86 + UIX/Microsoft/Iris/UI/EffectProperty.cs | 39 + UIX/Microsoft/Iris/UI/EffectValue.cs | 57 + UIX/Microsoft/Iris/UI/EffectValueType.cs | 19 + UIX/Microsoft/Iris/UI/Environment.cs | 84 + UIX/Microsoft/Iris/UI/FindChildResult.cs | 15 + UIX/Microsoft/Iris/UI/FocusStateHandler.cs | 13 + .../Iris/UI/FormCloseRequestedHandler.cs | 12 + .../Iris/UI/FormPropertyChangedHandler.cs | 10 + UIX/Microsoft/Iris/UI/InputEventHandler.cs | 12 + UIX/Microsoft/Iris/UI/InputHandler.cs | 336 + UIX/Microsoft/Iris/UI/InputHandlerList.cs | 17 + .../Iris/UI/InputHandlerModifiers.cs | 21 + UIX/Microsoft/Iris/UI/InputHandlerStage.cs | 18 + .../Iris/UI/InputHandlerTransition.cs | 14 + UIX/Microsoft/Iris/UI/RootLoadResult.cs | 36 + UIX/Microsoft/Iris/UI/RootUI.cs | 33 + UIX/Microsoft/Iris/UI/SavedKeyFocus.cs | 17 + UIX/Microsoft/Iris/UI/SessionInputHandler.cs | 13 + UIX/Microsoft/Iris/UI/UIClass.cs | 1454 ++ UIX/Microsoft/Iris/UI/UIForm.cs | 407 + UIX/Microsoft/Iris/UI/UIZone.cs | 592 + UIX/Microsoft/Iris/UI/ViewItem.cs | 2880 +++ UIX/Microsoft/Iris/UI/ViewItemID.cs | 50 + UIX/Microsoft/Iris/VideoStream.cs | 289 + UIX/Microsoft/Iris/ViewItems/Clip.cs | 228 + .../Iris/ViewItems/ContentViewItem.cs | 70 + .../Iris/ViewItems/CountLayoutInput.cs | 31 + UIX/Microsoft/Iris/ViewItems/Graphic.cs | 452 + UIX/Microsoft/Iris/ViewItems/Host.cs | 508 + .../Iris/ViewItems/HostRequestPacket.cs | 26 + UIX/Microsoft/Iris/ViewItems/HostStatus.cs | 16 + UIX/Microsoft/Iris/ViewItems/HwndHost.cs | 114 + .../Iris/ViewItems/ICustomRepeatedItem.cs | 13 + UIX/Microsoft/Iris/ViewItems/ImageLayout.cs | 76 + UIX/Microsoft/Iris/ViewItems/Index.cs | 55 + .../Iris/ViewItems/IndexLayoutInput.cs | 34 + UIX/Microsoft/Iris/ViewItems/IndexType.cs | 14 + UIX/Microsoft/Iris/ViewItems/LineAlignment.cs | 15 + .../ViewItems/PaintInvalidEventHandler.cs | 10 + UIX/Microsoft/Iris/ViewItems/Panel.cs | 14 + UIX/Microsoft/Iris/ViewItems/Repeater.cs | 1203 ++ .../Iris/ViewItems/RepeaterContentSelector.cs | 40 + .../RepeaterListContentsChangedArgs.cs | 33 + UIX/Microsoft/Iris/ViewItems/RootViewItem.cs | 43 + UIX/Microsoft/Iris/ViewItems/Scroller.cs | 76 + UIX/Microsoft/Iris/ViewItems/SizingPolicy.cs | 15 + .../Iris/ViewItems/StretchingPolicy.cs | 16 + UIX/Microsoft/Iris/ViewItems/Text.cs | 1493 ++ UIX/Microsoft/Iris/ViewItems/TextBounds.cs | 20 + .../Iris/ViewItems/TextFlowRenderingHelper.cs | 47 + UIX/Microsoft/Iris/ViewItems/TextFragment.cs | 81 + UIX/Microsoft/Iris/ViewItems/TextRunData.cs | 61 + .../Iris/ViewItems/TextRunRenderer.cs | 119 + UIX/Microsoft/Iris/ViewItems/TextSharpness.cs | 14 + UIX/Microsoft/Iris/ViewItems/TypeSelector.cs | 30 + .../Iris/ViewItems/UIPropertyRecord.cs | 37 + UIX/Microsoft/Iris/ViewItems/Video.cs | 169 + .../VisibleIndexRangeLayoutOutput.cs | 51 + UIX/Microsoft/Iris/VirtualList.cs | 844 + UIX/Microsoft/Iris/Window.cs | 425 + .../Iris/WindowCloseRequestedEventArgs.cs | 19 + .../Iris/WindowCloseRequestedHandler.cs | 12 + UIX/Microsoft/Iris/WindowColor.cs | 52 + UIX/Microsoft/Iris/WindowPosition.cs | 32 + UIX/Microsoft/Iris/WindowPositionPolicy.cs | 18 + UIX/Microsoft/Iris/WindowSize.cs | 38 + UIX/Microsoft/Iris/WindowState.cs | 15 + UIX/ParserLexClass.cs | 87 + UIX/ParserLexTable.cs | 2486 +++ UIX/ParserYaccClass.cs | 387 + UIX/ParserYaccTable.cs | 15327 ++++++++++++++++ UIX/SSVParseLib/SSLex.cs | 143 + UIX/SSVParseLib/SSLexConsumer.cs | 110 + UIX/SSVParseLib/SSLexFinalState.cs | 54 + UIX/SSVParseLib/SSLexLexeme.cs | 69 + UIX/SSVParseLib/SSLexMark.cs | 24 + UIX/SSVParseLib/SSLexSubtable.cs | 36 + UIX/SSVParseLib/SSLexTable.cs | 51 + UIX/SSVParseLib/SSLexTableRow.cs | 40 + UIX/SSVParseLib/SSLexTableRowEntry.cs | 28 + UIX/SSVParseLib/SSYacc.cs | 331 + UIX/SSVParseLib/SSYaccCache.cs | 23 + UIX/SSVParseLib/SSYaccStack.cs | 29 + UIX/SSVParseLib/SSYaccStackElement.cs | 29 + UIX/SSVParseLib/SSYaccTable.cs | 26 + UIX/SSVParseLib/SSYaccTableProd.cs | 24 + UIX/SSVParseLib/SSYaccTableRow.cs | 62 + UIX/SSVParseLib/SSYaccTableRowEntry.cs | 41 + UIX/UIX.csproj | 1061 ++ UIX/UIXSign/App.config | 6 + UIX/UIXSign/Program.cs | 66 + UIX/UIXSign/Properties/AssemblyInfo.cs | 36 + UIX/UIXSign/UIXSign.csproj | 78 + UIX/UIXSign/packages.config | 4 + UIX/app.config | 15 + UIX/packages.config | 5 + 967 files changed, 118389 insertions(+) create mode 100644 MicrosoftIris.sln create mode 100644 UIX/.gitattributes create mode 100644 UIX/.gitignore create mode 100644 UIX/AssemblyInfo.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccChildID.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccEvents.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccNavDirs.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccObjectID.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccRole.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccSelFlags.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccStates.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/Accessible.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccessibleChildren.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccessibleProperty.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/AccessibleProxy.cs create mode 100644 UIX/Microsoft/Iris/Accessibility/RootAccessibleProxy.cs create mode 100644 UIX/Microsoft/Iris/AggregateList.cs create mode 100644 UIX/Microsoft/Iris/Animations/ActiveSequence.cs create mode 100644 UIX/Microsoft/Iris/Animations/ActiveTransitions.cs create mode 100644 UIX/Microsoft/Iris/Animations/AlphaKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/Animation.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationArgs.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationCompleteArgs.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationEventType.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationHandle.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationManager.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationProxy.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationSystem.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationTemplate.cs create mode 100644 UIX/Microsoft/Iris/Animations/AnimationType.cs create mode 100644 UIX/Microsoft/Iris/Animations/BaseFloatKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/BaseKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/BaseMultiplyFloatKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/BaseMultiplyVector3Keyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/BaseRotationKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/BaseVector2Keyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/BaseVector3Keyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/BaseVector4Keyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/CameraAtKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/CameraEyeKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/CameraUpKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/CameraZnKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/EffectAnimation.cs create mode 100644 UIX/Microsoft/Iris/Animations/EffectColorKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/EffectFloatKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/EffectVector3Keyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/IAnimatableOwner.cs create mode 100644 UIX/Microsoft/Iris/Animations/IAnimationProvider.cs create mode 100644 UIX/Microsoft/Iris/Animations/Interpolation.cs create mode 100644 UIX/Microsoft/Iris/Animations/InterpolationType.cs create mode 100644 UIX/Microsoft/Iris/Animations/KeyframeFilter.cs create mode 100644 UIX/Microsoft/Iris/Animations/MergeAnimation.cs create mode 100644 UIX/Microsoft/Iris/Animations/NonIntensiveAnimation.cs create mode 100644 UIX/Microsoft/Iris/Animations/OrientationKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/OrphanedVisualCollection.cs create mode 100644 UIX/Microsoft/Iris/Animations/PositionKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/PositionXKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/PositionYKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/ReferenceAnimation.cs create mode 100644 UIX/Microsoft/Iris/Animations/RelativeTo.cs create mode 100644 UIX/Microsoft/Iris/Animations/RendererProperty.cs create mode 100644 UIX/Microsoft/Iris/Animations/RotateKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/ScaleKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/ScaleXKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/ScaleYKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/SizeKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/SizeXKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/SizeYKeyframe.cs create mode 100644 UIX/Microsoft/Iris/Animations/SnapshotPolicy.cs create mode 100644 UIX/Microsoft/Iris/Animations/SnapshotRelativeTo.cs create mode 100644 UIX/Microsoft/Iris/Animations/StopCommand.cs create mode 100644 UIX/Microsoft/Iris/Animations/StopCommandSet.cs create mode 100644 UIX/Microsoft/Iris/Animations/SwitchAnimation.cs create mode 100644 UIX/Microsoft/Iris/Animations/TransformAnimation.cs create mode 100644 UIX/Microsoft/Iris/Animations/TransformAttribute.cs create mode 100644 UIX/Microsoft/Iris/Animations/TransformByAttributeAnimation.cs create mode 100644 UIX/Microsoft/Iris/Animations/ValueTransformer.cs create mode 100644 UIX/Microsoft/Iris/Application.cs create mode 100644 UIX/Microsoft/Iris/ArrayListDataSet.cs create mode 100644 UIX/Microsoft/Iris/AssemblyDataProviderWrapper.cs create mode 100644 UIX/Microsoft/Iris/Audio/Sound.cs create mode 100644 UIX/Microsoft/Iris/BooleanChoice.cs create mode 100644 UIX/Microsoft/Iris/ByteRangedValue.cs create mode 100644 UIX/Microsoft/Iris/Choice.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllConstructorSchema.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumProxy.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumSchema.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllEventSchema.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllInterfaceProxy.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllIntrinsicTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResult.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResultFactory.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllMethodSchema.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllPropertySchema.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyHandleTable.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyList.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObject.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectHandleTable.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectReference.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyServices.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchemaBase.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/MarkupDataQueryHandleTable.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/MarkupDataTypeHandleTable.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/NativeDataProviderWrapper.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/NativeTraceCategories.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable`1.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/StringPinState.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/StringProxyHandleTable.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/TypeSchemaHandleTable.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/UIXIDVerifier.cs create mode 100644 UIX/Microsoft/Iris/CodeModel/Cpp/UIXVariant.cs create mode 100644 UIX/Microsoft/Iris/Command.cs create mode 100644 UIX/Microsoft/Iris/CompilerInput.cs create mode 100644 UIX/Microsoft/Iris/Data/INotifyList.cs create mode 100644 UIX/Microsoft/Iris/Data/IResourceProvider.cs create mode 100644 UIX/Microsoft/Iris/Data/IVirtualList.cs create mode 100644 UIX/Microsoft/Iris/Data/IntListUtility.cs create mode 100644 UIX/Microsoft/Iris/Data/ItemRequestCallback.cs create mode 100644 UIX/Microsoft/Iris/Data/ListUtility.cs create mode 100644 UIX/Microsoft/Iris/Data/Resource.cs create mode 100644 UIX/Microsoft/Iris/Data/ResourceAcquisitionCompleteHandler.cs create mode 100644 UIX/Microsoft/Iris/Data/ResourceManager.cs create mode 100644 UIX/Microsoft/Iris/Data/ResourceStatus.cs create mode 100644 UIX/Microsoft/Iris/Data/SingleArrayListCache.cs create mode 100644 UIX/Microsoft/Iris/Data/SlowDataAcquireCompleteHandler.cs create mode 100644 UIX/Microsoft/Iris/Data/StringUtility.cs create mode 100644 UIX/Microsoft/Iris/Data/UIListContentsChangeType.cs create mode 100644 UIX/Microsoft/Iris/Data/UIListContentsChangedArgs.cs create mode 100644 UIX/Microsoft/Iris/Data/UIListContentsChangedHandler.cs create mode 100644 UIX/Microsoft/Iris/Data/UpdateHelper.cs create mode 100644 UIX/Microsoft/Iris/DataProviderMapping.cs create mode 100644 UIX/Microsoft/Iris/DataProviderObject.cs create mode 100644 UIX/Microsoft/Iris/DataProviderPropertyChangedEventArgs.cs create mode 100644 UIX/Microsoft/Iris/DataProviderQuery.cs create mode 100644 UIX/Microsoft/Iris/DataProviderQueryFactory.cs create mode 100644 UIX/Microsoft/Iris/DataProviderQueryStatus.cs create mode 100644 UIX/Microsoft/Iris/DeferredInvokeHandler.cs create mode 100644 UIX/Microsoft/Iris/DeferredInvokePriority.cs create mode 100644 UIX/Microsoft/Iris/DeferredInvokeProxy.cs create mode 100644 UIX/Microsoft/Iris/Drawing/Camera.cs create mode 100644 UIX/Microsoft/Iris/Drawing/Color.cs create mode 100644 UIX/Microsoft/Iris/Drawing/ContentLoadCompleteHandler.cs create mode 100644 UIX/Microsoft/Iris/Drawing/EditCursorType.cs create mode 100644 UIX/Microsoft/Iris/Drawing/Font.cs create mode 100644 UIX/Microsoft/Iris/Drawing/FontStyles.cs create mode 100644 UIX/Microsoft/Iris/Drawing/ImageStatus.cs create mode 100644 UIX/Microsoft/Iris/Drawing/RawImage.cs create mode 100644 UIX/Microsoft/Iris/Drawing/RawImageItem.cs create mode 100644 UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs create mode 100644 UIX/Microsoft/Iris/Drawing/ResourceImageItem.cs create mode 100644 UIX/Microsoft/Iris/Drawing/RichText.cs create mode 100644 UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs create mode 100644 UIX/Microsoft/Iris/Drawing/Rotation.cs create mode 100644 UIX/Microsoft/Iris/Drawing/ScavengeImageCache.cs create mode 100644 UIX/Microsoft/Iris/Drawing/ScrollbarEnableFlags.cs create mode 100644 UIX/Microsoft/Iris/Drawing/ScrollbarType.cs create mode 100644 UIX/Microsoft/Iris/Drawing/SimpleText.cs create mode 100644 UIX/Microsoft/Iris/Drawing/TextFlow.cs create mode 100644 UIX/Microsoft/Iris/Drawing/TextImageCache.cs create mode 100644 UIX/Microsoft/Iris/Drawing/TextImageItem.cs create mode 100644 UIX/Microsoft/Iris/Drawing/TextMeasureParams.cs create mode 100644 UIX/Microsoft/Iris/Drawing/TextRun.cs create mode 100644 UIX/Microsoft/Iris/Drawing/TextStyle.cs create mode 100644 UIX/Microsoft/Iris/Drawing/UIImage.cs create mode 100644 UIX/Microsoft/Iris/Drawing/UriImage.cs create mode 100644 UIX/Microsoft/Iris/Error.cs create mode 100644 UIX/Microsoft/Iris/ErrorReportHandler.cs create mode 100644 UIX/Microsoft/Iris/Group.cs create mode 100644 UIX/Microsoft/Iris/GroupedList.cs create mode 100644 UIX/Microsoft/Iris/ICommand.cs create mode 100644 UIX/Microsoft/Iris/IDataProvider.cs create mode 100644 UIX/Microsoft/Iris/IDataProviderBaseObject.cs create mode 100644 UIX/Microsoft/Iris/IDataProviderObject.cs create mode 100644 UIX/Microsoft/Iris/IDataProviderQuery.cs create mode 100644 UIX/Microsoft/Iris/IModelItem.cs create mode 100644 UIX/Microsoft/Iris/IModelItemOwner.cs create mode 100644 UIX/Microsoft/Iris/ISearchableList.cs create mode 100644 UIX/Microsoft/Iris/IThreadSafeObject.cs create mode 100644 UIX/Microsoft/Iris/IValueRange.cs create mode 100644 UIX/Microsoft/Iris/Image.cs create mode 100644 UIX/Microsoft/Iris/ImageFormatUtils.cs create mode 100644 UIX/Microsoft/Iris/ImageInset.cs create mode 100644 UIX/Microsoft/Iris/ImageLoadCompleteHandler.cs create mode 100644 UIX/Microsoft/Iris/IndexedTree.cs create mode 100644 UIX/Microsoft/Iris/Input/AppCommandMapping.cs create mode 100644 UIX/Microsoft/Iris/Input/CommandCode.cs create mode 100644 UIX/Microsoft/Iris/Input/DragDropInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/DragOperation.cs create mode 100644 UIX/Microsoft/Iris/Input/HIDCommandMapping.cs create mode 100644 UIX/Microsoft/Iris/Input/HidDevice.cs create mode 100644 UIX/Microsoft/Iris/Input/ICookedInputSite.cs create mode 100644 UIX/Microsoft/Iris/Input/IInputCustomFocus.cs create mode 100644 UIX/Microsoft/Iris/Input/InputDevice.cs create mode 100644 UIX/Microsoft/Iris/Input/InputEventType.cs create mode 100644 UIX/Microsoft/Iris/Input/InputInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/InputItem.cs create mode 100644 UIX/Microsoft/Iris/Input/InputManager.cs create mode 100644 UIX/Microsoft/Iris/Input/InputQueue.cs create mode 100644 UIX/Microsoft/Iris/Input/KeyActionInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/KeyCommandInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/KeyFocusInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/KeyFocusReason.cs create mode 100644 UIX/Microsoft/Iris/Input/KeyInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/KeyStateInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/KeyboardDevice.cs create mode 100644 UIX/Microsoft/Iris/Input/MouseActionInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/MouseButtonInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/MouseDevice.cs create mode 100644 UIX/Microsoft/Iris/Input/MouseFocusInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/MouseInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/MouseMoveInfo.cs create mode 100644 UIX/Microsoft/Iris/Input/MouseWheelInfo.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/BeginDragPolicy.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/Characters.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/ClickCount.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/ClickHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/ClickType.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/DragDropHelper.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/DragHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/DragSourceHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/DropAction.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/DropTargetHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/EventContext.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/FocusChangeReason.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/FocusHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/KeyHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/KeyHandlerKey.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/ModifierInputHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/MouseWheelHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/ScrollingHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/ShortcutHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/ShortcutHandlerCommand.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/TextEditingHandler.cs create mode 100644 UIX/Microsoft/Iris/InputHandlers/TypingHandler.cs create mode 100644 UIX/Microsoft/Iris/IntRangedValue.cs create mode 100644 UIX/Microsoft/Iris/InvokePolicy.cs create mode 100644 UIX/Microsoft/Iris/ItemCountHandler.cs create mode 100644 UIX/Microsoft/Iris/Key.cs create mode 100644 UIX/Microsoft/Iris/Layout/Alignment.cs create mode 100644 UIX/Microsoft/Iris/Layout/AreaOfInterest.cs create mode 100644 UIX/Microsoft/Iris/Layout/AreaOfInterestID.cs create mode 100644 UIX/Microsoft/Iris/Layout/AreaOfInterestLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layout/ExtendedLayoutOutput.cs create mode 100644 UIX/Microsoft/Iris/Layout/ILayout.cs create mode 100644 UIX/Microsoft/Iris/Layout/ILayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layout/ILayoutNode.cs create mode 100644 UIX/Microsoft/Iris/Layout/ItemAlignment.cs create mode 100644 UIX/Microsoft/Iris/Layout/LayoutCompleteEventHandler.cs create mode 100644 UIX/Microsoft/Iris/Layout/LayoutConstants.cs create mode 100644 UIX/Microsoft/Iris/Layout/LayoutNodeEnumerator.cs create mode 100644 UIX/Microsoft/Iris/Layout/LayoutSlot.cs create mode 100644 UIX/Microsoft/Iris/Layout/SharedSize.cs create mode 100644 UIX/Microsoft/Iris/Layout/SharedSizePolicy.cs create mode 100644 UIX/Microsoft/Iris/Layout/Visibility.cs create mode 100644 UIX/Microsoft/Iris/Layouts/AnchorEdge.cs create mode 100644 UIX/Microsoft/Iris/Layouts/AnchorLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/AnchorLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/ContentPositioningPolicy.cs create mode 100644 UIX/Microsoft/Iris/Layouts/DefaultLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/DockLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/FlipDirection.cs create mode 100644 UIX/Microsoft/Iris/Layouts/FlowLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/FlowSizeMemoryLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/FormLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/GridLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/InterestPoint.cs create mode 100644 UIX/Microsoft/Iris/Layouts/KeepAliveLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/MajorMinor.cs create mode 100644 UIX/Microsoft/Iris/Layouts/MissingItemPolicy.cs create mode 100644 UIX/Microsoft/Iris/Layouts/MouseTarget.cs create mode 100644 UIX/Microsoft/Iris/Layouts/PlacementMode.cs create mode 100644 UIX/Microsoft/Iris/Layouts/PopupLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/PopupLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/PopupPosition.cs create mode 100644 UIX/Microsoft/Iris/Layouts/RelativeEdge.cs create mode 100644 UIX/Microsoft/Iris/Layouts/RepeatPolicy.cs create mode 100644 UIX/Microsoft/Iris/Layouts/RotateLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/ScaleLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/ScrollIntoViewDisposition.cs create mode 100644 UIX/Microsoft/Iris/Layouts/ScrollingLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/ScrollingLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/ScrollingLayoutOutput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/StackLayout.cs create mode 100644 UIX/Microsoft/Iris/Layouts/StackLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/Layouts/StackPriority.cs create mode 100644 UIX/Microsoft/Iris/Layouts/StripAlignment.cs create mode 100644 UIX/Microsoft/Iris/Library/AncestorEnumerator.cs create mode 100644 UIX/Microsoft/Iris/Library/Bits.cs create mode 100644 UIX/Microsoft/Iris/Library/DataCookie.cs create mode 100644 UIX/Microsoft/Iris/Library/DisposableNotifyObjectBase.cs create mode 100644 UIX/Microsoft/Iris/Library/DisposableObject.cs create mode 100644 UIX/Microsoft/Iris/Library/DynamicData.cs create mode 100644 UIX/Microsoft/Iris/Library/EventCookie.cs create mode 100644 UIX/Microsoft/Iris/Library/ExpandableArray.cs create mode 100644 UIX/Microsoft/Iris/Library/IDisposableObject.cs create mode 100644 UIX/Microsoft/Iris/Library/IDisposableOwner.cs create mode 100644 UIX/Microsoft/Iris/Library/ITreeNode.cs create mode 100644 UIX/Microsoft/Iris/Library/KeyAllocator.cs create mode 100644 UIX/Microsoft/Iris/Library/Math2.cs create mode 100644 UIX/Microsoft/Iris/Library/NotifyObjectBase.cs create mode 100644 UIX/Microsoft/Iris/Library/Result.cs create mode 100644 UIX/Microsoft/Iris/Library/SharedDisposableObject.cs create mode 100644 UIX/Microsoft/Iris/Library/SmartMap.cs create mode 100644 UIX/Microsoft/Iris/Library/StackIListEnumerator.cs create mode 100644 UIX/Microsoft/Iris/Library/StackIListReverseEnumerator.cs create mode 100644 UIX/Microsoft/Iris/Library/TreeNode.cs create mode 100644 UIX/Microsoft/Iris/Library/TreeNodeCollection.cs create mode 100644 UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs create mode 100644 UIX/Microsoft/Iris/Library/Utility.cs create mode 100644 UIX/Microsoft/Iris/ListContentsChangeType.cs create mode 100644 UIX/Microsoft/Iris/ListContentsChangedArgs.cs create mode 100644 UIX/Microsoft/Iris/ListContentsChangedHandler.cs create mode 100644 UIX/Microsoft/Iris/ListContentsChangedProxy.cs create mode 100644 UIX/Microsoft/Iris/ListDataSet.cs create mode 100644 UIX/Microsoft/Iris/Markup/AliasMapping.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyConstructorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyEventSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyLoadResult.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyMarkupDataQuery.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyMarkupDataType.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyMethodSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyObjectProxyHelper.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyPropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/AssemblyTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/BooleanBoxes.cs create mode 100644 UIX/Microsoft/Iris/Markup/ByteCodeReader.cs create mode 100644 UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs create mode 100644 UIX/Microsoft/Iris/Markup/ClassMethodSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/ClassPropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/CodeListeners.cs create mode 100644 UIX/Microsoft/Iris/Markup/CompilationMessage.cs create mode 100644 UIX/Microsoft/Iris/Markup/CompiledMarkupLoadResult.cs create mode 100644 UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs create mode 100644 UIX/Microsoft/Iris/Markup/ConstructHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/ConstructorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/CreateLoadResultHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/DecodeBinaryHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/DefaultConstructHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/DelegateListener.cs create mode 100644 UIX/Microsoft/Iris/Markup/DestructiveListener.cs create mode 100644 UIX/Microsoft/Iris/Markup/EffectClassTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/EncodeBinaryHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/EnumSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/ErrorLoadResult.cs create mode 100644 UIX/Microsoft/Iris/Markup/EventSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/ExpressionRestriction.cs create mode 100644 UIX/Microsoft/Iris/Markup/FastReflectionInvokeHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/FindCanonicalInstanceHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyPrimitiveTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/GetValueHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/IDynamicConstructionSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/IMarkupTypeBase.cs create mode 100644 UIX/Microsoft/Iris/Markup/INotifyObject.cs create mode 100644 UIX/Microsoft/Iris/Markup/ISchemaInfo.cs create mode 100644 UIX/Microsoft/Iris/Markup/Int32Boxes.cs create mode 100644 UIX/Microsoft/Iris/Markup/Int64Boxes.cs create mode 100644 UIX/Microsoft/Iris/Markup/Interpreter.cs create mode 100644 UIX/Microsoft/Iris/Markup/InterpreterContext.cs create mode 100644 UIX/Microsoft/Iris/Markup/InvokeHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/Listener.cs create mode 100644 UIX/Microsoft/Iris/Markup/ListenerEncodeMode.cs create mode 100644 UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs create mode 100644 UIX/Microsoft/Iris/Markup/ListenerRootNode.cs create mode 100644 UIX/Microsoft/Iris/Markup/ListenerType.cs create mode 100644 UIX/Microsoft/Iris/Markup/Listeners.cs create mode 100644 UIX/Microsoft/Iris/Markup/LoadPass.cs create mode 100644 UIX/Microsoft/Iris/Markup/LoadResult.cs create mode 100644 UIX/Microsoft/Iris/Markup/LoadResultCache.cs create mode 100644 UIX/Microsoft/Iris/Markup/LoadResultStatus.cs create mode 100644 UIX/Microsoft/Iris/Markup/ManagedXmlReader.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupBinaryDataTable.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupCompiler.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupConstantPersist.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupConstantPersistMode.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupConstantsTable.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataMapping.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataMappingEntry.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataProvider.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataQueryPreDefinedPropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataQueryPropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataQueryRefreshMethodSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataQuerySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataType.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataTypeBaseObject.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataTypePropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDataTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupDebugHelper.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupEncoder.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupError.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupImportTables.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupLineNumberTable.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupListener.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupListeners.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupMethodSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupPropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupServices.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupSystem.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupType.cs create mode 100644 UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MethodSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/MethodSignatureKey.cs create mode 100644 UIX/Microsoft/Iris/Markup/NamedContentRecord.cs create mode 100644 UIX/Microsoft/Iris/Markup/NativeCodeModelMessage.cs create mode 100644 UIX/Microsoft/Iris/Markup/NativeMarkupDataQuery.cs create mode 100644 UIX/Microsoft/Iris/Markup/NativeMarkupDataType.cs create mode 100644 UIX/Microsoft/Iris/Markup/NotificationID.cs create mode 100644 UIX/Microsoft/Iris/Markup/NotifyService.cs create mode 100644 UIX/Microsoft/Iris/Markup/ObjectSourceType.cs create mode 100644 UIX/Microsoft/Iris/Markup/OpCode.cs create mode 100644 UIX/Microsoft/Iris/Markup/OperationType.cs create mode 100644 UIX/Microsoft/Iris/Markup/ParameterContext.cs create mode 100644 UIX/Microsoft/Iris/Markup/ParseResult.cs create mode 100644 UIX/Microsoft/Iris/Markup/Parser.cs create mode 100644 UIX/Microsoft/Iris/Markup/PerformOperationHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/PropertyOverrideCriteria.cs create mode 100644 UIX/Microsoft/Iris/Markup/PropertyOverrideCriteriaTypeConstraint.cs create mode 100644 UIX/Microsoft/Iris/Markup/PropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/ProviderlessMarkupDataType.cs create mode 100644 UIX/Microsoft/Iris/Markup/RangeValidator.cs create mode 100644 UIX/Microsoft/Iris/Markup/ReflectionHelper.cs create mode 100644 UIX/Microsoft/Iris/Markup/RuntimeMessage.cs create mode 100644 UIX/Microsoft/Iris/Markup/SSLexUnicodeBufferConsumer.cs create mode 100644 UIX/Microsoft/Iris/Markup/SchemaType.cs create mode 100644 UIX/Microsoft/Iris/Markup/ScriptRunScheduler.cs create mode 100644 UIX/Microsoft/Iris/Markup/SetValueHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/SourceMarkupImportTables.cs create mode 100644 UIX/Microsoft/Iris/Markup/SourceMarkupLoadResult.cs create mode 100644 UIX/Microsoft/Iris/Markup/SourceMarkupLoader.cs create mode 100644 UIX/Microsoft/Iris/Markup/StandardAssemblyTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/SupportsOperationHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/SupportsTypeConversionHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/SymbolOrigin.cs create mode 100644 UIX/Microsoft/Iris/Markup/SymbolRecord.cs create mode 100644 UIX/Microsoft/Iris/Markup/SymbolReference.cs create mode 100644 UIX/Microsoft/Iris/Markup/TypeConstraint.cs create mode 100644 UIX/Microsoft/Iris/Markup/TypeConverterHandler.cs create mode 100644 UIX/Microsoft/Iris/Markup/TypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIB.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIClassMethodSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIClassPropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIClassTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/AccessibleSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/AliasSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/AlphaKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/AnchorEdgeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutInputSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/AnimationHandleSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/AnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/BlendSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/BlurSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/BooleanChoiceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/BooleanSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/BrightnessInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/BrightnessSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ByteRangedValueSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ByteSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/CameraAtKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/CameraEyeKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/CameraSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/CameraUpKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/CameraZnKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/CaretInfoSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/CharSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ClassSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ClassStateSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ClickHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ClipSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ColorElementInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ColorElementSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ColorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/CommandSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ContrastInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ContrastSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DataMappingSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DataQuerySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DataTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DebugOutlinesSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DebugSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DefaultLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DesaturateInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DesaturateSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DestinationElementInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DestinationElementSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DictionarySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DockLayoutInputSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DockLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DoubleSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DragHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DragSourceHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/DropTargetHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EditableTextDataSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectAnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectColorAnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectColorKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectElementInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectElementSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectFloatAnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectFloatKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectInputSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectLayerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectOperationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectVector3AnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EffectVector3KeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EmbossInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EmbossSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EnumeratorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EnvironmentSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/EventContextSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/FlowLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/FocusHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/FontSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/FormLayoutInputSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/GraphicSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/GridLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/GroupSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/HostSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/HwndHostSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/IAnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ImageElementInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ImageElementSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ImageSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/InputHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/InsetSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/IntRangedValueSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/InterpolateElementInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/InterpolateElementSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/InterpolationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/InvAlphaSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/InvColorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/InvertSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ItemAlignmentSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/KeyHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/KeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/LayoutInputSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/LayoutOutputSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/LayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/LightShaftInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/LightShaftSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ListSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MajorMinorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MappingSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MarkupDataQueryInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MarkupDataTypeInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MarkupErrorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MarkupSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MathSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MergeAnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/MouseWheelHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/NullSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/OrientationKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PanelSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PlacementModeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PointLight2DInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PointLight2DSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PointSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PopupLayoutInputSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PopupLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PopupPositionSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PositionKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PositionXKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/PositionYKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/RandomSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/RangedValueSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/RectangleSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/RelativeToSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/RepeaterSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/RotateKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/RotateLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/RotationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SavedKeyFocusSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ScaleKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ScaleLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ScaleXKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ScaleYKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ScrollModelBaseSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ScrollModelSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ScrollerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ScrollingHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SelectionManagerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SelectionRangeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SepiaInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SepiaSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SharedSizeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ShortcutHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SingleSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SizeKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SizeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SizeXKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SizeYKeyframeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SoundSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SpotLight2DInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SpotLight2DSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/StackLayoutInputSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/StackLayoutSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/StringSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/SwitchAnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TextEditingHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TextFragmentSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TextRunDataSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TextRunRendererSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TextSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TextScrollModelSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TextStyleSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TimerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TransformAnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TransformByAttributeAnimationSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TypeConstraintSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TypeSchemaDefinition.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TypeSelectorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/TypingHandlerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/UISchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/UIStateSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ValueRangeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ValueTransformerSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/Vector2Schema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/Vector3Schema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/VideoElementInstanceSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/VideoElementSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/VideoSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/VideoStreamSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/ViewItemSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIX/WindowSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXConstructorSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXEnumData.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXEventSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXLoadResult.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXLoadResultExports.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXMethodSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXPropertySchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXTypeFlags.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXTypeID.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs create mode 100644 UIX/Microsoft/Iris/Markup/UIXTypes.cs create mode 100644 UIX/Microsoft/Iris/Markup/ValidateMessage.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/CastMethod.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ConstantType.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ExpressionType.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ExpressionUsage.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/MethodSpecifier.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/NameUsage.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/PropertyAttribute.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/StatementType.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/SymbolResolutionDirective.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/TriggerRecord.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/TypeRestriction.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/Validate.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateAlias.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateClass.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateCode.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateContext.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateDataMapping.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateDataQuery.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateDataType.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateEffect.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateEffectElement.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpression.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionAs.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionAssignment.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionBaseClass.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCall.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionCast.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionConstant.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionDeclareTrigger.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIndex.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionIsCheck.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionList.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionNew.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionNullCoalescing.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionOperation.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionSymbol.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTernary.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionThis.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateExpressionTypeOf.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateFromString.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateMetadata.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateMethod.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateMethodList.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateNamespace.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateObject.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateObjectTag.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateParameter.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateParameterDefinition.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateParameterDefinitionList.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateProperty.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateScripts.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatement.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementAssignment.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementAttribute.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementBreak.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementCompound.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementExpression.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementForEach.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIf.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementIfElse.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementLoop.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementReturn.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementScopedLocal.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateStatementWhile.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateTypeConstraint.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateTypeIdentifier.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValidateUI.cs create mode 100644 UIX/Microsoft/Iris/Markup/Validation/ValueApplyMode.cs create mode 100644 UIX/Microsoft/Iris/MaximizeMode.cs create mode 100644 UIX/Microsoft/Iris/ModelItem.cs create mode 100644 UIX/Microsoft/Iris/ModelItemDisposeMode.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/BooleanChoice.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/ByteRangedValue.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/CaretInfo.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/Choice.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/Clipboard.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/EditableTextData.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/ITextScrollModelCallback.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUIBooleanChoice.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUIByteRangedValue.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUIChoice.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUICommand.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUIGroup.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUIIntRangedValue.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUIList.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUIRangedValue.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IUIValueRange.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/IntRangedValue.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/InvokePriority.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/LayoutOutput.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/NotifyList.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/Range.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/RangedValue.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/ScrollModel.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/ScrollModelBase.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/SelectionManager.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/TextScrollModel.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/UICommand.cs create mode 100644 UIX/Microsoft/Iris/ModelItems/UITimer.cs create mode 100644 UIX/Microsoft/Iris/Navigation/FindFromPointWorker.cs create mode 100644 UIX/Microsoft/Iris/Navigation/INavigationSite.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationClass.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationFlow.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationItem.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationOrder.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationOrientation.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationPolicies.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationServices.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationSpace.cs create mode 100644 UIX/Microsoft/Iris/Navigation/NavigationStrip.cs create mode 100644 UIX/Microsoft/Iris/Navigation/TransientNavigationSite.cs create mode 100644 UIX/Microsoft/Iris/OS/CLR/NativeMethods.cs create mode 100644 UIX/Microsoft/Iris/OS/CLR/StandardOleMarshalObject.cs create mode 100644 UIX/Microsoft/Iris/OS/CLR/UnsafeNativeMethods.cs create mode 100644 UIX/Microsoft/Iris/OS/COMResult.cs create mode 100644 UIX/Microsoft/Iris/OS/DataObject.cs create mode 100644 UIX/Microsoft/Iris/OS/DllResource.cs create mode 100644 UIX/Microsoft/Iris/OS/DllResources.cs create mode 100644 UIX/Microsoft/Iris/OS/FileResource.cs create mode 100644 UIX/Microsoft/Iris/OS/FileResources.cs create mode 100644 UIX/Microsoft/Iris/OS/HttpResource.cs create mode 100644 UIX/Microsoft/Iris/OS/HttpResources.cs create mode 100644 UIX/Microsoft/Iris/OS/IImeCallbacks.cs create mode 100644 UIX/Microsoft/Iris/OS/IRawUIXServices.cs create mode 100644 UIX/Microsoft/Iris/OS/IRichTextCallbacks.cs create mode 100644 UIX/Microsoft/Iris/OS/IUIXListCallbacks.cs create mode 100644 UIX/Microsoft/Iris/OS/NativeApi.cs create mode 100644 UIX/Microsoft/Iris/OS/NativeXmlException.cs create mode 100644 UIX/Microsoft/Iris/OS/NativeXmlNodeType.cs create mode 100644 UIX/Microsoft/Iris/OS/NativeXmlReader.cs create mode 100644 UIX/Microsoft/Iris/OS/Win32Api.cs create mode 100644 UIX/Microsoft/Iris/ObjectPropertyPair.cs create mode 100644 UIX/Microsoft/Iris/PropertySet.cs create mode 100644 UIX/Microsoft/Iris/PropertyValue.cs create mode 100644 UIX/Microsoft/Iris/ProviderlessDataProviderObject.cs create mode 100644 UIX/Microsoft/Iris/Queues/Dispatcher.cs create mode 100644 UIX/Microsoft/Iris/Queues/Feeder.cs create mode 100644 UIX/Microsoft/Iris/Queues/Interconnect.cs create mode 100644 UIX/Microsoft/Iris/Queues/PriorityQueue.cs create mode 100644 UIX/Microsoft/Iris/Queues/Queue.cs create mode 100644 UIX/Microsoft/Iris/Queues/QueueItem.cs create mode 100644 UIX/Microsoft/Iris/Queues/SimpleQueue.cs create mode 100644 UIX/Microsoft/Iris/RangedValue.cs create mode 100644 UIX/Microsoft/Iris/RawImageFormat.cs create mode 100644 UIX/Microsoft/Iris/ReleaseBehavior.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Audio/SoundData.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Audio/SoundManager.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Audio/SystemSoundEvent.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Audio/SystemSoundEventTable.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Drawing/Dib.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Drawing/EdgeFade.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Drawing/PointF.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Drawing/RectangleF.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Drawing/SizeF.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/HRESULT.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/Memory.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/RenderException.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/RendererApi.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/BasicVideoGeometry.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/BasicVideoPresentation.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/IUIVideoPortal.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/IUIVideoStream.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/LinearVideoStretch.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/VideoDisplayMode.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/VideoOverscanMode.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/VideoPresentationBuilder.cs create mode 100644 UIX/Microsoft/Iris/RenderAPI/VideoPlayback/VideoZoomHandler.cs create mode 100644 UIX/Microsoft/Iris/RenderingQuality.cs create mode 100644 UIX/Microsoft/Iris/RenderingType.cs create mode 100644 UIX/Microsoft/Iris/RequestItemHandler.cs create mode 100644 UIX/Microsoft/Iris/RequestSlowDataHandler.cs create mode 100644 UIX/Microsoft/Iris/Session/DeferredCall.cs create mode 100644 UIX/Microsoft/Iris/Session/DeferredHandler.cs create mode 100644 UIX/Microsoft/Iris/Session/Direction.cs create mode 100644 UIX/Microsoft/Iris/Session/DispatchPriority.cs create mode 100644 UIX/Microsoft/Iris/Session/DispatcherTimer.cs create mode 100644 UIX/Microsoft/Iris/Session/EffectManager.cs create mode 100644 UIX/Microsoft/Iris/Session/ErrorManager.cs create mode 100644 UIX/Microsoft/Iris/Session/ErrorRecord.cs create mode 100644 UIX/Microsoft/Iris/Session/ErrorWatermark.cs create mode 100644 UIX/Microsoft/Iris/Session/EventRouteStages.cs create mode 100644 UIX/Microsoft/Iris/Session/Form.cs create mode 100644 UIX/Microsoft/Iris/Session/FormSessionConnectHandler.cs create mode 100644 UIX/Microsoft/Iris/Session/IErrorContextSource.cs create mode 100644 UIX/Microsoft/Iris/Session/IModalSession.cs create mode 100644 UIX/Microsoft/Iris/Session/ITimerOwner.cs create mode 100644 UIX/Microsoft/Iris/Session/ITrackableUIElement.cs create mode 100644 UIX/Microsoft/Iris/Session/ITrackableUIElementEvents.cs create mode 100644 UIX/Microsoft/Iris/Session/IZoneDisplayChild.cs create mode 100644 UIX/Microsoft/Iris/Session/InputDeliveryStatus.cs create mode 100644 UIX/Microsoft/Iris/Session/InputNotificationEventArgs.cs create mode 100644 UIX/Microsoft/Iris/Session/InputNotificationHandler.cs create mode 100644 UIX/Microsoft/Iris/Session/InvalidKeyFocusHandler.cs create mode 100644 UIX/Microsoft/Iris/Session/KeyCoalesceFilter.cs create mode 100644 UIX/Microsoft/Iris/Session/LoopCondition.cs create mode 100644 UIX/Microsoft/Iris/Session/NotifyErrorBatch.cs create mode 100644 UIX/Microsoft/Iris/Session/SimpleCallback.cs create mode 100644 UIX/Microsoft/Iris/Session/StaticServices.cs create mode 100644 UIX/Microsoft/Iris/Session/TimeoutHandler.cs create mode 100644 UIX/Microsoft/Iris/Session/TimeoutManager.cs create mode 100644 UIX/Microsoft/Iris/Session/TransformSet.cs create mode 100644 UIX/Microsoft/Iris/Session/UIApplication.cs create mode 100644 UIX/Microsoft/Iris/Session/UIDispatcher.cs create mode 100644 UIX/Microsoft/Iris/Session/UISession.cs create mode 100644 UIX/Microsoft/Iris/Session/UiTask.cs create mode 100644 UIX/Microsoft/Iris/SessionConnectedHandler.cs create mode 100644 UIX/Microsoft/Iris/SimpleAnimationPropertyMap.cs create mode 100644 UIX/Microsoft/Iris/SoundType.cs create mode 100644 UIX/Microsoft/Iris/ThreadSafety.cs create mode 100644 UIX/Microsoft/Iris/ThreadSafetyBlock.cs create mode 100644 UIX/Microsoft/Iris/Timer.cs create mode 100644 UIX/Microsoft/Iris/UI/ChildFaultedInDelegate.cs create mode 100644 UIX/Microsoft/Iris/UI/Class.cs create mode 100644 UIX/Microsoft/Iris/UI/ColorScheme.cs create mode 100644 UIX/Microsoft/Iris/UI/EffectClass.cs create mode 100644 UIX/Microsoft/Iris/UI/EffectElementWrapper.cs create mode 100644 UIX/Microsoft/Iris/UI/EffectProperty.cs create mode 100644 UIX/Microsoft/Iris/UI/EffectValue.cs create mode 100644 UIX/Microsoft/Iris/UI/EffectValueType.cs create mode 100644 UIX/Microsoft/Iris/UI/Environment.cs create mode 100644 UIX/Microsoft/Iris/UI/FindChildResult.cs create mode 100644 UIX/Microsoft/Iris/UI/FocusStateHandler.cs create mode 100644 UIX/Microsoft/Iris/UI/FormCloseRequestedHandler.cs create mode 100644 UIX/Microsoft/Iris/UI/FormPropertyChangedHandler.cs create mode 100644 UIX/Microsoft/Iris/UI/InputEventHandler.cs create mode 100644 UIX/Microsoft/Iris/UI/InputHandler.cs create mode 100644 UIX/Microsoft/Iris/UI/InputHandlerList.cs create mode 100644 UIX/Microsoft/Iris/UI/InputHandlerModifiers.cs create mode 100644 UIX/Microsoft/Iris/UI/InputHandlerStage.cs create mode 100644 UIX/Microsoft/Iris/UI/InputHandlerTransition.cs create mode 100644 UIX/Microsoft/Iris/UI/RootLoadResult.cs create mode 100644 UIX/Microsoft/Iris/UI/RootUI.cs create mode 100644 UIX/Microsoft/Iris/UI/SavedKeyFocus.cs create mode 100644 UIX/Microsoft/Iris/UI/SessionInputHandler.cs create mode 100644 UIX/Microsoft/Iris/UI/UIClass.cs create mode 100644 UIX/Microsoft/Iris/UI/UIForm.cs create mode 100644 UIX/Microsoft/Iris/UI/UIZone.cs create mode 100644 UIX/Microsoft/Iris/UI/ViewItem.cs create mode 100644 UIX/Microsoft/Iris/UI/ViewItemID.cs create mode 100644 UIX/Microsoft/Iris/VideoStream.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Clip.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/ContentViewItem.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/CountLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Graphic.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Host.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/HostRequestPacket.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/HostStatus.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/HwndHost.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/ICustomRepeatedItem.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/ImageLayout.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Index.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/IndexLayoutInput.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/IndexType.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/LineAlignment.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/PaintInvalidEventHandler.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Panel.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Repeater.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/RepeaterContentSelector.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/RepeaterListContentsChangedArgs.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/RootViewItem.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Scroller.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/SizingPolicy.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/StretchingPolicy.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Text.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/TextBounds.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/TextFlowRenderingHelper.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/TextFragment.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/TextRunData.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/TextRunRenderer.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/TextSharpness.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/TypeSelector.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/UIPropertyRecord.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/Video.cs create mode 100644 UIX/Microsoft/Iris/ViewItems/VisibleIndexRangeLayoutOutput.cs create mode 100644 UIX/Microsoft/Iris/VirtualList.cs create mode 100644 UIX/Microsoft/Iris/Window.cs create mode 100644 UIX/Microsoft/Iris/WindowCloseRequestedEventArgs.cs create mode 100644 UIX/Microsoft/Iris/WindowCloseRequestedHandler.cs create mode 100644 UIX/Microsoft/Iris/WindowColor.cs create mode 100644 UIX/Microsoft/Iris/WindowPosition.cs create mode 100644 UIX/Microsoft/Iris/WindowPositionPolicy.cs create mode 100644 UIX/Microsoft/Iris/WindowSize.cs create mode 100644 UIX/Microsoft/Iris/WindowState.cs create mode 100644 UIX/ParserLexClass.cs create mode 100644 UIX/ParserLexTable.cs create mode 100644 UIX/ParserYaccClass.cs create mode 100644 UIX/ParserYaccTable.cs create mode 100644 UIX/SSVParseLib/SSLex.cs create mode 100644 UIX/SSVParseLib/SSLexConsumer.cs create mode 100644 UIX/SSVParseLib/SSLexFinalState.cs create mode 100644 UIX/SSVParseLib/SSLexLexeme.cs create mode 100644 UIX/SSVParseLib/SSLexMark.cs create mode 100644 UIX/SSVParseLib/SSLexSubtable.cs create mode 100644 UIX/SSVParseLib/SSLexTable.cs create mode 100644 UIX/SSVParseLib/SSLexTableRow.cs create mode 100644 UIX/SSVParseLib/SSLexTableRowEntry.cs create mode 100644 UIX/SSVParseLib/SSYacc.cs create mode 100644 UIX/SSVParseLib/SSYaccCache.cs create mode 100644 UIX/SSVParseLib/SSYaccStack.cs create mode 100644 UIX/SSVParseLib/SSYaccStackElement.cs create mode 100644 UIX/SSVParseLib/SSYaccTable.cs create mode 100644 UIX/SSVParseLib/SSYaccTableProd.cs create mode 100644 UIX/SSVParseLib/SSYaccTableRow.cs create mode 100644 UIX/SSVParseLib/SSYaccTableRowEntry.cs create mode 100644 UIX/UIX.csproj create mode 100644 UIX/UIXSign/App.config create mode 100644 UIX/UIXSign/Program.cs create mode 100644 UIX/UIXSign/Properties/AssemblyInfo.cs create mode 100644 UIX/UIXSign/UIXSign.csproj create mode 100644 UIX/UIXSign/packages.config create mode 100644 UIX/app.config create mode 100644 UIX/packages.config diff --git a/MicrosoftIris.sln b/MicrosoftIris.sln new file mode 100644 index 0000000..1bf2ef3 --- /dev/null +++ b/MicrosoftIris.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.32112.339 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UIX", "UIX\UIX.csproj", "{78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78A8B08C-C0E9-4BAC-9AF6-58D3A55C05C9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {25300402-D4C7-4F92-841D-894A842FF055} + EndGlobalSection +EndGlobal diff --git a/UIX/.gitattributes b/UIX/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/UIX/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/UIX/.gitignore b/UIX/.gitignore new file mode 100644 index 0000000..4ce6fdd --- /dev/null +++ b/UIX/.gitignore @@ -0,0 +1,340 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/UIX/AssemblyInfo.cs b/UIX/AssemblyInfo.cs new file mode 100644 index 0000000..0be4286 --- /dev/null +++ b/UIX/AssemblyInfo.cs @@ -0,0 +1,24 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Security.Permissions; + +[assembly: StringFreezing] +[assembly: AssemblyTitle("UIX")] +[assembly: CLSCompliant(true)] +[assembly: AssemblyDescription("Microsoft.Iris")] +[assembly: AssemblyCompany("Microsoft Corporation")] +[assembly: AssemblyDelaySign(true)] +//assembly: AssemblyKeyFile("e:\\temp\\466296\\public.amd64fre\\internal\\strongnamekeys\\fake\\36MSApp1024.snk")] +[assembly: AssemblyFileVersion("4.8.0015.0")] +[assembly: AssemblyProduct("Microsoft (R) Windows (R) Operating System")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation. All rights reserved.")] +[assembly: ComVisible(false)] +[assembly: InternalsVisibleTo("UIXLanguagePackage, PublicKey=002400000480000094000000060200000024000052534131000400000100010079ac5df018758f13b930394f7b6e7672b5221e5a299339cc185b20dcae03a23e4766f75d7ba8d3fc46163826f2df26cd474e6326c58ea8e4f8fcc3a66818134788ae709fd3f68995b6db8efe31ed952c98b2e3b43141b41a08ff4fd205548f19e32d22b6ada74a1d4bd04c6e08ff54a16272b669624cd6a4d68c98050db929f0")] +[assembly: InternalsVisibleTo("IrisEditor,PublicKey=00240000048000009400000006020000002400005253413100040000010001001dc70401884cdfad2010ce192e1f08a30fb034cf504759943eec3359d4ed09af3ce1616dbb124e479617ec73e4162903766e7a5e7bf1984bb318040118fe0f69dfb8b6e5c7c47a0e1bc9a8984b22f7221cc235986c09c74cab38ea3562c18adb8e3a95b73faf1ed71d7c309058b86d951af2165eb215b47de335e360a6a25da7")] +[assembly: InternalsVisibleTo("ZuneUIXTools,PublicKey=00240000048000009400000006020000002400005253413100040000010001007db41ad52f5f00b405568dc0c60a82648dae95969d258caae0ead609dfcff39385bc734a818e0302c8e2d742dd97de756565c8a6a265a77c492e67fd12061aa02838524a0563817629dfa26a6e34490c8995b696e82615bec637df2bcae1466bf004893c9edcc60b5a1a3443adae7f9279b82418e76296cf0a5faafdf308a7d1")] +//[assembly: InternalsVisibleTo("UIXBuild")] +//[assembly: InternalsVisibleTo("UIXBuildTask")] +[assembly: AssemblyVersion("4.8.0.0")] +[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] diff --git a/UIX/Microsoft/Iris/Accessibility/AccChildID.cs b/UIX/Microsoft/Iris/Accessibility/AccChildID.cs new file mode 100644 index 0000000..5d8db1e --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccChildID.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccChildID +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Accessibility +{ + internal enum AccChildID + { + Self, + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccEvents.cs b/UIX/Microsoft/Iris/Accessibility/AccEvents.cs new file mode 100644 index 0000000..ee4605a --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccEvents.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccEvents +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Accessibility +{ + internal enum AccEvents + { + None = 0, + SystemSound = 1, + SystemAlert = 2, + SystemForeground = 3, + SystemMenuStart = 4, + SystemMenuEnd = 5, + SystemMenuPopupStart = 6, + SystemMenuPopupEnd = 7, + SystemCaptureStart = 8, + SystemCaptureEnd = 9, + SystemMoveSizeStart = 10, // 0x0000000A + SystemMoveSizeEnd = 11, // 0x0000000B + SystemContextHelpStart = 12, // 0x0000000C + SystemContextHelpEnd = 13, // 0x0000000D + SystemDragDropStart = 14, // 0x0000000E + SystemDragDropEnd = 15, // 0x0000000F + SystemDialogStart = 16, // 0x00000010 + SystemDialogEnd = 17, // 0x00000011 + SystemScrollingStart = 18, // 0x00000012 + SystemScrollingEnd = 19, // 0x00000013 + SystemSwitchStart = 20, // 0x00000014 + SystemSwitchEnd = 21, // 0x00000015 + SystemMinimizeStart = 22, // 0x00000016 + SystemMinimizeEnd = 23, // 0x00000017 + ObjectCreate = 32768, // 0x00008000 + ObjectDestroy = 32769, // 0x00008001 + ObjectShow = 32770, // 0x00008002 + ObjectHide = 32771, // 0x00008003 + ObjectReorder = 32772, // 0x00008004 + ObjectFocus = 32773, // 0x00008005 + ObjectSelection = 32774, // 0x00008006 + ObjectSelectionAdd = 32775, // 0x00008007 + ObjectSelectionRemove = 32776, // 0x00008008 + ObjectSelectionWithin = 32777, // 0x00008009 + ObjectStateChange = 32778, // 0x0000800A + ObjectLocationChange = 32779, // 0x0000800B + ObjectNameChange = 32780, // 0x0000800C + ObjectDescriptionChange = 32781, // 0x0000800D + ObjectValueChange = 32782, // 0x0000800E + ObjectParentChange = 32783, // 0x0000800F + ObjectHelpChange = 32784, // 0x00008010 + ObjectDefaultActionChange = 32785, // 0x00008011 + ObjectAcceleratorChange = 32786, // 0x00008012 + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccNavDirs.cs b/UIX/Microsoft/Iris/Accessibility/AccNavDirs.cs new file mode 100644 index 0000000..1e547b2 --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccNavDirs.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccNavDirs +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Accessibility +{ + internal enum AccNavDirs + { + Min, + Up, + Down, + Left, + Right, + Next, + Previous, + FirstChild, + LastChild, + Max, + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccObjectID.cs b/UIX/Microsoft/Iris/Accessibility/AccObjectID.cs new file mode 100644 index 0000000..1d9e3d6 --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccObjectID.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccObjectID +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Accessibility +{ + internal enum AccObjectID + { + Sound = -11, // 0xFFFFFFF5 + Alert = -10, // 0xFFFFFFF6 + Cursor = -9, // 0xFFFFFFF7 + Caret = -8, // 0xFFFFFFF8 + SizeGrip = -7, // 0xFFFFFFF9 + HScroll = -6, // 0xFFFFFFFA + VScroll = -5, // 0xFFFFFFFB + Client = -4, // 0xFFFFFFFC + Menu = -3, // 0xFFFFFFFD + TitleBar = -2, // 0xFFFFFFFE + SysMenu = -1, // 0xFFFFFFFF + Window = 0, + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccRole.cs b/UIX/Microsoft/Iris/Accessibility/AccRole.cs new file mode 100644 index 0000000..2e64303 --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccRole.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccRole +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Accessibility +{ + internal enum AccRole + { + None, + TitleBar, + MenuBar, + ScrollBar, + Grip, + Sound, + Cursor, + Caret, + Alert, + Window, + Client, + MenuPopup, + MenuItem, + ToolTip, + Application, + Document, + Pane, + Chart, + Dialog, + Border, + Grouping, + Separator, + ToolBar, + StatusBar, + Table, + ColumnHeader, + RowHeader, + Column, + Row, + Cell, + Link, + HelpBalloon, + Character, + List, + ListItem, + Outline, + OutlineItem, + PageTab, + PropertyPage, + Indicator, + Graphic, + StaticText, + Text, + PushButton, + CheckButton, + RadioButton, + ComboBox, + DropList, + ProgressBar, + Dial, + HotkeyField, + Slider, + SpinButton, + Diagram, + Animation, + Equation, + ButtonDropDown, + ButtonMenu, + ButtonDropDownGrid, + Whitespace, + PageTabList, + Clock, + SplitButton, + IPAddress, + OutlineButton, + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccSelFlags.cs b/UIX/Microsoft/Iris/Accessibility/AccSelFlags.cs new file mode 100644 index 0000000..9217fbf --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccSelFlags.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccSelFlags +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Accessibility +{ + [Flags] + internal enum AccSelFlags + { + None = 0, + TakeFocus = 1, + TakeSelection = 2, + ExtendSelection = 4, + AddSelection = 8, + RemoveSelection = 16, // 0x00000010 + Valid = RemoveSelection | AddSelection | ExtendSelection | TakeSelection | TakeFocus, // 0x0000001F + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccStates.cs b/UIX/Microsoft/Iris/Accessibility/AccStates.cs new file mode 100644 index 0000000..262001c --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccStates.cs @@ -0,0 +1,49 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccStates +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Accessibility +{ + [Flags] + internal enum AccStates + { + None = 0, + Unavailable = 1, + Selected = 2, + Focused = 4, + Pressed = 8, + Checked = 16, // 0x00000010 + Mixed = 32, // 0x00000020 + Indeterminate = Mixed, // 0x00000020 + ReadOnly = 64, // 0x00000040 + HotTracked = 128, // 0x00000080 + Default = 256, // 0x00000100 + Expanded = 512, // 0x00000200 + Collapsed = 1024, // 0x00000400 + Busy = 2048, // 0x00000800 + Floating = 4096, // 0x00001000 + Marquee = 8192, // 0x00002000 + Animated = 16384, // 0x00004000 + Invisible = 32768, // 0x00008000 + OffScreen = 65536, // 0x00010000 + Sizeable = 131072, // 0x00020000 + Moveable = 262144, // 0x00040000 + SelfVoicing = 524288, // 0x00080000 + Focusable = 1048576, // 0x00100000 + Selectable = 2097152, // 0x00200000 + Linked = 4194304, // 0x00400000 + Traversed = 8388608, // 0x00800000 + MultiSelectable = 16777216, // 0x01000000 + ExtSelectable = 33554432, // 0x02000000 + Alert_Low = 67108864, // 0x04000000 + Alert_Medium = 134217728, // 0x08000000 + Alert_High = 268435456, // 0x10000000 + Protected = 536870912, // 0x20000000 + HasPopup = 1073741824, // 0x40000000 + Valid = HasPopup | Protected | Alert_High | Alert_Medium | Alert_Low | ExtSelectable | MultiSelectable | Traversed | Linked | Selectable | Focusable | SelfVoicing | Moveable | Sizeable | OffScreen | Invisible | Animated | Marquee | Floating | Busy | Collapsed | Expanded | Default | HotTracked | ReadOnly | Indeterminate | Checked | Pressed | Focused | Selected | Unavailable, // 0x7FFFFFFF + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/Accessible.cs b/UIX/Microsoft/Iris/Accessibility/Accessible.cs new file mode 100644 index 0000000..070c518 --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/Accessible.cs @@ -0,0 +1,478 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.Accessible +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Accessibility +{ + internal class Accessible : NotifyObjectBase + { + private DynamicData _dataMap; + private AccessibleProxy _proxy; + private static readonly DataCookie s_descriptionSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_defaultActionSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_defaultActionCommandSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_helpSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_helpTopicSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_keyboardShortcutSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_nameSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_roleSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_valueSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_animatedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_unavailableStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_selectedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_busyStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_pressedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_checkedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_collapsedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_defaultStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_marqueeStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_mixedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_expandedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_traversedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_selectableStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_protectedStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_popupStateSlot = DataCookie.ReserveSlot(); + private static readonly DataCookie s_multiSelectableStateSlot = DataCookie.ReserveSlot(); + + public Accessible() => SetData(s_roleSlot, AccRole.Client); + + public void Attach(AccessibleProxy proxy) + { + _proxy = proxy; + FireNotification(NotificationID.Enabled); + } + + public void Detach() + { + SetData(s_defaultActionCommandSlot, null); + _proxy = null; + } + + public bool Enabled => _proxy != null; + + public string Description + { + get => (string)GetData(s_descriptionSlot); + set + { + string description = Description; + if (!(value != description)) + return; + SetData(s_descriptionSlot, value); + FireAccessiblePropertyChanged(NotificationID.Description, AccessibleProperty.Description); + } + } + + public string DefaultAction + { + get => (string)GetData(s_defaultActionSlot); + set + { + string defaultAction = DefaultAction; + if (!(value != defaultAction)) + return; + SetData(s_defaultActionSlot, value); + FireAccessiblePropertyChanged(NotificationID.DefaultAction, AccessibleProperty.DefaultAction); + } + } + + public IUICommand DefaultActionCommand + { + get => (IUICommand)GetData(s_defaultActionCommandSlot); + set + { + IUICommand defaultActionCommand = DefaultActionCommand; + if (value == defaultActionCommand) + return; + SetData(s_defaultActionCommandSlot, value); + FireAccessiblePropertyChanged(NotificationID.DefaultActionCommand, AccessibleProperty.DefaultActionCommand); + } + } + + public string Help + { + get => (string)GetData(s_helpSlot); + set + { + string help = Help; + if (!(value != help)) + return; + SetData(s_helpSlot, value); + FireAccessiblePropertyChanged(NotificationID.Help, AccessibleProperty.Help); + } + } + + public int HelpTopic + { + get + { + object data = GetData(s_helpTopicSlot); + return data != null ? (int)data : -1; + } + set + { + int helpTopic = HelpTopic; + if (value == helpTopic) + return; + SetData(s_helpTopicSlot, value); + FireAccessiblePropertyChanged(NotificationID.HelpTopic, AccessibleProperty.HelpTopic); + } + } + + public string KeyboardShortcut + { + get => (string)GetData(s_keyboardShortcutSlot); + set + { + string keyboardShortcut = KeyboardShortcut; + if (!(value != keyboardShortcut)) + return; + SetData(s_keyboardShortcutSlot, value); + FireAccessiblePropertyChanged(NotificationID.KeyboardShortcut, AccessibleProperty.KeyboardShortcut); + } + } + + public string Name + { + get => (string)GetData(s_nameSlot); + set + { + string name = Name; + if (!(value != name)) + return; + SetData(s_nameSlot, value); + FireAccessiblePropertyChanged(NotificationID.Name, AccessibleProperty.Name); + } + } + + public AccRole Role + { + get + { + object data = GetData(s_roleSlot); + return data != null ? (AccRole)data : AccRole.None; + } + set + { + AccRole role = Role; + if (value == role) + return; + SetData(s_roleSlot, value); + FireAccessiblePropertyChanged(NotificationID.Role, AccessibleProperty.Role); + } + } + + public string Value + { + get => (string)GetData(s_valueSlot); + set + { + string str = Value; + if (!(value != str)) + return; + SetData(s_valueSlot, value); + FireAccessiblePropertyChanged(NotificationID.Value, AccessibleProperty.Value); + } + } + + public bool IsAnimated + { + get + { + object data = GetData(s_animatedStateSlot); + return data != null && (bool)data; + } + set + { + bool isAnimated = IsAnimated; + if (value == isAnimated) + return; + SetData(s_animatedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsAnimated, AccessibleProperty.IsAnimated); + } + } + + public bool IsUnavailable + { + get + { + object data = GetData(s_unavailableStateSlot); + return data != null && (bool)data; + } + set + { + bool isUnavailable = IsUnavailable; + if (value == isUnavailable) + return; + SetData(s_unavailableStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsUnavailable, AccessibleProperty.IsUnavailable); + } + } + + public bool IsSelected + { + get + { + object data = GetData(s_selectedStateSlot); + return data != null && (bool)data; + } + set + { + bool isSelected = IsSelected; + if (value == isSelected) + return; + SetData(s_selectedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsSelected, AccessibleProperty.IsSelected); + } + } + + public bool IsBusy + { + get + { + object data = GetData(s_busyStateSlot); + return data != null && (bool)data; + } + set + { + bool isBusy = IsBusy; + if (value == isBusy) + return; + SetData(s_busyStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsBusy, AccessibleProperty.IsBusy); + } + } + + public bool IsPressed + { + get + { + object data = GetData(s_pressedStateSlot); + return data != null && (bool)data; + } + set + { + bool isPressed = IsPressed; + if (value == isPressed) + return; + SetData(s_pressedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsPressed, AccessibleProperty.IsPressed); + } + } + + public bool IsChecked + { + get + { + object data = GetData(s_checkedStateSlot); + return data != null && (bool)data; + } + set + { + bool isChecked = IsChecked; + if (value == isChecked) + return; + SetData(s_checkedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsChecked, AccessibleProperty.IsChecked); + } + } + + public bool IsCollapsed + { + get + { + object data = GetData(s_collapsedStateSlot); + return data != null && (bool)data; + } + set + { + bool isCollapsed = IsCollapsed; + if (value == isCollapsed) + return; + SetData(s_collapsedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsCollapsed, AccessibleProperty.IsCollapsed); + } + } + + public bool IsDefault + { + get + { + object data = GetData(s_defaultStateSlot); + return data != null && (bool)data; + } + set + { + bool isDefault = IsDefault; + if (value == isDefault) + return; + SetData(s_defaultStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsDefault, AccessibleProperty.IsDefault); + } + } + + public bool IsMarquee + { + get + { + object data = GetData(s_marqueeStateSlot); + return data != null && (bool)data; + } + set + { + bool isMarquee = IsMarquee; + if (value == isMarquee) + return; + SetData(s_marqueeStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsMarquee, AccessibleProperty.IsMarquee); + } + } + + public bool IsMixed + { + get + { + object data = GetData(s_mixedStateSlot); + return data != null && (bool)data; + } + set + { + bool isMixed = IsMixed; + if (value == isMixed) + return; + SetData(s_mixedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsMixed, AccessibleProperty.IsMixed); + } + } + + public bool IsExpanded + { + get + { + object data = GetData(s_expandedStateSlot); + return data != null && (bool)data; + } + set + { + bool isExpanded = IsExpanded; + if (value == isExpanded) + return; + SetData(s_expandedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsExpanded, AccessibleProperty.IsExpanded); + } + } + + public bool IsTraversed + { + get + { + object data = GetData(s_traversedStateSlot); + return data != null && (bool)data; + } + set + { + bool isTraversed = IsTraversed; + if (value == isTraversed) + return; + SetData(s_traversedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsTraversed, AccessibleProperty.IsTraversed); + } + } + + public bool IsSelectable + { + get + { + object data = GetData(s_selectableStateSlot); + return data != null && (bool)data; + } + set + { + bool isSelectable = IsSelectable; + if (value == isSelectable) + return; + SetData(s_selectableStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsSelectable, AccessibleProperty.IsSelectable); + } + } + + public bool IsMultiSelectable + { + get + { + object data = GetData(s_multiSelectableStateSlot); + return data != null && (bool)data; + } + set + { + bool isMultiSelectable = IsMultiSelectable; + if (value == isMultiSelectable) + return; + SetData(s_multiSelectableStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsMultiSelectable, AccessibleProperty.IsMultiSelectable); + } + } + + public bool IsProtected + { + get + { + object data = GetData(s_protectedStateSlot); + return data != null && (bool)data; + } + set + { + bool isProtected = IsProtected; + if (value == isProtected) + return; + SetData(s_protectedStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.IsProtected, AccessibleProperty.IsProtected); + } + } + + public bool HasPopup + { + get + { + object data = GetData(s_popupStateSlot); + return data != null && (bool)data; + } + set + { + bool hasPopup = HasPopup; + if (value == hasPopup) + return; + SetData(s_popupStateSlot, value); + FireAccessiblePropertyChanged(NotificationID.HasPopup, AccessibleProperty.HasPopup); + } + } + + protected void FireAccessiblePropertyChanged( + string propertyName, + AccessibleProperty accessibleProperty) + { + FireNotification(propertyName); + if (_proxy != null) + { + _proxy.NotifyAccessiblePropertyChanged(accessibleProperty); + } + else + { + 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", propertyName); + } + } + + protected object GetData(DataCookie cookie) => _dataMap.GetData(cookie); + + protected void SetData(DataCookie cookie, object value) => _dataMap.SetData(cookie, value); + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccessibleChildren.cs b/UIX/Microsoft/Iris/Accessibility/AccessibleChildren.cs new file mode 100644 index 0000000..d8b0773 --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccessibleChildren.cs @@ -0,0 +1,98 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccessibleChildren +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; + +namespace Microsoft.Iris.Accessibility +{ + [ComVisible(true)] + public class AccessibleChildren : IEnumVARIANT + { + private AccessibleProxy _proxy; + private int _current; + + internal AccessibleChildren(AccessibleProxy proxy) + : this(proxy, -1) + { + } + + internal AccessibleChildren(AccessibleProxy proxy, int position) + { + _proxy = proxy; + _current = position; + } + + internal IEnumVARIANT Clone() => new AccessibleChildren(_proxy, _current); + + internal int Next(int count, object[] children) + { + int index = 0; + do + { + ++_current; + if (_current >= _proxy.UI.Children.Count) + { + _current = _proxy.UI.Children.Count; + break; + } + UIClass child = (UIClass)_proxy.UI.Children[_current]; + children[index] = child.AccessibleProxy; + ++index; + } + while (index < count); + return index; + } + + internal void Reset() => _current = -1; + + internal bool Skip(int count) + { + _current += count; + if (_current < _proxy.UI.Children.Count) + return true; + _current = _proxy.UI.Children.Count; + return false; + } + + IEnumVARIANT IEnumVARIANT.Clone() + { + VerifyEnumeratorAccess(); + return Clone(); + } + + unsafe int IEnumVARIANT.Next(int celt, object[] rgVar, IntPtr pceltFetched) + { + VerifyEnumeratorAccess(); + int num = Next(celt, rgVar); + *(int*)(void*)pceltFetched = num; + return num != celt ? 1 : 0; + } + + int IEnumVARIANT.Reset() + { + VerifyEnumeratorAccess(); + Reset(); + return 0; + } + + int IEnumVARIANT.Skip(int celt) + { + VerifyEnumeratorAccess(); + return !Skip(celt) ? 1 : 0; + } + + private void VerifyEnumeratorAccess() + { + if (_proxy.UI != null && UIDispatcher.IsUIThread) + return; + Marshal.ThrowExceptionForHR(-2147467259); + } + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccessibleProperty.cs b/UIX/Microsoft/Iris/Accessibility/AccessibleProperty.cs new file mode 100644 index 0000000..ebc2a68 --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccessibleProperty.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccessibleProperty +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Accessibility +{ + internal enum AccessibleProperty + { + DefaultAction, + DefaultActionCommand, + Description, + HasPopup, + Help, + HelpTopic, + IsAnimated, + IsBusy, + IsChecked, + IsCollapsed, + IsDefault, + IsExpanded, + IsMarquee, + IsMixed, + IsMultiSelectable, + IsPressed, + IsProtected, + IsSelectable, + IsSelected, + IsTraversed, + IsUnavailable, + KeyboardShortcut, + Name, + Role, + Value, + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/AccessibleProxy.cs b/UIX/Microsoft/Iris/Accessibility/AccessibleProxy.cs new file mode 100644 index 0000000..a5bee40 --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/AccessibleProxy.cs @@ -0,0 +1,549 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.AccessibleProxy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Accessibility; +using Microsoft.Iris.Navigation; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.ComTypes; +using System.Security; + +namespace Microsoft.Iris.Accessibility +{ + [ComVisible(true)] + [SuppressUnmanagedCodeSecurity] + public class AccessibleProxy : Microsoft.Iris.OS.CLR.StandardOleMarshalObject, IAccessible, IEnumVARIANT + { + internal static readonly Guid IID_IAccessible = new Guid("618736E0-3C3D-11CF-810C-00AA00389B71"); + private UIClass _ui; + private Accessible _data; + private IEnumVARIANT _children; + private int _proxyID = -1; + private static int s_proxyIDAllocator = 0; + private static Map s_proxyFromID = new Map(); + private static DeferredHandler s_notifyEventHandler = new DeferredHandler(NotifyEvent); + private static bool s_accessibilityActive; + + internal AccessibleProxy(UIClass ui, Accessible data) + { + _ui = ui; + _data = data; + _data.Attach(this); + _children = new AccessibleChildren(this); + } + + internal UIClass UI => _ui; + + internal void Detach() + { + _data.Detach(); + _ui = null; + if (_proxyID == -1) + return; + s_proxyFromID.Remove(_proxyID); + } + + internal static bool AccessibilityActive + { + get => s_accessibilityActive; + set => s_accessibilityActive = true; + } + + internal virtual IAccessible Parent => _ui.Parent != null ? _ui.Parent.AccessibleProxy : null; + + internal int ChildCount => _ui.Children.Count; + + internal virtual string Name + { + get => _data.Name; + set => _data.Name = value; + } + + internal string Value + { + get => _data.Value; + set => _data.Value = value; + } + + internal string Description => _data.Description; + + internal AccRole Role => _data.Role; + + internal AccStates State + { + get + { + AccStates accStates = AccStates.None; + if (_ui.DirectKeyFocus) + accStates |= AccStates.Focused; + if (_ui.IsKeyFocusable()) + accStates |= AccStates.Focusable; + if (_ui.DirectMouseFocus) + accStates |= AccStates.HotTracked; + if (!_ui.Visible) + accStates |= AccStates.Invisible; + if (_ui.Host != null && _ui.Host.IsOffscreen) + accStates |= AccStates.OffScreen; + if (_data.HasPopup) + accStates |= AccStates.HasPopup; + if (_data.IsAnimated) + accStates |= AccStates.Animated; + if (_data.IsBusy) + accStates |= AccStates.Busy; + if (_data.IsChecked) + accStates |= AccStates.Checked; + if (_data.IsCollapsed) + accStates |= AccStates.Collapsed; + if (_data.IsDefault) + accStates |= AccStates.Default; + if (_data.IsExpanded) + accStates |= AccStates.Expanded; + if (_data.IsMarquee) + accStates |= AccStates.Marquee; + if (_data.IsMixed) + accStates |= AccStates.Mixed; + if (_data.IsMultiSelectable) + accStates |= AccStates.MultiSelectable; + if (_data.IsPressed) + accStates |= AccStates.Pressed; + if (_data.IsProtected) + accStates |= AccStates.Protected; + if (_data.IsSelectable) + accStates |= AccStates.Selectable; + if (_data.IsSelected) + accStates |= AccStates.Selected; + if (_data.IsTraversed) + accStates |= AccStates.Traversed; + if (_data.IsUnavailable) + accStates |= AccStates.Unavailable; + return accStates; + } + } + + internal string Help => _data.Help; + + internal int HelpTopic => _data.HelpTopic; + + internal string KeyboardShortcut => _data.KeyboardShortcut; + + internal bool HasFocus => _ui.DirectKeyFocus; + + internal string DefaultAction => _data.DefaultAction; + + internal Rectangle Location + { + get + { + Rectangle rectangle = Rectangle.Zero; + Vector3 positionPxlVector; + Vector3 sizePxlVector; + if (_ui.RootItem != null && ((INavigationSite)_ui.RootItem).ComputeBounds(out positionPxlVector, out sizePxlVector)) + { + rectangle = new Rectangle((int)positionPxlVector.X, (int)positionPxlVector.Y, (int)sizePxlVector.X, (int)sizePxlVector.Y); + Point location = rectangle.Location; + UISession.Default.Form.ClientToScreen(ref location); + rectangle.Location = location; + } + return rectangle; + } + } + + internal virtual IAccessible Navigate(AccNavDirs navDir) + { + UIClass resultUI = null; + switch (navDir) + { + case AccNavDirs.Up: + _ui.FindNextFocusablePeer(Direction.North, RectangleF.Zero, out resultUI); + break; + case AccNavDirs.Down: + _ui.FindNextFocusablePeer(Direction.South, RectangleF.Zero, out resultUI); + break; + case AccNavDirs.Left: + _ui.FindNextFocusablePeer(Direction.West, RectangleF.Zero, out resultUI); + break; + case AccNavDirs.Right: + _ui.FindNextFocusablePeer(Direction.East, RectangleF.Zero, out resultUI); + break; + case AccNavDirs.Next: + resultUI = (UIClass)_ui.NextSibling; + break; + case AccNavDirs.Previous: + resultUI = (UIClass)_ui.PreviousSibling; + break; + case AccNavDirs.FirstChild: + resultUI = (UIClass)_ui.FirstChild; + break; + case AccNavDirs.LastChild: + resultUI = (UIClass)_ui.LastChild; + break; + } + return resultUI != null ? resultUI.AccessibleProxy : null; + } + + internal void DoDefaultAction() + { + if (_data.DefaultActionCommand == null) + return; + _data.DefaultActionCommand.Invoke(); + } + + internal static void NotifyCreated(UIClass ui) + { + if (!AccessibilityActive) + return; + ui.AccessibleProxy.QueueNotifyEvent(AccEvents.ObjectCreate); + } + + internal static void NotifyDestroyed(UIClass ui) + { + if (!AccessibilityActive) + return; + ui.AccessibleProxy.QueueNotifyEvent(AccEvents.ObjectDestroy); + } + + internal static void NotifyTreeChanged(UIClass ui) + { + if (!AccessibilityActive || !ui.Initialized) + return; + ui.AccessibleProxy.QueueNotifyEvent(AccEvents.ObjectReorder); + } + + internal static void NotifyVisibilityChange(UIClass ui, bool visible) + { + if (!AccessibilityActive || !ui.Initialized) + return; + ui.AccessibleProxy.QueueNotifyEvent(visible ? AccEvents.ObjectShow : AccEvents.ObjectHide); + } + + internal static void NotifyFocus(UIClass ui) + { + if (!AccessibilityActive || !ui.Initialized) + return; + ui.AccessibleProxy.QueueNotifyEvent(AccEvents.ObjectFocus); + } + + internal void NotifyAccessiblePropertyChanged(AccessibleProperty property) + { + if (!_ui.Initialized) + return; + AccEvents eventType = AccEvents.None; + switch (property) + { + case AccessibleProperty.DefaultAction: + eventType = AccEvents.ObjectDefaultActionChange; + break; + case AccessibleProperty.Description: + eventType = AccEvents.ObjectDescriptionChange; + break; + case AccessibleProperty.HasPopup: + case AccessibleProperty.IsAnimated: + case AccessibleProperty.IsBusy: + case AccessibleProperty.IsChecked: + case AccessibleProperty.IsCollapsed: + case AccessibleProperty.IsDefault: + case AccessibleProperty.IsExpanded: + case AccessibleProperty.IsMarquee: + case AccessibleProperty.IsMixed: + case AccessibleProperty.IsMultiSelectable: + case AccessibleProperty.IsPressed: + case AccessibleProperty.IsProtected: + case AccessibleProperty.IsSelectable: + case AccessibleProperty.IsTraversed: + case AccessibleProperty.IsUnavailable: + eventType = AccEvents.ObjectStateChange; + break; + case AccessibleProperty.Help: + eventType = AccEvents.ObjectHelpChange; + break; + case AccessibleProperty.HelpTopic: + eventType = AccEvents.ObjectHelpChange; + break; + case AccessibleProperty.IsSelected: + if (_data.IsSelected) + { + eventType = AccEvents.ObjectSelection; + break; + } + break; + case AccessibleProperty.KeyboardShortcut: + eventType = AccEvents.ObjectAcceleratorChange; + break; + case AccessibleProperty.Name: + eventType = AccEvents.ObjectNameChange; + break; + case AccessibleProperty.Value: + eventType = AccEvents.ObjectValueChange; + break; + } + if (eventType == AccEvents.None) + return; + QueueNotifyEvent(eventType); + } + + private void QueueNotifyEvent(AccEvents eventType) + { + object obj = new object[2] + { + this, + (int) eventType + }; + DeferredCall.Post(DispatchPriority.AppEvent, s_notifyEventHandler, obj); + } + + private static void NotifyEvent(object payload) + { + object[] objArray = (object[])payload; + AccessibleProxy accessibleProxy = (AccessibleProxy)objArray[0]; + AccEvents accEvents = (AccEvents)objArray[1]; + int proxyId = accessibleProxy.ProxyID; + UISession.Default.Form.NotifyWinEvent((int)accEvents, proxyId, 0); + if (accEvents != AccEvents.ObjectDestroy) + return; + accessibleProxy.Detach(); + } + + object IAccessible.accParent + { + get + { + VerifyProxyAccess(); + return Parent; + } + } + + object IAccessible.get_accChild(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return this; + } + + int IAccessible.accChildCount + { + get + { + VerifyProxyAccess(); + return ChildCount; + } + } + + string IAccessible.get_accName(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return Name; + } + + string IAccessible.get_accValue(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return Value; + } + + string IAccessible.get_accDescription(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return Description; + } + + object IAccessible.get_accRole(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return (int)Role; + } + + object IAccessible.get_accState(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return (int)State; + } + + string IAccessible.get_accHelp(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return Help; + } + + int IAccessible.get_accHelpTopic(out string pszHelpFile, object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + pszHelpFile = null; + return HelpTopic; + } + + string IAccessible.get_accKeyboardShortcut(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return KeyboardShortcut; + } + + object IAccessible.accFocus + { + get + { + VerifyProxyAccess(); + return HasFocus ? 0 : (object)null; + } + } + + object IAccessible.accSelection + { + get + { + VerifyProxyAccess(); + Marshal.ThrowExceptionForHR(-2147467263); + return null; + } + } + + string IAccessible.get_accDefaultAction(object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + return DefaultAction; + } + + void IAccessible.accSelect(int flagsSelect, object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + Marshal.ThrowExceptionForHR(-2147467263); + } + + void IAccessible.accLocation( + out int pxLeft, + out int pyTop, + out int pcxWidth, + out int pcyHeight, + object varChild) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + Rectangle location = Location; + pxLeft = location.X; + pyTop = location.Y; + pcxWidth = location.Width; + pcyHeight = location.Height; + } + + object IAccessible.accNavigate(int navDir, object varStart) + { + VerifyProxyAccess(); + VerifySelfChildID(varStart); + return Navigate((AccNavDirs)navDir); + } + + object IAccessible.accHitTest(int xLeft, int yTop) + { + VerifyProxyAccess(); + Marshal.ThrowExceptionForHR(-2147467263); + return null; + } + + void IAccessible.accDoDefaultAction(object varChild) + { + VerifyProxyAccess(); + DoDefaultAction(); + } + + void IAccessible.set_accName(object varChild, string pszName) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + Name = pszName; + } + + void IAccessible.set_accValue(object varChild, string pszValue) + { + VerifyProxyAccess(); + VerifySelfChildID(varChild); + Value = pszValue; + } + + IEnumVARIANT IEnumVARIANT.Clone() + { + VerifyProxyAccess(); + return _children.Clone(); + } + + int IEnumVARIANT.Next(int celt, object[] rgVar, IntPtr pceltFetched) + { + VerifyProxyAccess(); + return _children.Next(celt, rgVar, pceltFetched); + } + + int IEnumVARIANT.Reset() + { + VerifyProxyAccess(); + return _children.Reset(); + } + + int IEnumVARIANT.Skip(int celt) + { + VerifyProxyAccess(); + return _children.Skip(celt); + } + + private void VerifyProxyAccess() + { + if (_ui != null && UIDispatcher.IsUIThread) + return; + Marshal.ThrowExceptionForHR(-2147467259); + } + + private void VerifySelfChildID(object varChild) + { + if (varChild is int && (AccChildID)varChild == AccChildID.Self) + return; + Marshal.ThrowExceptionForHR(-2147024809); + } + + private int ProxyID + { + get + { + if (_proxyID == -1) + { + _proxyID = ++s_proxyIDAllocator; + s_proxyFromID[_proxyID] = this; + } + return _proxyID; + } + } + + internal static AccessibleProxy AccessibleProxyFromID(int proxyID) + { + AccessibleProxy accessibleProxy; + s_proxyFromID.TryGetValue(proxyID, out accessibleProxy); + return accessibleProxy; + } + + [DllImport("oleacc.dll")] + internal static extern IntPtr LresultFromObject( + ref Guid riid, + IntPtr wParam, + [MarshalAs(UnmanagedType.Interface)] object accPtr); + + [DllImport("oleacc.dll")] + internal static extern int CreateStdAccessibleObject( + IntPtr hwnd, + int objectID, + [MarshalAs(UnmanagedType.LPStruct)] Guid riid, + [MarshalAs(UnmanagedType.Interface)] out object accPtr); + } +} diff --git a/UIX/Microsoft/Iris/Accessibility/RootAccessibleProxy.cs b/UIX/Microsoft/Iris/Accessibility/RootAccessibleProxy.cs new file mode 100644 index 0000000..8600d55 --- /dev/null +++ b/UIX/Microsoft/Iris/Accessibility/RootAccessibleProxy.cs @@ -0,0 +1,53 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Accessibility.RootAccessibleProxy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Accessibility; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Accessibility +{ + [ComVisible(true)] + public class RootAccessibleProxy : AccessibleProxy + { + private IAccessible _clientBridge; + + internal RootAccessibleProxy(UIClass ui, Accessible data) + : base(ui, data) + { + } + + internal override IAccessible Parent => (IAccessible)_clientBridge.accParent; + + internal override IAccessible Navigate(AccNavDirs navDir) + { + IAccessible accessible = null; + switch (navDir) + { + case AccNavDirs.Up: + case AccNavDirs.Down: + case AccNavDirs.Left: + case AccNavDirs.Right: + case AccNavDirs.Next: + case AccNavDirs.Previous: + accessible = (IAccessible)_clientBridge.accNavigate((int)navDir, 0); + break; + case AccNavDirs.FirstChild: + case AccNavDirs.LastChild: + accessible = base.Navigate(navDir); + break; + } + return accessible; + } + + internal override string Name => UIApplication.ApplicationName; + + internal IAccessible ClientBridge => _clientBridge; + + internal void AttachClientBridge(IAccessible clientBridge) => _clientBridge = clientBridge; + } +} diff --git a/UIX/Microsoft/Iris/AggregateList.cs b/UIX/Microsoft/Iris/AggregateList.cs new file mode 100644 index 0000000..265b2fa --- /dev/null +++ b/UIX/Microsoft/Iris/AggregateList.cs @@ -0,0 +1,197 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.AggregateList +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using System; +using System.Collections; +using System.Diagnostics; + +namespace Microsoft.Iris +{ + public class AggregateList : VirtualList + { + private IList[] _lists; + + public AggregateList() + : this(null) + { + } + + public AggregateList(IList list1) + : this(new IList[1] { list1 }) + { + } + + public AggregateList(IList list1, IList list2) + : this(new IList[2] { list1, list2 }) + { + } + + public AggregateList(IList list1, IList list2, IList list3) + : this(new IList[3] { list1, list2, list3 }) + { + } + + public AggregateList(IList list1, IList list2, IList list3, IList list4) + : this(new IList[4] { list1, list2, list3, list4 }) + { + } + + public AggregateList(IList[] lists) + : base(true) + { + if (lists == null) + lists = new IList[0]; + _lists = lists; + UIListContentsChangedHandler contentsChangedHandler = new UIListContentsChangedHandler(ChildListModified); + SlowDataAcquireCompleteHandler acquireCompleteHandler = new SlowDataAcquireCompleteHandler(ChildListSlowDataAcquired); + for (int index = 0; index < _lists.Length; ++index) + { + if (_lists[index] == null) + _lists[index] = new ArrayList(); + IList list = _lists[index]; + if (list is INotifyList notifyList) + notifyList.ContentsChanged += contentsChangedHandler; + if (list is IVirtualList virtualList && virtualList.SlowDataRequestsEnabled) + virtualList.SlowDataAcquireCompleteHandler = acquireCompleteHandler; + } + Count = ItemCount; + } + + protected override void OnDispose(bool disposing) + { + if (disposing) + { + UIListContentsChangedHandler contentsChangedHandler = new UIListContentsChangedHandler(ChildListModified); + foreach (IList list in _lists) + { + if (list is INotifyList notifyList) + notifyList.ContentsChanged -= contentsChangedHandler; + if (list is IVirtualList virtualList && virtualList.SlowDataRequestsEnabled) + virtualList.SlowDataAcquireCompleteHandler = null; + } + } + base.OnDispose(disposing); + } + + protected override object OnRequestItem(int index) + { + foreach (IList list in _lists) + { + if (index < list.Count) + return list[index]; + index -= list.Count; + } + throw new IndexOutOfRangeException(nameof(index)); + } + + protected override void OnRequestSlowData(int index) + { + foreach (IList list in _lists) + { + if (index < list.Count) + { + if (list is IVirtualList virtualList && virtualList.SlowDataRequestsEnabled) + { + virtualList.NotifyRequestSlowData(index); + break; + } + break; + } + index -= list.Count; + } + NotifySlowDataAcquireComplete(index); + } + + private bool ChildListSlowDataAcquired(IVirtualList childList, int index) + { + NotifySlowDataAcquireComplete(ListIndexToMasterIndex(childList, index)); + return true; + } + + private void ChildListModified(IList listSender, UIListContentsChangedArgs args) + { + int masterIndex1 = ListIndexToMasterIndex(listSender, args.OldIndex); + int masterIndex2 = ListIndexToMasterIndex(listSender, args.NewIndex); + switch (args.Type) + { + case UIListContentsChangeType.Add: + case UIListContentsChangeType.Insert: + Insert(masterIndex2); + break; + case UIListContentsChangeType.AddRange: + case UIListContentsChangeType.InsertRange: + InsertRange(masterIndex2, args.Count); + break; + case UIListContentsChangeType.Remove: + RemoveAt(masterIndex1); + break; + case UIListContentsChangeType.Move: + if (masterIndex1 == masterIndex2) + break; + Move(masterIndex1, masterIndex2); + break; + case UIListContentsChangeType.Modified: + Modified(masterIndex2); + break; + default: + Clear(); + Count = ItemCount; + break; + } + } + + [Conditional("DEBUG")] + private void DEBUG_ValidateConsistency() + { + int index1 = 0; + for (int index2 = 0; index2 < _lists.Length; ++index2) + { + for (int index3 = 0; index3 < _lists[index2].Count; ++index3) + { + object obj1 = _lists[index2][index3]; + object obj2 = this[index1]; + ++index1; + } + } + } + + private int ListIndexToMasterIndex(IList list, int index) + { + int num = 0; + for (int index1 = 0; index1 < _lists.Length && _lists[index1] != list; ++index1) + num += _lists[index1].Count; + return num + index; + } + + private void MasterIndexToListIndex(int masterIndex, out IList list, out int index) + { + int num = 0; + int index1 = 0; + list = null; + for (; index1 < _lists.Length; ++index1) + { + list = _lists[index1]; + if (num + list.Count <= masterIndex) + num += list.Count; + else + break; + } + index = masterIndex - num; + } + + private int ItemCount + { + get + { + int num = 0; + foreach (IList list in _lists) + num += list.Count; + return num; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/ActiveSequence.cs b/UIX/Microsoft/Iris/Animations/ActiveSequence.cs new file mode 100644 index 0000000..45e5394 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/ActiveSequence.cs @@ -0,0 +1,309 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.ActiveSequence +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using System; +using System.Text; + +namespace Microsoft.Iris.Animations +{ + internal class ActiveSequence : DisposableObject + { + private UISession _session; + private IAnimatable _animatableTarget; + private Vector _ready; + private Vector _playing; + private float _lastProgress; + private AnimationTemplate _template; + private int _playingCount; + + internal ActiveSequence( + AnimationTemplate template_, + IAnimatable animatableTarget, + UISession session) + { + _animatableTarget = animatableTarget; + _session = session; + _template = template_; + _ready = new Vector(); + } + + protected override void OnDispose() + { + base.OnDispose(); + Vector animationCollection = GetAnimationCollection(); + if (animationCollection != null) + { + foreach (DisposableObject disposableObject in animationCollection) + disposableObject.Dispose(this); + FireComplete(false); + } + _session = null; + _animatableTarget = null; + _template = null; + _ready = null; + } + + public UISession Session => _session; + + internal IAnimatable Target => _animatableTarget; + + public AnimationTemplate Template => _template; + + public bool Playing => _playing != null; + + internal Vector PendingProxies => _ready; + + public void Play() + { + Vector ready = _ready; + _ready = null; + if (ready.Count > 0) + { + foreach (AnimationProxy animationProxy in ready) + animationProxy.Play(); + _playing = ready; + FireStart(); + } + else + { + FireStart(); + FireComplete(true); + } + } + + public void Stop() => Stop(null); + + public void Stop(StopCommandSet stopSetCommand) + { + if (UIDispatcher.IsUIThread) + { + StopWorker(stopSetCommand); + } + else + { + try + { + if (!Session.IsValid) + return; + DeferredCall.Post(DispatchPriority.High, new DeferredHandler(DeferredStop), stopSetCommand); + } + catch (InvalidOperationException ex) + { + } + } + } + + private void StopWorker(StopCommandSet stopSetCommand) + { + if (_playing == null) + return; + foreach (AnimationProxy animationProxy in _playing) + { + if (stopSetCommand != null) + animationProxy.Stop(stopSetCommand[animationProxy.Type]); + else + animationProxy.Stop(); + } + } + + private void DeferredStop(object args) => StopWorker((StopCommandSet)args); + + public bool ValidatePlayable() + { + foreach (AnimationProxy animationProxy in _ready) + { + if (!animationProxy.ValidatePlayable()) + return false; + } + return true; + } + + internal void OnAttachChildAnimation(AnimationProxy child) + { + child.DeclareOwner(this); + _ready.Add(child); + } + + private Vector GetAnimationCollection() => _ready ?? _playing; + + internal void OnDetachChildAnimation(AnimationProxy child, float progress) + { + Vector animationCollection = GetAnimationCollection(); + if (animationCollection == null) + return; + animationCollection.Remove(child); + child.Dispose(this); + if (_lastProgress < (double)progress) + _lastProgress = progress; + if (animationCollection != _playing || animationCollection.Count != 0) + return; + FireComplete(true); + } + + private void FireStart() => OnStart(); + + private void FireComplete(bool notify) + { + if (_playing != null) + _playing = null; + OnStop(_lastProgress, notify); + } + + public StopCommandSet GetStopCommandSet() + { + StopCommandSet stopCommandSet = null; + foreach (AnimationProxy animation in GetAnimationCollection()) + { + if (animation.HasDynamicKeyframes) + { + if (stopCommandSet == null) + stopCommandSet = new StopCommandSet(StopCommand.MoveToEnd); + stopCommandSet[animation.Type] = StopCommand.LeaveCurrent; + } + } + return stopCommandSet; + } + + public ActiveTransitions GetActiveTransitions() + { + Vector animationCollection = GetAnimationCollection(); + ActiveTransitions activeTransitions = ActiveTransitions.None; + foreach (AnimationProxy animationProxy in animationCollection) + { + ActiveTransitions activeTransition = ConvertToActiveTransition(animationProxy.Type); + activeTransitions |= activeTransition; + } + return activeTransitions; + } + + public static ActiveTransitions ConvertToActiveTransition(AnimationType type) + { + switch (type) + { + case AnimationType.Position: + return ActiveTransitions.Move; + case AnimationType.Size: + return ActiveTransitions.Size; + case AnimationType.Alpha: + return ActiveTransitions.Alpha; + case AnimationType.Scale: + return ActiveTransitions.Scale; + case AnimationType.Rotate: + return ActiveTransitions.Rotate; + case AnimationType.Orientation: + return ActiveTransitions.Orientation; + case AnimationType.PositionX: + return ActiveTransitions.PositionX; + case AnimationType.PositionY: + return ActiveTransitions.PositionY; + case AnimationType.SizeX: + return ActiveTransitions.SizeX; + case AnimationType.SizeY: + return ActiveTransitions.SizeY; + case AnimationType.ScaleX: + return ActiveTransitions.ScaleX; + case AnimationType.ScaleY: + return ActiveTransitions.ScaleY; + case AnimationType.Float: + case AnimationType.Vector2: + case AnimationType.Vector3: + return ActiveTransitions.Effect; + case AnimationType.CameraEye: + return ActiveTransitions.CameraEye; + case AnimationType.CameraAt: + return ActiveTransitions.CameraAt; + case AnimationType.CameraUp: + return ActiveTransitions.CameraUp; + case AnimationType.CameraZn: + return ActiveTransitions.CameraZn; + default: + return ActiveTransitions.None; + } + } + + public static ActiveTransitions ConvertToActiveTransition( + AnimationEventType type) + { + switch (type) + { + case AnimationEventType.Move: + return ActiveTransitions.Move; + case AnimationEventType.Size: + return ActiveTransitions.Size; + case AnimationEventType.Scale: + return ActiveTransitions.Scale; + case AnimationEventType.Rotate: + return ActiveTransitions.Rotate | ActiveTransitions.Orientation; + case AnimationEventType.Alpha: + return ActiveTransitions.Alpha; + default: + return ActiveTransitions.None; + } + } + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("{ActiveSequence Template=\""); + if (_template.DebugID != null) + { + stringBuilder.Append(_template.DebugID); + } + else + { + Animation template = _template as Animation; + if (template != null) + stringBuilder.Append(template.Type); + else + stringBuilder.Append(""); + } + stringBuilder.Append("\", Target="); + stringBuilder.Append(_animatableTarget.GetType().Name); + if (_animatableTarget is IVisual) + { + stringBuilder.Append(", IVisual="); + stringBuilder.Append(((IVisual)_animatableTarget).DebugID); + } + stringBuilder.Append("}"); + return stringBuilder.ToString(); + } + + public event EventHandler AnimationStarted; + + public event EventHandler AnimationCompleted; + + public event EventHandler AfterAnimationCompleted; + + internal void OnStart() + { + ++_playingCount; + if (_playingCount != 1 || AnimationStarted == null) + return; + AnimationStarted(this, EventArgs.Empty); + } + + internal void OnStop(float progress, bool notify) + { + --_playingCount; + if (notify && _playingCount == 0) + { + EventArgs e = new AnimationCompleteArgs(progress); + if (AnimationCompleted != null) + AnimationCompleted(this, e); + if (AfterAnimationCompleted == null) + return; + AfterAnimationCompleted(this, e); + } + else + { + int playingCount = _playingCount; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/ActiveTransitions.cs b/UIX/Microsoft/Iris/Animations/ActiveTransitions.cs new file mode 100644 index 0000000..20dcb51 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/ActiveTransitions.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.ActiveTransitions +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Animations +{ + [Flags] + internal enum ActiveTransitions + { + None = 0, + Move = 1, + Scale = 2, + Alpha = 4, + Rotate = 8, + Size = 16, // 0x00000010 + Effect = 32, // 0x00000020 + PositionX = 64, // 0x00000040 + PositionY = 128, // 0x00000080 + SizeX = 256, // 0x00000100 + SizeY = 512, // 0x00000200 + ScaleX = 1024, // 0x00000400 + ScaleY = 2048, // 0x00000800 + Orientation = 4096, // 0x00001000 + CameraEye = 8192, // 0x00002000 + CameraAt = 16384, // 0x00004000 + CameraUp = 32768, // 0x00008000 + CameraZn = 65536, // 0x00010000 + } +} diff --git a/UIX/Microsoft/Iris/Animations/AlphaKeyframe.cs b/UIX/Microsoft/Iris/Animations/AlphaKeyframe.cs new file mode 100644 index 0000000..cfd4146 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AlphaKeyframe.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AlphaKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class AlphaKeyframe : BaseMultiplyFloatKeyframe + { + public override AnimationType Type => AnimationType.Alpha; + + public override float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + return RelativeTo == RelativeTo.Final ? baseValue * args.NewAlpha : baseValue; + } + + public override void Apply(IAnimatableOwner animationTarget, float value) => ((ViewItem)animationTarget).VisualAlpha = value; + + public override void MagnifyValue(float magnifyValue) + { + float num = Value * magnifyValue; + if (num > 1.0) + num = 1f; + Value = num; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/Animation.cs b/UIX/Microsoft/Iris/Animations/Animation.cs new file mode 100644 index 0000000..89ea6cc --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/Animation.cs @@ -0,0 +1,152 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.Animation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System; +using System.Collections.Specialized; +using System.Text; + +namespace Microsoft.Iris.Animations +{ + internal class Animation : AnimationTemplate, IAnimationProvider + { + private static readonly DataCookie s_rotationAxisProperty = DataCookie.ReserveSlot(); + private static readonly DataCookie s_centerPointScaleProperty = DataCookie.ReserveSlot(); + private static readonly DataCookie s_centerPointOffsetProperty = DataCookie.ReserveSlot(); + private BitVector32 _bitsBitVector; + private AnimationEventType _type; + private DynamicData _dataMap; + + public Animation() + { + _type = AnimationEventType.Idle; + _bitsBitVector = new BitVector32(); + _dataMap = new DynamicData(); + } + + public override object Clone() + { + Animation animation = new Animation(); + CloneWorker(animation); + return animation; + } + + protected override void CloneWorker(AnimationTemplate rawAnimation) + { + base.CloneWorker(rawAnimation); + Animation animation = (Animation)rawAnimation; + animation.Type = Type; + if (GetBit(Bits.CenterPointScale)) + animation.CenterPointPercent = CenterPointPercent; + if (GetBit(Bits.RotationAxis)) + animation.RotationAxis = RotationAxis; + animation.DisableMouseInput = DisableMouseInput; + } + + private void PrepareToPlay(ref AnimationArgs args) + { + if (GetBit(Bits.CenterPointScale)) + args.ViewItem.VisualCenterPoint = CenterPointPercent; + if (!GetBit(Bits.RotationAxis)) + return; + Rotation visualRotation = args.ViewItem.VisualRotation; + args.ViewItem.VisualRotation = new Rotation(visualRotation.AngleRadians, RotationAxis); + } + + public AnimationEventType Type + { + get => _type; + set => _type = value; + } + + public Vector3 CenterPointPercent + { + get => !GetBit(Bits.CenterPointScale) ? Vector3.Zero : (Vector3)GetData(s_centerPointScaleProperty); + set + { + if (!(CenterPointPercent != value)) + return; + SetData(s_centerPointScaleProperty, value); + SetBit(Bits.CenterPointScale, true); + } + } + + public Vector3 RotationAxis + { + get => !GetBit(Bits.RotationAxis) ? Rotation.Default.Axis : (Vector3)GetData(s_rotationAxisProperty); + set + { + if (!(RotationAxis != value)) + return; + SetData(s_rotationAxisProperty, value); + SetBit(Bits.RotationAxis, true); + } + } + + public bool DisableMouseInput + { + get => GetBit(Bits.DisableMouseInput); + set => SetBit(Bits.DisableMouseInput, value); + } + + AnimationTemplate IAnimationProvider.Build( + ref AnimationArgs args) + { + PrepareToPlay(ref args); + return this; + } + + public bool CanCache => true; + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("{AnimationTemplate ID="); + stringBuilder.Append(DebugID); + stringBuilder.Append(", Loop="); + stringBuilder.Append(Loop); + stringBuilder.Append(", KeyframeCount="); + stringBuilder.Append(Keyframes.Count); + stringBuilder.Append("}"); + return stringBuilder.ToString(); + } + + private bool GetBit(Animation.Bits bit) => _bitsBitVector[(int)bit]; + + private void SetBit(Animation.Bits bit, bool value) => _bitsBitVector[(int)bit] = value; + + private bool ChangeBit(Animation.Bits bit, bool value) + { + if (_bitsBitVector[(int)bit] == value) + return false; + _bitsBitVector[(int)bit] = value; + return true; + } + + protected object GetData(DataCookie cookie) => _dataMap.GetData(cookie); + + protected void SetData(DataCookie cookie, object value) => _dataMap.SetData(cookie, value); + + protected Delegate GetEventHandler(EventCookie cookie) => _dataMap.GetEventHandler(cookie); + + protected void AddEventHandler(EventCookie cookie, Delegate handlerToAdd) => _dataMap.AddEventHandler(cookie, handlerToAdd); + + protected void RemoveEventHandler(EventCookie cookie, Delegate handlerToRemove) => _dataMap.RemoveEventHandler(cookie, handlerToRemove); + + protected void RemoveEventHandlers(EventCookie cookie) => _dataMap.RemoveEventHandlers(cookie); + + private static uint GetKey(EventCookie cookie) => EventCookie.ToUInt32(cookie); + + private enum Bits + { + CenterPointScale = 1, + RotationAxis = 2, + DisableMouseInput = 4, + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/AnimationArgs.cs b/UIX/Microsoft/Iris/Animations/AnimationArgs.cs new file mode 100644 index 0000000..a10cdff --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationArgs.cs @@ -0,0 +1,108 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationArgs +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal struct AnimationArgs + { + public ViewItem ViewItem; + public Vector3 OldPosition; + public Vector2 OldSize; + public Vector3 OldScale; + public Rotation OldRotation; + public float OldAlpha; + public Vector3 NewPosition; + public Vector2 NewSize; + public Vector3 NewScale; + public Rotation NewRotation; + public float NewAlpha; + public Vector3 OldEye; + public Vector3 OldAt; + public Vector3 OldUp; + public float OldZn; + public Vector3 NewEye; + public Vector3 NewAt; + public Vector3 NewUp; + public float NewZn; + + public AnimationArgs(Camera cam) + { + ViewItem = null; + OldPosition = Vector3.Zero; + OldSize = Vector2.Zero; + OldScale = Vector3.Zero; + OldRotation = Rotation.Default; + OldAlpha = 0.0f; + NewPosition = Vector3.Zero; + NewSize = Vector2.Zero; + NewScale = Vector3.Zero; + NewRotation = Rotation.Default; + NewAlpha = 0.0f; + OldEye = cam.Eye; + NewEye = cam.Eye; + OldAt = cam.At; + NewAt = cam.At; + OldUp = cam.Up; + NewUp = cam.Up; + OldZn = cam.Zn; + NewZn = cam.Zn; + } + + public AnimationArgs( + ViewItem vi, + Vector3 oldPosition, + Vector2 oldSize, + Vector3 oldScale, + Rotation oldRotation, + float oldAlpha, + Vector3 newPosition, + Vector2 newSize, + Vector3 newScale, + Rotation newRotation, + float newAlpha) + { + ViewItem = vi; + OldPosition = oldPosition; + OldSize = oldSize; + OldScale = oldScale; + OldRotation = oldRotation; + OldAlpha = oldAlpha; + NewPosition = newPosition; + NewSize = newSize; + NewScale = newScale; + NewRotation = newRotation; + NewAlpha = newAlpha; + OldEye = Vector3.Zero; + NewEye = Vector3.Zero; + OldAt = Vector3.Zero; + NewAt = Vector3.Zero; + OldUp = Vector3.Zero; + NewUp = Vector3.Zero; + OldZn = 0.0f; + NewZn = 0.0f; + } + + public AnimationArgs( + ViewItem vi, + Vector3 oldPosition, + Vector2 oldSize, + Vector3 oldScale, + Rotation oldRotation, + float oldAlpha) + : this(vi, oldPosition, oldSize, oldScale, oldRotation, oldAlpha, oldPosition, oldSize, oldScale, oldRotation, oldAlpha) + { + } + + public AnimationArgs(ViewItem vi) + : this(vi, vi.VisualPosition, vi.VisualSize, vi.VisualScale, vi.VisualRotation, vi.VisualAlpha, vi.VisualPosition, vi.VisualSize, vi.VisualScale, vi.VisualRotation, vi.VisualAlpha) + { + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/AnimationCompleteArgs.cs b/UIX/Microsoft/Iris/Animations/AnimationCompleteArgs.cs new file mode 100644 index 0000000..c3d256d --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationCompleteArgs.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationCompleteArgs +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Animations +{ + internal class AnimationCompleteArgs : EventArgs + { + private float _progress; + + public AnimationCompleteArgs(float progress) => _progress = progress; + + public float Progress => _progress; + } +} diff --git a/UIX/Microsoft/Iris/Animations/AnimationEventType.cs b/UIX/Microsoft/Iris/Animations/AnimationEventType.cs new file mode 100644 index 0000000..73a7617 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationEventType.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationEventType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal enum AnimationEventType + { + Show, + Hide, + Move, + Size, + Scale, + Rotate, + Alpha, + GainFocus, + LoseFocus, + ContentChangeShow, + ContentChangeHide, + Idle, + } +} diff --git a/UIX/Microsoft/Iris/Animations/AnimationHandle.cs b/UIX/Microsoft/Iris/Animations/AnimationHandle.cs new file mode 100644 index 0000000..c244c46 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationHandle.cs @@ -0,0 +1,47 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationHandle +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using System; + +namespace Microsoft.Iris.Animations +{ + internal class AnimationHandle : NotifyObjectBase + { + private int _playing; + + public event EventHandler Completed; + + public bool Playing => _playing > 0; + + internal void AssociateWithAnimationInstance(ActiveSequence anim) + { + anim.AnimationCompleted += new EventHandler(OnAnimationCompleted); + ++_playing; + if (_playing != 1) + return; + FireNotification(NotificationID.Playing); + } + + internal void FireCompleted() + { + if (Completed != null) + Completed(this, EventArgs.Empty); + FireNotification(NotificationID.Completed); + } + + private void OnAnimationCompleted(object sender, EventArgs args) + { + ((ActiveSequence)sender).AnimationCompleted -= new EventHandler(OnAnimationCompleted); + --_playing; + if (_playing != 0) + return; + FireNotification(NotificationID.Playing); + FireCompleted(); + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/AnimationManager.cs b/UIX/Microsoft/Iris/Animations/AnimationManager.cs new file mode 100644 index 0000000..bccbeee --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationManager.cs @@ -0,0 +1,141 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationManager +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System; + +namespace Microsoft.Iris.Animations +{ + internal class AnimationManager : IDisposable + { + private IRenderSession _session; + private Vector _orphans; + private bool _shuttingDown; + private static ConstantAnimationInput s_defaultPositionInput = new ConstantAnimationInput(Vector3.Zero); + private static ConstantAnimationInput s_defaultSizeInput = new ConstantAnimationInput(Vector2.Zero); + private static ConstantAnimationInput s_defaultAlphaInput = new ConstantAnimationInput(0.0f); + private static ConstantAnimationInput s_defaultScaleInput = new ConstantAnimationInput(Vector3.UnitVector); + private static ConstantAnimationInput s_defaultRotationInput = new ConstantAnimationInput(AxisAngle.Identity.ToVector4()); + private static ConstantAnimationInput s_defaultOrientationInput = new ConstantAnimationInput(AxisAngle.Identity.ToQuaternion()); + private static ConstantAnimationInput s_defaultFloatInput = new ConstantAnimationInput(0.0f); + private static ConstantAnimationInput s_defaultVector2Input = new ConstantAnimationInput(Vector2.Zero); + private static ConstantAnimationInput s_defaultVector3Input = new ConstantAnimationInput(Vector3.Zero); + private static ConstantAnimationInput s_defaultVector4Input = new ConstantAnimationInput(Vector4.Zero); + private static ConstantAnimationInput s_defaultCameraEyeInput = new ConstantAnimationInput(new Vector3(0.0f, 0.0f, -4f)); + private static ConstantAnimationInput s_defaultCameraAtInput = new ConstantAnimationInput(new Vector3(0.0f, 0.0f, 0.0f)); + private static ConstantAnimationInput s_defaultCameraUpInput = new ConstantAnimationInput(new Vector3(0.0f, 1f, 0.0f)); + private static ConstantAnimationInput s_defaultCameraZnInput = new ConstantAnimationInput(2f); + + public AnimationManager(IRenderSession session) + { + _session = session; + _orphans = new Vector(); + _session.AnimationSystem.UpdatesPerSecond = session.GraphicsDevice.DeviceType != GraphicsDeviceType.Gdi ? 0 : 3; + _session.AnimationSystem.BackCompat = true; + } + + ~AnimationManager() => Dispose(false); + + public void Dispose() + { + GC.SuppressFinalize(this); + Dispose(true); + } + + protected virtual void Dispose(bool inDisposeFlag) + { + _shuttingDown = true; + if (!inDisposeFlag) + return; + foreach (DisposableObject orphan in _orphans) + orphan.Dispose(this); + _orphans.Clear(); + } + + internal bool ShuttingDown => _shuttingDown; + + public void SetGlobalSpeedAdjustment(float value) + { + ValidateConnected(); + _session.AnimationSystem.SpeedAdjustment = value; + } + + public void PulseTimeAdvance(int pulseSize) + { + ValidateConnected(); + _session.AnimationSystem.PulseTimeAdvance(pulseSize); + } + + public void RegisterAnimatedOrphans(OrphanedVisualCollection orphan) => _orphans.Add(orphan); + + public void UnregisterAnimatedOrphans(OrphanedVisualCollection orphan) => _orphans.Remove(orphan); + + public bool CanPlayAnimationType(AnimationType type) => _session.GraphicsDevice.DeviceType != GraphicsDeviceType.Gdi || type == AnimationType.Position || (type == AnimationType.Size || type == AnimationType.Scale) || type == AnimationType.Alpha; + + private void ValidateConnected() + { + } + + internal IKeyframeAnimation BuildAnimation(AnimationProxy owner) + { + ValidateConnected(); + IKeyframeAnimation keyframeAnimation = null; + switch (owner.Type) + { + case AnimationType.Position: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultPositionInput); + break; + case AnimationType.Size: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultSizeInput); + break; + case AnimationType.Alpha: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultAlphaInput); + break; + case AnimationType.Scale: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultScaleInput); + break; + case AnimationType.Rotate: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultRotationInput); + break; + case AnimationType.Orientation: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultOrientationInput); + break; + case AnimationType.PositionX: + case AnimationType.PositionY: + case AnimationType.SizeX: + case AnimationType.SizeY: + case AnimationType.ScaleX: + case AnimationType.ScaleY: + case AnimationType.Float: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultFloatInput); + break; + case AnimationType.Vector2: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector2Input); + break; + case AnimationType.Vector3: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector3Input); + break; + case AnimationType.Vector4: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultVector4Input); + break; + case AnimationType.CameraEye: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraEyeInput); + break; + case AnimationType.CameraAt: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraAtInput); + break; + case AnimationType.CameraUp: + keyframeAnimation = _session.AnimationSystem.CreateKeyframeAnimation(owner, s_defaultCameraUpInput); + break; + case AnimationType.CameraZn: + keyframeAnimation = _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 new file mode 100644 index 0000000..694919f --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationProxy.cs @@ -0,0 +1,339 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationProxy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Animations +{ + internal class AnimationProxy : DisposableObject + { + private ActiveSequence _activeSequence; + private IKeyframeAnimation _animation; + private int _keyframesValue; + private bool _playingFlag; + private AnimationType _type; + private bool _dynamicFlag; + private bool _doNotAutoReleaseFlag; + private IAnimatable _animatableTarget; + private RendererProperty _rendererProperty; + private static DeferredHandler s_deferredCleanupWorker = new DeferredHandler(DeferredCleanupWorker); + + internal AnimationProxy( + ActiveSequence activeSequence, + IAnimatable animatableTarget, + AnimationType createType, + RendererProperty rendererProperty, + int loopCount, + StopCommand stopCmd) + { + UISession.Validate(activeSequence.Session); + AnimationSystem.ValidateAnimationType(createType); + _activeSequence = activeSequence; + _type = createType; + _animatableTarget = animatableTarget; + _rendererProperty = rendererProperty; + _animation = _activeSequence.Session.AnimationManager.BuildAnimation(this); + CommonCreate(loopCount, stopCmd); + } + + private void CommonCreate(int loopCount, StopCommand stopCmd) + { + _animation.RepeatCount = loopCount; + _animation.AsyncNotifyEvent += new AsyncNotifyHandler(OnAsyncNotification); + _animation.AddStageEvent(AnimationStage.Complete, new AnimationEvent(_animation, "AsyncNotify", 1U)); + _animation.AddStageEvent(AnimationStage.Reset, new AnimationEvent(_animation, "AsyncNotify", 2U)); + SetStopCommand(stopCmd); + _activeSequence.OnAttachChildAnimation(this); + } + + protected override void OnDispose() + { + CleanupWorker(0.0f, false); + base.OnDispose(); + } + + public UISession Session => _activeSequence.Session; + + public AnimationType Type => _type; + + public bool HasDynamicKeyframes => _dynamicFlag; + + internal bool DoNotAutoRelease + { + get => _doNotAutoReleaseFlag; + set => _doNotAutoReleaseFlag = value; + } + + public void AddFloatKeyframe(BaseKeyframe keyframe, float value) + { + ++_keyframesValue; + AnimationInput animationInput1; + if (keyframe.IsRelativeToObject) + { + _dynamicFlag = true; + animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask); + if (keyframe.Multiply && value != 1.0) + { + AnimationInput animationInput2 = new ConstantAnimationInput(value); + animationInput1 *= animationInput2; + } + else if (!keyframe.Multiply && value != 0.0) + { + AnimationInput animationInput2 = new ConstantAnimationInput(value); + animationInput1 += animationInput2; + } + } + else + animationInput1 = new ConstantAnimationInput(value); + _animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation))); + } + + public void AddVector2Keyframe(BaseKeyframe keyframe, Vector2 value) + { + ++_keyframesValue; + AnimationInput animationInput1; + if (keyframe.IsRelativeToObject) + { + _dynamicFlag = true; + animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask); + if (keyframe.Multiply && value != Vector2.UnitVector) + { + AnimationInput animationInput2 = new ConstantAnimationInput(value); + animationInput1 *= animationInput2; + } + else if (!keyframe.Multiply && value != Vector2.Zero) + { + AnimationInput animationInput2 = new ConstantAnimationInput(value); + animationInput1 += animationInput2; + } + } + else + animationInput1 = new ConstantAnimationInput(value); + _animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation))); + } + + public void AddVector3Keyframe(BaseKeyframe keyframe, Vector3 value) + { + ++_keyframesValue; + AnimationInput animationInput1; + if (keyframe.IsRelativeToObject) + { + _dynamicFlag = true; + animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask); + if (keyframe.Multiply && value != Vector3.UnitVector) + { + AnimationInput animationInput2 = new ConstantAnimationInput(value); + animationInput1 *= animationInput2; + } + else if (!keyframe.Multiply && value != Vector3.Zero) + { + AnimationInput animationInput2 = new ConstantAnimationInput(value); + animationInput1 += animationInput2; + } + } + else + animationInput1 = new ConstantAnimationInput(value); + _animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation))); + } + + public void AddVector4Keyframe(BaseKeyframe keyframe, Vector4 value) + { + ++_keyframesValue; + AnimationInput animationInput1; + if (keyframe.IsRelativeToObject) + { + _dynamicFlag = true; + animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask); + if (keyframe.Multiply && value != Vector4.UnitVector) + { + AnimationInput animationInput2 = new ConstantAnimationInput(value); + animationInput1 *= animationInput2; + } + else if (!keyframe.Multiply && value != Vector4.Zero) + { + AnimationInput animationInput2 = new ConstantAnimationInput(value); + animationInput1 += animationInput2; + } + } + else + animationInput1 = new ConstantAnimationInput(value); + _animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, GenerateInterpolation(keyframe.Interpolation))); + } + + public void AddRotationKeyframe(BaseKeyframe keyframe, Rotation value) + { + if (keyframe.Type != AnimationType.Orientation) + { + AddVector4Keyframe(keyframe, new Vector4(value.Axis.X, value.Axis.Y, value.Axis.Z, value.AngleRadians)); + } + else + { + ++_keyframesValue; + AnimationInput animationInput1; + if (keyframe.IsRelativeToObject) + { + _dynamicFlag = true; + animationInput1 = keyframe.RelativeTo.CreateAnimationInput(_animatableTarget, _rendererProperty.Property, _rendererProperty.SourceMask); + if (value != Rotation.Default) + { + AnimationInput animationInput2 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians)); + animationInput1 *= animationInput2; + } + } + else + animationInput1 = new ConstantAnimationInput(new Quaternion(value.Axis, value.AngleRadians)); + AnimationInterpolation interpolation = GenerateInterpolation(keyframe.Interpolation); + interpolation.UseSphericalCombination = true; + _animation.AddKeyframe(new AnimationKeyframe(keyframe.Time, animationInput1, interpolation)); + } + } + + public void SetStopCommand(StopCommand stopCmd) + { + switch (stopCmd) + { + case StopCommand.LeaveCurrent: + _animation.ResetBehavior = AnimationResetBehavior.LeaveCurrent; + break; + case StopCommand.MoveToBegin: + _animation.ResetBehavior = AnimationResetBehavior.SetInitialValue; + break; + case StopCommand.MoveToEnd: + _animation.ResetBehavior = AnimationResetBehavior.SetFinalValue; + break; + } + _animation.AutoReset = true; + } + + public bool ValidatePlayable() + { + if (_keyframesValue >= 2) + return true; + ErrorManager.ReportError("Animations must have at least 2 keyframes to play"); + return false; + } + + public void Play() + { + if (!ValidatePlayable()) + return; + if (!_activeSequence.Session.AnimationManager.CanPlayAnimationType(_type)) + { + Cleanup(0.0f, true); + } + else + { + if (_playingFlag || _animation == null || !Session.IsValid) + return; + _animation.AddTarget(_animatableTarget, _rendererProperty.Property, _rendererProperty.TargetMask); + _animation.Play(); + _playingFlag = true; + } + } + + public void Stop() => StopWorker(false, StopCommand.MoveToEnd); + + public void Stop(StopCommand stopCommand) => StopWorker(true, stopCommand); + + private void StopWorker(bool stopCommandFlag, StopCommand stopCommand) + { + if (!_playingFlag) + return; + _playingFlag = false; + if (_animation == null || !Session.IsValid) + return; + if (stopCommandFlag) + SetStopCommand(stopCommand); + _animation.Reset(); + _animation.RemoveAllTargets(); + } + + private void Cleanup(float progress, bool forceDeferFlag) + { + if (_animation == null) + return; + if (UIDispatcher.IsUIThread && !forceDeferFlag) + { + CleanupWorker(progress, true); + } + else + { + if (!Session.IsValid) + return; + DeferredCall.Post(DispatchPriority.Housekeeping, s_deferredCleanupWorker, this); + } + } + + private void CleanupWorker(float progress, bool withNotifications) + { + _playingFlag = false; + if (_animation != null) + { + _animation.AsyncNotifyEvent -= new AsyncNotifyHandler(OnAsyncNotification); + _animation.UnregisterUsage(this); + _animation = null; + } + _animatableTarget = null; + if (!withNotifications) + return; + _activeSequence.OnDetachChildAnimation(this, progress); + } + + private static void DeferredCleanupWorker(object args) => (args as AnimationProxy).CleanupWorker(0.0f, true); + + private static AnimationInterpolation GenerateInterpolation( + Interpolation interpolation) + { + if (interpolation == null) + return new LinearInterpolation(); + switch (interpolation.Type) + { + case InterpolationType.Linear: + return new LinearInterpolation(); + case InterpolationType.SCurve: + return new SCurveInterpolation(interpolation.Weight * 10f); + case InterpolationType.Exp: + return interpolation.Weight > 0.0 ? new ExponentialInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation(); + case InterpolationType.Log: + return interpolation.Weight > 0.0 ? new LogarithmicInterpolation(interpolation.Weight * 10f) : (AnimationInterpolation)new LinearInterpolation(); + case InterpolationType.Sine: + return new SineInterpolation(); + case InterpolationType.Cosine: + return new CosineInterpolation(); + case InterpolationType.Bezier: + return new BezierInterpolation(interpolation.BezierHandle1, interpolation.BezierHandle2); + case InterpolationType.EaseIn: + return new EaseInInterpolation(interpolation.Weight * 10f, interpolation.EasePercent); + case InterpolationType.EaseOut: + return new EaseOutInterpolation(interpolation.Weight * 10f, interpolation.EasePercent); + default: + return new LinearInterpolation(); + } + } + + private void OnAsyncNotification(int nCookie) + { + switch (nCookie) + { + case 1: + Cleanup(0.0f, false); + break; + case 2: + Cleanup(0.0f, false); + break; + } + } + + private enum AsyncNotifications + { + OnComplete = 1, + OnReset = 2, + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/AnimationSystem.cs b/UIX/Microsoft/Iris/Animations/AnimationSystem.cs new file mode 100644 index 0000000..7561ebb --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationSystem.cs @@ -0,0 +1,81 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationSystem +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Iris.Animations +{ + internal static class AnimationSystem + { + private static bool _enabledFlag = true; + private static bool _overrideToFalseFlag; + private static int _disableAnimationCount; + private static Dictionary _sequences = new Dictionary(); + + public static void ValidateAnimationType(AnimationType paramType) + { + } + + public static bool SequenceExists(string id) => _sequences.ContainsKey(id); + + public static AnimationTemplate GetSequenceByID(string id) + { + if (!Enabled) + return null; + return SequenceExists(id) ? (AnimationTemplate)_sequences[id].Clone() : null; + } + + public static AnimationTemplate GetSequenceByIDAlways(string id) => SequenceExists(id) ? (AnimationTemplate)_sequences[id].Clone() : null; + + public static void AddSequenceByID(string id, AnimationTemplate seq) + { + if (SequenceExists(id)) + return; + _sequences.Add(id, seq); + } + + public static void ClearSequences() => _sequences = new Dictionary(); + + public static ICollection GetAllSequences() => _sequences.Values; + + public static bool Enabled => _enabledFlag; + + public static void SetEnableState(bool value) => _enabledFlag = value; + + public static void OverrideAnimationState(bool overrideToFalseFlag) + { + if (_overrideToFalseFlag == overrideToFalseFlag) + return; + _overrideToFalseFlag = overrideToFalseFlag; + UpdateAnimationState(); + } + + public static void UpdateAnimationState() + { + bool flag = true; + if (_disableAnimationCount > 0 || _overrideToFalseFlag) + flag = false; + SetEnableState(flag); + } + + public static void PushDisableAnimations() + { + ++_disableAnimationCount; + if (_disableAnimationCount != 1) + return; + UpdateAnimationState(); + } + + public static void PopDisableAnimations() + { + --_disableAnimationCount; + if (_disableAnimationCount != 0) + return; + UpdateAnimationState(); + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/AnimationTemplate.cs b/UIX/Microsoft/Iris/Animations/AnimationTemplate.cs new file mode 100644 index 0000000..7661675 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationTemplate.cs @@ -0,0 +1,208 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationTemplate +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Iris.Animations +{ + internal class AnimationTemplate : ICloneable + { + private const float k_epsilon = 0.0001f; + private const StopCommand k_defaultStopCommand = StopCommand.MoveToEnd; + private string _debugIDName; + private List _keyframesList; + private int _loopCount; + private StopCommandSet _StopCommandSet; + + public AnimationTemplate() + : this(null) + { + } + + public AnimationTemplate(string debugIDName) + { + _keyframesList = new List(); + DebugID = debugIDName; + } + + public string DebugID + { + get => _debugIDName; + set => _debugIDName = value; + } + + public int Loop + { + get => _loopCount; + set => _loopCount = value; + } + + public List Keyframes => _keyframesList; + + public ActiveSequence Play(ViewItem vi) + { + AnimationArgs args = new AnimationArgs(vi); + return Play(vi.RendererVisual, ref args, null); + } + + public ActiveSequence Play( + IVisual visualTarget, + ref AnimationArgs args, + EventHandler onCompleteHandler) + { + ActiveSequence instance = CreateInstance(visualTarget, ref args); + if (onCompleteHandler != null) + instance.AnimationCompleted += onCompleteHandler; + instance.Play(); + return instance; + } + + public ActiveSequence CreateInstance( + IAnimatable animatableTarget, + string property, + ref AnimationArgs args) + { + if (_keyframesList.Count == 0) + { + ErrorManager.ReportError("Animations must have at least 2 keyframes to play"); + return null; + } + ActiveSequence aseq = new ActiveSequence(this, animatableTarget, UISession.Default); + AnimationProxy[] animationProxyArray = new AnimationProxy[20]; + int[] numArray = new int[20]; + bool[] flagArray = new bool[20]; + foreach (BaseKeyframe keyframes in _keyframesList) + { + int type = (int)keyframes.Type; + keyframes.AddtoAnimation(this, aseq, property, ref args, ref animationProxyArray[type]); + ++numArray[type]; + flagArray[type] |= keyframes.Time == 0.0; + } + for (int index = 0; index <= 19; ++index) + { + if (animationProxyArray[index] != null) + { + 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}'.", 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}'", animationType); + return null; + } + } + } + return !aseq.ValidatePlayable() ? null : aseq; + } + + public ActiveSequence CreateInstance( + IAnimatable animatableTarget, + ref AnimationArgs args) + { + return CreateInstance(animatableTarget, null, ref args); + } + + public void AddKeyframe(BaseKeyframe key) => InsertSorted(key); + + public BaseKeyframe GetKeyframe(float time) + { + int count = _keyframesList.Count; + for (int index = 0; index < count; ++index) + { + BaseKeyframe keyframes = _keyframesList[index]; + if (IsSameTime(time, keyframes.Time)) + return keyframes; + } + return null; + } + + public void RemoveKeyframe(float time) + { + BaseKeyframe keyframe = GetKeyframe(time); + if (keyframe == null) + return; + _keyframesList.Remove(keyframe); + } + + public StopCommand GetStopCommand(AnimationType paramType) + { + AnimationSystem.ValidateAnimationType(paramType); + StopCommand stopCommand = StopCommand.MoveToEnd; + if (_StopCommandSet != null) + stopCommand = _StopCommandSet[paramType]; + return stopCommand; + } + + public void SetStopCommand(AnimationType paramType, StopCommand command) + { + AnimationSystem.ValidateAnimationType(paramType); + if (_StopCommandSet == null) + _StopCommandSet = new StopCommandSet(StopCommand.MoveToEnd); + _StopCommandSet[paramType] = command; + } + + object ICloneable.Clone() => Clone(); + + public virtual object Clone() + { + AnimationTemplate anim = new AnimationTemplate(_debugIDName); + CloneWorker(anim); + return anim; + } + + protected virtual void CloneWorker(AnimationTemplate anim) + { + anim._loopCount = _loopCount; + int count = _keyframesList.Count; + for (int index = 0; index < count; ++index) + anim._keyframesList.Add(_keyframesList[index].Clone()); + anim._debugIDName = _debugIDName; + } + + private void InsertSorted(BaseKeyframe key) + { + for (int index = _keyframesList.Count - 1; index >= 0; --index) + { + if (_keyframesList[index].Time < (double)key.Time) + { + _keyframesList.Insert(index + 1, key); + return; + } + } + _keyframesList.Insert(0, key); + } + + private static bool IsSameTime(float t1, float t2) + { + float num = t2 - t1; + if (num < 0.0) + num *= -1f; + return num < 9.99999974737875E-05; + } + + internal class AnimationTemplateComparer : IComparer + { + public int Compare(object objx, object objy) + { + AnimationTemplate animationTemplate1 = objx as AnimationTemplate; + AnimationTemplate animationTemplate2 = objy as AnimationTemplate; + if (animationTemplate1 == null && animationTemplate2 == null) + return 0; + if (animationTemplate1 == null) + return -1; + return animationTemplate2 == null ? 1 : string.Compare(animationTemplate1.DebugID, animationTemplate2.DebugID, StringComparison.Ordinal); + } + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/AnimationType.cs b/UIX/Microsoft/Iris/Animations/AnimationType.cs new file mode 100644 index 0000000..4ca24ae --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/AnimationType.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.AnimationType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal enum AnimationType + { + First = 0, + Position = 0, + Size = 1, + Alpha = 2, + Scale = 3, + Rotate = 4, + Orientation = 5, + PositionX = 6, + PositionY = 7, + SizeX = 8, + SizeY = 9, + ScaleX = 10, // 0x0000000A + ScaleY = 11, // 0x0000000B + Float = 12, // 0x0000000C + Vector2 = 13, // 0x0000000D + Vector3 = 14, // 0x0000000E + Vector4 = 15, // 0x0000000F + CameraEye = 16, // 0x00000010 + CameraAt = 17, // 0x00000011 + CameraUp = 18, // 0x00000012 + CameraZn = 19, // 0x00000013 + Last = 19, // 0x00000013 + NumTypes = 20, // 0x00000014 + } +} diff --git a/UIX/Microsoft/Iris/Animations/BaseFloatKeyframe.cs b/UIX/Microsoft/Iris/Animations/BaseFloatKeyframe.cs new file mode 100644 index 0000000..54b665b --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/BaseFloatKeyframe.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.BaseFloatKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal abstract class BaseFloatKeyframe : BaseKeyframe + { + private float _value; + + protected override void PopulateAnimationWorker( + IAnimatable targetObject, + AnimationProxy animation, + ref AnimationArgs args) + { + float effectiveValue = GetEffectiveValue(targetObject, _value, ref args); + animation.AddFloatKeyframe(this, effectiveValue); + } + + public float Value + { + get => _value; + set => _value = value; + } + + public override object ObjectValue => Value; + + public virtual float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + return baseValue; + } + + public override void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args) + { + float effectiveValue = GetEffectiveValue(animationTarget.AnimationTarget, _value, ref args); + Apply(animationTarget, effectiveValue); + } + + public abstract void Apply(IAnimatableOwner animationTarget, float value); + + public override void MagnifyValue(float magnifyValue) => Value *= magnifyValue; + } +} diff --git a/UIX/Microsoft/Iris/Animations/BaseKeyframe.cs b/UIX/Microsoft/Iris/Animations/BaseKeyframe.cs new file mode 100644 index 0000000..1838abe --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/BaseKeyframe.cs @@ -0,0 +1,139 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.BaseKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using System; +using System.Text; + +namespace Microsoft.Iris.Animations +{ + internal abstract class BaseKeyframe : ICloneable + { + private Interpolation _interpolation; + private RelativeTo _relative; + private float _timeValue; + private static RendererProperty[] s_propertyMap = new RendererProperty[20]; + + static BaseKeyframe() + { + s_propertyMap[0] = new RendererProperty("Position"); + s_propertyMap[1] = new RendererProperty("Size"); + s_propertyMap[2] = new RendererProperty("Alpha"); + s_propertyMap[3] = new RendererProperty("Scale"); + s_propertyMap[4] = new RendererProperty("Rotation"); + s_propertyMap[5] = new RendererProperty("Orientation"); + s_propertyMap[6] = new RendererProperty("Position", "X", "X00"); + s_propertyMap[7] = new RendererProperty("Position", "Y", "0X0"); + s_propertyMap[8] = new RendererProperty("Size", "X", "X0"); + s_propertyMap[9] = new RendererProperty("Size", "Y", "0X"); + s_propertyMap[10] = new RendererProperty("Scale", "X", "X00"); + s_propertyMap[11] = new RendererProperty("Scale", "Y", "0X0"); + s_propertyMap[16] = new RendererProperty("CameraEye"); + s_propertyMap[17] = new RendererProperty("CameraAt"); + s_propertyMap[18] = new RendererProperty("CameraUp"); + s_propertyMap[19] = new RendererProperty("CameraZn"); + } + + public BaseKeyframe() + : this(0.0f) + { + } + + public BaseKeyframe(float timeValue) + { + _timeValue = timeValue; + _relative = RelativeTo.Final; + } + + public void AddtoAnimation( + AnimationTemplate anim, + ActiveSequence aseq, + string property, + ref AnimationArgs args, + ref AnimationProxy animation) + { + if (animation == null) + animation = CreateProxy(anim, aseq, property); + PopulateAnimationWorker(aseq.Target, animation, ref args); + } + + protected virtual AnimationProxy CreateProxy( + AnimationTemplate anim, + ActiveSequence aseq, + string property) + { + StopCommand stopCommand = anim.GetStopCommand(Type); + RendererProperty rendererProperty = property != null ? new RendererProperty(property) : s_propertyMap[(int)Type]; + return new AnimationProxy(aseq, aseq.Target, Type, rendererProperty, anim.Loop, stopCommand); + } + + public BaseKeyframe Clone() => (BaseKeyframe)MemberwiseClone(); + + object ICloneable.Clone() => Clone(); + + protected abstract void PopulateAnimationWorker( + IAnimatable targetObject, + AnimationProxy animation, + ref AnimationArgs args); + + public float Time + { + get => _timeValue; + set => _timeValue = value; + } + + public RelativeTo RelativeTo + { + get => _relative == null ? RelativeTo.Absolute : _relative; + set => _relative = value; + } + + public bool IsRelativeToObject => RelativeTo.IsRelativeToObject; + + public Interpolation Interpolation + { + get => _interpolation; + set => _interpolation = value; + } + + public abstract AnimationType Type { get; } + + public abstract object ObjectValue { get; } + + public abstract void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args); + + public abstract void MagnifyValue(float magnifyValue); + + public virtual bool Multiply => false; + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("<"); + stringBuilder.Append(GetType().Name); + stringBuilder.Append(" Time=\""); + stringBuilder.Append(_timeValue); + stringBuilder.Append("\""); + if (_interpolation != null) + { + stringBuilder.Append(" Interpolation=\""); + stringBuilder.Append(_interpolation.ToString()); + stringBuilder.Append("\""); + } + if (_relative != RelativeTo.Absolute) + { + stringBuilder.Append(" RelativeTo=\""); + stringBuilder.Append(_relative); + stringBuilder.Append("\""); + } + stringBuilder.Append(" Value=\""); + stringBuilder.Append(ObjectValue); + stringBuilder.Append("\""); + stringBuilder.Append("/>"); + return stringBuilder.ToString(); + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/BaseMultiplyFloatKeyframe.cs b/UIX/Microsoft/Iris/Animations/BaseMultiplyFloatKeyframe.cs new file mode 100644 index 0000000..b73d8a7 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/BaseMultiplyFloatKeyframe.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.BaseMultiplyFloatKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal abstract class BaseMultiplyFloatKeyframe : BaseFloatKeyframe + { + public BaseMultiplyFloatKeyframe() => Value = 1f; + + public override bool Multiply => true; + } +} diff --git a/UIX/Microsoft/Iris/Animations/BaseMultiplyVector3Keyframe.cs b/UIX/Microsoft/Iris/Animations/BaseMultiplyVector3Keyframe.cs new file mode 100644 index 0000000..6b60ab3 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/BaseMultiplyVector3Keyframe.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.BaseMultiplyVector3Keyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal abstract class BaseMultiplyVector3Keyframe : BaseVector3Keyframe + { + public BaseMultiplyVector3Keyframe() => Value = Vector3.UnitVector; + + public override bool Multiply => true; + + public override Vector3 GetEffectiveValue( + IAnimatable targetObject, + Vector3 baseValueVector, + ref AnimationArgs args) + { + if (RelativeTo == RelativeTo.Final) + baseValueVector *= GetRelativeToFinalValue(targetObject, ref args); + return baseValueVector; + } + + public abstract Vector3 GetRelativeToFinalValue( + IAnimatable targetObject, + ref AnimationArgs args); + } +} diff --git a/UIX/Microsoft/Iris/Animations/BaseRotationKeyframe.cs b/UIX/Microsoft/Iris/Animations/BaseRotationKeyframe.cs new file mode 100644 index 0000000..c64d273 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/BaseRotationKeyframe.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.BaseRotationKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal abstract class BaseRotationKeyframe : BaseKeyframe + { + private Rotation _valueRotation; + + public BaseRotationKeyframe() => _valueRotation = Rotation.Default; + + protected override void PopulateAnimationWorker( + IAnimatable targetObject, + AnimationProxy animation, + ref AnimationArgs args) + { + Rotation effectiveValue = GetEffectiveValue(targetObject, _valueRotation, ref args); + animation.AddRotationKeyframe(this, effectiveValue); + } + + public Rotation Value + { + get => _valueRotation; + set => _valueRotation = value; + } + + public override object ObjectValue => Value; + + public virtual Rotation GetEffectiveValue( + IAnimatable targetObject, + Rotation baseValueRotation, + ref AnimationArgs args) + { + return baseValueRotation; + } + + public override void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args) + { + Rotation effectiveValue = GetEffectiveValue(animationTarget.AnimationTarget, _valueRotation, ref args); + Apply(animationTarget, effectiveValue); + } + + public abstract void Apply(IAnimatableOwner animationTarget, Rotation valueRotation); + } +} diff --git a/UIX/Microsoft/Iris/Animations/BaseVector2Keyframe.cs b/UIX/Microsoft/Iris/Animations/BaseVector2Keyframe.cs new file mode 100644 index 0000000..21ec65d --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/BaseVector2Keyframe.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.BaseVector2Keyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal abstract class BaseVector2Keyframe : BaseKeyframe + { + private Vector2 _valueVector; + + protected override void PopulateAnimationWorker( + IAnimatable targetObject, + AnimationProxy animation, + ref AnimationArgs args) + { + Vector2 effectiveValue = GetEffectiveValue(targetObject, _valueVector, ref args); + animation.AddVector2Keyframe(this, effectiveValue); + } + + public Vector2 Value + { + get => _valueVector; + set => _valueVector = value; + } + + public override object ObjectValue => Value; + + public virtual Vector2 GetEffectiveValue( + IAnimatable targetObject, + Vector2 baseValueVector, + ref AnimationArgs args) + { + return baseValueVector; + } + + public override void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args) + { + Vector2 effectiveValue = GetEffectiveValue(animationTarget.AnimationTarget, _valueVector, ref args); + Apply(animationTarget, effectiveValue); + } + + public abstract void Apply(IAnimatableOwner animationTarget, Vector2 valueVector); + + public override void MagnifyValue(float magnifyValue) => Value *= magnifyValue; + } +} diff --git a/UIX/Microsoft/Iris/Animations/BaseVector3Keyframe.cs b/UIX/Microsoft/Iris/Animations/BaseVector3Keyframe.cs new file mode 100644 index 0000000..54f3fa9 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/BaseVector3Keyframe.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.BaseVector3Keyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal abstract class BaseVector3Keyframe : BaseKeyframe + { + private Vector3 _valueVector; + + protected override void PopulateAnimationWorker( + IAnimatable targetObject, + AnimationProxy animation, + ref AnimationArgs args) + { + Vector3 effectiveValue = GetEffectiveValue(targetObject, _valueVector, ref args); + animation.AddVector3Keyframe(this, effectiveValue); + } + + public Vector3 Value + { + get => _valueVector; + set => _valueVector = value; + } + + public override object ObjectValue => Value; + + public virtual Vector3 GetEffectiveValue( + IAnimatable targetObject, + Vector3 baseValueVector, + ref AnimationArgs args) + { + return baseValueVector; + } + + public override void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args) + { + Vector3 effectiveValue = GetEffectiveValue(animationTarget.AnimationTarget, _valueVector, ref args); + Apply(animationTarget, effectiveValue); + } + + public abstract void Apply(IAnimatableOwner animationTarget, Vector3 valueVector); + + public override void MagnifyValue(float magnifyValue) => Value *= magnifyValue; + } +} diff --git a/UIX/Microsoft/Iris/Animations/BaseVector4Keyframe.cs b/UIX/Microsoft/Iris/Animations/BaseVector4Keyframe.cs new file mode 100644 index 0000000..71595a9 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/BaseVector4Keyframe.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.BaseVector4Keyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal abstract class BaseVector4Keyframe : BaseKeyframe + { + private Vector4 _valueVector; + + protected override void PopulateAnimationWorker( + IAnimatable targetObject, + AnimationProxy animation, + ref AnimationArgs args) + { + Vector4 effectiveValue = GetEffectiveValue(targetObject, _valueVector, ref args); + animation.AddVector4Keyframe(this, effectiveValue); + } + + public Vector4 Value + { + get => _valueVector; + set => _valueVector = value; + } + + public override object ObjectValue => Value; + + public virtual Vector4 GetEffectiveValue( + IAnimatable targetObject, + Vector4 baseValueVector, + ref AnimationArgs args) + { + return baseValueVector; + } + + public override void Apply(IAnimatableOwner animationTarget, ref AnimationArgs args) + { + Vector4 effectiveValue = GetEffectiveValue(animationTarget.AnimationTarget, _valueVector, ref args); + Apply(animationTarget, effectiveValue); + } + + public abstract void Apply(IAnimatableOwner animationTarget, Vector4 valueVector); + + public override void MagnifyValue(float magnifyValue) => Value *= magnifyValue; + } +} diff --git a/UIX/Microsoft/Iris/Animations/CameraAtKeyframe.cs b/UIX/Microsoft/Iris/Animations/CameraAtKeyframe.cs new file mode 100644 index 0000000..c4dad9f --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/CameraAtKeyframe.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.CameraAtKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal class CameraAtKeyframe : BaseMultiplyVector3Keyframe + { + public override AnimationType Type => AnimationType.CameraAt; + + public override void Apply(IAnimatableOwner animationTarget, Vector3 value) => ((Camera)animationTarget).CameraAt = value; + + public override Vector3 GetRelativeToFinalValue( + IAnimatable targetObject, + ref AnimationArgs args) + { + return args.NewAt; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/CameraEyeKeyframe.cs b/UIX/Microsoft/Iris/Animations/CameraEyeKeyframe.cs new file mode 100644 index 0000000..ed25286 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/CameraEyeKeyframe.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.CameraEyeKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal class CameraEyeKeyframe : BaseMultiplyVector3Keyframe + { + public override AnimationType Type => AnimationType.CameraEye; + + public override void Apply(IAnimatableOwner animationTarget, Vector3 value) => ((Camera)animationTarget).CameraEye = value; + + public override Vector3 GetRelativeToFinalValue( + IAnimatable targetObject, + ref AnimationArgs args) + { + return args.NewEye; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/CameraUpKeyframe.cs b/UIX/Microsoft/Iris/Animations/CameraUpKeyframe.cs new file mode 100644 index 0000000..8d9a205 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/CameraUpKeyframe.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.CameraUpKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal class CameraUpKeyframe : BaseMultiplyVector3Keyframe + { + public override AnimationType Type => AnimationType.CameraUp; + + public override void Apply(IAnimatableOwner animationTarget, Vector3 value) => ((Camera)animationTarget).CameraUp = value; + + public override Vector3 GetRelativeToFinalValue( + IAnimatable targetObject, + ref AnimationArgs args) + { + return args.NewUp; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/CameraZnKeyframe.cs b/UIX/Microsoft/Iris/Animations/CameraZnKeyframe.cs new file mode 100644 index 0000000..128551a --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/CameraZnKeyframe.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.CameraZnKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal class CameraZnKeyframe : BaseMultiplyFloatKeyframe + { + public override AnimationType Type => AnimationType.CameraZn; + + public override void Apply(IAnimatableOwner animationTarget, float value) => ((Camera)animationTarget).CameraZn = value; + + public override float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + if (RelativeTo == RelativeTo.Final) + baseValue *= args.NewZn; + return baseValue; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/EffectAnimation.cs b/UIX/Microsoft/Iris/Animations/EffectAnimation.cs new file mode 100644 index 0000000..73e1848 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/EffectAnimation.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.EffectAnimation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal class EffectAnimation : AnimationTemplate, IAnimationProvider + { + AnimationEventType IAnimationProvider.Type => AnimationEventType.Idle; + + AnimationTemplate IAnimationProvider.Build( + ref AnimationArgs args) + { + return this; + } + + public bool CanCache => true; + } +} diff --git a/UIX/Microsoft/Iris/Animations/EffectColorKeyframe.cs b/UIX/Microsoft/Iris/Animations/EffectColorKeyframe.cs new file mode 100644 index 0000000..d13e0cd --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/EffectColorKeyframe.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.EffectColorKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal class EffectColorKeyframe : BaseVector4Keyframe + { + public override void Apply(IAnimatableOwner animationTarget, Vector4 value) + { + } + + public override AnimationType Type => AnimationType.Vector4; + + public Color Color + { + get => new Color(Value.W, Value.X, Value.Y, Value.Z); + set => Value = value.RenderConvert().ToVector4(); + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/EffectFloatKeyframe.cs b/UIX/Microsoft/Iris/Animations/EffectFloatKeyframe.cs new file mode 100644 index 0000000..7f9c86a --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/EffectFloatKeyframe.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.EffectFloatKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal class EffectFloatKeyframe : BaseFloatKeyframe + { + public override void Apply(IAnimatableOwner animationTarget, float value) + { + } + + public override AnimationType Type => AnimationType.Float; + } +} diff --git a/UIX/Microsoft/Iris/Animations/EffectVector3Keyframe.cs b/UIX/Microsoft/Iris/Animations/EffectVector3Keyframe.cs new file mode 100644 index 0000000..363e8ad --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/EffectVector3Keyframe.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.EffectVector3Keyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal class EffectVector3Keyframe : BaseVector3Keyframe + { + public override void Apply(IAnimatableOwner animationTarget, Vector3 value) + { + } + + public override AnimationType Type => AnimationType.Vector3; + } +} diff --git a/UIX/Microsoft/Iris/Animations/IAnimatableOwner.cs b/UIX/Microsoft/Iris/Animations/IAnimatableOwner.cs new file mode 100644 index 0000000..90d3a79 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/IAnimatableOwner.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.IAnimatableOwner +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal interface IAnimatableOwner + { + IAnimatable AnimationTarget { get; } + } +} diff --git a/UIX/Microsoft/Iris/Animations/IAnimationProvider.cs b/UIX/Microsoft/Iris/Animations/IAnimationProvider.cs new file mode 100644 index 0000000..e52cccd --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/IAnimationProvider.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.IAnimationProvider +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal interface IAnimationProvider + { + AnimationTemplate Build(ref AnimationArgs args); + + AnimationEventType Type { get; } + + bool CanCache { get; } + } +} diff --git a/UIX/Microsoft/Iris/Animations/Interpolation.cs b/UIX/Microsoft/Iris/Animations/Interpolation.cs new file mode 100644 index 0000000..1071dc1 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/Interpolation.cs @@ -0,0 +1,106 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.Interpolation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal class Interpolation + { + public static readonly Interpolation Default = new Interpolation(InterpolationType.Linear); + private InterpolationType _type; + private float _weight = 1f; + private float _bezierHandle1; + private float _bezierHandle2 = 1f; + private float _easePercent = 0.5f; + + public Interpolation() + : this(InterpolationType.Linear) + { + } + + public Interpolation(InterpolationType type) => _type = type; + + public InterpolationType Type + { + get => _type; + set => _type = value; + } + + public float Weight + { + get => _weight; + set => _weight = value; + } + + public float BezierHandle1 + { + get => _bezierHandle1; + set => _bezierHandle1 = value; + } + + public float BezierHandle2 + { + get => _bezierHandle2; + set => _bezierHandle2 = value; + } + + public float EasePercent + { + get => _easePercent; + set => _easePercent = value; + } + + public override string ToString() + { + string str; + switch (Type) + { + case InterpolationType.SCurve: + str = "SCurve"; + break; + case InterpolationType.Exp: + str = "Exp"; + break; + case InterpolationType.Log: + str = "Log"; + break; + case InterpolationType.Sine: + str = "Sine"; + break; + case InterpolationType.Cosine: + str = "Cosine"; + break; + case InterpolationType.Bezier: + str = "Bezier, " + BezierHandle1 + ", " + BezierHandle2; + break; + case InterpolationType.EaseIn: + str = "EaseIn, " + Weight + ", " + EasePercent; + break; + case InterpolationType.EaseOut: + str = "EaseOut, " + Weight + ", " + EasePercent; + break; + default: + str = "Linear"; + break; + } + if (Weight != 1.0) + str = str + ", " + Weight; + return str; + } + + public override bool Equals(object obj) + { + bool flag = false; + if (obj is Interpolation) + { + Interpolation interpolation = (Interpolation)obj; + flag = _type == interpolation._type && _weight == (double)interpolation._weight && (_bezierHandle1 == (double)interpolation._bezierHandle1 && _bezierHandle2 == (double)interpolation._bezierHandle2) && _easePercent == (double)interpolation._easePercent; + } + return flag; + } + + public override int GetHashCode() => _type.GetHashCode() ^ _weight.GetHashCode() ^ _bezierHandle1.GetHashCode() ^ _bezierHandle2.GetHashCode() ^ _easePercent.GetHashCode(); + } +} diff --git a/UIX/Microsoft/Iris/Animations/InterpolationType.cs b/UIX/Microsoft/Iris/Animations/InterpolationType.cs new file mode 100644 index 0000000..4029c7d --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/InterpolationType.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.InterpolationType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal enum InterpolationType + { + Linear, + SCurve, + Exp, + Log, + Sine, + Cosine, + Bezier, + EaseIn, + EaseOut, + } +} diff --git a/UIX/Microsoft/Iris/Animations/KeyframeFilter.cs b/UIX/Microsoft/Iris/Animations/KeyframeFilter.cs new file mode 100644 index 0000000..84cb496 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/KeyframeFilter.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.KeyframeFilter +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal enum KeyframeFilter + { + All, + Position, + Size, + Scale, + Rotate, + Alpha, + } +} diff --git a/UIX/Microsoft/Iris/Animations/MergeAnimation.cs b/UIX/Microsoft/Iris/Animations/MergeAnimation.cs new file mode 100644 index 0000000..9dee766 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/MergeAnimation.cs @@ -0,0 +1,97 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.MergeAnimation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections.Generic; + +namespace Microsoft.Iris.Animations +{ + internal class MergeAnimation : IAnimationProvider + { + private List _sourcesList; + private AnimationEventType _type; + private Animation _cacheAnimation; + + public List Sources + { + get + { + if (_sourcesList == null) + _sourcesList = new List(); + return _sourcesList; + } + set + { + _sourcesList = value; + ClearCache(); + } + } + + public AnimationEventType Type + { + get => _type; + set + { + _type = value; + ClearCache(); + } + } + + public AnimationTemplate Build(ref AnimationArgs args) + { + if (_cacheAnimation != null) + return _cacheAnimation; + Animation animation = new Animation(); + animation.Type = _type; + animation.DebugID = "Merge("; + bool flag1 = true; + foreach (IAnimationProvider sources in _sourcesList) + { + AnimationTemplate anim = sources.Build(ref args); + if (anim != null) + { + TransformAnimation.DumpAnimation(anim, "Source"); + string str = anim.DebugID; + if (!flag1) + str = ", " + str; + animation.DebugID += str; + flag1 = false; + if (animation.Loop != anim.Loop) + { + bool flag2 = false; + if (anim.Loop < 0) + flag2 = true; + else if (anim.Loop > animation.Loop) + flag2 = true; + if (flag2) + animation.Loop = anim.Loop; + } + foreach (BaseKeyframe keyframe in anim.Keyframes) + animation.AddKeyframe(keyframe); + } + } + animation.DebugID += ")"; + TransformAnimation.DumpAnimation(animation, "Result"); + if (CanCache) + _cacheAnimation = animation; + return animation; + } + + protected void ClearCache() => _cacheAnimation = null; + + public bool CanCache + { + get + { + foreach (IAnimationProvider sources in _sourcesList) + { + if (!sources.CanCache) + return false; + } + return true; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/NonIntensiveAnimation.cs b/UIX/Microsoft/Iris/Animations/NonIntensiveAnimation.cs new file mode 100644 index 0000000..8427a10 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/NonIntensiveAnimation.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.NonIntensiveAnimation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal class NonIntensiveAnimation : ReferenceAnimation + { + } +} diff --git a/UIX/Microsoft/Iris/Animations/OrientationKeyframe.cs b/UIX/Microsoft/Iris/Animations/OrientationKeyframe.cs new file mode 100644 index 0000000..be43bbb --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/OrientationKeyframe.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.OrientationKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal class OrientationKeyframe : RotateKeyframe + { + public override AnimationType Type => AnimationType.Orientation; + } +} diff --git a/UIX/Microsoft/Iris/Animations/OrphanedVisualCollection.cs b/UIX/Microsoft/Iris/Animations/OrphanedVisualCollection.cs new file mode 100644 index 0000000..7a4211a --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/OrphanedVisualCollection.cs @@ -0,0 +1,95 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.OrphanedVisualCollection +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System; + +namespace Microsoft.Iris.Animations +{ + internal class OrphanedVisualCollection : DisposableObject + { + private int _countEventsRemaining; + private Vector _orphansList; + private Vector _sequenceList; + private AnimationManager _animationManager; + + public OrphanedVisualCollection(AnimationManager aniManager) + { + DeclareOwner(aniManager); + _orphansList = new Vector(); + _sequenceList = new Vector(); + _animationManager = aniManager; + _countEventsRemaining = 1; + _animationManager.RegisterAnimatedOrphans(this); + } + + protected override void OnDispose() + { + foreach (ActiveSequence sequence in _sequenceList) + { + sequence.Stop(); + sequence.Dispose(this); + } + _sequenceList.Clear(); + foreach (IVisual orphans in _orphansList) + { + orphans.Remove(); + orphans.UnregisterUsage(this); + } + _orphansList.Clear(); + _animationManager = null; + base.OnDispose(); + } + + public void AddOrphan(IVisual visual) + { + visual.RegisterUsage(this); + _orphansList.Add(visual); + } + + public void RegisterWaitForAnimation(ActiveSequence aseq, bool transfer) + { + aseq.AnimationCompleted += new EventHandler(OnDestroyAnimationComplete); + ++_countEventsRemaining; + RegisterAnimation(aseq, transfer); + } + + public void RegisterAnimation(ActiveSequence aseq, bool transfer) + { + if (transfer) + aseq.TransferOwnership(this); + else + aseq.DeclareOwner(this); + _sequenceList.Add(aseq); + } + + public void OnLayoutApplyComplete() => OnEventComplete(null, EventArgs.Empty); + + private void OnDestroyAnimationComplete(object sender, EventArgs args) + { + ActiveSequence activeSequence = sender as ActiveSequence; + activeSequence.AnimationCompleted -= new EventHandler(OnDestroyAnimationComplete); + _sequenceList.Remove(activeSequence); + activeSequence.Dispose(this); + OnEventComplete(sender, args); + } + + private void OnEventComplete(object sender, EventArgs args) + { + --_countEventsRemaining; + if (Waiting) + return; + if (_animationManager != null) + _animationManager.UnregisterAnimatedOrphans(this); + Dispose(_animationManager); + } + + public bool Waiting => _countEventsRemaining > 0; + + public override string ToString() => InvariantString.Format("Orphans(WaitCount={0}, OrphanCount={1})", _sequenceList != null ? _sequenceList.Count.ToString() : "None", _orphansList.Count); + } +} diff --git a/UIX/Microsoft/Iris/Animations/PositionKeyframe.cs b/UIX/Microsoft/Iris/Animations/PositionKeyframe.cs new file mode 100644 index 0000000..de207a4 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/PositionKeyframe.cs @@ -0,0 +1,66 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.PositionKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class PositionKeyframe : BaseVector3Keyframe + { + public override AnimationType Type => AnimationType.Position; + + public override Vector3 GetEffectiveValue( + IAnimatable targetObject, + Vector3 baseValueVector, + ref AnimationArgs args) + { + return GetEffectivePositionValue(RelativeTo, targetObject, baseValueVector, ref args); + } + + public static Vector3 GetEffectivePositionValue( + RelativeTo relativeTo, + IAnimatable targetObject, + Vector3 baseValueVector, + ref AnimationArgs args) + { + if (UISession.Default.IsRtl) + baseValueVector.X = -baseValueVector.X; + if (relativeTo == RelativeTo.Final) + baseValueVector += args.NewPosition; + else if (relativeTo == RelativeTo.Absolute) + { + if (UISession.Default.IsRtl) + { + Vector2 vector2 = new Vector2(0.0f, 0.0f); + IVisualContainer visualContainer1 = null; + if (targetObject is IVisualContainer visualContainer) + { + vector2 = visualContainer.Size; + visualContainer1 = visualContainer.Parent; + } + else if (targetObject is ISprite sprite) + { + vector2 = sprite.Size; + visualContainer1 = sprite.Parent; + } + if (visualContainer1 != null) + baseValueVector.X = visualContainer1.Size.X - vector2.X + baseValueVector.X; + } + } + else if (relativeTo is SnapshotRelativeTo snapshotRelativeTo) + { + RectangleF rectangleF = args.ViewItem.TransformFromAncestor(null, snapshotRelativeTo.Bounds); + baseValueVector = baseValueVector + args.NewPosition + new Vector3(rectangleF.X, rectangleF.Y, 0.0f) * args.NewScale; + } + return baseValueVector; + } + + public override void Apply(IAnimatableOwner animationTarget, Vector3 valueVector) => ((ViewItem)animationTarget).VisualPosition = valueVector; + } +} diff --git a/UIX/Microsoft/Iris/Animations/PositionXKeyframe.cs b/UIX/Microsoft/Iris/Animations/PositionXKeyframe.cs new file mode 100644 index 0000000..a0caff2 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/PositionXKeyframe.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.PositionXKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class PositionXKeyframe : BaseFloatKeyframe + { + public override AnimationType Type => AnimationType.PositionX; + + public override void Apply(IAnimatableOwner animationTarget, float value) + { + Vector3 visualPosition = ((ViewItem)animationTarget).VisualPosition; + visualPosition.X = value; + ((ViewItem)animationTarget).VisualPosition = visualPosition; + } + + public override float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + return PositionKeyframe.GetEffectivePositionValue(RelativeTo, targetObject, new Vector3(baseValue, 0.0f, 0.0f), ref args).X; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/PositionYKeyframe.cs b/UIX/Microsoft/Iris/Animations/PositionYKeyframe.cs new file mode 100644 index 0000000..3a4d06a --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/PositionYKeyframe.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.PositionYKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class PositionYKeyframe : BaseFloatKeyframe + { + public override AnimationType Type => AnimationType.PositionY; + + public override void Apply(IAnimatableOwner animationTarget, float value) + { + Vector3 visualPosition = ((ViewItem)animationTarget).VisualPosition; + visualPosition.Y = value; + ((ViewItem)animationTarget).VisualPosition = visualPosition; + } + + public override float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + return PositionKeyframe.GetEffectivePositionValue(RelativeTo, targetObject, new Vector3(0.0f, baseValue, 0.0f), ref args).Y; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/ReferenceAnimation.cs b/UIX/Microsoft/Iris/Animations/ReferenceAnimation.cs new file mode 100644 index 0000000..34e8f38 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/ReferenceAnimation.cs @@ -0,0 +1,41 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.ReferenceAnimation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Animations +{ + internal abstract class ReferenceAnimation : IAnimationProvider + { + private IAnimationProvider _sourceAnimation; + + public IAnimationProvider Source + { + get => _sourceAnimation; + set + { + if (_sourceAnimation == value) + return; + _sourceAnimation = value; + OnSourceChanged(); + } + } + + protected virtual void OnSourceChanged() + { + } + + public AnimationEventType Type => _sourceAnimation != null ? _sourceAnimation.Type : AnimationEventType.Idle; + + public AnimationTemplate Build(ref AnimationArgs args) => BuildWorker(ref args); + + protected virtual AnimationTemplate BuildWorker(ref AnimationArgs args) => _sourceAnimation.Build(ref args); + + public override string ToString() => InvariantString.Format("{0}({1})", GetType().Name, Source); + + public virtual bool CanCache => _sourceAnimation == null || _sourceAnimation.CanCache; + } +} diff --git a/UIX/Microsoft/Iris/Animations/RelativeTo.cs b/UIX/Microsoft/Iris/Animations/RelativeTo.cs new file mode 100644 index 0000000..7a58cd8 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/RelativeTo.cs @@ -0,0 +1,138 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.RelativeTo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Animations +{ + internal class RelativeTo + { + private IAnimatable _sourceObject; + private int _sourceId; + private string _sourceProperty; + private SnapshotPolicy _snapshot; + private int _power = 1; + private float _multiply = 1f; + private float _add; + private static RelativeTo s_absolute = new RelativeTo(); + private static RelativeTo s_current = new RelativeTo(SnapshotPolicy.Once); + private static RelativeTo s_currentSnapshotOnLoop = new RelativeTo(SnapshotPolicy.OnLoop); + private static RelativeTo s_final = new RelativeTo(); + + public RelativeTo() => _snapshot = SnapshotPolicy.Continuous; + + public RelativeTo(SnapshotPolicy snapshot) => _snapshot = snapshot; + + public bool IsRelativeToObject => _sourceObject != null || _sourceId != 0 || this == s_current || this == s_currentSnapshotOnLoop; + + public IAnimatable Source + { + get => _sourceObject; + set => _sourceObject = value; + } + + public int SourceId + { + get => _sourceId; + set => _sourceId = value; + } + + public string Property + { + get => _sourceProperty; + set => _sourceProperty = value; + } + + public SnapshotPolicy Snapshot + { + get => _snapshot; + set => _snapshot = value; + } + + public int Power + { + get => _power; + set => _power = value; + } + + public float Multiply + { + get => _multiply; + set => _multiply = value; + } + + public float Add + { + get => _add; + set => _add = value; + } + + public static RelativeTo Absolute => s_absolute; + + public static RelativeTo Current => s_current; + + public static RelativeTo CurrentSnapshotOnLoop => s_currentSnapshotOnLoop; + + public static RelativeTo Final => s_final; + + public AnimationInput CreateAnimationInput( + IAnimatable defaultSource, + string defaultSourceProperty, + string defaultSourcePropertyMask) + { + IAnimatable sourceObject = null; + string sourcePropertyName = null; + string sourceMaskSpec = null; + bool flag = true; + if (_sourceProperty != null) + { + sourceObject = _sourceId == 0 ? _sourceObject : Application.MapExternalAnimationInput(_sourceId); + if (sourceObject != null) + { + sourcePropertyName = _sourceProperty; + flag = false; + } + } + if (flag) + { + sourceObject = defaultSource; + sourcePropertyName = defaultSourceProperty; + sourceMaskSpec = defaultSourcePropertyMask; + } + AnimationInput animationInput1; + if (Snapshot == SnapshotPolicy.Continuous) + { + animationInput1 = new ContinuousAnimationInput(sourceObject, sourcePropertyName, sourceMaskSpec); + } + else + { + CapturedAnimationInput capturedAnimationInput = new CapturedAnimationInput(sourceObject, sourcePropertyName, sourceMaskSpec); + if (Snapshot == SnapshotPolicy.OnLoop) + capturedAnimationInput.RefreshOnRepeat = true; + animationInput1 = capturedAnimationInput; + } + AnimationInput animationInput2 = animationInput1; + for (int index = 1; index < _power; ++index) + animationInput2 *= animationInput1; + if (_multiply != 1.0) + animationInput2 *= new ConstantAnimationInput(_multiply); + if (_add != 0.0) + animationInput2 += new ConstantAnimationInput(_add); + return animationInput2; + } + + public override string ToString() + { + if (this == s_absolute) + return "Absolute"; + if (this == s_current) + return "Current"; + if (this == s_currentSnapshotOnLoop) + return "CurrentSnapshotOnLoop"; + return this == s_final ? "Final" : string.Format("[Object = {0}, Property = {1}]", _sourceObject != null ? _sourceObject : (object)_sourceId, _sourceProperty); + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/RendererProperty.cs b/UIX/Microsoft/Iris/Animations/RendererProperty.cs new file mode 100644 index 0000000..869ae8b --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/RendererProperty.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.RendererProperty +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal struct RendererProperty + { + private string _property; + private string _sourceMask; + private string _targetMask; + + public RendererProperty(string property) + { + _property = property; + _sourceMask = null; + _targetMask = null; + } + + public RendererProperty(string property, string sourceMask, string targetMask) + { + _property = property; + _sourceMask = sourceMask; + _targetMask = targetMask; + } + + public string Property => _property; + + public string SourceMask => _sourceMask; + + public string TargetMask => _targetMask; + } +} diff --git a/UIX/Microsoft/Iris/Animations/RotateKeyframe.cs b/UIX/Microsoft/Iris/Animations/RotateKeyframe.cs new file mode 100644 index 0000000..dab6858 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/RotateKeyframe.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.RotateKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class RotateKeyframe : BaseRotationKeyframe + { + public override AnimationType Type => AnimationType.Rotate; + + public override Rotation GetEffectiveValue( + IAnimatable targetObject, + Rotation baseValueRotation, + ref AnimationArgs args) + { + if (RelativeTo == RelativeTo.Final) + baseValueRotation.AngleRadians += args.NewRotation.AngleRadians; + if (UISession.Default.IsRtl && baseValueRotation.Axis.Y <= 0.0 && baseValueRotation.Axis.X <= 0.0) + baseValueRotation.AngleRadians = -baseValueRotation.AngleRadians; + return baseValueRotation; + } + + public override void Apply(IAnimatableOwner animationTarget, Rotation valueRotation) => ((ViewItem)animationTarget).VisualRotation = valueRotation; + + public override void MagnifyValue(float magnifyValue) => Value = new Rotation(Value.AngleRadians * magnifyValue, Value.Axis); + } +} diff --git a/UIX/Microsoft/Iris/Animations/ScaleKeyframe.cs b/UIX/Microsoft/Iris/Animations/ScaleKeyframe.cs new file mode 100644 index 0000000..789ffb1 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/ScaleKeyframe.cs @@ -0,0 +1,60 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.ScaleKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class ScaleKeyframe : BaseVector3Keyframe + { + public ScaleKeyframe() => Value = Vector3.UnitVector; + + public override bool Multiply => true; + + public override AnimationType Type => AnimationType.Scale; + + public override Vector3 GetEffectiveValue( + IAnimatable targetObject, + Vector3 baseValueVector, + ref AnimationArgs args) + { + return GetEffectiveScaleValue(RelativeTo, targetObject, baseValueVector, ref args); + } + + public static Vector3 GetEffectiveScaleValue( + RelativeTo relativeTo, + IAnimatable targetObject, + Vector3 baseValueVector, + ref AnimationArgs args) + { + if (relativeTo == RelativeTo.Final) + baseValueVector *= args.NewScale; + else if (relativeTo is SnapshotRelativeTo snapshotRelativeTo) + { + 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; + } + + public override void Apply(IAnimatableOwner animationTarget, Vector3 valueVector) => ((ViewItem)animationTarget).VisualScale = valueVector; + + public override void MagnifyValue(float magnifyValue) + { + Vector3 vector3 = Value; + Value = new Vector3(MagnifyDimension(vector3.X, magnifyValue), MagnifyDimension(vector3.Y, magnifyValue), MagnifyDimension(vector3.Z, magnifyValue)); + } + + private float MagnifyDimension(float dimensionValue, float magnifyValue) + { + if (dimensionValue != 1.0) + dimensionValue *= magnifyValue; + return dimensionValue; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/ScaleXKeyframe.cs b/UIX/Microsoft/Iris/Animations/ScaleXKeyframe.cs new file mode 100644 index 0000000..41fffa0 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/ScaleXKeyframe.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.ScaleXKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class ScaleXKeyframe : BaseMultiplyFloatKeyframe + { + public override AnimationType Type => AnimationType.ScaleX; + + public override void Apply(IAnimatableOwner animationTarget, float value) + { + Vector3 visualScale = ((ViewItem)animationTarget).VisualScale; + visualScale.X = value; + ((ViewItem)animationTarget).VisualScale = visualScale; + } + + public override float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + return ScaleKeyframe.GetEffectiveScaleValue(RelativeTo, targetObject, new Vector3(baseValue, 0.0f, 0.0f), ref args).X; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/ScaleYKeyframe.cs b/UIX/Microsoft/Iris/Animations/ScaleYKeyframe.cs new file mode 100644 index 0000000..8e3e599 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/ScaleYKeyframe.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.ScaleYKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class ScaleYKeyframe : BaseMultiplyFloatKeyframe + { + public override AnimationType Type => AnimationType.ScaleY; + + public override void Apply(IAnimatableOwner animationTarget, float value) + { + Vector3 visualScale = ((ViewItem)animationTarget).VisualScale; + visualScale.Y = value; + ((ViewItem)animationTarget).VisualScale = visualScale; + } + + public override float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + return ScaleKeyframe.GetEffectiveScaleValue(RelativeTo, targetObject, new Vector3(0.0f, baseValue, 0.0f), ref args).Y; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/SizeKeyframe.cs b/UIX/Microsoft/Iris/Animations/SizeKeyframe.cs new file mode 100644 index 0000000..1c4876d --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/SizeKeyframe.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.SizeKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class SizeKeyframe : BaseVector2Keyframe + { + public override AnimationType Type => AnimationType.Size; + + public override Vector2 GetEffectiveValue( + IAnimatable targetObject, + Vector2 baseValueVector, + ref AnimationArgs args) + { + if (RelativeTo == RelativeTo.Final) + baseValueVector += args.NewSize; + return baseValueVector; + } + + public override void Apply(IAnimatableOwner animationTarget, Vector2 valueVector) => ((ViewItem)animationTarget).VisualSize = valueVector; + } +} diff --git a/UIX/Microsoft/Iris/Animations/SizeXKeyframe.cs b/UIX/Microsoft/Iris/Animations/SizeXKeyframe.cs new file mode 100644 index 0000000..c9a3643 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/SizeXKeyframe.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.SizeXKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class SizeXKeyframe : BaseFloatKeyframe + { + public override AnimationType Type => AnimationType.SizeX; + + public override void Apply(IAnimatableOwner animationTarget, float value) => ((ViewItem)animationTarget).VisualSize = new Vector2(value, ((ViewItem)animationTarget).VisualSize.Y); + + public override float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + return RelativeTo == RelativeTo.Final ? baseValue + args.NewSize.X : baseValue; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/SizeYKeyframe.cs b/UIX/Microsoft/Iris/Animations/SizeYKeyframe.cs new file mode 100644 index 0000000..8e31111 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/SizeYKeyframe.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.SizeYKeyframe +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Animations +{ + internal class SizeYKeyframe : BaseFloatKeyframe + { + public override AnimationType Type => AnimationType.SizeY; + + public override void Apply(IAnimatableOwner animationTarget, float value) => ((ViewItem)animationTarget).VisualSize = new Vector2(((ViewItem)animationTarget).VisualSize.X, value); + + public override float GetEffectiveValue( + IAnimatable targetObject, + float baseValue, + ref AnimationArgs args) + { + return RelativeTo == RelativeTo.Final ? baseValue + args.NewSize.Y : baseValue; + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/SnapshotPolicy.cs b/UIX/Microsoft/Iris/Animations/SnapshotPolicy.cs new file mode 100644 index 0000000..05709ab --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/SnapshotPolicy.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.SnapshotPolicy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal enum SnapshotPolicy + { + Continuous, + Once, + OnLoop, + } +} diff --git a/UIX/Microsoft/Iris/Animations/SnapshotRelativeTo.cs b/UIX/Microsoft/Iris/Animations/SnapshotRelativeTo.cs new file mode 100644 index 0000000..597262b --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/SnapshotRelativeTo.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.SnapshotRelativeTo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.RenderAPI.Drawing; + +namespace Microsoft.Iris.Animations +{ + internal class SnapshotRelativeTo : RelativeTo + { + private RectangleF _bounds; + + public SnapshotRelativeTo(RectangleF bounds) + : base(SnapshotPolicy.Once) + => _bounds = bounds; + + public RectangleF Bounds => _bounds; + } +} diff --git a/UIX/Microsoft/Iris/Animations/StopCommand.cs b/UIX/Microsoft/Iris/Animations/StopCommand.cs new file mode 100644 index 0000000..4d73477 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/StopCommand.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.StopCommand +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal enum StopCommand + { + LeaveCurrent, + MoveToBegin, + MoveToEnd, + } +} diff --git a/UIX/Microsoft/Iris/Animations/StopCommandSet.cs b/UIX/Microsoft/Iris/Animations/StopCommandSet.cs new file mode 100644 index 0000000..4c2bcee --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/StopCommandSet.cs @@ -0,0 +1,47 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.StopCommandSet +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Text; + +namespace Microsoft.Iris.Animations +{ + internal class StopCommandSet + { + private StopCommand[] _stopCommandsList; + + public StopCommandSet(StopCommand defaultCommand) + { + _stopCommandsList = new StopCommand[20]; + for (uint index = 0; index < _stopCommandsList.Length; ++index) + _stopCommandsList[index] = defaultCommand; + } + + public StopCommand this[AnimationType type] + { + get => _stopCommandsList[(uint)type]; + set => _stopCommandsList[(uint)type] = value; + } + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("StopCommandSet("); + int num = 0; + for (uint index = 0; index < _stopCommandsList.Length; ++index) + { + StopCommand stopCommands = _stopCommandsList[index]; + if (num > 0) + stringBuilder.Append(", "); + ++num; + stringBuilder.Append((AnimationType)index); + stringBuilder.Append(":"); + stringBuilder.Append(stopCommands); + } + stringBuilder.Append(")"); + return stringBuilder.ToString(); + } + } +} diff --git a/UIX/Microsoft/Iris/Animations/SwitchAnimation.cs b/UIX/Microsoft/Iris/Animations/SwitchAnimation.cs new file mode 100644 index 0000000..fa671dd --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/SwitchAnimation.cs @@ -0,0 +1,63 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.SwitchAnimation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; +using System.Collections.Generic; + +namespace Microsoft.Iris.Animations +{ + internal class SwitchAnimation : IAnimationProvider + { + private IUIValueRange _expressionObject; + private Dictionary _optionsList; + private AnimationEventType _type; + + public IUIValueRange Expression + { + get => _expressionObject; + set => _expressionObject = value; + } + + public Dictionary Options + { + get + { + if (_optionsList == null) + _optionsList = new Dictionary(); + return _optionsList; + } + set => _optionsList = value; + } + + public AnimationEventType Type + { + get => _type; + set => _type = value; + } + + public AnimationTemplate Build(ref AnimationArgs args) + { + AnimationTemplate animationTemplate = null; + if (_optionsList != null) + { + object obj = null; + if (_expressionObject != null) + obj = _expressionObject.ObjectValue; + string key = null; + if (obj != null) + key = obj.ToString(); + IAnimationProvider animationProvider = null; + if (key != null && _optionsList.ContainsKey(key)) + animationProvider = _optionsList[key]; + if (animationProvider != null) + animationTemplate = animationProvider.Build(ref args); + } + return animationTemplate; + } + + public bool CanCache => false; + } +} diff --git a/UIX/Microsoft/Iris/Animations/TransformAnimation.cs b/UIX/Microsoft/Iris/Animations/TransformAnimation.cs new file mode 100644 index 0000000..2b30d74 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/TransformAnimation.cs @@ -0,0 +1,176 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.TransformAnimation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Animations +{ + internal class TransformAnimation : ReferenceAnimation + { + private float _timeScaleValue; + private float _timeOffsetValue; + private float _magnitudeValue; + private KeyframeFilter _filter; + private AnimationTemplate _cacheAnimation; + + public TransformAnimation() + { + _timeScaleValue = 1f; + _magnitudeValue = 1f; + _filter = KeyframeFilter.All; + } + + public float TimeScale + { + get => _timeScaleValue; + set + { + if (_timeScaleValue == (double)value) + return; + _timeScaleValue = value; + ClearCache(); + } + } + + public float Delay + { + get => _timeOffsetValue; + set + { + if (_timeOffsetValue == (double)value) + return; + _timeOffsetValue = value; + ClearCache(); + } + } + + public float Magnitude + { + get => _magnitudeValue; + set + { + if (_magnitudeValue == (double)value) + return; + _magnitudeValue = value; + ClearCache(); + } + } + + public KeyframeFilter Filter + { + get => _filter; + set + { + if (_filter == value) + return; + _filter = value; + ClearCache(); + } + } + + protected override AnimationTemplate BuildWorker(ref AnimationArgs args) + { + if (_cacheAnimation != null) + return _cacheAnimation; + float timeScale = GetTimeScale(ref args); + float delayTime = GetDelayTime(ref args); + float magnitude = GetMagnitude(ref args); + bool flag1 = timeScale != 1.0; + bool flag2 = delayTime != 0.0; + bool flag3 = magnitude != 1.0; + int filter = (int)_filter; + AnimationTemplate anim1 = base.BuildWorker(ref args); + DumpAnimation(anim1, "Source"); + if (!flag1 && !flag2 && !flag3) + return anim1; + AnimationTemplate anim2 = (AnimationTemplate)anim1.Clone(); + anim2.DebugID += "'"; + if (flag1) + ApplyTimeScale(anim2, timeScale); + if (flag2) + ApplyTimeOffset(anim2, delayTime); + if (flag3) + ApplyMagnitude(anim2, magnitude); + if (CanCache) + _cacheAnimation = anim2; + return anim2; + } + + internal static void DumpAnimation(AnimationTemplate anim, string descriptionName) + { + foreach (BaseKeyframe keyframe in anim.Keyframes) + ; + } + + protected virtual float GetTimeScale(ref AnimationArgs args) => _timeScaleValue; + + protected virtual float GetDelayTime(ref AnimationArgs args) => _timeOffsetValue; + + protected virtual float GetMagnitude(ref AnimationArgs args) => _magnitudeValue; + + private void ApplyTimeScale(AnimationTemplate anim, float timeScaleValue) + { + foreach (BaseKeyframe keyframe in anim.Keyframes) + { + if (ShouldApplyTransform(keyframe)) + keyframe.Time *= timeScaleValue; + } + DumpAnimation(anim, "Result"); + } + + private void ApplyTimeOffset(AnimationTemplate anim, float timeOffsetValue) + { + ArrayList arrayList = new ArrayList(); + foreach (BaseKeyframe keyframe in anim.Keyframes) + { + if (ShouldApplyTransform(keyframe)) + { + if (keyframe.Time == 0.0) + arrayList.Add(keyframe.Clone()); + keyframe.Time += timeOffsetValue; + } + } + foreach (BaseKeyframe key in arrayList) + anim.AddKeyframe(key); + DumpAnimation(anim, "Result"); + } + + private void ApplyMagnitude(AnimationTemplate anim, float magnitudeValue) + { + foreach (BaseKeyframe keyframe in anim.Keyframes) + { + if (ShouldApplyTransform(keyframe)) + keyframe.MagnifyValue(magnitudeValue); + } + DumpAnimation(anim, "Result"); + } + + private KeyframeFilter GetKeyframeFilter(BaseKeyframe key) + { + switch (key.Type) + { + case AnimationType.Position: + return KeyframeFilter.Position; + case AnimationType.Size: + return KeyframeFilter.Size; + case AnimationType.Alpha: + return KeyframeFilter.Alpha; + case AnimationType.Scale: + return KeyframeFilter.Scale; + case AnimationType.Rotate: + return KeyframeFilter.Rotate; + default: + return KeyframeFilter.All; + } + } + + private bool ShouldApplyTransform(BaseKeyframe key) => _filter == KeyframeFilter.All || GetKeyframeFilter(key) == _filter; + + protected override void OnSourceChanged() => ClearCache(); + + protected void ClearCache() => _cacheAnimation = null; + } +} diff --git a/UIX/Microsoft/Iris/Animations/TransformAttribute.cs b/UIX/Microsoft/Iris/Animations/TransformAttribute.cs new file mode 100644 index 0000000..2004076 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/TransformAttribute.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.TransformAttribute +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Animations +{ + internal enum TransformAttribute + { + Index, + Width, + Height, + X, + Y, + } +} diff --git a/UIX/Microsoft/Iris/Animations/TransformByAttributeAnimation.cs b/UIX/Microsoft/Iris/Animations/TransformByAttributeAnimation.cs new file mode 100644 index 0000000..a1c3583 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/TransformByAttributeAnimation.cs @@ -0,0 +1,174 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.TransformByAttributeAnimation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Animations +{ + internal class TransformByAttributeAnimation : TransformAnimation + { + private TransformAttribute _attrib; + private float _maxTimeScaleValue; + private float _maxTimeOffsetValue; + private float _maxMagnitudeValue; + private float _overrideValue; + private bool _haveOverrideFlag; + private ValueTransformer _valueTransformer; + + public TransformByAttributeAnimation() + { + Delay = 0.0f; + Magnitude = 0.0f; + TimeScale = 0.0f; + Attribute = TransformAttribute.Index; + } + + public TransformAttribute Attribute + { + get => _attrib; + set => _attrib = value; + } + + public float MaxTimeScale + { + get => _maxTimeScaleValue; + set + { + if (_maxTimeScaleValue == (double)value) + return; + _maxTimeScaleValue = value; + ClearCache(); + } + } + + public float MaxDelay + { + get => _maxTimeOffsetValue; + set + { + if (_maxTimeOffsetValue == (double)value) + return; + _maxTimeOffsetValue = value; + ClearCache(); + } + } + + public float MaxMagnitude + { + get => _maxMagnitudeValue; + set + { + if (_maxMagnitudeValue == (double)value) + return; + _maxMagnitudeValue = value; + ClearCache(); + } + } + + public float Override + { + get => _overrideValue; + set + { + if (_haveOverrideFlag && _overrideValue == (double)value) + return; + _overrideValue = value; + _haveOverrideFlag = true; + ClearCache(); + } + } + + public ValueTransformer ValueTransformer + { + get => _valueTransformer; + set + { + if (_valueTransformer == value) + return; + _valueTransformer = value; + ClearCache(); + } + } + + protected override float GetTimeScale(ref AnimationArgs args) + { + float timeScale = base.GetTimeScale(ref args); + if (timeScale == 0.0) + return 1f; + float val1 = 1f + GetValue(ref args) * timeScale; + if (_maxTimeScaleValue != 0.0) + val1 = Math.Min(val1, _maxTimeScaleValue); + if (val1 < 0.0) + val1 = 0.0f; + return val1; + } + + protected override float GetDelayTime(ref AnimationArgs args) + { + float delayTime = base.GetDelayTime(ref args); + if (delayTime == 0.0) + return 0.0f; + float val1 = GetValue(ref args) * delayTime; + if (_maxTimeOffsetValue != 0.0) + val1 = Math.Min(val1, _maxTimeOffsetValue); + if (val1 < 0.0) + val1 = 0.0f; + return val1; + } + + protected override float GetMagnitude(ref AnimationArgs args) + { + float magnitude = base.GetMagnitude(ref args); + if (magnitude == 0.0) + return 1f; + float val1 = 1f + GetValue(ref args) * magnitude; + if (_maxMagnitudeValue != 0.0) + val1 = Math.Min(val1, _maxMagnitudeValue); + return val1; + } + + private float GetValue(ref AnimationArgs args) + { + float num = GetValueWorker(ref args); + if (_valueTransformer != null) + num = _valueTransformer.Transform(num); + return num; + } + + protected virtual float GetValueWorker(ref AnimationArgs args) + { + if (_haveOverrideFlag) + return _overrideValue; + switch (_attrib) + { + case TransformAttribute.Index: + return GetIndex(ref args); + case TransformAttribute.Width: + return args.NewSize.X; + case TransformAttribute.Height: + return args.NewSize.Y; + case TransformAttribute.X: + return args.NewPosition.X; + case TransformAttribute.Y: + return args.NewPosition.Y; + default: + return 0.0f; + } + } + + private int GetIndex(ref AnimationArgs args) + { + int num = 0; + ViewItem viewItem = args.ViewItem; + if (viewItem != null && viewItem.Parent != null) + num = viewItem.Parent.Children.IndexOf(viewItem); + return num; + } + + public override bool CanCache => false; + } +} diff --git a/UIX/Microsoft/Iris/Animations/ValueTransformer.cs b/UIX/Microsoft/Iris/Animations/ValueTransformer.cs new file mode 100644 index 0000000..ca84d42 --- /dev/null +++ b/UIX/Microsoft/Iris/Animations/ValueTransformer.cs @@ -0,0 +1,76 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Animations.ValueTransformer +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Animations +{ + internal class ValueTransformer + { + private float _add; + private float _subtract; + private float _multiply; + private float _divide; + private float _mod; + private bool _absolute; + + public ValueTransformer() + { + _multiply = 1f; + _divide = 1f; + _mod = float.MaxValue; + } + + public float Transform(float value) + { + value *= _multiply; + value /= _divide; + value += _add; + value -= _subtract; + if (_mod != 3.40282346638529E+38) + value %= _mod; + if (_absolute) + value = Math.Abs(value); + return value; + } + + public float Add + { + get => _add; + set => _add = value; + } + + public float Subtract + { + get => _subtract; + set => _subtract = value; + } + + public float Multiply + { + get => _multiply; + set => _multiply = value; + } + + public float Divide + { + get => _divide; + set => _divide = value; + } + + public float Mod + { + get => _mod; + set => _mod = value; + } + + public bool Absolute + { + get => _absolute; + set => _absolute = value; + } + } +} diff --git a/UIX/Microsoft/Iris/Application.cs b/UIX/Microsoft/Iris/Application.cs new file mode 100644 index 0000000..fee93be --- /dev/null +++ b/UIX/Microsoft/Iris/Application.cs @@ -0,0 +1,519 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Application +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Data; +using Microsoft.Iris.Input; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Diagnostics; +using System.Reflection; +using System.Security; +using System.Threading; + +namespace Microsoft.Iris +{ + public static class Application + { + private static Application.InitializationState s_initializationState = InitializationState.NotInitialized; + private static UISession s_session; + private static Window s_mainWindow; + private static bool s_isShuttingDown; + private static RenderingType s_renderType = RenderingType.Default; + private static SoundType s_soundType = SoundType.None; + private static RenderingQuality s_renderingQuality = RenderingQuality.MaxQuality; + private static bool s_EnableAnimations = true; + private static bool s_IsRTL = false; + private static Dictionary s_idToExternalAnimationInput; + private static Dictionary s_animationProviders; + + public static string Name + { + get => UIApplication.ApplicationName; + set => UIApplication.ApplicationName = value; + } + + public static Window Window + { + get + { + if (s_initializationState != InitializationState.FullyInitialized) + throw new InvalidOperationException("Application.Initialize must be called prior Window query"); + if (s_mainWindow == null) + s_mainWindow = new Window((UIForm)s_session.Form); + return s_mainWindow; + } + } + + public static RenderingType RenderingType + { + set + { + if (IsInitialized) + throw new InvalidOperationException("Property cannot be modified after application has been initialized"); + s_renderType = value; + } + get => s_renderType; + } + + public static SoundType SoundType + { + set + { + if (IsInitialized) + throw new InvalidOperationException("Property cannot be modified after application has been initialized"); + s_soundType = value; + } + get => s_soundType; + } + + public static RenderingQuality RenderingQuality + { + set + { + if (IsInitialized) + throw new InvalidOperationException("Property cannot be modified after application has been initialized"); + s_renderingQuality = value; + } + get => s_renderingQuality; + } + + public static bool AnimationsEnabled + { + set + { + if (IsInitialized) + throw new InvalidOperationException("Property cannot be modified after application has been initialized"); + s_EnableAnimations = value; + } + get => s_EnableAnimations; + } + + public static bool IsRTL + { + set + { + if (IsInitialized) + throw new InvalidOperationException("Property cannot be modified after application has been initialized"); + s_IsRTL = value; + } + get => s_IsRTL; + } + + public static bool IsDx9AccelerationAvailable + { + get + { + if (s_initializationState != InitializationState.FullyInitialized) + throw new InvalidOperationException("Application.Initialize must be called prior to DX9 check"); + return s_session.IsGraphicsDeviceAvailable(GraphicsDeviceType.Direct3D9); + } + } + + private static bool IsInitialized => s_initializationState != InitializationState.NotInitialized; + + public static bool StaticDllResourcesOnly + { + set + { + if (IsInitialized) + throw new InvalidOperationException("Property cannot be modified after application has been initialized"); + DllResources.StaticDllResourcesOnly = value; + } + get => DllResources.StaticDllResourcesOnly; + } + + public static bool IsDebug { get; set; } + + public static void Initialize() + { + if (IsInitialized) + throw new InvalidOperationException("Application already initialized"); + VerifyTrustedEnvironment(); + s_session = new UISession(); + s_session.IsRtl = s_IsRTL; + s_session.InputManager.KeyCoalescePolicy = new KeyCoalesceFilter(QueryKeyCoalesce); + GraphicsDeviceType graphicsType = ChooseRenderingGraphicsDevice(s_renderType); + switch (graphicsType) + { + case GraphicsDeviceType.Gdi: + s_renderType = RenderingType.GDI; + break; + case GraphicsDeviceType.Direct3D9: + s_renderType = RenderingType.DX9; + break; + default: + throw new ArgumentException(InvariantString.Format("Unknown graphics type {0}", graphicsType)); + } + if (graphicsType == GraphicsDeviceType.Gdi) + s_EnableAnimations = false; + SoundDeviceType soundType = ChooseRendererSoundDevice(s_soundType); + switch (soundType) + { + case SoundDeviceType.None: + s_soundType = SoundType.None; + break; + case SoundDeviceType.DirectSound8: + s_soundType = SoundType.DirectSound; + break; + default: + throw new ArgumentException(InvariantString.Format("Unknown sound type {0}", soundType)); + } + s_session.InitializeRenderingDevices(graphicsType, (GraphicsRenderingQuality)s_renderingQuality, soundType); + s_renderingQuality = (RenderingQuality)s_session.RenderSession.GraphicsDevice.RenderingQuality; + InitializeCommon(true); + if (!s_EnableAnimations) + AnimationSystem.OverrideAnimationState(true); + UIForm uiForm = new UIForm(s_session); + s_initializationState = InitializationState.FullyInitialized; + } + + private static void InitializeCommon(bool fullInitialization) + { + ErrorManager.OnErrors += new NotifyErrorBatch(NotifyErrorBatchHandler); + Debug.Trace.Initialize(); + MarkupSystem.Startup(!fullInitialization); + StaticServices.Initialize(); + } + + public static void InitializeForToolOnly() + { + if (IsInitialized) + throw new InvalidOperationException("Application has already been initialized"); + RenderApi.InitializeForToolOnly(); + UIDispatcher uiDispatcher = new UIDispatcher(true); + InitializeCommon(false); + s_initializationState = InitializationState.InitializedWithoutUI; + } + + public static bool IsApplicationThread => UIDispatcher.IsUIThread; + + public static bool LoadMarkup(string uri) + { + UIDispatcher.VerifyOnApplicationThread(); + if (uri == null) + throw new ArgumentNullException(nameof(uri)); + return MarkupSystem.Load(uri, MarkupSystem.RootIslandId) != null; + } + + public static bool CompileMarkup(CompilerInput[] compilands, CompilerInput dataTableCompiland) + { + UIDispatcher.VerifyOnApplicationThread(); + if (compilands == null) + throw new ArgumentNullException(nameof(compilands)); + foreach (CompilerInput compiland in compilands) + { + if (compiland.SourceFileName == null) + throw new ArgumentNullException("SourceFileName"); + if (compiland.OutputFileName == null) + throw new ArgumentNullException("OutputFileName"); + } + if (dataTableCompiland.SourceFileName == null && dataTableCompiland.OutputFileName != null || dataTableCompiland.SourceFileName != null && dataTableCompiland.OutputFileName == null) + throw new ArgumentException(nameof(dataTableCompiland)); + return MarkupCompiler.Compile(compilands, dataTableCompiland); + } + + public static void UnloadAllMarkup() + { + UIDispatcher.VerifyOnApplicationThread(); + MarkupSystem.UnloadAll(); + } + + public static void AddMarkupRedirect(string fromPrefix, string toPrefix) + { + UIDispatcher.VerifyOnApplicationThread(); + if (fromPrefix == null) + throw new ArgumentNullException(nameof(fromPrefix)); + if (toPrefix == null) + throw new ArgumentNullException(nameof(toPrefix)); + ResourceManager.Instance.AddUriRedirect(fromPrefix, toPrefix); + } + + public static void AddImportRedirect(string fromPrefix, string toPrefix) + { + UIDispatcher.VerifyOnApplicationThread(); + if (fromPrefix == null) + throw new ArgumentNullException(nameof(fromPrefix)); + if (toPrefix == null) + throw new ArgumentNullException(nameof(toPrefix)); + MarkupSystem.AddImportRedirect(fromPrefix, toPrefix); + } + + public static void RegisterDataProvider(string name, DataProviderQueryFactory factory) + { + UIDispatcher.VerifyOnApplicationThread(); + if (factory == null) + throw new ArgumentNullException(nameof(factory)); + if (name == null) + throw new ArgumentNullException(nameof(name)); + if (MarkupDataProvider.GetDataProvider(name) != null) + throw new ArgumentException("Provider is already registered"); + MarkupDataProvider.RegisterDataProvider(new AssemblyDataProviderWrapper(name, factory)); + } + + public static void Run(DeferredInvokeHandler initialLoadComplete) + { + UIDispatcher.VerifyOnApplicationThread(); + if (s_initializationState != InitializationState.FullyInitialized) + throw new InvalidOperationException("Application not initialized for displaying UI"); + if (initialLoadComplete != null) + ((UIForm)s_session.Form).SetInitialLoadCompleteCallback(DeferredInvokeProxy.Thunk(initialLoadComplete)); + UIApplication.Run(); + } + + public static void Run() => Run(null); + + public static event EventHandler ShuttingDown; + + public static bool IsShuttingDown => s_isShuttingDown; + + public static void Shutdown() + { + UIDispatcher.VerifyOnApplicationThread(); + s_isShuttingDown = true; + if (ShuttingDown != null) + ShuttingDown(null, EventArgs.Empty); + MarkupSystem.Shutdown(); + if (s_initializationState == InitializationState.FullyInitialized) + { + s_session.Dispose(); + s_session = null; + } + if (s_initializationState == InitializationState.InitializedWithoutUI) + RenderApi.ShutdownForToolOnly(); + StaticServices.Uninitialize(); + Debug.Trace.Shutdown(); + ErrorManager.OnErrors -= new NotifyErrorBatch(NotifyErrorBatchHandler); + s_initializationState = InitializationState.NotInitialized; + } + + public static void DeferredInvoke(DeferredInvokeHandler method, DeferredInvokePriority priority) => DeferredInvoke(method, null, priority); + + public static void DeferredInvoke(DeferredInvokeHandler method, object args) => DeferredInvoke(method, args, DeferredInvokePriority.Normal); + + public static void DeferredInvoke( + DeferredInvokeHandler method, + object args, + DeferredInvokePriority priority) + { + if (method == null) + throw new ArgumentNullException(nameof(method)); + DispatchPriority priority1; + switch (priority) + { + case DeferredInvokePriority.Normal: + priority1 = DispatchPriority.AppEvent; + break; + case DeferredInvokePriority.Low: + priority1 = DispatchPriority.Idle; + break; + default: + throw new ArgumentException(InvariantString.Format("Unknown DeferredInvokePriority {0}", priority)); + } + DeferredCall.Post(priority1, DeferredInvokeProxy.Thunk(method), args); + } + + public static void DeferredInvoke(DeferredInvokeHandler method, TimeSpan delay) => DeferredInvoke(method, null, delay); + + public static void DeferredInvoke(DeferredInvokeHandler method, object args, TimeSpan delay) + { + if (method == null) + throw new ArgumentNullException(nameof(method)); + DeferredCall.Post(delay, DeferredInvokeProxy.Thunk(method), args); + } + + public static void DeferredInvoke(Thread thread, DeferredInvokeHandler method) => DeferredInvoke(thread, method, null); + + public static void DeferredInvoke(Thread thread, DeferredInvokeHandler method, object args) + { + if (thread == null) + throw new ArgumentNullException(nameof(thread)); + if (method == null) + throw new ArgumentNullException(nameof(method)); + DeferredCall.Post(thread, DispatchPriority.AppEvent, DeferredInvokeProxy.Thunk(method), args); + } + + public static void DeferredInvokeOnWorkerThread( + DeferredInvokeHandler workerMethod, + DeferredInvokeHandler notifyMethod, + object args) + { + if (workerMethod == null) + throw new ArgumentNullException(nameof(workerMethod)); + if (notifyMethod == null) + throw new ArgumentNullException(nameof(notifyMethod)); + UIApplication.DeferredInvokeOnWorkerThread(DeferredInvokeProxy.Thunk(workerMethod), DeferredInvokeProxy.Thunk(notifyMethod), args); + } + + public static void RunWorkerMessagePump( + DeferredInvokeHandler initialWork, + object initialWorkArgs) + { + if (UIDispatcher.CurrentDispatcher != null) + throw new InvalidOperationException("Thread already has a dispatcher running"); + if (initialWork == null) + throw new ArgumentNullException(nameof(initialWork)); + UIApplication.StartArgs startArgs = null; + if (initialWork != null) + startArgs = new UIApplication.StartArgs(DeferredInvokeProxy.Thunk(initialWork), initialWorkArgs); + UIApplication.StartDispatcher(startArgs); + } + + public static Thread StartWorkerThreadWithMessagePump(string threadName) => UIApplication.StartThreadWithDispatcher(threadName); + + public static void ShutdownWorkerMessagePump(Thread thread) + { + if (thread == UIDispatcher.MainUIThread) + throw new InvalidOperationException("Use Application.Shutdown to shut down the application dispatcher"); + UIDispatcher.StopCurrentMessageLoop(thread); + } + + public static int CreateExternalAnimationInput(IDictionary propertyNameToId) + { + UIDispatcher.VerifyOnApplicationThread(); + if (s_idToExternalAnimationInput == null) + s_idToExternalAnimationInput = new Dictionary(); + SimpleAnimationPropertyMap animationPropertyMap = new SimpleAnimationPropertyMap(propertyNameToId); + IExternalAnimationInput externalAnimationInput = s_session.RenderSession.AnimationSystem.CreateExternalAnimationInput(s_idToExternalAnimationInput, animationPropertyMap); + s_idToExternalAnimationInput.Add((int)externalAnimationInput.UniqueId, externalAnimationInput); + return (int)externalAnimationInput.UniqueId; + } + + public static void DisposeExternalAnimationInput(int animationId) + { + UIDispatcher.VerifyOnApplicationThread(); + IExternalAnimationInput externalAnimationInput; + if (s_idToExternalAnimationInput == null || !s_idToExternalAnimationInput.TryGetValue(animationId, out externalAnimationInput)) + return; + s_idToExternalAnimationInput.Remove(animationId); + externalAnimationInput.UnregisterUsage(s_idToExternalAnimationInput); + IAnimationInputProvider animationInputProvider; + if (s_animationProviders == null || !s_animationProviders.TryGetValue(animationId, out animationInputProvider)) + return; + s_animationProviders.Remove(animationId); + animationInputProvider.UnregisterUsage(s_idToExternalAnimationInput); + } + + internal static IExternalAnimationInput MapExternalAnimationInput( + int animationId) + { + UIDispatcher.VerifyOnApplicationThread(); + IExternalAnimationInput externalAnimationInput = null; + if (s_idToExternalAnimationInput != null) + s_idToExternalAnimationInput.TryGetValue(animationId, out externalAnimationInput); + return externalAnimationInput; + } + + public static void SetExternalAnimationInputProperty( + int animationId, + string property, + float value) + { + UIDispatcher.VerifyOnApplicationThread(); + IAnimationInputProvider provider; + if (s_animationProviders == null || !s_animationProviders.TryGetValue(animationId, out provider)) + { + provider = MapExternalAnimationInput(animationId).CreateProvider(s_idToExternalAnimationInput); + if (s_animationProviders == null) + s_animationProviders = new Dictionary(); + s_animationProviders.Add(animationId, provider); + } + provider.PublishFloat(property, value); + } + + public static event ErrorReportHandler ErrorReport; + + private static void NotifyErrorBatchHandler(IList records) + { + if (ErrorReport == null) + return; + Error[] errors = new Error[records.Count]; + for (int index = 0; index < records.Count; ++index) + { + ErrorRecord record = (ErrorRecord)records[index]; + errors[index] = new Error() + { + Context = record.Context, + Message = record.Message, + Warning = record.Warning, + Line = record.Line, + Column = record.Column + }; + } + ErrorReport(errors); + } + + private static GraphicsDeviceType ChooseRenderingGraphicsDevice( + RenderingType type) + { + GraphicsDeviceType graphicsType; + switch (type) + { + case RenderingType.GDI: + graphicsType = GraphicsDeviceType.Gdi; + break; + case RenderingType.DX9: + case RenderingType.Default: + graphicsType = GraphicsDeviceType.Direct3D9; + break; + default: + throw new ArgumentException(InvariantString.Format("Unknown rendering type {0}", type)); + } + if (type == RenderingType.Default && !s_session.IsGraphicsDeviceRecommended(graphicsType) || !s_session.IsGraphicsDeviceAvailable(graphicsType)) + graphicsType = GraphicsDeviceType.Gdi; + return graphicsType; + } + + private static SoundDeviceType ChooseRendererSoundDevice(SoundType typeRequested) + { + if (typeRequested == SoundType.None) + return SoundDeviceType.None; + if (typeRequested != SoundType.DirectSound) + throw new ArgumentException(InvariantString.Format("Unknown sound type {0}", typeRequested)); + return s_session.IsSoundDeviceAvailable(SoundDeviceType.DirectSound8) ? SoundDeviceType.DirectSound8 : SoundDeviceType.None; + } + + private static bool QueryKeyCoalesce(Keys key) => true; + + private static void VerifyTrustedEnvironment() + { + Assembly assembly1 = new StackTrace().GetFrame(2).GetMethod().DeclaringType.Assembly; + Assembly assembly2 = typeof(Application).Assembly; + byte[] publicKey1 = assembly1.GetName().GetPublicKey(); + byte[] publicKey2 = assembly2.GetName().GetPublicKey(); + bool flag = true; + if (publicKey1.Length == publicKey2.Length) + { + for (int index = 0; index < publicKey2.Length; ++index) + { + if (publicKey1[index] != publicKey2[index]) + { + flag = false; + break; + } + } + } + else + flag = false; + //if (!flag) + // throw new SecurityException("Attempt to activate system within an untrusted environment"); + } + + private enum InitializationState + { + NotInitialized, + FullyInitialized, + InitializedWithoutUI, + } + } +} diff --git a/UIX/Microsoft/Iris/ArrayListDataSet.cs b/UIX/Microsoft/Iris/ArrayListDataSet.cs new file mode 100644 index 0000000..3ddac70 --- /dev/null +++ b/UIX/Microsoft/Iris/ArrayListDataSet.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ArrayListDataSet +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris +{ + public class ArrayListDataSet : ListDataSet + { + public ArrayListDataSet() + : this(null) + { + } + + public ArrayListDataSet(IModelItemOwner owner) + : base(owner, new ArrayList()) + { + } + } +} diff --git a/UIX/Microsoft/Iris/AssemblyDataProviderWrapper.cs b/UIX/Microsoft/Iris/AssemblyDataProviderWrapper.cs new file mode 100644 index 0000000..2a66aa8 --- /dev/null +++ b/UIX/Microsoft/Iris/AssemblyDataProviderWrapper.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.AssemblyDataProviderWrapper +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; + +namespace Microsoft.Iris +{ + internal class AssemblyDataProviderWrapper : IDataProvider + { + private string _name; + private DataProviderQueryFactory _factory; + + public AssemblyDataProviderWrapper(string name, DataProviderQueryFactory factory) + { + _name = name; + _factory = factory; + } + + public string Name => _name; + + public MarkupDataQuery Build(MarkupDataQuerySchema querySchema) => new AssemblyMarkupDataQuery(querySchema, this); + + public IDataProviderQuery ConstructQuery(object queryTypeCookie) => _factory(queryTypeCookie); + + 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 new file mode 100644 index 0000000..55399ed --- /dev/null +++ b/UIX/Microsoft/Iris/Audio/Sound.cs @@ -0,0 +1,63 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Audio.Sound +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Audio; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Audio +{ + internal class Sound + { + private string _source; + private SystemSoundEvent _systemSoundEvent; + + internal Sound() + { + } + + internal string Source + { + get => _source; + set + { + _source = value; + _systemSoundEvent = SystemSoundEvent.None; + } + } + + internal SystemSoundEvent SystemSoundEvent + { + get => _systemSoundEvent; + set + { + _systemSoundEvent = value; + _source = null; + } + } + + public void Play() + { + if (!Environment.Instance.SoundEffectsEnabled) + return; + SoundManager soundManager = UISession.Default.SoundManager; + ISoundBuffer soundBuffer = null; + string source = null; + if (_source != null) + source = _source; + else if (_systemSoundEvent != SystemSoundEvent.None) + source = soundManager.GetSystemSoundEventSource(_systemSoundEvent); + if (source != null) + soundBuffer = soundManager.GetSoundBuffer(source); + if (soundBuffer == null) + return; + ISound sound = soundBuffer.CreateSound(this); + sound.Play(); + sound.UnregisterUsage(this); + } + } +} diff --git a/UIX/Microsoft/Iris/BooleanChoice.cs b/UIX/Microsoft/Iris/BooleanChoice.cs new file mode 100644 index 0000000..038102c --- /dev/null +++ b/UIX/Microsoft/Iris/BooleanChoice.cs @@ -0,0 +1,68 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.BooleanChoice +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using System.Collections; + +namespace Microsoft.Iris +{ + public class BooleanChoice : + Choice, + IUIBooleanChoice, + IUIChoice, + IUIValueRange, + IDisposableObject, + INotifyObject + { + public BooleanChoice(IModelItemOwner owner, string description, IList options) + : base(owner, description) + { + if (options == null) + return; + Options = options; + } + + public BooleanChoice(IModelItemOwner owner, string description) + : this(owner, description, null) + { + } + + public BooleanChoice(IModelItemOwner owner) + : this(owner, null, null) + { + } + + public BooleanChoice() + : this(null) + { + } + + internal override Microsoft.Iris.ModelItems.Choice CreateInternalChoice() => new Microsoft.Iris.ModelItems.BooleanChoice(); + + public bool Value + { + get + { + using (ThreadValidator) + return ChosenIndex == 1; + } + set + { + using (ThreadValidator) + { + if (value == Value) + return; + if (value) + ChosenIndex = 1; + else + ChosenIndex = 0; + } + } + } + } +} diff --git a/UIX/Microsoft/Iris/ByteRangedValue.cs b/UIX/Microsoft/Iris/ByteRangedValue.cs new file mode 100644 index 0000000..2750d2f --- /dev/null +++ b/UIX/Microsoft/Iris/ByteRangedValue.cs @@ -0,0 +1,52 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ByteRangedValue +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris +{ + public class ByteRangedValue : RangedValue, IUIByteRangedValue, IUIRangedValue, IUIValueRange, INotifyObject + { + public ByteRangedValue(IModelItemOwner owner, string description) : base(owner, description) + { + } + + public ByteRangedValue(IModelItemOwner owner) : this(owner, null) + { + } + + public ByteRangedValue() : this(null) + { + } + + public byte Value + { + get => (byte)base.Value; + set => base.Value = value; + } + + public byte MinValue + { + get => (byte)base.MinValue; + set => base.MinValue = value; + } + + public byte MaxValue + { + get => (byte)base.MaxValue; + set => base.MaxValue = value; + } + + public byte Step + { + get => (byte)base.Step; + set => base.Step = value; + } + + internal override ModelItems.RangedValue CreateInternalRangedValue() => new ModelItems.ByteRangedValue(); + } +} diff --git a/UIX/Microsoft/Iris/Choice.cs b/UIX/Microsoft/Iris/Choice.cs new file mode 100644 index 0000000..08f032c --- /dev/null +++ b/UIX/Microsoft/Iris/Choice.cs @@ -0,0 +1,342 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Choice +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using System; +using System.Collections; +using System.ComponentModel; + +namespace Microsoft.Iris +{ + public class Choice : + ModelItem, + IValueRange, + IModelItem, + INotifyPropertyChanged, + IModelItemOwner, + IUIChoice, + IUIValueRange, + IDisposableObject, + INotifyObject, + AssemblyObjectProxyHelper.IFrameworkProxyObject, + AssemblyObjectProxyHelper.IAssemblyProxyObject + { + private NotifyService _notifier = new NotifyService(); + private static readonly EventCookie s_chosenChangedEvent = EventCookie.ReserveSlot(); + private Microsoft.Iris.ModelItems.Choice _choice; + private CodeListeners _listeners; + private ModelItem _lastChosen; + + public Choice(IModelItemOwner owner, string description, IList options) + : base(owner, description) + { + Initialize(); + Options = options; + } + + public Choice(IModelItemOwner owner, string description) + : base(owner, description) + => Initialize(); + + public Choice(IModelItemOwner owner) + : this(owner, null) + { + } + + public Choice() + : this(null) + { + } + + protected override void OnDispose(bool disposing) + { + base.OnDispose(disposing); + if (disposing) + { + _notifier.ClearListeners(); + _choice.Dispose(this); + _listeners.Dispose(this); + } + _choice = null; + } + + object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => this; + + object AssemblyObjectProxyHelper.IAssemblyProxyObject.AssemblyObject => this; + + public IList Options + { + get + { + using (ThreadValidator) + return (IList)AssemblyLoadResult.UnwrapObject(_choice.Options); + } + set + { + using (ThreadValidator) + { + IList potentialOptionsWrapped = (IList)AssemblyLoadResult.WrapObject(value); + ValidateOptionsList(potentialOptionsWrapped, value); + _choice.Options = potentialOptionsWrapped; + } + } + } + + public object ChosenValue + { + get + { + using (ThreadValidator) + return AssemblyLoadResult.UnwrapObject(_choice.ChosenValue); + } + set + { + using (ThreadValidator) + { + int index; + string error; + if (!_choice.ValidateOption(AssemblyLoadResult.WrapObject(value), out index, out error)) + throw new ArgumentException(error); + _choice.ChosenIndex = index; + } + } + } + + public int ChosenIndex + { + get + { + using (ThreadValidator) + return _choice.ChosenIndex; + } + set + { + using (ThreadValidator) + { + string error; + _choice.ChosenIndex = _choice.ValidateIndex(value, out error) ? value : throw new ArgumentException(error); + } + } + } + + public int DefaultIndex + { + get + { + using (ThreadValidator) + return _choice.DefaultIndex; + } + set + { + using (ThreadValidator) + _choice.DefaultIndex = value; + } + } + + object IValueRange.Value + { + get + { + using (ThreadValidator) + return AssemblyLoadResult.UnwrapObject(((IUIValueRange)_choice).ObjectValue); + } + } + + object IUIValueRange.ObjectValue => ((IUIValueRange)_choice).ObjectValue; + + IList IUIChoice.Options + { + get => _choice.Options; + set => _choice.Options = value; + } + + object IUIChoice.ChosenValue => _choice.ChosenValue; + + bool IUIChoice.ValidateIndex(int index, out string error) => _choice.ValidateIndex(index, out error); + + bool IUIChoice.ValidateOption(object value, out int index, out string error) => _choice.ValidateOption(value, out index, out error); + + bool IUIChoice.ValidateOptionsList(IList value, out string error) => _choice.ValidateOptionsList(value, out error); + + public bool HasNextValue + { + get + { + using (ThreadValidator) + return _choice.HasNextValue; + } + } + + public bool HasSelection + { + get + { + using (ThreadValidator) + return _choice.HasSelection; + } + } + + public bool HasPreviousValue + { + get + { + using (ThreadValidator) + return _choice.HasPreviousValue; + } + } + + public bool Wrap + { + get + { + using (ThreadValidator) + return _choice.Wrap; + } + set + { + using (ThreadValidator) + _choice.Wrap = value; + } + } + + public void PreviousValue() + { + using (ThreadValidator) + _choice.PreviousValue(); + } + + public void PreviousValue(bool wrap) + { + using (ThreadValidator) + _choice.PreviousValue(wrap); + } + + public void NextValue() + { + using (ThreadValidator) + _choice.NextValue(); + } + + public void NextValue(bool wrap) + { + using (ThreadValidator) + _choice.NextValue(wrap); + } + + public void Clear() + { + using (ThreadValidator) + _choice.Clear(); + } + + public void DefaultValue() + { + using (ThreadValidator) + _choice.DefaultValue(); + } + + protected virtual void OnChosenChanged() + { + } + + public event EventHandler ChosenChanged + { + add + { + using (ThreadValidator) + AddEventHandler(s_chosenChangedEvent, value); + } + remove + { + using (ThreadValidator) + RemoveEventHandler(s_chosenChangedEvent, value); + } + } + + private void Initialize() + { + _choice = CreateInternalChoice(); + _choice.DeclareOwner(this); + Vector listeners = new Vector(9); + DelegateListener.OnNotifyCallback callback = new DelegateListener.OnNotifyCallback(OnInternalChoicePropertyChanged); + 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(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)); + _listeners = new CodeListeners(listeners); + _listeners.DeclareOwner(this); + } + + protected override void OnPropertyChanged(string property) + { + base.OnPropertyChanged(property); + _notifier.FireThreadSafe(property); + } + + private void OnInternalChoicePropertyChanged(DelegateListener listener) => FirePropertyChanged(listener.Watch); + + private void OnChosenValueChanged(DelegateListener listener) + { + if (_lastChosen != null) + _lastChosen.Selected = false; + _lastChosen = ChosenValue as ModelItem; + if (_lastChosen != null) + _lastChosen.Selected = true; + FireChangedChosenEvent(); + OnInternalChoicePropertyChanged(listener); + } + + internal virtual Microsoft.Iris.ModelItems.Choice CreateInternalChoice() => new Microsoft.Iris.ModelItems.Choice(); + + private void ValidateOptionsList(IList potentialOptionsWrapped, IList potentialOptions) + { + using (ThreadValidator) + { + string error; + if (!_choice.ValidateOptionsList(potentialOptionsWrapped, out error)) + throw new ArgumentException(error); + ValidateOptionsListWorker(potentialOptions); + } + } + + protected virtual void ValidateOptionsListWorker(IList potentialOptions) + { + } + + private void FireChangedChosenEvent() + { + if (GetEventHandler(s_chosenChangedEvent) is EventHandler eventHandler) + eventHandler(this, EventArgs.Empty); + OnChosenChanged(); + } + + private void SetChosenSelected(bool selectedFlag) + { + if (!(ChosenValue is ModelItem chosenValue)) + return; + chosenValue.Selected = selectedFlag; + } + + void IDisposableObject.DeclareOwner(object owner) + { + } + + void IDisposableObject.TransferOwnership(object owner) + { + } + + void IDisposableObject.Dispose(object owner) => Dispose(); + + void INotifyObject.AddListener(Listener listener) => _notifier.AddListener(listener); + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllConstructorSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllConstructorSchema.cs new file mode 100644 index 0000000..1e30d97 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllConstructorSchema.cs @@ -0,0 +1,83 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllConstructorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllConstructorSchema : ConstructorSchema + { + private TypeSchema[] _parameterTypes; + private uint _id; + + public DllConstructorSchema(DllTypeSchema owner, uint ID) + : base(owner) + => _id = ID; + + public bool Load(IntPtr constructor) => QueryForParameterTypes(constructor); + + [Conditional("DEBUG")] + public void DEBUG_Dump() + { + string str1 = string.Empty; + if (_parameterTypes != null) + { + for (int index = 0; index < _parameterTypes.Length; ++index) + { + string str2 = ""; + if (_parameterTypes[index] != null) + str2 = _parameterTypes[index].Name; + str1 = string.Format("{0}{1}{2}", str1, index > 0 ? ", " : string.Empty, str2); + } + } + string.Format("0x{0:x8} {1}({2})", _id, Owner.Name, str1); + } + + public override TypeSchema[] ParameterTypes => _parameterTypes; + + private DllLoadResult OwnerLoadResult => (DllLoadResult)Owner.Owner; + + private bool QueryForParameterTypes(IntPtr constructor) + { + bool flag1 = false; + uint count; + if (CheckNativeReturn(NativeApi.SpQueryConstructorParameterCount(constructor, out count))) + { + uint[] IDs = new uint[count]; + if (CheckNativeReturn(NativeApi.SpGetConstructorParameterTypes(constructor, IDs, count))) + { + if (count > 0U) + { + _parameterTypes = new TypeSchema[count]; + bool flag2 = false; + for (int index = 0; index < count; ++index) + { + TypeSchema typeSchema = DllLoadResult.MapType(IDs[index]); + if (typeSchema != null) + _parameterTypes[index] = typeSchema; + else + flag2 = true; + } + flag1 = !flag2; + } + else + { + _parameterTypes = TypeSchema.EmptyList; + flag1 = true; + } + } + } + return flag1; + } + + public override object Construct(object[] parameters) => ((DllTypeSchema)Owner).Construct(_id, parameters); + + private bool CheckNativeReturn(uint hr) => DllLoadResult.CheckNativeReturn(hr, "IUIXConstructor"); + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumProxy.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumProxy.cs new file mode 100644 index 0000000..ed5cf4d --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumProxy.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllEnumProxy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllEnumProxy + { + private int _value; + private DllEnumSchema _schema; + + public DllEnumProxy(DllEnumSchema schema, int value) + { + _value = value; + _schema = schema; + } + + public int Value => _value; + + public DllEnumSchema Type => _schema; + + public override string ToString() => _schema.InvokeToString(this); + + public override int GetHashCode() => _value.GetHashCode(); + + public override bool Equals(object other) + { + bool flag = false; + if (other is DllEnumProxy dllEnumProxy) + flag = _schema == dllEnumProxy._schema && _value == dllEnumProxy._value; + return flag; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumSchema.cs new file mode 100644 index 0000000..86178e9 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEnumSchema.cs @@ -0,0 +1,141 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllEnumSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllEnumSchema : EnumSchema + { + private uint _id; + private IntPtr _nativeSchema; + + public DllEnumSchema(LoadResult owner, uint id, IntPtr nativeSchema) + : base(owner) + { + _id = id; + _nativeSchema = nativeSchema; + } + + [Conditional("DEBUG")] + public void DEBUG_DumpEnum() + { + int val1 = 0; + foreach (KeyValueEntry nameToValue in NameToValueMap) + { + if (nameToValue.Key != null) + val1 = Math.Max(val1, nameToValue.Key.Length); + } + string.Format("{{0,{0}}} = 0x{{1:x8}}", val1); + foreach (KeyValueEntry nameToValue in NameToValueMap) + ; + } + + public uint ID => _id; + + public bool Load() + { + string name; + bool flag = QueryName(out name); + if (flag) + { + bool isFlags; + flag = QueryIsFlags(out isFlags); + if (flag) + { + string[] names; + int[] values; + flag = QueryNamesAndValues(out names, out values); + if (flag) + { + Initialize(name, typeof(DllEnumProxy), isFlags, names, values); + flag = true; + } + } + } + return flag; + } + + private unsafe bool QueryName(out string name) + { + char* name1; + bool flag = CheckNativeReturn(NativeApi.SpQueryEnumName(_nativeSchema, out name1)); + name = !flag ? null : new string(name1); + return flag; + } + + private bool QueryIsFlags(out bool isFlags) => CheckNativeReturn(NativeApi.SpQueryEnumIsFlags(_nativeSchema, out isFlags)); + + private unsafe bool QueryNamesAndValues(out string[] names, out int[] values) + { + bool flag1 = false; + names = null; + values = null; + uint valueCount; + if (CheckNativeReturn(NativeApi.SpQueryEnumValueCount(_nativeSchema, out valueCount))) + { + bool flag2 = false; + if (valueCount > 0U) + { + names = new string[valueCount]; + values = new int[valueCount]; + for (uint index = 0; index < valueCount; ++index) + { + char* name; + int num; + if (CheckNativeReturn(NativeApi.SpGetEnumNameValue(_nativeSchema, index, out name, out num))) + { + if ((IntPtr)name != IntPtr.Zero) + { + names[index] = new string(name); + values[index] = num; + } + else + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "Name"); + } + else + { + flag2 = true; + break; + } + } + } + flag1 = !flag2; + } + return flag1; + } + + protected override void OnDispose() + { + base.OnDispose(); + NativeApi.SpReleaseExternalObject(_nativeSchema); + _nativeSchema = IntPtr.Zero; + } + + public object GetBoxedValue(int value) => EnumValueToObject(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 = null; + IntPtr result; + if (CheckNativeReturn(NativeApi.SpInvokeEnumToString(_nativeSchema, proxy.Value, out result))) + str = DllProxyServices.GetString(result); + return str; + } + + private DllLoadResult OwnerLoadResult => (DllLoadResult)Owner; + + private bool CheckNativeReturn(uint hr) => DllLoadResult.CheckNativeReturn(hr, "IUIXEnum"); + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllEventSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEventSchema.cs new file mode 100644 index 0000000..a81e0c4 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllEventSchema.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllEventSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllEventSchema : EventSchema + { + private string _name; + private bool _isStatic; + + public DllEventSchema(DllTypeSchema owner, uint ID) + : base(owner) + { + } + + public bool Load(IntPtr eventSchema) => QueryEventName(eventSchema) && QueryIsStatic(eventSchema); + + [Conditional("DEBUG")] + public void DEBUG_Dump() + { + } + + public override string Name => _name; + + public bool IsStatic => _isStatic; + + private unsafe bool QueryEventName(IntPtr eventSchema) + { + bool flag = false; + char* name; + if (CheckNativeReturn(NativeApi.SpQueryEventName(eventSchema, out name))) + { + _name = NotifyService.CanonicalizeString(new string(name)); + flag = true; + } + return flag; + } + + private bool QueryIsStatic(IntPtr eventSchema) => CheckNativeReturn(NativeApi.SpQueryEventIsStatic(eventSchema, out _isStatic)); + + private bool CheckNativeReturn(uint hr) => DllLoadResult.CheckNativeReturn(hr, "IUIXEvent"); + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllInterfaceProxy.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllInterfaceProxy.cs new file mode 100644 index 0000000..54ef746 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllInterfaceProxy.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllInterfaceProxy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal abstract class DllInterfaceProxy : DllProxyObject + { + protected IntPtr _interface; + + ~DllInterfaceProxy() => RegisterAppThreadRelease(new DllProxyObject.AppThreadReleaseEntry(_interface)); + + protected override void OnDispose() => new DllProxyObject.AppThreadReleaseEntry(_interface).Release(); + + protected override void LoadWorker(IntPtr nativeObject, IntPtr nativeMarshalAs) + { + _interface = nativeMarshalAs; + base.LoadWorker(nativeObject, nativeMarshalAs); + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllIntrinsicTypeSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllIntrinsicTypeSchema.cs new file mode 100644 index 0000000..dd9c6d0 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllIntrinsicTypeSchema.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllIntrinsicTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Markup.UIX; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllIntrinsicTypeSchema : DllTypeSchemaBase + { + public DllIntrinsicTypeSchema(DllLoadResult owner, uint ID, TypeSchema equivalentType) + : base(owner, ID) + { + _baseType = ObjectSchema.Type; + _name = InvariantString.Format(" {0}", equivalentType.Name); + _marshalAs = ID; + RegisterOneWayEquivalence(this, equivalentType); + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResult.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResult.cs new file mode 100644 index 0000000..d2c2f57 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResult.cs @@ -0,0 +1,337 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllLoadResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllLoadResult : LoadResult + { + private DllLoadResultFactory _source; + private LoadResultStatus _status; + private LoadPass _loadPass; + private IntPtr _schema; + private Map _userDefinedTypes; + private Map _intrinsicTypes; + private static Map s_intrinsicData; + private ushort _component; + private static ushort s_nextID = 1; + private static LoadResult s_objectContext; + + public static void Startup() + { + DllLoadResultFactory.Startup(); + DllProxyServices.Startup(); + LoadIntrinsicTypeData(); + } + + private static void LoadIntrinsicTypeData() + { + s_intrinsicData = new Map(); + s_intrinsicData[4294967294U] = new DllLoadResult.IntrinsicTypeData(BooleanSchema.Type); + s_intrinsicData[4294967293U] = new DllLoadResult.IntrinsicTypeData(ByteSchema.Type); + s_intrinsicData[4294967292U] = new DllLoadResult.IntrinsicTypeData(DoubleSchema.Type); + s_intrinsicData[4294967285U] = new DllLoadResult.IntrinsicTypeData(ListSchema.Type, typeof(DllProxyList)); + s_intrinsicData[4294967284U] = new DllLoadResult.IntrinsicTypeData(ImageSchema.Type); + s_intrinsicData[4294967283U] = new DllLoadResult.IntrinsicTypeData(Int32Schema.Type); + s_intrinsicData[4294967282U] = new DllLoadResult.IntrinsicTypeData(Int64Schema.Type); + s_intrinsicData[4294967280U] = new DllLoadResult.IntrinsicTypeData(ObjectSchema.Type); + s_intrinsicData[4294967279U] = new DllLoadResult.IntrinsicTypeData(SingleSchema.Type); + s_intrinsicData[4294967278U] = new DllLoadResult.IntrinsicTypeData(StringSchema.Type); + s_intrinsicData[4294967277U] = new DllLoadResult.IntrinsicTypeData(VoidSchema.Type); + } + + public static void Shutdown() => DllProxyServices.Shutdown(); + + public static bool CheckNativeReturn(uint hr, string interfaceName) + { + if ((int)hr >= 0) + return true; + ErrorManager.ReportError("Schema API failure: A method on '{0}' failed with code '0x{1:X8}'", interfaceName, hr); + return false; + } + + private bool CheckNativeReturn(uint hr) => CheckNativeReturn(hr, "IUIXTypeSchema"); + + public static void PushContext(LoadResult newContext) => s_objectContext = newContext; + + public static LoadResult CurrentContext => s_objectContext; + + public static void PopContext() => s_objectContext = null; + + public static TypeSchema MapType(uint typeID) + { + uint schemaComponent = UIXID.GetSchemaComponent(typeID); + TypeSchema typeSchema = null; + DllLoadResult dllLoadResult = null; + if (schemaComponent != ushort.MaxValue) + { + dllLoadResult = DllLoadResultFactory.GetLoadResultByID(schemaComponent); + if (dllLoadResult != null) + typeSchema = dllLoadResult.MapLocalType(typeID); + } + else if (CurrentContext is DllLoadResult currentContext) + typeSchema = currentContext.MapIntrinsicType(typeID); + if (typeSchema == null) + ErrorManager.ReportError("Unable to find type with ID '0x{0:X8}' in '{1}'", typeID, dllLoadResult != null ? dllLoadResult.Uri : string.Empty); + return typeSchema; + } + + private TypeSchema MapIntrinsicType(uint typeID) + { + if (_intrinsicTypes == null) + _intrinsicTypes = new Map(); + TypeSchema typeSchema; + DllLoadResult.IntrinsicTypeData intrinsicTypeData; + if (!_intrinsicTypes.TryGetValue(typeID, out typeSchema) && s_intrinsicData.TryGetValue(typeID, out intrinsicTypeData)) + { + typeSchema = !intrinsicTypeData.DemandCreateTypeSchema ? intrinsicTypeData.FrameworkEquivalent : new DllIntrinsicTypeSchema(this, typeID, intrinsicTypeData.FrameworkEquivalent); + _intrinsicTypes[typeID] = typeSchema; + } + return typeSchema; + } + + private TypeSchema MapLocalType(uint typeID) + { + TypeSchema typeSchema = null; + _userDefinedTypes.TryGetValue(typeID, out typeSchema); + return typeSchema; + } + + public DllLoadResult(DllLoadResultFactory sourceFactory, IntPtr nativeSchema, string uri) + : base(uri) + { + _source = sourceFactory; + _status = LoadResultStatus.Loading; + _schema = nativeSchema; + _loadPass = LoadPass.Invalid; + _component = s_nextID++; + } + + public override void Load(LoadPass pass) + { + if (pass <= _loadPass || pass != LoadPass.DeclareTypes) + return; + _status = !SetSchemaID() || !LoadTypes() ? LoadResultStatus.Error : LoadResultStatus.Success; + _loadPass = LoadPass.Done; + } + + public ushort SchemaComponent => _component; + + private bool SetSchemaID() => CheckNativeReturn(NativeApi.SpSetSchemaID(_schema, SchemaComponent)); + + private bool LoadTypes() + { + bool flag = false; + UIXIDVerifier idVerifier = new UIXIDVerifier(this); + uint typeCount; + uint enumCount; + if (CheckNativeReturn(NativeApi.SpQueryTypeCount(_schema, out typeCount)) && CheckNativeReturn(NativeApi.SpQueryEnumCount(_schema, out enumCount))) + { + int capacity = (int)typeCount + (int)enumCount; + if (capacity > 0) + { + _userDefinedTypes = new Map(capacity); + if (!LoadClasses(typeCount, idVerifier) || !LoadEnums(enumCount, idVerifier) || !ResolveTypes(idVerifier)) + goto label_4; + } + flag = true; + } + label_4: + return flag; + } + + private bool LoadClasses(uint numClasses, UIXIDVerifier idVerifier) + { + bool flag = false; + if (numClasses > 0U) + { + for (uint index = 0; index < numClasses; ++index) + { + if (!GetTypeSchema(index, idVerifier)) + flag = true; + } + } + return !flag; + } + + private bool GetTypeSchema(uint index, UIXIDVerifier idVerifier) + { + bool flag = false; + IntPtr type; + uint ID; + if (CheckNativeReturn(NativeApi.SpGetTypeSchema(_schema, index, out type, out ID))) + { + if (type != IntPtr.Zero) + { + StoreType(new DllTypeSchema(this, ID, type), ID, true, idVerifier); + flag = idVerifier.RegisterID(ID); + } + else + ErrorManager.ReportError("NULL object returned from {0}", "IUIXSchema::GetType"); + } + return flag; + } + + private void StoreType(TypeSchema schema, uint ID, bool isClass, UIXIDVerifier idVerifier) => _userDefinedTypes[ID] = schema; + + private static void DEBUG_DumpType(object param) + { + } + + private bool LoadEnums(uint numEnums, UIXIDVerifier idVerifier) + { + bool flag = false; + if (numEnums > 0U) + { + for (uint index = 0; index < numEnums; ++index) + { + if (!GetEnumSchema(index, idVerifier)) + flag = true; + } + } + return !flag; + } + + private bool GetEnumSchema(uint index, UIXIDVerifier idVerifier) + { + bool flag = false; + IntPtr enumType; + uint ID; + if (CheckNativeReturn(NativeApi.SpGetEnumSchema(_schema, index, out enumType, out ID))) + { + if (enumType != IntPtr.Zero) + { + StoreType(new DllEnumSchema(this, ID, enumType), ID, false, idVerifier); + flag = idVerifier.RegisterID(ID); + } + else + ErrorManager.ReportError("NULL object returned from {0}", "IUIXSchema::GetEnum"); + } + return flag; + } + + private bool ResolveTypes(UIXIDVerifier idVerifier) + { + bool flag = false; + if (_userDefinedTypes != null && _userDefinedTypes.Count > 0) + { + foreach (TypeSchema typeSchema in _userDefinedTypes.Values) + { + switch (typeSchema) + { + case DllTypeSchema dllTypeSchema: + if (!dllTypeSchema.Load(idVerifier)) + { + flag = true; + continue; + } + continue; + case DllEnumSchema dllEnumSchema: + if (!dllEnumSchema.Load()) + { + flag = true; + continue; + } + continue; + default: + flag = true; + continue; + } + } + } + return !flag; + } + + private static void DEBUG_DumpEnum(object param) + { + } + + protected override void OnDispose() + { + base.OnDispose(); + if (_userDefinedTypes != null && _userDefinedTypes.Count > 0) + { + foreach (DisposableObject disposableObject in _userDefinedTypes.Values) + disposableObject.Dispose(this); + } + if (_intrinsicTypes != null && _intrinsicTypes.Count > 0) + { + foreach (TypeSchema typeSchema in _intrinsicTypes.Values) + { + if (typeSchema is DllIntrinsicTypeSchema intrinsicTypeSchema) + intrinsicTypeSchema.Dispose(this); + } + } + NativeApi.SpReleaseExternalObject(_schema); + _schema = IntPtr.Zero; + _source.NotifyLoadResultDisposed(this); + } + + public override TypeSchema FindType(string name) + { + if (_userDefinedTypes != null && _userDefinedTypes.Count > 0) + { + foreach (TypeSchema typeSchema in _userDefinedTypes.Values) + { + if (typeSchema.Name == name) + return typeSchema; + } + } + return null; + } + + public override LoadResultStatus Status => _status; + + public override LoadResult[] Dependencies => EmptyList; + + public override bool Cachable => true; + + public static Type RuntimeTypeForMarshalAs(uint marshalAs) + { + Type type = null; + if (marshalAs == uint.MaxValue) + { + type = typeof(DllProxyObject); + } + else + { + DllLoadResult.IntrinsicTypeData intrinsicTypeData; + if (s_intrinsicData.TryGetValue(marshalAs, out intrinsicTypeData)) + type = intrinsicTypeData.MarshalAsRuntimeType; + } + return type; + } + + private class IntrinsicTypeData + { + private TypeSchema _frameworkType; + private Type _runtimeType; + + public IntrinsicTypeData(TypeSchema frameworkEquivalent) + : this(frameworkEquivalent, null) + { + } + + public IntrinsicTypeData(TypeSchema frameworkEquivalent, Type runtimeMarshalAsType) + { + _frameworkType = frameworkEquivalent; + _runtimeType = runtimeMarshalAsType; + } + + public TypeSchema FrameworkEquivalent => _frameworkType; + + public Type MarshalAsRuntimeType => _runtimeType; + + public bool DemandCreateTypeSchema => MarshalAsRuntimeType != null; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResultFactory.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResultFactory.cs new file mode 100644 index 0000000..2821060 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllLoadResultFactory.cs @@ -0,0 +1,118 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllLoadResultFactory +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllLoadResultFactory : SharedDisposableObject + { + private const string c_DllProtocol = "dll://"; + private string _dllName; + private IntPtr _module; + private IntPtr _schemaFactory; + private static Map s_loadResultCache = new Map(); + private static Map s_loadResultIDCache = new Map(); + private static Map s_dllFactoriesCache = new Map(); + + public static void Startup() => MarkupSystem.RegisterFactoryByProtocol("dll://", new CreateLoadResultHandler(GetLoadResult)); + + public static DllLoadResult GetLoadResultByID(uint id) + { + DllLoadResult dllLoadResult; + s_loadResultIDCache.TryGetValue(id, out dllLoadResult); + return dllLoadResult; + } + + private static LoadResult GetLoadResult(string uri) + { + DllLoadResult dllLoadResult; + if (s_loadResultCache.TryGetValue(uri, out dllLoadResult)) + return dllLoadResult; + int length = uri.IndexOf('!'); + string str; + string qualifier; + if (length != -1) + { + str = uri.Substring("dll://".Length, length); + qualifier = uri.Substring(length + 1); + } + else + { + str = uri.Substring("dll://".Length); + qualifier = null; + } + DllLoadResultFactory loadResultFactory; + if (!s_dllFactoriesCache.TryGetValue(str, out loadResultFactory)) + { + loadResultFactory = new DllLoadResultFactory(str); + s_dllFactoriesCache[str] = loadResultFactory; + } + DllLoadResult loadResult = loadResultFactory.GetLoadResult(uri, qualifier); + if (loadResult != null) + { + s_loadResultCache[uri] = loadResult; + s_loadResultIDCache[loadResult.SchemaComponent] = loadResult; + } + return loadResult; + } + + private DllLoadResultFactory(string dllName) + { + _dllName = dllName; + int num = (int)NativeApi.SpLoadDll(_dllName, out _module); + if ((int)NativeApi.SpCreateDllLoadResultFactory(_module, out _schemaFactory) >= 0) + return; + ErrorManager.ReportError("Unable to create IUIXSchemaFactory from '{0}'", dllName); + } + + protected override void OnDispose() + { + base.OnDispose(); + s_dllFactoriesCache.Remove(_dllName); + if (_schemaFactory != IntPtr.Zero) + { + NativeApi.SpReleaseExternalObject(_schemaFactory); + _schemaFactory = IntPtr.Zero; + } + if (!(_module != IntPtr.Zero)) + return; + NativeApi.SpSendDllSchemaUnloadNotification(_module); + NativeApi.SpFreeDll(_module); + _module = IntPtr.Zero; + } + + private DllLoadResult GetLoadResult(string fullUri, string qualifier) + { + DllLoadResult dllLoadResult = null; + IntPtr loadResult = IntPtr.Zero; + if (_schemaFactory != IntPtr.Zero) + { + if ((int)NativeApi.SpCreateDllLoadResult(_schemaFactory, qualifier, out loadResult) < 0) + ErrorManager.ReportError("Unable to create IUIXSchema from '{0}'", fullUri); + else if (loadResult != IntPtr.Zero) + { + dllLoadResult = new DllLoadResult(this, loadResult, fullUri); + RegisterUsage(dllLoadResult); + } + else + ErrorManager.ReportError("NULL object returned from {0}", "IUIXSchemaFactory::GetSchema"); + } + return dllLoadResult; + } + + public void NotifyLoadResultDisposed(DllLoadResult loadResult) + { + s_loadResultCache.Remove(loadResult.Uri); + s_loadResultIDCache.Remove(loadResult.SchemaComponent); + UnregisterUsage(loadResult); + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllMethodSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllMethodSchema.cs new file mode 100644 index 0000000..7f9d88e --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllMethodSchema.cs @@ -0,0 +1,128 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllMethodSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllMethodSchema : MethodSchema + { + private bool _isStatic; + private TypeSchema _returnType; + private TypeSchema[] _parameterTypes; + private string _name; + private uint _id; + + public DllMethodSchema(DllTypeSchema owner, uint ID) + : base(owner) + => _id = ID; + + public bool Load(IntPtr method) => QueryMethodName(method) && QueryForParameterTypes(method) && QueryReturnType(method) && QueryIsStatic(method); + + public uint ID => _id; + + [Conditional("DEBUG")] + public void DEBUG_Dump() + { + string str1 = string.Empty; + if (IsStatic) + str1 = "static "; + string str2 = "void"; + if (ReturnType != null) + str2 = ReturnType.Name; + string str3 = string.Empty; + if (_parameterTypes != null) + { + for (int index = 0; index < _parameterTypes.Length; ++index) + { + string str4 = ""; + if (_parameterTypes[index] != null) + str4 = _parameterTypes[index].Name; + str3 = string.Format("{0}{1}{2}", str3, index > 0 ? ", " : string.Empty, str4); + } + } + string.Format("0x{0:x8} {1}{2} {3}({4})", _id, str1, str2, Name, str3); + } + + public override string Name => _name; + + public override TypeSchema[] ParameterTypes => _parameterTypes; + + public override TypeSchema ReturnType => _returnType; + + public override bool IsStatic => _isStatic; + + private DllTypeSchema OwnerTypeSchema => (DllTypeSchema)Owner; + + public override object Invoke(object instance, object[] parameters) => OwnerTypeSchema.InvokeMethod(instance, this, parameters); + + private DllLoadResult OwnerLoadResult => (DllLoadResult)Owner.Owner; + + private unsafe bool QueryMethodName(IntPtr method) + { + bool flag = false; + char* name; + if (CheckNativeReturn(NativeApi.SpQueryMethodName(method, out name))) + { + _name = new string(name); + flag = true; + } + return flag; + } + + private bool QueryForParameterTypes(IntPtr method) + { + bool flag1 = false; + uint count; + if (CheckNativeReturn(NativeApi.SpQueryMethodParameterCount(method, out count))) + { + if (count > 0U) + { + uint[] IDs = new uint[(int)count]; + if (CheckNativeReturn(NativeApi.SpGetMethodParameterTypes(method, IDs, count))) + { + _parameterTypes = new TypeSchema[(int)count]; + bool flag2 = false; + for (uint index = 0; index < count; ++index) + { + TypeSchema typeSchema = DllLoadResult.MapType(IDs[index]); + if (typeSchema != null) + _parameterTypes[index] = typeSchema; + else + flag2 = true; + } + flag1 = !flag2; + } + } + else + { + _parameterTypes = TypeSchema.EmptyList; + flag1 = true; + } + } + return flag1; + } + + private bool QueryReturnType(IntPtr method) + { + bool flag = false; + uint type; + if (CheckNativeReturn(NativeApi.SpQueryMethodReturnType(method, out type))) + { + _returnType = DllLoadResult.MapType(type); + flag = _returnType != null; + } + return flag; + } + + private bool QueryIsStatic(IntPtr method) => CheckNativeReturn(NativeApi.SpQueryMethodIsStatic(method, out _isStatic)); + + private bool CheckNativeReturn(uint hr) => DllLoadResult.CheckNativeReturn(hr, "IUIXMethod"); + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllPropertySchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllPropertySchema.cs new file mode 100644 index 0000000..2b84047 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllPropertySchema.cs @@ -0,0 +1,165 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllPropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using System; +using System.Collections.Specialized; +using System.Diagnostics; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllPropertySchema : PropertySchema + { + private BitVector32 _bits; + private string _name; + private TypeSchema _type; + private uint _id; + + public DllPropertySchema(DllTypeSchema owner, uint ID) + : base(owner) + => _id = ID; + + public bool Load(IntPtr property) => QueryPropertyName(property) && QueryPropertyType(property) && (QueryCanRead(property) && QueryCanWrite(property)) && QueryIsStatic(property) && QueryNotifiesOnChange(property); + + public uint ID => _id; + + [Conditional("DEBUG")] + public void DEBUG_Dump() + { + string str1 = string.Empty; + if (IsStatic) + str1 = "static "; + string str2 = ""; + if (PropertyType != null) + str2 = PropertyType.Name; + string str3 = string.Empty; + if (CanRead) + str3 = "get;"; + string str4 = string.Empty; + if (CanWrite) + str4 = string.Format("{0}set;", CanRead ? " " : string.Empty); + string str5 = ""; + if (!NotifiesOnChange) + str5 = ""; + string.Format("0x{0:x8} {1}{2} {3} {{{4}{5}}} {6}", _id, str1, str2, Name, str3, str4, str5); + } + + public override string Name => _name; + + public override TypeSchema PropertyType => _type; + + public override TypeSchema AlternateType => (TypeSchema)null; + + public override bool CanRead => GetBit(Bits.CanRead); + + public override bool CanWrite => GetBit(Bits.CanWrite); + + public override bool IsStatic => GetBit(Bits.IsStatic); + + public override ExpressionRestriction ExpressionRestriction => ExpressionRestriction.None; + + public override bool RequiredForCreation => false; + + public override RangeValidator RangeValidator => (RangeValidator)null; + + public override bool NotifiesOnChange => GetBit(Bits.NotifiesOnChange); + + private DllTypeSchema OwnerTypeSchema => (DllTypeSchema)Owner; + + public override object GetValue(object instance) => OwnerTypeSchema.GetPropertyValue(instance, this); + + public override void SetValue(ref object instance, object value) => OwnerTypeSchema.SetPropertyValue(instance, this, value); + + private DllLoadResult OwnerLoadResult => (DllLoadResult)Owner.Owner; + + private unsafe bool QueryPropertyName(IntPtr property) + { + bool flag = false; + char* name; + if (CheckNativeReturn(NativeApi.SpQueryPropertyName(property, out name))) + { + _name = NotifyService.CanonicalizeString(new string(name)); + flag = true; + } + return flag; + } + + private bool QueryPropertyType(IntPtr property) + { + bool flag = false; + uint type; + if (CheckNativeReturn(NativeApi.SpQueryPropertyType(property, out type))) + { + _type = DllLoadResult.MapType(type); + flag = true; + } + return flag; + } + + private bool QueryCanRead(IntPtr property) + { + bool flag = false; + bool canRead; + if (CheckNativeReturn(NativeApi.SpQueryPropertyCanRead(property, out canRead))) + { + SetBit(Bits.CanRead, canRead); + flag = true; + } + return flag; + } + + private bool QueryCanWrite(IntPtr property) + { + bool flag = false; + bool canWrite; + if (CheckNativeReturn(NativeApi.SpQueryPropertyCanWrite(property, out canWrite))) + { + SetBit(Bits.CanWrite, canWrite); + flag = true; + } + return flag; + } + + private bool QueryIsStatic(IntPtr property) + { + bool flag = false; + bool isStatic; + if (CheckNativeReturn(NativeApi.SpQueryPropertyIsStatic(property, out isStatic))) + { + SetBit(Bits.IsStatic, isStatic); + flag = true; + } + return flag; + } + + private bool CheckNativeReturn(uint hr) => DllLoadResult.CheckNativeReturn(hr, "IUIXProperty"); + + private bool QueryNotifiesOnChange(IntPtr property) + { + bool flag = false; + bool notifiesOnChange; + if (CheckNativeReturn(NativeApi.SpQueryPropertyNotifiesOnChange(property, out notifiesOnChange))) + { + SetBit(Bits.NotifiesOnChange, notifiesOnChange); + flag = true; + } + return flag; + } + + private bool GetBit(DllPropertySchema.Bits lookupBit) => _bits[(int)lookupBit]; + + private void SetBit(DllPropertySchema.Bits changeBit, bool value) => _bits[(int)changeBit] = value; + + private enum Bits : uint + { + CanRead = 1, + CanWrite = 2, + IsStatic = 4, + NotifiesOnChange = 8, + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyHandleTable.cs new file mode 100644 index 0000000..cb27d8d --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyHandleTable.cs @@ -0,0 +1,61 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllProxyHandleTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllProxyHandleTable : ProxyHandleTable + { + public DllProxyHandleTable.DllProxyHandleTableEnumerator GetEnumerator() => new DllProxyHandleTable.DllProxyHandleTableEnumerator(GetTableEnumerator()); + + public ulong RegisterProxy(object d) => AllocateHandle(new DllProxyObjectReference() + { + Value = d + }); + + public void ReleaseProxy(ulong handle) + { + DllProxyObjectReference oldValue; + ReleaseHandle(handle, out oldValue); + oldValue.Value = null; + } + + protected bool LookupByHandleWorker(ulong handle, out object obj) + { + DllProxyObjectReference proxyObjectReference; + bool flag = InternalLookupByHandle(handle, out proxyObjectReference); + obj = !flag ? null : proxyObjectReference.Value; + return flag; + } + + internal struct DllProxyHandleTableEnumerator : IEnumerator + { + private ProxyHandleTable.ProxyHandleTableEnumerator _enumerator; + + public DllProxyHandleTableEnumerator( + ProxyHandleTable.ProxyHandleTableEnumerator enumerator) + { + _enumerator = enumerator; + } + + public bool MoveNext() + { + bool flag; + do + { + flag = _enumerator.MoveNext(); + } + while ((!flag || _enumerator.Current.Value == null) && flag); + return flag; + } + + public object Current => _enumerator.Current.Value; + + public void Reset() => _enumerator.Reset(); + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyList.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyList.cs new file mode 100644 index 0000000..0107a5b --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyList.cs @@ -0,0 +1,319 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllProxyList +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using Microsoft.Iris.ViewItems; +using System; +using System.Collections; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllProxyList : + DllInterfaceProxy, + IVirtualList, + INotifyList, + IList, + ICollection, + IEnumerable, + IUIXListCallbacks + { + private UpdateHelper _updater; + private Repeater _repeater; + private bool _wantSlowDataRequests; + private bool _callbacksRegistered; + private SlowDataAcquireCompleteHandler _slowDataAcquireCompleteHandler; + private UIListContentsChangedHandler _contentsChanged; + + protected override void LoadWorker(IntPtr nativeObject, IntPtr nativeMarshalAs) + { + base.LoadWorker(nativeObject, nativeMarshalAs); + NativeApi.SUCCEEDED(NativeApi.SpUIXListWantSlowDataRequests(_interface, out _wantSlowDataRequests)); + if (!_wantSlowDataRequests) + return; + _updater = new UpdateHelper(this); + } + + protected override void OnDispose() + { + UpdateCallbackRegistration(true); + base.OnDispose(); + } + + public unsafe int Add(object value) + { + int count = 0; + UIXVariant uixVariant; + UIXVariant.MarshalObject(value, &uixVariant); + NativeApi.SUCCEEDED(NativeApi.SpUIXListAdd(_interface, &uixVariant, out count)); + UIXVariant.CleanupMarshalledObject(&uixVariant); + return count; + } + + public bool Contains(object value) => IndexOf(value) >= 0; + + public unsafe int IndexOf(object value) + { + int index = -1; + UIXVariant uixVariant; + UIXVariant.MarshalObject(value, &uixVariant); + NativeApi.SUCCEEDED(NativeApi.SpUIXListIndexOf(_interface, &uixVariant, out index)); + UIXVariant.CleanupMarshalledObject(&uixVariant); + return index; + } + + public void Clear() => NativeApi.SUCCEEDED(NativeApi.SpUIXListClear(_interface)); + + public unsafe void Insert(int index, object value) + { + UIXVariant uixVariant; + UIXVariant.MarshalObject(value, &uixVariant); + NativeApi.SUCCEEDED(NativeApi.SpUIXListInsert(_interface, index, &uixVariant)); + UIXVariant.CleanupMarshalledObject(&uixVariant); + } + + public unsafe void Remove(object value) + { + UIXVariant uixVariant; + UIXVariant.MarshalObject(value, &uixVariant); + NativeApi.SUCCEEDED(NativeApi.SpUIXListRemove(_interface, &uixVariant)); + UIXVariant.CleanupMarshalledObject(&uixVariant); + } + + public void RemoveAt(int index) => NativeApi.SUCCEEDED(NativeApi.SpUIXListRemoveAt(_interface, index)); + + public void CopyTo(Array array, int index) => throw new NotImplementedException(); + + public int Count + { + get + { + int count = 0; + NativeApi.SUCCEEDED(NativeApi.SpUIXListGetCount(_interface, out count)); + return count; + } + } + + public bool IsFixedSize => false; + + public bool IsReadOnly => false; + + public bool IsSynchronized => false; + + bool IVirtualList.IsItemAvailable(int index) + { + bool isAvailable; + NativeApi.SUCCEEDED(NativeApi.SpUIXListIsItemAvailable(_interface, index, out isAvailable)); + return isAvailable; + } + + public void RequestItem(int index, ItemRequestCallback callback) + { + object obj = this[index]; + callback(this, index, obj); + } + + public unsafe object this[int index] + { + get + { + object obj = null; + UIXVariant inboundObject; + if (NativeApi.SUCCEEDED(NativeApi.SpUIXListGetItem(_interface, index, out inboundObject))) + obj = UIXVariant.GetValue(inboundObject, OwningLoadResult); + return obj; + } + set + { + UIXVariant uixVariant; + UIXVariant.MarshalObject(value, &uixVariant); + NativeApi.SUCCEEDED(NativeApi.SpUIXListSetItem(_interface, index, &uixVariant)); + UIXVariant.CleanupMarshalledObject(&uixVariant); + } + } + + public object SyncRoot => (object)null; + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + public StackIListEnumerator GetEnumerator() => new StackIListEnumerator(this); + + public event UIListContentsChangedHandler ContentsChanged + { + add + { + if (_contentsChanged == null) + UpdateCallbackRegistration(); + _contentsChanged += value; + } + remove + { + _contentsChanged -= value; + if (_contentsChanged != null) + return; + UpdateCallbackRegistration(); + } + } + + public void Move(int oldIndex, int newIndex) + { + int num = (int)NativeApi.SpUIXListMove(_interface, oldIndex, newIndex); + } + + public void ListChanged(int nativeType, int oldIndex, int newIndex, int count) + { + bool flag1 = true; + bool flag2 = true; + UIListContentsChangeType type = (UIListContentsChangeType)nativeType; + switch (type) + { + case UIListContentsChangeType.Add: + case UIListContentsChangeType.AddRange: + case UIListContentsChangeType.Remove: + case UIListContentsChangeType.Insert: + case UIListContentsChangeType.InsertRange: + case UIListContentsChangeType.Clear: + case UIListContentsChangeType.Reset: + if (!flag1) + break; + if (_contentsChanged != null) + _contentsChanged(this, new UIListContentsChangedArgs(type, oldIndex, newIndex, count)); + if (flag2) + FireNotification(NotificationID.Count); + if (_updater == null) + break; + ForwardListChangeToUpdater(type, oldIndex, newIndex, count); + break; + case UIListContentsChangeType.Move: + case UIListContentsChangeType.Modified: + flag2 = false; + goto case UIListContentsChangeType.Add; + default: + flag1 = false; + goto case UIListContentsChangeType.Add; + } + } + + private void ForwardListChangeToUpdater( + UIListContentsChangeType type, + int oldIndex, + int newIndex, + int count) + { + switch (type) + { + case UIListContentsChangeType.Remove: + _updater.RemoveIndex(oldIndex); + _updater.AdjustIndices(oldIndex, -1); + break; + case UIListContentsChangeType.Move: + int lowThreshold; + int highThreshold; + int amt; + if (oldIndex < newIndex) + { + lowThreshold = oldIndex; + highThreshold = newIndex; + amt = -1; + } + else + { + lowThreshold = newIndex; + highThreshold = oldIndex; + amt = 1; + } + _updater.RemoveIndex(oldIndex); + _updater.AdjustIndices(lowThreshold, highThreshold, amt); + _updater.AddIndex(newIndex); + break; + case UIListContentsChangeType.Insert: + _updater.AdjustIndices(newIndex, 1); + break; + case UIListContentsChangeType.InsertRange: + _updater.AdjustIndices(newIndex, count); + break; + case UIListContentsChangeType.Clear: + case UIListContentsChangeType.Reset: + _updater.Clear(); + break; + } + } + + public bool SlowDataRequestsEnabled => _wantSlowDataRequests; + + public void NotifyRequestSlowData(int index) => NativeApi.SUCCEEDED(NativeApi.SpUIXListFetchSlowData(_interface, index)); + + public void SlowDataAcquireComplete(int index) + { + bool flag = false; + if (_slowDataAcquireCompleteHandler != null) + flag = _slowDataAcquireCompleteHandler(this, index); + if (flag) + return; + _updater.NotifySlowDataAcquireComplete(index); + } + + public SlowDataAcquireCompleteHandler SlowDataAcquireCompleteHandler + { + get => _slowDataAcquireCompleteHandler; + set + { + if (!(value != _slowDataAcquireCompleteHandler)) + return; + _slowDataAcquireCompleteHandler = value; + UpdateCallbackRegistration(); + } + } + + public void NotifyVisualsCreated(int index) + { + if (_updater != null) + _updater.AddIndex(index); + NativeApi.SUCCEEDED(NativeApi.SpUIXListNotifyVisualsCreated(_interface, index)); + } + + public void NotifyVisualsReleased(int index) + { + if (_updater != null) + _updater.RemoveIndex(index); + NativeApi.SUCCEEDED(NativeApi.SpUIXListNotifyVisualsReleased(_interface, index)); + } + + public Repeater RepeaterHost + { + get => _repeater; + set + { + if (value == _repeater) + return; + _repeater = value; + UpdateCallbackRegistration(); + } + } + + private void UpdateCallbackRegistration() => UpdateCallbackRegistration(false); + + private void UpdateCallbackRegistration(bool inDispose) + { + bool flag = (_slowDataAcquireCompleteHandler != null || _contentsChanged != null || _repeater != null) & !inDispose; + if (flag == _callbacksRegistered) + return; + if (flag) + { + int num1 = (int)NativeApi.SpUIXListRegisterCallbacks(_interface, this); + } + else + { + int num2 = (int)NativeApi.SpUIXListUnregisterCallbacks(_interface, this); + if (_updater != null) + _updater.Clear(); + } + _callbacksRegistered = flag; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObject.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObject.cs new file mode 100644 index 0000000..9fb63ba --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObject.cs @@ -0,0 +1,272 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllProxyObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using Microsoft.Iris.RenderAPI; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllProxyObject : NotifyObjectBase, ISchemaInfo, IDisposableObject + { + private IntPtr _nativeObject; + private ulong _handle; + private DllTypeSchemaBase _type; + private static object s_finalizeLock = new object(); + private static bool s_pendingAppThreadRelease = false; + private static Vector s_pendingReleases; + private static SimpleCallback s_releaseOnAppThread = new SimpleCallback(ReleaseFinalizedObjects); + private static DllProxyObjectHandleTable s_handleTable; + + public static void CreateHandleTable() => s_handleTable = new DllProxyObjectHandleTable(); + + public static void ReleaseOutstandingProxies() + { + s_pendingAppThreadRelease = true; + GC.Collect(); + GC.WaitForPendingFinalizers(); + foreach (IDisposableObject disposableObject in s_handleTable) + disposableObject.Dispose(disposableObject); + ReleaseFinalizedObjects(); + } + + public static DllProxyObject Wrap(IntPtr nativeObject) + { + DllProxyObject dllProxyObject = null; + uint typeID; + if (!NativeApi.SUCCEEDED(NativeApi.SpGetTypeID(nativeObject, out typeID))) + return null; + TypeSchema type = DllLoadResult.MapType(typeID); + if (type != null) + { + dllProxyObject = GetExistingProxy(nativeObject) ?? WrapNewObject(nativeObject, type); + NativeApi.SpReleaseExternalObject(nativeObject); + } + return dllProxyObject; + } + + private static DllProxyObject GetExistingProxy(IntPtr nativeObject) + { + DllProxyObject dllProxyObject = null; + ulong state; + NativeApi.SpGetStateCache(nativeObject, out state); + if (state != 0UL && !s_handleTable.LookupByHandle(state, out dllProxyObject)) + ErrorManager.ReportError("IUIXObject::GetStateCache retrieved unexpected value"); + return dllProxyObject; + } + + private static DllProxyObject WrapNewObject(IntPtr nativeObject, TypeSchema type) + { + DllProxyObject dllProxyObject = null; + uint marshalAs; + IntPtr nativeImpl; + if (DetermineProxyInterfaceForObject(nativeObject, type, out marshalAs, out nativeImpl)) + { + switch (marshalAs) + { + case 4294967281: + case 4294967286: + case 4294967287: + case 4294967288: + case 4294967289: + case 4294967290: + case 4294967291: + dllProxyObject = new DllProxyObject(); + break; + case 4294967285: + dllProxyObject = new DllProxyList(); + break; + case uint.MaxValue: + dllProxyObject = new DllProxyObject(); + break; + default: + dllProxyObject = new DllProxyObject(); + break; + } + dllProxyObject.Load(nativeObject, nativeImpl, (DllTypeSchemaBase)type); + } + return dllProxyObject; + } + + private static bool DetermineProxyInterfaceForObject( + IntPtr nativeObject, + TypeSchema type, + out uint marshalAs, + out IntPtr nativeImpl) + { + bool flag = false; + DllTypeSchemaBase dllTypeSchemaBase = (DllTypeSchemaBase)type; + marshalAs = dllTypeSchemaBase.MarshalAs; + if (marshalAs == uint.MaxValue) + { + flag = true; + nativeImpl = IntPtr.Zero; + } + else if (CheckNativeReturn(NativeApi.SpQueryForMarshalAsInterface(nativeObject, marshalAs, out nativeImpl)) && nativeImpl != IntPtr.Zero) + flag = true; + else + ErrorManager.ReportError("Object didn't implement expected interface '{0}'", marshalAs); + return flag; + } + + protected DllProxyObject() => _handle = 0UL; + + ~DllProxyObject() => RegisterAppThreadRelease(new DllProxyObject.AppThreadReleaseEntry(_nativeObject, _handle, OwningLoadResult)); + + protected static void RegisterAppThreadRelease(DllProxyObject.AppThreadReleaseEntry entry) + { + lock (s_finalizeLock) + { + if (s_pendingReleases == null) + s_pendingReleases = new Vector(); + s_pendingReleases.Add(entry); + if (s_pendingAppThreadRelease) + return; + s_pendingAppThreadRelease = true; + DeferredCall.Post(DispatchPriority.Idle, s_releaseOnAppThread); + } + } + + private void Load(IntPtr nativeObject, IntPtr marshalAs, DllTypeSchemaBase type) + { + _type = type; + _nativeObject = nativeObject; + OwningLoadResult.RegisterProxyUsage(); + _handle = s_handleTable.RegisterProxy(this); + NativeApi.SpSetStateCache(_nativeObject, _handle); + NativeApi.SpAddRefExternalObject(_nativeObject); + LoadWorker(nativeObject, marshalAs); + } + + protected virtual void LoadWorker(IntPtr nativeObject, IntPtr nativeMarshalAs) + { + } + + public static HRESULT OnChangeNotification(IntPtr nativeObject, uint id) + { + HRESULT hresult = new HRESULT(0); + DllProxyObject existingProxy = GetExistingProxy(nativeObject); + if (existingProxy != null) + { + string id1 = null; + if (existingProxy._type is DllTypeSchema type) + id1 = type.MapChangeID(id); + if (id1 != null) + { + existingProxy.FireNotification(id1); + } + else + { + ErrorManager.ReportError("Invalid UIXID '0x{0:X8}' passed to NotifyChange", id); + hresult = new HRESULT(-2147024809); + } + } + return hresult; + } + + public ulong Handle => _handle; + + public IntPtr NativeObject => _nativeObject; + + public TypeSchema TypeSchema => _type; + + protected DllLoadResult OwningLoadResult => _type.Owner as DllLoadResult; + + private static bool CheckNativeReturn(uint hr) => DllLoadResult.CheckNativeReturn(hr, "IUIXObject"); + + bool IDisposableObject.IsDisposed => _nativeObject == IntPtr.Zero; + + void IDisposableObject.DeclareOwner(object owner) + { + } + + void IDisposableObject.TransferOwnership(object owner) + { + } + + void IDisposableObject.Dispose(object owner) + { + OnDispose(); + new DllProxyObject.AppThreadReleaseEntry(_nativeObject, _handle, OwningLoadResult).Release(); + GC.SuppressFinalize(this); + } + + protected virtual void OnDispose() + { + } + + private static void ReleaseFinalizedObjects() + { + Vector pendingReleases; + lock (s_finalizeLock) + { + pendingReleases = s_pendingReleases; + s_pendingReleases = null; + s_pendingAppThreadRelease = false; + } + if (pendingReleases == null || pendingReleases.Count == 0) + return; + foreach (DllProxyObject.AppThreadReleaseEntry threadReleaseEntry in pendingReleases) + threadReleaseEntry.Release(); + lock (s_finalizeLock) + { + if (s_pendingAppThreadRelease) + return; + pendingReleases.Clear(); + s_pendingReleases = pendingReleases; + } + } + + private static string DEBUG_FormatIntPtr(IntPtr ptr) => (string)null; + + public string DEBUG_Description() => string.Empty; + + public override string ToString() => _type is DllTypeSchema type ? type.InvokeToString(this) : GetType().Name; + + internal struct AppThreadReleaseEntry + { + private bool _releaseHandle; + public IntPtr _nativeObject; + public ulong _handle; + public DllLoadResult _loadResult; + + public AppThreadReleaseEntry(IntPtr nativeObject, ulong handle, DllLoadResult loadResult) + { + _nativeObject = nativeObject; + _handle = handle; + _loadResult = loadResult; + _releaseHandle = true; + } + + public AppThreadReleaseEntry(IntPtr nativeObject) + { + _nativeObject = nativeObject; + _releaseHandle = false; + _handle = 0UL; + _loadResult = null; + } + + public void Release() + { + if (_releaseHandle) + { + s_handleTable.ReleaseProxy(_handle); + ulong state; + NativeApi.SpGetStateCache(_nativeObject, out state); + if ((long)_handle == (long)state) + NativeApi.SpSetStateCache(_nativeObject, 0UL); + } + NativeApi.SpReleaseExternalObject(_nativeObject); + if (!_releaseHandle) + return; + _loadResult.UnregisterProxyUsage(); + } + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectHandleTable.cs new file mode 100644 index 0000000..7f6a493 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectHandleTable.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllProxyObjectHandleTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllProxyObjectHandleTable : DllProxyHandleTable + { + public bool LookupByHandle(ulong handle, out DllProxyObject obj) + { + object obj1; + bool flag = LookupByHandleWorker(handle, out obj1); + obj = (DllProxyObject)obj1; + return flag; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectReference.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectReference.cs new file mode 100644 index 0000000..82b8150 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyObjectReference.cs @@ -0,0 +1,42 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllProxyObjectReference +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal struct DllProxyObjectReference + { + private GCHandle _reference; + + public object Value + { + get + { + object obj = null; + if (_reference.IsAllocated) + obj = _reference.Target; + return obj; + } + set + { + if (value != null) + { + if (_reference.IsAllocated) + _reference.Target = value; + else + _reference = GCHandle.Alloc(value, GCHandleType.Weak); + } + else + { + if (!_reference.IsAllocated) + return; + _reference.Free(); + } + } + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyServices.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyServices.cs new file mode 100644 index 0000000..adc837c --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllProxyServices.cs @@ -0,0 +1,311 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllProxyServices +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI; +using Microsoft.Iris.Session; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllProxyServices : IRawUIXServices + { + private static StringProxyHandleTable s_stringTable; + + public static void Startup() + { + DllProxyObject.CreateHandleTable(); + s_stringTable = new StringProxyHandleTable(); + int num = (int)NativeApi.SpRegisterNativeServicesCallbacks(new DllProxyServices()); + } + + public static void Shutdown() + { + DllProxyObject.ReleaseOutstandingProxies(); + NativeMarkupDataType.ReleaseOutstandingProxies(); + NativeApi.SpUnregisterNativeServicesCallbacks(); + s_stringTable = null; + } + + HRESULT IRawUIXServices.NotifyChangeForObject( + IntPtr nativeObject, + uint changedID) + { + return DllProxyObject.OnChangeNotification(nativeObject, changedID); + } + + private static void Crash(string message) => throw new Exception(message); + + void IRawUIXServices.Crash(string message) => Crash(message); + + public static string GetString(IntPtr nativeStringObject) + { + string str = null; + if (nativeStringObject != IntPtr.Zero) + { + ulong handle; + NativeApi.SpGetStringHandle(nativeStringObject, out handle); + if (handle == 0UL) + NativeApi.SpConvertStringToManaged(nativeStringObject, out handle); + s_stringTable.LookupByHandle(handle, out str); + NativeApi.SpReleaseExternalObject(nativeStringObject); + } + return str; + } + + public static void CreateNativeString(string value, out IntPtr nativeObject) + { + nativeObject = IntPtr.Zero; + if (value == null || NativeApi.SpCreateNativeString(AllocateStringHandle(value), value.Length, out nativeObject)) + return; + Crash("Unable to allocate string"); + } + + unsafe ulong IRawUIXServices.AllocateString(char* value, out int length) + { + string str = new string(value); + length = str.Length; + return AllocateStringHandle(str); + } + + private static ulong AllocateStringHandle(string value) + { + ulong handle; + s_stringTable.GetStringHandle(value, out handle); + return handle; + } + + unsafe void IRawUIXServices.CopyString( + ulong handle, + char* target, + uint targetSize) + { + string source; + s_stringTable.LookupByHandle(handle, out source); + NativeApi.SpCopyString(source, target, targetSize); + } + + unsafe char* IRawUIXServices.PinString(ulong handle) + { + char* chPtr; + s_stringTable.PinString(handle, out chPtr); + return chPtr; + } + + void IRawUIXServices.UnpinString(ulong handle) => s_stringTable.UnpinString(handle); + + void IRawUIXServices.ReleaseString(ulong handle) => s_stringTable.ReleaseStringHandle(handle, out string _); + + public static UIImage GetImage(IntPtr nativeImageObject) + { + UIImage uiImage = null; + if (nativeImageObject != IntPtr.Zero) + { + ulong handle; + NativeApi.SpGetImageHandle(nativeImageObject, out handle); + if (handle == 0UL) + NativeApi.SpConvertImageToManaged(nativeImageObject, out handle); + uiImage = (UIImage)GCHandle.FromIntPtr(new IntPtr((long)handle)).Target; + NativeApi.SpReleaseExternalObject(nativeImageObject); + } + return uiImage; + } + + public static MarkupDataQuery GetDataQuery(IntPtr nativeQuery) + { + MarkupDataQuery markupDataQuery = null; + if (nativeQuery != IntPtr.Zero) + { + ulong frameworkQuery; + int internalHandle = (int)NativeApi.SpDataBaseObjectGetInternalHandle(nativeQuery, out frameworkQuery); + markupDataQuery = NativeMarkupDataQuery.LookupByHandle(frameworkQuery); + NativeApi.SpReleaseExternalObject(nativeQuery); + } + return markupDataQuery; + } + + public static MarkupDataType GetDataType(IntPtr nativeObject) + { + NativeMarkupDataType nativeMarkupDataType = null; + if (nativeObject != IntPtr.Zero) + { + ulong frameworkQuery; + int internalHandle = (int)NativeApi.SpDataBaseObjectGetInternalHandle(nativeObject, out frameworkQuery); + if (frameworkQuery != 0UL) + nativeMarkupDataType = NativeMarkupDataType.LookupByHandle(frameworkQuery); + if (nativeMarkupDataType == null) + { + ulong typeHandle; + NativeApi.SpDataBaseObjectGetTypeHandle(nativeObject, out typeHandle); + nativeMarkupDataType = NativeMarkupDataType.Create(typeHandle, nativeObject); + } + NativeApi.SpReleaseExternalObject(nativeObject); + } + return nativeMarkupDataType; + } + + public static void CreateNativeImage(UIImage image, out IntPtr nativeObject) + { + nativeObject = IntPtr.Zero; + if (image == null || !NativeApi.SpCreateNativeImage(GetImageHandle(image, image.Source), image.Source, out nativeObject).IsError()) + return; + Crash("Unable to allocate native image object"); + } + + private static ulong GetImageHandle(UIImage image, string source) => (ulong)GCHandle.ToIntPtr(GCHandle.Alloc(image)).ToInt64(); + + unsafe ulong IRawUIXServices.AllocateImageFromUri( + string uri, + NativeApi.IMAGE_DECODE_PARAMS* decodeParams) + { + Size maximumSize; + bool flippable; + bool antialiasEdges; + CrackDecodeParams(decodeParams, out maximumSize, out flippable, out antialiasEdges); + return GetImageHandle(new UriImage(uri, Inset.Zero, maximumSize, flippable, antialiasEdges), uri); + } + + unsafe ulong IRawUIXServices.AllocateImageFromBits( + string ID, + NativeApi.UIX_RAW_IMAGE_INFO* imageInfo, + NativeApi.IMAGE_DECODE_PARAMS* decodeParams) + { + SurfaceFormat surfaceFormat; + ImageFormatUtils.RawImageFormatToSurfaceFormat(imageInfo->format, out surfaceFormat); + Size maximumSize; + bool flippable; + bool antialiasEdges; + CrackDecodeParams(decodeParams, out maximumSize, out flippable, out antialiasEdges); + Size imageSize = new Size(imageInfo->width, imageInfo->height); + return GetImageHandle(new RawImage(ID, imageSize, imageInfo->stride, surfaceFormat, imageInfo->bits, true, Inset.Zero, maximumSize, flippable, antialiasEdges), ID); + } + + unsafe void IRawUIXServices.RemoveCachedImage( + string ID, + NativeApi.IMAGE_DECODE_PARAMS* decodeParams) + { + Size maximumSize; + bool flippable; + bool antialiasEdges; + CrackDecodeParams(decodeParams, out maximumSize, out flippable, out antialiasEdges); + UriImage.RemoveCache(ID, maximumSize, flippable, antialiasEdges); + } + + private static unsafe void CrackDecodeParams( + NativeApi.IMAGE_DECODE_PARAMS* decodeParams, + out Size maximumSize, + out bool flippable, + out bool antialiasEdges) + { + if ((IntPtr)decodeParams != IntPtr.Zero) + { + maximumSize = new Size(decodeParams->maximumWidth, decodeParams->maximumHeight); + flippable = decodeParams->Flippable; + antialiasEdges = decodeParams->AntialiasEdges; + } + else + { + maximumSize = Size.Zero; + flippable = false; + antialiasEdges = false; + } + } + + void IRawUIXServices.ReleaseImage(ulong handle) => GCHandle.FromIntPtr(new IntPtr((long)handle)).Free(); + + void IRawUIXServices.RegisterDataProvider( + string providerName, + IntPtr nativeFactoryCallback) + { + MarkupDataProvider.RegisterDataProvider(new NativeDataProviderWrapper(providerName, nativeFactoryCallback)); + } + + unsafe void IRawUIXServices.GetDataMapping( + string providerName, + ulong typeHandle, + IntPtr nativeCallback) + { + if (!(TypeSchema.LookupById(typeHandle) is MarkupDataTypeSchema typeSchema)) + return; + MarkupDataMapping dataMapping = MarkupDataProvider.FindDataMapping(providerName, typeSchema); + NativeApi.NativeDataMappingEntry[] entries = new NativeApi.NativeDataMappingEntry[dataMapping.Mappings.Length]; + for (int index = 0; index < entries.Length; ++index) + { + MarkupDataMappingEntry mapping = dataMapping.Mappings[index]; + entries[index].Source = mapping.Source; + entries[index].Target = mapping.Target; + entries[index].PropertyName = mapping.Property.Name; + entries[index].PropertyTypeName = mapping.Property.PropertyType.Name; + entries[index].PropertyTypeHandle = mapping.Property.PropertyType.UniqueId; + if (mapping.Property.AlternateType != null) + { + entries[index].UnderlyingCollectionTypeName = mapping.Property.AlternateType.Name; + entries[index].UnderlyingCollectionTypeHandle = mapping.Property.AlternateType.UniqueId; + } + // ISSUE: untyped stack allocation + UIXVariant* destination = stackalloc UIXVariant[sizeof(UIXVariant)]; + UIXVariant.MarshalObject(mapping.DefaultValue, destination); + entries[index].DefaultValue = *destination; + } + int num = (int)NativeApi.SpDataProviderReportDataMapping(nativeCallback, providerName, typeHandle, (uint)entries.Length, entries); + } + + void IRawUIXServices.NotifyChangeForDataObject( + ulong frameworkObjectHandle, + string propertyName, + UIXVariant.VariantType variantType) + { + MarkupDataTypeBaseObject dataTypeBaseObject = null; + switch (variantType) + { + case UIXVariant.VariantType.UIXDataQuery: + dataTypeBaseObject = NativeMarkupDataQuery.LookupByHandle(frameworkObjectHandle); + break; + case UIXVariant.VariantType.UIXDataType: + dataTypeBaseObject = NativeMarkupDataType.LookupByHandle(frameworkObjectHandle); + break; + } + if (dataTypeBaseObject == null) + return; + propertyName = NotifyService.CanonicalizeString(propertyName); + dataTypeBaseObject.FireNotificationThreadSafe(propertyName); + } + + IntPtr IRawUIXServices.GetAppWindowHandle() + { + IntPtr num = IntPtr.Zero; + if (UISession.Default != null && UISession.Default.Form != null) + num = UISession.Default.Form.__WindowHandle; + return num; + } + + void IRawUIXServices.ReportError(bool isWarning, string message) + { + if (isWarning) + ErrorManager.ReportWarning(message); + else + ErrorManager.ReportError(message); + } + + void IRawUIXServices.LowPriorityDeferredInvoke(IntPtr callback, IntPtr data) => DeferredCall.Post(DispatchPriority.Idle, new SimpleCallback(new DllProxyServices.DeferredInvokeState() + { + _callback = callback, + _data = data + }.Thunk)); + + internal class DeferredInvokeState + { + public IntPtr _callback; + public IntPtr _data; + + public void Thunk() => NativeApi.SpCallDeferredInvokeProc(_callback, _data); + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchema.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchema.cs new file mode 100644 index 0000000..a4b09e7 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchema.cs @@ -0,0 +1,548 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllTypeSchema : DllTypeSchemaBase + { + private const uint UIX_E_SCHEMA_ERRORS_REPORTED = 2147774470; + private IntPtr _type; + private uint _defaultConstructorID; + + public DllTypeSchema(DllLoadResult owner, uint ID, IntPtr typeSchema) + : base(owner, ID) + => _type = typeSchema; + + public bool Load(UIXIDVerifier idVerifier) + { + DllLoadResult.PushContext(OwnerLoadResult); + bool flag = QueryTypeName() && QueryIsRuntimeImmutable() && (QueryBaseType() && QueryConstructors(idVerifier)) && (QueryProperties(idVerifier) && QueryMethods(idVerifier) && QueryEvents(idVerifier)) && QueryMarshalAs(); + DllLoadResult.PopContext(); + return flag; + } + + [Conditional("DEBUG")] + public void DEBUG_DumpType() + { + } + + [Conditional("DEBUG")] + private void DEBUG_DumpConstructors() + { + bool flag = false; + if (HasDefaultConstructor) + flag = true; + if (_constructors != null) + { + foreach (DllConstructorSchema constructorSchema in _constructors.Values) + ; + flag = true; + } + int num = flag ? 1 : 0; + } + + [Conditional("DEBUG")] + private void DEBUG_DumpProperties() + { + if (_properties == null) + return; + foreach (DllPropertySchema dllPropertySchema in _properties.Values) + ; + } + + [Conditional("DEBUG")] + private void DEBUG_DumpMethods() + { + if (_methods == null) + return; + foreach (DllMethodSchema dllMethodSchema in _methods.Values) + ; + } + + [Conditional("DEBUG")] + private void DEBUG_DumpEvents() + { + if (_events == null) + return; + foreach (DllEventSchema dllEventSchema in _events.Values) + ; + } + + private unsafe bool QueryTypeName() + { + bool flag = false; + char* name; + if (CheckNativeReturn(NativeApi.SpQueryTypeName(_type, out name))) + { + _name = new string(name); + flag = true; + } + return flag; + } + + private bool QueryIsRuntimeImmutable() + { + bool flag = false; + bool isRuntimeImmutable; + if (CheckNativeReturn(NativeApi.SpIsRuntimeImmutable(_type, out isRuntimeImmutable))) + { + SetBit(Bits.IsRuntimeImmutable, isRuntimeImmutable); + flag = true; + } + return flag; + } + + private bool QueryBaseType() + { + bool flag = false; + uint baseTypeID; + if (CheckNativeReturn(NativeApi.SpQueryBaseType(_type, out baseTypeID))) + { + _baseType = DllLoadResult.MapType(baseTypeID); + flag = true; + } + return flag; + } + + private bool QueryConstructors(UIXIDVerifier idVerifier) + { + bool flag1 = false; + uint count; + if (CheckNativeReturn(NativeApi.SpQueryConstructorCount(_type, out count))) + { + bool flag2 = false; + _constructors = new Map((int)count); + for (uint index = 0; index < count; ++index) + { + if (!LoadConstructor(index, idVerifier)) + flag2 = true; + } + flag1 = !flag2; + } + return flag1; + } + + private bool LoadConstructor(uint index, UIXIDVerifier idVerifier) + { + bool flag = false; + IntPtr constructor; + uint ID; + if (CheckNativeReturn(NativeApi.SpGetConstructorSchema(_type, index, out constructor, out ID))) + { + if (constructor != IntPtr.Zero) + { + DllConstructorSchema constructorSchema = new DllConstructorSchema(this, ID); + flag = constructorSchema.Load(constructor); + if (flag) + { + _constructors[new MethodSignatureKey(constructorSchema.ParameterTypes)] = constructorSchema; + if (constructorSchema.ParameterTypes.Length == 0) + { + SetBit(Bits.HasDefaultConstructor, true); + _defaultConstructorID = ID; + } + flag = idVerifier.RegisterID(ID); + } + else + constructorSchema.Dispose(this); + NativeApi.SpReleaseExternalObject(constructor); + } + else + ErrorManager.ReportError("NULL object returned from {0}", "IUIXType::GetConstructor"); + } + return flag; + } + + private bool QueryProperties(UIXIDVerifier idVerifier) + { + bool flag1 = false; + uint count; + if (CheckNativeReturn(NativeApi.SpQueryPropertyCount(_type, out count))) + { + bool flag2 = false; + _properties = new Map((int)count); + for (uint index = 0; index < count; ++index) + { + if (!LoadProperty(index, idVerifier)) + flag2 = true; + } + flag1 = !flag2; + } + return flag1; + } + + private bool LoadProperty(uint index, UIXIDVerifier idVerifier) + { + bool flag = false; + IntPtr property; + uint ID; + if (CheckNativeReturn(NativeApi.SpGetPropertySchema(_type, index, out property, out ID))) + { + if (property != IntPtr.Zero) + { + DllPropertySchema dllPropertySchema = new DllPropertySchema(this, ID); + flag = dllPropertySchema.Load(property); + if (flag) + { + _properties[ID] = dllPropertySchema; + flag = idVerifier.RegisterID(ID); + } + NativeApi.SpReleaseExternalObject(property); + } + else + ErrorManager.ReportError("NULL object returned from {0}", "IUIXType::GetProperty"); + } + return flag; + } + + private bool QueryMethods(UIXIDVerifier idVerifier) + { + bool flag1 = false; + uint count; + if (CheckNativeReturn(NativeApi.SpQueryMethodCount(_type, out count))) + { + bool flag2 = false; + _methods = new Map((int)count); + for (uint index = 0; index < count; ++index) + { + if (!LoadMethod(index, idVerifier)) + flag2 = true; + } + flag1 = !flag2; + } + return flag1; + } + + private bool LoadMethod(uint index, UIXIDVerifier idVerifier) + { + bool flag = false; + IntPtr method; + uint ID; + if (CheckNativeReturn(NativeApi.SpGetMethodSchema(_type, index, out method, out ID))) + { + if (method != IntPtr.Zero) + { + DllMethodSchema dllMethodSchema = new DllMethodSchema(this, ID); + flag = dllMethodSchema.Load(method); + if (flag) + { + _methods[new MethodSignatureKey(dllMethodSchema.Name, dllMethodSchema.ParameterTypes)] = dllMethodSchema; + flag = idVerifier.RegisterID(ID); + } + else + dllMethodSchema.Dispose(this); + NativeApi.SpReleaseExternalObject(method); + } + else + ErrorManager.ReportError("NULL object returned from {0}", "IUIXType::GetMethod"); + } + return flag; + } + + private bool QueryEvents(UIXIDVerifier idVerifier) + { + bool flag1 = false; + uint count; + if (CheckNativeReturn(NativeApi.SpQueryEventCount(_type, out count))) + { + bool flag2 = false; + _events = new Map((int)count); + for (uint index = 0; index < count; ++index) + { + if (!LoadEvent(index, idVerifier)) + flag2 = true; + } + flag1 = !flag2; + } + return flag1; + } + + private bool QueryMarshalAs() + { + uint interopEquivalent; + bool flag = CheckNativeReturn(NativeApi.SpGetMarshalAs(_type, out interopEquivalent)); + if (flag) + flag = ValidateMarshalAs(interopEquivalent); + if (flag) + flag = RegisterMarshalAsEquivalents(interopEquivalent); + return flag; + } + + private bool RegisterMarshalAsEquivalents(uint declaredMarshalAs) + { + bool flag = true; + switch (declaredMarshalAs) + { + case 4294967281: + case 4294967286: + case 4294967287: + case 4294967288: + case 4294967289: + case 4294967290: + case 4294967291: + case uint.MaxValue: + return flag; + case 4294967285: + RegisterOneWayEquivalence(this, ListSchema.Type); + goto case 4294967281; + default: + ErrorManager.ReportError("Invalid MarshalAs '{0}' returned from IUIXType::MarshalAs", _marshalAs); + flag = false; + goto case 4294967281; + } + } + + private bool ValidateMarshalAs(uint declaredMarshalAs) + { + bool flag = true; + uint num = uint.MaxValue; + TypeSchema typeSchema = Base; + DllTypeSchemaBase dllTypeSchemaBase; + for (dllTypeSchemaBase = typeSchema as DllTypeSchemaBase; typeSchema != null && dllTypeSchemaBase == null; dllTypeSchemaBase = typeSchema as DllTypeSchemaBase) + typeSchema = typeSchema.Base; + if (dllTypeSchemaBase != null) + num = dllTypeSchemaBase.MarshalAs; + if (num != uint.MaxValue) + { + 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.", declaredMarshalAs, Name, num); + flag = false; + } + else + declaredMarshalAs = num; + } + _marshalAs = declaredMarshalAs; + return flag; + } + + private bool LoadEvent(uint index, UIXIDVerifier idVerifier) + { + bool flag = false; + IntPtr eventObj; + uint ID; + if (CheckNativeReturn(NativeApi.SpGetEventSchema(_type, index, out eventObj, out ID))) + { + if (eventObj != IntPtr.Zero) + { + DllEventSchema dllEventSchema = new DllEventSchema(this, ID); + flag = dllEventSchema.Load(eventObj); + if (flag) + { + _events[ID] = dllEventSchema; + flag = idVerifier.RegisterID(ID); + } + else + dllEventSchema.Dispose(this); + NativeApi.SpReleaseExternalObject(eventObj); + } + else + ErrorManager.ReportError("NULL object returned from {0}", "IUIXType::GetEvent"); + } + return flag; + } + + protected override void OnDispose() + { + base.OnDispose(); + NativeApi.SpReleaseExternalObject(_type); + _type = IntPtr.Zero; + } + + public string MapChangeID(uint id) + { + 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}'", id, Name); + return name; + } + + private bool MapChangeIDWorker(uint id, out string name) + { + bool flag = false; + name = null; + if ((int)UIXID.GetSchemaComponent(id) == OwnerLoadResult.SchemaComponent) + { + DllPropertySchema dllPropertySchema; + if (_properties != null && _properties.TryGetValue(id, out dllPropertySchema)) + { + name = dllPropertySchema.Name; + flag = true; + } + else + { + DllEventSchema dllEventSchema; + if (_events != null && _events.TryGetValue(id, out dllEventSchema)) + { + name = dllEventSchema.Name; + flag = true; + } + } + } + return flag; + } + + public override object ConstructDefault() => Construct(_defaultConstructorID, null); + + public unsafe object Construct(uint constructorID, object[] parameters) + { + DllProxyObject dllProxyObject = null; + UIXVariant* uixVariantPtr = null; + int count = 0; + if (parameters != null) + { + count = parameters.Length; + // ISSUE: untyped stack allocation + var uixVariantStack = stackalloc UIXVariant[sizeof(UIXVariant) * count]; + uixVariantPtr = uixVariantStack; + UIXVariant.MarshalObjectArray(parameters, uixVariantPtr); + } + ErrorWatermark watermark = ErrorManager.Watermark; + IntPtr nativeObject; + uint hr = NativeApi.SpInvokeConstructor(_type, constructorID, uixVariantPtr, (uint)count, out nativeObject); + if (NativeApi.SUCCEEDED(hr)) + dllProxyObject = DllProxyObject.Wrap(nativeObject); + else + ReportError(hr, ErrorContext.Construct, this, watermark); + if ((IntPtr)uixVariantPtr != IntPtr.Zero) + UIXVariant.CleanupMarshalledObjects(uixVariantPtr, count); + return dllProxyObject; + } + + public object GetPropertyValue(object instance, DllPropertySchema property) + { + IntPtr nativeObject = IntPtr.Zero; + if (!property.IsStatic) + nativeObject = ((DllProxyObject)instance).NativeObject; + ErrorWatermark watermark = ErrorManager.Watermark; + object obj = null; + UIXVariant propertyValue1; + uint propertyValue2 = NativeApi.SpGetPropertyValue(_type, nativeObject, property.ID, out propertyValue1); + if (NativeApi.SUCCEEDED(propertyValue2)) + obj = UIXVariant.GetValue(propertyValue1, Owner); + else + ReportError(propertyValue2, ErrorContext.PropertyGet, property, watermark); + return obj; + } + + public unsafe void SetPropertyValue(object instance, DllPropertySchema property, object value) + { + // ISSUE: untyped stack allocation + UIXVariant* uixVariantPtr = stackalloc UIXVariant[sizeof(UIXVariant)]; + UIXVariant.MarshalObject(value, uixVariantPtr); + IntPtr nativeObject = IntPtr.Zero; + if (!property.IsStatic) + nativeObject = ((DllProxyObject)instance).NativeObject; + ErrorWatermark watermark = ErrorManager.Watermark; + uint hr = NativeApi.SpSetPropertyValue(_type, nativeObject, property.ID, uixVariantPtr); + if (NativeApi.FAILED(hr)) + ReportError(hr, ErrorContext.PropertySet, property, watermark); + UIXVariant.CleanupMarshalledObject(uixVariantPtr); + } + + public unsafe object InvokeMethod(object instance, DllMethodSchema method, object[] parameters) + { + 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 = uixVariantStack; + UIXVariant.MarshalObjectArray(parameters, uixVariantPtr); + } + IntPtr nativeObject = IntPtr.Zero; + if (!method.IsStatic) + nativeObject = ((DllProxyObject)instance).NativeObject; + ErrorWatermark watermark = ErrorManager.Watermark; + UIXVariant returnValue; + uint hr = NativeApi.SpInvokeMethod(_type, nativeObject, method.ID, uixVariantPtr, (uint)count, out returnValue); + if (NativeApi.SUCCEEDED(hr)) + obj = UIXVariant.GetValue(returnValue, Owner); + else + ReportError(hr, ErrorContext.MethodInvoke, method, watermark); + if ((IntPtr)uixVariantPtr != IntPtr.Zero) + UIXVariant.CleanupMarshalledObjects(uixVariantPtr, count); + return obj; + } + + public string InvokeToString(DllProxyObject proxy) + { + string str = null; + ErrorWatermark watermark = ErrorManager.Watermark; + IntPtr nativeStringObject; + uint hr = NativeApi.SpInvokeToString(_type, proxy.NativeObject, out nativeStringObject); + if (NativeApi.SUCCEEDED(hr)) + str = DllProxyServices.GetString(nativeStringObject); + else + ReportError(hr, ErrorContext.ToString, this, watermark); + return str; + } + + private DllLoadResult OwnerLoadResult => (DllLoadResult)Owner; + + private void ReportError( + uint hr, + DllTypeSchema.ErrorContext contextType, + object context, + ErrorWatermark watermark) + { + if (hr == 2147774470U && watermark.ErrorsDetected) + return; + string message; + switch (contextType) + { + case ErrorContext.MethodInvoke: + DllMethodSchema dllMethodSchema = (DllMethodSchema)context; + 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 ErrorContext.ToString: + DllTypeSchema dllTypeSchema1 = (DllTypeSchema)context; + message = string.Format("Error 0x{0:X8} occurred invoking ToString on type {1} from {2}.", hr, dllTypeSchema1.Name, dllTypeSchema1.Owner.Uri); + break; + case ErrorContext.PropertyGet: + DllPropertySchema dllPropertySchema1 = (DllPropertySchema)context; + 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 ErrorContext.PropertySet: + DllPropertySchema dllPropertySchema2 = (DllPropertySchema)context; + 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 ErrorContext.Construct: + DllTypeSchema dllTypeSchema2 = (DllTypeSchema)context; + 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"; + break; + } + ErrorManager.ReportError(message); + } + + private bool CheckNativeReturn(uint hr) => DllLoadResult.CheckNativeReturn(hr, "IUIXType"); + + private enum ErrorContext + { + MethodInvoke, + ToString, + PropertyGet, + PropertySet, + Construct, + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchemaBase.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchemaBase.cs new file mode 100644 index 0000000..46cdb12 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/DllTypeSchemaBase.cs @@ -0,0 +1,215 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.DllTypeSchemaBase +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using System; +using System.Collections.Specialized; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class DllTypeSchemaBase : TypeSchema + { + private BitVector32 _bits; + protected uint _typeID; + protected Map _constructors; + protected Map _properties; + protected Map _methods; + protected Map _events; + protected string _name; + protected TypeSchema _baseType; + protected uint _marshalAs; + + protected DllTypeSchemaBase(DllLoadResult owner, uint ID) + : base(owner) + => _typeID = ID; + + protected override void OnDispose() + { + base.OnDispose(); + if (_constructors != null) + { + foreach (KeyValueEntry constructor in _constructors) + { + if (constructor.Value != null) + constructor.Value.Dispose(this); + } + _constructors = null; + } + if (_properties != null) + { + foreach (DllPropertySchema dllPropertySchema in _properties.Values) + dllPropertySchema?.Dispose(this); + _properties = null; + } + if (_methods != null) + { + foreach (KeyValueEntry method in _methods) + { + if (method.Value != null) + method.Value.Dispose(this); + } + _methods = null; + } + if (_events == null) + return; + foreach (DllEventSchema dllEventSchema in _events.Values) + dllEventSchema?.Dispose(this); + } + + public override object ConstructDefault() => (object)null; + + public override int FindTypeHint => (int)_typeID; + + public override bool HasDefaultConstructor => GetBit(Bits.HasDefaultConstructor); + + public override bool IsRuntimeImmutable => GetBit(Bits.IsRuntimeImmutable); + + public override ConstructorSchema FindConstructor(TypeSchema[] parameters) + { + DllConstructorSchema constructorSchema = null; + if (_constructors != null) + _constructors.TryGetValue(new MethodSignatureKey(parameters), out constructorSchema); + return constructorSchema; + } + + public override PropertySchema FindProperty(string name) + { + if (_properties != null) + { + foreach (DllPropertySchema dllPropertySchema in _properties.Values) + { + if (dllPropertySchema != null && dllPropertySchema.Name == name) + return dllPropertySchema; + } + } + if (Equivalents != null) + { + foreach (TypeSchema equivalent in Equivalents) + { + PropertySchema property = equivalent.FindProperty(name); + if (property != null) + return property; + } + } + return null; + } + + public override MethodSchema FindMethod(string name, TypeSchema[] parameters) + { + if (_methods != null) + { + DllMethodSchema dllMethodSchema = null; + if (_methods.TryGetValue(new MethodSignatureKey(name, parameters), out dllMethodSchema)) + return dllMethodSchema; + } + if (Equivalents != null) + { + foreach (TypeSchema equivalent in Equivalents) + { + MethodSchema method = equivalent.FindMethod(name, parameters); + if (method != null) + return method; + } + } + return null; + } + + public override EventSchema FindEvent(string name) + { + DllEventSchema dllEventSchema1 = null; + if (_events != null) + { + foreach (DllEventSchema dllEventSchema2 in _events.Values) + { + if (dllEventSchema2 != null && dllEventSchema2.Name == name) + { + dllEventSchema1 = dllEventSchema2; + break; + } + } + } + return dllEventSchema1; + } + + public override PropertySchema[] Properties + { + get + { + PropertySchema[] propertySchemaArray = PropertySchema.EmptyList; + if (_properties != null && _properties.Count > 0) + { + propertySchemaArray = new PropertySchema[_properties.Count]; + int num = 0; + foreach (PropertySchema propertySchema in _properties.Values) + propertySchemaArray[num++] = propertySchema; + } + return propertySchemaArray; + } + } + + public uint MarshalAs => _marshalAs; + + public override string Name => _name; + + public override string AlternateName => (string)null; + + public override TypeSchema Base => _baseType; + + public override Type RuntimeType => DllLoadResult.RuntimeTypeForMarshalAs(_marshalAs); + + public override Result TypeConverter( + object from, + TypeSchema fromType, + out object instance) + { + instance = null; + return Result.Fail("Not implemented"); + } + + public override bool SupportsTypeConversion(TypeSchema fromType) => false; + + public override void EncodeBinary(ByteCodeWriter writer, object instance) + { + } + + public override object DecodeBinary(ByteCodeReader reader) => (object)null; + + public override bool SupportsBinaryEncoding => false; + + public override object PerformOperation(object left, object right, OperationType op) => (object)null; + + public override bool SupportsOperation(OperationType op) => false; + + public override bool IsNullAssignable => true; + + public override object FindCanonicalInstance(string name) => (object)null; + + public override void InitializeInstance(ref object instance) + { + } + + public override bool HasInitializer => false; + + public override bool Contractual => false; + + public override bool IsNativeAssignableFrom(object check) => false; + + public override bool IsNativeAssignableFrom(TypeSchema check) => false; + + public override bool Disposable => true; + + protected bool GetBit(DllTypeSchemaBase.Bits lookupBit) => _bits[(int)lookupBit]; + + protected void SetBit(DllTypeSchemaBase.Bits changeBit, bool value) => _bits[(int)changeBit] = value; + + protected enum Bits : uint + { + HasDefaultConstructor = 1, + IsRuntimeImmutable = 2, + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/MarkupDataQueryHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/MarkupDataQueryHandleTable.cs new file mode 100644 index 0000000..c3d5824 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/MarkupDataQueryHandleTable.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.MarkupDataQueryHandleTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class MarkupDataQueryHandleTable : DllProxyHandleTable + { + public bool LookupByHandle(ulong handle, out MarkupDataQuery obj) + { + object obj1; + bool flag = LookupByHandleWorker(handle, out obj1); + obj = (MarkupDataQuery)obj1; + return flag; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/MarkupDataTypeHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/MarkupDataTypeHandleTable.cs new file mode 100644 index 0000000..323b828 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/MarkupDataTypeHandleTable.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.MarkupDataTypeHandleTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class MarkupDataTypeHandleTable : DllProxyHandleTable + { + public bool LookupByHandle(ulong handle, out MarkupDataType obj) + { + object obj1; + bool flag = LookupByHandleWorker(handle, out obj1); + obj = (MarkupDataType)obj1; + return flag; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/NativeDataProviderWrapper.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/NativeDataProviderWrapper.cs new file mode 100644 index 0000000..83323ea --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/NativeDataProviderWrapper.cs @@ -0,0 +1,41 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.NativeDataProviderWrapper +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using System; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class NativeDataProviderWrapper : IDataProvider + { + private string _name; + private IntPtr _factory; + + public NativeDataProviderWrapper(string name, IntPtr factory) + { + _name = name; + _factory = factory; + } + + public string Name => _name; + + public MarkupDataQuery Build(MarkupDataQuerySchema querySchema) => new NativeMarkupDataQuery(querySchema, this); + + public IntPtr ConstructQuery( + string providerName, + ulong queryTypeHandle, + ulong resultTypeHandle, + ulong queryHandle) + { + IntPtr query; + int num = (int)NativeApi.SpDataProviderConstructQuery(_factory, providerName, queryTypeHandle, resultTypeHandle, queryHandle, out query); + return query; + } + + public override string ToString() => string.Format("{0} ({1})", _name, _factory); + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/NativeTraceCategories.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/NativeTraceCategories.cs new file mode 100644 index 0000000..5d32cc5 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/NativeTraceCategories.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.NativeTraceCategories +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + [StructLayout(LayoutKind.Sequential, Size = 1)] + internal struct NativeTraceCategories + { + public const byte TypeLoading = 1; + public const byte Handles = 2; + public const byte PropertyChanges = 4; + public const byte Invocations = 8; + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable.cs new file mode 100644 index 0000000..ee70004 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.ProxyHandleTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Diagnostics; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class ProxyHandleTable + { + public const ulong c_InvalidHandle = 0; + private uint _tableIndex; + private static uint s_tableCount; + + protected ProxyHandleTable() => _tableIndex = s_tableCount++; + + protected uint TableIndex => _tableIndex; + + [Conditional("DEBUG")] + public static void DEBUG_AssertValidHandle(ulong handle) + { + } + + public static string DEBUG_FormatHandle(ulong handle) => string.Empty; + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable`1.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable`1.cs new file mode 100644 index 0000000..c42b6c2 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/ProxyHandleTable`1.cs @@ -0,0 +1,207 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.ProxyHandleTable`1 +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class ProxyHandleTable : ProxyHandleTable + { + private const int c_uninitialized = 0; + private const int c_invalidFreeListValue = -1; + private const int c_slotInUse = -2; + private const int c_tableShift = 30; + private const int c_lifetimeCountMask = 1073741823; + private const ulong c_uniquenessMask = 4294967295; + private const ulong c_indexMask = 4294967295; + private const int c_uniquenessShift = 32; + private ProxyHandleTable.ListEntry[] _entries; + private int _oldestFreeIndex; + private int _newestFreeIndex; + private int _filledBoundary; + private uint _lifetimeCount; + + public ProxyHandleTable() + { + _oldestFreeIndex = -1; + _newestFreeIndex = -1; + _filledBoundary = 0; + } + + protected bool InternalLookupByHandle(ulong handle, out T obj) + { + bool flag = false; + obj = default(T); + int index; + uint uniquenessBits; + DecodeHandle(handle, out index, out uniquenessBits); + ProxyHandleTable.ListEntry entry = _entries[index]; + if ((int)uniquenessBits == (int)entry.Uniquifier) + { + flag = true; + obj = entry.Value; + } + return flag; + } + + protected ulong AllocateHandle(T obj) + { + EnsureSpaceForNewEntry(); + int index = ReserveIndexForNewEntry(); + return StoreNewEntry(obj, index); + } + + private void EnsureSpaceForNewEntry() + { + if (_entries != null && (_oldestFreeIndex != -1 || _filledBoundary != _entries.Length)) + return; + EnlargeList(); + } + + private int ReserveIndexForNewEntry() + { + int index; + if (_oldestFreeIndex != -1) + { + index = FreeListIndexToRealIndex(_oldestFreeIndex); + _oldestFreeIndex = _entries[index].FreeIndex; + if (_oldestFreeIndex == -1) + _newestFreeIndex = -1; + } + else + index = _filledBoundary++; + return index; + } + + private ulong StoreNewEntry(T obj, int index) + { + ulong handle; + uint uniquifier; + GenerateHandle(index, out handle, out uniquifier); + int index1 = -2; + AddRef(ref index1); + _entries[index].Uniquifier = uniquifier; + _entries[index].Value = obj; + _entries[index].FreeIndex = index1; + return handle; + } + + private int FreeListIndexToRealIndex(int index) => index - 1; + + private int RealIndexToFreeListIndex(int index) => index + 1; + + private void GenerateHandle(int insertIndex, out ulong handle, out uint uniquifier) + { + ++_lifetimeCount; + uniquifier = TableIndex << 30; + uniquifier |= _lifetimeCount & 1073741823U; + handle = (ulong)uniquifier << 32; + uint num = (uint)insertIndex; + handle |= num; + } + + private void DecodeHandle(ulong handle, out int index, out uint uniquenessBits) + { + index = (int)((long)handle & uint.MaxValue); + ulong num = 18446744069414584320; + uniquenessBits = (uint)((handle & num) >> 32); + } + + private void EnlargeList() + { + if (_entries == null) + { + _entries = new ProxyHandleTable.ListEntry[4]; + } + else + { + ProxyHandleTable.ListEntry[] listEntryArray = new ProxyHandleTable.ListEntry[_entries.Length * 2]; + Array.Copy(_entries, listEntryArray, _entries.Length); + _entries = listEntryArray; + } + } + + protected void AddRefHandle(ulong handle) + { + int index; + DecodeHandle(handle, out index, out uint _); + AddRef(ref _entries[index].FreeIndex); + } + + private void AddRef(ref int index) => --index; + + private void Release(ref int index) => ++index; + + protected bool ReleaseHandle(ulong handle, out T oldValue) + { + bool flag = false; + int index; + DecodeHandle(handle, out index, out uint _); + Release(ref _entries[index].FreeIndex); + oldValue = _entries[index].Value; + if (_entries[index].FreeIndex == -2) + { + flag = true; + RemoveEntry(index); + } + return flag; + } + + private void RemoveEntry(int index) + { + _entries[index].Value = default(T); + int freeListIndex = RealIndexToFreeListIndex(index); + if (_newestFreeIndex != -1) + _entries[FreeListIndexToRealIndex(_newestFreeIndex)].FreeIndex = freeListIndex; + else + _oldestFreeIndex = freeListIndex; + _newestFreeIndex = freeListIndex; + _entries[index].FreeIndex = -1; + } + + protected ProxyHandleTable.ProxyHandleTableEnumerator GetTableEnumerator() => new ProxyHandleTable.ProxyHandleTableEnumerator(this); + + [Conditional("DEBUG")] + public void ValidateList() + { + } + + private struct ListEntry + { + public T Value; + public int FreeIndex; + public uint Uniquifier; + } + + internal struct ProxyHandleTableEnumerator + { + private const int START_INVALID_INDEX = -1; + private ProxyHandleTable _table; + private int _index; + + public ProxyHandleTableEnumerator(ProxyHandleTable table) + { + _table = table; + _index = -1; + } + + public bool MoveNext() + { + do + { + ++_index; + } + while (_index < _table._filledBoundary && _table._entries[_index].FreeIndex > -2); + return _index < _table._filledBoundary; + } + + public T Current => _table._entries[_index].Value; + + public void Reset() => _index = -1; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/StringPinState.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/StringPinState.cs new file mode 100644 index 0000000..b3509a5 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/StringPinState.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.StringPinState +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal struct StringPinState + { + public GCHandle _gcHandle; + public int _pinCount; + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/StringProxyHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/StringProxyHandleTable.cs new file mode 100644 index 0000000..ba78b52 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/StringProxyHandleTable.cs @@ -0,0 +1,76 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.StringProxyHandleTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class StringProxyHandleTable : ProxyHandleTable + { + private static Map s_stringToHandleLookup; + private static Map s_pinnedStrings; + + public bool GetStringHandle(string value, out ulong handle) + { + if (s_stringToHandleLookup == null) + s_stringToHandleLookup = new Map(); + bool flag = s_stringToHandleLookup.TryGetValue(value, out handle); + if (flag) + { + AddRefHandle(handle); + } + else + { + handle = AllocateHandle(value); + s_stringToHandleLookup[value] = handle; + } + return !flag; + } + + public bool ReleaseStringHandle(ulong handle, out string value) + { + bool flag = ReleaseHandle(handle, out value); + if (flag) + s_stringToHandleLookup.Remove(value); + return flag; + } + + public bool LookupByHandle(ulong handle, out string obj) => InternalLookupByHandle(handle, out obj); + + public unsafe int PinString(ulong handle, out char* value) + { + if (s_pinnedStrings == null) + s_pinnedStrings = new Map(); + StringPinState stringPinState; + if (s_pinnedStrings.TryGetValue(handle, out stringPinState)) + { + ++stringPinState._pinCount; + } + else + { + string str; + LookupByHandle(handle, out str); + stringPinState._gcHandle = GCHandle.Alloc(str, GCHandleType.Pinned); + stringPinState._pinCount = 1; + } + s_pinnedStrings[handle] = stringPinState; + value = (char*)stringPinState._gcHandle.AddrOfPinnedObject().ToPointer(); + return stringPinState._pinCount; + } + + public int UnpinString(ulong handle) + { + StringPinState pinnedString = s_pinnedStrings[handle]; + --pinnedString._pinCount; + if (pinnedString._pinCount == 0) + { + pinnedString._gcHandle.Free(); + s_pinnedStrings.Remove(handle); + } + return pinnedString._pinCount; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/TypeSchemaHandleTable.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/TypeSchemaHandleTable.cs new file mode 100644 index 0000000..71b7dc0 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/TypeSchemaHandleTable.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.TypeSchemaHandleTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class TypeSchemaHandleTable : DllProxyHandleTable + { + public bool LookupByHandle(ulong handle, out TypeSchema obj) + { + object obj1; + bool flag = LookupByHandleWorker(handle, out obj1); + obj = (TypeSchema)obj1; + return flag; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs new file mode 100644 index 0000000..aa074a3 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXID.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.UIXID +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal static class UIXID + { + public const uint IntrinsicSchemaComponent = 65535; + public const uint IntrinsicSchemaID = 4294901760; + public const uint Invalid = 4294967295; + public const uint Bool = 4294967294; + public const uint Byte = 4294967293; + public const uint Double = 4294967292; + public const uint IBooleanChoice = 4294967291; + public const uint IByteRangedValue = 4294967290; + public const uint IChoice = 4294967289; + public const uint ICommand = 4294967288; + public const uint IDictionary = 4294967287; + public const uint IIntRangedValue = 4294967286; + public const uint IList = 4294967285; + public const uint Image = 4294967284; + public const uint Int32 = 4294967283; + public const uint Int64 = 4294967282; + public const uint IRangedValue = 4294967281; + public const uint Object = 4294967280; + public const uint Single = 4294967279; + public const uint String = 4294967278; + public const uint Void = 4294967277; + public const uint DataQuery = 4294967276; + public const uint DataType = 4294967275; + private const int SCHEMA_SHIFT = 16; + private const uint SCHEMA_MASK = 4294901760; + private const uint LOCAL_MASK = 65535; + + public static uint GetSchemaID(uint ID) => ID & 4294901760U; + + public static uint GetSchemaComponent(uint ID) => (ID & 4294901760U) >> 16; + + 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 new file mode 100644 index 0000000..2c7eae6 --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXIDVerifier.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.UIXIDVerifier +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal class UIXIDVerifier + { + private Map _uniqueIDs; + private DllLoadResult _loadResult; + + public UIXIDVerifier(DllLoadResult loadResult) + { + _loadResult = loadResult; + _uniqueIDs = new Map(); + } + + public bool RegisterID(uint ID) => CheckForSchemaMatch(ID) && CheckForDuplicate(ID); + + private bool CheckForSchemaMatch(uint ID) + { + 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}'", ID, _loadResult.SchemaComponent, _loadResult.Uri); + return flag; + } + + private bool CheckForDuplicate(uint ID) + { + uint num = 0; + bool flag = _uniqueIDs.TryGetValue(ID, out num); + if (flag && num == 0U) + { + ErrorManager.ReportError("Duplicate ID '0x{0:X8}' found in schema from '{1}'", ID, _loadResult.Uri); + ++num; + } + _uniqueIDs[ID] = num; + return !flag; + } + } +} diff --git a/UIX/Microsoft/Iris/CodeModel/Cpp/UIXVariant.cs b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXVariant.cs new file mode 100644 index 0000000..8dfa32a --- /dev/null +++ b/UIX/Microsoft/Iris/CodeModel/Cpp/UIXVariant.cs @@ -0,0 +1,267 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CodeModel.Cpp.UIXVariant +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using System; + +namespace Microsoft.Iris.CodeModel.Cpp +{ + internal struct UIXVariant + { + private UIXVariant.VariantType _type; + private long _union; + + public static object GetValue(UIXVariant inboundObject, LoadResult context) + { + switch (inboundObject._type) + { + case VariantType.Empty: + return null; + case VariantType.Bool: + return inboundObject._integer != 0L; + case VariantType.Byte: + return (byte)inboundObject._integer; + case VariantType.Int32: + return (int)inboundObject._integer; + case VariantType.Int64: + return inboundObject._integer; + case VariantType.Single: + return inboundObject._float; + case VariantType.Double: + return inboundObject._double; + case VariantType.Enum: + return GetEnumValue(inboundObject._enum._value, inboundObject._enum._type); + case VariantType.UIXObject: + return GetObjectValue(inboundObject._pointer, context); + case VariantType.UIXString: + return DllProxyServices.GetString(inboundObject._pointer); + case VariantType.UIXImage: + return DllProxyServices.GetImage(inboundObject._pointer); + case VariantType.UIXDataQuery: + return DllProxyServices.GetDataQuery(inboundObject._pointer); + case VariantType.UIXDataType: + return DllProxyServices.GetDataType(inboundObject._pointer); + default: + return 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 = null; + DllLoadResult.PushContext(context); + if (value != IntPtr.Zero) + obj = DllProxyObject.Wrap(value); + DllLoadResult.PopContext(); + return obj; + } + + public static unsafe void MarshalObjectArray(object[] objects, UIXVariant* destination) + { + for (int index = 0; index < objects.Length; ++index) + MarshalObject(objects[index], destination + index); + } + + public static unsafe void MarshalObject(object o, UIXVariant* destination) + { + switch (o) + { + case null: + destination->SetToNull(); + break; + case bool flag: + destination->SetIntegerValue(flag ? 1L : 0L, VariantType.Bool); + break; + case byte num: + destination->SetIntegerValue(num, VariantType.Byte); + break; + case int num: + destination->SetIntegerValue(num, VariantType.Int32); + break; + case long num: + destination->SetIntegerValue(num, VariantType.Int64); + break; + case float num: + destination->SetFloatValue(num, VariantType.Single); + break; + case double num: + destination->SetDoubleValue(num, VariantType.Double); + break; + case string _: + IntPtr nativeObject1; + DllProxyServices.CreateNativeString((string)o, out nativeObject1); + destination->SetPointerValue(nativeObject1, VariantType.UIXString); + break; + case DllProxyObject _: + destination->SetPointerValue(((DllProxyObject)o).NativeObject, VariantType.UIXObject); + NativeApi.SpAddRefExternalObject(destination->_pointer); + break; + case DllEnumProxy _: + DllEnumProxy dllEnumProxy = (DllEnumProxy)o; + UIXVariant.EnumValue enumValue; + enumValue._value = dllEnumProxy.Value; + enumValue._type = dllEnumProxy.Type.ID; + destination->SetEnumValue(enumValue); + break; + case UIImage _: + IntPtr nativeObject2; + DllProxyServices.CreateNativeImage((UIImage)o, out nativeObject2); + destination->SetPointerValue(nativeObject2, VariantType.UIXImage); + break; + case MarkupDataQuery _: + MarkupDataQuery markupDataQuery = (MarkupDataQuery)o; + destination->SetPointerValue(markupDataQuery.ExternalNativeObject, VariantType.UIXDataQuery); + break; + case MarkupDataType _: + MarkupDataType markupDataType = (MarkupDataType)o; + destination->SetPointerValue(markupDataType.ExternalNativeObject, VariantType.UIXDataType); + break; + } + } + + public static unsafe void CleanupMarshalledObjects(UIXVariant* source, int count) + { + for (int index = 0; index < count; ++index) + CleanupMarshalledObject(source + index); + } + + public static unsafe void CleanupMarshalledObject(UIXVariant* source) + { + if (source->_type != VariantType.UIXObject || !(source->_pointer != IntPtr.Zero)) + return; + NativeApi.SpReleaseExternalObject(source->_pointer); + } + + private void SetToNull() + { + _pointer = IntPtr.Zero; + _type = VariantType.UIXObject; + } + + private void SetPointerValue(IntPtr value, UIXVariant.VariantType type) + { + _pointer = value; + _type = type; + } + + private void SetIntegerValue(long value, UIXVariant.VariantType type) + { + _integer = value; + _type = type; + } + + private void SetFloatValue(float value, UIXVariant.VariantType type) + { + _float = value; + _type = type; + } + + private void SetDoubleValue(double value, UIXVariant.VariantType type) + { + _double = value; + _type = type; + } + + private void SetEnumValue(UIXVariant.EnumValue value) + { + _enum = value; + _type = VariantType.Enum; + } + + private unsafe IntPtr _pointer + { + get + { + var value = _union; + return *(IntPtr*)&value; + } + set + { + long num; + *(IntPtr*)&num = value; + _union = num; + } + } + + private unsafe UIXVariant.EnumValue _enum + { + get + { + var value = _union; + return *(UIXVariant.EnumValue*)&value; + } + set + { + long num; + *(UIXVariant.EnumValue*)&num = value; + _union = num; + } + } + + private long _integer + { + get => _union; + set => _union = value; + } + + private unsafe float _float + { + get + { + var value = _union; + return *(float*)&value; + } + set + { + long num; + *(float*)&num = value; + _union = num; + } + } + + private unsafe double _double + { + get + { + var value = _union; + return *(double*)&value; + } + set + { + long num; + *(double*)&num = value; + _union = num; + } + } + + internal enum VariantType + { + Empty = 0, + Bool = 1, + Byte = 2, + Int32 = 3, + Int64 = 4, + Single = 5, + Double = 6, + Enum = 7, + UIXObject = 128, // 0x00000080 + UIXString = 129, // 0x00000081 + UIXImage = 130, // 0x00000082 + UIXDataQuery = 131, // 0x00000083 + UIXDataType = 132, // 0x00000084 + } + + private struct EnumValue + { + public int _value; + public uint _type; + } + } +} diff --git a/UIX/Microsoft/Iris/Command.cs b/UIX/Microsoft/Iris/Command.cs new file mode 100644 index 0000000..4eddab7 --- /dev/null +++ b/UIX/Microsoft/Iris/Command.cs @@ -0,0 +1,127 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Command +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using System; +using System.ComponentModel; + +namespace Microsoft.Iris +{ + public class Command : ModelItem, ICommand, INotifyPropertyChanged + { + private static readonly EventCookie s_invokedEvent = EventCookie.ReserveSlot(); + private bool _availableFlag = true; + private InvokePolicy _priority = InvokePolicy.AsynchronousNormal; + + public Command(IModelItemOwner owner, string description, EventHandler invokedHandler) + : base(owner, description) + { + if (invokedHandler == null) + return; + Invoked += invokedHandler; + } + + public Command(IModelItemOwner owner, EventHandler invokedHandler) + : this(owner, null, invokedHandler) + { + } + + public Command(IModelItemOwner owner) + : this(owner, null, null) + { + } + + public Command() + : this(null) + { + } + + public virtual bool Available + { + get + { + using (ThreadValidator) + return _availableFlag; + } + set + { + using (ThreadValidator) + { + if (_availableFlag == value) + return; + _availableFlag = value; + FirePropertyChanged(nameof(Available)); + } + } + } + + public InvokePolicy Priority + { + get + { + using (ThreadValidator) + return _priority; + } + set + { + using (ThreadValidator) + { + if (_priority == value) + return; + _priority = value; + FirePropertyChanged(nameof(Priority)); + } + } + } + + public void Invoke() => Invoke(Priority); + + public void Invoke(InvokePolicy invokePolicy) + { + using (ThreadValidator) + { + if (invokePolicy != InvokePolicy.Synchronous) + { + DispatchPriority priority = DispatchPriority.AppEvent; + if (invokePolicy == InvokePolicy.AsynchronousLowPri) + priority = DispatchPriority.Idle; + DeferredCall.Post(priority, new SimpleCallback(InvokeWorker)); + } + else + InvokeWorker(); + } + } + + private void InvokeWorker() + { + if (IsDisposed) + return; + FirePropertyChanged("Invoked"); + if (GetEventHandler(s_invokedEvent) is EventHandler eventHandler) + eventHandler(this, EventArgs.Empty); + OnInvoked(); + } + + public event EventHandler Invoked + { + add + { + using (ThreadValidator) + AddEventHandler(s_invokedEvent, value); + } + remove + { + using (ThreadValidator) + RemoveEventHandler(s_invokedEvent, value); + } + } + + protected virtual void OnInvoked() + { + } + } +} diff --git a/UIX/Microsoft/Iris/CompilerInput.cs b/UIX/Microsoft/Iris/CompilerInput.cs new file mode 100644 index 0000000..85db6df --- /dev/null +++ b/UIX/Microsoft/Iris/CompilerInput.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.CompilerInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public struct CompilerInput + { + public string SourceFileName; + public string OutputFileName; + public string IdentityUri; + } +} diff --git a/UIX/Microsoft/Iris/Data/INotifyList.cs b/UIX/Microsoft/Iris/Data/INotifyList.cs new file mode 100644 index 0000000..05ad62e --- /dev/null +++ b/UIX/Microsoft/Iris/Data/INotifyList.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.INotifyList +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Data +{ + internal interface INotifyList : IList, ICollection, IEnumerable + { + void Move(int oldIndex, int newIndex); + + event UIListContentsChangedHandler ContentsChanged; + } +} diff --git a/UIX/Microsoft/Iris/Data/IResourceProvider.cs b/UIX/Microsoft/Iris/Data/IResourceProvider.cs new file mode 100644 index 0000000..30f1e99 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/IResourceProvider.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.IResourceProvider +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Data +{ + internal interface IResourceProvider + { + Resource GetResource(string hierarchicalPart, string uri, bool forceSynchronous); + } +} diff --git a/UIX/Microsoft/Iris/Data/IVirtualList.cs b/UIX/Microsoft/Iris/Data/IVirtualList.cs new file mode 100644 index 0000000..7a3777f --- /dev/null +++ b/UIX/Microsoft/Iris/Data/IVirtualList.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.IVirtualList +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ViewItems; +using System.Collections; + +namespace Microsoft.Iris.Data +{ + internal interface IVirtualList : INotifyList, IList, ICollection, IEnumerable + { + void RequestItem(int idx, ItemRequestCallback callback); + + bool IsItemAvailable(int idx); + + void NotifyVisualsCreated(int idx); + + void NotifyVisualsReleased(int idx); + + Repeater RepeaterHost { get; set; } + + bool SlowDataRequestsEnabled { get; } + + void NotifyRequestSlowData(int index); + + SlowDataAcquireCompleteHandler SlowDataAcquireCompleteHandler { get; set; } + } +} diff --git a/UIX/Microsoft/Iris/Data/IntListUtility.cs b/UIX/Microsoft/Iris/Data/IntListUtility.cs new file mode 100644 index 0000000..6b7c865 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/IntListUtility.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.IntListUtility +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections.Generic; + +namespace Microsoft.Iris.Data +{ + internal static class IntListUtility + { + public static int IndexOf(List list, int item) + { + for (int index = 0; index < list.Count; ++index) + { + if (list[index] == item) + return index; + } + return -1; + } + + public static int IndexOf(Vector list, int item) + { + for (int index = 0; index < list.Count; ++index) + { + if (list[index] == item) + return index; + } + return -1; + } + + public static bool Contains(List list, int item) => IndexOf(list, item) != -1; + + public static bool Contains(Vector list, int item) => IndexOf(list, item) != -1; + } +} diff --git a/UIX/Microsoft/Iris/Data/ItemRequestCallback.cs b/UIX/Microsoft/Iris/Data/ItemRequestCallback.cs new file mode 100644 index 0000000..2699535 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/ItemRequestCallback.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.ItemRequestCallback +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Data +{ + internal delegate void ItemRequestCallback(object sender, int index, object item); +} diff --git a/UIX/Microsoft/Iris/Data/ListUtility.cs b/UIX/Microsoft/Iris/Data/ListUtility.cs new file mode 100644 index 0000000..5628ae3 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/ListUtility.cs @@ -0,0 +1,80 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.ListUtility +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Data +{ + internal static class ListUtility + { + public static bool IsNullOrEmpty(IList list) => list == null || list.Count <= 0; + + public static bool IsNullOrEmpty(IVector list) => list == null || list.Count <= 0; + + public static bool IsValidIndex(IList list, int idx) => IsValidIndex(idx, list.Count); + + public static bool IsValidIndex(IVector list, int idx) => IsValidIndex(idx, list.Count); + + public static bool IsValidIndex(int idx, int itemsCount) + { + int num = itemsCount - 1; + return idx >= 0 && idx <= num; + } + + public static bool AreContentsEqual(IVector a, IVector b) + { + int num1 = 0; + if (a != null) + num1 = a.Count; + int num2 = 0; + if (b != null) + num2 = b.Count; + if (num1 != num2) + return false; + for (int index = 0; index < num1; ++index) + { + if (!IsEqual(a[index], b[index])) + return false; + } + return true; + } + + private static bool IsEqual(object a, object b) => a == null ? b == null : a.Equals(b); + + public static void GetWrappedIndex( + int idx, + int itemsCount, + out int dataIndex, + out int generationValue) + { + if (itemsCount == 0) + { + dataIndex = 0; + generationValue = 0; + } + else + { + dataIndex = idx % itemsCount; + if (dataIndex < 0) + dataIndex = itemsCount + dataIndex; + generationValue = idx / itemsCount; + if (idx >= 0 || dataIndex == 0) + return; + --generationValue; + } + } + + public static int GetUnwrappedIndex(int dataIndex, int generationValue, int itemsCount) + { + int num = dataIndex + generationValue * itemsCount; + if (num < 0 && generationValue > 0) + num = int.MaxValue; + else if (num > 0 && generationValue < 0) + num = int.MinValue; + return num; + } + } +} diff --git a/UIX/Microsoft/Iris/Data/Resource.cs b/UIX/Microsoft/Iris/Data/Resource.cs new file mode 100644 index 0000000..930b59a --- /dev/null +++ b/UIX/Microsoft/Iris/Data/Resource.cs @@ -0,0 +1,135 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.Resource +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.OS; +using System; + +namespace Microsoft.Iris.Data +{ + internal abstract class Resource + { + protected string _uri; + private bool _forceSynchronous; + private IntPtr _buffer; + private uint _length; + private bool _requiresMemoryFree; + private ResourceStatus _status; + private string _errorDetails; + private int _acquisitions; + private ResourceAcquisitionCompleteHandler _completeHandlers; + + public Resource(string uri, bool forceSynchronous) + { + _uri = uri; + _forceSynchronous = forceSynchronous; + _status = ResourceStatus.NeedsAcquire; + } + + public string Uri => _uri; + + public abstract string Identifier { get; } + + public void Acquire() => Acquire(null); + + public void Acquire(ResourceAcquisitionCompleteHandler completeHandler) + { + ++_acquisitions; + if (completeHandler != null) + _completeHandlers += completeHandler; + if (_status == ResourceStatus.Acquiring) + return; + if (_status != ResourceStatus.Available) + { + _status = ResourceStatus.Acquiring; + _errorDetails = null; + StartAcquisition(_forceSynchronous); + } + else + { + if (completeHandler == null) + return; + completeHandler(this); + } + } + + public void Free() => Free(null); + + public void Free(ResourceAcquisitionCompleteHandler completeHandler) + { + --_acquisitions; + if (completeHandler != null) + _completeHandlers -= completeHandler; + if (_acquisitions != 0) + return; + if (_status == ResourceStatus.Acquiring) + CancelAcquisition(); + else if (_buffer != IntPtr.Zero) + { + if (_requiresMemoryFree) + FreeNativeBuffer(_buffer); + _buffer = IntPtr.Zero; + } + _status = ResourceStatus.NeedsAcquire; + } + + public ResourceStatus Status + { + get => _status; + set => _status = value; + } + + public string ErrorDetails => _errorDetails; + + public IntPtr Buffer => _buffer; + + public uint Length => _length; + + public bool ForceSynchronous => _forceSynchronous; + + protected abstract void StartAcquisition(bool forceSynchronous); + + protected abstract void CancelAcquisition(); + + protected void NotifyAcquisitionComplete( + IntPtr buffer, + uint length, + bool requiresMemoryFree, + string errorDetails) + { + _buffer = buffer; + _length = length; + _requiresMemoryFree = requiresMemoryFree; + if (buffer != IntPtr.Zero) + { + _status = ResourceStatus.Available; + } + else + { + _status = ResourceStatus.Error; + if (errorDetails == null) + errorDetails = string.Format("Failed to acquire resource '{0}'", Identifier); + _errorDetails = errorDetails; + } + if (_completeHandlers == null) + return; + _completeHandlers(this); + } + + protected static IntPtr AllocNativeBuffer(uint length) => NativeApi.MemAlloc(length, false); + + protected static void FreeNativeBuffer(IntPtr buffer) => NativeApi.MemFree(buffer); + + private void FireAcquisitionCompleteHandlers() + { + if (_completeHandlers == null) + return; + _completeHandlers(this); + _completeHandlers = null; + } + + public override string ToString() => _uri; + } +} diff --git a/UIX/Microsoft/Iris/Data/ResourceAcquisitionCompleteHandler.cs b/UIX/Microsoft/Iris/Data/ResourceAcquisitionCompleteHandler.cs new file mode 100644 index 0000000..9da0824 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/ResourceAcquisitionCompleteHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.ResourceAcquisitionCompleteHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Data +{ + internal delegate void ResourceAcquisitionCompleteHandler(Resource resource); +} diff --git a/UIX/Microsoft/Iris/Data/ResourceManager.cs b/UIX/Microsoft/Iris/Data/ResourceManager.cs new file mode 100644 index 0000000..9606b59 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/ResourceManager.cs @@ -0,0 +1,138 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.ResourceManager +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Data +{ + internal sealed class ResourceManager + { + internal const string ProtocolSeparator = "://"; + private Vector _redirects; + private Map _sourcesTable; + private static ResourceManager s_instance = new ResourceManager(); + + private ResourceManager() => _sourcesTable = new Map(); + + public static ResourceManager Instance => s_instance; + + public void RegisterSource(string scheme, IResourceProvider source) => _sourcesTable[scheme] = source; + + public void UnregisterSource(string scheme) => _sourcesTable.Remove(scheme); + + public bool IsRegisteredSource(string scheme) => _sourcesTable.ContainsKey(scheme); + + public Resource GetResource(string uri) => GetResource(uri, false); + + public Resource GetResource(string uri, bool forceSynchronous) + { + Resource resource = null; + if (_redirects != null) + { + foreach (ResourceManager.UriRedirect redirect in _redirects) + { + if (uri.StartsWith(redirect.fromPrefix, StringComparison.OrdinalIgnoreCase)) + { + if (redirect.toPrefix.Equals("{ERROR}", StringComparison.OrdinalIgnoreCase)) + { + ErrorManager.ReportError("Resource {0} not found, but should have been located by a markup redirect", uri); + return null; + } + resource = GetResourceWorker(redirect.toPrefix + uri.Substring(redirect.fromPrefix.Length), true); + if (resource != null) + { + resource.Acquire(); + bool flag = resource.Status == ResourceStatus.Available; + resource.Free(); + if (!flag) + resource = null; + } + } + if (resource != null) + break; + } + } + if (resource == null) + resource = GetResourceWorker(uri, forceSynchronous); + return resource; + } + + private Resource GetResourceWorker(string uri, bool forceSynchronous) + { + Resource resource = null; + string scheme; + string hierarchicalPart; + ParseUri(uri, out scheme, out hierarchicalPart); + if (string.IsNullOrEmpty(scheme) || string.IsNullOrEmpty(hierarchicalPart)) + { + ErrorManager.ReportWarning("Invalid resource uri: '{0}'", uri); + return null; + } + IResourceProvider resourceProvider; + if (_sourcesTable.TryGetValue(scheme, out resourceProvider)) + resource = resourceProvider.GetResource(hierarchicalPart, uri, forceSynchronous); + else + ErrorManager.ReportWarning("Invalid resource protocol: '{0}'", scheme); + return resource; + } + + public static void ParseUri(string uri, out string scheme, out string hierarchicalPart) + { + int length = uri.IndexOf("://", StringComparison.Ordinal); + if (length > 0) + { + scheme = uri.Substring(0, length); + hierarchicalPart = uri.Substring(length + "://".Length); + } + else + { + scheme = null; + hierarchicalPart = uri; + } + } + + public void AddUriRedirect(string fromPrefix, string toPrefix) + { + ResourceManager.UriRedirect uriRedirect = new ResourceManager.UriRedirect(); + uriRedirect.fromPrefix = fromPrefix; + uriRedirect.toPrefix = toPrefix; + if (_redirects == null) + _redirects = new Vector(); + _redirects.Add(uriRedirect); + } + + public static Resource AcquireResource(string uri) + { + ErrorWatermark watermark = ErrorManager.Watermark; + Resource resource = Instance.GetResource(uri, true); + if (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}'", 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", uri); + if (watermark.ErrorsDetected) + { + resource.Free(); + resource = null; + } + return resource; + } + + internal struct UriRedirect + { + public string fromPrefix; + public string toPrefix; + } + } +} diff --git a/UIX/Microsoft/Iris/Data/ResourceStatus.cs b/UIX/Microsoft/Iris/Data/ResourceStatus.cs new file mode 100644 index 0000000..ac8efcf --- /dev/null +++ b/UIX/Microsoft/Iris/Data/ResourceStatus.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.ResourceStatus +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Data +{ + internal enum ResourceStatus + { + NeedsAcquire, + Acquiring, + Available, + Error, + } +} diff --git a/UIX/Microsoft/Iris/Data/SingleArrayListCache.cs b/UIX/Microsoft/Iris/Data/SingleArrayListCache.cs new file mode 100644 index 0000000..3eb6bf0 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/SingleArrayListCache.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.SingleArrayListCache +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Data +{ + internal struct SingleArrayListCache + { + private ArrayList _list; + + public ArrayList Acquire() + { + ArrayList arrayList = _list; + _list = null; + if (arrayList == null) + arrayList = new ArrayList(); + return arrayList; + } + + public void Release(ArrayList list) + { + list.Clear(); + _list = list; + } + } +} diff --git a/UIX/Microsoft/Iris/Data/SlowDataAcquireCompleteHandler.cs b/UIX/Microsoft/Iris/Data/SlowDataAcquireCompleteHandler.cs new file mode 100644 index 0000000..3fb7f39 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/SlowDataAcquireCompleteHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.SlowDataAcquireCompleteHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Data +{ + internal delegate bool SlowDataAcquireCompleteHandler(IVirtualList list, int index); +} diff --git a/UIX/Microsoft/Iris/Data/StringUtility.cs b/UIX/Microsoft/Iris/Data/StringUtility.cs new file mode 100644 index 0000000..a647f23 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/StringUtility.cs @@ -0,0 +1,180 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.StringUtility +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Text; + +namespace Microsoft.Iris.Data +{ + internal static class StringUtility + { + public static string[] SplitAndTrim(char separator, string splitee) + { + string[] strArray = splitee.Split(separator); + for (int index = 0; index < strArray.Length; ++index) + strArray[index] = strArray[index].Trim(); + return strArray; + } + + public static string Unescape(string source, out int errorIndex, out string invalidSequence) + { + invalidSequence = null; + errorIndex = -1; + if (source.IndexOf('\\') == -1) + return source; + StringBuilder stringBuilder = new StringBuilder(source.Length); + int index = 0; + int startIndex = 0; + int length = source.Length; + bool flag = true; + while (flag && index < length) + { + startIndex = index; + char ch1 = source[index++]; + if (ch1 != '\\') + { + stringBuilder.Append(ch1); + } + else + { + if (index == length) + { + flag = false; + break; + } + char mode = source[index++]; + char ch2 = char.MinValue; + char ch3 = char.MinValue; + switch (mode) + { + case '"': + ch2 = '"'; + break; + case '\'': + ch2 = '\''; + break; + case '0': + ch2 = char.MinValue; + break; + case 'U': + case 'u': + case 'x': + uint result; + flag = ReadHexSequence(mode, source, ref index, length, out result); + if (flag) + { + if (result <= ushort.MaxValue) + { + ch2 = (char)result; + break; + } + if (result <= 1114111U) + { + ch2 = (char)((result - 65536U) / 1024U + 55296U); + ch3 = (char)((result - 65536U) % 1024U + 56320U); + break; + } + flag = false; + break; + } + break; + case '\\': + ch2 = '\\'; + break; + case 'a': + ch2 = '\a'; + break; + case 'b': + ch2 = '\b'; + break; + case 'f': + ch2 = '\f'; + break; + case 'n': + ch2 = '\n'; + break; + case 'r': + ch2 = '\r'; + break; + case 't': + ch2 = '\t'; + break; + case 'v': + ch2 = '\v'; + break; + default: + flag = false; + break; + } + if (flag) + { + stringBuilder.Append(ch2); + if (ch3 != char.MinValue) + stringBuilder.Append(ch3); + } + } + } + string str; + if (!flag) + { + str = null; + errorIndex = startIndex; + invalidSequence = source.Substring(startIndex, index - startIndex); + } + else + { + str = stringBuilder.ToString(); + errorIndex = -1; + } + return str; + } + + private static bool ReadHexSequence( + char mode, + string source, + ref int index, + int indexLast, + out uint result) + { + int num1; + int num2; + switch (mode) + { + case 'u': + num1 = 4; + num2 = 4; + break; + case 'x': + num1 = 1; + num2 = 4; + break; + default: + num1 = 8; + num2 = 8; + break; + } + int num3 = 0; + uint num4 = 0; + for (; index < indexLast && num3 < num2; ++num3) + { + char ch = source[index]; + uint num5; + if (ch >= '0' && ch <= '9') + num5 = ch - 48U; + else if (ch >= 'a' && ch <= 'f') + num5 = (uint)(10 + (ch - 97)); + else if (ch >= 'A' && ch <= 'F') + num5 = (uint)(10 + (ch - 65)); + else + break; + num4 = (num4 << 4) + num5; + ++index; + } + bool flag = num3 >= num1; + result = flag ? num4 : 0U; + return flag; + } + } +} diff --git a/UIX/Microsoft/Iris/Data/UIListContentsChangeType.cs b/UIX/Microsoft/Iris/Data/UIListContentsChangeType.cs new file mode 100644 index 0000000..1d6097e --- /dev/null +++ b/UIX/Microsoft/Iris/Data/UIListContentsChangeType.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.UIListContentsChangeType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Data +{ + internal enum UIListContentsChangeType + { + Add, + AddRange, + Remove, + Move, + Insert, + InsertRange, + Clear, + Modified, + Reset, + } +} diff --git a/UIX/Microsoft/Iris/Data/UIListContentsChangedArgs.cs b/UIX/Microsoft/Iris/Data/UIListContentsChangedArgs.cs new file mode 100644 index 0000000..36db2c7 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/UIListContentsChangedArgs.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.UIListContentsChangedArgs +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Data +{ + internal class UIListContentsChangedArgs : EventArgs + { + private UIListContentsChangeType _type; + private int _oldIndex; + private int _newIndex; + private int _count; + + public UIListContentsChangedArgs( + UIListContentsChangeType type, + int oldIndex, + int newIndex, + int count) + { + _count = count; + _type = type; + _oldIndex = oldIndex; + _newIndex = newIndex; + } + + public UIListContentsChangedArgs(UIListContentsChangeType type, int oldIndex, int newIndex) + : this(type, oldIndex, newIndex, 1) + { + } + + public UIListContentsChangeType Type => _type; + + public int OldIndex => _oldIndex; + + public int NewIndex => _newIndex; + + public int Count => _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/UIListContentsChangedHandler.cs b/UIX/Microsoft/Iris/Data/UIListContentsChangedHandler.cs new file mode 100644 index 0000000..a6ad7a5 --- /dev/null +++ b/UIX/Microsoft/Iris/Data/UIListContentsChangedHandler.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.UIListContentsChangedHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Data +{ + internal delegate void UIListContentsChangedHandler( + IList senderList, + UIListContentsChangedArgs args); +} diff --git a/UIX/Microsoft/Iris/Data/UpdateHelper.cs b/UIX/Microsoft/Iris/Data/UpdateHelper.cs new file mode 100644 index 0000000..ed5480f --- /dev/null +++ b/UIX/Microsoft/Iris/Data/UpdateHelper.cs @@ -0,0 +1,192 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Data.UpdateHelper +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using Microsoft.Iris.ViewItems; +using System; +using System.Collections.Generic; +using System.Diagnostics; + +namespace Microsoft.Iris.Data +{ + internal class UpdateHelper + { + private const int c_millisecondsBetweenUpdates = 100; + private const int c_millisecondsAllowedPerUpdate = 10; + private UpdateHelper.ItemDistanceComparer _itemDistanceComparer; + private IVirtualList _virtualList; + private List _itemsToUpdate; + private int _lastInterestIndex; + private DispatcherTimer _timer; + private bool _listIsDirty; + private List _outstandingUpdates; + private int _throttle; + + public UpdateHelper(IVirtualList virtualList) + { + _virtualList = virtualList; + _itemsToUpdate = new List(); + _throttle = Environment.ProcessorCount * 2; + _outstandingUpdates = new List(); + } + + public void AddIndex(int index) + { + _itemsToUpdate.Add(index); + _listIsDirty = true; + TriggerNextUpdate(); + } + + public void AdjustIndices(int lowThreshold, int amount) => AdjustIndices(lowThreshold, int.MaxValue, amount); + + public void AdjustIndices(int lowThreshold, int highThreshold, int amt) + { + for (int index = 0; index < _itemsToUpdate.Count; ++index) + { + int num = _itemsToUpdate[index]; + if (num >= lowThreshold && num <= highThreshold) + _itemsToUpdate[index] = num + amt; + } + if (_lastInterestIndex < lowThreshold || _lastInterestIndex > highThreshold) + return; + _lastInterestIndex += amt; + } + + public void Clear() => _itemsToUpdate.Clear(); + + public void RemoveIndex(int index) + { + int count = _itemsToUpdate.Count; + int index1 = 0; + while (index1 < count && _itemsToUpdate[index1] != index) + ++index1; + if (index1 >= count) + return; + int index2 = index1; + for (int index3 = index1 + 1; index3 < count; ++index3) + { + int num = _itemsToUpdate[index3]; + if (num != index) + { + _itemsToUpdate[index2] = num; + ++index2; + } + } + _itemsToUpdate.RemoveRange(index2, count - index2); + } + + public void Dispose() + { + if (_timer == null) + return; + _timer.Enabled = false; + } + + private void TriggerNextUpdate() + { + EnsureTimer(); + _timer.Enabled = true; + } + + private void DeliverNextUpdate(object senderObject, EventArgs unusedArgs) + { + if (_itemsToUpdate.Count == 0) + return; + if (_outstandingUpdates.Count == _throttle) + { + TriggerNextUpdate(); + } + else + { + Repeater repeaterHost = _virtualList.RepeaterHost; + if (repeaterHost == null) + return; + int index1 = -1; + repeaterHost.GetFocusedIndex(ref index1); + if (repeaterHost.GetExtendedLayoutOutput(VisibleIndexRangeLayoutOutput.DataCookie) is VisibleIndexRangeLayoutOutput extendedLayoutOutput) + { + if (index1 != -1 && (index1 < extendedLayoutOutput.BeginVisible || index1 > extendedLayoutOutput.EndVisible)) + index1 = -1; + if (index1 == -1) + index1 = extendedLayoutOutput.BeginVisible; + } + if (index1 != -1) + { + int dataIndex; + ListUtility.GetWrappedIndex(index1, _virtualList.Count, out dataIndex, out int _); + if (_lastInterestIndex != dataIndex) + _listIsDirty = true; + _lastInterestIndex = dataIndex; + } + if (_listIsDirty) + { + if (_itemDistanceComparer == null) + _itemDistanceComparer = new UpdateHelper.ItemDistanceComparer(); + _itemDistanceComparer.Initialize(_lastInterestIndex, _virtualList.Count); + _itemsToUpdate.Sort(_itemDistanceComparer); + _listIsDirty = false; + } + Stopwatch stopwatch = new Stopwatch(); + stopwatch.Start(); + int count = 0; + do + { + ++count; + int index2 = _itemsToUpdate[_itemsToUpdate.Count - count]; + _outstandingUpdates.Add(index2); + _virtualList.NotifyRequestSlowData(index2); + } + while (stopwatch.ElapsedMilliseconds < 10L && _itemsToUpdate.Count != count && _outstandingUpdates.Count < _throttle); + _itemsToUpdate.RemoveRange(_itemsToUpdate.Count - count, count); + if (_itemsToUpdate.Count == 0) + return; + TriggerNextUpdate(); + } + } + + public int Throttle + { + get => _throttle; + set => _throttle = value; + } + + public bool NotifySlowDataAcquireComplete(int index) => _outstandingUpdates.Remove(index); + + private void EnsureTimer() + { + if (_timer != null) + return; + _timer = new DispatcherTimer(); + _timer.AutoRepeat = false; + _timer.Interval = 100; + _timer.Tick += new EventHandler(DeliverNextUpdate); + } + + private class ItemDistanceComparer : IComparer + { + private int _focusedIndex; + private int _totalCount; + private int _midPoint; + + public void Initialize(int focusedIndex, int totalCount) + { + _focusedIndex = focusedIndex; + _totalCount = totalCount; + _midPoint = totalCount / 2; + } + + public int Compare(int left, int right) => GetDistance(right) - GetDistance(left); + + private int GetDistance(int potential) + { + int num = Math.Abs(potential - _focusedIndex); + if (num > _midPoint) + num = _totalCount - num + 1; + return num; + } + } + } +} diff --git a/UIX/Microsoft/Iris/DataProviderMapping.cs b/UIX/Microsoft/Iris/DataProviderMapping.cs new file mode 100644 index 0000000..9402f8b --- /dev/null +++ b/UIX/Microsoft/Iris/DataProviderMapping.cs @@ -0,0 +1,70 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DataProviderMapping +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.Markup.UIX; +using System; + +namespace Microsoft.Iris +{ + public class DataProviderMapping + { + private string _source; + private string _target; + private object _defaultValue; + private PropertySchema _propertySchema; + private Type _assemblyPropertyType; + private Type _assemblyAlternateType; + + public object PropertyTypeCookie => _propertySchema.PropertyType; + + public object UnderlyingCollectionTypeCookie => _propertySchema.AlternateType; + + public string PropertyName => _propertySchema.Name; + + public string PropertyTypeName => GetCanonicalTypeName(_propertySchema.PropertyType); + + public Type PropertyType => _assemblyPropertyType; + + public string UnderlyingCollectionTypeName => GetCanonicalTypeName(_propertySchema.AlternateType); + + public Type UnderlyingCollectionType => _assemblyAlternateType; + + public string Source => _source; + + public string Target => _target; + + public object DefaultValue => _defaultValue; + + internal DataProviderMapping(PropertySchema propertySchema, object defaultValue) + : this(propertySchema, null, null, defaultValue) + { + } + + internal DataProviderMapping( + PropertySchema propertySchema, + string source, + string target, + object defaultValue) + { + _propertySchema = propertySchema; + _source = source; + _target = target; + _defaultValue = defaultValue; + _assemblyPropertyType = AssemblyLoadResult.MapType(_propertySchema.PropertyType); + if (_propertySchema.AlternateType == null) + return; + _assemblyAlternateType = AssemblyLoadResult.MapType(_propertySchema.AlternateType); + } + + internal static string GetCanonicalTypeName(TypeSchema typeSchema) + { + if (typeSchema == null) + return null; + return typeSchema == ListSchema.Type ? "List" : typeSchema.Name; + } + } +} diff --git a/UIX/Microsoft/Iris/DataProviderObject.cs b/UIX/Microsoft/Iris/DataProviderObject.cs new file mode 100644 index 0000000..bf847ea --- /dev/null +++ b/UIX/Microsoft/Iris/DataProviderObject.cs @@ -0,0 +1,94 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DataProviderObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using System; +using System.Collections.Generic; + +namespace Microsoft.Iris +{ + public abstract class DataProviderObject : + IDataProviderObject, + IDataProviderBaseObject, + AssemblyObjectProxyHelper.IFrameworkProxyObject + { + private DataProviderQuery _owner; + private MarkupDataTypeSchema _typeSchema; + private MarkupDataType _internalObject; + private Dictionary _mappings; + private static object SynchronizedFindDataMappings = new object(); + + public abstract object GetProperty(string propertyName); + + public abstract void SetProperty(string propertyName, object value); + + protected DataProviderObject(DataProviderQuery owner, object typeCookie) + { + _owner = owner != null ? owner : throw new ArgumentNullException(nameof(owner)); + _typeSchema = typeCookie as MarkupDataTypeSchema; + if (_typeSchema != null) + return; + if (typeCookie is TypeSchema) + throw new ArgumentException(((TypeSchema)typeCookie).Name + " is not a valid type for a DataProviderObject", nameof(typeCookie)); + if (typeCookie == null) + throw new ArgumentNullException(nameof(typeCookie)); + throw new ArgumentException("typeCookie must be a TypeCookie from a DataProviderMapping", nameof(typeCookie)); + } + + internal DataProviderObject(MarkupDataTypeSchema typeSchema) => _typeSchema = typeSchema; + + public DataProviderQuery Owner => _owner; + + public string TypeName => _typeSchema.Name; + + protected IDictionary Mappings + { + get + { + if (_mappings == null) + { + lock (SynchronizedFindDataMappings) + { + MarkupDataMapping dataMapping = MarkupDataProvider.FindDataMapping(_owner != null ? _owner.ProviderName : string.Empty, _typeSchema); + if (dataMapping.AssemblyDataProviderCookie == null) + { + Dictionary dictionary = new Dictionary(dataMapping.Mappings.Length); + foreach (MarkupDataMappingEntry mapping in dataMapping.Mappings) + dictionary[mapping.Property.Name] = new DataProviderMapping(mapping.Property, mapping.Source, mapping.Target, AssemblyLoadResult.UnwrapObject(mapping.DefaultValue)); + dataMapping.AssemblyDataProviderCookie = dictionary; + } + _mappings = (Dictionary)dataMapping.AssemblyDataProviderCookie; + } + } + return _mappings; + } + } + + protected void FirePropertyChanged(string propertyName) + { + OnPropertyChanged(propertyName); + if (_internalObject == null) + return; + _internalObject.FireNotificationThreadSafe(propertyName); + } + + protected virtual void OnPropertyChanged(string propertyName) + { + } + + object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject + { + get + { + if (_internalObject == null) + _internalObject = new AssemblyMarkupDataType(_typeSchema, this); + return _internalObject; + } + } + + public override string ToString() => _typeSchema == null ? base.ToString() : _typeSchema.Name; + } +} diff --git a/UIX/Microsoft/Iris/DataProviderPropertyChangedEventArgs.cs b/UIX/Microsoft/Iris/DataProviderPropertyChangedEventArgs.cs new file mode 100644 index 0000000..1a31de0 --- /dev/null +++ b/UIX/Microsoft/Iris/DataProviderPropertyChangedEventArgs.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DataProviderPropertyChangedEventArgs +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.ComponentModel; + +namespace Microsoft.Iris +{ + public class DataProviderPropertyChangedEventArgs : PropertyChangedEventArgs + { + private bool _invalidatesQuery; + + public DataProviderPropertyChangedEventArgs(string name, bool invalidatesQuery) + : base(name) + => _invalidatesQuery = invalidatesQuery; + + public bool InvalidatesQuery => _invalidatesQuery; + } +} diff --git a/UIX/Microsoft/Iris/DataProviderQuery.cs b/UIX/Microsoft/Iris/DataProviderQuery.cs new file mode 100644 index 0000000..4196c70 --- /dev/null +++ b/UIX/Microsoft/Iris/DataProviderQuery.cs @@ -0,0 +1,204 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DataProviderQuery +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using System; +using System.Collections.Generic; +using System.ComponentModel; + +namespace Microsoft.Iris +{ + public abstract class DataProviderQuery : + IDataProviderQuery, + IDataProviderBaseObject, + AssemblyObjectProxyHelper.IFrameworkProxyObject, + IDisposableObject, + INotifyPropertyChanged + { + private MarkupDataQuerySchema _typeSchema; + private MarkupDataQuery _internalQuery; + private Dictionary _propertyValues; + private object _result; + private DataProviderQueryStatus _status; + private bool _isDisposed; + private bool _isInvalid; + private bool _enabled = true; + private bool _initialized; + + protected abstract void BeginExecute(); + + public object ResultTypeCookie => _typeSchema.ResultType; + + public object Result + { + get => _result; + set + { + if (Equals(_result, value)) + return; + _result = value; + FirePropertyChanged(nameof(Result)); + } + } + + public DataProviderQueryStatus Status + { + get => _status; + set + { + if (_status == value) + return; + _status = value; + FirePropertyChanged(nameof(Status)); + } + } + + public bool Enabled + { + get => _enabled; + set + { + if (_enabled == value) + return; + _enabled = value; + FirePropertyChanged(nameof(Enabled)); + if (!_enabled || !_isInvalid) + return; + DeferredBeginExecute(null); + } + } + + protected bool Initialized => _initialized; + + public void Refresh() => BeginExecute(); + + public virtual object GetProperty(string propertyName) + { + lock (SynchronizedPropertyStorage) + { + if (_propertyValues != null) + { + object obj; + if (_propertyValues.TryGetValue(propertyName, out obj)) + return obj; + } + } + return null; + } + + public virtual void SetProperty(string propertyName, object value) + { + bool flag1 = false; + lock (SynchronizedPropertyStorage) + { + bool flag2 = false; + if (_propertyValues == null) + { + _propertyValues = new Dictionary(); + flag2 = true; + } + if (!flag2 && _propertyValues.ContainsKey(propertyName)) + { + if (Equals(_propertyValues[propertyName], value)) + goto label_8; + } + _propertyValues[propertyName] = value; + flag1 = true; + } + label_8: + if (!flag1) + return; + FirePropertyChanged(propertyName); + } + + protected void FirePropertyChanged(string propertyName) + { + OnPropertyChanged(propertyName); + if (_internalQuery != null) + _internalQuery.FireNotificationThreadSafe(propertyName); + bool invalidatesQuery = _typeSchema.InvalidatesQuery(propertyName); + if (PropertyChanged != null) + PropertyChanged(this, new DataProviderPropertyChangedEventArgs(propertyName, invalidatesQuery)); + if (_isInvalid || !invalidatesQuery) + return; + _isInvalid = true; + if (!_enabled) + return; + Application.DeferredInvoke(new DeferredInvokeHandler(DeferredBeginExecute), DeferredInvokePriority.Low); + } + + public event PropertyChangedEventHandler PropertyChanged; + + private void DeferredBeginExecute(object args) + { + if (!_isInvalid) + return; + _isInvalid = false; + BeginExecute(); + } + + protected virtual void OnPropertyChanged(string propertyName) + { + } + + protected virtual void OnDispose() + { + } + + public bool IsDisposed => _isDisposed; + + void IDisposableObject.DeclareOwner(object owner) => DeclareOwnerWorker(owner); + + void IDataProviderQuery.DeclareOwner(object owner) => DeclareOwnerWorker(owner); + + private void DeclareOwnerWorker(object owner) + { + } + + void IDisposableObject.TransferOwnership(object owner) + { + } + + void IDisposableObject.Dispose(object owner) => DisposeWorker(owner); + + void IDataProviderQuery.Dispose(object owner) => DisposeWorker(owner); + + private void DisposeWorker(object owner) + { + if (_isDisposed) + return; + OnDispose(); + _isDisposed = true; + } + + protected DataProviderQuery(object typeCookie) + { + _typeSchema = typeCookie as MarkupDataQuerySchema; + if (_typeSchema == null) + throw new ArgumentException(nameof(typeCookie), "typeCookie must be the queryTypeCookie passed to ConstructQuery"); + _isInvalid = true; + } + + object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => _internalQuery; + + internal string ProviderName => _typeSchema.ProviderName; + + void IDataProviderQuery.SetInternalObject(MarkupDataQuery internalQuery) => _internalQuery = internalQuery; + + void IDataProviderQuery.OnInitialize() + { + _initialized = true; + if (!_enabled) + return; + DeferredBeginExecute(null); + } + + public override string ToString() => _typeSchema.Name; + + private object SynchronizedPropertyStorage => _internalQuery; + } +} diff --git a/UIX/Microsoft/Iris/DataProviderQueryFactory.cs b/UIX/Microsoft/Iris/DataProviderQueryFactory.cs new file mode 100644 index 0000000..900cd5c --- /dev/null +++ b/UIX/Microsoft/Iris/DataProviderQueryFactory.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DataProviderQueryFactory +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public delegate DataProviderQuery DataProviderQueryFactory(object queryTypeCookie); +} diff --git a/UIX/Microsoft/Iris/DataProviderQueryStatus.cs b/UIX/Microsoft/Iris/DataProviderQueryStatus.cs new file mode 100644 index 0000000..2df76dc --- /dev/null +++ b/UIX/Microsoft/Iris/DataProviderQueryStatus.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DataProviderQueryStatus +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public enum DataProviderQueryStatus + { + Idle, + RequestingData, + ProcessingData, + Complete, + Error, + } +} diff --git a/UIX/Microsoft/Iris/DeferredInvokeHandler.cs b/UIX/Microsoft/Iris/DeferredInvokeHandler.cs new file mode 100644 index 0000000..30efbc1 --- /dev/null +++ b/UIX/Microsoft/Iris/DeferredInvokeHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DeferredInvokeHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public delegate void DeferredInvokeHandler(object args); +} diff --git a/UIX/Microsoft/Iris/DeferredInvokePriority.cs b/UIX/Microsoft/Iris/DeferredInvokePriority.cs new file mode 100644 index 0000000..66a2144 --- /dev/null +++ b/UIX/Microsoft/Iris/DeferredInvokePriority.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DeferredInvokePriority +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public enum DeferredInvokePriority + { + Normal, + Low, + } +} diff --git a/UIX/Microsoft/Iris/DeferredInvokeProxy.cs b/UIX/Microsoft/Iris/DeferredInvokeProxy.cs new file mode 100644 index 0000000..244f576 --- /dev/null +++ b/UIX/Microsoft/Iris/DeferredInvokeProxy.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.DeferredInvokeProxy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; + +namespace Microsoft.Iris +{ + internal class DeferredInvokeProxy + { + private DeferredInvokeHandler _method; + + public static DeferredHandler Thunk(DeferredInvokeHandler method) => new DeferredHandler(new DeferredInvokeProxy() + { + _method = method + }.Thunk); + + private void Thunk(object args) => _method(args); + } +} diff --git a/UIX/Microsoft/Iris/Drawing/Camera.cs b/UIX/Microsoft/Iris/Drawing/Camera.cs new file mode 100644 index 0000000..89ec143 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/Camera.cs @@ -0,0 +1,448 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.Camera +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Collections; +using System.Diagnostics; + +namespace Microsoft.Iris.Drawing +{ + internal class Camera : SharedDisposableObject, INotifyObject, IAnimatableOwner + { + private ICamera _camera; + private Vector3 _vEyeNoSend; + private Vector3 _vAtNoSend; + private Vector3 _vUpNoSend; + private float _flZnNoSend; + private bool _hasEyeNoSend; + private bool _hasAtNoSend; + private bool _hasUpNoSend; + private bool _hasZnNoSend; + private Vector _activeAnimations; + private IAnimationProvider _eyeAnimation; + private IAnimationProvider _atAnimation; + private IAnimationProvider _upAnimation; + private IAnimationProvider _znAnimation; + private NotifyService _notifier = new NotifyService(); + private IList _listeners = new ArrayList(); + + public Camera() => _camera = UISession.Default.RenderSession.CreateCamera(this); + + protected override void OnDispose() + { + base.OnDispose(); + Vector activeAnimations = GetActiveAnimations(false); + if (activeAnimations != null) + { + foreach (DisposableObject disposableObject in activeAnimations) + disposableObject.Dispose(this); + } + _camera.UnregisterUsage(this); + _camera = null; + } + + public void AddListener(Listener listener) => _notifier.AddListener(listener); + + protected void FireNotification(string id) + { + _notifier.Fire(id); + foreach (object listener in _listeners) + { + if (listener is ViewItem viewItem) + viewItem.MarkPaintInvalid(); + } + } + + public override void RegisterUsage(object consumer) + { + base.RegisterUsage(consumer); + _listeners.Add(consumer); + } + + public override void UnregisterUsage(object consumer) + { + _listeners.Remove(consumer); + base.UnregisterUsage(consumer); + } + + public bool Perspective + { + get => _camera.Perspective; + set + { + if (_camera.Perspective == value) + return; + _camera.Perspective = value; + FireNotification(NotificationID.Perspective); + } + } + + public Vector3 Eye + { + get => _hasEyeNoSend ? _vEyeNoSend : _camera.Eye; + set + { + if (!(_camera.Eye != value)) + return; + CameraEyeNoSend = value; + if (_eyeAnimation == null || !PlayAnimation(_eyeAnimation, null)) + CameraEye = value; + FireNotification(NotificationID.Eye); + } + } + + private Vector3 CameraEyeNoSend + { + set + { + _hasEyeNoSend = true; + _vEyeNoSend = value; + } + } + + internal Vector3 CameraEye + { + set + { + _camera.Eye = value; + _hasEyeNoSend = false; + } + } + + public Vector3 At + { + get => _hasAtNoSend ? _vAtNoSend : _camera.At; + set + { + if (!(_camera.At != value)) + return; + CameraAtNoSend = value; + if (_atAnimation == null || !PlayAnimation(_atAnimation, null)) + CameraAt = value; + FireNotification(NotificationID.At); + } + } + + private Vector3 CameraAtNoSend + { + set + { + _hasAtNoSend = true; + _vAtNoSend = value; + } + } + + internal Vector3 CameraAt + { + set + { + _camera.At = value; + _hasAtNoSend = false; + } + } + + public Vector3 Up + { + get => _hasUpNoSend ? _vUpNoSend : _camera.Up; + set + { + if (!(_camera.Up != value)) + return; + CameraUpNoSend = value; + if (_upAnimation == null || !PlayAnimation(_upAnimation, null)) + CameraUp = value; + FireNotification(NotificationID.Up); + } + } + + private Vector3 CameraUpNoSend + { + set + { + _hasUpNoSend = true; + _vUpNoSend = value; + } + } + + internal Vector3 CameraUp + { + set + { + _camera.Up = value; + _hasUpNoSend = false; + } + } + + public float Zn + { + get => _hasZnNoSend ? _flZnNoSend : _camera.Zn; + set + { + if (_camera.Zn == (double)value) + return; + CameraZnNoSend = value; + if (_znAnimation == null || !PlayAnimation(_znAnimation, null)) + CameraZn = value; + FireNotification(NotificationID.Zn); + } + } + + private float CameraZnNoSend + { + set + { + _hasZnNoSend = true; + _flZnNoSend = value; + } + } + + internal float CameraZn + { + set + { + _camera.Zn = value; + _hasZnNoSend = false; + } + } + + internal ICamera APICamera => _camera; + + IAnimatable IAnimatableOwner.AnimationTarget => _camera; + + public IAnimationProvider EyeAnimation + { + get => _eyeAnimation; + set + { + if (_eyeAnimation == value) + return; + _eyeAnimation = value; + FireNotification(NotificationID.EyeAnimation); + } + } + + public IAnimationProvider AtAnimation + { + get => _atAnimation; + set + { + if (_atAnimation == value) + return; + _atAnimation = value; + FireNotification(NotificationID.AtAnimation); + } + } + + public IAnimationProvider UpAnimation + { + get => _upAnimation; + set + { + if (_upAnimation == value) + return; + _upAnimation = value; + FireNotification(NotificationID.UpAnimation); + } + } + + public IAnimationProvider ZnAnimation + { + get => _znAnimation; + set + { + if (_znAnimation == value) + return; + _znAnimation = value; + FireNotification(NotificationID.ZnAnimation); + } + } + + public bool PlayAnimation(IAnimationProvider ab, AnimationHandle animationHandle) + { + AnimationArgs args = new AnimationArgs(this); + return PlayAnimation(ab, ref args, UIClass.ShouldPlayAnimation(ab), animationHandle); + } + + private bool PlayAnimation( + IAnimationProvider ab, + ref AnimationArgs args, + bool shouldPlayAnimation, + AnimationHandle animationHandle) + { + AnimationTemplate anim = BuildAnimation(ab, ref args); + if (anim == null) + return false; + if (shouldPlayAnimation) + { + PlayAnimation(anim, ref args, null, animationHandle); + } + else + { + ApplyFinalAnimationState(anim, ref args); + animationHandle?.FireCompleted(); + } + return true; + } + + private void PlayAnimation( + AnimationTemplate anim, + ref AnimationArgs args, + EventHandler onCompleteHandler, + AnimationHandle animationHandle) + { + ActiveSequence instance = anim.CreateInstance(APICamera, ref args); + if (instance == null) + return; + instance.DeclareOwner(this); + if (onCompleteHandler != null) + instance.AnimationCompleted += onCompleteHandler; + animationHandle?.AssociateWithAnimationInstance(instance); + instance.AnimationCompleted += new EventHandler(OnAnimationComplete); + GetActiveAnimations(true).Add(instance); + OnAnimationListChanged(); + PlayAnimationWorker(instance); + if (!(anim is Animation animation)) + return; + int num = animation.DisableMouseInput ? 1 : 0; + } + + private void PlayAnimationWorker(ActiveSequence newSequence) + { + StopOverlappingAnimations(newSequence); + newSequence.Play(); + } + + private AnimationTemplate BuildAnimation( + IAnimationProvider ab, + ref AnimationArgs args) + { + return ab.Build(ref args); + } + + private void StopOverlappingAnimations(ActiveSequence newSequence) + { + Vector activeAnimations = GetActiveAnimations(false); + if (activeAnimations == null) + return; + ActiveTransitions activeTransitions = newSequence.GetActiveTransitions(); + StopCommandSet stopCommand = null; + foreach (ActiveSequence playingSequence in activeAnimations) + StopAnimationIfOverlapping(playingSequence, newSequence, activeTransitions, ref stopCommand); + } + + private bool StopAnimationIfOverlapping( + ActiveSequence playingSequence, + ActiveSequence newSequence, + ActiveTransitions newTransitions, + ref StopCommandSet stopCommand) + { + if (playingSequence.Target == newSequence.Target) + { + ActiveTransitions activeTransitions = playingSequence.GetActiveTransitions(); + if ((newTransitions & activeTransitions) != ActiveTransitions.None) + { + if (stopCommand == null) + { + stopCommand = newSequence.GetStopCommandSet(); + StopCommandSet stopCommandSet = stopCommand; + } + playingSequence.Stop(stopCommand); + return true; + } + } + return false; + } + + private void OnAnimationComplete(object sender, EventArgs args) + { + ActiveSequence activeSequence = sender as ActiveSequence; + activeSequence.AnimationCompleted -= new EventHandler(OnAnimationComplete); + Vector activeAnimations = GetActiveAnimations(false); + activeAnimations.Remove(activeSequence); + OnAnimationListChanged(); + if (activeAnimations.Count == 0) + _activeAnimations = null; + if (activeSequence.Template is Animation template) + { + int num = template.DisableMouseInput ? 1 : 0; + } + activeSequence.Dispose(this); + } + + private void StopActiveAnimations() + { + if (_activeAnimations == null) + return; + foreach (ActiveSequence activeAnimation in GetActiveAnimations(true)) + activeAnimation.Stop(); + } + + internal void ApplyFinalAnimationState(AnimationTemplate anim, ref AnimationArgs args) + { + BaseKeyframe[] baseKeyframeArray = new BaseKeyframe[20]; + foreach (BaseKeyframe keyframe in anim.Keyframes) + { + BaseKeyframe baseKeyframe = baseKeyframeArray[(uint)keyframe.Type]; + if (baseKeyframe == null || baseKeyframe.Time <= (double)keyframe.Time) + baseKeyframeArray[(uint)keyframe.Type] = keyframe; + } + foreach (BaseKeyframe baseKeyframe in baseKeyframeArray) + baseKeyframe?.Apply(this, ref args); + } + + private Vector GetActiveAnimations(bool createIfNone) => GetAnimationSequence(ref _activeAnimations, createIfNone); + + private Vector GetAnimationSequence( + ref Vector currentAnimationsList, + bool createIfNone) + { + Vector vector = null; + if (currentAnimationsList == null) + { + if (createIfNone) + { + vector = new Vector(); + currentAnimationsList = vector; + } + } + else + vector = currentAnimationsList; + return vector; + } + + private void OnAnimationListChanged() + { + } + + private static bool DoesAnimationListContainAnimationType( + Vector animationList, + ActiveTransitions type) + { + if (animationList != null) + { + foreach (ActiveSequence animation in animationList) + { + if ((animation.GetActiveTransitions() & type) == type) + return true; + } + } + return false; + } + + [Conditional("DEBUG")] + private void DEBUG_DumpAnimation(ActiveSequence aseq) + { + foreach (BaseKeyframe keyframe in aseq.Template.Keyframes) + ; + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/Color.cs b/UIX/Microsoft/Iris/Drawing/Color.cs new file mode 100644 index 0000000..365c372 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/Color.cs @@ -0,0 +1,227 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.Color +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using System; +using System.Text; + +namespace Microsoft.Iris.Drawing +{ + internal struct Color + { + private const int ARGBAlphaShift = 24; + private const int ARGBRedShift = 16; + private const int ARGBGreenShift = 8; + private const int ARGBBlueShift = 0; + private readonly uint value; + + public Color(int red, int green, int blue) => this = FromArgb(byte.MaxValue, red, green, blue); + + public Color(float red, float green, float blue) => this = FromArgb(1f, red, green, blue); + + public Color(int alpha, int red, int green, int blue) => this = FromArgb(alpha, red, green, blue); + + public Color(float alpha, float red, float green, float blue) => this = FromArgb(alpha, red, green, blue); + + internal Color(uint value) => this.value = value; + + public byte R + { + get => (byte)(Value >> 16 & byte.MaxValue); + set => this = FromArgb(A, value, G, B); + } + + public byte G + { + get => (byte)(Value >> 8 & byte.MaxValue); + set => this = FromArgb(A, R, value, B); + } + + public byte B + { + get => (byte)(Value & byte.MaxValue); + set => this = FromArgb(A, R, G, value); + } + + public byte A + { + get => (byte)(Value >> 24 & byte.MaxValue); + set => this = FromArgb(value, R, G, B); + } + + internal void GetArgb(out float a, out float r, out float g, out float b) + { + a = A / (float)byte.MaxValue; + r = R / (float)byte.MaxValue; + g = G / (float)byte.MaxValue; + b = B / (float)byte.MaxValue; + } + + internal uint Value => value; + + private static void CheckByte(int value, string name) + { + } + + private static int ChannelFromFloat(float value) => (int)(value * (double)byte.MaxValue); + + 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); + + internal static Color FromArgb(int alpha, int red, int green, int blue) + { + CheckByte(alpha, nameof(alpha)); + CheckByte(red, nameof(red)); + CheckByte(green, nameof(green)); + CheckByte(blue, nameof(blue)); + return new Color(MakeArgb((byte)alpha, (byte)red, (byte)green, (byte)blue)); + } + + internal static Color FromArgb(float alpha, float red, float green, float blue) => FromArgb(ChannelFromFloat(alpha), ChannelFromFloat(red), ChannelFromFloat(green), ChannelFromFloat(blue)); + + internal static Color FromArgb(int alpha, Color baseColor) + { + CheckByte(alpha, nameof(alpha)); + return new Color(MakeArgb((byte)alpha, baseColor.R, baseColor.G, baseColor.B)); + } + + internal static Color FromArgb(int red, int green, int blue) => FromArgb(byte.MaxValue, red, green, blue); + + internal float GetValue() + { + 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 (num2 > (double)num4) + num4 = num2; + if (num3 > (double)num4) + num4 = num3; + if (num2 < (double)num5) + num5 = num2; + if (num3 < (double)num5) + num5 = num3; + return (float)((num4 + (double)num5) / 2.0); + } + + internal float GetHue() + { + if (R == G && G == B) + return 0.0f; + 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 (num2 > (double)num5) + num5 = num2; + if (num3 > (double)num5) + num5 = num3; + if (num2 < (double)num6) + num6 = num2; + if (num3 < (double)num6) + num6 = num3; + float num7 = num5 - num6; + if (num1 == (double)num5) + num4 = (num2 - num3) / 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 (num8 < 0.0) + num8 += 360f; + return num8; + } + + internal float GetSaturation() + { + 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 (num2 > (double)num5) + num5 = num2; + if (num3 > (double)num5) + num5 = num3; + if (num2 < (double)num6) + num6 = num2; + if (num3 < (double)num6) + num6 = num3; + 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 (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(num1) % 6; + float num3 = num1 - num2; + float num4 = flValue * (1f - 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)(flValue * (double)byte.MaxValue), (int)(num6 * (double)byte.MaxValue), (int)(num4 * (double)byte.MaxValue)); + case 1: + 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)(num4 * (double)byte.MaxValue), (int)(flValue * (double)byte.MaxValue), (int)(num6 * (double)byte.MaxValue)); + case 3: + 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)(num6 * (double)byte.MaxValue), (int)(num4 * (double)byte.MaxValue), (int)(flValue * (double)byte.MaxValue)); + case 5: + 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); + } + } + + internal int ToArgb() => (int)Value; + + internal ColorF RenderConvert() => new ColorF(A, R, G, B); + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(32); + stringBuilder.Append("A="); + stringBuilder.Append(A); + stringBuilder.Append(", R="); + stringBuilder.Append(R); + stringBuilder.Append(", G="); + stringBuilder.Append(G); + stringBuilder.Append(", B="); + stringBuilder.Append(B); + return stringBuilder.ToString(); + } + + public static bool operator ==(Color left, Color right) => (int)left.value == (int)right.value; + + public static bool operator !=(Color left, Color right) => !(left == right); + + public override bool Equals(object obj) => obj is Color color && (int)value == (int)color.value; + + public bool Equals(Color right) => (int)value == (int)right.value; + + public override int GetHashCode() => value.GetHashCode(); + + internal static Color Transparent => new Color(0U); + + internal static Color Black => new Color(4278190080U); + + internal static Color White => new Color(uint.MaxValue); + } +} diff --git a/UIX/Microsoft/Iris/Drawing/ContentLoadCompleteHandler.cs b/UIX/Microsoft/Iris/Drawing/ContentLoadCompleteHandler.cs new file mode 100644 index 0000000..279e0c3 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/ContentLoadCompleteHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.ContentLoadCompleteHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Drawing +{ + internal delegate void ContentLoadCompleteHandler(object owner, ImageStatus status); +} diff --git a/UIX/Microsoft/Iris/Drawing/EditCursorType.cs b/UIX/Microsoft/Iris/Drawing/EditCursorType.cs new file mode 100644 index 0000000..f66f73f --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/EditCursorType.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.EditCursorType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Drawing +{ + internal enum EditCursorType + { + Default, + IBeam, + } +} diff --git a/UIX/Microsoft/Iris/Drawing/Font.cs b/UIX/Microsoft/Iris/Drawing/Font.cs new file mode 100644 index 0000000..85da0b0 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/Font.cs @@ -0,0 +1,92 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.Font +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Text; + +namespace Microsoft.Iris.Drawing +{ + internal sealed class Font + { + private string _fontName; + private float _fontHeight; + private float _altFontHeight; + private FontStyles _fontStyle; + + public Font() + : this("Arial", 12f, 0.0f, FontStyles.None) + { + } + + public Font(string fontName) + : this(fontName, 12f, 0.0f, FontStyles.None) + { + } + + public Font(string fontName, float fontHeight) + : this(fontName, fontHeight, 0.0f, FontStyles.None) + { + } + + public Font(string fontName, float fontHeight, float altFontHeight) + : this(fontName, fontHeight, altFontHeight, FontStyles.None) + { + } + + public Font(string fontName, float fontHeight, FontStyles fontStyles) + : this(fontName, fontHeight, 0.0f, fontStyles) + { + } + + public Font(string fontName, float fontHeight, float altFontHeight, FontStyles fontStyles) + { + _fontName = fontName; + _fontHeight = fontHeight; + _altFontHeight = altFontHeight; + _fontStyle = fontStyles; + } + + public float FontSize + { + get => _fontHeight; + set => _fontHeight = value; + } + + public float AltFontSize + { + get => _altFontHeight == 0.0 ? _fontHeight : _altFontHeight; + set => _altFontHeight = value; + } + + public FontStyles FontStyle + { + get => _fontStyle; + set => _fontStyle = value; + } + + public string FontName + { + get => _fontName; + set => _fontName = value; + } + + public override bool Equals(object obj) => obj is Font font && _fontName == font._fontName && (_fontHeight == (double)font._fontHeight && _altFontHeight == (double)font._altFontHeight) && _fontStyle == font._fontStyle; + + public override int GetHashCode() => _fontName.GetHashCode() ^ _fontHeight.GetHashCode() ^ _altFontHeight.GetHashCode() ^ _fontStyle.GetHashCode(); + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("{Font \""); + stringBuilder.Append(_fontName); + stringBuilder.Append("\" "); + stringBuilder.Append(_fontHeight); + stringBuilder.Append("pt "); + stringBuilder.Append(_fontStyle); + stringBuilder.Append("}"); + return stringBuilder.ToString(); + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/FontStyles.cs b/UIX/Microsoft/Iris/Drawing/FontStyles.cs new file mode 100644 index 0000000..ac00001 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/FontStyles.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.FontStyles +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Drawing +{ + [Flags] + internal enum FontStyles + { + None = 0, + Bold = 1, + Italic = 2, + Underline = 4, + } +} diff --git a/UIX/Microsoft/Iris/Drawing/ImageStatus.cs b/UIX/Microsoft/Iris/Drawing/ImageStatus.cs new file mode 100644 index 0000000..b8e7d8f --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/ImageStatus.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.ImageStatus +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Drawing +{ + internal enum ImageStatus + { + PendingLoad, + Loading, + Complete, + Error, + } +} diff --git a/UIX/Microsoft/Iris/Drawing/RawImage.cs b/UIX/Microsoft/Iris/Drawing/RawImage.cs new file mode 100644 index 0000000..4476a99 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/RawImage.cs @@ -0,0 +1,92 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.RawImage +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.Render.Extensions; +using Microsoft.Iris.RenderAPI; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Drawing +{ + internal class RawImage : UIImage + { + private string _uniqueID; + private Size _imageSize; + private int _stride; + private SurfaceFormat _format; + private IntPtr _data; + private uint _length; + private RawImageItemKey _cacheItemKey; + + public RawImage( + string uniqueID, + Size imageSize, + int stride, + SurfaceFormat format, + IntPtr data, + bool takeOwnership, + Inset nineGrid, + Size maximumSize, + bool flippable, + bool antialiasEdges) + : base(nineGrid, maximumSize, flippable, antialiasEdges) + { + Source = uniqueID; + _uniqueID = uniqueID; + _imageSize = imageSize; + _stride = stride; + _format = format; + _contentSize = imageSize; + int cbCopy = _imageSize.Height * Math.Abs(stride); + _length = (uint)cbCopy; + if (!takeOwnership) + { + _data = NativeApi.MemAlloc(_length, false); + Memory.Copy(_data, data, cbCopy); + } + else + _data = data; + } + + ~RawImage() + { + FreeBuffer(_data); + _data = IntPtr.Zero; + } + + internal static void FreeBuffer(IntPtr data) + { + if (!(data != IntPtr.Zero)) + return; + NativeApi.MemFree(data); + } + + protected override ImageCacheItem GetCacheItem(out bool needAsyncLoad) + { + ImageCache instance = ScavengeImageCache.Instance; + ImageCacheItem imageCacheItem = null; + string str = GetHashCode().ToString(); + if (_cacheItemKey == null) + _cacheItemKey = new RawImageItemKey(str); + else + imageCacheItem = instance.Lookup(_cacheItemKey); + if (imageCacheItem == null) + { + Size maxSize = ClampSize(_maximumSize); + imageCacheItem = new RawImageItem(UISession.Default.RenderSession, this, str, _data, _length, _imageSize, _stride, _format, maxSize, IsFlipped, _antialiasEdges); + instance.Add(_cacheItemKey, imageCacheItem); + } + needAsyncLoad = false; + return imageCacheItem; + } + + protected override void EnsureSizeMetrics() + { + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/RawImageItem.cs b/UIX/Microsoft/Iris/Drawing/RawImageItem.cs new file mode 100644 index 0000000..c599166 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/RawImageItem.cs @@ -0,0 +1,49 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.RawImageItem +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.Render.Extensions; +using System; + +namespace Microsoft.Iris.Drawing +{ + internal class RawImageItem : ImageCacheItem + { + private int _stride; + private SurfaceFormat _format; + private object _oKeepAlive; + + internal RawImageItem( + IRenderSession renderSession, + RawImage rawImage, + string source, + IntPtr data, + uint length, + Size imageSize, + int stride, + SurfaceFormat format, + Size maxSize, + bool flippable, + bool antialiasEdges) + : base(renderSession, source, maxSize, flippable, antialiasEdges) + { + _oKeepAlive = rawImage; + SetSize(imageSize); + SetBuffer(data, length); + _stride = stride; + _format = format; + } + + protected override void OnDispose() + { + _oKeepAlive = null; + m_buffer = IntPtr.Zero; + base.OnDispose(); + } + + protected override bool DoImageLoad() => ImageLoader.FromRaw(RenderImage, m_buffer, (int)m_length, m_size, _stride, _format, m_req.MaximumSize, m_req.Flippable, m_req.AntialiasEdges, m_req.BorderWidth, m_req.BorderColor, out m_info); + } +} diff --git a/UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs b/UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs new file mode 100644 index 0000000..22ce494 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/RawImageItemKey.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.RawImageItemKey +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render.Extensions; + +namespace Microsoft.Iris.Drawing +{ + internal class RawImageItemKey : ImageCacheKey + { + private static int s_uniqueId; + private int _uniqueId; + + public RawImageItemKey(string id) + : base(id) + => _uniqueId = ++s_uniqueId; + + public override bool Equals(object obj) + { + if (ReferenceEquals(this, obj)) + return true; + return obj is RawImageItemKey rawImageItemKey && _uniqueId == rawImageItemKey._uniqueId; + } + + public override int GetHashCode() => _uniqueId; + } +} diff --git a/UIX/Microsoft/Iris/Drawing/ResourceImageItem.cs b/UIX/Microsoft/Iris/Drawing/ResourceImageItem.cs new file mode 100644 index 0000000..da5a069 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/ResourceImageItem.cs @@ -0,0 +1,154 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.ResourceImageItem +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Render; +using Microsoft.Iris.Render.Extensions; + +namespace Microsoft.Iris.Drawing +{ + internal class ResourceImageItem : ImageCacheItem + { + private string _source; + private Resource _resource; + private bool _acquireCalled; + private ResourceAcquisitionCompleteHandler _resourceAcquisitionHandler; + + internal ResourceImageItem( + IRenderSession renderSession, + string source, + Size maxSize, + bool flippable, + bool antialiasEdges) + : base(renderSession, source, maxSize, flippable, antialiasEdges) + { + _source = source; + _resource = ResourceManager.Instance.GetResource(_source); + } + + protected override void OnDispose() + { + if (_resource != null) + { + FreeResource(); + _resource = null; + } + base.OnDispose(); + } + + internal Resource Resource + { + get + { + EnsureResource(); + return _resource; + } + } + + internal ImageStatus Status + { + get + { + switch (_resource.Status) + { + case ResourceStatus.NeedsAcquire: + return ImageStatus.PendingLoad; + case ResourceStatus.Acquiring: + return ImageStatus.Loading; + case ResourceStatus.Available: + return ImageStatus.Complete; + case ResourceStatus.Error: + return ImageStatus.Error; + default: + return ImageStatus.Error; + } + } + } + + protected override bool EnsureBuffer() + { + if (EnsureResource()) + { + if (IsResourceAvailable()) + OnResourceLoadComplete(_resource); + else if (!_acquireCalled) + { + _resourceAcquisitionHandler = new ResourceAcquisitionCompleteHandler(OnResourceLoadComplete); + _resource.Acquire(_resourceAcquisitionHandler); + _acquireCalled = true; + } + } + return false; + } + + protected override void OnImageLoadComplete() + { + ImageStatus status = Status; + if (LoadCompleteHandler == null) + return; + LoadCompleteHandler(this, status); + } + + private bool IsResourceAvailable() => _resource.Status == ResourceStatus.Available; + + public bool EnsureResource() + { + if (_resource == null) + _resource = ResourceManager.Instance.GetResource(_source); + return _resource != null; + } + + private void OnResourceLoadComplete(Resource resource) + { + if (resource != _resource) + return; + if (!IsSuccessfulResourceLoad(_resource) || Application.IsShuttingDown) + { + OnImageLoadComplete(); + FreeResource(); + } + else + { + SetBuffer(_resource.Buffer, _resource.Length); + if (_resource.Length <= 0U) + return; + if (!ProcessBuffer()) + _resource.Status = ResourceStatus.Error; + OnImageLoadComplete(); + } + } + + private static bool IsSuccessfulResourceLoad(Resource resource) => resource.Status != ResourceStatus.Error; + + private void FreeResource() + { + if (_acquireCalled) + { + _resource.Free(_resourceAcquisitionHandler); + _resourceAcquisitionHandler = null; + } + _acquireCalled = false; + } + + public override void StartLoad() => EnsureBuffer(); + + public override string ToString() => _source; + + public override void ReleaseImage() + { + LoadCompleteHandler = null; + base.ReleaseImage(); + } + + public override void RemoveData() + { + FreeResource(); + base.RemoveData(); + } + + public event ContentLoadCompleteHandler LoadCompleteHandler; + } +} diff --git a/UIX/Microsoft/Iris/Drawing/RichText.cs b/UIX/Microsoft/Iris/Drawing/RichText.cs new file mode 100644 index 0000000..82df2d3 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/RichText.cs @@ -0,0 +1,463 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.RichText +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI; +using Microsoft.Iris.RenderAPI.Drawing; +using Microsoft.Iris.Session; +using Microsoft.Iris.ViewItems; +using System; +using System.Collections; +using System.Runtime.InteropServices; +using System.Text; + +namespace Microsoft.Iris.Drawing +{ + internal sealed class RichText : IDisposable + { + public const float MaxWidthConstraint = 4095f; + public const float MaxHeightConstraint = 8191f; + private Win32Api.HANDLE _rtoHandle; + private NativeApi.ReportRunCallback _rrcb; + private string _currentlyMeasuringText; + private bool _oversampled; + private bool _hosted; + private bool _inImeCompositionMode; + private ArrayList _timers; + private EventHandler _timerTickHandler; + private object _lock; + + public RichText(bool richTextMode) + : this(richTextMode, null) + { + } + + public unsafe RichText(bool richTextMode, IRichTextCallbacks callbacks) + { + Size sizeMaximumSurface = Size.Zero; + if (UISession.Default != null) + sizeMaximumSurface = UIImage.MaximumSurfaceSize(UISession.Default); + if (callbacks != null) + { + _hosted = true; + _timers = new ArrayList(6); + _timerTickHandler = new EventHandler(OnTimerTick); + } + RendererApi.IFC(NativeApi.SpRichTextBuildObject(richTextMode, sizeMaximumSurface, callbacks, out _rtoHandle)); + _oversampled = false; + _lock = new object(); + _rrcb = new NativeApi.ReportRunCallback(OnReportRun); + } + + public void Dispose() => Dispose(true); + + private void Dispose(bool inDispose) + { + if (!inDispose) + return; + GC.SuppressFinalize(this); + lock (_lock) + { + NativeApi.SpRichTextDestroyObject(_rtoHandle); + _rtoHandle.h = IntPtr.Zero; + } + if (_timers == null) + return; + for (int index = 0; index < _timers.Count; ++index) + DisposeTimer((DispatcherTimer)_timers[index]); + _timers.Clear(); + } + + ~RichText() => Dispose(false); + + public string Content + { + set + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextSetContent(_rtoHandle, value)); + } + } + + public string SimpleContent + { + get + { + string str = null; + int textLength = 0; + lock (_lock) + { + RendererApi.IFC(NativeApi.SpRichTextGetSimpleContentLength(_rtoHandle, out textLength)); + if (textLength != 0) + { + StringBuilder textBuffer = new StringBuilder(textLength); + RendererApi.IFC(NativeApi.SpRichTextGetSimpleContent(_rtoHandle, textBuffer, textBuffer.Capacity)); + str = textBuffer.ToString(); + } + } + return str; + } + } + + public bool Oversample + { + set + { + if (_oversampled == value) + return; + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextSetOversampleMode(_rtoHandle, value)); + _oversampled = value; + } + get => _oversampled; + } + + public int MaxLength + { + set + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextSetMaximumLength(_rtoHandle, value)); + } + } + + public bool DetectUrls + { + set + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextSetDetectUrls(_rtoHandle, value)); + } + } + + public bool HasCallbacks => _hosted; + + public bool ReadOnly + { + set + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextSetReadOnly(_rtoHandle, value)); + } + } + + public void SetWordWrap(bool wordWrap) + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextSetWordWrap(_rtoHandle, wordWrap)); + } + + public Size GetNaturalBounds() + { + int cWidth; + int cHeight; + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextGetNaturalBounds(_rtoHandle, out cWidth, out cHeight)); + return new Size(cWidth, cHeight); + } + + public void SetSelectionRange(int selectionStart, int selectionEnd) + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextSetSelectionRange(_rtoHandle, selectionStart, selectionEnd)); + } + + public unsafe TextFlow Measure(string content, ref TextMeasureParams measureParams) + { + TextFlow textFlow = new TextFlow(); + GCHandle gcHandle = GCHandle.Alloc(textFlow); + _currentlyMeasuringText = content != null ? content : string.Empty; + fixed (char* content1 = _currentlyMeasuringText) + fixed (char* chPtr = measureParams._textStyle.FontFace) + { + var style = new TextStyle.MarshalledData(measureParams._textStyle) + { + _fontFace = chPtr + }; + measureParams.SetContent(content1); + measureParams._data._pTextStyle = &style; + fixed (TextMeasureParams.FormattedRange* formattedRangePtr = measureParams._formattedRanges) + { + measureParams._data._pFormattedRanges = formattedRangePtr; + fixed (TextStyle.MarshalledData* marshalledDataPtr = measureParams._formattedRangeStyles) + { + measureParams._data._pFormattedRangeStyles = marshalledDataPtr; + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextMeasure(_rtoHandle, ref measureParams._data, _rrcb, GCHandle.ToIntPtr(gcHandle))); + } + } + } + gcHandle.Free(); + _currentlyMeasuringText = null; + return textFlow; + } + + public void NotifyOfFocusChange(bool gainingFocus) + { + lock (_lock) + { + RendererApi.IFC(NativeApi.SpRichTextSetFocus(_rtoHandle, gainingFocus)); + if (gainingFocus) + return; + _inImeCompositionMode = false; + } + } + + public void ScrollUp(ScrollbarType whichBar) + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextScroll(_rtoHandle, (int)whichBar, 0)); + } + + public void ScrollDown(ScrollbarType whichBar) + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextScroll(_rtoHandle, (int)whichBar, 1)); + } + + public void PageUp(ScrollbarType whichBar) + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextScroll(_rtoHandle, (int)whichBar, 2)); + } + + public void PageDown(ScrollbarType whichBar) + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextScroll(_rtoHandle, (int)whichBar, 3)); + } + + public void ScrollToPosition(ScrollbarType whichBar, int whereTo) + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextScrollToPosition(_rtoHandle, (int)whichBar, whereTo)); + } + + public void SetScrollbars(bool horizontalScrollbar, bool verticalScrollbar) + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextSetScrollbars(_rtoHandle, horizontalScrollbar, verticalScrollbar)); + } + + public bool ForwardKeyStateNotification( + uint message, + int virtualKey, + int scanCode, + int repeatCount, + uint modifierState, + ushort flags) + { + bool handled = true; + lock (_lock) + { + if (!_inImeCompositionMode) + RendererApi.IFC(NativeApi.SpRichTextForwardKeyState(_rtoHandle, message, virtualKey, scanCode, repeatCount, modifierState, flags, out handled)); + } + return handled; + } + + public bool ForwardKeyCharacterNotification( + uint message, + int character, + int scanCode, + int repeatCount, + uint modifierState, + ushort flags) + { + bool handled = true; + lock (_lock) + { + if (!_inImeCompositionMode) + RendererApi.IFC(NativeApi.SpRichTextForwardKeyCharacter(_rtoHandle, message, character, scanCode, repeatCount, modifierState, flags, out handled)); + } + return handled; + } + + public bool ForwardMouseInput( + uint message, + uint modifierState, + int mouseButton, + int x, + int y, + int mouseWheelDelta) + { + bool handled = true; + lock (_lock) + { + if (!_inImeCompositionMode) + RendererApi.IFC(NativeApi.SpRichTextForwardMouseInput(_rtoHandle, message, modifierState, mouseButton, x, y, mouseWheelDelta, out handled)); + } + return handled; + } + + public HRESULT ForwardImeMessage(uint message, UIntPtr wParam, UIntPtr lParam) + { + lock (_lock) + { + switch (message) + { + case 269: + _inImeCompositionMode = true; + break; + case 270: + _inImeCompositionMode = false; + break; + } + RendererApi.IFC(NativeApi.SpRichTextForwardImeMessage(_rtoHandle, message, wParam, lParam)); + } + return new HRESULT(0); + } + + public bool CanUndo + { + get + { + bool canUndo; + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextCanUndo(_rtoHandle, out canUndo)); + return canUndo; + } + } + + public void Undo() + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextUndo(_rtoHandle)); + } + + public void Cut() + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextCut(_rtoHandle)); + } + + public void Copy() + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextCopy(_rtoHandle)); + } + + public void Paste() + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextPaste(_rtoHandle)); + } + + public void Delete() + { + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextDelete(_rtoHandle)); + } + + public static LineAlignment ReverseAlignment( + LineAlignment alignment, + bool condition) + { + if (condition) + { + switch (alignment) + { + case LineAlignment.Near: + alignment = LineAlignment.Far; + break; + case LineAlignment.Far: + alignment = LineAlignment.Near; + break; + } + } + return alignment; + } + + internal static Dib Rasterize( + IntPtr hGlyphRunInfo, + bool outlineMode, + Color textColor, + bool shadowMode) + { + IntPtr phTextBitmap = IntPtr.Zero; + IntPtr ppvBits; + Size psizeBitmap; + RendererApi.IFC(NativeApi.SpRichTextRasterize(hGlyphRunInfo, outlineMode ? 1 : 0, textColor, shadowMode ? 1 : 0, out phTextBitmap, out ppvBits, out psizeBitmap)); + return new Dib(phTextBitmap, ppvBits, psizeBitmap); + } + + public void SetTimer(uint id, uint timeout) + { + DispatcherTimer dispatcherTimer = FindTimer(id); + if (dispatcherTimer == null) + { + dispatcherTimer = new DispatcherTimer(); + _timers.Add(dispatcherTimer); + } + dispatcherTimer.UserData = id; + dispatcherTimer.Interval = (int)timeout; + dispatcherTimer.Tick += _timerTickHandler; + dispatcherTimer.Start(); + } + + public void KillTimer(uint id) + { + DispatcherTimer timer = FindTimer(id); + if (timer == null) + return; + DisposeTimer(timer); + _timers.Remove(timer); + } + + private DispatcherTimer FindTimer(uint id) + { + for (int index = 0; index < _timers.Count; ++index) + { + DispatcherTimer timer = (DispatcherTimer)_timers[index]; + if ((int)(uint)timer.UserData == (int)id) + return timer; + } + return null; + } + + private void DisposeTimer(DispatcherTimer timer) + { + timer.Tick -= _timerTickHandler; + timer.Stop(); + } + + private void OnTimerTick(object sender, EventArgs ea) + { + DispatcherTimer dispatcherTimer = (DispatcherTimer)sender; + lock (_lock) + RendererApi.IFC(NativeApi.SpRichTextOnTimerTick(_rtoHandle, (uint)dispatcherTimer.UserData)); + } + + private unsafe HRESULT OnReportRun( + IntPtr hGlyphRunInfo, + NativeApi.RasterizeRunPacket* runPacketPtr, + IntPtr lpString, + uint nChars, + IntPtr dataPtr) + { + bool flag = false; + if (_currentlyMeasuringText != null && _currentlyMeasuringText.Length == nChars) + { + flag = true; + char* pointer = (char*)lpString.ToPointer(); + for (int index = 0; index < nChars; ++index) + { + if (_currentlyMeasuringText[index] != pointer[index]) + { + flag = false; + break; + } + } + } + string content = flag ? _currentlyMeasuringText : Marshal.PtrToStringUni(lpString, (int)nChars); + TextRun run = TextRun.FromRunPacket(hGlyphRunInfo, runPacketPtr, content); + if (run != null) + ((TextFlow)GCHandle.FromIntPtr(dataPtr).Target).Add(run); + return new HRESULT(0); + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs b/UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs new file mode 100644 index 0000000..9d18027 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/RichTextInfoKey.cs @@ -0,0 +1,79 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.RichTextInfoKey +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.Render.Extensions; +using Microsoft.Iris.RenderAPI.Drawing; + +namespace Microsoft.Iris.Drawing +{ + internal class RichTextInfoKey : ImageCacheKey + { + private const int FLAGS_IS_ITALIC = 1; + private const int FLAGS_IS_UNDERLINE = 2; + private const int FLAGS_IS_OUTLINE = 4; + private const int FLAGS_IS_THICK_UNDERLINE = 8; + private const int FLAGS_IS_DOTTED_UNDERLINE = 16; + private string _samplingMode; + private string _content; + private SizeF _srcSizeF; + private Size _naturalSize; + private Point _rasterizedOffset; + private int _fontFaceUniqueId; + private int _fontSize; + private int _fontWeight; + private byte _rasterizerConfig; + private Color _textColor; + private int _flags; + private int _hashCode; + + public RichTextInfoKey(TextRun run, string samplingMode, bool outline, Color textColor) + : base(run.Content) + { + _samplingMode = samplingMode; + _content = run.Content; + _srcSizeF = run.RenderBounds.Size; + _naturalSize = run.NaturalExtent; + _rasterizedOffset = run.RasterizedOffset; + _fontFaceUniqueId = run.FontFaceUniqueId; + _fontSize = run.FontSize; + _fontWeight = run.FontWeight; + _rasterizerConfig = run.RasterizerConfig; + _textColor = textColor; + _flags = 0; + if (run.Italic) + _flags |= 1; + if (outline) + _flags |= 4; + switch (run.UnderlineStyle) + { + case NativeApi.UnderlineStyle.Solid: + _flags |= 2; + break; + case NativeApi.UnderlineStyle.Thick: + _flags |= 8; + break; + case NativeApi.UnderlineStyle.Dotted: + case NativeApi.UnderlineStyle.Dash: + case NativeApi.UnderlineStyle.DashDot: + case NativeApi.UnderlineStyle.DashDotDot: + _flags |= 16; + break; + } + _hashCode = _samplingMode.GetHashCode() ^ _content.GetHashCode() ^ _srcSizeF.GetHashCode() ^ _naturalSize.GetHashCode() ^ _rasterizedOffset.GetHashCode() ^ _fontFaceUniqueId.GetHashCode() ^ _fontSize ^ _fontWeight ^ _flags ^ _rasterizerConfig ^ _textColor.GetHashCode(); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(this, obj)) + return true; + return obj is RichTextInfoKey richTextInfoKey && _hashCode == richTextInfoKey._hashCode && (_fontFaceUniqueId == richTextInfoKey._fontFaceUniqueId && _fontSize == richTextInfoKey._fontSize) && (_fontWeight == richTextInfoKey._fontWeight && _flags == richTextInfoKey._flags && (_rasterizerConfig == richTextInfoKey._rasterizerConfig && _samplingMode.Equals(richTextInfoKey._samplingMode))) && (_srcSizeF.Equals(richTextInfoKey._srcSizeF) && _naturalSize.Equals(richTextInfoKey._naturalSize) && (_rasterizedOffset.Equals(richTextInfoKey._rasterizedOffset) && _textColor.Equals(richTextInfoKey._textColor))) && _content.Equals(richTextInfoKey._content); + } + + public override int GetHashCode() => _hashCode; + } +} diff --git a/UIX/Microsoft/Iris/Drawing/Rotation.cs b/UIX/Microsoft/Iris/Drawing/Rotation.cs new file mode 100644 index 0000000..3a628f4 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/Rotation.cs @@ -0,0 +1,66 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.Rotation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using System.Text; + +namespace Microsoft.Iris.Drawing +{ + internal struct Rotation + { + private Vector3 _axis; + private float _angleRad; + public static readonly Rotation Default = new Rotation(0.0f, new Vector3(0.0f, 0.0f, 1f)); + + public Rotation(float angleRadians) + : this(angleRadians, new Vector3(0.0f, 0.0f, 1f)) + { + } + + public Rotation(float angleRadians, Vector3 axis) + { + _axis = axis; + _angleRad = angleRadians; + } + + public Vector3 Axis + { + get => _axis; + set => _axis = value; + } + + public float AngleRadians + { + get => _angleRad; + set => _angleRad = value; + } + + public int AngleDegrees + { + get => (int)(_angleRad * 180.0 / 3.14159274101257); + set => _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 && 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() => Axis.GetHashCode() ^ AngleRadians.GetHashCode(); + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(128); + stringBuilder.Append("(Axis="); + stringBuilder.Append(Axis); + stringBuilder.Append(", Angle="); + stringBuilder.Append(AngleRadians); + stringBuilder.Append(")"); + return stringBuilder.ToString(); + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/ScavengeImageCache.cs b/UIX/Microsoft/Iris/Drawing/ScavengeImageCache.cs new file mode 100644 index 0000000..0a46bf1 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/ScavengeImageCache.cs @@ -0,0 +1,88 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.ScavengeImageCache +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Queues; +using Microsoft.Iris.Render.Extensions; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Drawing +{ + internal sealed class ScavengeImageCache : ImageCache + { + private static ScavengeImageCache s_theOnlyCache; + private static readonly DeferredHandler s_dhReschedule = new DeferredHandler(Reschedule); + private UISession _session; + private ScavengeImageCache.ScavengeCallback _callback; + + public static void Initialize(UISession session) + { + s_theOnlyCache = new ScavengeImageCache(session); + s_theOnlyCache.NumItemsToKeep = 200; + s_theOnlyCache.ItemRetainTime = new TimeSpan(0, 2, 0); + } + + public static void Uninitialize(UISession session) + { + if (s_theOnlyCache == null) + return; + s_theOnlyCache.Dispose(); + } + + public static ScavengeImageCache Instance => s_theOnlyCache; + + private ScavengeImageCache(UISession session) + : base(session.RenderSession, "GraphicImageCache") + => _session = session; + + protected override void OnDispose() + { + TimeoutManager timeoutManager = _session.Dispatcher.TimeoutManager; + ScavengeImageCache.ScavengeCallback callback = _callback; + if (callback != null) + timeoutManager.CancelTimeout(callback); + _callback = null; + base.OnDispose(); + } + + protected override void ScheduleScavenge() + { + if (!CleanupPending) + DeferredCall.Post(DispatchPriority.Idle, s_dhReschedule, this); + base.ScheduleScavenge(); + } + + private static void Reschedule(object arg) + { + ScavengeImageCache cache = arg as ScavengeImageCache; + if (!cache.CleanupPending) + return; + TimeoutManager timeoutManager = cache._session.Dispatcher.TimeoutManager; + ScavengeImageCache.ScavengeCallback callback = cache._callback; + cache._callback = null; + if (callback != null) + timeoutManager.CancelTimeout(callback); + ScavengeImageCache.ScavengeCallback scavengeCallback = new ScavengeImageCache.ScavengeCallback(cache); + timeoutManager.SetTimeoutRelative(scavengeCallback, TimeSpan.FromSeconds(5.0)); + cache._callback = scavengeCallback; + } + + private class ScavengeCallback : QueueItem + { + private ScavengeImageCache _cache; + + public ScavengeCallback(ScavengeImageCache cache) => _cache = cache; + + public override void Dispatch() + { + if (_cache._callback != this) + return; + _cache._callback = null; + _cache.CullObjects(); + } + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/ScrollbarEnableFlags.cs b/UIX/Microsoft/Iris/Drawing/ScrollbarEnableFlags.cs new file mode 100644 index 0000000..5b286fe --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/ScrollbarEnableFlags.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.ScrollbarEnableFlags +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Drawing +{ + internal enum ScrollbarEnableFlags + { + EnableBoth, + DisableNear, + DisableFar, + DisableBoth, + } +} diff --git a/UIX/Microsoft/Iris/Drawing/ScrollbarType.cs b/UIX/Microsoft/Iris/Drawing/ScrollbarType.cs new file mode 100644 index 0000000..f3f490b --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/ScrollbarType.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.ScrollbarType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Drawing +{ + internal enum ScrollbarType + { + Horizontal = 0, + Vertical = 1, + Both = 3, + } +} diff --git a/UIX/Microsoft/Iris/Drawing/SimpleText.cs b/UIX/Microsoft/Iris/Drawing/SimpleText.cs new file mode 100644 index 0000000..120f425 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/SimpleText.cs @@ -0,0 +1,87 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.SimpleText +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI; +using Microsoft.Iris.Session; +using Microsoft.Iris.ViewItems; +using System; + +namespace Microsoft.Iris.Drawing +{ + internal class SimpleText : IDisposable + { + private Win32Api.HANDLE _stoHandle; + + public SimpleText() + { + Size sizeMaximumSurface = Size.Zero; + if (UISession.Default != null) + sizeMaximumSurface = UIImage.MaximumSurfaceSize(UISession.Default); + RendererApi.IFC(NativeApi.SpSimpleTextBuildObject(sizeMaximumSurface, out _stoHandle)); + } + + public void Dispose() + { + GC.SuppressFinalize(this); + NativeApi.SpSimpleTextDestroyObject(_stoHandle); + _stoHandle = Win32Api.HANDLE.NULL; + } + + public unsafe bool CanMeasure(string content, TextStyle textStyle) + { + bool fPossible; + fixed (char* chPtr = textStyle.FontFace) + { + var style = new TextStyle.MarshalledData(textStyle) + { + _fontFace = chPtr + }; + RendererApi.IFC(NativeApi.SpSimpleTextMeasurePossible(_stoHandle, content, &style, out fPossible)); + } + return fPossible; + } + + public unsafe TextFlow Measure( + string content, + LineAlignment alignment, + TextStyle textStyle, + Size constraint) + { + TextFlow textFlow = new TextFlow(); + if (content == null) + content = string.Empty; + short wAlignment = 0; + switch (alignment) + { + case LineAlignment.Near: + wAlignment = 1; + break; + case LineAlignment.Center: + wAlignment = 3; + break; + case LineAlignment.Far: + wAlignment = 2; + break; + } + IntPtr hGlyphRunInfo; + NativeApi.RasterizeRunPacket rasterizeRunPacket; + fixed (char* chPtr = textStyle.FontFace) + { + var style = new TextStyle.MarshalledData(textStyle) + { + _fontFace = chPtr + }; + RendererApi.IFC(NativeApi.SpSimpleTextMeasure(_stoHandle, content, wAlignment, + &style, constraint, out hGlyphRunInfo, &rasterizeRunPacket)); + } + TextRun run = TextRun.FromRunPacket(hGlyphRunInfo, &rasterizeRunPacket, content); + textFlow.Add(run); + return textFlow; + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/TextFlow.cs b/UIX/Microsoft/Iris/Drawing/TextFlow.cs new file mode 100644 index 0000000..cf9417c --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/TextFlow.cs @@ -0,0 +1,198 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.TextFlow +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; + +namespace Microsoft.Iris.Drawing +{ + internal sealed class TextFlow : DisposableObject + { + private object _runsList; + private Vector _lineBounds; + private Rectangle _bounds; + private Rectangle _fitBounds; + private TextRun _lastFitRun; + private TextRun _firstFitOnFinalLineRun; + private int _firstVisibleIndex; + private int _lastVisibleIndex; + + internal TextFlow() + { + _bounds = new Rectangle(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue); + ResetFitTracking(); + ResetVisibleTracking(); + } + + protected override void OnDispose() + { + if (_runsList != null) + { + if (_runsList is TextRun runsList) + { + runsList.UnregisterUsage(this); + } + else + { + foreach (SharedDisposableObject runs in (Vector)_runsList) + runs.UnregisterUsage(this); + } + } + base.OnDispose(); + } + + public TextRun this[int index] => _runsList is TextRun runsList ? runsList : (TextRun)((Vector)_runsList)[index]; + + public int Count + { + get + { + if (_runsList is Vector runsList) + return runsList.Count; + return _runsList == null ? 0 : 1; + } + } + + public Vector LineBounds => _lineBounds; + + internal Rectangle GetLastLineBounds(int lineAlignmentOffset) + { + Rectangle left = Rectangle.Zero; + for (int index = Count - 1; index >= 0; --index) + { + TextRun run = this[index]; + if (IsOnLastLine(run)) + { + Point position = run.Position; + Size size = run.Size; + int x = position.X + lineAlignmentOffset; + int y = position.Y; + int num1 = x + size.Width; + int num2 = y + size.Height; + Rectangle right = new Rectangle(x, y, num1 - x, num2 - y); + left = !left.IsZero ? Rectangle.Union(left, right) : right; + } + else + break; + } + return left; + } + + internal bool IsOnLastLine(TextRun run) => run.Line == LastFitRun.Line; + + public Rectangle Bounds => _bounds; + + public Rectangle FitBounds => _fitBounds; + + public TextRun LastFitRun => _lastFitRun; + + public TextRun FirstFitRunOnFinalLine => _firstFitOnFinalLineRun; + + public int FirstVisibleIndex => _firstVisibleIndex; + + public int LastVisibleIndex => _lastVisibleIndex; + + public bool HasVisibleRuns => _firstVisibleIndex != -1; + + public void Add(TextRun run) + { + _bounds = Rectangle.Union(_bounds, run.LayoutBounds); + if (_runsList == null) + { + _runsList = run; + _lineBounds = new Vector(); + _lineBounds.Add(run.RenderBounds); + } + else + { + if (!(_runsList is Vector vector)) + { + object runsList = _runsList; + vector = new Vector(); + vector.Add(runsList); + _runsList = vector; + } + if (run.UnderlineStyle != NativeApi.UnderlineStyle.None) + { + Rectangle underlineBounds = run.UnderlineBounds; + int line1 = run.Line; + for (int index = vector.Count - 1; index > 0; --index) + { + Point position = ((TextRun)vector[index]).Position; + int line2 = ((TextRun)vector[index]).Line; + if (position.X >= underlineBounds.Left && line1 == line2) + ((TextRun)vector[index]).UnderlineStyle = run.UnderlineStyle; + else + break; + } + } + if (_lineBounds.Count < run.Line) + { + _lineBounds.Add(run.RenderBounds); + } + else + { + RectangleF lineBound = (RectangleF)_lineBounds[run.Line - 1]; + if ((int)lineBound.Y > (int)run.RenderBounds.Y || lineBound.IsEmpty) + _lineBounds[run.Line - 1] = run.RenderBounds; + } + vector.Add(run); + } + run.RegisterUsage(this); + } + + public void AddFit(TextRun run) + { + _fitBounds = Rectangle.Union(_fitBounds, run.LayoutBounds); + if (run.LayoutBounds.IsEmpty) + return; + if (_firstFitOnFinalLineRun == null || run.Line > _firstFitOnFinalLineRun.Line) + _firstFitOnFinalLineRun = run; + _lastFitRun = run; + } + + public void AddVisible(int runIndex) + { + this[runIndex].Visible = true; + if (_firstVisibleIndex == -1) + _firstVisibleIndex = runIndex; + _lastVisibleIndex = runIndex; + } + + public void ResetFitTracking() + { + _lastFitRun = null; + _fitBounds = new Rectangle(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue); + } + + public void ResetVisibleTracking() + { + _firstVisibleIndex = -1; + _lastVisibleIndex = int.MinValue; + } + + public void ClearSprites() + { + if (_runsList == null) + return; + if (_runsList is TextRun runsList) + { + runsList.TextSprite = null; + runsList.HighlightSprite = null; + } + else + { + foreach (TextRun runs in (Vector)_runsList) + { + runs.TextSprite = null; + runs.HighlightSprite = null; + } + } + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/TextImageCache.cs b/UIX/Microsoft/Iris/Drawing/TextImageCache.cs new file mode 100644 index 0000000..a6f8b65 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/TextImageCache.cs @@ -0,0 +1,88 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.TextImageCache +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Queues; +using Microsoft.Iris.Render.Extensions; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Drawing +{ + internal sealed class TextImageCache : ImageCache + { + private static TextImageCache s_theOnlyCache; + private static readonly DeferredHandler s_dhReschedule = new DeferredHandler(Reschedule); + private UISession _session; + private TextImageCache.ScavengeCallback _callback; + + public static void Initialize(UISession session) + { + s_theOnlyCache = new TextImageCache(session); + s_theOnlyCache.NumItemsToKeep = 500; + s_theOnlyCache.ItemRetainTime = TimeSpan.Zero; + } + + public static void Uninitialize(UISession session) + { + if (s_theOnlyCache == null) + return; + s_theOnlyCache.Dispose(); + } + + public static TextImageCache Instance => s_theOnlyCache; + + private TextImageCache(UISession session) + : base(session.RenderSession, nameof(TextImageCache)) + => _session = session; + + protected override void OnDispose() + { + TimeoutManager timeoutManager = _session.Dispatcher.TimeoutManager; + TextImageCache.ScavengeCallback callback = _callback; + if (callback != null) + timeoutManager.CancelTimeout(callback); + _callback = null; + base.OnDispose(); + } + + protected override void ScheduleScavenge() + { + if (!CleanupPending) + DeferredCall.Post(DispatchPriority.Idle, s_dhReschedule, this); + base.ScheduleScavenge(); + } + + private static void Reschedule(object arg) + { + TextImageCache cache = arg as TextImageCache; + if (!cache.CleanupPending) + return; + TimeoutManager timeoutManager = cache._session.Dispatcher.TimeoutManager; + TextImageCache.ScavengeCallback callback = cache._callback; + cache._callback = null; + if (callback != null) + timeoutManager.CancelTimeout(callback); + TextImageCache.ScavengeCallback scavengeCallback = new TextImageCache.ScavengeCallback(cache); + timeoutManager.SetTimeoutRelative(scavengeCallback, TimeSpan.FromSeconds(5.0)); + cache._callback = scavengeCallback; + } + + private class ScavengeCallback : QueueItem + { + private TextImageCache _cache; + + public ScavengeCallback(TextImageCache cache) => _cache = cache; + + public override void Dispatch() + { + if (_cache._callback != this) + return; + _cache._callback = null; + _cache.CullObjects(); + } + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/TextImageItem.cs b/UIX/Microsoft/Iris/Drawing/TextImageItem.cs new file mode 100644 index 0000000..8595e56 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/TextImageItem.cs @@ -0,0 +1,72 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.TextImageItem +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.Render.Extensions; +using Microsoft.Iris.RenderAPI.Drawing; + +namespace Microsoft.Iris.Drawing +{ + internal class TextImageItem : ImageCacheItem + { + private TextRun _run; + private Dib _dib; + private string _samplingModeName; + private Color _textColor; + private bool _outlineFlag; + + internal TextImageItem( + IRenderSession renderSession, + TextRun run, + string samplingModeName, + bool outlineFlag, + Color textColor) + : base(renderSession, run.Content) + { + _run = run; + _run.RegisterUsage(this); + _dib = null; + _samplingModeName = samplingModeName; + _outlineFlag = outlineFlag; + _textColor = textColor; + } + + protected override void OnDispose() + { + _run.UnregisterUsage(this); + ReleaseDib(); + base.OnDispose(); + } + + internal TextRun Run => _run; + + protected override bool EnsureBuffer() + { + if (_dib == null) + _dib = _run.Rasterize(_samplingModeName, _textColor, _outlineFlag); + return true; + } + + protected override bool DoImageLoad() => RenderImage.LoadContent(_dib.ImageFormat, _dib.ContentSize, _dib.Stride, _dib.Data); + + protected override void OnImageLoadComplete() + { + if (HasLoadsInProgress) + return; + ReleaseDib(); + } + + public override string ToString() => _run.Content; + + private void ReleaseDib() + { + if (_dib == null) + return; + _dib.Dispose(); + _dib = null; + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/TextMeasureParams.cs b/UIX/Microsoft/Iris/Drawing/TextMeasureParams.cs new file mode 100644 index 0000000..62906ed --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/TextMeasureParams.cs @@ -0,0 +1,153 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.TextMeasureParams +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.RenderAPI.Drawing; +using Microsoft.Iris.Session; +using Microsoft.Iris.ViewItems; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Drawing +{ + internal struct TextMeasureParams + { + public TextMeasureParams.MarshalledData _data; + public TextStyle _textStyle; + public TextMeasureParams.FormattedRange[] _formattedRanges; + public TextStyle.MarshalledData[] _formattedRangeStyles; + private GCHandle[] _formattedRangeStyleFontFaces; + + public void Initialize() + { + if (!UISession.Default.IsRtl) + return; + _data._flags |= MeasureFlags.IsRtl; + } + + public void Dispose() + { + if (_formattedRangeStyleFontFaces == null) + return; + foreach (GCHandle rangeStyleFontFace in _formattedRangeStyleFontFaces) + { + if (rangeStyleFontFace.IsAllocated) + rangeStyleFontFace.Free(); + } + _formattedRangeStyleFontFaces = null; + } + + public unsafe void SetContent(char* content) + { + _data._flags |= MeasureFlags.Content; + _data._content = content; + } + + public void SetFormat(LineAlignment lineAlignment, TextStyle style) + { + switch (lineAlignment) + { + case LineAlignment.Near: + _data._alignment = 1; + break; + case LineAlignment.Center: + _data._alignment = 3; + break; + case LineAlignment.Far: + _data._alignment = 2; + break; + } + _textStyle = style; + } + + public void TrimLeftSideBearing() => _data._flags |= MeasureFlags.TrimLeftSideBearing; + + public void SetEditMode(bool inEditMode) + { + if (inEditMode) + _data._flags |= MeasureFlags.FormatOnly; + else + _data._flags &= ~MeasureFlags.FormatOnly; + } + + public void SetScale(float scale) => _data._scale = scale; + + public void SetWordWrap(bool wordWrap) + { + _data._flags |= MeasureFlags.WordWrap; + if (wordWrap) + _data._flags |= MeasureFlags.WordWrapValue; + else + _data._flags &= ~MeasureFlags.WordWrapValue; + } + + public void SetPasswordChar(char passwordChar) + { + _data._flags |= MeasureFlags.PasswordMasked; + _data._passwordChar = passwordChar; + } + + public void SetConstraint(SizeF constraint) => _data._constraint = constraint; + + public void AllocateFormattedRanges(int formattedRangeCount, int formattedRangeStylesCount) + { + _formattedRanges = new TextMeasureParams.FormattedRange[formattedRangeCount]; + _formattedRangeStyles = new TextStyle.MarshalledData[formattedRangeStylesCount]; + _formattedRangeStyleFontFaces = new GCHandle[formattedRangeStylesCount]; + _data._formattedRangeCount = formattedRangeCount; + _data._formattedRangeStylesCount = formattedRangeStylesCount; + } + + public TextMeasureParams.FormattedRange[] FormattedRanges => _formattedRanges; + + public unsafe void SetFormattedRangeStyle(int index, TextStyle style) + { + _formattedRangeStyles[index] = new TextStyle.MarshalledData(style); + string fontFace = style.FontFace; + if (fontFace == null) + return; + GCHandle gcHandle = GCHandle.Alloc(fontFace, GCHandleType.Pinned); + _formattedRangeStyles[index]._fontFace = (char*)gcHandle.AddrOfPinnedObject().ToPointer(); + _formattedRangeStyleFontFaces[index] = gcHandle; + } + + internal struct MarshalledData + { + public TextMeasureParams.MeasureFlags _flags; + public byte _alignment; + [MarshalAs(UnmanagedType.U2)] + public char _passwordChar; + public unsafe char* _content; + public float _scale; + public SizeF _constraint; + public unsafe TextStyle.MarshalledData* _pTextStyle; + public int _formattedRangeCount; + public unsafe TextMeasureParams.FormattedRange* _pFormattedRanges; + public int _formattedRangeStylesCount; + public unsafe TextStyle.MarshalledData* _pFormattedRangeStyles; + } + + [Flags] + internal enum MeasureFlags : byte + { + None = 0, + Content = 1, + IsRtl = 2, + WordWrap = 4, + WordWrapValue = 8, + PasswordMasked = 16, // 0x10 + TrimLeftSideBearing = 32, // 0x20 + FormatOnly = 64, // 0x40 + } + + internal struct FormattedRange + { + public int FirstCharacter; + public int LastCharacter; + public Color Color; + public int StyleIndex; + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/TextRun.cs b/UIX/Microsoft/Iris/Drawing/TextRun.cs new file mode 100644 index 0000000..d4c5a72 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/TextRun.cs @@ -0,0 +1,211 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.TextRun +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using System; + +namespace Microsoft.Iris.Drawing +{ + internal sealed class TextRun : SharedDisposableObject + { + private const int CFE_LINK = 32; + private IntPtr _hGlyphRunInfo; + private IntPtr _hRasterizeRunPacket; + private Rectangle _layoutBounds; + private RectangleF _renderBounds; + private Point _offsetPoint; + private int _naturalX; + private int _naturalY; + private int _rasterizeX; + private int _rasterizeY; + private byte _rasterizerConfig; + private byte _bits; + private string _content; + private Color _runColor; + private Color _overrideColor; + private Color _highlightColor; + private int _fontFaceUniqueId; + public int _lfHeight; + public int _lfWeight; + private Size _naturalRunExtent; + private int _lineNumber; + private int _ascenderInset; + private int _baselineInset; + private Rectangle _underlineBounds; + public ISprite TextSprite; + public ISprite HighlightSprite; + + private unsafe TextRun( + IntPtr hGlyphRunInfo, + NativeApi.RasterizeRunPacket* runPacketPtr, + string content) + { + _hGlyphRunInfo = hGlyphRunInfo; + _hRasterizeRunPacket = new IntPtr(runPacketPtr); + _layoutBounds = runPacketPtr->rcLayoutBounds; + _renderBounds = runPacketPtr->rcfRenderBounds; + _naturalX = runPacketPtr->naturalX; + _naturalY = runPacketPtr->naturalY; + _rasterizeX = runPacketPtr->rasterizeX; + _rasterizeY = runPacketPtr->rasterizeY; + _rasterizerConfig = runPacketPtr->AAConfig; + _runColor = runPacketPtr->clrText; + _overrideColor = Color.Transparent; + _highlightColor = runPacketPtr->clrBackground; + _fontFaceUniqueId = runPacketPtr->fontFaceUniqueId; + _lfHeight = runPacketPtr->lf.lfHeight; + _lfWeight = runPacketPtr->lf.lfWeight; + SetBit(Bits.Italic, runPacketPtr->lf.lfItalic != 0); + SetBit(Bits.Underline, runPacketPtr->lf.lfUnderline != 0); + SetBit(Bits.Link, (runPacketPtr->dwEffects & 32) != 0); + _underlineBounds = runPacketPtr->rcUnderlineBounds; + _lineNumber = runPacketPtr->nLineNumber; + _naturalRunExtent = runPacketPtr->sizeNatural; + _ascenderInset = runPacketPtr->ascenderInset; + _baselineInset = runPacketPtr->baselineInset; + _content = content; + } + + protected override void OnDispose() + { + NativeApi.SpRichTextDestroyGlyphRunInfo(_hGlyphRunInfo); + base.OnDispose(); + } + + public string Content => _content; + + public RectangleF RenderBounds => _renderBounds; + + public Rectangle LayoutBounds => _layoutBounds; + + public Size NaturalExtent => _naturalRunExtent; + + public Color RunColor => _runColor; + + public Color OverrideColor + { + get => _overrideColor; + set => _overrideColor = value; + } + + public Color Color => _overrideColor != Color.Transparent ? _overrideColor : _runColor; + + public bool Highlighted => _highlightColor.A != 0; + + public Color HighlightColor => _highlightColor; + + public int FontFaceUniqueId => _fontFaceUniqueId; + + public int FontSize => _lfHeight; + + public int FontWeight => _lfWeight; + + public bool Italic => GetBit(Bits.Italic); + + public bool Underline => GetBit(Bits.Underline); + + public Point RasterizedOffset => new Point(_rasterizeX - _naturalX, _rasterizeY - _naturalY); + + public int AscenderInset => _ascenderInset; + + public int BaselineInset => _baselineInset; + + public int Line => _lineNumber; + + public bool Visible + { + get => GetBit(Bits.Visible); + set => SetBit(Bits.Visible, value); + } + + public bool IsFragment + { + get => GetBit(Bits.Fragment); + set => SetBit(Bits.Fragment, value); + } + + public Point Position => new Point(_layoutBounds.X, _layoutBounds.Y); + + public Size Size => new Size(_layoutBounds.Width, _layoutBounds.Height); + + public byte RasterizerConfig => _rasterizerConfig; + + public bool Link => GetBit(Bits.Link); + + public unsafe NativeApi.UnderlineStyle UnderlineStyle + { + get => _hRasterizeRunPacket == IntPtr.Zero ? NativeApi.UnderlineStyle.None : ((NativeApi.RasterizeRunPacket*)(void*)_hRasterizeRunPacket)->usUnderlineStyle; + set + { + if (!(_hRasterizeRunPacket != IntPtr.Zero)) + return; + ((NativeApi.RasterizeRunPacket*)(void*)_hRasterizeRunPacket)->usUnderlineStyle = value; + } + } + + public Rectangle UnderlineBounds => _underlineBounds; + + internal void ApplyOffset(Point offsetPoint) + { + if (!(_offsetPoint != offsetPoint)) + return; + _renderBounds.X -= _offsetPoint.X; + _renderBounds.Y -= _offsetPoint.Y; + _layoutBounds.X -= _offsetPoint.X; + _layoutBounds.Y -= _offsetPoint.Y; + _renderBounds.X += offsetPoint.X; + _renderBounds.Y += offsetPoint.Y; + _layoutBounds.X += offsetPoint.X; + _layoutBounds.Y += offsetPoint.Y; + _offsetPoint = offsetPoint; + } + + internal Dib Rasterize(string samplingMode, Color textColor, bool outlineFlag) + { + bool shadowMode = false; + if (samplingMode == "sdw") + shadowMode = true; + return RichText.Rasterize(_hGlyphRunInfo, outlineFlag, textColor, shadowMode); + } + + internal static unsafe TextRun FromRunPacket( + IntPtr hGlyphRunInfo, + NativeApi.RasterizeRunPacket* runPacketPtr, + string content) + { + return new TextRun(hGlyphRunInfo, runPacketPtr, content); + } + + public void RemoveSprites(IVisualContainer container) + { + if (TextSprite != null) + { + container.RemoveChild(TextSprite); + TextSprite = null; + } + if (HighlightSprite == null) + return; + container.RemoveChild(HighlightSprite); + HighlightSprite = null; + } + + private bool GetBit(TextRun.Bits lookupBit) => ((TextRun.Bits)_bits & lookupBit) != 0; + + private void SetBit(TextRun.Bits changeBit, bool value) => _bits = value ? (byte)((TextRun.Bits)_bits | changeBit) : (byte)((TextRun.Bits)_bits & ~changeBit); + + private enum Bits : byte + { + Visible = 1, + Fragment = 2, + Italic = 4, + Underline = 8, + Link = 16, // 0x10 + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/TextStyle.cs b/UIX/Microsoft/Iris/Drawing/TextStyle.cs new file mode 100644 index 0000000..f24100b --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/TextStyle.cs @@ -0,0 +1,246 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.TextStyle +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; +using System.Collections.Specialized; +using System.Text; + +namespace Microsoft.Iris.Drawing +{ + internal class TextStyle + { + private BitVector32 _flags; + private string _fontFace; + private float _fontHeightPts; + private float _altFontHeightPts; + private float _lineSpacing; + private float _characterSpacing; + private Color _textColor; + private bool _fragment; + + public bool IsInitialized() => _flags.Data != 0; + + public string FontFace + { + get => _fontFace; + set + { + _flags[1] = !string.IsNullOrEmpty(value); + _fontFace = value; + } + } + + public float FontSize + { + get => _fontHeightPts; + set + { + _flags[2] = true; + _fontHeightPts = value; + } + } + + public float AltFontSize + { + get => _altFontHeightPts == 0.0 ? _fontHeightPts : _altFontHeightPts; + set + { + _flags[512] = true; + _altFontHeightPts = value; + } + } + + public bool Bold + { + get => _flags[65536]; + set + { + _flags[4] = true; + _flags[65536] = value; + } + } + + public bool Italic + { + get => _flags[131072]; + set + { + _flags[8] = true; + _flags[131072] = value; + } + } + + public bool Underline + { + get => _flags[262144]; + set + { + _flags[16] = true; + _flags[262144] = value; + } + } + + public Color Color + { + get => _textColor; + set + { + _flags[64] = true; + _textColor = value; + } + } + + public float LineSpacing + { + get => _lineSpacing; + set + { + _flags[32] = true; + _lineSpacing = value; + } + } + + public bool EnableKerning + { + get => _flags[524288]; + set + { + _flags[128] = true; + _flags[524288] = value; + } + } + + public float CharacterSpacing + { + get => _characterSpacing; + set + { + _flags[256] = true; + _characterSpacing = value; + } + } + + public bool Fragment + { + get => _fragment; + set => _fragment = value; + } + + public void Add(TextStyle additional) + { + _fragment = additional._fragment; + if (additional._flags[1]) + FontFace = additional.FontFace; + if (additional._flags[2]) + FontSize = additional.FontSize; + if (additional._flags[512]) + AltFontSize = additional._altFontHeightPts; + if (additional._flags[4]) + Bold = additional.Bold; + if (additional._flags[8]) + Italic = additional.Italic; + if (additional._flags[16]) + Underline = additional.Underline; + if (additional._flags[32]) + LineSpacing = additional.LineSpacing; + if (additional._flags[128]) + EnableKerning = additional.EnableKerning; + if (additional._flags[256]) + CharacterSpacing = additional.CharacterSpacing; + if (!additional._flags[64]) + return; + Color = additional.Color; + } + + public bool HasColor => _flags[64]; + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("{TextStyle"); + if (_flags[1]) + { + stringBuilder.Append(" Font = \""); + stringBuilder.Append(FontFace); + stringBuilder.Append("\""); + } + if (_flags[2]) + { + stringBuilder.Append(" Pt = "); + stringBuilder.Append(FontSize); + } + if (_flags[4]) + { + stringBuilder.Append(" Bold = "); + stringBuilder.Append(Bold); + } + if (_flags[8]) + { + stringBuilder.Append(" Italic = "); + stringBuilder.Append(Italic); + } + if (_flags[16]) + { + stringBuilder.Append(" Underline = "); + stringBuilder.Append(Underline); + } + if (_flags[32]) + { + stringBuilder.Append(" LineSpacing = "); + stringBuilder.Append(LineSpacing); + } + if (_flags[64]) + { + stringBuilder.Append(" Color = "); + stringBuilder.Append(Color); + } + stringBuilder.Append(" }"); + return stringBuilder.ToString(); + } + + [Flags] + internal enum SetFlags + { + None = 0, + FontFace = 1, + FontHeight = 2, + Bold = 4, + Italic = 8, + Underline = 16, // 0x00000010 + LineSpacing = 32, // 0x00000020 + TextColor = 64, // 0x00000040 + EnableKerning = 128, // 0x00000080 + CharacterSpacing = 256, // 0x00000100 + AltFontHeight = 512, // 0x00000200 + BoldValue = 65536, // 0x00010000 + ItalicValue = 131072, // 0x00020000 + UnderlineValue = 262144, // 0x00040000 + EnableKerningValue = 524288, // 0x00080000 + } + + internal struct MarshalledData + { + public int _flags; + public unsafe char* _fontFace; + public float _fontHeightPts; + public float _altFontHeightPts; + public float _lineSpacing; + public float _characterSpacing; + public Color _textColor; + + public unsafe MarshalledData(TextStyle from) + { + _flags = from._flags.Data; + _fontHeightPts = from._fontHeightPts; + _altFontHeightPts = from._altFontHeightPts; + _lineSpacing = from._lineSpacing; + _characterSpacing = from._characterSpacing; + _textColor = from._textColor; + _fontFace = null; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Drawing/UIImage.cs b/UIX/Microsoft/Iris/Drawing/UIImage.cs new file mode 100644 index 0000000..b7ae29a --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/UIImage.cs @@ -0,0 +1,194 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.UIImage +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Render; +using Microsoft.Iris.Render.Extensions; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Drawing +{ + internal abstract class UIImage : NotifyObjectBase + { + private static Size s_sizeMaximumSurface = new Size(-1, -1); + protected string _source; + private Inset _nineGrid; + protected Size _maximumSize; + protected bool _flippable; + protected bool _antialiasEdges; + private ImageStatus _status; + protected Size _contentSize; + + public UIImage(Inset nineGrid, Size maximumSize, bool flippable, bool antialiasEdges) + { + _nineGrid = nineGrid; + _maximumSize = maximumSize; + _flippable = flippable; + _antialiasEdges = antialiasEdges; + } + + public void Load() => Load(false); + + private void Load(bool inDraw) + { + if (_status != ImageStatus.PendingLoad) + return; + bool needAsyncLoad; + ImageCacheItem cacheItem = GetCacheItem(out needAsyncLoad); + if (cacheItem == null) + SetStatus(ImageStatus.Error); + else if (needAsyncLoad) + { + SetStatus(ImageStatus.Loading); + cacheItem.StartLoad(); + } + else + SetStatus(ImageStatus.Complete); + } + + private ImageCacheItem GetCacheItem() => GetCacheItem(out bool _); + + protected abstract ImageCacheItem GetCacheItem(out bool needAsyncLoad); + + protected abstract void EnsureSizeMetrics(); + + protected void OnHeaderLoadComplete() + { + if (LoadComplete == null) + return; + LoadComplete(this, Status); + } + + protected void SetStatus(ImageStatus status) + { + _status = status; + if ((_status == ImageStatus.Error || _status == ImageStatus.Complete) && LoadComplete != null) + LoadComplete(this, _status); + FireNotification(NotificationID.Status); + } + + internal IImage RenderImage => GetCacheItem()?.RenderImage; + + public ImageStatus Status => _status; + + public string Source + { + get => _source; + set + { + if (!(_source != value)) + return; + _source = value; + OnImageAttributeChanged(); + } + } + + public Inset NineGrid + { + get => _nineGrid; + set + { + if (!(_nineGrid != value)) + return; + _nineGrid = value; + OnImageAttributeChanged(); + } + } + + public Size MaximumSize + { + get => _maximumSize; + set + { + if (!(_maximumSize != value)) + return; + _maximumSize = value; + OnImageAttributeChanged(); + } + } + + public bool Flippable + { + get => _flippable; + set + { + if (_flippable == value) + return; + _flippable = value; + OnImageAttributeChanged(); + } + } + + public bool IsFlipped => _flippable && UISession.Default.IsRtl; + + public bool AntialiasEdges + { + get => _antialiasEdges; + set + { + if (_antialiasEdges == value) + return; + _antialiasEdges = value; + OnImageAttributeChanged(); + } + } + + internal Size Size + { + get + { + EnsureSizeMetrics(); + return _contentSize; + } + } + + public int Width + { + get + { + EnsureSizeMetrics(); + return _contentSize.Width; + } + } + + public int Height + { + get + { + EnsureSizeMetrics(); + return _contentSize.Height; + } + } + + internal void AddUser(object user) => GetCacheItem()?.RegisterUsage(user); + + public void RemoveUser(object user) => GetCacheItem()?.UnregisterUsage(user); + + internal static Size MaximumSurfaceSize(UISession session) + { + if (s_sizeMaximumSurface.Width == -1) + s_sizeMaximumSurface = session.RenderSession.GraphicsDevice.MaximumImageSize; + return s_sizeMaximumSurface; + } + + internal static Size ClampSize(Size maxSizeImage) + { + Size size = MaximumSurfaceSize(UISession.Default); + if (maxSizeImage.Width == 0 || maxSizeImage.Width > size.Width) + maxSizeImage.Width = size.Width; + if (maxSizeImage.Height == 0 || maxSizeImage.Height > size.Height) + maxSizeImage.Height = size.Height; + return maxSizeImage; + } + + protected virtual void OnImageAttributeChanged() + { + } + + public event ContentLoadCompleteHandler LoadComplete; + } +} diff --git a/UIX/Microsoft/Iris/Drawing/UriImage.cs b/UIX/Microsoft/Iris/Drawing/UriImage.cs new file mode 100644 index 0000000..2e9e130 --- /dev/null +++ b/UIX/Microsoft/Iris/Drawing/UriImage.cs @@ -0,0 +1,114 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Drawing.UriImage +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Render; +using Microsoft.Iris.Render.Extensions; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Drawing +{ + internal sealed class UriImage : UIImage + { + private ImageCacheKey _cacheKey; + + public UriImage() + : base(Inset.Zero, Size.Zero, false, false) + { + } + + public UriImage(string source, Inset nineGrid, Size maximumSize, bool flippable) + : this(source, nineGrid, maximumSize, flippable, false) + { + } + + public UriImage( + string source, + Inset nineGrid, + Size maximumSize, + bool flippable, + bool antialiasEdges) + : base(nineGrid, maximumSize, flippable, antialiasEdges) + { + Source = source; + } + + private ResourceImageItem FetchOrBuildItem() + { + ResourceImageItem resourceImageItem = GetResourceFromCache(); + if (resourceImageItem == null) + { + resourceImageItem = new ResourceImageItem(UISession.Default.RenderSession, Source, ClampSize(_maximumSize), IsFlipped, _antialiasEdges); + resourceImageItem.LoadCompleteHandler += new ContentLoadCompleteHandler(OnLoadComplete); + ScavengeImageCache.Instance.Add(_cacheKey, resourceImageItem); + SetStatus(resourceImageItem.Status); + _contentSize = new Size(0, 0); + } + else if (resourceImageItem.Resource.Status == ResourceStatus.NeedsAcquire || resourceImageItem.Resource.Status == ResourceStatus.Acquiring) + resourceImageItem.LoadCompleteHandler += new ContentLoadCompleteHandler(OnLoadComplete); + return resourceImageItem; + } + + private ResourceImageItem GetResourceFromCache() + { + Size maxSize = ClampSize(_maximumSize); + if (_cacheKey == null) + _cacheKey = new ImageCacheKey(Source, maxSize, IsFlipped, _antialiasEdges); + return (ResourceImageItem)ScavengeImageCache.Instance.Lookup(_cacheKey); + } + + protected override void OnImageAttributeChanged() => _cacheKey = null; + + private void OnLoadComplete(object owner, ImageStatus status) + { + ResourceImageItem resourceFromCache = GetResourceFromCache(); + if (resourceFromCache != null) + resourceFromCache.LoadCompleteHandler -= new ContentLoadCompleteHandler(OnLoadComplete); + SetStatus(status); + } + + protected override ImageCacheItem GetCacheItem(out bool needAsyncLoad) + { + ResourceImageItem resourceImageItem; + if (!string.IsNullOrEmpty(Source)) + { + resourceImageItem = FetchOrBuildItem(); + if (resourceImageItem != null) + { + needAsyncLoad = resourceImageItem.Resource.Status != ResourceStatus.Available; + } + else + { + resourceImageItem = null; + needAsyncLoad = false; + } + } + else + { + resourceImageItem = null; + needAsyncLoad = false; + } + return resourceImageItem; + } + + protected override void EnsureSizeMetrics() + { + ImageCacheItem cacheItem = GetCacheItem(out bool _); + if (cacheItem == null) + return; + _contentSize = cacheItem.ImageSize; + } + + public static void RemoveCache( + string source, + Size maximumSize, + bool flippable, + bool antialiasEdges) + { + ScavengeImageCache.Instance.RemoveData(new ImageCacheKey(source, maximumSize, flippable, antialiasEdges)); + } + } +} diff --git a/UIX/Microsoft/Iris/Error.cs b/UIX/Microsoft/Iris/Error.cs new file mode 100644 index 0000000..d787277 --- /dev/null +++ b/UIX/Microsoft/Iris/Error.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Error +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris +{ + public class Error + { + public string Context; + public string Message; + public bool Warning; + public int Line; + public int Column; + + public override string ToString() + { + string str1 = Context; + if (str1 != null && str1.StartsWith("file://", StringComparison.Ordinal)) + str1 = str1.Substring(7); + string str2; + if (Line != -1) + str2 = string.Format("{0}({1},{2}) : {3} : {4}", str1, Line, Column, Warning ? "warning" : "error", Message); + else + str2 = Context == null ? string.Format("{0} : {1}", Warning ? "warning" : "error", Message) : string.Format("{0} : {1} : {2}", str1, Warning ? "warning" : "error", Message); + return str2; + } + } +} diff --git a/UIX/Microsoft/Iris/ErrorReportHandler.cs b/UIX/Microsoft/Iris/ErrorReportHandler.cs new file mode 100644 index 0000000..0b9d81b --- /dev/null +++ b/UIX/Microsoft/Iris/ErrorReportHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ErrorReportHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public delegate void ErrorReportHandler(Error[] errors); +} diff --git a/UIX/Microsoft/Iris/Group.cs b/UIX/Microsoft/Iris/Group.cs new file mode 100644 index 0000000..291bdba --- /dev/null +++ b/UIX/Microsoft/Iris/Group.cs @@ -0,0 +1,59 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Group +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; + +namespace Microsoft.Iris +{ + public class Group : VirtualList + { + private GroupedList _groupedList; + private int _startIndex; + + internal Group(GroupedList groupedList, int startIndex, int count) + : base(groupedList, true, null) + { + _groupedList = groupedList; + _startIndex = startIndex; + Count = count; + } + + public int StartIndex + { + get => _startIndex; + internal set + { + if (_startIndex == value) + return; + _startIndex = value; + FirePropertyChanged(nameof(StartIndex)); + FirePropertyChanged("EndIndex"); + } + } + + public int EndIndex => StartIndex + Count - 1; + + internal override void OnCountChanged() => FirePropertyChanged("EndIndex"); + + private int GetSourceIndex(int groupedIndex) => StartIndex + groupedIndex; + + internal bool ContainsSourceIndex(int sourceIndex) => StartIndex <= sourceIndex && sourceIndex <= EndIndex; + + protected override object OnRequestItem(int index) => _groupedList.Source[GetSourceIndex(index)]; + + protected override void OnRequestSlowData(int groupedIndex) + { + if (!(_groupedList.Source is IVirtualList source) || !source.SlowDataRequestsEnabled) + return; + int sourceIndex = GetSourceIndex(groupedIndex); + if (sourceIndex >= source.Count) + return; + source.NotifyRequestSlowData(sourceIndex); + } + + public override string ToString() => "Group [" + StartIndex + "-" + EndIndex + "]"; + } +} diff --git a/UIX/Microsoft/Iris/GroupedList.cs b/UIX/Microsoft/Iris/GroupedList.cs new file mode 100644 index 0000000..533b402 --- /dev/null +++ b/UIX/Microsoft/Iris/GroupedList.cs @@ -0,0 +1,380 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.GroupedList +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Session; +using System; +using System.Collections; + +namespace Microsoft.Iris +{ + public class GroupedList : VirtualList + { + private IList _source; + private IComparer _comparer; + private Vector _groups = new Vector(); + private bool _repairGroupsPending; + private bool _adjustCountPending; + + public GroupedList() + : base(true) + { + } + + public GroupedList(IList source, IComparer comparer, int count) + : base(true) + { + Comparer = comparer; + SetSource(source, count); + } + + public IList Source + { + get => _source; + set => SetSource(value, 1, false); + } + + public void SetSource(IList source, int groupCount) => SetSource(source, groupCount, false); + + private void SetSource(IList value, int groupCount, bool disposing) + { + if (_source == value) + return; + if (_source is INotifyList sourceNotifyA) + sourceNotifyA.ContentsChanged -= new UIListContentsChangedHandler(SourceListModified); + if (_source is IVirtualList sourceVirtual && sourceVirtual.SlowDataRequestsEnabled) + sourceVirtual.SlowDataAcquireCompleteHandler = null; + _source = value; + if (_source is INotifyList sourceNotifyB) + sourceNotifyB.ContentsChanged += new UIListContentsChangedHandler(SourceListModified); + if (_source is IVirtualList sourceVirtualB && sourceVirtualB.SlowDataRequestsEnabled) + sourceVirtualB.SlowDataAcquireCompleteHandler = new SlowDataAcquireCompleteHandler(SourceSlowDataAcquired); + if (disposing) + return; + FirePropertyChanged("Source"); + Regroup(groupCount); + } + + public IComparer Comparer + { + get => _comparer; + set + { + if (_comparer == value) + return; + _comparer = value; + Regroup(); + FirePropertyChanged(nameof(Comparer)); + } + } + + public void Regroup() => Regroup(1); + + public void Regroup(int groupCount) + { + foreach (ModelItem group in _groups) + group.Dispose(); + _groups.Clear(); + Clear(); + Count = Source == null || Source.Count <= 0 ? 0 : Math.Max(1, groupCount); + } + + protected override object OnRequestItem(int index) + { + if (_repairGroupsPending && index >= _groups.Count) + return null; + EnsureGroup(index); + return index >= _groups.Count ? null : (object)_groups[index]; + } + + private void ScheduleAdjustCount() + { + if (_adjustCountPending || GetCountAdjustment() == 0) + return; + DeferredCall.Post(DispatchPriority.Housekeeping, new DeferredHandler(AdjustCount)); + } + + private int GetCountAdjustment() + { + int num1 = 0; + int num2 = Source != null ? Source.Count : 0; + Group lastGroup = GetLastGroup(); + int num3 = lastGroup != null ? lastGroup.EndIndex + 1 : 0; + int num4 = num2 - num3; + int num5 = Count - _groups.Count; + if (_groups.Count == Count && num4 > 0) + { + int num6 = num3 / _groups.Count; + num1 = Math.Max(1, num4 / num6); + } + else if (lastGroup == null || num5 > num4) + num1 = num4 - num5; + return num1; + } + + private void AdjustCount(object args) + { + _adjustCountPending = false; + int countAdjustment = GetCountAdjustment(); + if (countAdjustment > 0) + { + AddRange(countAdjustment); + } + else + { + if (countAdjustment >= 0) + return; + int num = -countAdjustment; + for (int index = 0; index < num; ++index) + RemoveAt(Count - 1); + } + } + + private bool SourceSlowDataAcquired(IVirtualList list, int sourceIndex) + { + Group groupForSourceIndex = GetGroupForSourceIndex(sourceIndex); + groupForSourceIndex?.NotifySlowDataAcquireComplete(sourceIndex - groupForSourceIndex.StartIndex); + return false; + } + + private void EnsureGroup(int maxGroup) + { + if (Comparer != null && Source != null && Source.Count > 0) + { + int previousGroupIndex = _groups.Count - 1; + Group lastGroup = GetLastGroup(); + GroupItems(ref lastGroup, ref previousGroupIndex, Source.Count - 1, maxGroup, true, false); + } + ScheduleAdjustCount(); + } + + private void GroupItems( + ref Group previousGroup, + ref int previousGroupIndex, + int endIndex, + int maxGroup, + bool createGroups, + bool notify) + { + if (_groups.Count > maxGroup) + return; + if (previousGroup == null) + { + ++previousGroupIndex; + previousGroup = InsertGroup(previousGroupIndex, 0, notify); + } + for (int index = previousGroup.EndIndex + 1; index <= endIndex; ++index) + { + if (!TryInsertItemIntoGroup(previousGroup, index)) + { + if (!createGroups || _groups.Count > maxGroup) + break; + ++previousGroupIndex; + previousGroup = InsertGroup(previousGroupIndex, index, notify); + } + } + } + + protected override void OnDispose(bool disposing) + { + if (disposing) + SetSource(null, 0, true); + base.OnDispose(disposing); + } + + private void SourceListModified(IList listSender, UIListContentsChangedArgs args) + { + if (Comparer == null) + return; + bool flag = false; + switch (args.Type) + { + case UIListContentsChangeType.Add: + case UIListContentsChangeType.AddRange: + case UIListContentsChangeType.Insert: + case UIListContentsChangeType.InsertRange: + if (Count != 0) + { + Group lastGroup = GetLastGroup(); + if (lastGroup != null && args.NewIndex <= lastGroup.EndIndex + 1) + { + flag = true; + int newIndex = args.NewIndex; + int num = args.NewIndex + args.Count - 1; + int groupIndex; + Group groupForSourceIndex = GetGroupForSourceIndex(newIndex - 1, out groupIndex); + for (int index = groupIndex + 1; index < _groups.Count; ++index) + _groups[index].StartIndex += args.Count; + if (groupForSourceIndex != null && groupForSourceIndex.ContainsSourceIndex(newIndex)) + { + SplitGroup(groupForSourceIndex, groupIndex, newIndex - 1, num + 1); + break; + } + break; + } + break; + } + Count = 1; + break; + case UIListContentsChangeType.Remove: + int groupIndex1; + Group groupForSourceIndex1 = GetGroupForSourceIndex(args.OldIndex, out groupIndex1); + for (int index = groupIndex1 + 1; index < _groups.Count; ++index) + --_groups[index].StartIndex; + if (groupForSourceIndex1 != null) + { + if (groupForSourceIndex1.Count == 1) + { + RemoveGroup(groupIndex1); + flag = true; + break; + } + groupForSourceIndex1.RemoveAt(args.OldIndex - groupForSourceIndex1.StartIndex); + break; + } + break; + case UIListContentsChangeType.Move: + case UIListContentsChangeType.Modified: + throw new NotImplementedException(); + default: + Regroup(); + break; + } + if (!flag || _repairGroupsPending) + return; + _repairGroupsPending = true; + DeferredCall.Post(DispatchPriority.Housekeeping, new DeferredHandler(RepairGroups)); + } + + private void RepairGroups(object args) + { + _repairGroupsPending = false; + for (int previousGroupIndex = -1; previousGroupIndex < _groups.Count; ++previousGroupIndex) + { + Group previousGroup = previousGroupIndex > -1 ? _groups[previousGroupIndex] : null; + Group group = previousGroupIndex + 1 < _groups.Count ? _groups[previousGroupIndex + 1] : null; + int num1 = previousGroup != null ? previousGroup.EndIndex + 1 : 0; + int num2 = group != null ? group.StartIndex - 1 : Source.Count - 1; + if (group != null) + { + while (num2 >= num1 && TryInsertItemIntoGroup(group, num2)) + --num2; + } + if (num1 <= num2) + GroupItems(ref previousGroup, ref previousGroupIndex, num2, int.MaxValue, group != null, true); + if (TryMergeWithNext(previousGroupIndex)) + --previousGroupIndex; + } + AdjustCount(null); + } + + private bool IsEqualToNext(int sourceIndex) => Comparer.Compare(Source[sourceIndex], Source[sourceIndex + 1]) == 0; + + private bool TryMergeWithNext(int i) + { + if (i >= 0 && i < _groups.Count - 1) + { + Group group1 = _groups[i]; + if (IsEqualToNext(group1.EndIndex)) + { + Group group2 = _groups[i + 1]; + group1.AddRange(group2.Count); + RemoveGroup(i + 1); + return true; + } + } + return false; + } + + private void RemoveGroup(int groupIndex) + { + _groups[groupIndex].Dispose(); + _groups.RemoveAt(groupIndex); + RemoveAt(groupIndex); + } + + private bool TryInsertItemIntoGroup(Group group, int index) + { + int sourceIndex = index - 1; + if (index < group.StartIndex) + sourceIndex = index; + if (!IsEqualToNext(sourceIndex)) + return false; + group.StartIndex = Math.Min(group.StartIndex, index); + group.Insert(index - group.StartIndex); + return true; + } + + private Group SplitGroup( + Group group, + int groupIndex, + int firstGroupSourceEndIndex, + int secondGroupSourceStartIndex) + { + int count = group.EndIndex - firstGroupSourceEndIndex; + for (int index = 0; index < count; ++index) + group.RemoveAt(group.Count - 1); + return InsertGroup(groupIndex + 1, secondGroupSourceStartIndex, count, true); + } + + private Group InsertGroup(int groupInsertIndex, int sourceIndex, bool notify) => InsertGroup(groupInsertIndex, sourceIndex, 1, notify); + + private Group InsertGroup( + int groupInsertIndex, + int startSourceIndex, + int count, + bool notify) + { + Group group = new Group(this, startSourceIndex, count); + group.Count = count; + _groups.Insert(groupInsertIndex, group); + if (notify) + Insert(groupInsertIndex); + return group; + } + + private Group GetLastGroup() => _groups.Count <= 0 ? null : _groups[_groups.Count - 1]; + + private Group GetGroupForSourceIndex(int sourceIndex, out int groupIndex) + { + int num1 = 0; + int num2 = _groups.Count - 1; + groupIndex = num1 + (num2 - num1) / 2; + while (num1 <= num2) + { + Group group = _groups[groupIndex]; + if (group.StartIndex <= sourceIndex && sourceIndex <= group.EndIndex) + return group; + if (group.StartIndex < sourceIndex) + num1 = groupIndex + 1; + else + num2 = groupIndex - 1; + groupIndex = num1 + (num2 - num1) / 2; + } + --groupIndex; + return null; + } + + public Group GetGroupForSourceIndex(int sourceIndex) => GetGroupForSourceIndex(sourceIndex, out int _); + + public int GetGroupIndexForSourceIndex(int sourceIndex) + { + for (int index = 0; index < Count; ++index) + { + Group group = (Group)this[index]; + if (group != null) + { + if (sourceIndex < group.Count) + return index; + sourceIndex -= group.Count; + } + else + break; + } + return -1; + } + } +} diff --git a/UIX/Microsoft/Iris/ICommand.cs b/UIX/Microsoft/Iris/ICommand.cs new file mode 100644 index 0000000..3479644 --- /dev/null +++ b/UIX/Microsoft/Iris/ICommand.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ICommand +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; +using System.ComponentModel; + +namespace Microsoft.Iris +{ + public interface ICommand : INotifyPropertyChanged + { + bool Available { get; set; } + + InvokePolicy Priority { get; set; } + + void Invoke(); + + void Invoke(InvokePolicy invokePolicy); + + event EventHandler Invoked; + } +} diff --git a/UIX/Microsoft/Iris/IDataProvider.cs b/UIX/Microsoft/Iris/IDataProvider.cs new file mode 100644 index 0000000..2a19264 --- /dev/null +++ b/UIX/Microsoft/Iris/IDataProvider.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IDataProvider +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; + +namespace Microsoft.Iris +{ + internal interface IDataProvider + { + string Name { get; } + + MarkupDataQuery Build(MarkupDataQuerySchema querySchema); + } +} diff --git a/UIX/Microsoft/Iris/IDataProviderBaseObject.cs b/UIX/Microsoft/Iris/IDataProviderBaseObject.cs new file mode 100644 index 0000000..fa8f93d --- /dev/null +++ b/UIX/Microsoft/Iris/IDataProviderBaseObject.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IDataProviderBaseObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + internal interface IDataProviderBaseObject + { + void SetProperty(string propertyName, object value); + + object GetProperty(string propertyName); + } +} diff --git a/UIX/Microsoft/Iris/IDataProviderObject.cs b/UIX/Microsoft/Iris/IDataProviderObject.cs new file mode 100644 index 0000000..1de0296 --- /dev/null +++ b/UIX/Microsoft/Iris/IDataProviderObject.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IDataProviderObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + internal interface IDataProviderObject : IDataProviderBaseObject + { + } +} diff --git a/UIX/Microsoft/Iris/IDataProviderQuery.cs b/UIX/Microsoft/Iris/IDataProviderQuery.cs new file mode 100644 index 0000000..ea20307 --- /dev/null +++ b/UIX/Microsoft/Iris/IDataProviderQuery.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IDataProviderQuery +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; + +namespace Microsoft.Iris +{ + internal interface IDataProviderQuery : IDataProviderBaseObject + { + void DeclareOwner(object owner); + + void Dispose(object owner); + + void SetInternalObject(MarkupDataQuery internalQuery); + + void OnInitialize(); + + object Result { get; set; } + + DataProviderQueryStatus Status { get; set; } + + bool Enabled { get; set; } + + void Refresh(); + } +} diff --git a/UIX/Microsoft/Iris/IModelItem.cs b/UIX/Microsoft/Iris/IModelItem.cs new file mode 100644 index 0000000..a848881 --- /dev/null +++ b/UIX/Microsoft/Iris/IModelItem.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IModelItem +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; +using System.ComponentModel; + +namespace Microsoft.Iris +{ + public interface IModelItem : INotifyPropertyChanged, IModelItemOwner + { + string Description { get; set; } + + bool Selected { get; set; } + + Guid UniqueId { get; set; } + } +} diff --git a/UIX/Microsoft/Iris/IModelItemOwner.cs b/UIX/Microsoft/Iris/IModelItemOwner.cs new file mode 100644 index 0000000..9993d61 --- /dev/null +++ b/UIX/Microsoft/Iris/IModelItemOwner.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IModelItemOwner +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public interface IModelItemOwner + { + void RegisterObject(ModelItem modelItem); + + void UnregisterObject(ModelItem modelItem); + } +} diff --git a/UIX/Microsoft/Iris/ISearchableList.cs b/UIX/Microsoft/Iris/ISearchableList.cs new file mode 100644 index 0000000..becdab7 --- /dev/null +++ b/UIX/Microsoft/Iris/ISearchableList.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ISearchableList +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public interface ISearchableList + { + int SearchForString(string searchString); + } +} diff --git a/UIX/Microsoft/Iris/IThreadSafeObject.cs b/UIX/Microsoft/Iris/IThreadSafeObject.cs new file mode 100644 index 0000000..4629c6b --- /dev/null +++ b/UIX/Microsoft/Iris/IThreadSafeObject.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IThreadSafeObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Threading; + +namespace Microsoft.Iris +{ + public interface IThreadSafeObject + { + Thread Affinity { get; set; } + } +} diff --git a/UIX/Microsoft/Iris/IValueRange.cs b/UIX/Microsoft/Iris/IValueRange.cs new file mode 100644 index 0000000..a8a503b --- /dev/null +++ b/UIX/Microsoft/Iris/IValueRange.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IValueRange +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.ComponentModel; + +namespace Microsoft.Iris +{ + public interface IValueRange : IModelItem, INotifyPropertyChanged, IModelItemOwner + { + object Value { get; } + + void NextValue(); + + void PreviousValue(); + + bool HasNextValue { get; } + + bool HasPreviousValue { get; } + } +} diff --git a/UIX/Microsoft/Iris/Image.cs b/UIX/Microsoft/Iris/Image.cs new file mode 100644 index 0000000..e9f1f9d --- /dev/null +++ b/UIX/Microsoft/Iris/Image.cs @@ -0,0 +1,195 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Image +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris +{ + public class Image : AssemblyObjectProxyHelper.IFrameworkProxyObject + { + private UIImage _uiImage; + private ImageLoadCompleteHandler _completeHandlers; + + public Image(string source) + : this(source, 0, 0, false) + { + } + + public Image(string source, ImageInset imageInset) + : this(source, imageInset.ToInset(), 0, 0, false, false) + { + } + + public Image(string source, int maximumWidth, int maximumHeight) + : this(source, maximumWidth, maximumHeight, false) + { + } + + public Image(string source, int maximumWidth, int maximumHeight, bool flippable) + : this(source, maximumWidth, maximumHeight, flippable, false) + { + } + + public Image( + string source, + int maximumWidth, + int maximumHeight, + bool flippable, + bool antialiasEdges) + : this(source, Inset.Zero, maximumWidth, maximumHeight, flippable, antialiasEdges) + { + } + + internal Image( + string source, + Inset inset, + int maximumWidth, + int maximumHeight, + bool flippable, + bool antialiasEdges) + { + if (source == null) + throw new ArgumentNullException(nameof(source)); + _uiImage = new UriImage(source, inset, new Size(maximumWidth, maximumHeight), flippable, antialiasEdges); + } + + public Image( + string uniqueID, + int imageWidth, + int imageHeight, + int stride, + RawImageFormat format, + IntPtr data) + : this(uniqueID, imageWidth, imageHeight, stride, format, data, 0, 0, false) + { + } + + public Image( + string uniqueID, + int imageWidth, + int imageHeight, + int stride, + RawImageFormat format, + IntPtr data, + int maximumWidth, + int maximumHeight, + bool flippable) + : this(uniqueID, imageWidth, imageHeight, stride, format, data, maximumWidth, maximumHeight, flippable, false) + { + } + + public Image( + string uniqueID, + int imageWidth, + int imageHeight, + int stride, + RawImageFormat format, + IntPtr data, + int maximumWidth, + int maximumHeight, + bool flippable, + bool anitaliasEdges) + { + SurfaceFormat surfaceFormat; + if (!ImageFormatUtils.RawImageFormatToSurfaceFormat(format, out surfaceFormat)) + throw new ArgumentException(nameof(format)); + uniqueID = "RAW:" + uniqueID; + _uiImage = new RawImage(uniqueID, new Size(imageWidth, imageHeight), stride, surfaceFormat, data, false, Inset.Zero, new Size(maximumWidth, maximumHeight), flippable, anitaliasEdges); + } + + public string Source => _uiImage.Source; + + public bool Load() + { + UIDispatcher.VerifyOnApplicationThread(); + _uiImage.Load(); + return _uiImage.Status == ImageStatus.Loading; + } + + public event ImageLoadCompleteHandler ImageLoadComplete + { + add + { + UIDispatcher.VerifyOnApplicationThread(); + if (_uiImage.Status == ImageStatus.PendingLoad) + throw new InvalidOperationException("Image Load event cannot be used before Load is called"); + if (_completeHandlers == null) + _uiImage.LoadComplete += new ContentLoadCompleteHandler(OnContentLoadComplete); + _completeHandlers += value; + } + remove + { + UIDispatcher.VerifyOnApplicationThread(); + if (_uiImage.Status == ImageStatus.PendingLoad) + throw new InvalidOperationException("Image Load event cannot be used before Load is called"); + _completeHandlers -= value; + if (_completeHandlers != null) + return; + _uiImage.LoadComplete -= new ContentLoadCompleteHandler(OnContentLoadComplete); + } + } + + public int Width + { + get + { + UIDispatcher.VerifyOnApplicationThread(); + return _uiImage.Width; + } + } + + public int Height + { + get + { + UIDispatcher.VerifyOnApplicationThread(); + return _uiImage.Height; + } + } + + public static void RemoveCache(string source) => RemoveCache(source, 0, 0, false, false); + + public static void RemoveCache(string source, int maximumWidth, int maximumHeight) => RemoveCache(source, maximumWidth, maximumHeight, false, false); + + public static void RemoveCache( + string source, + int maximumWidth, + int maximumHeight, + bool flippable) + { + RemoveCache(source, maximumWidth, maximumHeight, flippable, false); + } + + public static void RemoveCache( + string source, + int maximumWidth, + int maximumHeight, + bool flippable, + bool antialiasEdges) + { + if (source == null) + throw new ArgumentNullException(nameof(source)); + UriImage.RemoveCache(source, new Size(maximumWidth, maximumHeight), flippable, antialiasEdges); + } + + private void OnContentLoadComplete(object owner, ImageStatus status) => _completeHandlers(this); + + internal UIImage UIImage + { + get + { + UIDispatcher.VerifyOnApplicationThread(); + return _uiImage; + } + } + + object AssemblyObjectProxyHelper.IFrameworkProxyObject.FrameworkObject => _uiImage; + } +} diff --git a/UIX/Microsoft/Iris/ImageFormatUtils.cs b/UIX/Microsoft/Iris/ImageFormatUtils.cs new file mode 100644 index 0000000..2bb9238 --- /dev/null +++ b/UIX/Microsoft/Iris/ImageFormatUtils.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ImageFormatUtils +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris +{ + internal static class ImageFormatUtils + { + public static bool RawImageFormatToSurfaceFormat( + RawImageFormat rawFormat, + out SurfaceFormat surfaceFormat) + { + surfaceFormat = SurfaceFormat.None; + bool flag = true; + switch (rawFormat) + { + case RawImageFormat.A8R8G8B8: + surfaceFormat = SurfaceFormat.ARGB32; + break; + case RawImageFormat.X8R8G8B8: + surfaceFormat = SurfaceFormat.RGB32; + break; + case RawImageFormat.R8G8B8: + surfaceFormat = SurfaceFormat.RGB24; + break; + default: + flag = false; + break; + } + return flag; + } + } +} diff --git a/UIX/Microsoft/Iris/ImageInset.cs b/UIX/Microsoft/Iris/ImageInset.cs new file mode 100644 index 0000000..253759a --- /dev/null +++ b/UIX/Microsoft/Iris/ImageInset.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ImageInset +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris +{ + public struct ImageInset + { + private int _left; + private int _top; + private int _right; + private int _bottom; + + public ImageInset(int left, int top, int right, int bottom) + { + _left = left; + _top = top; + _right = right; + _bottom = bottom; + } + + public int Left => _left; + + public int Top => _top; + + public int Right => _right; + + public int Bottom => _bottom; + + internal Inset ToInset() => new Inset(_left, _top, _right, _bottom); + } +} diff --git a/UIX/Microsoft/Iris/ImageLoadCompleteHandler.cs b/UIX/Microsoft/Iris/ImageLoadCompleteHandler.cs new file mode 100644 index 0000000..e44bee7 --- /dev/null +++ b/UIX/Microsoft/Iris/ImageLoadCompleteHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ImageLoadCompleteHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public delegate void ImageLoadCompleteHandler(Image image); +} diff --git a/UIX/Microsoft/Iris/IndexedTree.cs b/UIX/Microsoft/Iris/IndexedTree.cs new file mode 100644 index 0000000..a4f39d3 --- /dev/null +++ b/UIX/Microsoft/Iris/IndexedTree.cs @@ -0,0 +1,444 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IndexedTree +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Diagnostics; + +namespace Microsoft.Iris +{ + internal class IndexedTree + { + private object _lockObj; + private IndexedTree.TreeNode _root; + private IndexedTree.TreeNode _poolHead; + private int _lastSearchedIndex; + + public IndexedTree() + { + _lastSearchedIndex = -1; + _lockObj = new object(); + } + + private void SetRoot(IndexedTree.TreeNode newValue) + { + if (_root == newValue) + return; + _root = newValue; + _lastSearchedIndex = -1; + } + + private IndexedTree.TreeNode AcquireTreeNode() + { + IndexedTree.TreeNode treeNode = _poolHead; + if (_poolHead != null) + { + _poolHead = _poolHead.parent; + treeNode.parent = null; + } + else + treeNode = new IndexedTree.TreeNode(); + return treeNode; + } + + private void ReclaimTreeNode(IndexedTree.TreeNode node) + { + node.parent = _poolHead; + node.left = null; + node.right = null; + _poolHead = node; + } + + public void Store(int index, object data) + { + lock (_lockObj) + { + IndexedTree.TreeNode newValue = Find(index); + if (newValue == null) + { + newValue = AcquireTreeNode(); + newValue.delta = index; + newValue.parent = null; + if (_root != null) + { + _root.parent = newValue; + if (_root.delta < index) + { + newValue.left = _root; + if (_root.right != null && _root.right.delta + _root.delta > index) + { + _root.right.parent = newValue; + newValue.right = _root.right; + newValue.right.delta = _root.right.delta + _root.delta - index; + _root.right = null; + } + } + else + { + newValue.right = _root; + if (_root.left != null && _root.left.delta + _root.delta < index) + { + _root.left.parent = newValue; + newValue.left = _root.left; + newValue.left.delta = _root.left.delta + _root.delta - index; + _root.left = null; + } + } + _root.delta -= index; + } + SetRoot(newValue); + } + newValue.data = data; + } + } + + public void Remove(int index) + { + lock (_lockObj) + { + IndexedTree.TreeNode node = Find(index); + if (node == null) + return; + IndexedTree.TreeNode treeNode; + for (; node.left != null; node = treeNode) + { + if (node.right == null) + { + IndexedTree.TreeNode left = node.left; + if (node == _root) + SetRoot(left); + else if (node.IsRightBranch) + node.parent.right = left; + else + node.parent.left = left; + left.delta += node.delta; + left.parent = node.parent; + ReclaimTreeNode(node); + return; + } + treeNode = node.left; + int num1 = index + treeNode.delta; + while (treeNode.right != null) + { + treeNode = treeNode.right; + num1 += treeNode.delta; + } + node.data = treeNode.data; + node.delta = num1; + if (node == _root) + _lastSearchedIndex = -1; + int num2 = num1 - index; + node.left.delta -= num2; + node.right.delta -= num2; + } + IndexedTree.TreeNode right = node.right; + if (node == _root) + SetRoot(right); + else if (node.IsRightBranch) + node.parent.right = right; + else + node.parent.left = right; + if (right != null) + { + right.delta += node.delta; + right.parent = node.parent; + } + ReclaimTreeNode(node); + } + } + + public bool TryGetData(int index, out object data) + { + lock (_lockObj) + { + IndexedTree.TreeNode treeNode = Find(index); + data = treeNode == null ? null : treeNode.data; + return treeNode != null; + } + } + + public void InsertRange(int index, int count) + { + lock (_lockObj) + { + Find(index); + if (_root == null) + return; + IndexedTree.TreeNode node = _root; + if (_root.delta < index) + node = _root.right; + ChangeIndex(node, count); + } + } + + private void ChangeIndex(IndexedTree.TreeNode node, int amount) + { + if (node == null) + return; + node.delta += amount; + if (node.left == null) + return; + node.left.delta -= amount; + } + + public void Insert(int index, bool setValue, object data) + { + lock (_lockObj) + { + InsertRange(index, 1); + if (!setValue) + return; + Store(index, data); + } + } + + public void RemoveIndex(int index) + { + lock (_lockObj) + { + IndexedTree.TreeNode treeNode = Find(index); + if (treeNode != null) + { + if (treeNode.right != null) + --treeNode.right.delta; + Remove(index); + } + else + { + if (_root == null) + return; + IndexedTree.TreeNode node = _root; + if (_root.delta < index) + node = _root.right; + ChangeIndex(node, -1); + } + } + } + + public void Clear() + { + lock (_lockObj) + SetRoot(null); + } + + public bool Contains(int index) + { + lock (_lockObj) + return Find(index) != null; + } + + public object this[int index] + { + get + { + lock (_lockObj) + { + object data; + TryGetData(index, out data); + return data; + } + } + set + { + lock (_lockObj) + Store(index, value); + } + } + + private IndexedTree.TreeNode Find(int index) + { + if (_lastSearchedIndex == index && _root != null) + return _root.delta != index ? null : _root; + _lastSearchedIndex = index; + IndexedTree.TreeNode treeNode = _root; + IndexedTree.TreeNode node = null; + int num = 0; + bool flag = false; + while (!flag && treeNode != null) + { + num += treeNode.delta; + node = treeNode; + if (num == index) + flag = true; + else + treeNode = num <= index ? treeNode.right : treeNode.left; + } + if (node != null) + Splay(node); + _lastSearchedIndex = index; + return !flag ? null : treeNode; + } + + private void Splay(IndexedTree.TreeNode node) + { + for (IndexedTree.TreeNode parent = node.parent; parent != null; parent = node.parent) + { + if (parent.parent == null) + Zig(node); + else if (node.IsLeftBranch == parent.IsLeftBranch) + ZigZig(node, parent); + else + ZigZag(node); + } + SetRoot(node); + } + + private void Zig(IndexedTree.TreeNode item) => Rotate(item); + + private void ZigZig(IndexedTree.TreeNode item, IndexedTree.TreeNode parent) + { + Rotate(parent); + Rotate(item); + } + + private void ZigZag(IndexedTree.TreeNode item) + { + Rotate(item); + Rotate(item); + } + + private void Rotate(IndexedTree.TreeNode child) + { + IndexedTree.TreeNode parent = child.parent; + int num1 = -child.delta; + int num2 = child.delta + parent.delta; + IndexedTree.TreeNode treeNode; + if (child.IsLeftBranch) + { + treeNode = child.right; + parent.left = treeNode; + child.parent = parent.parent; + child.right = parent; + } + else + { + treeNode = child.left; + parent.right = treeNode; + child.parent = parent.parent; + child.left = parent; + } + if (treeNode != null) + { + treeNode.parent = parent; + treeNode.delta += child.delta; + } + if (child.parent != null) + { + if (num2 < 0) + child.parent.left = child; + else + child.parent.right = child; + } + child.delta = num2; + parent.delta = num1; + parent.parent = child; + } + + public IndexedTree.TreeNode Root => _root; + + public IndexedTree.TreeEnumerator GetEnumerator() => new IndexedTree.TreeEnumerator(this); + + [Conditional("DEBUG")] + private void DEBUG_BumpGeneration() + { + } + + public class TreeNode + { + public int delta; + public IndexedTree.TreeNode left; + public IndexedTree.TreeNode right; + public IndexedTree.TreeNode parent; + public object data; + + public bool IsLeftBranch => delta < 0; + + public bool IsRightBranch => delta > 0; + } + + public struct TreeEntry + { + private int _index; + private object _data; + + public TreeEntry(int index, object data) + { + _index = index; + _data = data; + } + + public int Index => _index; + + public object Value => _data; + } + + public struct TreeEnumerator + { + private IndexedTree _tree; + private bool _started; + private IndexedTree.TreeNode _current; + private int _index; + + public TreeEnumerator(IndexedTree tree) + { + _tree = tree; + _current = _tree._root; + _started = false; + _index = _current != null ? _current.delta : -1; + } + + [Conditional("DEBUG")] + private void DEBUG_CheckGeneration() + { + } + + private void MoveToLeftmostChild() + { + if (_current == null) + return; + while (_current.left != null) + { + _current = _current.left; + _index += _current.delta; + } + } + + public bool MoveNext() + { + lock (_tree._lockObj) + { + if (!_started) + { + _started = true; + MoveToLeftmostChild(); + } + else if (_current.right != null) + { + _current = _current.right; + _index += _current.delta; + MoveToLeftmostChild(); + } + else if (_current.IsLeftBranch) + { + _index -= _current.delta; + _current = _current.parent; + } + else + { + for (; _current != null && _current.IsRightBranch; _current = _current.parent) + _index -= _current.delta; + if (_current != null) + { + _index -= _current.delta; + _current = _current.parent; + } + } + return _current != null; + } + } + + public IndexedTree.TreeEntry Current => new IndexedTree.TreeEntry(_index, _current.data); + } + } +} diff --git a/UIX/Microsoft/Iris/Input/AppCommandMapping.cs b/UIX/Microsoft/Iris/Input/AppCommandMapping.cs new file mode 100644 index 0000000..aaf43fb --- /dev/null +++ b/UIX/Microsoft/Iris/Input/AppCommandMapping.cs @@ -0,0 +1,54 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.AppCommandMapping +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal class AppCommandMapping + { + private AppCommandMapping() + { + } + + public static CommandCode Find(uint appCommand) + { + CommandCode commandCode = CommandCode.None; + switch (appCommand) + { + case 1: + commandCode = CommandCode.Back; + break; + case 11: + commandCode = CommandCode.SkipForward; + break; + case 12: + commandCode = CommandCode.SkipBack; + break; + case 13: + commandCode = CommandCode.Stop; + break; + case 14: + commandCode = CommandCode.PlayPause; + break; + case 46: + commandCode = CommandCode.Play; + break; + case 47: + commandCode = CommandCode.Pause; + break; + case 48: + commandCode = CommandCode.Record; + break; + case 49: + commandCode = CommandCode.FF; + break; + case 50: + commandCode = CommandCode.Rewind; + break; + } + return commandCode; + } + } +} diff --git a/UIX/Microsoft/Iris/Input/CommandCode.cs b/UIX/Microsoft/Iris/Input/CommandCode.cs new file mode 100644 index 0000000..d63899b --- /dev/null +++ b/UIX/Microsoft/Iris/Input/CommandCode.cs @@ -0,0 +1,98 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.CommandCode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal enum CommandCode + { + None = 0, + Guide = 1, + ChannelUp = 2, + PageUp = 2, + ChannelDown = 3, + PageDown = 3, + Play = 4, + Pause = 5, + Record = 6, + FF = 7, + Rewind = 8, + SkipForward = 9, + SkipBack = 10, // 0x0000000A + Stop = 11, // 0x0000000B + Mute = 12, // 0x0000000C + VolumeUp = 13, // 0x0000000D + VolumeDown = 14, // 0x0000000E + Details = 15, // 0x0000000F + Back = 16, // 0x00000010 + Home = 17, // 0x00000011 + MyPictures = 18, // 0x00000012 + LiveTV = 19, // 0x00000013 + MyShows = 20, // 0x00000014 + MyMusic = 21, // 0x00000015 + DVDMenu = 22, // 0x00000016 + MyVideos = 23, // 0x00000017 + DVDAudio = 24, // 0x00000018 + DVDSubtitles = 25, // 0x00000019 + Clear = 26, // 0x0000001A + MyTV = 27, // 0x0000001B + Forward = 28, // 0x0000001C + PlayPause = 30, // 0x0000001E + GoToBeginning = 31, // 0x0000001F + GoToEnd = 32, // 0x00000020 + StartOfList = 33, // 0x00000021 + EndOfList = 34, // 0x00000022 + ClosedCaption = 35, // 0x00000023 + Enter = 36, // 0x00000024 + ToggleWindowMode = 37, // 0x00000025 + RecordedTV = 38, // 0x00000026 + Refresh = 39, // 0x00000027 + DVDAngle = 40, // 0x00000028 + Reload = 41, // 0x00000029 + Print = 42, // 0x0000002A + Console = 43, // 0x0000002B + Kanji = 44, // 0x0000002C + Kana = 45, // 0x0000002D + MyRadio = 46, // 0x0000002E + Copy = 47, // 0x0000002F + Paste = 48, // 0x00000030 + SearchGuide = 49, // 0x00000031 + AdvanceZoomMode = 50, // 0x00000032 + MyGames = 51, // 0x00000033 + MorePrograms = 52, // 0x00000034 + Teletext = 53, // 0x00000035 + TeletextRed = 54, // 0x00000036 + TeletextGreen = 55, // 0x00000037 + TeletextYellow = 56, // 0x00000038 + TeletextBlue = 57, // 0x00000039 + MCEPower = 58, // 0x0000003A + DesignMode = 59, // 0x0000003B + ToBeRecorded = 60, // 0x0000003C + Messenger = 61, // 0x0000003D + Deprecated1 = 62, // 0x0000003E + Hangul = 63, // 0x0000003F + Hanja = 64, // 0x00000040 + PlayDisc = 65, // 0x00000041 + ToggleLock = 66, // 0x00000042 + SymphonyMessenger = 67, // 0x00000043 + OnlineSpotlight = 68, // 0x00000044 + OEMExtensibilityLaunch1 = 69, // 0x00000045 + Extender = 70, // 0x00000046 + Minimize = 71, // 0x00000047 + Close = 72, // 0x00000048 + OEMExtensibility0 = 73, // 0x00000049 + OEMExtensibility1 = 74, // 0x0000004A + OEMExtensibility2 = 75, // 0x0000004B + OEMExtensibility3 = 76, // 0x0000004C + OEMExtensibility4 = 77, // 0x0000004D + OEMExtensibility5 = 78, // 0x0000004E + OEMExtensibility6 = 79, // 0x0000004F + OEMExtensibility7 = 80, // 0x00000050 + OEMExtensibility8 = 81, // 0x00000051 + OEMExtensibility9 = 82, // 0x00000052 + OEMExtensibility10 = 83, // 0x00000053 + OEMExtensibility11 = 84, // 0x00000054 + } +} diff --git a/UIX/Microsoft/Iris/Input/DragDropInfo.cs b/UIX/Microsoft/Iris/Input/DragDropInfo.cs new file mode 100644 index 0000000..2702d68 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/DragDropInfo.cs @@ -0,0 +1,70 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.DragDropInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal class DragDropInfo : MouseInfo + { + private static InputInfo.InfoType s_poolType = InfoType.DragDrop; + private InputModifiers _modifiers; + private DragOperation _operation; + + static DragDropInfo() => SetPoolLimitMode(s_poolType, false); + + private DragDropInfo() + { + } + + public static DragDropInfo Create( + IRawInputSite rawSource, + int x, + int y, + InputModifiers modifiers, + DragOperation operation) + { + DragDropInfo dragDropInfo = (DragDropInfo)GetFromPool(s_poolType) ?? new DragDropInfo(); + dragDropInfo.Initialize(rawSource, x, y, modifiers, operation); + return dragDropInfo; + } + + public void Initialize( + IRawInputSite rawSource, + int x, + int y, + InputModifiers modifiers, + DragOperation operation) + { + _modifiers = modifiers; + _operation = operation; + Initialize(rawSource, x, y, EventTypeForDragOperation(operation)); + } + + protected override InputInfo.InfoType PoolType => s_poolType; + + public InputModifiers Modifiers => _modifiers; + + public DragOperation Operation => _operation; + + private static InputEventType EventTypeForDragOperation(DragOperation operation) + { + switch (operation) + { + case DragOperation.Enter: + return InputEventType.DragEnter; + case DragOperation.Over: + return InputEventType.DragOver; + case DragOperation.Leave: + return InputEventType.DragLeave; + case DragOperation.Drop: + return InputEventType.DragDropped; + case DragOperation.DragComplete: + return InputEventType.DragComplete; + default: + return InputEventType.Invalid; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Input/DragOperation.cs b/UIX/Microsoft/Iris/Input/DragOperation.cs new file mode 100644 index 0000000..3159e11 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/DragOperation.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.DragOperation +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal enum DragOperation + { + Enter, + Over, + Leave, + Drop, + DragComplete, + } +} diff --git a/UIX/Microsoft/Iris/Input/HIDCommandMapping.cs b/UIX/Microsoft/Iris/Input/HIDCommandMapping.cs new file mode 100644 index 0000000..ded7143 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/HIDCommandMapping.cs @@ -0,0 +1,76 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.HIDCommandMapping +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal class HIDCommandMapping + { + private static readonly HIDCommandMapping[] s_mappings = new HIDCommandMapping[41] + { + new HIDCommandMapping(CommandCode.Guide, 141U, 12U), + new HIDCommandMapping(CommandCode.ChannelUp, 156U, 12U), + new HIDCommandMapping(CommandCode.ChannelDown, 157U, 12U), + new HIDCommandMapping(CommandCode.Print, 520U, 12U), + new HIDCommandMapping(CommandCode.Details, 521U, 12U), + new HIDCommandMapping(CommandCode.Home, 13U, 65468U), + new HIDCommandMapping(CommandCode.DVDMenu, 36U, 65468U), + new HIDCommandMapping(CommandCode.LiveTV, 37U, 65468U), + new HIDCommandMapping(CommandCode.AdvanceZoomMode, 39U, 65468U), + new HIDCommandMapping(CommandCode.OnlineSpotlight, 60U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibilityLaunch1, 61U, 65468U), + new HIDCommandMapping(CommandCode.ClosedCaption, 43U, 65468U), + new HIDCommandMapping(CommandCode.MyTV, 70U, 65468U), + new HIDCommandMapping(CommandCode.MyMusic, 71U, 65468U), + new HIDCommandMapping(CommandCode.MyShows, 72U, 65468U), + new HIDCommandMapping(CommandCode.MyPictures, 73U, 65468U), + new HIDCommandMapping(CommandCode.MyVideos, 74U, 65468U), + new HIDCommandMapping(CommandCode.DVDAngle, 75U, 65468U), + new HIDCommandMapping(CommandCode.DVDAudio, 76U, 65468U), + new HIDCommandMapping(CommandCode.DVDSubtitles, 77U, 65468U), + new HIDCommandMapping(CommandCode.MyRadio, 80U, 65468U), + new HIDCommandMapping(CommandCode.Teletext, 90U, 65468U), + new HIDCommandMapping(CommandCode.TeletextRed, 91U, 65468U), + new HIDCommandMapping(CommandCode.TeletextGreen, 92U, 65468U), + new HIDCommandMapping(CommandCode.TeletextYellow, 93U, 65468U), + new HIDCommandMapping(CommandCode.TeletextBlue, 94U, 65468U), + new HIDCommandMapping(CommandCode.SymphonyMessenger, 100U, 65468U), + new HIDCommandMapping(CommandCode.Messenger, 105U, 65468U), + new HIDCommandMapping(CommandCode.MCEPower, 112U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility0, 50U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility1, 51U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility2, 52U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility3, 53U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility4, 54U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility5, 55U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility6, 56U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility7, 57U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility8, 58U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility9, 128U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility10, 129U, 65468U), + new HIDCommandMapping(CommandCode.OEMExtensibility11, 111U, 65468U) + }; + private CommandCode _command; + private uint _usage; + private uint _usagePage; + + private HIDCommandMapping(CommandCode command, uint usage, uint usagePage) + { + _command = command; + _usage = usage; + _usagePage = usagePage; + } + + public static CommandCode Find(uint usage, uint usagePage) + { + foreach (HIDCommandMapping mapping in s_mappings) + { + if ((int)mapping._usage == (int)usage && (int)mapping._usagePage == (int)usagePage) + return mapping._command; + } + return CommandCode.None; + } + } +} diff --git a/UIX/Microsoft/Iris/Input/HidDevice.cs b/UIX/Microsoft/Iris/Input/HidDevice.cs new file mode 100644 index 0000000..d19b67a --- /dev/null +++ b/UIX/Microsoft/Iris/Input/HidDevice.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.HidDevice +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal class HidDevice : InputDevice + { + internal HidDevice(InputManager manager) + : base(manager) + { + } + + internal KeyCommandInfo OnRawInput(CommandCode command, ref RawHidData args) + { + KeyCommandInfo keyCommandInfo = null; + if (command != CommandCode.None) + keyCommandInfo = KeyCommandInfo.Create(args._action, args._deviceType, command); + return keyCommandInfo; + } + } +} diff --git a/UIX/Microsoft/Iris/Input/ICookedInputSite.cs b/UIX/Microsoft/Iris/Input/ICookedInputSite.cs new file mode 100644 index 0000000..9123f27 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/ICookedInputSite.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.ICookedInputSite +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal interface ICookedInputSite + { + IRawInputSite RawInputSource { get; } + + bool IsValid { get; } + + bool AllowDoubleClicks { get; } + } +} diff --git a/UIX/Microsoft/Iris/Input/IInputCustomFocus.cs b/UIX/Microsoft/Iris/Input/IInputCustomFocus.cs new file mode 100644 index 0000000..0c80b0f --- /dev/null +++ b/UIX/Microsoft/Iris/Input/IInputCustomFocus.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.IInputCustomFocus +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal interface IInputCustomFocus + { + bool OverrideHostFocus(); + } +} diff --git a/UIX/Microsoft/Iris/Input/InputDevice.cs b/UIX/Microsoft/Iris/Input/InputDevice.cs new file mode 100644 index 0000000..f199f1b --- /dev/null +++ b/UIX/Microsoft/Iris/Input/InputDevice.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputDevice +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal abstract class InputDevice + { + private InputManager _manager; + + internal InputDevice(InputManager manager) => _manager = manager; + + internal InputManager Manager => _manager; + } +} diff --git a/UIX/Microsoft/Iris/Input/InputEventType.cs b/UIX/Microsoft/Iris/Input/InputEventType.cs new file mode 100644 index 0000000..766000b --- /dev/null +++ b/UIX/Microsoft/Iris/Input/InputEventType.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputEventType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal enum InputEventType + { + Invalid, + CommandDown, + CommandUp, + GainKeyFocus, + LoseKeyFocus, + KeyDown, + KeyUp, + KeyCharacter, + MouseMove, + GainMouseFocus, + LoseMouseFocus, + MousePrimaryDown, + MouseSecondaryDown, + MousePrimaryUp, + MouseSecondaryUp, + MouseDoubleClick, + MouseWheel, + DragEnter, + DragOver, + DragLeave, + DragDropped, + DragComplete, + } +} diff --git a/UIX/Microsoft/Iris/Input/InputInfo.cs b/UIX/Microsoft/Iris/Input/InputInfo.cs new file mode 100644 index 0000000..5f85241 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/InputInfo.cs @@ -0,0 +1,146 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Diagnostics; + +namespace Microsoft.Iris.Input +{ + internal abstract class InputInfo + { + private static InputInfo.InfoPool[] s_pools; + protected ICookedInputSite _target; + protected InputEventType _eventType; + private byte _lockCount; + private bool _routeTruncated; + private bool _handled; + + protected void Initialize(InputEventType eventType) + { + _eventType = eventType; + _lockCount = 0; + _routeTruncated = false; + _handled = false; + } + + [Conditional("DEBUG")] + protected void DEBUG_AssertInitialized() + { + } + + [Conditional("DEBUG")] + private void DEBUG_AssertZombied() + { + } + + protected static void SetPoolLimitMode(InputInfo.InfoType type, bool keepSingle) + { + if (s_pools == null) + s_pools = new InputInfo.InfoPool[9]; + s_pools[(int)type].SetLimitMode(keepSingle); + } + + protected abstract InputInfo.InfoType PoolType { get; } + + protected virtual void Zombie() + { + _target = null; + _eventType = InputEventType.Invalid; + } + + protected static InputInfo GetFromPool(InputInfo.InfoType poolType) => s_pools[(int)poolType].GetPooledInfo(); + + public void ReturnToPool() + { + if (!Poolable) + return; + s_pools[(int)PoolType].RecycleInfo(this); + } + + private bool Poolable => _lockCount == 0; + + public void Lock() => ++_lockCount; + + public void Unlock() + { + --_lockCount; + if (_lockCount != 0) + return; + ReturnToPool(); + } + + public bool Handled => _handled; + + public void MarkHandled() => _handled = true; + + public bool RouteTruncated => _routeTruncated; + + public ICookedInputSite Target => _target; + + public virtual InputEventType EventType => _eventType; + + public void TruncateRoute() => _routeTruncated = true; + + public virtual void UpdateTarget(ICookedInputSite target) => _target = target; + + public override string ToString() => GetType().Name; + + private struct InfoPool + { + private int _numEntries; + private int _maxEntries; + private object _storage; + + public void SetLimitMode(bool keepSingle) => _maxEntries = keepSingle ? 1 : 10; + + public InputInfo GetPooledInfo() + { + InputInfo inputInfo = null; + if (_numEntries > 0) + { + inputInfo = _maxEntries != 1 ? ((InputInfo[])_storage)[_numEntries - 1] : (InputInfo)_storage; + --_numEntries; + } + return inputInfo; + } + + public bool RecycleInfo(InputInfo info) + { + bool flag = false; + if (_numEntries < _maxEntries) + { + info.Zombie(); + if (_maxEntries == 1) + { + _storage = info; + } + else + { + if (_storage == null) + _storage = (new InputInfo[_maxEntries]); + ((InputInfo[])_storage)[_numEntries] = info; + } + ++_numEntries; + flag = true; + } + return flag; + } + } + + public enum InfoType + { + KeyCommand, + KeyFocus, + KeyState, + KeyCharacter, + MouseFocus, + MouseMove, + MouseButton, + MouseWheel, + DragDrop, + NumTypes, + } + } +} diff --git a/UIX/Microsoft/Iris/Input/InputItem.cs b/UIX/Microsoft/Iris/Input/InputItem.cs new file mode 100644 index 0000000..83bffa0 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/InputItem.cs @@ -0,0 +1,89 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputItem +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Debug; +using Microsoft.Iris.Queues; + +namespace Microsoft.Iris.Input +{ + internal class InputItem : QueueItem + { + private const int c_maxCacheCount = 5; + private static InputItem s_cache; + private static int s_cachedCount; + private InputManager _manager; + private ICookedInputSite _target; + private InputInfo _info; + + private InputItem() + { + } + + public static InputItem Create( + InputManager manager, + ICookedInputSite target, + InputInfo info) + { + InputItem inputItem = AllocateFromPool(); + inputItem._manager = manager; + inputItem._target = target; + inputItem._info = info; + return inputItem; + } + + private static InputItem AllocateFromPool() + { + InputItem inputItem = null; + if (s_cache != null) + { + inputItem = s_cache; + s_cache = (InputItem)inputItem._next; + inputItem._next = null; + --s_cachedCount; + } + if (inputItem == null) + inputItem = new InputItem(); + return inputItem; + } + + public void ReturnToPool() => ReturnToPool(true); + + private void ReturnToPool(bool returnInfoToo) + { + if (returnInfoToo) + _info.ReturnToPool(); + _manager = null; + _target = null; + _info = null; + _prev = null; + _next = null; + _owner = null; + if (s_cachedCount >= 5) + return; + _next = s_cache; + s_cache = this; + ++s_cachedCount; + } + + public InputManager Manager => _manager; + + public InputInfo Info => _info; + + public override string ToString() => base.ToString() + " -> " + _info + " -> " + DebugHelpers.DEBUG_ObjectToString(_target); + + public override void Dispatch() + { + if (_info.Target == null) + _info.UpdateTarget(_target); + _info.Lock(); + _manager.DeliverInput(_target, _info); + _info.Unlock(); + ReturnToPool(false); + } + + internal void UpdateInputSite(ICookedInputSite target) => _target = target; + } +} diff --git a/UIX/Microsoft/Iris/Input/InputManager.cs b/UIX/Microsoft/Iris/Input/InputManager.cs new file mode 100644 index 0000000..e9fe091 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/InputManager.cs @@ -0,0 +1,653 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputManager +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Debug; +using Microsoft.Iris.Library; +using Microsoft.Iris.OS; +using Microsoft.Iris.Queues; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Input +{ + internal class InputManager : IRawInputCallbacks + { + private InputModifiers _HACK_sysModifiers; + private UISession _session; + private InputQueue _inputQueue; + private int _inputSuspendCount; + private readonly SimpleCallback _resumeInput; + private KeyboardDevice _keyboardDevice; + private MouseDevice _mouseDevice; + private HidDevice _remoteDevice; + private DateTime _lastInputTime; + private bool _keyFocusCanBeNull; + private bool _ignoreHungKeyFocus; + private ICookedInputSite _ignoreHungKeyFocusTarget; + private bool _inputDisabled; + private KeyCoalesceFilter _keyCoalescePolicy; + private KeyStateInfo _currentCoalesceKeyEvent; + private bool _currentCoalesceUndelivered; + private Point _physicalMouseOffset; + private bool _refreshHitTargetPending; + private readonly SimpleCallback _refreshHitTargetHandler; + private UIZone _mouseFocusZone; + private UIZone _keyFocusZone; + private static readonly DeferredHandler s_deliverCoalescedKey = new DeferredHandler(DeliverCoalescedKey); + + internal InputManager(UISession session) + { + _session = session; + _keyFocusCanBeNull = true; + _lastInputTime = DateTime.MinValue; + _inputQueue = new InputQueue(this); + _resumeInput = new SimpleCallback(ResumeInput); + _refreshHitTargetHandler = new SimpleCallback(RefreshHitTargetHandler); + } + + internal void ConnectToRenderer() => Session.RenderSession.InputSystem.RegisterRawInputCallbacks(this); + + internal void PrepareToShutDown() + { + KeyCoalescePolicy = null; + EndKeyCoalesce(); + InvalidKeyFocus = null; + _inputDisabled = true; + Session.RenderSession.InputSystem.UnregisterRawInputCallbacks(); + _inputQueue.PrepareToShutDown(); + } + + internal UISession Session => _session; + + internal InputQueue Queue => _inputQueue; + + internal InputModifiers Modifiers => Keyboard.KeyboardModifiers | Mouse.MouseModifiers; + + internal InputModifiers DragModifiers => _inputQueue.DragModifiers; + + internal KeyboardDevice Keyboard + { + get + { + if (_keyboardDevice == null) + _keyboardDevice = new KeyboardDevice(this); + return _keyboardDevice; + } + } + + internal MouseDevice Mouse + { + get + { + if (_mouseDevice == null) + _mouseDevice = new MouseDevice(this); + return _mouseDevice; + } + } + + internal HidDevice Remote + { + get + { + if (_remoteDevice == null) + _remoteDevice = new HidDevice(this); + return _remoteDevice; + } + } + + public DateTime LastInputTime => _lastInputTime; + + public bool InputEnabled => !_inputDisabled; + + public bool KeyFocusCanBeNull + { + get => _inputDisabled || _keyFocusCanBeNull; + set + { + if (_keyFocusCanBeNull == value) + return; + _keyFocusCanBeNull = value; + if (value) + return; + _inputQueue.RevalidateInputSiteUsage(null, false); + } + } + + public ICookedInputSite RawKeyFocus => _inputQueue.PendingKeyFocus; + + public ICookedInputSite RawInstantaneousKeyFocus => _inputQueue.InstantaneousKeyFocus; + + public bool RawKeyFocusIsDefault => _inputQueue.PendingKeyFocusIsDefault; + + public KeyCoalesceFilter KeyCoalescePolicy + { + get => _keyCoalescePolicy; + set => _keyCoalescePolicy = value; + } + + public Point MostRecentPhysicalMousePos + { + get => _physicalMouseOffset; + set + { + if (!(_physicalMouseOffset != value)) + return; + _physicalMouseOffset = value; + if (MousePositionChanged == null) + return; + MousePositionChanged(this, EventArgs.Empty); + } + } + + public event InvalidKeyFocusHandler InvalidKeyFocus; + + public event EventHandler MousePositionChanged; + + public event InputNotificationHandler PreviewInput; + + public event InputNotificationHandler HandledInput; + + public event InputNotificationHandler UnhandledInput; + + public void SuspendInputUntil(DispatchPriority unlockPriority) + { + DeferredCall.Post(unlockPriority, _resumeInput); + Session.Dispatcher.BlockInputQueue(true); + ++_inputSuspendCount; + } + + private void ResumeInput() + { + if (_inputSuspendCount <= 0) + return; + --_inputSuspendCount; + if (_inputSuspendCount != 0) + return; + Session.Dispatcher.BlockInputQueue(false); + } + + internal void UpdateLastInputTime() => _lastInputTime = DateTime.UtcNow; + + public InputHandlerFlags InputHandlerMask => InputHandlerFlags.All; + + public void HandleRawKeyboardInput( + uint message, + InputModifiers modifiers, + ref RawKeyboardData args) + { + KeyInfo info = Keyboard.OnRawInput(message, modifiers, ref args); + if (info != null) + _inputQueue.RawKeyAction(info); + UpdateLastInputTime(); + } + + public void HandleRawMouseInput(uint message, InputModifiers modifiers, ref RawMouseData args) + { + Mouse.OnRawInput(message, modifiers, ref args); + UpdateLastInputTime(); + } + + public void HandleRawHidInput(ref RawHidData args) + { + KeyActionInfo keyActionInfo = Remote.OnRawInput(HIDCommandMapping.Find(args._commandCode, args._usagePage), ref args); + if (keyActionInfo != null) + _inputQueue.RawKeyAction(keyActionInfo); + UpdateLastInputTime(); + } + + public void HandleAppCommand(ref RawHidData args) + { + KeyActionInfo keyActionInfo = Remote.OnRawInput(AppCommandMapping.Find(args._commandCode), ref args); + if (keyActionInfo != null) + _inputQueue.RawKeyAction(keyActionInfo); + UpdateLastInputTime(); + } + + public void HandleRawDragInput(uint message, InputModifiers modifiers, ref RawDragData args) + { + using (DataObject dataObject = new DataObject(args._pDataStream)) + { + object data = null; + if (message == 0U) + data = dataObject.GetExternalData(); + Mouse.OnRawInput(message, modifiers, ref args, data); + } + UpdateLastInputTime(); + } + + internal void RevalidateInputSiteUsage( + ICookedInputSite target, + bool recursiveFlag, + bool knownDisabledFlag) + { + if (_ignoreHungKeyFocus && !knownDisabledFlag) + { + StopIgnoringHungKeyFocus(); + target = null; + recursiveFlag = false; + } + _inputQueue.RevalidateInputSiteUsage(target, recursiveFlag); + if (_refreshHitTargetPending) + return; + _refreshHitTargetPending = true; + DeferredCall.Post(DispatchPriority.RenderSync, _refreshHitTargetHandler); + } + + private void RefreshHitTargetHandler() + { + _refreshHitTargetPending = false; + Session.Form.RefreshHitTarget(); + } + + public bool IsPendingKeyFocusValid() => IsValidKeyFocusWorker(_inputQueue.PendingKeyFocus); + + public void SimulateDragEnter( + ICookedInputSite dragSource, + IRawInputSite rawTargetSite, + object data, + int x, + int y, + InputModifiers modifiers) + { + _inputQueue.SimulateDragEnter(dragSource, rawTargetSite, data, x, y, modifiers); + } + + public void SimulateDragOver(InputModifiers modifiers) => _inputQueue.SimulateDragOver(modifiers); + + public void SimulateDragOver( + IRawInputSite rawTargetSite, + int x, + int y, + InputModifiers modifiers) + { + _inputQueue.SimulateDragOver(rawTargetSite, x, y, modifiers); + } + + public void SimulateDragEnd( + IRawInputSite rawTargetSite, + InputModifiers modifiers, + DragOperation formOperation) + { + _inputQueue.SimulateDragEnd(rawTargetSite, modifiers, formOperation); + } + + public object GetDragDropValue() => _inputQueue.GetDragDropValue(); + + internal bool FilterKeyboardEvent(KeyStateInfo info) + { + switch (info.Action) + { + case KeyAction.Up: + EndKeyCoalesce(); + break; + case KeyAction.Down: + if (info.RepeatCount == 2U) + { + BeginKeyCoalesce(info); + break; + } + if (info.RepeatCount > 2U && CoalesceRepeatedKey(info)) + return false; + EndKeyCoalesce(); + break; + } + return true; + } + + private bool BeginKeyCoalesce(KeyStateInfo info) + { + EndKeyCoalesce(); + if (_keyCoalescePolicy == null || !_keyCoalescePolicy(info.Key)) + return false; + SetCoalesceKeyEvent(info.MakeRepeatableCopy()); + return true; + } + + private void SetCoalesceKeyEvent(KeyStateInfo info) + { + if (_currentCoalesceKeyEvent != null) + _currentCoalesceKeyEvent.Unlock(); + _currentCoalesceKeyEvent = info; + if (_currentCoalesceKeyEvent == null) + return; + _currentCoalesceKeyEvent.Lock(); + } + + private bool CoalesceRepeatedKey(KeyStateInfo info) + { + if (!info.IsRepeatOf(_currentCoalesceKeyEvent)) + return false; + SetCoalesceKeyEvent(info); + if (!_currentCoalesceUndelivered) + { + _currentCoalesceUndelivered = true; + _inputQueue.RawInputIdleItem(DeferredCall.Create(s_deliverCoalescedKey, this)); + } + return true; + } + + private void EndKeyCoalesce() + { + SetCoalesceKeyEvent(null); + _currentCoalesceUndelivered = false; + } + + private static void DeliverCoalescedKey(object args) + { + InputManager inputManager = (InputManager)args; + if (!inputManager._currentCoalesceUndelivered) + return; + inputManager._currentCoalesceUndelivered = false; + ICookedInputSite instantaneousKeyFocus = inputManager._inputQueue.InstantaneousKeyFocus; + inputManager.DeliverInputWorker(instantaneousKeyFocus, inputManager._currentCoalesceKeyEvent, EventRouteStages.All); + inputManager.SuspendInputUntil(DispatchPriority.Idle); + } + + public void MapMouseInput(MouseActionInfo info, ICookedInputSite captureSite) + { + ICookedInputSite target = HitTestInput(info.RawSource, captureSite); + if (!IsValidCookedInputSite(target)) + target = null; + IRawInputSite naturalHit = info.NaturalHit; + ICookedInputSite naturalTarget = null; + if (naturalHit != null) + naturalTarget = naturalHit != info.RawSource ? (naturalHit is ITreeNode treeNode ? treeNode.Zone?.MapInput(naturalHit, null) : null) : target; + info.SetMappedTargets(target, naturalTarget); + } + + internal ICookedInputSite HitTestInput( + IRawInputSite rawSource, + ICookedInputSite targetRelative) + { + ICookedInputSite cookedInputSite = null; + if (!_inputDisabled) + { + ITreeNode treeNode = null; + if (targetRelative != null) + treeNode = targetRelative as ITreeNode; + else if (rawSource != null) + treeNode = rawSource.OwnerData as ITreeNode; + if (treeNode != null) + { + UIZone zone = treeNode.Zone; + if (zone != null) + cookedInputSite = zone.MapInput(rawSource, targetRelative); + } + } + return cookedInputSite; + } + + internal bool IsValidCookedInputSite(ICookedInputSite target) => target == null || (target as ITreeNode).Zone != null; + + internal bool IsSiteInfluencedByPeer(ICookedInputSite target, ICookedInputSite peer) + { + if (!(peer is ITreeNode potentialParent)) + return false; + UIZone zone = potentialParent.Zone; + return zone != null && target is ITreeNode potentialChild && potentialChild.Zone == zone && zone.IsChildADescendant(potentialParent, potentialChild); + } + + internal bool IsValidKeyFocusSite(ICookedInputSite target) + { + bool flag = IsValidKeyFocusWorker(target); + if (_ignoreHungKeyFocus) + { + if (flag) + StopIgnoringHungKeyFocus(); + else if (target == _ignoreHungKeyFocusTarget) + flag = true; + else + StopIgnoringHungKeyFocus(); + } + return flag; + } + + private bool IsValidKeyFocusWorker(ICookedInputSite candidate) + { + bool flag = KeyFocusCanBeNull; + if (candidate is ITreeNode child) + { + UIZone zone = child.Zone; + if (zone != null) + flag = zone.IsChildKeyFocusable(child); + } + return flag; + } + + internal void RepairInvalidKeyFocus(uint attemptCount) + { + if (_inputQueue.PendingKeyFocus is ITreeNode pendingKeyFocus && pendingKeyFocus.Zone == null) + { + _inputQueue.RequestKeyFocus(null, KeyFocusReason.Default); + if (_keyFocusCanBeNull) + return; + } + if (attemptCount <= 1U) + { + SuspendInputUntil(DispatchPriority.LayoutSync); + } + else + { + if (InvalidKeyFocus != null) + InvalidKeyFocus(_inputQueue.LastCompletedKeyFocus); + ICookedInputSite pendingKeyFocusB = _inputQueue.PendingKeyFocus; + if (IsValidKeyFocusWorker(pendingKeyFocusB)) + return; + if (_keyFocusCanBeNull) + { + _inputQueue.RequestKeyFocus(null, KeyFocusReason.Default); + } + else + { + _ignoreHungKeyFocus = true; + _ignoreHungKeyFocusTarget = pendingKeyFocusB; + } + } + } + + private void StopIgnoringHungKeyFocus() + { + _ignoreHungKeyFocus = false; + _ignoreHungKeyFocusTarget = null; + } + + internal void RequestHostKeyFocus(ICookedInputSite target) + { + if (!_session.IsValid || target is IInputCustomFocus inputCustomFocus && inputCustomFocus.OverrideHostFocus() || _session.Form == null) + return; + _session.Form.TakeFocus(); + } + + internal void RequestHostMouseCapture(IRawInputSite rawSource, bool state) + { + if (_session.Form == null) + return; + _session.Form.SetCapture(rawSource, state); + } + + internal void DeliverInput(ICookedInputSite target, InputInfo info) + { + if (info is KeyStateInfo info1 && !FilterKeyboardEvent(info1)) + return; + DeliverInputWorker(target, info, EventRouteStages.All); + } + + public void ForwardInput(ICookedInputSite target, InputInfo info) => DeliverInputWorker(target, info, EventRouteStages.Direct); + + private void DeliverInputWorker( + ICookedInputSite target, + InputInfo info, + EventRouteStages stages) + { + if (_inputDisabled) + return; + InputManager.ZoneDeliveryInfo inputZoneRouting = ComputeInputZoneRouting(target, info); + if (CheckFocus(target, ref inputZoneRouting, info) && inputZoneRouting.zone != null) + { + byte traceLevelForEvent = Trace.GetTraceLevelForEvent(info); + EventRouteStages stage = EventRouteStages.None; + if (PreviewInput != null && (stages & EventRouteStages.Preview) != EventRouteStages.None) + { + PreviewInput(this, new InputNotificationEventArgs(info, target, stage)); + if (info.Handled) + stage = EventRouteStages.Preview; + } + if (!info.Handled && (stages & EventRouteStages.Routed) != EventRouteStages.None) + { + int num = (int)DeliverInputStageWorker(info, EventRouteStages.Routed, ref inputZoneRouting, traceLevelForEvent); + if (info.Handled) + stage = EventRouteStages.Routed; + } + if (!info.Handled && (stages & EventRouteStages.Direct) != EventRouteStages.None) + { + int num = (int)DeliverInputStageWorker(info, EventRouteStages.Direct, ref inputZoneRouting, traceLevelForEvent); + if (info.Handled) + stage = EventRouteStages.Direct; + } + if (!info.Handled && (stages & EventRouteStages.Bubbled) != EventRouteStages.None) + { + int num = (int)DeliverInputStageWorker(info, EventRouteStages.Bubbled, ref inputZoneRouting, traceLevelForEvent); + if (info.Handled) + stage = EventRouteStages.Bubbled; + } + if (!info.Handled && (stages & EventRouteStages.Unhandled) != EventRouteStages.None) + { + int num = (int)DeliverInputStageWorker(info, EventRouteStages.Unhandled, ref inputZoneRouting, traceLevelForEvent); + if (info.Handled) + stage = EventRouteStages.Unhandled; + } + InputNotificationHandler notificationHandler = !info.Handled ? UnhandledInput : HandledInput; + if (notificationHandler != null) + notificationHandler(this, new InputNotificationEventArgs(info, target, stage)); + } + if (inputZoneRouting.zone == null) + return; + inputZoneRouting.zone.RecycleInputDeliveryData(inputZoneRouting.param); + } + + private InputDeliveryStatus DeliverInputStageWorker( + InputInfo input, + EventRouteStages stage, + ref InputManager.ZoneDeliveryInfo deliveryInfo, + byte traceLevel) + { + InputDeliveryStatus inputDeliveryStatus = InputDeliveryStatus.Normal; + if (deliveryInfo.param != null) + { + bool handled = input.Handled; + inputDeliveryStatus = deliveryInfo.zone.DeliverInput(deliveryInfo.param, stage); + int num1 = input.Handled ? 1 : 0; + int num2 = handled ? 1 : 0; + } + deliveryInfo.stagesDelivered |= stage; + return inputDeliveryStatus; + } + + private InputManager.ZoneDeliveryInfo ComputeInputZoneRouting( + ICookedInputSite finalTarget, + InputInfo info) + { + ITreeNode endpoint = null; + UIZone uiZone = null; + if (finalTarget is ITreeNode) + { + endpoint = (ITreeNode)finalTarget; + uiZone = endpoint.Zone; + } + if (uiZone == null) + return new InputManager.ZoneDeliveryInfo(); + return new InputManager.ZoneDeliveryInfo() + { + zone = uiZone, + param = uiZone.PrepareInputForDelivery(endpoint, finalTarget, info) + }; + } + + private bool CheckFocus( + ICookedInputSite target, + ref InputManager.ZoneDeliveryInfo deliveryInfo, + InputInfo info) + { + bool flag = true; + switch (info) + { + case MouseFocusInfo mouseFocusInfo: + if (mouseFocusInfo.State || mouseFocusInfo.Other == null) + { + InputManager.ZoneDeliveryInfo newFocusInfo = new InputManager.ZoneDeliveryInfo(); + if (mouseFocusInfo.State) + newFocusInfo = deliveryInfo; + ProcessFocusUpdates(InputDeviceType.Mouse, ref _mouseFocusZone, newFocusInfo, target as ITreeNode); + _session.RootZone.UpdateCursor(null); + } + if (mouseFocusInfo.State && target == mouseFocusInfo.Other) + flag = false; + return flag; + case KeyFocusInfo keyFocusInfo: + if (keyFocusInfo.State || keyFocusInfo.Other == null) + { + InputManager.ZoneDeliveryInfo newFocusInfo = new InputManager.ZoneDeliveryInfo(); + if (keyFocusInfo.State) + newFocusInfo = deliveryInfo; + ProcessFocusUpdates(InputDeviceType.Keyboard, ref _keyFocusZone, newFocusInfo, target as ITreeNode); + } + if (keyFocusInfo.State && target == keyFocusInfo.Other) + flag = false; + return flag; + default: + return flag; + } + } + + private static void ProcessFocusUpdates( + InputDeviceType focusType, + ref UIZone refCurrentFocusZone, + InputManager.ZoneDeliveryInfo newFocusInfo, + ITreeNode actualFocus) + { + UIZone zone = refCurrentFocusZone; + if (zone == null && newFocusInfo.zone == null) + return; + refCurrentFocusZone = newFocusInfo.zone; + if (refCurrentFocusZone == null) + UpdateZoneFocusStates(focusType, zone, null, false, null); + if (newFocusInfo.zone == null) + return; + UpdateZoneFocusStates(focusType, newFocusInfo.zone, newFocusInfo.param, true, actualFocus); + } + + private static void UpdateZoneFocusStates( + InputDeviceType focusType, + UIZone zone, + object param, + bool deepFocusFlag, + ITreeNode actualFocus) + { + ITreeNode directFocusChild = null; + object obj = null; + if (deepFocusFlag) + { + if (actualFocus != null && actualFocus.Zone == zone) + directFocusChild = actualFocus; + obj = param; + } + zone.UpdateInputFocusStates(focusType, deepFocusFlag, directFocusChild, obj); + } + + internal InputModifiers HACK_SystemModifiers => _HACK_sysModifiers; + + internal void HACK_UpdateSystemModifiers(InputModifiers modifiers) => _HACK_sysModifiers = modifiers; + + private struct ZoneDeliveryInfo + { + public UIZone zone; + public object param; + public EventRouteStages stagesDelivered; + } + } +} diff --git a/UIX/Microsoft/Iris/Input/InputQueue.cs b/UIX/Microsoft/Iris/Input/InputQueue.cs new file mode 100644 index 0000000..6faba4e --- /dev/null +++ b/UIX/Microsoft/Iris/Input/InputQueue.cs @@ -0,0 +1,768 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.InputQueue +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Queues; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Input +{ + internal class InputQueue : SimpleQueue + { + private QueueItem.Stack _filterStack; + private InputManager _inputManager; + private ICookedInputSite _currentKeyFocus; + private ICookedInputSite _desiredKeyFocus; + private KeyFocusReason _desiredKeyFocusReason; + private ICookedInputSite _lastCompletedKeyFocus; + private bool _revalidateKeyFocus; + private uint _keyFocusRepairCount; + private SimpleCallback _invalidKeyFocusCallback; + private bool _mouseMoved; + private IRawInputSite _rawMouseSite; + private IRawInputSite _rawMouseNaturalSite; + private Point _rawMousePos; + private Point _rawScreenPos; + private InputModifiers _rawMouseModifiers; + private int _mouseWheelDelta; + private bool _dragOver; + private bool _dragging; + private ICookedInputSite _dragSource; + private IRawInputSite _rawDropTargetSite; + private Point _rawDragPoint; + private InputModifiers _rawDragModifiers; + private object _dragData; + private object _pendingDragData; + private ICookedInputSite _appDropTarget; + private IRawInputSite _appMouseFocusSite; + private IRawInputSite _appNaturalTarget; + private ICookedInputSite _appMouseFocusTarget; + private ICookedInputSite _appMouseFocusCapture; + private InputModifiers _appMouseFocusButtons; + private ICookedInputSite _lastCompletedMouseFocus; + private Point _appMousePos; + private bool _revalidateMouseFocus; + private SimpleQueue _inputIdleQueue; + + public InputQueue(InputManager manager) + { + _inputManager = manager; + _filterStack = new QueueItem.Stack(); + _rawMousePos = new Point(); + _appMousePos = new Point(); + _desiredKeyFocusReason = KeyFocusReason.Default; + _inputIdleQueue = new SimpleQueue(); + _inputIdleQueue.Wake += new EventHandler(OnChildQueueWake); + _invalidKeyFocusCallback = new SimpleCallback(InvalidKeyFocusCallback); + } + + public ICookedInputSite InstantaneousKeyFocus => _currentKeyFocus; + + public ICookedInputSite PendingKeyFocus => _desiredKeyFocus; + + public bool PendingKeyFocusIsDefault => _desiredKeyFocusReason == KeyFocusReason.Default; + + public ICookedInputSite LastCompletedKeyFocus => _lastCompletedKeyFocus; + + public ICookedInputSite CurrentMouseFocus => _appMouseFocusTarget; + + public InputModifiers DragModifiers => _rawDragModifiers; + + public void RequestKeyFocus(ICookedInputSite desired) => RequestKeyFocus(desired, KeyFocusReason.Other); + + public void RequestKeyFocus(ICookedInputSite desired, KeyFocusReason reason) + { + if (_desiredKeyFocus != desired) + { + _desiredKeyFocus = desired; + _desiredKeyFocusReason = reason; + } + else if (reason != KeyFocusReason.Default) + _desiredKeyFocusReason = reason; + if (desired != null) + _inputManager.RequestHostKeyFocus(desired); + if (_desiredKeyFocus == _currentKeyFocus) + return; + OnWake(); + } + + public void PrepareToShutDown() + { + RequestKeyFocus(null); + RawMouseLeave(); + } + + public void RawKeyAction(KeyInfo info) => PostItem(GenerateGenericInput(info)); + + public void RawMouseMove( + IRawInputSite site, + IRawInputSite naturalSite, + InputModifiers modifiers, + ref RawMouseData rawEventData) + { + _rawMouseSite = site; + _rawMouseNaturalSite = naturalSite; + _rawMousePos.X = rawEventData._positionX; + _rawMousePos.Y = rawEventData._positionY; + _rawScreenPos.X = rawEventData._screenX; + _rawScreenPos.Y = rawEventData._screenY; + _rawMouseModifiers = modifiers; + SetMouseMoved(); + } + + public void RawMouseLeave() + { + CancelMouseCapture(null); + _mouseWheelDelta = 0; + _rawMouseSite = null; + _rawMouseNaturalSite = null; + _rawMousePos.X = -1; + _rawMousePos.Y = -1; + _rawScreenPos.X = -1; + _rawScreenPos.Y = -1; + _rawMouseModifiers = InputModifiers.None; + SetMouseMoved(); + } + + public void RawMouseButtonState( + uint message, + IRawInputSite site, + IRawInputSite naturalSite, + InputModifiers modifiers, + MouseButtons button, + bool state) + { + PostItem(GenerateMouseButton(site, naturalSite, _rawMousePos.X, _rawMousePos.Y, _rawScreenPos.X, _rawScreenPos.Y, modifiers, button, state, message)); + } + + public void RawMouseWheel(InputModifiers modifiers, ref RawMouseData rawEventData) + { + bool flag = _mouseWheelDelta != 0; + _mouseWheelDelta += rawEventData._wheelDelta; + _rawMouseModifiers = modifiers; + if (flag || _mouseWheelDelta == 0) + return; + OnWake(); + } + + public void SimulateDragEnter( + ICookedInputSite dragSource, + IRawInputSite rawTargetSite, + object data, + int x, + int y, + InputModifiers modifiers) + { + SimulateDragDrop(dragSource, rawTargetSite, data, x, y, modifiers, DragOperation.Enter); + } + + public void SimulateDragOver(InputModifiers modifiers) => SimulateDragDrop(_dragSource, _rawDropTargetSite, null, _rawDragPoint.X, _rawDragPoint.Y, modifiers, DragOperation.Over); + + public void SimulateDragOver( + IRawInputSite rawTargetSite, + int x, + int y, + InputModifiers modifiers) + { + SimulateDragDrop(_dragSource, rawTargetSite, null, x, y, modifiers, DragOperation.Over); + } + + public void SimulateDragEnd( + IRawInputSite rawTargetSite, + InputModifiers modifiers, + DragOperation formOperation) + { + PushFilterStack(GenerateDragDrop(_dragSource, null, _rawDragPoint.X, _rawDragPoint.Y, modifiers, DragOperation.DragComplete)); + SimulateDragDrop(_dragSource, rawTargetSite, null, _rawDragPoint.X, _rawDragPoint.Y, modifiers, formOperation); + OnWake(); + _dragSource = null; + } + + private void SimulateDragDrop( + ICookedInputSite dragSource, + IRawInputSite rawTargetSite, + object data, + int x, + int y, + InputModifiers modifiers, + DragOperation formOperation) + { + _dragSource = dragSource; + InputItem dragDropItem = GenerateDragDropItem(dragSource, rawTargetSite, data, x, y, modifiers, formOperation); + if (dragDropItem == null) + return; + PushFilterStack(dragDropItem); + OnWake(); + } + + public void RawDragDrop( + IRawInputSite rawSite, + object data, + int x, + int y, + InputModifiers modifiers, + DragOperation formOperation, + RawDragData rawEventData) + { + if (_dragSource == null) + { + if (formOperation == DragOperation.Over && data == null && _pendingDragData != null) + { + data = _pendingDragData; + formOperation = DragOperation.Enter; + } + _pendingDragData = null; + InputItem dragDropItem = GenerateDragDropItem(null, rawSite, data, x, y, modifiers, formOperation); + if (dragDropItem == null) + return; + PostItem(dragDropItem); + } + else if (formOperation == DragOperation.Enter) + { + _pendingDragData = data; + } + else + { + if (formOperation != DragOperation.Leave) + return; + _pendingDragData = null; + } + } + + private InputItem GenerateDragDropItem( + ICookedInputSite dragSource, + IRawInputSite rawSite, + object data, + int x, + int y, + InputModifiers modifiers, + DragOperation formOperation) + { + InputItem inputItem = null; + IRawInputSite rawDropTargetSite = _rawDropTargetSite; + if (formOperation == DragOperation.Enter) + _dragData = data; + _rawDropTargetSite = rawSite; + _rawDragPoint = new Point(x, y); + _rawDragModifiers = modifiers; + if (formOperation != DragOperation.Drop) + { + _dragging = true; + if (rawDropTargetSite == rawSite) + { + if (!_dragOver) + { + _dragOver = true; + OnWake(); + } + } + else + inputItem = GenerateDragDrop(null, rawSite, x, y, modifiers, DragOperation.Over); + } + else + { + inputItem = GenerateDragDrop(_appDropTarget, rawSite, x, y, modifiers, DragOperation.Drop); + _appDropTarget = null; + } + if (formOperation == DragOperation.Drop || formOperation == DragOperation.Leave) + { + _dragOver = false; + _dragging = false; + _rawDropTargetSite = null; + _rawDragPoint = new Point(); + _rawDragModifiers = InputModifiers.None; + if (formOperation == DragOperation.Leave) + _dragData = null; + } + return inputItem; + } + + public object GetDragDropValue() + { + object dragData = _dragData; + if (!_dragging) + _dragData = null; + return dragData; + } + + public void RawInputIdleItem(QueueItem item) => _inputIdleQueue.PostItem(item); + + public void RevalidateInputSiteUsage(ICookedInputSite target, bool recursiveFlag) + { + bool flag1 = false; + if (target == null) + { + if (!recursiveFlag) + { + _revalidateKeyFocus = true; + _revalidateMouseFocus = true; + SetMouseMoved(); + return; + } + flag1 = true; + } + CancelMouseCapture(target); + bool flag2 = false; + if (!_mouseMoved && _appMouseFocusTarget != null && (flag1 || _appMouseFocusTarget == target || recursiveFlag && _inputManager.IsSiteInfluencedByPeer(_appMouseFocusTarget, target))) + { + _revalidateMouseFocus = true; + SetMouseMoved(); + if (_appMouseFocusTarget == _desiredKeyFocus) + flag2 = true; + } + if (_revalidateKeyFocus || !flag2 && (_desiredKeyFocus == null || !flag1 && _desiredKeyFocus != target && (!recursiveFlag || !_inputManager.IsSiteInfluencedByPeer(_desiredKeyFocus, target)))) + return; + _revalidateKeyFocus = true; + OnWake(); + } + + public override QueueItem GetNextItem() + { + InputItem inputItem; + QueueItem queueItem1 = null; + while (true) + { + QueueItem queueItem2; + do + { + queueItem2 = PeekFilterStack(); + if (queueItem2 != null) + { + queueItem1 = FilterItem(queueItem2); + if (queueItem1 == null) + PopFilterStack(); + else + goto label_5; + } + else + goto label_8; + } + while (!(queueItem2 is InputItem)); + inputItem = (InputItem)queueItem2; + inputItem.ReturnToPool(); + continue; + label_5: + if (queueItem1 != queueItem2) + { + PushFilterStack(queueItem1); + queueItem1 = null; + } + else + break; + } + PopFilterStack(); + label_8: + return queueItem1; + } + + private void PushFilterStack(QueueItem item) => _filterStack.Push(item); + + private QueueItem PopFilterStack() => _filterStack.Pop(); + + private QueueItem PeekFilterStack() + { + QueueItem queueItem = _filterStack.Peek(); + if (queueItem == null) + { + queueItem = GetNextRawInputItem(); + if (queueItem != null) + PushFilterStack(queueItem); + } + return queueItem; + } + + private QueueItem FilterItem(QueueItem item) + { + if (item is InputItem inputItem) + { + switch (inputItem.Info) + { + case MouseActionInfo mouseActionInfo: + MapMouseInput(mouseActionInfo); + Point clientOffset = new Point(mouseActionInfo.X, mouseActionInfo.Y); + switch (mouseActionInfo) + { + case MouseMoveInfo _: + QueueItem queueItem1 = UpdateMouseFocus(mouseActionInfo.Target, mouseActionInfo.RawSource, clientOffset); + if (queueItem1 != null) + return queueItem1; + if (IsAppMouseMove(mouseActionInfo)) + { + FinalizeMouseHit(inputItem, mouseActionInfo); + break; + } + item = null; + break; + case MouseButtonInfo mouseButtonInfo: + if (IsAppMouseMove(mouseActionInfo)) + { + InputModifiers modifiers1 = mouseButtonInfo.Modifiers; + InputModifiers modifiersForButtons = GetModifiersForButtons(mouseButtonInfo.Button); + InputModifiers modifiers2 = !mouseButtonInfo.IsDown ? modifiers1 | modifiersForButtons : modifiers1 & ~modifiersForButtons; + return GenerateMouseMove(mouseActionInfo.RawSource, mouseActionInfo.NaturalHit, mouseActionInfo.X, mouseActionInfo.Y, mouseButtonInfo.ScreenX, mouseButtonInfo.ScreenY, modifiers2); + } + FinalizeMouseHit(inputItem, mouseActionInfo); + UpdateMouseCapture(mouseActionInfo.RawSource, mouseActionInfo.Target, mouseButtonInfo.Modifiers); + _appMouseFocusButtons = mouseButtonInfo.Modifiers & InputModifiers.AllButtons; + break; + case MouseWheelInfo _: + inputItem.UpdateInputSite(_appMouseFocusTarget); + break; + } + break; + case MouseFocusInfo mouseFocusInfo: + if (!mouseFocusInfo.State && _appMouseFocusButtons != InputModifiers.None) + { + QueueItem queueItem2 = UpdateOrphanedButtons(mouseFocusInfo.RawSource, mouseFocusInfo.X, mouseFocusInfo.Y); + if (queueItem2 != null) + return queueItem2; + break; + } + break; + case KeyActionInfo _: + QueueItem queueItem3 = UpdateKeyFocus(); + if (queueItem3 != null) + return queueItem3; + inputItem.UpdateInputSite(_currentKeyFocus); + break; + case DragDropInfo dragDropInfo: + if (dragDropInfo.Operation == DragOperation.Over) + { + InputItem inputItemB = UpdateDragOver(_inputManager.HitTestInput(_rawDropTargetSite, null)); + if (inputItemB != null) + return inputItemB; + inputItemB.UpdateInputSite(_appDropTarget); + break; + } + break; + } + } + return item; + } + + private InputModifiers GetModifiersForButtons(MouseButtons button) + { + InputModifiers inputModifiers = InputModifiers.None; + if ((button & MouseButtons.Left) != MouseButtons.None) + inputModifiers |= InputModifiers.LeftMouse; + if ((button & MouseButtons.Middle) != MouseButtons.None) + inputModifiers |= InputModifiers.MiddleMouse; + if ((button & MouseButtons.Right) != MouseButtons.None) + inputModifiers |= InputModifiers.RightMouse; + if ((button & MouseButtons.XButton1) != MouseButtons.None) + inputModifiers |= InputModifiers.XMouse1; + if ((button & MouseButtons.XButton2) != MouseButtons.None) + inputModifiers |= InputModifiers.XMouse2; + return inputModifiers; + } + + private QueueItem GetNextRawInputItem() + { + QueueItem queueItem; + if ((queueItem = InjectRawInput_Prty()) == null && (queueItem = InjectRawInput_Norm()) == null) + queueItem = InjectRawInput_Idle(); + return queueItem; + } + + private QueueItem InjectRawInput_Prty() => UpdateKeyFocus(); + + private QueueItem InjectRawInput_Norm() => base.GetNextItem(); + + private QueueItem InjectRawInput_Idle() + { + if (_mouseWheelDelta != 0) + { + QueueItem mouseWheel = GenerateMouseWheel(_rawMouseSite, _rawMouseNaturalSite, _rawMousePos.X, _rawMousePos.Y, _rawScreenPos.X, _rawScreenPos.Y, _rawMouseModifiers, _mouseWheelDelta); + _mouseWheelDelta = 0; + return mouseWheel; + } + if (_mouseMoved) + { + QueueItem mouseMove = GenerateMouseMove(_rawMouseSite, _rawMouseNaturalSite, _rawMousePos.X, _rawMousePos.Y, _rawScreenPos.X, _rawScreenPos.Y, _rawMouseModifiers); + _mouseMoved = false; + return mouseMove; + } + if (!_dragOver) + return _inputIdleQueue.GetNextItem(); + InputItem dragDrop = GenerateDragDrop(null, _rawDropTargetSite, _rawDragPoint.X, _rawDragPoint.Y, _rawDragModifiers, DragOperation.Over); + _dragOver = false; + return dragDrop; + } + + private void OnChildQueueWake(object sender, EventArgs args) => OnWake(); + + private void MapMouseInput(MouseActionInfo info) => _inputManager.MapMouseInput(info, _appMouseFocusCapture); + + private void FinalizeMouseHit(InputItem item, MouseActionInfo mouse) + { + item.UpdateInputSite(mouse.Target); + _appMousePos = new Point(mouse.X, mouse.Y); + _appNaturalTarget = mouse.NaturalHit; + } + + private QueueItem CheckForInvalidKeyFocus() + { + QueueItem queueItem = null; + if (!IsValidInputSite(_desiredKeyFocus) || !_inputManager.IsValidKeyFocusSite(_desiredKeyFocus)) + { + ++_keyFocusRepairCount; + _revalidateKeyFocus = true; + queueItem = GenerateInvalidKeyFocusCallback(); + } + else + { + int focusRepairCount = (int)_keyFocusRepairCount; + _keyFocusRepairCount = 0U; + _revalidateKeyFocus = false; + } + return queueItem; + } + + private void InvalidKeyFocusCallback() => _inputManager.RepairInvalidKeyFocus(_keyFocusRepairCount); + + private QueueItem UpdateKeyFocus() + { + QueueItem queueItem = null; + if (_revalidateKeyFocus || _currentKeyFocus != _desiredKeyFocus) + { + queueItem = CheckForInvalidKeyFocus(); + if (queueItem == null && _currentKeyFocus != _desiredKeyFocus) + { + if (_currentKeyFocus != null) + { + if (!IsValidInputSite(_currentKeyFocus)) + _currentKeyFocus = null; + queueItem = GenerateKeyFocus(_currentKeyFocus, false, _desiredKeyFocus, _desiredKeyFocusReason); + _currentKeyFocus = null; + } + if (queueItem == null && _desiredKeyFocus != null) + { + _currentKeyFocus = _desiredKeyFocus; + if (!IsValidInputSite(_lastCompletedKeyFocus)) + _lastCompletedKeyFocus = null; + queueItem = GenerateKeyFocus(_currentKeyFocus, true, _lastCompletedKeyFocus, _desiredKeyFocusReason); + } + if (_currentKeyFocus == _desiredKeyFocus) + _lastCompletedKeyFocus = _currentKeyFocus; + } + if (queueItem == null && _currentKeyFocus != null) + queueItem = GenerateKeyFocus(_currentKeyFocus, true, _lastCompletedKeyFocus, KeyFocusReason.Validation); + } + return queueItem; + } + + private QueueItem UpdateMouseFocus( + ICookedInputSite target, + IRawInputSite site, + Point clientOffset) + { + QueueItem queueItem = null; + if (_revalidateMouseFocus || _appMouseFocusTarget != target) + { + _revalidateMouseFocus = false; + if (_appMouseFocusTarget != target) + { + if (_appMouseFocusTarget != null) + { + if (!IsValidInputSite(_appMouseFocusTarget)) + _appMouseFocusTarget = null; + queueItem = GenerateMouseFocus(_appMouseFocusTarget, _appMouseFocusSite, _appMousePos.X, _appMousePos.Y, false, target); + _appMouseFocusSite = null; + _appMouseFocusTarget = null; + _appMousePos.X = -1; + _appMousePos.Y = -1; + } + if (queueItem == null && target != null) + { + _appMouseFocusSite = site; + _appMouseFocusTarget = target; + if (!IsValidInputSite(_lastCompletedMouseFocus)) + _lastCompletedMouseFocus = null; + queueItem = GenerateMouseFocus(_appMouseFocusTarget, _appMouseFocusSite, clientOffset.X, clientOffset.Y, true, _lastCompletedMouseFocus); + } + if (_appMouseFocusTarget == target) + _lastCompletedMouseFocus = _appMouseFocusTarget; + } + if (queueItem == null && _appMouseFocusTarget != null) + queueItem = GenerateMouseFocus(_appMouseFocusTarget, _appMouseFocusSite, clientOffset.X, clientOffset.Y, true, _lastCompletedMouseFocus); + } + return queueItem; + } + + private void UpdateMouseCapture( + IRawInputSite site, + ICookedInputSite target, + InputModifiers modifiers) + { + bool flag = (modifiers & InputModifiers.AllButtons) != InputModifiers.None; + ICookedInputSite cookedInputSite = null; + if (flag) + cookedInputSite = target; + if (_appMouseFocusCapture == cookedInputSite) + return; + _inputManager.RequestHostMouseCapture(site, cookedInputSite != null); + _appMouseFocusCapture = cookedInputSite; + SetMouseMoved(); + } + + private QueueItem UpdateOrphanedButtons(IRawInputSite site, int x, int y) + { + MouseButtons button; + uint message; + if ((_appMouseFocusButtons & InputModifiers.LeftMouse) != InputModifiers.None) + { + _appMouseFocusButtons &= ~InputModifiers.LeftMouse; + button = MouseButtons.Left; + message = 514U; + } + else if ((_appMouseFocusButtons & InputModifiers.MiddleMouse) != InputModifiers.None) + { + _appMouseFocusButtons &= ~InputModifiers.MiddleMouse; + button = MouseButtons.Middle; + message = 520U; + } + else if ((_appMouseFocusButtons & InputModifiers.RightMouse) != InputModifiers.None) + { + _appMouseFocusButtons &= ~InputModifiers.RightMouse; + button = MouseButtons.Right; + message = 517U; + } + else if ((_appMouseFocusButtons & InputModifiers.XMouse1) != InputModifiers.None) + { + _appMouseFocusButtons &= ~InputModifiers.XMouse1; + button = MouseButtons.XButton1; + message = 524U; + } + else if ((_appMouseFocusButtons & InputModifiers.XMouse2) != InputModifiers.None) + { + _appMouseFocusButtons &= ~InputModifiers.XMouse2; + button = MouseButtons.XButton2; + message = 524U; + } + else + { + _appMouseFocusButtons = InputModifiers.None; + return null; + } + return GenerateMouseButton(site, null, x, y, _rawScreenPos.X, _rawScreenPos.Y, _appMouseFocusButtons, button, false, message); + } + + private InputItem UpdateDragOver(ICookedInputSite target) + { + if (target != _appDropTarget) + { + if (_appDropTarget != null) + { + ICookedInputSite appDropTarget = _appDropTarget; + _appDropTarget = null; + return GenerateDragDrop(appDropTarget, null, _rawDragPoint.X, _rawDragPoint.Y, _rawMouseModifiers, DragOperation.Leave); + } + if (target != null) + { + _appDropTarget = target; + return GenerateDragDrop(target, _rawDropTargetSite, _rawDragPoint.X, _rawDragPoint.Y, _rawDragModifiers, DragOperation.Enter); + } + } + return null; + } + + private bool IsAppMouseMove(MouseActionInfo mouseInfo) => mouseInfo.Target != _appMouseFocusTarget || mouseInfo.NaturalHit != _appNaturalTarget || mouseInfo.X != _appMousePos.X || mouseInfo.Y != _appMousePos.Y; + + private bool IsValidInputSite(ICookedInputSite target) => target == null || _inputManager.IsValidCookedInputSite(target); + + private void SetMouseMoved() + { + if (_mouseMoved) + return; + _mouseMoved = true; + OnWake(); + } + + private void CancelMouseCapture(ICookedInputSite cancelSite) + { + if (_appMouseFocusCapture == null || cancelSite != _appMouseFocusCapture && cancelSite != null) + return; + UpdateMouseCapture(_appMouseFocusCapture.RawInputSource, null, InputModifiers.None); + } + + private QueueItem GenerateGenericInput(InputInfo info) => InputItem.Create(_inputManager, null, info); + + private QueueItem GenerateInvalidKeyFocusCallback() => DeferredCall.Create(_invalidKeyFocusCallback); + + private QueueItem GenerateKeyFocus( + ICookedInputSite target, + bool focus, + ICookedInputSite other, + KeyFocusReason reason) + { + return InputItem.Create(_inputManager, target, KeyFocusInfo.Create(focus, other, reason)); + } + + private InputItem GenerateMouseFocus( + ICookedInputSite target, + IRawInputSite site, + int x, + int y, + bool focus, + ICookedInputSite other) + { + return InputItem.Create(_inputManager, target, MouseFocusInfo.Create(site, x, y, focus, other)); + } + + private InputItem GenerateMouseMove( + IRawInputSite site, + IRawInputSite naturalSite, + int x, + int y, + int screenX, + int screenY, + InputModifiers modifiers) + { + return InputItem.Create(_inputManager, null, MouseMoveInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers)); + } + + private InputItem GenerateMouseButton( + IRawInputSite site, + IRawInputSite naturalSite, + int x, + int y, + int screenX, + int screenY, + InputModifiers modifiers, + MouseButtons button, + bool state, + uint message) + { + return InputItem.Create(_inputManager, null, MouseButtonInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers, button, state, message)); + } + + private InputItem GenerateMouseWheel( + IRawInputSite site, + IRawInputSite naturalSite, + int x, + int y, + int screenX, + int screenY, + InputModifiers modifiers, + int wheelDelta) + { + return InputItem.Create(_inputManager, null, MouseWheelInfo.Create(site, naturalSite, x, y, screenX, screenY, modifiers, wheelDelta)); + } + + private InputItem GenerateDragDrop( + ICookedInputSite cookedSite, + IRawInputSite rawSite, + int x, + int y, + InputModifiers modifiers, + DragOperation operation) + { + InputInfo info = DragDropInfo.Create(rawSite, x, y, modifiers, operation); + return InputItem.Create(_inputManager, cookedSite, info); + } + } +} diff --git a/UIX/Microsoft/Iris/Input/KeyActionInfo.cs b/UIX/Microsoft/Iris/Input/KeyActionInfo.cs new file mode 100644 index 0000000..5e836b1 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/KeyActionInfo.cs @@ -0,0 +1,71 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyActionInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Input +{ + [Serializable] + internal abstract class KeyActionInfo : KeyInfo + { + private KeyAction _action; + private InputDeviceType _deviceType; + private InputModifiers _modifiers; + private uint _repeatCount; + private bool _systemKey; + private uint _nativeMessageID; + private int _scanCode; + private ushort _eventFlags; + + protected void Initialize( + KeyAction action, + InputEventType eventType, + InputDeviceType deviceType, + InputModifiers modifiers, + uint repeatCount, + bool systemKey, + uint nativeMessageID, + int scanCode, + ushort eventFlags) + { + _systemKey = systemKey; + _action = action; + _deviceType = deviceType; + _modifiers = modifiers; + _repeatCount = repeatCount; + _nativeMessageID = nativeMessageID; + _scanCode = scanCode; + _eventFlags = eventFlags; + Initialize(eventType); + } + + protected void Initialize( + KeyAction action, + InputEventType eventType, + InputDeviceType deviceType) + { + Initialize(action, eventType, deviceType, InputModifiers.None, 1U, false, 0U, 0, 0); + } + + public KeyAction Action => _action; + + public InputDeviceType DeviceType => _deviceType; + + public InputModifiers Modifiers => _modifiers; + + public uint RepeatCount => _repeatCount; + + public bool SystemKey => _systemKey; + + public uint NativeMessageID => _nativeMessageID; + + public int ScanCode => _scanCode; + + public ushort KeyboardFlags => _eventFlags; + + public bool IsRepeatOf(KeyActionInfo other) => other != null && _action == other._action && (_deviceType == other._deviceType && _systemKey == other._systemKey) && _modifiers == other._modifiers; + } +} diff --git a/UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs b/UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs new file mode 100644 index 0000000..1c4c1fc --- /dev/null +++ b/UIX/Microsoft/Iris/Input/KeyCharacterInfo.cs @@ -0,0 +1,59 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyCharacterInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Input +{ + internal class KeyCharacterInfo : KeyActionInfo + { + private static InputInfo.InfoType s_poolType = InfoType.KeyCharacter; + private char _character; + + static KeyCharacterInfo() => SetPoolLimitMode(s_poolType, false); + + private KeyCharacterInfo() + { + } + + public static KeyCharacterInfo Create( + KeyAction action, + InputDeviceType deviceType, + InputModifiers modifiers, + uint repeatCount, + char character, + bool systemKey, + uint nativeMessageID, + int scanCode, + ushort eventFlags) + { + KeyCharacterInfo keyCharacterInfo = (KeyCharacterInfo)GetFromPool(s_poolType) ?? new KeyCharacterInfo(); + keyCharacterInfo.Initialize(action, deviceType, modifiers, repeatCount, character, systemKey, nativeMessageID, scanCode, eventFlags); + return keyCharacterInfo; + } + + private void Initialize( + KeyAction action, + InputDeviceType deviceType, + InputModifiers modifiers, + uint repeatCount, + char character, + bool systemKey, + uint nativeMessageID, + int scanCode, + ushort eventFlags) + { + _character = character; + Initialize(action, InputEventType.KeyCharacter, deviceType, modifiers, repeatCount, systemKey, nativeMessageID, scanCode, eventFlags); + } + + public char Character => _character; + + protected override InputInfo.InfoType PoolType => s_poolType; + + public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", GetType().Name, Action, _character); + } +} diff --git a/UIX/Microsoft/Iris/Input/KeyCommandInfo.cs b/UIX/Microsoft/Iris/Input/KeyCommandInfo.cs new file mode 100644 index 0000000..63eec4e --- /dev/null +++ b/UIX/Microsoft/Iris/Input/KeyCommandInfo.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyCommandInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Input +{ + internal class KeyCommandInfo : KeyActionInfo + { + private static InputInfo.InfoType s_poolType = InfoType.KeyCommand; + public CommandCode _command; + + static KeyCommandInfo() => SetPoolLimitMode(s_poolType, false); + + private KeyCommandInfo() + { + } + + public static KeyCommandInfo Create( + KeyAction action, + InputDeviceType deviceType, + CommandCode command) + { + KeyCommandInfo keyCommandInfo = (KeyCommandInfo)GetFromPool(s_poolType) ?? new KeyCommandInfo(); + keyCommandInfo.Initialize(action, deviceType, command); + return keyCommandInfo; + } + + private void Initialize(KeyAction action, InputDeviceType deviceType, CommandCode command) + { + _command = command; + Initialize(action, action == KeyAction.Down ? InputEventType.CommandDown : InputEventType.CommandUp, deviceType); + } + + public CommandCode Command => _command; + + protected override InputInfo.InfoType PoolType => s_poolType; + + public override string ToString() => InvariantString.Format("{0}({1}, Command={2})", GetType().Name, Action, _command); + } +} diff --git a/UIX/Microsoft/Iris/Input/KeyFocusInfo.cs b/UIX/Microsoft/Iris/Input/KeyFocusInfo.cs new file mode 100644 index 0000000..1ad242f --- /dev/null +++ b/UIX/Microsoft/Iris/Input/KeyFocusInfo.cs @@ -0,0 +1,54 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyFocusInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal class KeyFocusInfo : KeyInfo + { + private static InputInfo.InfoType s_poolType = InfoType.KeyFocus; + private bool _state; + private ICookedInputSite _other; + private KeyFocusReason _focusReason; + + static KeyFocusInfo() => SetPoolLimitMode(s_poolType, true); + + private KeyFocusInfo() + { + } + + public static KeyFocusInfo Create( + bool state, + ICookedInputSite other, + KeyFocusReason focusReason) + { + KeyFocusInfo keyFocusInfo = (KeyFocusInfo)GetFromPool(s_poolType) ?? new KeyFocusInfo(); + keyFocusInfo.Initialize(state, other, focusReason); + return keyFocusInfo; + } + + private void Initialize(bool state, ICookedInputSite other, KeyFocusReason focusReason) + { + _state = state; + _other = other; + _focusReason = focusReason; + Initialize(state ? InputEventType.GainKeyFocus : InputEventType.LoseKeyFocus); + } + + protected override void Zombie() + { + base.Zombie(); + _other = null; + } + + public bool State => _state; + + public ICookedInputSite Other => _other; + + public KeyFocusReason FocusReason => _focusReason; + + protected override InputInfo.InfoType PoolType => s_poolType; + } +} diff --git a/UIX/Microsoft/Iris/Input/KeyFocusReason.cs b/UIX/Microsoft/Iris/Input/KeyFocusReason.cs new file mode 100644 index 0000000..1acdb39 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/KeyFocusReason.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyFocusReason +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal enum KeyFocusReason + { + Default, + Directional, + Tab, + MouseDown, + MouseEnter, + Restore, + Validation, + Other, + } +} diff --git a/UIX/Microsoft/Iris/Input/KeyInfo.cs b/UIX/Microsoft/Iris/Input/KeyInfo.cs new file mode 100644 index 0000000..42426b8 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/KeyInfo.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal abstract class KeyInfo : InputInfo + { + } +} diff --git a/UIX/Microsoft/Iris/Input/KeyStateInfo.cs b/UIX/Microsoft/Iris/Input/KeyStateInfo.cs new file mode 100644 index 0000000..1df0586 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/KeyStateInfo.cs @@ -0,0 +1,63 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyStateInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Input +{ + internal class KeyStateInfo : KeyActionInfo + { + private static InputInfo.InfoType s_poolType = InfoType.KeyState; + private Keys _key; + + static KeyStateInfo() => SetPoolLimitMode(s_poolType, false); + + private KeyStateInfo() + { + } + + public static KeyStateInfo Create( + KeyAction action, + InputDeviceType deviceType, + InputModifiers modifiers, + uint repeatCount, + Keys key, + bool systemKey, + uint nativeMessageID, + int scanCode, + ushort eventFlags) + { + KeyStateInfo keyStateInfo = (KeyStateInfo)GetFromPool(s_poolType) ?? new KeyStateInfo(); + keyStateInfo.Initialize(action, deviceType, modifiers, repeatCount, key, systemKey, nativeMessageID, scanCode, eventFlags); + return keyStateInfo; + } + + private void Initialize( + KeyAction action, + InputDeviceType deviceType, + InputModifiers modifiers, + uint repeatCount, + Keys key, + bool systemKey, + uint nativeMessageID, + int scanCode, + ushort eventFlags) + { + _key = key; + Initialize(action, action == KeyAction.Down ? InputEventType.KeyDown : InputEventType.KeyUp, deviceType, modifiers, repeatCount, systemKey, nativeMessageID, scanCode, eventFlags); + } + + public bool IsRepeatOf(KeyStateInfo other) => other != null && _key == other._key && IsRepeatOf((KeyActionInfo)other); + + public KeyStateInfo MakeRepeatableCopy() => Create(Action, DeviceType, Modifiers, RepeatCount, _key, SystemKey, NativeMessageID, ScanCode, KeyboardFlags); + + public Keys Key => _key; + + protected override InputInfo.InfoType PoolType => s_poolType; + + public override string ToString() => InvariantString.Format("{0}({1}, Key={2})", GetType().Name, Action, _key); + } +} diff --git a/UIX/Microsoft/Iris/Input/KeyboardDevice.cs b/UIX/Microsoft/Iris/Input/KeyboardDevice.cs new file mode 100644 index 0000000..0743d58 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/KeyboardDevice.cs @@ -0,0 +1,285 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.KeyboardDevice +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Input +{ + internal class KeyboardDevice : InputDevice + { + internal const int KeyDown = 0; + internal const int KeyUp = 1; + internal const int KeyChar = 2; + internal const int SysKeyDown = 3; + internal const int SysKeyUp = 4; + internal const int SysChar = 5; + private const int k_initialArrayLength = 4; + private ExpandableArray _keyStates; + private InputModifiers _keyModifiers; + private bool _modifiersDirty; + + public KeyboardDevice(InputManager manager) + : base(manager) + { + _keyStates = new ExpandableArray(4); + Reset(); + } + + public InputModifiers KeyboardModifiers + { + get + { + if (_modifiersDirty) + UpdateModifierState(); + return _keyModifiers & InputModifiers.AllKeys; + } + } + + public bool Alt => (KeyboardModifiers & InputModifiers.AltKey) != InputModifiers.None; + + public bool Ctrl => (KeyboardModifiers & InputModifiers.ControlKey) != InputModifiers.None; + + public bool Shift => (KeyboardModifiers & InputModifiers.ShiftKey) != InputModifiers.None; + + public bool Win => (KeyboardModifiers & InputModifiers.WindowsKey) != InputModifiers.None; + + internal KeyInfo OnRawInput( + uint message, + InputModifiers modifiers, + ref RawKeyboardData args) + { + Manager.HACK_UpdateSystemModifiers(modifiers); + return message == 2U || message == 5U ? OnRawKeyCharacter(message, ref args) : OnRawKeyState(message, modifiers, ref args); + } + + internal KeyInfo OnRawKeyCharacter(uint message, ref RawKeyboardData args) => KeyCharacterInfo.Create(KeyAction.Character, args._deviceType, 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 = null; + bool systemKey = false; + KeyAction action; + switch (message) + { + case 0: + action = KeyAction.Down; + break; + case 1: + action = KeyAction.Up; + break; + case 3: + systemKey = true; + goto case 0; + case 4: + systemKey = true; + goto case 1; + default: + return null; + } + if (TrackKey(action, args._virtualKey, args._scanCode)) + { + InputModifiers modifiers = Manager.Modifiers & ~MapKeyToModifier(args._virtualKey); + keyStateInfo = KeyStateInfo.Create(action, args._deviceType, modifiers, args._repCount, args._virtualKey, systemKey, message, args._scanCode, args._flags); + } + return keyStateInfo; + } + + public bool IsKeyDown(Keys key) + { + foreach (KeyboardDevice.KeyState keyState in _keyStates) + { + if (keyState.VKey == key && keyState.IsDown) + return true; + } + return false; + } + + public bool IsKeyHandled(Keys key) + { + foreach (KeyboardDevice.KeyState keyState in _keyStates) + { + if (keyState.VKey == key) + return keyState.IsHandled; + } + return false; + } + + internal void MarkKeyHandled(Keys key) + { + foreach (KeyboardDevice.KeyState keyState in _keyStates) + { + if (keyState.VKey == key && keyState.IsDown) + { + keyState.MarkHandled(); + break; + } + } + } + + public void Reset() + { + _keyStates.Clear(); + _modifiersDirty = true; + _keyModifiers = InputModifiers.None; + } + + private bool TrackKey(KeyAction action, Keys vkey, int scanCode) + { + bool flag = false; + if (vkey == Keys.None) + return false; + if (IsModifier(vkey)) + MarkModifiersInvalid(); + switch (action) + { + case KeyAction.Up: + flag = TrackKeyUp(vkey, scanCode); + break; + case KeyAction.Down: + flag = TrackKeyDown(vkey, scanCode); + break; + } + return flag; + } + + private bool TrackKeyDown(Keys vkey, int scanCode) + { + KeyboardDevice.KeyState keyState1 = null; + for (int index = 0; index < _keyStates.Length; ++index) + { + KeyboardDevice.KeyState keyState2 = (KeyboardDevice.KeyState)_keyStates[index]; + if (keyState2 != null) + { + if (keyState2.IsDown) + { + if (keyState2.VKey == vkey && keyState2.ScanCode == scanCode) + { + keyState1 = keyState2; + break; + } + } + else + { + _keyStates[index] = null; + keyState2.Dispose(); + } + } + } + if (keyState1 == null) + { + KeyboardDevice.KeyState keyState2 = new KeyboardDevice.KeyState(vkey, scanCode); + _keyStates.Add(keyState2); + keyState2.IsDown = true; + } + return true; + } + + private bool TrackKeyUp(Keys vkey, int scanCode) + { + KeyboardDevice.KeyState keyState1 = null; + bool flag = false; + foreach (KeyboardDevice.KeyState keyState2 in _keyStates) + { + if (keyState2.VKey == vkey && keyState2.ScanCode == scanCode) + { + keyState1 = keyState2; + break; + } + } + if (keyState1 != null) + { + flag = keyState1.IsDown; + keyState1.IsDown = false; + } + int num = flag ? 1 : 0; + return flag; + } + + private bool IsModifier(Keys vkey) => MapKeyToModifier(vkey) != InputModifiers.None; + + private void MarkModifiersInvalid() => _modifiersDirty = true; + + private InputModifiers MapKeyToModifier(Keys vkey) + { + switch (vkey) + { + case Keys.ShiftKey: + case Keys.LShiftKey: + case Keys.RShiftKey: + return InputModifiers.ShiftKey; + case Keys.ControlKey: + case Keys.LControlKey: + case Keys.RControlKey: + return InputModifiers.ControlKey; + case Keys.Menu: + case Keys.LMenu: + case Keys.RMenu: + return InputModifiers.AltKey; + case Keys.LWin: + case Keys.RWin: + return InputModifiers.WindowsKey; + default: + return InputModifiers.None; + } + } + + private void UpdateModifierState() + { + if (!_modifiersDirty) + return; + _keyModifiers = InputModifiers.None; + foreach (KeyboardDevice.KeyState keyState in _keyStates) + { + if (keyState.IsDown) + _keyModifiers |= MapKeyToModifier(keyState.VKey); + } + _modifiersDirty = false; + } + + private class KeyState + { + private Keys _vkey; + private int _scanCode; + private bool _down; + private bool _handled; + + public KeyState(Keys vkey, int scanCode) + { + _vkey = vkey; + _scanCode = scanCode; + _down = false; + _handled = false; + } + + public void Dispose() => Dispose(true); + + protected void Dispose(bool inDispose) + { + if (!inDispose) + return; + _vkey = Keys.None; + _scanCode = -1; + } + + public Keys VKey => _vkey; + + public int ScanCode => _scanCode; + + public bool IsDown + { + get => _down; + set => _down = value; + } + + public bool IsHandled => _handled; + + public void MarkHandled() => _handled = true; + } + } +} diff --git a/UIX/Microsoft/Iris/Input/MouseActionInfo.cs b/UIX/Microsoft/Iris/Input/MouseActionInfo.cs new file mode 100644 index 0000000..eccd369 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/MouseActionInfo.cs @@ -0,0 +1,72 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.MouseActionInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal abstract class MouseActionInfo : MouseInfo + { + private IRawInputSite _naturalHit; + private ICookedInputSite _naturalTarget; + private InputModifiers _modifiers; + private int _screenX; + private int _screenY; + private int _wheelDelta; + private uint _nativeMessageID; + private MouseButtons _button; + + protected void Initialize( + IRawInputSite rawSource, + IRawInputSite rawNatural, + int x, + int y, + int screenX, + int screenY, + InputModifiers modifiers, + InputEventType eventType, + uint messageID, + MouseButtons button, + int wheelDelta) + { + _naturalHit = rawNatural; + _modifiers = modifiers; + _screenX = screenX; + _screenY = screenY; + _wheelDelta = wheelDelta; + _nativeMessageID = messageID; + _button = button; + Initialize(rawSource, x, y, eventType); + } + + protected override void Zombie() + { + base.Zombie(); + _naturalHit = null; + _naturalTarget = null; + } + + public uint NativeMessageID => _nativeMessageID; + + public IRawInputSite NaturalHit => _naturalHit; + + public ICookedInputSite NaturalTarget => _naturalTarget; + + public InputModifiers Modifiers => _modifiers; + + public MouseButtons Button => _button; + + public int ScreenX => _screenX; + + public int ScreenY => _screenY; + + public int WheelDelta => _wheelDelta; + + public void SetMappedTargets(ICookedInputSite target, ICookedInputSite naturalTarget) + { + UpdateTarget(target); + _naturalTarget = naturalTarget; + } + } +} diff --git a/UIX/Microsoft/Iris/Input/MouseButtonInfo.cs b/UIX/Microsoft/Iris/Input/MouseButtonInfo.cs new file mode 100644 index 0000000..779e25e --- /dev/null +++ b/UIX/Microsoft/Iris/Input/MouseButtonInfo.cs @@ -0,0 +1,80 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.MouseButtonInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Input +{ + internal class MouseButtonInfo : MouseActionInfo + { + private static InputInfo.InfoType s_poolType = InfoType.MouseButton; + private bool _doubleClick; + private bool _state; + + static MouseButtonInfo() => SetPoolLimitMode(s_poolType, false); + + private MouseButtonInfo() + { + } + + public static MouseButtonInfo Create( + IRawInputSite rawSource, + IRawInputSite rawNatural, + int x, + int y, + int screenX, + int screenY, + InputModifiers modifiers, + MouseButtons button, + bool state, + uint messageID) + { + MouseButtonInfo mouseButtonInfo = (MouseButtonInfo)GetFromPool(s_poolType) ?? new MouseButtonInfo(); + mouseButtonInfo.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, button, state, messageID); + return mouseButtonInfo; + } + + private void Initialize( + IRawInputSite rawSource, + IRawInputSite rawNatural, + int x, + int y, + int screenX, + int screenY, + InputModifiers modifiers, + MouseButtons button, + bool state, + uint messageID) + { + _state = state; + _doubleClick = false; + Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, EventTypeForMouseButton(state, button, modifiers), messageID, button, 0); + } + + public override InputEventType EventType => _doubleClick ? InputEventType.MouseDoubleClick : _eventType; + + public override void UpdateTarget(ICookedInputSite target) + { + base.UpdateTarget(target); + _doubleClick = (Modifiers & InputModifiers.DoubleClick) != InputModifiers.None && target != null && target.AllowDoubleClicks; + } + + private static InputEventType EventTypeForMouseButton( + bool state, + MouseButtons button, + InputModifiers modifiers) + { + bool flag = (button & MouseButtons.Left) != MouseButtons.None; + return !state ? (!flag ? InputEventType.MouseSecondaryUp : InputEventType.MousePrimaryUp) : (!flag ? InputEventType.MouseSecondaryDown : InputEventType.MousePrimaryDown); + } + + public bool IsDown => _state; + + protected override InputInfo.InfoType PoolType => s_poolType; + + public override string ToString() => InvariantString.Format("{0}({1}, Button={2})", GetType().Name, _state ? "Down" : "Up", Button); + } +} diff --git a/UIX/Microsoft/Iris/Input/MouseDevice.cs b/UIX/Microsoft/Iris/Input/MouseDevice.cs new file mode 100644 index 0000000..85b2669 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/MouseDevice.cs @@ -0,0 +1,103 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.MouseDevice +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Input +{ + internal class MouseDevice : InputDevice + { + public const uint LButtonDown = 513; + public const uint LButtonUp = 514; + public const uint LButtonDblClk = 515; + public const uint RButtonDown = 516; + public const uint RButtonUp = 517; + public const uint RButtonDblClk = 518; + public const uint MButtonDown = 519; + public const uint MButtonUp = 520; + public const uint MButtonDblClk = 521; + public const uint XButtonDown = 523; + public const uint XButtonUp = 524; + public const uint XButtonDblClk = 525; + public const uint MouseMove = 512; + public const uint MouseWheel = 522; + public const uint MouseLeave = 675; + + internal MouseDevice(InputManager manager) + : base(manager) + { + } + + public InputModifiers MouseModifiers => Manager.HACK_SystemModifiers & InputModifiers.AllMouse; + + public bool OnRawInput(uint message, InputModifiers modifiers, ref RawMouseData args) + { + IRawInputSite visCapture = args._visCapture; + IRawInputSite visNatural = args._visNatural; + Manager.HACK_UpdateSystemModifiers(modifiers); + switch (message) + { + case 512: + case 513: + case 514: + case 515: + case 516: + case 517: + case 518: + case 519: + case 520: + case 521: + case 523: + case 524: + case 525: + Manager.MostRecentPhysicalMousePos = new Point(args._physicalX, args._physicalY); + Manager.Queue.RawMouseMove(visCapture, visNatural, Manager.Modifiers, ref args); + break; + case 675: + Manager.Queue.RawMouseLeave(); + break; + } + bool state = false; + switch (message) + { + case 513: + case 515: + case 516: + case 518: + case 519: + case 521: + case 523: + case 525: + state = true; + goto case 514; + case 514: + case 517: + case 520: + case 524: + Manager.Queue.RawMouseButtonState(message, visCapture, visNatural, Manager.Modifiers, args._button, state); + break; + case 522: + Manager.Queue.RawMouseWheel(Manager.Modifiers, ref args); + break; + } + return true; + } + + public bool OnRawInput( + uint message, + InputModifiers modifiers, + ref RawDragData args, + object data) + { + Manager.HACK_UpdateSystemModifiers(modifiers); + Manager.MostRecentPhysicalMousePos = new Point(args._positionX, args._positionY); + IRawInputSite visCapture = args._visCapture; + DragOperation formOperation = (DragOperation)message; + 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 new file mode 100644 index 0000000..01c6664 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/MouseFocusInfo.cs @@ -0,0 +1,57 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.MouseFocusInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal class MouseFocusInfo : MouseInfo + { + private static InputInfo.InfoType s_poolType = InfoType.MouseFocus; + private bool _state; + private ICookedInputSite _other; + + static MouseFocusInfo() => SetPoolLimitMode(s_poolType, true); + + private MouseFocusInfo() + { + } + + public static MouseFocusInfo Create( + IRawInputSite rawSource, + int x, + int y, + bool state, + ICookedInputSite other) + { + MouseFocusInfo mouseFocusInfo = (MouseFocusInfo)GetFromPool(s_poolType) ?? new MouseFocusInfo(); + mouseFocusInfo.Initialize(rawSource, x, y, state, other); + return mouseFocusInfo; + } + + private void Initialize( + IRawInputSite rawSource, + int x, + int y, + bool state, + ICookedInputSite other) + { + _state = state; + _other = other; + Initialize(rawSource, x, y, state ? InputEventType.GainMouseFocus : InputEventType.LoseMouseFocus); + } + + protected override void Zombie() + { + base.Zombie(); + _other = null; + } + + public ICookedInputSite Other => _other; + + public bool State => _state; + + protected override InputInfo.InfoType PoolType => s_poolType; + } +} diff --git a/UIX/Microsoft/Iris/Input/MouseInfo.cs b/UIX/Microsoft/Iris/Input/MouseInfo.cs new file mode 100644 index 0000000..391ae87 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/MouseInfo.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.MouseInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal abstract class MouseInfo : InputInfo + { + private IRawInputSite _rawSource; + private int _x; + private int _y; + + protected void Initialize(IRawInputSite rawSource, int x, int y, InputEventType eventType) + { + _rawSource = rawSource; + _x = x; + _y = y; + Initialize(eventType); + } + + protected override void Zombie() + { + base.Zombie(); + _rawSource = null; + } + + public IRawInputSite RawSource => _rawSource; + + public int X => _x; + + public int Y => _y; + } +} diff --git a/UIX/Microsoft/Iris/Input/MouseMoveInfo.cs b/UIX/Microsoft/Iris/Input/MouseMoveInfo.cs new file mode 100644 index 0000000..d75d833 --- /dev/null +++ b/UIX/Microsoft/Iris/Input/MouseMoveInfo.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.MouseMoveInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Input +{ + internal class MouseMoveInfo : MouseActionInfo + { + private static InputInfo.InfoType s_poolType = InfoType.MouseMove; + + static MouseMoveInfo() => SetPoolLimitMode(s_poolType, true); + + private MouseMoveInfo() + { + } + + public static MouseMoveInfo Create( + IRawInputSite rawSource, + IRawInputSite rawNatural, + int x, + int y, + int screenX, + int screenY, + InputModifiers modifiers) + { + MouseMoveInfo mouseMoveInfo = (MouseMoveInfo)GetFromPool(s_poolType) ?? new MouseMoveInfo(); + mouseMoveInfo.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, InputEventType.MouseMove, 512U, MouseButtons.None, 0); + return mouseMoveInfo; + } + + protected override InputInfo.InfoType PoolType => s_poolType; + } +} diff --git a/UIX/Microsoft/Iris/Input/MouseWheelInfo.cs b/UIX/Microsoft/Iris/Input/MouseWheelInfo.cs new file mode 100644 index 0000000..14d6fea --- /dev/null +++ b/UIX/Microsoft/Iris/Input/MouseWheelInfo.cs @@ -0,0 +1,41 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Input.MouseWheelInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Input +{ + internal class MouseWheelInfo : MouseActionInfo + { + public const int k_defaultDelta = 120; + private static InputInfo.InfoType s_poolType = InfoType.MouseWheel; + + static MouseWheelInfo() => SetPoolLimitMode(s_poolType, true); + + private MouseWheelInfo() + { + } + + public static MouseWheelInfo Create( + IRawInputSite rawSource, + IRawInputSite rawNatural, + int x, + int y, + int screenX, + int screenY, + InputModifiers modifiers, + int delta) + { + MouseWheelInfo mouseWheelInfo = (MouseWheelInfo)GetFromPool(s_poolType) ?? new MouseWheelInfo(); + mouseWheelInfo.Initialize(rawSource, rawNatural, x, y, screenX, screenY, modifiers, InputEventType.MouseWheel, 522U, MouseButtons.None, delta); + return mouseWheelInfo; + } + + public override string ToString() => InvariantString.Format("{0}(Delta={1})", GetType().Name, WheelDelta); + + protected override InputInfo.InfoType PoolType => s_poolType; + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/BeginDragPolicy.cs b/UIX/Microsoft/Iris/InputHandlers/BeginDragPolicy.cs new file mode 100644 index 0000000..a631ff2 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/BeginDragPolicy.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.BeginDragPolicy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.InputHandlers +{ + internal enum BeginDragPolicy + { + Down, + Move, + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/Characters.cs b/UIX/Microsoft/Iris/InputHandlers/Characters.cs new file mode 100644 index 0000000..6abc7c5 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/Characters.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.Characters +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.InputHandlers +{ + internal static class Characters + { + public const char Back = '\b'; + public const char Enter = '\r'; + public const char Escape = '\x001B'; + public const char Space = ' '; + public const char Delete = '\x007F'; + public const char Null = '\0'; + public const char SOH = '\x0001'; + public const char STX = '\x0002'; + public const char ETX = '\x0003'; + public const char EOT = '\x0004'; + public const char ENQ = '\x0005'; + public const char ACK = '\x0006'; + public const char BELL = '\a'; + public const char Tab = '\t'; + public const char LineFeed = '\n'; + public const char VT = '\v'; + public const char FF = '\f'; + public const char SO = '\x000E'; + public const char SI = '\x000F'; + public const char DLE = '\x0010'; + public const char DC1 = '\x0011'; + public const char DC2 = '\x0012'; + public const char DC3 = '\x0013'; + public const char DC4 = '\x0014'; + public const char NAK = '\x0015'; + public const char SYN = '\x0016'; + public const char ETB = '\x0017'; + public const char Cancel = '\x0018'; + public const char EM = '\x0019'; + public const char SUB = '\x001A'; + public const char FS = '\x001C'; + public const char GS = '\x001D'; + public const char RS = '\x001E'; + public const char US = '\x001F'; + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/ClickCount.cs b/UIX/Microsoft/Iris/InputHandlers/ClickCount.cs new file mode 100644 index 0000000..cd98dc5 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/ClickCount.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.ClickCount +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.InputHandlers +{ + internal enum ClickCount + { + Single, + Double, + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/ClickHandler.cs b/UIX/Microsoft/Iris/InputHandlers/ClickHandler.cs new file mode 100644 index 0000000..486c3f9 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/ClickHandler.cs @@ -0,0 +1,482 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.ClickHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.InputHandlers +{ + internal class ClickHandler : ModifierInputHandler + { + private static int s_defaultRepeatDelay = Win32Api.GetDefaultKeyDelay(); + private static int s_defaultRepeatRate = Win32Api.GetDefaultKeyRepeat(); + private ClickCount _clickCount; + private ClickType _clickType; + private int _repeatDelay; + private int _repeatRate; + private IUICommand _command; + private WeakReference _eventContext; + private ClickType _clickTypeInProgress; + private DispatcherTimer _repeatTimer; + private bool _clickValidPosition; + private bool _handleEscape; + private bool _handle; + private bool _repeat; + + public ClickHandler() + { + _clickType = ClickType.Key | ClickType.GamePad | ClickType.LeftMouse; + _clickCount = ClickCount.Single; + _repeat = true; + _repeatDelay = DefaultRepeatDelay; + _repeatRate = DefaultRepeatRate; + _handle = true; + } + + protected override void OnDispose() + { + if (_repeatTimer != null) + _repeatTimer.Enabled = false; + base.OnDispose(); + } + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + if (ShouldHandleEvent(ClickType.Mouse)) + UI.MouseInteractive = true; + if (!ShouldHandleEvent(ClickType.Key | ClickType.GamePad)) + return; + UI.KeyInteractive = true; + } + + public ClickType ClickType + { + get => _clickType; + set + { + if (_clickType == value) + return; + _clickType = value; + FireNotification(NotificationID.ClickType); + } + } + + public ClickCount ClickCount + { + get => _clickCount; + set + { + if (_clickCount == value) + return; + _clickCount = value; + FireNotification(NotificationID.ClickCount); + } + } + + public bool Repeat + { + get => _repeat; + set + { + if (_repeat == value) + return; + _repeat = value; + FireNotification(NotificationID.Repeat); + } + } + + public int RepeatDelay + { + get => _repeatDelay; + set + { + if (_repeatDelay == value) + return; + _repeatDelay = value; + FireNotification(NotificationID.RepeatDelay); + } + } + + public int RepeatRate + { + get => _repeatRate; + set + { + if (_repeatRate == value) + return; + _repeatRate = value; + FireNotification(NotificationID.RepeatRate); + } + } + + public bool Clicking => _clickTypeInProgress != ClickType.None && _clickValidPosition; + + public object EventContext => CheckEventContext(ref _eventContext); + + public IUICommand Command + { + get => _command; + set + { + if (_command == value) + return; + _command = value; + FireNotification(NotificationID.Command); + } + } + + public bool Handle + { + get => _handle; + set + { + if (_handle == value) + return; + _handle = value; + FireNotification(NotificationID.Handle); + } + } + + private void InvokeCommand() + { + FireNotification(NotificationID.Invoked); + if (_command == null) + return; + _command.Invoke(); + } + + private void BeginClick(ClickType clickType, bool validPosition) + { + if (_clickTypeInProgress == ClickType.None) + { + _clickTypeInProgress = clickType; + _clickValidPosition = validPosition; + if (validPosition) + FireNotification(NotificationID.Clicking); + } + else if (_clickTypeInProgress != clickType) + CancelClick(ClickType.Any); + SetEventContext(null, ref _eventContext, NotificationID.EventContext); + } + + private void EndClick(ICookedInputSite clickTarget, ClickType clickType) + { + if (_clickTypeInProgress == ClickType.None) + return; + SetEventContext(clickTarget, ref _eventContext, NotificationID.EventContext); + if (_clickTypeInProgress == clickType && _clickValidPosition) + InvokeCommand(); + CancelClick(ClickType.Any); + } + + private void UpdateClickValidPosition(bool validPosition) + { + bool clicking = Clicking; + _clickValidPosition = validPosition; + if (Clicking == clicking) + return; + FireNotification(NotificationID.Clicking); + } + + private void CancelClick(ClickType clickType) + { + if (_clickTypeInProgress != ClickType.None && Library.Bits.TestAllFlags((uint)clickType, (uint)_clickTypeInProgress)) + { + bool clicking = Clicking; + _clickTypeInProgress = ClickType.None; + if (Clicking != clicking) + FireNotification(NotificationID.Clicking); + } + if (_repeatTimer == null) + return; + _repeatTimer.Enabled = false; + } + + private bool ShouldHandleEvent( + ClickType type, + InputHandlerModifiers modifiers, + ClickCount count) + { + return ShouldHandleEvent(type) && _clickCount == count && ShouldHandleEvent(modifiers); + } + + private bool ShouldHandleEvent(ClickType type) => Library.Bits.TestAnyFlags((uint)_clickType, (uint)type); + + private bool OnClickEvent( + ICookedInputSite clickTarget, + ClickType type, + InputHandlerTransition transition, + InputHandlerModifiers modifiers) + { + return OnClickEvent(clickTarget, type, transition, modifiers, ClickCount.Single); + } + + private bool OnClickEvent( + ICookedInputSite clickTarget, + ClickType type, + InputHandlerTransition transition, + InputHandlerModifiers modifiers, + ClickCount count) + { + if (!ShouldHandleEvent(type, modifiers, count)) + return false; + if (transition == InputHandlerTransition.Up) + { + if (HandlerTransition != InputHandlerTransition.Down) + EndClick(clickTarget, type); + if (_repeatTimer != null) + _repeatTimer.Enabled = false; + } + else + { + BeginClick(type, true); + if (HandlerTransition == InputHandlerTransition.Down) + { + EndClick(clickTarget, type); + StartRepeat(new ClickHandler.ClickInfo() + { + type = type, + transition = transition, + modifiers = modifiers, + count = count, + target = clickTarget + }); + } + } + return true; + } + + private ClickType GetClickType(MouseButtons buttons) + { + ClickType clickType = ClickType.None; + if ((buttons & MouseButtons.Left) != MouseButtons.None) + clickType |= ClickType.LeftMouse; + if ((buttons & MouseButtons.Right) != MouseButtons.None) + clickType |= ClickType.RightMouse; + if ((buttons & MouseButtons.Middle) != MouseButtons.None) + clickType |= ClickType.MiddleMouse; + return clickType; + } + + private void StartRepeat(ClickHandler.ClickInfo clickInfo) + { + if (!Repeat) + return; + if (_repeatTimer == null) + { + _repeatTimer = new DispatcherTimer(); + _repeatTimer.Tick += new EventHandler(SimulateClickEvent); + _repeatTimer.AutoRepeat = true; + } + _repeatTimer.Interval = RepeatDelay; + _repeatTimer.UserData = clickInfo; + _repeatTimer.Enabled = true; + } + + private void SimulateClickEvent(object sender, EventArgs args) + { + bool flag = false; + ClickHandler.ClickInfo userData = (ClickHandler.ClickInfo)_repeatTimer.UserData; + if (Enabled && Repeat && _clickValidPosition && (userData.target == null || userData.target.IsValid)) + { + OnClickEvent(userData.target, userData.type, userData.transition, userData.modifiers, userData.count); + flag = true; + } + if (flag) + { + _repeatTimer.Enabled = false; + _repeatTimer = null; + StartRepeat(userData); + _repeatTimer.Interval = RepeatRate; + } + else + { + _repeatTimer.Enabled = false; + _repeatTimer = null; + } + } + + private static int DefaultRepeatDelay => s_defaultRepeatDelay; + + private static int DefaultRepeatRate => s_defaultRepeatRate; + + protected override void OnMousePrimaryDown(UIClass ui, MouseButtonInfo info) + { + if (!OnClickEvent(info.Target, GetClickType(info.Button), InputHandlerTransition.Down, GetModifiers(info.Modifiers)) || !_handle) + return; + info.MarkHandled(); + } + + protected override void OnMouseSecondaryDown(UIClass ui, MouseButtonInfo info) + { + if (!OnClickEvent(info.Target, GetClickType(info.Button), InputHandlerTransition.Down, GetModifiers(info.Modifiers)) || !_handle) + return; + info.MarkHandled(); + } + + protected override void OnMousePrimaryUp(UIClass ui, MouseButtonInfo info) + { + if (!OnClickEvent(info.Target, GetClickType(info.Button), InputHandlerTransition.Up, GetModifiers(info.Modifiers)) || !_handle) + return; + info.MarkHandled(); + } + + protected override void OnMouseSecondaryUp(UIClass ui, MouseButtonInfo info) + { + if (!OnClickEvent(info.Target, GetClickType(info.Button), InputHandlerTransition.Up, GetModifiers(info.Modifiers)) || !_handle) + return; + info.MarkHandled(); + } + + protected override void OnMouseDoubleClick(UIClass ui, MouseButtonInfo info) + { + ClickType clickType = GetClickType(info.Button); + if (!OnClickEvent(info.Target, clickType, InputHandlerTransition.Down, GetModifiers(info.Modifiers), ClickCount.Double)) + return; + OnClickEvent(info.Target, clickType, InputHandlerTransition.Up, GetModifiers(info.Modifiers), ClickCount.Double); + if (!_handle) + return; + info.MarkHandled(); + } + + protected override void OnMouseMove(UIClass ui, MouseMoveInfo info) + { + if (!ShouldHandleEvent(ClickType.Mouse)) + return; + UpdateClickValidPosition(UI.HasDescendant(info.NaturalTarget as UIClass)); + } + + protected override void OnLoseMouseFocus(UIClass ui, MouseFocusInfo info) + { + if (!ShouldHandleEvent(ClickType.Mouse)) + return; + CancelClick(ClickType.Mouse); + } + + protected override void OnKeyDown(UIClass ui, KeyStateInfo info) + { + if (info.RepeatCount > 1U) + return; + switch (info.Key) + { + case Keys.Enter: + if (!OnClickEvent(info.Target, ClickType.EnterKey, InputHandlerTransition.Down, GetModifiers(info.Modifiers)) || !_handle) + break; + info.MarkHandled(); + break; + case Keys.Escape: + if (!Clicking) + break; + CancelClick(ClickType.Any); + if (_handle) + info.MarkHandled(); + _handleEscape = true; + break; + case Keys.Space: + if (!OnClickEvent(info.Target, ClickType.SpaceKey, InputHandlerTransition.Down, GetModifiers(info.Modifiers)) || !_handle) + break; + info.MarkHandled(); + break; + case Keys.GamePadA: + if (!OnClickEvent(info.Target, ClickType.GamePadA, InputHandlerTransition.Down, GetModifiers(info.Modifiers)) || !_handle) + break; + info.MarkHandled(); + break; + case Keys.GamePadStart: + if (!OnClickEvent(info.Target, ClickType.GamePadStart, InputHandlerTransition.Down, GetModifiers(info.Modifiers)) || !_handle) + break; + info.MarkHandled(); + break; + } + } + + protected override void OnKeyUp(UIClass ui, KeyStateInfo info) + { + switch (info.Key) + { + case Keys.Enter: + if (!OnClickEvent(info.Target, ClickType.EnterKey, InputHandlerTransition.Up, GetModifiers(info.Modifiers)) || !_handle) + break; + info.MarkHandled(); + break; + case Keys.Escape: + if (!_handleEscape) + break; + if (_handle) + info.MarkHandled(); + _handleEscape = false; + break; + case Keys.Space: + if (!OnClickEvent(info.Target, ClickType.SpaceKey, InputHandlerTransition.Up, GetModifiers(info.Modifiers)) || !_handle) + break; + info.MarkHandled(); + break; + case Keys.GamePadA: + if (!OnClickEvent(info.Target, ClickType.GamePadA, InputHandlerTransition.Up, GetModifiers(info.Modifiers)) || !_handle) + break; + info.MarkHandled(); + break; + case Keys.GamePadStart: + if (!OnClickEvent(info.Target, ClickType.GamePadStart, InputHandlerTransition.Up, GetModifiers(info.Modifiers)) || !_handle) + break; + info.MarkHandled(); + break; + } + } + + protected override void OnKeyCharacter(UIClass ui, KeyCharacterInfo info) + { + switch (info.Character) + { + case '\r': + if (!ShouldHandleEvent(ClickType.EnterKey, GetModifiers(info.Modifiers), ClickCount.Single) || !_handle) + break; + info.MarkHandled(); + break; + case '\x001B': + if (!_handleEscape || !_handle) + break; + info.MarkHandled(); + break; + case ' ': + if (!ShouldHandleEvent(ClickType.SpaceKey, GetModifiers(info.Modifiers), ClickCount.Single) || !_handle) + break; + info.MarkHandled(); + break; + } + } + + protected override void OnLoseKeyFocus(UIClass ui, KeyFocusInfo info) + { + if (ShouldHandleEvent(ClickType.SpaceKey)) + CancelClick(ClickType.SpaceKey); + if (ShouldHandleEvent(ClickType.EnterKey)) + CancelClick(ClickType.EnterKey); + if (ShouldHandleEvent(ClickType.GamePadA)) + CancelClick(ClickType.GamePadA); + if (ShouldHandleEvent(ClickType.GamePadStart)) + CancelClick(ClickType.GamePadStart); + _handleEscape = false; + } + + private struct ClickInfo + { + public ClickType type; + public InputHandlerTransition transition; + public InputHandlerModifiers modifiers; + public ClickCount count; + public ICookedInputSite target; + } + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/ClickType.cs b/UIX/Microsoft/Iris/InputHandlers/ClickType.cs new file mode 100644 index 0000000..0c4a66f --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/ClickType.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.ClickType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.InputHandlers +{ + [Flags] + internal enum ClickType + { + None = 0, + LeftMouse = 1, + RightMouse = 2, + MiddleMouse = 4, + SpaceKey = 8, + EnterKey = 16, // 0x00000010 + GamePadA = 32, // 0x00000020 + GamePadStart = 64, // 0x00000040 + Mouse = MiddleMouse | RightMouse | LeftMouse, // 0x00000007 + Key = EnterKey | SpaceKey, // 0x00000018 + GamePad = GamePadStart | GamePadA, // 0x00000060 + Any = GamePad | Key | Mouse, // 0x0000007F + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/DragDropHelper.cs b/UIX/Microsoft/Iris/InputHandlers/DragDropHelper.cs new file mode 100644 index 0000000..146d554 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/DragDropHelper.cs @@ -0,0 +1,105 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.DragDropHelper +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.InputHandlers +{ + internal static class DragDropHelper + { + private static bool _draggingInternally; + private static DragSourceHandler _sourceHandler; + private static DropTargetHandler _targetHandler; + private static DropAction _dropAction; + + public static bool DraggingInternally => _draggingInternally; + + public static DragSourceHandler SourceHandler => _sourceHandler; + + public static DropTargetHandler TargetHandler + { + get => _targetHandler; + set + { + if (_targetHandler == value) + return; + DropTargetHandler targetHandler = _targetHandler; + _targetHandler = value; + OnAllowedDropActionsChanged(); + } + } + + public static DropAction AllowedDropActions => _targetHandler == null ? DropAction.None : _targetHandler.AllowedDropActions; + + public static InputModifiers Modifiers => UISession.Default.InputManager.DragModifiers; + + public static void OnAllowedDropActionsChanged() + { + if (DraggingInternally) + { + _sourceHandler.UpdateCurrentAction(); + } + else + { + uint allowedDropActions = (uint)AllowedDropActions; + UISession.Default.Form.SetDragDropResult(allowedDropActions, allowedDropActions); + } + } + + public static void BeginDrag( + DragSourceHandler sourceHandler, + ICookedInputSite source, + IRawInputSite target, + int formX, + int formY, + InputModifiers modifiers) + { + _sourceHandler = sourceHandler; + _draggingInternally = true; + UISession.Default.Form.IsDragInProgress = true; + UISession.Default.InputManager.SimulateDragEnter(source, target, _sourceHandler.Value, formX, formY, modifiers); + } + + public static void Requery(InputModifiers modifiers) + { + UISession.Default.InputManager.SimulateDragOver(modifiers); + _sourceHandler.UpdateCurrentAction(); + } + + public static void Requery( + IRawInputSite target, + int formX, + int formY, + InputModifiers modifiers) + { + UISession.Default.InputManager.SimulateDragOver(target, formX, formY, modifiers); + } + + public static void EndDrag(IRawInputSite target, InputModifiers modifiers, DropAction action) + { + DragOperation formOperation = DragOperation.Drop; + _dropAction = action; + _draggingInternally = false; + if (action == DropAction.None) + { + target = null; + formOperation = DragOperation.Leave; + } + UISession.Default.InputManager.SimulateDragEnd(target, modifiers, formOperation); + UISession.Default.Form.IsDragInProgress = false; + } + + public static void OnDragComplete() + { + _sourceHandler.OnEndDrag(_dropAction); + _sourceHandler = null; + _dropAction = DropAction.None; + } + + public static object GetValue() => UISession.Default.InputManager.GetDragDropValue(); + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/DragHandler.cs b/UIX/Microsoft/Iris/InputHandlers/DragHandler.cs new file mode 100644 index 0000000..738b85e --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/DragHandler.cs @@ -0,0 +1,473 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.DragHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Iris.InputHandlers +{ + internal class DragHandler : InputHandler + { + private CursorID _dragCursor; + private BeginDragPolicy _beginDragPolicy; + private bool _pendingDrag; + private bool _inDrag; + private bool _hasRelativeTo; + private Vector2 _initialPosition; + private Point _initialScreenPosition; + private Vector2 _beginPosition; + private Vector2 _endPosition; + private Point _screenBeginPosition; + private Point _screenEndPosition; + private Size _lastKnownSize; + private InputHandlerModifiers _activeModifiers; + private bool _cancelOnEscape; + private ViewItem _relativeTo; + private RectangleF _contextBounds; + private List _addedContexts; + private List _removedContexts; + + public DragHandler() => _beginDragPolicy = BeginDragPolicy.Down; + + public override void OnZoneDetached() + { + CancelDrag(); + base.OnZoneDetached(); + } + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (HandleDirect) + UI.MouseInteractive = true; + if (_relativeTo != null) + return; + SetRelativeTo(null); + } + + public BeginDragPolicy BeginDragPolicy + { + get => _beginDragPolicy; + set + { + if (_beginDragPolicy == value) + return; + _beginDragPolicy = value; + FireNotification(NotificationID.BeginDragPolicy); + } + } + + public bool Dragging => _inDrag; + + private void SetDragging(bool value) + { + if (_inDrag == value) + return; + _inDrag = value; + FireNotification(NotificationID.Dragging); + } + + public Vector2 BeginPosition => NormalizeCoordinates(_beginPosition); + + private void SetBeginPosition(Vector2 relativeCoordinate) + { + if (!(_beginPosition != relativeCoordinate)) + return; + _beginPosition = relativeCoordinate; + FireNotification(NotificationID.BeginPosition); + FireNotification(NotificationID.RelativeDragSize); + } + + public Vector2 EndPosition => NormalizeCoordinates(_endPosition); + + private void SetEndPosition(Vector2 relativeCoordinate) + { + if (!(_endPosition != relativeCoordinate)) + return; + _endPosition = relativeCoordinate; + FireNotification(NotificationID.EndPosition); + FireNotification(NotificationID.RelativeDragSize); + } + + public Size ScreenDragSize => (ScreenEndPosition - ScreenBeginPosition).ToSize(); + + public Vector2 LocalDragSize + { + get + { + Size screenDragSize = ScreenDragSize; + Vector3 vector3 = _relativeTo != null ? _relativeTo.ComputeEffectiveScale() : Vector3.UnitVector; + return new Vector2(screenDragSize.Width / vector3.X, screenDragSize.Height / vector3.Y); + } + } + + public Vector2 RelativeDragSize => EndPosition - BeginPosition; + + public InputHandlerModifiers ActiveModifiers => _activeModifiers; + + private void SetActiveModifiers(InputHandlerModifiers value) + { + if (_activeModifiers == value) + return; + _activeModifiers = value; + FireNotification(NotificationID.ActiveModifiers); + } + + public CursorID DragCursor + { + get => _dragCursor; + set + { + if (_dragCursor == value) + return; + _dragCursor = value; + FireNotification(NotificationID.DragCursor); + } + } + + private Point ScreenBeginPosition + { + get => _screenBeginPosition; + set + { + if (!(_screenBeginPosition != value)) + return; + _screenBeginPosition = value; + FireNotification(NotificationID.ScreenDragSize); + FireNotification(NotificationID.LocalDragSize); + } + } + + private Point ScreenEndPosition + { + get => _screenEndPosition; + set + { + if (!(_screenEndPosition != value)) + return; + _screenEndPosition = value; + FireNotification(NotificationID.ScreenDragSize); + FireNotification(NotificationID.LocalDragSize); + } + } + + public bool CancelOnEscape + { + get => _cancelOnEscape; + set + { + if (_cancelOnEscape == value) + return; + if (Dragging) + HookSessionInput(value); + _cancelOnEscape = value; + FireNotification(NotificationID.CancelOnEscape); + } + } + + public ViewItem RelativeTo + { + get => !_hasRelativeTo ? null : _relativeTo; + set + { + bool hasRelativeTo = _hasRelativeTo; + _hasRelativeTo = value != null; + ViewItem relativeTo = _relativeTo; + SetRelativeTo(value); + if (hasRelativeTo == _hasRelativeTo && relativeTo == _relativeTo) + return; + FireNotification(NotificationID.RelativeTo); + } + } + + private void SetRelativeTo(ViewItem relativeTo) + { + if (_relativeTo == relativeTo && relativeTo != null) + return; + LayoutCompleteEventHandler completeEventHandler = new LayoutCompleteEventHandler(OnRelativeToLayoutComplete); + if (_relativeTo != null) + _relativeTo.LayoutComplete -= completeEventHandler; + _relativeTo = relativeTo; + if (_relativeTo == null && UI != null) + _relativeTo = UI.RootItem; + if (_relativeTo == null) + return; + _relativeTo.LayoutComplete += completeEventHandler; + } + + public void ResetDragOrigin() + { + SetBeginPosition(_endPosition); + ScreenBeginPosition = ScreenEndPosition; + } + + private void BeginDrag( + Vector2 relativeBegin, + Vector2 relativeEnd, + Point screenBegin, + Point screenEnd, + InputHandlerModifiers modifiers) + { + SetDragging(true); + _pendingDrag = false; + _contextBounds = RectangleF.Zero; + if (CancelOnEscape) + HookSessionInput(true); + SetBeginPosition(relativeBegin); + SetEndPosition(relativeEnd); + ScreenBeginPosition = screenBegin; + ScreenEndPosition = screenEnd; + SetActiveModifiers(modifiers); + FireNotification(NotificationID.Started); + UpdateCursor(); + } + + private void EndDrag(bool completed) + { + if (Dragging) + { + if (CancelOnEscape) + HookSessionInput(false); + SetDragging(false); + if (completed) + FireNotification(NotificationID.Ended); + else + FireNotification(NotificationID.Canceled); + UpdateCursor(); + } + _pendingDrag = false; + } + + private void InDrag(Vector2 uiPoint, Point screenPoint, InputHandlerModifiers modifiers) + { + if (screenPoint != ScreenEndPosition) + { + SetEndPosition(TransformToRelative(uiPoint)); + ScreenEndPosition = screenPoint; + } + SetActiveModifiers(modifiers); + } + + protected override void OnMousePrimaryDown(UIClass ui, MouseButtonInfo info) + { + if (!Dragging) + { + Vector2 relative = TransformToRelative(TransformToUI(new Point(info.X, info.Y), (UIClass)info.Target)); + Point point = new Point(info.ScreenX, info.ScreenY); + if (BeginDragPolicy == BeginDragPolicy.Down) + { + BeginDrag(relative, relative, point, point, GetModifiers(info.Modifiers)); + info.MarkHandled(); + } + else + { + _pendingDrag = true; + _initialPosition = relative; + _initialScreenPosition = point; + } + } + base.OnMousePrimaryDown(ui, info); + } + + protected override void OnMousePrimaryUp(UIClass ui, MouseButtonInfo info) + { + bool dragging = Dragging; + if (dragging || _pendingDrag) + { + EndDrag(true); + if (dragging) + info.MarkHandled(); + } + base.OnMousePrimaryUp(ui, info); + } + + protected override void OnMouseMove(UIClass ui, MouseMoveInfo info) + { + if ((info.Modifiers & InputModifiers.LeftMouse) == InputModifiers.None) + EndDrag(true); + else if (Dragging || _pendingDrag) + { + Vector2 ui1 = TransformToUI(new Point(info.X, info.Y), (UIClass)info.Target); + Point point = new Point(info.ScreenX, info.ScreenY); + if (Dragging) + { + InDrag(ui1, point, GetModifiers(info.Modifiers)); + info.MarkHandled(); + } + else if (Math.Abs(point.X - _initialScreenPosition.X) >= Win32Api.GetSystemMetrics(68) || Math.Abs(point.Y - _initialScreenPosition.Y) >= Win32Api.GetSystemMetrics(69)) + { + BeginDrag(_initialPosition, TransformToRelative(ui1), _initialScreenPosition, point, GetModifiers(info.Modifiers)); + info.MarkHandled(); + } + } + base.OnMouseMove(ui, info); + } + + protected override void OnLoseMouseFocus(UIClass ui, MouseFocusInfo info) + { + CancelDrag(); + base.OnLoseMouseFocus(ui, info); + } + + private void OnRelativeToLayoutComplete(object sender) => SetLastLayoutSize(_relativeTo.LayoutSize); + + protected void SetLastLayoutSize(Size size) + { + Vector2 beginPosition = BeginPosition; + Vector2 endPosition = EndPosition; + Vector2 relativeDragSize = RelativeDragSize; + _lastKnownSize = size; + if (!Dragging) + return; + Point client = _relativeTo.ScreenToClient(_screenEndPosition); + SetEndPosition(new Vector2(client.X, client.Y)); + if (beginPosition != BeginPosition) + FireNotification(NotificationID.BeginPosition); + if (endPosition != EndPosition) + FireNotification(NotificationID.EndPosition); + if (!(relativeDragSize != RelativeDragSize)) + return; + FireNotification(NotificationID.RelativeDragSize); + } + + private void HookSessionInput(bool hook) + { + if (hook) + UI.SessionInput += new SessionInputHandler(OnSessionInput); + else + UI.SessionInput -= new SessionInputHandler(OnSessionInput); + } + + private void OnSessionInput(InputInfo originalEvent, EventRouteStages stageHandled) + { + if (!(originalEvent is KeyStateInfo keyStateInfo)) + return; + if (keyStateInfo.Key == Keys.Escape) + CancelDrag(); + keyStateInfo.MarkHandled(); + } + + private Vector2 TransformToRelative(Vector2 uiPoint) + { + if (_relativeTo != null) + { + RectangleF rectangleF = _relativeTo.TransformFromAncestor(UI.RootItem, new RectangleF(uiPoint.X, uiPoint.Y, 0.0f, 0.0f)); + uiPoint.X = rectangleF.X; + uiPoint.Y = rectangleF.Y; + } + return uiPoint; + } + + private RectangleF TransformFromRelative(RectangleF relativeBounds) + { + RectangleF rectangleF = relativeBounds; + if (_relativeTo != null) + rectangleF = _relativeTo.TransformToAncestor(UI.RootItem, relativeBounds); + return rectangleF; + } + + private Vector2 TransformToUI(Point uiPoint, UIClass reference) + { + float x = uiPoint.X; + float y = uiPoint.Y; + if (reference != UI) + { + RectangleF rect = new RectangleF(x, y, 0.0f, 0.0f); + RectangleF ancestor = reference.RootItem.TransformToAncestor(UI.RootItem, rect); + x = ancestor.X; + y = ancestor.Y; + } + return new Vector2(x, y); + } + + private Vector2 NormalizeCoordinates(Vector2 pt) => _lastKnownSize.Width == 0 || _lastKnownSize.Height == 0 ? Vector2.Zero : new Vector2(pt.X / _lastKnownSize.Width, pt.Y / _lastKnownSize.Height); + + internal override CursorID GetCursor() => _dragCursor != CursorID.NotSpecified && Dragging ? _dragCursor : CursorID.NotSpecified; + + public void CancelDrag() => EndDrag(false); + + private void GetDragBounds(out RectangleF relativeBounds, out RectangleF uiBounds) + { + relativeBounds = new RectangleF(Math.Min(_beginPosition.X, _endPosition.X), Math.Min(_beginPosition.Y, _endPosition.Y), Math.Abs(_beginPosition.X - _endPosition.X), Math.Abs(_beginPosition.Y - _endPosition.Y)); + uiBounds = TransformFromRelative(relativeBounds); + } + + public IList GetEventContexts() + { + IList added = new List(); + RectangleF uiBounds; + GetDragBounds(out RectangleF _, out uiBounds); + GetEventContexts(UI, added, null, RectangleF.Zero, uiBounds); + return added; + } + + public IList GetAddedEventContexts() + { + UpdateEventContexts(); + return _addedContexts; + } + + public IList GetRemovedEventContexts() + { + UpdateEventContexts(); + return _removedContexts; + } + + private void UpdateEventContexts() + { + RectangleF relativeBounds; + RectangleF uiBounds; + GetDragBounds(out relativeBounds, out uiBounds); + if (!(relativeBounds != _contextBounds)) + return; + _addedContexts = new List(); + _removedContexts = new List(); + GetEventContexts(UI, _addedContexts, _removedContexts, TransformFromRelative(_contextBounds), uiBounds); + _contextBounds = relativeBounds; + } + + private static void GetEventContexts( + UIClass node, + IList added, + IList removed, + RectangleF oldBounds, + RectangleF newBounds) + { + ViewItem rootItem = node.RootItem; + if (rootItem == null) + return; + object eventContext = node.GetEventContext(); + if (eventContext != null && rootItem.Parent != null) + { + RectangleF rectangleF = new RectangleF(Point.Zero, rootItem.Parent.LayoutSize); + bool flag1 = rectangleF.IntersectsWith(oldBounds); + bool flag2 = rectangleF.IntersectsWith(newBounds); + if (flag2 && !flag1) + added.Add(eventContext); + else if (removed != null && flag1 && !flag2) + removed.Add(eventContext); + } + for (UIClass node1 = (UIClass)node.FirstChild; node1 != null; node1 = (UIClass)node1.NextSibling) + { + if (node1.RootItem != null) + { + RectangleF oldBounds1 = node1.RootItem.Parent.TransformFromAncestor(rootItem.Parent, oldBounds); + RectangleF newBounds1 = node1.RootItem.Parent.TransformFromAncestor(rootItem.Parent, newBounds); + GetEventContexts(node1, added, removed, oldBounds1, newBounds1); + } + } + } + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/DragSourceHandler.cs b/UIX/Microsoft/Iris/InputHandlers/DragSourceHandler.cs new file mode 100644 index 0000000..4f145a4 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/DragSourceHandler.cs @@ -0,0 +1,279 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.DragSourceHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Markup; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.InputHandlers +{ + internal class DragSourceHandler : InputHandler + { + private object _value; + private DropAction _allowedDropActions; + private DropAction _currentDropAction; + private bool _pendingDrag; + private bool _dragCanceled; + private int _initialX; + private int _initialY; + private CursorID _moveCursor; + private CursorID _copyCursor; + private CursorID _cancelCursor; + + internal DragSourceHandler() + { + _moveCursor = CursorID.Move; + _copyCursor = CursorID.Copy; + _cancelCursor = CursorID.Cancel; + } + + public override void OnZoneDetached() + { + if (Dragging) + EndDrag(null, InputModifiers.None, DropAction.None); + base.OnZoneDetached(); + } + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + UI.MouseInteractive = true; + } + + public object Value + { + get => _value; + set + { + if (_value == value) + return; + _value = value; + FireNotification(NotificationID.Value); + } + } + + public DropAction AllowedDropActions + { + get => _allowedDropActions; + set + { + if (_allowedDropActions == value) + return; + _allowedDropActions = value; + FireNotification(NotificationID.AllowedDropActions); + } + } + + public DropAction CurrentDropAction => _currentDropAction; + + private void SetCurrentDropAction(DropAction value) + { + if (_currentDropAction == value) + return; + _currentDropAction = value; + FireNotification(NotificationID.CurrentDropAction); + UpdateCursor(); + } + + public bool Dragging => DragDropHelper.DraggingInternally && DragDropHelper.SourceHandler == this; + + public CursorID MoveCursor + { + get => _moveCursor; + set + { + if (_moveCursor == value) + return; + _moveCursor = value; + FireNotification(NotificationID.MoveCursor); + } + } + + public CursorID CopyCursor + { + get => _copyCursor; + set + { + if (_copyCursor == value) + return; + _copyCursor = value; + FireNotification(NotificationID.CopyCursor); + } + } + + public CursorID CancelCursor + { + get => _cancelCursor; + set + { + if (_cancelCursor == value) + return; + _cancelCursor = value; + FireNotification(NotificationID.CancelCursor); + } + } + + protected override void OnMousePrimaryDown(UIClass ui, MouseButtonInfo info) + { + _pendingDrag = true; + _initialX = info.ScreenX; + _initialY = info.ScreenY; + base.OnMousePrimaryDown(ui, info); + } + + protected override void OnMouseMove(UIClass ui, MouseMoveInfo info) + { + if (Dragging) + { + DragDropHelper.Requery(info.NaturalHit, info.ScreenX, info.ScreenY, info.Modifiers); + info.MarkHandled(); + } + else if (_pendingDrag) + { + if (Math.Abs(info.ScreenX - _initialX) >= Win32Api.GetSystemMetrics(68) || Math.Abs(info.ScreenY - _initialY) >= Win32Api.GetSystemMetrics(69)) + { + _pendingDrag = false; + DragDropHelper.BeginDrag(this, info.Target, info.NaturalHit, 0, 0, info.Modifiers); + UI.SessionInput += new SessionInputHandler(OnSessionInput); + FireNotification(NotificationID.Dragging); + FireNotification(NotificationID.Started); + UpdateCursor(); + info.MarkHandled(); + } + } + else if (_dragCanceled) + info.MarkHandled(); + base.OnMouseMove(ui, info); + } + + protected override void OnMousePrimaryUp(UIClass sender, MouseButtonInfo info) + { + _pendingDrag = false; + if (Dragging) + { + EndDrag(info?.NaturalHit, info.Modifiers, CurrentDropAction); + info.MarkHandled(); + } + else if (_dragCanceled) + { + _dragCanceled = false; + info.MarkHandled(); + } + base.OnMousePrimaryUp(sender, info); + } + + protected override void OnDragComplete(UIClass sender, DragDropInfo info) + { + DragDropHelper.OnDragComplete(); + info.MarkHandled(); + base.OnDragComplete(sender, info); + } + + private void OnSessionInput(InputInfo originalEvent, EventRouteStages handledStage) + { + switch (originalEvent) + { + case KeyStateInfo keyStateInfo: + switch (keyStateInfo.Key) + { + case Keys.ControlKey: + InputModifiers modifiers = keyStateInfo.Modifiers; + if (keyStateInfo.Action == KeyAction.Down) + modifiers |= InputModifiers.ControlKey; + DragDropHelper.Requery(modifiers); + break; + case Keys.Escape: + EndDrag(null, keyStateInfo.Modifiers, DropAction.None); + _dragCanceled = true; + break; + } + keyStateInfo.MarkHandled(); + break; + case MouseButtonInfo mouseButtonInfo: + if (mouseButtonInfo.Button == MouseButtons.Left) + break; + mouseButtonInfo.MarkHandled(); + break; + } + } + + protected override void OnLoseKeyFocus(UIClass sender, KeyFocusInfo info) + { + _pendingDrag = false; + if (Dragging) + EndDrag(null, DragDropHelper.Modifiers, DropAction.None); + base.OnLoseKeyFocus(sender, info); + } + + protected override void OnLoseMouseFocus(UIClass sender, MouseFocusInfo info) + { + _pendingDrag = false; + if (Dragging) + EndDrag(null, DragDropHelper.Modifiers, DropAction.None); + base.OnLoseMouseFocus(sender, info); + } + + private void EndDrag(IRawInputSite target, InputModifiers modifiers, DropAction action) + { + UI.SessionInput -= new SessionInputHandler(OnSessionInput); + DragDropHelper.EndDrag(target, modifiers, action); + } + + internal void OnEndDrag(DropAction action) + { + FireNotification(NotificationID.Dragging); + switch (action) + { + case DropAction.None: + FireNotification(NotificationID.Canceled); + break; + case DropAction.Copy: + FireNotification(NotificationID.Copied); + break; + case DropAction.Move: + FireNotification(NotificationID.Moved); + break; + } + UpdateCursor(); + } + + internal void UpdateCurrentAction() + { + DropAction dropAction = DragDropHelper.AllowedDropActions & AllowedDropActions; + if ((dropAction & DropAction.All) == DropAction.All) + { + if ((DragDropHelper.Modifiers & InputModifiers.ControlKey) == InputModifiers.ControlKey) + SetCurrentDropAction(DropAction.Copy); + else + SetCurrentDropAction(DropAction.Move); + } + else + SetCurrentDropAction(dropAction); + } + + internal override CursorID GetCursor() + { + if (Dragging) + { + switch (CurrentDropAction) + { + case DropAction.None: + return CancelCursor; + case DropAction.Copy: + return CopyCursor; + case DropAction.Move: + return MoveCursor; + } + } + return CursorID.NotSpecified; + } + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/DropAction.cs b/UIX/Microsoft/Iris/InputHandlers/DropAction.cs new file mode 100644 index 0000000..54c8ccd --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/DropAction.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.DropAction +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.InputHandlers +{ + [Flags] + internal enum DropAction + { + None = 0, + Copy = 1, + Move = 2, + All = Move | Copy, // 0x00000003 + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/DropTargetHandler.cs b/UIX/Microsoft/Iris/InputHandlers/DropTargetHandler.cs new file mode 100644 index 0000000..71baa80 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/DropTargetHandler.cs @@ -0,0 +1,102 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.DropTargetHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.InputHandlers +{ + internal class DropTargetHandler : InputHandler + { + private bool _dragging; + private DropAction _allowedDropActions; + private WeakReference _eventContext; + + internal DropTargetHandler() => UISession.Default.Form.EnableExternalDragDrop = true; + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + UI.MouseInteractive = true; + } + + public DropAction AllowedDropActions + { + get => _allowedDropActions; + set + { + if (_allowedDropActions == value) + return; + _allowedDropActions = value; + FireNotification(NotificationID.AllowedDropActions); + if (!Dragging) + return; + DragDropHelper.OnAllowedDropActionsChanged(); + } + } + + public bool Dragging => _dragging; + + public object EventContext => CheckEventContext(ref _eventContext); + + protected override void OnDragEnter(UIClass ui, DragDropInfo info) + { + _dragging = true; + DragDropHelper.TargetHandler = this; + FireNotification(NotificationID.Dragging); + FireNotification(NotificationID.DragEnter); + SetEventContext(info.Target, ref _eventContext, NotificationID.EventContext); + info.MarkHandled(); + base.OnDragEnter(ui, info); + } + + protected override void OnDragOver(UIClass ui, DragDropInfo info) + { + if (Dragging) + { + FireNotification(NotificationID.DragOver); + info.MarkHandled(); + } + base.OnDragOver(ui, info); + } + + protected override void OnDragLeave(UIClass ui, DragDropInfo info) + { + if (Dragging) + { + EndDrag(NotificationID.DragLeave); + info.MarkHandled(); + SetEventContext(null, ref _eventContext, NotificationID.EventContext); + } + base.OnDragLeave(ui, info); + } + + protected override void OnDropped(UIClass ui, DragDropInfo info) + { + if (Dragging) + { + EndDrag(NotificationID.Dropped); + info.MarkHandled(); + } + base.OnDropped(ui, info); + } + + private void EndDrag(string eventName) + { + _dragging = false; + FireNotification(NotificationID.Dragging); + FireNotification(eventName); + DragDropHelper.TargetHandler = null; + } + + public object GetValue() => DragDropHelper.GetValue(); + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/EventContext.cs b/UIX/Microsoft/Iris/InputHandlers/EventContext.cs new file mode 100644 index 0000000..e3e50a5 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/EventContext.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.EventContext +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.InputHandlers +{ + internal class EventContext : InputHandler + { + private object _value; + + protected override void ConfigureInteractivity() => UI.SetEventContext(this); + + public object Value + { + get => _value; + set + { + if (_value == value) + return; + _value = value; + FireNotification(NotificationID.Value); + } + } + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/FocusChangeReason.cs b/UIX/Microsoft/Iris/InputHandlers/FocusChangeReason.cs new file mode 100644 index 0000000..8fc34bd --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/FocusChangeReason.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.FocusChangeReason +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.InputHandlers +{ + [Flags] + internal enum FocusChangeReason + { + Mouse = 1, + Directional = 2, + Tab = 4, + Key = Tab | Directional, // 0x00000006 + Other = 8, + Any = Other | Key | Mouse, // 0x0000000F + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/FocusHandler.cs b/UIX/Microsoft/Iris/InputHandlers/FocusHandler.cs new file mode 100644 index 0000000..1bed1be --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/FocusHandler.cs @@ -0,0 +1,81 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.FocusHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.InputHandlers +{ + internal class FocusHandler : ModifierInputHandler + { + private FocusChangeReason _changeReason; + private WeakReference _gainedEventContext; + private WeakReference _lostEventContext; + + public FocusHandler() => _changeReason = FocusChangeReason.Any; + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + UI.KeyInteractive = true; + } + + public FocusChangeReason Reason + { + get => _changeReason; + set + { + if (_changeReason == value) + return; + _changeReason = value; + FireNotification(NotificationID.Reason); + } + } + + public object GainedEventContext => CheckEventContext(ref _gainedEventContext); + + public object LostEventContext => CheckEventContext(ref _lostEventContext); + + protected override void OnGainKeyFocus(UIClass ui, KeyFocusInfo info) + { + if (!ShouldHandleEvent(info)) + return; + SetEventContext(info.Target, ref _gainedEventContext, NotificationID.GainedEventContext); + FireNotification(NotificationID.GainedFocus); + } + + protected override void OnLoseKeyFocus(UIClass ui, KeyFocusInfo info) + { + if (!ShouldHandleEvent(info)) + return; + SetEventContext(info.Target, ref _lostEventContext, NotificationID.LostEventContext); + FireNotification(NotificationID.LostFocus); + } + + private bool ShouldHandleEvent(KeyFocusInfo info) => Library.Bits.TestAnyFlags((uint)Reason, (uint)GetFocusChangeReason(info)) && ShouldHandleEvent(GetModifiers(UISession.Default.InputManager.Modifiers)); + + private static FocusChangeReason GetFocusChangeReason(KeyFocusInfo info) + { + switch (info.FocusReason) + { + case KeyFocusReason.Directional: + return FocusChangeReason.Directional; + case KeyFocusReason.Tab: + return FocusChangeReason.Tab; + case KeyFocusReason.MouseDown: + case KeyFocusReason.MouseEnter: + return FocusChangeReason.Mouse; + default: + return FocusChangeReason.Other; + } + } + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/KeyHandler.cs b/UIX/Microsoft/Iris/InputHandlers/KeyHandler.cs new file mode 100644 index 0000000..df19f37 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/KeyHandler.cs @@ -0,0 +1,273 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.KeyHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Collections; + +namespace Microsoft.Iris.InputHandlers +{ + internal class KeyHandler : ModifierInputHandler + { + private ArrayList _invokedKeys; + private KeyHandlerKey _key; + private IUICommand _command; + private bool _pressing; + private bool _handle; + private bool _stopRoute; + private bool _repeat; + private WeakReference _eventContext; + + public KeyHandler() + { + _handle = true; + HandlerTransition = InputHandlerTransition.Down; + _key = KeyHandlerKey.None; + _repeat = true; + } + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + UI.KeyInteractive = true; + } + + public bool Pressing => _pressing; + + public KeyHandlerKey Key + { + get => _key; + set + { + if (_key == value) + return; + _key = value; + FireNotification(NotificationID.Key); + } + } + + public IUICommand Command + { + get => _command; + set + { + if (_command == value) + return; + _command = value; + FireNotification(NotificationID.Command); + } + } + + public bool Handle + { + get => _handle; + set + { + if (_handle == value) + return; + _handle = value; + FireNotification(NotificationID.Handle); + } + } + + public bool StopRoute + { + get => _stopRoute; + set + { + _stopRoute = value; + FireNotification(NotificationID.StopRoute); + } + } + + public bool Repeat + { + get => _repeat; + set + { + if (_repeat == value) + return; + _repeat = value; + FireNotification(NotificationID.Repeat); + } + } + + public object EventContext => CheckEventContext(ref _eventContext); + + public bool TrackInvokedKeys + { + get => _invokedKeys != null; + set + { + if (TrackInvokedKeys == value) + return; + _invokedKeys = !value ? null : new ArrayList(); + FireNotification(NotificationID.TrackInvokedKeys); + } + } + + public void GetInvokedKeys(IList copyTo) + { + if (TrackInvokedKeys) + { + foreach (object invokedKey in _invokedKeys) + copyTo.Add(invokedKey); + _invokedKeys.Clear(); + } + else + ErrorManager.ReportError("KeyHandler needs to be marked TrackInvokedKeys=\"true\" in order to call GetInvokedKeys()"); + } + + protected override void OnKeyDown(UIClass ui, KeyStateInfo info) + { + Keys key = info.Key; + InputHandlerModifiers modifiers = GetModifiers(info.Modifiers); + if (key != (Keys)_key) + TranslateKey(ref key, ref modifiers); + if (!KeyMatches(key) || !ShouldHandleEvent(modifiers)) + return; + bool flag; + if (!_pressing) + { + _pressing = true; + FireNotification(NotificationID.Pressing); + flag = true; + } + else + flag = _repeat; + if (flag) + { + if (HandlerTransition == InputHandlerTransition.Down) + InvokeCommand(key); + if (_handle) + info.MarkHandled(); + } + if (_stopRoute) + info.TruncateRoute(); + SetEventContext(info.Target, ref _eventContext, NotificationID.EventContext); + } + + protected override void OnKeyUp(UIClass ui, KeyStateInfo info) + { + Keys key = info.Key; + InputHandlerModifiers modifiers = GetModifiers(info.Modifiers); + if (key != (Keys)_key) + TranslateKey(ref key, ref modifiers); + if (!KeyMatches(key) || !ShouldHandleEvent(modifiers)) + return; + _pressing = false; + FireNotification(NotificationID.Pressing); + if (HandlerTransition == InputHandlerTransition.Up) + InvokeCommand(key); + if (_handle) + info.MarkHandled(); + if (_stopRoute) + info.TruncateRoute(); + SetEventContext(info.Target, ref _eventContext, NotificationID.EventContext); + } + + protected override void OnLoseKeyFocus(UIClass ui, KeyFocusInfo info) + { + if (!_pressing) + return; + _pressing = false; + FireNotification(NotificationID.Pressing); + } + + private bool KeyMatches(Keys candidate) + { + if (_key >= KeyHandlerKey.None) + return candidate == (Keys)_key; + return _key == KeyHandlerKey.Any && candidate != Keys.None; + } + + public static void TranslateKey(ref Keys key, ref InputHandlerModifiers modifiers) => TranslateKey(ref key, ref modifiers, Orientation.Horizontal); + + public static void TranslateKey( + ref Keys key, + ref InputHandlerModifiers modifiers, + Orientation orientation) + { + InputHandlerModifiers handlerModifiers = modifiers; + modifiers = InputHandlerModifiers.None; + switch (key) + { + case Keys.GamePadA: + case Keys.GamePadStart: + key = Keys.Enter; + break; + case Keys.GamePadB: + case Keys.GamePadBack: + key = Keys.Back; + break; + case Keys.GamePadRShoulder: + key = Keys.Tab; + break; + case Keys.GamePadLShoulder: + key = Keys.Tab; + modifiers = InputHandlerModifiers.Shift; + break; + case Keys.GamePadLTrigger: + key = Keys.PageUp; + break; + case Keys.GamePadRTrigger: + key = Keys.Next; + break; + case Keys.GamePadDPadUp: + case Keys.GamePadLThumbUp: + key = Keys.Up; + break; + case Keys.GamePadDPadDown: + case Keys.GamePadLThumbDown: + key = Keys.Down; + break; + case Keys.GamePadDPadLeft: + case Keys.GamePadLThumbLeft: + key = Keys.Left; + break; + case Keys.GamePadDPadRight: + case Keys.GamePadLThumbRight: + key = Keys.Right; + break; + case Keys.GamePadLThumbUpLeft: + key = orientation == Orientation.Vertical ? Keys.Up : Keys.Left; + break; + case Keys.GamePadLThumbUpRight: + key = orientation == Orientation.Vertical ? Keys.Up : Keys.Right; + break; + case Keys.GamePadLThumbDownRight: + key = orientation == Orientation.Vertical ? Keys.Down : Keys.Right; + break; + case Keys.GamePadLThumbDownLeft: + key = orientation == Orientation.Vertical ? Keys.Down : Keys.Left; + break; + default: + modifiers = handlerModifiers; + break; + } + } + + private void InvokeCommand(Keys key) + { + FireNotification(NotificationID.Invoked); + if (_command != null) + _command.Invoke(); + if (!TrackInvokedKeys) + return; + _invokedKeys.Add((KeyHandlerKey)key); + } + + public override string ToString() => InvariantString.Format("{0}({1})", GetType().Name, _key); + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/KeyHandlerKey.cs b/UIX/Microsoft/Iris/InputHandlers/KeyHandlerKey.cs new file mode 100644 index 0000000..7acf475 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/KeyHandlerKey.cs @@ -0,0 +1,155 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.KeyHandlerKey +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.InputHandlers +{ + internal enum KeyHandlerKey + { + Any = -1, // 0xFFFFFFFF + None = 0, + Backspace = 8, + Tab = 9, + Clear = 12, // 0x0000000C + Enter = 13, // 0x0000000D + Shift = 16, // 0x00000010 + Control = 17, // 0x00000011 + Alt = 18, // 0x00000012 + CapsLock = 20, // 0x00000014 + Escape = 27, // 0x0000001B + Space = 32, // 0x00000020 + PageUp = 33, // 0x00000021 + PageDown = 34, // 0x00000022 + End = 35, // 0x00000023 + Home = 36, // 0x00000024 + Left = 37, // 0x00000025 + Up = 38, // 0x00000026 + Right = 39, // 0x00000027 + Down = 40, // 0x00000028 + PrintScreen = 44, // 0x0000002C + Insert = 45, // 0x0000002D + Delete = 46, // 0x0000002E + D0 = 48, // 0x00000030 + D1 = 49, // 0x00000031 + D2 = 50, // 0x00000032 + D3 = 51, // 0x00000033 + D4 = 52, // 0x00000034 + D5 = 53, // 0x00000035 + D6 = 54, // 0x00000036 + D7 = 55, // 0x00000037 + D8 = 56, // 0x00000038 + D9 = 57, // 0x00000039 + A = 65, // 0x00000041 + B = 66, // 0x00000042 + C = 67, // 0x00000043 + D = 68, // 0x00000044 + E = 69, // 0x00000045 + F = 70, // 0x00000046 + G = 71, // 0x00000047 + H = 72, // 0x00000048 + I = 73, // 0x00000049 + J = 74, // 0x0000004A + K = 75, // 0x0000004B + L = 76, // 0x0000004C + M = 77, // 0x0000004D + N = 78, // 0x0000004E + O = 79, // 0x0000004F + P = 80, // 0x00000050 + Q = 81, // 0x00000051 + R = 82, // 0x00000052 + S = 83, // 0x00000053 + T = 84, // 0x00000054 + U = 85, // 0x00000055 + V = 86, // 0x00000056 + W = 87, // 0x00000057 + X = 88, // 0x00000058 + Y = 89, // 0x00000059 + Z = 90, // 0x0000005A + Apps = 93, // 0x0000005D + NumPad0 = 96, // 0x00000060 + NumPad1 = 97, // 0x00000061 + NumPad2 = 98, // 0x00000062 + NumPad3 = 99, // 0x00000063 + NumPad4 = 100, // 0x00000064 + NumPad5 = 101, // 0x00000065 + NumPad6 = 102, // 0x00000066 + NumPad7 = 103, // 0x00000067 + NumPad8 = 104, // 0x00000068 + NumPad9 = 105, // 0x00000069 + Multiply = 106, // 0x0000006A + Add = 107, // 0x0000006B + Subtract = 109, // 0x0000006D + Divide = 111, // 0x0000006F + F1 = 112, // 0x00000070 + F2 = 113, // 0x00000071 + F3 = 114, // 0x00000072 + F4 = 115, // 0x00000073 + F5 = 116, // 0x00000074 + F6 = 117, // 0x00000075 + F7 = 118, // 0x00000076 + F8 = 119, // 0x00000077 + F9 = 120, // 0x00000078 + F10 = 121, // 0x00000079 + F11 = 122, // 0x0000007A + F12 = 123, // 0x0000007B + F13 = 124, // 0x0000007C + F14 = 125, // 0x0000007D + F15 = 126, // 0x0000007E + F16 = 127, // 0x0000007F + F17 = 128, // 0x00000080 + F18 = 129, // 0x00000081 + F19 = 130, // 0x00000082 + F20 = 131, // 0x00000083 + F21 = 132, // 0x00000084 + F22 = 133, // 0x00000085 + F23 = 134, // 0x00000086 + F24 = 135, // 0x00000087 + NumLock = 144, // 0x00000090 + Semicolon = 186, // 0x000000BA + Equals = 187, // 0x000000BB + Comma = 188, // 0x000000BC + Underscore = 189, // 0x000000BD + Period = 190, // 0x000000BE + QuestionMark = 191, // 0x000000BF + Tilde = 192, // 0x000000C0 + OpenBrace = 219, // 0x000000DB + Pipe = 220, // 0x000000DC + CloseBrace = 221, // 0x000000DD + Quotes = 222, // 0x000000DE + Backslash = 226, // 0x000000E2 + GamePadA = 22528, // 0x00005800 + GamePadB = 22529, // 0x00005801 + GamePadX = 22530, // 0x00005802 + GamePadY = 22531, // 0x00005803 + GamePadRShoulder = 22532, // 0x00005804 + GamePadLShoulder = 22533, // 0x00005805 + GamePadLTrigger = 22534, // 0x00005806 + GamePadRTrigger = 22535, // 0x00005807 + GamePadDPadUp = 22544, // 0x00005810 + GamePadDPadDown = 22545, // 0x00005811 + GamePadDPadLeft = 22546, // 0x00005812 + GamePadDPadRight = 22547, // 0x00005813 + GamePadStart = 22548, // 0x00005814 + GamePadLThumbPress = 22550, // 0x00005816 + GamePadRThumbPress = 22551, // 0x00005817 + GamePadLThumbUp = 22560, // 0x00005820 + GamePadLThumbDown = 22561, // 0x00005821 + GamePadLThumbRight = 22562, // 0x00005822 + GamePadLThumbLeft = 22563, // 0x00005823 + GamePadLThumbUpLeft = 22564, // 0x00005824 + GamePadLThumbUpRight = 22565, // 0x00005825 + GamePadLThumbDownRight = 22566, // 0x00005826 + GamePadLThumbDownLeft = 22567, // 0x00005827 + GamePadRThumbUp = 22576, // 0x00005830 + GamePadRThumbDown = 22577, // 0x00005831 + GamePadRThumbRight = 22578, // 0x00005832 + GamePadRThumbLeft = 22579, // 0x00005833 + GamePadRThumbUpLeft = 22580, // 0x00005834 + GamePadRThumbUpRight = 22581, // 0x00005835 + GamePadRThumbDownRight = 22582, // 0x00005836 + GamePadRThumbDownLeft = 22583, // 0x00005837 + GamePadBack = 22597, // 0x00005845 + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/ModifierInputHandler.cs b/UIX/Microsoft/Iris/InputHandlers/ModifierInputHandler.cs new file mode 100644 index 0000000..573970d --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/ModifierInputHandler.cs @@ -0,0 +1,63 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.ModifierInputHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.InputHandlers +{ + internal class ModifierInputHandler : InputHandler + { + private InputHandlerModifiers _requiredModifiers; + private InputHandlerModifiers _disallowedModifiers; + private InputHandlerTransition _handlerTransition; + + public ModifierInputHandler() + { + _handlerTransition = InputHandlerTransition.Up; + _requiredModifiers = InputHandlerModifiers.None; + _disallowedModifiers = InputHandlerModifiers.None; + } + + public InputHandlerTransition HandlerTransition + { + get => _handlerTransition; + set + { + if (_handlerTransition == value) + return; + _handlerTransition = value; + FireNotification(NotificationID.HandlerTransition); + } + } + + public InputHandlerModifiers RequiredModifiers + { + get => _requiredModifiers; + set + { + if (_requiredModifiers == value) + return; + _requiredModifiers = value; + FireNotification(NotificationID.RequiredModifiers); + } + } + + public InputHandlerModifiers DisallowedModifiers + { + get => _disallowedModifiers; + set + { + if (_disallowedModifiers == value) + return; + _disallowedModifiers = value; + FireNotification(NotificationID.DisallowedModifiers); + } + } + + protected bool ShouldHandleEvent(InputHandlerModifiers modifiers) => (_disallowedModifiers == InputHandlerModifiers.None || !Library.Bits.TestAnyFlags((uint)modifiers, (uint)_disallowedModifiers)) && (_requiredModifiers == InputHandlerModifiers.None || Library.Bits.TestAllFlags((uint)modifiers, (uint)_requiredModifiers)); + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/MouseWheelHandler.cs b/UIX/Microsoft/Iris/InputHandlers/MouseWheelHandler.cs new file mode 100644 index 0000000..7f88bb2 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/MouseWheelHandler.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.MouseWheelHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Markup; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.InputHandlers +{ + internal class MouseWheelHandler : InputHandler + { + private bool _handle; + + public MouseWheelHandler() => _handle = true; + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + UI.MouseInteractive = true; + UI.KeyInteractive = true; + } + + public bool Handle + { + get => _handle; + set + { + if (_handle == value) + return; + _handle = value; + FireNotification(NotificationID.Handle); + } + } + + protected override void OnMouseWheel(UIClass ui, MouseWheelInfo info) + { + if (info.WheelDelta > 0) + FireNotification(NotificationID.UpInvoked); + else + FireNotification(NotificationID.DownInvoked); + if (!_handle) + return; + info.MarkHandled(); + } + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/ScrollingHandler.cs b/UIX/Microsoft/Iris/InputHandlers/ScrollingHandler.cs new file mode 100644 index 0000000..bbd223e --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/ScrollingHandler.cs @@ -0,0 +1,366 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.ScrollingHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; +using System; + +namespace Microsoft.Iris.InputHandlers +{ + internal class ScrollingHandler : InputHandler + { + private ScrollModel _model; + private bool _handleDirectionalKeysFlag; + private bool _handlePageKeysFlag; + private bool _handleHomeEndKeysFlag; + private bool _handlePageCommandsFlag; + private bool _handleMouseWheelFlag; + private bool _useFocusBehavior; + private Keys _currentCampingKey; + private int _cumulativeMouseWheelDelta; + + public ScrollingHandler() + { + _handleDirectionalKeysFlag = true; + _handlePageKeysFlag = true; + _handlePageCommandsFlag = true; + _handleHomeEndKeysFlag = true; + _handleMouseWheelFlag = true; + _useFocusBehavior = true; + HandlerStage = InputHandlerStage.Direct | InputHandlerStage.Bubbled; + } + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + if (_handleDirectionalKeysFlag || _handlePageKeysFlag || (_handleHomeEndKeysFlag || _handlePageCommandsFlag)) + UI.KeyInteractive = true; + if (!_handleMouseWheelFlag) + return; + UI.MouseInteractive = true; + } + + public bool HandleDirectionalKeys + { + get => _handleDirectionalKeysFlag; + set + { + if (_handleDirectionalKeysFlag == value) + return; + _handleDirectionalKeysFlag = value; + FireNotification(NotificationID.HandleDirectionalKeys); + } + } + + public bool HandlePageKeys + { + get => _handlePageKeysFlag; + set + { + if (_handlePageKeysFlag == value) + return; + _handlePageKeysFlag = value; + FireNotification(NotificationID.HandlePageKeys); + } + } + + public bool HandleHomeEndKeys + { + get => _handleHomeEndKeysFlag; + set + { + if (_handleHomeEndKeysFlag == value) + return; + _handleHomeEndKeysFlag = value; + FireNotification(NotificationID.HandleHomeEndKeys); + } + } + + public bool HandlePageCommands + { + get => _handlePageCommandsFlag; + set + { + if (_handlePageCommandsFlag == value) + return; + _handlePageCommandsFlag = value; + FireNotification(NotificationID.HandlePageCommands); + } + } + + public bool HandleMouseWheel + { + get => _handleMouseWheelFlag; + set + { + if (_handleMouseWheelFlag == value) + return; + _handleMouseWheelFlag = value; + FireNotification(NotificationID.HandleMouseWheel); + } + } + + public ScrollModel ScrollModel + { + get => _model; + set + { + if (_model == value) + return; + _model = value; + FireNotification(NotificationID.ScrollModel); + } + } + + public bool UseFocusBehavior + { + get => _useFocusBehavior; + set + { + if (_useFocusBehavior == value) + return; + _useFocusBehavior = value; + FireNotification(NotificationID.UseFocusBehavior); + } + } + + private bool ValidScrollModel => _model != null && _model.Enabled; + + protected override void OnGainKeyFocus(UIClass sender, KeyFocusInfo info) + { + if (!ValidScrollModel || !_useFocusBehavior) + return; + _model.NotifyFocusChange(info.Target as UIClass); + } + + protected override void OnKeyDown(UIClass ui, KeyStateInfo info) + { + if (!ValidScrollModel) + return; + if (info.Key != _currentCampingKey) + EndCamp(); + Keys key = info.Key; + InputHandlerModifiers modifiers = GetModifiers(info.Modifiers); + KeyHandler.TranslateKey(ref key, ref modifiers, Orientation); + switch (ShouldHandleKey(key)) + { + case HandleKeyPolicy.None: + return; + case HandleKeyPolicy.Up: + _model.ScrollUp(_useFocusBehavior); + break; + case HandleKeyPolicy.Down: + _model.ScrollDown(_useFocusBehavior); + break; + case HandleKeyPolicy.PageUp: + _model.PageUp(_useFocusBehavior); + break; + case HandleKeyPolicy.PageDown: + _model.PageDown(_useFocusBehavior); + break; + case HandleKeyPolicy.Home: + _model.Home(_useFocusBehavior); + break; + case HandleKeyPolicy.End: + _model.End(_useFocusBehavior); + break; + } + BeginCamp(info.Key); + info.MarkHandled(); + } + + private void BeginCamp(Keys key) + { + if (!IsCamping) + _model.BeginCamp(); + _currentCampingKey = key; + } + + private void EndCamp() + { + if (!IsCamping) + return; + _model.EndCamp(); + _currentCampingKey = Keys.None; + } + + private bool IsCamping => _currentCampingKey != Keys.None; + + protected override void OnKeyUp(UIClass ui, KeyStateInfo info) + { + if (!ValidScrollModel) + return; + if (info.Key == _currentCampingKey) + EndCamp(); + Keys key = info.Key; + InputHandlerModifiers modifiers = GetModifiers(info.Modifiers); + KeyHandler.TranslateKey(ref key, ref modifiers, Orientation); + if (ShouldHandleKey(key) == HandleKeyPolicy.None) + return; + info.MarkHandled(); + } + + protected override void OnLoseDeepKeyFocus() => EndCamp(); + + protected override void OnCommandDown(UIClass ui, KeyCommandInfo info) + { + if (!ValidScrollModel || info.Action != KeyAction.Down) + return; + switch (info.Command) + { + case CommandCode.ChannelUp: + if (!_handlePageCommandsFlag) + break; + _model.PageUp(); + info.MarkHandled(); + break; + case CommandCode.ChannelDown: + if (!_handlePageCommandsFlag) + break; + _model.PageDown(); + info.MarkHandled(); + break; + } + } + + protected override void OnCommandUp(UIClass ui, KeyCommandInfo info) + { + switch (info.Command) + { + case CommandCode.ChannelUp: + case CommandCode.ChannelDown: + if (!_handlePageCommandsFlag) + break; + info.MarkHandled(); + break; + } + } + + protected override void OnMouseWheel(UIClass ui, MouseWheelInfo info) + { + if (!_handleMouseWheelFlag || !ValidScrollModel || InputHasKeyModifiers(info)) + return; + _cumulativeMouseWheelDelta += -info.WheelDelta; + if (Math.Abs(_cumulativeMouseWheelDelta) >= 120) + { + if (_cumulativeMouseWheelDelta > 0) + _model.ScrollDown(_cumulativeMouseWheelDelta / 120); + else + _model.ScrollUp(Math.Abs(_cumulativeMouseWheelDelta / 120)); + _cumulativeMouseWheelDelta %= 120; + } + info.MarkHandled(); + } + + private ScrollingHandler.HandleKeyPolicy ShouldHandleKey(Keys key) + { + ScrollingHandler.HandleKeyPolicy handleKeyPolicy = HandleKeyPolicy.None; + switch (key) + { + case Keys.PageUp: + if (_handlePageKeysFlag) + { + handleKeyPolicy = HandleKeyPolicy.PageUp; + break; + } + break; + case Keys.Next: + if (_handlePageKeysFlag) + { + handleKeyPolicy = HandleKeyPolicy.PageDown; + break; + } + break; + case Keys.End: + if (_handleHomeEndKeysFlag) + { + handleKeyPolicy = HandleKeyPolicy.End; + break; + } + break; + case Keys.Home: + if (_handleHomeEndKeysFlag) + { + handleKeyPolicy = HandleKeyPolicy.Home; + break; + } + break; + case Keys.Left: + if (_handleDirectionalKeysFlag && Orientation == Orientation.Horizontal) + { + handleKeyPolicy = UI.Zone.Session.IsRtl ? HandleKeyPolicy.Down : HandleKeyPolicy.Up; + break; + } + break; + case Keys.Up: + if (_handleDirectionalKeysFlag && Orientation == Orientation.Vertical) + { + handleKeyPolicy = HandleKeyPolicy.Up; + break; + } + break; + case Keys.Right: + if (_handleDirectionalKeysFlag && Orientation == Orientation.Horizontal) + { + handleKeyPolicy = UI.Zone.Session.IsRtl ? HandleKeyPolicy.Up : HandleKeyPolicy.Down; + break; + } + break; + case Keys.Down: + if (_handleDirectionalKeysFlag && Orientation == Orientation.Vertical) + { + handleKeyPolicy = HandleKeyPolicy.Down; + break; + } + break; + } + return handleKeyPolicy; + } + + private Orientation Orientation + { + get + { + Orientation orientation = Orientation.Horizontal; + if (_model.TargetViewItem is Scroller targetViewItem) + orientation = targetViewItem.Orientation; + return orientation; + } + } + + private bool InputHasKeyModifiers(InputInfo info) + { + InputModifiers inputModifiers = InputModifiers.None; + switch (info) + { + case KeyStateInfo _: + inputModifiers = ((KeyActionInfo)info).Modifiers; + break; + case MouseActionInfo _: + inputModifiers = ((MouseActionInfo)info).Modifiers; + break; + } + return (inputModifiers & InputModifiers.AllKeys) != InputModifiers.None; + } + + private enum HandleKeyPolicy + { + None, + Up, + Down, + PageUp, + PageDown, + Home, + End, + } + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/ShortcutHandler.cs b/UIX/Microsoft/Iris/InputHandlers/ShortcutHandler.cs new file mode 100644 index 0000000..077395e --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/ShortcutHandler.cs @@ -0,0 +1,94 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.ShortcutHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.InputHandlers +{ + internal class ShortcutHandler : InputHandler + { + private ShortcutHandlerCommand _shortcut; + private IUICommand _command; + private bool _handle; + + public ShortcutHandler() => _handle = true; + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + UI.KeyInteractive = true; + } + + public ShortcutHandlerCommand Shortcut + { + get => _shortcut; + set + { + if (_shortcut == value) + return; + _shortcut = value; + FireNotification(NotificationID.Shortcut); + } + } + + public IUICommand Command + { + get => _command; + set + { + if (_command == value) + return; + _command = value; + FireNotification(NotificationID.Command); + } + } + + public bool Handle + { + get => _handle; + set + { + if (_handle == value) + return; + _handle = value; + FireNotification(NotificationID.Handle); + } + } + + protected override void OnCommandDown(UIClass ui, KeyCommandInfo info) + { + if (info.Command != (CommandCode)_shortcut) + return; + InvokeCommand(); + if (!_handle) + return; + info.MarkHandled(); + } + + protected override void OnCommandUp(UIClass ui, KeyCommandInfo info) + { + if (info.Command != (CommandCode)_shortcut || !_handle) + return; + info.MarkHandled(); + } + + private void InvokeCommand() + { + FireNotification(NotificationID.Invoked); + if (_command == null) + return; + _command.Invoke(); + } + + public override string ToString() => InvariantString.Format("{0}({1})", GetType().Name, _shortcut); + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/ShortcutHandlerCommand.cs b/UIX/Microsoft/Iris/InputHandlers/ShortcutHandlerCommand.cs new file mode 100644 index 0000000..13dc597 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/ShortcutHandlerCommand.cs @@ -0,0 +1,41 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.ShortcutHandlerCommand +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.InputHandlers +{ + internal enum ShortcutHandlerCommand + { + None = 0, + ChannelUp = 2, + PageUp = 2, + ChannelDown = 3, + PageDown = 3, + Play = 4, + Pause = 5, + Record = 6, + FastForward = 7, + Rewind = 8, + SkipForward = 9, + SkipBack = 10, // 0x0000000A + Stop = 11, // 0x0000000B + Back = 16, // 0x00000010 + Clear = 26, // 0x0000001A + PlayPause = 30, // 0x0000001E + Enter = 36, // 0x00000024 + OEMExtensibility0 = 73, // 0x00000049 + OEMExtensibility1 = 74, // 0x0000004A + OEMExtensibility2 = 75, // 0x0000004B + OEMExtensibility3 = 76, // 0x0000004C + OEMExtensibility4 = 77, // 0x0000004D + OEMExtensibility5 = 78, // 0x0000004E + OEMExtensibility6 = 79, // 0x0000004F + OEMExtensibility7 = 80, // 0x00000050 + OEMExtensibility8 = 81, // 0x00000051 + OEMExtensibility9 = 82, // 0x00000052 + OEMExtensibility10 = 83, // 0x00000053 + OEMExtensibility11 = 84, // 0x00000054 + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/TextEditingHandler.cs b/UIX/Microsoft/Iris/InputHandlers/TextEditingHandler.cs new file mode 100644 index 0000000..8c2dc40 --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/TextEditingHandler.cs @@ -0,0 +1,1113 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.TextEditingHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Input; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; +using System; + +namespace Microsoft.Iris.InputHandlers +{ + internal class TextEditingHandler : + InputHandler, + IRichTextCallbacks, + ITextScrollModelCallback, + IImeCallbacks + { + private const uint WM_LBUTTONDOWN = 513; + private const uint WM_LBUTTONUP = 514; + private TextEditingHandler.TextEditingCommand _copyCommand; + private TextEditingHandler.TextEditingCommand _cutCommand; + private TextEditingHandler.TextEditingCommand _deleteCommand; + private TextEditingHandler.TextPasteCommand _pasteCommand; + private TextEditingHandler.TextEditingCommand _selectAllCommand; + private TextEditingHandler.TextEditingCommand _undoCommand; + private uint _bits; + private Range _selection; + private Point _inputOffset; + private int _savedMouseYPositionToWorkAroundRichEditBug; + private EditableTextData _editData; + private EventHandler _maxLengthChangedHandler; + private EventHandler _readOnlyChangedHandler; + private EventHandler _valueChangedHandler; + private EventHandler _activationStateHandler; + private Form _activationStateNotifier; + private Text _textDisplay; + private CaretInfo _caretInfo; + private RichText _editControl; + private CursorID _cursor; + private TextScrollModel.State _pendingHorizontalScrollState; + private TextScrollModel.State _pendingVerticalScrollState; + private TextScrollModel _horizontalScrollModel; + private TextScrollModel _verticalScrollModel; + private SimpleCallback _updateScrollbars; + private InputInfo _pendingPointerDown; + private Color _linkColor; + private string _linkClickedParameter; + private bool _InImeMode; + private uint _ImeCallbackToken; + + public TextEditingHandler() + { + _caretInfo = new CaretInfo(); + _editControl = new RichText(true, this); + _maxLengthChangedHandler = new EventHandler(OnEditableTextMaxLengthChanged); + _readOnlyChangedHandler = new EventHandler(OnEditableTextReadOnlyChanged); + _valueChangedHandler = new EventHandler(OnEditableTextValueChanged); + _activationStateHandler = new EventHandler(OnActivationChanged); + SetBit(Bits.AcceptsEnter); + } + + protected override void OnDispose() + { + base.OnDispose(); + RemoveEditableTextEventHandlers(); + UnregisterImeMessageHandler(); + if (_activationStateNotifier != null) + UpdateActivationStateHandler(false); + HorizontalScrollModel = null; + VerticalScrollModel = null; + _editControl.Dispose(); + } + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + UI.MouseInteractive = true; + UI.KeyInteractive = true; + } + + public override void OnZoneAttached() + { + if (!UI.DirectKeyFocus) + return; + UpdateActivationStateHandler(true); + } + + private void OnActivationChanged(object sender, EventArgs ea) + { + WindowIsActivated = _activationStateNotifier.ActivationState; + UpdateCaretVisibility(); + } + + public EditableTextData EditableTextData + { + get => _editData; + set + { + if (_editData == value) + return; + RemoveEditableTextEventHandlers(); + _editData = value; + if (_editData != null) + { + AddEditableTextEventHandlers(); + UpdateMaxLengthOnRichEdit(); + UpdateReadOnlyOnRichEdit(); + UpdateContentOnRichEdit(); + } + FireThreadSafeNotification(NotificationID.EditableTextData); + } + } + + private void RemoveEditableTextEventHandlers() + { + if (_editData == null) + return; + _editData.MaxLengthChanged -= _maxLengthChangedHandler; + _editData.ReadOnlyChanged -= _readOnlyChangedHandler; + _editData.ValueChanged -= _valueChangedHandler; + } + + private void AddEditableTextEventHandlers() + { + _editData.MaxLengthChanged += _maxLengthChangedHandler; + _editData.ReadOnlyChanged += _readOnlyChangedHandler; + _editData.ValueChanged += _valueChangedHandler; + } + + private void UnregisterImeMessageHandler() => RendererApi.IFC(NativeApi.SpUnregisterImeCallbacks(_ImeCallbackToken)); + + private void OnEditableTextMaxLengthChanged(object sender, EventArgs unused) => UpdateMaxLengthOnRichEdit(); + + private void OnEditableTextReadOnlyChanged(object sender, EventArgs unused) => UpdateReadOnlyOnRichEdit(); + + private void OnEditableTextValueChanged(object sender, EventArgs unused) + { + if (InsideValueChangeOnEditableTextData) + return; + UpdateContentOnRichEdit(); + } + + private void UpdateContentOnRichEdit() + { + if (_editData == null) + return; + InsideContentChangeOnRichEdit = true; + _editControl.Content = _editData.Value; + if (_textDisplay != null) + _textDisplay.MarkScaleDirty(); + InsideContentChangeOnRichEdit = false; + } + + private void UpdateReadOnlyOnRichEdit() + { + _editControl.ReadOnly = _editData.ReadOnly; + UpdateSelectionAndReadOnlyCommands(); + } + + private void UpdateMaxLengthOnRichEdit() => _editControl.MaxLength = _editData.MaxLength; + + public Text TextDisplay + { + get => _textDisplay; + set + { + if (_textDisplay == value) + return; + LayoutCompleteEventHandler completeEventHandler = new LayoutCompleteEventHandler(TextLayoutComplete); + if (_textDisplay != null) + { + _textDisplay.ExternalRasterizer = null; + _textDisplay.ExternalEditingHandler = null; + _textDisplay.LayoutComplete -= completeEventHandler; + } + _textDisplay = value; + if (_textDisplay != null) + { + _textDisplay.ExternalRasterizer = _editControl; + _textDisplay.ExternalEditingHandler = this; + _textDisplay.OnDisplayedContentChange(); + _textDisplay.LayoutComplete += completeEventHandler; + InputOffsetDirty = true; + } + FireThreadSafeNotification(NotificationID.TextDisplay); + } + } + + private void TextLayoutComplete(object sender) => InputOffsetDirty = true; + + private void FireTypingInputRejectedEvent() => FireThreadSafeNotification(NotificationID.TypingInputRejected); + + public bool DetectUrls + { + get => GetBit(Bits.DetectUrls); + set + { + if (!ChangeBit(Bits.DetectUrls, value)) + return; + _editControl.DetectUrls = value; + FireThreadSafeNotification(NotificationID.DetectUrls); + } + } + + public Color LinkColor + { + get => _linkColor; + set + { + if (!(_linkColor != value)) + return; + _linkColor = value; + FireThreadSafeNotification(NotificationID.LinkColor); + } + } + + private void FireLinkClicked() => FireThreadSafeNotification(NotificationID.LinkClicked); + + public string LinkClickedParameter + { + get => _linkClickedParameter; + private set + { + if (!(_linkClickedParameter != value)) + return; + _linkClickedParameter = value; + FireThreadSafeNotification(NotificationID.LinkClickedParameter); + } + } + + HRESULT IRichTextCallbacks.SetCursor(EditCursorType type) + { + CursorID cursorId = CursorID.NotSpecified; + switch (type) + { + case EditCursorType.IBeam: + cursorId = CursorID.IBeam; + break; + } + if (cursorId != _cursor) + { + _cursor = cursorId; + UpdateCursor(); + } + return new HRESULT(0); + } + + internal override CursorID GetCursor() => _cursor; + + private bool IgnoreReadOnlyChar(char character) => character == '\r' || character == '\t'; + + protected override void OnKeyDown(UIClass ui, KeyStateInfo info) + { + bool flag = ForwardKeyStateChange(info); + switch (info.Key) + { + case Keys.Back: + if (_editData.ReadOnly) + FireTypingInputRejectedEvent(); + info.MarkHandled(); + break; + case Keys.Tab: + if (flag) + info.MarkHandled(); + HandledTabKeyDown = info.Handled; + break; + case Keys.Enter: + if (!info.Handled && AcceptsEnter && (info.Modifiers == InputModifiers.None && !_editData.ReadOnly)) + { + _editData.Submit(); + info.MarkHandled(); + } + HandledEnterKeyDown = info.Handled; + break; + } + } + + protected override void OnKeyCharacter(UIClass ui, KeyCharacterInfo info) + { + if (ForwardKeyCharacter(info) && !info.Handled && (_editData.ReadOnly && !IgnoreReadOnlyChar(info.Character))) + FireTypingInputRejectedEvent(); + switch (info.Character) + { + case '\b': + info.MarkHandled(); + break; + case '\t': + if (!HandledTabKeyDown) + break; + info.MarkHandled(); + break; + case '\r': + if (!HandledEnterKeyDown) + break; + info.MarkHandled(); + break; + } + } + + protected override void OnKeyUp(UIClass ui, KeyStateInfo info) + { + ForwardKeyStateChange(info); + switch (info.Key) + { + case Keys.Back: + info.MarkHandled(); + break; + case Keys.Tab: + if (!HandledTabKeyDown) + break; + info.MarkHandled(); + HandledTabKeyDown = false; + break; + case Keys.Enter: + if (!HandledEnterKeyDown) + break; + info.MarkHandled(); + HandledEnterKeyDown = false; + break; + } + } + + private bool ForwardKeyToRichEdit(KeyStateInfo info) + { + bool flag = true; + switch (info.Key) + { + case Keys.Tab: + flag = info.Action != KeyAction.Down ? HandledTabKeyDown : AcceptsTab; + break; + case Keys.Enter: + flag = info.Action != KeyAction.Down ? HandledEnterKeyDown : AcceptsEnter; + break; + } + return flag; + } + + private bool ForwardKeyCharacterToRichEdit(KeyCharacterInfo info) + { + bool flag = true; + switch (info.Character) + { + case '\t': + flag = HandledTabKeyDown; + break; + case '\r': + flag = HandledEnterKeyDown; + break; + } + return flag; + } + + private bool ForwardKeyStateChange(KeyStateInfo info) + { + if (!ForwardKeyToRichEdit(info)) + return false; + if (_editControl.ForwardKeyStateNotification(info.NativeMessageID, (int)info.Key, info.ScanCode, (int)info.RepeatCount, (uint)info.Modifiers, info.KeyboardFlags)) + info.MarkHandled(); + return true; + } + + private bool ForwardKeyCharacter(KeyCharacterInfo info) + { + if (!ForwardKeyCharacterToRichEdit(info)) + return false; + if (_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(this, out _ImeCallbackToken)); + _editControl.NotifyOfFocusChange(true); + if (Overtype) + SelectAll(); + DeliverPendingPointerDown(); + if (UI.IsZoned) + UpdateActivationStateHandler(true); + if (!_textDisplay.UsePasswordMask && !_textDisplay.DisableIme) + return; + RendererApi.IFC(NativeApi.SpPostDeferredImeMessage(1032U, new UIntPtr(_ImeCallbackToken), UIntPtr.Zero)); + } + + protected override void OnLoseKeyFocus(UIClass ui, KeyFocusInfo info) + { + _editControl.NotifyOfFocusChange(false); + HandledEnterKeyDown = false; + HandledTabKeyDown = false; + if (UI.IsZoned) + UpdateActivationStateHandler(false); + ClearPendingPointerDown(); + RendererApi.IFC(NativeApi.SpUnregisterImeCallbacks(_ImeCallbackToken)); + } + + protected override void OnLoseMouseFocus(UIClass ui, MouseFocusInfo info) + { + } + + private void UpdateActivationStateHandler(bool add) + { + if (add) + { + _activationStateNotifier = UI.Zone.Form; + _activationStateNotifier.ActivationChange += _activationStateHandler; + OnActivationChanged(null, EventArgs.Empty); + } + else + { + _activationStateNotifier.ActivationChange -= _activationStateHandler; + _activationStateNotifier = null; + } + } + + protected override void OnMouseDoubleClick(UIClass ui, MouseButtonInfo info) => ForwardMouseInput(info); + + protected override void OnMouseMove(UIClass ui, MouseMoveInfo info) => ForwardMouseInput(info); + + protected override void OnMousePrimaryDown(UIClass ui, MouseButtonInfo info) + { + _pendingPointerDown = info; + info.Lock(); + if (!UI.DirectKeyFocus && HandlerStage == InputHandlerStage.Direct && UI.KeyFocusOnMouseDown) + return; + DeliverPendingPointerDown(); + } + + private void DeliverPendingPointerDown() + { + if (_pendingPointerDown == null) + return; + MousePrimaryDown = true; + MouseButtonInfo pendingPointerDown = (MouseButtonInfo)_pendingPointerDown; + _savedMouseYPositionToWorkAroundRichEditBug = pendingPointerDown.Y; + ForwardMouseInput(pendingPointerDown); + ClearPendingPointerDown(); + } + + private void ClearPendingPointerDown() + { + if (_pendingPointerDown == null) + return; + _pendingPointerDown.Unlock(); + _pendingPointerDown = null; + } + + protected override void OnMousePrimaryUp(UIClass ui, MouseButtonInfo info) + { + MousePrimaryDown = false; + ForwardMouseInput(info); + } + + protected override void OnMouseSecondaryDown(UIClass ui, MouseButtonInfo info) => ForwardMouseInput(info); + + protected override void OnMouseSecondaryUp(UIClass ui, MouseButtonInfo info) => ForwardMouseInput(info); + + protected override void OnMouseWheel(UIClass ui, MouseWheelInfo info) + { + if (!_textDisplay.WordWrap) + return; + ForwardMouseInput(info); + } + + private bool ForwardMouseInput( + uint nativeMessageID, + InputModifiers modifiers, + MouseButtons button, + int inputX, + int inputY, + int wheelDelta) + { + if (InputOffsetDirty) + { + Vector3 parentOffsetPxlVector; + ViewItem.GetAccumulatedOffsetAndScale(_textDisplay, UI.RootItem, out parentOffsetPxlVector, out Vector3 _); + _inputOffset = new Point((int)Math.Floor(parentOffsetPxlVector.X), (int)Math.Floor(parentOffsetPxlVector.Y)); + InputOffsetDirty = false; + } + int x = inputX - _inputOffset.X; + int y = inputY - _inputOffset.Y; + if (MousePrimaryDown && _textDisplay != null && !_textDisplay.WordWrap) + y = _savedMouseYPositionToWorkAroundRichEditBug - _inputOffset.Y; + return _editControl.ForwardMouseInput(nativeMessageID, (uint)modifiers, (int)button, x, y, wheelDelta); + } + + private void ForwardMouseInput(MouseActionInfo info) + { + if (!ForwardMouseInput(info.NativeMessageID, info.Modifiers, info.Button, info.X, info.Y, info.WheelDelta)) + return; + info.MarkHandled(); + } + + public bool Overtype + { + get => GetBit(Bits.Overtype); + set + { + if (!ChangeBit(Bits.Overtype, value)) + return; + FireThreadSafeNotification(NotificationID.Overtype); + } + } + + public bool AcceptsTab + { + get => GetBit(Bits.AcceptsTab); + set + { + if (!ChangeBit(Bits.AcceptsTab, value)) + return; + FireThreadSafeNotification(NotificationID.AcceptsTab); + } + } + + public bool AcceptsEnter + { + get => GetBit(Bits.AcceptsEnter); + set + { + if (!ChangeBit(Bits.AcceptsEnter, value)) + return; + FireThreadSafeNotification(NotificationID.AcceptsEnter); + } + } + + public bool WordWrap + { + set + { + if (!ChangeBit(Bits.WordWrap, value)) + return; + _editControl.SetWordWrap(value); + if (!value) + return; + UpdateContentOnRichEdit(); + } + } + + public CaretInfo CaretInfo => _caretInfo; + + private void CreateCommands() + { + if (GetBit(Bits.CommandsCreated)) + return; + SetBit(Bits.CommandsCreated); + _undoCommand = new TextEditingHandler.TextEditingCommand(new SimpleCallback(_editControl.Undo)); + _cutCommand = new TextEditingHandler.TextEditingCommand(new SimpleCallback(_editControl.Cut)); + _copyCommand = new TextEditingHandler.TextEditingCommand(new SimpleCallback(_editControl.Copy)); + _pasteCommand = new TextEditingHandler.TextPasteCommand(new SimpleCallback(_editControl.Paste)); + _deleteCommand = new TextEditingHandler.TextEditingCommand(new SimpleCallback(_editControl.Delete)); + _selectAllCommand = new TextEditingHandler.TextEditingCommand(new SimpleCallback(SelectAll)); + UpdateSelectionAndReadOnlyCommands(); + UpdateTextBasedCommandAvailability(); + } + + public IUICommand UndoCommand + { + get + { + CreateCommands(); + return _undoCommand; + } + } + + public void Undo() => _editControl.Undo(); + + public IUICommand CutCommand + { + get + { + CreateCommands(); + return _cutCommand; + } + } + + public void Cut() => _editControl.Cut(); + + public IUICommand CopyCommand + { + get + { + CreateCommands(); + return _copyCommand; + } + } + + public void Copy() => _editControl.Copy(); + + public IUICommand PasteCommand + { + get + { + CreateCommands(); + return _pasteCommand; + } + } + + public void Paste() => _editControl.Paste(); + + public IUICommand DeleteCommand + { + get + { + CreateCommands(); + return _deleteCommand; + } + } + + public void Delete() => _editControl.Delete(); + + public IUICommand SelectAllCommand + { + get + { + CreateCommands(); + return _selectAllCommand; + } + } + + public void SelectAll() + { + string str = _editData != null ? _editData.Value : null; + if (string.IsNullOrEmpty(str)) + return; + SelectionRange = new Range(0, str.Length); + } + + public Range SelectionRange + { + get => _selection; + set + { + if (_selection.IsEqual(value)) + return; + _editControl.SetSelectionRange(value.Begin, value.End); + } + } + + private void UpdateTextBasedCommandAvailability() + { + _undoCommand.Available = _editControl.CanUndo; + _selectAllCommand.Available = _editData != null && !string.IsNullOrEmpty(_editData.Value); + } + + private void UpdateSelectionAndReadOnlyCommands() + { + if (!GetBit(Bits.CommandsCreated)) + return; + bool flag1 = !_selection.IsEmpty; + bool flag2 = _editData == null || _editData.ReadOnly; + _cutCommand.Available = flag1 && !flag2; + _copyCommand.Available = flag1; + _deleteCommand.Available = flag1 && !flag2; + _pasteCommand.TextIsReadOnly = flag2; + } + + HRESULT IRichTextCallbacks.TextChanged() + { + if (!Application.IsApplicationThread) + { + Application.DeferredInvoke(args => ((IRichTextCallbacks)args).TextChanged(), this, DeferredInvokePriority.Normal); + return new HRESULT(0); + } + if (GetBit(Bits.CommandsCreated)) + UpdateTextBasedCommandAvailability(); + if (_editData != null && !InsideContentChangeOnRichEdit) + { + InsideValueChangeOnEditableTextData = true; + _editData.Value = _editControl.SimpleContent; + InsideValueChangeOnEditableTextData = false; + } + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.InvalidateContent() + { + if (!Application.IsApplicationThread) + { + Application.DeferredInvoke(args => ((IRichTextCallbacks)args).InvalidateContent(), this, DeferredInvokePriority.Normal); + return new HRESULT(0); + } + if (_textDisplay != null) + _textDisplay.OnDisplayedContentChange(); + RefreshCaretPosition(); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.SelectionChanged( + int selectionStart, + int selectionEnd) + { + _selection = new Range(selectionStart, selectionEnd); + FireThreadSafeNotification(NotificationID.SelectionRange); + UpdateSelectionAndReadOnlyCommands(); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.MaxLengthExceeded() + { + FireTypingInputRejectedEvent(); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.SetTimer(uint id, uint timeout) + { + _editControl.SetTimer(id, timeout); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.KillTimer(uint id) + { + _editControl.KillTimer(id); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.CreateCaret(int width, int height) + { + _caretInfo.CreateCaret(new Size(width, height)); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.SetCaretPos(int x, int y) + { + _caretInfo.SetCaretPosition(new Point(x, y)); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.ShowCaret(bool visible) + { + RichEditCaretVisible = visible; + UpdateCaretVisibility(); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.ClientToWindow(Point pt, out Point ppt) + { + ppt = _textDisplay == null ? new Point(0, 0) : _textDisplay.ClientToWindow(pt); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.ClientToScreen(Point pt, out Point ppt) + { + ppt = _textDisplay.ClientToScreen(pt); + return new HRESULT(0); + } + + HRESULT IRichTextCallbacks.LinkClicked(int start, int end) + { + string str = _editData != null ? _editData.Value : string.Empty; + if (string.IsNullOrEmpty(str)) + { + LinkClickedParameter = string.Empty; + } + else + { + end = end >= 0 ? Math.Min(str.Length, end) : str.Length; + start = Math.Min(start, end); + LinkClickedParameter = str.Substring(start, end - start); + } + FireLinkClicked(); + return new HRESULT(0); + } + + HRESULT IImeCallbacks.OnImeMessageReceived( + uint message, + UIntPtr wParam, + UIntPtr lParam) + { + switch (message) + { + case 269: + InImeCompositionMode = true; + break; + case 270: + InImeCompositionMode = false; + break; + } + return _editControl.ForwardImeMessage(message, wParam, lParam); + } + + public bool InImeCompositionMode + { + get => _InImeMode; + set + { + if (_InImeMode == value) + return; + CaretInfo.IgnoreIdealWidth = value; + _InImeMode = value; + FireThreadSafeNotification(NotificationID.InImeCompositionMode); + } + } + + HRESULT IRichTextCallbacks.SetScrollRange( + int whichBarInt, + int minPosition, + int extent, + int viewExtent, + int scrollPosition) + { + if (whichBarInt == 1 && _verticalScrollModel != null) + { + SetScrollRange(ref _pendingVerticalScrollState, minPosition, extent, viewExtent, scrollPosition); + ScheduleScrollbarUpdate(true); + } + else if (_horizontalScrollModel != null) + { + SetScrollRange(ref _pendingHorizontalScrollState, minPosition, extent, viewExtent, scrollPosition); + ScheduleScrollbarUpdate(false); + } + return new HRESULT(0); + } + + private void SetScrollRange( + ref TextScrollModel.State state, + int minPosition, + int extent, + int viewExtent, + int scrollAmount) + { + state.Min = minPosition; + state.Extent = extent; + state.ViewExtent = viewExtent; + state.ScrollAmount = scrollAmount; + } + + private bool IsVerticalScrollbar(ScrollbarType whichBar) => whichBar == ScrollbarType.Vertical || whichBar == ScrollbarType.Both; + + private bool IsHorizontalScrollbar(ScrollbarType whichBar) => whichBar == ScrollbarType.Horizontal || whichBar == ScrollbarType.Both; + + HRESULT IRichTextCallbacks.EnableScrollbar( + int whichBarInt, + ScrollbarEnableFlags flags) + { + ScrollbarType whichBar = (ScrollbarType)whichBarInt; + if (IsVerticalScrollbar(whichBar) && _verticalScrollModel != null) + { + EnableScrollbar(ref _pendingVerticalScrollState, flags); + ScheduleScrollbarUpdate(true); + } + if (IsHorizontalScrollbar(whichBar) && _horizontalScrollModel != null) + { + EnableScrollbar(ref _pendingHorizontalScrollState, flags); + ScheduleScrollbarUpdate(false); + } + return new HRESULT(0); + } + + private void EnableScrollbar(ref TextScrollModel.State state, ScrollbarEnableFlags flags) + { + switch (flags) + { + case ScrollbarEnableFlags.EnableBoth: + state.CanScrollUp = true; + state.CanScrollDown = true; + break; + case ScrollbarEnableFlags.DisableNear: + state.CanScrollUp = false; + state.CanScrollDown = true; + break; + case ScrollbarEnableFlags.DisableFar: + state.CanScrollUp = true; + state.CanScrollDown = false; + break; + case ScrollbarEnableFlags.DisableBoth: + state.CanScrollUp = false; + state.CanScrollDown = false; + break; + } + } + + private void ScheduleScrollbarUpdate(bool vertical) + { + bool flag = !GetBit(Bits.PendingVerticalScrollbarUpdate) && !GetBit(Bits.PendingHorizontalScrollbarUpdate); + if (vertical) + SetBit(Bits.PendingVerticalScrollbarUpdate); + else + SetBit(Bits.PendingHorizontalScrollbarUpdate); + if (!flag) + return; + if (_updateScrollbars == null) + _updateScrollbars = new SimpleCallback(UpdateScrollbars); + DeferredCall.Post(DispatchPriority.Normal, _updateScrollbars); + } + + private void UpdateScrollbars() + { + if (GetBit(Bits.PendingVerticalScrollbarUpdate)) + { + ClearBit(Bits.PendingVerticalScrollbarUpdate); + _verticalScrollModel.UpdateState(_pendingVerticalScrollState); + _pendingVerticalScrollState = new TextScrollModel.State(); + } + if (!GetBit(Bits.PendingHorizontalScrollbarUpdate)) + return; + ClearBit(Bits.PendingHorizontalScrollbarUpdate); + _horizontalScrollModel.UpdateState(_pendingHorizontalScrollState); + _pendingHorizontalScrollState = new TextScrollModel.State(); + } + + public TextScrollModel HorizontalScrollModel + { + get + { + if (_horizontalScrollModel == null) + StoreScrollModel(ref _horizontalScrollModel, new TextScrollModel()); + return _horizontalScrollModel; + } + set + { + if (_horizontalScrollModel == value) + return; + StoreScrollModel(ref _horizontalScrollModel, value); + FireThreadSafeNotification(NotificationID.HorizontalScrollModel); + } + } + + public TextScrollModel VerticalScrollModel + { + get + { + if (_verticalScrollModel == null) + StoreScrollModel(ref _verticalScrollModel, new TextScrollModel()); + return _verticalScrollModel; + } + set + { + if (_verticalScrollModel == value) + return; + StoreScrollModel(ref _verticalScrollModel, value); + FireThreadSafeNotification(NotificationID.VerticalScrollModel); + } + } + + private void StoreScrollModel(ref TextScrollModel storage, TextScrollModel newDude) + { + if (storage != null) + storage.DetachCallbacks(); + storage = newDude; + if (storage != null) + storage.AttachCallbacks(this); + _editControl.SetScrollbars(_horizontalScrollModel != null, _verticalScrollModel != null); + } + + private ScrollbarType WhichScrollbar(TextScrollModel who) => who != _verticalScrollModel ? ScrollbarType.Horizontal : ScrollbarType.Vertical; + + void ITextScrollModelCallback.ScrollUp(TextScrollModel who) => _editControl.ScrollUp(WhichScrollbar(who)); + + void ITextScrollModelCallback.ScrollDown(TextScrollModel who) => _editControl.ScrollDown(WhichScrollbar(who)); + + void ITextScrollModelCallback.PageUp(TextScrollModel who) => _editControl.PageUp(WhichScrollbar(who)); + + void ITextScrollModelCallback.PageDown(TextScrollModel who) => _editControl.PageDown(WhichScrollbar(who)); + + void ITextScrollModelCallback.ScrollToPosition( + TextScrollModel who, + int whereTo) + { + _editControl.ScrollToPosition(WhichScrollbar(who), whereTo); + } + + private void UpdateCaretVisibility() => CaretInfo.SetVisible(RichEditCaretVisible && WindowIsActivated); + + private void RefreshCaretPosition() + { + if (!CaretInfo.Visible || MousePrimaryDown || _editControl == null) + return; + _editControl.NotifyOfFocusChange(true); + } + + private bool HandledTabKeyDown + { + get => GetBit(Bits.HandledTabKeyDown); + set => SetBit(Bits.HandledTabKeyDown, value); + } + + private bool HandledEnterKeyDown + { + get => GetBit(Bits.HandledEnterKeyDown); + set => SetBit(Bits.HandledEnterKeyDown, value); + } + + private bool InputOffsetDirty + { + get => GetBit(Bits.InputOffsetDirty); + set => SetBit(Bits.InputOffsetDirty, value); + } + + private bool MousePrimaryDown + { + get => GetBit(Bits.MousePrimaryDown); + set => SetBit(Bits.MousePrimaryDown, value); + } + + private bool InsideValueChangeOnEditableTextData + { + get => GetBit(Bits.InsideValueChangeOnEditableTextData); + set => SetBit(Bits.InsideValueChangeOnEditableTextData, value); + } + + private bool InsideContentChangeOnRichEdit + { + get => GetBit(Bits.InsideContentChangeOnRichEdit); + set => SetBit(Bits.InsideContentChangeOnRichEdit, value); + } + + private bool RichEditCaretVisible + { + get => GetBit(Bits.RichEditCaretVisible); + set => SetBit(Bits.RichEditCaretVisible, value); + } + + private bool WindowIsActivated + { + get => GetBit(Bits.WindowIsActivated); + set => SetBit(Bits.WindowIsActivated, value); + } + + private bool GetBit(TextEditingHandler.Bits lookupBit) => ((TextEditingHandler.Bits)_bits & lookupBit) != 0; + + private void SetBit(TextEditingHandler.Bits changeBit) + { + TextEditingHandler textEditingHandler = this; + textEditingHandler._bits = (uint)((TextEditingHandler.Bits)textEditingHandler._bits | changeBit); + } + + private void SetBit(TextEditingHandler.Bits changeBit, bool value) => _bits = value ? (uint)((TextEditingHandler.Bits)_bits | changeBit) : (uint)((TextEditingHandler.Bits)_bits & ~changeBit); + + private void ClearBit(TextEditingHandler.Bits changeBit) + { + TextEditingHandler textEditingHandler = this; + textEditingHandler._bits = (uint)((TextEditingHandler.Bits)textEditingHandler._bits & ~changeBit); + } + + private bool ChangeBit(TextEditingHandler.Bits changeBit, bool value) + { + uint num = value ? (uint)((TextEditingHandler.Bits)_bits | changeBit) : (uint)((TextEditingHandler.Bits)_bits & ~changeBit); + bool flag = (int)num != (int)_bits; + if (flag) + _bits = num; + return flag; + } + + private enum Bits + { + AcceptsTab = 1, + AcceptsEnter = 2, + HandledTabKeyDown = 4, + HandledEnterKeyDown = 16, // 0x00000010 + InputOffsetDirty = 32, // 0x00000020 + MousePrimaryDown = 64, // 0x00000040 + Overtype = 128, // 0x00000080 + InsideValueChangeOnEditableTextData = 256, // 0x00000100 + InsideContentChangeOnRichEdit = 512, // 0x00000200 + RichEditCaretVisible = 1024, // 0x00000400 + WindowIsActivated = 2048, // 0x00000800 + WordWrap = 4096, // 0x00001000 + CommandsCreated = 8192, // 0x00002000 + PendingHorizontalScrollbarUpdate = 16384, // 0x00004000 + PendingVerticalScrollbarUpdate = 32768, // 0x00008000 + DetectUrls = 65536, // 0x00010000 + } + + private class TextEditingCommand : UICommand + { + private SimpleCallback _onInvoked; + + public TextEditingCommand(SimpleCallback onInvoked) => _onInvoked = onInvoked; + + protected override void OnInvoked() + { + base.OnInvoked(); + _onInvoked(); + } + } + + private class TextPasteCommand : TextEditingHandler.TextEditingCommand, IUICommand + { + private bool _isReadOnly; + + public TextPasteCommand(SimpleCallback onInvoked) + : base(onInvoked) + { + } + + bool IUICommand.Available + { + get => Clipboard.ContainsText() && !_isReadOnly; + set + { + } + } + + public bool TextIsReadOnly + { + get => _isReadOnly; + set => _isReadOnly = value; + } + } + } +} diff --git a/UIX/Microsoft/Iris/InputHandlers/TypingHandler.cs b/UIX/Microsoft/Iris/InputHandlers/TypingHandler.cs new file mode 100644 index 0000000..f542dba --- /dev/null +++ b/UIX/Microsoft/Iris/InputHandlers/TypingHandler.cs @@ -0,0 +1,224 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InputHandlers.TypingHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.InputHandlers +{ + internal class TypingHandler : InputHandler + { + private EditableTextData _edit; + private bool _submitOnEnter; + private bool _treatEscapeAsBackspace; + private bool _handlingBackspaceFlag; + private bool _handlingDeleteFlag; + + protected override void ConfigureInteractivity() + { + base.ConfigureInteractivity(); + if (!HandleDirect) + return; + UI.MouseInteractive = true; + UI.KeyInteractive = true; + } + + public bool SubmitOnEnter + { + get => _submitOnEnter; + set + { + if (_submitOnEnter == value) + return; + _submitOnEnter = value; + FireNotification(NotificationID.SubmitOnEnter); + } + } + + public bool TreatEscapeAsBackspace + { + get => _treatEscapeAsBackspace; + set + { + if (_treatEscapeAsBackspace == value) + return; + _treatEscapeAsBackspace = value; + FireNotification(NotificationID.TreatEscapeAsBackspace); + } + } + + private void FireTypingInputRejectedEvent() => FireNotification(NotificationID.TypingInputRejected); + + public EditableTextData EditableTextData + { + get => _edit; + set + { + if (_edit == value) + return; + _edit = value; + FireNotification(NotificationID.EditableTextData); + } + } + + protected override void OnKeyDown(UIClass ui, KeyStateInfo info) + { + if (ShouldIgnoreInput(info) || _edit == null) + return; + switch (info.Key) + { + case Keys.Back: + if (IsEditableTextEmpty() && !_handlingBackspaceFlag) + break; + info.MarkHandled(); + break; + case Keys.Enter: + if (!_submitOnEnter) + break; + _edit.Submit(); + info.MarkHandled(); + break; + case Keys.Escape: + if (!_treatEscapeAsBackspace) + break; + goto case Keys.Back; + case Keys.Delete: + if (IsEditableTextEmpty()) + break; + RemoveChar(); + info.MarkHandled(); + _handlingDeleteFlag = true; + break; + case Keys.NumPad0: + case Keys.NumPad1: + case Keys.NumPad2: + case Keys.NumPad3: + case Keys.NumPad4: + case Keys.NumPad5: + case Keys.NumPad6: + case Keys.NumPad7: + case Keys.NumPad8: + case Keys.NumPad9: + info.MarkHandled(); + break; + } + } + + protected override void OnKeyCharacter(UIClass ui, KeyCharacterInfo info) + { + if (ShouldIgnoreInput(info) || _edit == null) + return; + switch (info.Character) + { + case '\b': + if (!IsEditableTextEmpty()) + { + RemoveChar(); + info.MarkHandled(); + _handlingBackspaceFlag = true; + break; + } + if (!_handlingBackspaceFlag) + break; + info.MarkHandled(); + break; + case '\t': + break; + case '\r': + if (!_submitOnEnter) + break; + info.MarkHandled(); + break; + case '\x001B': + if (!_treatEscapeAsBackspace) + break; + goto case '\b'; + default: + InputChar(info.Character); + info.MarkHandled(); + break; + } + } + + protected override void OnKeyUp(UIClass ui, KeyStateInfo info) + { + if (ShouldIgnoreInput(info) || _edit == null) + return; + switch (info.Key) + { + case Keys.Back: + if (!_handlingBackspaceFlag) + break; + info.MarkHandled(); + _handlingBackspaceFlag = false; + break; + case Keys.Enter: + if (!_submitOnEnter) + break; + info.MarkHandled(); + break; + case Keys.Escape: + if (!_treatEscapeAsBackspace) + break; + goto case Keys.Back; + case Keys.Delete: + if (!_handlingDeleteFlag) + break; + info.MarkHandled(); + _handlingDeleteFlag = false; + break; + case Keys.NumPad0: + case Keys.NumPad1: + case Keys.NumPad2: + case Keys.NumPad3: + case Keys.NumPad4: + case Keys.NumPad5: + case Keys.NumPad6: + case Keys.NumPad7: + case Keys.NumPad8: + case Keys.NumPad9: + info.MarkHandled(); + break; + } + } + + private void RemoveChar() + { + if (_edit == null || IsEditableTextEmpty()) + return; + if (!_edit.ReadOnly) + _edit.Value = _edit.Value.Substring(0, _edit.Value.Length - 1); + else + FireTypingInputRejectedEvent(); + } + + private void Clear() + { + if (_edit == null || IsEditableTextEmpty()) + return; + if (!_edit.ReadOnly) + _edit.Value = string.Empty; + else + FireTypingInputRejectedEvent(); + } + + private void InputChar(char ch) + { + if (_edit == null) + return; + if (!_edit.ReadOnly && (IsEditableTextEmpty() || _edit.Value.Length < _edit.MaxLength)) + _edit.Value += (string)(object)ch; + else + FireTypingInputRejectedEvent(); + } + + private bool ShouldIgnoreInput(KeyActionInfo info) => (info.Modifiers & InputModifiers.ControlKey) == InputModifiers.ControlKey || (info.Modifiers & InputModifiers.AltKey) == InputModifiers.AltKey || (info.Modifiers & InputModifiers.WindowsKey) == InputModifiers.WindowsKey; + + private bool IsEditableTextEmpty() => string.IsNullOrEmpty(_edit.Value); + } +} diff --git a/UIX/Microsoft/Iris/IntRangedValue.cs b/UIX/Microsoft/Iris/IntRangedValue.cs new file mode 100644 index 0000000..d42022d --- /dev/null +++ b/UIX/Microsoft/Iris/IntRangedValue.cs @@ -0,0 +1,52 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.IntRangedValue +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris +{ + public class IntRangedValue : RangedValue, IUIIntRangedValue, IUIRangedValue, IUIValueRange, INotifyObject + { + public IntRangedValue(IModelItemOwner owner, string description) : base(owner, description) + { + } + + public IntRangedValue(IModelItemOwner owner) : this(owner, null) + { + } + + public IntRangedValue() : this(null) + { + } + + public int Value + { + get => (int)base.Value; + set => base.Value = value; + } + + public int MinValue + { + get => (int)base.MinValue; + set => base.MinValue = value; + } + + public int MaxValue + { + get => (int)base.MaxValue; + set => base.MaxValue = value; + } + + public int Step + { + get => (int)base.Step; + set => base.Step = value; + } + + internal override ModelItems.RangedValue CreateInternalRangedValue() => new ModelItems.IntRangedValue(); + } +} diff --git a/UIX/Microsoft/Iris/InvokePolicy.cs b/UIX/Microsoft/Iris/InvokePolicy.cs new file mode 100644 index 0000000..733b995 --- /dev/null +++ b/UIX/Microsoft/Iris/InvokePolicy.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.InvokePolicy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public enum InvokePolicy + { + Synchronous, + AsynchronousNormal, + AsynchronousLowPri, + } +} diff --git a/UIX/Microsoft/Iris/ItemCountHandler.cs b/UIX/Microsoft/Iris/ItemCountHandler.cs new file mode 100644 index 0000000..8bf225b --- /dev/null +++ b/UIX/Microsoft/Iris/ItemCountHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ItemCountHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public delegate void ItemCountHandler(VirtualList list); +} diff --git a/UIX/Microsoft/Iris/Key.cs b/UIX/Microsoft/Iris/Key.cs new file mode 100644 index 0000000..7731385 --- /dev/null +++ b/UIX/Microsoft/Iris/Key.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Key +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + internal static class Key + { + public const string PublicKey = "0x0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"; + public const string PublicKeyToken = "31bf3856ad364e35"; + public const string PublicKeyTokenAttrib = ",PublicKeyToken=31bf3856ad364e35"; + public const string PublicKeyAttrib = ",PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9"; + } +} diff --git a/UIX/Microsoft/Iris/Layout/Alignment.cs b/UIX/Microsoft/Iris/Layout/Alignment.cs new file mode 100644 index 0000000..d1b7404 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/Alignment.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.Alignment +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layout +{ + internal enum Alignment + { + Unspecified, + Near, + Center, + Far, + Fill, + } +} diff --git a/UIX/Microsoft/Iris/Layout/AreaOfInterest.cs b/UIX/Microsoft/Iris/Layout/AreaOfInterest.cs new file mode 100644 index 0000000..3728698 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/AreaOfInterest.cs @@ -0,0 +1,93 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.AreaOfInterest +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layout +{ + internal struct AreaOfInterest + { + private Rectangle _rectangle; + private Rectangle _displayRectangle; + private AreaOfInterestID _id; + + public AreaOfInterest(Size size, AreaOfInterestID id) + : this(size, Inset.Zero, id) + { + } + + public AreaOfInterest(Size size, Inset margins, AreaOfInterestID id) + : this(new Rectangle(Point.Zero, size), margins, id) + { + } + + public AreaOfInterest(Rectangle rectangle, AreaOfInterestID id) + : this(rectangle, rectangle, id) + { + } + + public AreaOfInterest(Rectangle rectangle, Inset margins, AreaOfInterestID id) + : this(rectangle, Rectangle.Inflate(rectangle, margins.ToRect), id) + { + } + + public AreaOfInterest(Rectangle rectangle, Rectangle displayRectangle, AreaOfInterestID id) + { + _rectangle = rectangle; + _displayRectangle = displayRectangle; + _id = id; + } + + public AreaOfInterest Transform(Point offset) => new AreaOfInterest(Rectangle.Offset(_rectangle, offset), Rectangle.Offset(_displayRectangle, offset), Id); + + public static void AddAreaOfInterest( + AreaOfInterest interest, + ref Vector areasOfInterestList) + { + if (areasOfInterestList == null) + areasOfInterestList = new Vector(); + for (int index = 0; index < areasOfInterestList.Count; ++index) + { + if (areasOfInterestList[index].Id == interest.Id) + return; + } + areasOfInterestList.Add(interest); + } + + public override string ToString() => InvariantString.Format("AreaOfInterest(\"{0}\", {1}, {2})", Id, Rectangle, DisplayRectangle); + + public override int GetHashCode() => _rectangle.GetHashCode() ^ _displayRectangle.GetHashCode() ^ _id.GetHashCode(); + + public override bool Equals(object other) + { + try + { + return this == (AreaOfInterest)other; + } + catch + { + return false; + } + } + + public bool Equals(AreaOfInterest other) => _rectangle == other._rectangle && _displayRectangle == other._displayRectangle && _id == other._id; + + public static bool operator ==(AreaOfInterest a, AreaOfInterest b) => a._rectangle == b._rectangle && a._displayRectangle == b._displayRectangle && a._id == b._id; + + public static bool operator !=(AreaOfInterest a, AreaOfInterest b) => a._rectangle != b._rectangle || a._displayRectangle != b._displayRectangle || a._id != b._id; + + public Rectangle Rectangle => _rectangle; + + public Rectangle DisplayRectangle + { + get => _displayRectangle; + set => _displayRectangle = value; + } + + public AreaOfInterestID Id => _id; + } +} diff --git a/UIX/Microsoft/Iris/Layout/AreaOfInterestID.cs b/UIX/Microsoft/Iris/Layout/AreaOfInterestID.cs new file mode 100644 index 0000000..8c8a9a6 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/AreaOfInterestID.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.AreaOfInterestID +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Layout +{ + [Flags] + internal enum AreaOfInterestID + { + Focus = 1, + FocusOverride = 2, + PendingFocus = 4, + ScrollIntoViewRequest = 8, + ScrollableRange = 16, // 0x00000010 + } +} diff --git a/UIX/Microsoft/Iris/Layout/AreaOfInterestLayoutInput.cs b/UIX/Microsoft/Iris/Layout/AreaOfInterestLayoutInput.cs new file mode 100644 index 0000000..94ca62b --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/AreaOfInterestLayoutInput.cs @@ -0,0 +1,42 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.AreaOfInterestLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layout +{ + internal class AreaOfInterestLayoutInput : ILayoutInput + { + private AreaOfInterestID _id; + private Inset _margins; + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + + public AreaOfInterestLayoutInput(AreaOfInterestID idName, Inset margins) + { + _id = idName; + _margins = margins; + } + + public AreaOfInterestLayoutInput() + { + } + + public AreaOfInterestID Id + { + get => _id; + set => _id = value; + } + + public Inset Margins => _margins; + + DataCookie ILayoutInput.Data => Data; + + public static DataCookie Data => s_dataProperty; + + public override string ToString() => InvariantString.Format("{0}({1})", GetType().Name, _id); + } +} diff --git a/UIX/Microsoft/Iris/Layout/ExtendedLayoutOutput.cs b/UIX/Microsoft/Iris/Layout/ExtendedLayoutOutput.cs new file mode 100644 index 0000000..d69e6b7 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/ExtendedLayoutOutput.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.ExtendedLayoutOutput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Layout +{ + internal abstract class ExtendedLayoutOutput + { + public ExtendedLayoutOutput nextOutput; + + private DataCookie Data => OutputID; + + public abstract DataCookie OutputID { get; } + } +} diff --git a/UIX/Microsoft/Iris/Layout/ILayout.cs b/UIX/Microsoft/Iris/Layout/ILayout.cs new file mode 100644 index 0000000..52116df --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/ILayout.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.ILayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layout +{ + internal interface ILayout + { + Size Measure(ILayoutNode layoutNode, Size constraint); + + void Arrange(ILayoutNode layoutNode, LayoutSlot slot); + + ItemAlignment DefaultChildAlignment { get; } + } +} diff --git a/UIX/Microsoft/Iris/Layout/ILayoutInput.cs b/UIX/Microsoft/Iris/Layout/ILayoutInput.cs new file mode 100644 index 0000000..fedb92f --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/ILayoutInput.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.ILayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Layout +{ + internal interface ILayoutInput + { + DataCookie Data { get; } + } +} diff --git a/UIX/Microsoft/Iris/Layout/ILayoutNode.cs b/UIX/Microsoft/Iris/Layout/ILayoutNode.cs new file mode 100644 index 0000000..21059a6 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/ILayoutNode.cs @@ -0,0 +1,78 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.ILayoutNode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layout +{ + internal interface ILayoutNode + { + Size Measure(Size constraint); + + void Arrange(LayoutSlot parentSlot); + + void Arrange(LayoutSlot parentSlot, Rectangle bounds); + + void Arrange(LayoutSlot parentSlot, Rectangle bounds, Vector3 scale, Rotation rotation); + + void Commit(); + + void MarkHidden(); + + ILayoutInput GetLayoutInput(DataCookie inputID); + + void SetLayoutInput(ILayoutInput input); + + void SetLayoutInput(ILayoutInput input, bool invalidateLayout); + + ExtendedLayoutOutput GetExtendedLayoutOutput(DataCookie outputID); + + void SetExtendedLayoutOutput(ExtendedLayoutOutput newDataOutput); + + bool ContainsAreaOfInterest(AreaOfInterestID id); + + bool TryGetAreaOfInterest(AreaOfInterestID id, out AreaOfInterest area); + + void AddAreaOfInterest(AreaOfInterest interest); + + Vector GetSpecificChildrenRequestList(); + + void RequestMoreChildren(int childrenCount); + + void RequestSpecificChildren(Vector indiciesList); + + object MeasureData { get; set; } + + int LayoutChildrenCount { get; } + + LayoutNodeEnumerator LayoutChildren { get; } + + ILayoutNode NextSibling { get; } + + ILayoutNode NextVisibleSibling { get; } + + bool LayoutContributesToWidth { get; set; } + + void SetVisibleIndexRange( + int beginVisible, + int endVisible, + int beginVisibleOffscreen, + int endVisibleOffscreen, + int? focusedItem); + + Size DesiredSize { get; } + + Size AlignedSize { get; } + + Point AlignmentOffset { get; } + + Point LayoutPosition { get; } + + bool Visible { get; } + } +} diff --git a/UIX/Microsoft/Iris/Layout/ItemAlignment.cs b/UIX/Microsoft/Iris/Layout/ItemAlignment.cs new file mode 100644 index 0000000..b0cca63 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/ItemAlignment.cs @@ -0,0 +1,54 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.ItemAlignment +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layout +{ + internal struct ItemAlignment + { + private Alignment _horizontal; + private Alignment _vertical; + internal static readonly ItemAlignment Default = new ItemAlignment(); + + public ItemAlignment(Alignment horizontal, Alignment vertical) + { + _horizontal = horizontal; + _vertical = vertical; + } + + public Alignment Horizontal + { + get => _horizontal; + set => _horizontal = value; + } + + public Alignment Vertical + { + get => _vertical; + set => _vertical = value; + } + + public Alignment GetAlignment(Orientation orientation) => orientation != Orientation.Horizontal ? Vertical : Horizontal; + + public override bool Equals(object obj) => obj is ItemAlignment itemAlignment && this == itemAlignment; + + public override int GetHashCode() => (int)((Alignment)((int)Horizontal << 16) ^ Vertical); + + public static bool operator ==(ItemAlignment left, ItemAlignment right) => left.Horizontal == right.Horizontal && left.Vertical == right.Vertical; + + public static bool operator !=(ItemAlignment left, ItemAlignment right) => !(left == right); + + public static ItemAlignment Merge(ItemAlignment alignment, ItemAlignment fallback) + { + if (alignment.Horizontal == Alignment.Unspecified) + alignment.Horizontal = fallback.Horizontal; + if (alignment.Vertical == Alignment.Unspecified) + alignment.Vertical = fallback.Vertical; + return alignment; + } + } +} diff --git a/UIX/Microsoft/Iris/Layout/LayoutCompleteEventHandler.cs b/UIX/Microsoft/Iris/Layout/LayoutCompleteEventHandler.cs new file mode 100644 index 0000000..3915722 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/LayoutCompleteEventHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.LayoutCompleteEventHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layout +{ + internal delegate void LayoutCompleteEventHandler(object sender); +} diff --git a/UIX/Microsoft/Iris/Layout/LayoutConstants.cs b/UIX/Microsoft/Iris/Layout/LayoutConstants.cs new file mode 100644 index 0000000..7715af0 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/LayoutConstants.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.LayoutConstants +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layout +{ + internal static class LayoutConstants + { + public const int Infinite = 16777215; + } +} diff --git a/UIX/Microsoft/Iris/Layout/LayoutNodeEnumerator.cs b/UIX/Microsoft/Iris/Layout/LayoutNodeEnumerator.cs new file mode 100644 index 0000000..b8c7d8a --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/LayoutNodeEnumerator.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.LayoutNodeEnumerator +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layout +{ + internal struct LayoutNodeEnumerator + { + private ILayoutNode _start; + private ILayoutNode _current; + private bool _haventStartedYet; + + public LayoutNodeEnumerator GetEnumerator() => this; + + public LayoutNodeEnumerator(ILayoutNode start) + { + _start = start; + _current = null; + _haventStartedYet = true; + } + + public bool MoveNext() + { + if (_current != null) + _current = _current.NextVisibleSibling; + else if (_haventStartedYet) + { + _current = _start; + _haventStartedYet = false; + } + return _current != null; + } + + public ILayoutNode Current => _current; + + public void Reset() + { + _current = null; + _haventStartedYet = true; + } + } +} diff --git a/UIX/Microsoft/Iris/Layout/LayoutSlot.cs b/UIX/Microsoft/Iris/Layout/LayoutSlot.cs new file mode 100644 index 0000000..3761971 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/LayoutSlot.cs @@ -0,0 +1,104 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.LayoutSlot +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using System.Text; + +namespace Microsoft.Iris.Layout +{ + internal struct LayoutSlot + { + private Size _bounds; + private Point _offset; + private Rectangle _viewBounds; + private Rectangle _peripheralViewBounds; + + public LayoutSlot(Size extent) + : this(extent, Point.Zero, new Rectangle(extent), new Rectangle(extent)) + { + } + + public LayoutSlot( + Size extent, + Point offset, + Rectangle viewBounds, + Rectangle viewPeripheralBounds) + { + _bounds = extent; + _offset = offset; + _viewBounds = viewBounds; + _peripheralViewBounds = viewPeripheralBounds; + } + + public Size Bounds + { + get => _bounds; + set => _bounds = value; + } + + public Point Offset + { + get => _offset; + set => _offset = value; + } + + public Rectangle View + { + get => _viewBounds; + set => _viewBounds = value; + } + + public Rectangle PeripheralView + { + get => _peripheralViewBounds; + set => _peripheralViewBounds = value; + } + + public void Deflate(Inset inset) + { + int num1 = inset.Left + inset.Right; + int num2 = inset.Top + inset.Bottom; + _bounds.Width -= num1; + if (_bounds.Width < 0) + _bounds.Width = 0; + _bounds.Height -= num2; + if (_bounds.Height < 0) + _bounds.Height = 0; + _viewBounds.X -= inset.Left; + _viewBounds.Y -= inset.Top; + _peripheralViewBounds.X -= inset.Left; + _peripheralViewBounds.Y -= inset.Top; + } + + public static bool operator ==(LayoutSlot left, LayoutSlot right) => left._bounds == right._bounds && left._offset == right._offset && left._viewBounds == right._viewBounds && left._peripheralViewBounds == right._peripheralViewBounds; + + public static bool operator !=(LayoutSlot left, LayoutSlot right) => !(left == right); + + public override bool Equals(object obj) => obj is LayoutSlot layoutSlot && this == layoutSlot; + + public override int GetHashCode() => _bounds.GetHashCode() ^ _offset.GetHashCode() ^ _viewBounds.GetHashCode() ^ _peripheralViewBounds.GetHashCode(); + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append(GetType().Name); + stringBuilder.Append("("); + stringBuilder.Append("Bounds="); + stringBuilder.Append(_bounds); + stringBuilder.Append(", Offset="); + stringBuilder.Append(_offset); + stringBuilder.Append(", View="); + stringBuilder.Append(_viewBounds); + if (_peripheralViewBounds != _viewBounds) + { + stringBuilder.Append(", Peripheral="); + stringBuilder.Append(_peripheralViewBounds); + } + stringBuilder.Append(")"); + return stringBuilder.ToString(); + } + } +} diff --git a/UIX/Microsoft/Iris/Layout/SharedSize.cs b/UIX/Microsoft/Iris/Layout/SharedSize.cs new file mode 100644 index 0000000..a12660b --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/SharedSize.cs @@ -0,0 +1,222 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.SharedSize +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Layout +{ + internal class SharedSize : NotifyObjectBase + { + private Size _minimumSize; + private Size _maximumSize; + private Size _desiredSize; + private bool _accumulatingSize; + private bool _applyPending; + private Vector _dependents; + + public SharedSize() + { + _minimumSize = Size.Zero; + _maximumSize = Size.Zero; + _desiredSize = Size.Zero; + _accumulatingSize = true; + } + + public Size MaximumSize + { + get => _maximumSize; + set + { + if (!(_maximumSize != value)) + return; + Size size1 = Size; + _maximumSize = value; + Size size2 = Size; + FireNotification(NotificationID.MaximumSize); + if (!(size1 != size2)) + return; + FireNotification(NotificationID.Size); + InvalidateDependents(true); + } + } + + public Size MinimumSize + { + get => _minimumSize; + set + { + if (!(_minimumSize != value)) + return; + Size size1 = Size; + _minimumSize = value; + Size size2 = Size; + FireNotification(NotificationID.MinimumSize); + if (!(size1 != size2)) + return; + FireNotification(NotificationID.Size); + InvalidateDependents(true); + } + } + + public Size Size + { + get + { + Size size = Size.Max(_desiredSize, MinimumSize); + Size maximumSize = MaximumSize; + if (maximumSize.Width > 0) + size.Width = Math.Min(size.Width, maximumSize.Width); + if (maximumSize.Height > 0) + size.Height = Math.Min(size.Height, maximumSize.Height); + return size; + } + set => SetSize(value, true); + } + + public void AutoSize() + { + SetSize(Size.Zero, false); + InvalidateDependents(true); + } + + private void SetSize(Size value, bool stopAccumulating) + { + if (_desiredSize != value) + { + Size size1 = Size; + _desiredSize = value; + Size size2 = Size; + if (size1 != size2) + { + FireNotification(NotificationID.Size); + if (stopAccumulating) + InvalidateDependents(true); + } + } + _accumulatingSize = !stopAccumulating; + } + + public void Register(ViewItem viewitem) + { + if (_dependents == null) + _dependents = new Vector(); + _dependents.Add(viewitem); + } + + public void Unregister(ViewItem viewitem) => _dependents.Remove(viewitem); + + public void AdjustConstraint(ref Size constraint, ref Size minSize, SharedSizePolicy policy) + { + Size size1 = Size; + Size maximumSize = MaximumSize; + Size size2 = constraint; + Size size3 = size1; + Size size4 = minSize; + if ((policy & SharedSizePolicy.SharesWidth) != 0) + { + if (!_accumulatingSize) + { + int num = Math.Max(size4.Width, Math.Min(size1.Width, size2.Width)); + if (num >= MinimumSize.Width && (num <= maximumSize.Width || maximumSize.Width == 0)) + { + size4.Width = num; + size2.Width = num; + } + else + { + size2.Width = 0; + size4.Width = 1; + } + } + else + { + if (maximumSize.Width != 0) + size2.Width = Math.Min(maximumSize.Width, size2.Width); + size4.Width = Math.Max(size3.Width, size4.Width); + } + } + if ((policy & SharedSizePolicy.SharesHeight) != 0) + { + if (!_accumulatingSize) + { + int num = Math.Max(size4.Height, Math.Min(size1.Height, size2.Height)); + if (num >= MinimumSize.Height && (num <= maximumSize.Height || maximumSize.Height == 0)) + { + size4.Height = num; + size2.Height = num; + } + else + { + size2.Height = 0; + size4.Height = 1; + } + } + else + { + if (maximumSize.Height != 0) + size2.Height = Math.Min(maximumSize.Height, size2.Height); + size4.Height = Math.Max(size3.Height, size4.Height); + } + } + constraint = size2; + minSize = size4; + } + + public void AccumulateSize(Size size, SharedSizePolicy policy) + { + if (!_accumulatingSize) + return; + Size size1 = Size; + if ((policy & SharedSizePolicy.ContributesToWidth) != 0 && size.Width > size1.Width) + size1.Width = size.Width; + if ((policy & SharedSizePolicy.ContributesToHeight) != 0 && size.Height > size1.Height) + size1.Height = size.Height; + SetSize(size1, false); + EnsureApplySize(); + } + + private void EnsureApplySize() + { + if (_applyPending) + return; + _applyPending = true; + DeferredCall.Post(DispatchPriority.LayoutPass2, new SimpleCallback(ApplySize)); + } + + private void ApplySize() + { + _accumulatingSize = false; + _applyPending = false; + InvalidateDependents(false); + } + + private void InvalidateDependents(bool forceInvalid) + { + if (_dependents == null) + return; + Size size1 = Size; + foreach (ViewItem dependent in _dependents) + { + if (forceInvalid) + { + dependent.MarkLayoutInvalid(); + } + else + { + SharedSizePolicy sharedSizePolicy = dependent.SharedSizePolicy; + Size size2 = ((ILayoutNode)dependent).DesiredSize - dependent.Margins.Size; + 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/Layout/SharedSizePolicy.cs b/UIX/Microsoft/Iris/Layout/SharedSizePolicy.cs new file mode 100644 index 0000000..04a9798 --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/SharedSizePolicy.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.SharedSizePolicy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Layout +{ + [Flags] + internal enum SharedSizePolicy + { + ContributesToWidth = 1, + ContributesToHeight = 2, + ContributesToSize = ContributesToHeight | ContributesToWidth, // 0x00000003 + SharesWidth = 4, + SharesHeight = 8, + SharesSize = SharesHeight | SharesWidth, // 0x0000000C + Default = SharesSize | ContributesToSize, // 0x0000000F + } +} diff --git a/UIX/Microsoft/Iris/Layout/Visibility.cs b/UIX/Microsoft/Iris/Layout/Visibility.cs new file mode 100644 index 0000000..bba7a9c --- /dev/null +++ b/UIX/Microsoft/Iris/Layout/Visibility.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layout.Visibility +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layout +{ + internal enum Visibility : byte + { + Visible, + ImplicitlyHidden, + ExplicitlyHidden, + } +} diff --git a/UIX/Microsoft/Iris/Layouts/AnchorEdge.cs b/UIX/Microsoft/Iris/Layouts/AnchorEdge.cs new file mode 100644 index 0000000..1d41568 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/AnchorEdge.cs @@ -0,0 +1,142 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.AnchorEdge +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Text; + +namespace Microsoft.Iris.Layouts +{ + internal class AnchorEdge + { + private string _idName; + private float _percentValue; + private int _offsetValue; + private float _maximumPercentValue; + private int _maximumOffsetValue; + private float _minimumPercentValue; + private int _minimumOffsetValue; + private bool _maximumSetFlag; + private bool _minimumSetFlag; + + public AnchorEdge() + { + } + + public AnchorEdge(string id, float percent) + { + Id = id; + Percent = percent; + } + + public string Id + { + get => _idName; + set => _idName = value; + } + + public float Percent + { + get => _percentValue; + set => _percentValue = value; + } + + public int Offset + { + get => _offsetValue; + set => _offsetValue = value; + } + + public float MaximumPercent + { + get => _maximumPercentValue; + set + { + _maximumPercentValue = value; + _maximumSetFlag = true; + } + } + + public int MaximumOffset + { + get => _maximumOffsetValue; + set + { + _maximumOffsetValue = value; + _maximumSetFlag = true; + } + } + + public float MinimumPercent + { + get => _minimumPercentValue; + set + { + _minimumPercentValue = value; + _minimumSetFlag = true; + } + } + + public int MinimumOffset + { + get => _minimumOffsetValue; + set + { + _minimumOffsetValue = value; + _minimumSetFlag = true; + } + } + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.Append("("); + stringBuilder.Append(_idName); + stringBuilder.Append(", "); + stringBuilder.Append(_percentValue); + if (_offsetValue != 0) + { + stringBuilder.Append(", "); + stringBuilder.Append(_offsetValue); + } + if (_maximumPercentValue > 0.0) + { + stringBuilder.Append(", MaximumPercent="); + stringBuilder.Append(_maximumPercentValue); + stringBuilder.Append(", MaximumOffset="); + stringBuilder.Append(_maximumOffsetValue); + } + if (_minimumPercentValue > 0.0) + { + stringBuilder.Append(", MinimumPercent="); + stringBuilder.Append(_minimumPercentValue); + stringBuilder.Append(", MinimumOffset="); + stringBuilder.Append(_minimumOffsetValue); + } + stringBuilder.Append(")"); + return stringBuilder.ToString(); + } + + public static bool operator ==(AnchorEdge lhs, AnchorEdge rhs) + { + if ((object)lhs == null && (object)rhs == null) + return true; + return (object)lhs != null && lhs.Equals(rhs); + } + + public static bool operator !=(AnchorEdge lhs, AnchorEdge rhs) => !(lhs == rhs); + + public override bool Equals(object obj) + { + AnchorEdge anchorEdge = obj as AnchorEdge; + return (object)anchorEdge != null && Id == anchorEdge.Id && (Percent == (double)anchorEdge.Percent && Offset == anchorEdge.Offset) && (MaximumSet == anchorEdge.MaximumSet && MaximumPercent == (double)anchorEdge.MaximumPercent && (MaximumOffset == anchorEdge.MaximumOffset && MinimumSet == anchorEdge.MinimumSet)) && MinimumPercent == (double)anchorEdge.MinimumPercent && MinimumOffset == anchorEdge.MinimumOffset; + } + + public override int GetHashCode() => (Id != null ? Id.GetHashCode() : 0) ^ Percent.GetHashCode() ^ Offset << 8 ^ MaximumSet.GetHashCode() ^ MaximumPercent.GetHashCode() ^ MaximumOffset << 16 ^ MinimumSet.GetHashCode() ^ MinimumPercent.GetHashCode() ^ MinimumOffset << 24; + + internal bool MaximumSet => _maximumSetFlag; + + internal bool MinimumSet => _minimumSetFlag; + } +} diff --git a/UIX/Microsoft/Iris/Layouts/AnchorLayout.cs b/UIX/Microsoft/Iris/Layouts/AnchorLayout.cs new file mode 100644 index 0000000..595ded8 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/AnchorLayout.cs @@ -0,0 +1,415 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.AnchorLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Layouts +{ + internal class AnchorLayout : ILayout + { + private bool _sizeToHorizontalChildrenFlag = true; + private bool _sizeToVerticalChildrenFlag = true; + private ItemAlignment _defaultChildAlignment; + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + private static AnchorEdge s_anchorParent0 = new AnchorEdge("Parent", 0.0f); + private static AnchorEdge s_anchorParent1 = new AnchorEdge("Parent", 1f); + private static AnchorEdge s_anchorParentActual0 = new AnchorEdge("ParentActual", 0.0f); + private static AnchorEdge s_anchorParentActual1 = new AnchorEdge("ParentActual", 1f); + + public bool SizeToHorizontalChildren + { + get => _sizeToHorizontalChildrenFlag; + set => _sizeToHorizontalChildrenFlag = value; + } + + public bool SizeToVerticalChildren + { + get => _sizeToVerticalChildrenFlag; + set => _sizeToVerticalChildrenFlag = value; + } + + public ItemAlignment DefaultChildAlignment + { + get => _defaultChildAlignment; + set => _defaultChildAlignment = value; + } + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + if (!(layoutNode.MeasureData is AnchorLayout.Packet packet)) + { + packet = new AnchorLayout.Packet(); + layoutNode.MeasureData = packet; + packet.ParentRecord = new AnchorLayout.Record("Parent", new Rectangle(Point.Zero, constraint), LayoutPhase.Done); + packet.ParentActualRecord = new AnchorLayout.Record("ParentActual", Rectangle.Zero, LayoutPhase.Arrange); + packet.AreaOfInterestRecord = new AnchorLayout.Record("Focus", Rectangle.Zero, LayoutPhase.Arrange); + packet.Records = new Vector(layoutNode.LayoutChildrenCount); + } + else + { + packet.ParentRecord.Bounds = new Rectangle(Point.Zero, constraint); + packet.CircularitiesDetected = false; + packet.CircularityBreakerRecord = null; + } + packet.Subject = layoutNode; + packet.Constraint = constraint; + packet.TotalBounds = new Rectangle(int.MaxValue, int.MaxValue, int.MinValue, int.MinValue); + Size zero = Size.Zero; + if (layoutNode.LayoutChildrenCount == 0) + { + packet.Records.Clear(); + if (!_sizeToHorizontalChildrenFlag) + zero.Width = constraint.Width; + if (!_sizeToVerticalChildrenFlag) + zero.Height = constraint.Height; + layoutNode.RequestMoreChildren(int.MaxValue); + return zero; + } + int index = 0; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + if (index < packet.Records.Count) + { + packet.Records[index].Initialize(layoutChild); + } + else + { + AnchorLayout.Record record = new AnchorLayout.Record(layoutChild); + packet.Records.Add(record); + } + ++index; + } + packet.Records.RemoveRange(index, packet.Records.Count - index); + foreach (AnchorLayout.Record record in packet.Records) + { + if (record.Phase == LayoutPhase.Untouched) + { + packet.CircularityBreakerRecord = null; + MeasureChild(packet, record); + } + } + if (packet.CircularitiesDetected) + { + foreach (AnchorLayout.Record record in packet.Records) + { + if (record.Phase == LayoutPhase.Circular) + record.Phase = LayoutPhase.Untouched; + } + packet.CircularitiesDetected = false; + foreach (AnchorLayout.Record record in packet.Records) + { + if (record.Phase == LayoutPhase.Untouched) + MeasureChild(packet, record); + } + } + Size size = constraint; + if (_sizeToHorizontalChildrenFlag || _sizeToVerticalChildrenFlag) + { + if (_sizeToHorizontalChildrenFlag) + size.Width = packet.TotalBounds.Width; + if (_sizeToVerticalChildrenFlag) + size.Height = packet.TotalBounds.Height; + foreach (AnchorLayout.Record record in packet.Records) + { + Rectangle bounds = record.Bounds; + if (_sizeToHorizontalChildrenFlag) + bounds.X -= packet.TotalBounds.X; + if (_sizeToVerticalChildrenFlag) + bounds.Y -= packet.TotalBounds.Y; + record.Bounds = bounds; + } + } + layoutNode.RequestMoreChildren(int.MaxValue); + return size; + } + + private void MeasureChild(AnchorLayout.Packet packet, AnchorLayout.Record record) + { + AnchorLayoutInput input = record.Input; + record.Phase = LayoutPhase.InProgress; + bool allArrangePhase = true; + bool anyArrangePhase = false; + int edge1 = ComputeEdge(packet, "Left", input.Left, s_anchorParent0, Orientation.Horizontal, record, out AnchorLayout.Record _, ref allArrangePhase, ref anyArrangePhase); + int edge2 = ComputeEdge(packet, "Top", input.Top, s_anchorParent0, Orientation.Vertical, record, out AnchorLayout.Record _, ref allArrangePhase, ref anyArrangePhase); + int edge3 = ComputeEdge(packet, "Right", input.Right, s_anchorParent1, Orientation.Horizontal, record, out AnchorLayout.Record _, ref allArrangePhase, ref anyArrangePhase); + int edge4 = ComputeEdge(packet, "Bottom", input.Bottom, s_anchorParent1, Orientation.Vertical, record, out AnchorLayout.Record _, ref allArrangePhase, ref anyArrangePhase); + if (anyArrangePhase) + { + if (!allArrangePhase) + { + 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.", record.Input); + record.Invalid = true; + } + record.Phase = LayoutPhase.Arrange; + } + else + { + Normalize(ref edge1, ref edge3); + Normalize(ref edge2, ref edge4); + int constraintMaxValue1; + ComputeConstraint(edge1, edge3, out constraintMaxValue1); + int constraintMaxValue2; + ComputeConstraint(edge2, edge4, out constraintMaxValue2); + Size constraint = new Size(constraintMaxValue1, constraintMaxValue2); + record.LayoutNode.Measure(constraint); + int size1; + int x = LocationFromEdges(input.Left, input.Right, edge1, edge3, record.LayoutNode.DesiredSize.Width, record.LayoutNode.AlignedSize.Width, record.LayoutNode.AlignmentOffset.X, out size1); + int size2; + int y = LocationFromEdges(input.Top, input.Bottom, edge2, edge4, record.LayoutNode.DesiredSize.Height, record.LayoutNode.AlignedSize.Height, record.LayoutNode.AlignmentOffset.Y, out size2); + record.Bounds = new Rectangle(x, y, size1, size2); + bool flag = packet.CircularityBreakerRecord == record; + if (record.Phase != LayoutPhase.InProgress && !flag) + return; + record.Phase = LayoutPhase.Done; + Rectangle bounds = record.Bounds; + if (!input.ContributesToWidth) + { + bounds.X = int.MaxValue; + bounds.Width = int.MinValue; + } + if (!input.ContributesToHeight) + { + bounds.Y = int.MaxValue; + bounds.Height = int.MinValue; + } + packet.TotalBounds = Rectangle.Union(packet.TotalBounds, bounds); + } + } + + private int ComputeEdge( + AnchorLayout.Packet packet, + string edgeName, + AnchorEdge anchor, + AnchorEdge fallback, + Orientation orientation, + AnchorLayout.Record record, + out AnchorLayout.Record recordRef, + ref bool allArrangePhase, + ref bool anyArrangePhase) + { + anchor = anchor != null ? anchor : fallback; + recordRef = GetReferenceRecord(packet, anchor.Id); + if (recordRef == null) + { + allArrangePhase = false; + return 0; + } + bool flag = recordRef.Phase == LayoutPhase.Arrange; + allArrangePhase &= flag; + anyArrangePhase |= flag; + record.Visible &= recordRef.Visible; + Rectangle bounds = recordRef.Bounds; + if (recordRef.Phase != LayoutPhase.Done && recordRef.Phase != LayoutPhase.Arrange) + { + record.Phase = LayoutPhase.Circular; + bounds = packet.ParentRecord.Bounds; + if (recordRef.Phase == LayoutPhase.InProgress && packet.CircularityBreakerRecord == null) + { + packet.CircularityBreakerRecord = recordRef; + packet.CircularitiesDetected = true; + } + } + int val1 = Weigh(orientation == Orientation.Horizontal ? bounds.Width : bounds.Height, anchor.Percent) + (orientation == Orientation.Horizontal ? bounds.X : bounds.Y) + anchor.Offset; + int num = orientation == Orientation.Horizontal ? packet.ParentRecord.Bounds.Width : packet.ParentRecord.Bounds.Height; + if (anchor.MaximumSet) + { + int val2 = Weigh(num, anchor.MaximumPercent) + anchor.MaximumOffset; + val1 = Math.Min(val1, val2); + } + if (anchor.MinimumSet) + { + int val2 = Weigh(num, anchor.MinimumPercent) + anchor.MinimumOffset; + val1 = Math.Max(val1, val2); + } + return val1; + } + + private static void ComputeConstraint(int nearValue, int farValue, out int constraintMaxValue) => constraintMaxValue = farValue - nearValue; + + private static int LocationFromEdges( + AnchorEdge near, + AnchorEdge far, + int nearValue, + int farValue, + int desiredSize, + int alignedSize, + int alignmentOffset, + out int size) + { + size = desiredSize; + int num; + if (near == null && far == null) + num = (nearValue + farValue - desiredSize) / 2; + else if (near != null && far == null) + num = nearValue; + else if (near == null && far != null) + { + num = farValue - desiredSize; + } + else + { + num = nearValue + alignmentOffset; + size = alignedSize; + } + return num; + } + + private static void Normalize(ref int nearValue, ref int farValue) + { + if (farValue >= nearValue) + return; + farValue = nearValue; + } + + private static int Weigh(int value, float percentValue) => (int)(value * (double)percentValue); + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + AnchorLayout.Packet measureData = (AnchorLayout.Packet)layoutNode.MeasureData; + if (measureData.Records == null) + return; + measureData.ParentActualRecord.Bounds = new Rectangle(Point.Zero, slot.Bounds); + measureData.AreaOfInterestRecord.Bounds = Rectangle.Zero; + Vector vector = null; + AnchorLayout.Record record1 = null; + foreach (AnchorLayout.Record record2 in measureData.Records) + { + if (record2.Phase != LayoutPhase.Arrange) + { + record2.LayoutNode.Arrange(slot, record2.Bounds); + if (record1 == null && (record2.LayoutNode.ContainsAreaOfInterest(AreaOfInterestID.FocusOverride) || record2.LayoutNode.ContainsAreaOfInterest(AreaOfInterestID.Focus))) + record1 = record2; + } + else if (!record2.Invalid) + { + if (vector == null) + vector = new Vector(); + vector.Add(record2); + } + else + record2.LayoutNode.MarkHidden(); + } + if (vector == null) + return; + if (record1 != null) + { + AreaOfInterest area; + if (!record1.LayoutNode.TryGetAreaOfInterest(AreaOfInterestID.FocusOverride, out area)) + record1.LayoutNode.TryGetAreaOfInterest(AreaOfInterestID.Focus, out area); + measureData.AreaOfInterestRecord.Bounds = Rectangle.Offset(area.DisplayRectangle, record1.Bounds.Location); + } + foreach (AnchorLayout.Record record2 in vector) + { + AnchorLayoutInput input = record2.Input; + bool flag = false; + AnchorLayout.Record recordRef; + int edge1 = ComputeEdge(measureData, "Left", input.Left, null, Orientation.Horizontal, record2, out recordRef, ref flag, ref flag); + int edge2 = ComputeEdge(measureData, "Top", input.Top, null, Orientation.Vertical, record2, out recordRef, ref flag, ref flag); + int edge3 = ComputeEdge(measureData, "Right", input.Right, null, Orientation.Horizontal, record2, out recordRef, ref flag, ref flag); + int edge4 = 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)); + record2.LayoutNode.Arrange(slot, new Rectangle(edge1, edge2, width, height)); + } + } + + private AnchorLayout.Record GetReferenceRecord( + AnchorLayout.Packet packet, + string id) + { + if (id == "Parent") + return packet.ParentRecord; + if (id == "ParentActual") + return packet.ParentActualRecord; + if (id == "Focus") + return packet.AreaOfInterestRecord; + foreach (AnchorLayout.Record record in packet.Records) + { + if (record.ID == id) + { + if (record.Phase == LayoutPhase.Untouched) + MeasureChild(packet, record); + return record; + } + } + ErrorManager.ReportError("Anchor layout: {0} cannot find the '{1}' child", GetType().Name, id); + return null; + } + + internal static DataCookie InputData => s_dataProperty; + + internal enum LayoutPhase + { + Untouched, + InProgress, + Circular, + Done, + Arrange, + } + + internal class Record + { + public ILayoutNode LayoutNode; + public string ID; + public AnchorLayoutInput Input; + public Rectangle Bounds; + public AnchorLayout.LayoutPhase Phase; + public bool Visible = true; + public bool Invalid; + private static AnchorLayoutInput s_defaultInput = new AnchorLayoutInput(); + + public Record(ILayoutNode layoutNode) => Initialize(layoutNode); + + public void Initialize(ILayoutNode layoutNode) + { + LayoutNode = layoutNode; + Input = layoutNode.GetLayoutInput(InputData) as AnchorLayoutInput; + if (Input == null) + Input = s_defaultInput; + ID = ((ViewItem)layoutNode).Name; + Bounds = Rectangle.Zero; + Phase = LayoutPhase.Untouched; + Visible = true; + Invalid = false; + } + + public Record(string idName, Rectangle bounds, AnchorLayout.LayoutPhase phaseOverride) + { + ID = idName; + Bounds = bounds; + Phase = phaseOverride; + } + + public override string ToString() => string.Format("AnchorLayout.Record({0}, Phase={1})", ID, Phase); + } + + private class Packet + { + public ILayoutNode Subject; + public Vector Records; + public AnchorLayout.Record ParentRecord; + public AnchorLayout.Record ParentActualRecord; + public AnchorLayout.Record AreaOfInterestRecord; + public Size Constraint; + public Rectangle TotalBounds; + public bool CircularitiesDetected; + public AnchorLayout.Record CircularityBreakerRecord; + + 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 new file mode 100644 index 0000000..4b270ba --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/AnchorLayoutInput.cs @@ -0,0 +1,63 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.AnchorLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Layouts +{ + internal class AnchorLayoutInput : ILayoutInput + { + private AnchorEdge _anchorLeft; + private AnchorEdge _anchorTop; + private AnchorEdge _anchorRight; + private AnchorEdge _anchorBottom; + private bool _contributesToWidthFlag = true; + private bool _contributesToHeightFlag = true; + + public AnchorEdge Left + { + get => _anchorLeft; + set => _anchorLeft = value; + } + + public AnchorEdge Top + { + get => _anchorTop; + set => _anchorTop = value; + } + + public AnchorEdge Right + { + get => _anchorRight; + set => _anchorRight = value; + } + + public AnchorEdge Bottom + { + get => _anchorBottom; + set => _anchorBottom = value; + } + + public bool ContributesToWidth + { + get => _contributesToWidthFlag; + set => _contributesToWidthFlag = value; + } + + public bool ContributesToHeight + { + get => _contributesToHeightFlag; + set => _contributesToHeightFlag = value; + } + + DataCookie ILayoutInput.Data => Data; + + internal static DataCookie Data => AnchorLayout.InputData; + + public override string ToString() => InvariantString.Format("AnchorLayoutInput(Left={0}, Top={1}, Right={2}, Bottom={3}{4}{5})", Left, Top, Right, Bottom, ContributesToWidth ? ", ContributesToWidth=true" : string.Empty, ContributesToHeight ? ", ContributesToHeight=true" : string.Empty); + } +} diff --git a/UIX/Microsoft/Iris/Layouts/ContentPositioningPolicy.cs b/UIX/Microsoft/Iris/Layouts/ContentPositioningPolicy.cs new file mode 100644 index 0000000..3d0423d --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/ContentPositioningPolicy.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.ContentPositioningPolicy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal enum ContentPositioningPolicy + { + RespectPaddingAndLocking, + ShowMaximalContent, + } +} diff --git a/UIX/Microsoft/Iris/Layouts/DefaultLayout.cs b/UIX/Microsoft/Iris/Layouts/DefaultLayout.cs new file mode 100644 index 0000000..09082d2 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/DefaultLayout.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.DefaultLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layouts +{ + internal class DefaultLayout : ILayout + { + private static DefaultLayout s_sharedLayout = new DefaultLayout(); + + private DefaultLayout() + { + } + + public static DefaultLayout Instance => s_sharedLayout; + + public ItemAlignment DefaultChildAlignment => ItemAlignment.Default; + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) => Measure(layoutNode, constraint); + + public static Size Measure(ILayoutNode layoutNode, Size constraint) + { + Size sz1 = Size.Zero; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + Size sz2 = layoutChild.Measure(constraint); + sz1 = Size.Max(sz1, sz2); + } + layoutNode.RequestMoreChildren(int.MaxValue); + return sz1; + } + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) => Arrange(layoutNode, slot); + + public static void Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + layoutChild.Arrange(slot); + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/DockLayout.cs b/UIX/Microsoft/Iris/Layouts/DockLayout.cs new file mode 100644 index 0000000..3a579e9 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/DockLayout.cs @@ -0,0 +1,124 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.DockLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layouts +{ + internal class DockLayout : ILayout + { + private DockLayoutInput _defaultLayoutInput; + private ItemAlignment _defaultChildAlignment; + private static int s_numberOfAdditionalItemsToRequestAtATime = 42; + private static DockLayoutInput s_defaultLayoutInput = DockLayoutInput.Client; + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + + internal static DataCookie DockData => s_dataProperty; + + public DockLayoutInput DefaultLayoutInput + { + get => _defaultLayoutInput; + set => _defaultLayoutInput = value; + } + + public ItemAlignment DefaultChildAlignment + { + get => _defaultChildAlignment; + set => _defaultChildAlignment = value; + } + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + Size size1 = constraint; + Size sz2_1 = Size.Zero; + Size constraint1 = size1; + bool flag = false; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + Size size2 = layoutChild.Measure(constraint1); + sz2_1 = Size.Max(size1 - constraint1 + size2, sz2_1); + DockLayoutInput layoutInputForNode = GetLayoutInputForNode(layoutChild); + if (layoutInputForNode == DockLayoutInput.Left || layoutInputForNode == DockLayoutInput.Right) + constraint1.Width -= size2.Width; + else if (layoutInputForNode == DockLayoutInput.Top || layoutInputForNode == DockLayoutInput.Bottom) + constraint1.Height -= size2.Height; + else if (layoutInputForNode == DockLayoutInput.Client) + flag = true; + } + if (flag) + { + Size sz2_2 = Size.Zero; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + if (GetLayoutInputForNode(layoutChild) == DockLayoutInput.Client) + sz2_2 = Size.Max(layoutChild.Measure(constraint1), sz2_2); + } + sz2_1 = Size.Max(size1 - constraint1 + sz2_2, sz2_1); + } + if (sz2_1.Width < size1.Width || sz2_1.Height < size1.Height) + layoutNode.RequestMoreChildren(s_numberOfAdditionalItemsToRequestAtATime); + return sz2_1; + } + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + Rectangle bounds1 = new Rectangle(Point.Zero, slot.Bounds); + bool flag = false; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + Size desiredSize = layoutChild.DesiredSize; + Rectangle bounds2 = bounds1; + DockLayoutInput layoutInputForNode = GetLayoutInputForNode(layoutChild); + if (layoutInputForNode == DockLayoutInput.Left) + { + bounds2.Width = desiredSize.Width; + bounds1.X += desiredSize.Width; + bounds1.Width -= desiredSize.Width; + } + else if (layoutInputForNode == DockLayoutInput.Right) + { + bounds2.X = bounds1.Right - desiredSize.Width; + bounds2.Width = desiredSize.Width; + bounds1.Width -= desiredSize.Width; + } + else if (layoutInputForNode == DockLayoutInput.Top) + { + bounds2.Height = desiredSize.Height; + bounds1.Y += desiredSize.Height; + bounds1.Height -= desiredSize.Height; + } + else if (layoutInputForNode == DockLayoutInput.Bottom) + { + bounds2.Y = bounds1.Bottom - desiredSize.Height; + bounds2.Height = desiredSize.Height; + bounds1.Height -= desiredSize.Height; + } + else if (layoutInputForNode == DockLayoutInput.Client) + { + flag = true; + continue; + } + layoutChild.Arrange(slot, bounds2); + } + if (!flag) + return; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + if (GetLayoutInputForNode(layoutChild) == DockLayoutInput.Client) + layoutChild.Arrange(slot, bounds1); + } + } + + private DockLayoutInput GetLayoutInputForNode(ILayoutNode node) + { + if (!(node.GetLayoutInput(s_dataProperty) is DockLayoutInput dockLayoutInput)) + dockLayoutInput = _defaultLayoutInput ?? s_defaultLayoutInput; + return dockLayoutInput; + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs new file mode 100644 index 0000000..9643f33 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/DockLayoutInput.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.DockLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Layouts +{ + internal class DockLayoutInput : ILayoutInput + { + public static readonly DockLayoutInput Left = new DockLayoutInput(); + public static readonly DockLayoutInput Top = new DockLayoutInput(); + public static readonly DockLayoutInput Right = new DockLayoutInput(); + public static readonly DockLayoutInput Bottom = new DockLayoutInput(); + public static readonly DockLayoutInput Client = new DockLayoutInput(); + + private DockLayoutInput() + { + } + + DataCookie ILayoutInput.Data => Data; + + internal static DataCookie Data => DockLayout.DockData; + + internal string PositionString + { + get + { + if (this == Left) + return "Left"; + if (this == Top) + return "Top"; + if (this == Right) + return "Right"; + return this == Bottom ? "Bottom" : "Client"; + } + } + + public override string ToString() => InvariantString.Format("{0}(Position={1})", GetType().Name, PositionString); + } +} diff --git a/UIX/Microsoft/Iris/Layouts/FlipDirection.cs b/UIX/Microsoft/Iris/Layouts/FlipDirection.cs new file mode 100644 index 0000000..e22a95a --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/FlipDirection.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.FlipDirection +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Layouts +{ + [Flags] + internal enum FlipDirection + { + None = 0, + Horizontal = 1, + Vertical = 2, + Both = Vertical | Horizontal, // 0x00000003 + } +} diff --git a/UIX/Microsoft/Iris/Layouts/FlowLayout.cs b/UIX/Microsoft/Iris/Layouts/FlowLayout.cs new file mode 100644 index 0000000..173ae88 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/FlowLayout.cs @@ -0,0 +1,790 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.FlowLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.ViewItems; +using System; + +namespace Microsoft.Iris.Layouts +{ + internal class FlowLayout : ILayout + { + private Orientation _orientationFlow; + private MajorMinor _spacingMajorMinor; + private MajorMinor _repeatGapMajorMinor; + private RepeatPolicy _repeat; + private StripAlignment _stripAlignment; + private bool _allowWrapFlag; + private MissingItemPolicy _policyForMissingItems; + private int _minimumSampleSizeValue; + private ItemAlignment _defaultChildAlignment; + + public FlowLayout() + { + _orientationFlow = Orientation.Horizontal; + _minimumSampleSizeValue = 3; + } + + public Orientation Orientation + { + get => _orientationFlow; + set => _orientationFlow = value; + } + + public MajorMinor Spacing + { + get => _spacingMajorMinor; + set => _spacingMajorMinor = value; + } + + public bool AllowWrap + { + get => _allowWrapFlag; + set => _allowWrapFlag = value; + } + + public StripAlignment StripAlignment + { + get => _stripAlignment; + set => _stripAlignment = value; + } + + public RepeatPolicy Repeat + { + get => _repeat; + set => _repeat = value; + } + + public MajorMinor RepeatGap + { + get => _repeatGapMajorMinor; + set => _repeatGapMajorMinor = value; + } + + public MissingItemPolicy MissingItemPolicy + { + get => _policyForMissingItems; + set => _policyForMissingItems = value; + } + + public int MinimumSampleSize + { + get => _minimumSampleSizeValue; + set => _minimumSampleSizeValue = value; + } + + public ItemAlignment DefaultChildAlignment + { + get => _defaultChildAlignment; + set => _defaultChildAlignment = value; + } + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + if (!(layoutNode.MeasureData is FlowLayout.Packet packet)) + { + packet = new FlowLayout.Packet(); + layoutNode.MeasureData = packet; + } + else + packet.Clear(); + packet.Subject = layoutNode; + packet.Constraint = constraint; + packet.Available = new MajorMinor(constraint, Orientation); + packet.Cache = (FlowSizeMemoryLayoutInput)packet.Subject.GetLayoutInput(FlowSizeMemoryLayoutInput.Data); + packet.RepeatOrientation = Orientation; + if (AllowWrap) + packet.RepeatOrientation = Orientation == Orientation.Vertical ? Orientation.Horizontal : Orientation.Vertical; + DetermineCount(packet); + if (layoutNode.LayoutChildrenCount == 0) + { + if (packet.PotentialCount > 0) + layoutNode.RequestMoreChildren(1); + return Size.Zero; + } + CreateRecordsFromChildren(packet); + HandleMissingRecords(packet); + MeasureRecords(packet); + if (packet.DesiredSize.IsEmpty && packet.PotentialCount != layoutNode.LayoutChildrenCount) + layoutNode.RequestMoreChildren(1); + return packet.DesiredSize.ToSize(Orientation); + } + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + if (layoutNode.LayoutChildrenCount == 0) + return; + FlowLayout.Packet measureData = (FlowLayout.Packet)layoutNode.MeasureData; + measureData.Slot = slot; + Rectangle peripheralView = slot.PeripheralView; + Rectangle view = slot.View; + measureData.PeripheralStart = new MajorMinor(new Size(peripheralView.Location), measureData.RepeatOrientation); + measureData.PeripheralSize = new MajorMinor(peripheralView.Size, measureData.RepeatOrientation); + measureData.PeripheralEnd = measureData.PeripheralStart + measureData.PeripheralSize; + measureData.ViewStart = new MajorMinor(new Size(view.Location), measureData.RepeatOrientation); + measureData.ViewSize = new MajorMinor(view.Size, measureData.RepeatOrientation); + measureData.ViewEnd = measureData.ViewStart + measureData.ViewSize; + DetermineRepeatPolicy(measureData); + ArrangeChildren(measureData); + CalculateVisualIntersections(measureData); + RequestMissingChildren(measureData); + MajorMinor majorMinor = measureData.DesiredSize; + if (measureData.Repeat) + { + majorMinor = new MajorMinor(measureData.Available.Major, measureData.DesiredSize.Minor); + Rectangle rectangle = new Rectangle(new MajorMinor(-measureData.Available.Major / 2, 0).ToPoint(_orientationFlow), majorMinor.ToSize(_orientationFlow)); + layoutNode.AddAreaOfInterest(new AreaOfInterest(rectangle, AreaOfInterestID.ScrollableRange)); + } + layoutNode.SetVisibleIndexRange(measureData.BeginVisible, measureData.EndVisible, measureData.BeginVisibleOffscreen, measureData.EndVisibleOffscreen, measureData.FocusedItem); + } + + private void DetermineCount(FlowLayout.Packet packet) + { + int num = !(packet.Subject.GetLayoutInput(CountLayoutInput.Data) is CountLayoutInput layoutInput) ? packet.Subject.LayoutChildrenCount : layoutInput.Count; + packet.PotentialCount = num; + } + + private void InitializeRecordList(ref Vector recordList, int count) + { + if (recordList == null) + { + recordList = new Vector(count); + } + else + { + int count1 = recordList.Count - count; + if (count1 > 0) + recordList.RemoveRange(count, count1); + foreach (FlowLayout.Record record in recordList) + record?.Clear(); + } + for (int count1 = recordList.Count; count1 < count; ++count1) + recordList.Add(null); + } + + private void CreateRecordsFromChildren(FlowLayout.Packet packet) + { + InitializeRecordList(ref packet.Records, packet.PotentialCount); + Vector availableDataIndices = packet.AvailableDataIndices; + Vector availableVirtualIndices = packet.AvailableVirtualIndices; + bool flag = false; + int childIndex = 0; + foreach (ILayoutNode layoutChild in packet.Subject.LayoutChildren) + { + int virtualIndex; + int dataIndex; + IndexType type; + GetIndex(layoutChild, childIndex, packet.PotentialCount, out virtualIndex, out dataIndex, out int _, out type); + Vector vector = packet.Records; + if (type == IndexType.Content) + { + availableVirtualIndices.Add(virtualIndex); + } + else + { + if (!flag) + { + InitializeRecordList(ref packet.Dividers, packet.PotentialCount); + flag = true; + } + vector = packet.Dividers; + } + FlowLayout.Record record1 = vector[dataIndex]; + if (Record.IsNullOrEmpty(record1)) + { + FlowLayout.Record record2 = record1; + if (record2 == null) + vector[dataIndex] = record2 = new FlowLayout.Record(); + record2.Initialize(RecordSourceType.LayoutNode); + if (record2.Nodes == null) + record2.Nodes = new Vector(1); + record2.Nodes.Add(layoutChild); + record2.Index = dataIndex; + if (type == IndexType.Content) + { + availableDataIndices.Add(record2.Index); + } + else + { + layoutChild.Measure(packet.Constraint); + record2.Size = new MajorMinor(layoutChild.DesiredSize, Orientation); + record2.SizeValid = true; + } + } + else + record1.Nodes.Add(layoutChild); + ++childIndex; + } + if (packet.Cache == null) + { + packet.Cache = new FlowSizeMemoryLayoutInput(); + packet.Subject.SetLayoutInput(packet.Cache, false); + } + else + { + int index = 0; + foreach (Size knownSiz in packet.Cache.KnownSizes) + { + if (index >= packet.Records.Count) + break; + if (!knownSiz.IsEmpty) + { + MajorMinor majorMinor = new MajorMinor(knownSiz, Orientation); + if (!AllowWrap) + majorMinor = new MajorMinor(majorMinor.Major, 0); + FlowLayout.Record record = packet.Records[index]; + if (!Record.IsNullOrEmpty(record)) + { + record.CachedSize = majorMinor; + } + else + { + if (record == null) + packet.Records[index] = record = new FlowLayout.Record(); + record.Initialize(RecordSourceType.SizeCache); + record.Index = index; + record.CachedSize = majorMinor; + } + ++index; + } + } + } + } + + private void GetIndex( + ILayoutNode childNode, + int childIndex, + int itemsCount, + out int virtualIndex, + out int dataIndex, + out int generationValue, + out IndexType type) + { + IndexLayoutInput layoutInput = (IndexLayoutInput)childNode.GetLayoutInput(IndexLayoutInput.Data); + if (layoutInput != null) + { + virtualIndex = layoutInput.Index.Value; + ListUtility.GetWrappedIndex(virtualIndex, itemsCount, out dataIndex, out generationValue); + type = layoutInput.Type; + } + else + { + virtualIndex = childIndex; + dataIndex = childIndex; + generationValue = 0; + type = IndexType.Content; + } + } + + private void HandleMissingRecords(FlowLayout.Packet packet) + { + int count = packet.AvailableDataIndices.Count; + if (packet.PotentialCount - count == 0) + return; + MissingItemPolicy missingItemPolicy = MissingItemPolicy; + if (count < _minimumSampleSizeValue) + missingItemPolicy = MissingItemPolicy.Wait; + MajorMinor a = MissingItemPolicy != MissingItemPolicy.SizeToSmallest ? MajorMinor.Zero : new MajorMinor(16777215, 16777215); + for (int index = 0; index < packet.Records.Count; ++index) + { + FlowLayout.Record record = packet.Records[index]; + if (!Record.IsNullOrEmpty(record)) + { + if (ListUtility.IsNullOrEmpty(record.Nodes)) + ++count; + switch (missingItemPolicy) + { + case MissingItemPolicy.SizeToAverage: + a += record.CachedSize; + continue; + case MissingItemPolicy.SizeToSmallest: + a = MajorMinor.Min(a, record.CachedSize); + continue; + case MissingItemPolicy.SizeToLargest: + a = MajorMinor.Max(a, record.CachedSize); + continue; + default: + continue; + } + } + } + if (packet.PotentialCount == count) + return; + if (missingItemPolicy == MissingItemPolicy.SizeToAverage) + { + 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) + { + FlowLayout.Record record = packet.Records[index]; + if (Record.IsNullOrEmpty(record)) + { + if (record == null) + packet.Records[index] = record = new FlowLayout.Record(); + record.Initialize(RecordSourceType.Fake); + record.Index = index; + record.CachedSize = a; + } + } + } + + private void MeasureRecords(FlowLayout.Packet packet) + { + MajorMinor offset = MajorMinor.Zero; + MajorMinor zero = MajorMinor.Zero; + int num1 = 0; + int num2 = 0; + MajorMinor stripSize = MajorMinor.Zero; + int lastLaidOutIndex = -1; + int count = packet.Records.Count; + for (int index = 0; index < packet.Records.Count; ++index) + { + FlowLayout.Record record = packet.Records[index]; + MeasureRecord(packet, record, offset); + MajorMinor majorMinor1 = offset + record.Size; + MajorMinor majorMinor2 = packet.Available - majorMinor1; + if (majorMinor2.Minor < 0) + { + record.SizeValid = false; + break; + } + if (majorMinor2.Major < 0) + { + if (AllowWrap) + { + if (num2 == 0) + { + record.SizeValid = false; + break; + } + FinalizeStrip(packet, stripSize, offset, ref zero); + ++num1; + num2 = 0; + stripSize = MajorMinor.Zero; + offset = new MajorMinor(0, zero.Minor + Spacing.Minor); + --index; + } + else + break; + } + else + { + record.Strip = num1; + record.Offset = offset; + FlowLayout.Record divider = GetDivider(packet, record); + if (divider != null) + { + if (num2 > 0) + { + MajorMinor majorMinor3 = offset; + majorMinor3.Major -= (Spacing.Major + divider.Size.Major) / 2; + divider.Offset = majorMinor3; + divider.Strip = num1; + } + else + divider.Size = MajorMinor.Zero; + } + ++num2; + stripSize = new MajorMinor(majorMinor1.Major, Math.Max(record.Size.Minor, stripSize.Minor)); + offset.Major = majorMinor1.Major + Spacing.Major; + lastLaidOutIndex = index; + } + } + if (num2 != 0) + { + HandleLastItem(packet, ref lastLaidOutIndex, ref offset, ref stripSize); + FinalizeStrip(packet, stripSize, offset, ref zero); + } + packet.LastLaidOutRecord = lastLaidOutIndex; + packet.StoppedAtRecord = count; + packet.DesiredSize = zero; + } + + private void MeasureRecord( + FlowLayout.Packet packet, + FlowLayout.Record record, + MajorMinor offset) + { + if (record.SizeValid) + return; + Size childConstraint = GetChildConstraint(packet, offset); + record.Size = MajorMinor.Zero; + if (record.Nodes != null && record.Nodes.Count > 0) + { + for (int index = 0; index < record.Nodes.Count; ++index) + { + ILayoutNode node = record.Nodes[index]; + GetIndex(node, 0, packet.PotentialCount, out int _, out int _, out int _, out IndexType _); + node.Measure(childConstraint); + MajorMinor a = new MajorMinor(node.DesiredSize, Orientation); + 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(Orientation); + } + else + record.Size = record.CachedSize; + record.SizeValid = true; + } + + private Size GetChildConstraint(FlowLayout.Packet packet, MajorMinor offset) + { + Size constraint = packet.Constraint; + return AllowWrap ? constraint : (packet.Available - offset).ToSize(Orientation); + } + + private void FinalizeStrip( + FlowLayout.Packet packet, + MajorMinor stripSize, + MajorMinor offset, + ref MajorMinor desiredSize) + { + packet.StripSizes.Add(stripSize); + desiredSize = new MajorMinor(Math.Max(desiredSize.Major, stripSize.Major), offset.Minor + stripSize.Minor); + } + + private FlowLayout.Record GetDivider( + FlowLayout.Packet packet, + FlowLayout.Record record) + { + return packet.Dividers == null ? null : packet.Dividers[record.Index]; + } + + private void HandleLastItem( + FlowLayout.Packet packet, + ref int lastLaidOutIndex, + ref MajorMinor offset, + ref MajorMinor stripSize) + { + int index = lastLaidOutIndex + 1; + if (index == packet.Records.Count) + return; + FlowLayout.Record record = packet.Records[index]; + if (ListUtility.IsNullOrEmpty(record.Nodes)) + return; + Size size = (packet.Available - offset).ToSize(Orientation); + foreach (ILayoutNode node in record.Nodes) + node.Measure(size); + Size desiredSize = record.Nodes[0].DesiredSize; + if (desiredSize.Width > size.Width || desiredSize.Height > size.Height) + return; + record.Size = new MajorMinor(desiredSize, Orientation); + record.SizeValid = true; + int major = offset.Major + record.Size.Major; + offset = new MajorMinor(major + Spacing.Major, offset.Minor); + lastLaidOutIndex = index; + stripSize = new MajorMinor(major, Math.Max(record.Size.Minor, stripSize.Minor)); + } + + private void DetermineRepeatPolicy(FlowLayout.Packet packet) + { + MajorMinor majorMinor = new MajorMinor(packet.Slot.View.Size, Orientation); + bool flag1 = packet.DesiredSize.Major <= majorMinor.Major; + bool flag2; + switch (Repeat) + { + case RepeatPolicy.WhenTooBig: + flag2 = !flag1; + break; + case RepeatPolicy.WhenTooSmall: + flag2 = flag1; + break; + case RepeatPolicy.Always: + flag2 = true; + break; + default: + flag2 = false; + break; + } + packet.Repeat = flag2; + } + + private void CalculateVisualIntersections(FlowLayout.Packet packet) + { + if (packet.DesiredSize.IsEmpty) + { + packet.BeginVisible = packet.BeginVisibleOffscreen = 0; + packet.EndVisible = packet.EndVisibleOffscreen = packet.LastLaidOutRecord + 1; + } + else + { + int major1 = packet.PeripheralStart.Major; + int major2 = packet.ViewStart.Major; + int major3 = packet.ViewEnd.Major; + int major4 = packet.PeripheralEnd.Major; + packet.BeginVisibleOffscreen = IndexFromPosition(packet, major1, false) - 1; + packet.BeginVisible = packet.BeginVisibleOffscreen; + if (major2 != major1) + packet.BeginVisible = IndexFromPosition(packet, major2, false) - 1; + packet.EndVisible = IndexFromPosition(packet, major3, false); + packet.EndVisibleOffscreen = packet.EndVisible; + if (major4 == major3) + return; + packet.EndVisibleOffscreen = IndexFromPosition(packet, major4, false); + } + } + + private int GetRepeatMajor(FlowLayout.Packet packet, MajorMinor majorMinor) => Orientation != packet.RepeatOrientation ? majorMinor.Minor : majorMinor.Major; + + private int IndexFromPosition(FlowLayout.Packet packet, int position, bool exactMatch) + { + int dataIndex1 = position; + int generationValue = 0; + if (packet.PotentialCount == packet.LastLaidOutRecord + 1) + { + int itemsCount = GetRepeatMajor(packet, packet.DesiredSize) + GetRepeatMajor(packet, RepeatGap); + ListUtility.GetWrappedIndex(position, itemsCount, out dataIndex1, out generationValue); + } + int dataIndex2 = packet.PotentialCount; + for (int index = 0; index < packet.Records.Count; ++index) + { + FlowLayout.Record record = packet.Records[index]; + if (exactMatch && GetRepeatMajor(packet, record.Offset) <= dataIndex1 && GetRepeatMajor(packet, record.Offset) + GetRepeatMajor(packet, record.Size) >= dataIndex1) + { + dataIndex2 = record.Index; + break; + } + if (index == packet.StoppedAtRecord) + { + dataIndex2 = packet.PotentialCount; + break; + } + if (GetRepeatMajor(packet, record.Offset) >= dataIndex1 || index > packet.LastLaidOutRecord) + { + dataIndex2 = record.Index; + break; + } + } + int num = dataIndex2; + if (packet.PotentialCount == packet.LastLaidOutRecord + 1) + num = ListUtility.GetUnwrappedIndex(dataIndex2, generationValue, packet.PotentialCount); + return num; + } + + private void FilterIntersectionPoints(FlowLayout.Packet packet) + { + int num1 = packet.BeginVisibleOffscreen; + int num2 = packet.EndVisibleOffscreen; + if (!packet.Repeat) + { + num1 = 0; + num2 = packet.PotentialCount; + } + if (packet.LastLaidOutRecord < packet.PotentialCount - 1) + { + num1 = Math.Max(Math.Min(num1, packet.LastLaidOutRecord), 0); + num2 = Math.Max(Math.Min(num2, packet.LastLaidOutRecord + 2), num1 + 1); + } + if (num1 == packet.BeginVisibleOffscreen && num2 == packet.EndVisibleOffscreen) + return; + packet.BeginVisibleOffscreen = Math2.Clamp(packet.BeginVisibleOffscreen, num1, num2); + packet.BeginVisible = Math2.Clamp(packet.BeginVisible, num1, num2); + packet.BeginVisible = Math.Max(packet.BeginVisible, packet.BeginVisibleOffscreen); + packet.EndVisible = Math.Max(packet.EndVisible, packet.BeginVisible + 1); + packet.EndVisible = Math2.Clamp(packet.EndVisible, num1, num2); + packet.EndVisibleOffscreen = Math2.Clamp(packet.EndVisibleOffscreen, num1, num2); + packet.EndVisibleOffscreen = Math.Max(packet.EndVisibleOffscreen, packet.EndVisible); + } + + private void RequestMissingChildren(FlowLayout.Packet packet) + { + FilterIntersectionPoints(packet); + int visibleOffscreen = packet.BeginVisibleOffscreen; + int num1 = packet.EndVisibleOffscreen - 1; + int num2 = -1; + if (packet.AvailableDataIndices.Count < _minimumSampleSizeValue) + num2 = _minimumSampleSizeValue; + Vector indiciesList = null; + for (int index = visibleOffscreen; index <= num1; ++index) + { + if (!IntListUtility.Contains(packet.AvailableVirtualIndices, index)) + { + if (indiciesList == null) + indiciesList = packet.Subject.GetSpecificChildrenRequestList(); + indiciesList.Add(index); + if (num2 > 0 && indiciesList.Count >= num2) + break; + } + } + if (ListUtility.IsNullOrEmpty(indiciesList)) + return; + packet.Subject.RequestSpecificChildren(indiciesList); + } + + private void ArrangeChildren(FlowLayout.Packet packet) + { + MajorMinor majorMinor1 = MajorMinor.Zero; + int strip = -1; + int childIndex = 0; + foreach (ILayoutNode layoutChild in packet.Subject.LayoutChildren) + { + int virtualIndex; + int dataIndex; + int generationValue; + IndexType type; + GetIndex(layoutChild, childIndex, packet.PotentialCount, out virtualIndex, out dataIndex, out generationValue, out type); + FlowLayout.Record record = type != IndexType.Content ? packet.Dividers[dataIndex] : packet.Records[dataIndex]; + if (!record.SizeValid) + { + layoutChild.MarkHidden(); + } + else + { + if (type == IndexType.Content && strip != record.Strip) + { + strip = record.Strip; + majorMinor1 = GetStripOffset(packet, strip); + } + MajorMinor majorMinor2 = PositionFromIndex(packet, record.Offset, generationValue); + majorMinor2.Major += majorMinor1.Major; + Size size = new MajorMinor(new MajorMinor(layoutChild.DesiredSize, Orientation).Major, majorMinor1.Minor).ToSize(Orientation); + Rectangle bounds = new Rectangle(majorMinor2.ToPoint(Orientation), size); + layoutChild.Arrange(packet.Slot, bounds); + if (layoutChild.ContainsAreaOfInterest(AreaOfInterestID.Focus)) + packet.FocusedItem = new int?(virtualIndex); + ++childIndex; + } + } + } + + private MajorMinor GetStripOffset(FlowLayout.Packet packet, int strip) + { + MajorMinor zero = MajorMinor.Zero; + if (strip >= 0 && strip < packet.StripSizes.Count) + { + MajorMinor stripSiz = packet.StripSizes[strip]; + MajorMinor majorMinor1 = new MajorMinor(packet.Slot.Bounds, Orientation); + switch (StripAlignment) + { + case StripAlignment.Center: + zero.Major = (majorMinor1.Major - stripSiz.Major) / 2; + break; + case StripAlignment.Far: + zero.Major = majorMinor1.Major - stripSiz.Major; + break; + } + if (!AllowWrap) + { + MajorMinor majorMinor2 = new MajorMinor(packet.Slot.Bounds, Orientation); + zero.Minor = majorMinor2.Minor; + } + else + zero.Minor = stripSiz.Minor; + } + return zero; + } + + private MajorMinor PositionFromIndex( + FlowLayout.Packet packet, + MajorMinor recordoffset, + int generationValue) + { + if (generationValue == 0) + return recordoffset; + MajorMinor majorMinor = recordoffset; + if (Orientation == packet.RepeatOrientation) + majorMinor.Major = ListUtility.GetUnwrappedIndex(majorMinor.Major, generationValue, packet.DesiredSize.Major + RepeatGap.Major); + else + majorMinor.Minor = ListUtility.GetUnwrappedIndex(majorMinor.Minor, generationValue, packet.DesiredSize.Minor + RepeatGap.Minor); + return majorMinor; + } + + internal class Record + { + public int Index; + public Vector Nodes; + public MajorMinor Size; + public bool SizeValid; + public MajorMinor CachedSize; + public MajorMinor Offset; + public int Strip; + + public static bool IsNullOrEmpty(FlowLayout.Record record) => record == null || record.Index == int.MinValue; + + public void Clear() => Initialize(RecordSourceType.Unspecified); + + public void Initialize(FlowLayout.RecordSourceType source) + { + Index = int.MinValue; + if (Nodes != null) + Nodes.Clear(); + Size = MajorMinor.Zero; + SizeValid = false; + CachedSize = MajorMinor.Zero; + Offset = MajorMinor.Zero; + Strip = 0; + } + + public override string ToString() => InvariantString.Format("Record[{0}] Size:{1}", Index, Size); + } + + internal enum RecordSourceType + { + Unspecified, + LayoutNode, + SizeCache, + Fake, + } + + private class Packet + { + public ILayoutNode Subject; + public Size Constraint; + public LayoutSlot Slot; + public MajorMinor Available; + public FlowSizeMemoryLayoutInput Cache; + public Orientation RepeatOrientation; + public MajorMinor PeripheralStart; + public MajorMinor PeripheralSize; + public MajorMinor PeripheralEnd; + public MajorMinor ViewStart; + public MajorMinor ViewSize; + public MajorMinor ViewEnd; + public Vector Records; + public Vector Dividers; + public int PotentialCount; + public Vector AvailableVirtualIndices = new Vector(); + public Vector AvailableDataIndices = new Vector(); + public MajorMinor DesiredSize; + public Vector StripSizes = new Vector(); + public int LastLaidOutRecord; + public int StoppedAtRecord; + public bool Repeat; + public int BeginVisibleOffscreen; + public int BeginVisible; + public int EndVisible; + public int EndVisibleOffscreen; + public int? FocusedItem; + + public void Clear() + { + PeripheralStart = MajorMinor.Zero; + PeripheralSize = MajorMinor.Zero; + PeripheralEnd = MajorMinor.Zero; + ViewStart = MajorMinor.Zero; + ViewSize = MajorMinor.Zero; + ViewEnd = MajorMinor.Zero; + PotentialCount = 0; + AvailableVirtualIndices.Clear(); + AvailableDataIndices.Clear(); + DesiredSize = MajorMinor.Zero; + StripSizes.Clear(); + LastLaidOutRecord = 0; + StoppedAtRecord = 0; + Repeat = false; + BeginVisibleOffscreen = 0; + BeginVisible = 0; + EndVisible = 0; + EndVisibleOffscreen = 0; + FocusedItem = new int?(); + } + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/FlowSizeMemoryLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/FlowSizeMemoryLayoutInput.cs new file mode 100644 index 0000000..62f4734 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/FlowSizeMemoryLayoutInput.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.FlowSizeMemoryLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System.Text; + +namespace Microsoft.Iris.Layouts +{ + internal class FlowSizeMemoryLayoutInput : ILayoutInput + { + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + private Vector _cache; + + public FlowSizeMemoryLayoutInput() => _cache = new Vector(); + + public Vector KnownSizes + { + get => _cache; + set => _cache = value; + } + + DataCookie ILayoutInput.Data => Data; + + public static DataCookie Data => s_dataProperty; + + public override string ToString() + { + StringBuilder stringBuilder = new StringBuilder(); + bool flag = true; + int num = 0; + foreach (Size size in _cache) + { + if (!flag) + stringBuilder.Append(", "); + flag = false; + stringBuilder.Append("["); + stringBuilder.Append(num); + stringBuilder.Append("]="); + stringBuilder.Append(size); + ++num; + } + return InvariantString.Format("{0}({1})", GetType().Name, stringBuilder); + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/FormLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/FormLayoutInput.cs new file mode 100644 index 0000000..eaee6b2 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/FormLayoutInput.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.FormLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal class FormLayoutInput : AnchorLayoutInput + { + } +} diff --git a/UIX/Microsoft/Iris/Layouts/GridLayout.cs b/UIX/Microsoft/Iris/Layouts/GridLayout.cs new file mode 100644 index 0000000..a5b7989 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/GridLayout.cs @@ -0,0 +1,650 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.GridLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.ViewItems; +using System; + +namespace Microsoft.Iris.Layouts +{ + internal class GridLayout : ILayout + { + private Orientation _orientation; + private bool _allowWrap; + private Size _referenceSize; + private Size _spacing; + private int _rows; + private int _columns; + private RepeatPolicy _repeat; + private int _repeatGap; + private ItemAlignment _defaultChildAlignment; + + public GridLayout() + : this(Orientation.Horizontal) + { + } + + public GridLayout(Orientation o) => _orientation = o; + + public Orientation Orientation + { + get => _orientation; + set + { + if (_orientation == value) + return; + _orientation = value; + } + } + + public bool AllowWrap + { + get => _allowWrap; + set + { + if (_allowWrap == value) + return; + _allowWrap = value; + } + } + + public Size ReferenceSize + { + get => _referenceSize; + set + { + if (!(_referenceSize != value)) + return; + _referenceSize = value; + } + } + + public int Rows + { + get => _rows; + set + { + if (_rows == value) + return; + _rows = value; + } + } + + public int Columns + { + get => _columns; + set + { + if (_columns == value) + return; + _columns = value; + } + } + + public Size Spacing + { + get => _spacing; + set + { + if (!(_spacing != value)) + return; + _spacing = value; + } + } + + public RepeatPolicy Repeat + { + get => _repeat; + set + { + if (_repeat == value) + return; + _repeat = value; + } + } + + public int RepeatGap + { + get => _repeatGap; + set + { + if (_repeatGap == value) + return; + _repeatGap = value; + } + } + + public ItemAlignment DefaultChildAlignment + { + get => _defaultChildAlignment; + set => _defaultChildAlignment = value; + } + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + GridLayout.GeneralFlowInfo generalFlowInfo = CalculateGeneralFlowInfo(layoutNode, constraint); + layoutNode.MeasureData = generalFlowInfo; + if (generalFlowInfo.itemsCount <= 0 || !generalFlowInfo.referenceExtent.IsEmpty) + return generalFlowInfo.usedSize.ToSize(Orientation); + layoutNode.RequestMoreChildren(1); + return Size.Zero; + } + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + GridLayout.GeneralFlowInfo measureData = (GridLayout.GeneralFlowInfo)layoutNode.MeasureData; + measureData.slot = slot; + MajorMinor majorMinor1 = new MajorMinor(slot.View.Size, Orientation); + MajorMinor majorMinor2 = new MajorMinor(slot.PeripheralView.Size, Orientation); + MajorMinor majorMinor3 = new MajorMinor(slot.View.Location.ToSize(), Orientation); + bool flag1 = measureData.availableSpace.Major != majorMinor2.Major || majorMinor3.Major != 0; + bool flag2 = measureData.availableSpace.Minor != majorMinor2.Minor || majorMinor3.Minor != 0; + MajorMinor majorMinor4 = majorMinor2 + measureData.spacing; + MajorMinor majorMinor5 = majorMinor1 + measureData.spacing; + bool roundUp1 = flag1; + bool roundUp2 = flag2; + MajorMinor a = MajorMinor.Zero; + a.Major = DivideIntegers(majorMinor5.Major, measureData.referenceWithSpacing.Major, roundUp1); + a.Minor = DivideIntegers(majorMinor5.Minor, measureData.referenceWithSpacing.Minor, roundUp2); + a.Minor = Math.Min(a.Minor, measureData.fitItems.Minor); + bool flag3 = !measureData.wrapping ? measureData.totalItems.Major <= a.Major : measureData.totalItems.Minor <= a.Minor; + bool flag4; + switch (_repeat) + { + case RepeatPolicy.WhenTooBig: + flag4 = !flag3; + break; + case RepeatPolicy.WhenTooSmall: + flag4 = flag3; + break; + case RepeatPolicy.Always: + flag4 = true; + break; + default: + flag4 = false; + break; + } + if (!flag4) + a = MajorMinor.Min(a, measureData.totalItems); + else + measureData.wrapping |= AllowWrap; + measureData.repeating = flag4; + measureData.allowPartialItemsMajor = roundUp1; + measureData.allowPartialItemsMinor = roundUp2; + measureData.viewSize = majorMinor2; + if (measureData.itemsCount > 0) + { + GridLayout.IndexRangeInfo indicesInfo; + Vector indicesToDisplayList; + ArrangeChildren(layoutNode, measureData, out indicesInfo, out indicesToDisplayList); + if (indicesToDisplayList != null) + layoutNode.RequestSpecificChildren(indicesToDisplayList); + layoutNode.SetVisibleIndexRange(indicesInfo.realBeginIndex, indicesInfo.realEndIndex, indicesInfo.beginIndex, indicesInfo.endIndex, measureData.focusedItemIndex); + } + MajorMinor usedSize = measureData.usedSize; + if (!measureData.repeating) + return; + MajorMinor zero = MajorMinor.Zero; + if (measureData.wrapping) + zero.Minor = -usedSize.Minor / 2; + else + zero.Major = -usedSize.Major / 2; + Rectangle rectangle = new Rectangle(zero.ToPoint(Orientation), usedSize.ToSize(Orientation)); + layoutNode.AddAreaOfInterest(new AreaOfInterest(rectangle, AreaOfInterestID.ScrollableRange)); + } + + private int GetItemCount(ILayoutNode layoutNode) + { + int num = -1; + if (layoutNode.GetLayoutInput(CountLayoutInput.Data) is CountLayoutInput layoutInput) + num = layoutInput.Count; + if (num == -1) + num = layoutNode.LayoutChildrenCount; + return num; + } + + private Size GetReferenceSize(ILayoutNode layoutNode, Size constraint) + { + Size referenceSize = ReferenceSize; + if (referenceSize.Width == 0.0 && Columns != 0) + { + int num = (constraint.Width - Spacing.Width * (Columns - 1)) / Columns; + if (num <= 0) + return Size.Zero; + referenceSize.Width = num; + constraint.Width = num; + } + if (referenceSize.Height == 0.0 && Rows != 0) + { + int num = (constraint.Height - Spacing.Height * (Rows - 1)) / Rows; + if (num <= 0) + return Size.Zero; + referenceSize.Height = num; + constraint.Height = num; + } + if (referenceSize.IsEmpty && layoutNode.LayoutChildrenCount > 0) + { + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + layoutChild.Measure(constraint); + if (referenceSize.Width == 0) + referenceSize.Width = layoutChild.DesiredSize.Width; + if (referenceSize.Height == 0) + referenceSize.Height = layoutChild.DesiredSize.Height; + if (!referenceSize.IsEmpty) + break; + } + } + return referenceSize; + } + + private GridLayout.GeneralFlowInfo CalculateGeneralFlowInfo( + ILayoutNode layoutNode, + Size constraint) + { + int itemCount = GetItemCount(layoutNode); + Size size1 = GetReferenceSize(layoutNode, constraint); + GridLayout.GeneralFlowInfo generalFlowInfo = new GridLayout.GeneralFlowInfo(itemCount, size1, constraint); + if (itemCount == 0 || size1.IsEmpty) + return generalFlowInfo; + if (size1.Width > constraint.Width || size1.Height > constraint.Height) + { + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + layoutChild.MarkHidden(); + generalFlowInfo.referenceExtent = Size.Zero; + return generalFlowInfo; + } + bool flag = AllowWrap; + if (Orientation == Orientation.Vertical && Columns > 1) + flag = true; + else if (Orientation == Orientation.Horizontal && Rows > 1) + flag = true; + MajorMinor majorMinor1 = new MajorMinor(size1, Orientation); + MajorMinor a = new MajorMinor(0, majorMinor1.Minor); + if (!flag && new MajorMinor(ReferenceSize, Orientation).Minor == 0) + { + majorMinor1.Minor = new MajorMinor(constraint, Orientation).Minor; + size1 = majorMinor1.ToSize(Orientation); + } + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + Size size2 = layoutChild.Measure(size1); + a = MajorMinor.Max(a, new MajorMinor(size2, Orientation)); + } + if (!flag) + { + majorMinor1.Minor = a.Minor; + size1 = majorMinor1.ToSize(Orientation); + } + MajorMinor majorMinor2 = new MajorMinor(size1, Orientation); + MajorMinor majorMinor3 = new MajorMinor(Spacing, Orientation); + MajorMinor majorMinor4 = majorMinor2 + majorMinor3; + MajorMinor majorMinor5 = new MajorMinor(constraint, Orientation); + MajorMinor majorMinor6 = majorMinor5 + majorMinor3; + MajorMinor zero1 = MajorMinor.Zero; + zero1.Major = DivideIntegers(majorMinor6.Major, majorMinor4.Major, false); + zero1.Minor = DivideIntegers(majorMinor6.Minor, majorMinor4.Minor, false); + if (zero1.Major >= itemCount) + flag = false; + MajorMinor zero2 = MajorMinor.Zero; + zero2.Major = Math.Min(itemCount, zero1.Major); + zero2.Minor = 1; + if (flag && zero2.Major > 0) + { + zero2.Minor = DivideIntegers(itemCount, zero2.Major, true); + zero2.Minor = Math.Min(zero2.Minor, zero1.Minor); + } + MajorMinor majorMinor7 = majorMinor4 * zero2 - majorMinor3; + MajorMinor majorMinor8 = new MajorMinor(RepeatGap, 0); + if (flag) + majorMinor8 = majorMinor8.Swap(); + MajorMinor majorMinor9 = majorMinor7 + majorMinor8; + MajorMinor majorMinor10 = majorMinor7; + if (Repeat == RepeatPolicy.WhenTooSmall || Repeat == RepeatPolicy.Always) + { + if (flag) + majorMinor10.Minor = majorMinor5.Minor; + else + majorMinor10.Major = majorMinor5.Major; + } + generalFlowInfo.wrapping = flag; + generalFlowInfo.reference = majorMinor2; + generalFlowInfo.spacing = majorMinor3; + generalFlowInfo.referenceWithSpacing = majorMinor4; + generalFlowInfo.availableSpace = majorMinor5; + generalFlowInfo.fitItems = zero1; + generalFlowInfo.totalItems = zero2; + generalFlowInfo.repeatInstanceSize = majorMinor9; + generalFlowInfo.usedSize = majorMinor10; + return generalFlowInfo; + } + + private void ArrangeChildren( + ILayoutNode layoutNode, + GridLayout.GeneralFlowInfo generalInfo, + out GridLayout.IndexRangeInfo indicesInfo, + out Vector indicesToDisplayList) + { + indicesInfo = GetIndexRange(layoutNode, generalInfo); + indicesToDisplayList = null; + if (indicesInfo.nonEmptyRange) + { + indicesToDisplayList = layoutNode.GetSpecificChildrenRequestList(); + for (int beginIndex = indicesInfo.beginIndex; beginIndex <= indicesInfo.endIndex; ++beginIndex) + indicesToDisplayList.Add(beginIndex); + } + if (layoutNode.LayoutChildrenCount == 0) + return; + Size referenceExtent = generalInfo.referenceExtent; + if (!generalInfo.wrapping) + { + if (Orientation == Orientation.Horizontal) + referenceExtent.Height = generalInfo.slot.Bounds.Height; + else + referenceExtent.Width = generalInfo.slot.Bounds.Width; + } + Rectangle rectangle1 = new Rectangle(Point.Zero, generalInfo.slot.Bounds); + int num = 0; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + int idx = num; + if (layoutChild.GetLayoutInput(IndexLayoutInput.Data) is IndexLayoutInput layoutInput) + { + idx = layoutInput.Index.Value; + int type = (int)layoutInput.Type; + } + Point offset = PositionFromIndex(layoutNode, idx, generalInfo, out MajorMinor _); + if (indicesToDisplayList != null) + indicesToDisplayList.Remove(idx); + Rectangle rectangle2 = new Rectangle(offset, referenceExtent); + if (generalInfo.repeating || rectangle1.Contains(rectangle2)) + { + layoutChild.Arrange(generalInfo.slot, rectangle2); + if (layoutChild.ContainsAreaOfInterest(AreaOfInterestID.Focus)) + generalInfo.focusedItemIndex = new int?(idx); + } + else + layoutChild.MarkHidden(); + ++num; + } + } + + private GridLayout.IndexRangeInfo GetIndexRange( + ILayoutNode layoutNode, + GridLayout.GeneralFlowInfo generalInfo) + { + if (generalInfo.totalItems.IsEmpty) + return new GridLayout.IndexRangeInfo(); + MajorMinor position1 = new MajorMinor(generalInfo.slot.PeripheralView.Location.ToSize(), Orientation); + MajorMinor position2 = new MajorMinor(generalInfo.slot.View.Location.ToSize(), Orientation); + MajorMinor majorMinor1 = new MajorMinor(generalInfo.slot.PeripheralView.Size, Orientation); + MajorMinor majorMinor2 = new MajorMinor(generalInfo.slot.View.Size, Orientation); + MajorMinor position3 = position1 + majorMinor1; + MajorMinor position4 = position2 + majorMinor2; + bool flag1 = true; + bool flag2 = true; + int index1; + bool flag3 = flag1 & GetViewIntersectionFromPosition(layoutNode, position1, generalInfo, ViewIntersectionType.BeginOffscreen, out index1); + int index2; + bool flag4 = flag2 & GetViewIntersectionFromPosition(layoutNode, position2, generalInfo, ViewIntersectionType.BeginOnscreen, out index2); + int index3; + bool flag5 = flag3 & GetViewIntersectionFromPosition(layoutNode, position3, generalInfo, ViewIntersectionType.EndOnscreen, out index3); + int index4; + bool flag6 = flag4 & GetViewIntersectionFromPosition(layoutNode, position4, generalInfo, ViewIntersectionType.EndOffscreen, out index4); + return !flag5 ? new GridLayout.IndexRangeInfo() : new GridLayout.IndexRangeInfo(index1, index3, index2, index4, generalInfo); + } + + private Point PositionFromIndex( + ILayoutNode layoutNode, + int idx, + GridLayout.GeneralFlowInfo generalInfo, + out MajorMinor index) + { + int dataIndex; + int generationValue; + ListUtility.GetWrappedIndex(idx, generalInfo.itemsCount, out dataIndex, out generationValue); + index = PositionFromIndex(dataIndex, generalInfo.totalItems); + MajorMinor majorMinor1 = index * generalInfo.referenceWithSpacing; + MajorMinor majorMinor2 = generalInfo.repeatInstanceSize * new MajorMinor(generationValue, generationValue); + if (generalInfo.wrapping) + majorMinor2.Major = 0; + else + majorMinor2.Minor = 0; + return (majorMinor1 + majorMinor2).ToPoint(Orientation); + } + + private MajorMinor PositionFromIndex(int idx, MajorMinor totalItems) + { + if (totalItems.IsEmpty) + return MajorMinor.Zero; + MajorMinor zero = MajorMinor.Zero; + zero.Minor = idx / totalItems.Major; + zero.Major = idx - zero.Minor * totalItems.Major; + return zero; + } + + private bool GetViewIntersectionFromPosition( + ILayoutNode layoutNode, + MajorMinor position, + GridLayout.GeneralFlowInfo generalInfo, + GridLayout.ViewIntersectionType intersectionType, + out int index) + { + MajorMinor repeatInstanceSize = generalInfo.repeatInstanceSize; + MajorMinor majorMinor1 = position; + index = 0; + bool biasUp = false; + bool flag1 = false; + switch (intersectionType) + { + case ViewIntersectionType.BeginOffscreen: + case ViewIntersectionType.BeginOnscreen: + if (!generalInfo.repeating) + flag1 = position.Major >= repeatInstanceSize.Major || position.Minor >= repeatInstanceSize.Minor; + if (generalInfo.wrapping) + position.Major = 0; + biasUp = true; + break; + case ViewIntersectionType.EndOnscreen: + case ViewIntersectionType.EndOffscreen: + if (!generalInfo.repeating) + flag1 = position.Major <= 0 || position.Minor <= 0; + if (generalInfo.wrapping) + position.Major = repeatInstanceSize.Major - 1; + biasUp = false; + break; + } + if (!flag1) + { + if (!generalInfo.repeating) + position = !biasUp ? MajorMinor.Min(position, repeatInstanceSize - new MajorMinor(1, 1)) : MajorMinor.Max(position, MajorMinor.Zero); + bool flag2 = position.Major != majorMinor1.Major; + bool flag3 = position.Minor != majorMinor1.Minor; + int dataIndex1; + int generationValue1; + ListUtility.GetWrappedIndex(position.Major, repeatInstanceSize.Major, out dataIndex1, out generationValue1); + int dataIndex2; + int generationValue2; + ListUtility.GetWrappedIndex(position.Minor, repeatInstanceSize.Minor, out dataIndex2, out generationValue2); + int generation = generationValue1; + if (generalInfo.wrapping) + generation = generationValue2; + MajorMinor majorMinor2 = new MajorMinor(dataIndex1, dataIndex2); + MajorMinor zero = MajorMinor.Zero; + int result1; + zero.Major = Math.DivRem(majorMinor2.Major, generalInfo.referenceWithSpacing.Major, out result1); + int result2; + zero.Minor = Math.DivRem(majorMinor2.Minor, generalInfo.referenceWithSpacing.Minor, out result2); + if (generalInfo.wrapping) + { + if (!flag3) + zero.Minor = ApplyEdgeBias(biasUp, result2, generalInfo.reference.Minor, generalInfo.allowPartialItemsMinor, zero.Minor); + int max = generalInfo.totalItems.Major - 1; + bool flag4 = zero.Minor == generalInfo.totalItems.Minor - 1; + bool flag5 = generalInfo.totalItems.Minor * generalInfo.totalItems.Major > generalInfo.itemsCount; + if (flag4 && flag5) + { + int num = generalInfo.itemsCount % generalInfo.totalItems.Major; + if (num != 0) + max = num - 1; + } + zero.Major = Math2.Clamp(zero.Major, 0, max); + } + else + { + zero.Minor = 0; + if (!flag2) + zero.Major = ApplyEdgeBias(biasUp, result1, generalInfo.reference.Major, generalInfo.allowPartialItemsMajor, zero.Major); + } + index = IndexFromGridPosition(zero, generation, generalInfo, out int _); + } + return !flag1; + } + + private int ApplyEdgeBias( + bool biasUp, + int remainder, + int reference, + bool allowPartialItems, + int currentGridPosition) + { + if (biasUp && (remainder >= reference || remainder != 0 && !allowPartialItems)) + ++currentGridPosition; + else if (!biasUp && (remainder == 0 || remainder < reference && !allowPartialItems)) + --currentGridPosition; + return currentGridPosition; + } + + private int IndexFromGridPosition( + MajorMinor gridPosition, + int generation, + GridLayout.GeneralFlowInfo generalInfo, + out int normalizedIndex) + { + normalizedIndex = gridPosition.Minor * generalInfo.totalItems.Major + gridPosition.Major; + int num = generalInfo.itemsCount * generation; + return normalizedIndex + num; + } + + private static int DivideIntegers(int a, int b, bool roundUp) + { + double num = a / (double)b; + return roundUp ? (int)Math.Ceiling(num) : (int)Math.Floor(num); + } + + private enum ViewIntersectionType + { + BeginOffscreen, + BeginOnscreen, + EndOnscreen, + EndOffscreen, + } + + private class GeneralFlowInfo + { + public Size constraint; + public LayoutSlot slot; + public int itemsCount; + public Size referenceExtent; + public bool repeating; + public bool wrapping; + public bool allowPartialItemsMajor; + public bool allowPartialItemsMinor; + public int? focusedItemIndex; + public MajorMinor reference; + public MajorMinor spacing; + public MajorMinor referenceWithSpacing; + public MajorMinor availableSpace; + public MajorMinor viewSize; + public MajorMinor fitItems; + public MajorMinor totalItems; + public MajorMinor repeatInstanceSize; + public MajorMinor usedSize; + + public GeneralFlowInfo(int itemsCount, Size referenceExtent, Size constraint) + { + this.itemsCount = itemsCount; + this.referenceExtent = referenceExtent; + this.constraint = constraint; + repeating = false; + reference = MajorMinor.Zero; + spacing = MajorMinor.Zero; + referenceWithSpacing = MajorMinor.Zero; + availableSpace = MajorMinor.Zero; + viewSize = MajorMinor.Zero; + totalItems = MajorMinor.Zero; + repeatInstanceSize = MajorMinor.Zero; + usedSize = MajorMinor.Zero; + wrapping = false; + allowPartialItemsMajor = false; + allowPartialItemsMinor = false; + focusedItemIndex = new int?(); + } + } + + private struct IndexRangeInfo + { + private int _beginIndex; + private int _endIndex; + private int _realBeginIndex; + private int _realEndIndex; + private bool _isValid; + + public IndexRangeInfo( + int beginIndex, + int endIndex, + int realBeginIndex, + int realEndIndex, + GridLayout.GeneralFlowInfo generalInfo) + { + if (!generalInfo.repeating) + { + NormalizeRange(beginIndex, endIndex, generalInfo.itemsCount, out beginIndex, out endIndex); + NormalizeRange(realBeginIndex, realEndIndex, generalInfo.itemsCount, out realBeginIndex, out realEndIndex); + } + _beginIndex = beginIndex; + _endIndex = endIndex; + _realBeginIndex = realBeginIndex; + _realEndIndex = realEndIndex; + _isValid = true; + } + + private static void NormalizeRange( + int begin, + int end, + int itemsCount, + out int normalizedBegin, + out int normalizedEnd) + { + int generationValue1; + ListUtility.GetWrappedIndex(begin, itemsCount, out normalizedBegin, out generationValue1); + int generationValue2; + ListUtility.GetWrappedIndex(end, itemsCount, out normalizedEnd, out generationValue2); + if (generationValue2 != generationValue1) + { + normalizedEnd = ListUtility.GetUnwrappedIndex(normalizedEnd, generationValue2 - generationValue1, itemsCount); + normalizedBegin -= normalizedEnd - itemsCount; + normalizedEnd = itemsCount; + } + normalizedBegin = Math2.Clamp(normalizedBegin, 0, itemsCount); + normalizedEnd = Math2.Clamp(normalizedEnd, 0, itemsCount); + } + + public int beginIndex => _beginIndex; + + public int endIndex => _endIndex; + + public int realBeginIndex => _realBeginIndex; + + public int realEndIndex => _realEndIndex; + + public bool nonEmptyRange => _isValid; + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/InterestPoint.cs b/UIX/Microsoft/Iris/Layouts/InterestPoint.cs new file mode 100644 index 0000000..78a96bc --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/InterestPoint.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.InterestPoint +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal enum InterestPoint + { + TopLeft, + TopRight, + BottomLeft, + BottomRight, + Center, + NumPoints, + } +} diff --git a/UIX/Microsoft/Iris/Layouts/KeepAliveLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/KeepAliveLayoutInput.cs new file mode 100644 index 0000000..70f71cd --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/KeepAliveLayoutInput.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.KeepAliveLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Layouts +{ + internal class KeepAliveLayoutInput : ILayoutInput + { + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + private int _count; + + public static bool ShouldKeepVisible(ILayoutNode layoutNode) => layoutNode.GetLayoutInput(Data) != null; + + public int Count + { + get => _count; + set => _count = value; + } + + DataCookie ILayoutInput.Data => Data; + + public static DataCookie Data => s_dataProperty; + + public override string ToString() => InvariantString.Format("{0}", GetType().Name); + } +} diff --git a/UIX/Microsoft/Iris/Layouts/MajorMinor.cs b/UIX/Microsoft/Iris/Layouts/MajorMinor.cs new file mode 100644 index 0000000..0b0acd7 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/MajorMinor.cs @@ -0,0 +1,105 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.MajorMinor +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using System; + +namespace Microsoft.Iris.Layouts +{ + internal struct MajorMinor + { + private int major; + private int minor; + public static readonly MajorMinor Zero = new MajorMinor(0, 0); + + public MajorMinor(int major, int minor) + { + this.major = major; + this.minor = minor; + } + + public MajorMinor(Size size, Orientation o) + { + switch (o) + { + case Orientation.Horizontal: + major = size.Width; + minor = size.Height; + break; + default: + major = size.Height; + minor = size.Width; + break; + } + } + + public SizeF ToSizeF(Orientation o) + { + switch (o) + { + case Orientation.Horizontal: + return new SizeF(major, minor); + default: + return new SizeF(minor, major); + } + } + + public Size ToSize(Orientation o) + { + switch (o) + { + case Orientation.Horizontal: + return new Size(major, minor); + default: + return new Size(minor, major); + } + } + + public Point ToPoint(Orientation o) => ToSize(o).ToPoint(); + + public static MajorMinor Min(MajorMinor a, MajorMinor b) => new MajorMinor(Math.Min(a.Major, b.Major), Math.Min(a.Minor, b.Minor)); + + public static MajorMinor Max(MajorMinor a, MajorMinor b) => new MajorMinor(Math.Max(a.Major, b.Major), Math.Max(a.Minor, b.Minor)); + + public static MajorMinor Clamp(MajorMinor original, MajorMinor min, MajorMinor max) => new MajorMinor(Math2.Clamp(original.Major, min.Major, max.Major), Math2.Clamp(original.Minor, min.Minor, max.Minor)); + + public static MajorMinor operator +(MajorMinor left, MajorMinor right) => new MajorMinor(left.Major + right.Major, left.Minor + right.Minor); + + public static MajorMinor operator -(MajorMinor left, MajorMinor right) => new MajorMinor(left.Major - right.Major, left.Minor - right.Minor); + + public static MajorMinor operator *(MajorMinor left, MajorMinor right) => new MajorMinor(left.Major * right.Major, left.Minor * right.Minor); + + public static MajorMinor operator /(MajorMinor left, MajorMinor right) => new MajorMinor(left.Major / right.Major, left.Minor / right.Minor); + + public static bool operator ==(MajorMinor left, MajorMinor right) => left.Major == right.Major && left.Minor == right.Minor; + + public static bool operator !=(MajorMinor left, MajorMinor right) => !(left == right); + + public override bool Equals(object obj) => obj is MajorMinor majorMinor && majorMinor == this; + + public override int GetHashCode() => major ^ minor; + + public MajorMinor Swap() => new MajorMinor(Minor, Major); + + public int Major + { + get => major; + set => major = value; + } + + public int Minor + { + get => minor; + set => minor = value; + } + + public bool IsEmpty => Major == 0 || Minor == 0; + + public override string ToString() => InvariantString.Format("(Major={0}, Minor={1})", Major, Minor); + } +} diff --git a/UIX/Microsoft/Iris/Layouts/MissingItemPolicy.cs b/UIX/Microsoft/Iris/Layouts/MissingItemPolicy.cs new file mode 100644 index 0000000..f754828 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/MissingItemPolicy.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.MissingItemPolicy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal enum MissingItemPolicy + { + SizeToAverage, + SizeToSmallest, + SizeToLargest, + Wait, + } +} diff --git a/UIX/Microsoft/Iris/Layouts/MouseTarget.cs b/UIX/Microsoft/Iris/Layouts/MouseTarget.cs new file mode 100644 index 0000000..1785d11 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/MouseTarget.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.MouseTarget +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal enum MouseTarget + { + None, + Fixed, + Follow, + } +} diff --git a/UIX/Microsoft/Iris/Layouts/PlacementMode.cs b/UIX/Microsoft/Iris/Layouts/PlacementMode.cs new file mode 100644 index 0000000..f080c1c --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/PlacementMode.cs @@ -0,0 +1,242 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.PlacementMode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal class PlacementMode + { + private PopupPosition[] _popupPositions; + private MouseTarget _mouseTarget; + private bool _usesTargetSize; + private static PlacementMode s_origin; + private static PlacementMode s_left; + private static PlacementMode s_right; + private static PlacementMode s_top; + private static PlacementMode s_bottom; + private static PlacementMode s_center; + private static PlacementMode s_mouseOrigin; + private static PlacementMode s_mouseBottom; + private static PlacementMode s_followMouseOrigin; + private static PlacementMode s_followMouseBottom; + + public PopupPosition[] PopupPositions + { + get => _popupPositions; + set + { + _popupPositions = value; + _usesTargetSize = false; + if (_popupPositions == null) + return; + for (int index = 0; index < _popupPositions.Length; ++index) + { + if (_popupPositions[index].Target != InterestPoint.TopLeft) + { + _usesTargetSize = true; + break; + } + } + } + } + + public MouseTarget MouseTarget + { + get => _mouseTarget; + set => _mouseTarget = value; + } + + internal bool UsesTargetSize => _usesTargetSize; + + public override string ToString() + { + if (this == s_origin) + return "Origin"; + if (this == s_bottom) + return "Bottom"; + if (this == s_top) + return "Top"; + if (this == s_left) + return "Left"; + if (this == s_right) + return "Right"; + if (this == s_center) + return "Center"; + if (this == s_mouseOrigin) + return "MouseOrigin"; + if (this == s_mouseBottom) + return "MouseBottom"; + if (this == s_followMouseOrigin) + return "FollowMouseOrigin"; + return this == s_followMouseBottom ? "FollowMouseBottom" : base.ToString(); + } + + public static PlacementMode Origin + { + get + { + if (s_origin == null) + { + s_origin = new PlacementMode(); + s_origin.PopupPositions = new PopupPosition[1] + { + new PopupPosition(InterestPoint.TopLeft, InterestPoint.TopLeft, FlipDirection.None) + }; + } + return s_origin; + } + } + + public static PlacementMode Bottom + { + get + { + if (s_bottom == null) + { + s_bottom = new PlacementMode(); + s_bottom.PopupPositions = new PopupPosition[2] + { + new PopupPosition(InterestPoint.BottomLeft, InterestPoint.TopLeft, FlipDirection.None), + new PopupPosition(InterestPoint.TopLeft, InterestPoint.BottomLeft, FlipDirection.Vertical) + }; + } + return s_bottom; + } + } + + public static PlacementMode Center + { + get + { + if (s_center == null) + { + s_center = new PlacementMode(); + s_center.PopupPositions = new PopupPosition[1] + { + new PopupPosition(InterestPoint.Center, InterestPoint.Center, FlipDirection.None) + }; + } + return s_center; + } + } + + public static PlacementMode Right + { + get + { + if (s_right == null) + { + s_right = new PlacementMode(); + s_right.PopupPositions = new PopupPosition[4] + { + new PopupPosition(InterestPoint.TopRight, InterestPoint.TopLeft, FlipDirection.None), + new PopupPosition(InterestPoint.BottomRight, InterestPoint.BottomLeft, FlipDirection.Vertical), + new PopupPosition(InterestPoint.TopLeft, InterestPoint.TopRight, FlipDirection.Horizontal), + new PopupPosition(InterestPoint.BottomLeft, InterestPoint.BottomRight, FlipDirection.Both) + }; + } + return s_right; + } + } + + public static PlacementMode Left + { + get + { + if (s_left == null) + { + s_left = new PlacementMode(); + s_left.PopupPositions = new PopupPosition[4] + { + new PopupPosition(InterestPoint.TopLeft, InterestPoint.TopRight, FlipDirection.None), + new PopupPosition(InterestPoint.BottomLeft, InterestPoint.BottomRight, FlipDirection.Vertical), + new PopupPosition(InterestPoint.TopRight, InterestPoint.TopLeft, FlipDirection.Horizontal), + new PopupPosition(InterestPoint.BottomRight, InterestPoint.BottomLeft, FlipDirection.Both) + }; + } + return s_left; + } + } + + public static PlacementMode Top + { + get + { + if (s_top == null) + { + s_top = new PlacementMode(); + s_top.PopupPositions = new PopupPosition[2] + { + new PopupPosition(InterestPoint.TopLeft, InterestPoint.BottomLeft, FlipDirection.None), + new PopupPosition(InterestPoint.BottomLeft, InterestPoint.TopLeft, FlipDirection.Vertical) + }; + } + return s_top; + } + } + + public static PlacementMode MouseOrigin + { + get + { + if (s_mouseOrigin == null) + { + s_mouseOrigin = new PlacementMode(); + s_mouseOrigin.MouseTarget = MouseTarget.Fixed; + s_mouseOrigin.PopupPositions = new PopupPosition[4] + { + new PopupPosition(InterestPoint.TopLeft, InterestPoint.TopLeft, FlipDirection.None), + new PopupPosition(InterestPoint.TopLeft, InterestPoint.TopRight, FlipDirection.Horizontal), + new PopupPosition(InterestPoint.TopLeft, InterestPoint.BottomLeft, FlipDirection.Vertical), + new PopupPosition(InterestPoint.TopLeft, InterestPoint.BottomRight, FlipDirection.Both) + }; + } + return s_mouseOrigin; + } + } + + public static PlacementMode MouseBottom + { + get + { + if (s_mouseBottom == null) + { + s_mouseBottom = new PlacementMode(); + s_mouseBottom.MouseTarget = MouseTarget.Fixed; + s_mouseBottom.PopupPositions = Bottom.PopupPositions; + } + return s_mouseBottom; + } + } + + public static PlacementMode FollowMouseOrigin + { + get + { + if (s_followMouseOrigin == null) + { + s_followMouseOrigin = new PlacementMode(); + s_followMouseOrigin.MouseTarget = MouseTarget.Follow; + s_followMouseOrigin.PopupPositions = MouseOrigin.PopupPositions; + } + return s_followMouseOrigin; + } + } + + public static PlacementMode FollowMouseBottom + { + get + { + if (s_followMouseBottom == null) + { + s_followMouseBottom = new PlacementMode(); + s_followMouseBottom.MouseTarget = MouseTarget.Follow; + s_followMouseBottom.PopupPositions = MouseBottom.PopupPositions; + } + return s_followMouseBottom; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/PopupLayout.cs b/UIX/Microsoft/Iris/Layouts/PopupLayout.cs new file mode 100644 index 0000000..f74349b --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/PopupLayout.cs @@ -0,0 +1,288 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.PopupLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.OS; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Collections; + +namespace Microsoft.Iris.Layouts +{ + internal class PopupLayout : ILayout + { + private const float c_tolerance = 0.01f; + private static DeferredHandler s_checkForLayoutChanges = new DeferredHandler(CheckForLayoutChanges); + private Vector _followMouseSubjects; + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + + internal static DataCookie DataCookie => s_dataProperty; + + public ItemAlignment DefaultChildAlignment => ItemAlignment.Default; + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + if (!(layoutChild.GetLayoutInput(s_dataProperty) is PopupLayoutInput layoutInput) || !layoutInput.ConstrainToTarget) + layoutChild.Measure(constraint); + } + layoutNode.RequestMoreChildren(int.MaxValue); + return constraint; + } + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + bool hook = false; + ViewItem viewItem = (ViewItem)layoutNode; + if (layoutNode.LayoutChildrenCount > 0) + { + RectangleF layoutBounds = new RectangleF(PointF.Zero, new SizeF(slot.Bounds.Width, slot.Bounds.Height)); + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + if (!(layoutChild.GetLayoutInput(s_dataProperty) is PopupLayoutInput layoutInput)) + layoutInput = PopupLayoutInput.Default; + if (layoutInput.TargetIsFollowMouse) + hook = true; + ViewItem child = (ViewItem)layoutChild; + Point zero = Point.Zero; + Size size = Size.Zero; + RectangleF placementTargetRect = GetPlacementTargetRect(child, viewItem, layoutInput, slot); + if (layoutInput.ConstrainToTarget) + { + size = new Size((int)placementTargetRect.Width, (int)placementTargetRect.Height); + layoutChild.Measure(size); + } + else + size = layoutChild.DesiredSize; + Point childPosition = GetChildPosition(viewItem, layoutBounds, layoutInput, layoutChild, child, slot, placementTargetRect); + layoutChild.Arrange(slot, new Rectangle(childPosition, size)); + } + } + HookMousePositionChanged(viewItem, hook); + } + + private Point GetChildPosition( + ViewItem layoutElement, + RectangleF layoutBounds, + PopupLayoutInput layoutInput, + ILayoutNode childNode, + ViewItem child, + LayoutSlot slot, + RectangleF placementRect) + { + PlacementMode placement = layoutInput.Placement; + if (placement == null || ListUtility.IsNullOrEmpty(placement.PopupPositions)) + return Point.Zero; + PointF[] interestPoints = InterestPointsFromRect(placementRect); + PointF[] childInterestPoints = GetChildInterestPoints(childNode); + GetBounds(interestPoints); + RectangleF bounds = GetBounds(childInterestPoints); + double width = bounds.Width; + double height = bounds.Height; + bool flag1 = layoutInput.RespectMenuDropAlignment && Win32Api.GetMenuDropAlignment(); + PointF bestPosition = PointF.Zero; + float num1 = -1f; + FlipDirection flipDirection = FlipDirection.None; + int length = placement.PopupPositions.Length; + for (int index = 0; index < length; ++index) + { + PopupPosition popupPosition = placement.PopupPositions[index]; + InterestPoint target = popupPosition.Target; + InterestPoint popup = popupPosition.Popup; + SizeF sizeF = interestPoints[(int)target] - childInterestPoints[(int)popup]; + PointF pos = new PointF(sizeF.Width, sizeF.Height); + RectangleF b = RectangleF.Offset(bounds, pos); + RectangleF rectangleF = RectangleF.Intersect(layoutBounds, b); + float num2 = !rectangleF.IsEmpty ? rectangleF.Width * rectangleF.Height : 0.0f; + bool flag2 = (popupPosition.Flipped & FlipDirection.Horizontal) == FlipDirection.Horizontal; + bool flag3 = (popupPosition.Flipped & FlipDirection.Vertical) == FlipDirection.Vertical; + if (flag2 && flag1 || !flag2 && !flag1) + num2 += 0.1f; + if (!flag3) + num2 += 0.1f; + if (num2 - (double)num1 > 0.00999999977648258) + { + bestPosition = pos; + num1 = num2; + flipDirection = popupPosition.Flipped; + } + if (!layoutInput.StayInBounds) + break; + } + layoutInput.FlippedHorizontally = (flipDirection & FlipDirection.Horizontal) == FlipDirection.Horizontal; + layoutInput.FlippedVertically = (flipDirection & FlipDirection.Vertical) == FlipDirection.Vertical; + if (layoutInput.StayInBounds) + bestPosition = NudgeIntoBounds(layoutBounds, bestPosition, bounds, placement); + return new Point((int)bestPosition.X, (int)bestPosition.Y); + } + + private RectangleF GetPlacementTargetRect( + ViewItem child, + ViewItem layoutElement, + PopupLayoutInput layoutInput, + LayoutSlot slot) + { + PlacementMode placement = layoutInput.Placement; + ViewItem placementTarget = layoutInput.PlacementTarget; + bool flag = false; + RectangleF rectangleF; + if (layoutInput.TargetIsMouse || layoutInput.TargetIsFollowMouse) + { + if (layoutInput.MouseRect == RectangleF.Zero || layoutInput.TargetIsFollowMouse) + layoutInput.MouseRect = GetMouseRect(placement); + rectangleF = layoutInput.MouseRect; + flag = true; + } + else if (placementTarget == null || placementTarget.IsDisposed) + { + rectangleF = new RectangleF(Point.Zero, slot.Bounds); + } + else + { + rectangleF = placementTarget.BoundsRelativeToAncestor(null); + flag = true; + PopupLayout.PlacementTargetInfo placementTargetInfo = new PopupLayout.PlacementTargetInfo(child, placementTarget, rectangleF); + DeferredCall.Post(DispatchPriority.LayoutSync, s_checkForLayoutChanges, placementTargetInfo); + } + rectangleF.Offset(layoutInput.Offset.X, layoutInput.Offset.Y); + if (flag) + rectangleF = layoutElement.TransformFromAncestor(null, rectangleF); + return rectangleF; + } + + private static void CheckForLayoutChanges(object args) + { + PopupLayout.PlacementTargetInfo placementTargetInfo = (PopupLayout.PlacementTargetInfo)args; + if (placementTargetInfo.placementTarget.IsDisposed || placementTargetInfo.child.IsDisposed) + return; + RectangleF ancestor = placementTargetInfo.placementTarget.BoundsRelativeToAncestor(null); + if (!(placementTargetInfo.bounds != ancestor)) + return; + placementTargetInfo.child.MarkLayoutInvalid(); + } + + private PointF[] GetChildInterestPoints(ILayoutNode childNode) + { + Size desiredSize = childNode.DesiredSize; + return InterestPointsFromRect(new RectangleF(0.0f, 0.0f, desiredSize.Width, desiredSize.Height)); + } + + private static PointF[] InterestPointsFromRect(RectangleF rect) => new PointF[5] + { + rect.TopLeft, + rect.TopRight, + rect.BottomLeft, + rect.BottomRight, + rect.Center + }; + + private RectangleF GetBounds(PointF[] interestPoints) + { + float num1; + float x1 = num1 = interestPoints[0].X; + float num2; + float y1 = num2 = interestPoints[0].Y; + for (int index = 1; index < interestPoints.Length; ++index) + { + float x2 = interestPoints[index].X; + float y2 = interestPoints[index].Y; + if (x2 < (double)x1) + x1 = x2; + if (x2 > (double)num1) + num1 = x2; + if (y2 < (double)y1) + y1 = y2; + if (y2 > (double)num2) + num2 = y2; + } + return new RectangleF(x1, y1, num1 - x1, num2 - y1); + } + + private PointF NudgeIntoBounds( + RectangleF layoutBounds, + PointF bestPosition, + RectangleF childBounds, + PlacementMode placement) + { + bestPosition.X = Math2.Clamp(bestPosition.X, layoutBounds.Left, layoutBounds.Right - childBounds.Width); + bestPosition.Y = Math2.Clamp(bestPosition.Y, layoutBounds.Top, layoutBounds.Bottom - childBounds.Height); + return bestPosition; + } + + private RectangleF GetMouseRect(PlacementMode placement) + { + Point physicalMousePos = UISession.Default.InputManager.MostRecentPhysicalMousePos; + if (!placement.UsesTargetSize) + return new RectangleF(physicalMousePos.X, physicalMousePos.Y, 0.0f, 0.0f); + int height; + int hotY; + NativeApi.SpGetMouseCursorInfo(out height, out hotY); + return new RectangleF(physicalMousePos.X, physicalMousePos.Y - hotY - 1, 0.0f, height + 2); + } + + private void HookMousePositionChanged(ViewItem subject, bool hook) + { + if ((_followMouseSubjects != null && _followMouseSubjects.Contains(subject)) == hook) + return; + if (hook) + { + if (_followMouseSubjects == null) + { + _followMouseSubjects = new Vector(); + UISession.Default.InputManager.MousePositionChanged += new EventHandler(OnMousePositionChanged); + } + _followMouseSubjects.Add(subject); + } + else + { + _followMouseSubjects.Remove(subject); + if (_followMouseSubjects.Count != 0) + return; + _followMouseSubjects = null; + UISession.Default.InputManager.MousePositionChanged -= new EventHandler(OnMousePositionChanged); + } + } + + private void OnMousePositionChanged(object sender, EventArgs args) + { + for (int index = 0; index < _followMouseSubjects.Count; ++index) + { + ViewItem followMouseSubject = _followMouseSubjects[index]; + if (followMouseSubject.Layout == this && !followMouseSubject.IsDisposed) + { + followMouseSubject.MarkLayoutInvalid(); + } + else + { + HookMousePositionChanged(followMouseSubject, false); + if (_followMouseSubjects == null) + break; + --index; + } + } + } + + private class PlacementTargetInfo + { + public ViewItem child; + public ViewItem placementTarget; + public RectangleF bounds; + + public PlacementTargetInfo(ViewItem child, ViewItem placementTarget, RectangleF bounds) + { + this.child = child; + this.placementTarget = placementTarget; + this.bounds = bounds; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/PopupLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/PopupLayoutInput.cs new file mode 100644 index 0000000..d1a7092 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/PopupLayoutInput.cs @@ -0,0 +1,120 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.PopupLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Layouts +{ + internal class PopupLayoutInput : NotifyObjectBase, ILayoutInput + { + private ViewItem _target; + private PlacementMode _placementMode; + private Point _offset; + private bool _stayInBounds; + private bool _respectMenuDropAlignment; + private bool _constrainToTarget; + private RectangleF _mouseRect = RectangleF.Zero; + private bool _flippedHorizontally; + private bool _flippedVertically; + private static PopupLayoutInput s_default; + + public PopupLayoutInput() + { + _stayInBounds = true; + _respectMenuDropAlignment = true; + Placement = PlacementMode.Origin; + } + + public ViewItem PlacementTarget + { + get => _target; + set => _target = value; + } + + public PlacementMode Placement + { + get => _placementMode; + set => _placementMode = value; + } + + public Point Offset + { + get => _offset; + set => _offset = value; + } + + public bool StayInBounds + { + get => _stayInBounds; + set => _stayInBounds = value; + } + + public bool RespectMenuDropAlignment + { + get => _respectMenuDropAlignment; + set => _respectMenuDropAlignment = value; + } + + public bool ConstrainToTarget + { + get => _constrainToTarget; + set => _constrainToTarget = value; + } + + DataCookie ILayoutInput.Data => Data; + + internal static DataCookie Data => PopupLayout.DataCookie; + + internal RectangleF MouseRect + { + get => _mouseRect; + set => _mouseRect = value; + } + + public bool FlippedHorizontally + { + get => _flippedHorizontally; + set + { + if (_flippedHorizontally == value) + return; + _flippedHorizontally = value; + FireNotification(NotificationID.FlippedHorizontally); + } + } + + public bool FlippedVertically + { + get => _flippedVertically; + set + { + if (_flippedVertically == value) + return; + _flippedVertically = value; + FireNotification(NotificationID.FlippedVertically); + } + } + + internal bool TargetIsMouse => _placementMode != null && _placementMode.MouseTarget == MouseTarget.Fixed; + + internal bool TargetIsFollowMouse => _placementMode != null && _placementMode.MouseTarget == MouseTarget.Follow; + + internal static PopupLayoutInput Default + { + get + { + if (s_default == null) + s_default = new PopupLayoutInput(); + return s_default; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/PopupPosition.cs b/UIX/Microsoft/Iris/Layouts/PopupPosition.cs new file mode 100644 index 0000000..1f47a5a --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/PopupPosition.cs @@ -0,0 +1,40 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.PopupPosition +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal struct PopupPosition + { + private InterestPoint _popup; + private InterestPoint _target; + private FlipDirection _flipDirection; + + public PopupPosition(InterestPoint target, InterestPoint popup, FlipDirection flipDirection) + { + _target = target; + _popup = popup; + _flipDirection = flipDirection; + } + + public InterestPoint Target + { + get => _target; + set => _target = value; + } + + public InterestPoint Popup + { + get => _popup; + set => _popup = value; + } + + public FlipDirection Flipped + { + get => _flipDirection; + set => _flipDirection = value; + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/RelativeEdge.cs b/UIX/Microsoft/Iris/Layouts/RelativeEdge.cs new file mode 100644 index 0000000..e188632 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/RelativeEdge.cs @@ -0,0 +1,14 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.RelativeEdge +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal enum RelativeEdge + { + Near, + Far, + } +} diff --git a/UIX/Microsoft/Iris/Layouts/RepeatPolicy.cs b/UIX/Microsoft/Iris/Layouts/RepeatPolicy.cs new file mode 100644 index 0000000..9a42864 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/RepeatPolicy.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.RepeatPolicy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal enum RepeatPolicy + { + Never, + WhenTooBig, + WhenTooSmall, + Always, + } +} diff --git a/UIX/Microsoft/Iris/Layouts/RotateLayout.cs b/UIX/Microsoft/Iris/Layouts/RotateLayout.cs new file mode 100644 index 0000000..38702ff --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/RotateLayout.cs @@ -0,0 +1,75 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.RotateLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layouts +{ + internal class RotateLayout : ILayout + { + private int _angleDegrees; + + public int AngleDegrees + { + get => _angleDegrees; + set => _angleDegrees = value; + } + + public ItemAlignment DefaultChildAlignment => ItemAlignment.Default; + + private bool IsVertical => AngleDegrees == 90 || AngleDegrees == 270; + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + if (IsVertical) + constraint = new Size(constraint.Height, constraint.Width); + Size size = DefaultLayout.Measure(layoutNode, constraint); + if (IsVertical) + size = new Size(size.Height, size.Width); + return size; + } + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + if (layoutNode.LayoutChildrenCount <= 0) + return; + Rectangle rectangle = new Rectangle(slot.Bounds); + switch (AngleDegrees) + { + case 90: + Point offset1 = new Point(rectangle.Width, rectangle.Width); + rectangle = RotateRect90(rectangle, offset1); + slot.View = RotateRect90(slot.View, offset1); + slot.PeripheralView = RotateRect90(slot.PeripheralView, offset1); + break; + case 180: + Point offset2 = new Point(2 * rectangle.Width, 2 * rectangle.Height); + rectangle = RotateRect180(rectangle, offset2); + slot.View = RotateRect180(slot.View, offset2); + slot.PeripheralView = RotateRect180(slot.PeripheralView, offset2); + break; + case 270: + Point offset3 = new Point(rectangle.Height, rectangle.Height); + rectangle = RotateRect270(rectangle, offset3); + slot.View = RotateRect270(slot.View, offset3); + slot.PeripheralView = RotateRect270(slot.PeripheralView, offset3); + break; + } + Rotation rotation = Rotation.Default; + rotation.AngleDegrees = AngleDegrees; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + layoutChild.Arrange(slot, rectangle, Vector3.UnitVector, rotation); + } + + private static Rectangle RotateRect90(Rectangle rect, Point offset) => new Rectangle(rect.Y + offset.X, -rect.Right + offset.Y, rect.Height, rect.Width); + + private static Rectangle RotateRect180(Rectangle rect, Point offset) => new Rectangle(-rect.Right + offset.X, -rect.Bottom + offset.Y, rect.Width, rect.Height); + + private static Rectangle RotateRect270(Rectangle rect, Point offset) => new Rectangle(-rect.Bottom + offset.X, rect.X + offset.Y, rect.Height, rect.Width); + } +} diff --git a/UIX/Microsoft/Iris/Layouts/ScaleLayout.cs b/UIX/Microsoft/Iris/Layouts/ScaleLayout.cs new file mode 100644 index 0000000..b070cdb --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/ScaleLayout.cs @@ -0,0 +1,96 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.ScaleLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Drawing; +using System; + +namespace Microsoft.Iris.Layouts +{ + internal class ScaleLayout : ILayout + { + private Vector2 _minimumScale; + private Vector2 _maximumScale; + private bool _maintainAspectRatio; + + public ScaleLayout() + { + _minimumScale = new Vector2(0.0f, 0.0f); + _maximumScale = new Vector2(1f, 1f); + _maintainAspectRatio = true; + } + + public Vector2 MinimumScale + { + get => _minimumScale; + set => _minimumScale = value; + } + + public Vector2 MaximumScale + { + get => _maximumScale; + set => _maximumScale = value; + } + + public bool MaintainAspectRatio + { + get => _maintainAspectRatio; + set => _maintainAspectRatio = value; + } + + public ItemAlignment DefaultChildAlignment => ItemAlignment.Default; + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + Size zero = Size.Zero; + Size constraint1 = new Size(UnscaleConstraint(constraint.Width, MinimumScale.X), UnscaleConstraint(constraint.Height, MinimumScale.Y)); + Size size = DefaultLayout.Measure(layoutNode, constraint1); + SizeF sizeF = new SizeF(1f, 1f); + if (!size.IsZero) + sizeF = new SizeF(constraint.Width / (float)size.Width, constraint.Height / (float)size.Height); + if (_maintainAspectRatio) + { + float num = Math.Min(sizeF.Width, sizeF.Height); + sizeF = new SizeF(num, num); + } + sizeF.Width = Math.Max(sizeF.Width, MinimumScale.X); + sizeF.Height = Math.Max(sizeF.Height, MinimumScale.Y); + if (MaximumScale.X != 0.0) + sizeF.Width = Math.Min(sizeF.Width, MaximumScale.X); + if (MaximumScale.Y != 0.0) + sizeF.Height = Math.Min(sizeF.Height, MaximumScale.Y); + 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) => minScale == 0.0 ? 16777215 : Math.Min((int)Math.Round(constraint / (double)minScale), 16777215); + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + if (layoutNode.LayoutChildrenCount <= 0) + return; + SizeF measureData = (SizeF)layoutNode.MeasureData; + Vector3 scale = new Vector3(measureData.Width, measureData.Height, 1f); + slot.View = ScaleView(slot.View, measureData); + slot.PeripheralView = ScaleView(slot.PeripheralView, measureData); + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + layoutChild.Arrange(slot, new Rectangle(Point.Zero, layoutChild.DesiredSize), scale, Rotation.Default); + } + + private static Rectangle ScaleView(Rectangle view, SizeF scale) + { + 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 new file mode 100644 index 0000000..0aa22e4 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/ScrollIntoViewDisposition.cs @@ -0,0 +1,142 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.ScrollIntoViewDisposition +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Layouts +{ + internal class ScrollIntoViewDisposition + { + private int _beginPadding; + private int _endPadding; + private bool _locked; + private float _lockedPosition; + private float _lockedAlignment; + private ContentPositioningPolicy _positioningPolicy; + private bool _enabled; + private RelativeEdge _relativeBeginPadding; + private RelativeEdge _relativeEndPadding; + + public ScrollIntoViewDisposition() + : this(0) + { + } + + public ScrollIntoViewDisposition(int paddingValue) + { + Reset(); + _beginPadding = _endPadding = paddingValue; + } + + public void CopyFrom(ScrollIntoViewDisposition other) + { + _beginPadding = other._beginPadding; + _endPadding = other._endPadding; + _lockedPosition = other._lockedPosition; + _lockedAlignment = other._lockedAlignment; + _locked = other._locked; + _enabled = other._enabled; + _positioningPolicy = other._positioningPolicy; + _relativeBeginPadding = other._relativeBeginPadding; + _relativeEndPadding = other._relativeEndPadding; + } + + public void Reset() + { + _beginPadding = _endPadding = 0; + _lockedPosition = -1f; + _lockedAlignment = 0.5f; + _enabled = true; + _locked = false; + _positioningPolicy = ContentPositioningPolicy.RespectPaddingAndLocking; + _relativeBeginPadding = RelativeEdge.Near; + _relativeEndPadding = RelativeEdge.Far; + } + + public bool IsDefault => _beginPadding == 0 && _endPadding == 0 && (BeginPaddingRelativeTo == RelativeEdge.Near && EndPaddingRelativeTo == RelativeEdge.Far) && !Locked; + + public int Padding + { + get => BeginPadding; + set + { + EndPadding = value; + BeginPadding = value; + } + } + + public int BeginPadding + { + get => _beginPadding; + set => _beginPadding = value; + } + + public int EndPadding + { + get => _endPadding; + set => _endPadding = value; + } + + public RelativeEdge BeginPaddingRelativeTo + { + get => _relativeBeginPadding; + set => _relativeBeginPadding = value; + } + + public RelativeEdge EndPaddingRelativeTo + { + get => _relativeEndPadding; + set => _relativeEndPadding = value; + } + + public bool Locked + { + get => _locked; + set => _locked = value; + } + + public float LockedPosition + { + get => _lockedPosition; + set => _lockedPosition = value; + } + + public float LockedAlignment + { + get => _lockedAlignment; + set => _lockedAlignment = value; + } + + public bool Enabled + { + get => _enabled; + set => _enabled = value; + } + + public ContentPositioningPolicy ContentPositioningBehavior + { + get => _positioningPolicy; + set => _positioningPolicy = value; + } + + public override string ToString() + { + string str1 = InvariantString.Format("{0}(", GetType().Name); + string str2; + if (!_enabled) + { + str2 = InvariantString.Format("{0}Disabled", str1); + } + else + { + str2 = InvariantString.Format("{0}(BeginPadding={1}({2}), EndPadding={3}({4})", str1, _beginPadding, _relativeBeginPadding, _endPadding, _relativeEndPadding); + if (Locked) + 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 new file mode 100644 index 0000000..12dd386 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/ScrollingLayout.cs @@ -0,0 +1,333 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.ScrollingLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.ViewItems; +using System; + +namespace Microsoft.Iris.Layouts +{ + internal class ScrollingLayout : ILayout + { + private Orientation _orientation; + private int _prefetch; + private static bool s_allowScrollFocusIntoView; + + public ScrollingLayout(Orientation orientation, int prefetch) + { + _orientation = orientation; + _prefetch = prefetch; + } + + public Orientation Orientation + { + get => _orientation; + set + { + if (_orientation == value) + return; + _orientation = value; + } + } + + public int Prefetch + { + get => _prefetch; + set + { + if (_prefetch == value) + return; + _prefetch = value; + } + } + + public ItemAlignment DefaultChildAlignment => ItemAlignment.Default; + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + Size size; + if (!(layoutNode.GetLayoutInput(ScrollingLayoutInput.Data) is ScrollingLayoutInput layoutInput) || layoutInput.Enabled) + { + Size infiniteConstraint = GetInfiniteConstraint(constraint); + size = DefaultLayout.Measure(layoutNode, infiniteConstraint); + layoutNode.MeasureData = size; + } + else + size = DefaultLayout.Measure(layoutNode, constraint); + return size; + } + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + if (!(layoutNode.GetLayoutInput(ScrollingLayoutInput.Data) is ScrollingLayoutInput sli)) + sli = new ScrollingLayoutInput(); + int scrollAmount = sli.ScrollAmount; + ScrollingLayoutOutput scrollingLayoutOutput = null; + if (layoutNode.LayoutChildrenCount > 0) + { + if (sli.Enabled) + { + scrollingLayoutOutput = Arrange(layoutNode, slot, sli, ref scrollAmount); + } + else + { + DefaultLayout.Arrange(layoutNode, slot); + scrollAmount = 0; + scrollingLayoutOutput = new ScrollingLayoutOutput(); + } + } + sli.SetScrollAmount(scrollAmount); + if (scrollingLayoutOutput == null) + return; + layoutNode.SetExtendedLayoutOutput(scrollingLayoutOutput); + } + + private ScrollingLayoutOutput Arrange( + ILayoutNode layoutNode, + LayoutSlot slot, + ScrollingLayoutInput sli, + ref int scrollAmount) + { + LayoutSlot childSlot; + Rectangle viewBounds; + GetChildSlot(slot, scrollAmount, out childSlot, out viewBounds); + int num = scrollAmount; + ScrollingLayoutOutput scrollingLayoutOutput = ArrangeChildren(layoutNode, slot, childSlot, viewBounds, sli, true, ref scrollAmount); + if (num != scrollAmount) + { + GetChildSlot(slot, scrollAmount, out childSlot, out viewBounds); + scrollingLayoutOutput = ArrangeChildren(layoutNode, slot, childSlot, viewBounds, sli, false, ref scrollAmount); + } + return scrollingLayoutOutput; + } + + private void GetChildSlot( + LayoutSlot slot, + int scrollAmount, + out LayoutSlot childSlot, + out Rectangle viewBounds) + { + Size infiniteConstraint = GetInfiniteConstraint(slot.Bounds); + Size bounds = slot.Bounds; + viewBounds = new Rectangle(Point.Zero, bounds); + Point offset = ScrollAmountToOffset(_prefetch); + Rectangle viewPeripheralBounds = viewBounds; + viewPeripheralBounds.Inflate(offset.X, offset.Y); + childSlot = new LayoutSlot(infiniteConstraint, slot.Offset, viewBounds, viewPeripheralBounds); + } + + private ScrollingLayoutOutput ArrangeChildren( + ILayoutNode layoutNode, + LayoutSlot slot, + LayoutSlot childSlot, + Rectangle viewBounds, + ScrollingLayoutInput sli, + bool applyPendingScrollData, + ref int scrollAmount) + { + Rectangle areaOfInterestBounds = Rectangle.Zero; + bool scrollAreaOfInterestIntoView = sli.ScrollIntoViewDisposition.Enabled; + bool flag1 = false; + VisibleIndexRangeLayoutOutput rangeLayoutOutput = null; + Rectangle rectangle1 = Rectangle.Zero; + Rectangle bounds = new Rectangle(new MajorMinor(-scrollAmount, 0).ToPoint(Orientation), Size.Max(slot.Bounds, (Size)layoutNode.MeasureData)); + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + layoutChild.Arrange(childSlot, bounds); + rangeLayoutOutput = layoutChild.GetExtendedLayoutOutput(VisibleIndexRangeLayoutOutput.DataCookie) as VisibleIndexRangeLayoutOutput; + bool flag2 = true; + AreaOfInterest area1; + if (!layoutChild.TryGetAreaOfInterest(AreaOfInterestID.ScrollIntoViewRequest, out area1) && !layoutChild.TryGetAreaOfInterest(AreaOfInterestID.PendingFocus, out area1)) + flag2 = layoutChild.TryGetAreaOfInterest(AreaOfInterestID.Focus, out area1); + if (flag2) + areaOfInterestBounds = area1.Rectangle; + if (IsFocusAreaOfInterest(area1.Id) && !sli.ScrollIntoViewDisposition.Enabled) + DisallowScrollFocusIntoView(); + scrollAreaOfInterestIntoView &= ScrollFocusIntoView; + if (area1.Id == AreaOfInterestID.ScrollIntoViewRequest && !areaOfInterestBounds.IsZero) + { + scrollAreaOfInterestIntoView = true; + flag1 = true; + } + Rectangle rectangle2 = new Rectangle(Point.Zero, layoutChild.DesiredSize); + AreaOfInterest area2; + if (layoutChild.TryGetAreaOfInterest(AreaOfInterestID.ScrollableRange, out area2)) + rectangle2 = Rectangle.Union(rectangle2, area2.Rectangle); + rectangle1 = Rectangle.Union(rectangle1, rectangle2); + } + ScrollingLayoutOutput scrollAmount1 = CalculateScrollAmount(layoutNode, viewBounds, rectangle1, sli, applyPendingScrollData, scrollAreaOfInterestIntoView, areaOfInterestBounds, ref scrollAmount); + scrollAmount1.VisibleIndices = rangeLayoutOutput; + scrollAmount1.ProcessedExplicitScrollIntoViewRequest = flag1; + scrollAmount1.ScrollFocusIntoView = ScrollFocusIntoView; + return scrollAmount1; + } + + private bool IsFocusAreaOfInterest(AreaOfInterestID areaOfInterestID) => areaOfInterestID == AreaOfInterestID.PendingFocus || areaOfInterestID == AreaOfInterestID.Focus; + + private ScrollingLayoutOutput CalculateScrollAmount( + ILayoutNode layoutNode, + Rectangle viewBounds, + Rectangle scrollableBounds, + ScrollingLayoutInput sli, + bool applyPendingScrollData, + bool scrollAreaOfInterestIntoView, + Rectangle areaOfInterestBounds, + ref int scrollAmount) + { + int space1 = ItemToSpace(viewBounds.Size); + int space2 = ItemToSpace(scrollableBounds.Size); + int num1 = -(space1 - space2); + int num2 = (int)Math.Round(space1 * (double)sli.PageStep); + int num3 = ItemToSpace(scrollableBounds.Location.ToSize()); + int num4 = num3 + num1; + if (num1 < 0) + { + num3 = 0; + num4 = 0; + } + if (!areaOfInterestBounds.IsZero && scrollAreaOfInterestIntoView) + { + scrollAmount = ScrollIntoView(layoutNode, areaOfInterestBounds, scrollAmount, space1, space2, num3, num4, sli.ScrollIntoViewDisposition); + if (sli.SecondaryScrollIntoViewDisposition != null && sli.SecondaryScrollIntoViewDisposition.Enabled) + scrollAmount = ScrollIntoView(layoutNode, areaOfInterestBounds, scrollAmount, space1, space2, num3, num4, sli.SecondaryScrollIntoViewDisposition); + scrollAmount = Math.Max(scrollAmount, num3); + scrollAmount = Math.Min(scrollAmount, num4); + } + else if (num1 > 0) + { + if (applyPendingScrollData) + { + float position = 0.0f; + if (sli.GetPendingScrollPosition(out position)) + { + int num5 = (int)Math2.Blend(num3, num4, position, false); + scrollAmount = num5; + } + int amount = 0; + if (sli.GetPendingPageRequests(out amount)) + { + int num5 = amount * num2; + scrollAmount += num5; + } + } + scrollAmount = Math.Max(scrollAmount, num3); + scrollAmount = Math.Min(scrollAmount, num4); + } + else + scrollAmount = 0; + int space3 = ItemToSpace(scrollableBounds.Location.ToSize()); + bool flag1 = -scrollAmount < space3; + bool flag2 = -scrollAmount + space2 > space1; + float num6 = 1f; + float val2 = 1f; + float num7 = 0.0f; + float num8 = 1f; + float num9 = num1; + float num10 = scrollAmount; + if (num2 > 0) + { + 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 / space2; + num8 = (num10 + space1) / space2; + } + return new ScrollingLayoutOutput() + { + CanScrollNegative = flag1, + CanScrollPositive = flag2, + CurrentPage = num6, + TotalPages = val2, + ViewNear = num7, + ViewFar = num8 + }; + } + + private int ScrollIntoView( + ILayoutNode layoutNode, + Rectangle areaOfInterestBounds, + int scrollAmount, + int viewMajorSpace, + int naturalMajorSpace, + int naturalMinScroll, + int naturalMaxScroll, + ScrollIntoViewDisposition scrollIntoView) + { + Rectangle rectangle = areaOfInterestBounds; + int num1 = ItemToSpace(rectangle.Location.ToSize()); + int space = ItemToSpace(rectangle.Size); + int num2 = num1 + space; + int num3 = scrollAmount; + int num4 = viewMajorSpace; + int num5 = num3 + num4; + int num6 = num3; + int num7 = num5; + int beginPadding = scrollIntoView.BeginPadding; + switch (scrollIntoView.BeginPaddingRelativeTo) + { + case RelativeEdge.Near: + num6 = num3 + beginPadding; + break; + case RelativeEdge.Far: + num6 = num5 - beginPadding; + break; + } + int endPadding = scrollIntoView.EndPadding; + switch (scrollIntoView.EndPaddingRelativeTo) + { + case RelativeEdge.Near: + num7 = num3 + endPadding; + break; + case RelativeEdge.Far: + num7 = num5 - endPadding; + break; + } + int num8 = num6 - num3; + int num9 = num7 - num5; + if (scrollIntoView.Locked) + { + float num10 = num7 - num6; + float num11 = num10 * scrollIntoView.LockedPosition; + float num12 = num10 * (1f - scrollIntoView.LockedPosition); + int num13 = num1 + (int)(space * (double)scrollIntoView.LockedAlignment); + num1 = num13 - (int)num11; + num2 = num13 + (int)num12; + } + int num14 = scrollAmount; + if (num2 > num7) + { + scrollAmount = num2 - num4 - num9; + int num10 = scrollAmount - num14; + num6 += num10; + int num11 = num7 + num10; + } + if (num1 < num6) + scrollAmount = num1 - num8; + if (scrollIntoView.ContentPositioningBehavior == ContentPositioningPolicy.ShowMaximalContent) + scrollAmount = Math2.Clamp(scrollAmount, naturalMinScroll, naturalMaxScroll); + return scrollAmount; + } + + private int ItemToSpace(Size size) => new MajorMinor(size, _orientation).Major; + + protected Point ScrollAmountToOffset(int scrollAmount) => new MajorMinor(scrollAmount, 0).ToPoint(_orientation); + + protected Size GetInfiniteConstraint(Size maxExtent) => new MajorMinor(maxExtent, _orientation) + { + Major = 16777215 + }.ToSize(_orientation); + + public static void ResetScrollFocusIntoView() => s_allowScrollFocusIntoView = true; + + public static bool ScrollFocusIntoView => s_allowScrollFocusIntoView; + + public static void DisallowScrollFocusIntoView() => s_allowScrollFocusIntoView = false; + } +} diff --git a/UIX/Microsoft/Iris/Layouts/ScrollingLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/ScrollingLayoutInput.cs new file mode 100644 index 0000000..ffbd89e --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/ScrollingLayoutInput.cs @@ -0,0 +1,119 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.ScrollingLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Layouts +{ + internal class ScrollingLayoutInput : ILayoutInput + { + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + private int _scrollAmount; + private int _pendingScrollAmount; + private int _pendingPageCommands; + private float _pendingScrollPosition; + private bool _havePendingScrollPosition; + private bool _enabled; + private float _pageStep; + private ScrollIntoViewDisposition _scrollIntoView; + private ScrollIntoViewDisposition _secondaryScrollIntoView; + + public ScrollingLayoutInput() + { + _pageStep = 1f; + _enabled = true; + _scrollIntoView = new ScrollIntoViewDisposition(); + } + + public bool Enabled + { + get => _enabled; + set + { + if (value == _enabled) + return; + _enabled = value; + if (!value) + return; + _scrollAmount = 0; + _pendingScrollAmount = 0; + _pendingPageCommands = 0; + _pendingScrollPosition = 0.0f; + _havePendingScrollPosition = false; + } + } + + public void Scroll(int amount) => _scrollAmount += amount; + + public void PageUp() => --_pendingPageCommands; + + public void PageDown() => ++_pendingPageCommands; + + public void Home() => ScrollToPosition(0.0f); + + public void End() => ScrollToPosition(1f); + + public void ScrollToPosition(float position) + { + _havePendingScrollPosition = true; + _pendingScrollPosition = position; + } + + public bool GetPendingScrollPosition(out float position) + { + if (!_havePendingScrollPosition) + { + position = 0.0f; + return false; + } + position = _pendingScrollPosition; + return true; + } + + public bool GetPendingPageRequests(out int amount) + { + amount = _pendingPageCommands; + return _pendingPageCommands != 0; + } + + internal int ScrollAmount => _scrollAmount; + + internal void SetScrollAmount(int scrollAmount) => _pendingScrollAmount = scrollAmount; + + internal void OnLayoutComplete() + { + SecondaryScrollIntoViewDisposition = null; + _havePendingScrollPosition = false; + _pendingPageCommands = 0; + _scrollAmount = _pendingScrollAmount; + } + + internal float PageStep + { + get => _pageStep; + set => _pageStep = value; + } + + public ScrollIntoViewDisposition ScrollIntoViewDisposition + { + get => _scrollIntoView; + set => _scrollIntoView = value; + } + + public ScrollIntoViewDisposition SecondaryScrollIntoViewDisposition + { + get => _secondaryScrollIntoView; + set => _secondaryScrollIntoView = value; + } + + DataCookie ILayoutInput.Data => Data; + + public static DataCookie Data => s_dataProperty; + + public override string ToString() => InvariantString.Format("{0}(ScrollAmount={1}, PageAmount={2}, PageStep={3}, Disposition=({4}))", GetType().Name, _pendingScrollAmount, _pendingPageCommands, _pageStep, _scrollIntoView); + } +} diff --git a/UIX/Microsoft/Iris/Layouts/ScrollingLayoutOutput.cs b/UIX/Microsoft/Iris/Layouts/ScrollingLayoutOutput.cs new file mode 100644 index 0000000..8068111 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/ScrollingLayoutOutput.cs @@ -0,0 +1,86 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.ScrollingLayoutOutput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Layouts +{ + internal class ScrollingLayoutOutput : ExtendedLayoutOutput + { + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + private bool _canScrollNegative; + private bool _canScrollPositive; + private float _currentPage; + private float _totalPages; + private float _viewNear; + private float _viewFar; + private bool _processedScrollIntoViewRequest; + private bool _scrollFocusIntoView = true; + private VisibleIndexRangeLayoutOutput _visibleIndices; + + public bool CanScrollNegative + { + get => _canScrollNegative; + set => _canScrollNegative = value; + } + + public bool CanScrollPositive + { + get => _canScrollPositive; + set => _canScrollPositive = value; + } + + public float CurrentPage + { + get => _currentPage; + set => _currentPage = value; + } + + public float TotalPages + { + get => _totalPages; + set => _totalPages = value; + } + + public float ViewNear + { + get => _viewNear; + set => _viewNear = value; + } + + public float ViewFar + { + get => _viewFar; + set => _viewFar = value; + } + + public bool ProcessedExplicitScrollIntoViewRequest + { + get => _processedScrollIntoViewRequest; + set => _processedScrollIntoViewRequest = value; + } + + public bool ScrollFocusIntoView + { + get => _scrollFocusIntoView; + set => _scrollFocusIntoView = value; + } + + public VisibleIndexRangeLayoutOutput VisibleIndices + { + get => _visibleIndices; + set => _visibleIndices = value; + } + + public override DataCookie OutputID => DataCookie; + + public static DataCookie DataCookie => s_dataProperty; + + public override string ToString() => InvariantString.Format("{0}(CanScrollNegative={1}, CanScrollPositive={2}, CurrentPage={3}, TotalPages={4})", GetType().Name, _canScrollNegative, _canScrollPositive, _currentPage, _totalPages); + } +} diff --git a/UIX/Microsoft/Iris/Layouts/StackLayout.cs b/UIX/Microsoft/Iris/Layouts/StackLayout.cs new file mode 100644 index 0000000..d6c4539 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/StackLayout.cs @@ -0,0 +1,100 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.StackLayout +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System; + +namespace Microsoft.Iris.Layouts +{ + internal class StackLayout : ILayout + { + private static StackLayoutInput s_defaultLayoutInput = new StackLayoutInput(); + private static readonly DataCookie s_dataProperty = DataCookie.ReserveSlot(); + + internal static DataCookie Data => s_dataProperty; + + public ItemAlignment DefaultChildAlignment => ItemAlignment.Default; + + Size ILayout.Measure(ILayoutNode layoutNode, Size constraint) + { + Size size1 = new Size(); + if (layoutNode.LayoutChildrenCount > 0) + { + int num = 0; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + StackLayoutInput layoutInputForNode = GetLayoutInputForNode(layoutChild); + Size size2 = layoutChild.Measure(constraint); + size1.Height = Math.Max(size1.Height, layoutChild.DesiredSize.Height); + if (layoutInputForNode.Priority == StackPriority.High) + num += size2.Width; + else if (layoutInputForNode.Priority == StackPriority.Medium) + num += layoutInputForNode.MinimumSize.Width; + } + size1.Width = num; + layoutNode.MeasureData = num; + } + layoutNode.RequestMoreChildren(int.MaxValue); + return size1; + } + + void ILayout.Arrange(ILayoutNode layoutNode, LayoutSlot slot) + { + if (layoutNode.LayoutChildrenCount <= 0) + return; + int measureData = (int)layoutNode.MeasureData; + int width1 = slot.Bounds.Width; + int x = 0; + int width2 = width1 - measureData; + foreach (ILayoutNode layoutChild in layoutNode.LayoutChildren) + { + if (x < width1) + { + int width3 = width1 - x; + StackLayoutInput layoutInputForNode = GetLayoutInputForNode(layoutChild); + if (layoutInputForNode.Priority == StackPriority.High) + { + if (layoutChild.DesiredSize.Width > width3) + { + Size constraint = new Size(width3, slot.Bounds.Height); + layoutChild.Measure(constraint); + } + } + else if (layoutInputForNode.Priority == StackPriority.Medium && layoutInputForNode.MinimumSize.Width <= width3) + { + Size constraint = new Size(layoutInputForNode.MinimumSize.Width + width2, slot.Bounds.Height); + layoutChild.Measure(constraint); + width2 -= layoutChild.DesiredSize.Width - layoutInputForNode.MinimumSize.Width; + } + else if (layoutInputForNode.Priority == StackPriority.Low && width2 > 0) + { + Size constraint = new Size(width2, slot.Bounds.Height); + layoutChild.Measure(constraint); + width2 -= layoutChild.DesiredSize.Width; + } + else + { + layoutChild.MarkHidden(); + continue; + } + layoutChild.Arrange(slot, new Rectangle(x, 0, layoutChild.DesiredSize.Width, slot.Bounds.Height)); + x += layoutChild.DesiredSize.Width; + } + else + layoutChild.MarkHidden(); + } + } + + private StackLayoutInput GetLayoutInputForNode(ILayoutNode layoutNode) + { + if (!(layoutNode.GetLayoutInput(s_dataProperty) is StackLayoutInput stackLayoutInput)) + stackLayoutInput = s_defaultLayoutInput; + return stackLayoutInput; + } + } +} diff --git a/UIX/Microsoft/Iris/Layouts/StackLayoutInput.cs b/UIX/Microsoft/Iris/Layouts/StackLayoutInput.cs new file mode 100644 index 0000000..21049be --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/StackLayoutInput.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.StackLayoutInput +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Layouts +{ + internal class StackLayoutInput : ILayoutInput + { + private StackPriority _priority; + private Size _minimumSize; + + public StackLayoutInput() => Priority = StackPriority.Low; + + public StackPriority Priority + { + get => _priority; + set => _priority = value; + } + + public Size MinimumSize + { + get => _minimumSize; + set => _minimumSize = value; + } + + DataCookie ILayoutInput.Data => StackLayout.Data; + } +} diff --git a/UIX/Microsoft/Iris/Layouts/StackPriority.cs b/UIX/Microsoft/Iris/Layouts/StackPriority.cs new file mode 100644 index 0000000..da9cd69 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/StackPriority.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.StackPriority +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal enum StackPriority + { + Low, + Medium, + High, + } +} diff --git a/UIX/Microsoft/Iris/Layouts/StripAlignment.cs b/UIX/Microsoft/Iris/Layouts/StripAlignment.cs new file mode 100644 index 0000000..e5cc537 --- /dev/null +++ b/UIX/Microsoft/Iris/Layouts/StripAlignment.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Layouts.StripAlignment +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Layouts +{ + internal enum StripAlignment + { + Near, + Center, + Far, + } +} diff --git a/UIX/Microsoft/Iris/Library/AncestorEnumerator.cs b/UIX/Microsoft/Iris/Library/AncestorEnumerator.cs new file mode 100644 index 0000000..d7b591f --- /dev/null +++ b/UIX/Microsoft/Iris/Library/AncestorEnumerator.cs @@ -0,0 +1,47 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.AncestorEnumerator +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Library +{ + internal struct AncestorEnumerator : IEnumerator, IEnumerable + { + private TreeNode _nodeStart; + private TreeNode _nodeCurrent; + private TreeNode _nodeNext; + + internal AncestorEnumerator(TreeNode nodeStart) + { + _nodeStart = nodeStart; + _nodeCurrent = null; + _nodeNext = _nodeStart; + } + + object IEnumerator.Current => _nodeCurrent; + + public TreeNode Current => _nodeCurrent; + + IEnumerator IEnumerable.GetEnumerator() => this; + + public AncestorEnumerator GetEnumerator() => this; + + public void Reset() + { + _nodeCurrent = null; + _nodeNext = _nodeStart; + } + + public bool MoveNext() + { + _nodeCurrent = _nodeNext; + if (_nodeNext == null) + return false; + _nodeNext = _nodeNext.Parent; + return true; + } + } +} diff --git a/UIX/Microsoft/Iris/Library/Bits.cs b/UIX/Microsoft/Iris/Library/Bits.cs new file mode 100644 index 0000000..c58018c --- /dev/null +++ b/UIX/Microsoft/Iris/Library/Bits.cs @@ -0,0 +1,79 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.Bits +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Diagnostics; + +namespace Microsoft.Iris.Library +{ + internal static class Bits + { + public static bool TestFlag(int value, int maskValue) => (value & maskValue) != 0; + + public static bool TestFlag(uint value, uint maskValue) => ((int)value & (int)maskValue) != 0; + + public static bool TestAnyFlags(int value, int maskValue) => (value & maskValue) != 0; + + public static bool TestAnyFlags(uint value, uint maskValue) => ((int)value & (int)maskValue) != 0; + + public static bool TestAllFlags(int value, int maskValue) => (value & maskValue) == maskValue; + + public static bool TestAllFlags(uint value, uint maskValue) => ((int)value & (int)maskValue) == (int)maskValue; + + public static void SetFlag(ref int value, int maskValue) => value |= maskValue; + + public static void SetFlag(ref uint value, uint maskValue) => value |= maskValue; + + public static void ClearFlag(ref int value, int maskValue) => value &= ~maskValue; + + public static void ClearFlag(ref uint value, uint maskValue) => value &= ~maskValue; + + public static void ChangeFlags(ref int value, int newValue, int maskValue) => value = newValue & maskValue | value & ~maskValue; + + public static void ChangeFlags(ref uint value, uint newValue, uint maskValue) => value = (uint)((int)newValue & (int)maskValue | (int)value & ~(int)maskValue); + + public static void ChangeFlag(ref int value, bool flag, int maskValue) + { + int num = flag ? maskValue : 0; + value = num & maskValue | value & ~maskValue; + } + + public static void ChangeFlag(ref uint value, bool flag, uint maskValue) + { + uint num = flag ? maskValue : 0U; + value = (uint)((int)num & (int)maskValue | (int)value & ~(int)maskValue); + } + + public static void FlipFlags(ref int value, int maskValue) => value ^= maskValue; + + public static void FlipFlags(ref uint value, uint maskValue) => value ^= maskValue; + + public static int ExtractFlags(int value, int maskValue) => value & maskValue; + + public static int ExtractFlags(int value, int maskValue, int shiftBitsCount) => (value & maskValue) >> shiftBitsCount; + + public static uint ExtractFlags(uint value, uint maskValue) => value & maskValue; + + public static uint ExtractFlags(uint value, uint maskValue, int shiftBitsCount) => (value & maskValue) >> shiftBitsCount; + + [Conditional("DEBUG")] + public static void AssertFlags(int testFlagsValue, int validFlagsValue) + { + } + + [Conditional("DEBUG")] + public static void AssertFlags(uint testFlagsValue, uint validFlagsValue) + { + } + + public static void PromptFlags(int testFlagsValue, int validFlagsValue) + { + } + + public static void PromptFlags(uint testFlagsValue, uint validFlagsValue) + { + } + } +} diff --git a/UIX/Microsoft/Iris/Library/DataCookie.cs b/UIX/Microsoft/Iris/Library/DataCookie.cs new file mode 100644 index 0000000..b969807 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/DataCookie.cs @@ -0,0 +1,41 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.DataCookie +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Library +{ + internal struct DataCookie + { + public static readonly DataCookie NULL = new DataCookie(); + private uint m_value; + + private DataCookie(uint value) => m_value = value; + + public static bool operator ==(DataCookie hl, DataCookie hr) => (int)hl.m_value == (int)hr.m_value; + + public static bool operator !=(DataCookie hl, DataCookie hr) => (int)hl.m_value != (int)hr.m_value; + + public override bool Equals(object oCompare) + { + uint num; + if (oCompare is DataCookie dataCookie) + num = dataCookie.m_value; + else if (oCompare is uint value) + num = value; + else + return false; + + return (int)m_value == (int)num; + } + + public override int GetHashCode() => (int)m_value; + + internal static DataCookie FromUInt32(uint value) => new DataCookie(value); + + internal static uint ToUInt32(DataCookie handle) => handle.m_value; + + public static DataCookie ReserveSlot() => FromUInt32(KeyAllocator.ReserveSlot()); + } +} diff --git a/UIX/Microsoft/Iris/Library/DisposableNotifyObjectBase.cs b/UIX/Microsoft/Iris/Library/DisposableNotifyObjectBase.cs new file mode 100644 index 0000000..17bc32a --- /dev/null +++ b/UIX/Microsoft/Iris/Library/DisposableNotifyObjectBase.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.DisposableNotifyObjectBase +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; + +namespace Microsoft.Iris.Library +{ + internal class DisposableNotifyObjectBase : DisposableObject, INotifyObject + { + private NotifyService _notifier = new NotifyService(); + + protected DisposableNotifyObjectBase() + { + } + + protected void FireNotification(string id) => _notifier.Fire(id); + + protected void FireThreadSafeNotification(string id) => _notifier.FireThreadSafe(id); + + public void AddListener(Listener listener) => _notifier.AddListener(listener); + } +} diff --git a/UIX/Microsoft/Iris/Library/DisposableObject.cs b/UIX/Microsoft/Iris/Library/DisposableObject.cs new file mode 100644 index 0000000..5d8ff38 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/DisposableObject.cs @@ -0,0 +1,38 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.DisposableObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Diagnostics; + +namespace Microsoft.Iris.Library +{ + internal class DisposableObject : IDisposableObject + { + private bool _isDisposed; + + protected DisposableObject() + { + } + + public bool IsDisposed => _isDisposed; + + public void DeclareOwner(object owner) => OnOwnerDeclared(owner); + + public void TransferOwnership(object owner) => OnOwnerDeclared(owner); + + protected virtual void OnOwnerDeclared(object owner) + { + } + + public void Dispose(object owner) => OnDispose(); + + protected virtual void OnDispose() => _isDisposed = true; + + [Conditional("DEBUG")] + public void DEBUG_DeclareDisposeUnnecessary() + { + } + } +} diff --git a/UIX/Microsoft/Iris/Library/DynamicData.cs b/UIX/Microsoft/Iris/Library/DynamicData.cs new file mode 100644 index 0000000..57e6042 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/DynamicData.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.DynamicData +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Library +{ + internal struct DynamicData + { + private SmartMap _dataMap; + + public void Create() => _dataMap = new SmartMap(); + + public object GetData(DataCookie cookie) => _dataMap[GetKey(cookie)]; + + public void SetData(DataCookie cookie, object value) => _dataMap[GetKey(cookie)] = value; + + public Delegate GetEventHandler(EventCookie cookie) => _dataMap[GetKey(cookie)] as Delegate; + + public bool AddEventHandler(EventCookie cookie, Delegate handlerToAdd) + { + uint key = GetKey(cookie); + Delegate data = _dataMap[key] as Delegate; + _dataMap[key] = Delegate.Combine(data, handlerToAdd); + return (object)data == null; + } + + public bool RemoveEventHandler(EventCookie cookie, Delegate handlerToRemove) + { + uint key = GetKey(cookie); + Delegate @delegate = Delegate.Remove(_dataMap[key] as Delegate, handlerToRemove); + _dataMap[key] = @delegate; + return (object)@delegate == null; + } + + public void RemoveEventHandlers(EventCookie cookie) => _dataMap[GetKey(cookie)] = null; + + private static uint GetKey(DataCookie cookie) => DataCookie.ToUInt32(cookie); + + private static uint GetKey(EventCookie cookie) => EventCookie.ToUInt32(cookie); + } +} diff --git a/UIX/Microsoft/Iris/Library/EventCookie.cs b/UIX/Microsoft/Iris/Library/EventCookie.cs new file mode 100644 index 0000000..692042d --- /dev/null +++ b/UIX/Microsoft/Iris/Library/EventCookie.cs @@ -0,0 +1,41 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.EventCookie +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Library +{ + internal struct EventCookie + { + public static readonly EventCookie NULL = new EventCookie(); + private uint m_value; + + private EventCookie(uint value) => m_value = value; + + public static bool operator ==(EventCookie hl, EventCookie hr) => (int)hl.m_value == (int)hr.m_value; + + public static bool operator !=(EventCookie hl, EventCookie hr) => (int)hl.m_value != (int)hr.m_value; + + public override bool Equals(object oCompare) + { + uint num; + if (oCompare is EventCookie eventCookie) + num = eventCookie.m_value; + else if (oCompare is uint value) + num = value; + else + return false; + + return (int)m_value == (int)num; + } + + public override int GetHashCode() => (int)m_value; + + internal static EventCookie FromUInt32(uint value) => new EventCookie(value); + + internal static uint ToUInt32(EventCookie handle) => handle.m_value; + + public static EventCookie ReserveSlot() => FromUInt32(KeyAllocator.ReserveSlot()); + } +} diff --git a/UIX/Microsoft/Iris/Library/ExpandableArray.cs b/UIX/Microsoft/Iris/Library/ExpandableArray.cs new file mode 100644 index 0000000..5e122bb --- /dev/null +++ b/UIX/Microsoft/Iris/Library/ExpandableArray.cs @@ -0,0 +1,161 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.ExpandableArray +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; +using System.Collections; +using System.Linq; + +namespace Microsoft.Iris.Library +{ + internal class ExpandableArray + { + private object[] _array; + private int _generation; + private int _lockCount; + + public ExpandableArray(int initialSize) => _array = new object[initialSize]; + + public int Length => _array.Length; + + public bool IsFixedSize => false; + + public bool IsReadOnly => false; + + public object this[int index] + { + get => _array[index]; + set => SetItem(index, value); + } + + public int Add(object value) + { + int index = 0; + while (index < _array.Length && _array[index] != null) + ++index; + SetItem(index, value); + return index; + } + + public void Clear() + { + IncrementGeneration(); + Array.Clear(_array, 0, _array.Length); + } + + public bool Contains(object value) => _array.Contains(value); + + public int IndexOf(object value) => Array.IndexOf(_array, value); + + public void Insert(int index, object value) + { + } + + public void Remove(object value) + { + } + + public void RemoveAt(int index) + { + } + + public int Count + { + get + { + int num = 0; + for (int index = 0; index < _array.Length; ++index) + { + if (_array[index] != null) + ++num; + } + return num; + } + } + + public bool IsSynchronized => false; + + public object SyncRoot => (object)null; + + public void CopyTo(Array array, int index) => _array.CopyTo(array, index); + + public ExpandableArray.NullSkippingEnumerator GetEnumerator() => new ExpandableArray.NullSkippingEnumerator(this); + + public void LockArray() => ++_lockCount; + + public void UnlockArray() => --_lockCount; + + private void IncrementGeneration() + { + ++_generation; + if (_generation != int.MaxValue) + return; + _generation = 0; + } + + private void ExpandArray(int index) + { + int length = _array.Length; + while (index >= length) + length <<= 1; + object[] objArray = new object[length]; + for (int index1 = 0; index1 < _array.Length; ++index1) + objArray[index1] = _array[index1]; + _array = objArray; + } + + private void SetItem(int index, object value) + { + IncrementGeneration(); + if (index >= _array.Length) + ExpandArray(index); + _array[index] = value; + } + + public struct NullSkippingEnumerator : IEnumerator + { + private ExpandableArray _array; + private int _position; + private int _generation; + + public NullSkippingEnumerator(ExpandableArray array) + { + _array = array; + _position = -1; + _generation = array._generation; + } + + public object Current + { + get + { + CheckGeneration(); + return _array[_position]; + } + } + + public bool MoveNext() + { + CheckGeneration(); + for (++_position; _position < _array.Length; ++_position) + { + if (_array[_position] != null) + return true; + } + return false; + } + + public void Reset() + { + CheckGeneration(); + _position = -1; + } + + private void CheckGeneration() + { + } + } + } +} diff --git a/UIX/Microsoft/Iris/Library/IDisposableObject.cs b/UIX/Microsoft/Iris/Library/IDisposableObject.cs new file mode 100644 index 0000000..901fdef --- /dev/null +++ b/UIX/Microsoft/Iris/Library/IDisposableObject.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.IDisposableObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Library +{ + internal interface IDisposableObject + { + bool IsDisposed { get; } + + void DeclareOwner(object owner); + + void TransferOwnership(object owner); + + void Dispose(object owner); + } +} diff --git a/UIX/Microsoft/Iris/Library/IDisposableOwner.cs b/UIX/Microsoft/Iris/Library/IDisposableOwner.cs new file mode 100644 index 0000000..1062e72 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/IDisposableOwner.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.IDisposableOwner +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Library +{ + internal interface IDisposableOwner + { + void RegisterDisposable(IDisposableObject disposable); + + bool UnregisterDisposable(ref IDisposableObject disposable); + } +} diff --git a/UIX/Microsoft/Iris/Library/ITreeNode.cs b/UIX/Microsoft/Iris/Library/ITreeNode.cs new file mode 100644 index 0000000..4ee07ba --- /dev/null +++ b/UIX/Microsoft/Iris/Library/ITreeNode.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.ITreeNode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Library +{ + internal interface ITreeNode + { + UIZone Zone { get; } + + ITreeNode Parent { get; } + } +} diff --git a/UIX/Microsoft/Iris/Library/KeyAllocator.cs b/UIX/Microsoft/Iris/Library/KeyAllocator.cs new file mode 100644 index 0000000..7f1a4f2 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/KeyAllocator.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.KeyAllocator +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Threading; + +namespace Microsoft.Iris.Library +{ + internal class KeyAllocator + { + private static int s_idxKeyGen; + + internal static uint ReserveSlot() => (uint)Interlocked.Increment(ref s_idxKeyGen); + } +} diff --git a/UIX/Microsoft/Iris/Library/Math2.cs b/UIX/Microsoft/Iris/Library/Math2.cs new file mode 100644 index 0000000..46cd1c5 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/Math2.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.Math2 +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Library +{ + internal class Math2 + { + public static int FindPowerOf2(int value) => FindPowerOf2(value, 1); + + public static int FindPowerOf2(int value, int startValue) + { + int num = startValue; + while (num < value) + num *= 2; + return num; + } + + public static int RoundUp(float value) => (int)(value + 0.5); + + public static int Clamp(int value, int min, int max) + { + if (value < min) + return min; + return value > max ? max : value; + } + + public static float Clamp(float value, float min, float max) + { + if (value < (double)min) + return min; + return value > (double)max ? max : value; + } + + public static bool WithinEpsilon(float value1, float value2) + { + float num = value1 - value2; + 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/NotifyObjectBase.cs b/UIX/Microsoft/Iris/Library/NotifyObjectBase.cs new file mode 100644 index 0000000..2431ec5 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/NotifyObjectBase.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.NotifyObjectBase +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup; + +namespace Microsoft.Iris.Library +{ + internal class NotifyObjectBase : INotifyObject + { + private NotifyService _notifier = new NotifyService(); + + protected NotifyObjectBase() + { + } + + protected void FireNotification(string id) => _notifier.Fire(id); + + protected void FireThreadSafeNotification(string id) => _notifier.FireThreadSafe(id); + + public void AddListener(Listener listener) => _notifier.AddListener(listener); + } +} diff --git a/UIX/Microsoft/Iris/Library/Result.cs b/UIX/Microsoft/Iris/Library/Result.cs new file mode 100644 index 0000000..be54b35 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/Result.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.Result +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Library +{ + internal struct Result + { + public static Result Success = new Result(null); + private string _error; + + public static Result Fail(string error) => new Result(error); + + public static Result Fail(string format, object param) => new Result(string.Format(format, param)); + + public static Result Fail(string format, object param1, object param2) => new Result(string.Format(format, param1, param2)); + + public static Result Fail(string format, object param1, object param2, object param3) => new Result(string.Format(format, param1, param2, param3)); + + public bool Failed => _error != null; + + public string Error => _error; + + public override string ToString() => _error; + + private Result(string error) => _error = error; + } +} diff --git a/UIX/Microsoft/Iris/Library/SharedDisposableObject.cs b/UIX/Microsoft/Iris/Library/SharedDisposableObject.cs new file mode 100644 index 0000000..1811f57 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/SharedDisposableObject.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.SharedDisposableObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Library +{ + internal class SharedDisposableObject : DisposableObject + { + private int _usageCount; + + public SharedDisposableObject() => DeclareOwner(this); + + protected override void OnDispose() => base.OnDispose(); + + public virtual void RegisterUsage(object consumer) => ++_usageCount; + + public virtual void UnregisterUsage(object consumer) + { + --_usageCount; + if (_usageCount != 0) + return; + Dispose(this); + } + } +} diff --git a/UIX/Microsoft/Iris/Library/SmartMap.cs b/UIX/Microsoft/Iris/Library/SmartMap.cs new file mode 100644 index 0000000..3c76aca --- /dev/null +++ b/UIX/Microsoft/Iris/Library/SmartMap.cs @@ -0,0 +1,179 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.SmartMap +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Library +{ + internal struct SmartMap + { + private SmartMap.Entry[] _listEntries; + + public int Count + { + get + { + int num = 0; + if (_listEntries != null) + num = _listEntries.Length; + return num; + } + } + + public bool IsEmpty => Count == 0; + + public object this[uint key] + { + get + { + int index = IndexOf(key); + return index < 0 ? null : _listEntries[index].dataObject; + } + set + { + int slotIndex = IndexOf(key); + if (value != null) + { + if (slotIndex >= 0) + _listEntries[slotIndex].dataObject = value; + else + Add(key, value, ~slotIndex); + } + else + { + if (slotIndex < 0) + return; + Remove(key, slotIndex); + } + } + } + + public uint[] Keys + { + get + { + uint[] numArray = null; + if (_listEntries != null) + { + numArray = new uint[_listEntries.Length]; + for (int index = 0; index < _listEntries.Length; ++index) + numArray[index] = _listEntries[index].key; + } + return numArray; + } + } + + public object[] Values + { + get + { + object[] objArray = null; + if (_listEntries != null) + { + objArray = new object[_listEntries.Length]; + for (int index = 0; index < _listEntries.Length; ++index) + objArray[index] = _listEntries[index].dataObject; + } + return objArray; + } + } + + public bool Lookup(object desired, out uint key) + { + if (_listEntries != null) + { + foreach (SmartMap.Entry listEntry in _listEntries) + { + if (listEntry.dataObject == desired) + { + key = listEntry.key; + return true; + } + } + } + key = 0U; + return false; + } + + private int IndexOf(uint key) + { + if (_listEntries == null) + return -1; + uint num1 = uint.MaxValue; + int index1 = 0; + if (_listEntries.Length > 4) + { + int num2 = 0; + int num3 = _listEntries.Length - 1; + while (num2 <= num3) + { + index1 = (num3 + num2) / 2; + num1 = _listEntries[index1].key; + if ((int)key == (int)num1) + return index1; + if (key < num1) + num3 = index1 - 1; + else + num2 = index1 + 1; + } + } + else + { + for (int index2 = 0; index2 < _listEntries.Length; ++index2) + { + index1 = index2; + num1 = _listEntries[index1].key; + if ((int)key == (int)num1) + return index1; + if (key < num1) + break; + } + } + if (key > num1) + ++index1; + return ~index1; + } + + private void Add(uint key, object dataObject, int slotIndex) + { + SmartMap.Entry[] entryArray; + if (_listEntries == null) + { + entryArray = new SmartMap.Entry[1]; + } + else + { + int length = _listEntries.Length; + entryArray = new SmartMap.Entry[length + 1]; + Array.Copy(_listEntries, entryArray, slotIndex); + Array.Copy(_listEntries, slotIndex, entryArray, slotIndex + 1, length - slotIndex); + } + _listEntries = entryArray; + _listEntries[slotIndex].key = key; + _listEntries[slotIndex].dataObject = dataObject; + } + + private void Remove(uint key, int slotIndex) + { + int length = _listEntries.Length; + if (length > 0) + { + SmartMap.Entry[] entryArray = new SmartMap.Entry[length - 1]; + Array.Copy(_listEntries, entryArray, slotIndex); + Array.Copy(_listEntries, slotIndex + 1, entryArray, slotIndex, length - (slotIndex + 1)); + _listEntries = entryArray; + } + else + _listEntries = null; + } + + private struct Entry + { + internal uint key; + internal object dataObject; + } + } +} diff --git a/UIX/Microsoft/Iris/Library/StackIListEnumerator.cs b/UIX/Microsoft/Iris/Library/StackIListEnumerator.cs new file mode 100644 index 0000000..a997e17 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/StackIListEnumerator.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.StackIListEnumerator +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Library +{ + internal struct StackIListEnumerator : IEnumerator + { + private const int START_INVALID_INDEX = -1; + private IList _list; + private int _currentIndex; + + internal StackIListEnumerator(IList list) + { + _list = list; + _currentIndex = -1; + } + + public StackIListEnumerator GetEnumerator() => this; + + public bool MoveNext() => ++_currentIndex < _list.Count; + + public object Current => _list[_currentIndex]; + + public void Reset() => _currentIndex = -1; + } +} diff --git a/UIX/Microsoft/Iris/Library/StackIListReverseEnumerator.cs b/UIX/Microsoft/Iris/Library/StackIListReverseEnumerator.cs new file mode 100644 index 0000000..f043ebd --- /dev/null +++ b/UIX/Microsoft/Iris/Library/StackIListReverseEnumerator.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.StackIListReverseEnumerator +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Library +{ + internal struct StackIListReverseEnumerator : IEnumerator + { + private IList _list; + private int _currentIndex; + + public StackIListReverseEnumerator(IList list) + { + _list = list; + _currentIndex = list.Count; + } + + public StackIListReverseEnumerator GetEnumerator() => this; + + public bool MoveNext() => --_currentIndex >= 0; + + public object Current => _list[_currentIndex]; + + public void Reset() => _currentIndex = _list.Count; + } +} diff --git a/UIX/Microsoft/Iris/Library/TreeNode.cs b/UIX/Microsoft/Iris/Library/TreeNode.cs new file mode 100644 index 0000000..e9482c9 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/TreeNode.cs @@ -0,0 +1,261 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.TreeNode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Library +{ + internal abstract class TreeNode : DisposableObject, ITreeNode + { + private static readonly DataCookie s_instanceIDProperty = DataCookie.ReserveSlot(); + private static readonly EventCookie s_deepParentChangeEvent = EventCookie.ReserveSlot(); + private TreeNode _nodeParent; + private TreeNode _nodeFirstChild; + private TreeNode _nodeNext; + private TreeNode _nodePrevious; + private UIZone _zone; + private DynamicData _dataMap; + + public TreeNode() + { + _dataMap = new DynamicData(); + _dataMap.Create(); + } + + protected override void OnDispose() + { + base.OnDispose(); + ChangeParent(null); + RemoveEventHandlers(s_deepParentChangeEvent); + } + + public bool IsZoned => _zone != null; + + public void ChangeParent(TreeNode nodeNewParent) => ChangeParent(nodeNewParent, null, LinkType.First); + + public void ChangeParent(TreeNode nodeNewParent, TreeNode nodeSibling, TreeNode.LinkType lt) + { + if (_nodeParent == nodeNewParent) + return; + UIZone zone = null; + TreeNode nodeParent = _nodeParent; + if (_nodeParent != null) + { + DoUnlink(this); + nodeParent.OnChildrenChanged(); + } + if (nodeNewParent != null) + { + DoLink(nodeNewParent, this, nodeSibling, lt); + zone = nodeNewParent.Zone; + nodeNewParent.OnChildrenChanged(); + } + PropagateZone(zone); + FireTreeChangeWorker(); + } + + public void PropagateZone(UIZone zone) + { + if (_zone == zone) + return; + if (_zone != null) + OnZoneDetached(); + _zone = zone; + if (zone != null) + OnZoneAttached(); + foreach (TreeNode child in Children) + child.PropagateZone(zone); + } + + public void MoveNode(TreeNode nodeSibling, TreeNode.LinkType lt) + { + TreeNode nodeParent = _nodeParent; + DoUnlink(this); + DoLink(nodeParent, this, nodeSibling, lt); + } + + public void RemoveAllChildren(bool disposeChildrenFlag) + { + while (_nodeFirstChild != null) + _nodeFirstChild.ChangeParent(null); + } + + protected virtual void OnZoneAttached() + { + } + + protected virtual void OnZoneDetached() + { + } + + protected virtual void OnChildrenChanged() + { + } + + public event EventHandler DeepParentChange + { + add => AddEventHandler(s_deepParentChangeEvent, value); + remove => RemoveEventHandler(s_deepParentChangeEvent, value); + } + + public UIZone Zone => _zone; + + UIZone ITreeNode.Zone => _zone; + + public UISession UISession => _zone.Session; + + public bool HasChildren => _nodeFirstChild != null; + + public abstract bool IsRoot { get; } + + ITreeNode ITreeNode.Parent => _nodeParent; + + public TreeNode Parent => _nodeParent; + + public TreeNode NextSibling => _nodeNext; + + public TreeNode PreviousSibling => _nodePrevious; + + public TreeNode FirstSibling => _nodeParent == null ? this : _nodeParent._nodeFirstChild; + + public TreeNode LastSibling + { + get + { + TreeNode treeNode = this; + while (treeNode._nodeNext != null) + treeNode = treeNode._nodeNext; + return treeNode; + } + } + + public TreeNode FirstChild => _nodeFirstChild; + + public TreeNode LastChild => _nodeFirstChild != null ? _nodeFirstChild.LastSibling : null; + + public TreeNodeCollection Children => new TreeNodeCollection(this); + + public AncestorEnumerator Ancestors => new AncestorEnumerator(this); + + public bool HasDescendant(TreeNode nodeOther) + { + for (; nodeOther != null; nodeOther = nodeOther._nodeParent) + { + if (nodeOther == this) + return true; + } + return false; + } + + public int ChildCount + { + get + { + int num = 0; + for (TreeNode treeNode = _nodeFirstChild; treeNode != null; treeNode = treeNode._nodeNext) + ++num; + return num; + } + } + + private static void DoLink( + TreeNode nodeParent, + TreeNode nodeChange, + TreeNode nodeSibling, + TreeNode.LinkType lt) + { + nodeChange._nodeParent = nodeParent; + TreeNode nodeFirstChild = nodeParent._nodeFirstChild; + if (nodeFirstChild == null) + { + nodeParent._nodeFirstChild = nodeChange; + } + else + { + switch (lt) + { + case LinkType.Before: + nodeChange._nodeNext = nodeSibling; + nodeChange._nodePrevious = nodeSibling._nodePrevious; + nodeSibling._nodePrevious = nodeChange; + if (nodeChange._nodePrevious != null) + { + nodeChange._nodePrevious._nodeNext = nodeChange; + break; + } + nodeParent._nodeFirstChild = nodeChange; + break; + case LinkType.Behind: + nodeChange._nodePrevious = nodeSibling; + nodeChange._nodeNext = nodeSibling._nodeNext; + nodeSibling._nodeNext = nodeChange; + if (nodeChange._nodeNext == null) + break; + nodeChange._nodeNext._nodePrevious = nodeChange; + break; + case LinkType.First: + nodeParent._nodeFirstChild = nodeChange; + nodeChange._nodeNext = nodeFirstChild; + if (nodeFirstChild == null) + break; + nodeFirstChild._nodePrevious = nodeChange; + break; + case LinkType.Last: + TreeNode lastSibling = nodeFirstChild.LastSibling; + lastSibling._nodeNext = nodeChange; + nodeChange._nodePrevious = lastSibling; + break; + } + } + } + + private static void DoUnlink(TreeNode nodeChange) + { + if (nodeChange._nodeParent._nodeFirstChild == nodeChange) + nodeChange._nodeParent._nodeFirstChild = nodeChange._nodeNext; + if (nodeChange._nodeNext != null) + nodeChange._nodeNext._nodePrevious = nodeChange._nodePrevious; + if (nodeChange._nodePrevious != null) + nodeChange._nodePrevious._nodeNext = nodeChange._nodeNext; + nodeChange._nodeParent = null; + nodeChange._nodeNext = null; + nodeChange._nodePrevious = null; + } + + private void FireTreeChangeWorker() + { + foreach (TreeNode child in Children) + child.FireTreeChangeWorker(); + if (!(GetEventHandler(s_deepParentChangeEvent) is EventHandler eventHandler)) + return; + eventHandler(this, EventArgs.Empty); + } + + protected object GetData(DataCookie cookie) => _dataMap.GetData(cookie); + + protected void SetData(DataCookie cookie, object value) => _dataMap.SetData(cookie, value); + + protected Delegate GetEventHandler(EventCookie cookie) => _dataMap.GetEventHandler(cookie); + + protected bool AddEventHandler(EventCookie cookie, Delegate handlerToAdd) => _dataMap.AddEventHandler(cookie, handlerToAdd); + + protected bool RemoveEventHandler(EventCookie cookie, Delegate handlerToRemove) => _dataMap.RemoveEventHandler(cookie, handlerToRemove); + + protected void RemoveEventHandlers(EventCookie cookie) => _dataMap.RemoveEventHandlers(cookie); + + private static uint GetKey(EventCookie cookie) => EventCookie.ToUInt32(cookie); + + public enum LinkType + { + Before = 1, + Behind = 2, + First = 3, + Last = 4, + } + } +} diff --git a/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs b/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs new file mode 100644 index 0000000..f7a64cf --- /dev/null +++ b/UIX/Microsoft/Iris/Library/TreeNodeCollection.cs @@ -0,0 +1,116 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.TreeNodeCollection +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; +using System.Collections; + +namespace Microsoft.Iris.Library +{ + internal struct TreeNodeCollection : IList, ICollection, IEnumerable + { + private TreeNode _nodeSubject; + + internal TreeNodeCollection(TreeNode nodeSubject) => _nodeSubject = nodeSubject; + + public int Count => _nodeSubject.ChildCount; + + bool ICollection.IsSynchronized => false; + + object ICollection.SyncRoot => (object)null; + + bool IList.IsFixedSize => false; + + bool IList.IsReadOnly => false; + + object IList.this[int index] + { + get => this[index]; + set + { + } + } + + public TreeNode this[int childIndex] + { + get + { + int num = 0; + foreach (TreeNode treeNode in this) + { + if (childIndex == num) + return treeNode; + ++num; + } + return null; + } + set + { + } + } + + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + public TreeNodeEnumerator GetEnumerator() => new TreeNodeEnumerator(_nodeSubject); + + void ICollection.CopyTo(Array destList, int destIndex) + { + foreach (TreeNode treeNode in this) + destList.SetValue(treeNode, destIndex++); + } + + public void CopyTo(TreeNode[] destList, int destIndex) => ((ICollection)this).CopyTo(destList, destIndex); + + int IList.Add(object value) + { + Add((TreeNode)value); + return _nodeSubject.ChildCount - 1; + } + + public void Add(TreeNode nodeChild) => nodeChild.ChangeParent(_nodeSubject, null, TreeNode.LinkType.Last); + + public void Clear() => _nodeSubject.RemoveAllChildren(true); + + bool IList.Contains(object nodeChild) => Contains((TreeNode)nodeChild); + + public bool Contains(TreeNode nodeChild) => nodeChild.Parent == _nodeSubject; + + int IList.IndexOf(object nodeChild) => IndexOf((TreeNode)nodeChild); + + public int IndexOf(TreeNode nodeChild) + { + if (nodeChild.Parent != _nodeSubject) + return -1; + int num = 0; + foreach (TreeNode treeNode in this) + { + if (nodeChild == treeNode) + return num; + ++num; + } + return -1; + } + + void IList.Insert(int insertAtIndex, object nodeChild) => Insert(insertAtIndex, (TreeNode)nodeChild); + + public void Insert(int insertAtIndex, TreeNode nodeChild) + { + TreeNode nodeSibling = null; + TreeNode.LinkType lt = TreeNode.LinkType.Last; + if (insertAtIndex < Count) + { + nodeSibling = this[insertAtIndex]; + lt = TreeNode.LinkType.Before; + } + nodeChild.ChangeParent(_nodeSubject, nodeSibling, lt); + } + + void IList.Remove(object nodeChild) => Remove((TreeNode)nodeChild); + + public void Remove(TreeNode nodeChild) => nodeChild.ChangeParent(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 new file mode 100644 index 0000000..117e292 --- /dev/null +++ b/UIX/Microsoft/Iris/Library/TreeNodeEnumerator.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.TreeNodeEnumerator +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Library +{ + internal struct TreeNodeEnumerator : IEnumerator + { + private TreeNode _nodeParent; + private TreeNode _nodeCurrent; + private TreeNode _nodeNext; + + internal TreeNodeEnumerator(TreeNode nodeParent) + { + _nodeParent = nodeParent; + _nodeCurrent = null; + _nodeNext = nodeParent.FirstChild; + } + + object IEnumerator.Current => _nodeCurrent; + + public TreeNode Current => _nodeCurrent; + + public void Reset() + { + _nodeCurrent = null; + _nodeNext = _nodeParent.FirstChild; + } + + public bool MoveNext() + { + _nodeCurrent = _nodeNext; + if (_nodeNext == null) + return false; + _nodeNext = _nodeNext.NextSibling; + return true; + } + } +} diff --git a/UIX/Microsoft/Iris/Library/Utility.cs b/UIX/Microsoft/Iris/Library/Utility.cs new file mode 100644 index 0000000..8f2969b --- /dev/null +++ b/UIX/Microsoft/Iris/Library/Utility.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Library.Utility +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Library +{ + internal class Utility + { + public static bool IsEqual(object a, object b) => a == null ? b == null : a.Equals(b); + } +} diff --git a/UIX/Microsoft/Iris/ListContentsChangeType.cs b/UIX/Microsoft/Iris/ListContentsChangeType.cs new file mode 100644 index 0000000..414e6d5 --- /dev/null +++ b/UIX/Microsoft/Iris/ListContentsChangeType.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ListContentsChangeType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris +{ + public enum ListContentsChangeType + { + Add, + AddRange, + Remove, + Move, + Insert, + InsertRange, + Clear, + Modified, + Reset, + } +} diff --git a/UIX/Microsoft/Iris/ListContentsChangedArgs.cs b/UIX/Microsoft/Iris/ListContentsChangedArgs.cs new file mode 100644 index 0000000..7605847 --- /dev/null +++ b/UIX/Microsoft/Iris/ListContentsChangedArgs.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ListContentsChangedArgs +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris +{ + public class ListContentsChangedArgs : EventArgs + { + private ListContentsChangeType _type; + private int _oldIndex; + private int _newIndex; + private int _count; + + internal ListContentsChangedArgs( + ListContentsChangeType type, + int oldIndex, + int newIndex, + int count) + { + _count = count; + _type = type; + _oldIndex = oldIndex; + _newIndex = newIndex; + } + + internal ListContentsChangedArgs(ListContentsChangeType type, int oldIndex, int newIndex) + : this(type, oldIndex, newIndex, 1) + { + } + + public ListContentsChangeType Type => _type; + + public int OldIndex => _oldIndex; + + public int NewIndex => _newIndex; + + public int Count => _count; + } +} diff --git a/UIX/Microsoft/Iris/ListContentsChangedHandler.cs b/UIX/Microsoft/Iris/ListContentsChangedHandler.cs new file mode 100644 index 0000000..bb4e83c --- /dev/null +++ b/UIX/Microsoft/Iris/ListContentsChangedHandler.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ListContentsChangedHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris +{ + public delegate void ListContentsChangedHandler(IList senderList, ListContentsChangedArgs args); +} diff --git a/UIX/Microsoft/Iris/ListContentsChangedProxy.cs b/UIX/Microsoft/Iris/ListContentsChangedProxy.cs new file mode 100644 index 0000000..a205d0a --- /dev/null +++ b/UIX/Microsoft/Iris/ListContentsChangedProxy.cs @@ -0,0 +1,65 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ListContentsChangedProxy +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using System; +using System.Collections; + +namespace Microsoft.Iris +{ + internal class ListContentsChangedProxy + { + private ListContentsChangedHandler _method; + + public static UIListContentsChangedHandler Thunk( + ListContentsChangedHandler method) + { + return new UIListContentsChangedHandler(new ListContentsChangedProxy() + { + _method = method + }.Thunk); + } + + private void Thunk(IList senderList, UIListContentsChangedArgs internalArgs) + { + ListContentsChangeType type; + switch (internalArgs.Type) + { + case UIListContentsChangeType.Add: + type = ListContentsChangeType.Add; + break; + case UIListContentsChangeType.AddRange: + type = ListContentsChangeType.AddRange; + break; + case UIListContentsChangeType.Remove: + type = ListContentsChangeType.Remove; + break; + case UIListContentsChangeType.Move: + type = ListContentsChangeType.Move; + break; + case UIListContentsChangeType.Insert: + type = ListContentsChangeType.Insert; + break; + case UIListContentsChangeType.InsertRange: + type = ListContentsChangeType.InsertRange; + break; + case UIListContentsChangeType.Clear: + type = ListContentsChangeType.Clear; + break; + case UIListContentsChangeType.Modified: + type = ListContentsChangeType.Modified; + break; + case UIListContentsChangeType.Reset: + type = ListContentsChangeType.Reset; + break; + default: + throw new ArgumentException("Unexpected ListContentsChangeType"); + } + ListContentsChangedArgs args = new ListContentsChangedArgs(type, internalArgs.OldIndex, internalArgs.NewIndex, internalArgs.Count); + _method(senderList, args); + } + } +} diff --git a/UIX/Microsoft/Iris/ListDataSet.cs b/UIX/Microsoft/Iris/ListDataSet.cs new file mode 100644 index 0000000..f62c2e5 --- /dev/null +++ b/UIX/Microsoft/Iris/ListDataSet.cs @@ -0,0 +1,365 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.ListDataSet +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using System; +using System.Collections; + +namespace Microsoft.Iris +{ + public class ListDataSet : ModelItem, INotifyList, IList, ICollection, IEnumerable + { + private static readonly EventCookie s_listContentsChangedEvent = EventCookie.ReserveSlot(); + private IList _sourceList; + + protected ListDataSet() + : this(null) + { + } + + public ListDataSet(IList source) + : this(null, source) + { + } + + public ListDataSet(IModelItemOwner owner, IList source) + : base(owner) + => _sourceList = source; + + public IList Source + { + get + { + using (ThreadValidator) + return _sourceList; + } + set + { + using (ThreadValidator) + { + if (_sourceList == value) + return; + _sourceList = !(_sourceList is IVirtualList) ? value : throw new ArgumentException(InvariantString.Format("ListDataSet does not support IVirtualList. Cannot associate with source list: {0}", value)); + FirePropertyChanged(nameof(Source)); + FirePropertyChanged("Count"); + FireSetChanged(UIListContentsChangeType.Reset, -1, -1); + } + } + } + + public virtual int Count + { + get + { + using (ThreadValidator) + return _sourceList == null ? 0 : _sourceList.Count; + } + } + + public virtual bool IsSynchronized + { + get + { + using (ThreadValidator) + return _sourceList != null && _sourceList.IsSynchronized; + } + } + + public virtual object SyncRoot + { + get + { + using (ThreadValidator) + return _sourceList == null ? null : _sourceList.SyncRoot; + } + } + + public bool IsReadOnly + { + get + { + using (ThreadValidator) + return _sourceList == null || _sourceList.IsReadOnly; + } + } + + public bool IsFixedSize + { + get + { + using (ThreadValidator) + return _sourceList == null || _sourceList.IsFixedSize; + } + } + + public object this[int itemIndex] + { + get + { + using (ThreadValidator) + return _sourceList == null ? null : _sourceList[itemIndex]; + } + set + { + using (ThreadValidator) + { + if (_sourceList == null) + throw new InvalidOperationException("Cannot use the this indexer without first specifying a Source for this ListDataSet."); + if (itemIndex < 0 || itemIndex >= Count) + throw new ArgumentOutOfRangeException(nameof(itemIndex), itemIndex, "Given index is out of the range of this list."); + if (_sourceList[itemIndex] == value) + return; + _sourceList[itemIndex] = value; + FireSetChanged(UIListContentsChangeType.Modified, itemIndex, itemIndex); + } + } + } + + public virtual void Clear() + { + using (ThreadValidator) + { + if (_sourceList == null) + return; + _sourceList.Clear(); + FireSetChanged(UIListContentsChangeType.Clear, -1, -1); + FirePropertyChanged("Count"); + } + } + + public virtual void CopyTo(Array array, int index) + { + using (ThreadValidator) + { + if (_sourceList == null) + throw new NotImplementedException("The \"CopyTo\" operation is not supported by this ListDataSet"); + _sourceList.CopyTo(array, index); + } + } + + public void CopyFrom(IEnumerable source) + { + using (ThreadValidator) + { + if (source == null) + throw new ArgumentNullException(nameof(source)); + foreach (object obj in source) + Add(obj); + } + } + + public virtual IEnumerator GetEnumerator() + { + using (ThreadValidator) + return _sourceList != null ? _sourceList.GetEnumerator() : throw new NotImplementedException("The \"GetEnumerator\" operation is not supported by this UIDataSet"); + } + + public bool Contains(object item) + { + using (ThreadValidator) + return _sourceList != null && _sourceList.Contains(item); + } + + public int IndexOf(object item) + { + using (ThreadValidator) + return _sourceList == null ? -1 : _sourceList.IndexOf(item); + } + + public void Remove(object item) + { + using (ThreadValidator) + { + int index = IndexOf(item); + if (index <= -1) + return; + RemoveAt(index); + } + } + + public void RemoveAt(int index) + { + using (ThreadValidator) + { + if (_sourceList == null) + throw new ArgumentException(InvariantString.Format("Empty list cannot remove item at index {0}", index)); + object obj = this[index]; + _sourceList.RemoveAt(index); + FireSetChanged(UIListContentsChangeType.Remove, index, -1); + FirePropertyChanged("Count"); + } + } + + public void Move(int oldIndex, int newIndex) + { + using (ThreadValidator) + { + if (_sourceList == null) + throw new ArgumentException(InvariantString.Format("Empty list cannot move item from {0} to {1}", oldIndex, newIndex)); + object obj = this[oldIndex]; + if (_sourceList is INotifyList sourceList) + { + sourceList.Move(oldIndex, newIndex); + } + else + { + _sourceList.RemoveAt(oldIndex); + _sourceList.Insert(newIndex, obj); + } + FireSetChanged(UIListContentsChangeType.Move, oldIndex, newIndex); + } + } + + public int Reorder(IList indices, int newIndex) + { + using (ThreadValidator) + { + if (indices == null) + throw new ArgumentNullException(nameof(indices)); + if (newIndex < 0 || newIndex > 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 = null; + if (indices.IsReadOnly) + numArray = new int[indices.Count]; + int index1 = 0; + foreach (object index2 in indices) + { + if (!(index2 is int num)) + throw new ArgumentException("indices[" + index1 + "] does not contain an int", nameof(indices)); + if (num < 0 || num >= Count) + 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 = numArray; + int num1 = newIndex; + for (int index2 = 0; index2 < indices.Count; ++index2) + { + int index3 = (int)indices[index2]; + if (index3 < newIndex) + { + --newIndex; + --num1; + } + if (index3 != newIndex) + { + Move(index3, newIndex); + for (int index4 = index2 + 1; index4 < indices.Count; ++index4) + { + int index5 = (int)indices[index4]; + if (index3 < index5 && index5 <= newIndex) + indices[index4] = index5 - 1; + else if (newIndex <= index5 && index5 < index3) + indices[index4] = index5 + 1; + else if (index5 == index3) + indices[index4] = newIndex; + } + } + ++newIndex; + } + return num1; + } + } + + public void Insert(int index, object item) + { + using (ThreadValidator) + { + _sourceList.Insert(index, item); + FireSetChanged(UIListContentsChangeType.Insert, -1, index); + FirePropertyChanged("Count"); + } + } + + public int Add(object item) + { + using (ThreadValidator) + { + int newIndex = _sourceList != null ? _sourceList.Add(item) : throw new ArgumentException("Empty list cannot add items."); + FireSetChanged(UIListContentsChangeType.Add, -1, newIndex); + FirePropertyChanged("Count"); + return newIndex; + } + } + + public void Sort(IComparer comparer) + { + using (ThreadValidator) + { + if (comparer == null) + throw new ArgumentException("Must provide a valid IComparer"); + SortWorker(comparer); + } + } + + public void Sort() + { + using (ThreadValidator) + SortWorker(null); + } + + private void SortWorker(IComparer cmp) + { + for (int index1 = 0; index1 < Count; ++index1) + { + for (int index2 = index1 + 1; index2 < Count; ++index2) + { + if (Compare(this[index1], this[index2], cmp) > 0) + Move(index2, index1); + } + } + } + + private int Compare(object objA, object objB, IComparer cmp) + { + if (cmp != null) + return cmp.Compare(objA, objB); + return objA is IComparable comparable ? comparable.CompareTo(objB) : 0; + } + + event UIListContentsChangedHandler INotifyList.ContentsChanged + { + add + { + using (ThreadValidator) + AddEventHandler(s_listContentsChangedEvent, value); + } + remove + { + using (ThreadValidator) + RemoveEventHandler(s_listContentsChangedEvent, value); + } + } + + public event ListContentsChangedHandler ContentsChanged + { + add + { + using (ThreadValidator) + AddEventHandler(s_listContentsChangedEvent, ListContentsChangedProxy.Thunk(value)); + } + remove + { + using (ThreadValidator) + RemoveEventHandler(s_listContentsChangedEvent, ListContentsChangedProxy.Thunk(value)); + } + } + + internal void FireSetChanged(UIListContentsChangeType type, int oldIndex, int newIndex) + { + UIListContentsChangedHandler eventHandler = (UIListContentsChangedHandler)GetEventHandler(s_listContentsChangedEvent); + if (eventHandler != null) + { + UIListContentsChangedArgs args = new UIListContentsChangedArgs(type, oldIndex, newIndex); + eventHandler(this, args); + } + FirePropertyChanged("ContentsChanged"); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/AliasMapping.cs b/UIX/Microsoft/Iris/Markup/AliasMapping.cs new file mode 100644 index 0000000..3cd0268 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AliasMapping.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AliasMapping +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class AliasMapping + { + public string Alias; + public LoadResult LoadResult; + public string TargetType; + + public AliasMapping(string alias, LoadResult loadResult, string targetType) + { + Alias = alias; + LoadResult = loadResult; + TargetType = targetType; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/AssemblyConstructorSchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyConstructorSchema.cs new file mode 100644 index 0000000..d99d391 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyConstructorSchema.cs @@ -0,0 +1,39 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyConstructorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Reflection; + +namespace Microsoft.Iris.Markup +{ + internal class AssemblyConstructorSchema : ConstructorSchema + { + private ConstructorInfo _constructorInfo; + private TypeSchema[] _parameterTypes; + private FastReflectionInvokeHandler _constructor; + + public AssemblyConstructorSchema( + AssemblyTypeSchema owner, + ConstructorInfo constructorInfo, + TypeSchema[] parameterTypes) + : base(owner) + { + _constructorInfo = constructorInfo; + _parameterTypes = parameterTypes; + } + + public override TypeSchema[] ParameterTypes => _parameterTypes; + + public override object Construct(object[] parameters) + { + object[] paramters = AssemblyLoadResult.UnwrapObjectList(parameters); + AssemblyTypeSchema owner = (AssemblyTypeSchema)Owner; + if (_constructor == null) + _constructor = ReflectionHelper.CreateMethodInvoke(_constructorInfo); + object instance = _constructor(null, paramters); + return AssemblyLoadResult.WrapObject(owner, instance); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/AssemblyEventSchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyEventSchema.cs new file mode 100644 index 0000000..9d0be86 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyEventSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyEventSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Reflection; + +namespace Microsoft.Iris.Markup +{ + internal class AssemblyEventSchema : EventSchema + { + private EventInfo _eventInfo; + + public AssemblyEventSchema(AssemblyTypeSchema owner, EventInfo eventInfo) + : base(owner) + => _eventInfo = eventInfo; + + public override string Name => _eventInfo.Name; + } +} diff --git a/UIX/Microsoft/Iris/Markup/AssemblyLoadResult.cs b/UIX/Microsoft/Iris/Markup/AssemblyLoadResult.cs new file mode 100644 index 0000000..1bcdcc4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyLoadResult.cs @@ -0,0 +1,356 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyLoadResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Reflection; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Markup +{ + internal class AssemblyLoadResult : LoadResult + { + private const string c_AssemblyProtocol = "assembly://"; + private Assembly _assembly; + private string _namespace; + private string _namespacePrefix; + public static TypeSchema ObjectTypeSchema; + public static TypeSchema ListTypeSchema; + public static TypeSchema EnumeratorTypeSchema; + public static TypeSchema DictionaryTypeSchema; + public static TypeSchema CommandTypeSchema; + public static TypeSchema ValueRangeTypeSchema; + private static Map s_typeCache = new Map(32); + private static Map s_assemblyCache = new Map(); + + private static LoadResult Create(string uri) + { + 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", uri); + return null; + } + string leftName; + string rightName; + SplitAtLastWhack(valueName, out leftName, out rightName); + AssemblyName name = null; + try + { + name = new AssemblyName(leftName); + } + catch (COMException ex) + { + } + catch (FileLoadException ex) + { + } + if (name == null) + { + name = new AssemblyName(); + name.CodeBase = leftName; + } + if (name != null) + { + Exception assemblyLoadException; + Assembly assembly = FindAssembly(name, out assemblyLoadException); + if (assembly != null) + loadResult = MapAssembly(assembly, rightName); + else if (assemblyLoadException != null) + ErrorManager.ReportError("Failure loading assembly: '{0}'", assemblyLoadException.Message); + else + ErrorManager.ReportError("Failure loading assembly"); + } + return loadResult; + } + + public static void Startup() + { + AssemblyObjectProxyHelper.InitializeStatics(); + MarkupSystem.RegisterFactoryByProtocol("assembly://", new CreateLoadResultHandler(Create)); + Map typeCache1 = s_typeCache; + Type type1 = typeof(object); + FrameworkCompatibleAssemblyPrimitiveTypeSchema primitiveTypeSchema; + ObjectTypeSchema = primitiveTypeSchema = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(ObjectSchema.Type); + TypeSchema typeA1 = primitiveTypeSchema; + typeCache1[type1] = primitiveTypeSchema; + TypeSchema.RegisterTwoWayEquivalence(typeA1, ObjectSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(void)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(VoidSchema.Type)), VoidSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(bool)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(BooleanSchema.Type)), BooleanSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(byte)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(ByteSchema.Type)), ByteSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(char)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(CharSchema.Type)), CharSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(double)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(DoubleSchema.Type)), DoubleSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(string)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(StringSchema.Type)), StringSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(float)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(SingleSchema.Type)), SingleSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(int)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(Int32Schema.Type)), Int32Schema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(long)] = new FrameworkCompatibleAssemblyPrimitiveTypeSchema(Int64Schema.Type)), Int64Schema.Type); + Map typeCache2 = s_typeCache; + Type type2 = typeof(IList); + FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema1; + ListTypeSchema = assemblyTypeSchema1 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IList), typeof(IList), typeof(ArrayList)); + TypeSchema typeA2 = assemblyTypeSchema1; + typeCache2[type2] = assemblyTypeSchema1; + TypeSchema.RegisterTwoWayEquivalence(typeA2, ListSchema.Type); + Map typeCache3 = s_typeCache; + Type type3 = typeof(IEnumerator); + FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema2; + EnumeratorTypeSchema = assemblyTypeSchema2 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IEnumerator), typeof(IEnumerator)); + TypeSchema typeA3 = assemblyTypeSchema2; + typeCache3[type3] = assemblyTypeSchema2; + TypeSchema.RegisterTwoWayEquivalence(typeA3, EnumeratorSchema.Type); + Map typeCache4 = s_typeCache; + Type type4 = typeof(IDictionary); + FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema3; + DictionaryTypeSchema = assemblyTypeSchema3 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IDictionary), AssemblyObjectProxyHelper.ProxyDictionaryType, typeof(Dictionary)); + TypeSchema producer1 = assemblyTypeSchema3; + typeCache4[type4] = assemblyTypeSchema3; + TypeSchema.RegisterOneWayEquivalence(producer1, DictionarySchema.Type); + Map typeCache5 = s_typeCache; + Type type5 = typeof(ICommand); + FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema4; + CommandTypeSchema = assemblyTypeSchema4 = new FrameworkCompatibleAssemblyTypeSchema(typeof(ICommand), AssemblyObjectProxyHelper.ProxyCommandType); + TypeSchema producer2 = assemblyTypeSchema4; + typeCache5[type5] = assemblyTypeSchema4; + TypeSchema.RegisterOneWayEquivalence(producer2, CommandSchema.Type); + Map typeCache6 = s_typeCache; + Type type6 = typeof(IValueRange); + FrameworkCompatibleAssemblyTypeSchema assemblyTypeSchema5; + ValueRangeTypeSchema = assemblyTypeSchema5 = new FrameworkCompatibleAssemblyTypeSchema(typeof(IValueRange), AssemblyObjectProxyHelper.ProxyValueRangeType); + TypeSchema producer3 = assemblyTypeSchema5; + typeCache6[type6] = assemblyTypeSchema5; + TypeSchema.RegisterOneWayEquivalence(producer3, ValueRangeSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(s_typeCache[typeof(Group)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Group), typeof(IUIGroup))), GroupSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(s_typeCache[typeof(Image)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Image), typeof(UIImage))), ImageSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(s_typeCache[typeof(Type)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Type), typeof(TypeSchema), null, ObjectTypeSchema)), TypeSchemaDefinition.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(s_typeCache[typeof(VideoStream)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(VideoStream))), VideoStreamSchema.Type); + TypeSchema producer4; + 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)(s_typeCache[typeof(Microsoft.Iris.BooleanChoice)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.BooleanChoice))), BooleanChoiceSchema.Type); + TypeSchema producer5; + 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)(s_typeCache[typeof(Microsoft.Iris.IntRangedValue)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.IntRangedValue))), IntRangedValueSchema.Type); + TypeSchema.RegisterOneWayEquivalence((TypeSchema)(s_typeCache[typeof(Microsoft.Iris.ByteRangedValue)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(Microsoft.Iris.ByteRangedValue))), ByteRangedValueSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(DataProviderQuery)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderQuery), typeof(MarkupDataQuery))), MarkupDataQueryInstanceSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(DataProviderObject)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderObject), typeof(MarkupDataType))), MarkupDataTypeInstanceSchema.Type); + TypeSchema.RegisterTwoWayEquivalence((TypeSchema)(s_typeCache[typeof(DataProviderQueryStatus)] = new FrameworkCompatibleAssemblyTypeSchema(typeof(DataProviderQueryStatus))), UIXLoadResultExports.DataQueryStatusType); + } + + public static void Shutdown() + { + foreach (SharedDisposableObject disposableObject in s_assemblyCache.Values) + disposableObject.UnregisterUsage(s_assemblyCache); + s_assemblyCache.Clear(); + s_assemblyCache = null; + foreach (AssemblyTypeSchema assemblyTypeSchema in s_typeCache.Values) + { + AssemblyLoadResult owner = (AssemblyLoadResult)assemblyTypeSchema.Owner; + assemblyTypeSchema.Dispose(owner); + } + s_typeCache.Clear(); + s_typeCache = null; + } + + public string Namespace => _namespace; + + public override LoadResultStatus Status => LoadResultStatus.Success; + + public override TypeSchema FindType(string name) + { + Type type = _assembly.GetType(_namespacePrefix + name, false); + if (type == null) + return null; + if (type.IsVisible) + return MapType(type); + ErrorManager.ReportError("Type '{0}' is not public in '{1}'", name, _assembly); + return null; + } + + public static AssemblyLoadResult MapAssembly(Assembly assembly, string ns) + { + AssemblyLoadResult.MapAssemblyKey key = new AssemblyLoadResult.MapAssemblyKey(assembly, ns); + AssemblyLoadResult assemblyLoadResult; + if (!s_assemblyCache.TryGetValue(key, out assemblyLoadResult)) + { + string uri = "assembly://" + assembly.FullName; + if (ns != null) + uri = uri + "/" + ns; + assemblyLoadResult = new AssemblyLoadResult(assembly, ns, uri); + s_assemblyCache[key] = assemblyLoadResult; + assemblyLoadResult.RegisterUsage(s_assemblyCache); + } + return assemblyLoadResult; + } + + public static AssemblyTypeSchema MapType(Type type) + { + object obj; + AssemblyTypeSchema assemblyTypeSchema; + if (s_typeCache.TryGetValue(type, out obj)) + { + assemblyTypeSchema = (AssemblyTypeSchema)obj; + } + else + { + assemblyTypeSchema = AssemblyObjectProxyHelper.CreateProxySchema(type); + s_typeCache[type] = assemblyTypeSchema; + } + return assemblyTypeSchema; + } + + public static Type MapType(TypeSchema typeSchema) + { + if (typeSchema is AssemblyTypeSchema assemblyTypeSchema) + return assemblyTypeSchema.InternalType; + for (TypeSchema typeSchema1 = typeSchema; typeSchema1 != null; typeSchema1 = typeSchema1.Base) + { + if (typeSchema1.Equivalents != null) + { + foreach (TypeSchema equivalent in typeSchema1.Equivalents) + { + if (equivalent is AssemblyTypeSchema assemblyTypeSchemaB) + return assemblyTypeSchemaB.InternalType; + } + } + } + return null; + } + + internal static Type[] MapTypeList(TypeSchema[] typeSchemaList) + { + Type[] typeArray = new Type[typeSchemaList.Length]; + for (int index = 0; index < typeSchemaList.Length; ++index) + { + typeArray[index] = MapType(typeSchemaList[index]); + if (typeArray[index] == null) + return null; + } + return typeArray; + } + + internal static TypeSchema[] MapTypeList(Type[] typeList) + { + TypeSchema[] typeSchemaArray = new TypeSchema[typeList.Length]; + for (int index = 0; index < typeList.Length; ++index) + { + typeSchemaArray[index] = MapType(typeList[index]); + if (typeSchemaArray[index] == 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(null, instance); + + internal static object UnwrapObject(object instance) => AssemblyObjectProxyHelper.UnwrapObject(instance); + + internal static object[] UnwrapObjectList(object[] instanceList) + { + if (instanceList == null) + return null; + object[] objArray = new object[instanceList.Length]; + for (int index = 0; index < objArray.Length; ++index) + objArray[index] = UnwrapObject(instanceList[index]); + return objArray; + } + + private static void SplitAtLastWhack( + string valueName, + out string leftName, + out string rightName) + { + int length = valueName.LastIndexOf('/'); + if (length != -1) + { + leftName = valueName.Substring(0, length); + rightName = valueName.Substring(length + 1); + } + else + { + leftName = valueName; + rightName = null; + } + } + + public static Assembly FindAssembly( + AssemblyName name, + out Exception assemblyLoadException) + { + Assembly assembly = null; + assemblyLoadException = null; + try + { + assembly = Assembly.Load(name); + } + catch (FileLoadException ex) + { + assemblyLoadException = ex; + } + catch (BadImageFormatException ex) + { + assemblyLoadException = ex; + } + catch (FileNotFoundException ex) + { + assemblyLoadException = ex; + } + return assembly; + } + + public override string GetCompilerReferenceName() => base.GetCompilerReferenceName() ?? string.Format("{0}{1}/{2}", "assembly://", _assembly.GetName().Name, _namespace); + + internal Assembly Assembly => _assembly; + + private AssemblyLoadResult(Assembly assembly, string ns, string uri) + : base(uri) + { + _assembly = assembly; + _namespace = ns; + if (ns == null) + return; + _namespacePrefix = ns + "."; + } + + internal struct MapAssemblyKey + { + private Assembly _assembly; + private string _namespace; + + public MapAssemblyKey(Assembly assembly, string ns) + { + _assembly = assembly; + _namespace = ns; + } + + public override bool Equals(object obj) + { + AssemblyLoadResult.MapAssemblyKey mapAssemblyKey = (AssemblyLoadResult.MapAssemblyKey)obj; + return _assembly == mapAssemblyKey._assembly && _namespace == mapAssemblyKey._namespace; + } + + public override int GetHashCode() + { + int hashCode = _assembly.GetHashCode(); + if (_namespace != null) + hashCode ^= _namespace.GetHashCode(); + return hashCode; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataQuery.cs b/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataQuery.cs new file mode 100644 index 0000000..254626d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataQuery.cs @@ -0,0 +1,74 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyMarkupDataQuery +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Markup +{ + internal class AssemblyMarkupDataQuery : MarkupDataQuery + { + private IDataProviderQuery _externalQuery; + + public AssemblyMarkupDataQuery(MarkupDataQuerySchema type, AssemblyDataProviderWrapper provider) + : base(type) + { + _externalQuery = provider.ConstructQuery(type); + _externalQuery.DeclareOwner(this); + _externalQuery.SetInternalObject(this); + ApplyDefaultValues(); + } + + public override void NotifyInitialized() + { + base.NotifyInitialized(); + if (_externalQuery == null) + return; + _externalQuery.OnInitialize(); + } + + protected override void OnDispose() + { + base.OnDispose(); + if (_externalQuery == null) + return; + _externalQuery.Dispose(this); + } + + public override void Refresh() => _externalQuery.Refresh(); + + public override object Result + { + get => AssemblyLoadResult.WrapObject(_externalQuery.Result); + set => _externalQuery.Result = AssemblyLoadResult.UnwrapObject(value); + } + + public override DataProviderQueryStatus Status => _externalQuery.Status; + + public override bool Enabled + { + get => _externalQuery.Enabled; + set => _externalQuery.Enabled = value; + } + + protected override bool ExternalObjectGetProperty(string propertyName, out object value) + { + object property = _externalQuery.GetProperty(propertyName); + value = AssemblyLoadResult.WrapObject(property); + return true; + } + + protected override bool ExternalObjectSetProperty(string propertyName, object value) + { + object obj = AssemblyLoadResult.UnwrapObject(value); + _externalQuery.SetProperty(propertyName, obj); + return true; + } + + 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 new file mode 100644 index 0000000..85b65ba --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyMarkupDataType.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyMarkupDataType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Markup +{ + internal class AssemblyMarkupDataType : MarkupDataType + { + private IDataProviderObject _externalObject; + + public AssemblyMarkupDataType(MarkupDataTypeSchema type, IDataProviderObject externalObject) + : base(type) + => _externalObject = externalObject; + + protected override bool ExternalObjectGetProperty(string propertyName, out object value) + { + object property = _externalObject.GetProperty(propertyName); + value = AssemblyLoadResult.WrapObject(property); + return true; + } + + protected override bool ExternalObjectSetProperty(string propertyName, object value) + { + object obj = AssemblyLoadResult.UnwrapObject(value); + _externalObject.SetProperty(propertyName, obj); + return true; + } + + 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 new file mode 100644 index 0000000..89f7ca6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyMethodSchema.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyMethodSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Reflection; + +namespace Microsoft.Iris.Markup +{ + internal class AssemblyMethodSchema : MethodSchema + { + private MethodInfo _methodInfo; + private TypeSchema[] _parameterTypes; + private TypeSchema _returnTypeSchema; + private FastReflectionInvokeHandler _method; + + public AssemblyMethodSchema( + AssemblyTypeSchema owner, + MethodInfo methodInfo, + TypeSchema[] parameterTypes) + : base(owner) + { + _methodInfo = methodInfo; + _parameterTypes = parameterTypes; + _returnTypeSchema = AssemblyLoadResult.MapType(_methodInfo.ReturnType); + } + + public override string Name => _methodInfo.Name; + + public override TypeSchema[] ParameterTypes => _parameterTypes; + + public override TypeSchema ReturnType => _returnTypeSchema; + + public override bool IsStatic => _methodInfo.IsStatic; + + public override object Invoke(object instance, object[] parameters) + { + object target = AssemblyLoadResult.UnwrapObject(instance); + object[] paramters = AssemblyLoadResult.UnwrapObjectList(parameters); + if (_method == null) + _method = ReflectionHelper.CreateMethodInvoke(_methodInfo); + return AssemblyLoadResult.WrapObject(_returnTypeSchema, _method(target, paramters)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/AssemblyObjectProxyHelper.cs b/UIX/Microsoft/Iris/Markup/AssemblyObjectProxyHelper.cs new file mode 100644 index 0000000..a89bda7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyObjectProxyHelper.cs @@ -0,0 +1,649 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyObjectProxyHelper +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.ViewItems; +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; + +namespace Microsoft.Iris.Markup +{ + internal static class AssemblyObjectProxyHelper + { + private static AssemblyObjectProxyHelper.ProxyTypeInfo[] s_proxyTypeInfoTable; + private static Type s_typeofString; + + public static void InitializeStatics() + { + s_typeofString = typeof(string); + s_proxyTypeInfoTable = new AssemblyObjectProxyHelper.ProxyTypeInfo[7] + { + 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) + }; + } + + public static AssemblyTypeSchema CreateProxySchema(Type assemblyType) + { + foreach (AssemblyObjectProxyHelper.ProxyTypeInfo proxyTypeInfo in s_proxyTypeInfoTable) + { + if (proxyTypeInfo.type.IsAssignableFrom(assemblyType)) + { + AssemblyTypeSchema assemblyTypeSchema = new FrameworkCompatibleAssemblyTypeSchema(assemblyType, proxyTypeInfo.proxyType); + if (proxyTypeInfo.equivalents != null) + assemblyTypeSchema.ShareEquivalents(proxyTypeInfo.equivalents); + return assemblyTypeSchema; + } + } + return new StandardAssemblyTypeSchema(assemblyType); + } + + internal static Type ProxyListType => typeof(AssemblyObjectProxyHelper.ProxyList); + + internal static Type ProxyDictionaryType => typeof(AssemblyObjectProxyHelper.ProxyDictionary); + + internal static Type ProxyCommandType => typeof(AssemblyObjectProxyHelper.ProxyCommand); + + internal static Type ProxyValueRangeType => typeof(AssemblyObjectProxyHelper.ProxyValueRange); + + internal static object WrapObject(TypeSchema typeSchema, object instance) + { + if (instance == null) + return null; + if (instance.GetType().IsPrimitive) + return instance; + switch (instance) + { + case Type type: + return AssemblyLoadResult.MapType(type); + case AssemblyObjectProxyHelper.IFrameworkProxyObject frameworkProxyObject: + return frameworkProxyObject.FrameworkObject; + default: + AssemblyObjectProxyHelper.ProxyObject proxyObject = null; + bool isDisposable = instance is IDisposable; + bool notifiesOnChange = instance is INotifyPropertyChanged; + switch (instance) + { + case ICommand _: + proxyObject = new AssemblyObjectProxyHelper.ProxyCommand(instance); + break; + case IValueRange _: + proxyObject = new AssemblyObjectProxyHelper.ProxyValueRange(instance); + break; + case IDictionary _: + proxyObject = new AssemblyObjectProxyHelper.ProxyDictionary(instance); + break; + case IList _: + 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) + { + proxyObject = new AssemblyObjectProxyHelper.ProxyObject(instance); + break; + } + break; + } + if (proxyObject == null) + return instance; + proxyObject.SetIntrinsicState(isDisposable, notifiesOnChange); + return proxyObject; + } + } + + internal static object UnwrapObject(object instance) + { + if (instance == null) + return null; + Type type = instance.GetType(); + if (type.IsPrimitive || type == s_typeofString) + return instance; + switch (instance) + { + case AssemblyObjectProxyHelper.IAssemblyProxyObject assemblyProxyObject: + return assemblyProxyObject.AssemblyObject; + case IList uixList: + return new AssemblyObjectProxyHelper.ReverseProxyList(uixList); + case IDictionary _: + case IDisposable _: + return new AssemblyObjectProxyHelper.WrappedFrameworkObject(instance); + default: + return instance; + } + } + + private struct ProxyTypeInfo + { + public Type type; + public Type proxyType; + public Vector equivalents; + + public ProxyTypeInfo(Type type, Type proxyType, TypeSchema equivalence) + { + this.type = type; + this.proxyType = proxyType; + equivalents = null; + if (equivalence == null) + return; + equivalents = new Vector(1); + equivalents.Add(equivalence); + } + } + + public interface IFrameworkProxyObject + { + object FrameworkObject { get; } + } + + private class WrappedFrameworkObject : AssemblyObjectProxyHelper.IFrameworkProxyObject + { + private object _frameworkObject; + + public WrappedFrameworkObject(object frameworkObject) => _frameworkObject = frameworkObject; + + public object FrameworkObject => _frameworkObject; + } + + public interface IAssemblyProxyObject + { + object AssemblyObject { get; } + } + + private class ProxyObject : + DisposableObject, + INotifyObject, + AssemblyObjectProxyHelper.IAssemblyProxyObject, + IModelItemOwner, + ISchemaInfo + { + protected object _assemblyObject; + private bool _isDisposable; + private bool _isModelItemOwner; + private bool _hasPropertyChangedHandlerAttached; + private NotifyService _notifier = new NotifyService(); + + public ProxyObject(object assemblyObject) => _assemblyObject = assemblyObject; + + public void SetIntrinsicState(bool isDisposable, bool notifiesOnChange) => _isDisposable = isDisposable; + + protected override void OnDispose() + { + if (_hasPropertyChangedHandlerAttached) + { + ((INotifyPropertyChanged)_assemblyObject).PropertyChanged -= new PropertyChangedEventHandler(OnPropertyChanged); + _hasPropertyChangedHandlerAttached = false; + } + _notifier.ClearListeners(); + if (_isDisposable && (!(_assemblyObject is ModelItem) || _isModelItemOwner)) + ((IDisposable)_assemblyObject).Dispose(); + base.OnDispose(); + } + + protected override void OnOwnerDeclared(object owner) + { + base.OnOwnerDeclared(owner); + if (!(_assemblyObject is ModelItem assemblyObject)) + return; + assemblyObject.Owner = this; + } + + public void AddListener(Listener listener) + { + if (!_hasPropertyChangedHandlerAttached) + { + ((INotifyPropertyChanged)_assemblyObject).PropertyChanged += new PropertyChangedEventHandler(OnPropertyChanged); + _hasPropertyChangedHandlerAttached = true; + } + _notifier.AddListener(listener); + } + + private void OnPropertyChanged(object sender, PropertyChangedEventArgs args) + { + _notifier.FireThreadSafe(args.PropertyName); + if (_notifier.HasListeners) + return; + ((INotifyPropertyChanged)_assemblyObject).PropertyChanged -= new PropertyChangedEventHandler(OnPropertyChanged); + _hasPropertyChangedHandlerAttached = false; + } + + public void RegisterObject(ModelItem modelItem) + { + if (modelItem != _assemblyObject) + throw new ArgumentException("Unexpected model item provided for ownership registration"); + _isModelItemOwner = true; + } + + public void UnregisterObject(ModelItem modelItem) + { + if (!_isModelItemOwner || modelItem != _assemblyObject) + throw new ArgumentException("Unexpected model item provided for ownership unregistration"); + _isModelItemOwner = false; + } + + public object AssemblyObject => _assemblyObject; + + public TypeSchema TypeSchema => AssemblyLoadResult.MapType(_assemblyObject.GetType()); + + public override bool Equals(object rhs) + { + if (rhs is AssemblyObjectProxyHelper.IAssemblyProxyObject) + rhs = ((AssemblyObjectProxyHelper.IAssemblyProxyObject)rhs).AssemblyObject; + return _assemblyObject.Equals(rhs); + } + + public override int GetHashCode() => _assemblyObject.GetHashCode(); + + public override string ToString() => _assemblyObject.ToString(); + } + + private class ProxyCommand : AssemblyObjectProxyHelper.ProxyObject, IUICommand + { + public ProxyCommand(object assemblyObject) + : base(assemblyObject) + { + } + + protected ICommand ExternalCommand => (ICommand)_assemblyObject; + + public bool Available + { + get => ExternalCommand.Available; + set => ExternalCommand.Available = value; + } + + public InvokePriority Priority + { + get + { + switch (ExternalCommand.Priority) + { + case InvokePolicy.Synchronous: + case InvokePolicy.AsynchronousNormal: + return InvokePriority.Normal; + default: + return InvokePriority.Low; + } + } + set + { + if (value == InvokePriority.Normal) + ExternalCommand.Priority = InvokePolicy.AsynchronousNormal; + else + ExternalCommand.Priority = InvokePolicy.AsynchronousLowPri; + } + } + + public void Invoke() => ExternalCommand.Invoke(); + } + + private class ProxyValueRange : AssemblyObjectProxyHelper.ProxyObject, IUIValueRange + { + public ProxyValueRange(object assemblyObject) + : base(assemblyObject) + { + } + + protected IValueRange ExternalRange => (IValueRange)_assemblyObject; + + public object ObjectValue => AssemblyLoadResult.WrapObject(ExternalRange.Value); + + public bool HasPreviousValue => ExternalRange.HasPreviousValue; + + public bool HasNextValue => ExternalRange.HasNextValue; + + public void PreviousValue() => ExternalRange.PreviousValue(); + + public void NextValue() => ExternalRange.NextValue(); + } + + private class ProxyList : + AssemblyObjectProxyHelper.ProxyObject, + IUIList, + IList, + ICollection, + IEnumerable + { + private bool _canSearch; + + public ProxyList(object assemblyObject) + : base(assemblyObject) + => _canSearch = assemblyObject is ISearchableList; + + protected IList ExternalList => (IList)_assemblyObject; + + public int Add(object value) => ExternalList.Add(AssemblyLoadResult.UnwrapObject(value)); + + public void Clear() => ExternalList.Clear(); + + public bool Contains(object value) => ExternalList.Contains(AssemblyLoadResult.UnwrapObject(value)); + + public int IndexOf(object value) => ExternalList.IndexOf(AssemblyLoadResult.UnwrapObject(value)); + + public void Insert(int index, object value) => ExternalList.Insert(index, AssemblyLoadResult.UnwrapObject(value)); + + public bool IsFixedSize => ExternalList.IsFixedSize; + + public bool IsReadOnly => ExternalList.IsReadOnly; + + public void Remove(object value) => ExternalList.Remove(AssemblyLoadResult.UnwrapObject(value)); + + public void RemoveAt(int index) => ExternalList.RemoveAt(index); + + public object this[int index] + { + get => AssemblyLoadResult.WrapObject(ExternalList[index]); + set => ExternalList[index] = AssemblyLoadResult.UnwrapObject(value); + } + + public void CopyTo(Array array, int index) + { + int index1 = index; + for (int index2 = 0; index2 < ExternalList.Count; ++index2) + { + array.SetValue(AssemblyLoadResult.WrapObject(ExternalList[index2]), index1); + ++index1; + } + } + + public int Count => ExternalList.Count; + + public bool IsSynchronized => ExternalList.IsSynchronized; + + public object SyncRoot => ExternalList.SyncRoot; + + public IEnumerator GetEnumerator() => new AssemblyObjectProxyHelper.ProxyListEnumerator(ExternalList.GetEnumerator()); + + public bool CanSearch => _canSearch; + + public int SearchForString(string searchString) => _canSearch ? ((ISearchableList)ExternalList).SearchForString(searchString) : -1; + + public virtual void Move(int oldIndex, int newIndex) + { + object external = ExternalList[oldIndex]; + RemoveAt(oldIndex); + Insert(newIndex, external); + } + } + + private class ProxyListEnumerator : IEnumerator, AssemblyObjectProxyHelper.IAssemblyProxyObject + { + private IEnumerator _assemblyEnumerator; + + public ProxyListEnumerator(object assemblyObject) => _assemblyEnumerator = (IEnumerator)assemblyObject; + + public bool MoveNext() => _assemblyEnumerator.MoveNext(); + + public void Reset() => _assemblyEnumerator.Reset(); + + public object Current => AssemblyLoadResult.WrapObject(_assemblyEnumerator.Current); + + public object AssemblyObject => _assemblyEnumerator; + } + + private class ProxyNotifyList : + AssemblyObjectProxyHelper.ProxyList, + INotifyList, + IList, + ICollection, + IEnumerable + { + private bool _isNotifyList; + private UIListContentsChangedHandler _listContentsChangedHandler; + private Delegate _handlersAttachedToMe; + + public ProxyNotifyList(object assemblyObject, bool isNotifyList) + : base(assemblyObject) + => _isNotifyList = isNotifyList; + + public ProxyNotifyList(object assemblyObject) + : this(assemblyObject, true) + { + } + + protected INotifyList ExternalNotifyList => (INotifyList)_assemblyObject; + + public override void Move(int oldIndex, int newIndex) => ExternalNotifyList.Move(oldIndex, newIndex); + + public event UIListContentsChangedHandler ContentsChanged + { + add + { + if (!_isNotifyList) + return; + if (_listContentsChangedHandler == null) + { + _listContentsChangedHandler = new UIListContentsChangedHandler(OnListContentsChanged); + ExternalNotifyList.ContentsChanged += _listContentsChangedHandler; + } + _handlersAttachedToMe = Delegate.Combine(_handlersAttachedToMe, value); + } + remove + { + if (!_isNotifyList) + return; + _handlersAttachedToMe = Delegate.Remove(_handlersAttachedToMe, value); + if ((object)_handlersAttachedToMe != null) + return; + ExternalNotifyList.ContentsChanged -= _listContentsChangedHandler; + _listContentsChangedHandler = null; + } + } + + private void OnListContentsChanged(IList senderList, UIListContentsChangedArgs args) => ((UIListContentsChangedHandler)_handlersAttachedToMe)(this, args); + } + + private class ProxyVirtualNotifyList : + AssemblyObjectProxyHelper.ProxyNotifyList, + IVirtualList, + INotifyList, + IList, + ICollection, + IEnumerable + { + private ItemRequestCallback _onItemGeneratedCallback; + private Dictionary _itemCallbacks; + + public ProxyVirtualNotifyList(object assemblyObject, bool isNotifyList) + : base(assemblyObject, isNotifyList) + { + } + + protected IVirtualList ExternalVirtualList => (IVirtualList)_assemblyObject; + + public void RequestItem(int index, ItemRequestCallback callback) + { + if (_itemCallbacks == null) + _itemCallbacks = new Dictionary(); + _itemCallbacks[index] = callback; + if (_onItemGeneratedCallback == null) + _onItemGeneratedCallback = new ItemRequestCallback(OnItemGenerated); + ExternalVirtualList.RequestItem(index, _onItemGeneratedCallback); + } + + public bool IsItemAvailable(int index) => ExternalVirtualList.IsItemAvailable(index); + + public void NotifyVisualsCreated(int index) => ExternalVirtualList.NotifyVisualsCreated(index); + + public void NotifyVisualsReleased(int index) => ExternalVirtualList.NotifyVisualsReleased(index); + + public bool SlowDataRequestsEnabled => ExternalVirtualList.SlowDataRequestsEnabled; + + public void NotifyRequestSlowData(int index) => ExternalVirtualList.NotifyRequestSlowData(index); + + public Repeater RepeaterHost + { + get => ExternalVirtualList.RepeaterHost; + set => ExternalVirtualList.RepeaterHost = value; + } + + public SlowDataAcquireCompleteHandler SlowDataAcquireCompleteHandler + { + get => ExternalVirtualList.SlowDataAcquireCompleteHandler; + set => ExternalVirtualList.SlowDataAcquireCompleteHandler = value; + } + + private void OnItemGenerated(object sender, int index, object item) + { + ItemRequestCallback itemCallback = (ItemRequestCallback)_itemCallbacks[index]; + _itemCallbacks.Remove(index); + itemCallback(this, index, AssemblyLoadResult.WrapObject(item)); + } + } + + private class ProxyGroup : + AssemblyObjectProxyHelper.ProxyVirtualNotifyList, + IUIGroup, + IList, + ICollection, + IEnumerable + { + public ProxyGroup(object assemblyObject, bool isNotifyList) + : base(assemblyObject, isNotifyList) + { + } + + protected Group ExternalGroup => (Group)_assemblyObject; + + public int StartIndex => ExternalGroup.StartIndex; + + public int EndIndex => ExternalGroup.EndIndex; + } + + private class ProxyDictionary : + AssemblyObjectProxyHelper.ProxyObject, + IDictionary, + ICollection, + IEnumerable + { + public ProxyDictionary(object assemblyObject) + : base(assemblyObject) + { + } + + protected IDictionary ExternalDictionary => (IDictionary)_assemblyObject; + + public bool IsReadOnly => ExternalDictionary.IsReadOnly; + + public bool Contains(object key) => ExternalDictionary.Contains(AssemblyLoadResult.WrapObject(key)); + + public bool IsFixedSize => false; + + public void Remove(object key) + { + } + + public void Clear() => ExternalDictionary.Clear(); + + public void Add(object key, object value) => ExternalDictionary.Add(AssemblyLoadResult.WrapObject(key), AssemblyLoadResult.WrapObject(value)); + + public ICollection Keys => (ICollection)null; + + public ICollection Values => (ICollection)null; + + public object this[object key] + { + get => AssemblyLoadResult.UnwrapObject(ExternalDictionary[AssemblyLoadResult.WrapObject(key)]); + set => ExternalDictionary[AssemblyLoadResult.WrapObject(key)] = AssemblyLoadResult.WrapObject(value); + } + + public void CopyTo(Array array, int index) + { + } + + public int Count => ExternalDictionary.Count; + + public bool IsSynchronized => false; + + public object SyncRoot => (object)null; + + public IEnumerator GetEnumerator() => (IEnumerator)null; + + IDictionaryEnumerator IDictionary.GetEnumerator() => (IDictionaryEnumerator)null; + } + + private class ReverseProxyList : + IList, + ICollection, + IEnumerable, + AssemblyObjectProxyHelper.IFrameworkProxyObject + { + private IList _uixList; + + public ReverseProxyList(IList uixList) => _uixList = uixList; + + public object FrameworkObject => _uixList; + + public int Add(object value) => _uixList.Add(AssemblyLoadResult.WrapObject(value)); + + public void Clear() => _uixList.Clear(); + + public bool Contains(object value) => _uixList.Contains(AssemblyLoadResult.WrapObject(value)); + + public int IndexOf(object value) => _uixList.IndexOf(AssemblyLoadResult.WrapObject(value)); + + public void Insert(int index, object value) => _uixList.Insert(index, AssemblyLoadResult.WrapObject(value)); + + public bool IsFixedSize => _uixList.IsFixedSize; + + public bool IsReadOnly => _uixList.IsReadOnly; + + public void Remove(object value) => _uixList.Remove(AssemblyLoadResult.WrapObject(value)); + + public void RemoveAt(int index) => _uixList.RemoveAt(index); + + public object this[int index] + { + get => AssemblyLoadResult.UnwrapObject(_uixList[index]); + set => _uixList[index] = AssemblyLoadResult.WrapObject(value); + } + + public void CopyTo(Array array, int index) + { + int index1 = index; + for (int index2 = 0; index2 < _uixList.Count; ++index2) + { + array.SetValue(AssemblyLoadResult.UnwrapObject(_uixList[index2]), index1); + ++index1; + } + } + + public int Count => _uixList.Count; + + public bool IsSynchronized => _uixList.IsSynchronized; + + public object SyncRoot => _uixList.SyncRoot; + + public IEnumerator GetEnumerator() => new AssemblyObjectProxyHelper.ReverseProxyListEnumerator(_uixList.GetEnumerator()); + } + + private class ReverseProxyListEnumerator : + IEnumerator, + AssemblyObjectProxyHelper.IFrameworkProxyObject + { + private IEnumerator _uixEnumerator; + + public ReverseProxyListEnumerator(IEnumerator uixEnumerator) => _uixEnumerator = uixEnumerator; + + public bool MoveNext() => _uixEnumerator.MoveNext(); + + public void Reset() => _uixEnumerator.Reset(); + + public object Current => AssemblyLoadResult.UnwrapObject(_uixEnumerator.Current); + + public object FrameworkObject => _uixEnumerator; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/AssemblyPropertySchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyPropertySchema.cs new file mode 100644 index 0000000..602dde8 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyPropertySchema.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyPropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Reflection; + +namespace Microsoft.Iris.Markup +{ + internal class AssemblyPropertySchema : PropertySchema + { + private PropertyInfo _propertyInfo; + private TypeSchema _propertyTypeSchema; + private bool _isStatic; + private FastReflectionInvokeHandler _getMethod; + private FastReflectionInvokeHandler _setMethod; + private object[] _setMethodParams; + + public AssemblyPropertySchema(AssemblyTypeSchema owner, PropertyInfo propertyInfo) + : base(owner) + { + _propertyInfo = propertyInfo; + _propertyTypeSchema = AssemblyLoadResult.MapType(_propertyInfo.PropertyType); + _isStatic = (_propertyInfo.GetGetMethod() ?? _propertyInfo.GetSetMethod()).IsStatic; + } + + public override string Name => _propertyInfo.Name; + + public override TypeSchema PropertyType => _propertyTypeSchema; + + public override TypeSchema AlternateType => (TypeSchema)null; + + public override bool CanRead => _propertyInfo.CanRead; + + public override bool CanWrite => _propertyInfo.CanWrite; + + public override bool IsStatic => _isStatic; + + public override ExpressionRestriction ExpressionRestriction => ExpressionRestriction.None; + + public override bool RequiredForCreation => false; + + public override RangeValidator RangeValidator => (RangeValidator)null; + + public override bool NotifiesOnChange + { + get + { + AssemblyTypeSchema owner = (AssemblyTypeSchema)Owner; + return !_isStatic && owner.NotifiesOnChange; + } + } + + public override object GetValue(object instance) + { + object target = AssemblyLoadResult.UnwrapObject(instance); + if (_getMethod == null) + _getMethod = ReflectionHelper.CreateMethodInvoke(_propertyInfo.GetGetMethod()); + return AssemblyLoadResult.WrapObject(_propertyTypeSchema, _getMethod(target, null)); + } + + public override void SetValue(ref object instance, object value) + { + object target = AssemblyLoadResult.UnwrapObject(instance); + object obj1 = AssemblyLoadResult.UnwrapObject(value); + if (_setMethod == null) + { + _setMethod = ReflectionHelper.CreateMethodInvoke(_propertyInfo.GetSetMethod()); + _setMethodParams = new object[1]; + } + _setMethodParams[0] = obj1; + object obj2 = _setMethod(target, _setMethodParams); + _setMethodParams[0] = null; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/AssemblyTypeSchema.cs b/UIX/Microsoft/Iris/Markup/AssemblyTypeSchema.cs new file mode 100644 index 0000000..86bfe09 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/AssemblyTypeSchema.cs @@ -0,0 +1,340 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.AssemblyTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using System; +using System.ComponentModel; +using System.Reflection; + +namespace Microsoft.Iris.Markup +{ + internal class AssemblyTypeSchema : TypeSchema + { + private Type _type; + private TypeSchema _baseType; + private bool _isDisposable; + private bool _notifiesOnChange; + private bool _isFrameworkEnum; + private Map _constructorCache = new Map(); + private Map _propertyCache = new Map(); + private Map _methodCache = new Map(); + private Map _eventCache = new Map(); + private Map s_constructorInfosCache = new Map(); + private Map s_methodInfosCache = new Map(); + + protected AssemblyTypeSchema(Type type, TypeSchema baseType) + : base(AssemblyLoadResult.MapAssembly(type.Assembly, type.Namespace)) + { + _type = type; + _baseType = baseType; + _isFrameworkEnum = type.IsEnum && Enum.GetUnderlyingType(type) == typeof(int); + _notifiesOnChange = typeof(INotifyPropertyChanged).IsAssignableFrom(_type); + _isDisposable = typeof(IDisposable).IsAssignableFrom(_type); + } + + protected override void OnDispose() + { + base.OnDispose(); + foreach (KeyValueEntry keyValueEntry in _constructorCache) + keyValueEntry.Value.Dispose(this); + foreach (KeyValueEntry keyValueEntry in _propertyCache) + keyValueEntry.Value.Dispose(this); + foreach (KeyValueEntry keyValueEntry in _methodCache) + keyValueEntry.Value.Dispose(this); + foreach (KeyValueEntry keyValueEntry in _eventCache) + keyValueEntry.Value.Dispose(this); + } + + public override string Name + { + get + { + string str = _type.Name; + if (_type.IsGenericType) + str = _type.ToString().Substring(((AssemblyLoadResult)Owner).Namespace.Length + 1); + return str; + } + } + + public override string AlternateName => (string)null; + + public override TypeSchema Base + { + get + { + if (_baseType == null && this != AssemblyLoadResult.ObjectTypeSchema) + { + if (_type.BaseType != null) + _baseType = AssemblyLoadResult.MapType(_type.BaseType); + else if (_type.IsInterface) + _baseType = AssemblyLoadResult.ObjectTypeSchema; + } + return _baseType; + } + } + + public override bool Contractual => _type.IsInterface; + + public override Type RuntimeType => _type; + + public Type InternalType => _type; + + public override bool IsNativeAssignableFrom(object check) => InternalType.IsAssignableFrom(AssemblyLoadResult.UnwrapObject(check).GetType()); + + public override bool IsNativeAssignableFrom(TypeSchema checkSchema) + { + Type c = checkSchema.RuntimeType; + if (checkSchema is AssemblyTypeSchema assemblyTypeSchema) + c = assemblyTypeSchema.InternalType; + return InternalType.IsAssignableFrom(c); + } + + public override bool Disposable => _isDisposable; + + public override object ConstructDefault() => AssemblyLoadResult.WrapObject(this, Activator.CreateInstance(_type)); + + public override bool HasDefaultConstructor => _type.IsValueType || _type.GetConstructor(Type.EmptyTypes) != null; + + public override bool HasInitializer => false; + + public override void InitializeInstance(ref object instance) + { + } + + public override ConstructorSchema FindConstructor(TypeSchema[] parameters) + { + ConstructorSchema constructorSchema; + if (!_constructorCache.TryGetValue(new MethodSignatureKey(parameters), out constructorSchema)) + { + ConstructorInfo[] constructors; + if (!s_constructorInfosCache.TryGetValue(_type, out constructors)) + { + constructors = _type.GetConstructors(BindingFlags.Instance | BindingFlags.Public); + s_constructorInfosCache[_type] = constructors; + } + if (constructors != null) + { + foreach (ConstructorInfo constructorInfo in constructors) + { + TypeSchema[] schemaParameters = null; + if (CheckForMethodSignatureMatch(constructorInfo, null, parameters, out schemaParameters)) + { + constructorSchema = new AssemblyConstructorSchema(this, constructorInfo, schemaParameters); + _constructorCache[new MethodSignatureKey(schemaParameters)] = constructorSchema; + break; + } + } + } + } + return constructorSchema; + } + + public override PropertySchema FindProperty(string name) + { + PropertySchema propertySchema; + if (!_propertyCache.TryGetValue(name, out propertySchema)) + { + PropertyInfo propertyHelper = GetPropertyHelper(_type, name); + if (propertyHelper != null) + { + propertySchema = new AssemblyPropertySchema(this, propertyHelper); + _propertyCache[name] = propertySchema; + } + } + return propertySchema; + } + + private static PropertyInfo GetPropertyHelper(Type type, string name) + { + PropertyInfo propertyInfo = null; + try + { + propertyInfo = type.GetProperty(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public); + } + catch (AmbiguousMatchException ex) + { + PropertyInfo[] properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public); + for (int index = 0; index < properties.Length; ++index) + { + if (properties[index].Name == name) + { + propertyInfo = properties[index]; + break; + } + } + } + if (propertyInfo == null && type.IsInterface) + { + foreach (Type type1 in type.GetInterfaces()) + { + propertyInfo = GetPropertyHelper(type1, name); + if (propertyInfo != null) + break; + } + } + return propertyInfo; + } + + public override MethodSchema FindMethod(string name, TypeSchema[] parameters) + { + MethodSchema methodSchema; + if (!_methodCache.TryGetValue(new MethodSignatureKey(name, parameters), out methodSchema)) + { + MethodInfo[] methodInfoArray = null; + if (!s_methodInfosCache.TryGetValue(_type, out methodInfoArray)) + { + methodInfoArray = _type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public); + s_methodInfosCache[_type] = methodInfoArray; + } + if (methodInfoArray != null) + { + foreach (MethodInfo methodInfo in methodInfoArray) + { + TypeSchema[] schemaParameters; + if (CheckForMethodSignatureMatch(methodInfo, name, parameters, out schemaParameters)) + { + methodSchema = new AssemblyMethodSchema(this, methodInfo, schemaParameters); + _methodCache[new MethodSignatureKey(name, schemaParameters)] = methodSchema; + break; + } + } + } + } + return methodSchema; + } + + private bool CheckForMethodSignatureMatch( + MethodBase candidateMember, + string name, + TypeSchema[] parameters, + out TypeSchema[] schemaParameters) + { + schemaParameters = null; + if (name != null && candidateMember.Name != name) + return false; + ParameterInfo[] parameters1 = candidateMember.GetParameters(); + if (parameters1.Length != parameters.Length) + return false; + TypeSchema[] typeSchemaArray = new TypeSchema[parameters1.Length]; + for (int index = 0; index < parameters.Length; ++index) + { + typeSchemaArray[index] = AssemblyLoadResult.MapType(parameters1[index].ParameterType); + if (!typeSchemaArray[index].IsAssignableFrom(parameters[index])) + return false; + } + schemaParameters = typeSchemaArray; + return true; + } + + public override EventSchema FindEvent(string name) + { + EventSchema eventSchema; + if (!_eventCache.TryGetValue(name, out eventSchema)) + { + EventInfo eventInfo = _type.GetEvent(name); + if (eventInfo != null) + { + eventSchema = new AssemblyEventSchema(this, eventInfo); + _eventCache[name] = eventSchema; + } + } + return eventSchema; + } + + public override object FindCanonicalInstance(string name) + { + if (_type.IsEnum) + { + try + { + return Enum.Parse(_type, name); + } + catch (ArgumentException ex) + { + } + } + return null; + } + + public override PropertySchema[] Properties => PropertySchema.EmptyList; + + public override Result TypeConverter( + object from, + TypeSchema fromType, + out object instance) + { + if (_isFrameworkEnum && Int32Schema.Type.IsAssignableFrom(fromType)) + { + instance = Enum.ToObject(_type, (int)from); + return Result.Success; + } + instance = null; + return Result.Fail("Unimplemented"); + } + + public override bool SupportsTypeConversion(TypeSchema fromType) => _isFrameworkEnum && Int32Schema.Type.IsAssignableFrom(fromType); + + public override void EncodeBinary(ByteCodeWriter writer, object instance) + { + if (_type.IsEnum) + { + writer.WriteInt32((int)instance); + } + else + { + if (_type != typeof(Guid)) + return; + writer.Write(((Guid)instance).ToByteArray(), 16U); + } + } + + public override object DecodeBinary(ByteCodeReader reader) + { + object obj; + if (_type.IsEnum) + obj = Enum.ToObject(_type, reader.ReadInt32()); + else if (_type == typeof(Guid)) + { + byte[] b = new byte[16]; + for (int index = 0; index < 16; ++index) + b[index] = reader.ReadByte(); + obj = new Guid(b); + } + else + obj = null; + return obj; + } + + public override bool SupportsBinaryEncoding + { + get + { + if (_type == typeof(Guid)) + return true; + return _type.IsEnum && Enum.GetUnderlyingType(_type) == typeof(int); + } + } + + public override object PerformOperation(object left, object right, OperationType op) + { + bool flag = left != null ? left.Equals(right) : right == null || right.Equals(left); + return BooleanBoxes.Box(op == OperationType.RelationalEquals ? flag : !flag); + } + + public override bool SupportsOperation(OperationType op) => op == OperationType.RelationalEquals || op == OperationType.RelationalNotEquals; + + public override bool IsNullAssignable => !_type.IsValueType; + + public override int FindTypeHint => -1; + + public bool NotifiesOnChange => _notifiesOnChange; + + public override bool IsRuntimeImmutable => _type.IsEnum; + + public override bool IsEnum => _isFrameworkEnum; + } +} diff --git a/UIX/Microsoft/Iris/Markup/BooleanBoxes.cs b/UIX/Microsoft/Iris/Markup/BooleanBoxes.cs new file mode 100644 index 0000000..deed171 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/BooleanBoxes.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.BooleanBoxes +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class BooleanBoxes + { + internal static object TrueBox = true; + internal static object FalseBox = false; + + internal static object Box(bool value) => value ? TrueBox : FalseBox; + } +} diff --git a/UIX/Microsoft/Iris/Markup/ByteCodeReader.cs b/UIX/Microsoft/Iris/Markup/ByteCodeReader.cs new file mode 100644 index 0000000..5566e48 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ByteCodeReader.cs @@ -0,0 +1,314 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ByteCodeReader +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.OS; +using System; +using System.IO; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Markup +{ + internal class ManagedByteCodeReader : DisposableObject + { + private static char[] s_scratchCharArray = new char[100]; + private BinaryReader _reader; + private IntPtr _buffer; + private byte[] _bytes; + private bool _inFixedMemory; + + public unsafe ManagedByteCodeReader(IntPtr buffer, long size, bool ownsAllocation) + { + byte[] bytes = new byte[size]; + Marshal.Copy(buffer, bytes, 0, (int)size); + _bytes = bytes; + + _reader = new BinaryReader(new MemoryStream(_bytes)); + _buffer = buffer; + } + + public byte[] Bytes => _bytes; + + public uint Size => (uint)_reader.BaseStream.Length; + + public uint CurrentOffset + { + get => (uint)_reader.BaseStream.Position; + set => _reader.BaseStream.Seek(value <= Size ? value : throw new Exception("Invalid offset"), SeekOrigin.Begin); + } + + public unsafe IntPtr CurrentAddress => new IntPtr(_buffer.ToInt64() + _reader.BaseStream.Position); + + public bool IsInFixedMemory => _inFixedMemory; + + public void MarkAsInFixedMemory() => _inFixedMemory = true; + + public bool ReadBool() => _reader.ReadBoolean(); + + public unsafe byte ReadByte() => _reader.ReadByte(); + + public char ReadChar() => _reader.ReadChar(); + + public unsafe ushort ReadUInt16() => _reader.ReadUInt16(); + + public int ReadInt32() => _reader.ReadInt32(); + + public unsafe uint ReadUInt32() => _reader.ReadUInt32(); + + public static unsafe ushort ReadUInt16(IntPtr pData) + { + var reader = new ByteCodeReader(pData, sizeof(ushort), false); + return reader.ReadUInt16(); + } + + public static unsafe uint ReadUInt32(IntPtr pData) + { + var reader = new ByteCodeReader(pData, sizeof(uint), false); + return reader.ReadUInt32(); + } + + public long ReadInt64() => _reader.ReadInt64(); + + public unsafe ulong ReadUInt64() => _reader.ReadUInt64(); + + public unsafe float ReadSingle() => _reader.ReadSingle(); + + public unsafe double ReadDouble() => _reader.ReadDouble(); + + public unsafe string ReadString() + { + uint num1 = ReadUInt16(); + if (num1 == ushort.MaxValue) + return null; + bool flag; + uint num2; + if (((int)num1 & 32768) != 0) + { + flag = true; + num1 &= (uint)short.MaxValue; + num2 = num1; + } + else + { + flag = false; + num2 = num1 * 2U; + } + if (CurrentOffset + num2 > Size) + ThrowReadError(); + char[] chArray = num1 >= s_scratchCharArray.Length ? new char[num1] : s_scratchCharArray; + byte* numPtr1 = (byte*)(_buffer.ToInt64() + CurrentOffset); + if (flag) + { + for (int index = 0; index < num1; ++index) + chArray[index] = (char)*numPtr1++; + } + else + { + for (int index = 0; index < num1; ++index) + { + byte* numPtr2 = numPtr1; + byte* numPtr3 = numPtr2 + 1; + byte num3 = *numPtr2; + byte* numPtr4 = numPtr3; + numPtr1 = numPtr4 + 1; + byte num4 = *numPtr4; + chArray[index] = (char)(num3 | (uint)num4 << 8); + } + } + _reader.BaseStream.Seek(num2, SeekOrigin.Current); + return new string(chArray, 0, (int)num1); + } + + public unsafe IntPtr ToIntPtr(out long size) + { + size = Size; + return _buffer; + } + + public unsafe IntPtr GetAddress(uint offset) => new IntPtr(_buffer.ToInt64() + offset); + + private void ThrowReadError() => throw new Exception("Attempted to read past the end of the buffer."); + + protected override unsafe void OnDispose() + { + base.OnDispose(); + _reader.Close(); + _buffer = IntPtr.Zero; + } + } + + internal class ByteCodeReader : DisposableObject + { + private static char[] s_scratchCharArray = new char[100]; + private unsafe byte* _buffer; + private uint _offset; + private uint _size; + private bool _ownsAllocation; + private bool _inFixedMemory; + + public unsafe ByteCodeReader(IntPtr buffer, uint size, bool ownsAllocation) + { + _buffer = (byte*)buffer.ToPointer(); + _size = size; + _offset = 0U; + _ownsAllocation = ownsAllocation; + int num = _ownsAllocation ? 1 : 0; + } + + public uint Size => _size; + + public uint CurrentOffset + { + get => _offset; + set => _offset = value <= _size ? value : throw new Exception("Invalid offset"); + } + + public unsafe IntPtr CurrentAddress => new IntPtr(_buffer + (int)_offset); + + public void MarkAsInFixedMemory() => _inFixedMemory = true; + + public bool IsInFixedMemory => _inFixedMemory; + + public bool ReadBool() => ReadByte() != 0; + + public unsafe byte ReadByte() + { + if (_offset >= _size) + ThrowReadError(); + byte num = _buffer[(int)_offset]; + ++_offset; + return num; + } + + public char ReadChar() => (char)ReadUInt16(); + + public unsafe ushort ReadUInt16() + { + if (_offset + 2U > _size) + ThrowReadError(); + byte* numPtr = _buffer + (int)_offset; + byte num1 = *numPtr; + byte num2 = numPtr[1]; + _offset += 2U; + return (ushort)(num1 | (uint)num2 << 8); + } + + public int ReadInt32() => (int)ReadUInt32(); + + public unsafe uint ReadUInt32() + { + if (_offset + 4U > _size) + ThrowReadError(); + byte* numPtr = _buffer + (int)_offset; + byte num1 = *numPtr; + byte num2 = numPtr[1]; + byte num3 = numPtr[2]; + byte num4 = numPtr[3]; + _offset += 4U; + return (uint)(num1 | num2 << 8 | num3 << 16 | num4 << 24); + } + + public static unsafe ushort ReadUInt16(IntPtr pData) + { + byte* pointer = (byte*)pData.ToPointer(); + return (ushort)(*pointer | (uint)pointer[1] << 8); + } + + public static unsafe uint ReadUInt32(IntPtr pData) + { + byte* pointer = (byte*)pData.ToPointer(); + return (uint)(*pointer | pointer[1] << 8 | pointer[2] << 16 | pointer[3] << 24); + } + + public long ReadInt64() => (long)ReadUInt64(); + + public unsafe ulong ReadUInt64() + { + if (_offset + 8U > _size) + ThrowReadError(); + byte* numPtr = _buffer + (int)_offset; + byte num1 = *numPtr; + byte num2 = numPtr[1]; + byte num3 = numPtr[2]; + byte num4 = numPtr[3]; + byte num5 = numPtr[4]; + byte num6 = numPtr[5]; + byte num7 = numPtr[6]; + byte num8 = numPtr[7]; + _offset += 8U; + uint num9 = (uint)(num1 | num2 << 8 | num3 << 16 | num4 << 24); + return (ulong)(uint)(num5 | num6 << 8 | num7 << 16 | num8 << 24) << 32 | num9; + } + + //public unsafe float ReadSingle() => *(float*)&ReadUInt32(); + public unsafe float ReadSingle() => BitConverter.ToSingle(BitConverter.GetBytes(ReadUInt32()), 0); + + //public unsafe double ReadDouble() => *(double*)&ReadInt64(); + public unsafe double ReadDouble() => BitConverter.ToSingle(BitConverter.GetBytes(ReadUInt64()), 0); + + public unsafe string ReadString() + { + uint num1 = ReadUInt16(); + if (num1 == ushort.MaxValue) + return null; + bool flag; + uint num2; + if (((int)num1 & 32768) != 0) + { + flag = true; + num1 &= (uint)short.MaxValue; + num2 = num1; + } + else + { + flag = false; + num2 = num1 * 2U; + } + if (_offset + num2 > _size) + ThrowReadError(); + char[] chArray = num1 >= s_scratchCharArray.Length ? new char[num1] : ByteCodeReader.s_scratchCharArray; + byte* numPtr1 = _buffer + (int)_offset; + if (flag) + { + for (int index = 0; index < num1; ++index) + chArray[index] = (char)*numPtr1++; + } + else + { + for (int index = 0; index < num1; ++index) + { + byte* numPtr2 = numPtr1; + byte* numPtr3 = numPtr2 + 1; + byte num3 = *numPtr2; + byte* numPtr4 = numPtr3; + numPtr1 = numPtr4 + 1; + byte num4 = *numPtr4; + chArray[index] = (char)(num3 | (uint)num4 << 8); + } + } + _offset += num2; + return new string(chArray, 0, (int)num1); + } + + public unsafe IntPtr ToIntPtr(out uint size) + { + size = _size; + return new IntPtr(_buffer); + } + + public unsafe IntPtr GetAddress(uint offset) => new IntPtr(_buffer + (int)offset); + + private void ThrowReadError() => throw new Exception("Attempted to read past the end of the buffer."); + + protected override unsafe void OnDispose() + { + base.OnDispose(); + if (_ownsAllocation) + NativeApi.MemFree(new IntPtr(_buffer)); + _buffer = null; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs b/UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs new file mode 100644 index 0000000..372a4f6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ByteCodeWriter.cs @@ -0,0 +1,228 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ByteCodeWriter +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.OS; +using System; +using System.Collections; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Markup +{ + internal class ByteCodeWriter + { + private const int BLOCK_SIZE = 4096; + private byte[] _scratch = new byte[8]; + private uint _cbFreeInBlock; + private uint _totalSize; + private byte[] _currentBlock; + private ArrayList _blockList = new ArrayList(); + + public uint DataSize => _totalSize; + + public void WriteByte(byte value) + { + _scratch[0] = value; + Write(_scratch, 1U); + } + + public void WriteByte(OpCode value) + { + _scratch[0] = (byte)value; + Write(_scratch, 1U); + } + + public void WriteBool(bool value) + { + _scratch[0] = 0; + if (value) _scratch[0] = 1; + Write(_scratch, 1U); + } + + public void WriteChar(char value) + { + _scratch[0] = (byte)value; + _scratch[1] = (byte)((uint)value >> 8); + Write(_scratch, 2U); + } + + public void WriteUInt16(ushort value) + { + _scratch[0] = (byte)value; + _scratch[1] = (byte)((uint)value >> 8); + Write(_scratch, 2U); + } + + public void WriteUInt16(int rawValue) + { + ushort num = (ushort)rawValue; + _scratch[0] = (byte)num; + _scratch[1] = (byte)((uint)num >> 8); + Write(_scratch, 2U); + } + + public void WriteUInt16(uint rawValue) + { + ushort num = (ushort)rawValue; + _scratch[0] = (byte)num; + _scratch[1] = (byte)((uint)num >> 8); + Write(_scratch, 2U); + } + + public void WriteInt32(int value) + { + _scratch[0] = (byte)value; + _scratch[1] = (byte)(value >> 8); + _scratch[2] = (byte)(value >> 16); + _scratch[3] = (byte)(value >> 24); + Write(_scratch, 4U); + } + + public void WriteUInt32(uint value) + { + _scratch[0] = (byte)value; + _scratch[1] = (byte)(value >> 8); + _scratch[2] = (byte)(value >> 16); + _scratch[3] = (byte)(value >> 24); + Write(_scratch, 4U); + } + + public void WriteInt64(long value) => WriteUInt64((ulong)value); + + public void WriteUInt64(ulong value) + { + _scratch[0] = (byte)value; + _scratch[1] = (byte)(value >> 8); + _scratch[2] = (byte)(value >> 16); + _scratch[3] = (byte)(value >> 24); + _scratch[4] = (byte)(value >> 32); + _scratch[5] = (byte)(value >> 40); + _scratch[6] = (byte)(value >> 48); + _scratch[7] = (byte)(value >> 56); + Write(_scratch, 8U); + } + + public unsafe void WriteSingle(float value) + { + uint num = *(uint*)&value; + _scratch[0] = (byte)num; + _scratch[1] = (byte)(num >> 8); + _scratch[2] = (byte)(num >> 16); + _scratch[3] = (byte)(num >> 24); + Write(_scratch, 4U); + } + + public unsafe void WriteDouble(double value) => WriteInt64(*(long*)&value); + + public void WriteString(string value) + { + if (value == null) + { + WriteUInt16(ushort.MaxValue); + } + else + { + if (value.Length >= short.MaxValue) + throw new ArgumentException("String too long"); + bool flag = false; + foreach (char ch in value) + { + if (ch > 'ÿ') + { + flag = true; + break; + } + } + uint length = (uint)value.Length; + if (!flag) + length |= 32768U; + WriteUInt16((ushort)length); + foreach (char ch in value) + { + if (flag) + WriteChar(ch); + else + WriteByte((byte)ch); + } + } + } + + public void Write(ByteCodeReader value) => Write(value, 0U); + + public unsafe void Write(ByteCodeReader value, uint offset) + { + IntPtr intPtr = value.ToIntPtr(out uint size); + if (offset > size) + throw new ArgumentOutOfRangeException(nameof(offset)); + Write(new IntPtr(intPtr.ToInt64() + offset), (uint)(size - offset)); + } + + public unsafe void Write(byte[] buffer, uint count) + { + fixed (byte* pbData = buffer) + Write(pbData, count); + } + + public unsafe void Write(IntPtr buffer, uint count) => Write((byte*)buffer.ToPointer(), count); + + private unsafe void Write(byte* pbData, uint cbData) + { + while (cbData > 0U) + { + if (_cbFreeInBlock == 0U) + { + _currentBlock = new byte[4096]; + _blockList.Add(_currentBlock); + _cbFreeInBlock = 4096U; + } + uint num1 = cbData <= _cbFreeInBlock ? cbData : _cbFreeInBlock; + uint num2 = 4096U - _cbFreeInBlock; + Marshal.Copy(new IntPtr(pbData), _currentBlock, (int)num2, (int)num1); + pbData += (int)num1; + cbData -= num1; + _cbFreeInBlock -= num1; + _totalSize += num1; + } + } + + public void Overwrite(uint offset, uint value) + { + if (offset + 4U > _totalSize) + throw new ArgumentException("Invalid offset"); + OverwriteByte(offset, (byte)value); + OverwriteByte(offset + 1U, (byte)(value >> 8)); + OverwriteByte(offset + 2U, (byte)(value >> 16)); + OverwriteByte(offset + 3U, (byte)(value >> 24)); + } + + private void OverwriteByte(uint offset, byte value) => ((byte[])_blockList[(int)(offset / 4096U)])[(offset % 4096U)] = value; + + private unsafe byte* ComposeFinalBuffer(out uint totalSize) + { + byte* pointer = (byte*)NativeApi.MemAlloc(_totalSize, false).ToPointer(); + byte* numPtr = pointer; + for (int index = 0; index < _blockList.Count - 1; ++index) + { + Marshal.Copy((byte[])_blockList[index], 0, new IntPtr(numPtr), 4096); + numPtr += 4096; + } + uint num = 4096U - _cbFreeInBlock; + if (_currentBlock != null && num != 0U) + Marshal.Copy(_currentBlock, 0, new IntPtr(numPtr), (int)num); + totalSize = _totalSize; + _blockList.Clear(); + _currentBlock = null; + _cbFreeInBlock = 0U; + _totalSize = 0U; + return pointer; + } + + public unsafe ByteCodeReader CreateReader() + { + uint totalSize; + return new ByteCodeReader(new IntPtr(ComposeFinalBuffer(out totalSize)), totalSize, true); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/ClassMethodSchema.cs b/UIX/Microsoft/Iris/Markup/ClassMethodSchema.cs new file mode 100644 index 0000000..6c12625 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ClassMethodSchema.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ClassMethodSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class ClassMethodSchema : MarkupMethodSchema + { + public ClassMethodSchema( + ClassTypeSchema owner, + string name, + TypeSchema returnType, + TypeSchema[] parameterTypes, + string[] parameterNames) + : base(owner, name, returnType, parameterTypes, parameterNames) + { + } + + protected override IMarkupTypeBase GetMarkupTypeBase(object instance) => instance == null ? ((ClassTypeSchema)Owner).SharedInstance : (IMarkupTypeBase)instance; + + public override bool IsStatic => ((ClassTypeSchema)Owner).IsShared; + } +} diff --git a/UIX/Microsoft/Iris/Markup/ClassPropertySchema.cs b/UIX/Microsoft/Iris/Markup/ClassPropertySchema.cs new file mode 100644 index 0000000..63e1ec0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ClassPropertySchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ClassPropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup +{ + internal class ClassPropertySchema : MarkupPropertySchema + { + public ClassPropertySchema(MarkupTypeSchema owner, string name, TypeSchema propertyType) + : base(owner, name, propertyType) + { + } + + public override bool IsStatic => ((ClassTypeSchema)Owner).IsShared; + + public override object GetValue(object instance) + { + ClassTypeSchema owner = (ClassTypeSchema)Owner; + return (instance == null ? owner.SharedInstance : (Class)instance).GetProperty(Name); + } + + public override void SetValue(ref object instance, object value) + { + ClassTypeSchema owner = (ClassTypeSchema)Owner; + (instance == null ? owner.SharedInstance : (Class)instance).SetProperty(Name, value); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs b/UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs new file mode 100644 index 0000000..463f19b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ClassTypeSchema.cs @@ -0,0 +1,68 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ClassTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class ClassTypeSchema : MarkupTypeSchema + { + private bool _isShared; + private Class _sharedInstance; + + public ClassTypeSchema(MarkupLoadResult owner, string name) + : base(owner, name) + { + } + + protected override void OnDispose() + { + base.OnDispose(); + if (_sharedInstance == null) + return; + _sharedInstance.Dispose(this); + _sharedInstance = null; + } + + public override MarkupType MarkupType => MarkupType.Class; + + protected override TypeSchema DefaultBase => ObjectSchema.Type; + + public override Type RuntimeType => typeof(Class); + + public override object ConstructDefault() => _isShared ? SharedInstance : ConstructNewInstance(); + + public override void InitializeInstance(ref object instance) => InitializeInstance((IMarkupTypeBase)instance); + + public override bool HasInitializer => !_isShared; + + public override bool Disposable => !_isShared && base.Disposable; + + public bool IsShared => _isShared; + + public void MarkShareable() => _isShared = true; + + public Class SharedInstance + { + get + { + if (!_isShared) + return null; + if (_sharedInstance == null) + { + _sharedInstance = ConstructNewInstance(); + _sharedInstance.DeclareOwner(this); + InitializeInstance(_sharedInstance); + } + return _sharedInstance; + } + } + + protected virtual Class ConstructNewInstance() => new Class(this); + } +} diff --git a/UIX/Microsoft/Iris/Markup/CodeListeners.cs b/UIX/Microsoft/Iris/Markup/CodeListeners.cs new file mode 100644 index 0000000..8dc38c6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/CodeListeners.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.CodeListeners +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class CodeListeners : Listeners + { + public CodeListeners(Vector listeners) + : base(listeners) + { + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/CompilationMessage.cs b/UIX/Microsoft/Iris/Markup/CompilationMessage.cs new file mode 100644 index 0000000..53405c0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/CompilationMessage.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.CompilationMessage +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class CompilationMessage + { + public const string CanOnlyCompileMarkupResources = "'{0}' is not markup, it cannot be compiled"; + public const string RemoteResourceTargetsUnsupported = "'{0}' cannot be compiled since it is not local (it is remote and requires download)"; + public const string UnableToOpenFileForWrite = "'{0}' cannot be opened for writing"; + public const string ImportDependencyFailure = "Import of '{0}' failed"; + public const string ImportMemberFailure = "Import of {0} named '{1}' from '{2}' failed"; + public const string ImportVirtualMethodFailure = "Import of virtual method with index {0} from '{1}' failed"; + public const string UnableToOpenOutputFile = "Unable to open output file '{0}'. Error code {1}"; + public const string UnableToSaveToOutputFile = "An error occurred while saving data to output file '{0}'. Error code {1}"; + public const string MultipleImportNames = "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"; + public const string InvalidInputFileName = "'{0}' is not a valid filename"; + } +} diff --git a/UIX/Microsoft/Iris/Markup/CompiledMarkupLoadResult.cs b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoadResult.cs new file mode 100644 index 0000000..ec03f39 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoadResult.cs @@ -0,0 +1,71 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.CompiledMarkupLoadResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class CompiledMarkupLoadResult : MarkupLoadResult + { + private Resource _resource; + private CompiledMarkupLoader _loader; + private IntPtr _addressOfLineNumberData; + + public CompiledMarkupLoadResult(Resource resource, string uri) + : base(uri) + { + _resource = resource; + if (uri != resource.Uri) + _uriUnderlying = resource.Uri; + _loader = CompiledMarkupLoader.Load(this, resource); + } + + public override bool IsSource => false; + + public override MarkupConstantsTable ConstantsTable => _binaryDataTable.ConstantsTable; + + public override MarkupImportTables ImportTables => _binaryDataTable.ImportTables; + + public void SetAddressOfLineNumberData(IntPtr address) => _addressOfLineNumberData = address; + + public override MarkupLineNumberTable LineNumberTable + { + get + { + if (_lineNumberTable == null) + _lineNumberTable = CompiledMarkupLoader.DecodeLineNumberTable(_addressOfLineNumberData); + return _lineNumberTable; + } + } + + public override void Load(LoadPass currentPass) + { + if (_loader == null) + return; + ErrorManager.EnterContext(ErrorContextUri); + _loader.Depersist(currentPass); + ErrorManager.ExitContext(); + if (currentPass != LoadPass.Done) + return; + LoadComplete(); + } + + private void LoadComplete() + { + if (_resource != null) + { + _resource.Free(); + _resource = null; + } + _loader = null; + if (Status != LoadResultStatus.Loading) + return; + SetStatus(LoadResultStatus.Success); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs new file mode 100644 index 0000000..9dee442 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/CompiledMarkupLoader.cs @@ -0,0 +1,807 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.CompiledMarkupLoader +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class CompiledMarkupLoader + { + private const uint c_LineNumberRecordSize = 12; + private CompiledMarkupLoadResult _loadResultTarget; + private ByteCodeReader _reader; + private bool _hasErrors; + private LoadPass _currentDepersistPass; + private MarkupLoadResult _binaryDataTableLoadResult; + private MarkupBinaryDataTable _binaryDataTable; + private bool _usingSharedDataTable; + private uint _objectSectionStart; + private uint _objectSectionEnd; + private uint _lineNumberTableStart; + private uint _lineNumberTableEnd; + private TypeSchema[][] _typeSchemaArrays; + + public static CompiledMarkupLoader Load(CompiledMarkupLoadResult loadResult, Resource resource) + { + return new CompiledMarkupLoader(loadResult, resource); + } + + private CompiledMarkupLoader(CompiledMarkupLoadResult loadResultTarget, Resource resource) + { + _loadResultTarget = loadResultTarget; + _reader = new ByteCodeReader(resource.Buffer, resource.Length, false); + if (resource is DllResource) + _reader.MarkAsInFixedMemory(); + uint num1 = _reader.ReadUInt32(); + uint num2 = _reader.ReadUInt32(); + if (num1 != 440551765U) + ReportError("Invalid compiled UIX file"); + if (num2 == 1012U) + return; + ReportError("Compiled UIX file '{0}' was compiled for the runtime with version {1}, but the current runtime is version {2}", resource.Uri, num2.ToString(), 1012U.ToString()); + } + + public void Depersist(LoadPass currentPass) + { + if (_currentDepersistPass >= currentPass) + return; + _currentDepersistPass = currentPass; + if (_binaryDataTableLoadResult != null) + _binaryDataTableLoadResult.Load(_currentDepersistPass); + if (_currentDepersistPass == LoadPass.DeclareTypes) + DoLoadPassDeclareTypes(); + else if (_currentDepersistPass == LoadPass.PopulatePublicModel) + DoLoadPassPopulatePublicModel(); + else if (_currentDepersistPass == LoadPass.Full) + { + DoLoadPassFull(); + } + else + { + foreach (MarkupTypeSchema markupTypeSchema in _loadResultTarget.ExportTable) + markupTypeSchema.Seal(); + _reader = null; + } + foreach (LoadResult dependency in _loadResultTarget.Dependencies) + { + if (dependency != _loadResultTarget) + { + dependency.Load(_currentDepersistPass); + if (dependency.Status == LoadResultStatus.Error) + MarkHasErrors(); + } + } + } + + private void DoLoadPassDeclareTypes() + { + if (HasErrors) + return; + DepersistTableOfContents(); + if (HasErrors) + return; + DepersistDependencies(); + if (HasErrors) + return; + DepersistTypeExportDeclarations(); + if (!HasErrors) + ; + } + + private void DoLoadPassPopulatePublicModel() + { + if (HasErrors) + return; + DepersistTypeImportTable(); + if (HasErrors) + return; + DepersistTypeExportDefinitions(); + if (!HasErrors) + ; + } + + private void DoLoadPassFull() + { + if (HasErrors) + return; + DepersistMemberImportTables(); + if (HasErrors) + return; + DepersistDataMappingsTable(); + if (HasErrors) + return; + DepersistConstantsTable(); + if (HasErrors) + return; + DepersistLineNumberTable(); + if (HasErrors) + return; + DepersistObjectSection(); + if (!HasErrors) + ; + } + + private void DepersistTableOfContents() + { + _objectSectionStart = _reader.ReadUInt32(); + _objectSectionEnd = _reader.ReadUInt32(); + _lineNumberTableStart = _reader.ReadUInt32(); + _lineNumberTableEnd = _reader.ReadUInt32(); + string uri = _reader.ReadString(); + if (uri != null) + { + _binaryDataTableLoadResult = MarkupSystem.ResolveLoadResult(uri, _loadResultTarget.IslandReferences) as MarkupLoadResult; + if (_binaryDataTableLoadResult != null) + { + _binaryDataTableLoadResult.Load(_currentDepersistPass); + _binaryDataTable = _binaryDataTableLoadResult.BinaryDataTable; + _loadResultTarget.SetBinaryDataTable(_binaryDataTable); + if (_binaryDataTable.SharedDependenciesTableWithBinaryDataTable == null) + _binaryDataTable.SharedDependenciesTableWithBinaryDataTable = new LoadResult[1] + { + _binaryDataTableLoadResult + }; + _loadResultTarget.SetDependenciesTable(_binaryDataTable.SharedDependenciesTableWithBinaryDataTable); + _usingSharedDataTable = true; + } + else + MarkHasErrors(); + } + else + DepersistBinaryDataTable(_reader.ReadUInt32()); + } + + private void DepersistDependencies() + { + if (_usingSharedDataTable) + return; + ushort num = _reader.ReadUInt16(); + LoadResult[] dependenciesTable = new LoadResult[num]; + for (ushort index = 0; index < num; ++index) + { + _reader.ReadBool(); + string uri = ReadDataTableString(); + LoadResult loadResult = MarkupSystem.ResolveLoadResult(uri, _loadResultTarget.IslandReferences); + if (loadResult == null || loadResult.Status == LoadResultStatus.Error) + { + ReportError("Import of '{0}' failed", uri); + return; + } + dependenciesTable[index] = loadResult; + } + _loadResultTarget.SetDependenciesTable(dependenciesTable); + } + + private void DepersistTypeExportDeclarations() + { + ushort num1 = _reader.ReadUInt16(); + TypeSchema[] exportTable = new TypeSchema[num1]; + for (int index = 0; index < num1; ++index) + { + string name = ReadDataTableString(); + MarkupTypeSchema markupTypeSchema = MarkupTypeSchema.Build(MarkupTypeToDefinition((MarkupType)_reader.ReadInt32()), _loadResultTarget, name); + exportTable[index] = markupTypeSchema; + } + _loadResultTarget.SetExportTable(exportTable); + ushort num2 = _reader.ReadUInt16(); + if (num2 <= 0) + return; + AliasMapping[] aliasTable = new AliasMapping[num2]; + for (int index1 = 0; index1 < num2; ++index1) + { + string alias = ReadDataTableString(); + ushort index2 = _reader.ReadUInt16(); + string targetType = ReadDataTableString(); + LoadResult dependent = MapIndexToDependent(index2); + aliasTable[index1] = new AliasMapping(alias, dependent, targetType); + } + _loadResultTarget.SetAliasTable(aliasTable); + } + + private void DepersistTypeImportTable() + { + if (_usingSharedDataTable) + return; + MarkupImportTables importTables = new MarkupImportTables(); + _loadResultTarget.BinaryDataTable.SetImportTables(importTables); + ushort num = _reader.ReadUInt16(); + if (num <= 0) + return; + TypeSchema[] typeSchemaArray = new TypeSchema[num]; + for (ushort index = 0; index < num; ++index) + { + LoadResult dependent = MapIndexToDependent(_reader.ReadUInt16()); + string name = ReadDataTableString(); + TypeSchema type = dependent.FindType(name); + if (type == null) + ReportError("Import of {0} named '{1}' from '{2}' failed", "type", name, dependent.Uri); + else + typeSchemaArray[index] = type; + } + importTables.TypeImports = typeSchemaArray; + } + + private void DepersistTypeExportDefinitions() + { + TypeSchema[] typeImports = _loadResultTarget.ImportTables.TypeImports; + foreach (MarkupTypeSchema markupTypeSchema in _loadResultTarget.ExportTable) + { + MarkupType markupType = markupTypeSchema.MarkupType; + TypeSchema definition = MarkupTypeToDefinition(markupType); + uint typeDepth = _reader.ReadUInt16(); + markupTypeSchema.SetTypeDepth(typeDepth); + if (typeDepth > 1U) + { + ushort num = _reader.ReadUInt16(); + TypeSchema typeSchema = typeImports[num]; + markupTypeSchema.SetBaseType((MarkupTypeSchema)typeSchema); + } + uint offset1 = _reader.ReadUInt32(); + markupTypeSchema.SetInitializePropertiesOffset(offset1); + uint offset2 = _reader.ReadUInt32(); + markupTypeSchema.SetInitializeLocalsInputOffset(offset2); + uint offset3 = _reader.ReadUInt32(); + markupTypeSchema.SetInitializeContentOffset(offset3); + markupTypeSchema.SetInitialEvaluateOffsets(ReadUInt32ArrayHelper()); + markupTypeSchema.SetFinalEvaluateOffsets(ReadUInt32ArrayHelper()); + markupTypeSchema.SetRefreshListenerGroupOffsets(ReadUInt32ArrayHelper()); + uint listenerCount = _reader.ReadUInt32(); + markupTypeSchema.SetListenerCount(listenerCount); + uint num1 = _reader.ReadUInt32(); + if (num1 > 0U) + { + SymbolReference[] symbolTable = new SymbolReference[num1]; + for (int index = 0; index < num1; ++index) + { + SymbolReference symbolReference = new SymbolReference(ReadDataTableString(), (SymbolOrigin)_reader.ReadByte()); + symbolTable[index] = symbolReference; + } + markupTypeSchema.SetSymbolReferenceTable(symbolTable); + } + DepersistInheritedSymbolTable(markupTypeSchema); + int totalPropertiesAndLocalsCount = _reader.ReadInt32(); + markupTypeSchema.SetTotalPropertiesAndLocalsCount(totalPropertiesAndLocalsCount); + if (markupType == MarkupType.UI) + { + ushort num2 = _reader.ReadUInt16(); + if (num2 > 0) + { + NamedContentRecord[] namedContentTable = new NamedContentRecord[num2]; + for (int index = 0; index < num2; ++index) + { + string name = ReadDataTableString(); + uint offset4 = _reader.ReadUInt32(); + namedContentTable[index] = new NamedContentRecord(name); + namedContentTable[index].SetOffset(offset4); + } + ((UIClassTypeSchema)markupTypeSchema).SetNamedContentTable(namedContentTable); + } + } + else + { + if (_reader.ReadBool()) + ((ClassTypeSchema)markupTypeSchema).MarkShareable(); + if (markupType == MarkupType.Effect) + { + EffectClassTypeSchema effectClassTypeSchema = (EffectClassTypeSchema)markupTypeSchema; + effectClassTypeSchema.SetTechniqueOffsets(ReadUInt32ArrayHelper()); + effectClassTypeSchema.SetInstancePropertyAssignments(ReadUInt32ArrayHelper()); + effectClassTypeSchema.SetDynamicElementAssignments(ReadStringArrayHelper()); + int symbolIndex = _reader.ReadInt32(); + effectClassTypeSchema.SetDefaultElementSymbolIndex(symbolIndex); + } + if (markupType == MarkupType.DataQuery) + { + MarkupDataQuerySchema markupDataQuerySchema = (MarkupDataQuerySchema)markupTypeSchema; + markupDataQuerySchema.ProviderName = ReadDataTableString(); + ushort index = _reader.ReadUInt16(); + markupDataQuerySchema.ResultType = MapIndexToType(index); + } + } + ushort num3 = _reader.ReadUInt16(); + if (num3 > 0) + { + PropertySchema[] properties = new PropertySchema[num3]; + for (int index1 = 0; index1 < num3; ++index1) + { + string name = ReadDataTableString(); + bool requiredForCreation = _reader.ReadBool(); + bool flag = _reader.ReadBool(); + PropertyOverrideCriteriaTypeConstraint criteriaTypeConstraint = null; + if (flag) + { + ushort num2 = _reader.ReadUInt16(); + ushort num4 = _reader.ReadUInt16(); + TypeSchema constraint = typeImports[num2]; + criteriaTypeConstraint = new PropertyOverrideCriteriaTypeConstraint(typeImports[num4], constraint); + } + ushort num5 = _reader.ReadUInt16(); + TypeSchema propertyType = typeImports[num5]; + MarkupPropertySchema markupPropertySchema = MarkupPropertySchema.Build(definition, markupTypeSchema, name, propertyType); + markupPropertySchema.SetRequiredForCreation(requiredForCreation); + markupPropertySchema.SetOverrideCriteria(criteriaTypeConstraint); + if (markupType == MarkupType.DataType) + { + MarkupDataTypePropertySchema typePropertySchema = (MarkupDataTypePropertySchema)markupPropertySchema; + ushort index2 = _reader.ReadUInt16(); + if (index2 != ushort.MaxValue) + typePropertySchema.SetUnderlyingCollectionType(MapIndexToType(index2)); + } + if (markupType == MarkupType.DataQuery) + { + MarkupDataQueryPropertySchema queryPropertySchema = (MarkupDataQueryPropertySchema)markupPropertySchema; + if (_reader.ReadBool()) + queryPropertySchema.DefaultValue = queryPropertySchema.PropertyType.DecodeBinary(_reader); + queryPropertySchema.InvalidatesQuery = _reader.ReadBool(); + ushort index2 = _reader.ReadUInt16(); + if (index2 != ushort.MaxValue) + queryPropertySchema.SetUnderlyingCollectionType(MapIndexToType(index2)); + } + properties[index1] = markupPropertySchema; + } + markupTypeSchema.SetPropertyList(properties); + } + MethodSchema[] methods = ReadMarkupMethodArrayHelper(definition, markupTypeSchema); + if (methods != null) + markupTypeSchema.SetMethodList(methods); + MethodSchema[] virtualMethods = ReadMarkupMethodArrayHelper(definition, markupTypeSchema); + if (virtualMethods != null) + markupTypeSchema.SetVirtualMethodList(virtualMethods); + } + foreach (MarkupTypeSchema markupTypeSchema in _loadResultTarget.ExportTable) + markupTypeSchema.BuildProperties(); + } + + private void DepersistMemberImportTables() + { + if (_usingSharedDataTable) + return; + MarkupImportTables importTables = _loadResultTarget.ImportTables; + ushort num1 = _reader.ReadUInt16(); + if (num1 > 0) + { + ConstructorSchema[] constructorSchemaArray = new ConstructorSchema[num1]; + for (int index1 = 0; index1 < num1; ++index1) + { + TypeSchema type = MapIndexToType(_reader.ReadUInt16()); + ushort num2 = _reader.ReadUInt16(); + TypeSchema[] parameters = TypeSchema.EmptyList; + if (num2 > 0) + { + parameters = GetTempParameterArray(num2); + for (ushort index2 = 0; index2 < num2; ++index2) + { + ushort index3 = _reader.ReadUInt16(); + parameters[index2] = MapIndexToType(index3); + } + } + ConstructorSchema constructor = type.FindConstructor(parameters); + if (constructor == null) + ReportError("Import of {0} named '{1}' from '{2}' failed", "constructor", type.Name, type.Owner.Uri); + else + constructorSchemaArray[index1] = constructor; + } + importTables.ConstructorImports = constructorSchemaArray; + } + ushort num3 = _reader.ReadUInt16(); + if (num3 > 0) + { + PropertySchema[] propertySchemaArray = new PropertySchema[num3]; + for (int index = 0; index < num3; ++index) + { + TypeSchema type = MapIndexToType(_reader.ReadUInt16()); + string name = ReadDataTableString(); + PropertySchema property = type.FindProperty(name); + if (property == null) + ReportError("Import of {0} named '{1}' from '{2}' failed", "property", name, type.Name); + else + propertySchemaArray[index] = property; + } + importTables.PropertyImports = propertySchemaArray; + } + ushort num4 = _reader.ReadUInt16(); + if (num4 > 0) + { + MethodSchema[] methodSchemaArray = new MethodSchema[num4]; + for (int index1 = 0; index1 < num4; ++index1) + { + MethodSchema methodSchema = null; + TypeSchema type = MapIndexToType(_reader.ReadUInt16()); + if (!_reader.ReadBool()) + { + string name = ReadDataTableString(); + ushort num2 = _reader.ReadUInt16(); + TypeSchema[] parameters = TypeSchema.EmptyList; + if (num2 > 0) + { + parameters = GetTempParameterArray(num2); + for (ushort index2 = 0; index2 < num2; ++index2) + { + ushort index3 = _reader.ReadUInt16(); + parameters[index2] = MapIndexToType(index3); + } + } + methodSchema = type.FindMethod(name, parameters); + if (methodSchema == null) + ReportError("Import of {0} named '{1}' from '{2}' failed", "method", name, type.Name); + } + else + { + int num2 = _reader.ReadInt32(); + if (type is MarkupTypeSchema markupTypeSchema) + { + foreach (MarkupMethodSchema virtualMethod in markupTypeSchema.VirtualMethods) + { + if (virtualMethod.VirtualId == num2) + { + methodSchema = virtualMethod; + break; + } + } + } + if (methodSchema == null) + ReportError("Import of virtual method with index {0} from '{1}' failed", num2.ToString(), type.Name); + } + methodSchemaArray[index1] = methodSchema; + } + importTables.MethodImports = methodSchemaArray; + } + ushort num5 = _reader.ReadUInt16(); + if (num5 <= 0) + return; + EventSchema[] eventSchemaArray = new EventSchema[num5]; + for (int index = 0; index < num5; ++index) + { + TypeSchema type = MapIndexToType(_reader.ReadUInt16()); + string name = ReadDataTableString(); + EventSchema eventSchema = type.FindEvent(name); + if (eventSchema == null) + ReportError("Import of {0} named '{1}' from '{2}' failed", "event", name, type.Name); + else + eventSchemaArray[index] = eventSchema; + } + importTables.EventImports = eventSchemaArray; + } + + private void DepersistDataMappingsTable() + { + ushort num1 = _reader.ReadUInt16(); + if (num1 <= 0) + return; + MarkupDataMapping[] dataMappingsTable = new MarkupDataMapping[num1]; + for (int index1 = 0; index1 < num1; ++index1) + { + MarkupDataMapping markupDataMapping = new MarkupDataMapping(null); + ushort index2 = _reader.ReadUInt16(); + markupDataMapping.TargetType = (MarkupDataTypeSchema)MapIndexToType(index2); + markupDataMapping.Provider = ReadDataTableString(); + ushort num2 = _reader.ReadUInt16(); + markupDataMapping.Mappings = new MarkupDataMappingEntry[num2]; + for (int index3 = 0; index3 < num2; ++index3) + { + MarkupDataMappingEntry dataMappingEntry = new MarkupDataMappingEntry(); + dataMappingEntry.Source = ReadDataTableString(); + dataMappingEntry.Target = ReadDataTableString(); + ushort num3 = _reader.ReadUInt16(); + dataMappingEntry.Property = (MarkupDataTypePropertySchema)_loadResultTarget.ImportTables.PropertyImports[num3]; + dataMappingEntry.DefaultValue = !_reader.ReadBool() ? MarkupDataProvider.GetDefaultValueForType(dataMappingEntry.Property.PropertyType) : dataMappingEntry.Property.PropertyType.DecodeBinary(_reader); + markupDataMapping.Mappings[index3] = dataMappingEntry; + } + dataMappingsTable[index1] = markupDataMapping; + } + _loadResultTarget.SetDataMappingsTable(dataMappingsTable); + } + + public static void DecodeInheritableSymbolTable(MarkupTypeSchema typeExport, ByteCodeReader reader, IntPtr startAddress) + { + if (reader == null) + { + uint size = ByteCodeReader.ReadUInt32(startAddress); + reader = new ByteCodeReader(new IntPtr(startAddress.ToInt64() + 4L), size, false); + } + else + { + int num1 = (int)reader.ReadUInt32(); + } + MarkupLoadResult owner = typeExport.Owner as MarkupLoadResult; + MarkupBinaryDataTable binaryDataTable = owner.BinaryDataTable; + uint num2 = reader.ReadUInt32(); + SymbolRecord[] symbolTable; + if (num2 > 0U) + { + symbolTable = new SymbolRecord[num2]; + for (int index = 0; index < num2; ++index) + { + SymbolRecord symbolRecord = new SymbolRecord(); + symbolRecord.Name = ReadDataTableString(reader, binaryDataTable); + symbolRecord.SymbolOrigin = (SymbolOrigin)reader.ReadByte(); + ushort num3 = reader.ReadUInt16(); + symbolRecord.Type = owner.ImportTables.TypeImports[num3]; + symbolTable[index] = symbolRecord; + } + } + else + symbolTable = SymbolRecord.EmptyList; + typeExport.SetInheritableSymbolsTable(symbolTable); + } + + private void DepersistInheritedSymbolTable(MarkupTypeSchema typeExport) + { + if (_reader.IsInFixedMemory) + { + typeExport.SetAddressOfInheritableSymbolTable(_reader.CurrentAddress); + uint num = _reader.ReadUInt32(); + _reader.CurrentOffset += num; + } + else + DecodeInheritableSymbolTable(typeExport, _reader, IntPtr.Zero); + } + + private void DepersistConstantsTable() + { + ushort num = _reader.ReadUInt16(); + if (num <= 0) + return; + object[] runtimeList = new object[num]; + MarkupConstantsTable constantsTable = new MarkupConstantsTable(runtimeList); + if (!_reader.IsInFixedMemory) + { + _reader.CurrentOffset += (uint)((num + 1) * 4); + for (int index = 0; index < num; ++index) + { + object obj = DepersistConstant(_reader, _loadResultTarget); + runtimeList[index] = obj; + } + } + else + { + ByteCodeReader constantsTableReader = new ByteCodeReader(_reader.CurrentAddress, ByteCodeReader.ReadUInt32(_reader.GetAddress(_reader.CurrentOffset + num * 4U)), false); + constantsTable.SetConstantsTableReader(constantsTableReader, _loadResultTarget); + } + _loadResultTarget.BinaryDataTable.SetConstantsTable(constantsTable); + } + + public static object DepersistConstant(ByteCodeReader reader, MarkupLoadResult loadResult) + { + ushort num = reader.ReadUInt16(); + TypeSchema typeImport = loadResult.ImportTables.TypeImports[num]; + MarkupConstantPersistMode constantPersistMode = (MarkupConstantPersistMode)reader.ReadByte(); + object instance = null; + switch (constantPersistMode) + { + case MarkupConstantPersistMode.Binary: + instance = typeImport.DecodeBinary(reader); + break; + case MarkupConstantPersistMode.FromString: + string str = ReadDataTableString(reader, loadResult.BinaryDataTable); + typeImport.TypeConverter(str, StringSchema.Type, out instance); + break; + case MarkupConstantPersistMode.Canonical: + string name = ReadDataTableString(reader, loadResult.BinaryDataTable); + instance = typeImport.FindCanonicalInstance(name); + break; + } + return instance; + } + + private static MarkupLineNumberTable DecodeLineNumberTable(ByteCodeReader reader) + { + ushort num = reader.ReadUInt16(); + 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)(ByteCodeReader.ReadUInt16(address) * 12 + 2); + return DecodeLineNumberTable(new ByteCodeReader(address, size, false)); + } + + private void DepersistLineNumberTable() + { + if (_reader.IsInFixedMemory) + { + _loadResultTarget.SetAddressOfLineNumberData(_reader.GetAddress(_lineNumberTableStart)); + } + else + { + uint currentOffset = _reader.CurrentOffset; + _reader.CurrentOffset = _lineNumberTableStart; + _loadResultTarget.SetLineNumberTable(DecodeLineNumberTable(_reader)); + _reader.CurrentOffset = currentOffset; + } + } + + private void DepersistObjectSection() + { + uint num = _objectSectionEnd - _objectSectionStart; + ByteCodeReader reader; + if (_reader.IsInFixedMemory) + { + reader = new ByteCodeReader(_reader.GetAddress(_objectSectionStart), num, false); + } + else + { + ByteCodeWriter byteCodeWriter = new ByteCodeWriter(); + byteCodeWriter.Write(_reader.GetAddress(_objectSectionStart), num); + reader = byteCodeWriter.CreateReader(); + } + _loadResultTarget.SetObjectSection(reader); + } + + private void DepersistBinaryDataTable(uint binaryDataTableOffset) + { + uint currentOffset = _reader.CurrentOffset; + _reader.CurrentOffset = binaryDataTableOffset; + int stringCount = _reader.ReadInt32(); + _binaryDataTable = new MarkupBinaryDataTable(null, stringCount); + if (!_reader.IsInFixedMemory) + { + _reader.CurrentOffset += (uint)((stringCount + 1) * 4); + Vector strings = _binaryDataTable.Strings; + for (int index = 0; index < stringCount; ++index) + { + string str = _reader.ReadString(); + strings[index] = str; + } + } + else + _binaryDataTable.SetStringTableReader(new ByteCodeReader(_reader.CurrentAddress, ByteCodeReader.ReadUInt32(_reader.GetAddress(_reader.CurrentOffset + (uint)(stringCount * 4))), false)); + _loadResultTarget.SetBinaryDataTable(_binaryDataTable); + _reader.CurrentOffset = currentOffset; + } + + private LoadResult MapIndexToDependent(ushort index) + { + LoadResult loadResult; + switch (index) + { + case 65533: + loadResult = _loadResultTarget; + break; + case 65534: + loadResult = MarkupSystem.UIXGlobal; + break; + default: + loadResult = _binaryDataTableLoadResult == null ? _loadResultTarget.Dependencies[index] : _binaryDataTableLoadResult.Dependencies[index]; + break; + } + return loadResult; + } + + private TypeSchema MapIndexToType(ushort index) => _loadResultTarget.ImportTables.TypeImports[index]; + + private string ReadDataTableString() => _binaryDataTable.GetStringByIndex(_reader.ReadInt32()); + + private static string ReadDataTableString(ByteCodeReader reader, MarkupBinaryDataTable binaryDataTable) + { + int index = reader.ReadInt32(); + return binaryDataTable.GetStringByIndex(index); + } + + private uint[] ReadUInt32ArrayHelper() + { + uint num = _reader.ReadUInt32(); + if (num <= 0U) + return null; + uint[] numArray = new uint[num]; + for (int index = 0; index < num; ++index) + numArray[index] = _reader.ReadUInt32(); + return numArray; + } + + private string[] ReadStringArrayHelper() + { + uint num = _reader.ReadUInt32(); + if (num <= 0U) + return null; + string[] strArray = new string[num]; + for (int index = 0; index < num; ++index) + strArray[index] = ReadDataTableString(); + return strArray; + } + + private MethodSchema[] ReadMarkupMethodArrayHelper(TypeSchema markupTypeDefinition, MarkupTypeSchema typeExport) + { + MethodSchema[] methodSchemaArray = null; + ushort num1 = _reader.ReadUInt16(); + if (num1 > 0) + { + methodSchemaArray = new MethodSchema[num1]; + for (int index1 = 0; index1 < num1; ++index1) + { + string name = ReadDataTableString(); + TypeSchema type = MapIndexToType(_reader.ReadUInt16()); + uint num2 = _reader.ReadUInt32(); + TypeSchema[] parameterTypes = TypeSchema.EmptyList; + if (num2 > 0U) + { + parameterTypes = new TypeSchema[num2]; + for (int index2 = 0; index2 < num2; ++index2) + { + ushort index3 = _reader.ReadUInt16(); + parameterTypes[index2] = MapIndexToType(index3); + } + } + string[] parameterNames = ReadStringArrayHelper() ?? MarkupMethodSchema.s_emptyStringArray; + int virtualId = _reader.ReadInt32(); + bool isVirtualThunk = _reader.ReadBool(); + uint codeOffset = _reader.ReadUInt32(); + MarkupMethodSchema markupMethodSchema = MarkupMethodSchema.Build(markupTypeDefinition, typeExport, name, type, parameterTypes, parameterNames, isVirtualThunk); + markupMethodSchema.SetCodeOffset(codeOffset); + markupMethodSchema.SetVirtualId(virtualId); + methodSchemaArray[index1] = markupMethodSchema; + } + } + return methodSchemaArray; + } + + private TypeSchema MarkupTypeToDefinition(MarkupType markupType) + { + switch (markupType) + { + case MarkupType.UI: + return UISchema.Type; + case MarkupType.Effect: + return EffectSchema.Type; + case MarkupType.DataType: + return DataTypeSchema.Type; + case MarkupType.DataQuery: + return DataQuerySchema.Type; + default: + return ClassSchema.Type; + } + } + + private TypeSchema[] GetTempParameterArray(int count) + { + if (_typeSchemaArrays == null) + _typeSchemaArrays = new TypeSchema[5][]; + if (count >= _typeSchemaArrays.Length) + return new TypeSchema[count]; + int index = count - 1; + if (_typeSchemaArrays[index] == null) + _typeSchemaArrays[index] = new TypeSchema[count]; + return _typeSchemaArrays[index]; + } + + public void ReportError(string error, string param0, string param1, string param2) => ReportError(string.Format(error, param0, param1, param2)); + + public void ReportError(string error, string param0, string param1) => ReportError(string.Format(error, param0, param1)); + + public void ReportError(string error, string param0) => ReportError(string.Format(error, param0)); + + public void ReportError(string error) + { + MarkHasErrors(); + ErrorManager.ReportError(error); + } + + public void MarkHasErrors() + { + if (_hasErrors) + return; + _hasErrors = true; + _loadResultTarget.MarkLoadFailed(); + } + + public bool HasErrors => _hasErrors; + + public static bool IsUIB(Resource resource) + { + bool flag = false; + if (resource.Length > 4U && ByteCodeReader.ReadUInt32(resource.Buffer) == 440551765U) + flag = true; + return flag; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/ConstructHandler.cs b/UIX/Microsoft/Iris/Markup/ConstructHandler.cs new file mode 100644 index 0000000..18d6d4a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ConstructHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ConstructHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate object ConstructHandler(object[] parameters); +} diff --git a/UIX/Microsoft/Iris/Markup/ConstructorSchema.cs b/UIX/Microsoft/Iris/Markup/ConstructorSchema.cs new file mode 100644 index 0000000..4315870 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ConstructorSchema.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ConstructorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal abstract class ConstructorSchema : DisposableObject + { + public static ConstructorSchema[] EmptyList = new ConstructorSchema[0]; + private TypeSchema _owner; + + public ConstructorSchema(TypeSchema owner) + { + _owner = owner; + DeclareOwner(owner); + } + + public TypeSchema Owner => _owner; + + public abstract TypeSchema[] ParameterTypes { get; } + + public abstract object Construct(object[] parameters); + } +} diff --git a/UIX/Microsoft/Iris/Markup/CreateLoadResultHandler.cs b/UIX/Microsoft/Iris/Markup/CreateLoadResultHandler.cs new file mode 100644 index 0000000..8af4ce4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/CreateLoadResultHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.CreateLoadResultHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate LoadResult CreateLoadResultHandler(string uri); +} diff --git a/UIX/Microsoft/Iris/Markup/DecodeBinaryHandler.cs b/UIX/Microsoft/Iris/Markup/DecodeBinaryHandler.cs new file mode 100644 index 0000000..eb7f4b9 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/DecodeBinaryHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.DecodeBinaryHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate object DecodeBinaryHandler(ByteCodeReader reader); +} diff --git a/UIX/Microsoft/Iris/Markup/DefaultConstructHandler.cs b/UIX/Microsoft/Iris/Markup/DefaultConstructHandler.cs new file mode 100644 index 0000000..1ef04a5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/DefaultConstructHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.DefaultConstructHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate object DefaultConstructHandler(); +} diff --git a/UIX/Microsoft/Iris/Markup/DelegateListener.cs b/UIX/Microsoft/Iris/Markup/DelegateListener.cs new file mode 100644 index 0000000..e92d9b0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/DelegateListener.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.DelegateListener +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class DelegateListener : Listener + { + private DelegateListener.OnNotifyCallback _onNotify; + + public DelegateListener( + INotifyObject notifier, + string watch, + DelegateListener.OnNotifyCallback callback) + { + _watch = watch; + _onNotify = callback; + notifier.AddListener(this); + } + + public override void Dispose() + { + base.Dispose(); + _onNotify = null; + } + + public override void OnNotify() + { + base.OnNotify(); + _onNotify(this); + } + + public delegate void OnNotifyCallback(DelegateListener listener); + } +} diff --git a/UIX/Microsoft/Iris/Markup/DestructiveListener.cs b/UIX/Microsoft/Iris/Markup/DestructiveListener.cs new file mode 100644 index 0000000..bc0015e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/DestructiveListener.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.DestructiveListener +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class DestructiveListener : MarkupListener + { + private uint _refreshId; + + public void Reset( + INotifyObject notifier, + string watch, + IMarkupTypeBase scriptHost, + uint scriptId, + uint refreshId) + { + Reset(notifier, watch, scriptHost, scriptId); + _refreshId = refreshId; + } + + public override void OnNotify() + { + base.OnNotify(); + ScriptHost.ScheduleScriptRun(_refreshId, true); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/EffectClassTypeSchema.cs b/UIX/Microsoft/Iris/Markup/EffectClassTypeSchema.cs new file mode 100644 index 0000000..8b0401e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/EffectClassTypeSchema.cs @@ -0,0 +1,123 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.EffectClassTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class EffectClassTypeSchema : ClassTypeSchema + { + private uint[] _techniqueOffsets; + private uint[] _instancePropertyAssignments; + private string[] _dynamicElementAssignments; + private int _defaultElementSymbolIndex = -1; + private IEffectTemplate _effectTemplate; + private int _templateIndexBuilt; + private PropertySchema _defaultProperty; + + public EffectClassTypeSchema(MarkupLoadResult owner, string name) + : base(owner, name) + { + } + + protected override void SealWorker() + { + base.SealWorker(); + _defaultProperty = FindPropertyDeep("Default"); + } + + public override MarkupType MarkupType => MarkupType.Effect; + + protected override void OnDispose() + { + base.OnDispose(); + if (_effectTemplate == null) + return; + _effectTemplate.UnregisterUsage(this); + _effectTemplate = null; + } + + protected override TypeSchema DefaultBase => EffectInstanceSchema.Type; + + public override Type RuntimeType => typeof(EffectClass); + + public string DefaultElementSymbol => _defaultElementSymbolIndex >= 0 ? SymbolReferenceTable[_defaultElementSymbolIndex].Symbol : null; + + protected override Class ConstructNewInstance() + { + EnsureEffectTemplate(); + return new EffectClass(this, _effectTemplate); + } + + protected override bool RunInitialEvaluates(IMarkupTypeBase scriptHost) + { + bool flag = true; + if (_instancePropertyAssignments != null && _templateIndexBuilt >= 0) + { + ErrorManager.EnterContext(this); + flag = RunInitializeScript(scriptHost, _instancePropertyAssignments[_templateIndexBuilt]); + ErrorManager.ExitContext(); + } + return flag && base.RunInitialEvaluates(scriptHost); + } + + private void EnsureEffectTemplate() + { + if (_effectTemplate != null) + return; + _effectTemplate = UISession.Default.RenderSession.CreateEffectTemplate(this, Name); + ErrorManager.EnterContext(this); + Class @class = new Class(this); + @class.DeclareOwner(this); + _templateIndexBuilt = -1; + for (int index = 0; index < _techniqueOffsets.Length; ++index) + { + object obj = RunAtOffset(@class, _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", Name); + } + else + { + EffectInput input = (EffectInput)obj; + if (_dynamicElementAssignments != null) + { + foreach (string elementAssignment in _dynamicElementAssignments) + _effectTemplate.AddEffectProperty(elementAssignment); + } + if (_effectTemplate.Build(input)) + { + _templateIndexBuilt = index; + break; + } + } + } + @class.Dispose(this); + ErrorManager.ExitContext(); + } + + public uint[] TechniqueOffsets => _techniqueOffsets; + + public uint[] InstancePropertyAssignments => _instancePropertyAssignments; + + public string[] DynamicElementAssignments => _dynamicElementAssignments; + + public int DefaultElementSymbolIndex => _defaultElementSymbolIndex; + + public void SetTechniqueOffsets(uint[] techniqueOffsets) => _techniqueOffsets = techniqueOffsets; + + public void SetInstancePropertyAssignments(uint[] instancePropertyAssignments) => _instancePropertyAssignments = instancePropertyAssignments; + + public void SetDynamicElementAssignments(string[] dynamicElementAssignments) => _dynamicElementAssignments = dynamicElementAssignments; + + public void SetDefaultElementSymbolIndex(int symbolIndex) => _defaultElementSymbolIndex = symbolIndex; + } +} diff --git a/UIX/Microsoft/Iris/Markup/EncodeBinaryHandler.cs b/UIX/Microsoft/Iris/Markup/EncodeBinaryHandler.cs new file mode 100644 index 0000000..884a42b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/EncodeBinaryHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.EncodeBinaryHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate void EncodeBinaryHandler(ByteCodeWriter writer, object instance); +} diff --git a/UIX/Microsoft/Iris/Markup/EnumSchema.cs b/UIX/Microsoft/Iris/Markup/EnumSchema.cs new file mode 100644 index 0000000..35f2b7a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/EnumSchema.cs @@ -0,0 +1,211 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.EnumSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using System; +using System.Diagnostics; + +namespace Microsoft.Iris.Markup +{ + internal class EnumSchema : TypeSchema + { + private string _name; + private Type _enumType; + protected Map _nameToValueMap; + private bool _isFlags; + private string[] _names; + private int[] _values; + + public EnumSchema(LoadResult owner) + : base(owner) + { + } + + protected void Initialize( + string enumName, + Type runtimeType, + bool isFlags, + string[] names, + int[] values) + { + _name = enumName; + _enumType = runtimeType; + _isFlags = isFlags; + _names = names; + _values = values; + } + + protected virtual void InitializeNameToValueMap() + { + _nameToValueMap = new Map(_names.Length); + for (int index = 0; index < _names.Length; ++index) + _nameToValueMap[_names[index]] = _values[index]; + _names = null; + _values = null; + } + + [Conditional("DEBUG")] + protected void DEBUG_AssertInitialized() + { + } + + public Vector Names + { + get + { + Vector vector = new Vector(); + foreach (string key in NameToValueMap.Keys) + vector.Add(key); + return vector; + } + } + + protected Map NameToValueMap + { + get + { + if (_nameToValueMap == null) + InitializeNameToValueMap(); + return _nameToValueMap; + } + } + + protected bool IsFlags => _isFlags; + + public override string Name => _name; + + public override string AlternateName => (string)null; + + public override TypeSchema Base => ObjectSchema.Type; + + public override bool Contractual => false; + + public override Type RuntimeType => _enumType; + + public override bool IsNativeAssignableFrom(object check) => RuntimeType.IsAssignableFrom(check.GetType()); + + public override bool IsNativeAssignableFrom(TypeSchema check) => false; + + public override bool Disposable => false; + + public override object ConstructDefault() => EnumValueToObject(0); + + public override bool HasDefaultConstructor => true; + + public override void InitializeInstance(ref object instance) + { + } + + public override bool HasInitializer => false; + + public override ConstructorSchema FindConstructor(TypeSchema[] parameters) => (ConstructorSchema)null; + + public override PropertySchema FindProperty(string name) => (PropertySchema)null; + + public override MethodSchema FindMethod(string name, TypeSchema[] parameters) => (MethodSchema)null; + + public override EventSchema FindEvent(string name) => (EventSchema)null; + + public override object FindCanonicalInstance(string name) + { + int num; + return NameToValue(name, out num) ? EnumValueToObject(num) : null; + } + + public bool NameToValue(string name, out int value) => NameToValueMap.TryGetValue(name, out value); + + protected virtual object EnumValueToObject(int value) => Enum.ToObject(_enumType, value); + + protected virtual int ValueFromObject(object obj) => (int)obj; + + public override PropertySchema[] Properties => PropertySchema.EmptyList; + + private Result ConvertFromString(string value, out object instance) + { + instance = null; + int num1 = 0; + if (_isFlags && value.IndexOf(',') >= 0) + { + foreach (string name in StringUtility.SplitAndTrim(',', value)) + { + int num2; + if (!NameToValue(name, out num2)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", name, _name); + num1 |= num2; + } + } + else if (!NameToValue(value, out num1)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", value, _name); + instance = EnumValueToObject(num1); + return Result.Success; + } + + public override Result TypeConverter( + object from, + TypeSchema fromType, + out object instance) + { + Result result; + if (StringSchema.Type.IsAssignableFrom(fromType)) + result = ConvertFromString((string)from, out instance); + else if (Int32Schema.Type.IsAssignableFrom(fromType)) + { + instance = EnumValueToObject((int)from); + result = Result.Success; + } + else + { + instance = null; + result = Result.Fail("Unsupported"); + } + return result; + } + + public override bool SupportsTypeConversion(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType) || Int32Schema.Type.IsAssignableFrom(fromType); + + public override void EncodeBinary(ByteCodeWriter writer, object instance) => writer.WriteInt32(ValueFromObject(instance)); + + public override object DecodeBinary(ByteCodeReader reader) => EnumValueToObject(reader.ReadInt32()); + + public override bool SupportsBinaryEncoding => true; + + public override object PerformOperation(object left, object right, OperationType op) + { + bool flag = Equals(left, right); + switch (op) + { + case OperationType.RelationalEquals: + return BooleanBoxes.Box(flag); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(!flag); + default: + return null; + } + } + + public override bool SupportsOperation(OperationType op) + { + switch (op) + { + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + return true; + default: + return false; + } + } + + public override bool IsNullAssignable => false; + + public override bool IsRuntimeImmutable => true; + + public override bool IsEnum => true; + + public override int FindTypeHint => -1; + } +} diff --git a/UIX/Microsoft/Iris/Markup/ErrorLoadResult.cs b/UIX/Microsoft/Iris/Markup/ErrorLoadResult.cs new file mode 100644 index 0000000..c181c07 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ErrorLoadResult.cs @@ -0,0 +1,20 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ErrorLoadResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class ErrorLoadResult : LoadResult + { + public ErrorLoadResult(string uri) + : base(uri) + { + } + + public override TypeSchema FindType(string name) => (TypeSchema)null; + + public override LoadResultStatus Status => LoadResultStatus.Error; + } +} diff --git a/UIX/Microsoft/Iris/Markup/EventSchema.cs b/UIX/Microsoft/Iris/Markup/EventSchema.cs new file mode 100644 index 0000000..ba5914d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/EventSchema.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.EventSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal abstract class EventSchema : DisposableObject + { + private TypeSchema _owner; + public static EventSchema[] EmptyList = new EventSchema[0]; + + public EventSchema(TypeSchema owner) + { + _owner = owner; + DeclareOwner(owner); + } + + public TypeSchema Owner => _owner; + + public abstract string Name { get; } + } +} diff --git a/UIX/Microsoft/Iris/Markup/ExpressionRestriction.cs b/UIX/Microsoft/Iris/Markup/ExpressionRestriction.cs new file mode 100644 index 0000000..9912e4a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ExpressionRestriction.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ExpressionRestriction +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum ExpressionRestriction + { + None, + ReadOnly, + NoAccess, + } +} diff --git a/UIX/Microsoft/Iris/Markup/FastReflectionInvokeHandler.cs b/UIX/Microsoft/Iris/Markup/FastReflectionInvokeHandler.cs new file mode 100644 index 0000000..4565c5d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/FastReflectionInvokeHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.FastReflectionInvokeHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate object FastReflectionInvokeHandler(object target, object[] paramters); +} diff --git a/UIX/Microsoft/Iris/Markup/FindCanonicalInstanceHandler.cs b/UIX/Microsoft/Iris/Markup/FindCanonicalInstanceHandler.cs new file mode 100644 index 0000000..cdc96e7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/FindCanonicalInstanceHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.FindCanonicalInstanceHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate object FindCanonicalInstanceHandler(string name); +} diff --git a/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyPrimitiveTypeSchema.cs b/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyPrimitiveTypeSchema.cs new file mode 100644 index 0000000..546c322 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyPrimitiveTypeSchema.cs @@ -0,0 +1,42 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.FrameworkCompatibleAssemblyPrimitiveTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal class FrameworkCompatibleAssemblyPrimitiveTypeSchema : + FrameworkCompatibleAssemblyTypeSchema + { + private TypeSchema _frameworkSchema; + + public FrameworkCompatibleAssemblyPrimitiveTypeSchema(TypeSchema frameworkSchema) + : base(frameworkSchema.RuntimeType) + => _frameworkSchema = frameworkSchema; + + public override Result TypeConverter( + object from, + TypeSchema fromType, + out object instance) + { + return _frameworkSchema.TypeConverter(from, fromType, out instance); + } + + public override bool SupportsTypeConversion(TypeSchema fromType) => _frameworkSchema.SupportsTypeConversion(fromType); + + public override void EncodeBinary(ByteCodeWriter writer, object instance) => _frameworkSchema.EncodeBinary(writer, instance); + + public override object DecodeBinary(ByteCodeReader reader) => _frameworkSchema.DecodeBinary(reader); + + public override bool SupportsBinaryEncoding => _frameworkSchema.SupportsBinaryEncoding; + + public override bool IsRuntimeImmutable => _frameworkSchema.IsRuntimeImmutable; + + public override object PerformOperation(object left, object right, OperationType op) => _frameworkSchema.PerformOperation(left, right, op); + + public override bool SupportsOperation(OperationType op) => _frameworkSchema.SupportsOperation(op); + } +} diff --git a/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyTypeSchema.cs b/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyTypeSchema.cs new file mode 100644 index 0000000..17149e5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/FrameworkCompatibleAssemblyTypeSchema.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.FrameworkCompatibleAssemblyTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Markup +{ + internal class FrameworkCompatibleAssemblyTypeSchema : AssemblyTypeSchema + { + private Type _frameworkType; + private Type _constructDefaultType; + + public FrameworkCompatibleAssemblyTypeSchema(Type assemblyType) + : this(assemblyType, assemblyType, null, null) + { + } + + public FrameworkCompatibleAssemblyTypeSchema(Type assemblyType, Type frameworkType) + : this(assemblyType, frameworkType, null, null) + { + } + + public FrameworkCompatibleAssemblyTypeSchema( + Type assemblyType, + Type frameworkType, + Type constructDefaultType) + : this(assemblyType, frameworkType, constructDefaultType, null) + { + } + + public FrameworkCompatibleAssemblyTypeSchema( + Type assemblyType, + Type frameworkType, + Type constructDefaultType, + TypeSchema baseType) + : base(assemblyType, baseType) + { + _frameworkType = frameworkType; + _constructDefaultType = constructDefaultType; + } + + public override Type RuntimeType => _frameworkType; + + public override bool HasDefaultConstructor => base.HasDefaultConstructor || _constructDefaultType != null; + + public override object ConstructDefault() => base.HasDefaultConstructor ? base.ConstructDefault() : AssemblyLoadResult.WrapObject(this, Activator.CreateInstance(_constructDefaultType)); + } +} diff --git a/UIX/Microsoft/Iris/Markup/GetValueHandler.cs b/UIX/Microsoft/Iris/Markup/GetValueHandler.cs new file mode 100644 index 0000000..b249da8 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/GetValueHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.GetValueHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate object GetValueHandler(object instance); +} diff --git a/UIX/Microsoft/Iris/Markup/IDynamicConstructionSchema.cs b/UIX/Microsoft/Iris/Markup/IDynamicConstructionSchema.cs new file mode 100644 index 0000000..211218a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/IDynamicConstructionSchema.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.IDynamicConstructionSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal interface IDynamicConstructionSchema + { + object ConstructDefault(TypeSchema replacedType); + } +} diff --git a/UIX/Microsoft/Iris/Markup/IMarkupTypeBase.cs b/UIX/Microsoft/Iris/Markup/IMarkupTypeBase.cs new file mode 100644 index 0000000..440413c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/IMarkupTypeBase.cs @@ -0,0 +1,38 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.IMarkupTypeBase +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using System.Collections.Generic; + +namespace Microsoft.Iris.Markup +{ + internal interface IMarkupTypeBase : IDisposableOwner + { + TypeSchema TypeSchema { get; } + + void NotifyInitialized(); + + object GetProperty(string name); + + void SetProperty(string name, object value); + + object ReadSymbol(SymbolReference symbolRef); + + void WriteSymbol(SymbolReference symbolRef, object value); + + MarkupListeners Listeners { get; set; } + + void ScheduleScriptRun(uint scriptId, bool ignoreErrors); + + object RunScript(uint scriptId, bool ignoreErrors, ParameterContext parameterContext); + + bool ScriptEnabled { get; } + + void NotifyScriptErrors(); + + Dictionary Storage { get; } + } +} diff --git a/UIX/Microsoft/Iris/Markup/INotifyObject.cs b/UIX/Microsoft/Iris/Markup/INotifyObject.cs new file mode 100644 index 0000000..22809c2 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/INotifyObject.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.INotifyObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal interface INotifyObject + { + void AddListener(Listener listener); + } +} diff --git a/UIX/Microsoft/Iris/Markup/ISchemaInfo.cs b/UIX/Microsoft/Iris/Markup/ISchemaInfo.cs new file mode 100644 index 0000000..1a2fa04 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ISchemaInfo.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ISchemaInfo +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal interface ISchemaInfo + { + TypeSchema TypeSchema { get; } + } +} diff --git a/UIX/Microsoft/Iris/Markup/Int32Boxes.cs b/UIX/Microsoft/Iris/Markup/Int32Boxes.cs new file mode 100644 index 0000000..6128589 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/Int32Boxes.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.Int32Boxes +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class Int32Boxes + { + 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 new file mode 100644 index 0000000..c462b42 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/Int64Boxes.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.Int64Boxes +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class Int64Boxes + { + 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 new file mode 100644 index 0000000..cd9d833 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/Interpreter.cs @@ -0,0 +1,1647 @@ +using System; +using System.Collections; +using System.Linq; +using System.Xml; +using Microsoft.Iris.Debug; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup +{ + // Token: 0x0200018B RID: 395 + internal class Interpreter + { + // Token: 0x06000F21 RID: 3873 RVA: 0x00029E78 File Offset: 0x00028E78 + public static object Run(InterpreterContext context) + { + object result = null; + ByteCodeReader byteCodeReader = null; + long num = -1L; + bool flag = true; + ErrorManager.EnterContext(context); + try + { + byteCodeReader = context.LoadResult.ObjectSection; + num = (long)((ulong)byteCodeReader.CurrentOffset); + byteCodeReader.CurrentOffset = context.InitialBytecodeOffset; + if (InterpreterContext.UseDecompile) + result = RunDecompile(context, byteCodeReader); + else + result = Run(context, byteCodeReader); + flag = false; + } + finally + { + if (flag) + { + ExceptionContext = context.ToString(); + } + ErrorManager.ExitContext(); + if (byteCodeReader != null && num != -1L) + { + byteCodeReader.CurrentOffset = (uint)num; + } + } + return result; + } + + // Token: 0x06000F22 RID: 3874 RVA: 0x00029EF8 File Offset: 0x00028EF8 + private static object Run(InterpreterContext context, ByteCodeReader reader) + { + MarkupLoadResult loadResult = context.LoadResult; + IMarkupTypeBase instance = context.Instance; + MarkupImportTables importTables = loadResult.ImportTables; + MarkupConstantsTable constantsTable = loadResult.ConstantsTable; + SymbolReference[] symbolReferenceTable = context.MarkupType.SymbolReferenceTable; + Trace.IsCategoryEnabled(TraceCategory.Markup); + Stack stack = _stack; + int count = stack.Count; + if (instance != null) + { + stack.Push(instance); + } + ErrorWatermark watermark = ErrorManager.Watermark; + bool flag = false; + object result = null; + bool wasInDebugState = false; + while (!flag) + { + OpCode opCode = (OpCode)reader.ReadByte(); + switch (opCode) + { + case OpCode.ConstructObject: + { + int num = reader.ReadUInt16(); + TypeSchema typeSchema = importTables.TypeImports[num]; + object obj = typeSchema.ConstructDefault(); + ReportErrorOnNull(obj, "Construction", typeSchema.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj, typeSchema, instance); + stack.Push(obj); + } + break; + } + case OpCode.ConstructObjectIndirect: + { + int num2 = reader.ReadUInt16(); + TypeSchema typeSchema2 = importTables.TypeImports[num2]; + TypeSchema typeSchema3 = (TypeSchema)stack.Pop(); + if (!typeSchema2.IsAssignableFrom(typeSchema3)) + { + ErrorManager.ReportError("Script runtime failure: Dynamic construction type override failed. Attempting to construct '{0}' in place of '{1}'", (typeSchema3 != null) ? typeSchema3.Name : "null", typeSchema2.Name); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + IDynamicConstructionSchema dynamicConstructionSchema = typeSchema3 as IDynamicConstructionSchema; + object obj2; + if (dynamicConstructionSchema != null) + { + obj2 = dynamicConstructionSchema.ConstructDefault(typeSchema2); + } + else + { + obj2 = typeSchema3.ConstructDefault(); + } + ReportErrorOnNull(obj2, "Construction", typeSchema3.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj2, typeSchema3, instance); + stack.Push(obj2); + } + break; + } + case OpCode.ConstructObjectParam: + { + int num3 = reader.ReadUInt16(); + TypeSchema typeSchema4 = importTables.TypeImports[num3]; + int num4 = reader.ReadUInt16(); + ConstructorSchema constructorSchema = importTables.ConstructorImports[num4]; + int i = constructorSchema.ParameterTypes.Length; + object[] array = ParameterListAllocator.Alloc(i); + for (i--; i >= 0; i--) + { + array[i] = stack.Pop(); + } + object obj3 = constructorSchema.Construct(array); + ReportErrorOnNull(obj3, "Construction", typeSchema4.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj3, typeSchema4, instance); + stack.Push(obj3); + ParameterListAllocator.Free(array); + } + break; + } + case OpCode.ConstructFromString: + { + int num5 = reader.ReadUInt16(); + TypeSchema typeSchema5 = importTables.TypeImports[num5]; + int index = reader.ReadUInt16(); + string from = (string)constantsTable.Get(index); + object obj4; + typeSchema5.TypeConverter(from, StringSchema.Type, out obj4); + ReportErrorOnNull(obj4, "Construction", typeSchema5.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj4, typeSchema5, instance); + stack.Push(obj4); + } + break; + } + case OpCode.ConstructFromBinary: + { + int num6 = reader.ReadUInt16(); + TypeSchema typeSchema6 = importTables.TypeImports[num6]; + object obj5 = typeSchema6.DecodeBinary(reader); + ReportErrorOnNull(obj5, "Construction", typeSchema6.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj5, typeSchema6, instance); + stack.Push(obj5); + } + break; + } + case OpCode.InitializeInstance: + { + int num7 = reader.ReadUInt16(); + TypeSchema typeSchema7 = importTables.TypeImports[num7]; + object obj6 = stack.Pop(); + typeSchema7.InitializeInstance(ref obj6); + ReportErrorOnNull(obj6, "Initialize", typeSchema7.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj6); + } + break; + } + case OpCode.InitializeInstanceIndirect: + { + TypeSchema typeSchema8 = (TypeSchema)stack.Pop(); + object obj7 = stack.Pop(); + typeSchema8.InitializeInstance(ref obj7); + ReportErrorOnNull(obj7, "Initialize", typeSchema8.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj7); + } + break; + } + case OpCode.LookupSymbol: + { + int num8 = reader.ReadUInt16(); + SymbolReference symbolRef = symbolReferenceTable[num8]; + object obj8 = context.ReadSymbol(symbolRef); + stack.Push(obj8); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.WriteSymbol: + case OpCode.WriteSymbolPeek: + { + object value = (opCode == OpCode.WriteSymbolPeek) ? stack.Peek() : stack.Pop(); + int num9 = reader.ReadUInt16(); + SymbolReference symbolRef2 = symbolReferenceTable[num9]; + context.WriteSymbol(symbolRef2, value); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.ClearSymbol: + { + int num10 = reader.ReadUInt16(); + SymbolReference symbolRef3 = symbolReferenceTable[num10]; + context.ClearSymbol(symbolRef3); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.PropertyInitialize: + case OpCode.PropertyInitializeIndirect: + { + bool flag2 = opCode == OpCode.PropertyInitializeIndirect; + TypeSchema typeSchema9 = null; + if (flag2) + { + typeSchema9 = (TypeSchema)stack.Pop(); + } + int num11 = reader.ReadUInt16(); + PropertySchema propertySchema = importTables.PropertyImports[num11]; + object obj9 = stack.Pop(); + object obj10 = stack.Pop(); + ReportErrorOnNull(obj10, "Property Set", propertySchema.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + if (flag2) + { + PropertySchema propertySchema2 = typeSchema9.FindPropertyDeep(propertySchema.Name); + if (propertySchema2 != propertySchema) + { + TypeSchema propertyType = propertySchema2.PropertyType; + if (!propertyType.IsAssignableFrom(obj9)) + { + string param = TypeSchema.NameFromInstance(obj9); + ErrorManager.ReportError("Script runtime failure: Incompatible value for property '{0}' supplied (expecting values of type '{1}' but got '{2}') while constructing runtime replacement type '{3}' (original type '{4}')", propertySchema.Name, propertyType.Name, param, typeSchema9.Name, propertySchema.Owner.Name); + result = ScriptError; + } + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + } + propertySchema.SetValue(ref obj10, obj9); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj10); + } + } + break; + } + case OpCode.PropertyListAdd: + { + int propertyIndex = reader.ReadUInt16(); + object value2 = stack.Pop(); + object collection = GetCollection(stack.Peek(), importTables, propertyIndex); + ReportErrorOnNull(collection, "List Add"); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + ((IList)collection).Add(value2); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + } + } + break; + } + case OpCode.PropertyDictionaryAdd: + { + int propertyIndex2 = reader.ReadUInt16(); + int index2 = reader.ReadUInt16(); + string key = (string)constantsTable.Get(index2); + object value3 = stack.Pop(); + object collection2 = GetCollection(stack.Peek(), importTables, propertyIndex2); + ReportErrorOnNull(collection2, "Dictionary Add"); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + ((IDictionary)collection2)[key] = value3; + if (ErrorsDetected(watermark, ref result, ref flag)) + { + } + } + break; + } + case OpCode.PropertyAssign: + case OpCode.PropertyAssignStatic: + { + int num12 = reader.ReadUInt16(); + PropertySchema propertySchema3 = importTables.PropertyImports[num12]; + object instance2 = null; + if (opCode == OpCode.PropertyAssign) + { + instance2 = stack.Pop(); + ReportErrorOnNullOrDisposed(instance2, "Property Set", propertySchema3.Name, propertySchema3.Owner); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + object value4 = stack.Peek(); + propertySchema3.SetValue(ref instance2, value4); + if (!ErrorsDetected(watermark, ref result, ref flag) && Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.PropertyGet: + case OpCode.PropertyGetPeek: + case OpCode.PropertyGetStatic: + { + int num13 = reader.ReadUInt16(); + PropertySchema propertySchema4 = importTables.PropertyImports[num13]; + object instance3 = null; + if (opCode != OpCode.PropertyGetStatic) + { + instance3 = ((opCode == OpCode.PropertyGet) ? stack.Pop() : stack.Peek()); + ReportErrorOnNullOrDisposed(instance3, "Property Get", propertySchema4.Name, propertySchema4.Owner); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + object value5 = propertySchema4.GetValue(instance3); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(value5); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + break; + } + case OpCode.MethodInvoke: + case OpCode.MethodInvokePeek: + case OpCode.MethodInvokeStatic: + case OpCode.MethodInvokePushLastParam: + case OpCode.MethodInvokeStaticPushLastParam: + { + int num14 = reader.ReadUInt16(); + MethodSchema methodSchema = importTables.MethodImports[num14]; + int j = methodSchema.ParameterTypes.Length; + object[] array2 = ParameterListAllocator.Alloc(j); + for (j--; j >= 0; j--) + { + array2[j] = stack.Pop(); + } + object instance4 = null; + bool flag3 = opCode != OpCode.MethodInvokeStatic && opCode != OpCode.MethodInvokeStaticPushLastParam; + bool flag4 = opCode == OpCode.MethodInvokePeek; + bool flag5 = opCode == OpCode.MethodInvokePushLastParam || opCode == OpCode.MethodInvokeStaticPushLastParam; + if (flag3) + { + if (!flag4) + { + instance4 = stack.Pop(); + } + else + { + instance4 = stack.Peek(); + } + ReportErrorOnNullOrDisposed(instance4, "Method Invoke", methodSchema.Name, methodSchema.Owner); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + object obj11 = methodSchema.Invoke(instance4, array2); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + if (!flag5) + { + if (methodSchema.ReturnType != VoidSchema.Type) + { + stack.Push(obj11); + } + } + else + { + stack.Push(array2[array2.Length - 1]); + } + ParameterListAllocator.Free(array2); + } + break; + } + case OpCode.VerifyTypeCast: + { + int num15 = reader.ReadUInt16(); + TypeSchema typeSchema10 = importTables.TypeImports[num15]; + object obj12 = stack.Peek(); + if (obj12 != null) + { + if (!typeSchema10.IsAssignableFrom(obj12)) + { + string param2 = TypeSchema.NameFromInstance(obj12); + string name = typeSchema10.Name; + ErrorManager.ReportError("Script runtime failure: Invalid type cast while attempting to cast an instance with a runtime type of '{0}' to '{1}'", param2, name); + result = ScriptError; + } + if (ErrorsDetected(watermark, ref result, ref flag)) + { + } + } + else if (!typeSchema10.IsNullAssignable) + { + ReportErrorOnNull(obj12, "Verify Type Cast", typeSchema10.Name); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + } + } + break; + } + case OpCode.ConvertType: + { + int num16 = reader.ReadUInt16(); + TypeSchema typeSchema11 = importTables.TypeImports[num16]; + int num17 = reader.ReadUInt16(); + TypeSchema fromType = importTables.TypeImports[num17]; + object obj13 = stack.Pop(); + ReportErrorOnNull(obj13, "Type Conversion", typeSchema11.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + object obj14; + Result result2 = typeSchema11.TypeConverter(obj13, fromType, out obj14); + if (result2.Failed) + { + ErrorManager.ReportError("Script runtime failure: Type conversion failed while attempting to convert to '{0}' ({1})", typeSchema11.Name, result2.Error); + } + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj14); + } + } + break; + } + case OpCode.Operation: + { + int num18 = reader.ReadUInt16(); + TypeSchema typeSchema12 = importTables.TypeImports[num18]; + OperationType op = (OperationType)reader.ReadByte(); + object right = null; + if (!TypeSchema.IsUnaryOperation(op)) + { + right = stack.Pop(); + } + object left = stack.Pop(); + object obj15 = typeSchema12.PerformOperationDeep(left, right, op); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj15); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + break; + } + case OpCode.IsCheck: + { + int num19 = reader.ReadUInt16(); + TypeSchema typeSchema13 = importTables.TypeImports[num19]; + object obj16 = stack.Pop(); + bool value6 = false; + if (obj16 != null) + { + value6 = typeSchema13.IsAssignableFrom(obj16); + } + stack.Push(BooleanBoxes.Box(value6)); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.As: + { + int num20 = reader.ReadUInt16(); + TypeSchema typeSchema14 = importTables.TypeImports[num20]; + object obj17 = stack.Peek(); + if (obj17 != null && !typeSchema14.IsAssignableFrom(obj17)) + { + stack.Pop(); + stack.Push(null); + } + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.TypeOf: + { + int num21 = reader.ReadUInt16(); + TypeSchema obj18 = importTables.TypeImports[num21]; + stack.Push(obj18); + break; + } + case OpCode.PushNull: + stack.Push(null); + break; + case OpCode.PushConstant: + { + int index3 = reader.ReadUInt16(); + object obj19 = constantsTable.Get(index3); + stack.Push(obj19); + break; + } + case OpCode.PushThis: + stack.Push(instance); + break; + case OpCode.DiscardValue: + stack.Pop(); + break; + case OpCode.ReturnValue: + { + object obj20 = stack.Pop(); + result = obj20; + flag = true; + break; + } + case OpCode.ReturnVoid: + result = VoidReturnValue; + flag = true; + break; + case OpCode.JumpIfFalse: + case OpCode.JumpIfFalsePeek: + case OpCode.JumpIfTruePeek: + { + uint currentOffset = reader.ReadUInt32(); + object obj21 = (opCode == OpCode.JumpIfFalse) ? stack.Pop() : stack.Peek(); + bool flag6 = (bool)obj21; + bool flag7 = opCode == OpCode.JumpIfTruePeek; + Trace.IsCategoryEnabled(TraceCategory.Markup); + if (flag7 == flag6) + { + reader.CurrentOffset = currentOffset; + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + break; + } + case OpCode.JumpIfDictionaryContains: + { + ushort propertyIndex3 = reader.ReadUInt16(); + ushort index4 = reader.ReadUInt16(); + uint currentOffset2 = reader.ReadUInt32(); + string key2 = (string)constantsTable.Get(index4); + object collection3 = GetCollection(stack.Peek(), importTables, propertyIndex3); + ReportErrorOnNull(collection3, "Dictionary Contains"); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + bool flag8 = ((IDictionary)collection3).Contains(key2); + Trace.IsCategoryEnabled(TraceCategory.Markup); + if (flag8) + { + reader.CurrentOffset = currentOffset2; + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + } + break; + } + case OpCode.JumpIfNullPeek: + { + uint currentOffset3 = reader.ReadUInt32(); + object obj22 = stack.Peek(); + Trace.IsCategoryEnabled(TraceCategory.Markup); + if (obj22 == null) + { + reader.CurrentOffset = currentOffset3; + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + break; + } + case OpCode.Jump: + { + uint currentOffset4 = reader.ReadUInt32(); + reader.CurrentOffset = currentOffset4; + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.ConstructListenerStorage: + { + int listenerCount = reader.ReadUInt16(); + if (instance.Listeners == null) + { + MarkupListeners markupListeners = new MarkupListeners(listenerCount); + markupListeners.DeclareOwner(instance); + instance.Listeners = markupListeners; + } + else + { + instance.Listeners.AddEntries(listenerCount); + } + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.Listen: + case OpCode.DestructiveListen: + { + int index5 = reader.ReadUInt16(); + ListenerType listenerType = (ListenerType)reader.ReadByte(); + int num22 = reader.ReadUInt16(); + uint scriptOffset = reader.ReadUInt32(); + uint refreshOffset = uint.MaxValue; + if (opCode == OpCode.DestructiveListen) + { + refreshOffset = reader.ReadUInt32(); + } + string watch = null; + switch (listenerType) + { + case ListenerType.Property: + watch = importTables.PropertyImports[num22].Name; + break; + case ListenerType.Event: + watch = importTables.EventImports[num22].Name; + break; + case ListenerType.Symbol: + watch = symbolReferenceTable[num22].Symbol; + break; + } + object obj23 = stack.Peek(); + if (obj23 != null) + { + INotifyObject notifier = (INotifyObject)obj23; + Trace.IsCategoryEnabled(TraceCategory.Markup); + MarkupListeners listeners = instance.Listeners; + listeners.RefreshListener(index5, notifier, watch, instance, scriptOffset, refreshOffset); + } + else + { + Trace.IsCategoryEnabled(TraceCategory.Markup); + } + break; + } + case OpCode.EnterDebugState: + { + int breakpointIndex = reader.ReadInt32(); + if (MarkupSystem.IsDebuggingEnabled(2)) + { + wasInDebugState = MarkupDebugHelper.EnterDebugState(wasInDebugState, loadResult, breakpointIndex, instance.Storage); + } + break; + } + } + } + while (stack.Count > count) + { + stack.Pop(); + } + return result; + } + + // Token: 0x06000F23 RID: 3875 RVA: 0x0002ADA7 File Offset: 0x00029DA7 + private static bool ErrorsDetected(ErrorWatermark watermark, ref object result, ref bool done) + { + if (watermark.ErrorsDetected) + { + result = ScriptError; + done = true; + return true; + } + return false; + } + + // Token: 0x06000F24 RID: 3876 RVA: 0x0002ADC0 File Offset: 0x00029DC0 + private static void RegisterDisposable(object instance, TypeSchema type, IMarkupTypeBase root) + { + if (type.Disposable && root != null) + { + IDisposableObject disposableObject = (IDisposableObject)instance; + root.RegisterDisposable(disposableObject); + disposableObject.DeclareOwner(root); + } + } + + // Token: 0x06000F25 RID: 3877 RVA: 0x0002ADF0 File Offset: 0x00029DF0 + private static object GetCollection(object stackInstance, MarkupImportTables importTables, int propertyIndex) + { + object result = null; + if (propertyIndex == 65535) + { + result = stackInstance; + } + else + { + PropertySchema propertySchema = importTables.PropertyImports[propertyIndex]; + ReportErrorOnNull(stackInstance, "Property Get", propertySchema.Name); + if (stackInstance != null) + { + result = propertySchema.GetValue(stackInstance); + } + } + return result; + } + + // Token: 0x06000F26 RID: 3878 RVA: 0x0002AE31 File Offset: 0x00029E31 + private static void ReportErrorOnNull(object instance, string operation, string member) + { + if (instance == null) + { + ErrorManager.ReportError("Script runtime failure: Null-reference while attempting a '{0}' of '{1}' on a null instance", operation, member); + } + } + + // Token: 0x06000F27 RID: 3879 RVA: 0x0002AE42 File Offset: 0x00029E42 + private static void ReportErrorOnNull(object instance, string operation) + { + if (instance == null) + { + ErrorManager.ReportError("Script runtime failure: Null-reference while attempting a '{0}'", operation); + } + } + + // Token: 0x06000F28 RID: 3880 RVA: 0x0002AE54 File Offset: 0x00029E54 + private static void ReportErrorOnNullOrDisposed(object instance, string operation, string member, TypeSchema typeSchema) + { + if (instance == null) + { + ErrorManager.ReportError("Script runtime failure: Null-reference while attempting a '{0}' of '{1}' on a null instance", operation, member); + return; + } + if (typeSchema.Disposable) + { + IDisposableObject disposableObject = (IDisposableObject)instance; + if (disposableObject.IsDisposed) + { + ErrorManager.ReportError("Script runtime failure: Attempting a '{0}' of '{1}' on an object '{2}' that has already been disposed", operation, member, TypeSchema.NameFromInstance(instance)); + } + } + } + + // Token: 0x04000947 RID: 2375 + public const uint InvalidOffset = 4294967295U; + + // Token: 0x04000948 RID: 2376 + private static object VoidReturnValue = new object(); + + // Token: 0x04000949 RID: 2377 + private static Stack _stack = new Stack(); + private static Stack _xmlStack = new Stack(); + + // Token: 0x0400094A RID: 2378 + public static object ScriptError = new Interpreter.ScriptErrorObject(); + + // Token: 0x0400094B RID: 2379 + public static string ExceptionContext; + + // Token: 0x0200018C RID: 396 + private class ScriptErrorObject + { + } + + // Token: 0x0200018D RID: 397 + private struct ParameterListAllocator + { + // Token: 0x06000F2C RID: 3884 RVA: 0x0002AECC File Offset: 0x00029ECC + public static object[] Alloc(int count) + { + object[] array; + if (count == 0) + { + array = s_params0; + } + else if (count < 20) + { + array = s_cachedLists[count]; + if (array != null) + { + s_cachedLists[count] = null; + } + else + { + array = new object[count]; + } + } + else + { + array = new object[count]; + } + return array; + } + + // Token: 0x06000F2D RID: 3885 RVA: 0x0002AF10 File Offset: 0x00029F10 + public static void Free(object[] paramList) + { + int num = paramList.Length; + if (num != 0 && num < 20 && s_cachedLists[num] == null) + { + Array.Clear(paramList, 0, paramList.Length); + s_cachedLists[num] = paramList; + } + } + + // Token: 0x0400094C RID: 2380 + private const int MAX_CACHED_LIST_SIZE = 20; + + // Token: 0x0400094D RID: 2381 + private static object[] s_params0 = new object[0]; + + // Token: 0x0400094E RID: 2382 + private static object[][] s_cachedLists = new object[20][]; + } + + private static XmlElement UIXElem; + + private static XmlDocument _xmlDoc; + public static XmlDocument XmlDoc + { + get + { + if (_xmlDoc == null) + { + _xmlDoc = new XmlDocument(); + UIXElem = _xmlDoc.CreateElement("UIX"); + UIXElem.SetAttribute("xmlns", "http://schemas.microsoft.com/2007/uix"); + _xmlDoc.AppendChild(UIXElem); + } + return _xmlDoc; + } + } + + public static System.Collections.Generic.List ExecutedOpCodes { get; set; } + = new System.Collections.Generic.List(); + + /// + /// Attempts to generate source UIX from a compiled result + /// + private static object RunDecompile(InterpreterContext context, ByteCodeReader reader) + { + MarkupLoadResult loadResult = context.LoadResult; + IMarkupTypeBase instance = context.Instance; + MarkupImportTables importTables = loadResult.ImportTables; + MarkupConstantsTable constantsTable = loadResult.ConstantsTable; + SymbolReference[] symbolReferenceTable = context.MarkupType.SymbolReferenceTable; + Trace.IsCategoryEnabled(TraceCategory.Markup); + Stack stack = _stack; + Stack xmlStack = _xmlStack; + int count = stack.Count; + if (instance != null) + { + stack.Push(instance); + + // Make sure XmlDoc has been initialized + _ = XmlDoc; + + // Add UI container to root + string key = instance.TypeSchema.Name; + XmlElement instanceXml = UIXElem.ChildNodes.OfType() + .FirstOrDefault(elem => elem?.GetAttribute("Name") == key); + if (instanceXml == null) + { + instanceXml = XmlDoc.CreateElement("UI"); + instanceXml.SetAttribute("Name", key); + UIXElem.AppendChild(instanceXml); + } + xmlStack.Push(instanceXml); + } + ErrorWatermark watermark = ErrorManager.Watermark; + bool flag = false; + object result = null; + bool wasInDebugState = false; + while (!flag) + { + OpCode opCode = (OpCode)reader.ReadByte(); + ExecutedOpCodes.Add(opCode); + switch (opCode) + { + case OpCode.ConstructObject: + { + int num = reader.ReadUInt16(); + TypeSchema typeSchema = importTables.TypeImports[num]; + object obj = typeSchema.ConstructDefault(); + + string typeName = obj.GetType().Name; + int idxTilde = typeName.IndexOf('`'); + if (idxTilde >= 0) + typeName = typeName.Substring(0, idxTilde); + var objXml = XmlDoc.CreateElement(typeName); + + ReportErrorOnNull(obj, "Construction", typeSchema.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj, typeSchema, instance); + stack.Push(obj); + xmlStack.Push(objXml); + } + break; + } + case OpCode.ConstructObjectIndirect: + { + int num2 = reader.ReadUInt16(); + TypeSchema typeSchema2 = importTables.TypeImports[num2]; + TypeSchema typeSchema3 = (TypeSchema)stack.Pop(); + TypeSchema typeSchemaXml3 = (TypeSchema)xmlStack.Pop(); + if (!typeSchema2.IsAssignableFrom(typeSchema3)) + { + ErrorManager.ReportError("Script runtime failure: Dynamic construction type override failed. Attempting to construct '{0}' in place of '{1}'", (typeSchema3 != null) ? typeSchema3.Name : "null", typeSchema2.Name); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + IDynamicConstructionSchema dynamicConstructionSchema = typeSchema3 as IDynamicConstructionSchema; + object obj2; + if (dynamicConstructionSchema != null) + { + obj2 = dynamicConstructionSchema.ConstructDefault(typeSchema2); + } + else + { + obj2 = typeSchema3.ConstructDefault(); + } + var objXml2 = XmlDoc.CreateElement(obj2.GetType().Name); + ReportErrorOnNull(obj2, "Construction", typeSchema3.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj2, typeSchema3, instance); + stack.Push(obj2); + xmlStack.Push(objXml2); + } + break; + } + case OpCode.ConstructObjectParam: + { + int num3 = reader.ReadUInt16(); + TypeSchema typeSchema4 = importTables.TypeImports[num3]; + int num4 = reader.ReadUInt16(); + ConstructorSchema constructorSchema = importTables.ConstructorImports[num4]; + int i = constructorSchema.ParameterTypes.Length; + object[] array = ParameterListAllocator.Alloc(i); + for (i--; i >= 0; i--) + { + array[i] = stack.Pop(); + xmlStack.Pop(); // TODO + } + object obj3 = constructorSchema.Construct(array); + var objXml3 = XmlDoc.CreateElement(obj3.GetType().Name); + ReportErrorOnNull(obj3, "Construction", typeSchema4.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj3, typeSchema4, instance); + stack.Push(obj3); + xmlStack.Push(objXml3); + ParameterListAllocator.Free(array); + } + break; + } + case OpCode.ConstructFromString: + { + int num5 = reader.ReadUInt16(); + TypeSchema typeSchema5 = importTables.TypeImports[num5]; + int index = reader.ReadUInt16(); + string from = (string)constantsTable.Get(index); + object obj4; + typeSchema5.TypeConverter(from, StringSchema.Type, out obj4); + var objXml4 = XmlDoc.CreateElement(obj4.GetType().Name); + ReportErrorOnNull(obj4, "Construction", typeSchema5.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj4, typeSchema5, instance); + stack.Push(obj4); + xmlStack.Push(objXml4); + } + break; + } + case OpCode.ConstructFromBinary: + { + int num6 = reader.ReadUInt16(); + TypeSchema typeSchema6 = importTables.TypeImports[num6]; + object obj5 = typeSchema6.DecodeBinary(reader); + var objXml5 = XmlDoc.CreateElement(obj5.GetType().Name); + ReportErrorOnNull(obj5, "Construction", typeSchema6.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + RegisterDisposable(obj5, typeSchema6, instance); + stack.Push(obj5); + xmlStack.Push(objXml5); + } + break; + } + case OpCode.InitializeInstance: + { + int num7 = reader.ReadUInt16(); + TypeSchema typeSchema7 = importTables.TypeImports[num7]; + object obj6 = stack.Pop(); + var objXml6 = (XmlElement)xmlStack.Pop(); + typeSchema7.InitializeInstance(ref obj6); + objXml6.SetAttribute("Name", typeSchema7.Name); + ReportErrorOnNull(obj6, "Initialize", typeSchema7.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj6); + xmlStack.Push(objXml6); + } + break; + } + case OpCode.InitializeInstanceIndirect: + { + TypeSchema typeSchema8 = (TypeSchema)stack.Pop(); + object obj7 = stack.Pop(); + typeSchema8.InitializeInstance(ref obj7); + var objXml7 = (XmlElement)xmlStack.Pop(); + objXml7.SetAttribute("Name", typeSchema8.Name); + ReportErrorOnNull(obj7, "Initialize", typeSchema8.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj7); + xmlStack.Push(objXml7); + } + break; + } + case OpCode.LookupSymbol: + { + int num8 = reader.ReadUInt16(); + SymbolReference symbolRef = symbolReferenceTable[num8]; + object obj8 = context.ReadSymbol(symbolRef); + var objXml8 = XmlDoc.CreateElement(obj8.GetType().Name); + stack.Push(obj8); + xmlStack.Push(objXml8); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.WriteSymbol: + case OpCode.WriteSymbolPeek: + { + object value = (opCode == OpCode.WriteSymbolPeek) ? stack.Peek() : stack.Pop(); + int num9 = reader.ReadUInt16(); + SymbolReference symbolRef2 = symbolReferenceTable[num9]; + context.WriteSymbol(symbolRef2, value); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.ClearSymbol: + { + int num10 = reader.ReadUInt16(); + SymbolReference symbolRef3 = symbolReferenceTable[num10]; + context.ClearSymbol(symbolRef3); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.PropertyInitialize: + case OpCode.PropertyInitializeIndirect: + { + bool isPropInitIndirect = opCode == OpCode.PropertyInitializeIndirect; + TypeSchema typeSchema9 = null; + if (isPropInitIndirect) + { + typeSchema9 = (TypeSchema)stack.Pop(); + } + int num11 = reader.ReadUInt16(); + PropertySchema propertySchema = importTables.PropertyImports[num11]; + object propValue = stack.Pop(); + object destObj = stack.Pop(); + object propValueXml = xmlStack.Pop(); + var destObjXml = (XmlElement)xmlStack.Pop(); + ReportErrorOnNull(destObj, "Property Set", propertySchema.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + if (isPropInitIndirect) + { + PropertySchema propertySchema2 = typeSchema9.FindPropertyDeep(propertySchema.Name); + if (propertySchema2 != propertySchema) + { + TypeSchema propertyType = propertySchema2.PropertyType; + if (!propertyType.IsAssignableFrom(propValue)) + { + string param = TypeSchema.NameFromInstance(propValue); + ErrorManager.ReportError("Script runtime failure: Incompatible value for property '{0}' supplied (expecting values of type '{1}' but got '{2}') while constructing runtime replacement type '{3}' (original type '{4}')", propertySchema.Name, propertyType.Name, param, typeSchema9.Name, propertySchema.Owner.Name); + result = ScriptError; + } + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + } + propertySchema.SetValue(ref destObj, propValue); + if (propValueXml is XmlElement propValueXmlElem) + { + var propXmlElem = XmlDoc.CreateElement(propertySchema.Name); + propXmlElem.AppendChild(propValueXmlElem); + destObjXml.AppendChild(propXmlElem); + } + else + { + destObjXml.SetAttribute(propertySchema.Name, propValueXml.ToString()); + } + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(destObj); + xmlStack.Push(destObjXml); + } + } + break; + } + case OpCode.PropertyListAdd: + { + int propertyIndex = reader.ReadUInt16(); + object value2 = stack.Pop(); + XmlElement valueXml2 = (XmlElement)xmlStack.Pop(); + object collection = GetCollectionDecompile(stack.Peek(), importTables, propertyIndex, out var propertySchema); + ReportErrorOnNull(collection, "List Add"); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + ((IList)collection).Add(value2); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + } + + // Add value to list + var destObjXml = (XmlElement)xmlStack.Peek(); + // Create element if needed + if (!(destObjXml.SelectSingleNode(propertySchema.Name) is XmlElement propXmlElem2)) + { + propXmlElem2 = XmlDoc.CreateElement(propertySchema.Name); + destObjXml.AppendChild(propXmlElem2); + } + propXmlElem2.AppendChild(valueXml2); + } + break; + } + case OpCode.PropertyDictionaryAdd: + { + int propertyIndex2 = reader.ReadUInt16(); + int index2 = reader.ReadUInt16(); + string key = (string)constantsTable.Get(index2); + object value3 = stack.Pop(); + XmlElement valueXml3 = (XmlElement)xmlStack.Pop(); + object collection2 = GetCollectionDecompile(stack.Peek(), importTables, propertyIndex2, out var propertySchema2); + ReportErrorOnNull(collection2, "Dictionary Add"); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + ((IDictionary)collection2)[key] = value3; + if (ErrorsDetected(watermark, ref result, ref flag)) + { + } + + // Add value to dictionary + var destObjXml2 = (XmlElement)xmlStack.Peek(); + // Create element if needed + if (propertySchema2 != null) + { + XmlElement propXmlElem2 = destObjXml2.SelectSingleNode(propertySchema2.Name) as XmlElement; + if (propXmlElem2 == null) + { + propXmlElem2 = XmlDoc.CreateElement(propertySchema2.Name); + destObjXml2.AppendChild(propXmlElem2); + } + propXmlElem2.AppendChild(valueXml3); + } + valueXml3.SetAttribute("Name", key); + } + break; + } + case OpCode.PropertyAssign: + case OpCode.PropertyAssignStatic: + { + int num12 = reader.ReadUInt16(); + PropertySchema propertySchema3 = importTables.PropertyImports[num12]; + object instance2 = null; + if (opCode == OpCode.PropertyAssign) + { + instance2 = stack.Pop(); + ReportErrorOnNullOrDisposed(instance2, "Property Set", propertySchema3.Name, propertySchema3.Owner); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + object value4 = stack.Peek(); + propertySchema3.SetValue(ref instance2, value4); + if (!ErrorsDetected(watermark, ref result, ref flag) && Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.PropertyGet: + case OpCode.PropertyGetPeek: + case OpCode.PropertyGetStatic: + { + int num13 = reader.ReadUInt16(); + PropertySchema propertySchema4 = importTables.PropertyImports[num13]; + object instance3 = null; + if (opCode != OpCode.PropertyGetStatic) + { + instance3 = ((opCode == OpCode.PropertyGet) ? stack.Pop() : stack.Peek()); + ReportErrorOnNullOrDisposed(instance3, "Property Get", propertySchema4.Name, propertySchema4.Owner); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + object value5 = propertySchema4.GetValue(instance3); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(value5); + xmlStack.Push(GenerateXmlRepresentation(value5)); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + break; + } + case OpCode.MethodInvoke: + case OpCode.MethodInvokePeek: + case OpCode.MethodInvokeStatic: + case OpCode.MethodInvokePushLastParam: + case OpCode.MethodInvokeStaticPushLastParam: + { + int num14 = reader.ReadUInt16(); + MethodSchema methodSchema = importTables.MethodImports[num14]; + int j = methodSchema.ParameterTypes.Length; + object[] array2 = ParameterListAllocator.Alloc(j); + for (j--; j >= 0; j--) + { + array2[j] = stack.Pop(); + } + object instance4 = null; + bool flag3 = opCode != OpCode.MethodInvokeStatic && opCode != OpCode.MethodInvokeStaticPushLastParam; + bool flag4 = opCode == OpCode.MethodInvokePeek; + bool flag5 = opCode == OpCode.MethodInvokePushLastParam || opCode == OpCode.MethodInvokeStaticPushLastParam; + if (flag3) + { + if (!flag4) + { + instance4 = stack.Pop(); + } + else + { + instance4 = stack.Peek(); + } + ReportErrorOnNullOrDisposed(instance4, "Method Invoke", methodSchema.Name, methodSchema.Owner); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + break; + } + } + object obj11 = methodSchema.Invoke(instance4, array2); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + if (!flag5) + { + if (methodSchema.ReturnType != VoidSchema.Type) + { + stack.Push(obj11); + } + } + else + { + stack.Push(array2[array2.Length - 1]); + } + ParameterListAllocator.Free(array2); + } + break; + } + case OpCode.VerifyTypeCast: + { + int num15 = reader.ReadUInt16(); + TypeSchema typeSchema10 = importTables.TypeImports[num15]; + object obj12 = stack.Peek(); + if (obj12 != null) + { + if (!typeSchema10.IsAssignableFrom(obj12)) + { + string param2 = TypeSchema.NameFromInstance(obj12); + string name = typeSchema10.Name; + ErrorManager.ReportError("Script runtime failure: Invalid type cast while attempting to cast an instance with a runtime type of '{0}' to '{1}'", param2, name); + result = ScriptError; + } + if (ErrorsDetected(watermark, ref result, ref flag)) + { + } + } + else if (!typeSchema10.IsNullAssignable) + { + ReportErrorOnNull(obj12, "Verify Type Cast", typeSchema10.Name); + if (ErrorsDetected(watermark, ref result, ref flag)) + { + } + } + break; + } + case OpCode.ConvertType: + { + int num16 = reader.ReadUInt16(); + TypeSchema typeSchema11 = importTables.TypeImports[num16]; + int num17 = reader.ReadUInt16(); + TypeSchema fromType = importTables.TypeImports[num17]; + object obj13 = stack.Pop(); + ReportErrorOnNull(obj13, "Type Conversion", typeSchema11.Name); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + object obj14; + Result result2 = typeSchema11.TypeConverter(obj13, fromType, out obj14); + if (result2.Failed) + { + ErrorManager.ReportError("Script runtime failure: Type conversion failed while attempting to convert to '{0}' ({1})", typeSchema11.Name, result2.Error); + } + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj14); + } + } + break; + } + case OpCode.Operation: + { + int num18 = reader.ReadUInt16(); + TypeSchema typeSchema12 = importTables.TypeImports[num18]; + OperationType op = (OperationType)reader.ReadByte(); + object right = null; + if (!TypeSchema.IsUnaryOperation(op)) + { + right = stack.Pop(); + } + object left = stack.Pop(); + object obj15 = typeSchema12.PerformOperationDeep(left, right, op); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + stack.Push(obj15); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + break; + } + case OpCode.IsCheck: + { + int num19 = reader.ReadUInt16(); + TypeSchema typeSchema13 = importTables.TypeImports[num19]; + object obj16 = stack.Pop(); + bool value6 = false; + if (obj16 != null) + { + value6 = typeSchema13.IsAssignableFrom(obj16); + } + stack.Push(BooleanBoxes.Box(value6)); + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.As: + { + int num20 = reader.ReadUInt16(); + TypeSchema typeSchema14 = importTables.TypeImports[num20]; + object obj17 = stack.Peek(); + if (obj17 != null && !typeSchema14.IsAssignableFrom(obj17)) + { + stack.Pop(); + stack.Push(null); + } + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.TypeOf: + { + int num21 = reader.ReadUInt16(); + TypeSchema obj18 = importTables.TypeImports[num21]; + stack.Push(obj18); + break; + } + case OpCode.PushNull: + stack.Push(null); + break; + case OpCode.PushConstant: + { + int index3 = reader.ReadUInt16(); + object obj19 = constantsTable.Get(index3); + stack.Push(obj19); + xmlStack.Push(GenerateXmlRepresentation(obj19)); + break; + } + case OpCode.PushThis: + stack.Push(instance); + xmlStack.Push(GenerateXmlRepresentation(instance)); + break; + case OpCode.DiscardValue: + stack.Pop(); + break; + case OpCode.ReturnValue: + { + object obj20 = stack.Pop(); + result = obj20; + flag = true; + break; + } + case OpCode.ReturnVoid: + result = VoidReturnValue; + flag = true; + break; + case OpCode.JumpIfFalse: + case OpCode.JumpIfFalsePeek: + case OpCode.JumpIfTruePeek: + { + uint currentOffset = reader.ReadUInt32(); + object obj21 = (opCode == OpCode.JumpIfFalse) ? stack.Pop() : stack.Peek(); + bool flag6 = (bool)obj21; + bool flag7 = opCode == OpCode.JumpIfTruePeek; + Trace.IsCategoryEnabled(TraceCategory.Markup); + if (flag7 == flag6) + { + reader.CurrentOffset = currentOffset; + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + break; + } + case OpCode.JumpIfDictionaryContains: + { + ushort propertyIndex3 = reader.ReadUInt16(); + ushort index4 = reader.ReadUInt16(); + uint currentOffset2 = reader.ReadUInt32(); + string key2 = (string)constantsTable.Get(index4); + object collection3 = GetCollection(stack.Peek(), importTables, propertyIndex3); + ReportErrorOnNull(collection3, "Dictionary Contains"); + if (!ErrorsDetected(watermark, ref result, ref flag)) + { + bool flag8 = ((IDictionary)collection3).Contains(key2); + Trace.IsCategoryEnabled(TraceCategory.Markup); + if (flag8) + { + reader.CurrentOffset = currentOffset2; + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + } + break; + } + case OpCode.JumpIfNullPeek: + { + uint currentOffset3 = reader.ReadUInt32(); + object obj22 = stack.Peek(); + Trace.IsCategoryEnabled(TraceCategory.Markup); + if (obj22 == null) + { + reader.CurrentOffset = currentOffset3; + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + } + break; + } + case OpCode.Jump: + { + uint currentOffset4 = reader.ReadUInt32(); + reader.CurrentOffset = currentOffset4; + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.ConstructListenerStorage: + { + int listenerCount = reader.ReadUInt16(); + if (instance.Listeners == null) + { + MarkupListeners markupListeners = new MarkupListeners(listenerCount); + markupListeners.DeclareOwner(instance); + instance.Listeners = markupListeners; + } + else + { + instance.Listeners.AddEntries(listenerCount); + } + if (Trace.IsCategoryEnabled(TraceCategory.Markup)) + { + } + break; + } + case OpCode.Listen: + case OpCode.DestructiveListen: + { + int index5 = reader.ReadUInt16(); + ListenerType listenerType = (ListenerType)reader.ReadByte(); + int num22 = reader.ReadUInt16(); + uint scriptOffset = reader.ReadUInt32(); + uint refreshOffset = uint.MaxValue; + if (opCode == OpCode.DestructiveListen) + { + refreshOffset = reader.ReadUInt32(); + } + string watch = null; + switch (listenerType) + { + case ListenerType.Property: + watch = importTables.PropertyImports[num22].Name; + break; + case ListenerType.Event: + watch = importTables.EventImports[num22].Name; + break; + case ListenerType.Symbol: + watch = symbolReferenceTable[num22].Symbol; + break; + } + object obj23 = stack.Peek(); + if (obj23 != null) + { + INotifyObject notifier = (INotifyObject)obj23; + Trace.IsCategoryEnabled(TraceCategory.Markup); + MarkupListeners listeners = instance.Listeners; + listeners.RefreshListener(index5, notifier, watch, instance, scriptOffset, refreshOffset); + } + else + { + Trace.IsCategoryEnabled(TraceCategory.Markup); + } + break; + } + case OpCode.EnterDebugState: + { + int breakpointIndex = reader.ReadInt32(); + if (MarkupSystem.IsDebuggingEnabled(2)) + { + wasInDebugState = MarkupDebugHelper.EnterDebugState(wasInDebugState, loadResult, breakpointIndex, instance.Storage); + } + break; + } + } + + if (stack.Count != xmlStack.Count) + throw new InvalidOperationException( + $"Invalid stacks, stack:{stack.Count} != xmlStack{xmlStack.Count}! " + + $"Check implementations for {opCode} and {ExecutedOpCodes[ExecutedOpCodes.Count - 2]}"); + } + while (stack.Count > count) + { + stack.Pop(); + xmlStack.Pop(); + } + + CleanUpXmlDoc(); + InterpreterContext.DecompileResults.Add(XmlDoc); + return result; + } + + // Token: 0x06000F25 RID: 3877 RVA: 0x0002ADF0 File Offset: 0x00029DF0 + private static object GetCollectionDecompile(object stackInstance, MarkupImportTables importTables, int propertyIndex, out PropertySchema prop) + { + object result = null; + prop = null; + if (propertyIndex == 65535) + { + result = stackInstance; + } + else + { + PropertySchema propertySchema = importTables.PropertyImports[propertyIndex]; + ReportErrorOnNull(stackInstance, "Property Get", propertySchema.Name); + if (stackInstance != null) + { + result = propertySchema.GetValue(stackInstance); + prop = propertySchema; + } + } + return result; + } + + private static object GenerateXmlRepresentation(object obj) + { + var objType = obj.GetType(); + if (objType.IsPrimitive || objType.IsEnum || objType == typeof(string)) + return obj; + else + { + var objXml = XmlDoc.CreateElement(objType.Name); + // Use reflection to recursively generate XML representations for each property + foreach (System.Reflection.PropertyInfo prop in objType.GetProperties()) + { + if (!prop.CanWrite) + continue; + + object value = prop.GetValue(obj, null); + object defaultValue = prop.PropertyType.IsValueType ? Activator.CreateInstance(prop.PropertyType) : null; + if (value.Equals(defaultValue)) + continue; + + var propValue = GenerateXmlRepresentation(value); + if (propValue is XmlElement propValueXml) + { + var propXml = XmlDoc.CreateElement(prop.Name); + propXml.AppendChild(propValueXml); + objXml.AppendChild(propXml); + } + else + { + // Primitive type, set as attribute + objXml.SetAttribute(prop.Name, propValue.ToString()); + } + } + return objXml; + } + } + + private static void CleanUpXmlDoc() + { + XmlNamespaceManager nsManager = new XmlNamespaceManager(XmlDoc.NameTable); + var hosts = XmlDoc.DocumentElement.SelectNodes("*//Host", nsManager); + foreach (XmlNode node in hosts) + { + if (!(node is XmlElement host)) + continue; + + if (host.Attributes.Count == 1 && host.HasAttribute("Name")) + { + string uiElemName = host.GetAttribute("Name"); + nsManager.AddNamespace("me", "Me"); + XmlDoc.DocumentElement.SetAttribute("xmlns:me", "Me"); + + XmlElement uiElem = XmlDoc.CreateElement("me", uiElemName, "Me"); + host.ParentNode.ReplaceChild(uiElem, host); + } + } + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/InterpreterContext.cs b/UIX/Microsoft/Iris/Markup/InterpreterContext.cs new file mode 100644 index 0000000..84e9d83 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/InterpreterContext.cs @@ -0,0 +1,129 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.InterpreterContext +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Iris.Markup +{ + internal class InterpreterContext : IErrorContextSource + { + private MarkupTypeSchema _type; + private IMarkupTypeBase _instance; + private MarkupLoadResult _loadResult; + private uint _initialBytecodeOffset; + private ParameterContext _parameterContext; + private Map _scopedLocals; + private static Stack s_cache = new Stack(); + public static bool UseDecompile = false; + public static List DecompileResults = new List(); + + private InterpreterContext() + { + } + + string IErrorContextSource.GetErrorContextDescription() => _type.Owner.ErrorContextUri; + + void IErrorContextSource.GetErrorPosition(ref int line, ref int column) + { + uint currentOffset = _loadResult.ObjectSection.CurrentOffset; + if (currentOffset > 0U) + --currentOffset; + _loadResult.LineNumberTable.Lookup(currentOffset, out line, out column); + } + + public IMarkupTypeBase Instance => _instance; + + public MarkupTypeSchema MarkupType => _type; + + public uint InitialBytecodeOffset => _initialBytecodeOffset; + + public MarkupLoadResult LoadResult => _loadResult; + + public object ReadSymbol(SymbolReference symbolRef) + { + object obj = null; + switch (symbolRef.Origin) + { + case SymbolOrigin.ScopedLocal: + _scopedLocals.TryGetValue(symbolRef.Symbol, out obj); + break; + case SymbolOrigin.Parameter: + obj = _parameterContext.ReadParameter(symbolRef.Symbol); + break; + default: + obj = _instance.ReadSymbol(symbolRef); + break; + } + return obj; + } + + public void WriteSymbol(SymbolReference symbolRef, object value) + { + switch (symbolRef.Origin) + { + case SymbolOrigin.ScopedLocal: + if (_scopedLocals == null) + _scopedLocals = new Map(); + _scopedLocals[symbolRef.Symbol] = value; + break; + case SymbolOrigin.Parameter: + _parameterContext.WriteParameter(symbolRef.Symbol, value); + break; + default: + _instance.WriteSymbol(symbolRef, value); + break; + } + } + + public void ClearSymbol(SymbolReference symbolRef) + { + if (symbolRef.Origin != SymbolOrigin.ScopedLocal) + return; + _scopedLocals.Remove(symbolRef.Symbol); + } + + public static InterpreterContext Acquire( + IMarkupTypeBase instance, + MarkupTypeSchema type, + uint initialBytecodeOffset, + ParameterContext parameterContext) + { + InterpreterContext interpreterContext = null; + if (s_cache.Count != 0) + interpreterContext = (InterpreterContext)s_cache.Pop(); + if (interpreterContext == null) + interpreterContext = new InterpreterContext(); + interpreterContext._instance = instance; + interpreterContext._initialBytecodeOffset = initialBytecodeOffset; + interpreterContext._type = type; + interpreterContext._loadResult = (MarkupLoadResult)type.Owner; + interpreterContext._parameterContext = parameterContext; + return interpreterContext; + } + + public static void Release(InterpreterContext context) + { + context._instance = null; + context._type = null; + context._loadResult = null; + context._initialBytecodeOffset = 0U; + context._parameterContext = new ParameterContext(null, null); + if (context._scopedLocals != null) + context._scopedLocals.Clear(); + s_cache.Push(context); + } + + public override string ToString() + { + int line = 0; + int column = 0; + ((IErrorContextSource)this).GetErrorPosition(ref line, ref column); + return string.Format("{0} ({1}, {2})", ((IErrorContextSource)this).GetErrorContextDescription(), line, column); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/InvokeHandler.cs b/UIX/Microsoft/Iris/Markup/InvokeHandler.cs new file mode 100644 index 0000000..cfdc4c4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/InvokeHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.InvokeHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate object InvokeHandler(object instance, object[] parameters); +} diff --git a/UIX/Microsoft/Iris/Markup/Listener.cs b/UIX/Microsoft/Iris/Markup/Listener.cs new file mode 100644 index 0000000..c3a7248 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/Listener.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.Listener +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class Listener : ListenerNodeBase + { + protected string _watch; + + public string Watch => _watch; + + public override void Dispose() + { + _watch = null; + base.Dispose(); + } + + public virtual void OnNotify() + { + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/ListenerEncodeMode.cs b/UIX/Microsoft/Iris/Markup/ListenerEncodeMode.cs new file mode 100644 index 0000000..e14f781 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ListenerEncodeMode.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ListenerEncodeMode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.Validation; + +namespace Microsoft.Iris.Markup +{ + internal class ListenerEncodeMode + { + public TriggerRecord TriggerContainer; + private uint _totalListenersOnBaseType; + private MarkupTypeSchema _typeSchema; + + public ListenerEncodeMode(MarkupTypeSchema typeSchema) + { + _typeSchema = typeSchema; + if (typeSchema.MarkupTypeBase == null) + return; + _totalListenersOnBaseType = typeSchema.MarkupTypeBase.TotalListenerCount; + } + + public uint SequentialListenerIndex(uint localListenerIndex) => _totalListenersOnBaseType + localListenerIndex; + + public uint ScriptId => _typeSchema.EncodeScriptOffsetAsId(TriggerContainer.ActionCode.EncodeStartOffset); + + public uint RefreshId => _typeSchema.EncodeScriptOffsetAsId(TriggerContainer.SourceExpression.EncodeStartOffset); + + public bool RunOnNonTailTrigger => TriggerContainer.SourceExpression.ExpressionType != ExpressionType.Call || ((ValidateExpressionCall)TriggerContainer.SourceExpression).FoundMemberType != SchemaType.Event; + } +} diff --git a/UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs b/UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs new file mode 100644 index 0000000..0ffd048 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ListenerNodeBase.cs @@ -0,0 +1,67 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ListenerNodeBase +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Diagnostics; + +namespace Microsoft.Iris.Markup +{ + internal class ListenerNodeBase + { + protected ListenerNodeBase _next; + protected ListenerNodeBase _prev; + + protected ListenerNodeBase() + { + _next = null; + _prev = null; + } + + public virtual void Dispose() + { + if (!IsLinked) + return; + Unlink(); + } + + public ListenerNodeBase Next => _next; + + public bool IsLinked => _next != null && _prev != null; + + public void AddPrevious(ListenerNodeBase node) + { + if (_prev == null) + { + _prev = this; + _next = this; + } + node._prev = _prev; + node._next = this; + _prev._next = node; + _prev = node; + } + + public void Unlink() + { + if (_prev == _next) + { + _prev._next = null; + _prev._prev = null; + } + else + { + _prev._next = _next; + _next._prev = _prev; + } + _prev = null; + _next = null; + } + + [Conditional("DEBUG")] + private void DEBUG_ValidateList() + { + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/ListenerRootNode.cs b/UIX/Microsoft/Iris/Markup/ListenerRootNode.cs new file mode 100644 index 0000000..c9d7836 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ListenerRootNode.cs @@ -0,0 +1,13 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ListenerRootNode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class ListenerRootNode : ListenerNodeBase + { + public override string ToString() => "ListenerRoot"; + } +} diff --git a/UIX/Microsoft/Iris/Markup/ListenerType.cs b/UIX/Microsoft/Iris/Markup/ListenerType.cs new file mode 100644 index 0000000..9d89c49 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ListenerType.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ListenerType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum ListenerType + { + Property, + Event, + Symbol, + } +} diff --git a/UIX/Microsoft/Iris/Markup/Listeners.cs b/UIX/Microsoft/Iris/Markup/Listeners.cs new file mode 100644 index 0000000..2fcb094 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/Listeners.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.Listeners +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal class Listeners : DisposableObject + { + protected Vector _listenerList; + + protected Listeners(Vector listeners) => _listenerList = listeners; + + protected Listeners(int listenerCount) => AddEntries(listenerCount); + + public void AddEntries(int listenerCount) + { + if (_listenerList == null) + _listenerList = new Vector(listenerCount); + else + _listenerList.Capacity += listenerCount; + for (int index = 0; index < listenerCount; ++index) + _listenerList.Add(null); + } + + protected override void OnDispose() + { + base.OnDispose(); + for (int index = 0; index < _listenerList.Count; ++index) + _listenerList[index]?.Dispose(); + _listenerList = null; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/LoadPass.cs b/UIX/Microsoft/Iris/Markup/LoadPass.cs new file mode 100644 index 0000000..e43da00 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/LoadPass.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.LoadPass +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum LoadPass + { + Invalid, + DeclareTypes, + PopulatePublicModel, + Full, + Done, + } +} diff --git a/UIX/Microsoft/Iris/Markup/LoadResult.cs b/UIX/Microsoft/Iris/Markup/LoadResult.cs new file mode 100644 index 0000000..66a02c8 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/LoadResult.cs @@ -0,0 +1,117 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.LoadResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Markup +{ + internal abstract class LoadResult : SharedDisposableObject + { + private string _uri; + protected string _uriUnderlying; + private uint _islandReferences; + private string _compilerReferenceName; + public static LoadResult[] EmptyList = new LoadResult[0]; + + public LoadResult(string uri) => _uri = uri; + + protected override void OnDispose() => base.OnDispose(); + + public string Uri => _uri; + + public string UnderlyingUri => _uriUnderlying; + + public string ErrorContextUri => _uriUnderlying == null ? _uri : _uriUnderlying; + + public uint IslandReferences => _islandReferences; + + public void AddReference(uint islandId) + { + if (((int)_islandReferences & (int)islandId) != 0) + return; + if (_islandReferences == 0U) + RegisterUsage(this); + _islandReferences |= islandId; + foreach (LoadResult dependency in Dependencies) + { + if (dependency != this) + dependency.AddReference(islandId); + } + } + + public void RemoveReferenceDeep(uint islandId) + { + if ((_islandReferences & islandId) <= 0U) + return; + _islandReferences &= ~islandId; + foreach (LoadResult dependency in Dependencies) + { + if (dependency != this) + dependency.RemoveReferenceDeep(islandId); + } + if (_islandReferences != 0U) + return; + UnregisterUsage(this); + foreach (LoadResult dependency in Dependencies) + { + if (dependency != this) + dependency.UnregisterUsage(this); + } + } + + public void RemoveAllReferences() => RemoveReferenceDeep(IslandReferences); + + protected void RegisterDependenciesUsage() + { + foreach (LoadResult dependency in Dependencies) + { + if (dependency != this) + { + dependency.RegisterUsage(this); + dependency.AddReference(_islandReferences); + } + } + } + + public void RegisterProxyUsage() => RegisterUsage(this); + + public void UnregisterProxyUsage() => UnregisterUsage(this); + + public virtual void Load(LoadPass pass) + { + } + + public abstract TypeSchema FindType(string name); + + public abstract LoadResultStatus Status { get; } + + public virtual LoadResult[] Dependencies => EmptyList; + + public virtual TypeSchema[] ExportTable => TypeSchema.EmptyList; + + public virtual bool Cachable => true; + + public void SetCompilerReferenceName(string name) + { + if (_compilerReferenceName == null) + { + _compilerReferenceName = name; + } + else + { + if (name.Equals(_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", _compilerReferenceName, name); + } + } + + public virtual string GetCompilerReferenceName() => _compilerReferenceName; + + public override string ToString() => _uri; + } +} diff --git a/UIX/Microsoft/Iris/Markup/LoadResultCache.cs b/UIX/Microsoft/Iris/Markup/LoadResultCache.cs new file mode 100644 index 0000000..60f184b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/LoadResultCache.cs @@ -0,0 +1,57 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.LoadResultCache +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using System.Collections.Generic; + +namespace Microsoft.Iris.Markup +{ + internal static class LoadResultCache + { + private static Dictionary s_cache = new Dictionary(InvariantString.OrdinalIgnoreCaseComparer); + + public static LoadResult Read(string uri) + { + LoadResult loadResult; + s_cache.TryGetValue(uri, out loadResult); + return loadResult; + } + + public static void Write(string uri, LoadResult loadResult) + { + s_cache[uri] = loadResult; + loadResult.RegisterUsage(s_cache); + } + + public static void Remove(uint islandId) + { + Vector vector = new Vector(); + foreach (KeyValuePair keyValuePair in s_cache) + { + LoadResult loadResult = keyValuePair.Value; + if ((loadResult.IslandReferences & islandId) > 0U) + loadResult.RemoveReferenceDeep(islandId); + if (loadResult.IslandReferences == 0U) + { + loadResult.UnregisterUsage(s_cache); + vector.Add(keyValuePair.Key); + } + } + foreach (string key in vector) + s_cache.Remove(key); + } + + public static void Clear() + { + foreach (LoadResult loadResult in s_cache.Values) + { + loadResult.RemoveAllReferences(); + loadResult.UnregisterUsage(s_cache); + } + s_cache.Clear(); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/LoadResultStatus.cs b/UIX/Microsoft/Iris/Markup/LoadResultStatus.cs new file mode 100644 index 0000000..b34c44a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/LoadResultStatus.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.LoadResultStatus +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum LoadResultStatus + { + Loading, + Success, + Error, + } +} diff --git a/UIX/Microsoft/Iris/Markup/ManagedXmlReader.cs b/UIX/Microsoft/Iris/Markup/ManagedXmlReader.cs new file mode 100644 index 0000000..53d3252 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ManagedXmlReader.cs @@ -0,0 +1,379 @@ +using Microsoft.Iris.Data; +using Microsoft.Iris.Markup; +using System; +using System.IO; +using System.Runtime.InteropServices; +using System.Xml; + +namespace Microsoft.Iris.Markup +{ + internal struct ManagedXmlReader : IDisposable + { + private XmlReader _reader; + private XmlNodeType _prevNodeType; + private XmlNodeType _curNodeType; + private int _lineNumber; + private int _linePosition; + private bool _beforeFirstAttribute; + + public ManagedXmlReader(Resource resource) : this(false) => _reader = XmlReader.Create(resource.Uri); + + public ManagedXmlReader(string content, bool isFragment) : this(false) => _reader = XmlReader.Create(new StringReader(content)); + + private ManagedXmlReader(bool placeHolder) + { + _lineNumber = -1; + _linePosition = -1; + _beforeFirstAttribute = true; + _reader = null; + _curNodeType = XmlNodeType.None; + _prevNodeType = XmlNodeType.None; + } + + public void Dispose() + { + _reader.Close(); + _reader = null; + } + + public bool Read(out XmlNodeType nodeType) + { + _beforeFirstAttribute = true; + _lineNumber = InternalLineNumber; + _linePosition = InternalLinePosition; + bool flag = _reader.Read(); + nodeType = _reader.NodeType; + _prevNodeType = _curNodeType; + _curNodeType = nodeType; + return flag; + } + + public bool ReadAttribute() + { + if (_beforeFirstAttribute) + return MoveToFirstAttribute(); + bool nextAttribute = MoveToNextAttribute(); + if (!nextAttribute) + _beforeFirstAttribute = true; + return nextAttribute; + } + + private bool MoveToFirstAttribute() + { + _beforeFirstAttribute = false; + _lineNumber = InternalLineNumber; + _linePosition = InternalLinePosition; + return _reader.MoveToFirstAttribute(); + } + + private bool MoveToNextAttribute() + { + _lineNumber = InternalLineNumber; + _linePosition = InternalLinePosition; + return _reader.MoveToNextAttribute(); + } + + public bool IsEmptyElement => _reader.IsEmptyElement; + + public string Name => _reader.Name; + + public string LocalName => _reader.LocalName; + + public string Prefix => _reader.Prefix; + + public string Value => _reader.Value; + + public unsafe bool IsInlineExpression + { + get + { + string value = _reader.Value; + return value.StartsWith("{") && value.EndsWith("}"); + } + } + + public SSLexUnicodeBufferConsumer LexConsumerForValueWithPrefix(string prefix) + { + char[] buffer = _reader.Value.ToCharArray(); + SSLexUnicodeBufferConsumer unicodeBufferConsumer = new SSLexUnicodeBufferConsumer(buffer, (uint)buffer.Length, prefix); + int lineNumber = _lineNumber; + int column = _linePosition - prefix.Length + 1; + if (_curNodeType == XmlNodeType.CDATA && _prevNodeType != XmlNodeType.Whitespace) + column += 9; + unicodeBufferConsumer.SetDocumentOffset(lineNumber, column); + return unicodeBufferConsumer; + } + + public int LineNumber => _lineNumber; + + public int LinePosition => _linePosition; + + private int InternalLineNumber => ((IXmlLineInfo)_reader).LineNumber; + + private int InternalLinePosition => ((IXmlLineInfo)_reader).LinePosition; + + private void IFC(uint hr) => SUCCEEDED(hr); + + private bool SUCCEEDED(uint hr) + { + if (hr == 0U) + return true; + if (hr == 1U) + return false; + ThrowXmlException(hr); + return false; + } + + private void ThrowXmlException(uint hr) + { + string message = null; + switch (hr) + { + case 3222069277: + message = "Character in character entity is not a decimal digit as was expected."; + break; + case 3222069278: + message = "Character in character entity is not a hexadecimal digit as was expected."; + break; + case 3222069279: + message = "Character entity has invalid Unicode value."; + break; + case 3222072833: + message = "Unexpected end of input"; + break; + case 3222072834: + message = "Unrecognized encoding"; + break; + case 3222072835: + message = "Unable to switch the encoding"; + break; + case 3222072836: + message = "Unrecognized input signature"; + break; + case 3222072865: + message = "Whitespace expected"; + break; + case 3222072866: + message = "Semicolon expected"; + break; + case 3222072867: + message = "'>' expected"; + break; + case 3222072868: + message = "Quote expected"; + break; + case 3222072869: + message = "Equal expected"; + break; + case 3222072870: + message = "Well-formedness constraint: no '<' in attribute value"; + break; + case 3222072871: + message = "Hexadecimal digit expected"; + break; + case 3222072872: + message = "Decimal digit expected"; + break; + case 3222072873: + message = "'[' expected"; + break; + case 3222072874: + message = "'(' expected"; + break; + case 3222072875: + message = "Illegal xml character"; + break; + case 3222072876: + message = "Illegal name character"; + break; + case 3222072877: + message = "Incorrect document syntax"; + break; + case 3222072878: + message = "Incorrect CDATA section syntax"; + break; + case 3222072879: + message = "Incorrect comment syntax"; + break; + case 3222072880: + message = "Incorrect conditional section syntax"; + break; + case 3222072881: + message = "Incorrect ATTLIST declaration syntax"; + break; + case 3222072882: + message = "Incorrect DOCTYPE declaration syntax"; + break; + case 3222072883: + message = "Incorrect ELEMENT declaration syntax"; + break; + case 3222072884: + message = "Incorrect ENTITY declaration syntax"; + break; + case 3222072885: + message = "Incorrect NOTATION declaration syntax"; + break; + case 3222072886: + message = "NDATA expected"; + break; + case 3222072887: + message = "PUBLIC expected"; + break; + case 3222072888: + message = "SYSTEM expected"; + break; + case 3222072889: + message = "Name expected"; + break; + case 3222072890: + message = "One root element"; + break; + case 3222072891: + message = "Well-formedness constraint: element type match"; + break; + case 3222072892: + message = "Well-formedness constraint: unique attribute spec"; + break; + case 3222072893: + message = "Text/xmldecl not at the beginning of input"; + break; + case 3222072894: + message = "Leading \"xml\""; + break; + case 3222072895: + message = "Incorrect text declaration syntax"; + break; + case 3222072896: + message = "Incorrect xml declaration syntax"; + break; + case 3222072897: + message = "Incorrect encoding name syntax"; + break; + case 3222072898: + message = "Incorrect public identifier syntax"; + break; + case 3222072899: + message = "Well-formedness constraint: pes in internal subset"; + break; + case 3222072900: + message = "Well-formedness constraint: pes between declarations"; + break; + case 3222072901: + message = "Well-formedness constraint: no recursion"; + break; + case 3222072902: + message = "Entity content not well formed"; + break; + case 3222072903: + message = "Well-formedness constraint: undeclared entity "; + break; + case 3222072904: + message = "Well-formedness constraint: parsed entity"; + break; + case 3222072905: + message = "Well-formedness constraint: no external entity references"; + break; + case 3222072906: + message = "Incorrect processing instruction syntax"; + break; + case 3222072907: + message = "Incorrect system identifier syntax"; + break; + case 3222072908: + message = "'?' expected"; + break; + case 3222072909: + message = "No ']]>' in element content"; + break; + case 3222072910: + message = "Not all chunks of value have been read"; + break; + case 3222072911: + message = "DTD was found but is prohibited"; + break; + case 3222072912: + message = "xml:space attribute with invalid value"; + break; + case 3222072929: + message = "Illegal qualified name character"; + break; + case 3222072930: + message = "Multiple colons in qualified name"; + break; + case 3222072931: + message = "Colon in name"; + break; + case 3222072932: + message = "Declared prefix"; + break; + case 3222072933: + message = "Undeclared prefix"; + break; + case 3222072934: + message = "Non default namespace with empty uri"; + break; + case 3222072935: + message = "\"xml\" prefix is reserved and must have the http://www.w3.org/XML/1998/namespace URI"; + break; + case 3222072936: + message = "\"xmlns\" prefix is reserved for use by XML"; + break; + case 3222072937: + message = "xml namespace URI (http://www.w3.org/XML/1998/namespace) must be assigned only to prefix \"xml\""; + break; + case 3222072938: + message = "xmlns namespace URI (http://www.w3.org/2000/xmlns/) is reserved and must not be used"; + break; + case 3222072961: + message = "Element depth exceeds limit in XmlReaderProperty_MaxElementDepth"; + break; + case 3222072962: + message = "Entity expansion exceeds limit in XmlReaderProperty_MaxEntityExpansion"; + break; + case 3222073089: + message = "Writer: specified string is not whitespace"; + break; + case 3222073090: + message = "Writer: namespace prefix is already declared with a different namespace"; + break; + case 3222073091: + message = "Writer: It is not allowed to declare a namespace prefix with empty URI (for example xmlns:p=””)."; + break; + case 3222073092: + message = "Writer: duplicate attribute"; + break; + case 3222073093: + message = "Writer: can not redefine the xmlns prefix"; + break; + case 3222073094: + message = "Writer: xml prefix must have the http://www.w3.org/XML/1998/namespace URI"; + break; + case 3222073095: + message = "Writer: xml namespace URI (http://www.w3.org/XML/1998/namespace) must be assigned only to prefix \"xml\""; + break; + case 3222073096: + message = "Writer: xmlns namespace URI (http://www.w3.org/2000/xmlns/) is reserved and must not be used"; + break; + case 3222073097: + message = "Writer: namespace is not declared"; + break; + case 3222073098: + message = "Writer: invalid value of xml:space attribute (allowed values are \"default\" and \"preserve\")"; + break; + case 3222073099: + message = "Writer: performing the requested action would result in invalid XML document"; + break; + case 3222073100: + message = "Writer: input contains invalid or incomplete surrogate pair"; + break; + } + if (message != null) + { + int lineNumber = _reader == null ? -1 : InternalLineNumber; + int linePosition = _reader == null? -1 : InternalLinePosition; + throw new XmlException(message, new Exception(hr.ToString()), lineNumber, linePosition); + } + throw new XmlException("Unknown error", new Exception(hr.ToString()), -1, -1); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupBinaryDataTable.cs b/UIX/Microsoft/Iris/Markup/MarkupBinaryDataTable.cs new file mode 100644 index 0000000..dcf84df --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupBinaryDataTable.cs @@ -0,0 +1,79 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupBinaryDataTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupBinaryDataTable + { + private string _uri; + private Vector _strings; + private MarkupConstantsTable _constantsTable; + private MarkupImportTables _importTables; + private LoadResult[] _sharedDependenciesTable; + private SourceMarkupImportTables _sourceMarkupImportTables; + private ByteCodeReader _stringTableReader; + + public MarkupBinaryDataTable(string uri, int stringCount) + { + _uri = uri; + _strings = new Vector(stringCount); + _strings.ExpandTo(stringCount); + } + + public MarkupBinaryDataTable(string uri) + : this(uri, 0) + { + } + + public void SetStringTableReader(ByteCodeReader stringTableReader) => _stringTableReader = stringTableReader; + + public string Uri => _uri; + + public int GetIndexOrAdd(string s) + { + int num = _strings.IndexOf(s); + if (num == -1) + { + _strings.Add(s); + num = _strings.Count - 1; + } + return num; + } + + public string GetStringByIndex(int index) + { + string str = _strings[index]; + if (str == null) + { + _stringTableReader.CurrentOffset = (uint)(index * 4); + _stringTableReader.CurrentOffset = _stringTableReader.ReadUInt32(); + str = _stringTableReader.ReadString(); + _strings[index] = str; + } + return str; + } + + public Vector Strings => _strings; + + public MarkupConstantsTable ConstantsTable => _constantsTable; + + public MarkupImportTables ImportTables => _importTables; + + public SourceMarkupImportTables SourceMarkupImportTables => _sourceMarkupImportTables; + + public void SetConstantsTable(MarkupConstantsTable constantsTable) => _constantsTable = constantsTable; + + public void SetImportTables(MarkupImportTables importTables) => _importTables = importTables; + + public void SetSourceMarkupImportTables(SourceMarkupImportTables sourceMarkupImportTables) => _sourceMarkupImportTables = sourceMarkupImportTables; + + public LoadResult[] SharedDependenciesTableWithBinaryDataTable + { + get => _sharedDependenciesTable; + set => _sharedDependenciesTable = value; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupCompiler.cs b/UIX/Microsoft/Iris/Markup/MarkupCompiler.cs new file mode 100644 index 0000000..30f5148 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupCompiler.cs @@ -0,0 +1,603 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupCompiler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using System; +using System.Runtime.InteropServices; + +namespace Microsoft.Iris.Markup +{ + internal class MarkupCompiler + { + private ByteCodeWriter _writer; + private MarkupLoadResult _loadResult; + private MarkupBinaryDataTable _binaryDataTable; + private bool _usingSharedBinaryDataTable; + private uint _objectSectionStartFixup; + private uint _objectSectionEndFixup; + private uint _lineNumberTableStartFixup; + private uint _lineNumberTableEndFixup; + private uint _binaryDataTableSectionOffsetFixup = uint.MaxValue; + private bool _binaryDataTablePersisted; + + private MarkupCompiler() + { + } + + public static bool Compile(CompilerInput[] compilands, CompilerInput dataTableCompiland) + { + ErrorWatermark watermark1 = ErrorManager.Watermark; + MarkupBinaryDataTable markupBinaryDataTable = null; + if (dataTableCompiland.SourceFileName != null) + { + markupBinaryDataTable = new MarkupBinaryDataTable(dataTableCompiland.SourceFileName); + MarkupConstantsTable constantsTable = new MarkupConstantsTable(); + markupBinaryDataTable.SetConstantsTable(constantsTable); + markupBinaryDataTable.SetSourceMarkupImportTables(new SourceMarkupImportTables()); + } + Vector vector = new Vector(); + foreach (CompilerInput compiland in compilands) + { + if (compiland.SourceFileName.IndexOf("://", StringComparison.Ordinal) != -1) + 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($"'{uri}' is not markup, it cannot be compiled"); + } + else + { + vector.Add(loadResult); + if (compiland.IdentityUri != null) + loadResult.SetCompilerReferenceName(compiland.IdentityUri); + if (markupBinaryDataTable != null) + markupLoadResult.SetBinaryDataTable(markupBinaryDataTable); + } + } + } + foreach (LoadResult loadResult in vector) + MarkupSystem.Load(loadResult.Uri, MarkupSystem.RootIslandId); + if (!watermark1.ErrorsDetected) + { + for (int index = 0; index < compilands.Length; ++index) + { + ErrorWatermark watermark2 = ErrorManager.Watermark; + ByteCodeWriter writer = Run((MarkupLoadResult)vector[index], markupBinaryDataTable); + if (!watermark2.ErrorsDetected) + SaveCompiledOutput(writer, compilands[index].OutputFileName); + } + if (markupBinaryDataTable != null) + SaveCompiledOutput(CompileBinaryDataTable(markupBinaryDataTable), dataTableCompiland.OutputFileName); + } + return !watermark1.ErrorsDetected; + } + + private static void SaveCompiledOutput(ByteCodeWriter writer, string outputFile) + { + ErrorWatermark watermark = ErrorManager.Watermark; + IntPtr invalidHandleValue = Win32Api.INVALID_HANDLE_VALUE; + ByteCodeReader reader = writer.CreateReader(); + 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}", outputFile, Marshal.GetLastWin32Error()); + if (!watermark.ErrorsDetected) + { + uint size = 0; + IntPtr intPtr = reader.ToIntPtr(out size); + uint lpNumberOfBytesWritten = 0; + if (!Win32Api.WriteFile(file, intPtr, size, out lpNumberOfBytesWritten, IntPtr.Zero)) + 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(typeof(MarkupSystem)); + } + + public static ByteCodeWriter Run( + MarkupLoadResult loadResult, + MarkupBinaryDataTable sharedBinaryDataTable) + { + return new MarkupCompiler().InternalRun(loadResult, sharedBinaryDataTable); + } + + private ByteCodeWriter InternalRun( + MarkupLoadResult loadResult, + MarkupBinaryDataTable sharedBinaryDataTable) + { + _writer = new ByteCodeWriter(); + _loadResult = loadResult; + PersistHeader(); + PersistTableOfContents(sharedBinaryDataTable); + PersistDependencies(); + PersistTypeExportDeclarations(); + PersistTypeImportTable(); + PersistTypeExportDefinitions(); + PersistMemberImportTables(); + PersistDataMappingsTable(); + PersistConstantsTable(); + PersistBinaryDataTable(); + PersistObjectSection(); + PersistLineNumberTable(); + return _writer; + } + + private void PersistHeader() + { + _writer.WriteUInt32(440551765U); + _writer.WriteUInt32(1012U); + } + + private void PersistTableOfContents(MarkupBinaryDataTable sharedBinaryDataTable) + { + _objectSectionStartFixup = _writer.DataSize; + _writer.WriteUInt32(uint.MaxValue); + _objectSectionEndFixup = _writer.DataSize; + _writer.WriteUInt32(uint.MaxValue); + _lineNumberTableStartFixup = _writer.DataSize; + _writer.WriteUInt32(uint.MaxValue); + _lineNumberTableEndFixup = _writer.DataSize; + _writer.WriteUInt32(uint.MaxValue); + if (sharedBinaryDataTable != null) + { + _binaryDataTable = sharedBinaryDataTable; + _writer.WriteString(_binaryDataTable.Uri); + _usingSharedBinaryDataTable = true; + } + else + { + _writer.WriteString(null); + _usingSharedBinaryDataTable = false; + _binaryDataTable = _loadResult.BinaryDataTable; + if (_binaryDataTable == null) + _binaryDataTable = new MarkupBinaryDataTable(null, 0); + _binaryDataTableSectionOffsetFixup = _writer.DataSize; + _writer.WriteUInt32(uint.MaxValue); + } + } + + private void PersistDependencies() + { + if (_usingSharedBinaryDataTable) + return; + _writer.WriteUInt16(_loadResult.Dependencies.Length); + foreach (LoadResult dependency in _loadResult.Dependencies) + { + _writer.WriteBool(dependency is MarkupLoadResult); + WriteDataTableString(dependency.GetCompilerReferenceName() ?? dependency.Uri); + } + } + + private void PersistTypeExportDeclarations() + { + _writer.WriteUInt16(_loadResult.ExportTable.Length); + foreach (MarkupTypeSchema markupTypeSchema in _loadResult.ExportTable) + { + MarkupType markupType = markupTypeSchema.MarkupType; + WriteDataTableString(markupTypeSchema.Name); + _writer.WriteInt32((int)markupType); + } + if (_loadResult.AliasTable == null) + { + _writer.WriteUInt16(0); + } + else + { + _writer.WriteUInt16(_loadResult.AliasTable.Length); + foreach (AliasMapping aliasMapping in _loadResult.AliasTable) + { + WriteDataTableString(aliasMapping.Alias); + _writer.WriteUInt16(MapDependentToIndex(aliasMapping.LoadResult)); + WriteDataTableString(aliasMapping.TargetType); + } + } + } + + private void PersistTypeImportTable() + { + if (_usingSharedBinaryDataTable) + return; + _writer.WriteUInt16(_loadResult.ImportTables.TypeImports.Length); + foreach (TypeSchema typeImport in _loadResult.ImportTables.TypeImports) + { + _writer.WriteUInt16(MapDependentToIndex(typeImport.Owner)); + WriteDataTableString(typeImport.Name); + } + } + + private void PersistTypeExportDefinitions() + { + foreach (MarkupTypeSchema markupTypeSchema in _loadResult.ExportTable) + { + MarkupType markupType = markupTypeSchema.MarkupType; + _writer.WriteUInt16(markupTypeSchema.TypeDepth); + if (markupTypeSchema.TypeDepth > 1U) + _writer.WriteUInt16(MapTypeToIndex(markupTypeSchema.Base)); + _writer.WriteUInt32(markupTypeSchema.InitializePropertiesOffset); + _writer.WriteUInt32(markupTypeSchema.InitializeLocalsInputOffset); + _writer.WriteUInt32(markupTypeSchema.InitializeContentOffset); + WriteUInt32ArrayHelper(markupTypeSchema.InitialEvaluateOffsets, "InitialEvaluateOffsets"); + WriteUInt32ArrayHelper(markupTypeSchema.FinalEvaluateOffsets, "FinalEvaluateOffsets"); + WriteUInt32ArrayHelper(markupTypeSchema.RefreshGroupOffsets, "RefreshGroupOffsets"); + _writer.WriteUInt32(markupTypeSchema.ListenerCount); + uint num1 = 0; + if (markupTypeSchema.SymbolReferenceTable != null) + num1 = (uint)markupTypeSchema.SymbolReferenceTable.Length; + _writer.WriteUInt32(num1); + if (num1 != 0U) + { + foreach (SymbolReference symbolReference in markupTypeSchema.SymbolReferenceTable) + { + WriteDataTableString(symbolReference.Symbol); + _writer.WriteByte((byte)symbolReference.Origin); + } + } + uint dataSize1 = _writer.DataSize; + _writer.WriteUInt32(uint.MaxValue); + uint dataSize2 = _writer.DataSize; + uint num2 = 0; + if (markupTypeSchema.InheritableSymbolsTable != null) + num2 = (uint)markupTypeSchema.InheritableSymbolsTable.Length; + _writer.WriteUInt32(num2); + if (num2 != 0U) + { + foreach (SymbolRecord symbolRecord in markupTypeSchema.InheritableSymbolsTable) + { + WriteDataTableString(symbolRecord.Name); + _writer.WriteByte((byte)symbolRecord.SymbolOrigin); + _writer.WriteUInt16(MapTypeToIndex(symbolRecord.Type)); + } + } + uint num3 = _writer.DataSize - dataSize2; + _writer.Overwrite(dataSize1, num3); + _writer.WriteInt32(markupTypeSchema.TotalPropertiesAndLocalsCount); + if (markupType == MarkupType.UI) + { + UIClassTypeSchema uiClassTypeSchema = (UIClassTypeSchema)markupTypeSchema; + ushort num4 = 0; + if (uiClassTypeSchema.NamedContentTable != null) + num4 = (ushort)uiClassTypeSchema.NamedContentTable.Length; + _writer.WriteUInt16(num4); + if (num4 != 0) + { + foreach (NamedContentRecord namedContentRecord in uiClassTypeSchema.NamedContentTable) + { + WriteDataTableString(namedContentRecord.Name); + _writer.WriteUInt32(namedContentRecord.Offset); + } + } + } + else + { + _writer.WriteBool(((ClassTypeSchema)markupTypeSchema).IsShared); + if (markupType == MarkupType.Effect) + { + EffectClassTypeSchema effectClassTypeSchema = (EffectClassTypeSchema)markupTypeSchema; + WriteUInt32ArrayHelper(effectClassTypeSchema.TechniqueOffsets, "TechniqueOffsets"); + WriteUInt32ArrayHelper(effectClassTypeSchema.InstancePropertyAssignments, "InstancePropertyAssignments"); + WriteStringArrayHelper(effectClassTypeSchema.DynamicElementAssignments, "DynamicElementAssignments"); + _writer.WriteInt32(effectClassTypeSchema.DefaultElementSymbolIndex); + } + if (markupType == MarkupType.DataQuery) + { + MarkupDataQuerySchema markupDataQuerySchema = (MarkupDataQuerySchema)markupTypeSchema; + WriteDataTableString(markupDataQuerySchema.ProviderName); + _writer.WriteUInt16(MapTypeToIndex(markupDataQuerySchema.ResultType)); + } + } + PropertySchema[] properties = markupTypeSchema.Properties; + _writer.WriteUInt16(properties.Length); + foreach (MarkupPropertySchema markupPropertySchema in properties) + { + WriteDataTableString(markupPropertySchema.Name); + _writer.WriteBool(markupPropertySchema.RequiredForCreation); + if (markupPropertySchema.OverrideCriteria != null) + { + PropertyOverrideCriteriaTypeConstraint overrideCriteria = (PropertyOverrideCriteriaTypeConstraint)markupPropertySchema.OverrideCriteria; + _writer.WriteBool(true); + ushort index1 = MapTypeToIndex(overrideCriteria.Constraint); + ushort index2 = MapTypeToIndex(overrideCriteria.Use); + _writer.WriteUInt16(index1); + _writer.WriteUInt16(index2); + } + else + _writer.WriteBool(false); + _writer.WriteUInt16(MapTypeToIndex(markupPropertySchema.PropertyType)); + if (markupType == MarkupType.DataType) + { + MarkupDataTypePropertySchema typePropertySchema = (MarkupDataTypePropertySchema)markupPropertySchema; + _writer.WriteUInt16(typePropertySchema.AlternateType != null ? MapTypeToIndex(typePropertySchema.AlternateType) : ushort.MaxValue); + } + if (markupType == MarkupType.DataQuery) + { + MarkupDataQueryPropertySchema queryPropertySchema = (MarkupDataQueryPropertySchema)markupPropertySchema; + if (queryPropertySchema.DefaultValue != null) + { + _writer.WriteBool(true); + queryPropertySchema.PropertyType.EncodeBinary(_writer, queryPropertySchema.DefaultValue); + } + else + _writer.WriteBool(false); + _writer.WriteBool(queryPropertySchema.InvalidatesQuery); + _writer.WriteUInt16(queryPropertySchema.AlternateType != null ? MapTypeToIndex(queryPropertySchema.AlternateType) : ushort.MaxValue); + } + } + WriteMarkupMethodArrayHelper(markupTypeSchema.Methods, "METHODS"); + WriteMarkupMethodArrayHelper(markupTypeSchema.VirtualMethods, "VIRTUAL METHODS"); + } + } + + private void PersistMemberImportTables() + { + if (_usingSharedBinaryDataTable) + return; + _writer.WriteUInt16(_loadResult.ImportTables.ConstructorImports.Length); + foreach (ConstructorSchema constructorImport in _loadResult.ImportTables.ConstructorImports) + { + _writer.WriteUInt16(MapTypeToIndex(constructorImport.Owner)); + _writer.WriteUInt16(constructorImport.ParameterTypes.Length); + foreach (TypeSchema parameterType in constructorImport.ParameterTypes) + _writer.WriteUInt16(MapTypeToIndex(parameterType)); + } + _writer.WriteUInt16(_loadResult.ImportTables.PropertyImports.Length); + foreach (PropertySchema propertyImport in _loadResult.ImportTables.PropertyImports) + { + _writer.WriteUInt16(MapTypeToIndex(propertyImport.Owner)); + WriteDataTableString(propertyImport.Name); + } + _writer.WriteUInt16(_loadResult.ImportTables.MethodImports.Length); + foreach (MethodSchema methodImport in _loadResult.ImportTables.MethodImports) + { + _writer.WriteUInt16(MapTypeToIndex(methodImport.Owner)); + bool flag = false; + MarkupMethodSchema markupMethodSchema = null; + if (methodImport is MarkupMethodSchema) + { + markupMethodSchema = (MarkupMethodSchema)methodImport; + flag = markupMethodSchema.IsVirtual && !markupMethodSchema.IsVirtualThunk; + } + _writer.WriteBool(flag); + if (!flag) + { + WriteDataTableString(methodImport.Name); + _writer.WriteUInt16(methodImport.ParameterTypes.Length); + foreach (TypeSchema parameterType in methodImport.ParameterTypes) + _writer.WriteUInt16(MapTypeToIndex(parameterType)); + } + else + _writer.WriteInt32(markupMethodSchema.VirtualId); + } + _writer.WriteUInt16(_loadResult.ImportTables.EventImports.Length); + foreach (EventSchema eventImport in _loadResult.ImportTables.EventImports) + { + _writer.WriteUInt16(MapTypeToIndex(eventImport.Owner)); + WriteDataTableString(eventImport.Name); + } + } + + private void PersistDataMappingsTable() + { + if (_loadResult.DataMappingsTable == null) + { + _writer.WriteUInt16(0); + } + else + { + _writer.WriteUInt16(_loadResult.DataMappingsTable.Length); + foreach (MarkupDataMapping markupDataMapping in _loadResult.DataMappingsTable) + { + _writer.WriteUInt16(MapTypeToIndex(markupDataMapping.TargetType)); + WriteDataTableString(markupDataMapping.Provider); + _writer.WriteUInt16(markupDataMapping.Mappings.Length); + foreach (MarkupDataMappingEntry mapping in markupDataMapping.Mappings) + { + WriteDataTableString(mapping.Source); + WriteDataTableString(mapping.Target); + _writer.WriteUInt16(MapPropertyToIndex(mapping.Property)); + if (mapping.DefaultValue != null && mapping.Property.PropertyType.SupportsBinaryEncoding) + { + _writer.WriteBool(true); + mapping.Property.PropertyType.EncodeBinary(_writer, mapping.DefaultValue); + } + else + _writer.WriteBool(false); + } + } + } + } + + private void PersistConstantsTable() + { + if (!_usingSharedBinaryDataTable) + { + int length = _loadResult.ConstantsTable.PersistList.Length; + _writer.WriteUInt16(length); + uint dataSize = _writer.DataSize; + uint offset = dataSize; + for (int index = 0; index <= length; ++index) + _writer.WriteUInt32(uint.MaxValue); + foreach (MarkupConstantPersist persist in _loadResult.ConstantsTable.PersistList) + { + _writer.Overwrite(offset, _writer.DataSize - dataSize); + offset += 4U; + ushort index = MapTypeToIndex(persist.Type); + MarkupConstantPersistMode constantPersistMode = persist.Mode; + if (persist.Type == StringSchema.Type) + constantPersistMode = MarkupConstantPersistMode.FromString; + _writer.WriteUInt16(index); + _writer.WriteByte((byte)constantPersistMode); + switch (constantPersistMode) + { + case MarkupConstantPersistMode.Binary: + _loadResult.ImportTables.TypeImports[index].EncodeBinary(_writer, persist.Data); + break; + case MarkupConstantPersistMode.FromString: + case MarkupConstantPersistMode.Canonical: + WriteDataTableString((string)persist.Data); + break; + } + } + _writer.Overwrite(offset, _writer.DataSize - dataSize); + } + else + _writer.WriteUInt16(0); + } + + private void PersistBinaryDataTable() + { + if (_binaryDataTableSectionOffsetFixup != uint.MaxValue) + { + uint dataSize1 = _writer.DataSize; + Vector strings = _binaryDataTable.Strings; + _writer.WriteInt32(strings.Count); + uint dataSize2 = _writer.DataSize; + uint offset = dataSize2; + for (int index = 0; index <= strings.Count; ++index) + _writer.WriteUInt32(uint.MaxValue); + foreach (string str in strings) + { + _writer.Overwrite(offset, _writer.DataSize - dataSize2); + offset += 4U; + _writer.WriteString(str); + } + _writer.Overwrite(offset, _writer.DataSize - dataSize2); + _writer.Overwrite(_binaryDataTableSectionOffsetFixup, dataSize1); + } + _binaryDataTablePersisted = true; + } + + private void PersistLineNumberTable() + { + _writer.Overwrite(_lineNumberTableStartFixup, _writer.DataSize); + _writer.WriteUInt16(_loadResult.LineNumberTable.PersistList.Length); + foreach (ulong persist in _loadResult.LineNumberTable.PersistList) + _writer.WriteUInt64(persist); + _writer.Overwrite(_lineNumberTableEndFixup, _writer.DataSize); + } + + private void PersistObjectSection() + { + _writer.Overwrite(_objectSectionStartFixup, _writer.DataSize); + _writer.Write(_loadResult.ObjectSection); + _loadResult.ObjectSection.ToIntPtr(out uint _); + _writer.Overwrite(_objectSectionEndFixup, _writer.DataSize); + } + + private ushort MapDependentToIndex(LoadResult dependent) + { + if (dependent == MarkupSystem.UIXGlobal) + return 65534; + if (dependent == _loadResult) + return 65533; + int num = _usingSharedBinaryDataTable ? _binaryDataTable.SourceMarkupImportTables.ImportedLoadResults.IndexOf(dependent) : Array.IndexOf(_loadResult.Dependencies, dependent); + return num >= 0 ? (ushort)num : ushort.MaxValue; + } + + private ushort MapTypeToIndex(TypeSchema type) + { + for (ushort index = 0; index < (ushort)_loadResult.ImportTables.TypeImports.Length; ++index) + { + TypeSchema typeImport = _loadResult.ImportTables.TypeImports[index]; + if (type == typeImport) + return index; + } + return ushort.MaxValue; + } + + private ushort MapPropertyToIndex(PropertySchema property) + { + for (ushort index = 0; index < (ushort)_loadResult.ImportTables.PropertyImports.Length; ++index) + { + PropertySchema propertyImport = _loadResult.ImportTables.PropertyImports[index]; + if (property == propertyImport) + return index; + } + return ushort.MaxValue; + } + + private ushort MapMethodToIndex(MethodSchema method) + { + for (ushort index = 0; index < (ushort)_loadResult.ImportTables.MethodImports.Length; ++index) + { + MethodSchema methodImport = _loadResult.ImportTables.MethodImports[index]; + if (method == methodImport) + return index; + } + return ushort.MaxValue; + } + + private void WriteDataTableString(string s) => _writer.WriteInt32(_binaryDataTable.GetIndexOrAdd(s)); + + private void WriteUInt32ArrayHelper(uint[] array, string debugName) + { + uint num1 = 0; + if (array != null) + num1 = (uint)array.Length; + _writer.WriteUInt32(num1); + if (num1 == 0U) + return; + foreach (uint num2 in array) + _writer.WriteUInt32(num2); + } + + private void WriteStringArrayHelper(string[] array, string debugName) + { + uint num = 0; + if (array != null) + num = (uint)array.Length; + _writer.WriteUInt32(num); + if (num == 0U) + return; + foreach (string s in array) + WriteDataTableString(s); + } + + private void WriteMarkupMethodArrayHelper(MethodSchema[] methods, string debugName) + { + _writer.WriteUInt16(methods.Length); + foreach (MarkupMethodSchema method in methods) + { + WriteDataTableString(method.Name); + _writer.WriteUInt16(MapTypeToIndex(method.ReturnType)); + _writer.WriteInt32(method.ParameterTypes.Length); + foreach (TypeSchema parameterType in method.ParameterTypes) + _writer.WriteUInt16(MapTypeToIndex(parameterType)); + WriteStringArrayHelper(method.ParameterNames, "ParameterNames"); + _writer.WriteInt32(method.VirtualId); + _writer.WriteBool(method.IsVirtualThunk); + _writer.WriteUInt32(method.CodeOffset); + } + } + + public static ByteCodeWriter CompileBinaryDataTable( + MarkupBinaryDataTable binaryDataTable) + { + SourceMarkupLoadResult markupLoadResult = new SourceMarkupLoadResult(binaryDataTable.Uri); + markupLoadResult.RegisterUsage(markupLoadResult); + binaryDataTable.ConstantsTable.PrepareForRuntimeUse(); + MarkupImportTables importTables = binaryDataTable.SourceMarkupImportTables.PrepareImportTables(); + Vector importedLoadResults = binaryDataTable.SourceMarkupImportTables.ImportedLoadResults; + LoadResult[] dependenciesTable = new LoadResult[importedLoadResults.Count]; + for (int index = 0; index < dependenciesTable.Length; ++index) + dependenciesTable[index] = (LoadResult)importedLoadResults[index]; + markupLoadResult.SetBinaryDataTable(binaryDataTable); + markupLoadResult.SetConstantsTable(binaryDataTable.ConstantsTable); + markupLoadResult.SetDependenciesTable(dependenciesTable, false); + markupLoadResult.SetImportTables(importTables); + markupLoadResult.SetLineNumberTable(new MarkupLineNumberTable()); + markupLoadResult.LineNumberTable.PrepareForRuntimeUse(); + markupLoadResult.SetObjectSection(new ByteCodeWriter().CreateReader()); + ByteCodeWriter byteCodeWriter = Run(markupLoadResult, null); + markupLoadResult.UnregisterUsage(markupLoadResult); + return byteCodeWriter; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupConstantPersist.cs b/UIX/Microsoft/Iris/Markup/MarkupConstantPersist.cs new file mode 100644 index 0000000..e4755d7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupConstantPersist.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupConstantPersist +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal struct MarkupConstantPersist + { + public MarkupConstantPersistMode Mode; + public object Data; + public TypeSchema Type; + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupConstantPersistMode.cs b/UIX/Microsoft/Iris/Markup/MarkupConstantPersistMode.cs new file mode 100644 index 0000000..0b8eddb --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupConstantPersistMode.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupConstantPersistMode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum MarkupConstantPersistMode + { + Binary, + FromString, + Canonical, + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupConstantsTable.cs b/UIX/Microsoft/Iris/Markup/MarkupConstantsTable.cs new file mode 100644 index 0000000..a84fa0b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupConstantsTable.cs @@ -0,0 +1,127 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupConstantsTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections.Generic; +using System.Diagnostics; + +namespace Microsoft.Iris.Markup +{ + internal class MarkupConstantsTable + { + private object[] _runtimeList; + private MarkupConstantPersist[] _persistList; + private Dictionary _lookupTable; + private ByteCodeReader _constantsTableReader; + private MarkupLoadResult _loadResultOwner; + + public MarkupConstantsTable() => _lookupTable = new Dictionary(new MarkupConstantsTable.MarkupConstantEqualityComparer()); + + public MarkupConstantsTable(object[] runtimeList) => _runtimeList = runtimeList; + + public void SetConstantsTableReader( + ByteCodeReader constantsTableReader, + MarkupLoadResult loadResultOwner) + { + _constantsTableReader = constantsTableReader; + _loadResultOwner = loadResultOwner; + } + + public int Add(TypeSchema type, object value, MarkupConstantPersistMode persistMode) => Add(type, value, persistMode, value); + + public int Add( + TypeSchema type, + object value, + MarkupConstantPersistMode persistMode, + object persistData) + { + MarkupConstantsTable.MarkupConstant key; + key.Type = type; + key.Value = value; + key.HashCode = value.GetHashCode(); + if (MarkupSystem.CompileMode) + { + key.Persist.Mode = persistMode; + key.Persist.Data = persistData; + key.Persist.Type = type; + } + else + { + key.Persist.Mode = MarkupConstantPersistMode.Binary; + key.Persist.Data = null; + key.Persist.Type = null; + } + int count; + if (!_lookupTable.TryGetValue(key, out count)) + { + count = _lookupTable.Count; + _lookupTable.Add(key, count); + } + return count; + } + + public object Get(int index) + { + object obj = _runtimeList[index]; + if (obj == null) + { + _constantsTableReader.CurrentOffset = (uint)(index * 4); + _constantsTableReader.CurrentOffset = _constantsTableReader.ReadUInt32(); + obj = CompiledMarkupLoader.DepersistConstant(_constantsTableReader, _loadResultOwner); + _runtimeList[index] = obj; + } + return obj; + } + + public void PrepareForRuntimeUse() + { + _runtimeList = new object[_lookupTable.Count]; + if (MarkupSystem.CompileMode) + _persistList = new MarkupConstantPersist[_lookupTable.Count]; + foreach (KeyValuePair keyValuePair in _lookupTable) + { + _runtimeList[keyValuePair.Value] = keyValuePair.Key.Value; + if (MarkupSystem.CompileMode) + _persistList[keyValuePair.Value] = keyValuePair.Key.Persist; + } + _lookupTable = null; + } + + public MarkupConstantPersist[] PersistList => _persistList; + + [Conditional("DEBUG")] + public void DEBUG_DumpTable() + { + } + + private class MarkupConstantEqualityComparer : + IEqualityComparer + { + bool IEqualityComparer.Equals( + MarkupConstantsTable.MarkupConstant x, + MarkupConstantsTable.MarkupConstant y) + { + bool flag = false; + if (x.Type == y.Type) + flag = (bool)x.Type.PerformOperationDeep(x.Value, y.Value, OperationType.RelationalEquals); + return flag; + } + + int IEqualityComparer.GetHashCode( + MarkupConstantsTable.MarkupConstant obj) + { + return obj.HashCode; + } + } + + private struct MarkupConstant + { + public TypeSchema Type; + public object Value; + public int HashCode; + public MarkupConstantPersist Persist; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataMapping.cs b/UIX/Microsoft/Iris/Markup/MarkupDataMapping.cs new file mode 100644 index 0000000..8a9b10b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataMapping.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataMapping +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupDataMapping + { + private string _name; + private MarkupDataMappingEntry[] _mappings; + private MarkupDataTypeSchema _targetType; + private string _provider; + private object _assemblyDataProviderCookie; + + public MarkupDataMapping(string name) => _name = name; + + public MarkupDataTypeSchema TargetType + { + get => _targetType; + set => _targetType = value; + } + + public string Provider + { + get => _provider; + set => _provider = value; + } + + public MarkupDataMappingEntry[] Mappings + { + get => _mappings; + set => _mappings = value; + } + + public object AssemblyDataProviderCookie + { + get => _assemblyDataProviderCookie; + set => _assemblyDataProviderCookie = value; + } + + public override string ToString() => string.Format("({0}, {1})", _provider, _targetType); + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataMappingEntry.cs b/UIX/Microsoft/Iris/Markup/MarkupDataMappingEntry.cs new file mode 100644 index 0000000..a9ec449 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataMappingEntry.cs @@ -0,0 +1,40 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataMappingEntry +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupDataMappingEntry + { + private string _source; + private string _target; + private MarkupDataTypePropertySchema _property; + private object _defaultValue; + + public string Source + { + get => _source; + set => _source = value; + } + + public string Target + { + get => _target; + set => _target = value; + } + + public MarkupDataTypePropertySchema Property + { + get => _property; + set => _property = value; + } + + public object DefaultValue + { + get => _defaultValue; + set => _defaultValue = value; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataProvider.cs b/UIX/Microsoft/Iris/Markup/MarkupDataProvider.cs new file mode 100644 index 0000000..0ad6b6b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataProvider.cs @@ -0,0 +1,100 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataProvider +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using System.Collections.Generic; + +namespace Microsoft.Iris.Markup +{ + internal static class MarkupDataProvider + { + private static Map s_mappings = new Map(); + private static Dictionary s_providers = new Dictionary(); + + public static void AddDataMapping(MarkupDataMapping mapping) + { + MarkupDataProvider.MappingKey key = new MarkupDataProvider.MappingKey(mapping.TargetType, mapping.Provider); + if (!s_mappings.ContainsKey(key)) + s_mappings[key] = mapping; + else + ErrorManager.ReportError("Data mapping already defined for type '{0}', provider '{1}'", mapping.TargetType.Name, mapping.Provider); + } + + public static void RemoveDataMapping(MarkupDataMapping mapping) + { + MarkupDataProvider.MappingKey key = new MarkupDataProvider.MappingKey(mapping.TargetType, mapping.Provider); + s_mappings.Remove(key); + } + + public static MarkupDataMapping FindDataMapping( + string providerName, + MarkupDataTypeSchema typeSchema) + { + MarkupDataProvider.MappingKey key = new MarkupDataProvider.MappingKey(typeSchema, providerName); + MarkupDataMapping markupDataMapping; + if (!s_mappings.TryGetValue(key, out markupDataMapping)) + { + markupDataMapping = new MarkupDataMapping(null); + markupDataMapping.Provider = providerName; + markupDataMapping.TargetType = typeSchema; + markupDataMapping.Mappings = FillInDefaultMappings(typeSchema, null); + s_mappings[key] = markupDataMapping; + } + return markupDataMapping; + } + + public static void RegisterDataProvider(IDataProvider provider) => s_providers[provider.Name] = provider; + + public static IDataProvider GetDataProvider(string providerName) + { + IDataProvider dataProvider; + return s_providers.TryGetValue(providerName, out dataProvider) ? dataProvider : null; + } + + public static object GetDefaultValueForType(TypeSchema type) => type.IsNullAssignable ? null : type.ConstructDefault(); + + public static MarkupDataMappingEntry[] FillInDefaultMappings( + MarkupDataTypeSchema targetType, + Map entries) + { + if (entries == null) + entries = new Map(); + for (MarkupDataTypeSchema markupDataTypeSchema = targetType; markupDataTypeSchema != null; markupDataTypeSchema = markupDataTypeSchema.Base as MarkupDataTypeSchema) + { + foreach (MarkupDataTypePropertySchema property in markupDataTypeSchema.Properties) + { + if (!entries.ContainsKey(property.Name)) + entries[property.Name] = new MarkupDataMappingEntry() + { + Property = property, + DefaultValue = GetDefaultValueForType(property.PropertyType) + }; + } + } + MarkupDataMappingEntry[] dataMappingEntryArray = new MarkupDataMappingEntry[entries.Count]; + int num = 0; + foreach (MarkupDataMappingEntry dataMappingEntry in entries.Values) + dataMappingEntryArray[num++] = dataMappingEntry; + return dataMappingEntryArray; + } + + private struct MappingKey + { + private MarkupDataTypeSchema _targetType; + private string _provider; + + public MappingKey(MarkupDataTypeSchema targetType, string provider) + { + _targetType = targetType; + _provider = provider; + } + + public override bool Equals(object rhs) => rhs is MarkupDataProvider.MappingKey mappingKey && _targetType == mappingKey._targetType && _provider == mappingKey._provider; + + public override int GetHashCode() => _targetType.GetHashCode() ^ _provider.GetHashCode(); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs new file mode 100644 index 0000000..ce925ea --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQuery.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataQuery +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal abstract class MarkupDataQuery : MarkupDataTypeBaseObject + { + private MarkupDataQuerySchema _owner; + + public MarkupDataQuery(MarkupDataQuerySchema type) + : base(type) + => _owner = type; + + protected void ApplyDefaultValues() + { + Map map = null; + for (MarkupDataQuerySchema owner = _owner; owner != null; owner = owner.Base as MarkupDataQuerySchema) + { + foreach (MarkupDataQueryPropertySchema property in owner.Properties) + { + if (property.DefaultValue != null && (map == null || !map.ContainsKey(property.Name))) + { + object instance = this; + property.SetValue(ref instance, property.DefaultValue); + if (map == null) + map = new Map(); + map[property.Name] = null; + } + } + } + } + + public abstract void Refresh(); + + public abstract object Result { get; set; } + + public abstract DataProviderQueryStatus Status { get; } + + public abstract bool Enabled { get; set; } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQueryPreDefinedPropertySchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQueryPreDefinedPropertySchema.cs new file mode 100644 index 0000000..b0ca5e9 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQueryPreDefinedPropertySchema.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataQueryPreDefinedPropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupDataQueryPreDefinedPropertySchema : MarkupDataQueryPropertySchema + { + private GetValueHandler _getValueHandler; + private SetValueHandler _setValueHandler; + + public MarkupDataQueryPreDefinedPropertySchema( + MarkupDataQuerySchema owner, + TypeSchema propertyType, + string name, + GetValueHandler getValueHandler, + SetValueHandler setValueHandler) + : base(owner, name, propertyType) + { + InvalidatesQuery = false; + _getValueHandler = getValueHandler; + _setValueHandler = setValueHandler; + } + + public override bool CanWrite => _setValueHandler != null; + + public override ExpressionRestriction ExpressionRestriction => !CanWrite ? ExpressionRestriction.ReadOnly : ExpressionRestriction.None; + + public override object GetValue(object instance) => _getValueHandler(instance); + + public override void SetValue(ref object instance, object value) => _setValueHandler(ref instance, value); + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQueryPropertySchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQueryPropertySchema.cs new file mode 100644 index 0000000..a4616f4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQueryPropertySchema.cs @@ -0,0 +1,39 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataQueryPropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupDataQueryPropertySchema : ClassPropertySchema + { + private object _defaultValue; + private bool _invalidatesQuery = true; + private TypeSchema _underlyingCollectionType; + + public MarkupDataQueryPropertySchema( + MarkupTypeSchema owner, + string name, + TypeSchema propertyType) + : base(owner, name, propertyType) + { + } + + public object DefaultValue + { + get => _defaultValue; + set => _defaultValue = value; + } + + public bool InvalidatesQuery + { + get => _invalidatesQuery; + set => _invalidatesQuery = value; + } + + public override TypeSchema AlternateType => _underlyingCollectionType; + + public void SetUnderlyingCollectionType(TypeSchema underlyingCollectionType) => _underlyingCollectionType = underlyingCollectionType; + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQueryRefreshMethodSchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQueryRefreshMethodSchema.cs new file mode 100644 index 0000000..1ac5a2c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQueryRefreshMethodSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataQueryRefreshMethodSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.UIX; + +namespace Microsoft.Iris.Markup +{ + internal class MarkupDataQueryRefreshMethodSchema : MethodSchema + { + public MarkupDataQueryRefreshMethodSchema(MarkupDataQuerySchema owner) + : base(owner) + { + } + + public override string Name => "Refresh"; + + public override TypeSchema[] ParameterTypes => TypeSchema.EmptyList; + + public override TypeSchema ReturnType => VoidSchema.Type; + + public override bool IsStatic => false; + + public override object Invoke(object instance, object[] parameters) + { + ((MarkupDataQuery)instance).Refresh(); + return null; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataQuerySchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataQuerySchema.cs new file mode 100644 index 0000000..9d65508 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataQuerySchema.cs @@ -0,0 +1,101 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataQuerySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class MarkupDataQuerySchema : ClassTypeSchema + { + private TypeSchema _resultType; + private string _providerName; + private MarkupDataQueryPreDefinedPropertySchema _resultProperty; + private MarkupDataQueryPreDefinedPropertySchema[] _predefinedProperties; + private MarkupDataQueryRefreshMethodSchema _refreshMethod; + + public MarkupDataQuerySchema(MarkupLoadResult owner, string name) + : base(owner, name) + { + } + + protected override void OnDispose() + { + base.OnDispose(); + if (_predefinedProperties != null) + { + foreach (DisposableObject predefinedProperty in _predefinedProperties) + predefinedProperty.Dispose(this); + } + if (_refreshMethod == null) + return; + _refreshMethod.Dispose(this); + } + + public override void BuildProperties() + { + base.BuildProperties(); + _predefinedProperties = new MarkupDataQueryPreDefinedPropertySchema[3] + { + _resultProperty = new MarkupDataQueryPreDefinedPropertySchema(this, _resultType != null ? _resultType : ObjectSchema.Type, "Result", new GetValueHandler(GetResultProperty), null), + new MarkupDataQueryPreDefinedPropertySchema(this, UIXLoadResultExports.DataQueryStatusType, "Status", new GetValueHandler(GetStatusProperty), null), + new MarkupDataQueryPreDefinedPropertySchema(this, BooleanSchema.Type, "Enabled", new GetValueHandler(GetEnabledProperty), new SetValueHandler(SetEnabledProperty)) + }; + _refreshMethod = new MarkupDataQueryRefreshMethodSchema(this); + } + + public override MarkupType MarkupType => MarkupType.DataQuery; + + protected override TypeSchema DefaultBase => MarkupDataQueryInstanceSchema.Type; + + public override Type RuntimeType => typeof(MarkupDataQuery); + + public override object ConstructDefault() + { + IDataProvider dataProvider = MarkupDataProvider.GetDataProvider(_providerName); + if (dataProvider != 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) + { + foreach (PropertySchema predefinedProperty in _predefinedProperties) + { + if (name == predefinedProperty.Name) + return predefinedProperty; + } + return base.FindProperty(name); + } + + public override MethodSchema FindMethod(string name, TypeSchema[] parameters) => _refreshMethod.Name == name && parameters.Length == 0 ? _refreshMethod : base.FindMethod(name, parameters); + + public string ProviderName + { + get => _providerName; + set => _providerName = value; + } + + public TypeSchema ResultType + { + get => _resultType; + set => _resultType = value; + } + + public bool InvalidatesQuery(string propertyName) => FindPropertyDeep(propertyName) is MarkupDataQueryPropertySchema propertyDeep && propertyDeep.InvalidatesQuery; + + private static object GetResultProperty(object instance) => ((MarkupDataQuery)instance).Result; + + private static object GetStatusProperty(object instance) => ((MarkupDataQuery)instance).Status; + + 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 new file mode 100644 index 0000000..7963532 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataType.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal abstract class MarkupDataType : MarkupDataTypeBaseObject + { + public MarkupDataType(MarkupDataTypeSchema type) + : base(type) + { + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataTypeBaseObject.cs b/UIX/Microsoft/Iris/Markup/MarkupDataTypeBaseObject.cs new file mode 100644 index 0000000..ec45760 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataTypeBaseObject.cs @@ -0,0 +1,67 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataTypeBaseObject +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Markup +{ + internal abstract class MarkupDataTypeBaseObject : + Class, + AssemblyObjectProxyHelper.IAssemblyProxyObject + { + protected MarkupDataTypeBaseObject(MarkupTypeSchema type) + : base(type) + { + } + + public override object ReadSymbol(SymbolReference symbolRef) + { + object obj; + return symbolRef.Origin == SymbolOrigin.Properties && ExternalObjectGetProperty(symbolRef.Symbol, out obj) ? obj : base.ReadSymbol(symbolRef); + } + + public override void WriteSymbol(SymbolReference symbolRef, object value) + { + if (symbolRef.Origin == SymbolOrigin.Properties && ExternalObjectSetProperty(symbolRef.Symbol, value)) + return; + base.WriteSymbol(symbolRef, value); + } + + public override object GetProperty(string name) + { + object obj; + return ExternalObjectGetProperty(name, out obj) ? obj : base.GetProperty(name); + } + + public override void SetProperty(string name, object value) + { + if (ExternalObjectSetProperty(name, value)) + return; + base.SetProperty(name, value); + } + + public void FireNotificationThreadSafe(string property) + { + property = NotifyService.CanonicalizeString(property); + _notifier.FireThreadSafe(property); + } + + protected virtual bool ExternalObjectGetProperty(string propertyName, out object value) + { + value = null; + return false; + } + + protected virtual bool ExternalObjectSetProperty(string propertyName, object value) => false; + + protected abstract IDataProviderBaseObject ExternalAssemblyObject { get; } + + object AssemblyObjectProxyHelper.IAssemblyProxyObject.AssemblyObject => ExternalAssemblyObject; + + public abstract IntPtr ExternalNativeObject { get; } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataTypePropertySchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataTypePropertySchema.cs new file mode 100644 index 0000000..940e430 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataTypePropertySchema.cs @@ -0,0 +1,25 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataTypePropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupDataTypePropertySchema : ClassPropertySchema + { + private TypeSchema _underlyingCollectionType; + + public MarkupDataTypePropertySchema( + MarkupTypeSchema owner, + string name, + TypeSchema propertyType) + : base(owner, name, propertyType) + { + } + + public override TypeSchema AlternateType => _underlyingCollectionType; + + public void SetUnderlyingCollectionType(TypeSchema underlyingCollectionType) => _underlyingCollectionType = underlyingCollectionType; + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDataTypeSchema.cs b/UIX/Microsoft/Iris/Markup/MarkupDataTypeSchema.cs new file mode 100644 index 0000000..7391aa5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDataTypeSchema.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDataTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.UIX; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class MarkupDataTypeSchema : ClassTypeSchema + { + public MarkupDataTypeSchema(MarkupLoadResult owner, string name) + : base(owner, name) + { + } + + public override object ConstructDefault() => new ProviderlessMarkupDataType(this); + + public override MarkupType MarkupType => MarkupType.DataType; + + protected override TypeSchema DefaultBase => MarkupDataTypeInstanceSchema.Type; + + public override Type RuntimeType => typeof(MarkupDataType); + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupDebugHelper.cs b/UIX/Microsoft/Iris/Markup/MarkupDebugHelper.cs new file mode 100644 index 0000000..a86f3b1 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupDebugHelper.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupDebugHelper +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; +using System.Diagnostics; + +namespace Microsoft.Iris.Markup +{ + internal static class MarkupDebugHelper + { + [Conditional("ENABLE_STATEDBG")] + public static void Shutdown() + { + } + + public static bool EnterDebugState( + bool wasInDebugState, + MarkupLoadResult loadResult, + int breakpointIndex, + IDictionary storage) + { + return false; + } + + [Conditional("ENABLE_STATEDBG")] + public static void LeaveDebugState() + { + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupEncoder.cs b/UIX/Microsoft/Iris/Markup/MarkupEncoder.cs new file mode 100644 index 0000000..0bb25ab --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupEncoder.cs @@ -0,0 +1,903 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupEncoder +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Debug; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.Markup.Validation; +using System.Collections; +using System.Diagnostics; + +namespace Microsoft.Iris.Markup +{ + internal class MarkupEncoder + { + private ByteCodeWriter _writer; + private MarkupConstantsTable _constantsTable; + private MarkupLineNumberTable _lineNumberTable; + private string _sourceFilePathBestGuess; + + public MarkupEncoder( + MarkupImportTables importTables, + MarkupConstantsTable constantsTable, + MarkupLineNumberTable lineNumberTable) + { + _constantsTable = constantsTable; + _lineNumberTable = lineNumberTable; + } + + public ByteCodeReader EncodeOBJECTSection( + ParseResult parseResult, + string uri, + string sourceFilePathBestGuess) + { + _sourceFilePathBestGuess = sourceFilePathBestGuess; + _writer = new ByteCodeWriter(); + if (parseResult.ClassList.Count > 0) + { + for (int index = 0; index < parseResult.ClassList.Count; ++index) + EncodeClass(parseResult.ClassList[index]); + } + ByteCodeReader reader = _writer.CreateReader(); + _writer = null; + return reader; + } + + private void EncodeClass(ValidateClass cls) + { + ValidateUI ui = null; + if (cls.ObjectType == UISchema.Type) + ui = (ValidateUI)cls; + ValidateEffect validateEffect = null; + if (cls.ObjectType == EffectSchema.Type) + validateEffect = (ValidateEffect)cls; + if (cls.IndirectedObject == null) + { + int totalInitialEvaluates = 0; + int totalFinalEvaluates = 0; + if (cls.ActionList.Count > 0) + EncodeScript(cls.ActionList, out totalInitialEvaluates, out totalFinalEvaluates); + if (cls.TriggerList.Count > 0) + EncodeListenerGroupRefresh(cls); + if (cls.MethodList != null && cls.MethodList.Count > 0) + EncodeMethods(cls.TypeExport, cls.MethodList); + if (cls.FoundPropertiesValidateProperty != null) + { + uint offset = GetOffset(); + cls.TypeExport.SetInitializePropertiesOffset(offset); + EncodeInitializeProperty(cls.FoundPropertiesValidateProperty); + cls.RemoveProperty(cls.FoundPropertiesValidateProperty); + _writer.WriteByte(OpCode.ReturnVoid); + } + if (ui != null && ui.FoundContentValidateProperty != null) + { + uint offset = GetOffset(); + cls.TypeExport.SetInitializeContentOffset(offset); + EncodeInitializeProperty(ui.FoundContentValidateProperty); + cls.RemoveProperty(ui.FoundContentValidateProperty); + _writer.WriteByte(OpCode.ReturnVoid); + } + if (validateEffect != null) + EncodeTechniquesProperty((EffectClassTypeSchema)cls.TypeExport, validateEffect); + uint offset1 = GetOffset(); + cls.TypeExport.SetInitializeLocalsInputOffset(offset1); + for (ValidateProperty property = cls.PropertyList; property != null; property = property.Next) + EncodeInitializeProperty(property); + if (cls.TypeExport.ListenerCount > 0U) + EncodeListenerInitialize(cls); + if (totalInitialEvaluates > 0) + EstablishInitialOrFinalEvaluateOffsets(cls, totalInitialEvaluates, true); + if (totalFinalEvaluates > 0) + EstablishInitialOrFinalEvaluateOffsets(cls, totalFinalEvaluates, false); + _writer.WriteByte(OpCode.ReturnVoid); + if (ui == null) + return; + EncodeNamedContent(ui); + } + else + { + EncodeObjectBySource(cls.IndirectedObject); + _writer.WriteByte(OpCode.ReturnValue); + } + } + + private void EncodeConstructObject(ValidateObjectTag objectTag) + { + if (objectTag.IndirectedObject == null) + { + if (objectTag.DynamicConstructionType != null) + { + EncodeObjectBySource(objectTag.DynamicConstructionType); + _writer.WriteByte(OpCode.ConstructObjectIndirect); + _writer.WriteUInt16(objectTag.FoundTypeIndex); + bool forceVerifyValues = objectTag.FoundType is MarkupTypeSchema; + EncodeInitializeProperties(objectTag, forceVerifyValues); + EncodeObjectBySource(objectTag.DynamicConstructionType); + if (!objectTag.FoundType.HasInitializer) + return; + _writer.WriteByte(OpCode.InitializeInstanceIndirect); + } + else + { + _writer.WriteByte(OpCode.ConstructObject); + _writer.WriteUInt16(objectTag.FoundTypeIndex); + EncodeInitializeProperties(objectTag); + EncodeInitializeInstance(objectTag.FoundType, objectTag.FoundTypeIndex); + } + } + else + EncodeObjectBySource(objectTag.IndirectedObject); + } + + private void EncodeInitializeProperties(ValidateObjectTag objectTag) => EncodeInitializeProperties(objectTag, false); + + private void EncodeInitializeProperties(ValidateObjectTag objectTag, bool forceVerifyValues) + { + if (objectTag.PropertyCount <= 0) + return; + for (ValidateProperty property = objectTag.PropertyList; property != null; property = property.Next) + EncodeInitializeProperty(property, objectTag.DynamicConstructionType); + } + + private void EncodeInitializeInstance(TypeSchema type, int typeIndex) + { + if (!type.HasInitializer) + return; + _writer.WriteByte(OpCode.InitializeInstance); + _writer.WriteUInt16(typeIndex); + } + + private void EncodeInitializeProperty(ValidateProperty property) => EncodeInitializeProperty(property, null); + + private void EncodeInitializeProperty( + ValidateProperty property, + ValidateObject dynamicConstructionType) + { + if (property.IsPseudo) + return; + if (property.ValueApplyMode == ValueApplyMode.SingleValueSet) + { + EncodeObjectBySource(property.Value); + RecordLineNumber(property); + if (dynamicConstructionType == null) + { + _writer.WriteByte(OpCode.PropertyInitialize); + _writer.WriteUInt16(property.FoundPropertyIndex); + } + else + { + EncodeObjectBySource(dynamicConstructionType); + _writer.WriteByte(OpCode.PropertyInitializeIndirect); + _writer.WriteUInt16(property.FoundPropertyIndex); + } + } + else + { + if ((property.ValueApplyMode & ValueApplyMode.CollectionPopulateAndSet) != ValueApplyMode.SingleValueSet) + { + _writer.WriteByte(OpCode.ConstructObject); + _writer.WriteUInt16(property.FoundPropertyTypeIndex); + } + for (ValidateObjectTag next = (ValidateObjectTag)property.Value; next != null; next = next.Next) + { + if (!next.PropertyIsRequiredForCreation) + { + uint fixUpLocation = uint.MaxValue; + if (property.ShouldSkipDictionaryAddIfContains) + { + _writer.WriteByte(OpCode.JumpIfDictionaryContains); + _writer.WriteUInt16((property.ValueApplyMode & ValueApplyMode.CollectionAdd) != ValueApplyMode.SingleValueSet ? property.FoundPropertyIndex : -1); + _writer.WriteUInt16(_constantsTable.Add(StringSchema.Type, next.Name, MarkupConstantPersistMode.Binary)); + fixUpLocation = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + } + EncodeConstructObject(next); + if ((property.ValueApplyMode & ValueApplyMode.MultiValueDictionary) != ValueApplyMode.SingleValueSet) + { + _writer.WriteByte(OpCode.PropertyDictionaryAdd); + _writer.WriteUInt16((property.ValueApplyMode & ValueApplyMode.CollectionAdd) != ValueApplyMode.SingleValueSet ? property.FoundPropertyIndex : -1); + _writer.WriteUInt16(_constantsTable.Add(StringSchema.Type, next.Name, MarkupConstantPersistMode.Binary)); + } + else + { + _writer.WriteByte(OpCode.PropertyListAdd); + _writer.WriteUInt16((property.ValueApplyMode & ValueApplyMode.CollectionAdd) != ValueApplyMode.SingleValueSet ? property.FoundPropertyIndex : -1); + } + if (fixUpLocation != uint.MaxValue) + FixUpJumpOffset(fixUpLocation); + } + } + if ((property.ValueApplyMode & ValueApplyMode.CollectionPopulateAndSet) == ValueApplyMode.SingleValueSet) + return; + if (dynamicConstructionType == null) + { + _writer.WriteByte(OpCode.PropertyInitialize); + _writer.WriteUInt16(property.FoundPropertyIndex); + } + else + { + EncodeObjectBySource(dynamicConstructionType); + RecordLineNumber(property); + _writer.WriteByte(OpCode.PropertyInitializeIndirect); + _writer.WriteUInt16(property.FoundPropertyIndex); + } + } + } + + private void EncodeObjectBySource(ValidateObject obj) + { + switch (obj.ObjectSourceType) + { + case ObjectSourceType.ObjectTag: + EncodeConstructObject((ValidateObjectTag)obj); + break; + case ObjectSourceType.FromString: + EncodeFromString((ValidateFromString)obj); + break; + case ObjectSourceType.Code: + EncodeCode((ValidateCode)obj); + break; + case ObjectSourceType.Expression: + EncodeExpression((ValidateExpression)obj, null); + break; + } + } + + private void EncodeFromString(ValidateFromString fromString) + { + if (fromString.ObjectType.IsRuntimeImmutable) + { + MarkupConstantPersistMode persistMode; + object persistData; + if (fromString.ObjectType.SupportsBinaryEncoding) + { + persistMode = MarkupConstantPersistMode.Binary; + persistData = fromString.FromStringInstance; + } + else + { + persistMode = MarkupConstantPersistMode.FromString; + persistData = fromString.FromString; + } + int rawValue = _constantsTable.Add(fromString.ObjectType, fromString.FromStringInstance, persistMode, persistData); + _writer.WriteByte(OpCode.PushConstant); + _writer.WriteUInt16(rawValue); + } + else if (fromString.ObjectType.SupportsBinaryEncoding) + { + _writer.WriteByte(OpCode.ConstructFromBinary); + _writer.WriteUInt16(fromString.TypeHintIndex); + fromString.ObjectType.EncodeBinary(_writer, fromString.FromStringInstance); + } + else + { + int rawValue = _constantsTable.Add(StringSchema.Type, fromString.FromString, MarkupConstantPersistMode.FromString); + _writer.WriteByte(OpCode.ConstructFromString); + _writer.WriteUInt16(fromString.TypeHintIndex); + _writer.WriteUInt16(rawValue); + } + } + + private void EncodeCanonicalInstance(object instance, TypeSchema type, string memberName) + { + int rawValue = _constantsTable.Add(type, instance, MarkupConstantPersistMode.Canonical, memberName); + _writer.WriteByte(OpCode.PushConstant); + _writer.WriteUInt16(rawValue); + } + + private void EncodeNamedContent(ValidateUI ui) + { + if (ui.FoundNamedContentProperties == null) + return; + NamedContentRecord[] namedContentTable = ((UIClassTypeSchema)ui.TypeExport).NamedContentTable; + int index = 0; + foreach (ValidateProperty namedContentProperty in ui.FoundNamedContentProperties) + { + uint offset = GetOffset(); + namedContentTable[index].SetOffset(offset); + EncodeObjectBySource(namedContentProperty.Value); + _writer.WriteByte(OpCode.ReturnValue); + ++index; + } + } + + private void EncodeCode(ValidateCode code) + { + uint offset = GetOffset(); + code.TrackEncodingOffset(offset); + EncodeStatement(code.StatementCompound); + if (code.ReturnStatements != null) + { + foreach (ValidateStatementReturn returnStatement in code.ReturnStatements) + { + if (!returnStatement.IsTrailingReturn) + FixUpJumpOffset(returnStatement.JumpFixupOffset); + } + } + if (code.Embedded) + return; + if (code.ObjectType != VoidSchema.Type) + _writer.WriteByte(OpCode.ReturnValue); + else + _writer.WriteByte(OpCode.ReturnVoid); + } + + private void EncodeStatement(ValidateStatement statement) + { + RecordLineNumber(statement); + if (statement.StatementType != StatementType.Compound) + DeclareDebugPoint(statement.Line, statement.Column); + switch (statement.StatementType) + { + case StatementType.Assignment: + ValidateStatementAssignment statementAssignment = (ValidateStatementAssignment)statement; + if (statementAssignment.DeclaredScopedLocal != null) + EncodeStatement(statementAssignment.DeclaredScopedLocal); + EncodeExpression(statementAssignment.RValue); + EncodeExpression(statementAssignment.LValue); + _writer.WriteByte(OpCode.DiscardValue); + break; + case StatementType.Expression: + ValidateStatementExpression statementExpression = (ValidateStatementExpression)statement; + EncodeExpression(statementExpression.Expression); + if (statementExpression.Expression.ObjectType == VoidSchema.Type) + break; + _writer.WriteByte(OpCode.DiscardValue); + break; + case StatementType.ForEach: + ValidateStatementForEach statementForEach = (ValidateStatementForEach)statement; + EncodeScopedLocal(statementForEach.ScopedLocal); + EncodeExpression(statementForEach.Expression); + _writer.WriteByte(OpCode.MethodInvoke); + _writer.WriteUInt16(statementForEach.FoundGetEnumeratorIndex); + uint offset1 = GetOffset(); + _writer.WriteByte(OpCode.MethodInvokePeek); + _writer.WriteUInt16(statementForEach.FoundMoveNextIndex); + _writer.WriteByte(OpCode.JumpIfFalse); + uint offset2 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + _writer.WriteByte(OpCode.PropertyGetPeek); + _writer.WriteUInt16(statementForEach.FoundCurrentIndex); + _writer.WriteByte(OpCode.VerifyTypeCast); + _writer.WriteUInt16(statementForEach.ScopedLocal.FoundTypeIndex); + _writer.WriteByte(OpCode.WriteSymbol); + _writer.WriteUInt16(statementForEach.ScopedLocal.FoundSymbolIndex); + EncodeStatement(statementForEach.StatementCompound); + _writer.WriteByte(OpCode.Jump); + _writer.WriteUInt32(offset1); + FixUpJumpOffset(offset2); + uint offset3 = GetOffset(); + _writer.WriteByte(OpCode.DiscardValue); + EncodeScopedLocalsWipe(statementForEach.ScopedLocalsToClear); + foreach (ValidateStatementBreak breakStatement in statementForEach.BreakStatements) + { + if (breakStatement.IsContinue) + FixUpJumpOffset(breakStatement.JumpFixupOffset, offset1); + else + FixUpJumpOffset(breakStatement.JumpFixupOffset, offset3); + } + break; + case StatementType.While: + ValidateStatementWhile validateStatementWhile = (ValidateStatementWhile)statement; + uint offset4 = GetOffset(); + if (validateStatementWhile.IsDoWhile) + EncodeStatement(validateStatementWhile.Body); + EncodeExpression(validateStatementWhile.Condition); + _writer.WriteByte(OpCode.JumpIfFalse); + uint offset5 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + if (!validateStatementWhile.IsDoWhile) + EncodeStatement(validateStatementWhile.Body); + _writer.WriteByte(OpCode.Jump); + _writer.WriteUInt32(offset4); + FixUpJumpOffset(offset5); + uint offset6 = GetOffset(); + foreach (ValidateStatementBreak breakStatement in validateStatementWhile.BreakStatements) + { + if (breakStatement.IsContinue) + FixUpJumpOffset(breakStatement.JumpFixupOffset, offset4); + else + FixUpJumpOffset(breakStatement.JumpFixupOffset, offset6); + } + break; + case StatementType.If: + ValidateStatementIf validateStatementIf = (ValidateStatementIf)statement; + EncodeExpression(validateStatementIf.Condition); + _writer.WriteByte(OpCode.JumpIfFalse); + uint offset7 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + EncodeStatement(validateStatementIf.StatementCompound); + FixUpJumpOffset(offset7); + break; + case StatementType.IfElse: + ValidateStatementIfElse validateStatementIfElse = (ValidateStatementIfElse)statement; + EncodeExpression(validateStatementIfElse.Condition); + _writer.WriteByte(OpCode.JumpIfFalse); + uint offset8 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + EncodeStatement(validateStatementIfElse.StatementCompoundTrue); + _writer.WriteByte(OpCode.Jump); + uint offset9 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + FixUpJumpOffset(offset8); + EncodeStatement(validateStatementIfElse.StatementCompoundFalse); + FixUpJumpOffset(offset9); + break; + case StatementType.Return: + ValidateStatementReturn validateStatementReturn = (ValidateStatementReturn)statement; + if (validateStatementReturn.Expression != null) + EncodeExpression(validateStatementReturn.Expression); + if (validateStatementReturn.IsTrailingReturn) + break; + EncodeScopedLocalsWipe(validateStatementReturn.ScopedLocalsToClear); + _writer.WriteByte(OpCode.Jump); + uint offset10 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + validateStatementReturn.TrackJumpFixupOffset(offset10); + break; + case StatementType.ScopedLocal: + EncodeScopedLocal((ValidateStatementScopedLocal)statement); + break; + case StatementType.Compound: + ValidateStatementCompound statementCompound = (ValidateStatementCompound)statement; + for (ValidateStatement statement1 = statementCompound.StatementList; statement1 != null; statement1 = statement1.Next) + EncodeStatement(statement1); + EncodeScopedLocalsWipe(statementCompound.ScopedLocalsToClear); + break; + case StatementType.Break: + ValidateStatementBreak validateStatementBreak = (ValidateStatementBreak)statement; + EncodeScopedLocalsWipe(validateStatementBreak.ScopedLocalsToClear); + _writer.WriteByte(OpCode.Jump); + uint offset11 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + validateStatementBreak.TrackJumpFixupOffset(offset11); + break; + } + } + + private void EncodeExpression(ValidateExpression expression) => EncodeExpression(expression, null); + + private void EncodeExpression( + ValidateExpression expression, + ListenerEncodeMode listenerEncodeMode) + { + RecordLineNumber(expression); + expression.TrackEncodingOffset(GetOffset()); + switch (expression.ExpressionType) + { + case ExpressionType.Assignment: + ValidateExpressionAssignment expressionAssignment = (ValidateExpressionAssignment)expression; + if (!expressionAssignment.IsIndexAssignment) + EncodeExpression(expressionAssignment.RValue); + EncodeExpression(expressionAssignment.LValue); + break; + case ExpressionType.Symbol: + bool flag1 = true; + ValidateExpressionSymbol expressionSymbol = (ValidateExpressionSymbol)expression; + if (expressionSymbol.NotifyIndex >= 0 && listenerEncodeMode != null) + { + EncodeListenerHookup(listenerEncodeMode, expressionSymbol.NotifyIndex, ListenerType.Symbol, expressionSymbol.FoundSymbolIndex, expressionSymbol.IsNotifierRoot); + flag1 = !expressionSymbol.IsNotifierRoot; + } + if (!flag1) + break; + _writer.WriteByte(expressionSymbol.Usage != ExpressionUsage.RValue ? OpCode.WriteSymbolPeek : OpCode.LookupSymbol); + _writer.WriteUInt16(expressionSymbol.FoundSymbolIndex); + break; + case ExpressionType.Call: + ValidateExpressionCall validateExpressionCall = (ValidateExpressionCall)expression; + bool flag2 = false; + if (validateExpressionCall.Target != null) + { + EncodeExpression(validateExpressionCall.Target, listenerEncodeMode); + flag2 = true; + } + switch (validateExpressionCall.FoundMemberType) + { + case SchemaType.Property: + bool flag3 = true; + if (validateExpressionCall.NotifyIndex >= 0 && listenerEncodeMode != null) + { + EncodeListenerHookup(listenerEncodeMode, validateExpressionCall.NotifyIndex, ListenerType.Property, validateExpressionCall.FoundMemberIndex, validateExpressionCall.IsNotifierRoot); + flag3 = !validateExpressionCall.IsNotifierRoot; + } + if (!flag3) + return; + OpCode opCode = validateExpressionCall.Usage != ExpressionUsage.RValue ? (flag2 ? OpCode.PropertyAssign : OpCode.PropertyAssignStatic) : (flag2 ? OpCode.PropertyGet : OpCode.PropertyGetStatic); + RecordLineNumber(expression); + _writer.WriteByte(opCode); + _writer.WriteUInt16(validateExpressionCall.FoundMemberIndex); + return; + case SchemaType.Method: + if (validateExpressionCall.ParameterList != ValidateParameter.EmptyList) + { + for (ValidateParameter validateParameter = validateExpressionCall.ParameterList; validateParameter != null; validateParameter = validateParameter.Next) + EncodeExpression(validateParameter.Expression); + } + RecordLineNumber(expression); + _writer.WriteByte(validateExpressionCall.IsIndexAssignment ? (flag2 ? OpCode.MethodInvokePushLastParam : OpCode.MethodInvokeStaticPushLastParam) : (flag2 ? OpCode.MethodInvoke : OpCode.MethodInvokeStatic)); + _writer.WriteUInt16(validateExpressionCall.FoundMemberIndex); + return; + case SchemaType.Event: + if (validateExpressionCall.NotifyIndex < 0 || listenerEncodeMode == null) + return; + EncodeListenerHookup(listenerEncodeMode, validateExpressionCall.NotifyIndex, ListenerType.Event, validateExpressionCall.FoundMemberIndex, validateExpressionCall.IsNotifierRoot); + return; + case SchemaType.CanonicalInstance: + EncodeCanonicalInstance(validateExpressionCall.FoundCanonicalInstance, validateExpressionCall.ObjectType, validateExpressionCall.MemberName); + return; + default: + return; + } + case ExpressionType.Cast: + ValidateExpressionCast validateExpressionCast = (ValidateExpressionCast)expression; + EncodeExpression(validateExpressionCast.Castee, listenerEncodeMode); + RecordLineNumber(expression); + if (validateExpressionCast.FoundCastMethod == CastMethod.Cast) + { + _writer.WriteByte(OpCode.VerifyTypeCast); + _writer.WriteUInt16(validateExpressionCast.FoundTypeCastIndex); + break; + } + _writer.WriteByte(OpCode.ConvertType); + _writer.WriteUInt16(validateExpressionCast.FoundTypeCastIndex); + _writer.WriteUInt16(validateExpressionCast.FoundCasteeTypeIndex); + break; + case ExpressionType.New: + ValidateExpressionNew validateExpressionNew = (ValidateExpressionNew)expression; + if (!validateExpressionNew.IsParameterizedConstruction) + { + _writer.WriteByte(OpCode.ConstructObject); + _writer.WriteUInt16(validateExpressionNew.FoundConstructTypeIndex); + } + else + { + for (ValidateParameter validateParameter = validateExpressionNew.ParameterList; validateParameter != null; validateParameter = validateParameter.Next) + EncodeExpression(validateParameter.Expression); + RecordLineNumber(expression); + _writer.WriteByte(OpCode.ConstructObjectParam); + _writer.WriteUInt16(validateExpressionNew.FoundConstructTypeIndex); + _writer.WriteUInt16(validateExpressionNew.FoundParameterizedConstructorIndex); + } + EncodeInitializeInstance(validateExpressionNew.FoundConstructType, validateExpressionNew.FoundConstructTypeIndex); + break; + case ExpressionType.Operation: + ValidateExpressionOperation expressionOperation = (ValidateExpressionOperation)expression; + EncodeExpression(expressionOperation.LeftSide); + uint fixUpLocation = uint.MaxValue; + if (expressionOperation.FoundOperationTargetType == BooleanSchema.Type && (expressionOperation.Op == OperationType.LogicalAnd || expressionOperation.Op == OperationType.LogicalOr)) + { + RecordLineNumber(expression); + _writer.WriteByte(expressionOperation.Op == OperationType.LogicalOr ? OpCode.JumpIfTruePeek : OpCode.JumpIfFalsePeek); + fixUpLocation = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + } + if (expressionOperation.RightSide != null) + EncodeExpression(expressionOperation.RightSide); + RecordLineNumber(expression); + _writer.WriteByte(OpCode.Operation); + _writer.WriteUInt16(expressionOperation.FoundOperationTargetTypeIndex); + _writer.WriteByte((byte)expressionOperation.Op); + if (fixUpLocation == uint.MaxValue) + break; + FixUpJumpOffset(fixUpLocation); + break; + case ExpressionType.IsCheck: + ValidateExpressionIsCheck expressionIsCheck = (ValidateExpressionIsCheck)expression; + EncodeExpression(expressionIsCheck.Expression); + RecordLineNumber(expression); + _writer.WriteByte(OpCode.IsCheck); + _writer.WriteUInt16(expressionIsCheck.TypeIdentifier.FoundTypeIndex); + break; + case ExpressionType.As: + ValidateExpressionAs validateExpressionAs = (ValidateExpressionAs)expression; + EncodeExpression(validateExpressionAs.Expression); + RecordLineNumber(expression); + _writer.WriteByte(OpCode.As); + _writer.WriteUInt16(validateExpressionAs.TypeIdentifier.FoundTypeIndex); + break; + case ExpressionType.Constant: + ValidateExpressionConstant expressionConstant = (ValidateExpressionConstant)expression; + if (expressionConstant.ConstantType != ConstantType.Null) + { + int rawValue = _constantsTable.Add(expressionConstant.ObjectType, expressionConstant.FoundConstant, MarkupConstantPersistMode.Binary); + _writer.WriteByte(OpCode.PushConstant); + _writer.WriteUInt16(rawValue); + break; + } + _writer.WriteByte(OpCode.PushNull); + break; + case ExpressionType.DeclareTrigger: + EncodeExpression(((ValidateExpressionDeclareTrigger)expression).Expression); + break; + case ExpressionType.TypeOf: + ValidateExpressionTypeOf expressionTypeOf = (ValidateExpressionTypeOf)expression; + _writer.WriteByte(OpCode.TypeOf); + _writer.WriteUInt16(expressionTypeOf.TypeIdentifier.FoundTypeIndex); + break; + case ExpressionType.List: + ArrayList expressions = ((ValidateExpressionList)expression).Expressions; + for (int index = 0; index < expressions.Count; ++index) + { + ValidateExpression expression1 = (ValidateExpression)expressions[index]; + EncodeExpression(expression1); + if (index < expressions.Count - 1 && expression1.ObjectType != VoidSchema.Type) + _writer.WriteByte(OpCode.DiscardValue); + } + break; + case ExpressionType.Index: + EncodeExpression(((ValidateExpressionIndex)expression).CallExpression); + break; + case ExpressionType.Ternary: + ValidateExpressionTernary expressionTernary = (ValidateExpressionTernary)expression; + EncodeExpression(expressionTernary.Condition); + _writer.WriteByte(OpCode.JumpIfFalse); + uint offset1 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + EncodeExpression(expressionTernary.TrueClause); + _writer.WriteByte(OpCode.Jump); + uint offset2 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + FixUpJumpOffset(offset1); + EncodeExpression(expressionTernary.FalseClause); + FixUpJumpOffset(offset2); + break; + case ExpressionType.NullCoalescing: + ValidateExpressionNullCoalescing expressionNullCoalescing = (ValidateExpressionNullCoalescing)expression; + EncodeExpression(expressionNullCoalescing.Condition); + _writer.WriteByte(OpCode.JumpIfNullPeek); + uint offset3 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + _writer.WriteByte(OpCode.Jump); + uint offset4 = GetOffset(); + _writer.WriteUInt32(uint.MaxValue); + FixUpJumpOffset(offset3); + _writer.WriteByte(OpCode.DiscardValue); + EncodeExpression(expressionNullCoalescing.NullClause); + FixUpJumpOffset(offset4); + break; + case ExpressionType.This: + case ExpressionType.BaseClass: + _writer.WriteByte(OpCode.PushThis); + break; + } + } + + private void EncodeScopedLocal(ValidateStatementScopedLocal statementScopedLocal) + { + if (statementScopedLocal.HasInitialAssignment) + return; + if (!statementScopedLocal.FoundType.IsNullAssignable) + { + _writer.WriteByte(OpCode.ConstructObject); + _writer.WriteUInt16(statementScopedLocal.FoundTypeIndex); + } + else + _writer.WriteByte(OpCode.PushNull); + _writer.WriteByte(OpCode.WriteSymbol); + _writer.WriteUInt16(statementScopedLocal.FoundSymbolIndex); + } + + private void EncodeScopedLocalsWipe(Vector scopedLocalsToClear) + { + if (scopedLocalsToClear == null) + return; + foreach (int rawValue in scopedLocalsToClear) + { + _writer.WriteByte(OpCode.ClearSymbol); + _writer.WriteUInt16(rawValue); + } + } + + private bool EncodeListenerHookup( + ListenerEncodeMode listenerEncodeMode, + int localListenerIndex, + ListenerType listenerType, + int targetIndex, + bool isRoot) + { + uint rawValue = listenerEncodeMode.SequentialListenerIndex((uint)localListenerIndex); + if (isRoot) + { + _writer.WriteByte(OpCode.Listen); + _writer.WriteUInt16(rawValue); + _writer.WriteByte((byte)listenerType); + _writer.WriteUInt16(targetIndex); + _writer.WriteUInt32(listenerEncodeMode.ScriptId); + } + else + { + uint num = listenerEncodeMode.RunOnNonTailTrigger ? listenerEncodeMode.ScriptId : uint.MaxValue; + _writer.WriteByte(OpCode.DestructiveListen); + _writer.WriteUInt16(rawValue); + _writer.WriteByte((byte)listenerType); + _writer.WriteUInt16(targetIndex); + _writer.WriteUInt32(num); + _writer.WriteUInt32(listenerEncodeMode.RefreshId); + } + return isRoot; + } + + private void EncodeScript( + Vector actionList, + out int totalInitialEvaluates, + out int totalFinalEvaluates) + { + totalInitialEvaluates = 0; + totalFinalEvaluates = 0; + foreach (ValidateCode action in actionList) + { + if (action.InitialEvaluate) + ++totalInitialEvaluates; + if (action.FinalEvaluate) + ++totalFinalEvaluates; + EncodeCode(action); + } + } + + private void EncodeMethods(MarkupTypeSchema typeSchema, ArrayList methodList) + { + foreach (ValidateMethod method in methodList) + { + uint offset = GetOffset(); + EncodeCode(method.Body); + uint codeOffset = typeSchema.EncodeScriptOffsetAsId(offset); + method.MethodExport.SetCodeOffset(codeOffset); + } + } + + private void EncodeListenerGroupRefresh(ValidateClass cls) + { + Vector triggerList = cls.TriggerList; + ListenerEncodeMode listenerEncodeMode = new ListenerEncodeMode(cls.TypeExport); + foreach (TriggerRecord triggerRecord in triggerList) + { + listenerEncodeMode.TriggerContainer = triggerRecord; + EncodeExpression(triggerRecord.SourceExpression, listenerEncodeMode); + _writer.WriteByte(37); + } + } + + private void EncodeListenerInitialize(ValidateClass cls) + { + _writer.WriteByte(OpCode.ConstructListenerStorage); + _writer.WriteUInt16(cls.TypeExport.ListenerCount); + Vector triggerList = cls.TriggerList; + uint[] refreshGroupOffsets = new uint[triggerList.Count]; + for (int index = 0; index < triggerList.Count; ++index) + { + TriggerRecord triggerRecord = triggerList[index]; + refreshGroupOffsets[index] = triggerRecord.SourceExpression.EncodeStartOffset; + } + cls.TypeExport.SetRefreshListenerGroupOffsets(refreshGroupOffsets); + } + + private void EstablishInitialOrFinalEvaluateOffsets( + ValidateClass cls, + int totalEvaluates, + bool isInitialEvaluate) + { + Vector actionList = cls.ActionList; + uint[] numArray = new uint[totalEvaluates]; + int num = 0; + foreach (ValidateCode validateCode in actionList) + { + if (isInitialEvaluate && validateCode.InitialEvaluate || !isInitialEvaluate && validateCode.FinalEvaluate) + numArray[num++] = validateCode.EncodeStartOffset; + } + if (isInitialEvaluate) + cls.TypeExport.SetInitialEvaluateOffsets(numArray); + else + cls.TypeExport.SetFinalEvaluateOffsets(numArray); + } + + private void EncodeTechniquesProperty( + EffectClassTypeSchema typeExport, + ValidateEffect validateEffect) + { + ValidateProperty validateProperty = validateEffect.FoundTechniquesValidateProperty; + if (validateProperty == null) + return; + int length = 0; + ValidateObjectTag validateObjectTag1 = validateProperty.Value as ValidateObjectTag; + for (ValidateObjectTag validateObjectTag2 = validateObjectTag1; validateObjectTag2 != null; validateObjectTag2 = validateObjectTag2.Next) + ++length; + uint[] techniqueOffsets = new uint[length]; + int num = 0; + for (ValidateObjectTag objectTag = validateObjectTag1; objectTag != null; objectTag = objectTag.Next) + { + techniqueOffsets[num++] = GetOffset(); + EncodeConstructObject(objectTag); + _writer.WriteByte(OpCode.ReturnValue); + } + typeExport.SetTechniqueOffsets(techniqueOffsets); + validateEffect.RemoveProperty(validateEffect.FoundTechniquesValidateProperty); + if (validateEffect.FoundInstancePropertyAssignments == null) + return; + uint[] instancePropertyAssignments = new uint[length]; + for (int index = 0; index < length; ++index) + instancePropertyAssignments[index] = GetOffset(); + foreach (KeyValueEntry propertyAssignment in validateEffect.FoundInstancePropertyAssignments) + { + int elementSymbolIndex = validateEffect.GetElementSymbolIndex(propertyAssignment.Key); + _writer.WriteByte(OpCode.LookupSymbol); + _writer.WriteUInt16(elementSymbolIndex); + for (ValidateProperty next = propertyAssignment.Value; next != null; next = next.Next) + EncodeInitializeProperty(next); + _writer.WriteByte(OpCode.DiscardValue); + } + _writer.WriteByte(OpCode.ReturnVoid); + typeExport.SetInstancePropertyAssignments(instancePropertyAssignments); + } + + private uint GetOffset() => _writer.DataSize; + + private void FixUpJumpOffset(uint fixUpLocation, uint fixedOffset) => _writer.Overwrite(fixUpLocation, fixedOffset); + + private void FixUpJumpOffset(uint fixUpLocation) => FixUpJumpOffset(fixUpLocation, GetOffset()); + + private void RecordLineNumber(Validate validate) => _lineNumberTable.AddRecord(GetOffset(), validate.Line, validate.Column); + + [Conditional("DEBUG")] + private void DEBUG_EmitStart() + { + } + + [Conditional("DEBUG")] + private void DEBUG_EmitStop(OpCode opCode) => Debug.Trace.IsCategoryEnabled(TraceCategory.MarkupEncoding); + + [Conditional("DEBUG")] + private void DEBUG_EmitStop(OpCode opCode, object param) => Debug.Trace.IsCategoryEnabled(TraceCategory.MarkupEncoding); + + [Conditional("DEBUG")] + private void DEBUG_EmitStop(OpCode opCode, object param, object param2) => Debug.Trace.IsCategoryEnabled(TraceCategory.MarkupEncoding); + + [Conditional("DEBUG")] + private void DEBUG_EmitStop(OpCode opCode, object param, object param2, object param3) => Debug.Trace.IsCategoryEnabled(TraceCategory.MarkupEncoding); + + [Conditional("DEBUG")] + private void DEBUG_EmitStop( + OpCode opCode, + object param, + object param2, + object param3, + object param4) + { + Debug.Trace.IsCategoryEnabled(TraceCategory.MarkupEncoding); + } + + [Conditional("DEBUG")] + private void DEBUG_EmitStop( + OpCode opCode, + object param, + object param2, + object param3, + object param4, + object param5) + { + Debug.Trace.IsCategoryEnabled(TraceCategory.MarkupEncoding); + } + + [Conditional("DEBUG")] + private void DEBUG_EmitStopWorker( + OpCode opCode, + object data0, + object data1, + object data2, + object data3, + object data4) + { + } + + [Conditional("DEBUG")] + private void DEBUG_ReportFixup(uint fixupLocation, uint value) + { + } + + private void DeclareDebugPoint(int line, int column) + { + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupError.cs b/UIX/Microsoft/Iris/Markup/MarkupError.cs new file mode 100644 index 0000000..83f6f2b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupError.cs @@ -0,0 +1,40 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupError +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup +{ + internal class MarkupError + { + private ErrorRecord _error; + private string _context; + + internal MarkupError(ErrorRecord error) + { + _error = error; + _context = error.Context; + if (_context == null || error.Line == -1) + return; + if (error.Column != -1) + _context = string.Format("{0} ({1},{2})", _context, error.Line, error.Column); + else + _context = string.Format("{0} ({1})", _context, error.Line); + } + + public bool IsError => !_error.Warning; + + public string Message => _error.Message; + + public string Context => _context; + + public string Uri => _error.Context; + + public int Line => _error.Line; + + public int Column => _error.Column; + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupImportTables.cs b/UIX/Microsoft/Iris/Markup/MarkupImportTables.cs new file mode 100644 index 0000000..57044e5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupImportTables.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupImportTables +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupImportTables + { + public TypeSchema[] TypeImports = TypeSchema.EmptyList; + public ConstructorSchema[] ConstructorImports = ConstructorSchema.EmptyList; + public PropertySchema[] PropertyImports = PropertySchema.EmptyList; + public MethodSchema[] MethodImports = MethodSchema.EmptyList; + public EventSchema[] EventImports = EventSchema.EmptyList; + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupLineNumberTable.cs b/UIX/Microsoft/Iris/Markup/MarkupLineNumberTable.cs new file mode 100644 index 0000000..7d2b495 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupLineNumberTable.cs @@ -0,0 +1,78 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupLineNumberTable +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Diagnostics; + +namespace Microsoft.Iris.Markup +{ + internal class MarkupLineNumberTable + { + private const ulong OFFSET_MASK = 4194303; + private const uint OFFSET_MAX = 4194303; + private const ulong LINE_MASK = 8796088827904; + private const int LINE_SHIFT = 22; + private const uint LINE_MAX = 2097151; + private const ulong COLUMN_MASK = 18446735277616529408; + private const int COLUMN_SHIFT = 43; + private const uint COLUMN_MAX = 2097151; + private Vector _lookupTable; + private ulong[] _runtimeList; + + public MarkupLineNumberTable() => _lookupTable = new Vector(); + + public MarkupLineNumberTable(ulong[] runtimeList) => _runtimeList = runtimeList; + + public void AddRecord(uint offset, int line, int column) + { + ulong num = Pack(offset, line, column); + if (_lookupTable.Count > 0 && (int)UnpackOffset(_lookupTable[_lookupTable.Count - 1]) == (int)offset) + _lookupTable[_lookupTable.Count - 1] = num; + else + _lookupTable.Add(num); + } + + public void PrepareForRuntimeUse() + { + _runtimeList = new ulong[_lookupTable.Count]; + for (int index = 0; index < _lookupTable.Count; ++index) + _runtimeList[index] = _lookupTable[index]; + _lookupTable = null; + } + + public void Lookup(uint offset, out int line, out int column) + { + int length = _runtimeList.Length; + int index = 0; + while (index < length && (offset < UnpackOffset(_runtimeList[index]) || index != length - 1 && offset >= UnpackOffset(_runtimeList[index + 1]))) + ++index; + if (index < length) + { + line = UnpackLine(_runtimeList[index]); + column = UnpackColumn(_runtimeList[index]); + } + else + { + line = -1; + column = -1; + } + } + + internal ulong[] PersistList => _runtimeList; + + [Conditional("DEBUG")] + public void DEBUG_DumpTable() + { + } + + 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); + + private static int UnpackLine(ulong value) => (int)((value & 8796088827904UL) >> 22); + + private static int UnpackColumn(ulong value) => (int)((value & 18446735277616529408UL) >> 43); + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupListener.cs b/UIX/Microsoft/Iris/Markup/MarkupListener.cs new file mode 100644 index 0000000..245cf7a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupListener.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupListener +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupListener : Listener + { + protected IMarkupTypeBase _scriptHost; + protected uint _scriptId = uint.MaxValue; + + internal MarkupListener() + { + } + + internal void Reset( + INotifyObject notifier, + string watch, + IMarkupTypeBase scriptHost, + uint scriptId) + { + _watch = watch; + _scriptHost = scriptHost; + _scriptId = scriptId; + _watch = NotifyService.CanonicalizeString(_watch); + notifier.AddListener(this); + } + + public override void Dispose() + { + _scriptHost = null; + _scriptId = uint.MaxValue; + base.Dispose(); + } + + internal IMarkupTypeBase ScriptHost => _scriptHost; + + public override void OnNotify() + { + base.OnNotify(); + if (_scriptId == uint.MaxValue) + return; + _scriptHost.ScheduleScriptRun(_scriptId, false); + } + + public override string ToString() => string.Format("{0}{4}: {1}->0x{2:X8} on '{3}'", GetType().Name, _watch, _scriptId, _scriptHost, ""); + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupListeners.cs b/UIX/Microsoft/Iris/Markup/MarkupListeners.cs new file mode 100644 index 0000000..3fc0b32 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupListeners.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupListeners +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class MarkupListeners : Listeners + { + public MarkupListeners(int listenerCount) + : base(listenerCount) + { + } + + public void RefreshListener( + int index, + INotifyObject notifier, + string watch, + IMarkupTypeBase scriptHost, + uint scriptOffset, + uint refreshOffset) + { + MarkupListener markupListener = null; + if (_listenerList[index] is MarkupListener) + { + markupListener = (MarkupListener)_listenerList[index]; + markupListener.Dispose(); + } + if (refreshOffset == uint.MaxValue) + { + if (markupListener == null) + markupListener = new MarkupListener(); + markupListener.Reset(notifier, watch, scriptHost, scriptOffset); + } + else + { + if (markupListener == null) + markupListener = new DestructiveListener(); + ((DestructiveListener)markupListener).Reset(notifier, watch, scriptHost, scriptOffset, refreshOffset); + } + _listenerList[index] = markupListener; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs b/UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs new file mode 100644 index 0000000..e41afd5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupLoadResult.cs @@ -0,0 +1,180 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupLoadResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup +{ + internal abstract class MarkupLoadResult : LoadResult + { + private LoadResult[] _dependenciesTable = EmptyList; + private ByteCodeReader _reader; + protected MarkupBinaryDataTable _binaryDataTable; + protected MarkupLineNumberTable _lineNumberTable; + private TypeSchema[] _exportTable = TypeSchema.EmptyList; + private AliasMapping[] _aliasTable; + private Map _resolvedAliases; + private MarkupDataMapping[] _dataMappingsTable; + private LoadResultStatus _status; + + 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) + => _status = LoadResultStatus.Loading; + + private void OnLoaded() + { + if (_dataMappingsTable == null) + return; + foreach (MarkupDataMapping mapping in _dataMappingsTable) + MarkupDataProvider.AddDataMapping(mapping); + } + + protected override void OnDispose() + { + base.OnDispose(); + if (_dataMappingsTable != null) + { + foreach (MarkupDataMapping mapping in _dataMappingsTable) + MarkupDataProvider.RemoveDataMapping(mapping); + } + if (_reader != null) + _reader.Dispose(this); + foreach (DisposableObject disposableObject in _exportTable) + disposableObject.Dispose(this); + _exportTable = null; + } + + public override TypeSchema FindType(string name) + { + TypeSchema typeSchema = FindTypeWorker(name); + if (typeSchema == null) + { + typeSchema = ResolveAlias(name); + if (typeSchema != null) + _resolvedAliases[name] = typeSchema; + } + return typeSchema; + } + + private TypeSchema FindTypeWorker(string name) + { + for (int index = 0; index < _exportTable.Length; ++index) + { + TypeSchema typeSchema = _exportTable[index]; + if (name == typeSchema.Name) + return typeSchema; + } + TypeSchema typeSchema1; + return _resolvedAliases != null && _resolvedAliases.TryGetValue(name, out typeSchema1) ? typeSchema1 : null; + } + + private TypeSchema ResolveAlias(string name) + { + int num = 100; + var markupLoadResult = this; + while (num-- > 0) + { + AliasMapping aliasMapping1 = null; + if (markupLoadResult._aliasTable != null) + { + foreach (AliasMapping aliasMapping2 in markupLoadResult._aliasTable) + { + if (aliasMapping2.Alias == name) + { + aliasMapping1 = aliasMapping2; + break; + } + } + } + if (aliasMapping1 != null) + { + if (!(aliasMapping1.LoadResult is MarkupLoadResult)) + return aliasMapping1.LoadResult.FindType(aliasMapping1.TargetType); + markupLoadResult = (MarkupLoadResult)aliasMapping1.LoadResult; + TypeSchema typeWorker = markupLoadResult.FindTypeWorker(aliasMapping1.TargetType); + if (typeWorker != null) + return typeWorker; + name = aliasMapping1.TargetType; + } + else + break; + } + if (num <= 0) + ErrorManager.ReportError("Alias cycle detected: {0} {1}", ToString(), name); + return null; + } + + public abstract bool IsSource { get; } + + public override LoadResult[] Dependencies => _dependenciesTable; + + public abstract MarkupImportTables ImportTables { get; } + + public ByteCodeReader ObjectSection => _reader; + + public override TypeSchema[] ExportTable => _exportTable; + + public AliasMapping[] AliasTable => _aliasTable; + + public MarkupDataMapping[] DataMappingsTable => _dataMappingsTable; + + public MarkupBinaryDataTable BinaryDataTable => _binaryDataTable; + + public abstract MarkupConstantsTable ConstantsTable { get; } + + public virtual MarkupLineNumberTable LineNumberTable => _lineNumberTable; + + public void SetDependenciesTable(LoadResult[] dependenciesTable, bool registerDependencies) + { + _dependenciesTable = dependenciesTable; + if (!registerDependencies) + return; + RegisterDependenciesUsage(); + } + + public void SetDependenciesTable(LoadResult[] dependenciesTable) => SetDependenciesTable(dependenciesTable, true); + + public void SetObjectSection(ByteCodeReader reader) + { + reader.DeclareOwner(this); + _reader = reader; + } + + public void SetBinaryDataTable(MarkupBinaryDataTable binaryDataTable) => _binaryDataTable = binaryDataTable; + + public void SetLineNumberTable(MarkupLineNumberTable lineNumberTable) => _lineNumberTable = lineNumberTable; + + public void SetExportTable(TypeSchema[] exportTable) => _exportTable = exportTable; + + public void SetAliasTable(AliasMapping[] aliasTable) + { + _aliasTable = aliasTable; + if (_aliasTable == null) + return; + _resolvedAliases = new Map(_aliasTable.Length); + } + + public void SetDataMappingsTable(MarkupDataMapping[] dataMappingsTable) => _dataMappingsTable = dataMappingsTable; + + public override LoadResultStatus Status => _status; + + public void SetStatus(LoadResultStatus status) + { + if (_status == status) + return; + _status = status; + if (_status != LoadResultStatus.Success) + return; + OnLoaded(); + } + + public virtual void MarkLoadFailed() => _status = LoadResultStatus.Error; + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupMethodSchema.cs b/UIX/Microsoft/Iris/Markup/MarkupMethodSchema.cs new file mode 100644 index 0000000..666e7b1 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupMethodSchema.cs @@ -0,0 +1,131 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupMethodSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.UIX; + +namespace Microsoft.Iris.Markup +{ + internal abstract class MarkupMethodSchema : MethodSchema + { + private string _name; + private TypeSchema _returnType; + private TypeSchema[] _parameterTypes; + private string[] _parameterNames; + protected uint _codeOffset = uint.MaxValue; + private int _virtualId = -1; + private bool _isVirtualThunk; + public static readonly string[] s_emptyStringArray = new string[0]; + public static readonly MarkupMethodSchema[] EmptyMethodList = new MarkupMethodSchema[0]; + + public static MarkupMethodSchema Build( + TypeSchema markupTypeBase, + MarkupTypeSchema owner, + string name, + TypeSchema returnType, + TypeSchema[] parameterTypes, + string[] parameterNames, + bool isVirtualThunk) + { + MarkupMethodSchema markupMethodSchema = null; + if (markupTypeBase == ClassSchema.Type || markupTypeBase == EffectSchema.Type) + markupMethodSchema = new ClassMethodSchema((ClassTypeSchema)owner, name, returnType, parameterTypes, parameterNames); + else if (markupTypeBase == UISchema.Type) + markupMethodSchema = new UIClassMethodSchema((UIClassTypeSchema)owner, name, returnType, parameterTypes, parameterNames); + markupMethodSchema._isVirtualThunk = isVirtualThunk; + return markupMethodSchema; + } + + public static MarkupMethodSchema Build( + TypeSchema markupTypeBase, + MarkupTypeSchema owner, + string name, + TypeSchema returnType, + TypeSchema[] parameterTypes, + string[] parameterNames) + { + return Build(markupTypeBase, owner, name, returnType, parameterTypes, parameterNames, false); + } + + public static MarkupMethodSchema BuildVirtualThunk( + TypeSchema markupTypeBase, + MarkupMethodSchema virtualMethod) + { + return Build(markupTypeBase, (MarkupTypeSchema)virtualMethod.Owner, virtualMethod.Name, virtualMethod.ReturnType, virtualMethod.ParameterTypes, virtualMethod.ParameterNames, true); + } + + protected MarkupMethodSchema( + MarkupTypeSchema owner, + string name, + TypeSchema returnType, + TypeSchema[] parameterTypes, + string[] parameterNames) + : base(owner) + { + _name = name; + _returnType = returnType; + _parameterTypes = parameterTypes; + _parameterNames = parameterNames; + for (int index = 0; index < _parameterNames.Length; ++index) + _parameterNames[index] = NotifyService.CanonicalizeString(_parameterNames[index]); + } + + public override string Name => _name; + + public override TypeSchema[] ParameterTypes => _parameterTypes; + + public string[] ParameterNames => _parameterNames; + + public override TypeSchema ReturnType => _returnType; + + public override bool IsStatic => false; + + public bool IsVirtual => _virtualId >= 0; + + public int VirtualId => _virtualId; + + public bool IsVirtualThunk => _isVirtualThunk; + + public uint CodeOffset => _codeOffset; + + public void SetCodeOffset(uint codeOffset) => _codeOffset = codeOffset; + + public void SetVirtualId(int virtualId) => _virtualId = virtualId; + + public override object Invoke(object instance, object[] parameters) + { + IMarkupTypeBase markupTypeBase = GetMarkupTypeBase(instance); + if (markupTypeBase == null) + return null; + return _isVirtualThunk ? CallVirt(markupTypeBase, parameters) : CallDirect(markupTypeBase, parameters); + } + + private object CallVirt(IMarkupTypeBase markupInstance, object[] parameters) + { + MarkupTypeSchema typeSchema = (MarkupTypeSchema)markupInstance.TypeSchema; + MarkupMethodSchema markupMethodSchema = null; + while (true) + { + foreach (MarkupMethodSchema virtualMethod in typeSchema.VirtualMethods) + { + if (virtualMethod.VirtualId == _virtualId) + { + markupMethodSchema = virtualMethod; + break; + } + } + if (markupMethodSchema == null) + typeSchema = (MarkupTypeSchema)typeSchema.Base; + else + break; + } + return markupMethodSchema.CallDirect(markupInstance, parameters); + } + + private object CallDirect(IMarkupTypeBase markupInstance, object[] parameters) => markupInstance.RunScript(_codeOffset, false, new ParameterContext(_parameterNames, parameters)); + + protected abstract IMarkupTypeBase GetMarkupTypeBase(object instance); + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupPropertySchema.cs b/UIX/Microsoft/Iris/Markup/MarkupPropertySchema.cs new file mode 100644 index 0000000..4bcb166 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupPropertySchema.cs @@ -0,0 +1,66 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupPropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.UIX; + +namespace Microsoft.Iris.Markup +{ + internal abstract class MarkupPropertySchema : PropertySchema + { + private string _name; + protected TypeSchema _propertyType; + private PropertyOverrideCriteria _overrideCriteria; + private bool _requiredForCreation; + + public static MarkupPropertySchema Build( + TypeSchema markupTypeBase, + MarkupTypeSchema owner, + string name, + TypeSchema propertyType) + { + if (markupTypeBase == ClassSchema.Type || markupTypeBase == EffectSchema.Type) + return new ClassPropertySchema(owner, name, propertyType); + if (markupTypeBase == UISchema.Type) + return new UIClassPropertySchema((UIClassTypeSchema)owner, name, propertyType); + if (markupTypeBase == DataTypeSchema.Type) + 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(owner) + { + _name = NotifyService.CanonicalizeString(name); + _propertyType = propertyType; + } + + public void SetOverrideCriteria(PropertyOverrideCriteria overrideCriteria) => _overrideCriteria = overrideCriteria; + + public void SetRequiredForCreation(bool requiredForCreation) => _requiredForCreation = requiredForCreation; + + public override string Name => _name; + + public override TypeSchema PropertyType => _propertyType; + + public override TypeSchema AlternateType => (TypeSchema)null; + + public PropertyOverrideCriteria OverrideCriteria => _overrideCriteria; + + public override bool CanRead => true; + + public override bool CanWrite => true; + + public override bool IsStatic => false; + + public override ExpressionRestriction ExpressionRestriction => ExpressionRestriction.None; + + public override bool RequiredForCreation => _requiredForCreation; + + public override RangeValidator RangeValidator => (RangeValidator)null; + + public override bool NotifiesOnChange => true; + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupServices.cs b/UIX/Microsoft/Iris/Markup/MarkupServices.cs new file mode 100644 index 0000000..2ed5c30 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupServices.cs @@ -0,0 +1,57 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupServices +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using System.Collections; + +namespace Microsoft.Iris.Markup +{ + internal sealed class MarkupServices : INotifyObject + { + private static MarkupServices s_instance; + private NotifyList _errors = new NotifyList(); + private bool _warningsOnly = true; + private NotifyService _notifier = new NotifyService(); + + private MarkupServices() => ErrorManager.OnErrors += new NotifyErrorBatch(OnErrorBatch); + + public static MarkupServices Instance + { + get + { + if (s_instance == null) + s_instance = new MarkupServices(); + return s_instance; + } + } + + private void OnErrorBatch(IList errors) + { + foreach (ErrorRecord error in errors) + { + if (!error.Warning) + _warningsOnly = false; + _errors.Add(new MarkupError(error)); + } + FireNotification(NotificationID.ErrorsDetected); + } + + public IList Errors => _errors; + + public bool WarningsOnly => _warningsOnly; + + public void ClearErrors() + { + _errors.Clear(); + _warningsOnly = true; + } + + void INotifyObject.AddListener(Listener listener) => _notifier.AddListener(listener); + + private void FireNotification(string id) => _notifier.Fire(id); + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupSystem.cs b/UIX/Microsoft/Iris/Markup/MarkupSystem.cs new file mode 100644 index 0000000..f3ae176 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupSystem.cs @@ -0,0 +1,261 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupSystem +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.CodeModel.Cpp; +using Microsoft.Iris.Data; +using Microsoft.Iris.Debug; +using Microsoft.Iris.Markup.Validation; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; + +namespace Microsoft.Iris.Markup +{ + internal static class MarkupSystem + { + public const string RootTag = "UIX"; + public const string SchemaVersion = "http://schemas.microsoft.com/2007/uix"; + public const string DataSchemaRootTag = "DataSchema"; + public const string DataSchemaVersion = "http://schemas.microsoft.com/2007/uixdata"; + public static UIXLoadResult UIXGlobal; + public static RootLoadResult RootGlobal; + public static bool CompileMode; + public static bool TrackAdditionalMetadata; + public static bool MarkupSystemActive; + private static Vector s_factoriesByProtocol; + private static Vector s_factoriesByExtension; + private static Vector s_importRedirectsFrom; + private static Vector s_importRedirectsTo; + private static uint s_rootIslandId; + private static uint s_activeIslands; + + public static void Startup(bool compileMode) + { + MarkupSystemActive = true; + CompileMode = compileMode; + s_factoriesByProtocol = new Vector(); + s_factoriesByExtension = new Vector(); + s_rootIslandId = AllocateIslandId(); + UIXGlobal = new UIXLoadResult("http://schemas.microsoft.com/2007/uix"); + UIXGlobal.RegisterUsage(typeof(MarkupSystem)); + UIXLoadResult.InitializeStatics(); + ValidateContext.InitializeStatics(); + ValidateUI.InitializeStatics(); + ValidateClass.InitializeStatics(); + ValidateStatementForEach.InitializeStatics(); + ValidateParameter.InitializeStatics(); + TypeRestriction.InitializeStatics(); + NativeMarkupDataQuery.InitializeStatics(); + NativeMarkupDataType.InitializeStatics(); + RootGlobal = new RootLoadResult("Root"); + RootGlobal.RegisterUsage(typeof(MarkupSystem)); + AssemblyLoadResult.Startup(); + DllLoadResult.Startup(); + ResourceManager.Instance.RegisterSource("res", DllResources.Instance); + HttpResources.Startup(); + ResourceManager.Instance.RegisterSource("file", FileResources.Instance); + } + + public static void Shutdown() + { + UnloadAll(); + AssemblyLoadResult.Shutdown(); + DllLoadResult.Shutdown(); + RootGlobal.UnregisterUsage(typeof(MarkupSystem)); + RootGlobal = null; + UIXGlobal.UnregisterUsage(typeof(MarkupSystem)); + UIXGlobal = null; + HttpResources.Shutdown(); + if (s_factoriesByProtocol != null) + s_factoriesByProtocol.Clear(); + if (s_factoriesByExtension != null) + s_factoriesByExtension.Clear(); + MarkupSystemActive = false; + } + + public static void EnableMetadataTracking() => TrackAdditionalMetadata = true; + + public static LoadResult Load(string uri, uint islandId) + { + ErrorManager.EnterContext(uri); + LoadResult loadResult = ResolveLoadResult(uri, islandId); + if (loadResult != null) + { + loadResult.Load(LoadPass.DeclareTypes); + loadResult.Load(LoadPass.PopulatePublicModel); + loadResult.Load(LoadPass.Full); + loadResult.Load(LoadPass.Done); + } + ErrorManager.ExitContext(); + return loadResult; + } + + public static LoadResult ResolveLoadResult(string uri, uint islandId) + { + ErrorManager.EnterContext(uri); + uri = ApplyImportRedirects(uri); + LoadResult loadResult = LoadResultCache.Read(uri); + if (loadResult == null) + { + bool flag = false; + bool cacheResult = true; + foreach (MarkupSystem.Factory factory in s_factoriesByProtocol) + { + if (uri.StartsWith(factory.key, StringComparison.Ordinal)) + { + loadResult = factory.handler(uri); + flag = true; + break; + } + } + if (!flag) + { + foreach (MarkupSystem.Factory factory in s_factoriesByExtension) + { + if (uri.EndsWith(factory.key, StringComparison.Ordinal)) + { + loadResult = factory.handler(uri); + flag = true; + break; + } + } + } + if (!flag) + loadResult = CreateMarkupLoadResult(uri, ref cacheResult); + if (loadResult == null) + loadResult = new ErrorLoadResult(uri); + if (cacheResult && loadResult.Cachable) + { + LoadResultCache.Write(uri, loadResult); + if (loadResult.UnderlyingUri != null) + LoadResultCache.Write(loadResult.UnderlyingUri, loadResult); + } + } + loadResult?.AddReference(islandId); + ErrorManager.ExitContext(); + return loadResult; + } + + private static LoadResult CreateMarkupLoadResult(string uri, ref bool cacheResult) + { + Resource resource = ResourceManager.AcquireResource(uri); + if (resource == null) + return null; + ErrorManager.EnterContext(resource.Uri); + LoadResult loadResult = LoadResultCache.Read(resource.Uri); + if (loadResult != null) + { + cacheResult = false; + LoadResultCache.Write(uri, loadResult); + } + else + { + loadResult = MarkupLoadResult.Create(uri, resource); + if (loadResult != null) + resource = null; + } + resource?.Free(); + ErrorManager.ExitContext(); + return loadResult; + } + + public static uint RootIslandId => s_rootIslandId; + + public static uint AllocateIslandId() + { + int num1 = ~(int)s_activeIslands; + uint num2 = (uint)(num1 & -num1); + s_activeIslands |= num2; + return num2; + } + + public static void FreeIslandId(uint islandId) => s_activeIslands &= ~islandId; + + public static void UnloadIsland(uint islandId) => LoadResultCache.Remove(islandId); + + public static void UnloadAll() => LoadResultCache.Clear(); + + public static bool RegisterFactoryByProtocol(string protocol, CreateLoadResultHandler handler) + { + if (protocol.EndsWith("://", StringComparison.Ordinal)) + protocol = protocol.Substring(0, protocol.Length - 3); + bool flag = !ResourceManager.Instance.IsRegisteredSource(protocol); + protocol += "://"; + if (flag) + { + foreach (MarkupSystem.Factory factory in s_factoriesByProtocol) + { + if (factory.key == protocol) + flag = false; + } + } + if (flag) + s_factoriesByProtocol.Add(new MarkupSystem.Factory() + { + key = protocol, + handler = handler + }); + return flag; + } + + public static bool RegisterFactoryByExtension(string extension, CreateLoadResultHandler handler) + { + bool flag = true; + if (!extension.StartsWith(".", StringComparison.Ordinal)) + extension = "." + extension; + foreach (MarkupSystem.Factory factory in s_factoriesByExtension) + { + if (factory.key == extension) + flag = false; + } + if (flag) + s_factoriesByExtension.Add(new MarkupSystem.Factory() + { + handler = handler, + key = extension + }); + return flag; + } + + public static void AddImportRedirect(string fromPrefix, string toPrefix) + { + if (s_importRedirectsFrom == null) + { + s_importRedirectsFrom = new Vector(); + s_importRedirectsTo = new Vector(); + } + s_importRedirectsFrom.Add(fromPrefix); + s_importRedirectsTo.Add(toPrefix); + } + + private static string ApplyImportRedirects(string uri) + { + if (s_importRedirectsFrom != null) + { + for (int index = 0; index < s_importRedirectsFrom.Count; ++index) + { + string str = s_importRedirectsFrom[index]; + if (uri.StartsWith(str, StringComparison.Ordinal)) + { + uri = uri.Substring(str.Length); + uri = s_importRedirectsTo[index] + uri; + break; + } + } + } + return uri; + } + + public static bool IsDebuggingEnabled(byte level) => !CompileMode && Trace.IsCategoryEnabled(TraceCategory.MarkupDebug, level); + + internal class Factory + { + public CreateLoadResultHandler handler; + public string key; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupType.cs b/UIX/Microsoft/Iris/Markup/MarkupType.cs new file mode 100644 index 0000000..746eb02 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupType.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum MarkupType + { + None, + UI, + Class, + Effect, + DataType, + DataQuery, + } +} diff --git a/UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs b/UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs new file mode 100644 index 0000000..e5ab10c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MarkupTypeSchema.cs @@ -0,0 +1,389 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MarkupTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Markup +{ + internal abstract class MarkupTypeSchema : TypeSchema + { + private const int c_TypeDepthShift = 27; + private const uint c_ScriptOffsetMask = 134217727; + public const uint InvalidScriptId = 4294967295; + private MarkupLoadResult _owner; + private string _name; + private MarkupTypeSchema _baseType; + private uint _typeDepth; + private int _totalPropertiesAndLocalsCount; + private PropertySchema[] _properties = PropertySchema.EmptyList; + private MethodSchema[] _methods = MethodSchema.EmptyList; + private Map _methodLookupTable; + private MethodSchema[] _virtualMethods = MethodSchema.EmptyList; + private SymbolReference[] _symbolReferenceTable; + private IntPtr _addressOfInheritableSymbolsTable; + private SymbolRecord[] _inheritableSymbolsTable; + private uint _initializePropertiesOffset = uint.MaxValue; + private uint _initializeLocalsInputOffset = uint.MaxValue; + private uint _initializeContentOffset = uint.MaxValue; + private uint[] _refreshGroupOffsets; + private uint[] _initialEvaluateOffsets; + private uint[] _finalEvaluateOffsets; + private uint _listenerCount; + private bool _sealed; + private object _loadData; + private static object[] EmptyParameterList = new object[0]; + + public static MarkupTypeSchema Build( + TypeSchema markupTypeDefinition, + MarkupLoadResult owner, + string name) + { + if (markupTypeDefinition == ClassSchema.Type) + return new ClassTypeSchema(owner, name); + if (markupTypeDefinition == UISchema.Type) + return new UIClassTypeSchema(owner, name); + if (markupTypeDefinition == EffectSchema.Type) + return new EffectClassTypeSchema(owner, name); + if (markupTypeDefinition == DataTypeSchema.Type) + return new MarkupDataTypeSchema(owner, name); + return markupTypeDefinition == DataQuerySchema.Type ? new MarkupDataQuerySchema(owner, name) : null; + } + + public MarkupTypeSchema(MarkupLoadResult owner, string name) + : base(owner) + { + _owner = owner; + _name = name; + } + + public abstract MarkupType MarkupType { get; } + + public void SetBaseType(MarkupTypeSchema baseType) => _baseType = baseType; + + public object LoadData + { + get => _loadData; + set => _loadData = value; + } + + public virtual void BuildProperties() + { + } + + public void Seal() + { + if (_sealed) + return; + SealWorker(); + } + + protected virtual void SealWorker() + { + _sealed = true; + _loadData = null; + if (_baseType == null) + { + _typeDepth = 1U; + } + else + { + _baseType.Seal(); + _typeDepth = _baseType._typeDepth + 1U; + } + } + + public bool Sealed => _sealed; + + protected override void OnDispose() + { + base.OnDispose(); + foreach (DisposableObject property in _properties) + property.Dispose(this); + foreach (DisposableObject method in _methods) + method.Dispose(this); + foreach (DisposableObject virtualMethod in _virtualMethods) + virtualMethod.Dispose(this); + } + + public override string Name => _name; + + public override string AlternateName => (string)null; + + public override TypeSchema Base => _baseType == null ? DefaultBase : _baseType; + + public override bool Contractual => false; + + public override bool IsNativeAssignableFrom(object check) => false; + + public override bool IsNativeAssignableFrom(TypeSchema checkSchema) => false; + + public MarkupTypeSchema MarkupTypeBase => _baseType; + + protected abstract TypeSchema DefaultBase { get; } + + public override bool Disposable => true; + + public override bool HasDefaultConstructor => true; + + public object Run( + IMarkupTypeBase markupType, + uint scriptId, + bool ignoreErrors, + ParameterContext parameterContext) + { + ErrorManager.EnterContext(markupType.TypeSchema.Owner.ErrorContextUri, ignoreErrors); + MarkupTypeSchema markupTypeSchema = this; + uint num = scriptId >> 27; + while ((int)num != (int)markupTypeSchema._typeDepth) + markupTypeSchema = markupTypeSchema._baseType; + object obj = markupTypeSchema.RunAtOffset(markupType, scriptId & 0x07FFFFFFU, parameterContext); + ErrorManager.ExitContext(); + return obj; + } + + protected object RunAtOffset( + IMarkupTypeBase markupType, + uint scriptOffset, + ParameterContext parameterContext) + { + object obj = null; + if (markupType.ScriptEnabled) + { + InterpreterContext context = InterpreterContext.Acquire(markupType, this, scriptOffset, parameterContext); + obj = Interpreter.Run(context); + if (context != null) + InterpreterContext.Release(context); + } + if (obj == Interpreter.ScriptError && !ErrorManager.IgnoringErrors) + markupType.NotifyScriptErrors(); + return obj; + } + + protected object RunAtOffset(IMarkupTypeBase markupType, uint scriptOffset) => RunAtOffset(markupType, scriptOffset, new ParameterContext()); + + public override ConstructorSchema FindConstructor(TypeSchema[] parameters) => (ConstructorSchema)null; + + public override PropertySchema FindProperty(string name) + { + for (int index = 0; index < _properties.Length; ++index) + { + PropertySchema property = _properties[index]; + if (name == property.Name) + return property; + } + return null; + } + + public override PropertySchema[] Properties => _properties; + + public override MethodSchema[] Methods => _methods; + + public override MethodSchema FindMethod(string name, TypeSchema[] parameters) + { + MethodSchema methodSchema = null; + if (_methodLookupTable != null) + _methodLookupTable.TryGetValue(new MethodSignatureKey(name, parameters), out methodSchema); + return methodSchema; + } + + public MethodSchema[] VirtualMethods => _virtualMethods; + + public override bool HasInitializer => true; + + protected void InitializeInstance(IMarkupTypeBase classBase) + { + if (!InitializePropertiesLocalsInputContent(classBase, true)) + return; + RefreshAllListeners(classBase); + if (!RunInitialEvaluates(classBase)) + return; + classBase.NotifyInitialized(); + } + + private bool InitializePropertiesLocalsInputContent( + IMarkupTypeBase classBase, + bool shouldInitializeContent) + { + ErrorManager.EnterContext(this); + try + { + if (!RunInitializeScript(classBase, _initializePropertiesOffset)) + return false; + if (_baseType != null) + { + bool shouldInitializeContent1 = shouldInitializeContent && _initializeContentOffset == uint.MaxValue; + if (!_baseType.InitializePropertiesLocalsInputContent(classBase, shouldInitializeContent1)) + return false; + } + if (!RunInitializeScript(classBase, _initializeLocalsInputOffset)) + return false; + if (shouldInitializeContent) + { + if (!RunInitializeScript(classBase, _initializeContentOffset)) + return false; + } + } + finally + { + ErrorManager.ExitContext(); + } + return true; + } + + private void RefreshAllListeners(IMarkupTypeBase scriptHost) + { + if (_baseType != null) + _baseType.RefreshAllListeners(scriptHost); + RunOffsets(scriptHost, _refreshGroupOffsets, true); + } + + protected virtual bool RunInitialEvaluates(IMarkupTypeBase scriptHost) => (_baseType == null || _baseType.RunInitialEvaluates(scriptHost)) && RunOffsets(scriptHost, _initialEvaluateOffsets); + + public bool RunFinalEvaluates(IMarkupTypeBase scriptHost) => (_baseType == null || _baseType.RunFinalEvaluates(scriptHost)) && RunOffsets(scriptHost, _finalEvaluateOffsets); + + private bool RunOffsets(IMarkupTypeBase scriptHost, uint[] scriptOffsets) => RunOffsets(scriptHost, scriptOffsets, false); + + private bool RunOffsets(IMarkupTypeBase scriptHost, uint[] scriptOffsets, bool ignoreErrors) + { + bool flag = true; + if (scriptOffsets != null) + { + ErrorManager.EnterContext(this, ignoreErrors); + foreach (uint scriptOffset in scriptOffsets) + { + if (!RunInitializeScript(scriptHost, scriptOffset)) + { + flag = false; + break; + } + } + ErrorManager.ExitContext(); + } + return flag; + } + + protected bool RunInitializeScript(IMarkupTypeBase scriptHost, uint scriptOffset) + { + if (scriptOffset == uint.MaxValue || 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", _name); + return false; + } + + public override EventSchema FindEvent(string name) => (EventSchema)null; + + public override object FindCanonicalInstance(string name) => (object)null; + + public override Result TypeConverter( + object from, + TypeSchema fromType, + out object instance) + { + instance = null; + return Result.Fail("Type conversion is not available for '{0}'", _name); + } + + public override bool SupportsTypeConversion(TypeSchema fromType) => false; + + public override bool SupportsBinaryEncoding => false; + + public override void EncodeBinary(ByteCodeWriter writer, object instance) + { + } + + public override object DecodeBinary(ByteCodeReader reader) => (object)null; + + public override object PerformOperation(object left, object right, OperationType op) => (object)null; + + public override bool SupportsOperation(OperationType op) => false; + + public override bool IsNullAssignable => true; + + public override bool IsRuntimeImmutable => false; + + public override int FindTypeHint => -1; + + public SymbolReference[] SymbolReferenceTable => _symbolReferenceTable; + + public SymbolRecord[] InheritableSymbolsTable + { + get + { + if (_inheritableSymbolsTable == null) + { + if (_addressOfInheritableSymbolsTable != IntPtr.Zero) + CompiledMarkupLoader.DecodeInheritableSymbolTable(this, null, _addressOfInheritableSymbolsTable); + else + _inheritableSymbolsTable = SymbolRecord.EmptyList; + } + return _inheritableSymbolsTable; + } + } + + public uint TypeDepth => _typeDepth; + + public int TotalPropertiesAndLocalsCount => _totalPropertiesAndLocalsCount; + + public uint InitializePropertiesOffset => _initializePropertiesOffset; + + public uint InitializeLocalsInputOffset => _initializeLocalsInputOffset; + + public uint InitializeContentOffset => _initializeContentOffset; + + public uint[] RefreshGroupOffsets => _refreshGroupOffsets; + + public uint[] InitialEvaluateOffsets => _initialEvaluateOffsets; + + public uint[] FinalEvaluateOffsets => _finalEvaluateOffsets; + + public uint ListenerCount => _listenerCount; + + public uint TotalListenerCount => _listenerCount + (_baseType == null ? 0U : _baseType.TotalListenerCount); + + public uint EncodeScriptOffsetAsId(uint scriptOffset) => scriptOffset | _typeDepth << 27; + + public string LocallyUniqueId => _typeDepth.ToString(); + + public void SetTypeDepth(uint typeDepth) => _typeDepth = typeDepth; + + public void SetPropertyList(PropertySchema[] properties) => _properties = properties; + + public void SetMethodList(MethodSchema[] methods) + { + _methods = methods; + _methodLookupTable = new Map(methods.Length); + foreach (MethodSchema method in _methods) + _methodLookupTable[new MethodSignatureKey(method.Name, method.ParameterTypes)] = method; + } + + public void SetVirtualMethodList(MethodSchema[] virtualMethods) => _virtualMethods = virtualMethods; + + public void SetSymbolReferenceTable(SymbolReference[] symbolTable) => _symbolReferenceTable = symbolTable; + + public void SetInheritableSymbolsTable(SymbolRecord[] symbolTable) => _inheritableSymbolsTable = symbolTable; + + public void SetAddressOfInheritableSymbolTable(IntPtr address) => _addressOfInheritableSymbolsTable = address; + + public void SetRefreshListenerGroupOffsets(uint[] refreshGroupOffsets) => _refreshGroupOffsets = refreshGroupOffsets; + + public void SetInitialEvaluateOffsets(uint[] initialEvaluateOffsets) => _initialEvaluateOffsets = initialEvaluateOffsets; + + public void SetFinalEvaluateOffsets(uint[] finalEvaluateOffsets) => _finalEvaluateOffsets = finalEvaluateOffsets; + + public void SetListenerCount(uint listenerCount) => _listenerCount = listenerCount; + + public void SetTotalPropertiesAndLocalsCount(int totalPropertiesAndLocalsCount) => _totalPropertiesAndLocalsCount = totalPropertiesAndLocalsCount; + + public void SetInitializePropertiesOffset(uint offset) => _initializePropertiesOffset = offset; + + public void SetInitializeLocalsInputOffset(uint offset) => _initializeLocalsInputOffset = offset; + + public void SetInitializeContentOffset(uint offset) => _initializeContentOffset = offset; + } +} diff --git a/UIX/Microsoft/Iris/Markup/MethodSchema.cs b/UIX/Microsoft/Iris/Markup/MethodSchema.cs new file mode 100644 index 0000000..32517db --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MethodSchema.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MethodSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal abstract class MethodSchema : DisposableObject + { + private TypeSchema _owner; + public static MethodSchema[] EmptyList = new MethodSchema[0]; + + public MethodSchema(TypeSchema owner) + { + _owner = owner; + DeclareOwner(owner); + } + + public TypeSchema Owner => _owner; + + public abstract string Name { get; } + + public abstract TypeSchema[] ParameterTypes { get; } + + public abstract TypeSchema ReturnType { get; } + + public abstract bool IsStatic { get; } + + public abstract object Invoke(object instance, object[] parameters); + } +} diff --git a/UIX/Microsoft/Iris/Markup/MethodSignatureKey.cs b/UIX/Microsoft/Iris/Markup/MethodSignatureKey.cs new file mode 100644 index 0000000..343ed63 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/MethodSignatureKey.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.MethodSignatureKey +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal struct MethodSignatureKey + { + private string _name; + private TypeSchema[] _parameters; + + public MethodSignatureKey(TypeSchema[] parameters) + : this(null, parameters) + { + } + + public MethodSignatureKey(string name, TypeSchema[] parameters) + { + _name = name; + _parameters = parameters; + } + + public override bool Equals(object obj) + { + MethodSignatureKey methodSignatureKey = (MethodSignatureKey)obj; + if (_name != methodSignatureKey._name || _parameters.Length != methodSignatureKey._parameters.Length) + return false; + for (int index = 0; index < _parameters.Length; ++index) + { + if (!_parameters[index].IsAssignableFrom(methodSignatureKey._parameters[index])) + return false; + } + return true; + } + + public override int GetHashCode() + { + int num = 0; + if (_name != null) + num ^= _name.GetHashCode(); + return num ^ _parameters.Length; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/NamedContentRecord.cs b/UIX/Microsoft/Iris/Markup/NamedContentRecord.cs new file mode 100644 index 0000000..9c732c7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/NamedContentRecord.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.NamedContentRecord +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class NamedContentRecord + { + public string Name; + public uint Offset = uint.MaxValue; + + public NamedContentRecord(string name) => Name = name; + + public void SetOffset(uint offset) => Offset = offset; + } +} diff --git a/UIX/Microsoft/Iris/Markup/NativeCodeModelMessage.cs b/UIX/Microsoft/Iris/Markup/NativeCodeModelMessage.cs new file mode 100644 index 0000000..7215d5e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/NativeCodeModelMessage.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.NativeCodeModelMessage +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class NativeCodeModelMessage + { + public const string NativeChangeNotificationIDInvalid = "ChangeNotification received for ID '0x{0:X8}' which isn't a property or event on '{1}'"; + public const string NativeTypeIDInvalid = "Unable to find type with ID '0x{0:X8}' in '{1}'"; + public const string SchemaAPIFailed = "Schema API failure: A method on '{0}' failed with code '0x{1:X8}'"; + public const string SchemaParameterlessConstructor = "IUIXConstructors must have parameters"; + public const string SchemaCreationFailed = "Unable to create IUIXSchema from '{0}'"; + public const string SchemaDuplicateID = "Duplicate ID '0x{0:X8}' found in schema from '{1}'"; + public const string SchemaFactoryCreationFailed = "Unable to create IUIXSchemaFactory from '{0}'"; + public const string SchemaIDMismatch = "Schema component on ID '0x{0:X8}' doesn't match schema's ID '0x{1:X8}' on '{2}'"; + public const string SchemaInvalidHandleValue = "IUIXObject::GetStateCache retrieved unexpected value"; + public const string SchemaInvalidChangeNotificationID = "Invalid UIXID '0x{0:X8}' passed to NotifyChange"; + public const string SchemaInvalidMarshalAs = "Invalid MarshalAs '{0}' returned from IUIXType::MarshalAs"; + public const string SchemaInterfaceNotImplemented = "Object didn't implement expected interface '{0}'"; + public const string SchemaMultipleMarshalAs = "Invalid MarshalAs '{0}' on type '{1}'. Only a single MarshalAs value is permitted through a type heirarchy, and '{2}' was already declared."; + public const string SchemaNativeObjectNull = "NULL object returned from {0}"; + public const string MethodInvokeFailed = "Error 0x{0:X8} occurred invoking method {1}.{2} from {3}."; + public const string PropertyGetFailed = "Error 0x{0:X8} occurred reading property {1}.{2} from {3}."; + public const string PropertySetFailed = "Error 0x{0:X8} occurred writing property {1}.{2} from {3}."; + public const string ToStringFailed = "Error 0x{0:X8} occurred invoking ToString on type {1} from {2}."; + public const string ConstructFailed = "Error 0x{0:X8} occurred constructing object of type {1} from {2}."; + } +} diff --git a/UIX/Microsoft/Iris/Markup/NativeMarkupDataQuery.cs b/UIX/Microsoft/Iris/Markup/NativeMarkupDataQuery.cs new file mode 100644 index 0000000..5eabf59 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/NativeMarkupDataQuery.cs @@ -0,0 +1,123 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.NativeMarkupDataQuery +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.CodeModel.Cpp; +using Microsoft.Iris.OS; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class NativeMarkupDataQuery : MarkupDataQuery + { + private IntPtr _externalQuery; + private ulong _handleToMe; + private ulong _typeHandle; + private ulong _resultTypeHandle; + private static MarkupDataQueryHandleTable s_handleTable; + + public static void InitializeStatics() => s_handleTable = new MarkupDataQueryHandleTable(); + + public NativeMarkupDataQuery(MarkupDataQuerySchema type, NativeDataProviderWrapper provider) + : base(type) + { + _handleToMe = s_handleTable.RegisterProxy(this); + _typeHandle = type.UniqueId; + _resultTypeHandle = type.ResultType.UniqueId; + _externalQuery = provider.ConstructQuery(type.ProviderName, _typeHandle, _resultTypeHandle, _handleToMe); + ApplyDefaultValues(); + } + + public override void NotifyInitialized() + { + base.NotifyInitialized(); + int num = (int)NativeApi.SpDataQueryNotifyInitialized(_externalQuery); + } + + protected override void OnDispose() + { + base.OnDispose(); + s_handleTable.ReleaseProxy(_handleToMe); + int num = (int)NativeApi.SpDataBaseObjectSetInternalHandle(_externalQuery, 0UL); + NativeApi.SpReleaseExternalObject(_externalQuery); + } + + public override void Refresh() + { + int num = (int)NativeApi.SpDataQueryRefresh(_externalQuery); + } + + public override unsafe object Result + { + get + { + UIXVariant propertyValue; + int resultProperty = (int)NativeApi.SpDataQueryGetResultProperty(_externalQuery, out propertyValue); + return UIXVariant.GetValue(propertyValue, TypeSchema.Owner); + } + set + { + UIXVariant* uixVariantPtr = stackalloc UIXVariant[sizeof(UIXVariant)]; + UIXVariant.MarshalObject(value, uixVariantPtr); + int num = (int)NativeApi.SpDataQuerySetResultProperty(_externalQuery, uixVariantPtr); + } + } + + public override DataProviderQueryStatus Status + { + get + { + DataProviderQueryStatus propertyValue; + int statusProperty = (int)NativeApi.SpDataQueryGetStatusProperty(_externalQuery, out propertyValue); + return propertyValue; + } + } + + public override bool Enabled + { + get + { + bool propertyValue; + int enabledProperty = (int)NativeApi.SpDataQueryGetEnabledProperty(_externalQuery, out propertyValue); + return propertyValue; + } + set + { + int num = (int)NativeApi.SpDataQuerySetEnabledProperty(_externalQuery, value); + } + } + + protected override bool ExternalObjectGetProperty(string propertyName, out object value) + { + UIXVariant propertyValue; + int property = (int)NativeApi.SpDataBaseObjectGetProperty(_externalQuery, propertyName, out propertyValue); + TypeSchema.FindPropertyDeep(propertyName); + value = UIXVariant.GetValue(propertyValue, TypeSchema.Owner); + return true; + } + + protected override unsafe bool ExternalObjectSetProperty(string propertyName, object value) + { + // ISSUE: untyped stack allocation + UIXVariant* uixVariantPtr = stackalloc UIXVariant[sizeof(UIXVariant)]; + UIXVariant.MarshalObject(value, uixVariantPtr); + int num = (int)NativeApi.SpDataBaseObjectSetProperty(_externalQuery, propertyName, uixVariantPtr); + return true; + } + + protected override IDataProviderBaseObject ExternalAssemblyObject => (IDataProviderBaseObject)null; + + public override IntPtr ExternalNativeObject => _externalQuery; + + public ulong Handle => _handleToMe; + + public static MarkupDataQuery LookupByHandle(ulong handle) + { + MarkupDataQuery markupDataQuery; + s_handleTable.LookupByHandle(handle, out markupDataQuery); + return markupDataQuery; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/NativeMarkupDataType.cs b/UIX/Microsoft/Iris/Markup/NativeMarkupDataType.cs new file mode 100644 index 0000000..28e3e6e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/NativeMarkupDataType.cs @@ -0,0 +1,164 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.NativeMarkupDataType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.CodeModel.Cpp; +using Microsoft.Iris.Library; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class NativeMarkupDataType : MarkupDataType + { + private IntPtr _externalObject; + private ulong _handleToMe; + private ulong _typeHandle; + private static object s_finalizeLock; + private static bool s_pendingAppThreadRelease; + private static Vector s_pendingReleases; + private static SimpleCallback s_releaseOnAppThread; + private static MarkupDataTypeHandleTable s_handleTable; + + public static void InitializeStatics() + { + s_handleTable = new MarkupDataTypeHandleTable(); + s_finalizeLock = new object(); + s_pendingAppThreadRelease = false; + s_releaseOnAppThread = new SimpleCallback(ReleaseFinalizedObjects); + } + + private NativeMarkupDataType(MarkupDataTypeSchema type, IntPtr externalObject) + : base(type) + { + _externalObject = externalObject; + _handleToMe = s_handleTable.RegisterProxy(this); + _typeHandle = type.UniqueId; + NativeApi.SpAddRefExternalObject(_externalObject); + int num = (int)NativeApi.SpDataBaseObjectSetInternalHandle(_externalObject, _handleToMe); + TypeSchema.Owner.RegisterProxyUsage(); + } + + protected override void OnDispose() + { + ReleaseNativeObject(_externalObject, _handleToMe, _typeHandle); + GC.SuppressFinalize(this); + base.OnDispose(); + } + + ~NativeMarkupDataType() + { + lock (s_finalizeLock) + { + if (s_pendingReleases == null) + s_pendingReleases = new Vector(); + s_pendingReleases.Add(new NativeMarkupDataType.AppThreadReleaseEntry(_externalObject, _handleToMe, _typeHandle)); + if (s_pendingAppThreadRelease) + return; + s_pendingAppThreadRelease = true; + DeferredCall.Post(DispatchPriority.Idle, s_releaseOnAppThread); + } + } + + protected override bool ExternalObjectGetProperty(string propertyName, out object value) + { + UIXVariant propertyValue; + int property = (int)NativeApi.SpDataBaseObjectGetProperty(_externalObject, propertyName, out propertyValue); + TypeSchema.FindPropertyDeep(propertyName); + value = UIXVariant.GetValue(propertyValue, TypeSchema.Owner); + return true; + } + + protected override unsafe bool ExternalObjectSetProperty(string propertyName, object value) + { + // ISSUE: untyped stack allocation + UIXVariant* uixVariantPtr = stackalloc UIXVariant[sizeof(UIXVariant)]; + UIXVariant.MarshalObject(value, uixVariantPtr); + int num = (int)NativeApi.SpDataBaseObjectSetProperty(_externalObject, propertyName, uixVariantPtr); + return true; + } + + protected override IDataProviderBaseObject ExternalAssemblyObject => (IDataProviderBaseObject)null; + + public override IntPtr ExternalNativeObject => _externalObject; + + public static NativeMarkupDataType LookupByHandle(ulong handle) + { + MarkupDataType markupDataType; + s_handleTable.LookupByHandle(handle, out markupDataType); + return (NativeMarkupDataType)markupDataType; + } + + public static NativeMarkupDataType Create( + ulong typeHandle, + IntPtr nativeObject) + { + return new NativeMarkupDataType((MarkupDataTypeSchema)TypeSchema.LookupById(typeHandle), nativeObject); + } + + public static void ReleaseOutstandingProxies() + { + s_pendingAppThreadRelease = true; + GC.Collect(); + GC.WaitForPendingFinalizers(); + foreach (IDisposableObject disposableObject in s_handleTable) + disposableObject.Dispose(disposableObject); + ReleaseFinalizedObjects(); + } + + private static void ReleaseFinalizedObjects() + { + Vector pendingReleases; + lock (s_finalizeLock) + { + pendingReleases = s_pendingReleases; + s_pendingReleases = null; + s_pendingAppThreadRelease = false; + } + if (pendingReleases == null || pendingReleases.Count == 0) + return; + foreach (NativeMarkupDataType.AppThreadReleaseEntry threadReleaseEntry in pendingReleases) + ReleaseNativeObject(threadReleaseEntry._nativeObject, threadReleaseEntry._handle, threadReleaseEntry._typeHandle); + lock (s_finalizeLock) + { + if (s_pendingAppThreadRelease) + return; + pendingReleases.Clear(); + s_pendingReleases = pendingReleases; + } + } + + private static void ReleaseNativeObject( + IntPtr nativeObject, + ulong proxyHandle, + ulong typeHandle) + { + s_handleTable.ReleaseProxy(proxyHandle); + ulong frameworkQuery; + int internalHandle = (int)NativeApi.SpDataBaseObjectGetInternalHandle(nativeObject, out frameworkQuery); + if ((long)proxyHandle == (long)frameworkQuery) + { + int num = (int)NativeApi.SpDataBaseObjectSetInternalHandle(nativeObject, 0UL); + } + NativeApi.SpReleaseExternalObject(nativeObject); + TypeSchema.LookupById(typeHandle).Owner.UnregisterProxyUsage(); + } + + internal struct AppThreadReleaseEntry + { + public IntPtr _nativeObject; + public ulong _handle; + public ulong _typeHandle; + + public AppThreadReleaseEntry(IntPtr nativeObject, ulong handle, ulong typeHandle) + { + _nativeObject = nativeObject; + _handle = handle; + _typeHandle = typeHandle; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/NotificationID.cs b/UIX/Microsoft/Iris/Markup/NotificationID.cs new file mode 100644 index 0000000..597eb9f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/NotificationID.cs @@ -0,0 +1,314 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.NotificationID +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class NotificationID + { + public static readonly string AcceptsEnter = NotifyService.CanonicalizeString(nameof(AcceptsEnter)); + public static readonly string AcceptsTab = NotifyService.CanonicalizeString(nameof(AcceptsTab)); + public static readonly string AcquiringImage = NotifyService.CanonicalizeString(nameof(AcquiringImage)); + public static readonly string Active = NotifyService.CanonicalizeString(nameof(Active)); + public static readonly string ActiveModifiers = NotifyService.CanonicalizeString(nameof(ActiveModifiers)); + public static readonly string Alignment = NotifyService.CanonicalizeString(nameof(Alignment)); + public static readonly string AllowDoubleClicks = NotifyService.CanonicalizeString(nameof(AllowDoubleClicks)); + public static readonly string AllowedDropActions = NotifyService.CanonicalizeString(nameof(AllowedDropActions)); + public static readonly string Alpha = NotifyService.CanonicalizeString(nameof(Alpha)); + public static readonly string AlwaysOnTop = NotifyService.CanonicalizeString(nameof(AlwaysOnTop)); + public static readonly string Anchor = NotifyService.CanonicalizeString(nameof(Anchor)); + public static readonly string At = NotifyService.CanonicalizeString(nameof(At)); + public static readonly string AtAnimation = NotifyService.CanonicalizeString(nameof(AtAnimation)); + public static readonly string AutoRepeat = NotifyService.CanonicalizeString(nameof(AutoRepeat)); + public static readonly string Available = NotifyService.CanonicalizeString(nameof(Available)); + public static readonly string Background = NotifyService.CanonicalizeString(nameof(Background)); + public static readonly string BeginDragPolicy = NotifyService.CanonicalizeString(nameof(BeginDragPolicy)); + public static readonly string BeginPadding = NotifyService.CanonicalizeString(nameof(BeginPadding)); + public static readonly string BeginPaddingRelativeTo = NotifyService.CanonicalizeString(nameof(BeginPaddingRelativeTo)); + public static readonly string BeginPosition = NotifyService.CanonicalizeString(nameof(BeginPosition)); + public static readonly string BlinkTime = NotifyService.CanonicalizeString(nameof(BlinkTime)); + public static readonly string Bold = NotifyService.CanonicalizeString(nameof(Bold)); + public static readonly string BoundsType = NotifyService.CanonicalizeString(nameof(BoundsType)); + public static readonly string Camera = NotifyService.CanonicalizeString(nameof(Camera)); + public static readonly string CanScrollDown = NotifyService.CanonicalizeString(nameof(CanScrollDown)); + public static readonly string CanScrollUp = NotifyService.CanonicalizeString(nameof(CanScrollUp)); + public static readonly string CanSearch = NotifyService.CanonicalizeString(nameof(CanSearch)); + public static readonly string CancelCursor = NotifyService.CanonicalizeString(nameof(CancelCursor)); + public static readonly string CancelOnEscape = NotifyService.CanonicalizeString(nameof(CancelOnEscape)); + public static readonly string Canceled = NotifyService.CanonicalizeString(nameof(Canceled)); + public static readonly string Caption = NotifyService.CanonicalizeString(nameof(Caption)); + public static readonly string CaretInfo = NotifyService.CanonicalizeString(nameof(CaretInfo)); + public static readonly string CenterPointPercent = NotifyService.CanonicalizeString(nameof(CenterPointPercent)); + public static readonly string CharacterSpacing = NotifyService.CanonicalizeString(nameof(CharacterSpacing)); + public static readonly string ChildAlignment = NotifyService.CanonicalizeString(nameof(ChildAlignment)); + public static readonly string ChosenIndex = NotifyService.CanonicalizeString(nameof(ChosenIndex)); + public static readonly string ChosenValue = NotifyService.CanonicalizeString(nameof(ChosenValue)); + public static readonly string ClickCount = NotifyService.CanonicalizeString(nameof(ClickCount)); + public static readonly string ClickType = NotifyService.CanonicalizeString(nameof(ClickType)); + public static readonly string Clicking = NotifyService.CanonicalizeString(nameof(Clicking)); + public static readonly string ClientSize = NotifyService.CanonicalizeString(nameof(ClientSize)); + public static readonly string Clipped = NotifyService.CanonicalizeString(nameof(Clipped)); + public static readonly string Color = NotifyService.CanonicalizeString(nameof(Color)); + public static readonly string ColorMask = NotifyService.CanonicalizeString(nameof(ColorMask)); + public static readonly string ColorScheme = NotifyService.CanonicalizeString(nameof(ColorScheme)); + public static readonly string Command = NotifyService.CanonicalizeString(nameof(Command)); + public static readonly string Completed = NotifyService.CanonicalizeString(nameof(Completed)); + public static readonly string Content = NotifyService.CanonicalizeString(nameof(Content)); + public static readonly string ContentName = NotifyService.CanonicalizeString(nameof(ContentName)); + public static readonly string ContentPositioningBehavior = NotifyService.CanonicalizeString(nameof(ContentPositioningBehavior)); + public static readonly string ContentSelectors = NotifyService.CanonicalizeString(nameof(ContentSelectors)); + public static readonly string ContributesToWidth = NotifyService.CanonicalizeString(nameof(ContributesToWidth)); + public static readonly string Copied = NotifyService.CanonicalizeString(nameof(Copied)); + public static readonly string CopyCommand = NotifyService.CanonicalizeString(nameof(CopyCommand)); + public static readonly string CopyCursor = NotifyService.CanonicalizeString(nameof(CopyCursor)); + public static readonly string Count = NotifyService.CanonicalizeString(nameof(Count)); + public static readonly string CreateInterestOnFocus = NotifyService.CanonicalizeString(nameof(CreateInterestOnFocus)); + public static readonly string Current = NotifyService.CanonicalizeString(nameof(Current)); + public static readonly string CurrentDropAction = NotifyService.CanonicalizeString(nameof(CurrentDropAction)); + public static readonly string CurrentPage = NotifyService.CanonicalizeString(nameof(CurrentPage)); + public static readonly string Cursor = NotifyService.CanonicalizeString(nameof(Cursor)); + public static readonly string CutCommand = NotifyService.CanonicalizeString(nameof(CutCommand)); + public static readonly string Data = NotifyService.CanonicalizeString(nameof(Data)); + public static readonly string DebugOutline = NotifyService.CanonicalizeString(nameof(DebugOutline)); + public static readonly string DefaultAction = NotifyService.CanonicalizeString(nameof(DefaultAction)); + public static readonly string DefaultActionCommand = NotifyService.CanonicalizeString(nameof(DefaultActionCommand)); + public static readonly string DefaultFocusIndex = NotifyService.CanonicalizeString(nameof(DefaultFocusIndex)); + public static readonly string DefaultIndex = NotifyService.CanonicalizeString(nameof(DefaultIndex)); + public static readonly string DeleteCommand = NotifyService.CanonicalizeString(nameof(DeleteCommand)); + public static readonly string Description = NotifyService.CanonicalizeString(nameof(Description)); + public static readonly string DetectUrls = NotifyService.CanonicalizeString(nameof(DetectUrls)); + public static readonly string DirectKeyFocus = NotifyService.CanonicalizeString(nameof(DirectKeyFocus)); + public static readonly string DirectMouseFocus = NotifyService.CanonicalizeString(nameof(DirectMouseFocus)); + public static readonly string DisableIme = NotifyService.CanonicalizeString(nameof(DisableIme)); + public static readonly string DisallowedModifiers = NotifyService.CanonicalizeString(nameof(DisallowedModifiers)); + public static readonly string DiscardOffscreenVisuals = NotifyService.CanonicalizeString(nameof(DiscardOffscreenVisuals)); + public static readonly string DividerName = NotifyService.CanonicalizeString(nameof(DividerName)); + public static readonly string DownInvoked = NotifyService.CanonicalizeString(nameof(DownInvoked)); + public static readonly string DragCursor = NotifyService.CanonicalizeString(nameof(DragCursor)); + public static readonly string DragEnter = NotifyService.CanonicalizeString(nameof(DragEnter)); + public static readonly string DragLeave = NotifyService.CanonicalizeString(nameof(DragLeave)); + public static readonly string DragOver = NotifyService.CanonicalizeString(nameof(DragOver)); + public static readonly string Dragging = NotifyService.CanonicalizeString(nameof(Dragging)); + public static readonly string Dropped = NotifyService.CanonicalizeString(nameof(Dropped)); + public static readonly string EditableTextData = NotifyService.CanonicalizeString(nameof(EditableTextData)); + public static readonly string Effect = NotifyService.CanonicalizeString(nameof(Effect)); + public static readonly string EnableKerning = NotifyService.CanonicalizeString(nameof(EnableKerning)); + public static readonly string Enabled = NotifyService.CanonicalizeString(nameof(Enabled)); + public static readonly string EndIndex = NotifyService.CanonicalizeString(nameof(EndIndex)); + public static readonly string EndPadding = NotifyService.CanonicalizeString(nameof(EndPadding)); + public static readonly string EndPaddingRelativeTo = NotifyService.CanonicalizeString(nameof(EndPaddingRelativeTo)); + public static readonly string EndPosition = NotifyService.CanonicalizeString(nameof(EndPosition)); + public static readonly string Ended = NotifyService.CanonicalizeString(nameof(Ended)); + public static readonly string ErrorImage = NotifyService.CanonicalizeString(nameof(ErrorImage)); + public static readonly string ErrorsDetected = NotifyService.CanonicalizeString(nameof(ErrorsDetected)); + public static readonly string EventContext = NotifyService.CanonicalizeString(nameof(EventContext)); + public static readonly string Eye = NotifyService.CanonicalizeString(nameof(Eye)); + public static readonly string EyeAnimation = NotifyService.CanonicalizeString(nameof(EyeAnimation)); + public static readonly string FadeAmount = NotifyService.CanonicalizeString(nameof(FadeAmount)); + public static readonly string FadeSize = NotifyService.CanonicalizeString(nameof(FadeSize)); + public static readonly string FarOffset = NotifyService.CanonicalizeString(nameof(FarOffset)); + public static readonly string FarPercent = NotifyService.CanonicalizeString(nameof(FarPercent)); + public static readonly string Flippable = NotifyService.CanonicalizeString(nameof(Flippable)); + public static readonly string FlippedHorizontally = NotifyService.CanonicalizeString(nameof(FlippedHorizontally)); + public static readonly string FlippedVertically = NotifyService.CanonicalizeString(nameof(FlippedVertically)); + public static readonly string FocusInterestTarget = NotifyService.CanonicalizeString(nameof(FocusInterestTarget)); + public static readonly string FocusInterestTargetMargins = NotifyService.CanonicalizeString(nameof(FocusInterestTargetMargins)); + public static readonly string FocusOrder = NotifyService.CanonicalizeString(nameof(FocusOrder)); + public static readonly string FocusedItemDiscarded = NotifyService.CanonicalizeString(nameof(FocusedItemDiscarded)); + public static readonly string Font = NotifyService.CanonicalizeString(nameof(Font)); + public static readonly string FontFace = NotifyService.CanonicalizeString(nameof(FontFace)); + public static readonly string FontSize = NotifyService.CanonicalizeString(nameof(FontSize)); + public static readonly string Fragment = NotifyService.CanonicalizeString(nameof(Fragment)); + public static readonly string Fragments = NotifyService.CanonicalizeString(nameof(Fragments)); + public static readonly string FullyEnabled = NotifyService.CanonicalizeString(nameof(FullyEnabled)); + public static readonly string GainedEventContext = NotifyService.CanonicalizeString(nameof(GainedEventContext)); + public static readonly string GainedFocus = NotifyService.CanonicalizeString(nameof(GainedFocus)); + public static readonly string Handle = NotifyService.CanonicalizeString(nameof(Handle)); + public static readonly string HandleDirectionalKeys = NotifyService.CanonicalizeString(nameof(HandleDirectionalKeys)); + public static readonly string HandleHomeEndKeys = NotifyService.CanonicalizeString(nameof(HandleHomeEndKeys)); + public static readonly string HandleMouseWheel = NotifyService.CanonicalizeString(nameof(HandleMouseWheel)); + public static readonly string HandlePageCommands = NotifyService.CanonicalizeString(nameof(HandlePageCommands)); + public static readonly string HandlePageKeys = NotifyService.CanonicalizeString(nameof(HandlePageKeys)); + public static readonly string HandlerStage = NotifyService.CanonicalizeString(nameof(HandlerStage)); + public static readonly string HandlerTransition = NotifyService.CanonicalizeString(nameof(HandlerTransition)); + public static readonly string HasNextValue = NotifyService.CanonicalizeString(nameof(HasNextValue)); + public static readonly string HasPopup = NotifyService.CanonicalizeString(nameof(HasPopup)); + public static readonly string HasPreviousValue = NotifyService.CanonicalizeString(nameof(HasPreviousValue)); + public static readonly string HasSelection = NotifyService.CanonicalizeString(nameof(HasSelection)); + public static readonly string Help = NotifyService.CanonicalizeString(nameof(Help)); + public static readonly string HelpTopic = NotifyService.CanonicalizeString(nameof(HelpTopic)); + public static readonly string HideMouseOnIdle = NotifyService.CanonicalizeString(nameof(HideMouseOnIdle)); + public static readonly string HighlightColor = NotifyService.CanonicalizeString(nameof(HighlightColor)); + public static readonly string HorizontalAlignment = NotifyService.CanonicalizeString(nameof(HorizontalAlignment)); + public static readonly string HorizontalScrollModel = NotifyService.CanonicalizeString(nameof(HorizontalScrollModel)); + public static readonly string HostOutlineColor = NotifyService.CanonicalizeString(nameof(HostOutlineColor)); + public static readonly string IdealWidth = NotifyService.CanonicalizeString(nameof(IdealWidth)); + public static readonly string InImeCompositionMode = NotifyService.CanonicalizeString(nameof(InImeCompositionMode)); + public static readonly string InputEnabled = NotifyService.CanonicalizeString(nameof(InputEnabled)); + public static readonly string Interval = NotifyService.CanonicalizeString(nameof(Interval)); + public static readonly string Invoked = NotifyService.CanonicalizeString(nameof(Invoked)); + public static readonly string IsAnimated = NotifyService.CanonicalizeString(nameof(IsAnimated)); + public static readonly string IsBusy = NotifyService.CanonicalizeString(nameof(IsBusy)); + public static readonly string IsChecked = NotifyService.CanonicalizeString(nameof(IsChecked)); + public static readonly string IsCollapsed = NotifyService.CanonicalizeString(nameof(IsCollapsed)); + public static readonly string IsDefault = NotifyService.CanonicalizeString(nameof(IsDefault)); + public static readonly string IsExpanded = NotifyService.CanonicalizeString(nameof(IsExpanded)); + public static readonly string IsMarquee = NotifyService.CanonicalizeString(nameof(IsMarquee)); + public static readonly string IsMixed = NotifyService.CanonicalizeString(nameof(IsMixed)); + public static readonly string IsMultiSelectable = NotifyService.CanonicalizeString(nameof(IsMultiSelectable)); + public static readonly string IsPressed = NotifyService.CanonicalizeString(nameof(IsPressed)); + public static readonly string IsProtected = NotifyService.CanonicalizeString(nameof(IsProtected)); + public static readonly string IsRightToLeft = NotifyService.CanonicalizeString(nameof(IsRightToLeft)); + public static readonly string IsSelectable = NotifyService.CanonicalizeString(nameof(IsSelectable)); + public static readonly string IsSelected = NotifyService.CanonicalizeString(nameof(IsSelected)); + public static readonly string IsTraversed = NotifyService.CanonicalizeString(nameof(IsTraversed)); + public static readonly string IsUnavailable = NotifyService.CanonicalizeString(nameof(IsUnavailable)); + public static readonly string Italic = NotifyService.CanonicalizeString(nameof(Italic)); + public static readonly string Key = NotifyService.CanonicalizeString(nameof(Key)); + public static readonly string KeyFocus = NotifyService.CanonicalizeString(nameof(KeyFocus)); + public static readonly string KeyFocusImage = NotifyService.CanonicalizeString(nameof(KeyFocusImage)); + public static readonly string KeyFocusOnMouseDown = NotifyService.CanonicalizeString(nameof(KeyFocusOnMouseDown)); + public static readonly string KeyFocusOnMouseEnter = NotifyService.CanonicalizeString(nameof(KeyFocusOnMouseEnter)); + public static readonly string KeyInteractive = NotifyService.CanonicalizeString(nameof(KeyInteractive)); + public static readonly string KeyInteractiveImage = NotifyService.CanonicalizeString(nameof(KeyInteractiveImage)); + public static readonly string KeyboardShortcut = NotifyService.CanonicalizeString(nameof(KeyboardShortcut)); + public static readonly string LastLineBounds = NotifyService.CanonicalizeString(nameof(LastLineBounds)); + public static readonly string Layout = NotifyService.CanonicalizeString(nameof(Layout)); + public static readonly string LayoutInput = NotifyService.CanonicalizeString(nameof(LayoutInput)); + public static readonly string LetterboxColor = NotifyService.CanonicalizeString(nameof(LetterboxColor)); + public static readonly string LineAlignment = NotifyService.CanonicalizeString(nameof(LineAlignment)); + public static readonly string LineSpacing = NotifyService.CanonicalizeString(nameof(LineSpacing)); + public static readonly string LinkClicked = NotifyService.CanonicalizeString(nameof(LinkClicked)); + public static readonly string LinkClickedParameter = NotifyService.CanonicalizeString(nameof(LinkClickedParameter)); + public static readonly string LinkColor = NotifyService.CanonicalizeString(nameof(LinkColor)); + public static readonly string LocalDragSize = NotifyService.CanonicalizeString(nameof(LocalDragSize)); + public static readonly string Locked = NotifyService.CanonicalizeString(nameof(Locked)); + public static readonly string LockedAlignment = NotifyService.CanonicalizeString(nameof(LockedAlignment)); + public static readonly string LockedPosition = NotifyService.CanonicalizeString(nameof(LockedPosition)); + public static readonly string LostEventContext = NotifyService.CanonicalizeString(nameof(LostEventContext)); + public static readonly string LostFocus = NotifyService.CanonicalizeString(nameof(LostFocus)); + public static readonly string MaintainFocusedItemOnSourceChanges = NotifyService.CanonicalizeString(nameof(MaintainFocusedItemOnSourceChanges)); + public static readonly string Margins = NotifyService.CanonicalizeString(nameof(Margins)); + public static readonly string MaxLength = NotifyService.CanonicalizeString(nameof(MaxLength)); + public static readonly string MaxValue = NotifyService.CanonicalizeString(nameof(MaxValue)); + public static readonly string MaximizeMode = NotifyService.CanonicalizeString(nameof(MaximizeMode)); + public static readonly string MaximumLines = NotifyService.CanonicalizeString(nameof(MaximumLines)); + public static readonly string MaximumSize = NotifyService.CanonicalizeString(nameof(MaximumSize)); + public static readonly string MinValue = NotifyService.CanonicalizeString(nameof(MinValue)); + public static readonly string MinimumSize = NotifyService.CanonicalizeString(nameof(MinimumSize)); + public static readonly string MouseActive = NotifyService.CanonicalizeString(nameof(MouseActive)); + public static readonly string MouseFocus = NotifyService.CanonicalizeString(nameof(MouseFocus)); + public static readonly string MouseFocusImage = NotifyService.CanonicalizeString(nameof(MouseFocusImage)); + public static readonly string MouseIdleTimeout = NotifyService.CanonicalizeString(nameof(MouseIdleTimeout)); + public static readonly string MouseInteractive = NotifyService.CanonicalizeString(nameof(MouseInteractive)); + public static readonly string MouseInteractiveImage = NotifyService.CanonicalizeString(nameof(MouseInteractiveImage)); + public static readonly string MoveCursor = NotifyService.CanonicalizeString(nameof(MoveCursor)); + public static readonly string Moved = NotifyService.CanonicalizeString(nameof(Moved)); + public static readonly string Name = NotifyService.CanonicalizeString(nameof(Name)); + public static readonly string NamedStyles = NotifyService.CanonicalizeString(nameof(NamedStyles)); + public static readonly string Navigation = NotifyService.CanonicalizeString(nameof(Navigation)); + public static readonly string NearOffset = NotifyService.CanonicalizeString(nameof(NearOffset)); + public static readonly string NearPercent = NotifyService.CanonicalizeString(nameof(NearPercent)); + public static readonly string NewContentOnTop = NotifyService.CanonicalizeString(nameof(NewContentOnTop)); + public static readonly string ObjectValue = NotifyService.CanonicalizeString(nameof(ObjectValue)); + public static readonly string Options = NotifyService.CanonicalizeString(nameof(Options)); + public static readonly string Orientation = NotifyService.CanonicalizeString(nameof(Orientation)); + public static readonly string OutlineColor = NotifyService.CanonicalizeString(nameof(OutlineColor)); + public static readonly string OutlineLabel = NotifyService.CanonicalizeString(nameof(OutlineLabel)); + public static readonly string OutlineScope = NotifyService.CanonicalizeString(nameof(OutlineScope)); + public static readonly string Overtype = NotifyService.CanonicalizeString(nameof(Overtype)); + public static readonly string Padding = NotifyService.CanonicalizeString(nameof(Padding)); + public static readonly string PageSizedScrollStep = NotifyService.CanonicalizeString(nameof(PageSizedScrollStep)); + public static readonly string PageStep = NotifyService.CanonicalizeString(nameof(PageStep)); + public static readonly string PasswordMask = NotifyService.CanonicalizeString(nameof(PasswordMask)); + public static readonly string PasteCommand = NotifyService.CanonicalizeString(nameof(PasteCommand)); + public static readonly string Perspective = NotifyService.CanonicalizeString(nameof(Perspective)); + public static readonly string Playing = NotifyService.CanonicalizeString(nameof(Playing)); + public static readonly string Position = NotifyService.CanonicalizeString(nameof(Position)); + public static readonly string Prefetch = NotifyService.CanonicalizeString(nameof(Prefetch)); + public static readonly string PreloadContent = NotifyService.CanonicalizeString(nameof(PreloadContent)); + public static readonly string Pressing = NotifyService.CanonicalizeString(nameof(Pressing)); + public static readonly string PreventInterruption = NotifyService.CanonicalizeString(nameof(PreventInterruption)); + public static readonly string Priority = NotifyService.CanonicalizeString(nameof(Priority)); + public static readonly string Range = NotifyService.CanonicalizeString(nameof(Range)); + public static readonly string ReadOnly = NotifyService.CanonicalizeString(nameof(ReadOnly)); + public static readonly string Reason = NotifyService.CanonicalizeString(nameof(Reason)); + public static readonly string RelativeDragSize = NotifyService.CanonicalizeString(nameof(RelativeDragSize)); + public static readonly string RelativeTo = NotifyService.CanonicalizeString(nameof(RelativeTo)); + public static readonly string Repeat = NotifyService.CanonicalizeString(nameof(Repeat)); + public static readonly string RepeatDelay = NotifyService.CanonicalizeString(nameof(RepeatDelay)); + public static readonly string RepeatRate = NotifyService.CanonicalizeString(nameof(RepeatRate)); + public static readonly string RequiredModifiers = NotifyService.CanonicalizeString(nameof(RequiredModifiers)); + public static readonly string Result = NotifyService.CanonicalizeString(nameof(Result)); + public static readonly string Role = NotifyService.CanonicalizeString(nameof(Role)); + public static readonly string Root = NotifyService.CanonicalizeString(nameof(Root)); + public static readonly string Rotation = NotifyService.CanonicalizeString(nameof(Rotation)); + public static readonly string Scale = NotifyService.CanonicalizeString(nameof(Scale)); + public static readonly string ScreenDragSize = NotifyService.CanonicalizeString(nameof(ScreenDragSize)); + public static readonly string ScrollModel = NotifyService.CanonicalizeString(nameof(ScrollModel)); + public static readonly string ScrollStep = NotifyService.CanonicalizeString(nameof(ScrollStep)); + public static readonly string SelectAllCommand = NotifyService.CanonicalizeString(nameof(SelectAllCommand)); + public static readonly string SelectedIndex = NotifyService.CanonicalizeString(nameof(SelectedIndex)); + public static readonly string SelectedIndices = NotifyService.CanonicalizeString(nameof(SelectedIndices)); + public static readonly string SelectedItem = NotifyService.CanonicalizeString(nameof(SelectedItem)); + public static readonly string SelectedItems = NotifyService.CanonicalizeString(nameof(SelectedItems)); + public static readonly string SelectionRange = NotifyService.CanonicalizeString(nameof(SelectionRange)); + public static readonly string SharedSize = NotifyService.CanonicalizeString(nameof(SharedSize)); + public static readonly string SharedSizePolicy = NotifyService.CanonicalizeString(nameof(SharedSizePolicy)); + public static readonly string Shortcut = NotifyService.CanonicalizeString(nameof(Shortcut)); + public static readonly string ShowFar = NotifyService.CanonicalizeString(nameof(ShowFar)); + public static readonly string ShowInTaskbar = NotifyService.CanonicalizeString(nameof(ShowInTaskbar)); + public static readonly string ShowNear = NotifyService.CanonicalizeString(nameof(ShowNear)); + public static readonly string ShowWindowFrame = NotifyService.CanonicalizeString(nameof(ShowWindowFrame)); + public static readonly string SingleSelect = NotifyService.CanonicalizeString(nameof(SingleSelect)); + public static readonly string Size = NotifyService.CanonicalizeString(nameof(Size)); + public static readonly string SizingPolicy = NotifyService.CanonicalizeString(nameof(SizingPolicy)); + public static readonly string Source = NotifyService.CanonicalizeString(nameof(Source)); + public static readonly string SourceList = NotifyService.CanonicalizeString(nameof(SourceList)); + public static readonly string SourceType = NotifyService.CanonicalizeString(nameof(SourceType)); + public static readonly string SourceValue = NotifyService.CanonicalizeString(nameof(SourceValue)); + public static readonly string StartIndex = NotifyService.CanonicalizeString(nameof(StartIndex)); + public static readonly string Started = NotifyService.CanonicalizeString(nameof(Started)); + public static readonly string Status = NotifyService.CanonicalizeString(nameof(Status)); + public static readonly string Step = NotifyService.CanonicalizeString(nameof(Step)); + public static readonly string StopRoute = NotifyService.CanonicalizeString(nameof(StopRoute)); + public static readonly string StretchingPolicy = NotifyService.CanonicalizeString(nameof(StretchingPolicy)); + public static readonly string Style = NotifyService.CanonicalizeString(nameof(Style)); + public static readonly string SubmitOnEnter = NotifyService.CanonicalizeString(nameof(SubmitOnEnter)); + public static readonly string Submitted = NotifyService.CanonicalizeString(nameof(Submitted)); + public static readonly string SuggestedSize = NotifyService.CanonicalizeString(nameof(SuggestedSize)); + public static readonly string TextColor = NotifyService.CanonicalizeString(nameof(TextColor)); + public static readonly string TextDisplay = NotifyService.CanonicalizeString(nameof(TextDisplay)); + public static readonly string TextFont = NotifyService.CanonicalizeString(nameof(TextFont)); + public static readonly string TextHighlightColor = NotifyService.CanonicalizeString(nameof(TextHighlightColor)); + public static readonly string TextSharpness = NotifyService.CanonicalizeString(nameof(TextSharpness)); + public static readonly string Tick = NotifyService.CanonicalizeString(nameof(Tick)); + public static readonly string TotalPages = NotifyService.CanonicalizeString(nameof(TotalPages)); + public static readonly string TrackInvokedKeys = NotifyService.CanonicalizeString(nameof(TrackInvokedKeys)); + public static readonly string TreatEscapeAsBackspace = NotifyService.CanonicalizeString(nameof(TreatEscapeAsBackspace)); + public static readonly string Type = NotifyService.CanonicalizeString(nameof(Type)); + public static readonly string TypingInputRejected = NotifyService.CanonicalizeString(nameof(TypingInputRejected)); + public static readonly string Underline = NotifyService.CanonicalizeString(nameof(Underline)); + public static readonly string UndoCommand = NotifyService.CanonicalizeString(nameof(UndoCommand)); + public static readonly string Unloadable = NotifyService.CanonicalizeString(nameof(Unloadable)); + public static readonly string Up = NotifyService.CanonicalizeString(nameof(Up)); + public static readonly string UpAnimation = NotifyService.CanonicalizeString(nameof(UpAnimation)); + public static readonly string UpInvoked = NotifyService.CanonicalizeString(nameof(UpInvoked)); + public static readonly string UseFocusBehavior = NotifyService.CanonicalizeString(nameof(UseFocusBehavior)); + public static readonly string UsePasswordMask = NotifyService.CanonicalizeString(nameof(UsePasswordMask)); + public static readonly string Value = NotifyService.CanonicalizeString(nameof(Value)); + public static readonly string VerticalAlignment = NotifyService.CanonicalizeString(nameof(VerticalAlignment)); + public static readonly string VerticalScrollModel = NotifyService.CanonicalizeString(nameof(VerticalScrollModel)); + public static readonly string VideoStream = NotifyService.CanonicalizeString(nameof(VideoStream)); + public static readonly string ViewFar = NotifyService.CanonicalizeString(nameof(ViewFar)); + public static readonly string ViewNear = NotifyService.CanonicalizeString(nameof(ViewNear)); + public static readonly string Visible = NotifyService.CanonicalizeString(nameof(Visible)); + public static readonly string WindowState = NotifyService.CanonicalizeString(nameof(WindowState)); + public static readonly string WordWrap = NotifyService.CanonicalizeString(nameof(WordWrap)); + public static readonly string Wrap = NotifyService.CanonicalizeString(nameof(Wrap)); + public static readonly string Zn = NotifyService.CanonicalizeString(nameof(Zn)); + public static readonly string ZnAnimation = NotifyService.CanonicalizeString(nameof(ZnAnimation)); + } +} diff --git a/UIX/Microsoft/Iris/Markup/NotifyService.cs b/UIX/Microsoft/Iris/Markup/NotifyService.cs new file mode 100644 index 0000000..bcfeaf0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/NotifyService.cs @@ -0,0 +1,75 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.NotifyService +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using System.Diagnostics; + +namespace Microsoft.Iris.Markup +{ + internal struct NotifyService + { + private ListenerRootNode _listenerRoot; + private static Map s_canonicalizedStrings = new Map(2048); + + public void Fire(string id) + { + if (_listenerRoot == null || _listenerRoot.Next == null) + return; + for (ListenerNodeBase next = _listenerRoot.Next; next != _listenerRoot; next = next.Next) + { + Listener listener = (Listener)next; + if (ReferenceEquals(listener.Watch, id)) + listener.OnNotify(); + } + } + + public void FireThreadSafe(string id) + { + id = CanonicalizeString(id); + if (UIDispatcher.IsUIThread) + Fire(id); + else + DeferredCall.Post(DispatchPriority.AppEvent, new DeferredHandler(FireThreadSafeMarshalHandler), id); + } + + public void FireThreadSafeMarshalHandler(object arg) => Fire((string)arg); + + public bool HasListeners => _listenerRoot != null && _listenerRoot.Next != null; + + public void AddListener(Listener listener) + { + if (_listenerRoot == null) + _listenerRoot = new ListenerRootNode(); + _listenerRoot.AddPrevious(listener); + } + + public void ClearListeners() + { + if (_listenerRoot == null) + return; + while (_listenerRoot.Next != null) + _listenerRoot.Next.Unlink(); + _listenerRoot.Dispose(); + _listenerRoot = null; + } + + public static string CanonicalizeString(string value) => GetCanonicalizedString(value, true); + + private static string GetCanonicalizedString(string value, bool addIfNotFound) + { + object obj = null; + if (!s_canonicalizedStrings.TryGetValue(value, out obj) && addIfNotFound) + { + s_canonicalizedStrings[value] = value; + obj = value; + } + return (string)obj; + } + + [Conditional("DEBUG")] + public static void AssertIsCanonicalized(string value) => GetCanonicalizedString(value, false); + } +} diff --git a/UIX/Microsoft/Iris/Markup/ObjectSourceType.cs b/UIX/Microsoft/Iris/Markup/ObjectSourceType.cs new file mode 100644 index 0000000..2e6661d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ObjectSourceType.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ObjectSourceType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum ObjectSourceType + { + ObjectTag = 1, + FromString = 2, + Code = 3, + Expression = 4, + } +} diff --git a/UIX/Microsoft/Iris/Markup/OpCode.cs b/UIX/Microsoft/Iris/Markup/OpCode.cs new file mode 100644 index 0000000..17cd7d7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/OpCode.cs @@ -0,0 +1,59 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.OpCode +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum OpCode : byte + { + ConstructObject = 1, + ConstructObjectIndirect = 2, + ConstructObjectParam = 3, + ConstructFromString = 4, + ConstructFromBinary = 5, + InitializeInstance = 6, + InitializeInstanceIndirect = 7, + LookupSymbol = 8, + WriteSymbol = 9, + WriteSymbolPeek = 10, // 0x0A + ClearSymbol = 11, // 0x0B + PropertyInitialize = 12, // 0x0C + PropertyInitializeIndirect = 13, // 0x0D + PropertyListAdd = 14, // 0x0E + PropertyDictionaryAdd = 15, // 0x0F + PropertyAssign = 16, // 0x10 + PropertyAssignStatic = 17, // 0x11 + PropertyGet = 18, // 0x12 + PropertyGetPeek = 19, // 0x13 + PropertyGetStatic = 20, // 0x14 + MethodInvoke = 21, // 0x15 + MethodInvokePeek = 22, // 0x16 + MethodInvokeStatic = 23, // 0x17 + MethodInvokePushLastParam = 24, // 0x18 + MethodInvokeStaticPushLastParam = 25, // 0x19 + VerifyTypeCast = 26, // 0x1A + ConvertType = 27, // 0x1B + Operation = 28, // 0x1C + IsCheck = 29, // 0x1D + As = 30, // 0x1E + TypeOf = 31, // 0x1F + PushNull = 32, // 0x20 + PushConstant = 33, // 0x21 + PushThis = 34, // 0x22 + DiscardValue = 35, // 0x23 + ReturnValue = 36, // 0x24 + ReturnVoid = 37, // 0x25 + JumpIfFalse = 38, // 0x26 + JumpIfFalsePeek = 39, // 0x27 + JumpIfTruePeek = 40, // 0x28 + JumpIfDictionaryContains = 41, // 0x29 + JumpIfNullPeek = 42, // 0x2A + Jump = 43, // 0x2B + ConstructListenerStorage = 44, // 0x2C + Listen = 45, // 0x2D + DestructiveListen = 46, // 0x2E + EnterDebugState = 47, // 0x2F + } +} diff --git a/UIX/Microsoft/Iris/Markup/OperationType.cs b/UIX/Microsoft/Iris/Markup/OperationType.cs new file mode 100644 index 0000000..c60c7ce --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/OperationType.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.OperationType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum OperationType + { + MathAdd = 1, + MathSubtract = 2, + MathMultiply = 3, + MathDivide = 4, + MathModulus = 5, + LogicalAnd = 6, + LogicalOr = 7, + RelationalEquals = 8, + RelationalNotEquals = 9, + RelationalLessThan = 10, // 0x0000000A + RelationalGreaterThan = 11, // 0x0000000B + RelationalLessThanEquals = 12, // 0x0000000C + RelationalGreaterThanEquals = 13, // 0x0000000D + RelationalIs = 14, // 0x0000000E + LogicalNot = 15, // 0x0000000F + MathNegate = 16, // 0x00000010 + PostIncrement = 17, // 0x00000011 + PostDecrement = 18, // 0x00000012 + } +} diff --git a/UIX/Microsoft/Iris/Markup/ParameterContext.cs b/UIX/Microsoft/Iris/Markup/ParameterContext.cs new file mode 100644 index 0000000..323267c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ParameterContext.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ParameterContext +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal struct ParameterContext + { + private string[] _parameterNames; + private object[] _parameterValues; + + public ParameterContext(string[] parameterNames, object[] parameterValues) + { + _parameterNames = parameterNames; + _parameterValues = parameterValues; + } + + public object ReadParameter(string name) + { + int length = _parameterNames.Length; + for (int index = 0; index < length; ++index) + { + if (_parameterNames[index] == name) + return _parameterValues[index]; + } + return null; + } + + public void WriteParameter(string name, object value) + { + int length = _parameterNames.Length; + for (int index = 0; index < length; ++index) + { + if (_parameterNames[index] == name) + { + _parameterValues[index] = value; + break; + } + } + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/ParseResult.cs b/UIX/Microsoft/Iris/Markup/ParseResult.cs new file mode 100644 index 0000000..0d7e7e4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ParseResult.cs @@ -0,0 +1,23 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ParseResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.Validation; + +namespace Microsoft.Iris.Markup +{ + internal class ParseResult + { + public string Root; + public string Version; + public ValidateNamespace XmlnsList; + public bool HasErrors; + public Vector ClassList = new Vector(4); + public Vector AliasList = s_EmptyAliasList; + public Vector DataMappingList = s_EmptyDataMappingList; + public static Vector s_EmptyAliasList = new Vector(0); + public static Vector s_EmptyDataMappingList = new Vector(0); + } +} diff --git a/UIX/Microsoft/Iris/Markup/Parser.cs b/UIX/Microsoft/Iris/Markup/Parser.cs new file mode 100644 index 0000000..4795929 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/Parser.cs @@ -0,0 +1,381 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.Parser +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Markup.Validation; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; +using SSVParseLib; +using System.Collections; +using System.Xml; + +namespace Microsoft.Iris.Markup +{ + internal class Parser + { + private static ParserLexClass s_lex; + private static ParserYaccClass s_yacc; + private static SSLexTable s_lexTable; + private static SSYaccTable s_yaccTable; + private static bool s_parserActive; + + public static ParseResult Invoke(SourceMarkupLoader owner, Resource resource) + { + ErrorWatermark watermark = ErrorManager.Watermark; + ParseResult parseResult = new ParseResult(); + Stack parseStack = new Stack(); + bool flag = false; + bool additionalMetadata = MarkupSystem.TrackAdditionalMetadata; + using (ManagedXmlReader xmlReader = new ManagedXmlReader(resource)) + { + try + { + string str1 = string.Empty; + XmlNodeType nodeType; + while (xmlReader.Read(out nodeType)) + { + if (parseResult.Root == null || parseStack.Count == 0 && nodeType == XmlNodeType.EndElement) + { + if (nodeType == XmlNodeType.Element) + { + parseResult.Root = xmlReader.Name; + while (xmlReader.ReadAttribute()) + { + string name = xmlReader.Name; + string prefix = xmlReader.Prefix; + if (name == "xmlns") + parseResult.Version = xmlReader.Value; + else if (prefix == "xmlns") + { + ValidateNamespace validateNamespace = new ValidateNamespace(owner, xmlReader.LocalName, xmlReader.Value, xmlReader.LineNumber, xmlReader.LinePosition); + if (parseResult.XmlnsList == null) + parseResult.XmlnsList = validateNamespace; + else + parseResult.XmlnsList.AppendToEnd(validateNamespace); + } + else + ReportError(xmlReader, "Unexpected attribute '{0}' on root tag", name); + } + } + } + else + { + switch (nodeType) + { + case XmlNodeType.Element: + if (flag) + { + ReportError(xmlReader, "Script tag may not contain XML elements, found: '{0}'", xmlReader.Name); + continue; + } + bool isEmptyElement = xmlReader.IsEmptyElement; + string prefix1 = xmlReader.Prefix; + string localName = xmlReader.LocalName; + if (parseStack.Count % 2 == 0) + { + if (prefix1 == "" && localName == "Script") + { + flag = true; + parseStack.Push(new Parser.ScriptBlock(xmlReader.LineNumber, xmlReader.LinePosition)); + if (xmlReader.ReadAttribute()) + ReportError(xmlReader, "Script tag may not have XML attributes"); + } + else + { + ValidateTypeIdentifier typeIdentifier = new ValidateTypeIdentifier(owner, prefix1, localName, xmlReader.LineNumber, xmlReader.LinePosition); + bool isRootTag = parseStack.Count == 0; + ValidateObjectTag objectTagValidator = owner.CreateObjectTagValidator(typeIdentifier, xmlReader.LineNumber, xmlReader.LinePosition, isRootTag); + while (xmlReader.ReadAttribute()) + { + if (xmlReader.Prefix == string.Empty) + { + ValidateObject objectFromString = CreateValidateObjectFromString(owner, xmlReader); + ValidateProperty property = new ValidateProperty(owner, xmlReader.LocalName, objectFromString, xmlReader.LineNumber, xmlReader.LinePosition); + objectTagValidator.AddProperty(property); + } + else + ReportError(xmlReader, "Property or Object tag may not have prefixed attributes: '{0}'", xmlReader.Name); + } + parseStack.Push(objectTagValidator); + if (additionalMetadata && !string.IsNullOrEmpty(str1)) + { + objectTagValidator.Metadata.Comments = str1; + str1 = string.Empty; + } + } + } + else + { + if (prefix1 != string.Empty) + ReportError(xmlReader, "Property tag may not be prefixed: '{0}'", xmlReader.Name); + if (localName == "Methods") + { + flag = true; + parseStack.Push(new Parser.ScriptBlock(xmlReader.LineNumber, xmlReader.LinePosition, CodeType.Methods)); + if (xmlReader.ReadAttribute()) + ReportError(xmlReader, "Script tag may not have XML attributes"); + } + else + { + ValidateProperty validateProperty = new ValidateProperty(owner, localName, xmlReader.LineNumber, xmlReader.LinePosition); + while (xmlReader.ReadAttribute()) + { + if (xmlReader.Prefix == string.Empty) + validateProperty.AddAttribute(new PropertyAttribute() + { + Name = xmlReader.LocalName, + Value = xmlReader.Value + }); + else + ReportError(xmlReader, "Property or Object tag may not have prefixed attributes: '{0}'", xmlReader.Name); + } + parseStack.Push(validateProperty); + } + } + if (isEmptyElement) + { + flag = false; + HandleEndElement(owner, parseResult, parseStack); + continue; + } + continue; + case XmlNodeType.Text: + case XmlNodeType.CDATA: + if (parseStack.Count == 0) + { + ReportError(xmlReader, "Text/CDATA is not allowed under root tag ('{0}')", xmlReader.Value.Trim()); + continue; + } + switch (parseStack.Peek()) + { + case ValidateProperty validateProperty: + if (validateProperty.Value == null) + { + validateProperty.Value = CreateValidateObjectFromString(owner, xmlReader); + continue; + } + if (validateProperty.Value is ValidateFromString) + { + ReportError(xmlReader, "Property tag may only contain one Text/CDATA, found more text: '{0}'", xmlReader.Value.Trim()); + continue; + } + 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) + { + scriptBlock.ValidateValue = ParseCode(owner, xmlReader, scriptBlock.CodeType); + continue; + } + ReportError(xmlReader, "Script tag may only contain one Text/CDATA, found more text: '{0}'", xmlReader.Value.Trim()); + continue; + default: + ReportError(xmlReader, "Object tag may not contain Text/CDATA: '{0}'", xmlReader.Value.Trim()); + continue; + } + case XmlNodeType.Comment: + string str2 = null; + if (additionalMetadata) + { + str2 = xmlReader.Value; + str1 = str1 + '\n' + str2; + } + if (flag) + { + if (str2 == null) + str2 = xmlReader.Value; + ReportError(xmlReader, "Script tag may not contain XML comments, found: '{0}'", str2.Trim()); + continue; + } + continue; + case XmlNodeType.EndElement: + flag = false; + HandleEndElement(owner, parseResult, parseStack); + continue; + default: + continue; + } + } + } + } + catch (NativeXmlException ex) + { + ErrorManager.ReportError(ex.LineNumber, ex.LinePosition, ex.Message); + } + } + if (watermark.ErrorsDetected) + { + parseResult = new ParseResult(); + parseResult.HasErrors = true; + } + return parseResult; + } + + private static void HandleEndElement( + SourceMarkupLoader owner, + ParseResult parseResult, + Stack parseStack) + { + if (parseStack.Count % 2 == 1) + { + object obj = parseStack.Pop(); + bool flag = false; + ValidateObject validateObject; + // FIXME + ScriptBlock scriptBlock = null; + if (obj is Parser.ScriptBlock) + { + scriptBlock = (Parser.ScriptBlock)obj; + validateObject = (ValidateObject)scriptBlock.ValidateValue; + } + else + { + validateObject = (ValidateObject)obj; + flag = true; + } + if (parseStack.Count == 0) + { + switch (validateObject) + { + case ValidateClass validateClass: + parseResult.ClassList.Add(validateClass); + break; + case ValidateAlias validateAlias: + if (parseResult.AliasList == ParseResult.s_EmptyAliasList) + parseResult.AliasList = new Vector(4); + parseResult.AliasList.Add(validateAlias); + break; + case ValidateDataMapping validateDataMapping: + if (parseResult.DataMappingList == ParseResult.s_EmptyDataMappingList) + parseResult.DataMappingList = new Vector(4); + parseResult.DataMappingList.Add(validateDataMapping); + break; + default: + if (flag) + { + ValidateObjectTag validateObjectTag = (ValidateObjectTag)validateObject; + 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 ", "Script"); + break; + } + } + else if (validateObject != null) + ((ValidateProperty)parseStack.Peek()).AddValue(validateObject); + if (!flag) + return; + ((ValidateObjectTag)validateObject).NotifyParseComplete(); + } + else + { + object obj = parseStack.Pop(); + ValidateProperty property = obj as ValidateProperty; + ValidateObjectTag validateObjectTag = (ValidateObjectTag)parseStack.Peek(); + if (property != null) + { + validateObjectTag.AddProperty(property); + } + else + { + Parser.ScriptBlock scriptBlock = (Parser.ScriptBlock)obj; + if (validateObjectTag is ValidateClass validateClass) + validateClass.NotifyFoundMethodList((ValidateMethodList)scriptBlock.ValidateValue); + else + ErrorManager.ReportError(scriptBlock.ValidateValue.Line, scriptBlock.ValidateValue.Column, "Methods allowed only on , and "); + } + } + } + + private static ValidateObject CreateValidateObjectFromString( + SourceMarkupLoader owner, + ManagedXmlReader xmlReader) + { + if (xmlReader.IsInlineExpression) + return (ValidateObject)ParseCode(owner, xmlReader, CodeType.InlineExpression); + string fromString = xmlReader.Value; + bool expandEscapes = true; + if (fromString.Length > 0 && fromString[0] == '@') + { + fromString = fromString.Substring(1); + expandEscapes = false; + } + return new ValidateFromString(owner, fromString, expandEscapes, xmlReader.LineNumber, xmlReader.LinePosition); + } + + private static Validate ParseCode( + SourceMarkupLoader owner, + ManagedXmlReader xmlReader, + Parser.CodeType codeType) + { + Validate validate = null; + if (s_lexTable == null) + { + s_lexTable = new ParserLexTable(); + s_yaccTable = new ParserYaccTable(); + s_lex = new ParserLexClass(s_lexTable); + s_yacc = new ParserYaccClass(s_yaccTable, s_lex); + } + string prefix; + switch (codeType) + { + case CodeType.Methods: + prefix = "%%"; + break; + case CodeType.InlineExpression: + prefix = "$$"; + break; + default: + prefix = "@@"; + break; + } + SSLexUnicodeBufferConsumer unicodeBufferConsumer = xmlReader.LexConsumerForValueWithPrefix(prefix); + s_lex.Reset(unicodeBufferConsumer); + s_yacc.Reset(owner); + s_parserActive = true; + s_yacc.parse(); + if (!s_yacc.HasErrors) + { + validate = (Validate)s_yacc.treeRoot().Object; + if (MarkupSystem.TrackAdditionalMetadata) + validate.Metadata.OriginalValue = xmlReader.Value; + } + s_lex.Reset(null); + s_yacc.Reset(null); + s_parserActive = false; + return validate; + } + + private static void ReportError(ManagedXmlReader xmlReader, string message) => ErrorManager.ReportError(xmlReader.LineNumber, xmlReader.LinePosition, message); + + private static void ReportError(ManagedXmlReader xmlReader, string message, object param) => ErrorManager.ReportError(xmlReader.LineNumber, xmlReader.LinePosition, message, param); + + private enum CodeType + { + ScriptBlock, + Methods, + InlineExpression, + } + + private class ScriptBlock + { + public Validate ValidateValue; + public int Line; + public int Column; + public Parser.CodeType CodeType; + + public ScriptBlock(int line, int column) + { + Line = line; + Column = column; + } + + public ScriptBlock(int line, int column, Parser.CodeType codeType) + : this(line, column) + => CodeType = codeType; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/PerformOperationHandler.cs b/UIX/Microsoft/Iris/Markup/PerformOperationHandler.cs new file mode 100644 index 0000000..7620880 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/PerformOperationHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.PerformOperationHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate object PerformOperationHandler(object left, object right, OperationType op); +} diff --git a/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteria.cs b/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteria.cs new file mode 100644 index 0000000..d1c4214 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteria.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.PropertyOverrideCriteria +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal abstract class PropertyOverrideCriteria + { + public abstract Result Verify(PropertyOverrideCriteria baseCriteria); + } +} diff --git a/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteriaTypeConstraint.cs b/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteriaTypeConstraint.cs new file mode 100644 index 0000000..28a6332 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/PropertyOverrideCriteriaTypeConstraint.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.PropertyOverrideCriteriaTypeConstraint +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal class PropertyOverrideCriteriaTypeConstraint : PropertyOverrideCriteria + { + private TypeSchema _use; + private TypeSchema _constraint; + + public PropertyOverrideCriteriaTypeConstraint(TypeSchema use, TypeSchema constraint) + { + _use = use; + _constraint = constraint; + } + + public override Result Verify(PropertyOverrideCriteria baseCriteria) + { + PropertyOverrideCriteriaTypeConstraint criteriaTypeConstraint = (PropertyOverrideCriteriaTypeConstraint)baseCriteria; + if (!criteriaTypeConstraint.Constraint.IsAssignableFrom(_use)) + 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(_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 => _use; + + public TypeSchema Constraint => _constraint; + } +} diff --git a/UIX/Microsoft/Iris/Markup/PropertySchema.cs b/UIX/Microsoft/Iris/Markup/PropertySchema.cs new file mode 100644 index 0000000..2713943 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/PropertySchema.cs @@ -0,0 +1,48 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.PropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal abstract class PropertySchema : DisposableObject + { + public static PropertySchema[] EmptyList = new PropertySchema[0]; + private TypeSchema _owner; + + public PropertySchema(TypeSchema owner) + { + _owner = owner; + DeclareOwner(owner); + } + + public TypeSchema Owner => _owner; + + public abstract string Name { get; } + + public abstract TypeSchema PropertyType { get; } + + public abstract TypeSchema AlternateType { get; } + + public abstract bool CanRead { get; } + + public abstract bool CanWrite { get; } + + public abstract bool IsStatic { get; } + + public abstract ExpressionRestriction ExpressionRestriction { get; } + + public abstract bool RequiredForCreation { get; } + + public abstract RangeValidator RangeValidator { get; } + + public abstract bool NotifiesOnChange { get; } + + public abstract object GetValue(object instance); + + public abstract void SetValue(ref object instance, object value); + } +} diff --git a/UIX/Microsoft/Iris/Markup/ProviderlessMarkupDataType.cs b/UIX/Microsoft/Iris/Markup/ProviderlessMarkupDataType.cs new file mode 100644 index 0000000..15e8909 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ProviderlessMarkupDataType.cs @@ -0,0 +1,58 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ProviderlessMarkupDataType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Markup +{ + internal class ProviderlessMarkupDataType : MarkupDataType + { + private IDataProviderObject _externalAssemblyObject; + + public ProviderlessMarkupDataType(MarkupDataTypeSchema typeSchema) + : base(typeSchema) + { + } + + protected override IDataProviderBaseObject ExternalAssemblyObject + { + get + { + if (_externalAssemblyObject == null) + _externalAssemblyObject = new ProviderlessDataProviderObject(this, (MarkupDataTypeSchema)TypeSchema); + return _externalAssemblyObject; + } + } + + public override IntPtr ExternalNativeObject => IntPtr.Zero; + + public override object ReadSymbol(SymbolReference symbolRef) + { + lock (SynchronizedPropertyStorage) + return base.ReadSymbol(symbolRef); + } + + public override void WriteSymbol(SymbolReference symbolRef, object value) + { + lock (SynchronizedPropertyStorage) + base.WriteSymbol(symbolRef, value); + } + + public override object GetProperty(string name) + { + lock (SynchronizedPropertyStorage) + return base.GetProperty(name); + } + + public override void SetProperty(string name, object value) + { + lock (SynchronizedPropertyStorage) + base.SetProperty(name, value); + } + + private object SynchronizedPropertyStorage => _storage; + } +} diff --git a/UIX/Microsoft/Iris/Markup/RangeValidator.cs b/UIX/Microsoft/Iris/Markup/RangeValidator.cs new file mode 100644 index 0000000..8fa9553 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/RangeValidator.cs @@ -0,0 +1,12 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.RangeValidator +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal delegate Result RangeValidator(object value); +} diff --git a/UIX/Microsoft/Iris/Markup/ReflectionHelper.cs b/UIX/Microsoft/Iris/Markup/ReflectionHelper.cs new file mode 100644 index 0000000..302b1a7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ReflectionHelper.cs @@ -0,0 +1,94 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ReflectionHelper +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; +using System.Reflection; +using System.Reflection.Emit; + +namespace Microsoft.Iris.Markup +{ + internal static class ReflectionHelper + { + private static System.Reflection.Emit.OpCode[] s_loadInts = new System.Reflection.Emit.OpCode[9] + { + OpCodes.Ldc_I4_0, + OpCodes.Ldc_I4_1, + OpCodes.Ldc_I4_2, + OpCodes.Ldc_I4_3, + OpCodes.Ldc_I4_4, + OpCodes.Ldc_I4_5, + OpCodes.Ldc_I4_6, + OpCodes.Ldc_I4_7, + OpCodes.Ldc_I4_8 + }; + private static Module s_irisModule = typeof(ReflectionHelper).Module; + + public static FastReflectionInvokeHandler CreateMethodInvoke( + MethodBase methodBase) + { + DynamicMethod dynamicMethod = new DynamicMethod("MethodInvoker", typeof(object), new Type[2] + { + typeof (object), + typeof (object[]) + }, s_irisModule, true); + ILGenerator ilGenerator = dynamicMethod.GetILGenerator(); + ParameterInfo[] parameters = methodBase.GetParameters(); + Type[] typeArray = new Type[parameters.Length]; + for (int index = 0; index < parameters.Length; ++index) + typeArray[index] = parameters[index].ParameterType; + MethodInfo methodInfo = methodBase as MethodInfo; + if (methodInfo != null && !methodInfo.IsStatic) + { + methodInfo = (MethodInfo)methodBase; + ilGenerator.Emit(OpCodes.Ldarg_0); + Type declaringType = methodInfo.DeclaringType; + EmitCastToType(ilGenerator, declaringType); + if (declaringType.IsValueType) + { + LocalBuilder local = ilGenerator.DeclareLocal(declaringType); + ilGenerator.Emit(OpCodes.Stloc_0); + ilGenerator.Emit(OpCodes.Ldloca_S, local); + } + } + for (int index = 0; index < typeArray.Length; ++index) + { + ilGenerator.Emit(OpCodes.Ldarg_1); + if (index < s_loadInts.Length) + ilGenerator.Emit(s_loadInts[index]); + else + ilGenerator.Emit(OpCodes.Ldc_I4, index); + ilGenerator.Emit(OpCodes.Ldelem_Ref); + EmitCastToType(ilGenerator, typeArray[index]); + } + Type cls; + if (methodInfo != null) + { + ilGenerator.EmitCall(methodInfo.IsStatic ? OpCodes.Call : OpCodes.Callvirt, methodInfo, null); + cls = methodInfo.ReturnType; + } + else + { + ConstructorInfo con = (ConstructorInfo)methodBase; + ilGenerator.Emit(OpCodes.Newobj, con); + cls = con.DeclaringType; + } + if (cls == typeof(void)) + ilGenerator.Emit(OpCodes.Ldnull); + else if (cls.IsValueType) + ilGenerator.Emit(OpCodes.Box, cls); + ilGenerator.Emit(OpCodes.Ret); + return (FastReflectionInvokeHandler)dynamicMethod.CreateDelegate(typeof(FastReflectionInvokeHandler)); + } + + private static void EmitCastToType(ILGenerator il, Type type) + { + if (type.IsValueType) + il.Emit(OpCodes.Unbox_Any, type); + else + il.Emit(OpCodes.Castclass, type); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/RuntimeMessage.cs b/UIX/Microsoft/Iris/Markup/RuntimeMessage.cs new file mode 100644 index 0000000..8690af4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/RuntimeMessage.cs @@ -0,0 +1,81 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.RuntimeMessage +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class RuntimeMessage + { + public const string AccessibilityAccessWhenNotEnabled = "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"; + public const string AnchorLayoutAnchorItemNotFound = "Anchor layout: {0} cannot find the '{1}' child"; + public const string AnchorLayoutInconsistentEdges = "All AnchorEdges must refer to actual positions on AnchorLayoutInput {0}."; + public const string AnchorContributesActual = "AnchorLayoutInput {0} cannot contribute to width or height."; + public const string AnimationInvalidKeyframeSingleType = "Animation must have at least 2 keyframes of each type. Attempted to play an animation that only has {0} keyframe of type '{1}'."; + public const string AnimationInvalidKeyframeNoZeroForType = "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}'"; + public const string AnimationInvalidKeyframeCount = "Animations must have at least 2 keyframes to play"; + public const string DepersistInvalidFile = "Invalid compiled UIX file"; + public const string DepersistWrongFileVersion = "Compiled UIX file '{0}' was compiled for the runtime with version {1}, but the current runtime is version {2}"; + public const string DisposeAttemptOnNonDisposableObject = "Attempt to dispose an object '{0}' that isn't disposable"; + public const string DisposeAttemptUnownedObject = "Attempt to dispose an object '{0}' that '{1}' doesn't own"; + public const string ExplicitResourceRedirectFailure = "Resource {0} not found, but should have been located by a markup redirect"; + public const string FileNotFound = "File not found: '{0}'"; + public const string FontResourceNotFound = "Font Resource {1} not found in module {0}"; + public const string HostCannotInvokeMethods = "Host '{0}' is currently not hosting a UI and therefore cannot invoke methods"; + public const string HostIsNotUnloadable = "UnloadAll may only be called on Unloadable hosts"; + public const string HostRequestReplacementTypeMustBeUI = "RequestSource failed: Referrenced type '{0}' is not a UI"; + public const string HostRequestSourceUriLoadFailed = "RequestSource failed: Unable to load '{0}'"; + public const string HostRequestUIDoesNotMatchTypeRestriction = "RequestSource failed: Found '{0}' within '{1}', but, it is not a '{2}'"; + public const string HostRequestUINotFoundWithinMarkupLoadResult = "RequestSource failed: Unable to find '{0}' within '{1}'"; + public const string HwndHostBackgroundSolidColor = "HwndHost.Background must be a solid color"; + public const string InterpreterChildAddOperation = "Child Add"; + public const string InterpreterConstructionOperation = "Construction"; + public const string InterpreterConversionFailed = "Script runtime failure: Type conversion failed while attempting to convert to '{0}' ({1})"; + public const string InterpreterDictionaryAddOperation = "Dictionary Add"; + public const string InterpreterDictionaryContainsOperation = "Dictionary Contains"; + public const string InterpreterDynamicConstructionTypeMismatch = "Script runtime failure: Dynamic construction type override failed. Attempting to construct '{0}' in place of '{1}'"; + public const string InterpreterInitializeOperation = "Initialize"; + public const string InterpreterInvalidCast = "Script runtime failure: Invalid type cast while attempting to cast an instance with a runtime type of '{0}' to '{1}'"; + public const string InterpreterListAddOperation = "List Add"; + public const string InterpreterMethodInvokeOperation = "Method Invoke"; + public const string InterpreterNullReferenceMember = "Script runtime failure: Null-reference while attempting a '{0}' of '{1}' on a null instance"; + public const string InterpreterNullReference = "Script runtime failure: Null-reference while attempting a '{0}'"; + public const string InterpreterObjectAlreadyDisposed = "Script runtime failure: Attempting a '{0}' of '{1}' on an object '{2}' that has already been disposed"; + public const string InterpreterPropertyGetOperation = "Property Get"; + public const string InterpreterPropertySetOperation = "Property Set"; + public const string InterpreterReplacementTypeInvalidPropertyValue = "Script runtime failure: Incompatible value for property '{0}' supplied (expecting values of type '{1}' but got '{2}') while constructing runtime replacement type '{3}' (original type '{4}')"; + public const string InterpreterTypeConversionOperation = "Type Conversion"; + public const string InterpreterVerifyTypeCastOperation = "Verify Type Cast"; + public const string InvalidResourceScheme = "Invalid resource protocol: '{0}'"; + public const string InvalidResourceUri = "Invalid resource uri: '{0}'"; + public const string KeyHandlerNeedToTrackInvokedKeys = "KeyHandler needs to be marked TrackInvokedKeys=\"true\" in order to call GetInvokedKeys()"; + public const string MarkupTypeScriptErrorsWhileBuildingNamedContent = "Script runtime failure: Scripting errors have prevented '{0}' named content from being constructed"; + public const string MarkupTypeScriptErrorsWhileInitializing = "Script runtime failure: Scripting errors have prevented '{0}' from properly initializing and will affect its operation"; + public const string MarkupTypeScriptsDisabledDueToErrors = "Script runtime failure: Scripting has been disabled for '{0}' due to runtime scripting errors"; + public const string NoValidFocusTarget = "No valid focus target found. Input from a keyboard or remote will be ignored until focus is restored"; + public const string RepeaterInvalidContent = "Repeater failed to find content to repeat. ContentName was '{0}'"; + public const string RepeaterInvalidInlineContent = "Repeater unable to create inline content"; + public const string RepeaterInvalidDividerContent = "Repeater failed to find divider content to repeat (DividerName was '{0}')"; + public const string RepeaterNoContent = "Repeater has no content to repeat"; + public const string ReplacementTypeMissingRequiredProperty = "Runtime UI replacement to '{0}' failed since required property '{1}' was never provided a value"; + public const string ReplacementTypeInvalidProperty = "Runtime UI replacement to '{0}' failed since a property named '{1}' was specified but doesn't exist on '{0}'"; + public const string ReplacementTypeInvalidPropertyValue = "Runtime UI replacement to '{0}' failed since the value specified ({1}) for the '{2}' property is incompatible (type expected is '{3}')"; + public const string ResourceAcquireFailed = "Failed to acquire resource '{0}'"; + public const string ResourceAcquireFailedNoAsync = "Failed to acquire resource '{0}'. Resources that cannot be fetched synchronously are not valid in this context"; + public const string ResourceDownloadFailed = "Failed to complete download from '{0}'"; + public const string ResourceInvalidUri = "Invalid URI: '{0}'"; + public const string ResourceHttpHostConnectionFailed = "Unable to connect to web host: '{0}'"; + public const string ResourceNotFound = "Resource not found: res://{0}!{1}"; + public const string SchemaArgumentInvalidParameter = "Script runtime failure: Invalid '{0}' value for '{1}'"; + public const string SchemaArgumentInvalidParameterListContents = "Script runtime failure: Invalid value '{0}' within list '{1}'"; + public const string SchemaArgumentNullParameter = "Script runtime failure: Invalid 'null' value for '{0}'"; + public const string SchemaArgumentOutOfRangeParameter = "Script runtime failure: Invalid '{0}' value is out of range for '{1}'"; + public const string SelectionOutsideList = "Selected Index {0} is not a valid index in SourceList of size {1}"; + public const string SelectionOperationNotSupported = "Calling {0} is not supported on a SelectionManager in single selection modes."; + public const string SelectionCannotModifySelection = "Cannot modify selection through the list returned by {0}. Use the methods on SelectionManager instead."; + public const string TextEditableComplexFormattingDisallowed = "Text: Complex formatting unsupported on text that is editable"; + public const string TextScrollModelAttachedToMultipleHandlers = "TextScrollModel can't be attached to multiple TextEditingHandlers"; + public const string TooManyUnloadableHosts = "Maximum number of Unloadable Hosts reached"; + } +} diff --git a/UIX/Microsoft/Iris/Markup/SSLexUnicodeBufferConsumer.cs b/UIX/Microsoft/Iris/Markup/SSLexUnicodeBufferConsumer.cs new file mode 100644 index 0000000..c16da5e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SSLexUnicodeBufferConsumer.cs @@ -0,0 +1,78 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SSLexUnicodeBufferConsumer +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.OS; +using SSVParseLib; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class SSLexUnicodeBufferConsumer : SSLexConsumer + { + private char[] _buffer; + private uint _length; + private string _prefix; + + public SSLexUnicodeBufferConsumer(char[] buffer, uint length) + : this(buffer, length, "") + { + } + + public SSLexUnicodeBufferConsumer(IntPtr intPtr, uint length) + : this(intPtr, length, "") + { + } + + public unsafe SSLexUnicodeBufferConsumer(char[] buffer, uint length, string prefix) + { + _buffer = buffer; + _length = length; + _prefix = prefix; + } + + public unsafe SSLexUnicodeBufferConsumer(IntPtr intPtr, uint length, string prefix) + { + _buffer = new char[length]; + System.Runtime.InteropServices.Marshal.Copy(intPtr, _buffer, 0, (int)length); + _length = length; + _prefix = prefix; + } + + public override bool getNext() => GetCharAt(m_index, out m_current); + + public override unsafe string getSubstring(int start, int length) + { + if (start + length <= _prefix.Length) + { + return _prefix.Substring(start, length); + } + else + { + fixed (char* ptr = _buffer) + { + return NativeApi.PtrToStringUni(new IntPtr(ptr + start - _prefix.Length), length); + } + } + } + + public unsafe bool GetCharAt(int position, out char ch) + { + if (position < _prefix.Length) + { + ch = _prefix[m_index]; + return true; + } + int index = position - _prefix.Length; + if (index < _length) + { + ch = _buffer[index]; + return true; + } + ch = char.MinValue; + return false; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/SchemaType.cs b/UIX/Microsoft/Iris/Markup/SchemaType.cs new file mode 100644 index 0000000..3947ced --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SchemaType.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SchemaType +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum SchemaType + { + None, + Type, + Constructor, + Property, + Method, + Event, + CanonicalInstance, + } +} diff --git a/UIX/Microsoft/Iris/Markup/ScriptRunScheduler.cs b/UIX/Microsoft/Iris/Markup/ScriptRunScheduler.cs new file mode 100644 index 0000000..16731b1 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ScriptRunScheduler.cs @@ -0,0 +1,77 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ScriptRunScheduler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Markup +{ + internal struct ScriptRunScheduler + { + private Vector _pendingList; + private static ScriptRunScheduler.RunListCache s_listCache = new ScriptRunScheduler.RunListCache(); + + public bool Pending => _pendingList != null; + + public void ScheduleRun(uint scriptId, bool ignoreErrors) + { + if (_pendingList == null) + _pendingList = s_listCache.Acquire(); + int index; + for (index = 0; index < _pendingList.Count; ++index) + { + uint scriptId1 = _pendingList[index].ScriptId; + if ((int)scriptId == (int)scriptId1) + return; + if (scriptId < scriptId1) + break; + } + _pendingList.Insert(index, new ScriptRunScheduler.PendingScript(scriptId, ignoreErrors)); + } + + public void Execute(IMarkupTypeBase markupTypeBase) + { + if (_pendingList == null) + return; + Vector pendingList = _pendingList; + _pendingList = null; + for (int index = 0; index < pendingList.Count; ++index) + { + ScriptRunScheduler.PendingScript pendingScript = pendingList[index]; + markupTypeBase.RunScript(pendingScript.ScriptId, pendingScript.IgnoreErrors, new ParameterContext()); + } + s_listCache.Release(pendingList); + } + + internal struct PendingScript + { + public uint ScriptId; + public bool IgnoreErrors; + + public PendingScript(uint scriptId, bool ignoreErrors) + { + ScriptId = scriptId; + IgnoreErrors = ignoreErrors; + } + } + + private class RunListCache + { + private const int c_MaxNumLists = 128; + private const int c_MaxListSize = 32; + private Stack _lists = new Stack(128); + + public Vector Acquire() => _lists.Count <= 0 ? new Vector() : (Vector)_lists.Pop(); + + public void Release(Vector list) + { + if (_lists.Count >= 128 || list.Capacity > 32) + return; + list.Clear(); + _lists.Push(list); + } + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/SetValueHandler.cs b/UIX/Microsoft/Iris/Markup/SetValueHandler.cs new file mode 100644 index 0000000..0c2d7be --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SetValueHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SetValueHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate void SetValueHandler(ref object instance, object value); +} diff --git a/UIX/Microsoft/Iris/Markup/SourceMarkupImportTables.cs b/UIX/Microsoft/Iris/Markup/SourceMarkupImportTables.cs new file mode 100644 index 0000000..898bbe6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SourceMarkupImportTables.cs @@ -0,0 +1,59 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SourceMarkupImportTables +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class SourceMarkupImportTables + { + public Vector ImportedLoadResults = new Vector(); + public Vector ImportedTypes = new Vector(); + public Vector ImportedConstructors = new Vector(); + public Vector ImportedProperties = new Vector(); + public Vector ImportedEvents = new Vector(); + public Vector ImportedMethods = new Vector(); + + public MarkupImportTables PrepareImportTables() + { + MarkupImportTables markupImportTables = new MarkupImportTables(); + if (ImportedTypes.Count > 0) + { + TypeSchema[] typeSchemaArray = new TypeSchema[ImportedTypes.Count]; + for (int index = 0; index < ImportedTypes.Count; ++index) + typeSchemaArray[index] = (TypeSchema)ImportedTypes[index]; + markupImportTables.TypeImports = typeSchemaArray; + } + if (ImportedConstructors.Count > 0) + { + ConstructorSchema[] constructorSchemaArray = new ConstructorSchema[ImportedConstructors.Count]; + for (int index = 0; index < ImportedConstructors.Count; ++index) + constructorSchemaArray[index] = (ConstructorSchema)ImportedConstructors[index]; + markupImportTables.ConstructorImports = constructorSchemaArray; + } + if (ImportedProperties.Count > 0) + { + PropertySchema[] propertySchemaArray = new PropertySchema[ImportedProperties.Count]; + for (int index = 0; index < ImportedProperties.Count; ++index) + propertySchemaArray[index] = (PropertySchema)ImportedProperties[index]; + markupImportTables.PropertyImports = propertySchemaArray; + } + if (ImportedMethods.Count > 0) + { + MethodSchema[] methodSchemaArray = new MethodSchema[ImportedMethods.Count]; + for (int index = 0; index < ImportedMethods.Count; ++index) + methodSchemaArray[index] = (MethodSchema)ImportedMethods[index]; + markupImportTables.MethodImports = methodSchemaArray; + } + if (ImportedEvents.Count > 0) + { + EventSchema[] eventSchemaArray = new EventSchema[ImportedEvents.Count]; + for (int index = 0; index < ImportedEvents.Count; ++index) + eventSchemaArray[index] = (EventSchema)ImportedEvents[index]; + markupImportTables.EventImports = eventSchemaArray; + } + return markupImportTables; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/SourceMarkupLoadResult.cs b/UIX/Microsoft/Iris/Markup/SourceMarkupLoadResult.cs new file mode 100644 index 0000000..d7fb91a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SourceMarkupLoadResult.cs @@ -0,0 +1,84 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SourceMarkupLoadResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Markup.Validation; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup +{ + internal class SourceMarkupLoadResult : MarkupLoadResult + { + private MarkupConstantsTable _constantsTable; + private MarkupImportTables _importTables; + private Resource _resource; + private SourceMarkupLoader _loader; + private bool _doneWithLoader; + + public SourceMarkupLoadResult(Resource resource, string uri) + : base(uri) + { + _resource = resource; + if (uri != resource.Uri) + _uriUnderlying = resource.Uri; + _loader = SourceMarkupLoader.Load(this, resource); + } + + public SourceMarkupLoadResult(string uri) + : base(uri) + { + } + + public override bool IsSource => true; + + internal SourceMarkupLoader Loader => _loader; + + public override MarkupConstantsTable ConstantsTable => _constantsTable; + + public override MarkupImportTables ImportTables => _importTables; + + public override void Load(LoadPass currentPass) + { + if (_doneWithLoader) + return; + ErrorManager.EnterContext(ErrorContextUri); + _loader.Validate(currentPass); + ErrorManager.ExitContext(); + if (currentPass != LoadPass.Done) + return; + if (!MarkupSystem.TrackAdditionalMetadata) + _loader = null; + _doneWithLoader = true; + } + + public void ValidateType(MarkupTypeSchema typeSchema, LoadPass currentPass) + { + ValidateClass loadData = (ValidateClass)typeSchema.LoadData; + if (loadData == null) + return; + ErrorManager.EnterContext(ErrorContextUri); + loadData.Validate(currentPass); + ErrorManager.ExitContext(); + } + + public void ValidationComplete() + { + if (_resource != null) + { + _resource.Free(); + _resource = null; + } + if (Status == LoadResultStatus.Loading) + SetStatus(LoadResultStatus.Success); + foreach (MarkupTypeSchema markupTypeSchema in ExportTable) + markupTypeSchema.Seal(); + } + + public void SetConstantsTable(MarkupConstantsTable constantsTable) => _constantsTable = constantsTable; + + public void SetImportTables(MarkupImportTables importTables) => _importTables = importTables; + } +} diff --git a/UIX/Microsoft/Iris/Markup/SourceMarkupLoader.cs b/UIX/Microsoft/Iris/Markup/SourceMarkupLoader.cs new file mode 100644 index 0000000..57ec931 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SourceMarkupLoader.cs @@ -0,0 +1,450 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SourceMarkupLoader +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.Markup.Validation; +using Microsoft.Iris.Session; +using System.Collections.Generic; + +namespace Microsoft.Iris.Markup +{ + internal class SourceMarkupLoader + { + private const string MePrefix = "me"; + public const string MeNamespace = "Me"; + private ParseResult _parseResult; + private SourceMarkupLoadResult _loadResultTarget; + private Vector _validateObjects = new Vector(); + private Vector _foundExportedTypes = new Vector(); + private Vector _foundAliasMappings; + private bool _hasErrors; + public Dictionary _importedNamespaces = new Dictionary(); + private bool _usingSharedBinaryDataTable; + private SourceMarkupImportTables _importTables; + private Dictionary _referencedNamespaces = new Dictionary(); + private LoadPass _currentValidationPass; + + public static SourceMarkupLoader Load( + SourceMarkupLoadResult loadResult, + Resource resource) + { + SourceMarkupLoader owner = new SourceMarkupLoader(loadResult); + ParseResult parseResult = Parser.Invoke(owner, resource); + if (parseResult.HasErrors) + owner.MarkHasErrors(); + else + owner.SetParseResult(parseResult); + return owner; + } + + protected SourceMarkupLoader(SourceMarkupLoadResult loadResultTarget) => _loadResultTarget = loadResultTarget; + + public SourceMarkupLoadResult LoadResultTarget => _loadResultTarget; + + public void SetParseResult(ParseResult parseResult) => _parseResult = parseResult; + + public LoadResult FindDependency(string prefix) + { + if (prefix == null) + return MarkupSystem.UIXGlobal; + object obj; + _importedNamespaces.TryGetValue(prefix, out obj); + return (LoadResult)obj; + } + + public void Validate(LoadPass currentPass) + { + if (_currentValidationPass >= currentPass) + return; + _currentValidationPass = currentPass; + if (_currentValidationPass == LoadPass.DeclareTypes) + { + if (_parseResult == null) + return; + if (_parseResult.Root != "UIX") + { + ReportError("Unknown markup format. Expecting ... root markup tags", -1, -1); + return; + } + if (_parseResult.Version != "http://schemas.microsoft.com/2007/uix") + { + ReportError(string.Format("Unsupported version of markup: '{0}'", _parseResult.Version), -1, -1); + return; + } + if (_loadResultTarget.BinaryDataTable != null) + { + _importTables = _loadResultTarget.BinaryDataTable.SourceMarkupImportTables; + _usingSharedBinaryDataTable = true; + } + else + _importTables = new SourceMarkupImportTables(); + for (ValidateNamespace validateNamespace = _parseResult.XmlnsList; validateNamespace != null; validateNamespace = validateNamespace.Next) + { + LoadResult loadResult = validateNamespace.Validate(); + if (loadResult != null) + { + _importedNamespaces[validateNamespace.Prefix] = loadResult; + TrackImportedLoadResult(loadResult); + } + } + } + foreach (LoadResult loadResult in _importedNamespaces.Values) + { + if (loadResult != _loadResultTarget && loadResult != MarkupSystem.UIXGlobal) + { + loadResult.Load(_currentValidationPass); + if (loadResult.Status == LoadResultStatus.Error) + MarkHasErrors(); + } + } + if (_parseResult != null && currentPass != LoadPass.Done) + { + foreach (ValidateClass validateClass in _parseResult.ClassList) + validateClass.Validate(_currentValidationPass); + foreach (ValidateDataMapping dataMapping in _parseResult.DataMappingList) + dataMapping.Validate(_currentValidationPass); + foreach (ValidateAlias alias in _parseResult.AliasList) + alias.Validate(_currentValidationPass); + if (_currentValidationPass == LoadPass.Full) + { + for (ValidateNamespace validateNamespace = _parseResult.XmlnsList; validateNamespace != null; validateNamespace = validateNamespace.Next) + { + if (!_referencedNamespaces.ContainsKey(validateNamespace.Prefix)) + ErrorManager.ReportWarning(validateNamespace.Line, validateNamespace.Column, "Unreferenced namespace {0}", validateNamespace.Prefix); + } + } + } + CompleteValidationPass(); + } + + public void CompleteValidationPass() + { + if (_currentValidationPass == LoadPass.DeclareTypes) + { + _loadResultTarget.SetExportTable(PrepareExportTable()); + _loadResultTarget.SetAliasTable(PrepareAliasTable()); + } + else if (_currentValidationPass == LoadPass.PopulatePublicModel) + { + if (_parseResult == null) + return; + foreach (ValidateClass validateClass in _parseResult.ClassList) + { + if (validateClass.TypeExport != null) + validateClass.TypeExport.BuildProperties(); + } + } + else + { + if (_currentValidationPass != LoadPass.Full) + return; + if (HasErrors) + _loadResultTarget.MarkLoadFailed(); + MarkupImportTables importTables = null; + if (_importTables != null) + { + importTables = _importTables.PrepareImportTables(); + _loadResultTarget.SetImportTables(importTables); + } + MarkupLineNumberTable lineNumberTable = new MarkupLineNumberTable(); + MarkupConstantsTable constantsTable = _loadResultTarget.BinaryDataTable == null ? new MarkupConstantsTable() : _loadResultTarget.BinaryDataTable.ConstantsTable; + _loadResultTarget.SetDataMappingsTable(PrepareDataMappingTable()); + _loadResultTarget.ValidationComplete(); + ByteCodeReader reader = null; + if (!HasErrors) + reader = new MarkupEncoder(importTables, constantsTable, lineNumberTable).EncodeOBJECTSection(_parseResult, _loadResultTarget.Uri, null); + if (!_usingSharedBinaryDataTable) + { + constantsTable.PrepareForRuntimeUse(); + _loadResultTarget.SetConstantsTable(constantsTable); + } + lineNumberTable.PrepareForRuntimeUse(); + _loadResultTarget.SetLineNumberTable(lineNumberTable); + if (reader != null) + _loadResultTarget.SetObjectSection(reader); + _loadResultTarget.SetDependenciesTable(PrepareDependenciesTable()); + if (!MarkupSystem.TrackAdditionalMetadata) + _parseResult = null; + foreach (DisposableObject validateObject in _validateObjects) + validateObject.Dispose(this); + } + } + + public int RegisterExportedType(MarkupTypeSchema type) + { + int count = _foundExportedTypes.Count; + _foundExportedTypes.Add(type); + return count; + } + + public int RegisterAlias(string alias, LoadResult loadResult, string targetType) + { + TrackImportedLoadResult(loadResult); + if (_foundAliasMappings == null) + _foundAliasMappings = new Vector(); + int count = _foundAliasMappings.Count; + _foundAliasMappings.Add(new AliasMapping(alias, loadResult, targetType)); + return count; + } + + public bool IsTypeNameTaken(string typeName) + { + foreach (TypeSchema foundExportedType in _foundExportedTypes) + { + if (foundExportedType.Name == typeName) + return true; + } + if (_foundAliasMappings != null) + { + foreach (AliasMapping foundAliasMapping in _foundAliasMappings) + { + if (foundAliasMapping.Alias == typeName) + return true; + } + } + return false; + } + + public void TrackValidateObject(Microsoft.Iris.Markup.Validation.Validate validate) + { + _validateObjects.Add(validate); + validate.DeclareOwner(this); + } + + public void TrackImportedLoadResult(LoadResult loadResult) + { + if (loadResult == MarkupSystem.UIXGlobal) + return; + for (int index = 0; index < _importTables.ImportedLoadResults.Count; ++index) + { + if ((LoadResult)_importTables.ImportedLoadResults[index] == loadResult) + return; + } + _importTables.ImportedLoadResults.Add(loadResult); + } + + public int TrackImportedType(TypeSchema type) + { + TrackImportedLoadResult(type.Owner); + return TrackImportedSchema(_importTables.ImportedTypes, type); + } + + public int TrackImportedConstructor(ConstructorSchema constructor) + { + int num = TrackImportedSchema(_importTables.ImportedConstructors, constructor); + TrackImportedType(constructor.Owner); + foreach (TypeSchema parameterType in constructor.ParameterTypes) + TrackImportedType(parameterType); + return num; + } + + public int TrackImportedProperty(PropertySchema property) + { + int num = TrackImportedSchema(_importTables.ImportedProperties, property); + TrackImportedType(property.Owner); + return num; + } + + public int TrackImportedMethod(MethodSchema method) + { + int num = TrackImportedSchema(_importTables.ImportedMethods, method); + TrackImportedType(method.Owner); + foreach (TypeSchema parameterType in method.ParameterTypes) + TrackImportedType(parameterType); + return num; + } + + public int TrackImportedEvent(EventSchema evt) + { + int num = TrackImportedSchema(_importTables.ImportedEvents, evt); + TrackImportedType(evt.Owner); + return num; + } + + public int TrackImportedSchema(Vector importList, object schema) + { + for (int index = 0; index < importList.Count; ++index) + { + if (importList[index] == schema) + return index; + } + int count = importList.Count; + importList.Add(schema); + return count; + } + + public void ReportError(string error, int line, int column) + { + MarkHasErrors(); + ErrorManager.ReportError(line, column, error); + } + + public void MarkHasErrors() + { + if (_hasErrors) + return; + _hasErrors = true; + _loadResultTarget.MarkLoadFailed(); + } + + public LoadResult[] PrepareDependenciesTable() + { + LoadResult[] loadResultArray = LoadResult.EmptyList; + int length = 0; + if (_importTables != null) + { + foreach (LoadResult importedLoadResult in _importTables.ImportedLoadResults) + { + if (importedLoadResult != _loadResultTarget) + ++length; + } + } + if (length != 0) + { + loadResultArray = new LoadResult[length]; + int index = 0; + foreach (LoadResult importedLoadResult in _importTables.ImportedLoadResults) + { + if (importedLoadResult != _loadResultTarget) + { + loadResultArray[index] = importedLoadResult; + ++index; + } + } + } + return loadResultArray; + } + + public TypeSchema[] PrepareExportTable() + { + TypeSchema[] typeSchemaArray = TypeSchema.EmptyList; + if (_foundExportedTypes.Count > 0) + { + typeSchemaArray = new TypeSchema[_foundExportedTypes.Count]; + for (int index = 0; index < _foundExportedTypes.Count; ++index) + { + MarkupTypeSchema foundExportedType = (MarkupTypeSchema)_foundExportedTypes[index]; + typeSchemaArray[index] = foundExportedType; + } + } + return typeSchemaArray; + } + + private AliasMapping[] PrepareAliasTable() + { + AliasMapping[] aliasMappingArray = null; + if (_foundAliasMappings != null) + { + aliasMappingArray = new AliasMapping[_foundAliasMappings.Count]; + for (int index = 0; index < _foundAliasMappings.Count; ++index) + aliasMappingArray[index] = (AliasMapping)_foundAliasMappings[index]; + } + return aliasMappingArray; + } + + private MarkupDataMapping[] PrepareDataMappingTable() + { + MarkupDataMapping[] dataMappingTable = null; + int length = PrepareDataMappingTableHelper(null); + if (length > 0) + { + dataMappingTable = new MarkupDataMapping[length]; + PrepareDataMappingTableHelper(dataMappingTable); + } + return dataMappingTable; + } + + private int PrepareDataMappingTableHelper(MarkupDataMapping[] dataMappingTable) + { + int dataMappingCount = 0; + if (_parseResult != null) + { + foreach (ValidateClass validateClass in _parseResult.ClassList) + { + if (validateClass is ValidateDataType validateDataType) + AddDataMappingsHelper(validateDataType.FoundDataMappingSet, dataMappingTable, ref dataMappingCount); + } + foreach (ValidateDataMapping dataMapping in _parseResult.DataMappingList) + AddDataMappingsHelper(dataMapping.FoundDataMappingSet, dataMappingTable, ref dataMappingCount); + } + return dataMappingCount; + } + + private void AddDataMappingsHelper( + Vector dataMappingSet, + MarkupDataMapping[] dataMappingTable, + ref int dataMappingCount) + { + if (dataMappingSet == null) + return; + foreach (MarkupDataMapping dataMapping in dataMappingSet) + { + if (dataMappingTable != null) + dataMappingTable[dataMappingCount] = dataMapping; + ++dataMappingCount; + } + } + + public void NotifyTypeIdentifierFound(string prefix, string type) + { + if (prefix == null) + return; + _referencedNamespaces[prefix] = null; + } + + public ValidateObjectTag CreateObjectTagValidator( + ValidateTypeIdentifier typeIdentifier, + int line, + int offset, + bool isRootTag) + { + ValidateObjectTag validateObjectTag = null; + if (isRootTag) + { + if (typeIdentifier.TypeName == ClassSchema.Type.Name) + validateObjectTag = new ValidateClass(this, typeIdentifier, line, offset); + else if (typeIdentifier.TypeName == UISchema.Type.Name) + validateObjectTag = new ValidateUI(this, typeIdentifier, line, offset); + else if (typeIdentifier.TypeName == EffectSchema.Type.Name) + validateObjectTag = new ValidateEffect(this, typeIdentifier, line, offset); + else if (typeIdentifier.TypeName == AliasSchema.Type.Name) + validateObjectTag = new ValidateAlias(this, typeIdentifier, line, offset); + else if (typeIdentifier.TypeName == DataTypeSchema.Type.Name) + validateObjectTag = new ValidateDataType(this, typeIdentifier, line, offset); + else if (typeIdentifier.TypeName == DataQuerySchema.Type.Name) + validateObjectTag = new ValidateDataQuery(this, typeIdentifier, line, offset); + else if (typeIdentifier.TypeName == DataMappingSchema.Type.Name) + validateObjectTag = new ValidateDataMapping(this, typeIdentifier, line, offset); + } + else if (typeIdentifier.Prefix == null) + { + if (typeIdentifier.TypeName == TypeConstraintSchema.Type.Name) + { + validateObjectTag = new ValidateTypeConstraint(this, typeIdentifier, line, offset); + } + else + { + TypeSchema type = MarkupSystem.UIXGlobal.FindType(typeIdentifier.TypeName); + if (EffectElementSchema.Type.IsAssignableFrom(type)) + validateObjectTag = new ValidateEffectElement(this, typeIdentifier, line, offset); + } + } + if (validateObjectTag == null) + validateObjectTag = new ValidateObjectTag(this, typeIdentifier, line, offset); + return validateObjectTag; + } + + public void NotifyClassParseComplete(string className) + { + } + + public bool HasErrors => _hasErrors; + + internal ParseResult ParseResult => _parseResult; + } +} diff --git a/UIX/Microsoft/Iris/Markup/StandardAssemblyTypeSchema.cs b/UIX/Microsoft/Iris/Markup/StandardAssemblyTypeSchema.cs new file mode 100644 index 0000000..8ad33a2 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/StandardAssemblyTypeSchema.cs @@ -0,0 +1,18 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.StandardAssemblyTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Markup +{ + internal class StandardAssemblyTypeSchema : AssemblyTypeSchema + { + public StandardAssemblyTypeSchema(Type type) + : base(type, null) + { + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/SupportsOperationHandler.cs b/UIX/Microsoft/Iris/Markup/SupportsOperationHandler.cs new file mode 100644 index 0000000..40cc4ec --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SupportsOperationHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SupportsOperationHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate bool SupportsOperationHandler(OperationType op); +} diff --git a/UIX/Microsoft/Iris/Markup/SupportsTypeConversionHandler.cs b/UIX/Microsoft/Iris/Markup/SupportsTypeConversionHandler.cs new file mode 100644 index 0000000..da69730 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SupportsTypeConversionHandler.cs @@ -0,0 +1,10 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SupportsTypeConversionHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal delegate bool SupportsTypeConversionHandler(TypeSchema fromType); +} diff --git a/UIX/Microsoft/Iris/Markup/SymbolOrigin.cs b/UIX/Microsoft/Iris/Markup/SymbolOrigin.cs new file mode 100644 index 0000000..f575f6b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SymbolOrigin.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SymbolOrigin +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum SymbolOrigin + { + None, + Properties, + Locals, + Input, + Content, + Techniques, + ScopedLocal, + Reserved, + Methods, + Parameter, + } +} diff --git a/UIX/Microsoft/Iris/Markup/SymbolRecord.cs b/UIX/Microsoft/Iris/Markup/SymbolRecord.cs new file mode 100644 index 0000000..6c1419f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SymbolRecord.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SymbolRecord +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class SymbolRecord + { + public string Name; + public TypeSchema Type; + public SymbolOrigin SymbolOrigin; + public static SymbolRecord[] EmptyList = new SymbolRecord[0]; + } +} diff --git a/UIX/Microsoft/Iris/Markup/SymbolReference.cs b/UIX/Microsoft/Iris/Markup/SymbolReference.cs new file mode 100644 index 0000000..24aa832 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/SymbolReference.cs @@ -0,0 +1,24 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.SymbolReference +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal struct SymbolReference + { + private string _symbol; + private SymbolOrigin _origin; + + public SymbolReference(string symbol, SymbolOrigin origin) + { + _origin = origin; + _symbol = NotifyService.CanonicalizeString(symbol); + } + + public string Symbol => _symbol; + + public SymbolOrigin Origin => _origin; + } +} diff --git a/UIX/Microsoft/Iris/Markup/TypeConstraint.cs b/UIX/Microsoft/Iris/Markup/TypeConstraint.cs new file mode 100644 index 0000000..befc140 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/TypeConstraint.cs @@ -0,0 +1,26 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.TypeConstraint +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class TypeConstraint + { + private TypeSchema _constraint; + private TypeSchema _type; + + public TypeSchema Constraint + { + get => _constraint; + set => _constraint = value; + } + + public TypeSchema Type + { + get => _type; + set => _type = value; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/TypeConverterHandler.cs b/UIX/Microsoft/Iris/Markup/TypeConverterHandler.cs new file mode 100644 index 0000000..9257e5d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/TypeConverterHandler.cs @@ -0,0 +1,15 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.TypeConverterHandler +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup +{ + internal delegate Result TypeConverterHandler( + object from, + TypeSchema fromType, + out object instance); +} diff --git a/UIX/Microsoft/Iris/Markup/TypeSchema.cs b/UIX/Microsoft/Iris/Markup/TypeSchema.cs new file mode 100644 index 0000000..b6ac17e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/TypeSchema.cs @@ -0,0 +1,248 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.TypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; +using System; + +namespace Microsoft.Iris.Markup +{ + internal abstract class TypeSchema : DisposableObject + { + private LoadResult _owner; + private ulong _id; + private Vector _equivalents; + private static ulong s_uniqueId; + private static Map s_idToTypeSchema = new Map(); + public static TypeSchema[] EmptyList = new TypeSchema[0]; + + public TypeSchema(LoadResult owner) + { + _owner = owner; + _id = ++s_uniqueId; + s_idToTypeSchema[_id] = this; + DeclareOwner(owner); + } + + protected override void OnDispose() + { + s_idToTypeSchema.Remove(_id); + base.OnDispose(); + } + + public LoadResult Owner => _owner; + + public Vector Equivalents => _equivalents; + + public abstract string Name { get; } + + public abstract string AlternateName { get; } + + public abstract TypeSchema Base { get; } + + public abstract bool Contractual { get; } + + public abstract Type RuntimeType { get; } + + public abstract bool IsNativeAssignableFrom(object check); + + public abstract bool IsNativeAssignableFrom(TypeSchema check); + + public abstract bool Disposable { get; } + + public abstract object ConstructDefault(); + + public abstract bool HasDefaultConstructor { get; } + + public abstract void InitializeInstance(ref object instance); + + public abstract bool HasInitializer { get; } + + public abstract ConstructorSchema FindConstructor(TypeSchema[] parameters); + + public abstract PropertySchema FindProperty(string name); + + public abstract MethodSchema FindMethod(string name, TypeSchema[] parameters); + + public abstract EventSchema FindEvent(string name); + + public abstract object FindCanonicalInstance(string name); + + public virtual ConstructorSchema[] Constructors => (ConstructorSchema[])null; + + public abstract PropertySchema[] Properties { get; } + + public virtual MethodSchema[] Methods => (MethodSchema[])null; + + public virtual EventSchema[] Events => (EventSchema[])null; + + public abstract Result TypeConverter( + object from, + TypeSchema fromType, + out object instance); + + public abstract bool SupportsTypeConversion(TypeSchema fromType); + + public abstract void EncodeBinary(ByteCodeWriter writer, object instance); + + public abstract object DecodeBinary(ByteCodeReader reader); + + public abstract bool SupportsBinaryEncoding { get; } + + public abstract object PerformOperation(object left, object right, OperationType op); + + public abstract bool SupportsOperation(OperationType op); + + public abstract bool IsNullAssignable { get; } + + public abstract bool IsRuntimeImmutable { get; } + + public virtual bool IsEnum => false; + + public virtual bool IsStatic => false; + + public abstract int FindTypeHint { get; } + + public bool IsAssignableFrom(object check) + { + if (check == null) + return IsNullAssignable; + return check is ISchemaInfo schemaInfo ? IsAssignableFrom(schemaInfo.TypeSchema) : IsNativeAssignableFrom(check); + } + + public bool IsAssignableFrom(TypeSchema checkSchema) + { + if (checkSchema == null) + return false; + if (checkSchema == NullSchema.Type && IsNullAssignable) + return true; + if (!Contractual) + { + for (TypeSchema typeSchema = checkSchema; typeSchema != null; typeSchema = typeSchema.Base) + { + if (this == typeSchema) + return true; + if (typeSchema.Equivalents != null) + { + foreach (TypeSchema equivalent in typeSchema.Equivalents) + { + if (equivalent == this) + return true; + } + } + } + } + return IsNativeAssignableFrom(checkSchema); + } + + public PropertySchema FindPropertyDeep(string name) + { + for (TypeSchema typeSchema = this; typeSchema != null; typeSchema = typeSchema.Base) + { + PropertySchema property = typeSchema.FindProperty(name); + if (property != null) + return property; + } + return null; + } + + public Vector FindRequiredPropertyNamesDeep() + { + Vector list = new Vector(); + FindRequiredPropertyNamesDeep(list); + return list; + } + + private void FindRequiredPropertyNamesDeep(Vector list) + { + if (Base != null) + Base.FindRequiredPropertyNamesDeep(list); + foreach (PropertySchema property in Properties) + { + int index = list.IndexOf(property.Name); + if (index != -1) + { + if (!property.RequiredForCreation) + list.RemoveAt(index); + } + else if (property.RequiredForCreation) + list.Add(property.Name); + } + } + + public MethodSchema FindMethodDeep(string name, TypeSchema[] parameters) + { + for (TypeSchema typeSchema = this; typeSchema != null; typeSchema = typeSchema.Base) + { + MethodSchema method = typeSchema.FindMethod(name, parameters); + if (method != null) + return method; + } + return null; + } + + public EventSchema FindEventDeep(string name) + { + for (TypeSchema typeSchema = this; typeSchema != null; typeSchema = typeSchema.Base) + { + EventSchema eventSchema = typeSchema.FindEvent(name); + if (eventSchema != null) + return eventSchema; + } + return null; + } + + public bool SupportsOperationDeep(OperationType op) + { + for (TypeSchema typeSchema = this; typeSchema != null; typeSchema = typeSchema.Base) + { + if (typeSchema.SupportsOperation(op)) + return true; + } + return false; + } + + public object PerformOperationDeep(object left, object right, OperationType op) + { + for (TypeSchema typeSchema = this; typeSchema != null; typeSchema = typeSchema.Base) + { + if (typeSchema.SupportsOperation(op)) + return typeSchema.PerformOperation(left, right, op); + } + return null; + } + + public static bool IsUnaryOperation(OperationType op) => op == OperationType.LogicalNot || op == OperationType.MathNegate || op == OperationType.PostIncrement || op == OperationType.PostDecrement; + + public static void RegisterOneWayEquivalence(TypeSchema producer, TypeSchema consumer) + { + if (producer._equivalents == null) + producer._equivalents = new Vector(); + producer._equivalents.Add(consumer); + } + + public static void RegisterTwoWayEquivalence(TypeSchema typeA, TypeSchema typeB) + { + RegisterOneWayEquivalence(typeA, typeB); + RegisterOneWayEquivalence(typeB, typeA); + } + + public void ShareEquivalents(Vector equivalents) => _equivalents = equivalents; + + public virtual string ErrorContextDescription => string.Format("{0} (Owner='{1}')", Name, Owner.Uri ?? "Unavailable"); + + public static string NameFromInstance(object instance) => !(instance is ISchemaInfo schemaInfo) ? instance.GetType().Name : schemaInfo.TypeSchema.Name; + + public ulong UniqueId => _id; + + public static TypeSchema LookupById(ulong id) + { + TypeSchema typeSchema; + s_idToTypeSchema.TryGetValue(id, out typeSchema); + return typeSchema; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIB.cs b/UIX/Microsoft/Iris/Markup/UIB.cs new file mode 100644 index 0000000..50ca62e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIB.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIB +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class UIB + { + public const uint FileSignature = 440551765; + public const uint FileVersion = 1012; + public const ushort InvalidIndex = 65535; + public const ushort ImportIndexIntrinsic = 65534; + public const ushort ImportIndexSelf = 65533; + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIClassMethodSchema.cs b/UIX/Microsoft/Iris/Markup/UIClassMethodSchema.cs new file mode 100644 index 0000000..c7852a0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIClassMethodSchema.cs @@ -0,0 +1,35 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIClassMethodSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup +{ + internal class UIClassMethodSchema : MarkupMethodSchema + { + public UIClassMethodSchema( + UIClassTypeSchema owner, + string name, + TypeSchema returnType, + TypeSchema[] parameterTypes, + string[] parameterNames) + : base(owner, name, returnType, parameterTypes, parameterNames) + { + } + + protected override IMarkupTypeBase GetMarkupTypeBase(object instance) + { + if (!(instance is IMarkupTypeBase markupTypeBase)) + { + markupTypeBase = ((Host)instance).ChildUI; + if (markupTypeBase == null) + ErrorManager.ReportError("Host '{0}' is currently not hosting a UI and therefore cannot invoke methods", instance); + } + return markupTypeBase; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIClassPropertySchema.cs b/UIX/Microsoft/Iris/Markup/UIClassPropertySchema.cs new file mode 100644 index 0000000..39abc85 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIClassPropertySchema.cs @@ -0,0 +1,22 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIClassPropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup +{ + internal class UIClassPropertySchema : MarkupPropertySchema + { + public UIClassPropertySchema(UIClassTypeSchema owner, string name, TypeSchema propertyType) + : base(owner, name, propertyType) + { + } + + public override object GetValue(object instance) => ((Host)instance).GetChildUIProperty(Name); + + public override void SetValue(ref object instance, object value) => ((Host)instance).SetChildUIProperty(Name, value); + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIClassTypeSchema.cs b/UIX/Microsoft/Iris/Markup/UIClassTypeSchema.cs new file mode 100644 index 0000000..2be8669 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIClassTypeSchema.cs @@ -0,0 +1,96 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIClassTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class UIClassTypeSchema : MarkupTypeSchema, IDynamicConstructionSchema + { + private NamedContentRecord[] _namedContentTable; + + public UIClassTypeSchema(MarkupLoadResult owner, string name) + : base(owner, name) + { + } + + public override MarkupType MarkupType => MarkupType.UI; + + protected override TypeSchema DefaultBase => HostSchema.Type; + + public override Type RuntimeType => typeof(Host); + + public override object ConstructDefault() => new Host(this); + + object IDynamicConstructionSchema.ConstructDefault( + TypeSchema replacedType) + { + return new Host((UIClassTypeSchema)replacedType, this); + } + + public UIClass ConstructUI() => new UIClass(this); + + public ViewItem ConstructNamedContent( + string name, + IMarkupTypeBase markupType, + ParameterContext parameterContext) + { + ErrorManager.EnterContext(markupType.TypeSchema.Owner.ErrorContextUri); + try + { + uint scriptOffset = uint.MaxValue; + if (_namedContentTable != null) + { + foreach (NamedContentRecord namedContentRecord in _namedContentTable) + { + if (namedContentRecord.Name == name) + { + scriptOffset = namedContentRecord.Offset; + break; + } + } + } + if (scriptOffset == uint.MaxValue) + { + UIClassTypeSchema markupTypeBase = (UIClassTypeSchema)MarkupTypeBase; + if (markupTypeBase != null) + return markupTypeBase.ConstructNamedContent(name, markupType, parameterContext); + } + if (scriptOffset != uint.MaxValue) + { + object obj = 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", name); + } + return null; + } + finally + { + ErrorManager.ExitContext(); + } + } + + public override void InitializeInstance(ref object instance) + { + Host ownerHost = instance as Host; + UIClass childUi = ownerHost.ChildUI; + childUi.DeclareHost(ownerHost); + InitializeInstance(ownerHost.ChildUI); + if (childUi.RootItem != null) + ownerHost.Children.Add(childUi.RootItem); + childUi.DeclareOwner(ownerHost); + } + + public NamedContentRecord[] NamedContentTable => _namedContentTable; + + public void SetNamedContentTable(NamedContentRecord[] namedContentTable) => _namedContentTable = namedContentTable; + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/AccessibleSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AccessibleSchema.cs new file mode 100644 index 0000000..e8de2e5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/AccessibleSchema.cs @@ -0,0 +1,181 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.AccessibleSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Accessibility; +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class AccessibleSchema + { + public static UIXTypeSchema Type; + + private static object GetEnabled(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).Enabled); + + 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) => ((Accessible)instanceObj).DefaultActionCommand; + + private static void SetDefaultActionCommand(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).DefaultActionCommand = (IUICommand)valueObj; + + private static object GetDescription(object instanceObj) => ((Accessible)instanceObj).Description; + + private static void SetDescription(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).Description = (string)valueObj; + + private static object GetHasPopup(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).HasPopup); + + private static void SetHasPopup(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).HasPopup = (bool)valueObj; + + 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) => ((Accessible)instanceObj).HelpTopic; + + private static void SetHelpTopic(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).HelpTopic = (int)valueObj; + + private static object GetIsAnimated(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsAnimated); + + private static void SetIsAnimated(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsAnimated = (bool)valueObj; + + private static object GetIsBusy(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsBusy); + + private static void SetIsBusy(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsBusy = (bool)valueObj; + + private static object GetIsChecked(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsChecked); + + private static void SetIsChecked(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsChecked = (bool)valueObj; + + private static object GetIsCollapsed(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsCollapsed); + + private static void SetIsCollapsed(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsCollapsed = (bool)valueObj; + + private static object GetIsDefault(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsDefault); + + private static void SetIsDefault(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsDefault = (bool)valueObj; + + private static object GetIsExpanded(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsExpanded); + + private static void SetIsExpanded(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsExpanded = (bool)valueObj; + + private static object GetIsMarquee(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsMarquee); + + private static void SetIsMarquee(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsMarquee = (bool)valueObj; + + private static object GetIsMixed(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsMixed); + + private static void SetIsMixed(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsMixed = (bool)valueObj; + + private static object GetIsMultiSelectable(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsMultiSelectable); + + private static void SetIsMultiSelectable(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsMultiSelectable = (bool)valueObj; + + private static object GetIsPressed(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsPressed); + + private static void SetIsPressed(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsPressed = (bool)valueObj; + + private static object GetIsProtected(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsProtected); + + private static void SetIsProtected(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsProtected = (bool)valueObj; + + private static object GetIsSelectable(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsSelectable); + + private static void SetIsSelectable(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsSelectable = (bool)valueObj; + + private static object GetIsSelected(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsSelected); + + private static void SetIsSelected(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsSelected = (bool)valueObj; + + private static object GetIsTraversed(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsTraversed); + + private static void SetIsTraversed(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsTraversed = (bool)valueObj; + + private static object GetIsUnavailable(object instanceObj) => BooleanBoxes.Box(((Accessible)instanceObj).IsUnavailable); + + private static void SetIsUnavailable(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).IsUnavailable = (bool)valueObj; + + 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) => ((Accessible)instanceObj).Name; + + private static void SetName(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).Name = (string)valueObj; + + 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) => ((Accessible)instanceObj).Value; + + private static void SetValue(ref object instanceObj, object valueObj) => ((Accessible)instanceObj).Value = (string)valueObj; + + private static object Construct() => new Accessible(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(0, "Accessible", null, 153, typeof(Accessible), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(0, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEnabled), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(0, "DefaultAction", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDefaultAction), new SetValueHandler(SetDefaultAction), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(0, "DefaultActionCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDefaultActionCommand), new SetValueHandler(SetDefaultActionCommand), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(0, "Description", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDescription), new SetValueHandler(SetDescription), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(0, "HasPopup", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHasPopup), new SetValueHandler(SetHasPopup), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(0, "Help", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHelp), new SetValueHandler(SetHelp), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(0, "HelpTopic", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHelpTopic), new SetValueHandler(SetHelpTopic), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(0, "IsAnimated", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsAnimated), new SetValueHandler(SetIsAnimated), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(0, "IsBusy", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsBusy), new SetValueHandler(SetIsBusy), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(0, "IsChecked", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsChecked), new SetValueHandler(SetIsChecked), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(0, "IsCollapsed", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsCollapsed), new SetValueHandler(SetIsCollapsed), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(0, "IsDefault", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsDefault), new SetValueHandler(SetIsDefault), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(0, "IsExpanded", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsExpanded), new SetValueHandler(SetIsExpanded), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(0, "IsMarquee", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsMarquee), new SetValueHandler(SetIsMarquee), false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(0, "IsMixed", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsMixed), new SetValueHandler(SetIsMixed), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(0, "IsMultiSelectable", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsMultiSelectable), new SetValueHandler(SetIsMultiSelectable), false); + UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema(0, "IsPressed", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsPressed), new SetValueHandler(SetIsPressed), false); + UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema(0, "IsProtected", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsProtected), new SetValueHandler(SetIsProtected), false); + UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema(0, "IsSelectable", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsSelectable), new SetValueHandler(SetIsSelectable), false); + UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema(0, "IsSelected", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsSelected), new SetValueHandler(SetIsSelected), false); + UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema(0, "IsTraversed", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsTraversed), new SetValueHandler(SetIsTraversed), false); + UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema(0, "IsUnavailable", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsUnavailable), new SetValueHandler(SetIsUnavailable), false); + UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema(0, "KeyboardShortcut", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetKeyboardShortcut), new SetValueHandler(SetKeyboardShortcut), false); + UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema(0, "Name", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetName), new SetValueHandler(SetName), false); + UIXPropertySchema uixPropertySchema25 = new UIXPropertySchema(0, "Role", 1, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRole), new SetValueHandler(SetRole), false); + UIXPropertySchema uixPropertySchema26 = new UIXPropertySchema(0, "Value", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[26] + { + 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 new file mode 100644 index 0000000..95c1311 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/AliasSchema.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.AliasSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class AliasSchema + { + public static UIXTypeSchema Type; + + private static void SetType(ref object instanceObj, object valueObj) + { + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(2, "Alias", null, -1, typeof(object), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(2, "Type", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetType), false); + Type.Initialize(null, null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..0279f58 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/AlphaKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.AlphaKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class AlphaKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new AlphaKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(4, "AlphaKeyframe", null, 130, typeof(AlphaKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(4, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..734c0d0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/AnchorEdgeSchema.cs @@ -0,0 +1,175 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.AnchorEdgeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class AnchorEdgeSchema + { + public static UIXTypeSchema Type; + + 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) => ((AnchorEdge)instanceObj).Percent; + + private static void SetPercent(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).Percent = (float)valueObj; + + 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) => ((AnchorEdge)instanceObj).MaximumPercent; + + private static void SetMaximumPercent(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).MaximumPercent = (float)valueObj; + + 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) => ((AnchorEdge)instanceObj).MinimumPercent; + + private static void SetMinimumPercent(ref object instanceObj, object valueObj) => ((AnchorEdge)instanceObj).MinimumPercent = (float)valueObj; + + 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() => new AnchorEdge(); + + private static object ConstructIdPercent(object[] parameters) + { + object instanceObj = Construct(); + SetId(ref instanceObj, parameters[0]); + SetPercent(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringIdPercent( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result1.Error); + SetId(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result2.Error); + SetPercent(ref instance, valueObj2); + return result2; + } + + private static object ConstructIdPercentOffset(object[] parameters) + { + object instanceObj = Construct(); + SetId(ref instanceObj, parameters[0]); + SetPercent(ref instanceObj, parameters[1]); + SetOffset(ref instanceObj, parameters[2]); + return instanceObj; + } + + private static Result ConvertFromStringIdPercentOffset( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result1.Error); + SetId(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result2.Error); + SetPercent(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], Int32Schema.Type, null, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "AnchorEdge", result3.Error); + SetOffset(ref instance, valueObj3); + return result3; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + switch (splitString.Length) + { + case 2: + result = ConvertFromStringIdPercent(splitString, out instance); + if (!result.Failed) + return result; + break; + case 3: + result = ConvertFromStringIdPercentOffset(splitString, out instance); + if (!result.Failed) + return result; + break; + default: + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "AnchorEdge"); + break; + } + } + return result; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(6, "AnchorEdge", null, 153, typeof(AnchorEdge), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(6, "Id", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetId), new SetValueHandler(SetId), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(6, "Percent", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPercent), new SetValueHandler(SetPercent), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(6, "Offset", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetOffset), new SetValueHandler(SetOffset), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(6, "MaximumPercent", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMaximumPercent), new SetValueHandler(SetMaximumPercent), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(6, "MaximumOffset", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMaximumOffset), new SetValueHandler(SetMaximumOffset), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(6, "MinimumPercent", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMinimumPercent), new SetValueHandler(SetMinimumPercent), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(6, "MinimumOffset", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMinimumOffset), new SetValueHandler(SetMinimumOffset), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(6, new short[2] + { + 208, + 194 + }, new ConstructHandler(ConstructIdPercent)); + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(6, new short[3] + { + 208, + 194, + 115 + }, new ConstructHandler(ConstructIdPercentOffset)); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[2] + { + constructorSchema1, + constructorSchema2 + }, new PropertySchema[7] + { + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema7, + uixPropertySchema6, + uixPropertySchema3, + uixPropertySchema2 + }, null, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutInputSchema.cs new file mode 100644 index 0000000..6a90d20 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutInputSchema.cs @@ -0,0 +1,113 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.AnchorLayoutInputSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class AnchorLayoutInputSchema + { + public static UIXTypeSchema Type; + + 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) => ((AnchorLayoutInput)instanceObj).Top; + + private static void SetTop(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).Top = (AnchorEdge)valueObj; + + 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) => ((AnchorLayoutInput)instanceObj).Bottom; + + private static void SetBottom(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).Bottom = (AnchorEdge)valueObj; + + private static object GetContributesToWidth(object instanceObj) => BooleanBoxes.Box(((AnchorLayoutInput)instanceObj).ContributesToWidth); + + private static void SetContributesToWidth(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).ContributesToWidth = (bool)valueObj; + + private static object GetContributesToHeight(object instanceObj) => BooleanBoxes.Box(((AnchorLayoutInput)instanceObj).ContributesToHeight); + + private static void SetContributesToHeight(ref object instanceObj, object valueObj) => ((AnchorLayoutInput)instanceObj).ContributesToHeight = (bool)valueObj; + + private static object Construct() => new AnchorLayoutInput(); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string id = (string)valueObj; + instanceObj = null; + instanceObj = new AnchorLayoutInput() + { + Left = new AnchorEdge(id, 0.0f), + Top = new AnchorEdge(id, 0.0f), + Right = new AnchorEdge(id, 1f), + Bottom = new AnchorEdge(id, 1f) + }; + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static object CallTryParseStringAnchorLayoutInput( + object instanceObj, + object[] parameters) + { + string parameter1 = (string)parameters[0]; + AnchorLayoutInput parameter2 = (AnchorLayoutInput)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(8, "AnchorLayoutInput", null, 133, typeof(AnchorLayoutInput), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(8, "Left", 6, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetLeft), new SetValueHandler(SetLeft), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(8, "Top", 6, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetTop), new SetValueHandler(SetTop), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(8, "Right", 6, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRight), new SetValueHandler(SetRight), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(8, "Bottom", 6, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetBottom), new SetValueHandler(SetBottom), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(8, "ContributesToWidth", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetContributesToWidth), new SetValueHandler(SetContributesToWidth), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(8, "ContributesToHeight", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetContributesToHeight), new SetValueHandler(SetContributesToHeight), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(8, "TryParse", new short[2] + { + 208, + 8 + }, 8, new InvokeHandler(CallTryParseStringAnchorLayoutInput), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema2 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutSchema.cs new file mode 100644 index 0000000..f0553a3 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/AnchorLayoutSchema.cs @@ -0,0 +1,106 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.AnchorLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class AnchorLayoutSchema + { + public static UIXTypeSchema Type; + + private static object GetSizeToHorizontalChildren(object instanceObj) => BooleanBoxes.Box(((AnchorLayout)instanceObj).SizeToHorizontalChildren); + + private static void SetSizeToHorizontalChildren(ref object instanceObj, object valueObj) => ((AnchorLayout)instanceObj).SizeToHorizontalChildren = (bool)valueObj; + + private static object GetSizeToVerticalChildren(object instanceObj) => BooleanBoxes.Box(((AnchorLayout)instanceObj).SizeToVerticalChildren); + + private static void SetSizeToVerticalChildren(ref object instanceObj, object valueObj) => ((AnchorLayout)instanceObj).SizeToVerticalChildren = (bool)valueObj; + + 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() => new AnchorLayout(); + + private static object ConstructSizeToHorizontalChildrenSizeToVerticalChildren( + object[] parameters) + { + object instanceObj = Construct(); + SetSizeToHorizontalChildren(ref instanceObj, parameters[0]); + SetSizeToVerticalChildren(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringSizeToHorizontalChildrenSizeToVerticalChildren( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], BooleanSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "AnchorLayout", result1.Error); + SetSizeToHorizontalChildren(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], BooleanSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "AnchorLayout", result2.Error); + SetSizeToVerticalChildren(ref instance, valueObj2); + return result2; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 2) + { + result = ConvertFromStringSizeToHorizontalChildrenSizeToVerticalChildren(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "AnchorLayout"); + } + return result; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(7, "AnchorLayout", null, 132, typeof(AnchorLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(7, "SizeToHorizontalChildren", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSizeToHorizontalChildren), new SetValueHandler(SetSizeToHorizontalChildren), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(7, "SizeToVerticalChildren", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSizeToVerticalChildren), new SetValueHandler(SetSizeToVerticalChildren), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(7, "DefaultChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDefaultChildAlignment), new SetValueHandler(SetDefaultChildAlignment), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(7, new short[2] + { + 15, + 15 + }, new ConstructHandler(ConstructSizeToHorizontalChildrenSizeToVerticalChildren)); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[3] + { + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/AnimationHandleSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/AnimationHandleSchema.cs new file mode 100644 index 0000000..86124a9 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/AnimationHandleSchema.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.AnimationHandleSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class AnimationHandleSchema + { + public static UIXTypeSchema Type; + + private static object GetPlaying(object instanceObj) => BooleanBoxes.Box(((AnimationHandle)instanceObj).Playing); + + private static object Construct() => new AnimationHandle(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(11, "AnimationHandle", null, 153, typeof(AnimationHandle), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(11, "Playing", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPlaying), null, false); + UIXEventSchema uixEventSchema = new UIXEventSchema(11, "Completed"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + uixPropertySchema + }, null, new EventSchema[1] + { + 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 new file mode 100644 index 0000000..0ff6ca5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/AnimationSchema.cs @@ -0,0 +1,79 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.AnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class AnimationSchema + { + public static RangeValidator ValidateLoopValue = new RangeValidator(RangeValidateLoopValue); + public static UIXTypeSchema Type; + + private static object GetCenterPointPercent(object instanceObj) => ((Animation)instanceObj).CenterPointPercent; + + private static void SetCenterPointPercent(ref object instanceObj, object valueObj) => ((Animation)instanceObj).CenterPointPercent = (Vector3)valueObj; + + private static object GetDisableMouseInput(object instanceObj) => BooleanBoxes.Box(((Animation)instanceObj).DisableMouseInput); + + private static void SetDisableMouseInput(ref object instanceObj, object valueObj) => ((Animation)instanceObj).DisableMouseInput = (bool)valueObj; + + private static object GetKeyframes(object instanceObj) => ((AnimationTemplate)instanceObj).Keyframes; + + private static object GetLoop(object instanceObj) => ((AnimationTemplate)instanceObj).Loop; + + private static void SetLoop(ref object instanceObj, object valueObj) + { + Animation animation = (Animation)instanceObj; + int num = (int)valueObj; + Result result = ValidateLoopValue(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + animation.Loop = num; + } + + 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) => ((Animation)instanceObj).Type; + + private static void SetType(ref object instanceObj, object valueObj) => ((Animation)instanceObj).Type = (AnimationEventType)valueObj; + + 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}", "-1", num.ToString()) : Result.Success; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(9, "Animation", null, 104, typeof(Animation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(9, "CenterPointPercent", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetCenterPointPercent), new SetValueHandler(SetCenterPointPercent), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(9, "DisableMouseInput", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDisableMouseInput), new SetValueHandler(SetDisableMouseInput), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(9, "Keyframes", 138, 130, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetKeyframes), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(9, "Loop", 115, -1, ExpressionRestriction.None, false, ValidateLoopValue, false, new GetValueHandler(GetLoop), new SetValueHandler(SetLoop), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(9, "RotationAxis", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRotationAxis), new SetValueHandler(SetRotationAxis), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(9, "Type", 10, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetType), new SetValueHandler(SetType), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + 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 new file mode 100644 index 0000000..da5df4c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/BlendSchema.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.BlendSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class BlendSchema + { + public static UIXTypeSchema Type; + + 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) => ((BlendElement)instanceObj).Input2; + + private static void SetInput2(ref object instanceObj, object valueObj) => ((BlendElement)instanceObj).Input2 = (EffectInput)valueObj; + + 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) => ((BlendElement)instanceObj).AlphaOperation; + + private static void SetAlphaOperation(ref object instanceObj, object valueObj) => ((BlendElement)instanceObj).AlphaOperation = (AlphaOperation)valueObj; + + private static object Construct() => new BlendElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(13, "Blend", null, 77, typeof(BlendElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(13, "Input1", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetInput1), new SetValueHandler(SetInput1), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(13, "Input2", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetInput2), new SetValueHandler(SetInput2), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(13, "ColorOperation", 38, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetColorOperation), new SetValueHandler(SetColorOperation), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(13, "AlphaOperation", 5, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAlphaOperation), new SetValueHandler(SetAlphaOperation), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[4] + { + 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 new file mode 100644 index 0000000..6b302c5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/BlurSchema.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.BlurSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class BlurSchema + { + public static UIXTypeSchema Type; + + 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) => ((GaussianBlurElement)instanceObj).KernelRadius; + + private static void SetKernelRadius(ref object instanceObj, object valueObj) => ((GaussianBlurElement)instanceObj).KernelRadius = (int)valueObj; + + 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() => new GaussianBlurElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(14, "Blur", null, 80, typeof(GaussianBlurElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(14, "Mode", 96, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMode), new SetValueHandler(SetMode), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(14, "KernelRadius", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetKernelRadius), new SetValueHandler(SetKernelRadius), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(14, "Bluriness", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetBluriness), new SetValueHandler(SetBluriness), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..830b679 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/BooleanChoiceSchema.cs @@ -0,0 +1,39 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.BooleanChoiceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class BooleanChoiceSchema + { + public static UIXTypeSchema Type; + + private static object GetValue(object instanceObj) => BooleanBoxes.Box(((IUIChoice)instanceObj).ChosenIndex == 1); + + private static void SetValue(ref object instanceObj, object valueObj) + { + IUIBooleanChoice uiBooleanChoice = (IUIBooleanChoice)instanceObj; + if ((bool)valueObj) + uiBooleanChoice.ChosenIndex = 1; + else + uiBooleanChoice.ChosenIndex = 0; + } + + private static object Construct() => new Microsoft.Iris.ModelItems.BooleanChoice(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(16, "BooleanChoice", null, 28, typeof(IUIBooleanChoice), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(16, "Value", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..ef9f7c9 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/BooleanSchema.cs @@ -0,0 +1,173 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.BooleanSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class BooleanSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => BooleanBoxes.FalseBox; + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + bool flag = (bool)instanceObj; + writer.WriteBool(flag); + } + + private static object DecodeBinary(ByteCodeReader reader) => BooleanBoxes.Box(reader.ReadBool()); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str = (string)valueObj; + instanceObj = null; + bool result; + if (!bool.TryParse(str, out result)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Boolean"); + instanceObj = BooleanBoxes.Box(result); + return Result.Success; + } + + private static Result ConvertFromInt32(object valueObj, out object instanceObj) + { + int num = (int)valueObj; + instanceObj = null; + bool flag = num != 0; + instanceObj = BooleanBoxes.Box(flag); + return Result.Success; + } + + private static Result ConvertFromInt64(object valueObj, out object instanceObj) + { + long num = (long)valueObj; + instanceObj = null; + bool flag = num != 0L; + instanceObj = BooleanBoxes.Box(flag); + return Result.Success; + } + + private static Result ConvertFromSingle(object valueObj, out object instanceObj) + { + float num = (float)valueObj; + instanceObj = null; + bool flag = num != 0.0; + instanceObj = BooleanBoxes.Box(flag); + return Result.Success; + } + + private static Result ConvertFromDouble(object valueObj, out object instanceObj) + { + double num = (double)valueObj; + instanceObj = null; + bool flag = num != 0.0; + instanceObj = BooleanBoxes.Box(flag); + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => DoubleSchema.Type.IsAssignableFrom(fromType) || Int32Schema.Type.IsAssignableFrom(fromType) || (Int64Schema.Type.IsAssignableFrom(fromType) || SingleSchema.Type.IsAssignableFrom(fromType)) || StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (DoubleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromDouble(from, out instance); + if (!result.Failed) + return result; + } + if (Int32Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt32(from, out instance); + if (!result.Failed) + return result; + } + if (Int64Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt64(from, out instance); + if (!result.Failed) + return result; + } + if (SingleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSingle(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.LogicalAnd: + case OperationType.LogicalOr: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.LogicalNot: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + bool flag1 = (bool)leftObj; + if (op == OperationType.LogicalNot) + return BooleanBoxes.Box(!flag1); + bool flag2 = (bool)rightObj; + switch (op - 6) + { + case 0: + return BooleanBoxes.Box(flag1 && flag2); + case OperationType.MathAdd: + return BooleanBoxes.Box(flag1 || flag2); + case OperationType.MathSubtract: + return BooleanBoxes.Box(flag1 == flag2); + case OperationType.MathMultiply: + return BooleanBoxes.Box(flag1 != flag2); + default: + return null; + } + } + + private static object CallTryParseStringBoolean(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + bool parameter2 = (bool)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(15, "Boolean", "bool", 153, typeof(bool), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(15, "TryParse", new short[2] + { + 208, + 15 + }, 15, new InvokeHandler(CallTryParseStringBoolean), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, null, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/BrightnessInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/BrightnessInstanceSchema.cs new file mode 100644 index 0000000..1e2afe6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/BrightnessInstanceSchema.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.BrightnessInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class BrightnessInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetBrightness(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Brightness", (float)valueObj); + + private static object CallPlayBrightnessAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Brightness, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(18, "BrightnessInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(18, "Brightness", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetBrightness), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(18, "PlayBrightnessAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayBrightnessAnimationEffectFloatAnimation), false); + Type.Initialize(null, null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..c168e9b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/BrightnessSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.BrightnessSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class BrightnessSchema + { + public static UIXTypeSchema Type; + + 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() => new BrightnessElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(17, "Brightness", null, 80, typeof(BrightnessElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(17, "Brightness", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetBrightness), new SetValueHandler(SetBrightness), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..3a11a50 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ByteRangedValueSchema.cs @@ -0,0 +1,67 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ByteRangedValueSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ByteRangedValueSchema + { + public static UIXTypeSchema Type; + + 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 (num > (double)uiByteRangedValue.MaxValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MinValue"); + else + uiByteRangedValue.MinValue = num; + } + + 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 (num < (double)uiByteRangedValue.MinValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MaxValue"); + else + uiByteRangedValue.MaxValue = num; + } + + private static object GetStep(object instanceObj) => (byte)((IUIRangedValue)instanceObj).Step; + + private static void SetStep(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Step = (byte)valueObj; + + private static object GetValue(object instanceObj) => (byte)((IUIRangedValue)instanceObj).Value; + + private static void SetValue(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Value = (byte)valueObj; + + private static object Construct() => new Microsoft.Iris.ModelItems.ByteRangedValue(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(20, "ByteRangedValue", null, 168, typeof(IUIByteRangedValue), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(20, "MinValue", 19, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMinValue), new SetValueHandler(SetMinValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(20, "MaxValue", 19, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMaxValue), new SetValueHandler(SetMaxValue), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(20, "Step", 19, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStep), new SetValueHandler(SetStep), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(20, "Value", 19, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[4] + { + 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 new file mode 100644 index 0000000..5296b8a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ByteSchema.cs @@ -0,0 +1,216 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ByteSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ByteSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => (byte)0; + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + byte num = (byte)instanceObj; + writer.WriteByte(num); + } + + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadByte(); + + 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 = null; + byte 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 = 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 = null; + byte num2 = (byte)num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromInt64(object valueObj, out object instanceObj) + { + long num1 = (long)valueObj; + instanceObj = null; + byte num2 = (byte)num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromSingle(object valueObj, out object instanceObj) + { + float num1 = (float)valueObj; + instanceObj = null; + byte num2 = (byte)num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromDouble(object valueObj, out object instanceObj) + { + double num1 = (double)valueObj; + instanceObj = null; + byte num2 = (byte)num1; + instanceObj = num2; + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => BooleanSchema.Type.IsAssignableFrom(fromType) || DoubleSchema.Type.IsAssignableFrom(fromType) || (Int32Schema.Type.IsAssignableFrom(fromType) || Int64Schema.Type.IsAssignableFrom(fromType)) || (SingleSchema.Type.IsAssignableFrom(fromType) || StringSchema.Type.IsAssignableFrom(fromType)); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (BooleanSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromBoolean(from, out instance); + if (!result.Failed) + return result; + } + if (DoubleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromDouble(from, out instance); + if (!result.Failed) + return result; + } + if (Int32Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt32(from, out instance); + if (!result.Failed) + return result; + } + if (Int64Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt64(from, out instance); + if (!result.Failed) + return result; + } + if (SingleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSingle(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.MathMultiply: + case OperationType.MathDivide: + case OperationType.MathModulus: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.RelationalLessThan: + case OperationType.RelationalGreaterThan: + case OperationType.RelationalLessThanEquals: + case OperationType.RelationalGreaterThanEquals: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + byte num1 = (byte)leftObj; + byte num2 = (byte)rightObj; + switch (op) + { + case OperationType.MathAdd: + return (byte)(num1 + (uint)num2); + case OperationType.MathSubtract: + return (byte)(num1 - (uint)num2); + case OperationType.MathMultiply: + return (byte)(num1 * (uint)num2); + case OperationType.MathDivide: + return (byte)(num1 / (uint)num2); + case OperationType.MathModulus: + return (byte)(num1 % (uint)num2); + case OperationType.RelationalEquals: + return BooleanBoxes.Box(num1 == num2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(num1 != num2); + case OperationType.RelationalLessThan: + return BooleanBoxes.Box(num1 < num2); + case OperationType.RelationalGreaterThan: + return BooleanBoxes.Box(num1 > num2); + case OperationType.RelationalLessThanEquals: + return BooleanBoxes.Box(num1 <= num2); + case OperationType.RelationalGreaterThanEquals: + return BooleanBoxes.Box(num1 >= num2); + default: + return null; + } + } + + private static object CallTryParseStringByte(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + byte parameter2 = (byte)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(19, "Byte", "byte", 153, typeof(byte), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(19, "ToString", new short[1] + { + 208 + }, 208, new InvokeHandler(CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(19, "TryParse", new short[2] + { + 208, + 19 + }, 19, new InvokeHandler(CallTryParseStringByte), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, null, new MethodSchema[2] + { + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/CameraAtKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CameraAtKeyframeSchema.cs new file mode 100644 index 0000000..37f0a19 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraAtKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.CameraAtKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class CameraAtKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new CameraAtKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(22, "CameraAtKeyframe", null, 130, typeof(CameraAtKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(22, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..ed1de48 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraEyeKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.CameraEyeKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class CameraEyeKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new CameraEyeKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(23, "CameraEyeKeyframe", null, 130, typeof(CameraEyeKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(23, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..d90650c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraSchema.cs @@ -0,0 +1,130 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.CameraSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class CameraSchema + { + public static UIXTypeSchema Type; + + 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) => ((Camera)instanceObj).At; + + private static void SetAt(ref object instanceObj, object valueObj) => ((Camera)instanceObj).At = (Vector3)valueObj; + + 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) => ((Camera)instanceObj).Zn; + + private static void SetZn(ref object instanceObj, object valueObj) => ((Camera)instanceObj).Zn = (float)valueObj; + + 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) => ((Camera)instanceObj).AtAnimation; + + private static void SetAtAnimation(ref object instanceObj, object valueObj) => ((Camera)instanceObj).AtAnimation = (IAnimationProvider)valueObj; + + 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) => ((Camera)instanceObj).ZnAnimation; + + private static void SetZnAnimation(ref object instanceObj, object valueObj) => ((Camera)instanceObj).ZnAnimation = (IAnimationProvider)valueObj; + + private static object GetPerspective(object instanceObj) => BooleanBoxes.Box(((Camera)instanceObj).Perspective); + + private static void SetPerspective(ref object instanceObj, object valueObj) => ((Camera)instanceObj).Perspective = (bool)valueObj; + + private static object Construct() => new Camera(); + + private static object CallPlayAnimationIAnimation(object instanceObj, object[] parameters) + { + Camera camera = (Camera)instanceObj; + IAnimationProvider parameter = (IAnimationProvider)parameters[0]; + if (parameter == null) + { + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; + } + camera.PlayAnimation(parameter, null); + return null; + } + + private static object CallPlayAnimationIAnimationAnimationHandle( + object instanceObj, + object[] parameters) + { + Camera camera = (Camera)instanceObj; + IAnimationProvider parameter1 = (IAnimationProvider)parameters[0]; + AnimationHandle parameter2 = (AnimationHandle)parameters[1]; + if (parameter1 == 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}'", "handle"); + return null; + } + camera.PlayAnimation(parameter1, parameter2); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(21, "Camera", null, 153, typeof(Camera), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(21, "Eye", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEye), new SetValueHandler(SetEye), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(21, "At", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAt), new SetValueHandler(SetAt), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(21, "Up", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetUp), new SetValueHandler(SetUp), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(21, "Zn", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetZn), new SetValueHandler(SetZn), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(21, "EyeAnimation", 104, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEyeAnimation), new SetValueHandler(SetEyeAnimation), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(21, "AtAnimation", 104, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAtAnimation), new SetValueHandler(SetAtAnimation), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(21, "UpAnimation", 104, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetUpAnimation), new SetValueHandler(SetUpAnimation), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(21, "ZnAnimation", 104, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetZnAnimation), new SetValueHandler(SetZnAnimation), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(21, "Perspective", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPerspective), new SetValueHandler(SetPerspective), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(21, "PlayAnimation", new short[1] + { + 104 + }, 240, new InvokeHandler(CallPlayAnimationIAnimation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(21, "PlayAnimation", new short[2] + { + 104, + 11 + }, 240, new InvokeHandler(CallPlayAnimationIAnimationAnimationHandle), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[9] + { + uixPropertySchema2, + uixPropertySchema6, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema9, + uixPropertySchema3, + uixPropertySchema7, + uixPropertySchema4, + uixPropertySchema8 + }, new MethodSchema[2] + { + 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 new file mode 100644 index 0000000..0e75808 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraUpKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.CameraUpKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class CameraUpKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new CameraUpKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(24, "CameraUpKeyframe", null, 130, typeof(CameraUpKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(24, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..d52ff12 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/CameraZnKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.CameraZnKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class CameraZnKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new CameraZnKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(25, "CameraZnKeyframe", null, 130, typeof(CameraZnKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(25, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..c6e7ac3 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/CaretInfoSchema.cs @@ -0,0 +1,48 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.CaretInfoSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class CaretInfoSchema + { + public static UIXTypeSchema Type; + + private static object GetBlinkTime(object instanceObj) => ((CaretInfo)instanceObj).BlinkTime; + + 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) => ((CaretInfo)instanceObj).Position; + + private static object GetSuggestedSize(object instanceObj) => ((CaretInfo)instanceObj).SuggestedSize; + + private static object Construct() => new CaretInfo(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(26, "CaretInfo", null, 153, typeof(CaretInfo), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(26, "BlinkTime", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetBlinkTime), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(26, "IdealWidth", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIdealWidth), new SetValueHandler(SetIdealWidth), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(26, "Visible", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetVisible), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(26, "Position", 158, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPosition), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(26, "SuggestedSize", 195, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSuggestedSize), null, false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[5] + { + 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 new file mode 100644 index 0000000..c45b9a3 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/CharSchema.cs @@ -0,0 +1,104 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.CharSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class CharSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => char.MinValue; + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + char ch = (char)instanceObj; + writer.WriteChar(ch); + } + + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadChar(); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str = (string)valueObj; + instanceObj = null; + if (str == null || str.Length != 1) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Char"); + char ch = str[0]; + instanceObj = ch; + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + char ch1 = (char)leftObj; + char ch2 = (char)rightObj; + switch (op) + { + case OperationType.RelationalEquals: + return BooleanBoxes.Box(ch1 == ch2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(ch1 != ch2); + default: + return null; + } + } + + private static object CallTryParseStringChar(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + char parameter2 = (char)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(27, "Char", "char", 153, typeof(char), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(27, "TryParse", new short[2] + { + 208, + 27 + }, 27, new InvokeHandler(CallTryParseStringChar), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, null, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs new file mode 100644 index 0000000..1f72e03 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ChoiceSchema.cs @@ -0,0 +1,154 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ChoiceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ChoiceSchema + { + public static UIXTypeSchema Type; + + private static object GetChosenValue(object instanceObj) => ((IUIChoice)instanceObj).ChosenValue; + + private static void SetChosenValue(ref object instanceObj, object valueObj) + { + IUIChoice uiChoice = (IUIChoice)instanceObj; + object obj = valueObj; + int index; + string error; + if (uiChoice.ValidateOption(obj, out index, out error)) + uiChoice.ChosenIndex = index; + else + ErrorManager.ReportError(error); + } + + private static object GetChosenIndex(object instanceObj) => ((IUIChoice)instanceObj).ChosenIndex; + + private static void SetChosenIndex(ref object instanceObj, object valueObj) + { + IUIChoice uiChoice = (IUIChoice)instanceObj; + int index = (int)valueObj; + string error; + if (uiChoice.ValidateIndex(index, out error)) + uiChoice.ChosenIndex = index; + else + ErrorManager.ReportError(error); + } + + 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) => ((IUIChoice)instanceObj).Options; + + private static void SetOptions(ref object instanceObj, object valueObj) + { + IUIChoice uiChoice = (IUIChoice)instanceObj; + IList list = (IList)valueObj; + string error; + if (uiChoice.ValidateOptionsList(list, out error)) + uiChoice.Options = list; + else + ErrorManager.ReportError(error); + } + + private static object GetHasSelection(object instanceObj) => BooleanBoxes.Box(((IUIChoice)instanceObj).HasSelection); + + private static object GetWrap(object instanceObj) => BooleanBoxes.Box(((IUIChoice)instanceObj).Wrap); + + private static void SetWrap(ref object instanceObj, object valueObj) => ((IUIChoice)instanceObj).Wrap = (bool)valueObj; + + private static object GetHasPreviousValue(object instanceObj) => BooleanBoxes.Box(((IUIValueRange)instanceObj).HasPreviousValue); + + private static object GetHasNextValue(object instanceObj) => BooleanBoxes.Box(((IUIValueRange)instanceObj).HasNextValue); + + private static object Construct() => new Microsoft.Iris.ModelItems.Choice(); + + private static object CallPreviousValue(object instanceObj, object[] parameters) + { + ((IUIValueRange)instanceObj).PreviousValue(); + return null; + } + + private static object CallPreviousValueBoolean(object instanceObj, object[] parameters) + { + ((IUIChoice)instanceObj).PreviousValue((bool)parameters[0]); + return null; + } + + private static object CallNextValue(object instanceObj, object[] parameters) + { + ((IUIValueRange)instanceObj).NextValue(); + return null; + } + + private static object CallNextValueBoolean(object instanceObj, object[] parameters) + { + ((IUIChoice)instanceObj).NextValue((bool)parameters[0]); + return null; + } + + private static object CallDefaultValue(object instanceObj, object[] parameters) + { + ((IUIChoice)instanceObj).DefaultValue(); + return null; + } + + private static object CallClear(object instanceObj, object[] parameters) + { + ((IUIChoice)instanceObj).Clear(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(28, "Choice", null, 231, typeof(IUIChoice), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(28, "ChosenValue", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetChosenValue), new SetValueHandler(SetChosenValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(28, "ChosenIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetChosenIndex), new SetValueHandler(SetChosenIndex), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(28, "DefaultIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDefaultIndex), new SetValueHandler(SetDefaultIndex), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(28, "Options", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetOptions), new SetValueHandler(SetOptions), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(28, "HasSelection", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHasSelection), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(28, "Wrap", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetWrap), new SetValueHandler(SetWrap), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(28, "HasPreviousValue", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHasPreviousValue), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(28, "HasNextValue", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHasNextValue), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(28, "PreviousValue", null, 240, new InvokeHandler(CallPreviousValue), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(28, "PreviousValue", new short[1] + { + 15 + }, 240, new InvokeHandler(CallPreviousValueBoolean), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(28, "NextValue", null, 240, new InvokeHandler(CallNextValue), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(28, "NextValue", new short[1] + { + 15 + }, 240, new InvokeHandler(CallNextValueBoolean), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(28, "DefaultValue", null, 240, new InvokeHandler(CallDefaultValue), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(28, "Clear", null, 240, new InvokeHandler(CallClear), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[8] + { + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema8, + uixPropertySchema7, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema6 + }, new MethodSchema[6] + { + 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 new file mode 100644 index 0000000..7b3031d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ClassSchema.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ClassSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ClassSchema + { + public static UIXTypeSchema Type; + + private static void SetShared(ref object instanceObj, object valueObj) + { + Class @class = (Class)instanceObj; + int num = (bool)valueObj ? 1 : 0; + } + + private static void SetBase(ref object instanceObj, object valueObj) + { + Class @class = (Class)instanceObj; + } + + private static object GetProperties(object instanceObj) => ((Class)instanceObj).Storage; + + private static object GetLocals(object instanceObj) => ((Class)instanceObj).Storage; + + private static object GetScripts(object instanceObj) => (object)null; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(29, "Class", null, -1, typeof(Class), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(29, "Shared", 15, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetShared), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(29, "Base", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetBase), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(29, "Properties", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetProperties), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(29, "Locals", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetLocals), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(29, "Scripts", 138, 240, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetScripts), null, false); + Type.Initialize(null, null, new PropertySchema[5] + { + 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 new file mode 100644 index 0000000..eae6ab5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ClassStateSchema.cs @@ -0,0 +1,51 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ClassStateSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ClassStateSchema + { + public static UIXTypeSchema Type; + + private static object CallDisposeOwnedObjectObject(object instanceObj, object[] parameters) + { + Class @class = (Class)instanceObj; + object parameter = parameters[0]; + if (parameter == null) + return null; + if (!(parameter is IDisposableObject disposable)) + { + 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", TypeSchema.NameFromInstance(disposable), @class.TypeSchema.Name); + return null; + } + disposable.Dispose(@class); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(30, "ClassState", null, -1, typeof(Class), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(30, "DisposeOwnedObject", new short[1] + { + 153 + }, 240, new InvokeHandler(CallDisposeOwnedObjectObject), false); + Type.Initialize(null, null, null, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..a06fbee --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ClickHandlerSchema.cs @@ -0,0 +1,126 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ClickHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.Library; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ClickHandlerSchema + { + public static UIXTypeSchema Type; + + private static object GetClicking(object instanceObj) => BooleanBoxes.Box(((ClickHandler)instanceObj).Clicking); + + 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) => ((ClickHandler)instanceObj).ClickType; + + private static void SetClickType(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).ClickType = (ClickType)valueObj; + + private static object GetCommand(object instanceObj) => ((ClickHandler)instanceObj).Command; + + private static void SetCommand(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).Command = (IUICommand)valueObj; + + private static object GetHandle(object instanceObj) => BooleanBoxes.Box(((ClickHandler)instanceObj).Handle); + + private static void SetHandle(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).Handle = (bool)valueObj; + + 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) => ((ModifierInputHandler)instanceObj).RequiredModifiers; + + private static void SetRequiredModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).RequiredModifiers = (InputHandlerModifiers)valueObj; + + 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 GetRepeat(object instanceObj) => BooleanBoxes.Box(((ClickHandler)instanceObj).Repeat); + + private static void SetRepeat(ref object instanceObj, object valueObj) => ((ClickHandler)instanceObj).Repeat = (bool)valueObj; + + private static object GetRepeatDelay(object instanceObj) => ((ClickHandler)instanceObj).RepeatDelay; + + private static void SetRepeatDelay(ref object instanceObj, object valueObj) + { + ClickHandler clickHandler = (ClickHandler)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + clickHandler.RepeatDelay = num; + } + + private static object GetRepeatRate(object instanceObj) => ((ClickHandler)instanceObj).RepeatRate; + + private static void SetRepeatRate(ref object instanceObj, object valueObj) + { + ClickHandler clickHandler = (ClickHandler)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + clickHandler.RepeatRate = num; + } + + 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() => new ClickHandler(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(32, "ClickHandler", null, 110, typeof(ClickHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(32, "Clicking", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetClicking), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(32, "ClickCount", 31, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetClickCount), new SetValueHandler(SetClickCount), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(32, "ClickType", 33, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetClickType), new SetValueHandler(SetClickType), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(32, "Command", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCommand), new SetValueHandler(SetCommand), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(32, "Handle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandle), new SetValueHandler(SetHandle), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(32, "HandlerTransition", 113, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerTransition), new SetValueHandler(SetHandlerTransition), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(32, "RequiredModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRequiredModifiers), new SetValueHandler(SetRequiredModifiers), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(32, "DisallowedModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDisallowedModifiers), new SetValueHandler(SetDisallowedModifiers), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(32, "Repeat", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRepeat), new SetValueHandler(SetRepeat), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(32, "RepeatDelay", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetRepeatDelay), new SetValueHandler(SetRepeatDelay), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(32, "RepeatRate", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetRepeatRate), new SetValueHandler(SetRepeatRate), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(32, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(32, "EventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEventContext), null, false); + UIXEventSchema uixEventSchema = new UIXEventSchema(32, "Invoked"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[13] + { + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema13, + uixPropertySchema5, + uixPropertySchema12, + uixPropertySchema6, + uixPropertySchema9, + uixPropertySchema10, + uixPropertySchema11, + uixPropertySchema7 + }, null, new EventSchema[1] + { + 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 new file mode 100644 index 0000000..ebd562b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ClipSchema.cs @@ -0,0 +1,104 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ClipSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ClipSchema + { + public static UIXTypeSchema Type; + + private static object GetChildren(object instanceObj) => ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); + + 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) => ((Clip)instanceObj).FadeSize; + + private static void SetFadeSize(ref object instanceObj, object valueObj) => ((Clip)instanceObj).FadeSize = (float)valueObj; + + 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) => ((Clip)instanceObj).FarOffset; + + private static void SetFarOffset(ref object instanceObj, object valueObj) => ((Clip)instanceObj).FarOffset = (float)valueObj; + + 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) => ((Clip)instanceObj).FarPercent; + + private static void SetFarPercent(ref object instanceObj, object valueObj) => ((Clip)instanceObj).FarPercent = (float)valueObj; + + private static object GetShowNear(object instanceObj) => BooleanBoxes.Box(((Clip)instanceObj).ShowNear); + + private static void SetShowNear(ref object instanceObj, object valueObj) => ((Clip)instanceObj).ShowNear = (bool)valueObj; + + private static object GetShowFar(object instanceObj) => BooleanBoxes.Box(((Clip)instanceObj).ShowFar); + + private static void SetShowFar(ref object instanceObj, object valueObj) => ((Clip)instanceObj).ShowFar = (bool)valueObj; + + 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) => ((Clip)instanceObj).FadeAmount; + + private static void SetFadeAmount(ref object instanceObj, object valueObj) + { + Clip clip = (Clip)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + clip.FadeAmount = num; + } + + private static object Construct() => new Clip(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(34, "Clip", null, 239, typeof(Clip), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(34, "Children", 138, 239, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetChildren), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(34, "Orientation", 154, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetOrientation), new SetValueHandler(SetOrientation), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(34, "FadeSize", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFadeSize), new SetValueHandler(SetFadeSize), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(34, "NearOffset", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetNearOffset), new SetValueHandler(SetNearOffset), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(34, "FarOffset", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFarOffset), new SetValueHandler(SetFarOffset), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(34, "NearPercent", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetNearPercent), new SetValueHandler(SetNearPercent), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(34, "FarPercent", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFarPercent), new SetValueHandler(SetFarPercent), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(34, "ShowNear", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetShowNear), new SetValueHandler(SetShowNear), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(34, "ShowFar", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetShowFar), new SetValueHandler(SetShowFar), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(34, "ColorMask", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetColorMask), new SetValueHandler(SetColorMask), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(34, "FadeAmount", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, true, new GetValueHandler(GetFadeAmount), new SetValueHandler(SetFadeAmount), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[11] + { + 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 new file mode 100644 index 0000000..2197dfd --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ColorElementInstanceSchema.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ColorElementInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ColorElementInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetColor(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Color", (Color)valueObj); + + private static object CallPlayColorAnimationEffectColorAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Color, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(37, "ColorElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(37, "Color", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetColor), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(37, "PlayColorAnimation", new short[1] + { + 71 + }, 240, new InvokeHandler(CallPlayColorAnimationEffectColorAnimation), false); + Type.Initialize(null, null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..2bd6d79 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ColorElementSchema.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ColorElementSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ColorElementSchema + { + public static UIXTypeSchema Type; + + private static void SetColor(ref object instanceObj, object valueObj) => ((ColorElement)instanceObj).Color = ((Color)valueObj).RenderConvert(); + + private static object Construct() => new ColorElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(36, "ColorElement", null, 77, typeof(ColorElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(36, "Color", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetColor), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..1dcbab0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ColorSchema.cs @@ -0,0 +1,1030 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ColorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using System.Collections.Generic; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ColorSchema + { + private static Dictionary s_NameToColorMap; + private static readonly object s_Default = new Color(byte.MaxValue, 0, 0, 0); + public static UIXTypeSchema Type; + + private static object GetAlpha(object instanceObj) => (float)(((Color)instanceObj).A / (double)byte.MaxValue); + + private static void SetAlpha(ref object instanceObj, object valueObj) + { + Color color = (Color)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + { + ErrorManager.ReportError(result.Error); + } + else + { + color.A = (byte)(num * (double)byte.MaxValue); + instanceObj = color; + } + } + + private static object GetRed(object instanceObj) => (float)(((Color)instanceObj).R / (double)byte.MaxValue); + + private static void SetRed(ref object instanceObj, object valueObj) + { + Color color = (Color)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + { + ErrorManager.ReportError(result.Error); + } + else + { + color.R = (byte)(num * (double)byte.MaxValue); + instanceObj = color; + } + } + + private static object GetGreen(object instanceObj) => (float)(((Color)instanceObj).G / (double)byte.MaxValue); + + private static void SetGreen(ref object instanceObj, object valueObj) + { + Color color = (Color)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + { + ErrorManager.ReportError(result.Error); + } + else + { + color.G = (byte)(num * (double)byte.MaxValue); + instanceObj = color; + } + } + + private static object GetBlue(object instanceObj) => (float)(((Color)instanceObj).B / (double)byte.MaxValue); + + private static void SetBlue(ref object instanceObj, object valueObj) + { + Color color = (Color)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + { + ErrorManager.ReportError(result.Error); + } + else + { + color.B = (byte)(num * (double)byte.MaxValue); + instanceObj = color; + } + } + + 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 = color; + } + + 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 = color; + } + + 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 = color; + } + + 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 = color; + } + + private static object Construct() => s_Default; + + private static object ConstructAlphaRedGreenBlue(object[] parameters) + { + object instanceObj = Construct(); + SetAlpha(ref instanceObj, parameters[0]); + SetRed(ref instanceObj, parameters[1]); + SetGreen(ref instanceObj, parameters[2]); + SetBlue(ref instanceObj, parameters[3]); + return instanceObj; + } + + private static Result ConvertFromStringAlphaRedGreenBlue( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result1.Error); + SetAlpha(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result2.Error); + SetRed(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result3.Error); + SetGreen(ref instance, valueObj3); + object valueObj4; + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj4); + if (result4.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result4.Error); + SetBlue(ref instance, valueObj4); + return result4; + } + + private static object ConstructARGB(object[] parameters) + { + object instanceObj = Construct(); + SetA(ref instanceObj, parameters[0]); + SetR(ref instanceObj, parameters[1]); + SetG(ref instanceObj, parameters[2]); + SetB(ref instanceObj, parameters[3]); + return instanceObj; + } + + private static Result ConvertFromStringARGB(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], ByteSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result1.Error); + SetA(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], ByteSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result2.Error); + SetR(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], ByteSchema.Type, null, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result3.Error); + SetG(ref instance, valueObj3); + object valueObj4; + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], ByteSchema.Type, null, out valueObj4); + if (result4.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result4.Error); + SetB(ref instance, valueObj4); + return result4; + } + + private static object ConstructRedGreenBlue(object[] parameters) + { + object instanceObj = Construct(); + SetRed(ref instanceObj, parameters[0]); + SetGreen(ref instanceObj, parameters[1]); + SetBlue(ref instanceObj, parameters[2]); + return instanceObj; + } + + private static Result ConvertFromStringRedGreenBlue( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result1.Error); + SetRed(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result2.Error); + SetGreen(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, SingleSchema.Validate0to1, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result3.Error); + SetBlue(ref instance, valueObj3); + return result3; + } + + private static object ConstructRGB(object[] parameters) + { + object instanceObj = Construct(); + SetR(ref instanceObj, parameters[0]); + SetG(ref instanceObj, parameters[1]); + SetB(ref instanceObj, parameters[2]); + return instanceObj; + } + + private static Result ConvertFromStringRGB(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], ByteSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result1.Error); + SetR(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], ByteSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result2.Error); + SetG(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], ByteSchema.Type, null, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Color", result3.Error); + SetB(ref instance, valueObj3); + return result3; + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Color color = (Color)instanceObj; + writer.WriteUInt32(color.Value); + } + + private static object DecodeBinary(ByteCodeReader reader) => new Color(reader.ReadUInt32()); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str = (string)valueObj; + instanceObj = null; + uint num; + if (!s_NameToColorMap.TryGetValue(str.ToLowerInvariant(), out num)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Color"); + Color color = new Color(num); + instanceObj = color; + return Result.Success; + } + + private static object FindCanonicalInstance(string name) + { + uint num; + return s_NameToColorMap.TryGetValue(name.ToLowerInvariant(), out num) ? new Color(num) : (object)null; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result1 = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result1 = ConvertFromString(from, out instance); + if (!result1.Failed) + return result1; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + switch (splitString.Length) + { + case 3: + Result result2 = ConvertFromStringRedGreenBlue(splitString, out instance); + if (!result2.Failed) + return result2; + result1 = ConvertFromStringRGB(splitString, out instance); + if (!result1.Failed) + return result1; + break; + case 4: + Result result3 = ConvertFromStringAlphaRedGreenBlue(splitString, out instance); + if (!result3.Failed) + return result3; + result1 = ConvertFromStringARGB(splitString, out instance); + if (!result1.Failed) + return result1; + break; + default: + result1 = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Color"); + break; + } + } + return result1; + } + + private static object CallTryParseStringColor(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + Color parameter2 = (Color)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + static ColorSchema() => s_NameToColorMap = new Dictionary(153) + { + { + "aliceblue", + 4293982463U + }, + { + "antiquewhite", + 4294634455U + }, + { + "aqua", + 4278255615U + }, + { + "aquamarine", + 4286578644U + }, + { + "azure", + 4293984255U + }, + { + "beige", + 4294309340U + }, + { + "bisque", + 4294960324U + }, + { + "black", + 4278190080U + }, + { + "blanchedalmond", + 4294962125U + }, + { + "blue", + 4278190335U + }, + { + "blueviolet", + 4287245282U + }, + { + "brown", + 4289014314U + }, + { + "burlywood", + 4292786311U + }, + { + "cadetblue", + 4284456608U + }, + { + "chartreuse", + 4286578432U + }, + { + "chocolate", + 4291979550U + }, + { + "coral", + 4294934352U + }, + { + "cornflowerblue", + 4284782061U + }, + { + "cornsilk", + 4294965468U + }, + { + "crimson", + 4292613180U + }, + { + "cyan", + 4278255615U + }, + { + "darkblue", + 4278190219U + }, + { + "darkcyan", + 4278225803U + }, + { + "darkgoldenrod", + 4290283019U + }, + { + "darkgray", + 4289309097U + }, + { + "darkgreen", + 4278215680U + }, + { + "darkgrey", + 4289309097U + }, + { + "darkkhaki", + 4290623339U + }, + { + "darkmagenta", + 4287299723U + }, + { + "darkolivegreen", + 4283788079U + }, + { + "darkorange", + 4294937600U + }, + { + "darkorchid", + 4288230092U + }, + { + "darkred", + 4287299584U + }, + { + "darksalmon", + 4293498490U + }, + { + "darkseagreen", + 4287609999U + }, + { + "darkslateblue", + 4282924427U + }, + { + "darkslategray", + 4281290575U + }, + { + "darkslategrey", + 4281290575U + }, + { + "darkturquoise", + 4278243025U + }, + { + "darkviolet", + 4287889619U + }, + { + "deeppink", + 4294907027U + }, + { + "deepskyblue", + 4278239231U + }, + { + "dimgray", + 4285098345U + }, + { + "dimgrey", + 4285098345U + }, + { + "dodgerblue", + 4280193279U + }, + { + "feldspar", + 4291924597U + }, + { + "firebrick", + 4289864226U + }, + { + "floralwhite", + 4294966000U + }, + { + "forestgreen", + 4280453922U + }, + { + "fuchsia", + 4294902015U + }, + { + "gainsboro", + 4292664540U + }, + { + "ghostwhite", + 4294506751U + }, + { + "gold", + 4294956800U + }, + { + "goldenrod", + 4292519200U + }, + { + "gray", + 4286611584U + }, + { + "green", + 4278222848U + }, + { + "greenyellow", + 4289593135U + }, + { + "grey", + 4286611584U + }, + { + "honeydew", + 4293984240U + }, + { + "hotpink", + 4294928820U + }, + { + "indianred", + 4291648604U + }, + { + "indigo", + 4283105410U + }, + { + "ivory", + 4294967280U + }, + { + "khaki", + 4293977740U + }, + { + "lavender", + 4293322490U + }, + { + "lavenderblush", + 4294963445U + }, + { + "lawngreen", + 4286381056U + }, + { + "lemonchiffon", + 4294965965U + }, + { + "lightblue", + 4289583334U + }, + { + "lightcoral", + 4293951616U + }, + { + "lightcyan", + 4292935679U + }, + { + "lightgoldenrodyellow", + 4294638290U + }, + { + "lightgray", + 4292072403U + }, + { + "lightgreen", + 4287688336U + }, + { + "lightgrey", + 4292072403U + }, + { + "lightpink", + 4294948545U + }, + { + "lightsalmon", + 4294942842U + }, + { + "lightseagreen", + 4280332970U + }, + { + "lightskyblue", + 4287090426U + }, + { + "lightslateblue", + 4286869759U + }, + { + "lightslategray", + 4286023833U + }, + { + "lightslategrey", + 4286023833U + }, + { + "lightsteelblue", + 4289774814U + }, + { + "lightyellow", + 4294967264U + }, + { + "lime", + 4278255360U + }, + { + "limegreen", + 4281519410U + }, + { + "linen", + 4294635750U + }, + { + "magenta", + 4294902015U + }, + { + "maroon", + 4286578688U + }, + { + "mediumaquamarine", + 4284927402U + }, + { + "mediumblue", + 4278190285U + }, + { + "mediumorchid", + 4290401747U + }, + { + "mediumpurple", + 4287852760U + }, + { + "mediumseagreen", + 4282168177U + }, + { + "mediumslateblue", + 4286277870U + }, + { + "mediumspringgreen", + 4278254234U + }, + { + "mediumturquoise", + 4282962380U + }, + { + "mediumvioletred", + 4291237253U + }, + { + "midnightblue", + 4279834992U + }, + { + "mintcream", + 4294311930U + }, + { + "mistyrose", + 4294960353U + }, + { + "moccasin", + 4294960309U + }, + { + "navajowhite", + 4294958765U + }, + { + "navy", + 4278190208U + }, + { + "oldlace", + 4294833638U + }, + { + "olive", + 4286611456U + }, + { + "olivedrab", + 4285238819U + }, + { + "orange", + 4294944000U + }, + { + "orangered", + 4294919424U + }, + { + "orchid", + 4292505814U + }, + { + "palegoldenrod", + 4293847210U + }, + { + "palegreen", + 4288215960U + }, + { + "paleturquoise", + 4289720046U + }, + { + "palevioletred", + 4292374675U + }, + { + "papayawhip", + 4294963157U + }, + { + "peachpuff", + 4294957753U + }, + { + "peru", + 4291659071U + }, + { + "pink", + 4294951115U + }, + { + "plum", + 4292714717U + }, + { + "powderblue", + 4289781990U + }, + { + "purple", + 4286578816U + }, + { + "red", + 4294901760U + }, + { + "rosybrown", + 4290547599U + }, + { + "royalblue", + 4282477025U + }, + { + "saddlebrown", + 4287317267U + }, + { + "salmon", + 4294606962U + }, + { + "sandybrown", + 4294222944U + }, + { + "seagreen", + 4281240407U + }, + { + "seashell", + 4294964718U + }, + { + "sienna", + 4288696877U + }, + { + "silver", + 4290822336U + }, + { + "skyblue", + 4287090411U + }, + { + "slateblue", + 4285160141U + }, + { + "slategray", + 4285563024U + }, + { + "slategrey", + 4285563024U + }, + { + "snow", + 4294966010U + }, + { + "springgreen", + 4278255487U + }, + { + "steelblue", + 4282811060U + }, + { + "tvblack", + 4279242768U + }, + { + "tvwhite", + 4293651435U + }, + { + "tan", + 4291998860U + }, + { + "teal", + 4278222976U + }, + { + "thistle", + 4292394968U + }, + { + "tomato", + 4294927175U + }, + { + "transparent", + 0U + }, + { + "turquoise", + 4282441936U + }, + { + "violet", + 4293821166U + }, + { + "violetred", + 4291829904U + }, + { + "wheat", + 4294303411U + }, + { + "white", + uint.MaxValue + }, + { + "whitesmoke", + 4294309365U + }, + { + "yellow", + 4294967040U + }, + { + "yellowgreen", + 4288335154U + } + }; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(35, "Color", null, 153, typeof(Color), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(35, "Alpha", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetAlpha), new SetValueHandler(SetAlpha), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(35, "Red", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetRed), new SetValueHandler(SetRed), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(35, "Green", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetGreen), new SetValueHandler(SetGreen), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(35, "Blue", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetBlue), new SetValueHandler(SetBlue), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(35, "A", 19, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetA), new SetValueHandler(SetA), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(35, "R", 19, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetR), new SetValueHandler(SetR), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(35, "G", 19, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetG), new SetValueHandler(SetG), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(35, "B", 19, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetB), new SetValueHandler(SetB), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(35, new short[4] + { + 194, + 194, + 194, + 194 + }, new ConstructHandler(ConstructAlphaRedGreenBlue)); + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(35, new short[4] + { + 19, + 19, + 19, + 19 + }, new ConstructHandler(ConstructARGB)); + UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema(35, new short[3] + { + 194, + 194, + 194 + }, new ConstructHandler(ConstructRedGreenBlue)); + UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema(35, new short[3] + { + 19, + 19, + 19 + }, new ConstructHandler(ConstructRGB)); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(35, "TryParse", new short[2] + { + 208, + 35 + }, 35, new InvokeHandler(CallTryParseStringColor), true); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[4] + { + constructorSchema1, + constructorSchema2, + constructorSchema3, + constructorSchema4 + }, new PropertySchema[8] + { + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema8, + uixPropertySchema4, + uixPropertySchema7, + uixPropertySchema3, + uixPropertySchema6, + uixPropertySchema2 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, new FindCanonicalInstanceHandler(FindCanonicalInstance), new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/CommandSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/CommandSchema.cs new file mode 100644 index 0000000..0bb33dd --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/CommandSchema.cs @@ -0,0 +1,49 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.CommandSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class CommandSchema + { + public static UIXTypeSchema Type; + + private static object GetAvailable(object instanceObj) => BooleanBoxes.Box(((IUICommand)instanceObj).Available); + + private static void SetAvailable(ref object instanceObj, object valueObj) => ((IUICommand)instanceObj).Available = (bool)valueObj; + + 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() => new UICommand(); + + private static object CallInvoke(object instanceObj, object[] parameters) + { + ((IUICommand)instanceObj).Invoke(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(40, "Command", null, 153, typeof(IUICommand), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(40, "Available", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAvailable), new SetValueHandler(SetAvailable), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(40, "Priority", 126, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPriority), new SetValueHandler(SetPriority), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(40, "Invoked"); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(40, "Invoke", null, 240, new InvokeHandler(CallInvoke), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..1131334 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ContrastInstanceSchema.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ContrastInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ContrastInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetContrast(ref object instanceObj, object valueObj) + { + EffectElementWrapper effectElementWrapper = (EffectElementWrapper)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + effectElementWrapper.SetProperty("Contrast", num); + } + + private static object CallPlayContrastAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Contrast, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(43, "ContrastInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(43, "Contrast", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, null, new SetValueHandler(SetContrast), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(43, "PlayContrastAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayContrastAnimationEffectFloatAnimation), false); + Type.Initialize(null, null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..30c638d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ContrastSchema.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ContrastSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ContrastSchema + { + public static UIXTypeSchema Type; + + private static object GetContrast(object instanceObj) => ((ContrastElement)instanceObj).Contrast; + + private static void SetContrast(ref object instanceObj, object valueObj) + { + ContrastElement contrastElement = (ContrastElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + contrastElement.Contrast = num; + } + + private static object Construct() => new ContrastElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(42, "Contrast", null, 80, typeof(ContrastElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(42, "Contrast", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetContrast), new SetValueHandler(SetContrast), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..d1d1a8b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DataMappingSchema.cs @@ -0,0 +1,38 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DataMappingSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DataMappingSchema + { + public static UIXTypeSchema Type; + + private static void SetTargetType(ref object instanceObj, object valueObj) + { + } + + private static void SetProvider(ref object instanceObj, object valueObj) + { + } + + private static object GetMappings(object instanceObj) => (object)null; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(45, "DataMapping", null, -1, typeof(object), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(45, "TargetType", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetTargetType), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(45, "Provider", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetProvider), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(45, "Mappings", 138, 140, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetMappings), null, false); + Type.Initialize(null, null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..e27d7ac --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DataQuerySchema.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DataQuerySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DataQuerySchema + { + public static UIXTypeSchema Type; + + private static void SetProvider(ref object instanceObj, object valueObj) + { + MarkupDataQuery markupDataQuery = (MarkupDataQuery)instanceObj; + } + + private static void SetResultType(ref object instanceObj, object valueObj) + { + MarkupDataQuery markupDataQuery = (MarkupDataQuery)instanceObj; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(46, "DataQuery", null, 29, typeof(MarkupDataQuery), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(46, "Provider", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetProvider), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(46, "ResultType", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetResultType), false); + Type.Initialize(null, null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..9764c6a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DataTypeSchema.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DataTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DataTypeSchema + { + public static UIXTypeSchema Type; + + private static void SetProvider(ref object instanceObj, object valueObj) + { + MarkupDataType markupDataType = (MarkupDataType)instanceObj; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(48, "DataType", null, 29, typeof(MarkupDataType), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(48, "Provider", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetProvider), false); + Type.Initialize(null, null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..bb265ef --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DebugOutlinesSchema.cs @@ -0,0 +1,122 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DebugOutlinesSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Debug; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DebugOutlinesSchema + { + public static UIXTypeSchema Type; + + 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) => DebugOutlines.Enabled; + + private static void SetEnabled(ref object instanceObj, object valueObj) + { + DebugOutlines debugOutlines = (DebugOutlines)instanceObj; + DebugOutlines.Enabled = (bool)valueObj; + } + + 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) => ((DebugOutlines)instanceObj).OutlineScope; + + private static void SetOutlineScope(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).OutlineScope = (DebugOutlineScope)valueObj; + + 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) => ((DebugOutlines)instanceObj).HostOutlineColor; + + private static void SetHostOutlineColor(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).HostOutlineColor = (Color)valueObj; + + 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) => ((DebugOutlines)instanceObj).TextFont; + + private static void SetTextFont(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).TextFont = (Font)valueObj; + + 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) => ((DebugOutlines)instanceObj).MouseFocusImage; + + private static void SetMouseFocusImage(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).MouseFocusImage = (UIImage)valueObj; + + 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) => ((DebugOutlines)instanceObj).KeyFocusImage; + + private static void SetKeyFocusImage(ref object instanceObj, object valueObj) => ((DebugOutlines)instanceObj).KeyFocusImage = (UIImage)valueObj; + + private static object Construct() => new DebugOutlines(); + + private static object CallNextScopeMode(object instanceObj, object[] parameters) + { + ((DebugOutlines)instanceObj).NextScopeMode(); + return null; + } + + private static object CallNextLabelMode(object instanceObj, object[] parameters) + { + ((DebugOutlines)instanceObj).NextLabelMode(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(52, "DebugOutlines", null, 239, typeof(DebugOutlines), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(52, "Root", 239, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRoot), new SetValueHandler(SetRoot), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(52, "Enabled", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetEnabled), new SetValueHandler(SetEnabled), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(52, "OutlineLabel", 50, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetOutlineLabel), new SetValueHandler(SetOutlineLabel), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(52, "OutlineScope", 51, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetOutlineScope), new SetValueHandler(SetOutlineScope), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(52, "OutlineColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetOutlineColor), new SetValueHandler(SetOutlineColor), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(52, "HostOutlineColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHostOutlineColor), new SetValueHandler(SetHostOutlineColor), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(52, "TextColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetTextColor), new SetValueHandler(SetTextColor), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(52, "TextFont", 93, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetTextFont), new SetValueHandler(SetTextFont), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(52, "MouseInteractiveImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMouseInteractiveImage), new SetValueHandler(SetMouseInteractiveImage), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(52, "MouseFocusImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMouseFocusImage), new SetValueHandler(SetMouseFocusImage), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(52, "KeyInteractiveImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetKeyInteractiveImage), new SetValueHandler(SetKeyInteractiveImage), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(52, "KeyFocusImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetKeyFocusImage), new SetValueHandler(SetKeyFocusImage), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(52, "NextScopeMode", null, 240, new InvokeHandler(CallNextScopeMode), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(52, "NextLabelMode", null, 240, new InvokeHandler(CallNextLabelMode), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[12] + { + uixPropertySchema2, + uixPropertySchema6, + uixPropertySchema12, + uixPropertySchema11, + uixPropertySchema10, + uixPropertySchema9, + uixPropertySchema5, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema7, + uixPropertySchema8 + }, new MethodSchema[2] + { + 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 new file mode 100644 index 0000000..9abe523 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DebugSchema.cs @@ -0,0 +1,130 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DebugSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.OS; +using System; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DebugSchema + { + public static UIXTypeSchema Type; + + private static object CallTraceString(object instanceObj, object[] parameters) + { + NativeApi.SpLogTrace(null, (string)parameters[0], 0); + return null; + } + + private static object CallTraceStringObject(object instanceObj, object[] parameters) + { + Trace((string)parameters[0], parameters[1], null, null, null, null); + return null; + } + + private static object CallTraceStringObjectObject(object instanceObj, object[] parameters) + { + Trace((string)parameters[0], parameters[1], parameters[2], null, null, null); + return null; + } + + private static object CallTraceStringObjectObjectObject(object instanceObj, object[] parameters) + { + Trace((string)parameters[0], parameters[1], parameters[2], parameters[3], null, null); + return null; + } + + private static object CallTraceStringObjectObjectObjectObject( + object instanceObj, + object[] parameters) + { + Trace((string)parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], null); + return null; + } + + private static object CallTraceStringObjectObjectObjectObjectObject( + object instanceObj, + object[] parameters) + { + Trace((string)parameters[0], parameters[1], parameters[2], parameters[3], parameters[4], parameters[5]); + return null; + } + + private static void Trace( + string format, + object param1, + object param2, + object param3, + object param4, + object param5) + { + string message; + try + { + message = string.Format(format, param1, param2, param3, param4, param5); + } + catch (FormatException ex) + { + message = string.Format("Invalid format for Debug.Trace [{0}].", format); + } + NativeApi.SpLogTrace(null, message, 0); + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(49, "Debug", null, 153, typeof(object), UIXTypeFlags.Static); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(49, "Trace", new short[1] + { + 208 + }, 240, new InvokeHandler(CallTraceString), true); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(49, "Trace", new short[2] + { + 208, + 153 + }, 240, new InvokeHandler(CallTraceStringObject), true); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(49, "Trace", new short[3] + { + 208, + 153, + 153 + }, 240, new InvokeHandler(CallTraceStringObjectObject), true); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(49, "Trace", new short[4] + { + 208, + 153, + 153, + 153 + }, 240, new InvokeHandler(CallTraceStringObjectObjectObject), true); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(49, "Trace", new short[5] + { + 208, + 153, + 153, + 153, + 153 + }, 240, new InvokeHandler(CallTraceStringObjectObjectObjectObject), true); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(49, "Trace", new short[6] + { + 208, + 153, + 153, + 153, + 153, + 153 + }, 240, new InvokeHandler(CallTraceStringObjectObjectObjectObjectObject), true); + Type.Initialize(null, null, null, new MethodSchema[6] + { + 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 new file mode 100644 index 0000000..f955388 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DefaultLayoutSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DefaultLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DefaultLayoutSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => DefaultLayout.Instance; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(53, "DefaultLayout", null, 132, typeof(DefaultLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() => Type.Initialize(new DefaultConstructHandler(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 new file mode 100644 index 0000000..3e68041 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DesaturateInstanceSchema.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DesaturateInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DesaturateInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetDesaturate(ref object instanceObj, object valueObj) + { + EffectElementWrapper effectElementWrapper = (EffectElementWrapper)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + effectElementWrapper.SetProperty("Desaturate", num); + } + + private static object CallPlayDesaturateAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Desaturate, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(55, "DesaturateInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(55, "Desaturate", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, null, new SetValueHandler(SetDesaturate), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(55, "PlayDesaturateAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayDesaturateAnimationEffectFloatAnimation), false); + Type.Initialize(null, null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..5fb7ce4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DesaturateSchema.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DesaturateSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DesaturateSchema + { + public static UIXTypeSchema Type; + + private static object GetDesaturate(object instanceObj) => ((DesaturateElement)instanceObj).Desaturate; + + private static void SetDesaturate(ref object instanceObj, object valueObj) + { + DesaturateElement desaturateElement = (DesaturateElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + desaturateElement.Desaturate = num; + } + + private static object Construct() => new DesaturateElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(54, "Desaturate", null, 80, typeof(DesaturateElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(54, "Desaturate", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetDesaturate), new SetValueHandler(SetDesaturate), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..843fb45 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DestinationElementInstanceSchema.cs @@ -0,0 +1,49 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DestinationElementInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DestinationElementInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetDownsample(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Downsample", (float)valueObj); + + private static void SetUVOffset(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("UVOffset", (Vector2)valueObj); + + private static object CallPlayDownsampleAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Downsample, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(57, "DestinationElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(57, "Downsample", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetDownsample), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(57, "UVOffset", 233, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetUVOffset), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(57, "PlayDownsampleAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayDownsampleAnimationEffectFloatAnimation), false); + Type.Initialize(null, null, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..f250233 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DestinationElementSchema.cs @@ -0,0 +1,49 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DestinationElementSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DestinationElementSchema + { + public static UIXTypeSchema Type; + + private static object GetDownsample(object instanceObj) => ((DestinationElement)instanceObj).Downsample; + + private static void SetDownsample(ref object instanceObj, object valueObj) + { + DestinationElement destinationElement = (DestinationElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + destinationElement.Downsample = num; + } + + 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() => new DestinationElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(56, "DestinationElement", null, 77, typeof(DestinationElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(56, "Downsample", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetDownsample), new SetValueHandler(SetDownsample), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(56, "UVOffset", 233, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetUVOffset), new SetValueHandler(SetUVOffset), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..8bc43ef --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DictionarySchema.cs @@ -0,0 +1,84 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DictionarySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DictionarySchema + { + public static UIXTypeSchema Type; + + private static object GetSource(object instanceObj) => (IDictionary)instanceObj; + + private static object Construct() => new Dictionary(); + + private static object Callget_ItemObject(object instanceObj, object[] parameters) + { + IDictionary dictionary = (IDictionary)instanceObj; + object parameter = parameters[0]; + if (parameter != null) + return dictionary[parameter]; + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "key"); + return null; + } + + private static object CallContainsObject(object instanceObj, object[] parameters) + { + IDictionary dictionary = (IDictionary)instanceObj; + object parameter = parameters[0]; + if (parameter != null) + return BooleanBoxes.Box(dictionary.Contains(parameter)); + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "key"); + return false; + } + + private static object Callset_ItemObjectObject(object instanceObj, object[] parameters) + { + IDictionary dictionary = (IDictionary)instanceObj; + object parameter1 = parameters[0]; + object parameter2 = parameters[1]; + if (parameter1 == null) + { + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "key"); + return null; + } + dictionary[parameter1] = parameter2; + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(58, "Dictionary", null, 153, typeof(IDictionary), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(58, "Source", 58, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSource), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(58, "get_Item", new short[1] + { + 153 + }, 153, new InvokeHandler(Callget_ItemObject), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(58, "Contains", new short[1] + { + 153 + }, 15, new InvokeHandler(CallContainsObject), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(58, "set_Item", new short[2] + { + 153, + 153 + }, 240, new InvokeHandler(Callset_ItemObjectObject), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[3] + { + 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 new file mode 100644 index 0000000..cd93981 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DockLayoutInputSchema.cs @@ -0,0 +1,85 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DockLayoutInputSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DockLayoutInputSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => DockLayoutInput.Client; + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str = (string)valueObj; + instanceObj = null; + DockLayoutInput instance = StringToInstance(str); + if (instance == null) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "DockLayoutInput"); + instanceObj = instance; + return Result.Success; + } + + private static object FindCanonicalInstance(string name) => StringToInstance(name); + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static object CallTryParseStringDockLayoutInput(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + DockLayoutInput parameter2 = (DockLayoutInput)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + private static DockLayoutInput StringToInstance(string value) + { + if (value == "Left") + return DockLayoutInput.Left; + if (value == "Top") + return DockLayoutInput.Top; + if (value == "Right") + return DockLayoutInput.Right; + if (value == "Bottom") + return DockLayoutInput.Bottom; + return value == "Client" ? DockLayoutInput.Client : null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(60, "DockLayoutInput", null, 133, typeof(DockLayoutInput), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(60, "TryParse", new short[2] + { + 208, + 60 + }, 60, new InvokeHandler(CallTryParseStringDockLayoutInput), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, null, new MethodSchema[1] + { + uixMethodSchema + }, null, new FindCanonicalInstanceHandler(FindCanonicalInstance), new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/DockLayoutSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DockLayoutSchema.cs new file mode 100644 index 0000000..4f4f0ca --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DockLayoutSchema.cs @@ -0,0 +1,39 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DockLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Layouts; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DockLayoutSchema + { + public static UIXTypeSchema Type; + + 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) => ((DockLayout)instanceObj).DefaultChildAlignment; + + private static void SetDefaultChildAlignment(ref object instanceObj, object valueObj) => ((DockLayout)instanceObj).DefaultChildAlignment = (ItemAlignment)valueObj; + + private static object Construct() => new DockLayout(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(59, "DockLayout", null, 132, typeof(DockLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(59, "DefaultLayoutInput", 60, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDefaultLayoutInput), new SetValueHandler(SetDefaultLayoutInput), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(59, "DefaultChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDefaultChildAlignment), new SetValueHandler(SetDefaultChildAlignment), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..a2195f0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DoubleSchema.cs @@ -0,0 +1,239 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DoubleSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DoubleSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => 0.0; + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + double num = (double)instanceObj; + writer.WriteDouble(num); + } + + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadDouble(); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string s = (string)valueObj; + instanceObj = null; + double 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 = null; + double num = flag ? 1.0 : 0.0; + instanceObj = num; + return Result.Success; + } + + private static Result ConvertFromByte(object valueObj, out object instanceObj) + { + byte num1 = (byte)valueObj; + instanceObj = null; + double num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromInt32(object valueObj, out object instanceObj) + { + int num1 = (int)valueObj; + instanceObj = null; + double num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromInt64(object valueObj, out object instanceObj) + { + long num1 = (long)valueObj; + instanceObj = null; + double num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromSingle(object valueObj, out object instanceObj) + { + float num1 = (float)valueObj; + instanceObj = null; + double num2 = num1; + instanceObj = num2; + return Result.Success; + } + + 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])); + + private static object CallIsNegativeInfinityDouble(object instanceObj, object[] parameters) => BooleanBoxes.Box(double.IsNegativeInfinity((double)parameters[0])); + + private static object CallIsPositiveInfinityDouble(object instanceObj, object[] parameters) => BooleanBoxes.Box(double.IsPositiveInfinity((double)parameters[0])); + + private static bool IsConversionSupported(TypeSchema fromType) => BooleanSchema.Type.IsAssignableFrom(fromType) || ByteSchema.Type.IsAssignableFrom(fromType) || (Int32Schema.Type.IsAssignableFrom(fromType) || Int64Schema.Type.IsAssignableFrom(fromType)) || (SingleSchema.Type.IsAssignableFrom(fromType) || StringSchema.Type.IsAssignableFrom(fromType)); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (BooleanSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromBoolean(from, out instance); + if (!result.Failed) + return result; + } + if (ByteSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromByte(from, out instance); + if (!result.Failed) + return result; + } + if (Int32Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt32(from, out instance); + if (!result.Failed) + return result; + } + if (Int64Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt64(from, out instance); + if (!result.Failed) + return result; + } + if (SingleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSingle(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.MathMultiply: + case OperationType.MathDivide: + case OperationType.MathModulus: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.RelationalLessThan: + case OperationType.RelationalGreaterThan: + case OperationType.RelationalLessThanEquals: + case OperationType.RelationalGreaterThanEquals: + case OperationType.MathNegate: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + double num1 = (double)leftObj; + if (op == OperationType.MathNegate) + return -num1; + double num2 = (double)rightObj; + switch (op - 1) + { + case 0: + return num1 + num2; + case OperationType.MathAdd: + return num1 - num2; + case OperationType.MathSubtract: + return num1 * num2; + case OperationType.MathMultiply: + return num1 / num2; + case OperationType.MathDivide: + return num1 % num2; + case OperationType.LogicalOr: + return BooleanBoxes.Box(num1 == num2); + case OperationType.RelationalEquals: + return BooleanBoxes.Box(num1 != num2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(num1 < num2); + case OperationType.RelationalLessThan: + return BooleanBoxes.Box(num1 > num2); + case OperationType.RelationalGreaterThan: + return BooleanBoxes.Box(num1 <= num2); + case OperationType.RelationalLessThanEquals: + return BooleanBoxes.Box(num1 >= num2); + default: + return null; + } + } + + private static object CallTryParseStringDouble(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + double parameter2 = (double)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(61, "Double", "double", 153, typeof(double), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(61, "ToString", new short[1] + { + 208 + }, 208, new InvokeHandler(CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(61, "IsNaN", new short[1] + { + 61 + }, 15, new InvokeHandler(CallIsNaNDouble), true); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(61, "IsNegativeInfinity", new short[1] + { + 61 + }, 15, new InvokeHandler(CallIsNegativeInfinityDouble), true); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(61, "IsPositiveInfinity", new short[1] + { + 61 + }, 15, new InvokeHandler(CallIsPositiveInfinityDouble), true); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(61, "TryParse", new short[2] + { + 208, + 61 + }, 61, new InvokeHandler(CallTryParseStringDouble), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, null, new MethodSchema[5] + { + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5 + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/DragHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/DragHandlerSchema.cs new file mode 100644 index 0000000..431f527 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DragHandlerSchema.cs @@ -0,0 +1,124 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DragHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DragHandlerSchema + { + public static UIXTypeSchema Type; + + 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) => ((DragHandler)instanceObj).BeginPosition; + + private static object GetEndPosition(object instanceObj) => ((DragHandler)instanceObj).EndPosition; + + private static object GetScreenDragSize(object instanceObj) => ((DragHandler)instanceObj).ScreenDragSize; + + private static object GetLocalDragSize(object instanceObj) => ((DragHandler)instanceObj).LocalDragSize; + + private static object GetRelativeDragSize(object instanceObj) => ((DragHandler)instanceObj).RelativeDragSize; + + private static object GetActiveModifiers(object instanceObj) => ((DragHandler)instanceObj).ActiveModifiers; + + private static object GetDragCursor(object instanceObj) => ((DragHandler)instanceObj).DragCursor; + + private static void SetDragCursor(ref object instanceObj, object valueObj) => ((DragHandler)instanceObj).DragCursor = (CursorID)valueObj; + + private static object GetCancelOnEscape(object instanceObj) => BooleanBoxes.Box(((DragHandler)instanceObj).CancelOnEscape); + + private static void SetCancelOnEscape(ref object instanceObj, object valueObj) => ((DragHandler)instanceObj).CancelOnEscape = (bool)valueObj; + + 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) => ((InputHandler)instanceObj).HandlerStage; + + private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; + + private static object Construct() => new DragHandler(); + + private static object CallResetDragOrigin(object instanceObj, object[] parameters) + { + ((DragHandler)instanceObj).ResetDragOrigin(); + return null; + } + + private static object CallCancelDrag(object instanceObj, object[] parameters) + { + ((DragHandler)instanceObj).CancelDrag(); + return null; + } + + private static object CallGetEventContexts(object instanceObj, object[] parameters) => ((DragHandler)instanceObj).GetEventContexts(); + + private static object CallGetAddedEventContexts(object instanceObj, object[] parameters) => ((DragHandler)instanceObj).GetAddedEventContexts(); + + private static object CallGetRemovedEventContexts(object instanceObj, object[] parameters) => ((DragHandler)instanceObj).GetRemovedEventContexts(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(62, "DragHandler", null, 110, typeof(DragHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(62, "BeginDragPolicy", 12, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetBeginDragPolicy), new SetValueHandler(SetBeginDragPolicy), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(62, "Dragging", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDragging), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(62, "BeginPosition", 233, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetBeginPosition), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(62, "EndPosition", 233, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEndPosition), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(62, "ScreenDragSize", 195, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetScreenDragSize), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(62, "LocalDragSize", 233, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLocalDragSize), null, false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(62, "RelativeDragSize", 233, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRelativeDragSize), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(62, "ActiveModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetActiveModifiers), null, false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(62, "DragCursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDragCursor), new SetValueHandler(SetDragCursor), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(62, "CancelOnEscape", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCancelOnEscape), new SetValueHandler(SetCancelOnEscape), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(62, "RelativeTo", 239, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRelativeTo), new SetValueHandler(SetRelativeTo), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(62, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(62, "ResetDragOrigin", null, 240, new InvokeHandler(CallResetDragOrigin), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(62, "CancelDrag", null, 240, new InvokeHandler(CallCancelDrag), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(62, "GetEventContexts", null, 138, new InvokeHandler(CallGetEventContexts), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(62, "GetAddedEventContexts", null, 138, new InvokeHandler(CallGetAddedEventContexts), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(62, "GetRemovedEventContexts", null, 138, new InvokeHandler(CallGetRemovedEventContexts), false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(62, "Started"); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(62, "Canceled"); + UIXEventSchema uixEventSchema3 = new UIXEventSchema(62, "Ended"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[12] + { + uixPropertySchema8, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema10, + uixPropertySchema9, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema12, + uixPropertySchema6, + uixPropertySchema7, + uixPropertySchema11, + uixPropertySchema5 + }, new MethodSchema[5] + { + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5 + }, new EventSchema[3] + { + 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 new file mode 100644 index 0000000..9e6678f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DragSourceHandlerSchema.cs @@ -0,0 +1,82 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DragSourceHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DragSourceHandlerSchema + { + public static UIXTypeSchema Type; + + 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) => ((DragSourceHandler)instanceObj).CurrentDropAction; + + private static object GetValue(object instanceObj) => ((DragSourceHandler)instanceObj).Value; + + private static void SetValue(ref object instanceObj, object valueObj) => ((DragSourceHandler)instanceObj).Value = valueObj; + + private static object GetDragging(object instanceObj) => BooleanBoxes.Box(((DragSourceHandler)instanceObj).Dragging); + + 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) => ((DragSourceHandler)instanceObj).MoveCursor; + + private static void SetMoveCursor(ref object instanceObj, object valueObj) => ((DragSourceHandler)instanceObj).MoveCursor = (CursorID)valueObj; + + 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) => ((DragSourceHandler)instanceObj).CancelCursor; + + private static void SetCancelCursor(ref object instanceObj, object valueObj) => ((DragSourceHandler)instanceObj).CancelCursor = (CursorID)valueObj; + + private static object Construct() => new DragSourceHandler(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(63, "DragSourceHandler", null, 110, typeof(DragSourceHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(63, "AllowedDropActions", 64, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAllowedDropActions), new SetValueHandler(SetAllowedDropActions), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(63, "CurrentDropAction", 64, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCurrentDropAction), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(63, "Value", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(63, "Dragging", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDragging), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(63, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(63, "MoveCursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMoveCursor), new SetValueHandler(SetMoveCursor), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(63, "CopyCursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCopyCursor), new SetValueHandler(SetCopyCursor), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(63, "CancelCursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCancelCursor), new SetValueHandler(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"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[8] + { + uixPropertySchema1, + uixPropertySchema8, + uixPropertySchema7, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema3 + }, null, new EventSchema[4] + { + 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 new file mode 100644 index 0000000..5a32280 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/DropTargetHandlerSchema.cs @@ -0,0 +1,63 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.DropTargetHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class DropTargetHandlerSchema + { + public static UIXTypeSchema Type; + + 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) => ((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() => new DropTargetHandler(); + + private static object CallGetValue(object instanceObj, object[] parameters) => ((DropTargetHandler)instanceObj).GetValue(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(65, "DropTargetHandler", null, 110, typeof(DropTargetHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(65, "AllowedDropActions", 64, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAllowedDropActions), new SetValueHandler(SetAllowedDropActions), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(65, "Dragging", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDragging), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(65, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(65, "EventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(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(CallGetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[4] + { + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema3 + }, new MethodSchema[1] + { + uixMethodSchema + }, new EventSchema[4] + { + 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 new file mode 100644 index 0000000..4e08c84 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionInstanceSchema.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EdgeDetectionInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EdgeDetectionInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetEdgeLimit(ref object instanceObj, object valueObj) + { + EffectElementWrapper effectElementWrapper = (EffectElementWrapper)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + effectElementWrapper.SetProperty("EdgeLimit", num); + } + + private static object CallPlayEdgeLimitAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.EdgeLimit, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(67, "EdgeDetectionInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(67, "EdgeLimit", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, null, new SetValueHandler(SetEdgeLimit), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(67, "PlayEdgeLimitAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayEdgeLimitAnimationEffectFloatAnimation), false); + Type.Initialize(null, null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..f3a2ae7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EdgeDetectionSchema.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EdgeDetectionSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EdgeDetectionSchema + { + public static UIXTypeSchema Type; + + private static object GetEdgeLimit(object instanceObj) => ((EdgeDetectionElement)instanceObj).EdgeLimit; + + private static void SetEdgeLimit(ref object instanceObj, object valueObj) + { + EdgeDetectionElement detectionElement = (EdgeDetectionElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + detectionElement.EdgeLimit = num; + } + + private static object Construct() => new EdgeDetectionElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(66, "EdgeDetection", null, 80, typeof(EdgeDetectionElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(66, "EdgeLimit", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetEdgeLimit), new SetValueHandler(SetEdgeLimit), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..0fd76c7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EditableTextDataSchema.cs @@ -0,0 +1,66 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EditableTextDataSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EditableTextDataSchema + { + public static UIXTypeSchema Type; + + 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) => ((EditableTextData)instanceObj).MaxLength; + + private static void SetMaxLength(ref object instanceObj, object valueObj) + { + EditableTextData editableTextData = (EditableTextData)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + editableTextData.MaxLength = num; + } + + private static object GetReadOnly(object instanceObj) => BooleanBoxes.Box(((EditableTextData)instanceObj).ReadOnly); + + private static void SetReadOnly(ref object instanceObj, object valueObj) => ((EditableTextData)instanceObj).ReadOnly = (bool)valueObj; + + private static object Construct() => new EditableTextData(); + + private static object CallSubmit(object instanceObj, object[] parameters) + { + ((EditableTextData)instanceObj).Submit(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(68, "EditableTextData", null, 153, typeof(EditableTextData), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(68, "Value", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(68, "MaxLength", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetMaxLength), new SetValueHandler(SetMaxLength), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(68, "ReadOnly", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetReadOnly), new SetValueHandler(SetReadOnly), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(68, "Submitted"); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(68, "Submit", null, 240, new InvokeHandler(CallSubmit), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..9508233 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectAnimationSchema.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectAnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectAnimationSchema + { + public static UIXTypeSchema Type; + + 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() => Type = new UIXTypeSchema(70, "EffectAnimation", null, 153, typeof(EffectAnimation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(70, "Loop", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetLoop), new SetValueHandler(SetLoop), false); + Type.Initialize(null, null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..9dbed85 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectColorAnimationSchema.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectColorAnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectColorAnimationSchema + { + public static UIXTypeSchema Type; + + private static object GetKeyframes(object instanceObj) => ((AnimationTemplate)instanceObj).Keyframes; + + private static object Construct() => new EffectAnimation(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(71, "EffectColorAnimation", null, 70, typeof(EffectAnimation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(71, "Keyframes", 138, 72, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetKeyframes), null, false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..47c83f1 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectColorKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectColorKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectColorKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new EffectColorKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(72, "EffectColorKeyframe", null, 130, typeof(EffectColorKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(72, "Value", 35, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..2bec999 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectElementInstanceSchema.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectElementInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectElementInstanceSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(74, "EffectElementInstance", null, -1, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..cbef407 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectElementSchema.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectElementSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectElementSchema + { + public static UIXTypeSchema Type; + + 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() => Type = new UIXTypeSchema(73, "EffectElement", null, -1, typeof(EffectElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(73, "Name", 208, -1, ExpressionRestriction.ReadOnly, false, null, false, new GetValueHandler(GetName), new SetValueHandler(SetName), false); + Type.Initialize(null, null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..e3d6895 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectFloatAnimationSchema.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectFloatAnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectFloatAnimationSchema + { + public static UIXTypeSchema Type; + + private static object GetKeyframes(object instanceObj) => ((AnimationTemplate)instanceObj).Keyframes; + + private static object Construct() => new EffectAnimation(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(75, "EffectFloatAnimation", null, 70, typeof(EffectAnimation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(75, "Keyframes", 138, 76, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetKeyframes), null, false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..64e4197 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectFloatKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectFloatKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectFloatKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new EffectFloatKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(76, "EffectFloatKeyframe", null, 130, typeof(EffectFloatKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(76, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..7cfe101 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectInputSchema.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectInputSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectInputSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(77, "EffectInput", null, 73, typeof(EffectInput), UIXTypeFlags.None); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..0941013 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectInstanceSchema.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectInstanceSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(78, "EffectInstance", null, 153, typeof(EffectClass), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..3718b04 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectLayerSchema.cs @@ -0,0 +1,39 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectLayerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectLayerSchema + { + public static UIXTypeSchema Type; + + 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) => ((EffectLayer)instanceObj).Operations; + + private static void SetOperations(ref object instanceObj, object valueObj) => ((EffectLayer)instanceObj).Operations = (IList)valueObj; + + private static object Construct() => new EffectLayer(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(79, "EffectLayer", null, 77, typeof(EffectLayer), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(79, "Input", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetInput), new SetValueHandler(SetInput), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(79, "Operations", 138, 80, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetOperations), new SetValueHandler(SetOperations), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..5b73b2b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectOperationSchema.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectOperationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectOperationSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(80, "EffectOperation", null, 73, typeof(EffectOperation), UIXTypeFlags.None); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..662e033 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectSchema.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectSchema + { + public static UIXTypeSchema Type; + + private static object GetTechniques(object instanceObj) => (object)null; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(69, "Effect", null, 29, typeof(EffectClass), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(69, "Techniques", 138, 77, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetTechniques), null, false); + Type.Initialize(null, null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..eac3b52 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectVector3AnimationSchema.cs @@ -0,0 +1,30 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectVector3AnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectVector3AnimationSchema + { + public static UIXTypeSchema Type; + + private static object GetKeyframes(object instanceObj) => ((AnimationTemplate)instanceObj).Keyframes; + + private static object Construct() => new EffectAnimation(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(81, "EffectVector3Animation", null, 70, typeof(EffectAnimation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(81, "Keyframes", 138, 82, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetKeyframes), null, false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..ffa8a0c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EffectVector3KeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EffectVector3KeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EffectVector3KeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new EffectVector3Keyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(82, "EffectVector3Keyframe", null, 130, typeof(EffectVector3Keyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(82, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..6c28ee4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EmbossInstanceSchema.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EmbossInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EmbossInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetDirection(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Direction", (int)valueObj); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(85, "EmbossInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(85, "Direction", 84, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetDirection), false); + Type.Initialize(null, null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..6777a99 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EmbossSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EmbossSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EmbossSchema + { + public static UIXTypeSchema Type; + + 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() => new EmbossElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(83, "Emboss", null, 80, typeof(EmbossElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(83, "Direction", 84, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDirection), new SetValueHandler(SetDirection), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..ab64c80 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EnumeratorSchema.cs @@ -0,0 +1,42 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EnumeratorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EnumeratorSchema + { + public static UIXTypeSchema Type; + + private static object GetCurrent(object instanceObj) => ((IEnumerator)instanceObj).Current; + + private static object CallMoveNext(object instanceObj, object[] parameters) => BooleanBoxes.Box(((IEnumerator)instanceObj).MoveNext()); + + private static object CallReset(object instanceObj, object[] parameters) + { + ((IEnumerator)instanceObj).Reset(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(86, "Enumerator", null, 153, typeof(IEnumerator), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(86, "Current", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCurrent), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(86, "MoveNext", null, 15, new InvokeHandler(CallMoveNext), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(86, "Reset", null, 240, new InvokeHandler(CallReset), false); + Type.Initialize(null, null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[2] + { + 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 new file mode 100644 index 0000000..75e5fff --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EnvironmentSchema.cs @@ -0,0 +1,86 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EnvironmentSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EnvironmentSchema + { + public static UIXTypeSchema Type; + + private static object GetIsRightToLeft(object instanceObj) => BooleanBoxes.Box(((Environment)instanceObj).IsRightToLeft); + + private static object GetColorScheme(object instanceObj) => ((Environment)instanceObj).ColorScheme; + + 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) => ((Environment)instanceObj).AnimationUpdatesPerSecond; + + private static void SetAnimationUpdatesPerSecond(ref object instanceObj, object valueObj) => ((Environment)instanceObj).AnimationUpdatesPerSecond = (int)valueObj; + + private static object GetDpiScale(object instanceObj) => Environment.DpiScale; + + private static object GetGraphicsDeviceType(object instanceObj) + { + RenderingType renderingType; + switch (UISession.Default.RenderSession.GraphicsDevice.DeviceType) + { + case GraphicsDeviceType.Gdi: + renderingType = RenderingType.GDI; + break; + case GraphicsDeviceType.Direct3D9: + case GraphicsDeviceType.XeDirectX9: + renderingType = RenderingType.DX9; + break; + default: + renderingType = RenderingType.Default; + break; + } + return renderingType; + } + + private static object Construct() => Environment.Instance; + + private static object CallAnimationAdvanceInt32(object instanceObj, object[] parameters) + { + ((Environment)instanceObj).AnimationAdvance((int)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(87, "Environment", null, 153, typeof(Environment), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(87, "IsRightToLeft", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetIsRightToLeft), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(87, "ColorScheme", 39, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetColorScheme), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(87, "AnimationSpeed", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAnimationSpeed), new SetValueHandler(SetAnimationSpeed), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(87, "AnimationUpdatesPerSecond", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAnimationUpdatesPerSecond), new SetValueHandler(SetAnimationUpdatesPerSecond), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(87, "DpiScale", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDpiScale), null, true); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(87, "GraphicsDeviceType", 98, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetGraphicsDeviceType), null, true); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(87, "AnimationAdvance", new short[1] + { + 115 + }, 240, new InvokeHandler(CallAnimationAdvanceInt32), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema2, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema1 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..2f75e9b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/EventContextSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.EventContextSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class EventContextSchema + { + public static UIXTypeSchema Type; + + private static object GetValue(object instanceObj) => ((EventContext)instanceObj).Value; + + private static void SetValue(ref object instanceObj, object valueObj) => ((EventContext)instanceObj).Value = valueObj; + + private static object Construct() => new EventContext(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(88, "EventContext", null, 110, typeof(EventContext), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(88, "Value", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..12a8dad --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/FlowLayoutSchema.cs @@ -0,0 +1,82 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.FlowLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class FlowLayoutSchema + { + public static UIXTypeSchema Type; + + 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) => ((FlowLayout)instanceObj).Spacing; + + private static void SetSpacing(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).Spacing = (MajorMinor)valueObj; + + private static object GetAllowWrap(object instanceObj) => BooleanBoxes.Box(((FlowLayout)instanceObj).AllowWrap); + + private static void SetAllowWrap(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).AllowWrap = (bool)valueObj; + + 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) => ((FlowLayout)instanceObj).Repeat; + + private static void SetRepeat(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).Repeat = (RepeatPolicy)valueObj; + + 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) => ((FlowLayout)instanceObj).MissingItemPolicy; + + private static void SetMissingItemPolicy(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).MissingItemPolicy = (MissingItemPolicy)valueObj; + + 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) => ((FlowLayout)instanceObj).DefaultChildAlignment; + + private static void SetDefaultChildAlignment(ref object instanceObj, object valueObj) => ((FlowLayout)instanceObj).DefaultChildAlignment = (ItemAlignment)valueObj; + + private static object Construct() => new FlowLayout(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(90, "FlowLayout", null, 132, typeof(FlowLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(90, "Orientation", 154, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetOrientation), new SetValueHandler(SetOrientation), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(90, "Spacing", 139, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSpacing), new SetValueHandler(SetSpacing), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(90, "AllowWrap", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAllowWrap), new SetValueHandler(SetAllowWrap), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(90, "StripAlignment", 209, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetStripAlignment), new SetValueHandler(SetStripAlignment), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(90, "Repeat", 172, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRepeat), new SetValueHandler(SetRepeat), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(90, "RepeatGap", 139, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRepeatGap), new SetValueHandler(SetRepeatGap), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(90, "MissingItemPolicy", 148, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMissingItemPolicy), new SetValueHandler(SetMissingItemPolicy), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(90, "MinimumSampleSize", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMinimumSampleSize), new SetValueHandler(SetMinimumSampleSize), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(90, "DefaultChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDefaultChildAlignment), new SetValueHandler(SetDefaultChildAlignment), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[9] + { + 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 new file mode 100644 index 0000000..2390552 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/FocusHandlerSchema.cs @@ -0,0 +1,65 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.FocusHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class FocusHandlerSchema + { + public static UIXTypeSchema Type; + + 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) => ((ModifierInputHandler)instanceObj).RequiredModifiers; + + private static void SetRequiredModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).RequiredModifiers = (InputHandlerModifiers)valueObj; + + 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) => ((InputHandler)instanceObj).HandlerStage; + + private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; + + private static object GetGainedEventContext(object instanceObj) => ((FocusHandler)instanceObj).GainedEventContext; + + private static object GetLostEventContext(object instanceObj) => ((FocusHandler)instanceObj).LostEventContext; + + private static object Construct() => new FocusHandler(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(92, "FocusHandler", null, 110, typeof(FocusHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(92, "Reason", 91, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetReason), new SetValueHandler(SetReason), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(92, "RequiredModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRequiredModifiers), new SetValueHandler(SetRequiredModifiers), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(92, "DisallowedModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDisallowedModifiers), new SetValueHandler(SetDisallowedModifiers), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(92, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(92, "GainedEventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetGainedEventContext), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(92, "LostEventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLostEventContext), null, false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(92, "GainedFocus"); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(92, "LostFocus"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + uixPropertySchema3, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema1, + uixPropertySchema2 + }, null, new EventSchema[2] + { + 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 new file mode 100644 index 0000000..54180a0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/FontSchema.cs @@ -0,0 +1,337 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.FontSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.OS; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class FontSchema + { + public static RangeValidator ValidateFontName = new RangeValidator(RangeValidateFontName); + public static UIXTypeSchema Type; + + private static object GetFontName(object instanceObj) => ((Font)instanceObj).FontName; + + private static void SetFontName(ref object instanceObj, object valueObj) + { + Font font = (Font)instanceObj; + string str = (string)valueObj; + Result result = ValidateFontName(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + font.FontName = str; + } + + private static object GetFontSize(object instanceObj) => ((Font)instanceObj).FontSize; + + private static void SetFontSize(ref object instanceObj, object valueObj) + { + Font font = (Font)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + font.FontSize = num; + } + + private static object GetAltFontSize(object instanceObj) => ((Font)instanceObj).AltFontSize; + + private static void SetAltFontSize(ref object instanceObj, object valueObj) + { + Font font = (Font)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + font.AltFontSize = num; + } + + 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() => new Font(); + + private static object ConstructFontName(object[] parameters) + { + object instanceObj = Construct(); + SetFontName(ref instanceObj, parameters[0]); + return instanceObj; + } + + private static Result ConvertFromStringFontName(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj; + Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, ValidateFontName, out valueObj); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result.Error); + SetFontName(ref instance, valueObj); + return result; + } + + private static object ConstructFontNameFontSize(object[] parameters) + { + object instanceObj = Construct(); + SetFontName(ref instanceObj, parameters[0]); + SetFontSize(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringFontNameFontSize( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, ValidateFontName, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result1.Error); + SetFontName(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result2.Error); + SetFontSize(ref instance, valueObj2); + return result2; + } + + private static object ConstructFontNameFontSizeAltFontSize(object[] parameters) + { + object instanceObj = Construct(); + SetFontName(ref instanceObj, parameters[0]); + SetFontSize(ref instanceObj, parameters[1]); + SetAltFontSize(ref instanceObj, parameters[2]); + return instanceObj; + } + + private static Result ConvertFromStringFontNameFontSizeAltFontSize( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, ValidateFontName, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result1.Error); + SetFontName(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result2.Error); + SetFontSize(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result3.Error); + SetAltFontSize(ref instance, valueObj3); + return result3; + } + + private static object ConstructFontNameFontSizeFontStyle(object[] parameters) + { + object instanceObj = Construct(); + SetFontName(ref instanceObj, parameters[0]); + SetFontSize(ref instanceObj, parameters[1]); + SetFontStyle(ref instanceObj, parameters[2]); + return instanceObj; + } + + private static Result ConvertFromStringFontNameFontSizeFontStyle( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, ValidateFontName, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result1.Error); + SetFontName(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result2.Error); + SetFontSize(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], UIXLoadResultExports.FontStylesType, null, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result3.Error); + SetFontStyle(ref instance, valueObj3); + return result3; + } + + private static object ConstructFontNameFontSizeAltFontSizeFontStyle(object[] parameters) + { + object instanceObj = Construct(); + SetFontName(ref instanceObj, parameters[0]); + SetFontSize(ref instanceObj, parameters[1]); + SetAltFontSize(ref instanceObj, parameters[2]); + SetFontStyle(ref instanceObj, parameters[3]); + return instanceObj; + } + + private static Result ConvertFromStringFontNameFontSizeAltFontSizeFontStyle( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, ValidateFontName, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result1.Error); + SetFontName(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result2.Error); + SetFontSize(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result3.Error); + SetAltFontSize(ref instance, valueObj3); + object valueObj4; + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], UIXLoadResultExports.FontStylesType, null, out valueObj4); + if (result4.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Font", result4.Error); + SetFontStyle(ref instance, valueObj4); + return result4; + } + + private static object CallLoadFontResourceStringString(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + string parameter2 = (string)parameters[1]; + if (string.IsNullOrEmpty(parameter1)) + 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}'", "resourceName"); + if (!NativeApi.SpLoadFontResource(parameter1, parameter2)) + ErrorManager.ReportError("Font Resource {1} not found in module {0}", parameter1, parameter2); + return null; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result1 = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + switch (splitString.Length) + { + case 1: + result1 = ConvertFromStringFontName(splitString, out instance); + if (!result1.Failed) + return result1; + break; + case 2: + result1 = ConvertFromStringFontNameFontSize(splitString, out instance); + if (!result1.Failed) + return result1; + break; + case 3: + Result result2 = ConvertFromStringFontNameFontSizeAltFontSize(splitString, out instance); + if (!result2.Failed) + return result2; + result1 = ConvertFromStringFontNameFontSizeFontStyle(splitString, out instance); + if (!result1.Failed) + return result1; + break; + case 4: + result1 = ConvertFromStringFontNameFontSizeAltFontSizeFontStyle(splitString, out instance); + if (!result1.Failed) + return result1; + break; + default: + result1 = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Font"); + break; + } + } + return result1; + } + + private static Result RangeValidateFontName(object value) + { + string str = (string)value; + if (str == null) + 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() => Type = new UIXTypeSchema(93, "Font", null, 153, typeof(Font), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(93, "FontName", 208, -1, ExpressionRestriction.None, false, ValidateFontName, false, new GetValueHandler(GetFontName), new SetValueHandler(SetFontName), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(93, "FontSize", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetFontSize), new SetValueHandler(SetFontSize), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(93, "AltFontSize", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetAltFontSize), new SetValueHandler(SetAltFontSize), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(93, "FontStyle", 94, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetFontStyle), new SetValueHandler(SetFontStyle), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(93, new short[1] + { + 208 + }, new ConstructHandler(ConstructFontName)); + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(93, new short[2] + { + 208, + 194 + }, new ConstructHandler(ConstructFontNameFontSize)); + UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema(93, new short[3] + { + 208, + 194, + 194 + }, new ConstructHandler(ConstructFontNameFontSizeAltFontSize)); + UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema(93, new short[3] + { + 208, + 194, + 94 + }, new ConstructHandler(ConstructFontNameFontSizeFontStyle)); + UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema(93, new short[4] + { + 208, + 194, + 194, + 94 + }, new ConstructHandler(ConstructFontNameFontSizeAltFontSizeFontStyle)); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(93, "LoadFontResource", new short[2] + { + 208, + 208 + }, 240, new InvokeHandler(CallLoadFontResourceStringString), true); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[5] + { + constructorSchema1, + constructorSchema2, + constructorSchema3, + constructorSchema4, + constructorSchema5 + }, new PropertySchema[4] + { + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema4 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/FormLayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/FormLayoutInputSchema.cs new file mode 100644 index 0000000..3eedd35 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/FormLayoutInputSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.FormLayoutInputSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class FormLayoutInputSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => new FormLayoutInput(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(95, "FormLayoutInput", null, 8, typeof(FormLayoutInput), UIXTypeFlags.None); + + public static void Pass2Initialize() => Type.Initialize(new DefaultConstructHandler(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 new file mode 100644 index 0000000..88f856b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/GraphicSchema.cs @@ -0,0 +1,97 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.GraphicSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Layouts; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class GraphicSchema + { + public static UIXTypeSchema Type; + + private static object GetChildren(object instanceObj) => ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); + + 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) => ((Graphic)instanceObj).PreloadContent; + + private static void SetPreloadContent(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).PreloadContent = (UIImage)valueObj; + + 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) => ((Graphic)instanceObj).AcquiringImage; + + private static void SetAcquiringImage(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).AcquiringImage = (UIImage)valueObj; + + 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) => ((Graphic)instanceObj).SizingPolicy; + + private static void SetSizingPolicy(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).SizingPolicy = (SizingPolicy)valueObj; + + 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) => ((Graphic)instanceObj).HorizontalAlignment; + + private static void SetHorizontalAlignment(ref object instanceObj, object valueObj) => ((Graphic)instanceObj).HorizontalAlignment = (StripAlignment)valueObj; + + 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() => new Graphic(); + + private static object CallCommitPreload(object instanceObj, object[] parameters) + { + ((Graphic)instanceObj).CommitPreload(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(97, "Graphic", null, 239, typeof(Graphic), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(97, "Children", 138, 239, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetChildren), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(97, "Content", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetContent), new SetValueHandler(SetContent), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(97, "PreloadContent", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPreloadContent), new SetValueHandler(SetPreloadContent), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(97, "Effect", 78, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEffect), new SetValueHandler(SetEffect), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(97, "AcquiringImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAcquiringImage), new SetValueHandler(SetAcquiringImage), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(97, "ErrorImage", 105, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetErrorImage), new SetValueHandler(SetErrorImage), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(97, "SizingPolicy", 199, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSizingPolicy), new SetValueHandler(SetSizingPolicy), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(97, "StretchingPolicy", 207, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStretchingPolicy), new SetValueHandler(SetStretchingPolicy), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(97, "HorizontalAlignment", 209, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHorizontalAlignment), new SetValueHandler(SetHorizontalAlignment), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(97, "VerticalAlignment", 209, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetVerticalAlignment), new SetValueHandler(SetVerticalAlignment), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(97, "CommitPreload", null, 240, new InvokeHandler(CallCommitPreload), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[10] + { + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema9, + uixPropertySchema3, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema10 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..c1f1f05 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/GridLayoutSchema.cs @@ -0,0 +1,102 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.GridLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class GridLayoutSchema + { + public static UIXTypeSchema Type; + + private static object GetOrientation(object instanceObj) => ((GridLayout)instanceObj).Orientation; + + private static void SetOrientation(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).Orientation = (Orientation)valueObj; + + private static object GetAllowWrap(object instanceObj) => BooleanBoxes.Box(((GridLayout)instanceObj).AllowWrap); + + private static void SetAllowWrap(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).AllowWrap = (bool)valueObj; + + 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) => ((GridLayout)instanceObj).Spacing; + + private static void SetSpacing(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).Spacing = (Size)valueObj; + + private static object GetRows(object instanceObj) => ((GridLayout)instanceObj).Rows; + + private static void SetRows(ref object instanceObj, object valueObj) + { + GridLayout gridLayout = (GridLayout)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + gridLayout.Rows = num; + } + + private static object GetColumns(object instanceObj) => ((GridLayout)instanceObj).Columns; + + private static void SetColumns(ref object instanceObj, object valueObj) + { + GridLayout gridLayout = (GridLayout)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + gridLayout.Columns = num; + } + + 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) => ((GridLayout)instanceObj).RepeatGap; + + private static void SetRepeatGap(ref object instanceObj, object valueObj) => ((GridLayout)instanceObj).RepeatGap = (int)valueObj; + + 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() => new GridLayout(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(99, "GridLayout", null, 132, typeof(GridLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(99, "Orientation", 154, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetOrientation), new SetValueHandler(SetOrientation), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(99, "AllowWrap", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAllowWrap), new SetValueHandler(SetAllowWrap), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(99, "ReferenceSize", 195, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetReferenceSize), new SetValueHandler(SetReferenceSize), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(99, "Spacing", 195, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSpacing), new SetValueHandler(SetSpacing), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(99, "Rows", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(GetRows), new SetValueHandler(SetRows), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(99, "Columns", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(GetColumns), new SetValueHandler(SetColumns), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(99, "Repeat", 172, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRepeat), new SetValueHandler(SetRepeat), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(99, "RepeatGap", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRepeatGap), new SetValueHandler(SetRepeatGap), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(99, "DefaultChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDefaultChildAlignment), new SetValueHandler(SetDefaultChildAlignment), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[9] + { + 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 new file mode 100644 index 0000000..0405411 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/GroupSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.GroupSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class GroupSchema + { + public static UIXTypeSchema Type; + + private static object GetStartIndex(object instanceObj) => ((IUIGroup)instanceObj).StartIndex; + + private static object GetEndIndex(object instanceObj) => ((IUIGroup)instanceObj).EndIndex; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(100, "Group", null, 138, typeof(IUIGroup), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(100, "StartIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStartIndex), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(100, "EndIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEndIndex), null, false); + Type.Initialize(null, null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..1ce28df --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/HostSchema.cs @@ -0,0 +1,461 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.HostSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class HostSchema + { + private static object[] s_paramsList = new object[10]; + public static UIXTypeSchema Type; + + private static object GetNewContentOnTop(object instanceObj) => BooleanBoxes.Box(((Host)instanceObj).NewContentOnTop); + + private static void SetNewContentOnTop(ref object instanceObj, object valueObj) => ((Host)instanceObj).NewContentOnTop = (bool)valueObj; + + private static object GetSource(object instanceObj) => ((Host)instanceObj).Source; + + private static object GetSourceType(object instanceObj) => ((Host)instanceObj).SourceType; + + private static object GetStatus(object instanceObj) => ((Host)instanceObj).Status; + + private static object GetInputEnabled(object instanceObj) => BooleanBoxes.Box(((Host)instanceObj).InputEnabled); + + private static void SetInputEnabled(ref object instanceObj, object valueObj) => ((Host)instanceObj).InputEnabled = (bool)valueObj; + + private static object GetUnloadable(object instanceObj) => BooleanBoxes.Box(((Host)instanceObj).Unloadable); + + private static void SetUnloadable(ref object instanceObj, object valueObj) => ((Host)instanceObj).Unloadable = (bool)valueObj; + + private static object Construct() => new Host(); + + private static object CallUnloadAll(object instanceObj, object[] parameters) + { + ((Host)instanceObj).UnloadAll(); + return null; + } + + private static object CallForceRefresh(object instanceObj, object[] parameters) + { + ((Host)instanceObj).ForceRefresh(); + return null; + } + + private static object CallForceRefreshBoolean(object instanceObj, object[] parameters) + { + ((Host)instanceObj).ForceRefresh((bool)parameters[0]); + return null; + } + + private static object CallRequestSourceString(object instanceObj, object[] parameters) + { + ((Host)instanceObj).RequestSource((string)parameters[0], null, null); + return null; + } + + private static object CallRequestSourceStringStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + string parameter1 = (string)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + RequestSourceCallBuilder(instance, parameter1, null, 1); + return null; + } + + private static object CallRequestSourceStringStringObjectStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + string parameter1 = (string)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + string parameter4 = (string)parameters[3]; + object parameter5 = parameters[4]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + s_paramsList[2] = parameter4; + s_paramsList[3] = parameter5; + RequestSourceCallBuilder(instance, parameter1, null, 2); + return null; + } + + private static object CallRequestSourceStringStringObjectStringObjectStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + string parameter1 = (string)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + string parameter4 = (string)parameters[3]; + object parameter5 = parameters[4]; + string parameter6 = (string)parameters[5]; + object parameter7 = parameters[6]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + s_paramsList[2] = parameter4; + s_paramsList[3] = parameter5; + s_paramsList[4] = parameter6; + s_paramsList[5] = parameter7; + RequestSourceCallBuilder(instance, parameter1, null, 3); + return null; + } + + private static object CallRequestSourceStringStringObjectStringObjectStringObjectStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + string parameter1 = (string)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + string parameter4 = (string)parameters[3]; + object parameter5 = parameters[4]; + string parameter6 = (string)parameters[5]; + object parameter7 = parameters[6]; + string parameter8 = (string)parameters[7]; + object parameter9 = parameters[8]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + s_paramsList[2] = parameter4; + s_paramsList[3] = parameter5; + s_paramsList[4] = parameter6; + s_paramsList[5] = parameter7; + s_paramsList[6] = parameter8; + s_paramsList[7] = parameter9; + RequestSourceCallBuilder(instance, parameter1, null, 4); + return null; + } + + private static object CallRequestSourceStringStringObjectStringObjectStringObjectStringObjectStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + string parameter1 = (string)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + string parameter4 = (string)parameters[3]; + object parameter5 = parameters[4]; + string parameter6 = (string)parameters[5]; + object parameter7 = parameters[6]; + string parameter8 = (string)parameters[7]; + object parameter9 = parameters[8]; + string parameter10 = (string)parameters[9]; + object parameter11 = parameters[10]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + s_paramsList[2] = parameter4; + s_paramsList[3] = parameter5; + s_paramsList[4] = parameter6; + s_paramsList[5] = parameter7; + s_paramsList[6] = parameter8; + s_paramsList[7] = parameter9; + s_paramsList[8] = parameter10; + s_paramsList[9] = parameter11; + RequestSourceCallBuilder(instance, parameter1, null, 5); + return null; + } + + private static object CallRequestSourceType(object instanceObj, object[] parameters) + { + ((Host)instanceObj).RequestSource(null, (TypeSchema)parameters[0], null); + return null; + } + + private static object CallRequestSourceTypeStringObject(object instanceObj, object[] parameters) + { + Host instance = (Host)instanceObj; + TypeSchema parameter1 = (TypeSchema)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + RequestSourceCallBuilder(instance, null, parameter1, 1); + return null; + } + + private static object CallRequestSourceTypeStringObjectStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + TypeSchema parameter1 = (TypeSchema)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + string parameter4 = (string)parameters[3]; + object parameter5 = parameters[4]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + s_paramsList[2] = parameter4; + s_paramsList[3] = parameter5; + RequestSourceCallBuilder(instance, null, parameter1, 2); + return null; + } + + private static object CallRequestSourceTypeStringObjectStringObjectStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + TypeSchema parameter1 = (TypeSchema)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + string parameter4 = (string)parameters[3]; + object parameter5 = parameters[4]; + string parameter6 = (string)parameters[5]; + object parameter7 = parameters[6]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + s_paramsList[2] = parameter4; + s_paramsList[3] = parameter5; + s_paramsList[4] = parameter6; + s_paramsList[5] = parameter7; + RequestSourceCallBuilder(instance, null, parameter1, 3); + return null; + } + + private static object CallRequestSourceTypeStringObjectStringObjectStringObjectStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + TypeSchema parameter1 = (TypeSchema)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + string parameter4 = (string)parameters[3]; + object parameter5 = parameters[4]; + string parameter6 = (string)parameters[5]; + object parameter7 = parameters[6]; + string parameter8 = (string)parameters[7]; + object parameter9 = parameters[8]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + s_paramsList[2] = parameter4; + s_paramsList[3] = parameter5; + s_paramsList[4] = parameter6; + s_paramsList[5] = parameter7; + s_paramsList[6] = parameter8; + s_paramsList[7] = parameter9; + RequestSourceCallBuilder(instance, null, parameter1, 4); + return null; + } + + private static object CallRequestSourceTypeStringObjectStringObjectStringObjectStringObjectStringObject( + object instanceObj, + object[] parameters) + { + Host instance = (Host)instanceObj; + TypeSchema parameter1 = (TypeSchema)parameters[0]; + string parameter2 = (string)parameters[1]; + object parameter3 = parameters[2]; + string parameter4 = (string)parameters[3]; + object parameter5 = parameters[4]; + string parameter6 = (string)parameters[5]; + object parameter7 = parameters[6]; + string parameter8 = (string)parameters[7]; + object parameter9 = parameters[8]; + string parameter10 = (string)parameters[9]; + object parameter11 = parameters[10]; + s_paramsList[0] = parameter2; + s_paramsList[1] = parameter3; + s_paramsList[2] = parameter4; + s_paramsList[3] = parameter5; + s_paramsList[4] = parameter6; + s_paramsList[5] = parameter7; + s_paramsList[6] = parameter8; + s_paramsList[7] = parameter9; + s_paramsList[8] = parameter10; + s_paramsList[9] = parameter11; + RequestSourceCallBuilder(instance, null, parameter1, 5); + return null; + } + + private static void RequestSourceCallBuilder( + Host instance, + string source, + TypeSchema type, + int numPairs) + { + ErrorWatermark watermark = ErrorManager.Watermark; + Vector vector = new Vector(numPairs); + for (int index = 0; index < numPairs; ++index) + { + string name = (string)s_paramsList[index * 2]; + object obj = s_paramsList[index * 2 + 1]; + if (name == null) + 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) + s_paramsList[index] = null; + if (watermark.ErrorsDetected) + return; + instance.RequestSource(source, type, vector); + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(101, "Host", null, 239, typeof(Host), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(101, "NewContentOnTop", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetNewContentOnTop), new SetValueHandler(SetNewContentOnTop), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(101, "Source", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSource), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(101, "SourceType", 225, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSourceType), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(101, "Status", 102, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStatus), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(101, "InputEnabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetInputEnabled), new SetValueHandler(SetInputEnabled), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(101, "Unloadable", 15, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(GetUnloadable), new SetValueHandler(SetUnloadable), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(101, "UnloadAll", null, 240, new InvokeHandler(CallUnloadAll), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(101, "ForceRefresh", null, 240, new InvokeHandler(CallForceRefresh), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(101, "ForceRefresh", new short[1] + { + 15 + }, 240, new InvokeHandler(CallForceRefreshBoolean), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(101, "RequestSource", new short[1] + { + 208 + }, 240, new InvokeHandler(CallRequestSourceString), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(101, "RequestSource", new short[3] + { + 208, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceStringStringObject), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(101, "RequestSource", new short[5] + { + 208, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceStringStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(101, "RequestSource", new short[7] + { + 208, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceStringStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(101, "RequestSource", new short[9] + { + 208, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceStringStringObjectStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(101, "RequestSource", new short[11] + { + 208, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceStringStringObjectStringObjectStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(101, "RequestSource", new short[1] + { + 225 + }, 240, new InvokeHandler(CallRequestSourceType), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(101, "RequestSource", new short[3] + { + 225, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceTypeStringObject), false); + UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema(101, "RequestSource", new short[5] + { + 225, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceTypeStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema(101, "RequestSource", new short[7] + { + 225, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceTypeStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema14 = new UIXMethodSchema(101, "RequestSource", new short[9] + { + 225, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceTypeStringObjectStringObjectStringObjectStringObject), false); + UIXMethodSchema uixMethodSchema15 = new UIXMethodSchema(101, "RequestSource", new short[11] + { + 225, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153, + 208, + 153 + }, 240, new InvokeHandler(CallRequestSourceTypeStringObjectStringObjectStringObjectStringObjectStringObject), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema6 + }, new MethodSchema[15] + { + 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 new file mode 100644 index 0000000..e72355d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/HwndHostSchema.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.HwndHostSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class HwndHostSchema + { + public static UIXTypeSchema Type; + + private static object GetHandle(object instanceObj) => ((HwndHost)instanceObj).Handle; + + 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() => new HwndHost(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(103, "HwndHost", null, 239, typeof(HwndHost), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(103, "Handle", 116, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(GetHandle), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(103, "ChildHandle", 116, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetChildHandle), new SetValueHandler(SetChildHandle), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..191060e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/IAnimationSchema.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.IAnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class IAnimationSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(104, "IAnimation", null, 153, typeof(IAnimationProvider), UIXTypeFlags.None); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..07d73db --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ImageElementInstanceSchema.cs @@ -0,0 +1,34 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ImageElementInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ImageElementInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetImage(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Image", (UIImage)valueObj); + + private static void SetUVOffset(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("UVOffset", (Vector2)valueObj); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(107, "ImageElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(107, "Image", 105, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetImage), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(107, "UVOffset", 233, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetUVOffset), false); + Type.Initialize(null, null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..42ef64f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ImageElementSchema.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ImageElementSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ImageElementSchema + { + public static UIXTypeSchema Type; + + private static void SetImage(ref object instanceObj, object valueObj) => ((ImageElement)instanceObj).Image = ((UIImage)valueObj)?.RenderImage; + + 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() => new ImageElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(106, "ImageElement", null, 77, typeof(ImageElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(106, "Image", 105, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetImage), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(106, "UVOffset", 233, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetUVOffset), new SetValueHandler(SetUVOffset), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..7016da0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ImageSchema.cs @@ -0,0 +1,334 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ImageSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ImageSchema + { + public static UIXTypeSchema Type; + + 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) => ((UIImage)instanceObj).NineGrid; + + private static void SetNineGrid(ref object instanceObj, object valueObj) => ((UIImage)instanceObj).NineGrid = (Inset)valueObj; + + private static object GetMaximumSize(object instanceObj) => ((UIImage)instanceObj).MaximumSize; + + private static void SetMaximumSize(ref object instanceObj, object valueObj) + { + UIImage uiImage = (UIImage)instanceObj; + Size size = (Size)valueObj; + Result result = SizeSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + uiImage.MaximumSize = size; + } + + private static object GetFlippable(object instanceObj) => BooleanBoxes.Box(((UIImage)instanceObj).Flippable); + + private static void SetFlippable(ref object instanceObj, object valueObj) => ((UIImage)instanceObj).Flippable = (bool)valueObj; + + private static object GetAntialiasEdges(object instanceObj) => BooleanBoxes.Box(((UIImage)instanceObj).AntialiasEdges); + + private static void SetAntialiasEdges(ref object instanceObj, object valueObj) => ((UIImage)instanceObj).AntialiasEdges = (bool)valueObj; + + private static object GetStatus(object instanceObj) => ((UIImage)instanceObj).Status; + + private static object GetWidth(object instanceObj) => ((UIImage)instanceObj).Width; + + private static object GetHeight(object instanceObj) => ((UIImage)instanceObj).Height; + + private static object Construct() => new UriImage(); + + private static object CallLoad(object instanceObj, object[] parameters) + { + ((UIImage)instanceObj).Load(); + return null; + } + + private static object ConstructSource(object[] parameters) + { + object instanceObj = Construct(); + SetSource(ref instanceObj, parameters[0]); + return instanceObj; + } + + private static Result ConvertFromStringSource(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj; + Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result.Error); + SetSource(ref instance, valueObj); + return result; + } + + private static object ConstructSourceNineGrid(object[] parameters) + { + object instanceObj = Construct(); + SetSource(ref instanceObj, parameters[0]); + SetNineGrid(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringSourceNineGrid( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result1.Error); + SetSource(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], InsetSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result2.Error); + SetNineGrid(ref instance, valueObj2); + return result2; + } + + private static object ConstructSourceNineGridMaximumSize(object[] parameters) + { + object instanceObj = Construct(); + SetSource(ref instanceObj, parameters[0]); + SetNineGrid(ref instanceObj, parameters[1]); + SetMaximumSize(ref instanceObj, parameters[2]); + return instanceObj; + } + + private static Result ConvertFromStringSourceNineGridMaximumSize( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result1.Error); + SetSource(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], InsetSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result2.Error); + SetNineGrid(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result3.Error); + SetMaximumSize(ref instance, valueObj3); + return result3; + } + + private static object ConstructSourceNineGridMaximumSizeFlippable(object[] parameters) + { + object instanceObj = Construct(); + SetSource(ref instanceObj, parameters[0]); + SetNineGrid(ref instanceObj, parameters[1]); + SetMaximumSize(ref instanceObj, parameters[2]); + SetFlippable(ref instanceObj, parameters[3]); + return instanceObj; + } + + private static Result ConvertFromStringSourceNineGridMaximumSizeFlippable( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result1.Error); + SetSource(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], InsetSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result2.Error); + SetNineGrid(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result3.Error); + SetMaximumSize(ref instance, valueObj3); + object valueObj4; + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], BooleanSchema.Type, null, out valueObj4); + if (result4.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result4.Error); + SetFlippable(ref instance, valueObj4); + return result4; + } + + private static object ConstructSourceNineGridMaximumSizeFlippableAntialiasEdges( + object[] parameters) + { + object instanceObj = Construct(); + SetSource(ref instanceObj, parameters[0]); + SetNineGrid(ref instanceObj, parameters[1]); + SetMaximumSize(ref instanceObj, parameters[2]); + SetFlippable(ref instanceObj, parameters[3]); + SetAntialiasEdges(ref instanceObj, parameters[4]); + return instanceObj; + } + + private static Result ConvertFromStringSourceNineGridMaximumSizeFlippableAntialiasEdges( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result1.Error); + SetSource(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], InsetSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result2.Error); + SetNineGrid(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SizeSchema.Type, SizeSchema.ValidateNotNegative, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result3.Error); + SetMaximumSize(ref instance, valueObj3); + object valueObj4; + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], BooleanSchema.Type, null, out valueObj4); + if (result4.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result4.Error); + SetFlippable(ref instance, valueObj4); + object valueObj5; + Result result5 = UIXLoadResult.ValidateStringAsValue(splitString[4], BooleanSchema.Type, null, out valueObj5); + if (result5.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Image", result5.Error); + SetAntialiasEdges(ref instance, valueObj5); + return result5; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + switch (splitString.Length) + { + case 1: + result = ConvertFromStringSource(splitString, out instance); + if (!result.Failed) + return result; + break; + case 2: + result = ConvertFromStringSourceNineGrid(splitString, out instance); + if (!result.Failed) + return result; + break; + case 3: + result = ConvertFromStringSourceNineGridMaximumSize(splitString, out instance); + if (!result.Failed) + return result; + break; + case 4: + result = ConvertFromStringSourceNineGridMaximumSizeFlippable(splitString, out instance); + if (!result.Failed) + return result; + break; + case 5: + result = ConvertFromStringSourceNineGridMaximumSizeFlippableAntialiasEdges(splitString, out instance); + if (!result.Failed) + return result; + break; + default: + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Image"); + break; + } + } + return result; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(105, "Image", null, 153, typeof(UIImage), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(105, "Source", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSource), new SetValueHandler(SetSource), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(105, "NineGrid", 114, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetNineGrid), new SetValueHandler(SetNineGrid), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(105, "MaximumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, false, new GetValueHandler(GetMaximumSize), new SetValueHandler(SetMaximumSize), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(105, "Flippable", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetFlippable), new SetValueHandler(SetFlippable), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(105, "AntialiasEdges", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAntialiasEdges), new SetValueHandler(SetAntialiasEdges), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(105, "Status", 108, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStatus), null, false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(105, "Width", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetWidth), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(105, "Height", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetHeight), null, false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(105, "Load", null, 240, new InvokeHandler(CallLoad), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(105, new short[1] + { + 208 + }, new ConstructHandler(ConstructSource)); + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(105, new short[2] + { + 208, + 114 + }, new ConstructHandler(ConstructSourceNineGrid)); + UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema(105, new short[3] + { + 208, + 114, + 195 + }, new ConstructHandler(ConstructSourceNineGridMaximumSize)); + UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema(105, new short[4] + { + 208, + 114, + 195, + 15 + }, new ConstructHandler(ConstructSourceNineGridMaximumSizeFlippable)); + UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema(105, new short[5] + { + 208, + 114, + 195, + 15, + 15 + }, new ConstructHandler(ConstructSourceNineGridMaximumSizeFlippableAntialiasEdges)); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[5] + { + constructorSchema1, + constructorSchema2, + constructorSchema3, + constructorSchema4, + constructorSchema5 + }, new PropertySchema[8] + { + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1, + uixPropertySchema6, + uixPropertySchema7 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs new file mode 100644 index 0000000..5285332 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/IndexSchema.cs @@ -0,0 +1,38 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.IndexSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class IndexSchema + { + public static UIXTypeSchema Type; + + private static object GetValue(object instanceObj) => ((Index)instanceObj).Value; + + private static object GetSourceValue(object instanceObj) => ((Index)instanceObj).SourceValue; + + private static object CallGetContainerIndex(object instanceObj, object[] parameters) => ((Index)instanceObj).GetContainerIndex(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(109, "Index", null, 153, typeof(Index), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(109, "Value", 115, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(GetValue), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(109, "SourceValue", 115, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(GetSourceValue), null, false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(109, "GetContainerIndex", null, 109, new InvokeHandler(CallGetContainerIndex), false); + Type.Initialize(null, null, new PropertySchema[2] + { + uixPropertySchema2, + uixPropertySchema1 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..971b0d0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/InputHandlerSchema.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.InputHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class InputHandlerSchema + { + public static UIXTypeSchema Type; + + private static object GetName(object instanceObj) => ((InputHandler)instanceObj).Name; + + private static void SetName(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).Name = (string)valueObj; + + private static object GetEnabled(object instanceObj) => BooleanBoxes.Box(((InputHandler)instanceObj).Enabled); + + private static void SetEnabled(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).Enabled = (bool)valueObj; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(110, "InputHandler", null, -1, typeof(InputHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(110, "Name", 208, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetName), new SetValueHandler(SetName), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(110, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEnabled), new SetValueHandler(SetEnabled), false); + Type.Initialize(null, null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..e3c5720 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/InsetSchema.cs @@ -0,0 +1,288 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.InsetSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class InsetSchema + { + private static readonly object s_Default = Inset.Zero; + public static UIXTypeSchema Type; + + 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 = inset; + } + + 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 = inset; + } + + 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 = inset; + } + + 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 = inset; + } + + private static object Construct() => s_Default; + + private static object ConstructInt32(object[] parameters) + { + int parameter = (int)parameters[0]; + return new Inset(parameter, parameter, parameter, parameter); + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Inset inset = (Inset)instanceObj; + writer.WriteInt32(inset.Left); + writer.WriteInt32(inset.Top); + writer.WriteInt32(inset.Right); + writer.WriteInt32(inset.Bottom); + } + + 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 = null; + int result; + if (!int.TryParse(s, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out result)) + return Result.Fail(""); + instanceObj = new Inset() + { + Left = result, + Top = result, + Right = result, + Bottom = result + }; + return Result.Success; + } + + private static Result ConvertFromInt32(object valueObj, out object instanceObj) + { + int num = (int)valueObj; + instanceObj = null; + instanceObj = new Inset() + { + Left = num, + Top = num, + Right = num, + Bottom = num + }; + return Result.Success; + } + + private static Result ConvertFromSingle(object valueObj, out object instanceObj) + { + float num1 = (float)valueObj; + instanceObj = null; + Inset inset = new Inset(); + int num2 = (int)num1; + inset.Left = num2; + inset.Top = num2; + inset.Right = num2; + inset.Bottom = num2; + instanceObj = inset; + return Result.Success; + } + + private static object ConstructLeftTopRightBottom(object[] parameters) + { + object instanceObj = Construct(); + SetLeft(ref instanceObj, parameters[0]); + SetTop(ref instanceObj, parameters[1]); + SetRight(ref instanceObj, parameters[2]); + SetBottom(ref instanceObj, parameters[3]); + return instanceObj; + } + + private static Result ConvertFromStringLeftTopRightBottom( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Inset", result1.Error); + SetLeft(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Inset", result2.Error); + SetTop(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], Int32Schema.Type, null, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Inset", result3.Error); + SetRight(ref instance, valueObj3); + object valueObj4; + Result result4 = UIXLoadResult.ValidateStringAsValue(splitString[3], Int32Schema.Type, null, out valueObj4); + if (result4.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Inset", result4.Error); + SetBottom(ref instance, valueObj4); + return result4; + } + + private static bool IsConversionSupported(TypeSchema fromType) => Int32Schema.Type.IsAssignableFrom(fromType) || SingleSchema.Type.IsAssignableFrom(fromType) || StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (Int32Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt32(from, out instance); + if (!result.Failed) + return result; + } + if (SingleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSingle(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 4) + { + result = ConvertFromStringLeftTopRightBottom(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Inset"); + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.MathNegate: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + Inset inset1 = (Inset)leftObj; + if (op == OperationType.MathNegate) + return -inset1; + Inset inset2 = (Inset)rightObj; + switch (op) + { + case OperationType.MathAdd: + return inset1 + inset2; + case OperationType.MathSubtract: + return inset1 - inset2; + case OperationType.RelationalEquals: + return BooleanBoxes.Box(inset1 == inset2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(inset1 != inset2); + default: + return null; + } + } + + private static object CallTryParseStringInset(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + Inset parameter2 = (Inset)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(114, "Inset", null, 153, typeof(Inset), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(114, "Left", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetLeft), new SetValueHandler(SetLeft), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(114, "Top", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetTop), new SetValueHandler(SetTop), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(114, "Right", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRight), new SetValueHandler(SetRight), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(114, "Bottom", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetBottom), new SetValueHandler(SetBottom), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(114, new short[1] + { + 115 + }, new ConstructHandler(ConstructInt32)); + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(114, new short[4] + { + 115, + 115, + 115, + 115 + }, new ConstructHandler(ConstructLeftTopRightBottom)); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(114, "TryParse", new short[2] + { + 208, + 114 + }, 114, new InvokeHandler(CallTryParseStringInset), true); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[2] + { + constructorSchema1, + constructorSchema2 + }, new PropertySchema[4] + { + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema3, + uixPropertySchema2 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs b/UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs new file mode 100644 index 0000000..8a95768 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/Int32Schema.cs @@ -0,0 +1,239 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.Int32Schema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.CodeModel.Cpp; +using Microsoft.Iris.Library; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class Int32Schema + { + public static RangeValidator ValidateNotNegative = new RangeValidator(RangeValidateNotNegative); + public static UIXTypeSchema Type; + + private static object GetMinValue(object instanceObj) => Int32Boxes.MinValueBox; + + private static object GetMaxValue(object instanceObj) => Int32Boxes.MaxValueBox; + + private static object Construct() => Int32Boxes.ZeroBox; + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + int num = (int)instanceObj; + writer.WriteInt32(num); + } + + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadInt32(); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string s = (string)valueObj; + instanceObj = null; + int 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 = null; + int num = flag ? 1 : 0; + instanceObj = num; + return Result.Success; + } + + private static Result ConvertFromByte(object valueObj, out object instanceObj) + { + byte num1 = (byte)valueObj; + instanceObj = null; + int num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromSingle(object valueObj, out object instanceObj) + { + float num1 = (float)valueObj; + instanceObj = null; + int num2 = (int)num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromInt64(object valueObj, out object instanceObj) + { + long num1 = (long)valueObj; + instanceObj = null; + int num2 = (int)num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromDouble(object valueObj, out object instanceObj) + { + double num1 = (double)valueObj; + instanceObj = null; + int num2 = (int)num1; + instanceObj = num2; + return Result.Success; + } + + 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); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (BooleanSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromBoolean(from, out instance); + if (!result.Failed) + return result; + } + if (ByteSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromByte(from, out instance); + if (!result.Failed) + return result; + } + if (DoubleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromDouble(from, out instance); + if (!result.Failed) + return result; + } + if (Int64Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt64(from, out instance); + if (!result.Failed) + return result; + } + if (SingleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSingle(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + if (!fromType.IsEnum) + return result; + instance = !(from is DllEnumProxy dllEnumProxy) ? (int)from : (object)dllEnumProxy.Value; + return Result.Success; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.MathMultiply: + case OperationType.MathDivide: + case OperationType.MathModulus: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.RelationalLessThan: + case OperationType.RelationalGreaterThan: + case OperationType.RelationalLessThanEquals: + case OperationType.RelationalGreaterThanEquals: + case OperationType.MathNegate: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + int num1 = (int)leftObj; + if (op == OperationType.MathNegate) + return -num1; + int num2 = (int)rightObj; + switch (op - 1) + { + case 0: + return num1 + num2; + case OperationType.MathAdd: + return num1 - num2; + case OperationType.MathSubtract: + return num1 * num2; + case OperationType.MathMultiply: + return num1 / num2; + case OperationType.MathDivide: + return num1 % num2; + case OperationType.LogicalOr: + return BooleanBoxes.Box(num1 == num2); + case OperationType.RelationalEquals: + return BooleanBoxes.Box(num1 != num2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(num1 < num2); + case OperationType.RelationalLessThan: + return BooleanBoxes.Box(num1 > num2); + case OperationType.RelationalGreaterThan: + return BooleanBoxes.Box(num1 <= num2); + case OperationType.RelationalLessThanEquals: + return BooleanBoxes.Box(num1 >= num2); + default: + return null; + } + } + + private static object CallTryParseStringInt32(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + int parameter2 = (int)parameters[1]; + object instanceObj1; + return 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}", num.ToString()) : Result.Success; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(115, "Int32", "int", 153, typeof(int), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(115, "MinValue", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMinValue), null, true); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(115, "MaxValue", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMaxValue), null, true); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(115, "ToString", new short[1] + { + 208 + }, 208, new InvokeHandler(CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(115, "TryParse", new short[2] + { + 208, + 115 + }, 115, new InvokeHandler(CallTryParseStringInt32), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + uixPropertySchema2, + uixPropertySchema1 + }, new MethodSchema[2] + { + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs b/UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs new file mode 100644 index 0000000..a176a63 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/Int64Schema.cs @@ -0,0 +1,228 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.Int64Schema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class Int64Schema + { + public static UIXTypeSchema Type; + + private static object GetMinValue(object instanceObj) => Int64Boxes.MinValueBox; + + private static object GetMaxValue(object instanceObj) => Int64Boxes.MaxValueBox; + + private static object Construct() => Int64Boxes.ZeroBox; + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + long num = (long)instanceObj; + writer.WriteInt64(num); + } + + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadInt64(); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string s = (string)valueObj; + instanceObj = null; + long 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 = null; + long num = flag ? 1L : 0L; + instanceObj = num; + return Result.Success; + } + + private static Result ConvertFromByte(object valueObj, out object instanceObj) + { + byte num1 = (byte)valueObj; + instanceObj = null; + long num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromSingle(object valueObj, out object instanceObj) + { + float num1 = (float)valueObj; + instanceObj = null; + long num2 = (long)num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromInt32(object valueObj, out object instanceObj) + { + int num1 = (int)valueObj; + instanceObj = null; + long num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromDouble(object valueObj, out object instanceObj) + { + double num1 = (double)valueObj; + instanceObj = null; + long num2 = (long)num1; + instanceObj = num2; + return Result.Success; + } + + 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)); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (BooleanSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromBoolean(from, out instance); + if (!result.Failed) + return result; + } + if (ByteSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromByte(from, out instance); + if (!result.Failed) + return result; + } + if (DoubleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromDouble(from, out instance); + if (!result.Failed) + return result; + } + if (Int32Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt32(from, out instance); + if (!result.Failed) + return result; + } + if (SingleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSingle(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.MathMultiply: + case OperationType.MathDivide: + case OperationType.MathModulus: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.RelationalLessThan: + case OperationType.RelationalGreaterThan: + case OperationType.RelationalLessThanEquals: + case OperationType.RelationalGreaterThanEquals: + case OperationType.MathNegate: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + long num1 = (long)leftObj; + if (op == OperationType.MathNegate) + return -num1; + long num2 = (long)rightObj; + switch (op - 1) + { + case 0: + return num1 + num2; + case OperationType.MathAdd: + return num1 - num2; + case OperationType.MathSubtract: + return num1 * num2; + case OperationType.MathMultiply: + return num1 / num2; + case OperationType.MathDivide: + return num1 % num2; + case OperationType.LogicalOr: + return BooleanBoxes.Box(num1 == num2); + case OperationType.RelationalEquals: + return BooleanBoxes.Box(num1 != num2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(num1 < num2); + case OperationType.RelationalLessThan: + return BooleanBoxes.Box(num1 > num2); + case OperationType.RelationalGreaterThan: + return BooleanBoxes.Box(num1 <= num2); + case OperationType.RelationalLessThanEquals: + return BooleanBoxes.Box(num1 >= num2); + default: + return null; + } + } + + private static object CallTryParseStringInt64(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + long parameter2 = (long)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(116, "Int64", "long", 153, typeof(long), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(116, "MinValue", 116, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMinValue), null, true); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(116, "MaxValue", 116, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMaxValue), null, true); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(116, "ToString", new short[1] + { + 208 + }, 208, new InvokeHandler(CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(116, "TryParse", new short[2] + { + 208, + 116 + }, 116, new InvokeHandler(CallTryParseStringInt64), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + uixPropertySchema2, + uixPropertySchema1 + }, new MethodSchema[2] + { + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/IntRangedValueSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/IntRangedValueSchema.cs new file mode 100644 index 0000000..7acd633 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/IntRangedValueSchema.cs @@ -0,0 +1,67 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.IntRangedValueSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class IntRangedValueSchema + { + public static UIXTypeSchema Type; + + 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 (num > (double)uiIntRangedValue.MaxValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MinValue"); + else + uiIntRangedValue.MinValue = num; + } + + 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 (num < (double)uiIntRangedValue.MinValue) + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", num, "MaxValue"); + else + uiIntRangedValue.MaxValue = num; + } + + private static object GetStep(object instanceObj) => (int)((IUIRangedValue)instanceObj).Step; + + private static void SetStep(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Step = (int)valueObj; + + private static object GetValue(object instanceObj) => (int)((IUIRangedValue)instanceObj).Value; + + private static void SetValue(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Value = (int)valueObj; + + private static object Construct() => new Microsoft.Iris.ModelItems.IntRangedValue(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(117, "IntRangedValue", null, 168, typeof(IUIIntRangedValue), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(117, "MinValue", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMinValue), new SetValueHandler(SetMinValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(117, "MaxValue", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMaxValue), new SetValueHandler(SetMaxValue), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(117, "Step", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStep), new SetValueHandler(SetStep), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(117, "Value", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[4] + { + 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 new file mode 100644 index 0000000..e7045f6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementInstanceSchema.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.InterpolateElementInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class InterpolateElementInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetValue(ref object instanceObj, object valueObj) + { + EffectElementWrapper effectElementWrapper = (EffectElementWrapper)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + effectElementWrapper.SetProperty("Value", num); + } + + private static object CallPlayValueAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Value, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(120, "InterpolateElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(120, "Value", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, null, new SetValueHandler(SetValue), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(120, "PlayValueAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayValueAnimationEffectFloatAnimation), false); + Type.Initialize(null, null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..a580a4d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/InterpolateElementSchema.cs @@ -0,0 +1,55 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.InterpolateElementSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class InterpolateElementSchema + { + public static UIXTypeSchema Type; + + 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) => ((InterpolateElement)instanceObj).Input2; + + private static void SetInput2(ref object instanceObj, object valueObj) => ((InterpolateElement)instanceObj).Input2 = (EffectInput)valueObj; + + private static object GetValue(object instanceObj) => ((InterpolateElement)instanceObj).Value; + + private static void SetValue(ref object instanceObj, object valueObj) + { + InterpolateElement interpolateElement = (InterpolateElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + interpolateElement.Value = num; + } + + private static object Construct() => new InterpolateElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(119, "InterpolateElement", null, 77, typeof(InterpolateElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(119, "Input1", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetInput1), new SetValueHandler(SetInput1), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(119, "Input2", 77, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetInput2), new SetValueHandler(SetInput2), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(119, "Value", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..9bfef86 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/InterpolationSchema.cs @@ -0,0 +1,193 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.InterpolationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class InterpolationSchema + { + public static RangeValidator ValidateEasePercent = new RangeValidator(RangeValidateEasePercent); + public static UIXTypeSchema 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) => ((Interpolation)instanceObj).Weight; + + private static void SetWeight(ref object instanceObj, object valueObj) + { + Interpolation interpolation = (Interpolation)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + interpolation.Weight = num; + } + + 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) => ((Interpolation)instanceObj).BezierHandle2; + + private static void SetBezierHandle2(ref object instanceObj, object valueObj) => ((Interpolation)instanceObj).BezierHandle2 = (float)valueObj; + + private static object GetEasePercent(object instanceObj) => ((Interpolation)instanceObj).EasePercent; + + private static void SetEasePercent(ref object instanceObj, object valueObj) + { + Interpolation interpolation = (Interpolation)instanceObj; + float num = (float)valueObj; + Result result = ValidateEasePercent(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + interpolation.EasePercent = num; + } + + private static object Construct() => new Interpolation(); + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Interpolation interpolation = (Interpolation)instanceObj; + writer.WriteInt32((int)interpolation.Type); + writer.WriteSingle(interpolation.Weight); + writer.WriteSingle(interpolation.BezierHandle1); + writer.WriteSingle(interpolation.BezierHandle2); + writer.WriteSingle(interpolation.EasePercent); + } + + private static object DecodeBinary(ByteCodeReader reader) => new Interpolation() + { + Type = (InterpolationType)reader.ReadInt32(), + Weight = reader.ReadSingle(), + BezierHandle1 = reader.ReadSingle(), + BezierHandle2 = reader.ReadSingle(), + EasePercent = reader.ReadSingle() + }; + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str = (string)valueObj; + instanceObj = null; + string[] strArray = str.Split(','); + if (strArray.Length < 1) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Interpolation"); + Interpolation interpolation = new Interpolation(); + instanceObj = interpolation; + object valueObj1; + Result result = UIXLoadResult.ValidateStringAsValue(strArray[0], UIXLoadResultExports.InterpolationTypeType, null, out valueObj1); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); + SetType(ref instanceObj, valueObj1); + if (strArray.Length == 2) + { + object valueObj2; + result = UIXLoadResult.ValidateStringAsValue(strArray[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); + SetWeight(ref instanceObj, valueObj2); + } + else if (strArray.Length == 3) + { + if (interpolation.Type == InterpolationType.Bezier) + { + object valueObj2; + result = UIXLoadResult.ValidateStringAsValue(strArray[1], SingleSchema.Type, null, out valueObj2); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); + SetBezierHandle1(ref instanceObj, valueObj2); + object valueObj3; + result = UIXLoadResult.ValidateStringAsValue(strArray[2], SingleSchema.Type, null, out valueObj3); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); + SetBezierHandle2(ref instanceObj, valueObj3); + } + else + { + object valueObj2; + result = UIXLoadResult.ValidateStringAsValue(strArray[1], SingleSchema.Type, SingleSchema.ValidateNotNegative, out valueObj2); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); + SetWeight(ref instanceObj, valueObj2); + object valueObj3; + result = UIXLoadResult.ValidateStringAsValue(strArray[2], SingleSchema.Type, ValidateEasePercent, out valueObj3); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Interpolation", result.Error); + SetEasePercent(ref instanceObj, valueObj3); + } + } + else if (strArray.Length >= 4) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Interpolation"); + instanceObj = interpolation; + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static object CallTryParseStringInterpolation(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + Interpolation parameter2 = (Interpolation)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + private static Result RangeValidateEasePercent(object value) + { + float num = (float)value; + 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() => Type = new UIXTypeSchema(121, "Interpolation", null, 153, typeof(Interpolation), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(121, "Type", 122, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetType), new SetValueHandler(SetType), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(121, "Weight", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetWeight), new SetValueHandler(SetWeight), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(121, "BezierHandle1", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetBezierHandle1), new SetValueHandler(SetBezierHandle1), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(121, "BezierHandle2", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetBezierHandle2), new SetValueHandler(SetBezierHandle2), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(121, "EasePercent", 194, -1, ExpressionRestriction.None, false, ValidateEasePercent, false, new GetValueHandler(GetEasePercent), new SetValueHandler(SetEasePercent), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(121, "TryParse", new short[2] + { + 208, + 121 + }, 121, new InvokeHandler(CallTryParseStringInterpolation), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[5] + { + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/InvAlphaSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/InvAlphaSchema.cs new file mode 100644 index 0000000..b0c7399 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/InvAlphaSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.InvAlphaSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class InvAlphaSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => new InvAlphaElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(123, "InvAlpha", null, 80, typeof(InvAlphaElement), UIXTypeFlags.None); + + public static void Pass2Initialize() => Type.Initialize(new DefaultConstructHandler(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 new file mode 100644 index 0000000..e1df76a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/InvColorSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.InvColorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class InvColorSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => new InvColorElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(124, "InvColor", null, 80, typeof(InvColorElement), UIXTypeFlags.None); + + public static void Pass2Initialize() => Type.Initialize(new DefaultConstructHandler(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 new file mode 100644 index 0000000..38a6589 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/InvertSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.InvertSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class InvertSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => new InvertElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(125, "Invert", null, 80, typeof(InvertElement), UIXTypeFlags.None); + + public static void Pass2Initialize() => Type.Initialize(new DefaultConstructHandler(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 new file mode 100644 index 0000000..3e6d720 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ItemAlignmentSchema.cs @@ -0,0 +1,160 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ItemAlignmentSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ItemAlignmentSchema + { + public static UIXTypeSchema Type; + + 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 = itemAlignment; + } + + 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 = itemAlignment; + } + + private static object Construct() => ItemAlignment.Default; + + private static object ConstructAlignment(object[] parameters) + { + Alignment parameter = (Alignment)parameters[0]; + return new ItemAlignment(parameter, parameter); + } + + private static object ConstructAlignmentAlignment(object[] parameters) => new ItemAlignment((Alignment)parameters[0], (Alignment)parameters[1]); + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + ItemAlignment itemAlignment = (ItemAlignment)instanceObj; + writer.WriteByte((byte)itemAlignment.Horizontal); + writer.WriteByte((byte)itemAlignment.Vertical); + } + + 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 = 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}'", str, "ItemAlignment"); + Result alignment3 = ParseAlignment(strArray[0], out alignment1); + if (alignment3.Failed) + return alignment3; + alignment3 = ParseAlignment(strArray[1], out alignment2); + if (alignment3.Failed) + return alignment3; + } + else + { + Result alignment3 = ParseAlignment(str, out alignment1); + if (alignment3.Failed) + return alignment3; + alignment2 = alignment1; + } + ItemAlignment itemAlignment = new ItemAlignment(alignment1, alignment2); + instanceObj = itemAlignment; + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static object CallTryParseStringItemAlignment(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + ItemAlignment parameter2 = (ItemAlignment)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + private static Result ParseAlignment(string value, out Alignment alignment) + { + value = value.Trim(); + alignment = Alignment.Unspecified; + if (value != "-") + { + object instance; + Result result = UIXLoadResultExports.AlignmentType.TypeConverter(value, StringSchema.Type, out instance); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "ItemAlignment", result.Error); + alignment = (Alignment)instance; + } + return Result.Success; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(sbyte.MaxValue, "ItemAlignment", null, 153, typeof(ItemAlignment), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(sbyte.MaxValue, "Horizontal", 3, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetHorizontal), new SetValueHandler(SetHorizontal), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(sbyte.MaxValue, "Vertical", 3, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetVertical), new SetValueHandler(SetVertical), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(sbyte.MaxValue, new short[1] + { + 3 + }, new ConstructHandler(ConstructAlignment)); + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(sbyte.MaxValue, new short[2] + { + 3, + 3 + }, new ConstructHandler(ConstructAlignmentAlignment)); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(sbyte.MaxValue, "TryParse", new short[2] + { + 208, + sbyte.MaxValue + }, sbyte.MaxValue, new InvokeHandler(CallTryParseStringItemAlignment), true); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[2] + { + constructorSchema1, + constructorSchema2 + }, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/KeyHandlerSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/KeyHandlerSchema.cs new file mode 100644 index 0000000..377f8cd --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/KeyHandlerSchema.cs @@ -0,0 +1,127 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.KeyHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class KeyHandlerSchema + { + public static UIXTypeSchema Type; + + private static object GetCommand(object instanceObj) => ((KeyHandler)instanceObj).Command; + + private static void SetCommand(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).Command = (IUICommand)valueObj; + + private static object GetHandle(object instanceObj) => BooleanBoxes.Box(((KeyHandler)instanceObj).Handle); + + private static void SetHandle(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).Handle = (bool)valueObj; + + private static object GetStopRoute(object instanceObj) => BooleanBoxes.Box(((KeyHandler)instanceObj).StopRoute); + + private static void SetStopRoute(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).StopRoute = (bool)valueObj; + + 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) => ((ModifierInputHandler)instanceObj).HandlerTransition; + + private static void SetHandlerTransition(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).HandlerTransition = (InputHandlerTransition)valueObj; + + 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) => ((ModifierInputHandler)instanceObj).DisallowedModifiers; + + private static void SetDisallowedModifiers(ref object instanceObj, object valueObj) => ((ModifierInputHandler)instanceObj).DisallowedModifiers = (InputHandlerModifiers)valueObj; + + private static object GetPressing(object instanceObj) => BooleanBoxes.Box(((KeyHandler)instanceObj).Pressing); + + private static object GetRepeat(object instanceObj) => BooleanBoxes.Box(((KeyHandler)instanceObj).Repeat); + + private static void SetRepeat(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).Repeat = (bool)valueObj; + + private static object GetTrackInvokedKeys(object instanceObj) => BooleanBoxes.Box(((KeyHandler)instanceObj).TrackInvokedKeys); + + private static void SetTrackInvokedKeys(ref object instanceObj, object valueObj) => ((KeyHandler)instanceObj).TrackInvokedKeys = (bool)valueObj; + + 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() => new KeyHandler(); + + private static object CallGetInvokedKeys(object instanceObj, object[] parameters) + { + KeyHandler keyHandler = (KeyHandler)instanceObj; + ArrayList arrayList = new ArrayList(); + keyHandler.GetInvokedKeys(arrayList); + return arrayList; + } + + private static object CallGetInvokedKeysList(object instanceObj, object[] parameters) + { + KeyHandler keyHandler = (KeyHandler)instanceObj; + IList parameter = (IList)parameters[0]; + if (parameter != null) + keyHandler.GetInvokedKeys(parameter); + else + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "copyTo"); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(128, "KeyHandler", null, 110, typeof(KeyHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(128, "Command", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCommand), new SetValueHandler(SetCommand), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(128, "Handle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandle), new SetValueHandler(SetHandle), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(128, "StopRoute", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStopRoute), new SetValueHandler(SetStopRoute), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(128, "Key", 129, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetKey), new SetValueHandler(SetKey), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(128, "HandlerTransition", 113, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerTransition), new SetValueHandler(SetHandlerTransition), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(128, "RequiredModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRequiredModifiers), new SetValueHandler(SetRequiredModifiers), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(128, "DisallowedModifiers", 111, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDisallowedModifiers), new SetValueHandler(SetDisallowedModifiers), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(128, "Pressing", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPressing), null, false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(128, "Repeat", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRepeat), new SetValueHandler(SetRepeat), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(128, "TrackInvokedKeys", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetTrackInvokedKeys), new SetValueHandler(SetTrackInvokedKeys), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(128, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(128, "EventContext", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEventContext), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(128, "GetInvokedKeys", null, 138, new InvokeHandler(CallGetInvokedKeys), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(128, "GetInvokedKeys", new short[1] + { + 138 + }, 240, new InvokeHandler(CallGetInvokedKeysList), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(128, "Invoked"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[12] + { + uixPropertySchema1, + uixPropertySchema7, + uixPropertySchema12, + uixPropertySchema2, + uixPropertySchema11, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema9, + uixPropertySchema6, + uixPropertySchema3, + uixPropertySchema10 + }, new MethodSchema[2] + { + 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 new file mode 100644 index 0000000..777121a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/KeyframeSchema.cs @@ -0,0 +1,42 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.KeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class KeyframeSchema + { + public static UIXTypeSchema Type; + + 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) => ((BaseKeyframe)instanceObj).RelativeTo; + + private static void SetRelativeTo(ref object instanceObj, object valueObj) => ((BaseKeyframe)instanceObj).RelativeTo = (RelativeTo)valueObj; + + 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() => Type = new UIXTypeSchema(130, "Keyframe", null, 153, typeof(BaseKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(130, "Time", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetTime), new SetValueHandler(SetTime), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(130, "RelativeTo", 171, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRelativeTo), new SetValueHandler(SetRelativeTo), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(130, "Interpolation", 121, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetInterpolation), new SetValueHandler(SetInterpolation), false); + Type.Initialize(null, null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..7dd7e60 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/LayoutInputSchema.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.LayoutInputSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class LayoutInputSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(133, "LayoutInput", null, 153, typeof(ILayoutInput), UIXTypeFlags.None); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..4d19022 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/LayoutOutputSchema.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.LayoutOutputSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class LayoutOutputSchema + { + public static UIXTypeSchema Type; + + private static object GetSize(object instanceObj) => ((LayoutOutput)instanceObj).Size; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(134, "LayoutOutput", null, 153, typeof(LayoutOutput), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(134, "Size", 195, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSize), null, false); + Type.Initialize(null, null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..cc559e6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/LayoutSchema.cs @@ -0,0 +1,97 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.LayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System.Collections.Generic; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class LayoutSchema + { + private static Dictionary s_NameToLayoutMap = new Dictionary(10); + public static UIXTypeSchema Type; + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str = (string)valueObj; + instanceObj = null; + object obj; + if (!s_NameToLayoutMap.TryGetValue(str.ToLowerInvariant(), out obj)) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "Layout"); + ILayout layout = (ILayout)obj; + instanceObj = layout; + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static object CallTryParseStringLayout(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + ILayout parameter2 = (ILayout)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + static LayoutSchema() + { + s_NameToLayoutMap.Add("anchor", new AnchorLayout()); + s_NameToLayoutMap.Add("default", DefaultLayout.Instance); + s_NameToLayoutMap.Add("dock", new DockLayout()); + s_NameToLayoutMap.Add("grid", new GridLayout()); + s_NameToLayoutMap.Add("scale", new ScaleLayout()); + s_NameToLayoutMap.Add("popup", new PopupLayout()); + s_NameToLayoutMap.Add("stack", new StackLayout()); + s_NameToLayoutMap.Add("form", new AnchorLayout() + { + SizeToHorizontalChildren = false, + SizeToVerticalChildren = false + }); + s_NameToLayoutMap.Add("horizontalflow", new FlowLayout() + { + Orientation = Orientation.Horizontal + }); + s_NameToLayoutMap.Add("verticalflow", new FlowLayout() + { + Orientation = Orientation.Vertical + }); + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(132, "Layout", null, 153, typeof(ILayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(132, "TryParse", new short[2] + { + 208, + 132 + }, 132, new InvokeHandler(CallTryParseStringLayout), true); + Type.Initialize(null, null, null, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/LightShaftInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/LightShaftInstanceSchema.cs new file mode 100644 index 0000000..f19c62f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/LightShaftInstanceSchema.cs @@ -0,0 +1,130 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.LightShaftInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class LightShaftInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetPosition(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Position", (Vector3)valueObj); + + private static void SetDecay(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Decay", (float)valueObj); + + private static void SetDensity(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Density", (float)valueObj); + + private static void SetFallOff(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("FallOff", (float)valueObj); + + private static void SetIntensity(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Intensity", (float)valueObj); + + private static void SetWeight(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Weight", (float)valueObj); + + private static object CallPlayPositionAnimationEffectVector3Animation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Position, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayDecayAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Decay, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayDensityAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Density, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayIntensityAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Intensity, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayFallOffAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.FallOff, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayWeightAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Weight, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(136, "LightShaftInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(136, "Position", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(136, "Decay", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetDecay), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(136, "Density", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetDensity), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(136, "FallOff", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetFallOff), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(136, "Intensity", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetIntensity), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(136, "Weight", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetWeight), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(136, "PlayPositionAnimation", new short[1] + { + 81 + }, 240, new InvokeHandler(CallPlayPositionAnimationEffectVector3Animation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(136, "PlayDecayAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayDecayAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(136, "PlayDensityAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayDensityAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(136, "PlayIntensityAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayIntensityAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(136, "PlayFallOffAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayFallOffAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(136, "PlayWeightAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayWeightAnimationEffectFloatAnimation), false); + Type.Initialize(null, null, new PropertySchema[6] + { + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema6 + }, new MethodSchema[6] + { + 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 new file mode 100644 index 0000000..e6fd674 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/LightShaftSchema.cs @@ -0,0 +1,109 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.LightShaftSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class LightShaftSchema + { + public static UIXTypeSchema Type; + + 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) => ((LightShaftElement)instanceObj).Decay; + + private static void SetDecay(ref object instanceObj, object valueObj) + { + LightShaftElement lightShaftElement = (LightShaftElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + lightShaftElement.Decay = num; + } + + private static object GetDensity(object instanceObj) => ((LightShaftElement)instanceObj).Density; + + private static void SetDensity(ref object instanceObj, object valueObj) + { + LightShaftElement lightShaftElement = (LightShaftElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + lightShaftElement.Density = num; + } + + private static object GetIntensity(object instanceObj) => ((LightShaftElement)instanceObj).Intensity; + + private static void SetIntensity(ref object instanceObj, object valueObj) + { + LightShaftElement lightShaftElement = (LightShaftElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + lightShaftElement.Intensity = num; + } + + private static object GetFallOff(object instanceObj) => ((LightShaftElement)instanceObj).FallOff; + + private static void SetFallOff(ref object instanceObj, object valueObj) + { + LightShaftElement lightShaftElement = (LightShaftElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + lightShaftElement.FallOff = num; + } + + private static object GetWeight(object instanceObj) => ((LightShaftElement)instanceObj).Weight; + + private static void SetWeight(ref object instanceObj, object valueObj) + { + LightShaftElement lightShaftElement = (LightShaftElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + lightShaftElement.Weight = num; + } + + private static object Construct() => new LightShaftElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(135, "LightShaft", null, 80, typeof(LightShaftElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(135, "Position", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPosition), new SetValueHandler(SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(135, "Decay", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetDecay), new SetValueHandler(SetDecay), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(135, "Density", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetDensity), new SetValueHandler(SetDensity), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(135, "Intensity", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetIntensity), new SetValueHandler(SetIntensity), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(135, "FallOff", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, false, new GetValueHandler(GetFallOff), new SetValueHandler(SetFallOff), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(135, "Weight", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetWeight), new SetValueHandler(SetWeight), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + 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 new file mode 100644 index 0000000..162276e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ListSchema.cs @@ -0,0 +1,225 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ListSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ListSchema + { + public static UIXTypeSchema Type; + + private static object GetCount(object instanceObj) => ((ICollection)instanceObj).Count; + + private static object GetSource(object instanceObj) => (IList)instanceObj; + + private static object GetCanSearch(object instanceObj) => (IList)instanceObj is IUIList uiList ? uiList.CanSearch : (object)false; + + private static object Construct() => new NotifyList(); + + private static object CallIsNullOrEmptyList(object instanceObj, object[] parameters) + { + IList parameter = (IList)parameters[0]; + return BooleanBoxes.Box(parameter == null || parameter.Count == 0); + } + + private static object Callget_ItemInt32(object instanceObj, object[] parameters) + { + IList list = (IList)instanceObj; + 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}'", parameter, "index"); + return null; + } + + private static object Callset_ItemInt32Object(object instanceObj, object[] parameters) + { + IList list = (IList)instanceObj; + int parameter1 = (int)parameters[0]; + object parameter2 = parameters[1]; + if (parameter1 < 0 || parameter1 >= list.Count) + { + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter1, "index"); + return null; + } + list[parameter1] = parameter2; + return null; + } + + private static object CallClear(object instanceObj, object[] parameters) + { + ((IList)instanceObj).Clear(); + return null; + } + + private static object CallAddObject(object instanceObj, object[] parameters) + { + ((IList)instanceObj).Add(parameters[0]); + return null; + } + + private static object CallRemoveObject(object instanceObj, object[] parameters) + { + ((IList)instanceObj).Remove(parameters[0]); + return null; + } + + private static object CallContainsObject(object instanceObj, object[] parameters) => ((IList)instanceObj).Contains(parameters[0]); + + private static object CallIndexOfObject(object instanceObj, object[] parameters) => ((IList)instanceObj).IndexOf(parameters[0]); + + private static object CallInsertInt32Object(object instanceObj, object[] parameters) + { + IList list = (IList)instanceObj; + int parameter1 = (int)parameters[0]; + object parameter2 = parameters[1]; + if (parameter1 < 0 || parameter1 > list.Count) + { + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter1, "index"); + return null; + } + list.Insert(parameter1, parameter2); + return null; + } + + private static object CallRemoveAtInt32(object instanceObj, object[] parameters) + { + IList list = (IList)instanceObj; + 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}'", parameter, "index"); + return null; + } + list.RemoveAt(parameter); + return null; + } + + private static object CallSearchForStringString(object instanceObj, object[] parameters) + { + IList list = (IList)instanceObj; + string parameter = (string)parameters[0]; + return list is IUIList uiList ? uiList.SearchForString(parameter) : (object)-1; + } + + private static object CallMoveInt32Int32(object instanceObj, object[] parameters) + { + IList list = (IList)instanceObj; + int parameter1 = (int)parameters[0]; + 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}'", parameter1, "oldIndex"); + return null; + } + if (parameter2 < 0 || parameter2 >= list.Count) + { + ErrorManager.ReportError("Script runtime failure: Invalid '{0}' value is out of range for '{1}'", parameter2, "newIndex"); + return null; + } + switch (list) + { + case IUIList uiList: + uiList.Move(parameter1, parameter2); + break; + case INotifyList notifyList: + notifyList.Move(parameter1, parameter2); + break; + default: + object obj = list[parameter1]; + list.RemoveAt(parameter1); + list.Insert(parameter2, obj); + break; + } + return null; + } + + private static object CallGetEnumerator(object instanceObj, object[] parameters) => ((IEnumerable)instanceObj).GetEnumerator(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(138, "List", null, 153, typeof(IList), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(138, "Count", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCount), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(138, "Source", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSource), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(138, "CanSearch", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCanSearch), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(138, "IsNullOrEmpty", new short[1] + { + 138 + }, 15, new InvokeHandler(CallIsNullOrEmptyList), true); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(138, "get_Item", new short[1] + { + 115 + }, 153, new InvokeHandler(Callget_ItemInt32), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(138, "set_Item", new short[2] + { + 115, + 153 + }, 240, new InvokeHandler(Callset_ItemInt32Object), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(138, "Clear", null, 240, new InvokeHandler(CallClear), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(138, "Add", new short[1] + { + 153 + }, 240, new InvokeHandler(CallAddObject), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(138, "Remove", new short[1] + { + 153 + }, 240, new InvokeHandler(CallRemoveObject), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(138, "Contains", new short[1] + { + 153 + }, 15, new InvokeHandler(CallContainsObject), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(138, "IndexOf", new short[1] + { + 153 + }, 115, new InvokeHandler(CallIndexOfObject), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(138, "Insert", new short[2] + { + 115, + 153 + }, 240, new InvokeHandler(CallInsertInt32Object), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(138, "RemoveAt", new short[1] + { + 115 + }, 240, new InvokeHandler(CallRemoveAtInt32), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(138, "SearchForString", new short[1] + { + 208 + }, 115, new InvokeHandler(CallSearchForStringString), false); + UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema(138, "Move", new short[2] + { + 115, + 115 + }, 240, new InvokeHandler(CallMoveInt32Int32), false); + UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema(138, "GetEnumerator", null, 86, new InvokeHandler(CallGetEnumerator), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[13] + { + 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 new file mode 100644 index 0000000..902f090 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MajorMinorSchema.cs @@ -0,0 +1,119 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MajorMinorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MajorMinorSchema + { + public static UIXTypeSchema Type; + + 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 = majorMinor; + } + + 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 = majorMinor; + } + + private static object Construct() => MajorMinor.Zero; + + private static object ConstructMajorMinor(object[] parameters) + { + object instanceObj = Construct(); + SetMajor(ref instanceObj, parameters[0]); + SetMinor(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringMajorMinor( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "MajorMinor", result1.Error); + SetMajor(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "MajorMinor", result2.Error); + SetMinor(ref instance, valueObj2); + return result2; + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + MajorMinor majorMinor = (MajorMinor)instanceObj; + writer.WriteInt32(majorMinor.Major); + writer.WriteInt32(majorMinor.Minor); + } + + private static object DecodeBinary(ByteCodeReader reader) => new MajorMinor(reader.ReadInt32(), reader.ReadInt32()); + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 2) + { + result = ConvertFromStringMajorMinor(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "MajorMinor"); + } + return result; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(139, "MajorMinor", null, 153, typeof(MajorMinor), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(139, "Major", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMajor), new SetValueHandler(SetMajor), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(139, "Minor", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMinor), new SetValueHandler(SetMinor), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(139, new short[2] + { + 115, + 115 + }, new ConstructHandler(ConstructMajorMinor)); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/MappingSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/MappingSchema.cs new file mode 100644 index 0000000..374c291 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MappingSchema.cs @@ -0,0 +1,48 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MappingSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MappingSchema + { + public static UIXTypeSchema Type; + + private static void SetProperty(ref object instanceObj, object valueObj) + { + } + + private static void SetSource(ref object instanceObj, object valueObj) + { + } + + private static void SetTarget(ref object instanceObj, object valueObj) + { + } + + private static void SetDefaultValue(ref object instanceObj, object valueObj) + { + } + + private static object Construct() => new object(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(140, "Mapping", null, -1, typeof(object), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(140, "Property", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetProperty), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(140, "Source", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetSource), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(140, "Target", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetTarget), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(140, "DefaultValue", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetDefaultValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[4] + { + 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 new file mode 100644 index 0000000..b2f441b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MarkupDataQueryInstanceSchema.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MarkupDataQueryInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MarkupDataQueryInstanceSchema + { + public static UIXTypeSchema Type; + + private static object GetStatus(object instanceObj) => ((MarkupDataQuery)instanceObj).Status; + + private static object GetResult(object instanceObj) => ((MarkupDataQuery)instanceObj).Result; + + private static object GetEnabled(object instanceObj) => BooleanBoxes.Box(((MarkupDataQuery)instanceObj).Enabled); + + private static void SetEnabled(ref object instanceObj, object valueObj) => ((MarkupDataQuery)instanceObj).Enabled = (bool)valueObj; + + private static object CallRefresh(object instanceObj, object[] parameters) + { + ((MarkupDataQuery)instanceObj).Refresh(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(142, "MarkupDataQueryInstance", null, 153, typeof(MarkupDataQuery), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(142, "Status", 47, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStatus), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(142, "Result", 143, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetResult), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(142, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEnabled), new SetValueHandler(SetEnabled), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(142, "Refresh", null, 240, new InvokeHandler(CallRefresh), false); + Type.Initialize(null, null, new PropertySchema[3] + { + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..445cc02 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MarkupDataTypeInstanceSchema.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MarkupDataTypeInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MarkupDataTypeInstanceSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(143, "MarkupDataTypeInstance", null, 153, typeof(MarkupDataType), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..a319111 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MarkupErrorSchema.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MarkupErrorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MarkupErrorSchema + { + public static UIXTypeSchema Type; + + private static object GetContext(object instanceObj) => ((MarkupError)instanceObj).Context; + + private static object GetMessage(object instanceObj) => ((MarkupError)instanceObj).Message; + + private static object GetUri(object instanceObj) => ((MarkupError)instanceObj).Uri; + + private static object GetLine(object instanceObj) => ((MarkupError)instanceObj).Line; + + private static object GetColumn(object instanceObj) => ((MarkupError)instanceObj).Column; + + private static object GetIsError(object instanceObj) => BooleanBoxes.Box(((MarkupError)instanceObj).IsError); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(144, "MarkupError", null, 153, typeof(MarkupError), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(144, "Context", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetContext), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(144, "Message", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMessage), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(144, "Uri", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetUri), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(144, "Line", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetLine), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(144, "Column", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetColumn), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(144, "IsError", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetIsError), null, false); + Type.Initialize(null, null, new PropertySchema[6] + { + 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 new file mode 100644 index 0000000..13b8f7b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MarkupSchema.cs @@ -0,0 +1,56 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MarkupSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MarkupSchema + { + public static UIXTypeSchema Type; + + private static object GetErrors(object instanceObj) => ((MarkupServices)instanceObj).Errors; + + private static object GetWarningsOnly(object instanceObj) => BooleanBoxes.Box(((MarkupServices)instanceObj).WarningsOnly); + + private static object Construct() => MarkupServices.Instance; + + private static object CallClearErrors(object instanceObj, object[] parameters) + { + ((MarkupServices)instanceObj).ClearErrors(); + return null; + } + + private static object CallIsDisposedObject(object instanceObj, object[] parameters) + { + object parameter = parameters[0]; + return parameter == null ? true : BooleanBoxes.Box(parameter is IDisposableObject disposableObject && disposableObject.IsDisposed); + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(141, "Markup", null, 153, typeof(MarkupServices), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(141, "Errors", 138, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetErrors), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(141, "WarningsOnly", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetWarningsOnly), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(141, "ClearErrors", null, 240, new InvokeHandler(CallClearErrors), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(141, "ErrorsDetected"); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(141, "IsDisposed", new short[1] + { + 153 + }, 15, new InvokeHandler(CallIsDisposedObject), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[2] + { + 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 new file mode 100644 index 0000000..0d4a5fd --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MathSchema.cs @@ -0,0 +1,288 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MathSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MathSchema + { + public static UIXTypeSchema Type; + + 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) => (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) => (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]; + + private static object CallAbsInt32(object instanceObj, object[] parameters) + { + int parameter = (int)parameters[0]; + int num = Math.Abs(parameter); + 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 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 ? num : parameters[0]; + } + + private static object CallRoundSingle(object instanceObj, object[] parameters) + { + float parameter = (float)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 ? num : parameters[0]; + } + + private static object CallFloorSingle(object instanceObj, object[] parameters) + { + float parameter = (float)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 ? num : parameters[0]; + } + + private static object CallCeilingSingle(object instanceObj, object[] parameters) + { + float parameter = (float)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 ? num : parameters[0]; + } + + private static object CallAcosDouble(object instanceObj, object[] parameters) => Math.Acos((double)parameters[0]); + + private static object CallAsinDouble(object instanceObj, object[] parameters) => Math.Asin((double)parameters[0]); + + private static object CallAtanDouble(object instanceObj, object[] parameters) => Math.Atan((double)parameters[0]); + + private static object CallAtan2DoubleDouble(object instanceObj, object[] parameters) => Math.Atan2((double)parameters[0], (double)parameters[1]); + + private static object CallCosDouble(object instanceObj, object[] parameters) => Math.Cos((double)parameters[0]); + + private static object CallCoshDouble(object instanceObj, object[] parameters) => Math.Cosh((double)parameters[0]); + + private static object CallSinDouble(object instanceObj, object[] parameters) => Math.Sin((double)parameters[0]); + + private static object CallSinhDouble(object instanceObj, object[] parameters) => Math.Sinh((double)parameters[0]); + + private static object CallTanDouble(object instanceObj, object[] parameters) => Math.Tan((double)parameters[0]); + + private static object CallTanhDouble(object instanceObj, object[] parameters) => Math.Tanh((double)parameters[0]); + + private static object CallSqrtDouble(object instanceObj, object[] parameters) => Math.Sqrt((double)parameters[0]); + + private static object CallPowDoubleDouble(object instanceObj, object[] parameters) => Math.Pow((double)parameters[0], (double)parameters[1]); + + private static object CallLogDouble(object instanceObj, object[] parameters) => Math.Log((double)parameters[0]); + + private static object CallLogDoubleDouble(object instanceObj, object[] parameters) => Math.Log((double)parameters[0], (double)parameters[1]); + + private static object CallLog10Double(object instanceObj, object[] parameters) => Math.Log10((double)parameters[0]); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(145, "Math", null, 153, typeof(object), UIXTypeFlags.Static); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(145, "Min", new short[2] + { + 115, + 115 + }, 115, new InvokeHandler(CallMinInt32Int32), true); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(145, "Min", new short[2] + { + 194, + 194 + }, 194, new InvokeHandler(CallMinSingleSingle), true); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(145, "Min", new short[2] + { + 61, + 61 + }, 61, new InvokeHandler(CallMinDoubleDouble), true); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(145, "Max", new short[2] + { + 115, + 115 + }, 115, new InvokeHandler(CallMaxInt32Int32), true); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(145, "Max", new short[2] + { + 194, + 194 + }, 194, new InvokeHandler(CallMaxSingleSingle), true); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(145, "Max", new short[2] + { + 61, + 61 + }, 61, new InvokeHandler(CallMaxDoubleDouble), true); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(145, "Abs", new short[1] + { + 115 + }, 115, new InvokeHandler(CallAbsInt32), true); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(145, "Abs", new short[1] + { + 194 + }, 194, new InvokeHandler(CallAbsSingle), true); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(145, "Abs", new short[1] + { + 61 + }, 61, new InvokeHandler(CallAbsDouble), true); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(145, "Round", new short[1] + { + 194 + }, 194, new InvokeHandler(CallRoundSingle), true); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(145, "Round", new short[1] + { + 61 + }, 61, new InvokeHandler(CallRoundDouble), true); + UIXMethodSchema uixMethodSchema12 = new UIXMethodSchema(145, "Floor", new short[1] + { + 194 + }, 194, new InvokeHandler(CallFloorSingle), true); + UIXMethodSchema uixMethodSchema13 = new UIXMethodSchema(145, "Floor", new short[1] + { + 61 + }, 61, new InvokeHandler(CallFloorDouble), true); + UIXMethodSchema uixMethodSchema14 = new UIXMethodSchema(145, "Ceiling", new short[1] + { + 194 + }, 194, new InvokeHandler(CallCeilingSingle), true); + UIXMethodSchema uixMethodSchema15 = new UIXMethodSchema(145, "Ceiling", new short[1] + { + 61 + }, 61, new InvokeHandler(CallCeilingDouble), true); + UIXMethodSchema uixMethodSchema16 = new UIXMethodSchema(145, "Acos", new short[1] + { + 61 + }, 61, new InvokeHandler(CallAcosDouble), true); + UIXMethodSchema uixMethodSchema17 = new UIXMethodSchema(145, "Asin", new short[1] + { + 61 + }, 61, new InvokeHandler(CallAsinDouble), true); + UIXMethodSchema uixMethodSchema18 = new UIXMethodSchema(145, "Atan", new short[1] + { + 61 + }, 61, new InvokeHandler(CallAtanDouble), true); + UIXMethodSchema uixMethodSchema19 = new UIXMethodSchema(145, "Atan2", new short[2] + { + 61, + 61 + }, 61, new InvokeHandler(CallAtan2DoubleDouble), true); + UIXMethodSchema uixMethodSchema20 = new UIXMethodSchema(145, "Cos", new short[1] + { + 61 + }, 61, new InvokeHandler(CallCosDouble), true); + UIXMethodSchema uixMethodSchema21 = new UIXMethodSchema(145, "Cosh", new short[1] + { + 61 + }, 61, new InvokeHandler(CallCoshDouble), true); + UIXMethodSchema uixMethodSchema22 = new UIXMethodSchema(145, "Sin", new short[1] + { + 61 + }, 61, new InvokeHandler(CallSinDouble), true); + UIXMethodSchema uixMethodSchema23 = new UIXMethodSchema(145, "Sinh", new short[1] + { + 61 + }, 61, new InvokeHandler(CallSinhDouble), true); + UIXMethodSchema uixMethodSchema24 = new UIXMethodSchema(145, "Tan", new short[1] + { + 61 + }, 61, new InvokeHandler(CallTanDouble), true); + UIXMethodSchema uixMethodSchema25 = new UIXMethodSchema(145, "Tanh", new short[1] + { + 61 + }, 61, new InvokeHandler(CallTanhDouble), true); + UIXMethodSchema uixMethodSchema26 = new UIXMethodSchema(145, "Sqrt", new short[1] + { + 61 + }, 61, new InvokeHandler(CallSqrtDouble), true); + UIXMethodSchema uixMethodSchema27 = new UIXMethodSchema(145, "Pow", new short[2] + { + 61, + 61 + }, 61, new InvokeHandler(CallPowDoubleDouble), true); + UIXMethodSchema uixMethodSchema28 = new UIXMethodSchema(145, "Log", new short[1] + { + 61 + }, 61, new InvokeHandler(CallLogDouble), true); + UIXMethodSchema uixMethodSchema29 = new UIXMethodSchema(145, "Log", new short[2] + { + 61, + 61 + }, 61, new InvokeHandler(CallLogDoubleDouble), true); + UIXMethodSchema uixMethodSchema30 = new UIXMethodSchema(145, "Log10", new short[1] + { + 61 + }, 61, new InvokeHandler(CallLog10Double), true); + Type.Initialize(null, null, null, new MethodSchema[30] + { + 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 new file mode 100644 index 0000000..55c96d6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MergeAnimationSchema.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MergeAnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MergeAnimationSchema + { + public static UIXTypeSchema Type; + + private static object GetSources(object instanceObj) => ((MergeAnimation)instanceObj).Sources; + + 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() => new MergeAnimation(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(147, "MergeAnimation", null, 104, typeof(MergeAnimation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(147, "Sources", 138, 104, ExpressionRestriction.NoAccess, false, null, false, new GetValueHandler(GetSources), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(147, "Type", 10, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetType), new SetValueHandler(SetType), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..92e087c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/MouseWheelHandlerSchema.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.MouseWheelHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class MouseWheelHandlerSchema + { + public static UIXTypeSchema Type; + + private static object GetHandle(object instanceObj) => BooleanBoxes.Box(((MouseWheelHandler)instanceObj).Handle); + + private static void SetHandle(ref object instanceObj, object valueObj) => ((MouseWheelHandler)instanceObj).Handle = (bool)valueObj; + + 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() => new MouseWheelHandler(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(150, "MouseWheelHandler", null, 110, typeof(MouseWheelHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(150, "Handle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandle), new SetValueHandler(SetHandle), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(150, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(150, "UpInvoked"); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(150, "DownInvoked"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, null, new EventSchema[2] + { + 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 new file mode 100644 index 0000000..6d953ae --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/NullSchema.cs @@ -0,0 +1,44 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.NullSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class NullSchema + { + public static UIXTypeSchema Type; + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + object obj1 = leftObj; + object obj2 = rightObj; + switch (op) + { + case OperationType.RelationalEquals: + return BooleanBoxes.Box(obj1 == obj2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(obj1 != obj2); + default: + return null; + } + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(152, "Null", null, -1, typeof(object), UIXTypeFlags.None); + + public static void Pass2Initialize() => Type.Initialize(null, null, null, null, null, null, null, null, null, null, new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs new file mode 100644 index 0000000..d0fba29 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ObjectSchema.cs @@ -0,0 +1,53 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ObjectSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ObjectSchema + { + public static UIXTypeSchema Type; + + private static object CallToString(object instanceObj, object[] parameters) => instanceObj.ToString(); + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + object objA = leftObj; + object objB = rightObj; + switch (op) + { + case OperationType.RelationalEquals: + return BooleanBoxes.Box(Equals(objA, objB)); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(!Equals(objA, objB)); + default: + return null; + } + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(153, "Object", "object", -1, typeof(object), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(153, "ToString", null, 208, new InvokeHandler(CallToString), false); + Type.Initialize(null, null, null, new MethodSchema[1] + { + uixMethodSchema + }, null, null, null, null, null, null, new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/OrientationKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/OrientationKeyframeSchema.cs new file mode 100644 index 0000000..ad7ff37 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/OrientationKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.OrientationKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class OrientationKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new OrientationKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(155, "OrientationKeyframe", null, 130, typeof(OrientationKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(155, "Value", 176, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..feea457 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PanelSchema.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PanelSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PanelSchema + { + public static UIXTypeSchema Type; + + private static object GetChildren(object instanceObj) => ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); + + private static object Construct() => new Panel(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(156, "Panel", null, 239, typeof(Panel), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(156, "Children", 138, 239, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetChildren), null, false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..cf3d0d9 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PlacementModeSchema.cs @@ -0,0 +1,118 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PlacementModeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PlacementModeSchema + { + public static UIXTypeSchema Type; + + private static object GetPopupPositions(object instanceObj) => new ArrayList(((PlacementMode)instanceObj).PopupPositions); + + private static void SetPopupPositions(ref object instanceObj, object valueObj) + { + PlacementMode placementMode = (PlacementMode)instanceObj; + IList list = (IList)valueObj; + PopupPosition[] popupPositionArray = new PopupPosition[list.Count]; + for (int index = 0; index < list.Count; ++index) + popupPositionArray[index] = (PopupPosition)list[index]; + placementMode.PopupPositions = popupPositionArray; + } + + 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() => new PlacementMode(); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str = (string)valueObj; + instanceObj = null; + PlacementMode instance = StringToInstance(str); + if (instance == null) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "PlacementMode"); + instanceObj = instance; + return Result.Success; + } + + private static object FindCanonicalInstance(string name) => StringToInstance(name); + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static object CallTryParseStringPlacementMode(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + PlacementMode parameter2 = (PlacementMode)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + private static PlacementMode StringToInstance(string value) + { + if (value == "Origin") + return PlacementMode.Origin; + if (value == "Left") + return PlacementMode.Left; + if (value == "Right") + return PlacementMode.Right; + if (value == "Top") + return PlacementMode.Top; + if (value == "Bottom") + return PlacementMode.Bottom; + if (value == "Center") + return PlacementMode.Center; + if (value == "MouseOrigin") + return PlacementMode.MouseOrigin; + if (value == "MouseBottom") + return PlacementMode.MouseBottom; + if (value == "FollowMouseOrigin") + return PlacementMode.FollowMouseOrigin; + return value == "FollowMouseBottom" ? PlacementMode.FollowMouseBottom : null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(157, "PlacementMode", null, 153, typeof(PlacementMode), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(157, "PopupPositions", 138, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPopupPositions), new SetValueHandler(SetPopupPositions), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(157, "MouseTarget", 149, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMouseTarget), new SetValueHandler(SetMouseTarget), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(157, "TryParse", new short[2] + { + 208, + 157 + }, 157, new InvokeHandler(CallTryParseStringPlacementMode), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + uixPropertySchema2, + uixPropertySchema1 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, new FindCanonicalInstanceHandler(FindCanonicalInstance), new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/PointLight2DInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PointLight2DInstanceSchema.cs new file mode 100644 index 0000000..7d629c6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PointLight2DInstanceSchema.cs @@ -0,0 +1,114 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PointLight2DInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PointLight2DInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetPosition(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Position", (Vector3)valueObj); + + private static void SetRadius(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Radius", (float)valueObj); + + private static void SetLightColor(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("LightColor", (Color)valueObj); + + private static void SetAmbientColor(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("AmbientColor", (Color)valueObj); + + private static void SetAttenuation(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Attenuation", (Vector3)valueObj); + + private static object CallPlayPositionAnimationEffectVector3Animation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Position, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayRadiusAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Radius, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayLightColorAnimationEffectColorAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.LightColor, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayAmbientColorAnimationEffectColorAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.AmbientColor, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayAttenuationAnimationEffectVector3Animation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Attenuation, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(160, "PointLight2DInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(160, "Position", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(160, "Radius", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetRadius), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(160, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetLightColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(160, "AmbientColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetAmbientColor), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(160, "Attenuation", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetAttenuation), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(160, "PlayPositionAnimation", new short[1] + { + 81 + }, 240, new InvokeHandler(CallPlayPositionAnimationEffectVector3Animation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(160, "PlayRadiusAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayRadiusAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(160, "PlayLightColorAnimation", new short[1] + { + 71 + }, 240, new InvokeHandler(CallPlayLightColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(160, "PlayAmbientColorAnimation", new short[1] + { + 71 + }, 240, new InvokeHandler(CallPlayAmbientColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(160, "PlayAttenuationAnimation", new short[1] + { + 81 + }, 240, new InvokeHandler(CallPlayAttenuationAnimationEffectVector3Animation), false); + Type.Initialize(null, null, new PropertySchema[5] + { + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[5] + { + 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 new file mode 100644 index 0000000..2839180 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PointLight2DSchema.cs @@ -0,0 +1,64 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PointLight2DSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PointLight2DSchema + { + public static UIXTypeSchema Type; + + 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) => ((PointLight2DElement)instanceObj).Radius; + + private static void SetRadius(ref object instanceObj, object valueObj) + { + PointLight2DElement pointLight2Delement = (PointLight2DElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + pointLight2Delement.Radius = num; + } + + private static void SetLightColor(ref object instanceObj, object valueObj) => ((PointLight2DElement)instanceObj).LightColor = ((Color)valueObj).RenderConvert(); + + private static void SetAmbientColor(ref object instanceObj, object valueObj) => ((PointLight2DElement)instanceObj).AmbientColor = ((Color)valueObj).RenderConvert(); + + 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() => new PointLight2DElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(159, "PointLight2D", null, 77, typeof(PointLight2DElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(159, "Position", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPosition), new SetValueHandler(SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(159, "Radius", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetRadius), new SetValueHandler(SetRadius), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(159, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetLightColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(159, "AmbientColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetAmbientColor), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(159, "Attenuation", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAttenuation), new SetValueHandler(SetAttenuation), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[5] + { + 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 new file mode 100644 index 0000000..ffc8220 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PointSchema.cs @@ -0,0 +1,153 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PointSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PointSchema + { + public static UIXTypeSchema Type; + + 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 = point; + } + + 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 = point; + } + + private static object Construct() => Point.Zero; + + private static object ConstructXY(object[] parameters) + { + object instanceObj = Construct(); + SetX(ref instanceObj, parameters[0]); + SetY(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringXY(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Point", result1.Error); + SetX(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Point", result2.Error); + SetY(ref instance, valueObj2); + return result2; + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Point point = (Point)instanceObj; + writer.WriteInt32(point.X); + writer.WriteInt32(point.Y); + } + + private static object DecodeBinary(ByteCodeReader reader) => new Point(reader.ReadInt32(), reader.ReadInt32()); + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 2) + { + result = ConvertFromStringXY(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Point"); + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.MathNegate: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + Point point1 = (Point)leftObj; + if (op == OperationType.MathNegate) + return -point1; + Point point2 = (Point)rightObj; + switch (op) + { + case OperationType.MathAdd: + return point1 + point2; + case OperationType.MathSubtract: + return point1 - point2; + case OperationType.RelationalEquals: + return BooleanBoxes.Box(point1 == point2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(point1 != point2); + default: + return null; + } + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(158, "Point", null, 153, typeof(Point), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(158, "X", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetX), new SetValueHandler(SetX), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(158, "Y", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetY), new SetValueHandler(SetY), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(158, new short[2] + { + 115, + 115 + }, new ConstructHandler(ConstructXY)); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, null, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutInputSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutInputSchema.cs new file mode 100644 index 0000000..6ecbd9f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutInputSchema.cs @@ -0,0 +1,72 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PopupLayoutInputSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PopupLayoutInputSchema + { + public static UIXTypeSchema Type; + + 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) => ((PopupLayoutInput)instanceObj).Placement; + + private static void SetPlacement(ref object instanceObj, object valueObj) => ((PopupLayoutInput)instanceObj).Placement = (PlacementMode)valueObj; + + private static object GetOffset(object instanceObj) => ((PopupLayoutInput)instanceObj).Offset; + + private static void SetOffset(ref object instanceObj, object valueObj) => ((PopupLayoutInput)instanceObj).Offset = (Point)valueObj; + + private static object GetStayInBounds(object instanceObj) => BooleanBoxes.Box(((PopupLayoutInput)instanceObj).StayInBounds); + + private static void SetStayInBounds(ref object instanceObj, object valueObj) => ((PopupLayoutInput)instanceObj).StayInBounds = (bool)valueObj; + + private static object GetRespectMenuDropAlignment(object instanceObj) => BooleanBoxes.Box(((PopupLayoutInput)instanceObj).RespectMenuDropAlignment); + + private static void SetRespectMenuDropAlignment(ref object instanceObj, object valueObj) => ((PopupLayoutInput)instanceObj).RespectMenuDropAlignment = (bool)valueObj; + + private static object GetConstrainToTarget(object instanceObj) => BooleanBoxes.Box(((PopupLayoutInput)instanceObj).ConstrainToTarget); + + private static void SetConstrainToTarget(ref object instanceObj, object valueObj) => ((PopupLayoutInput)instanceObj).ConstrainToTarget = (bool)valueObj; + + private static object GetFlippedHorizontally(object instanceObj) => BooleanBoxes.Box(((PopupLayoutInput)instanceObj).FlippedHorizontally); + + private static object GetFlippedVertically(object instanceObj) => BooleanBoxes.Box(((PopupLayoutInput)instanceObj).FlippedVertically); + + private static object Construct() => new PopupLayoutInput(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(162, "PopupLayoutInput", null, 133, typeof(PopupLayoutInput), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(162, "PlacementTarget", 239, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPlacementTarget), new SetValueHandler(SetPlacementTarget), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(162, "Placement", 157, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPlacement), new SetValueHandler(SetPlacement), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(162, "Offset", 158, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetOffset), new SetValueHandler(SetOffset), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(162, "StayInBounds", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetStayInBounds), new SetValueHandler(SetStayInBounds), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(162, "RespectMenuDropAlignment", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRespectMenuDropAlignment), new SetValueHandler(SetRespectMenuDropAlignment), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(162, "ConstrainToTarget", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetConstrainToTarget), new SetValueHandler(SetConstrainToTarget), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(162, "FlippedHorizontally", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFlippedHorizontally), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(162, "FlippedVertically", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFlippedVertically), null, false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[8] + { + 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 new file mode 100644 index 0000000..b5fb5ef --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PopupLayoutSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PopupLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PopupLayoutSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => new PopupLayout(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(161, "PopupLayout", null, 132, typeof(PopupLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() => Type.Initialize(new DefaultConstructHandler(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 new file mode 100644 index 0000000..76c6c63 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PopupPositionSchema.cs @@ -0,0 +1,62 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PopupPositionSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PopupPositionSchema + { + public static UIXTypeSchema Type; + + 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 = popupPosition; + } + + 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 = popupPosition; + } + + 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 = popupPosition; + } + + private static object Construct() => new PopupPosition(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(163, "PopupPosition", null, 153, typeof(PopupPosition), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(163, "Target", 118, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetTarget), new SetValueHandler(SetTarget), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(163, "Popup", 118, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPopup), new SetValueHandler(SetPopup), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(163, "Flipped", 89, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetFlipped), new SetValueHandler(SetFlipped), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..56fe7b5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PositionKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PositionKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PositionKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new PositionKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(164, "PositionKeyframe", null, 130, typeof(PositionKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(164, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..db67d70 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PositionXKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PositionXKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PositionXKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new PositionXKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(165, "PositionXKeyframe", null, 130, typeof(PositionXKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(165, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..e11cd59 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/PositionYKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.PositionYKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class PositionYKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new PositionYKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(166, "PositionYKeyframe", null, 130, typeof(PositionYKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(166, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..535d743 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/RandomSchema.cs @@ -0,0 +1,108 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.RandomSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Session; +using System; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class RandomSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => new Random(); + + private static object ConstructInt32(object[] parameters) => new Random((int)parameters[0]); + + 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 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) + { + Random random = (Random)instanceObj; + int parameter1 = (int)parameters[0]; + int parameter2 = (int)parameters[1]; + if (parameter1 <= parameter2) + 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) => ((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 random.NextDouble() * (parameter2 - parameter1) + parameter1; + } + + 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 (float)(random.NextDouble() * (parameter2 - (double)parameter1)) + parameter1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(167, "Random", null, 153, typeof(Random), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(167, new short[1] + { + 115 + }, new ConstructHandler(ConstructInt32)); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(167, "Next", null, 115, new InvokeHandler(CallNext), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(167, "Next", new short[1] + { + 115 + }, 115, new InvokeHandler(CallNextInt32), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(167, "Next", new short[2] + { + 115, + 115 + }, 115, new InvokeHandler(CallNextInt32Int32), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(167, "NextDouble", null, 61, new InvokeHandler(CallNextDouble), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(167, "NextDouble", new short[2] + { + 61, + 61 + }, 61, new InvokeHandler(CallNextDoubleDoubleDouble), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(167, "NextSingle", null, 194, new InvokeHandler(CallNextSingle), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(167, "NextSingle", new short[2] + { + 194, + 194 + }, 194, new InvokeHandler(CallNextSingleSingleSingle), false); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, null, new MethodSchema[7] + { + 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 new file mode 100644 index 0000000..61e86b1 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/RangedValueSchema.cs @@ -0,0 +1,71 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.RangedValueSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class RangedValueSchema + { + public static UIXTypeSchema Type; + + 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 (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) => ((IUIRangedValue)instanceObj).MaxValue; + + private static void SetMaxValue(ref object instanceObj, object valueObj) + { + IUIRangedValue uiRangedValue = (IUIRangedValue)instanceObj; + float num = (float)valueObj; + 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) => ((IUIRangedValue)instanceObj).Step; + + private static void SetStep(ref object instanceObj, object valueObj) => ((IUIRangedValue)instanceObj).Step = (float)valueObj; + + private static object GetRange(object instanceObj) => ((IUIRangedValue)instanceObj).Range; + + 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() => new Microsoft.Iris.ModelItems.RangedValue(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(168, "RangedValue", null, 231, typeof(IUIRangedValue), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(168, "MinValue", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMinValue), new SetValueHandler(SetMinValue), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(168, "MaxValue", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMaxValue), new SetValueHandler(SetMaxValue), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(168, "Step", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStep), new SetValueHandler(SetStep), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(168, "Range", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRange), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(168, "Value", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[5] + { + 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 new file mode 100644 index 0000000..314e2ea --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/RectangleSchema.cs @@ -0,0 +1,217 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.RectangleSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class RectangleSchema + { + public static UIXTypeSchema Type; + + 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 = rectangle; + } + + 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 = rectangle; + } + + 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 = rectangle; + } + + 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 = rectangle; + } + + private static object GetLeft(object instanceObj) => ((Rectangle)instanceObj).Left; + + private static object GetTop(object instanceObj) => ((Rectangle)instanceObj).Top; + + private static object GetRight(object instanceObj) => ((Rectangle)instanceObj).Right; + + private static object GetBottom(object instanceObj) => ((Rectangle)instanceObj).Bottom; + + private static object Construct() => Rectangle.Zero; + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string s = (string)valueObj; + instanceObj = null; + int result; + 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 = rectangle2; + return Result.Success; + } + + private static Result ConvertFromInt32(object valueObj, out object instanceObj) + { + int num1 = (int)valueObj; + instanceObj = null; + int num2 = num1; + Rectangle rectangle = Rectangle.FromLTRB(num2, num2, num2, num2); + instanceObj = rectangle; + return Result.Success; + } + + private static Result ConvertFromSingle(object valueObj, out object instanceObj) + { + float num1 = (float)valueObj; + instanceObj = null; + int num2 = (int)num1; + Rectangle rectangle = Rectangle.FromLTRB(num2, num2, num2, num2); + instanceObj = rectangle; + return Result.Success; + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Rectangle rectangle = (Rectangle)instanceObj; + writer.WriteInt32(rectangle.Left); + writer.WriteInt32(rectangle.Top); + writer.WriteInt32(rectangle.Right); + writer.WriteInt32(rectangle.Bottom); + } + + 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])); + + private static bool IsConversionSupported(TypeSchema fromType) => Int32Schema.Type.IsAssignableFrom(fromType) || SingleSchema.Type.IsAssignableFrom(fromType) || StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (Int32Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt32(from, out instance); + if (!result.Failed) + return result; + } + if (SingleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSingle(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + Rectangle rectangle1 = (Rectangle)leftObj; + Rectangle rectangle2 = (Rectangle)rightObj; + switch (op) + { + case OperationType.RelationalEquals: + return BooleanBoxes.Box(rectangle1 == rectangle2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(rectangle1 != rectangle2); + default: + return null; + } + } + + private static object CallTryParseStringRectangle(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + Rectangle parameter2 = (Rectangle)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(169, "Rectangle", null, 153, typeof(Rectangle), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(169, "X", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetX), new SetValueHandler(SetX), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(169, "Y", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetY), new SetValueHandler(SetY), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(169, "Width", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetWidth), new SetValueHandler(SetWidth), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(169, "Height", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetHeight), new SetValueHandler(SetHeight), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(169, "Left", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetLeft), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(169, "Top", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetTop), null, false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(169, "Right", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetRight), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(169, "Bottom", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetBottom), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(169, "Contains", new short[1] + { + 158 + }, 15, new InvokeHandler(CallContainsPoint), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(169, "TryParse", new short[2] + { + 208, + 169 + }, 169, new InvokeHandler(CallTryParseStringRectangle), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[8] + { + uixPropertySchema8, + uixPropertySchema4, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema6, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[2] + { + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/RelativeToSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RelativeToSchema.cs new file mode 100644 index 0000000..a53ca61 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/RelativeToSchema.cs @@ -0,0 +1,168 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.RelativeToSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class RelativeToSchema + { + public static UIXTypeSchema Type; + + 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) => ((RelativeTo)instanceObj).Property; + + private static void SetProperty(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).Property = (string)valueObj; + + 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) => ((RelativeTo)instanceObj).Power; + + private static void SetPower(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).Power = (int)valueObj; + + 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) => ((RelativeTo)instanceObj).Add; + + private static void SetAdd(ref object instanceObj, object valueObj) => ((RelativeTo)instanceObj).Add = (float)valueObj; + + private static object Construct() => new RelativeTo(); + + private static object ConstructSourceIdProperty(object[] parameters) + { + object instanceObj = Construct(); + SetSourceId(ref instanceObj, parameters[0]); + SetProperty(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringSourceIdProperty( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "RelativeTo", result1.Error); + SetSourceId(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], StringSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "RelativeTo", result2.Error); + SetProperty(ref instance, valueObj2); + return result2; + } + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str = (string)valueObj; + instanceObj = null; + RelativeTo instance = StringToInstance(str); + if (instance == null) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str, "RelativeTo"); + instanceObj = instance; + return Result.Success; + } + + private static object FindCanonicalInstance(string name) => StringToInstance(name); + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 2) + { + result = ConvertFromStringSourceIdProperty(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "RelativeTo"); + } + return result; + } + + private static object CallTryParseStringRelativeTo(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + RelativeTo parameter2 = (RelativeTo)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + private static RelativeTo StringToInstance(string value) + { + if (value == "Absolute") + return RelativeTo.Absolute; + if (value == "Current") + return RelativeTo.Current; + if (value == "CurrentSnapshotOnLoop") + return RelativeTo.CurrentSnapshotOnLoop; + return value == "Final" ? RelativeTo.Final : null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(171, "RelativeTo", null, 153, typeof(RelativeTo), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(171, "SourceId", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSourceId), new SetValueHandler(SetSourceId), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(171, "Property", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetProperty), new SetValueHandler(SetProperty), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(171, "Snapshot", 200, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSnapshot), new SetValueHandler(SetSnapshot), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(171, "Power", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPower), new SetValueHandler(SetPower), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(171, "Multiply", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMultiply), new SetValueHandler(SetMultiply), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(171, "Add", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAdd), new SetValueHandler(SetAdd), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(171, new short[2] + { + 115, + 208 + }, new ConstructHandler(ConstructSourceIdProperty)); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(171, "TryParse", new short[2] + { + 208, + 171 + }, 171, new InvokeHandler(CallTryParseStringRelativeTo), true); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[6] + { + uixPropertySchema6, + uixPropertySchema5, + uixPropertySchema4, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, new FindCanonicalInstanceHandler(FindCanonicalInstance), new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/RepeaterSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/RepeaterSchema.cs new file mode 100644 index 0000000..29c5e80 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/RepeaterSchema.cs @@ -0,0 +1,112 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.RepeaterSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class RepeaterSchema + { + public static UIXTypeSchema Type; + + 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) => ((Repeater)instanceObj).DividerName; + + private static void SetDividerName(ref object instanceObj, object valueObj) => ((Repeater)instanceObj).DividerName = (string)valueObj; + + 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) => ((Repeater)instanceObj).DefaultFocusIndex; + + private static void SetDefaultFocusIndex(ref object instanceObj, object valueObj) => ((Repeater)instanceObj).DefaultFocusIndex = (int)valueObj; + + private static void SetContent(ref object instanceObj, object valueObj) + { + Repeater repeater = (Repeater)instanceObj; + } + + private static void SetDivider(ref object instanceObj, object valueObj) + { + Repeater repeater = (Repeater)instanceObj; + } + + private static object GetDiscardOffscreenVisuals(object instanceObj) => BooleanBoxes.Box(((ViewItem)instanceObj).DiscardOffscreenVisuals); + + private static void SetDiscardOffscreenVisuals(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).DiscardOffscreenVisuals = (bool)valueObj; + + private static object GetContentSelectors(object instanceObj) => ((Repeater)instanceObj).ContentSelectors; + + private static object GetMaintainFocusedItemOnSourceChanges(object instanceObj) => BooleanBoxes.Box(((Repeater)instanceObj).MaintainFocusedItemOnSourceChanges); + + private static void SetMaintainFocusedItemOnSourceChanges( + ref object instanceObj, + object valueObj) + { + ((Repeater)instanceObj).MaintainFocusedItemOnSourceChanges = (bool)valueObj; + } + + private static object Construct() => new Repeater(); + + private static object CallNavigateIntoIndexInt32(object instanceObj, object[] parameters) + { + ((Repeater)instanceObj).NavigateIntoIndex((int)parameters[0]); + return null; + } + + private static object CallScrollIndexIntoViewInt32(object instanceObj, object[] parameters) + { + ((Repeater)instanceObj).ScrollIndexIntoView((int)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(173, "Repeater", null, 239, typeof(Repeater), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(173, "ContentName", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetContentName), new SetValueHandler(SetContentName), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(173, "DividerName", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDividerName), new SetValueHandler(SetDividerName), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(173, "Source", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSource), new SetValueHandler(SetSource), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(173, "DefaultFocusIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDefaultFocusIndex), new SetValueHandler(SetDefaultFocusIndex), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(173, "Content", 239, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetContent), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(173, "Divider", 239, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetDivider), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(173, "DiscardOffscreenVisuals", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDiscardOffscreenVisuals), new SetValueHandler(SetDiscardOffscreenVisuals), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(173, "ContentSelectors", 138, 227, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetContentSelectors), null, false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(173, "MaintainFocusedItemOnSourceChanges", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMaintainFocusedItemOnSourceChanges), new SetValueHandler(SetMaintainFocusedItemOnSourceChanges), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(173, "NavigateIntoIndex", new short[1] + { + 115 + }, 240, new InvokeHandler(CallNavigateIntoIndexInt32), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(173, "ScrollIndexIntoView", new short[1] + { + 115 + }, 240, new InvokeHandler(CallScrollIndexIntoViewInt32), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(173, "FocusedItemDiscarded"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[9] + { + uixPropertySchema5, + uixPropertySchema1, + uixPropertySchema8, + uixPropertySchema4, + uixPropertySchema7, + uixPropertySchema6, + uixPropertySchema2, + uixPropertySchema9, + uixPropertySchema3 + }, new MethodSchema[2] + { + 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 new file mode 100644 index 0000000..d3f093b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/RotateKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.RotateKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class RotateKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new RotateKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(174, "RotateKeyframe", null, 130, typeof(RotateKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(174, "Value", 176, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..d14b0f2 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/RotateLayoutSchema.cs @@ -0,0 +1,59 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.RotateLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class RotateLayoutSchema + { + public static RangeValidator ValidateRightAngle = new RangeValidator(RangeValidateRightAngle); + public static UIXTypeSchema Type; + + private static object GetAngleDegrees(object instanceObj) => ((RotateLayout)instanceObj).AngleDegrees; + + private static void SetAngleDegrees(ref object instanceObj, object valueObj) + { + RotateLayout rotateLayout = (RotateLayout)instanceObj; + int num = (int)valueObj; + Result result = ValidateRightAngle(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + rotateLayout.AngleDegrees = num; + } + + private static object Construct() => new RotateLayout(); + + private static Result RangeValidateRightAngle(object value) + { + int num = (int)value; + switch (num) + { + case 0: + case 90: + case 180: + case 270: + return Result.Success; + default: + return Result.Fail("Expecting a value of 0, 90, 180, or 270, but got {0}", num.ToString()); + } + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(175, "RotateLayout", null, 132, typeof(RotateLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(175, "AngleDegrees", 115, -1, ExpressionRestriction.None, false, ValidateRightAngle, false, new GetValueHandler(GetAngleDegrees), new SetValueHandler(SetAngleDegrees), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..680d5f6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/RotationSchema.cs @@ -0,0 +1,215 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.RotationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class RotationSchema + { + public static UIXTypeSchema Type; + + 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 = rotation; + } + + 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 = rotation; + } + + 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 = rotation; + } + + private static object Construct() => Rotation.Default; + + private static object ConstructAngleDegrees(object[] parameters) + { + object instanceObj = Construct(); + SetAngleDegrees(ref instanceObj, parameters[0]); + return instanceObj; + } + + private static object ConstructAngleRadians(object[] parameters) + { + object instanceObj = Construct(); + SetAngleRadians(ref instanceObj, parameters[0]); + return instanceObj; + } + + private static object ConstructAngleDegreesAxis(object[] parameters) + { + object instanceObj = Construct(); + SetAngleDegrees(ref instanceObj, parameters[0]); + SetAxis(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static object ConstructAngleRadiansAxis(object[] parameters) + { + object instanceObj = Construct(); + SetAngleRadians(ref instanceObj, parameters[0]); + SetAxis(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static object ConstructAxis(object[] parameters) + { + object instanceObj = Construct(); + SetAxis(ref instanceObj, parameters[0]); + return instanceObj; + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Rotation rotation = (Rotation)instanceObj; + Vector3Schema.Type.EncodeBinary(writer, rotation.Axis); + writer.WriteSingle(rotation.AngleRadians); + } + + private static object DecodeBinary(ByteCodeReader reader) + { + Vector3 axis = (Vector3)Vector3Schema.Type.DecodeBinary(reader); + return new Rotation(reader.ReadSingle(), axis); + } + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string str1 = (string)valueObj; + instanceObj = null; + Rotation rotation = Rotation.Default; + string[] strArray = str1.Split(';'); + if (strArray.Length != 2) + return Result.Fail("Unable to convert \"{0}\" to type '{1}'", str1, "Rotation"); + string str2 = strArray[1]; + object instance1; + Result result1 = Vector3Schema.Type.TypeConverter(str2, StringSchema.Type, out instance1); + if (result1.Failed) + 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(str4, StringSchema.Type, out instance2); + if (result2.Failed) + 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(str4, StringSchema.Type, out instance2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Rotation", result2.Error); + rotation.AngleDegrees = (int)instance2; + } + instanceObj = rotation; + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static object CallTryParseStringRotation(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + Rotation parameter2 = (Rotation)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(176, "Rotation", null, 153, typeof(Rotation), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(176, "Axis", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAxis), new SetValueHandler(SetAxis), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(176, "AngleRadians", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAngleRadians), new SetValueHandler(SetAngleRadians), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(176, "AngleDegrees", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAngleDegrees), new SetValueHandler(SetAngleDegrees), false); + UIXConstructorSchema constructorSchema1 = new UIXConstructorSchema(176, new short[1] + { + 115 + }, new ConstructHandler(ConstructAngleDegrees)); + UIXConstructorSchema constructorSchema2 = new UIXConstructorSchema(176, new short[1] + { + 194 + }, new ConstructHandler(ConstructAngleRadians)); + UIXConstructorSchema constructorSchema3 = new UIXConstructorSchema(176, new short[2] + { + 115, + 234 + }, new ConstructHandler(ConstructAngleDegreesAxis)); + UIXConstructorSchema constructorSchema4 = new UIXConstructorSchema(176, new short[2] + { + 194, + 234 + }, new ConstructHandler(ConstructAngleRadiansAxis)); + UIXConstructorSchema constructorSchema5 = new UIXConstructorSchema(176, new short[1] + { + 234 + }, new ConstructHandler(ConstructAxis)); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(176, "TryParse", new short[2] + { + 208, + 176 + }, 176, new InvokeHandler(CallTryParseStringRotation), true); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[5] + { + constructorSchema1, + constructorSchema2, + constructorSchema3, + constructorSchema4, + constructorSchema5 + }, new PropertySchema[3] + { + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/SavedKeyFocusSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SavedKeyFocusSchema.cs new file mode 100644 index 0000000..04e4c07 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SavedKeyFocusSchema.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SavedKeyFocusSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SavedKeyFocusSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(177, "SavedKeyFocus", null, 153, typeof(SavedKeyFocus), UIXTypeFlags.None); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..128b32a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ScaleKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ScaleKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ScaleKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new ScaleKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(178, "ScaleKeyframe", null, 130, typeof(ScaleKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(178, "Value", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..0090b26 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ScaleLayoutSchema.cs @@ -0,0 +1,65 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ScaleLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ScaleLayoutSchema + { + public static UIXTypeSchema Type; + + private static object GetMinimumScale(object instanceObj) => ((ScaleLayout)instanceObj).MinimumScale; + + private static void SetMinimumScale(ref object instanceObj, object valueObj) + { + ScaleLayout scaleLayout = (ScaleLayout)instanceObj; + Vector2 vector2 = (Vector2)valueObj; + Result result = Vector2Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + scaleLayout.MinimumScale = vector2; + } + + private static object GetMaximumScale(object instanceObj) => ((ScaleLayout)instanceObj).MaximumScale; + + private static void SetMaximumScale(ref object instanceObj, object valueObj) + { + ScaleLayout scaleLayout = (ScaleLayout)instanceObj; + Vector2 vector2 = (Vector2)valueObj; + Result result = Vector2Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + scaleLayout.MaximumScale = vector2; + } + + private static object GetMaintainAspectRatio(object instanceObj) => BooleanBoxes.Box(((ScaleLayout)instanceObj).MaintainAspectRatio); + + private static void SetMaintainAspectRatio(ref object instanceObj, object valueObj) => ((ScaleLayout)instanceObj).MaintainAspectRatio = (bool)valueObj; + + private static object Construct() => new ScaleLayout(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(179, "ScaleLayout", null, 132, typeof(ScaleLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(179, "MinimumScale", 233, -1, ExpressionRestriction.None, false, Vector2Schema.ValidateNotNegative, false, new GetValueHandler(GetMinimumScale), new SetValueHandler(SetMinimumScale), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(179, "MaximumScale", 233, -1, ExpressionRestriction.None, false, Vector2Schema.ValidateNotNegative, false, new GetValueHandler(GetMaximumScale), new SetValueHandler(SetMaximumScale), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(179, "MaintainAspectRatio", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMaintainAspectRatio), new SetValueHandler(SetMaintainAspectRatio), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..d79b931 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ScaleXKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ScaleXKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ScaleXKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new ScaleXKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(180, "ScaleXKeyframe", null, 130, typeof(ScaleXKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(180, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..562eb7e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ScaleYKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ScaleYKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ScaleYKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new ScaleYKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(181, "ScaleYKeyframe", null, 130, typeof(ScaleYKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(181, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..ed5c466 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ScrollModelBaseSchema.cs @@ -0,0 +1,137 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ScrollModelBaseSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ScrollModelBaseSchema + { + public static UIXTypeSchema Type; + + private static object GetScrollStep(object instanceObj) => ((ScrollModelBase)instanceObj).ScrollStep; + + private static void SetScrollStep(ref object instanceObj, object valueObj) + { + ScrollModelBase scrollModelBase = (ScrollModelBase)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + scrollModelBase.ScrollStep = num; + } + + private static object GetCanScrollUp(object instanceObj) => BooleanBoxes.Box(((ScrollModelBase)instanceObj).CanScrollUp); + + private static object GetCanScrollDown(object instanceObj) => BooleanBoxes.Box(((ScrollModelBase)instanceObj).CanScrollDown); + + private static object GetCurrentPage(object instanceObj) => ((ScrollModelBase)instanceObj).CurrentPage; + + private static object GetTotalPages(object instanceObj) => ((ScrollModelBase)instanceObj).TotalPages; + + private static object GetViewNear(object instanceObj) => ((ScrollModelBase)instanceObj).ViewNear; + + private static object GetViewFar(object instanceObj) => ((ScrollModelBase)instanceObj).ViewFar; + + private static object CallScrollInt32(object instanceObj, object[] parameters) + { + ((ScrollModelBase)instanceObj).Scroll((int)parameters[0]); + return null; + } + + private static object CallScrollUp(object instanceObj, object[] parameters) + { + ((ScrollModelBase)instanceObj).ScrollUp(); + return null; + } + + private static object CallScrollDown(object instanceObj, object[] parameters) + { + ((ScrollModelBase)instanceObj).ScrollDown(); + return null; + } + + private static object CallPageUp(object instanceObj, object[] parameters) + { + ((ScrollModelBase)instanceObj).PageUp(); + return null; + } + + private static object CallPageDown(object instanceObj, object[] parameters) + { + ((ScrollModelBase)instanceObj).PageDown(); + return null; + } + + private static object CallHome(object instanceObj, object[] parameters) + { + ((ScrollModelBase)instanceObj).Home(); + return null; + } + + private static object CallEnd(object instanceObj, object[] parameters) + { + ((ScrollModelBase)instanceObj).End(); + return null; + } + + private static object CallScrollToPositionSingle(object instanceObj, object[] parameters) + { + ((ScrollModelBase)instanceObj).ScrollToPosition((float)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(183, "ScrollModelBase", null, 153, typeof(ScrollModelBase), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(183, "ScrollStep", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetScrollStep), new SetValueHandler(SetScrollStep), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(183, "CanScrollUp", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCanScrollUp), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(183, "CanScrollDown", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCanScrollDown), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(183, "CurrentPage", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCurrentPage), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(183, "TotalPages", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetTotalPages), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(183, "ViewNear", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetViewNear), null, false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(183, "ViewFar", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetViewFar), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(183, "Scroll", new short[1] + { + 115 + }, 240, new InvokeHandler(CallScrollInt32), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(183, "ScrollUp", null, 240, new InvokeHandler(CallScrollUp), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(183, "ScrollDown", null, 240, new InvokeHandler(CallScrollDown), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(183, "PageUp", null, 240, new InvokeHandler(CallPageUp), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(183, "PageDown", null, 240, new InvokeHandler(CallPageDown), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(183, "Home", null, 240, new InvokeHandler(CallHome), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(183, "End", null, 240, new InvokeHandler(CallEnd), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(183, "ScrollToPosition", new short[1] + { + 194 + }, 240, new InvokeHandler(CallScrollToPositionSingle), false); + Type.Initialize(null, null, new PropertySchema[7] + { + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema4, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema6 + }, new MethodSchema[8] + { + 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 new file mode 100644 index 0000000..5ac9b5b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ScrollModelSchema.cs @@ -0,0 +1,114 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ScrollModelSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Library; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ScrollModelSchema + { + public static UIXTypeSchema Type; + + private static object GetEnabled(object instanceObj) => BooleanBoxes.Box(((ScrollModel)instanceObj).Enabled); + + private static void SetEnabled(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).Enabled = (bool)valueObj; + + private static object GetPageStep(object instanceObj) => ((ScrollModel)instanceObj).PageStep; + + private static void SetPageStep(ref object instanceObj, object valueObj) + { + ScrollModel scrollModel = (ScrollModel)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + scrollModel.PageStep = num; + } + + private static object GetPageSizedScrollStep(object instanceObj) => BooleanBoxes.Box(((ScrollModel)instanceObj).PageSizedScrollStep); + + private static void SetPageSizedScrollStep(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).PageSizedScrollStep = (bool)valueObj; + + 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) => ((ScrollModel)instanceObj).EndPadding; + + private static void SetEndPadding(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).EndPadding = (int)valueObj; + + 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) => ((ScrollModel)instanceObj).EndPaddingRelativeTo; + + private static void SetEndPaddingRelativeTo(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).EndPaddingRelativeTo = (RelativeEdge)valueObj; + + private static object GetLocked(object instanceObj) => BooleanBoxes.Box(((ScrollModel)instanceObj).Locked); + + private static void SetLocked(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).Locked = (bool)valueObj; + + 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) => ((ScrollModel)instanceObj).LockedAlignment; + + private static void SetLockedAlignment(ref object instanceObj, object valueObj) => ((ScrollModel)instanceObj).LockedAlignment = (float)valueObj; + + 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() => new ScrollModel(); + + private static object CallScrollFocusIntoView(object instanceObj, object[] parameters) + { + ((ScrollModel)instanceObj).ScrollFocusIntoView(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(182, "ScrollModel", null, 183, typeof(ScrollModel), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(182, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEnabled), new SetValueHandler(SetEnabled), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(182, "PageStep", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(GetPageStep), new SetValueHandler(SetPageStep), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(182, "PageSizedScrollStep", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPageSizedScrollStep), new SetValueHandler(SetPageSizedScrollStep), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(182, "BeginPadding", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetBeginPadding), new SetValueHandler(SetBeginPadding), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(182, "EndPadding", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEndPadding), new SetValueHandler(SetEndPadding), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(182, "BeginPaddingRelativeTo", 170, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetBeginPaddingRelativeTo), new SetValueHandler(SetBeginPaddingRelativeTo), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(182, "EndPaddingRelativeTo", 170, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEndPaddingRelativeTo), new SetValueHandler(SetEndPaddingRelativeTo), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(182, "Locked", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLocked), new SetValueHandler(SetLocked), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(182, "LockedPosition", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLockedPosition), new SetValueHandler(SetLockedPosition), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(182, "LockedAlignment", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLockedAlignment), new SetValueHandler(SetLockedAlignment), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(182, "ContentPositioningBehavior", 41, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetContentPositioningBehavior), new SetValueHandler(SetContentPositioningBehavior), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(182, "ScrollFocusIntoView", null, 240, new InvokeHandler(CallScrollFocusIntoView), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[11] + { + uixPropertySchema4, + uixPropertySchema6, + uixPropertySchema11, + uixPropertySchema1, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema10, + uixPropertySchema9, + uixPropertySchema3, + uixPropertySchema2 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..d03cfb0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ScrollerSchema.cs @@ -0,0 +1,50 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ScrollerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ScrollerSchema + { + public static UIXTypeSchema Type; + + 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) => ((Scroller)instanceObj).Prefetch; + + private static void SetPrefetch(ref object instanceObj, object valueObj) + { + Scroller scroller = (Scroller)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + scroller.Prefetch = num; + } + + private static object Construct() => new Scroller(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(184, "Scroller", null, 34, typeof(Scroller), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(184, "ScrollModel", 182, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetScrollModel), new SetValueHandler(SetScrollModel), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(184, "Prefetch", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetPrefetch), new SetValueHandler(SetPrefetch), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..44b833f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ScrollingHandlerSchema.cs @@ -0,0 +1,76 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ScrollingHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ScrollingHandlerSchema + { + public static UIXTypeSchema Type; + + private static object GetHandleDirectionalKeys(object instanceObj) => BooleanBoxes.Box(((ScrollingHandler)instanceObj).HandleDirectionalKeys); + + private static void SetHandleDirectionalKeys(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).HandleDirectionalKeys = (bool)valueObj; + + private static object GetHandlePageKeys(object instanceObj) => BooleanBoxes.Box(((ScrollingHandler)instanceObj).HandlePageKeys); + + private static void SetHandlePageKeys(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).HandlePageKeys = (bool)valueObj; + + private static object GetHandleHomeEndKeys(object instanceObj) => BooleanBoxes.Box(((ScrollingHandler)instanceObj).HandleHomeEndKeys); + + private static void SetHandleHomeEndKeys(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).HandleHomeEndKeys = (bool)valueObj; + + private static object GetHandlePageCommands(object instanceObj) => BooleanBoxes.Box(((ScrollingHandler)instanceObj).HandlePageCommands); + + private static void SetHandlePageCommands(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).HandlePageCommands = (bool)valueObj; + + private static object GetHandleMouseWheel(object instanceObj) => BooleanBoxes.Box(((ScrollingHandler)instanceObj).HandleMouseWheel); + + private static void SetHandleMouseWheel(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).HandleMouseWheel = (bool)valueObj; + + private static object GetScrollModel(object instanceObj) => ((ScrollingHandler)instanceObj).ScrollModel; + + private static void SetScrollModel(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).ScrollModel = (ScrollModel)valueObj; + + private static object GetUseFocusBehavior(object instanceObj) => BooleanBoxes.Box(((ScrollingHandler)instanceObj).UseFocusBehavior); + + private static void SetUseFocusBehavior(ref object instanceObj, object valueObj) => ((ScrollingHandler)instanceObj).UseFocusBehavior = (bool)valueObj; + + 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() => new ScrollingHandler(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(185, "ScrollingHandler", null, 110, typeof(ScrollingHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(185, "HandleDirectionalKeys", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandleDirectionalKeys), new SetValueHandler(SetHandleDirectionalKeys), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(185, "HandlePageKeys", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlePageKeys), new SetValueHandler(SetHandlePageKeys), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(185, "HandleHomeEndKeys", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandleHomeEndKeys), new SetValueHandler(SetHandleHomeEndKeys), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(185, "HandlePageCommands", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlePageCommands), new SetValueHandler(SetHandlePageCommands), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(185, "HandleMouseWheel", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandleMouseWheel), new SetValueHandler(SetHandleMouseWheel), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(185, "ScrollModel", 182, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetScrollModel), new SetValueHandler(SetScrollModel), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(185, "UseFocusBehavior", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetUseFocusBehavior), new SetValueHandler(SetUseFocusBehavior), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(185, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[8] + { + 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 new file mode 100644 index 0000000..d6b2515 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SelectionManagerSchema.cs @@ -0,0 +1,196 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SelectionManagerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SelectionManagerSchema + { + public static UIXTypeSchema Type; + + private static object GetCount(object instanceObj) => ((SelectionManager)instanceObj).Count; + + 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) => ((SelectionManager)instanceObj).Anchor; + + private static void SetAnchor(ref object instanceObj, object valueObj) => ((SelectionManager)instanceObj).Anchor = (int)valueObj; + + private static object GetSelectedIndices(object instanceObj) => ((SelectionManager)instanceObj).SelectedIndices; + + 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) => ((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() => new SelectionManager(); + + private static object CallIsSelectedInt32(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).IsSelected((int)parameters[0]); + + 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 null; + } + + 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) + { + SelectionManager selectionManager = (SelectionManager)instanceObj; + IList parameter1 = (IList)parameters[0]; + bool parameter2 = (bool)parameters[1]; + if (parameter1 == null) + { + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "indices"); + return null; + } + foreach (object obj in parameter1) + { + if (!(obj is int)) + { + ErrorManager.ReportError("Script runtime failure: Invalid value '{0}' within list '{1}'", obj, "indices"); + return null; + } + } + return selectionManager.Select(parameter1, parameter2); + } + + private static object CallToggleSelectInt32(object instanceObj, object[] parameters) => ((SelectionManager)instanceObj).ToggleSelect((int)parameters[0]); + + private static object CallToggleSelectList(object instanceObj, object[] parameters) + { + SelectionManager selectionManager = (SelectionManager)instanceObj; + IList parameter = (IList)parameters[0]; + if (parameter == null) + { + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "items"); + return null; + } + foreach (object obj in parameter) + { + if (!(obj is int)) + { + ErrorManager.ReportError("Script runtime failure: Invalid value '{0}' within list '{1}'", obj, "items"); + return null; + } + } + return selectionManager.ToggleSelect(parameter); + } + + 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) => ((SelectionManager)instanceObj).SelectRangeFromAnchor((int)parameters[0]); + + private static object CallSelectRangeFromAnchorInt32Int32( + object instanceObj, + object[] parameters) + { + return ((SelectionManager)instanceObj).SelectRangeFromAnchor((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() => Type = new UIXTypeSchema(186, "SelectionManager", null, 153, typeof(SelectionManager), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(186, "Count", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCount), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(186, "SourceList", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSourceList), new SetValueHandler(SetSourceList), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(186, "Anchor", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAnchor), new SetValueHandler(SetAnchor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(186, "SelectedIndices", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSelectedIndices), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(186, "SelectedItems", 138, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSelectedItems), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(186, "SingleSelect", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSingleSelect), new SetValueHandler(SetSingleSelect), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(186, "SelectedIndex", 115, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSelectedIndex), new SetValueHandler(SetSelectedIndex), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(186, "SelectedItem", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSelectedItem), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(186, "IsSelected", new short[1] + { + 115 + }, 15, new InvokeHandler(CallIsSelectedInt32), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(186, "IsRangeSelected", new short[2] + { + 115, + 115 + }, 15, new InvokeHandler(CallIsRangeSelectedInt32Int32), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(186, "Clear", null, 240, new InvokeHandler(CallClear), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(186, "Select", new short[2] + { + 115, + 15 + }, 15, new InvokeHandler(CallSelectInt32Boolean), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(186, "Select", new short[2] + { + 138, + 15 + }, 15, new InvokeHandler(CallSelectListBoolean), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(186, "ToggleSelect", new short[1] + { + 115 + }, 15, new InvokeHandler(CallToggleSelectInt32), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(186, "ToggleSelect", new short[1] + { + 138 + }, 15, new InvokeHandler(CallToggleSelectList), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(186, "SelectRange", new short[2] + { + 115, + 115 + }, 15, new InvokeHandler(CallSelectRangeInt32Int32), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(186, "SelectRangeFromAnchor", new short[1] + { + 115 + }, 15, new InvokeHandler(CallSelectRangeFromAnchorInt32), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(186, "SelectRangeFromAnchor", new short[2] + { + 115, + 115 + }, 15, new InvokeHandler(CallSelectRangeFromAnchorInt32Int32), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(186, "ToggleSelectRange", new short[2] + { + 115, + 115 + }, 15, new InvokeHandler(CallToggleSelectRangeInt32Int32), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[8] + { + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema7, + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema2 + }, new MethodSchema[11] + { + 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 new file mode 100644 index 0000000..6ed0ac9 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SelectionRangeSchema.cs @@ -0,0 +1,112 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SelectionRangeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SelectionRangeSchema + { + public static UIXTypeSchema Type; + + 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 = range; + } + + 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 = range; + } + + private static object GetIsEmpty(object instanceObj) => BooleanBoxes.Box(((Range)instanceObj).IsEmpty); + + private static object Construct() => new Range(0, 0); + + private static object ConstructBeginEnd(object[] parameters) + { + object instanceObj = Construct(); + SetBegin(ref instanceObj, parameters[0]); + SetEnd(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringBeginEnd(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "SelectionRange", result1.Error); + SetBegin(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "SelectionRange", result2.Error); + SetEnd(ref instance, valueObj2); + return result2; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 2) + { + result = ConvertFromStringBeginEnd(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "SelectionRange"); + } + return result; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(187, "SelectionRange", null, 153, typeof(Range), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(187, "Begin", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetBegin), new SetValueHandler(SetBegin), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(187, "End", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetEnd), new SetValueHandler(SetEnd), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(187, "IsEmpty", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetIsEmpty), null, false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(187, new short[2] + { + 115, + 115 + }, new ConstructHandler(ConstructBeginEnd)); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[3] + { + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 + }, null, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/SepiaInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SepiaInstanceSchema.cs new file mode 100644 index 0000000..a4f5149 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SepiaInstanceSchema.cs @@ -0,0 +1,116 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SepiaInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SepiaInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetLightColor(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Color", (Color)valueObj); + + private static void SetDarkColor(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Color", (Color)valueObj); + + private static void SetDesaturate(ref object instanceObj, object valueObj) + { + EffectElementWrapper effectElementWrapper = (EffectElementWrapper)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + effectElementWrapper.SetProperty("Desaturate", num); + } + + private static void SetTone(ref object instanceObj, object valueObj) + { + EffectElementWrapper effectElementWrapper = (EffectElementWrapper)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + effectElementWrapper.SetProperty("Tone", num); + } + + private static object CallPlayLightColorAnimationEffectColorAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.LightColor, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayDarkColorAnimationEffectColorAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.DarkColor, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayDesaturateAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Desaturate, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayToneAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Tone, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(189, "SepiaInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(189, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetLightColor), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(189, "DarkColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetDarkColor), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(189, "Desaturate", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, null, new SetValueHandler(SetDesaturate), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(189, "Tone", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, null, new SetValueHandler(SetTone), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(189, "PlayLightColorAnimation", new short[1] + { + 71 + }, 240, new InvokeHandler(CallPlayLightColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(189, "PlayDarkColorAnimation", new short[1] + { + 71 + }, 240, new InvokeHandler(CallPlayDarkColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(189, "PlayDesaturateAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayDesaturateAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(189, "PlayToneAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayToneAnimationEffectFloatAnimation), false); + Type.Initialize(null, null, new PropertySchema[4] + { + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema1, + uixPropertySchema4 + }, new MethodSchema[4] + { + 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 new file mode 100644 index 0000000..c9a8811 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SepiaSchema.cs @@ -0,0 +1,67 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SepiaSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SepiaSchema + { + public static UIXTypeSchema Type; + + private static void SetLightColor(ref object instanceObj, object valueObj) => ((SepiaElement)instanceObj).LightColor = ((Color)valueObj).RenderConvert(); + + private static void SetDarkColor(ref object instanceObj, object valueObj) => ((SepiaElement)instanceObj).DarkColor = ((Color)valueObj).RenderConvert(); + + private static object GetDesaturate(object instanceObj) => ((SepiaElement)instanceObj).Desaturate; + + private static void SetDesaturate(ref object instanceObj, object valueObj) + { + SepiaElement sepiaElement = (SepiaElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + sepiaElement.Desaturate = num; + } + + private static object GetTone(object instanceObj) => ((SepiaElement)instanceObj).Tone; + + private static void SetTone(ref object instanceObj, object valueObj) + { + SepiaElement sepiaElement = (SepiaElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + sepiaElement.Tone = num; + } + + private static object Construct() => new SepiaElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(188, "Sepia", null, 80, typeof(SepiaElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(188, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetLightColor), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(188, "DarkColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetDarkColor), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(188, "Desaturate", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetDesaturate), new SetValueHandler(SetDesaturate), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(188, "Tone", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetTone), new SetValueHandler(SetTone), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[4] + { + 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 new file mode 100644 index 0000000..04b2c0b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SharedSizeSchema.cs @@ -0,0 +1,84 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SharedSizeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SharedSizeSchema + { + public static UIXTypeSchema Type; + + private static object GetMaximumSize(object instanceObj) => ((SharedSize)instanceObj).MaximumSize; + + private static void SetMaximumSize(ref object instanceObj, object valueObj) + { + SharedSize sharedSize = (SharedSize)instanceObj; + Size size = (Size)valueObj; + Result result = SizeSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + sharedSize.MaximumSize = size; + } + + private static object GetMinimumSize(object instanceObj) => ((SharedSize)instanceObj).MinimumSize; + + private static void SetMinimumSize(ref object instanceObj, object valueObj) + { + SharedSize sharedSize = (SharedSize)instanceObj; + Size size = (Size)valueObj; + Result result = SizeSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + sharedSize.MinimumSize = size; + } + + private static object GetSize(object instanceObj) => ((SharedSize)instanceObj).Size; + + private static void SetSize(ref object instanceObj, object valueObj) + { + SharedSize sharedSize = (SharedSize)instanceObj; + Size size = (Size)valueObj; + Result result = SizeSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + sharedSize.Size = size; + } + + private static object Construct() => new SharedSize(); + + private static object CallAutoSize(object instanceObj, object[] parameters) + { + ((SharedSize)instanceObj).AutoSize(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(190, "SharedSize", null, 153, typeof(SharedSize), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(190, "MaximumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(GetMaximumSize), new SetValueHandler(SetMaximumSize), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(190, "MinimumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(GetMinimumSize), new SetValueHandler(SetMinimumSize), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(190, "Size", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(GetSize), new SetValueHandler(SetSize), false); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(190, "AutoSize", null, 240, new InvokeHandler(CallAutoSize), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 + }, new MethodSchema[1] + { + 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 new file mode 100644 index 0000000..05ba472 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ShortcutHandlerSchema.cs @@ -0,0 +1,56 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ShortcutHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ShortcutHandlerSchema + { + public static UIXTypeSchema Type; + + 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) => ((ShortcutHandler)instanceObj).Command; + + private static void SetCommand(ref object instanceObj, object valueObj) => ((ShortcutHandler)instanceObj).Command = (IUICommand)valueObj; + + private static object GetHandle(object instanceObj) => BooleanBoxes.Box(((ShortcutHandler)instanceObj).Handle); + + private static void SetHandle(ref object instanceObj, object valueObj) => ((ShortcutHandler)instanceObj).Handle = (bool)valueObj; + + 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() => new ShortcutHandler(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(192, "ShortcutHandler", null, 110, typeof(ShortcutHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(192, "Shortcut", 193, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetShortcut), new SetValueHandler(SetShortcut), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(192, "Command", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCommand), new SetValueHandler(SetCommand), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(192, "Handle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandle), new SetValueHandler(SetHandle), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(192, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(192, "Invoked"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[4] + { + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema1 + }, null, new EventSchema[1] + { + 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 new file mode 100644 index 0000000..7ad87cd --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SingleSchema.cs @@ -0,0 +1,239 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SingleSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SingleSchema + { + public static RangeValidator Validate0to1 = new RangeValidator(RangeValidate0to1); + public static RangeValidator ValidateNotNegative = new RangeValidator(RangeValidateNotNegative); + public static RangeValidator ValidateNotZero = new RangeValidator(RangeValidateNotZero); + public static UIXTypeSchema Type; + + private static object Construct() => 0.0f; + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + float num = (float)instanceObj; + writer.WriteSingle(num); + } + + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadSingle(); + + private static Result ConvertFromString(object valueObj, out object instanceObj) + { + string s = (string)valueObj; + instanceObj = null; + float 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 = null; + float num = flag ? 1f : 0.0f; + instanceObj = num; + return Result.Success; + } + + private static Result ConvertFromByte(object valueObj, out object instanceObj) + { + byte num1 = (byte)valueObj; + instanceObj = null; + float num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromInt32(object valueObj, out object instanceObj) + { + int num1 = (int)valueObj; + instanceObj = null; + float num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromInt64(object valueObj, out object instanceObj) + { + long num1 = (long)valueObj; + instanceObj = null; + float num2 = num1; + instanceObj = num2; + return Result.Success; + } + + private static Result ConvertFromDouble(object valueObj, out object instanceObj) + { + double num1 = (double)valueObj; + instanceObj = null; + float num2 = (float)num1; + instanceObj = num2; + return Result.Success; + } + + 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)); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (BooleanSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromBoolean(from, out instance); + if (!result.Failed) + return result; + } + if (ByteSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromByte(from, out instance); + if (!result.Failed) + return result; + } + if (DoubleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromDouble(from, out instance); + if (!result.Failed) + return result; + } + if (Int32Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt32(from, out instance); + if (!result.Failed) + return result; + } + if (Int64Schema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromInt64(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.MathMultiply: + case OperationType.MathDivide: + case OperationType.MathModulus: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.RelationalLessThan: + case OperationType.RelationalGreaterThan: + case OperationType.RelationalLessThanEquals: + case OperationType.RelationalGreaterThanEquals: + case OperationType.MathNegate: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + float num1 = (float)leftObj; + if (op == OperationType.MathNegate) + return (float)-num1; + float num2 = (float)rightObj; + switch (op - 1) + { + case 0: + return (float)(num1 + (double)num2); + case OperationType.MathAdd: + return (float)(num1 - (double)num2); + case OperationType.MathSubtract: + return (float)(num1 * (double)num2); + case OperationType.MathMultiply: + return (float)(num1 / (double)num2); + case OperationType.MathDivide: + return (float)(num1 % (double)num2); + case OperationType.LogicalOr: + return BooleanBoxes.Box(num1 == (double)num2); + case OperationType.RelationalEquals: + return BooleanBoxes.Box(num1 != (double)num2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(num1 < (double)num2); + case OperationType.RelationalLessThan: + return BooleanBoxes.Box(num1 > (double)num2); + case OperationType.RelationalGreaterThan: + return BooleanBoxes.Box(num1 <= (double)num2); + case OperationType.RelationalLessThanEquals: + return BooleanBoxes.Box(num1 >= (double)num2); + default: + return null; + } + } + + private static object CallTryParseStringSingle(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + float parameter2 = (float)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + private static Result RangeValidate0to1(object value) + { + float num = (float)value; + 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 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 num == 0.0 ? Result.Fail("Specified value '{0}' is not valid", num.ToString()) : Result.Success; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(194, "Single", "float", 153, typeof(float), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(194, "ToString", new short[1] + { + 208 + }, 208, new InvokeHandler(CallToStringString), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(194, "TryParse", new short[2] + { + 208, + 194 + }, 194, new InvokeHandler(CallTryParseStringSingle), true); + Type.Initialize(new DefaultConstructHandler(Construct), null, null, new MethodSchema[2] + { + uixMethodSchema1, + uixMethodSchema2 + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/SizeKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SizeKeyframeSchema.cs new file mode 100644 index 0000000..cddadc7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SizeKeyframeSchema.cs @@ -0,0 +1,33 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SizeKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SizeKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new SizeKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(196, "SizeKeyframe", null, 130, typeof(SizeKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(196, "Value", 233, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..c2d6c47 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SizeSchema.cs @@ -0,0 +1,126 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SizeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SizeSchema + { + public static RangeValidator ValidateNotNegative = new RangeValidator(RangeValidateNotNegative); + public static UIXTypeSchema Type; + + 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 = size; + } + + 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 = size; + } + + private static object Construct() => Size.Zero; + + private static object ConstructWidthHeight(object[] parameters) + { + object instanceObj = Construct(); + SetWidth(ref instanceObj, parameters[0]); + SetHeight(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringWidthHeight( + string[] splitString, + out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], Int32Schema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Size", result1.Error); + SetWidth(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], Int32Schema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Size", result2.Error); + SetHeight(ref instance, valueObj2); + return result2; + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Size size = (Size)instanceObj; + writer.WriteInt32(size.Width); + writer.WriteInt32(size.Height); + } + + private static object DecodeBinary(ByteCodeReader reader) => new Size(reader.ReadInt32(), reader.ReadInt32()); + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 2) + { + result = ConvertFromStringWidthHeight(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Size"); + } + return result; + } + + 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}", size.ToString()) : Result.Success; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(195, "Size", null, 153, typeof(Size), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(195, "Width", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetWidth), new SetValueHandler(SetWidth), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(195, "Height", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetHeight), new SetValueHandler(SetHeight), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(195, new short[2] + { + 115, + 115 + }, new ConstructHandler(ConstructWidthHeight)); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[2] + { + uixPropertySchema2, + uixPropertySchema1 + }, null, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/SizeXKeyframeSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SizeXKeyframeSchema.cs new file mode 100644 index 0000000..48b12b2 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SizeXKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SizeXKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SizeXKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new SizeXKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(197, "SizeXKeyframe", null, 130, typeof(SizeXKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(197, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..a5e3293 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SizeYKeyframeSchema.cs @@ -0,0 +1,32 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SizeYKeyframeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SizeYKeyframeSchema + { + public static UIXTypeSchema Type; + + 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() => new SizeYKeyframe(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(198, "SizeYKeyframe", null, 130, typeof(SizeYKeyframe), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(198, "Value", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValue), new SetValueHandler(SetValue), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..1e036c2 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SoundSchema.cs @@ -0,0 +1,100 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SoundSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Audio; +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.RenderAPI.Audio; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SoundSchema + { + public static UIXTypeSchema Type; + + 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) => ((Sound)instanceObj).SystemSoundEvent; + + private static void SetSystemSoundEvent(ref object instanceObj, object valueObj) => ((Sound)instanceObj).SystemSoundEvent = (SystemSoundEvent)valueObj; + + private static object Construct() => new Sound(); + + private static object ConstructSource(object[] parameters) + { + object instanceObj = Construct(); + SetSource(ref instanceObj, parameters[0]); + return instanceObj; + } + + private static Result ConvertFromStringSource(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj; + Result result = UIXLoadResult.ValidateStringAsValue(splitString[0], StringSchema.Type, null, out valueObj); + if (result.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Sound", result.Error); + SetSource(ref instance, valueObj); + return result; + } + + private static object CallPlay(object instanceObj, object[] parameters) + { + ((Sound)instanceObj).Play(); + return null; + } + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 1) + { + result = ConvertFromStringSource(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Sound"); + } + return result; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(201, "Sound", null, 153, typeof(Sound), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(201, "Source", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSource), new SetValueHandler(SetSource), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(201, "SystemSoundEvent", 211, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSystemSoundEvent), new SetValueHandler(SetSystemSoundEvent), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(201, new short[1] + { + 208 + }, new ConstructHandler(ConstructSource)); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(201, "Play", null, 240, new InvokeHandler(CallPlay), false); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DInstanceSchema.cs new file mode 100644 index 0000000..f31dbae --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DInstanceSchema.cs @@ -0,0 +1,165 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SpotLight2DInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Render; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SpotLight2DInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetPosition(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Position", (Vector3)valueObj); + + private static void SetDirectionAngle(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("DirectionAngle", (float)valueObj); + + private static void SetLightColor(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("LightColor", (Color)valueObj); + + private static void SetAmbientColor(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("AmbientColor", (Color)valueObj); + + private static void SetInnerConeAngle(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("InnerConeAngle", (float)valueObj); + + private static void SetOuterConeAngle(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("OuterConeAngle", (float)valueObj); + + private static void SetIntensity(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Intensity", (float)valueObj); + + private static void SetAttenuation(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Attenuation", (Vector3)valueObj); + + private static object CallPlayPositionAnimationEffectVector3Animation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Position, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayDirectionAngleAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.DirectionAngle, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayLightColorAnimationEffectColorAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.LightColor, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayAmbientColorAnimationEffectColorAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.AmbientColor, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayInnerConeAngleAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.InnerConeAngle, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayOuterConeAngleAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.OuterConeAngle, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayIntensityAnimationEffectFloatAnimation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Intensity, (EffectAnimation)parameters[0]); + return null; + } + + private static object CallPlayAttenuationAnimationEffectVector3Animation( + object instanceObj, + object[] parameters) + { + ((EffectElementWrapper)instanceObj).PlayAnimation(EffectProperty.Attenuation, (EffectAnimation)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(203, "SpotLight2DInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(203, "Position", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(203, "DirectionAngle", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetDirectionAngle), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(203, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetLightColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(203, "AmbientColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetAmbientColor), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(203, "InnerConeAngle", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetInnerConeAngle), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(203, "OuterConeAngle", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetOuterConeAngle), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(203, "Intensity", 194, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetIntensity), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(203, "Attenuation", 234, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetAttenuation), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(203, "PlayPositionAnimation", new short[1] + { + 81 + }, 240, new InvokeHandler(CallPlayPositionAnimationEffectVector3Animation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(203, "PlayDirectionAngleAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayDirectionAngleAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(203, "PlayLightColorAnimation", new short[1] + { + 71 + }, 240, new InvokeHandler(CallPlayLightColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(203, "PlayAmbientColorAnimation", new short[1] + { + 71 + }, 240, new InvokeHandler(CallPlayAmbientColorAnimationEffectColorAnimation), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(203, "PlayInnerConeAngleAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayInnerConeAngleAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(203, "PlayOuterConeAngleAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayOuterConeAngleAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(203, "PlayIntensityAnimation", new short[1] + { + 75 + }, 240, new InvokeHandler(CallPlayIntensityAnimationEffectFloatAnimation), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(203, "PlayAttenuationAnimation", new short[1] + { + 81 + }, 240, new InvokeHandler(CallPlayAttenuationAnimationEffectVector3Animation), false); + Type.Initialize(null, null, new PropertySchema[8] + { + uixPropertySchema4, + uixPropertySchema8, + uixPropertySchema2, + uixPropertySchema5, + uixPropertySchema7, + uixPropertySchema3, + uixPropertySchema6, + uixPropertySchema1 + }, new MethodSchema[8] + { + 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 new file mode 100644 index 0000000..0834f2c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SpotLight2DSchema.cs @@ -0,0 +1,100 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SpotLight2DSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SpotLight2DSchema + { + public static UIXTypeSchema Type; + + 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) => ((SpotLight2DElement)instanceObj).DirectionAngle; + + private static void SetDirectionAngle(ref object instanceObj, object valueObj) => ((SpotLight2DElement)instanceObj).DirectionAngle = (float)valueObj; + + private static void SetLightColor(ref object instanceObj, object valueObj) => ((SpotLight2DElement)instanceObj).LightColor = ((Color)valueObj).RenderConvert(); + + private static void SetAmbientColor(ref object instanceObj, object valueObj) => ((SpotLight2DElement)instanceObj).AmbientColor = ((Color)valueObj).RenderConvert(); + + private static object GetInnerConeAngle(object instanceObj) => ((SpotLight2DElement)instanceObj).InnerConeAngle; + + private static void SetInnerConeAngle(ref object instanceObj, object valueObj) + { + SpotLight2DElement spotLight2Delement = (SpotLight2DElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + spotLight2Delement.InnerConeAngle = num; + } + + private static object GetOuterConeAngle(object instanceObj) => ((SpotLight2DElement)instanceObj).OuterConeAngle; + + private static void SetOuterConeAngle(ref object instanceObj, object valueObj) + { + SpotLight2DElement spotLight2Delement = (SpotLight2DElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + spotLight2Delement.OuterConeAngle = num; + } + + private static object GetIntensity(object instanceObj) => ((SpotLight2DElement)instanceObj).Intensity; + + private static void SetIntensity(ref object instanceObj, object valueObj) + { + SpotLight2DElement spotLight2Delement = (SpotLight2DElement)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + spotLight2Delement.Intensity = num; + } + + 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() => new SpotLight2DElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(202, "SpotLight2D", null, 77, typeof(SpotLight2DElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(202, "Position", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPosition), new SetValueHandler(SetPosition), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(202, "DirectionAngle", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDirectionAngle), new SetValueHandler(SetDirectionAngle), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(202, "LightColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetLightColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(202, "AmbientColor", 35, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetAmbientColor), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(202, "InnerConeAngle", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetInnerConeAngle), new SetValueHandler(SetInnerConeAngle), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(202, "OuterConeAngle", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetOuterConeAngle), new SetValueHandler(SetOuterConeAngle), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(202, "Intensity", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, false, new GetValueHandler(GetIntensity), new SetValueHandler(SetIntensity), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(202, "Attenuation", 234, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAttenuation), new SetValueHandler(SetAttenuation), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[8] + { + 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 new file mode 100644 index 0000000..b61c24d --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/StackLayoutInputSchema.cs @@ -0,0 +1,39 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.StackLayoutInputSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class StackLayoutInputSchema + { + public static UIXTypeSchema Type; + + 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) => ((StackLayoutInput)instanceObj).MinimumSize; + + private static void SetMinimumSize(ref object instanceObj, object valueObj) => ((StackLayoutInput)instanceObj).MinimumSize = (Size)valueObj; + + private static object Construct() => new StackLayoutInput(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(205, "StackLayoutInput", null, 133, typeof(StackLayoutInput), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(205, "Priority", 206, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPriority), new SetValueHandler(SetPriority), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(205, "MinimumSize", 195, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMinimumSize), new SetValueHandler(SetMinimumSize), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..98b1a90 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/StackLayoutSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.StackLayoutSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Layouts; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class StackLayoutSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => new StackLayout(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(204, "StackLayout", null, 132, typeof(StackLayout), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() => Type.Initialize(new DefaultConstructHandler(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 new file mode 100644 index 0000000..7ef6416 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/StringSchema.cs @@ -0,0 +1,238 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.StringSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class StringSchema + { + public static UIXTypeSchema Type; + + private static object GetLength(object instanceObj) => ((string)instanceObj).Length; + + private static object Construct() => string.Empty; + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + string str = (string)instanceObj; + writer.WriteString(str); + } + + private static object DecodeBinary(ByteCodeReader reader) => reader.ReadString(); + + private static Result ConvertFromObject(object valueObj, out object instanceObj) + { + object obj = valueObj; + instanceObj = null; + string str = obj == null ? null : obj.ToString(); + instanceObj = str; + return Result.Success; + } + + private static object CallIsNullOrEmptyString(object instanceObj, object[] parameters) => BooleanBoxes.Box(string.IsNullOrEmpty((string)parameters[0])); + + private static object CallSubstringInt32(object instanceObj, object[] parameters) + { + string str = (string)instanceObj; + int parameter = (int)parameters[0]; + if (parameter >= 0 && parameter <= str.Length) + 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) + { + string str = (string)instanceObj; + int parameter1 = (int)parameters[0]; + 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}'", parameter1, "startIndex"); + return null; + } + if (parameter2 >= 0 && parameter1 + parameter2 >= 0 && parameter1 + parameter2 <= str.Length) + 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) => ((string)instanceObj).Trim(); + + private static object CallToLower(object instanceObj, object[] parameters) => ((string)instanceObj).ToLowerInvariant(); + + 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 string.Format(format, parameters); + } + + private static object CallFormatObjectObject(object instanceObj, object[] parameters) + { + string format = (string)instanceObj; + object parameter1 = parameters[0]; + object parameter2 = parameters[1]; + return string.Format(format, parameters); + } + + private static object CallFormatObjectObjectObject(object instanceObj, object[] parameters) + { + string format = (string)instanceObj; + object parameter1 = parameters[0]; + object parameter2 = parameters[1]; + object parameter3 = parameters[2]; + return string.Format(format, parameters); + } + + private static object CallFormatObjectObjectObjectObject( + object instanceObj, + object[] parameters) + { + string format = (string)instanceObj; + object parameter1 = parameters[0]; + object parameter2 = parameters[1]; + object parameter3 = parameters[2]; + object parameter4 = parameters[3]; + return string.Format(format, parameters); + } + + private static object CallFormatObjectObjectObjectObjectObject( + object instanceObj, + object[] parameters) + { + string format = (string)instanceObj; + object parameter1 = parameters[0]; + object parameter2 = parameters[1]; + object parameter3 = parameters[2]; + object parameter4 = parameters[3]; + object parameter5 = parameters[4]; + return string.Format(format, parameters); + } + + private static bool IsConversionSupported(TypeSchema fromType) => ObjectSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (ObjectSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromObject(from, out instance); + if (!result.Failed) + return result; + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + string str1 = (string)leftObj; + string str2 = (string)rightObj; + switch (op) + { + case OperationType.MathAdd: + return str1 + str2; + case OperationType.RelationalEquals: + return BooleanBoxes.Box(str1 == str2); + case OperationType.RelationalNotEquals: + return BooleanBoxes.Box(str1 != str2); + default: + return null; + } + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(208, "String", "string", 153, typeof(string), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(208, "Length", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetLength), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(208, "IsNullOrEmpty", new short[1] + { + 208 + }, 15, new InvokeHandler(CallIsNullOrEmptyString), true); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(208, "Substring", new short[1] + { + 115 + }, 208, new InvokeHandler(CallSubstringInt32), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(208, "Substring", new short[2] + { + 115, + 115 + }, 208, new InvokeHandler(CallSubstringInt32Int32), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(208, "Trim", null, 208, new InvokeHandler(CallTrim), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(208, "ToLower", null, 208, new InvokeHandler(CallToLower), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(208, "ToUpper", null, 208, new InvokeHandler(CallToUpper), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(208, "Format", new short[1] + { + 153 + }, 208, new InvokeHandler(CallFormatObject), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(208, "Format", new short[2] + { + 153, + 153 + }, 208, new InvokeHandler(CallFormatObjectObject), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(208, "Format", new short[3] + { + 153, + 153, + 153 + }, 208, new InvokeHandler(CallFormatObjectObjectObject), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(208, "Format", new short[4] + { + 153, + 153, + 153, + 153 + }, 208, new InvokeHandler(CallFormatObjectObjectObjectObject), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(208, "Format", new short[5] + { + 153, + 153, + 153, + 153, + 153 + }, 208, new InvokeHandler(CallFormatObjectObjectObjectObjectObject), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + uixPropertySchema + }, new MethodSchema[11] + { + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6, + uixMethodSchema7, + uixMethodSchema8, + uixMethodSchema9, + uixMethodSchema10, + uixMethodSchema11 + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/SwitchAnimationSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/SwitchAnimationSchema.cs new file mode 100644 index 0000000..f6f575c --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/SwitchAnimationSchema.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.SwitchAnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class SwitchAnimationSchema + { + public static UIXTypeSchema Type; + + 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) => ((SwitchAnimation)instanceObj).Options; + + 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() => new SwitchAnimation(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(210, "SwitchAnimation", null, 104, typeof(SwitchAnimation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(210, "Expression", 231, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetExpression), new SetValueHandler(SetExpression), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(210, "Options", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetOptions), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(210, "Type", 10, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetType), new SetValueHandler(SetType), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..4d9aab3 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TextEditingHandlerSchema.cs @@ -0,0 +1,203 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TextEditingHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TextEditingHandlerSchema + { + public static UIXTypeSchema Type; + + private static object GetAcceptsEnter(object instanceObj) => BooleanBoxes.Box(((TextEditingHandler)instanceObj).AcceptsEnter); + + private static void SetAcceptsEnter(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).AcceptsEnter = (bool)valueObj; + + private static object GetAcceptsTab(object instanceObj) => BooleanBoxes.Box(((TextEditingHandler)instanceObj).AcceptsTab); + + private static void SetAcceptsTab(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).AcceptsTab = (bool)valueObj; + + private static object GetCaretInfo(object instanceObj) => ((TextEditingHandler)instanceObj).CaretInfo; + + private static object GetEditableTextData(object instanceObj) => ((TextEditingHandler)instanceObj).EditableTextData; + + private static void SetEditableTextData(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).EditableTextData = (EditableTextData)valueObj; + + private static object GetOvertype(object instanceObj) => BooleanBoxes.Box(((TextEditingHandler)instanceObj).Overtype); + + private static void SetOvertype(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).Overtype = (bool)valueObj; + + 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) => ((TextEditingHandler)instanceObj).SelectionRange; + + private static void SetSelectionRange(ref object instanceObj, object valueObj) + { + TextEditingHandler textEditingHandler = (TextEditingHandler)instanceObj; + Range range = (Range)valueObj; + int num = 0; + 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}'", 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}'", range.End, "SelectionRange.End"); + textEditingHandler.SelectionRange = range; + } + + private static object GetCopyCommand(object instanceObj) => ((TextEditingHandler)instanceObj).CopyCommand; + + private static object GetCutCommand(object instanceObj) => ((TextEditingHandler)instanceObj).CutCommand; + + private static object GetDeleteCommand(object instanceObj) => ((TextEditingHandler)instanceObj).DeleteCommand; + + private static object GetPasteCommand(object instanceObj) => ((TextEditingHandler)instanceObj).PasteCommand; + + private static object GetSelectAllCommand(object instanceObj) => ((TextEditingHandler)instanceObj).SelectAllCommand; + + private static object GetUndoCommand(object instanceObj) => ((TextEditingHandler)instanceObj).UndoCommand; + + 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) => ((TextEditingHandler)instanceObj).VerticalScrollModel; + + private static void SetVerticalScrollModel(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).VerticalScrollModel = (TextScrollModel)valueObj; + + private static object GetDetectUrls(object instanceObj) => BooleanBoxes.Box(((TextEditingHandler)instanceObj).DetectUrls); + + private static void SetDetectUrls(ref object instanceObj, object valueObj) => ((TextEditingHandler)instanceObj).DetectUrls = (bool)valueObj; + + 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) => ((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) => ((InputHandler)instanceObj).HandlerStage; + + private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; + + private static object Construct() => new TextEditingHandler(); + + private static object CallCopy(object instanceObj, object[] parameters) + { + ((TextEditingHandler)instanceObj).Copy(); + return null; + } + + private static object CallCut(object instanceObj, object[] parameters) + { + ((TextEditingHandler)instanceObj).Cut(); + return null; + } + + private static object CallDelete(object instanceObj, object[] parameters) + { + ((TextEditingHandler)instanceObj).Delete(); + return null; + } + + private static object CallPaste(object instanceObj, object[] parameters) + { + ((TextEditingHandler)instanceObj).Paste(); + return null; + } + + private static object CallSelectAll(object instanceObj, object[] parameters) + { + ((TextEditingHandler)instanceObj).SelectAll(); + return null; + } + + private static object CallUndo(object instanceObj, object[] parameters) + { + ((TextEditingHandler)instanceObj).Undo(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(214, "TextEditingHandler", null, 110, typeof(TextEditingHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(214, "AcceptsEnter", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAcceptsEnter), new SetValueHandler(SetAcceptsEnter), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(214, "AcceptsTab", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAcceptsTab), new SetValueHandler(SetAcceptsTab), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(214, "CaretInfo", 26, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCaretInfo), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(214, "EditableTextData", 68, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEditableTextData), new SetValueHandler(SetEditableTextData), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(214, "Overtype", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetOvertype), new SetValueHandler(SetOvertype), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(214, "TextDisplay", 212, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetTextDisplay), new SetValueHandler(SetTextDisplay), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(214, "SelectionRange", 187, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSelectionRange), new SetValueHandler(SetSelectionRange), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(214, "CopyCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCopyCommand), null, false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(214, "CutCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCutCommand), null, false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(214, "DeleteCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDeleteCommand), null, false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(214, "PasteCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPasteCommand), null, false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(214, "SelectAllCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSelectAllCommand), null, false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(214, "UndoCommand", 40, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetUndoCommand), null, false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(214, "HorizontalScrollModel", 218, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHorizontalScrollModel), new SetValueHandler(SetHorizontalScrollModel), false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(214, "VerticalScrollModel", 218, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetVerticalScrollModel), new SetValueHandler(SetVerticalScrollModel), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(214, "DetectUrls", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDetectUrls), new SetValueHandler(SetDetectUrls), false); + UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema(214, "LinkColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLinkColor), new SetValueHandler(SetLinkColor), false); + UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema(214, "LinkClickedParameter", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLinkClickedParameter), null, false); + UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema(214, "InImeCompositionMode", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetInImeCompositionMode), new SetValueHandler(SetInImeCompositionMode), false); + UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema(214, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXEventSchema uixEventSchema1 = new UIXEventSchema(214, "TypingInputRejected"); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(214, "Copy", null, 240, new InvokeHandler(CallCopy), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(214, "Cut", null, 240, new InvokeHandler(CallCut), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(214, "Delete", null, 240, new InvokeHandler(CallDelete), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(214, "Paste", null, 240, new InvokeHandler(CallPaste), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(214, "SelectAll", null, 240, new InvokeHandler(CallSelectAll), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(214, "Undo", null, 240, new InvokeHandler(CallUndo), false); + UIXEventSchema uixEventSchema2 = new UIXEventSchema(214, "LinkClicked"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[20] + { + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema8, + uixPropertySchema9, + uixPropertySchema10, + uixPropertySchema16, + uixPropertySchema4, + uixPropertySchema20, + uixPropertySchema14, + uixPropertySchema19, + uixPropertySchema18, + uixPropertySchema17, + uixPropertySchema5, + uixPropertySchema11, + uixPropertySchema12, + uixPropertySchema7, + uixPropertySchema6, + uixPropertySchema13, + uixPropertySchema15 + }, new MethodSchema[6] + { + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4, + uixMethodSchema5, + uixMethodSchema6 + }, new EventSchema[2] + { + 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 new file mode 100644 index 0000000..a076d22 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TextFragmentSchema.cs @@ -0,0 +1,40 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TextFragmentSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TextFragmentSchema + { + public static UIXTypeSchema Type; + + private static object GetRuns(object instanceObj) => ((TextFragment)instanceObj).Runs; + + private static object GetTagName(object instanceObj) => ((TextFragment)instanceObj).TagName; + + private static object GetContent(object instanceObj) => ((TextFragment)instanceObj).Content; + + private static object GetAttributes(object instanceObj) => ((TextFragment)instanceObj).Attributes; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(215, "TextFragment", null, 153, typeof(TextFragment), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(215, "Runs", 138, 216, ExpressionRestriction.ReadOnly, false, null, false, new GetValueHandler(GetRuns), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(215, "TagName", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetTagName), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(215, "Content", 208, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetContent), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(215, "Attributes", 58, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAttributes), null, false); + Type.Initialize(null, null, new PropertySchema[4] + { + 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 new file mode 100644 index 0000000..6da6560 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TextRunDataSchema.cs @@ -0,0 +1,40 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TextRunDataSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TextRunDataSchema + { + public static UIXTypeSchema Type; + + private static object GetPosition(object instanceObj) => ((TextRunData)instanceObj).Position; + + private static object GetSize(object instanceObj) => ((TextRunData)instanceObj).Size; + + private static object GetColor(object instanceObj) => ((TextRunData)instanceObj).Color; + + private static object GetLineNumber(object instanceObj) => ((TextRunData)instanceObj).LineNumber; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(216, "TextRunData", null, 153, typeof(TextRunData), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(216, "Position", 158, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetPosition), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(216, "Size", 195, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSize), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(216, "Color", 35, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetColor), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(216, "LineNumber", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetLineNumber), null, false); + Type.Initialize(null, null, new PropertySchema[4] + { + 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 new file mode 100644 index 0000000..d237237 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TextRunRendererSchema.cs @@ -0,0 +1,46 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TextRunRendererSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TextRunRendererSchema + { + public static UIXTypeSchema Type; + + 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) => ((TextRunRenderer)instanceObj).Color; + + private static void SetColor(ref object instanceObj, object valueObj) => ((TextRunRenderer)instanceObj).Color = (Color)valueObj; + + 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() => new TextRunRenderer(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(217, "TextRunRenderer", null, 239, typeof(TextRunRenderer), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(217, "Data", 216, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetData), new SetValueHandler(SetData), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(217, "Color", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetColor), new SetValueHandler(SetColor), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(217, "Effect", 78, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEffect), new SetValueHandler(SetEffect), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..3aa9ee4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TextSchema.cs @@ -0,0 +1,178 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TextSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TextSchema + { + public static UIXTypeSchema Type; + + 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) => ((Text)instanceObj).Font; + + private static void SetFont(ref object instanceObj, object valueObj) => ((Text)instanceObj).Font = (Font)valueObj; + + private static object GetColor(object instanceObj) => ((Text)instanceObj).Color; + + private static void SetColor(ref object instanceObj, object valueObj) => ((Text)instanceObj).Color = (Color)valueObj; + + private static object GetWordWrap(object instanceObj) => BooleanBoxes.Box(((Text)instanceObj).WordWrap); + + private static void SetWordWrap(ref object instanceObj, object valueObj) => ((Text)instanceObj).WordWrap = (bool)valueObj; + + private static object GetMaximumLines(object instanceObj) => ((Text)instanceObj).MaximumLines; + + private static void SetMaximumLines(ref object instanceObj, object valueObj) + { + Text text = (Text)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + text.MaximumLines = num; + } + + 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) => ((Text)instanceObj).LineSpacing; + + private static void SetLineSpacing(ref object instanceObj, object valueObj) => ((Text)instanceObj).LineSpacing = (float)valueObj; + + private static object GetCharacterSpacing(object instanceObj) => ((Text)instanceObj).CharacterSpacing; + + private static void SetCharacterSpacing(ref object instanceObj, object valueObj) => ((Text)instanceObj).CharacterSpacing = (float)valueObj; + + private static object GetEnableKerning(object instanceObj) => BooleanBoxes.Box(((Text)instanceObj).EnableKerning); + + private static void SetEnableKerning(ref object instanceObj, object valueObj) => ((Text)instanceObj).EnableKerning = (bool)valueObj; + + private static object GetLastLineBounds(object instanceObj) => ((Text)instanceObj).LastLineBounds; + + 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) => ((Text)instanceObj).Style; + + private static void SetStyle(ref object instanceObj, object valueObj) => ((Text)instanceObj).Style = (TextStyle)valueObj; + + 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) => ((Text)instanceObj).Fragments; + + private static object GetTextSharpness(object instanceObj) => ((Text)instanceObj).TextSharpness; + + private static void SetTextSharpness(ref object instanceObj, object valueObj) => ((Text)instanceObj).TextSharpness = (TextSharpness)valueObj; + + private static object GetClipped(object instanceObj) => BooleanBoxes.Box(((Text)instanceObj).Clipped); + + private static object GetContributesToWidth(object instanceObj) => BooleanBoxes.Box(((Text)instanceObj).ContributesToWidth); + + private static void SetContributesToWidth(ref object instanceObj, object valueObj) => ((Text)instanceObj).ContributesToWidth = (bool)valueObj; + + 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) => ((ViewItem)instanceObj).Effect; + + private static void SetEffect(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Effect = (EffectClass)valueObj; + + private static object GetDisableIme(object instanceObj) => BooleanBoxes.Box(((Text)instanceObj).DisableIme); + + private static void SetDisableIme(ref object instanceObj, object valueObj) => ((Text)instanceObj).DisableIme = (bool)valueObj; + + 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) => ((Text)instanceObj).TextHighlightColor; + + private static void SetTextHighlightColor(ref object instanceObj, object valueObj) => ((Text)instanceObj).TextHighlightColor = (Color)valueObj; + + private static object GetUsePasswordMask(object instanceObj) => BooleanBoxes.Box(((Text)instanceObj).UsePasswordMask); + + private static void SetUsePasswordMask(ref object instanceObj, object valueObj) => ((Text)instanceObj).UsePasswordMask = (bool)valueObj; + + 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() => new Text(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(212, "Text", null, 239, typeof(Text), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(212, "Content", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetContent), new SetValueHandler(SetContent), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(212, "Font", 93, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFont), new SetValueHandler(SetFont), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(212, "Color", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetColor), new SetValueHandler(SetColor), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(212, "WordWrap", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetWordWrap), new SetValueHandler(SetWordWrap), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(212, "MaximumLines", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetMaximumLines), new SetValueHandler(SetMaximumLines), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(212, "LineAlignment", 137, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLineAlignment), new SetValueHandler(SetLineAlignment), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(212, "LineSpacing", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLineSpacing), new SetValueHandler(SetLineSpacing), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(212, "CharacterSpacing", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCharacterSpacing), new SetValueHandler(SetCharacterSpacing), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(212, "EnableKerning", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEnableKerning), new SetValueHandler(SetEnableKerning), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(212, "LastLineBounds", 169, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(GetLastLineBounds), null, false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(212, "FadeSize", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFadeSize), new SetValueHandler(SetFadeSize), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(212, "Style", 220, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetStyle), new SetValueHandler(SetStyle), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(212, "NamedStyles", 58, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetNamedStyles), new SetValueHandler(SetNamedStyles), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(212, "Fragments", 138, 215, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(GetFragments), null, false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(212, "TextSharpness", 219, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetTextSharpness), new SetValueHandler(SetTextSharpness), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(212, "Clipped", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetClipped), null, false); + UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema(212, "ContributesToWidth", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetContributesToWidth), new SetValueHandler(SetContributesToWidth), false); + UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema(212, "BoundsType", 213, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetBoundsType), new SetValueHandler(SetBoundsType), false); + UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema(212, "Effect", 78, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEffect), new SetValueHandler(SetEffect), false); + UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema(212, "DisableIme", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDisableIme), new SetValueHandler(SetDisableIme), false); + UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema(212, "HighlightColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHighlightColor), new SetValueHandler(SetHighlightColor), false); + UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema(212, "TextHighlightColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetTextHighlightColor), new SetValueHandler(SetTextHighlightColor), false); + UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema(212, "UsePasswordMask", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetUsePasswordMask), new SetValueHandler(SetUsePasswordMask), false); + UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema(212, "PasswordMask", 27, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPasswordMask), new SetValueHandler(SetPasswordMask), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[24] + { + 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 new file mode 100644 index 0000000..ada5efd --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TextScrollModelSchema.cs @@ -0,0 +1,21 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TextScrollModelSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TextScrollModelSchema + { + public static UIXTypeSchema Type; + + private static object Construct() => new TextScrollModel(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(218, "TextScrollModel", null, 183, typeof(TextScrollModel), UIXTypeFlags.None); + + public static void Pass2Initialize() => Type.Initialize(new DefaultConstructHandler(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 new file mode 100644 index 0000000..3b94915 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TextStyleSchema.cs @@ -0,0 +1,122 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TextStyleSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TextStyleSchema + { + public static RangeValidator ValidateFontFace = new RangeValidator(RangeValidateFontFace); + public static UIXTypeSchema Type; + + private static object GetFontFace(object instanceObj) => ((TextStyle)instanceObj).FontFace; + + private static void SetFontFace(ref object instanceObj, object valueObj) + { + TextStyle textStyle = (TextStyle)instanceObj; + string str = (string)valueObj; + Result result = ValidateFontFace(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + textStyle.FontFace = str; + } + + private static object GetFontSize(object instanceObj) => ((TextStyle)instanceObj).FontSize; + + private static void SetFontSize(ref object instanceObj, object valueObj) + { + TextStyle textStyle = (TextStyle)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + textStyle.FontSize = num; + } + + private static object GetBold(object instanceObj) => BooleanBoxes.Box(((TextStyle)instanceObj).Bold); + + private static void SetBold(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).Bold = (bool)valueObj; + + private static object GetItalic(object instanceObj) => BooleanBoxes.Box(((TextStyle)instanceObj).Italic); + + private static void SetItalic(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).Italic = (bool)valueObj; + + private static object GetUnderline(object instanceObj) => BooleanBoxes.Box(((TextStyle)instanceObj).Underline); + + private static void SetUnderline(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).Underline = (bool)valueObj; + + 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) => ((TextStyle)instanceObj).LineSpacing; + + private static void SetLineSpacing(ref object instanceObj, object valueObj) + { + TextStyle textStyle = (TextStyle)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + textStyle.LineSpacing = num; + } + + private static object GetEnableKerning(object instanceObj) => BooleanBoxes.Box(((TextStyle)instanceObj).EnableKerning); + + private static void SetEnableKerning(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).EnableKerning = (bool)valueObj; + + private static object GetCharacterSpacing(object instanceObj) => ((TextStyle)instanceObj).CharacterSpacing; + + private static void SetCharacterSpacing(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).CharacterSpacing = (float)valueObj; + + private static object GetFragment(object instanceObj) => BooleanBoxes.Box(((TextStyle)instanceObj).Fragment); + + private static void SetFragment(ref object instanceObj, object valueObj) => ((TextStyle)instanceObj).Fragment = (bool)valueObj; + + 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", str, "31") : Result.Success; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(220, "TextStyle", null, 153, typeof(TextStyle), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(220, "FontFace", 208, -1, ExpressionRestriction.None, false, ValidateFontFace, true, new GetValueHandler(GetFontFace), new SetValueHandler(SetFontFace), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(220, "FontSize", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(GetFontSize), new SetValueHandler(SetFontSize), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(220, "Bold", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetBold), new SetValueHandler(SetBold), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(220, "Italic", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetItalic), new SetValueHandler(SetItalic), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(220, "Underline", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetUnderline), new SetValueHandler(SetUnderline), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(220, "Color", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetColor), new SetValueHandler(SetColor), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(220, "LineSpacing", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotNegative, true, new GetValueHandler(GetLineSpacing), new SetValueHandler(SetLineSpacing), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(220, "EnableKerning", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEnableKerning), new SetValueHandler(SetEnableKerning), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(220, "CharacterSpacing", 194, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCharacterSpacing), new SetValueHandler(SetCharacterSpacing), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(220, "Fragment", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFragment), new SetValueHandler(SetFragment), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[10] + { + 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 new file mode 100644 index 0000000..ff96383 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TimerSchema.cs @@ -0,0 +1,74 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TimerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TimerSchema + { + public static UIXTypeSchema Type; + + private static object GetInterval(object instanceObj) => ((UITimer)instanceObj).Interval; + + private static void SetInterval(ref object instanceObj, object valueObj) + { + UITimer uiTimer = (UITimer)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + uiTimer.Interval = num; + } + + private static object GetEnabled(object instanceObj) => BooleanBoxes.Box(((UITimer)instanceObj).Enabled); + + private static void SetEnabled(ref object instanceObj, object valueObj) => ((UITimer)instanceObj).Enabled = (bool)valueObj; + + private static object GetAutoRepeat(object instanceObj) => BooleanBoxes.Box(((UITimer)instanceObj).AutoRepeat); + + private static void SetAutoRepeat(ref object instanceObj, object valueObj) => ((UITimer)instanceObj).AutoRepeat = (bool)valueObj; + + private static object Construct() => new UITimer(); + + private static object CallStart(object instanceObj, object[] parameters) + { + ((UITimer)instanceObj).Start(); + return null; + } + + private static object CallStop(object instanceObj, object[] parameters) + { + ((UITimer)instanceObj).Stop(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(221, "Timer", null, 153, typeof(UITimer), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(221, "Interval", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetInterval), new SetValueHandler(SetInterval), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(221, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEnabled), new SetValueHandler(SetEnabled), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(221, "AutoRepeat", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAutoRepeat), new SetValueHandler(SetAutoRepeat), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(221, "Tick"); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(221, "Start", null, 240, new InvokeHandler(CallStart), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(221, "Stop", null, 240, new InvokeHandler(CallStop), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, new MethodSchema[2] + { + 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 new file mode 100644 index 0000000..b10ca09 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TransformAnimationSchema.cs @@ -0,0 +1,60 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TransformAnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TransformAnimationSchema + { + public static UIXTypeSchema Type; + + 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) => ((TransformAnimation)instanceObj).Filter; + + private static void SetFilter(ref object instanceObj, object valueObj) => ((TransformAnimation)instanceObj).Filter = (KeyframeFilter)valueObj; + + 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) => ((TransformAnimation)instanceObj).TimeScale; + + private static void SetTimeScale(ref object instanceObj, object valueObj) => ((TransformAnimation)instanceObj).TimeScale = (float)valueObj; + + 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) => ((ReferenceAnimation)instanceObj).Type; + + private static object Construct() => new TransformAnimation(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(222, "TransformAnimation", null, 104, typeof(TransformAnimation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(222, "Delay", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetDelay), new SetValueHandler(SetDelay), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(222, "Filter", 131, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetFilter), new SetValueHandler(SetFilter), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(222, "Magnitude", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMagnitude), new SetValueHandler(SetMagnitude), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(222, "TimeScale", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetTimeScale), new SetValueHandler(SetTimeScale), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(222, "Source", 104, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSource), new SetValueHandler(SetSource), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(222, "Type", 10, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetType), null, false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + 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 new file mode 100644 index 0000000..f57cd28 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TransformByAttributeAnimationSchema.cs @@ -0,0 +1,62 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TransformByAttributeAnimationSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TransformByAttributeAnimationSchema + { + public static UIXTypeSchema Type; + + 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) => ((TransformByAttributeAnimation)instanceObj).MaxTimeScale; + + private static void SetMaxTimeScale(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).MaxTimeScale = (float)valueObj; + + 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) => ((TransformByAttributeAnimation)instanceObj).MaxMagnitude; + + private static void SetMaxMagnitude(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).MaxMagnitude = (float)valueObj; + + 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) => ((TransformByAttributeAnimation)instanceObj).ValueTransformer; + + private static void SetValueTransformer(ref object instanceObj, object valueObj) => ((TransformByAttributeAnimation)instanceObj).ValueTransformer = (ValueTransformer)valueObj; + + private static object Construct() => new TransformByAttributeAnimation(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(224, "TransformByAttributeAnimation", null, 222, typeof(TransformByAttributeAnimation), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(224, "Attribute", 223, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAttribute), new SetValueHandler(SetAttribute), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(224, "MaxTimeScale", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMaxTimeScale), new SetValueHandler(SetMaxTimeScale), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(224, "MaxDelay", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMaxDelay), new SetValueHandler(SetMaxDelay), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(224, "MaxMagnitude", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMaxMagnitude), new SetValueHandler(SetMaxMagnitude), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(224, "Override", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetOverride), new SetValueHandler(SetOverride), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(224, "ValueTransformer", 232, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetValueTransformer), new SetValueHandler(SetValueTransformer), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + 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 new file mode 100644 index 0000000..2baa59e --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TypeConstraintSchema.cs @@ -0,0 +1,36 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TypeConstraintSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TypeConstraintSchema + { + public static UIXTypeSchema 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) => ((TypeConstraint)instanceObj).Constraint; + + private static void SetConstraint(ref object instanceObj, object valueObj) => ((TypeConstraint)instanceObj).Constraint = (TypeSchema)valueObj; + + private static object Construct() => new TypeConstraint(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(226, "TypeConstraint", null, 153, typeof(TypeConstraint), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(226, "Type", 225, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetType), new SetValueHandler(SetType), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(226, "Constraint", 225, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetConstraint), new SetValueHandler(SetConstraint), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..c60e370 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TypeSchemaDefinition.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TypeSchemaDefinition +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TypeSchemaDefinition + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(225, "Type", null, 153, typeof(TypeSchema), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..b9a773b --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TypeSelectorSchema.cs @@ -0,0 +1,38 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TypeSelectorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TypeSelectorSchema + { + public static UIXTypeSchema 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) => ((TypeSelector)instanceObj).ContentName; + + private static void SetContentName(ref object instanceObj, object valueObj) => ((TypeSelector)instanceObj).ContentName = (string)valueObj; + + private static object Construct() => new TypeSelector(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(227, "TypeSelector", null, 153, typeof(TypeSelector), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(227, "Type", 225, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetType), new SetValueHandler(SetType), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(227, "ContentName", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetContentName), new SetValueHandler(SetContentName), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[2] + { + 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 new file mode 100644 index 0000000..ae749db --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/TypingHandlerSchema.cs @@ -0,0 +1,56 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.TypingHandlerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class TypingHandlerSchema + { + public static UIXTypeSchema Type; + + 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) => ((InputHandler)instanceObj).HandlerStage; + + private static void SetHandlerStage(ref object instanceObj, object valueObj) => ((InputHandler)instanceObj).HandlerStage = (InputHandlerStage)valueObj; + + private static object GetSubmitOnEnter(object instanceObj) => BooleanBoxes.Box(((TypingHandler)instanceObj).SubmitOnEnter); + + private static void SetSubmitOnEnter(ref object instanceObj, object valueObj) => ((TypingHandler)instanceObj).SubmitOnEnter = (bool)valueObj; + + private static object GetTreatEscapeAsBackspace(object instanceObj) => BooleanBoxes.Box(((TypingHandler)instanceObj).TreatEscapeAsBackspace); + + private static void SetTreatEscapeAsBackspace(ref object instanceObj, object valueObj) => ((TypingHandler)instanceObj).TreatEscapeAsBackspace = (bool)valueObj; + + private static object Construct() => new TypingHandler(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(228, "TypingHandler", null, 110, typeof(TypingHandler), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(228, "EditableTextData", 68, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEditableTextData), new SetValueHandler(SetEditableTextData), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(228, "HandlerStage", 112, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHandlerStage), new SetValueHandler(SetHandlerStage), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(228, "SubmitOnEnter", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSubmitOnEnter), new SetValueHandler(SetSubmitOnEnter), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(228, "TreatEscapeAsBackspace", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetTreatEscapeAsBackspace), new SetValueHandler(SetTreatEscapeAsBackspace), false); + UIXEventSchema uixEventSchema = new UIXEventSchema(228, "TypingInputRejected"); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[4] + { + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4 + }, null, new EventSchema[1] + { + 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 new file mode 100644 index 0000000..cb78843 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/UISchema.cs @@ -0,0 +1,59 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.UISchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class UISchema + { + public static UIXTypeSchema Type; + + private static object GetProperties(object instanceObj) => ((UIClass)instanceObj).Storage; + + private static object GetLocals(object instanceObj) => ((UIClass)instanceObj).Storage; + + private static object GetInput(object instanceObj) => ((UIClass)instanceObj).EnsureInputHandlerStorage(); + + private static object GetContent(object instanceObj) => ((UIClass)instanceObj).RootItem; + + private static void SetContent(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).SetRootItem((ViewItem)valueObj); + + private static object GetFlippable(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).Flippable); + + private static void SetFlippable(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).Flippable = (bool)valueObj; + + private static void SetBase(ref object instanceObj, object valueObj) + { + UIClass uiClass = (UIClass)instanceObj; + } + + private static object GetScripts(object instanceObj) => (object)null; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(229, "UI", null, -1, typeof(UIClass), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(229, "Properties", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetProperties), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(229, "Locals", 58, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetLocals), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(229, "Input", 138, 110, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetInput), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(229, "Content", 239, -1, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetContent), new SetValueHandler(SetContent), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(229, "Flippable", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFlippable), new SetValueHandler(SetFlippable), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(229, "Base", 208, -1, ExpressionRestriction.NoAccess, false, null, true, null, new SetValueHandler(SetBase), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(229, "Scripts", 138, 240, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetScripts), null, false); + Type.Initialize(null, null, new PropertySchema[7] + { + 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 new file mode 100644 index 0000000..9f46e9f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/UIStateSchema.cs @@ -0,0 +1,169 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.UIStateSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Input; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class UIStateSchema + { + public static UIXTypeSchema Type; + + private static object GetCreateInterestOnFocus(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).CreateInterestOnFocus); + + private static void SetCreateInterestOnFocus(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).CreateInterestOnFocus = (bool)valueObj; + + private static object GetCursor(object instanceObj) => ((UIClass)instanceObj).Cursor; + + private static void SetCursor(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).Cursor = (CursorID)valueObj; + + private static object GetDirectKeyFocus(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).DirectKeyFocus); + + private static object GetDirectMouseFocus(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).DirectMouseFocus); + + 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) => ((UIClass)instanceObj).FocusInterestTargetMargins; + + private static void SetFocusInterestTargetMargins(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).FocusInterestTargetMargins = (Inset)valueObj; + + private static object GetKeyFocus(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).KeyFocus); + + private static object GetKeyFocusOnMouseDown(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).KeyFocusOnMouseDown); + + private static void SetKeyFocusOnMouseDown(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).KeyFocusOnMouseDown = (bool)valueObj; + + private static object GetKeyFocusOnMouseEnter(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).KeyFocusOnMouseEnter); + + private static void SetKeyFocusOnMouseEnter(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).KeyFocusOnMouseEnter = (bool)valueObj; + + private static object GetKeyInteractive(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).KeyInteractive); + + private static void SetKeyInteractive(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).KeyInteractive = (bool)valueObj; + + private static object GetMouseFocus(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).MouseFocus); + + private static object GetMouseInteractive(object instanceObj) => ((UIClass)instanceObj).MouseInteractive; + + private static void SetMouseInteractive(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).SetMouseInteractive((bool)valueObj, true); + + private static object GetEnabled(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).Enabled); + + private static void SetEnabled(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).Enabled = (bool)valueObj; + + private static object GetFullyEnabled(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).FullyEnabled); + + private static object GetAllowDoubleClicks(object instanceObj) => BooleanBoxes.Box(((UIClass)instanceObj).AllowDoubleClicks); + + private static void SetAllowDoubleClicks(ref object instanceObj, object valueObj) => ((UIClass)instanceObj).AllowDoubleClicks = (bool)valueObj; + + private static object GetPaintOrder(object instanceObj) => (int)((UIClass)instanceObj).PaintOrder; + + private static void SetPaintOrder(ref object instanceObj, object valueObj) + { + UIClass uiClass = (UIClass)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + uiClass.PaintOrder = (uint)num; + } + + private static object CallDisposeOwnedObjectObject(object instanceObj, object[] parameters) + { + UIClass uiClass = (UIClass)instanceObj; + object parameter = parameters[0]; + if (parameter == null) + return null; + if (!(parameter is IDisposableObject disposable)) + { + 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", TypeSchema.NameFromInstance(disposable), uiClass.TypeSchema.Name); + return null; + } + disposable.Dispose(uiClass); + return null; + } + + private static object CallNavigateInto(object instanceObj, object[] parameters) + { + ((UIClass)instanceObj).NavigateInto(); + return null; + } + + private static object CallNavigateIntoBoolean(object instanceObj, object[] parameters) + { + ((UIClass)instanceObj).NavigateInto((bool)parameters[0]); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(230, "UIState", null, -1, typeof(UIClass), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(230, "CreateInterestOnFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCreateInterestOnFocus), new SetValueHandler(SetCreateInterestOnFocus), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(230, "Cursor", 44, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCursor), new SetValueHandler(SetCursor), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(230, "DirectKeyFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDirectKeyFocus), null, false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(230, "DirectMouseFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDirectMouseFocus), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(230, "FocusInterestTarget", 239, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFocusInterestTarget), new SetValueHandler(SetFocusInterestTarget), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(230, "FocusInterestTargetMargins", 114, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFocusInterestTargetMargins), new SetValueHandler(SetFocusInterestTargetMargins), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(230, "KeyFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetKeyFocus), null, false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(230, "KeyFocusOnMouseDown", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetKeyFocusOnMouseDown), new SetValueHandler(SetKeyFocusOnMouseDown), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(230, "KeyFocusOnMouseEnter", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetKeyFocusOnMouseEnter), new SetValueHandler(SetKeyFocusOnMouseEnter), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(230, "KeyInteractive", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetKeyInteractive), new SetValueHandler(SetKeyInteractive), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(230, "MouseFocus", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMouseFocus), null, false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(230, "MouseInteractive", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMouseInteractive), new SetValueHandler(SetMouseInteractive), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(230, "Enabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetEnabled), new SetValueHandler(SetEnabled), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(230, "FullyEnabled", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetFullyEnabled), null, false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(230, "AllowDoubleClicks", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAllowDoubleClicks), new SetValueHandler(SetAllowDoubleClicks), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(230, "PaintOrder", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, false, new GetValueHandler(GetPaintOrder), new SetValueHandler(SetPaintOrder), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(230, "DisposeOwnedObject", new short[1] + { + 153 + }, 240, new InvokeHandler(CallDisposeOwnedObjectObject), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(230, "NavigateInto", null, 240, new InvokeHandler(CallNavigateInto), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(230, "NavigateInto", new short[1] + { + 15 + }, 240, new InvokeHandler(CallNavigateIntoBoolean), false); + Type.Initialize(null, null, new PropertySchema[16] + { + uixPropertySchema15, + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3, + uixPropertySchema4, + uixPropertySchema13, + uixPropertySchema5, + uixPropertySchema6, + uixPropertySchema14, + uixPropertySchema7, + uixPropertySchema8, + uixPropertySchema9, + uixPropertySchema10, + uixPropertySchema11, + uixPropertySchema12, + uixPropertySchema16 + }, new MethodSchema[3] + { + 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 new file mode 100644 index 0000000..e46ee56 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ValueRangeSchema.cs @@ -0,0 +1,54 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ValueRangeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.ModelItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ValueRangeSchema + { + public static UIXTypeSchema Type; + + private static object GetObjectValue(object instanceObj) => ((IUIValueRange)instanceObj).ObjectValue; + + private static object GetHasPreviousValue(object instanceObj) => BooleanBoxes.Box(((IUIValueRange)instanceObj).HasPreviousValue); + + private static object GetHasNextValue(object instanceObj) => BooleanBoxes.Box(((IUIValueRange)instanceObj).HasNextValue); + + private static object CallPreviousValue(object instanceObj, object[] parameters) + { + ((IUIValueRange)instanceObj).PreviousValue(); + return null; + } + + private static object CallNextValue(object instanceObj, object[] parameters) + { + ((IUIValueRange)instanceObj).NextValue(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(231, "ValueRange", null, 153, typeof(IUIValueRange), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(231, "ObjectValue", 153, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetObjectValue), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(231, "HasPreviousValue", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHasPreviousValue), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(231, "HasNextValue", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHasNextValue), null, false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(231, "PreviousValue", null, 240, new InvokeHandler(CallPreviousValue), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(231, "NextValue", null, 240, new InvokeHandler(CallNextValue), false); + Type.Initialize(null, null, new PropertySchema[3] + { + uixPropertySchema3, + uixPropertySchema2, + uixPropertySchema1 + }, new MethodSchema[2] + { + 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 new file mode 100644 index 0000000..d797078 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ValueTransformerSchema.cs @@ -0,0 +1,82 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ValueTransformerSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Library; +using Microsoft.Iris.Session; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ValueTransformerSchema + { + public static UIXTypeSchema Type; + + 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) => ((ValueTransformer)instanceObj).Subtract; + + private static void SetSubtract(ref object instanceObj, object valueObj) => ((ValueTransformer)instanceObj).Subtract = (float)valueObj; + + 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) => ((ValueTransformer)instanceObj).Divide; + + private static void SetDivide(ref object instanceObj, object valueObj) + { + ValueTransformer valueTransformer = (ValueTransformer)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotZero(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + valueTransformer.Divide = num; + } + + private static object GetMod(object instanceObj) => ((ValueTransformer)instanceObj).Mod; + + private static void SetMod(ref object instanceObj, object valueObj) + { + ValueTransformer valueTransformer = (ValueTransformer)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.ValidateNotZero(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + valueTransformer.Mod = num; + } + + private static object GetAbsolute(object instanceObj) => BooleanBoxes.Box(((ValueTransformer)instanceObj).Absolute); + + private static void SetAbsolute(ref object instanceObj, object valueObj) => ((ValueTransformer)instanceObj).Absolute = (bool)valueObj; + + private static object Construct() => new ValueTransformer(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(232, "ValueTransformer", null, 153, typeof(ValueTransformer), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(232, "Add", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAdd), new SetValueHandler(SetAdd), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(232, "Subtract", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetSubtract), new SetValueHandler(SetSubtract), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(232, "Multiply", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMultiply), new SetValueHandler(SetMultiply), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(232, "Divide", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotZero, false, new GetValueHandler(GetDivide), new SetValueHandler(SetDivide), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(232, "Mod", 194, -1, ExpressionRestriction.None, false, SingleSchema.ValidateNotZero, false, new GetValueHandler(GetMod), new SetValueHandler(SetMod), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(232, "Absolute", 15, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetAbsolute), new SetValueHandler(SetAbsolute), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[6] + { + 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 new file mode 100644 index 0000000..5dfbeb6 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/Vector2Schema.cs @@ -0,0 +1,238 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.Vector2Schema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using System; +using System.Globalization; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class Vector2Schema + { + public static RangeValidator ValidateNotNegative = new RangeValidator(RangeValidateNotNegative); + public static UIXTypeSchema Type; + + 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 = vector2; + } + + 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 = vector2; + } + + private static object Construct() => Vector2.Zero; + + private static object ConstructXY(object[] parameters) + { + object instanceObj = Construct(); + SetX(ref instanceObj, parameters[0]); + SetY(ref instanceObj, parameters[1]); + return instanceObj; + } + + private static Result ConvertFromStringXY(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], SingleSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Vector2", result1.Error); + SetX(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Vector2", result2.Error); + SetY(ref instance, valueObj2); + return result2; + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Vector2 vector2 = (Vector2)instanceObj; + writer.WriteSingle(vector2.X); + writer.WriteSingle(vector2.Y); + } + + 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 = 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 = null; + float result; + if (!float.TryParse(s, NumberStyles.Float, NumberFormatInfo.InvariantInfo, out result)) + return Result.Fail(""); + instanceObj = new Vector2() + { + X = result, + Y = result + }; + return Result.Success; + } + + private static Result ConvertFromSingle(object valueObj, out object instanceObj) + { + float num = (float)valueObj; + instanceObj = null; + instanceObj = new Vector2() + { + X = num, + Y = num + }; + return Result.Success; + } + + private static bool IsConversionSupported(TypeSchema fromType) => SingleSchema.Type.IsAssignableFrom(fromType) || SizeSchema.Type.IsAssignableFrom(fromType) || StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (SingleSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSingle(from, out instance); + if (!result.Failed) + return result; + } + if (SizeSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromSize(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + result = ConvertFromString(from, out instance); + if (!result.Failed) + return result; + } + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 2) + { + result = ConvertFromStringXY(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Vector2"); + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.MathMultiply: + case OperationType.MathDivide: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.MathNegate: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + Vector2 vector2_1 = (Vector2)leftObj; + if (op == OperationType.MathNegate) + return -vector2_1; + Vector2 vector2_2 = (Vector2)rightObj; + switch (op - 1) + { + case 0: + return vector2_1 + vector2_2; + case OperationType.MathAdd: + return vector2_1 - vector2_2; + case OperationType.MathSubtract: + return vector2_1 * vector2_2; + case OperationType.MathMultiply: + 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 null; + } + } + + private static object CallTryParseStringVector2(object instanceObj, object[] parameters) + { + string parameter1 = (string)parameters[0]; + Vector2 parameter2 = (Vector2)parameters[1]; + object instanceObj1; + return ConvertFromString(parameter1, out instanceObj1).Failed ? parameter2 : instanceObj1; + } + + private static Result RangeValidateNotNegative(object value) + { + Vector2 vector2 = (Vector2)value; + 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() => Type = new UIXTypeSchema(233, "Vector2", null, 153, typeof(Vector2), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(233, "X", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetX), new SetValueHandler(SetX), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(233, "Y", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetY), new SetValueHandler(SetY), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(233, new short[2] + { + 194, + 194 + }, new ConstructHandler(ConstructXY)); + UIXMethodSchema uixMethodSchema = new UIXMethodSchema(233, "TryParse", new short[2] + { + 208, + 233 + }, 233, new InvokeHandler(CallTryParseStringVector2), true); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[2] + { + uixPropertySchema1, + uixPropertySchema2 + }, new MethodSchema[1] + { + uixMethodSchema + }, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/Vector3Schema.cs b/UIX/Microsoft/Iris/Markup/UIX/Vector3Schema.cs new file mode 100644 index 0000000..dd594f5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/Vector3Schema.cs @@ -0,0 +1,179 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.Vector3Schema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Data; +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class Vector3Schema + { + public static UIXTypeSchema Type; + + 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 = vector3; + } + + 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 = vector3; + } + + 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 = vector3; + } + + private static object Construct() => Vector3.Zero; + + private static object ConstructXYZ(object[] parameters) + { + object instanceObj = Construct(); + SetX(ref instanceObj, parameters[0]); + SetY(ref instanceObj, parameters[1]); + SetZ(ref instanceObj, parameters[2]); + return instanceObj; + } + + private static Result ConvertFromStringXYZ(string[] splitString, out object instance) + { + instance = Construct(); + object valueObj1; + Result result1 = UIXLoadResult.ValidateStringAsValue(splitString[0], SingleSchema.Type, null, out valueObj1); + if (result1.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Vector3", result1.Error); + SetX(ref instance, valueObj1); + object valueObj2; + Result result2 = UIXLoadResult.ValidateStringAsValue(splitString[1], SingleSchema.Type, null, out valueObj2); + if (result2.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Vector3", result2.Error); + SetY(ref instance, valueObj2); + object valueObj3; + Result result3 = UIXLoadResult.ValidateStringAsValue(splitString[2], SingleSchema.Type, null, out valueObj3); + if (result3.Failed) + return Result.Fail("Problem converting '{0}' ({1})", "Vector3", result3.Error); + SetZ(ref instance, valueObj3); + return result3; + } + + private static void EncodeBinary(ByteCodeWriter writer, object instanceObj) + { + Vector3 vector3 = (Vector3)instanceObj; + writer.WriteSingle(vector3.X); + writer.WriteSingle(vector3.Y); + writer.WriteSingle(vector3.Z); + } + + private static object DecodeBinary(ByteCodeReader reader) => new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()); + + private static bool IsConversionSupported(TypeSchema fromType) => StringSchema.Type.IsAssignableFrom(fromType); + + private static Result TryConvertFrom( + object from, + TypeSchema fromType, + out object instance) + { + Result result = Result.Fail("Unsupported"); + instance = null; + if (StringSchema.Type.IsAssignableFrom(fromType)) + { + string[] splitString = StringUtility.SplitAndTrim(',', (string)from); + if (splitString.Length == 3) + { + result = ConvertFromStringXYZ(splitString, out instance); + if (!result.Failed) + return result; + } + else + result = Result.Fail("Unable to convert \"{0}\" to type '{1}'", from.ToString(), "Vector3"); + } + return result; + } + + private static bool IsOperationSupported(OperationType op) + { + switch (op) + { + case OperationType.MathAdd: + case OperationType.MathSubtract: + case OperationType.MathMultiply: + case OperationType.MathDivide: + case OperationType.RelationalEquals: + case OperationType.RelationalNotEquals: + case OperationType.MathNegate: + return true; + default: + return false; + } + } + + private static object ExecuteOperation(object leftObj, object rightObj, OperationType op) + { + Vector3 vector3_1 = (Vector3)leftObj; + if (op == OperationType.MathNegate) + return -vector3_1; + Vector3 vector3_2 = (Vector3)rightObj; + switch (op - 1) + { + case 0: + return vector3_1 + vector3_2; + case OperationType.MathAdd: + return vector3_1 - vector3_2; + case OperationType.MathSubtract: + return vector3_1 * vector3_2; + case OperationType.MathMultiply: + 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 null; + } + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(234, "Vector3", null, 153, typeof(Vector3), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(234, "X", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetX), new SetValueHandler(SetX), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(234, "Y", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetY), new SetValueHandler(SetY), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(234, "Z", 194, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetZ), new SetValueHandler(SetZ), false); + UIXConstructorSchema constructorSchema = new UIXConstructorSchema(234, new short[3] + { + 194, + 194, + 194 + }, new ConstructHandler(ConstructXYZ)); + Type.Initialize(new DefaultConstructHandler(Construct), new ConstructorSchema[1] + { + constructorSchema + }, new PropertySchema[3] + { + uixPropertySchema1, + uixPropertySchema2, + uixPropertySchema3 + }, null, null, null, new TypeConverterHandler(TryConvertFrom), new SupportsTypeConversionHandler(IsConversionSupported), new EncodeBinaryHandler(EncodeBinary), new DecodeBinaryHandler(DecodeBinary), new PerformOperationHandler(ExecuteOperation), new SupportsOperationHandler(IsOperationSupported)); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/VideoElementInstanceSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/VideoElementInstanceSchema.cs new file mode 100644 index 0000000..647bbcc --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/VideoElementInstanceSchema.cs @@ -0,0 +1,29 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.VideoElementInstanceSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.RenderAPI.VideoPlayback; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class VideoElementInstanceSchema + { + public static UIXTypeSchema Type; + + private static void SetVideoStream(ref object instanceObj, object valueObj) => ((EffectElementWrapper)instanceObj).SetProperty("Video", (IUIVideoStream)valueObj); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(237, "VideoElementInstance", null, 74, typeof(EffectElementWrapper), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(237, "VideoStream", 238, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetVideoStream), false); + Type.Initialize(null, null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..c87d3f0 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/VideoElementSchema.cs @@ -0,0 +1,37 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.VideoElementSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Render; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class VideoElementSchema + { + public static UIXTypeSchema Type; + + private static void SetVideoStream(ref object instanceObj, object valueObj) + { + VideoElement videoElement = (VideoElement)instanceObj; + Microsoft.Iris.VideoStream videoStream = (Microsoft.Iris.VideoStream)valueObj; + if (videoStream == null) + return; + videoElement.VideoStream = videoStream.RenderStream; + } + + private static object Construct() => new VideoElement(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(236, "VideoElement", null, 77, typeof(VideoElement), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(236, "VideoStream", 238, -1, ExpressionRestriction.None, false, null, false, null, new SetValueHandler(SetVideoStream), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..ebce367 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/VideoSchema.cs @@ -0,0 +1,45 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.VideoSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Drawing; +using Microsoft.Iris.RenderAPI.VideoPlayback; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class VideoSchema + { + public static UIXTypeSchema Type; + + private static object GetChildren(object instanceObj) => ViewItemSchema.ListProxy.GetChildren((ViewItem)instanceObj); + + 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) => ((Video)instanceObj).LetterboxColor; + + private static void SetLetterboxColor(ref object instanceObj, object valueObj) => ((Video)instanceObj).LetterboxColor = (Color)valueObj; + + private static object Construct() => new Video(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(235, "Video", null, 239, typeof(Video), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(235, "Children", 138, 239, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetChildren), null, false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(235, "VideoStream", 238, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetVideoStream), new SetValueHandler(SetVideoStream), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(235, "LetterboxColor", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLetterboxColor), new SetValueHandler(SetLetterboxColor), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[3] + { + 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 new file mode 100644 index 0000000..eebab07 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/VideoStreamSchema.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.VideoStreamSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class VideoStreamSchema + { + public static UIXTypeSchema Type; + + private static object GetStreamID(object instanceObj) => ((VideoStream)instanceObj).StreamID; + + private static object Construct() => new VideoStream(); + + public static void Pass1Initialize() => Type = new UIXTypeSchema(238, "VideoStream", null, 153, typeof(VideoStream), UIXTypeFlags.Immutable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema = new UIXPropertySchema(238, "StreamID", 115, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetStreamID), null, false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[1] + { + 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 new file mode 100644 index 0000000..198df30 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/ViewItemSchema.cs @@ -0,0 +1,456 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.ViewItemSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Animations; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Library; +using Microsoft.Iris.Navigation; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; +using System; +using System.Collections; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class ViewItemSchema + { + public static UIXTypeSchema Type; + + private static object GetAlpha(object instanceObj) => ((ViewItem)instanceObj).Alpha; + + private static void SetAlpha(ref object instanceObj, object valueObj) + { + ViewItem viewItem = (ViewItem)instanceObj; + float num = (float)valueObj; + Result result = SingleSchema.Validate0to1(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + viewItem.Alpha = num; + } + + private static object GetAnimations(object instanceObj) => ListProxy.GetAnimation((ViewItem)instanceObj); + + 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) => ((ViewItem)instanceObj).DebugOutline; + + private static void SetDebugOutline(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).DebugOutline = (Color)valueObj; + + private static object GetFocusOrder(object instanceObj) => ((ViewItem)instanceObj).FocusOrder; + + private static void SetFocusOrder(ref object instanceObj, object valueObj) + { + ViewItem viewItem = (ViewItem)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + viewItem.FocusOrder = num; + } + + 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) => ((ViewItem)instanceObj).ChildAlignment; + + private static void SetChildAlignment(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).ChildAlignment = (ItemAlignment)valueObj; + + private static object GetLayout(object instanceObj) => ((ViewItem)instanceObj).Layout; + + private static void SetLayout(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Layout = (ILayout)valueObj; + + private static void SetLayoutInput(ref object instanceObj, object valueObj) + { + ViewItem viewItem = (ViewItem)instanceObj; + ILayoutInput layoutInput = (ILayoutInput)valueObj; + if (layoutInput == null) + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "LayoutInput"); + else + viewItem.LayoutInput = layoutInput; + } + + private static object GetLayoutOutput(object instanceObj) => ((ViewItem)instanceObj).LayoutOutput; + + private static object GetMargins(object instanceObj) => ((ViewItem)instanceObj).Margins; + + private static void SetMargins(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Margins = (Inset)valueObj; + + private static object GetMaximumSize(object instanceObj) => ((ViewItem)instanceObj).MaximumSizeObject; + + private static void SetMaximumSize(ref object instanceObj, object valueObj) + { + ViewItem viewItem = (ViewItem)instanceObj; + Result result = SizeSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + viewItem.MaximumSizeObject = valueObj; + } + + private static object GetMinimumSize(object instanceObj) => ((ViewItem)instanceObj).MinimumSizeObject; + + private static void SetMinimumSize(ref object instanceObj, object valueObj) + { + ViewItem viewItem = (ViewItem)instanceObj; + Result result = SizeSchema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + viewItem.MinimumSizeObject = valueObj; + } + + private static object GetMouseInteractive(object instanceObj) => BooleanBoxes.Box(((ViewItem)instanceObj).MouseInteractive); + + private static void SetMouseInteractive(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).MouseInteractive = (bool)valueObj; + + 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) => ((ViewItem)instanceObj).Navigation; + + private static void SetNavigation(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Navigation = (NavigationPolicies)valueObj; + + 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) => ((ViewItem)instanceObj).Rotation; + + private static void SetRotation(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Rotation = (Rotation)valueObj; + + 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) => ((ViewItem)instanceObj).SharedSize; + + private static void SetSharedSize(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).SharedSize = (SharedSize)valueObj; + + private static object GetSharedSizePolicy(object instanceObj) => ((ViewItem)instanceObj).SharedSizePolicy; + + private static void SetSharedSizePolicy(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).SharedSizePolicy = (SharedSizePolicy)valueObj; + + private static object GetVisible(object instanceObj) => BooleanBoxes.Box(((ViewItem)instanceObj).Visible); + + private static void SetVisible(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Visible = (bool)valueObj; + + 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) => ((ViewItem)instanceObj).Camera; + + private static void SetCamera(ref object instanceObj, object valueObj) => ((ViewItem)instanceObj).Camera = (Camera)valueObj; + + private static object CallAttachAnimationIAnimation(object instanceObj, object[] parameters) + { + ViewItem viewItem = (ViewItem)instanceObj; + IAnimationProvider parameter = (IAnimationProvider)parameters[0]; + if (parameter == null) + { + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; + } + viewItem.AttachAnimation(parameter); + return null; + } + + private static object CallAttachAnimationIAnimationAnimationHandle( + object instanceObj, + object[] parameters) + { + ViewItem viewItem = (ViewItem)instanceObj; + IAnimationProvider parameter1 = (IAnimationProvider)parameters[0]; + AnimationHandle parameter2 = (AnimationHandle)parameters[1]; + if (parameter1 == 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}'", "handle"); + return null; + } + viewItem.AttachAnimation(parameter1, parameter2); + return null; + } + + private static object CallDetachAnimationAnimationEventType( + object instanceObj, + object[] parameters) + { + ((ViewItem)instanceObj).DetachAnimation((AnimationEventType)parameters[0]); + return null; + } + + private static object CallPlayAnimationIAnimation(object instanceObj, object[] parameters) + { + ViewItem viewItem = (ViewItem)instanceObj; + IAnimationProvider parameter = (IAnimationProvider)parameters[0]; + if (parameter == null) + { + ErrorManager.ReportError("Script runtime failure: Invalid 'null' value for '{0}'", "animation"); + return null; + } + viewItem.PlayAnimation(parameter, null); + return null; + } + + private static object CallPlayAnimationIAnimationAnimationHandle( + object instanceObj, + object[] parameters) + { + ViewItem viewItem = (ViewItem)instanceObj; + IAnimationProvider parameter1 = (IAnimationProvider)parameters[0]; + AnimationHandle parameter2 = (AnimationHandle)parameters[1]; + if (parameter1 == 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}'", "handle"); + return null; + } + viewItem.PlayAnimation(parameter1, parameter2); + return null; + } + + private static object CallPlayAnimationAnimationEventType( + object instanceObj, + object[] parameters) + { + ((ViewItem)instanceObj).PlayAnimation((AnimationEventType)parameters[0]); + return null; + } + + private static object CallForceContentChange(object instanceObj, object[] parameters) + { + ((ViewItem)instanceObj).ForceContentChange(); + return null; + } + + private static object CallSnapshotPosition(object instanceObj, object[] parameters) => ((ViewItem)instanceObj).SnapshotPosition(); + + private static object CallNavigateInto(object instanceObj, object[] parameters) + { + ((ViewItem)instanceObj).NavigateInto(); + return null; + } + + private static object CallNavigateIntoBoolean(object instanceObj, object[] parameters) + { + ((ViewItem)instanceObj).NavigateInto((bool)parameters[0]); + return null; + } + + private static object CallScrollIntoView(object instanceObj, object[] parameters) + { + ((ViewItem)instanceObj).ScrollIntoView(); + return null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(239, "ViewItem", null, -1, typeof(ViewItem), UIXTypeFlags.Disposable); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(239, "Alpha", 194, -1, ExpressionRestriction.None, false, SingleSchema.Validate0to1, true, new GetValueHandler(GetAlpha), new SetValueHandler(SetAlpha), false); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(239, "Animations", 138, 104, ExpressionRestriction.NoAccess, false, null, true, new GetValueHandler(GetAnimations), null, false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(239, "CenterPointPercent", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCenterPointPercent), new SetValueHandler(SetCenterPointPercent), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(239, "DebugOutline", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetDebugOutline), new SetValueHandler(SetDebugOutline), false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(239, "FocusOrder", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetFocusOrder), new SetValueHandler(SetFocusOrder), false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(239, "Alignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAlignment), new SetValueHandler(SetAlignment), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(239, "ChildAlignment", sbyte.MaxValue, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetChildAlignment), new SetValueHandler(SetChildAlignment), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(239, "Layout", 132, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetLayout), new SetValueHandler(SetLayout), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(239, "LayoutInput", 133, -1, ExpressionRestriction.None, false, null, true, null, new SetValueHandler(SetLayoutInput), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(239, "LayoutOutput", 134, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetLayoutOutput), null, false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(239, "Margins", 114, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMargins), new SetValueHandler(SetMargins), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(239, "MaximumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(GetMaximumSize), new SetValueHandler(SetMaximumSize), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(239, "MinimumSize", 195, -1, ExpressionRestriction.None, false, SizeSchema.ValidateNotNegative, true, new GetValueHandler(GetMinimumSize), new SetValueHandler(SetMinimumSize), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(239, "MouseInteractive", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMouseInteractive), new SetValueHandler(SetMouseInteractive), false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(239, "Name", 208, -1, ExpressionRestriction.ReadOnly, false, null, true, new GetValueHandler(GetName), new SetValueHandler(SetName), false); + UIXPropertySchema uixPropertySchema16 = new UIXPropertySchema(239, "Navigation", 151, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetNavigation), new SetValueHandler(SetNavigation), false); + UIXPropertySchema uixPropertySchema17 = new UIXPropertySchema(239, "Padding", 114, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPadding), new SetValueHandler(SetPadding), false); + UIXPropertySchema uixPropertySchema18 = new UIXPropertySchema(239, "Rotation", 176, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetRotation), new SetValueHandler(SetRotation), false); + UIXPropertySchema uixPropertySchema19 = new UIXPropertySchema(239, "Scale", 234, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetScale), new SetValueHandler(SetScale), false); + UIXPropertySchema uixPropertySchema20 = new UIXPropertySchema(239, "SharedSize", 190, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSharedSize), new SetValueHandler(SetSharedSize), false); + UIXPropertySchema uixPropertySchema21 = new UIXPropertySchema(239, "SharedSizePolicy", 191, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetSharedSizePolicy), new SetValueHandler(SetSharedSizePolicy), false); + UIXPropertySchema uixPropertySchema22 = new UIXPropertySchema(239, "Visible", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetVisible), new SetValueHandler(SetVisible), false); + UIXPropertySchema uixPropertySchema23 = new UIXPropertySchema(239, "Background", 35, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetBackground), new SetValueHandler(SetBackground), false); + UIXPropertySchema uixPropertySchema24 = new UIXPropertySchema(239, "Camera", 21, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCamera), new SetValueHandler(SetCamera), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(239, "AttachAnimation", new short[1] + { + 104 + }, 240, new InvokeHandler(CallAttachAnimationIAnimation), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(239, "AttachAnimation", new short[2] + { + 104, + 11 + }, 240, new InvokeHandler(CallAttachAnimationIAnimationAnimationHandle), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(239, "DetachAnimation", new short[1] + { + 10 + }, 240, new InvokeHandler(CallDetachAnimationAnimationEventType), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(239, "PlayAnimation", new short[1] + { + 104 + }, 240, new InvokeHandler(CallPlayAnimationIAnimation), false); + UIXMethodSchema uixMethodSchema5 = new UIXMethodSchema(239, "PlayAnimation", new short[2] + { + 104, + 11 + }, 240, new InvokeHandler(CallPlayAnimationIAnimationAnimationHandle), false); + UIXMethodSchema uixMethodSchema6 = new UIXMethodSchema(239, "PlayAnimation", new short[1] + { + 10 + }, 240, new InvokeHandler(CallPlayAnimationAnimationEventType), false); + UIXMethodSchema uixMethodSchema7 = new UIXMethodSchema(239, "ForceContentChange", null, 240, new InvokeHandler(CallForceContentChange), false); + UIXMethodSchema uixMethodSchema8 = new UIXMethodSchema(239, "SnapshotPosition", null, 171, new InvokeHandler(CallSnapshotPosition), false); + UIXMethodSchema uixMethodSchema9 = new UIXMethodSchema(239, "NavigateInto", null, 240, new InvokeHandler(CallNavigateInto), false); + UIXMethodSchema uixMethodSchema10 = new UIXMethodSchema(239, "NavigateInto", new short[1] + { + 15 + }, 240, new InvokeHandler(CallNavigateIntoBoolean), false); + UIXMethodSchema uixMethodSchema11 = new UIXMethodSchema(239, "ScrollIntoView", null, 240, new InvokeHandler(CallScrollIntoView), false); + Type.Initialize(null, null, new PropertySchema[24] + { + 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] + { + 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 + { + private ViewItem _subject; + private ViewItemSchema.ListProxyMode _mode; + private static ViewItemSchema.ListProxy s_shared = new ViewItemSchema.ListProxy(); + + public static IList GetChildren(ViewItem subject) + { + s_shared.SetSubject(subject, ListProxyMode.Children); + return s_shared; + } + + public static IList GetAnimation(ViewItem subject) + { + s_shared.SetSubject(subject, ListProxyMode.Animation); + return s_shared; + } + + public int Add(object value) + { + switch (_mode) + { + case ListProxyMode.Children: + _subject.Children.Add((Microsoft.Iris.Library.TreeNode)value); + break; + case ListProxyMode.Animation: + if (value != null) + { + _subject.AttachAnimation((IAnimationProvider)value); + break; + } + break; + } + _subject = null; + return 0; + } + + public void Clear() => throw new NotImplementedException(); + + public bool Contains(object value) => throw new NotImplementedException(); + + public int IndexOf(object value) => throw new NotImplementedException(); + + public void Insert(int index, object value) => throw new NotImplementedException(); + + public void Remove(object value) => throw new NotImplementedException(); + + public void RemoveAt(int index) => throw new NotImplementedException(); + + public bool IsFixedSize => throw new NotImplementedException(); + + public bool IsReadOnly => throw new NotImplementedException(); + + public object this[int index] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + public void CopyTo(Array array, int index) => throw new NotImplementedException(); + + public int Count => throw new NotImplementedException(); + + public bool IsSynchronized => throw new NotImplementedException(); + + public object SyncRoot => throw new NotImplementedException(); + + public IEnumerator GetEnumerator() => throw new NotImplementedException(); + + private void SetSubject(ViewItem subject, ViewItemSchema.ListProxyMode mode) + { + _subject = subject; + _mode = mode; + } + + private ListProxy() + { + } + } + + internal enum ListProxyMode + { + Children, + Animation, + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs b/UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs new file mode 100644 index 0000000..d93b874 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/VoidSchema.cs @@ -0,0 +1,17 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.VoidSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class VoidSchema + { + public static UIXTypeSchema Type; + + public static void Pass1Initialize() => Type = new UIXTypeSchema(240, "Void", "void", -1, typeof(void), UIXTypeFlags.None); + + public static void Pass2Initialize() => 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 new file mode 100644 index 0000000..8745c7f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIX/WindowSchema.cs @@ -0,0 +1,155 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIX.WindowSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Render; +using Microsoft.Iris.Session; +using Microsoft.Iris.UI; + +namespace Microsoft.Iris.Markup.UIX +{ + internal static class WindowSchema + { + public static UIXTypeSchema Type; + + private static object GetMainWindow(object instanceObj) => UISession.Default.Form; + + 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) => ((Form)instanceObj).WindowState; + + private static void SetWindowState(ref object instanceObj, object valueObj) => ((Form)instanceObj).WindowState = (Microsoft.Iris.WindowState)valueObj; + + private static object GetActive(object instanceObj) => BooleanBoxes.Box(((Form)instanceObj).ActivationState); + + private static object GetMouseActive(object instanceObj) => BooleanBoxes.Box(!((UIForm)instanceObj).MouseIsIdle); + + private static object GetShowWindowFrame(object instanceObj) => BooleanBoxes.Box(((UIForm)instanceObj).ShowWindowFrame); + + private static void SetShowWindowFrame(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).ShowWindowFrame = (bool)valueObj; + + private static object GetHideMouseOnIdle(object instanceObj) => BooleanBoxes.Box(((UIForm)instanceObj).HideMouseOnIdle); + + private static void SetHideMouseOnIdle(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).HideMouseOnIdle = (bool)valueObj; + + private static object GetMouseIdleTimeout(object instanceObj) => ((UIForm)instanceObj).MouseIdleTimeout; + + private static void SetMouseIdleTimeout(ref object instanceObj, object valueObj) + { + UIForm uiForm = (UIForm)instanceObj; + int num = (int)valueObj; + Result result = Int32Schema.ValidateNotNegative(valueObj); + if (result.Failed) + ErrorManager.ReportError(result.Error); + else + uiForm.MouseIdleTimeout = num; + } + + private static object GetAlwaysOnTop(object instanceObj) => BooleanBoxes.Box(((UIForm)instanceObj).AlwaysOnTop); + + private static void SetAlwaysOnTop(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).AlwaysOnTop = (bool)valueObj; + + private static object GetShowInTaskbar(object instanceObj) => BooleanBoxes.Box(((UIForm)instanceObj).ShowInTaskbar); + + private static void SetShowInTaskbar(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).ShowInTaskbar = (bool)valueObj; + + private static object GetPreventInterruption(object instanceObj) => BooleanBoxes.Box(((UIForm)instanceObj).PreventInterruption); + + private static void SetPreventInterruption(ref object instanceObj, object valueObj) => ((UIForm)instanceObj).PreventInterruption = (bool)valueObj; + + 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) => ((Form)instanceObj).ClientSize; + + private static void SetClientSize(ref object instanceObj, object valueObj) => ((Form)instanceObj).ClientSize = (Size)valueObj; + + private static object GetPosition(object instanceObj) => ((Form)instanceObj).Position; + + private static void SetPosition(ref object instanceObj, object valueObj) => ((Form)instanceObj).Position = (Point)valueObj; + + private static object GetVisible(object instanceObj) => BooleanBoxes.Box(((Form)instanceObj).Visible); + + private static void SetVisible(ref object instanceObj, object valueObj) => ((Form)instanceObj).Visible = (bool)valueObj; + + private static object Construct() => UISession.Default.Form; + + private static object CallClose(object instanceObj, object[] parameters) + { + ((UIForm)instanceObj).Close(); + return null; + } + + private static object CallForceClose(object instanceObj, object[] parameters) + { + ((Form)instanceObj).ForceClose(); + return null; + } + + 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 null; + } + + public static void Pass1Initialize() => Type = new UIXTypeSchema(241, "Window", null, 153, typeof(UIForm), UIXTypeFlags.None); + + public static void Pass2Initialize() + { + UIXPropertySchema uixPropertySchema1 = new UIXPropertySchema(241, "MainWindow", 241, -1, ExpressionRestriction.None, false, null, false, new GetValueHandler(GetMainWindow), null, true); + UIXPropertySchema uixPropertySchema2 = new UIXPropertySchema(241, "Caption", 208, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetCaption), new SetValueHandler(SetCaption), false); + UIXPropertySchema uixPropertySchema3 = new UIXPropertySchema(241, "WindowState", 242, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetWindowState), new SetValueHandler(SetWindowState), false); + UIXPropertySchema uixPropertySchema4 = new UIXPropertySchema(241, "Active", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetActive), null, false); + UIXPropertySchema uixPropertySchema5 = new UIXPropertySchema(241, "MouseActive", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMouseActive), null, false); + UIXPropertySchema uixPropertySchema6 = new UIXPropertySchema(241, "ShowWindowFrame", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetShowWindowFrame), new SetValueHandler(SetShowWindowFrame), false); + UIXPropertySchema uixPropertySchema7 = new UIXPropertySchema(241, "HideMouseOnIdle", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetHideMouseOnIdle), new SetValueHandler(SetHideMouseOnIdle), false); + UIXPropertySchema uixPropertySchema8 = new UIXPropertySchema(241, "MouseIdleTimeout", 115, -1, ExpressionRestriction.None, false, Int32Schema.ValidateNotNegative, true, new GetValueHandler(GetMouseIdleTimeout), new SetValueHandler(SetMouseIdleTimeout), false); + UIXPropertySchema uixPropertySchema9 = new UIXPropertySchema(241, "AlwaysOnTop", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetAlwaysOnTop), new SetValueHandler(SetAlwaysOnTop), false); + UIXPropertySchema uixPropertySchema10 = new UIXPropertySchema(241, "ShowInTaskbar", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetShowInTaskbar), new SetValueHandler(SetShowInTaskbar), false); + UIXPropertySchema uixPropertySchema11 = new UIXPropertySchema(241, "PreventInterruption", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPreventInterruption), new SetValueHandler(SetPreventInterruption), false); + UIXPropertySchema uixPropertySchema12 = new UIXPropertySchema(241, "MaximizeMode", 146, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetMaximizeMode), new SetValueHandler(SetMaximizeMode), false); + UIXPropertySchema uixPropertySchema13 = new UIXPropertySchema(241, "ClientSize", 195, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetClientSize), new SetValueHandler(SetClientSize), false); + UIXPropertySchema uixPropertySchema14 = new UIXPropertySchema(241, "Position", 158, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetPosition), new SetValueHandler(SetPosition), false); + UIXPropertySchema uixPropertySchema15 = new UIXPropertySchema(241, "Visible", 15, -1, ExpressionRestriction.None, false, null, true, new GetValueHandler(GetVisible), new SetValueHandler(SetVisible), false); + UIXMethodSchema uixMethodSchema1 = new UIXMethodSchema(241, "Close", null, 240, new InvokeHandler(CallClose), false); + UIXMethodSchema uixMethodSchema2 = new UIXMethodSchema(241, "ForceClose", null, 240, new InvokeHandler(CallForceClose), false); + UIXMethodSchema uixMethodSchema3 = new UIXMethodSchema(241, "SaveKeyFocus", null, 177, new InvokeHandler(CallSaveKeyFocus), false); + UIXMethodSchema uixMethodSchema4 = new UIXMethodSchema(241, "RestoreKeyFocus", new short[1] + { + 177 + }, 240, new InvokeHandler(CallRestoreKeyFocusSavedKeyFocus), false); + Type.Initialize(new DefaultConstructHandler(Construct), null, new PropertySchema[15] + { + uixPropertySchema4, + uixPropertySchema9, + uixPropertySchema2, + uixPropertySchema13, + uixPropertySchema7, + uixPropertySchema1, + uixPropertySchema12, + uixPropertySchema5, + uixPropertySchema8, + uixPropertySchema14, + uixPropertySchema11, + uixPropertySchema10, + uixPropertySchema6, + uixPropertySchema15, + uixPropertySchema3 + }, new MethodSchema[4] + { + uixMethodSchema1, + uixMethodSchema2, + uixMethodSchema3, + uixMethodSchema4 + }, null, null, null, null, null, null, null, null); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXConstructorSchema.cs b/UIX/Microsoft/Iris/Markup/UIXConstructorSchema.cs new file mode 100644 index 0000000..bef882f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXConstructorSchema.cs @@ -0,0 +1,28 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXConstructorSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class UIXConstructorSchema : ConstructorSchema + { + private TypeSchema[] _parameterTypes; + private ConstructHandler _construct; + + public UIXConstructorSchema( + short ownerTypeID, + short[] parameterTypeIDs, + ConstructHandler construct) + : base(UIXTypes.MapIDToType(ownerTypeID)) + { + _parameterTypes = UIXTypes.MapIDsToTypes(parameterTypeIDs); + _construct = construct; + } + + public override TypeSchema[] ParameterTypes => _parameterTypes; + + public override object Construct(object[] parameters) => _construct(parameters); + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXEnumData.cs b/UIX/Microsoft/Iris/Markup/UIXEnumData.cs new file mode 100644 index 0000000..1043288 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXEnumData.cs @@ -0,0 +1,819 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXEnumData +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class UIXEnumData + { + public static Map GetAccessibleRoleEnumData() => new Map(64) + { + ["Alert"] = 8, + ["Animation"] = 54, + ["Application"] = 14, + ["Border"] = 19, + ["ButtonDropDown"] = 56, + ["ButtonDropDownGrid"] = 58, + ["ButtonMenu"] = 57, + ["Caret"] = 7, + ["Character"] = 32, + ["Chart"] = 17, + ["CheckButton"] = 44, + ["Client"] = 10, + ["Clock"] = 61, + ["Column"] = 27, + ["ColumnHeader"] = 25, + ["ComboBox"] = 46, + ["Cursor"] = 6, + ["Diagram"] = 53, + ["Dial"] = 49, + ["Dialog"] = 18, + ["Document"] = 15, + ["DropList"] = 47, + ["Equation"] = 55, + ["Graphic"] = 40, + ["Grip"] = 4, + ["Grouping"] = 20, + ["HelpBalloon"] = 31, + ["HotkeyField"] = 50, + ["IPAddress"] = 63, + ["Indicator"] = 39, + ["Link"] = 30, + ["List"] = 33, + ["ListItem"] = 34, + ["MenuBar"] = 2, + ["MenuItem"] = 12, + ["MenuPopup"] = 11, + ["None"] = 0, + ["Outline"] = 35, + ["OutlineButton"] = 64, + ["OutlineItem"] = 36, + ["PageTab"] = 37, + ["PageTabList"] = 60, + ["Pane"] = 16, + ["ProgressBar"] = 48, + ["PropertyPage"] = 38, + ["PushButton"] = 43, + ["RadioButton"] = 45, + ["Row"] = 28, + ["RowHeader"] = 26, + ["ScrollBar"] = 3, + ["Separator"] = 21, + ["Slider"] = 51, + ["Sound"] = 5, + ["SpinButton"] = 52, + ["SplitButton"] = 62, + ["StaticText"] = 41, + ["StatusBar"] = 23, + ["Table"] = 24, + ["Text"] = 42, + ["TitleBar"] = 1, + ["ToolBar"] = 22, + ["ToolTip"] = 13, + ["Whitespace"] = 59, + ["Window"] = 9 + }; + + public static Map GetAlignmentEnumData() => new Map(5) + { + ["Center"] = 2, + ["Far"] = 3, + ["Fill"] = 4, + ["Near"] = 1, + ["Unspecified"] = 0 + }; + + public static Map GetAnimationEventTypeEnumData() => new Map(12) + { + ["Alpha"] = 6, + ["ContentChangeHide"] = 10, + ["ContentChangeShow"] = 9, + ["GainFocus"] = 7, + ["Hide"] = 1, + ["Idle"] = 11, + ["LoseFocus"] = 8, + ["Move"] = 2, + ["Rotate"] = 5, + ["Scale"] = 4, + ["Show"] = 0, + ["Size"] = 3 + }; + + public static Map GetInputHandlerTransitionEnumData() => new Map(2) + { + ["Down"] = 0, + ["Up"] = 1 + }; + + public static Map GetInputHandlerModifiersEnumData() => new Map(6) + { + ["All"] = 15, + ["Alt"] = 4, + ["Ctrl"] = 1, + ["None"] = 0, + ["Shift"] = 2, + ["Windows"] = 8 + }; + + public static Map GetClickTypeEnumData() => new Map(12) + { + ["Any"] = sbyte.MaxValue, + ["EnterKey"] = 16, + ["GamePad"] = 96, + ["GamePadA"] = 32, + ["GamePadStart"] = 64, + ["Key"] = 24, + ["LeftMouse"] = 1, + ["MiddleMouse"] = 4, + ["Mouse"] = 7, + ["None"] = 0, + ["RightMouse"] = 2, + ["SpaceKey"] = 8 + }; + + public static Map GetClickCountEnumData() => new Map(2) + { + ["Double"] = 1, + ["Single"] = 0 + }; + + public static Map GetInvokePriorityEnumData() => new Map(2) + { + ["Low"] = 1, + ["Normal"] = 0 + }; + + public static Map GetCursorEnumData() => new Map(16) + { + ["Arrow"] = 2, + ["Cancel"] = 3, + ["Copy"] = 4, + ["Crosshair"] = 5, + ["Hand"] = 7, + ["IBeam"] = 6, + ["Move"] = 9, + ["No"] = 10, + ["NotSpecified"] = 0, + ["Size"] = 12, + ["SizeNESW"] = 16, + ["SizeNS"] = 13, + ["SizeNWSE"] = 15, + ["SizeWE"] = 14, + ["UpArrow"] = 17, + ["Wait"] = 18 + }; + + public static Map GetDataQueryStatusEnumData() => new Map(5) + { + ["Complete"] = 3, + ["Error"] = 4, + ["Idle"] = 0, + ["ProcessingData"] = 2, + ["RequestingData"] = 1 + }; + + public static Map GetDebugOutlineScopeEnumData() => new Map(4) + { + ["All"] = 3, + ["FlaggedOnly"] = 0, + ["Hosts"] = 2, + ["Input"] = 1 + }; + + public static Map GetDebugLabelFormatEnumData() => new Map(3) + { + ["Full"] = 2, + ["Name"] = 1, + ["None"] = 0 + }; + + public static Map GetDropActionEnumData() => new Map(4) + { + ["All"] = 3, + ["Copy"] = 1, + ["Move"] = 2, + ["None"] = 0 + }; + + public static Map GetBeginDragPolicyEnumData() => new Map(2) + { + ["Down"] = 0, + ["Move"] = 1 + }; + + public static Map GetColorOperationEnumData() => new Map(13) + { + ["Add"] = 0, + ["ColorBurn"] = 6, + ["ColorDodge"] = 5, + ["Darken"] = 4, + ["HardLight"] = 10, + ["Lighten"] = 3, + ["LinearBurn"] = 11, + ["LinearDodge"] = 0, + ["Multiply"] = 2, + ["Overlay"] = 8, + ["Screen"] = 7, + ["SoftLight"] = 9, + ["Subtract"] = 1 + }; + + public static Map GetAlphaOperationEnumData() => new Map(5) + { + ["Add"] = 0, + ["Multiply"] = 2, + ["Source1"] = 3, + ["Source2"] = 4, + ["Subtract"] = 1 + }; + + public static Map GetGaussianBlurModeEnumData() => new Map(3) + { + ["Horizontal"] = 1, + ["Normal"] = 0, + ["Vertical"] = 2 + }; + + public static Map GetEmbossDirectionEnumData() => new Map(2) + { + ["LeftToRight"] = 0, + ["RightToLeft"] = 1 + }; + + public static Map GetColorSchemeEnumData() => new Map(3) + { + ["Default"] = 0, + ["HighContrast1"] = 1, + ["HighContrast2"] = 2 + }; + + public static Map GetGraphicsDeviceTypeEnumData() => new Map(2) + { + ["DX9"] = 1, + ["GDI"] = 0 + }; + + public static Map GetOrientationEnumData() => new Map(2) + { + ["Horizontal"] = 0, + ["Vertical"] = 1 + }; + + public static Map GetRepeatPolicyEnumData() => new Map(4) + { + ["Always"] = 3, + ["Never"] = 0, + ["WhenTooBig"] = 1, + ["WhenTooSmall"] = 2 + }; + + public static Map GetStripAlignmentEnumData() => new Map(3) + { + ["Center"] = 1, + ["Far"] = 2, + ["Near"] = 0 + }; + + public static Map GetMissingItemPolicyEnumData() => new Map(4) + { + ["SizeToAverage"] = 0, + ["SizeToLargest"] = 2, + ["SizeToSmallest"] = 1, + ["Wait"] = 3 + }; + + public static Map GetFocusChangeReasonEnumData() => new Map(6) + { + ["Any"] = 15, + ["Directional"] = 2, + ["Key"] = 6, + ["Mouse"] = 1, + ["Other"] = 8, + ["Tab"] = 4 + }; + + public static Map GetFontStylesEnumData() => new Map(3) + { + ["Bold"] = 1, + ["Italic"] = 2, + ["None"] = 0 + }; + + public static Map GetSizingPolicyEnumData() => new Map(3) + { + ["SizeToChildren"] = 1, + ["SizeToConstraint"] = 2, + ["SizeToContent"] = 0 + }; + + public static Map GetStretchingPolicyEnumData() => new Map(4) + { + ["Fill"] = 1, + ["None"] = 0, + ["Uniform"] = 2, + ["UniformToFill"] = 3 + }; + + public static Map GetHostStatusEnumData() => new Map(4) + { + ["FailureLoadingSource"] = 2, + ["FailureRunningScript"] = 3, + ["LoadingSource"] = 1, + ["Normal"] = 0 + }; + + public static Map GetImageStatusEnumData() => new Map(4) + { + ["Complete"] = 2, + ["Error"] = 3, + ["Loading"] = 1, + ["PendingLoad"] = 0 + }; + + public static Map GetInputHandlerStageEnumData() => new Map(3) + { + ["Bubbled"] = 4, + ["Direct"] = 2, + ["Routed"] = 1 + }; + + public static Map GetInterpolationTypeEnumData() => new Map(9) + { + ["Bezier"] = 6, + ["Cosine"] = 5, + ["EaseIn"] = 7, + ["EaseOut"] = 8, + ["Exp"] = 2, + ["Linear"] = 0, + ["Log"] = 3, + ["SCurve"] = 1, + ["Sine"] = 4 + }; + + public static Map GetKeyHandlerKeyEnumData() => new Map(143) + { + ["A"] = 65, + ["Add"] = 107, + ["Alt"] = 18, + ["Any"] = -1, + ["Apps"] = 93, + ["B"] = 66, + ["Backslash"] = 226, + ["Backspace"] = 8, + ["C"] = 67, + ["CapsLock"] = 20, + ["Clear"] = 12, + ["CloseBrace"] = 221, + ["Comma"] = 188, + ["Control"] = 17, + ["D"] = 68, + ["D0"] = 48, + ["D1"] = 49, + ["D2"] = 50, + ["D3"] = 51, + ["D4"] = 52, + ["D5"] = 53, + ["D6"] = 54, + ["D7"] = 55, + ["D8"] = 56, + ["D9"] = 57, + ["Delete"] = 46, + ["Divide"] = 111, + ["Down"] = 40, + ["E"] = 69, + ["End"] = 35, + ["Enter"] = 13, + ["Equals"] = 187, + ["Escape"] = 27, + ["F"] = 70, + ["F1"] = 112, + ["F10"] = 121, + ["F11"] = 122, + ["F12"] = 123, + ["F13"] = 124, + ["F14"] = 125, + ["F15"] = 126, + ["F16"] = sbyte.MaxValue, + ["F17"] = 128, + ["F18"] = 129, + ["F19"] = 130, + ["F2"] = 113, + ["F20"] = 131, + ["F21"] = 132, + ["F22"] = 133, + ["F23"] = 134, + ["F24"] = 135, + ["F3"] = 114, + ["F4"] = 115, + ["F5"] = 116, + ["F6"] = 117, + ["F7"] = 118, + ["F8"] = 119, + ["F9"] = 120, + ["G"] = 71, + ["GamePadA"] = 22528, + ["GamePadB"] = 22529, + ["GamePadBack"] = 22597, + ["GamePadDPadDown"] = 22545, + ["GamePadDPadLeft"] = 22546, + ["GamePadDPadRight"] = 22547, + ["GamePadDPadUp"] = 22544, + ["GamePadLShoulder"] = 22533, + ["GamePadLThumbDown"] = 22561, + ["GamePadLThumbDownLeft"] = 22567, + ["GamePadLThumbDownRight"] = 22566, + ["GamePadLThumbLeft"] = 22563, + ["GamePadLThumbPress"] = 22550, + ["GamePadLThumbRight"] = 22562, + ["GamePadLThumbUp"] = 22560, + ["GamePadLThumbUpLeft"] = 22564, + ["GamePadLThumbUpRight"] = 22565, + ["GamePadLTrigger"] = 22534, + ["GamePadRShoulder"] = 22532, + ["GamePadRThumbDown"] = 22577, + ["GamePadRThumbDownLeft"] = 22583, + ["GamePadRThumbDownRight"] = 22582, + ["GamePadRThumbLeft"] = 22579, + ["GamePadRThumbPress"] = 22551, + ["GamePadRThumbRight"] = 22578, + ["GamePadRThumbUp"] = 22576, + ["GamePadRThumbUpLeft"] = 22580, + ["GamePadRThumbUpRight"] = 22581, + ["GamePadRTrigger"] = 22535, + ["GamePadStart"] = 22548, + ["GamePadX"] = 22530, + ["GamePadY"] = 22531, + ["H"] = 72, + ["Home"] = 36, + ["I"] = 73, + ["Insert"] = 45, + ["J"] = 74, + ["K"] = 75, + ["L"] = 76, + ["Left"] = 37, + ["M"] = 77, + ["Multiply"] = 106, + ["N"] = 78, + ["None"] = 0, + ["NumLock"] = 144, + ["NumPad0"] = 96, + ["NumPad1"] = 97, + ["NumPad2"] = 98, + ["NumPad3"] = 99, + ["NumPad4"] = 100, + ["NumPad5"] = 101, + ["NumPad6"] = 102, + ["NumPad7"] = 103, + ["NumPad8"] = 104, + ["NumPad9"] = 105, + ["O"] = 79, + ["OpenBrace"] = 219, + ["P"] = 80, + ["PageDown"] = 34, + ["PageUp"] = 33, + ["Period"] = 190, + ["Pipe"] = 220, + ["PrintScreen"] = 44, + ["Q"] = 81, + ["QuestionMark"] = 191, + ["Quotes"] = 222, + ["R"] = 82, + ["Right"] = 39, + ["S"] = 83, + ["Semicolon"] = 186, + ["Shift"] = 16, + ["Space"] = 32, + ["Subtract"] = 109, + ["T"] = 84, + ["Tab"] = 9, + ["Tilde"] = 192, + ["U"] = 85, + ["Underscore"] = 189, + ["Up"] = 38, + ["V"] = 86, + ["W"] = 87, + ["X"] = 88, + ["Y"] = 89, + ["Z"] = 90 + }; + + public static Map GetNavigationPoliciesEnumData() => new Map(20) + { + ["Column"] = 4, + ["ContainAll"] = 1792, + ["ContainDirectional"] = 768, + ["ContainHorizontal"] = 512, + ["ContainTabOrder"] = 1024, + ["ContainVertical"] = 256, + ["FlowHorizontal"] = 65536, + ["FlowVertical"] = 131072, + ["Group"] = 1, + ["None"] = 0, + ["PreferContainerFocus"] = 262144, + ["PreferFocusOrder"] = 64, + ["RememberFocus"] = 32, + ["Row"] = 2, + ["TabGroup"] = 16, + ["WrapAll"] = 28672, + ["WrapDirectional"] = 12288, + ["WrapHorizontal"] = 8192, + ["WrapTabOrder"] = 16384, + ["WrapVertical"] = 4096 + }; + + public static Map GetMouseTargetEnumData() => new Map(3) + { + ["Fixed"] = 1, + ["Follow"] = 2, + ["None"] = 0 + }; + + public static Map GetInterestPointEnumData() => new Map(5) + { + ["BottomLeft"] = 2, + ["BottomRight"] = 3, + ["Center"] = 4, + ["TopLeft"] = 0, + ["TopRight"] = 1 + }; + + public static Map GetFlipDirectionEnumData() => new Map(4) + { + ["Both"] = 3, + ["Horizontal"] = 1, + ["None"] = 0, + ["Vertical"] = 2 + }; + + public static Map GetSnapshotPolicyEnumData() => new Map(3) + { + ["Continuous"] = 0, + ["OnLoop"] = 2, + ["Once"] = 1 + }; + + public static Map GetRelativeEdgeEnumData() => new Map(2) + { + ["Far"] = 1, + ["Near"] = 0 + }; + + public static Map GetContentPositioningPolicyEnumData() => new Map(2) + { + ["RespectPaddingAndLocking"] = 0, + ["ShowMaximalContent"] = 1 + }; + + public static Map GetSharedSizePolicyEnumData() => new Map(7) + { + ["ContributesToHeight"] = 2, + ["ContributesToSize"] = 3, + ["ContributesToWidth"] = 1, + ["Default"] = 15, + ["SharesHeight"] = 8, + ["SharesSize"] = 12, + ["SharesWidth"] = 4 + }; + + public static Map GetShortcutHandlerCommandEnumData() => new Map(29) + { + ["Back"] = 16, + ["ChannelDown"] = 3, + ["ChannelUp"] = 2, + ["Clear"] = 26, + ["Enter"] = 36, + ["FastForward"] = 7, + ["None"] = 0, + ["OEMExtensibility0"] = 73, + ["OEMExtensibility1"] = 74, + ["OEMExtensibility10"] = 83, + ["OEMExtensibility11"] = 84, + ["OEMExtensibility2"] = 75, + ["OEMExtensibility3"] = 76, + ["OEMExtensibility4"] = 77, + ["OEMExtensibility5"] = 78, + ["OEMExtensibility6"] = 79, + ["OEMExtensibility7"] = 80, + ["OEMExtensibility8"] = 81, + ["OEMExtensibility9"] = 82, + ["PageDown"] = 3, + ["PageUp"] = 2, + ["Pause"] = 5, + ["Play"] = 4, + ["PlayPause"] = 30, + ["Record"] = 6, + ["Rewind"] = 8, + ["SkipBack"] = 10, + ["SkipForward"] = 9, + ["Stop"] = 11 + }; + + public static Map GetSystemSoundEventEnumData() => new Map(30) + { + ["Asterisk"] = 1, + ["CloseProgram"] = 2, + ["CriticalBatteryAlarm"] = 3, + ["CriticalStop"] = 4, + ["DefaultBeep"] = 5, + ["DeviceConnect"] = 6, + ["DeviceDisconnect"] = 7, + ["DeviceFailedToConnect"] = 8, + ["Exclamation"] = 9, + ["ExitWindows"] = 10, + ["LowBatteryAlarm"] = 11, + ["Maximize"] = 12, + ["MenuCommand"] = 13, + ["MenuPopup"] = 14, + ["Minimize"] = 15, + ["NewFaxNotification"] = 16, + ["NewMailNotification"] = 17, + ["None"] = 0, + ["OpenProgram"] = 18, + ["PrintComplete"] = 19, + ["ProgramError"] = 20, + ["Question"] = 21, + ["RestoreDown"] = 22, + ["RestoreUp"] = 23, + ["Select"] = 24, + ["ShowToolbarBand"] = 25, + ["StartWindows"] = 26, + ["SystemNotification"] = 27, + ["WindowsLogoff"] = 28, + ["WindowsLogon"] = 29 + }; + + public static Map GetStackPriorityEnumData() => new Map(3) + { + ["High"] = 2, + ["Low"] = 0, + ["Medium"] = 1 + }; + + public static Map GetLineAlignmentEnumData() => new Map(3) + { + ["Center"] = 1, + ["Far"] = 2, + ["Near"] = 0 + }; + + public static Map GetTextBoundsEnumData() => new Map(5) + { + ["AlignToAscender"] = 1, + ["AlignToBaseline"] = 2, + ["Full"] = 0, + ["Tight"] = 7, + ["TrimLeftSideBearing"] = 4 + }; + + public static Map GetTextSharpnessEnumData() => new Map(2) + { + ["Sharp"] = 0, + ["Soft"] = 1 + }; + + public static Map GetKeyframeFilterEnumData() => new Map(6) + { + ["All"] = 0, + ["Alpha"] = 5, + ["Position"] = 1, + ["Rotate"] = 4, + ["Scale"] = 3, + ["Size"] = 2 + }; + + public static Map GetTransformAttributeEnumData() => new Map(5) + { + ["Height"] = 2, + ["Index"] = 0, + ["Width"] = 1, + ["X"] = 3, + ["Y"] = 4 + }; + + public static Map GetWindowStateEnumData() => new Map(3) + { + ["Maximized"] = 2, + ["Minimized"] = 1, + ["Normal"] = 0 + }; + + public static Map GetMaximizeModeEnumData() => new Map(2) + { + ["FullScreen"] = 1, + ["Normal"] = 0 + }; + + public static Map GetDataForType(short typeID) + { + switch (typeID) + { + case 1: + return GetAccessibleRoleEnumData(); + case 3: + return GetAlignmentEnumData(); + case 5: + return GetAlphaOperationEnumData(); + case 10: + return GetAnimationEventTypeEnumData(); + case 12: + return GetBeginDragPolicyEnumData(); + case 31: + return GetClickCountEnumData(); + case 33: + return GetClickTypeEnumData(); + case 38: + return GetColorOperationEnumData(); + case 39: + return GetColorSchemeEnumData(); + case 41: + return GetContentPositioningPolicyEnumData(); + case 44: + return GetCursorEnumData(); + case 47: + return GetDataQueryStatusEnumData(); + case 50: + return GetDebugLabelFormatEnumData(); + case 51: + return GetDebugOutlineScopeEnumData(); + case 64: + return GetDropActionEnumData(); + case 84: + return GetEmbossDirectionEnumData(); + case 89: + return GetFlipDirectionEnumData(); + case 91: + return GetFocusChangeReasonEnumData(); + case 94: + return GetFontStylesEnumData(); + case 96: + return GetGaussianBlurModeEnumData(); + case 98: + return GetGraphicsDeviceTypeEnumData(); + case 102: + return GetHostStatusEnumData(); + case 108: + return GetImageStatusEnumData(); + case 111: + return GetInputHandlerModifiersEnumData(); + case 112: + return GetInputHandlerStageEnumData(); + case 113: + return GetInputHandlerTransitionEnumData(); + case 118: + return GetInterestPointEnumData(); + case 122: + return GetInterpolationTypeEnumData(); + case 126: + return GetInvokePriorityEnumData(); + case 129: + return GetKeyHandlerKeyEnumData(); + case 131: + return GetKeyframeFilterEnumData(); + case 137: + return GetLineAlignmentEnumData(); + case 146: + return GetMaximizeModeEnumData(); + case 148: + return GetMissingItemPolicyEnumData(); + case 149: + return GetMouseTargetEnumData(); + case 151: + return GetNavigationPoliciesEnumData(); + case 154: + return GetOrientationEnumData(); + case 170: + return GetRelativeEdgeEnumData(); + case 172: + return GetRepeatPolicyEnumData(); + case 191: + return GetSharedSizePolicyEnumData(); + case 193: + return GetShortcutHandlerCommandEnumData(); + case 199: + return GetSizingPolicyEnumData(); + case 200: + return GetSnapshotPolicyEnumData(); + case 206: + return GetStackPriorityEnumData(); + case 207: + return GetStretchingPolicyEnumData(); + case 209: + return GetStripAlignmentEnumData(); + case 211: + return GetSystemSoundEventEnumData(); + case 213: + return GetTextBoundsEnumData(); + case 219: + return GetTextSharpnessEnumData(); + case 223: + return GetTransformAttributeEnumData(); + case 242: + return GetWindowStateEnumData(); + default: + return null; + } + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs b/UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs new file mode 100644 index 0000000..42ad0a7 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXEnumSchema.cs @@ -0,0 +1,27 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXEnumSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using System; + +namespace Microsoft.Iris.Markup +{ + internal class UIXEnumSchema : EnumSchema + { + private short _typeID; + + public UIXEnumSchema(short typeID, string name, Type runtimeType, bool isFlags) + : base(MarkupSystem.UIXGlobal) + { + _typeID = typeID; + Initialize(name, runtimeType, isFlags, null, null); + UIXTypes.RegisterTypeForID(typeID, this); + } + + protected override void InitializeNameToValueMap() => _nameToValueMap = UIXEnumData.GetDataForType(_typeID); + + public override string ToString() => Name; + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXEventSchema.cs b/UIX/Microsoft/Iris/Markup/UIXEventSchema.cs new file mode 100644 index 0000000..07b9d5f --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXEventSchema.cs @@ -0,0 +1,19 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXEventSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class UIXEventSchema : EventSchema + { + private string _name; + + public UIXEventSchema(short ownerTypeID, string name) + : base(UIXTypes.MapIDToType(ownerTypeID)) + => _name = name; + + public override string Name => _name; + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXLoadResult.cs b/UIX/Microsoft/Iris/Markup/UIXLoadResult.cs new file mode 100644 index 0000000..47151b4 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXLoadResult.cs @@ -0,0 +1,59 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXLoadResult +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using Microsoft.Iris.Markup.UIX; + +namespace Microsoft.Iris.Markup +{ + internal class UIXLoadResult : LoadResult + { + public UIXLoadResult(string uri) + : base(uri) + { + } + + public static void InitializeStatics() => UIXLoadResultExports.InitializeStatics(); + + public override TypeSchema[] ExportTable => UIXLoadResultExports.ExportTable; + + private void SetExportTable(TypeSchema[] value) => UIXLoadResultExports.ExportTable = value; + + protected override void OnDispose() + { + base.OnDispose(); + foreach (DisposableObject disposableObject in ExportTable) + disposableObject.Dispose(this); + SetExportTable(null); + } + + public override TypeSchema FindType(string name) + { + for (int index = 0; index < ExportTable.Length; ++index) + { + TypeSchema typeSchema = ExportTable[index]; + if (typeSchema.Name == name || typeSchema.AlternateName == name) + return typeSchema; + } + return null; + } + + public override LoadResultStatus Status => LoadResultStatus.Success; + + public static Result ValidateStringAsValue( + string inline_, + TypeSchema propertyType, + RangeValidator validator, + out object value) + { + Result result = propertyType.TypeConverter(inline_, StringSchema.Type, out value); + if (result.Failed || validator == null) + return result; + result = validator(value); + return result; + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXLoadResultExports.cs b/UIX/Microsoft/Iris/Markup/UIXLoadResultExports.cs new file mode 100644 index 0000000..6a9ccd5 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXLoadResultExports.cs @@ -0,0 +1,520 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXLoadResultExports +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Accessibility; +using Microsoft.Iris.Animations; +using Microsoft.Iris.Debug; +using Microsoft.Iris.Drawing; +using Microsoft.Iris.Input; +using Microsoft.Iris.InputHandlers; +using Microsoft.Iris.Layout; +using Microsoft.Iris.Layouts; +using Microsoft.Iris.Markup.UIX; +using Microsoft.Iris.ModelItems; +using Microsoft.Iris.Navigation; +using Microsoft.Iris.Render; +using Microsoft.Iris.RenderAPI.Audio; +using Microsoft.Iris.UI; +using Microsoft.Iris.ViewItems; + +namespace Microsoft.Iris.Markup +{ + internal static class UIXLoadResultExports + { + public static TypeSchema AccessibleRoleType; + public static TypeSchema AlignmentType; + public static TypeSchema AlphaOperationType; + public static TypeSchema AnimationEventTypeType; + public static TypeSchema BeginDragPolicyType; + public static TypeSchema ClickCountType; + public static TypeSchema ClickTypeType; + public static TypeSchema ColorOperationType; + public static TypeSchema ColorSchemeType; + public static TypeSchema ContentPositioningPolicyType; + public static TypeSchema CursorType; + public static TypeSchema DataQueryStatusType; + public static TypeSchema DebugLabelFormatType; + public static TypeSchema DebugOutlineScopeType; + public static TypeSchema DropActionType; + public static TypeSchema EmbossDirectionType; + public static TypeSchema FlipDirectionType; + public static TypeSchema FocusChangeReasonType; + public static TypeSchema FontStylesType; + public static TypeSchema GaussianBlurModeType; + public static TypeSchema GraphicsDeviceTypeType; + public static TypeSchema HostStatusType; + public static TypeSchema ImageStatusType; + public static TypeSchema InputHandlerModifiersType; + public static TypeSchema InputHandlerStageType; + public static TypeSchema InputHandlerTransitionType; + public static TypeSchema InterestPointType; + public static TypeSchema InterpolationTypeType; + public static TypeSchema InvokePriorityType; + public static TypeSchema KeyHandlerKeyType; + public static TypeSchema KeyframeFilterType; + public static TypeSchema LineAlignmentType; + public static TypeSchema MaximizeModeType; + public static TypeSchema MissingItemPolicyType; + public static TypeSchema MouseTargetType; + public static TypeSchema NavigationPoliciesType; + public static TypeSchema OrientationType; + public static TypeSchema RelativeEdgeType; + public static TypeSchema RepeatPolicyType; + public static TypeSchema SharedSizePolicyType; + public static TypeSchema ShortcutHandlerCommandType; + public static TypeSchema SizingPolicyType; + public static TypeSchema SnapshotPolicyType; + public static TypeSchema StackPriorityType; + public static TypeSchema StretchingPolicyType; + public static TypeSchema StripAlignmentType; + public static TypeSchema SystemSoundEventType; + public static TypeSchema TextBoundsType; + public static TypeSchema TextSharpnessType; + public static TypeSchema TransformAttributeType; + public static TypeSchema WindowStateType; + public static TypeSchema[] ExportTable; + + public static void InitializeStatics() + { + ExportTable = new TypeSchema[243]; + AccessibleRoleType = new UIXEnumSchema(1, "AccessibleRole", typeof(AccRole), false); + AlignmentType = new UIXEnumSchema(3, "Alignment", typeof(Alignment), false); + AlphaOperationType = new UIXEnumSchema(5, "AlphaOperation", typeof(AlphaOperation), false); + AnimationEventTypeType = new UIXEnumSchema(10, "AnimationEventType", typeof(AnimationEventType), false); + BeginDragPolicyType = new UIXEnumSchema(12, "BeginDragPolicy", typeof(BeginDragPolicy), false); + ClickCountType = new UIXEnumSchema(31, "ClickCount", typeof(ClickCount), false); + ClickTypeType = new UIXEnumSchema(33, "ClickType", typeof(ClickType), true); + ColorOperationType = new UIXEnumSchema(38, "ColorOperation", typeof(ColorOperation), false); + ColorSchemeType = new UIXEnumSchema(39, "ColorScheme", typeof(ColorScheme), false); + ContentPositioningPolicyType = new UIXEnumSchema(41, "ContentPositioningPolicy", typeof(ContentPositioningPolicy), false); + CursorType = new UIXEnumSchema(44, "Cursor", typeof(CursorID), false); + DataQueryStatusType = new UIXEnumSchema(47, "DataQueryStatus", typeof(DataProviderQueryStatus), false); + DebugLabelFormatType = new UIXEnumSchema(50, "DebugLabelFormat", typeof(DebugLabelFormat), false); + DebugOutlineScopeType = new UIXEnumSchema(51, "DebugOutlineScope", typeof(DebugOutlineScope), false); + DropActionType = new UIXEnumSchema(64, "DropAction", typeof(DropAction), true); + EmbossDirectionType = new UIXEnumSchema(84, "EmbossDirection", typeof(EmbossDirection), false); + FlipDirectionType = new UIXEnumSchema(89, "FlipDirection", typeof(FlipDirection), true); + FocusChangeReasonType = new UIXEnumSchema(91, "FocusChangeReason", typeof(FocusChangeReason), true); + FontStylesType = new UIXEnumSchema(94, "FontStyles", typeof(FontStyles), true); + GaussianBlurModeType = new UIXEnumSchema(96, "GaussianBlurMode", typeof(GaussianBlurMode), false); + GraphicsDeviceTypeType = new UIXEnumSchema(98, "GraphicsDeviceType", typeof(RenderingType), false); + HostStatusType = new UIXEnumSchema(102, "HostStatus", typeof(HostStatus), false); + ImageStatusType = new UIXEnumSchema(108, "ImageStatus", typeof(ImageStatus), false); + InputHandlerModifiersType = new UIXEnumSchema(111, "InputHandlerModifiers", typeof(InputHandlerModifiers), true); + InputHandlerStageType = new UIXEnumSchema(112, "InputHandlerStage", typeof(InputHandlerStage), true); + InputHandlerTransitionType = new UIXEnumSchema(113, "InputHandlerTransition", typeof(InputHandlerTransition), false); + InterestPointType = new UIXEnumSchema(118, "InterestPoint", typeof(InterestPoint), false); + InterpolationTypeType = new UIXEnumSchema(122, "InterpolationType", typeof(InterpolationType), false); + InvokePriorityType = new UIXEnumSchema(126, "InvokePriority", typeof(InvokePriority), false); + KeyHandlerKeyType = new UIXEnumSchema(129, "KeyHandlerKey", typeof(KeyHandlerKey), false); + KeyframeFilterType = new UIXEnumSchema(131, "KeyframeFilter", typeof(KeyframeFilter), false); + LineAlignmentType = new UIXEnumSchema(137, "LineAlignment", typeof(LineAlignment), false); + MaximizeModeType = new UIXEnumSchema(146, "MaximizeMode", typeof(MaximizeMode), false); + MissingItemPolicyType = new UIXEnumSchema(148, "MissingItemPolicy", typeof(MissingItemPolicy), false); + MouseTargetType = new UIXEnumSchema(149, "MouseTarget", typeof(MouseTarget), false); + NavigationPoliciesType = new UIXEnumSchema(151, "NavigationPolicies", typeof(NavigationPolicies), true); + OrientationType = new UIXEnumSchema(154, "Orientation", typeof(Orientation), false); + RelativeEdgeType = new UIXEnumSchema(170, "RelativeEdge", typeof(RelativeEdge), false); + RepeatPolicyType = new UIXEnumSchema(172, "RepeatPolicy", typeof(RepeatPolicy), false); + SharedSizePolicyType = new UIXEnumSchema(191, "SharedSizePolicy", typeof(SharedSizePolicy), true); + ShortcutHandlerCommandType = new UIXEnumSchema(193, "ShortcutHandlerCommand", typeof(ShortcutHandlerCommand), false); + SizingPolicyType = new UIXEnumSchema(199, "SizingPolicy", typeof(SizingPolicy), false); + SnapshotPolicyType = new UIXEnumSchema(200, "SnapshotPolicy", typeof(SnapshotPolicy), false); + StackPriorityType = new UIXEnumSchema(206, "StackPriority", typeof(StackPriority), false); + StretchingPolicyType = new UIXEnumSchema(207, "StretchingPolicy", typeof(StretchingPolicy), false); + StripAlignmentType = new UIXEnumSchema(209, "StripAlignment", typeof(StripAlignment), false); + SystemSoundEventType = new UIXEnumSchema(211, "SystemSoundEvent", typeof(SystemSoundEvent), false); + TextBoundsType = new UIXEnumSchema(213, "TextBounds", typeof(TextBounds), true); + TextSharpnessType = new UIXEnumSchema(219, "TextSharpness", typeof(TextSharpness), false); + TransformAttributeType = new UIXEnumSchema(223, "TransformAttribute", typeof(TransformAttribute), false); + WindowStateType = new UIXEnumSchema(242, "WindowState", typeof(Microsoft.Iris.WindowState), false); + AccessibleSchema.Pass1Initialize(); + AliasSchema.Pass1Initialize(); + AlphaKeyframeSchema.Pass1Initialize(); + AnchorEdgeSchema.Pass1Initialize(); + AnchorLayoutSchema.Pass1Initialize(); + AnchorLayoutInputSchema.Pass1Initialize(); + AnimationSchema.Pass1Initialize(); + AnimationHandleSchema.Pass1Initialize(); + BlendSchema.Pass1Initialize(); + BlurSchema.Pass1Initialize(); + BooleanSchema.Pass1Initialize(); + BooleanChoiceSchema.Pass1Initialize(); + BrightnessSchema.Pass1Initialize(); + BrightnessInstanceSchema.Pass1Initialize(); + ByteSchema.Pass1Initialize(); + ByteRangedValueSchema.Pass1Initialize(); + CameraSchema.Pass1Initialize(); + CameraAtKeyframeSchema.Pass1Initialize(); + CameraEyeKeyframeSchema.Pass1Initialize(); + CameraUpKeyframeSchema.Pass1Initialize(); + CameraZnKeyframeSchema.Pass1Initialize(); + CaretInfoSchema.Pass1Initialize(); + CharSchema.Pass1Initialize(); + ChoiceSchema.Pass1Initialize(); + ClassSchema.Pass1Initialize(); + ClassStateSchema.Pass1Initialize(); + ClickHandlerSchema.Pass1Initialize(); + ClipSchema.Pass1Initialize(); + ColorSchema.Pass1Initialize(); + ColorElementSchema.Pass1Initialize(); + ColorElementInstanceSchema.Pass1Initialize(); + CommandSchema.Pass1Initialize(); + ContrastSchema.Pass1Initialize(); + ContrastInstanceSchema.Pass1Initialize(); + DataMappingSchema.Pass1Initialize(); + DataQuerySchema.Pass1Initialize(); + DataTypeSchema.Pass1Initialize(); + DebugSchema.Pass1Initialize(); + DebugOutlinesSchema.Pass1Initialize(); + DefaultLayoutSchema.Pass1Initialize(); + DesaturateSchema.Pass1Initialize(); + DesaturateInstanceSchema.Pass1Initialize(); + DestinationElementSchema.Pass1Initialize(); + DestinationElementInstanceSchema.Pass1Initialize(); + DictionarySchema.Pass1Initialize(); + DockLayoutSchema.Pass1Initialize(); + DockLayoutInputSchema.Pass1Initialize(); + DoubleSchema.Pass1Initialize(); + DragHandlerSchema.Pass1Initialize(); + DragSourceHandlerSchema.Pass1Initialize(); + DropTargetHandlerSchema.Pass1Initialize(); + EdgeDetectionSchema.Pass1Initialize(); + EdgeDetectionInstanceSchema.Pass1Initialize(); + EditableTextDataSchema.Pass1Initialize(); + EffectSchema.Pass1Initialize(); + EffectAnimationSchema.Pass1Initialize(); + EffectColorAnimationSchema.Pass1Initialize(); + EffectColorKeyframeSchema.Pass1Initialize(); + EffectElementSchema.Pass1Initialize(); + EffectElementInstanceSchema.Pass1Initialize(); + EffectFloatAnimationSchema.Pass1Initialize(); + EffectFloatKeyframeSchema.Pass1Initialize(); + EffectInputSchema.Pass1Initialize(); + EffectInstanceSchema.Pass1Initialize(); + EffectLayerSchema.Pass1Initialize(); + EffectOperationSchema.Pass1Initialize(); + EffectVector3AnimationSchema.Pass1Initialize(); + EffectVector3KeyframeSchema.Pass1Initialize(); + EmbossSchema.Pass1Initialize(); + EmbossInstanceSchema.Pass1Initialize(); + EnumeratorSchema.Pass1Initialize(); + EnvironmentSchema.Pass1Initialize(); + EventContextSchema.Pass1Initialize(); + FlowLayoutSchema.Pass1Initialize(); + FocusHandlerSchema.Pass1Initialize(); + FontSchema.Pass1Initialize(); + FormLayoutInputSchema.Pass1Initialize(); + GraphicSchema.Pass1Initialize(); + GridLayoutSchema.Pass1Initialize(); + GroupSchema.Pass1Initialize(); + HostSchema.Pass1Initialize(); + HwndHostSchema.Pass1Initialize(); + IAnimationSchema.Pass1Initialize(); + ImageSchema.Pass1Initialize(); + ImageElementSchema.Pass1Initialize(); + ImageElementInstanceSchema.Pass1Initialize(); + IndexSchema.Pass1Initialize(); + InputHandlerSchema.Pass1Initialize(); + InsetSchema.Pass1Initialize(); + Int32Schema.Pass1Initialize(); + Int64Schema.Pass1Initialize(); + IntRangedValueSchema.Pass1Initialize(); + InterpolateElementSchema.Pass1Initialize(); + InterpolateElementInstanceSchema.Pass1Initialize(); + InterpolationSchema.Pass1Initialize(); + InvAlphaSchema.Pass1Initialize(); + InvColorSchema.Pass1Initialize(); + InvertSchema.Pass1Initialize(); + ItemAlignmentSchema.Pass1Initialize(); + KeyHandlerSchema.Pass1Initialize(); + KeyframeSchema.Pass1Initialize(); + LayoutSchema.Pass1Initialize(); + LayoutInputSchema.Pass1Initialize(); + LayoutOutputSchema.Pass1Initialize(); + LightShaftSchema.Pass1Initialize(); + LightShaftInstanceSchema.Pass1Initialize(); + ListSchema.Pass1Initialize(); + MajorMinorSchema.Pass1Initialize(); + MappingSchema.Pass1Initialize(); + MarkupSchema.Pass1Initialize(); + MarkupDataQueryInstanceSchema.Pass1Initialize(); + MarkupDataTypeInstanceSchema.Pass1Initialize(); + MarkupErrorSchema.Pass1Initialize(); + MathSchema.Pass1Initialize(); + MergeAnimationSchema.Pass1Initialize(); + MouseWheelHandlerSchema.Pass1Initialize(); + NullSchema.Pass1Initialize(); + ObjectSchema.Pass1Initialize(); + OrientationKeyframeSchema.Pass1Initialize(); + PanelSchema.Pass1Initialize(); + PlacementModeSchema.Pass1Initialize(); + PointSchema.Pass1Initialize(); + PointLight2DSchema.Pass1Initialize(); + PointLight2DInstanceSchema.Pass1Initialize(); + PopupLayoutSchema.Pass1Initialize(); + PopupLayoutInputSchema.Pass1Initialize(); + PopupPositionSchema.Pass1Initialize(); + PositionKeyframeSchema.Pass1Initialize(); + PositionXKeyframeSchema.Pass1Initialize(); + PositionYKeyframeSchema.Pass1Initialize(); + RandomSchema.Pass1Initialize(); + RangedValueSchema.Pass1Initialize(); + RectangleSchema.Pass1Initialize(); + RelativeToSchema.Pass1Initialize(); + RepeaterSchema.Pass1Initialize(); + RotateKeyframeSchema.Pass1Initialize(); + RotateLayoutSchema.Pass1Initialize(); + RotationSchema.Pass1Initialize(); + SavedKeyFocusSchema.Pass1Initialize(); + ScaleKeyframeSchema.Pass1Initialize(); + ScaleLayoutSchema.Pass1Initialize(); + ScaleXKeyframeSchema.Pass1Initialize(); + ScaleYKeyframeSchema.Pass1Initialize(); + ScrollModelSchema.Pass1Initialize(); + ScrollModelBaseSchema.Pass1Initialize(); + ScrollerSchema.Pass1Initialize(); + ScrollingHandlerSchema.Pass1Initialize(); + SelectionManagerSchema.Pass1Initialize(); + SelectionRangeSchema.Pass1Initialize(); + SepiaSchema.Pass1Initialize(); + SepiaInstanceSchema.Pass1Initialize(); + SharedSizeSchema.Pass1Initialize(); + ShortcutHandlerSchema.Pass1Initialize(); + SingleSchema.Pass1Initialize(); + SizeSchema.Pass1Initialize(); + SizeKeyframeSchema.Pass1Initialize(); + SizeXKeyframeSchema.Pass1Initialize(); + SizeYKeyframeSchema.Pass1Initialize(); + SoundSchema.Pass1Initialize(); + SpotLight2DSchema.Pass1Initialize(); + SpotLight2DInstanceSchema.Pass1Initialize(); + StackLayoutSchema.Pass1Initialize(); + StackLayoutInputSchema.Pass1Initialize(); + StringSchema.Pass1Initialize(); + SwitchAnimationSchema.Pass1Initialize(); + TextSchema.Pass1Initialize(); + TextEditingHandlerSchema.Pass1Initialize(); + TextFragmentSchema.Pass1Initialize(); + TextRunDataSchema.Pass1Initialize(); + TextRunRendererSchema.Pass1Initialize(); + TextScrollModelSchema.Pass1Initialize(); + TextStyleSchema.Pass1Initialize(); + TimerSchema.Pass1Initialize(); + TransformAnimationSchema.Pass1Initialize(); + TransformByAttributeAnimationSchema.Pass1Initialize(); + TypeSchemaDefinition.Pass1Initialize(); + TypeConstraintSchema.Pass1Initialize(); + TypeSelectorSchema.Pass1Initialize(); + TypingHandlerSchema.Pass1Initialize(); + UISchema.Pass1Initialize(); + UIStateSchema.Pass1Initialize(); + ValueRangeSchema.Pass1Initialize(); + ValueTransformerSchema.Pass1Initialize(); + Vector2Schema.Pass1Initialize(); + Vector3Schema.Pass1Initialize(); + VideoSchema.Pass1Initialize(); + VideoElementSchema.Pass1Initialize(); + VideoElementInstanceSchema.Pass1Initialize(); + VideoStreamSchema.Pass1Initialize(); + ViewItemSchema.Pass1Initialize(); + VoidSchema.Pass1Initialize(); + WindowSchema.Pass1Initialize(); + AccessibleSchema.Pass2Initialize(); + AliasSchema.Pass2Initialize(); + AlphaKeyframeSchema.Pass2Initialize(); + AnchorEdgeSchema.Pass2Initialize(); + AnchorLayoutSchema.Pass2Initialize(); + AnchorLayoutInputSchema.Pass2Initialize(); + AnimationSchema.Pass2Initialize(); + AnimationHandleSchema.Pass2Initialize(); + BlendSchema.Pass2Initialize(); + BlurSchema.Pass2Initialize(); + BooleanSchema.Pass2Initialize(); + BooleanChoiceSchema.Pass2Initialize(); + BrightnessSchema.Pass2Initialize(); + BrightnessInstanceSchema.Pass2Initialize(); + ByteSchema.Pass2Initialize(); + ByteRangedValueSchema.Pass2Initialize(); + CameraSchema.Pass2Initialize(); + CameraAtKeyframeSchema.Pass2Initialize(); + CameraEyeKeyframeSchema.Pass2Initialize(); + CameraUpKeyframeSchema.Pass2Initialize(); + CameraZnKeyframeSchema.Pass2Initialize(); + CaretInfoSchema.Pass2Initialize(); + CharSchema.Pass2Initialize(); + ChoiceSchema.Pass2Initialize(); + ClassSchema.Pass2Initialize(); + ClassStateSchema.Pass2Initialize(); + ClickHandlerSchema.Pass2Initialize(); + ClipSchema.Pass2Initialize(); + ColorSchema.Pass2Initialize(); + ColorElementSchema.Pass2Initialize(); + ColorElementInstanceSchema.Pass2Initialize(); + CommandSchema.Pass2Initialize(); + ContrastSchema.Pass2Initialize(); + ContrastInstanceSchema.Pass2Initialize(); + DataMappingSchema.Pass2Initialize(); + DataQuerySchema.Pass2Initialize(); + DataTypeSchema.Pass2Initialize(); + DebugSchema.Pass2Initialize(); + DebugOutlinesSchema.Pass2Initialize(); + DefaultLayoutSchema.Pass2Initialize(); + DesaturateSchema.Pass2Initialize(); + DesaturateInstanceSchema.Pass2Initialize(); + DestinationElementSchema.Pass2Initialize(); + DestinationElementInstanceSchema.Pass2Initialize(); + DictionarySchema.Pass2Initialize(); + DockLayoutSchema.Pass2Initialize(); + DockLayoutInputSchema.Pass2Initialize(); + DoubleSchema.Pass2Initialize(); + DragHandlerSchema.Pass2Initialize(); + DragSourceHandlerSchema.Pass2Initialize(); + DropTargetHandlerSchema.Pass2Initialize(); + EdgeDetectionSchema.Pass2Initialize(); + EdgeDetectionInstanceSchema.Pass2Initialize(); + EditableTextDataSchema.Pass2Initialize(); + EffectSchema.Pass2Initialize(); + EffectAnimationSchema.Pass2Initialize(); + EffectColorAnimationSchema.Pass2Initialize(); + EffectColorKeyframeSchema.Pass2Initialize(); + EffectElementSchema.Pass2Initialize(); + EffectElementInstanceSchema.Pass2Initialize(); + EffectFloatAnimationSchema.Pass2Initialize(); + EffectFloatKeyframeSchema.Pass2Initialize(); + EffectInputSchema.Pass2Initialize(); + EffectInstanceSchema.Pass2Initialize(); + EffectLayerSchema.Pass2Initialize(); + EffectOperationSchema.Pass2Initialize(); + EffectVector3AnimationSchema.Pass2Initialize(); + EffectVector3KeyframeSchema.Pass2Initialize(); + EmbossSchema.Pass2Initialize(); + EmbossInstanceSchema.Pass2Initialize(); + EnumeratorSchema.Pass2Initialize(); + EnvironmentSchema.Pass2Initialize(); + EventContextSchema.Pass2Initialize(); + FlowLayoutSchema.Pass2Initialize(); + FocusHandlerSchema.Pass2Initialize(); + FontSchema.Pass2Initialize(); + FormLayoutInputSchema.Pass2Initialize(); + GraphicSchema.Pass2Initialize(); + GridLayoutSchema.Pass2Initialize(); + GroupSchema.Pass2Initialize(); + HostSchema.Pass2Initialize(); + HwndHostSchema.Pass2Initialize(); + IAnimationSchema.Pass2Initialize(); + ImageSchema.Pass2Initialize(); + ImageElementSchema.Pass2Initialize(); + ImageElementInstanceSchema.Pass2Initialize(); + IndexSchema.Pass2Initialize(); + InputHandlerSchema.Pass2Initialize(); + InsetSchema.Pass2Initialize(); + Int32Schema.Pass2Initialize(); + Int64Schema.Pass2Initialize(); + IntRangedValueSchema.Pass2Initialize(); + InterpolateElementSchema.Pass2Initialize(); + InterpolateElementInstanceSchema.Pass2Initialize(); + InterpolationSchema.Pass2Initialize(); + InvAlphaSchema.Pass2Initialize(); + InvColorSchema.Pass2Initialize(); + InvertSchema.Pass2Initialize(); + ItemAlignmentSchema.Pass2Initialize(); + KeyHandlerSchema.Pass2Initialize(); + KeyframeSchema.Pass2Initialize(); + LayoutSchema.Pass2Initialize(); + LayoutInputSchema.Pass2Initialize(); + LayoutOutputSchema.Pass2Initialize(); + LightShaftSchema.Pass2Initialize(); + LightShaftInstanceSchema.Pass2Initialize(); + ListSchema.Pass2Initialize(); + MajorMinorSchema.Pass2Initialize(); + MappingSchema.Pass2Initialize(); + MarkupSchema.Pass2Initialize(); + MarkupDataQueryInstanceSchema.Pass2Initialize(); + MarkupDataTypeInstanceSchema.Pass2Initialize(); + MarkupErrorSchema.Pass2Initialize(); + MathSchema.Pass2Initialize(); + MergeAnimationSchema.Pass2Initialize(); + MouseWheelHandlerSchema.Pass2Initialize(); + NullSchema.Pass2Initialize(); + ObjectSchema.Pass2Initialize(); + OrientationKeyframeSchema.Pass2Initialize(); + PanelSchema.Pass2Initialize(); + PlacementModeSchema.Pass2Initialize(); + PointSchema.Pass2Initialize(); + PointLight2DSchema.Pass2Initialize(); + PointLight2DInstanceSchema.Pass2Initialize(); + PopupLayoutSchema.Pass2Initialize(); + PopupLayoutInputSchema.Pass2Initialize(); + PopupPositionSchema.Pass2Initialize(); + PositionKeyframeSchema.Pass2Initialize(); + PositionXKeyframeSchema.Pass2Initialize(); + PositionYKeyframeSchema.Pass2Initialize(); + RandomSchema.Pass2Initialize(); + RangedValueSchema.Pass2Initialize(); + RectangleSchema.Pass2Initialize(); + RelativeToSchema.Pass2Initialize(); + RepeaterSchema.Pass2Initialize(); + RotateKeyframeSchema.Pass2Initialize(); + RotateLayoutSchema.Pass2Initialize(); + RotationSchema.Pass2Initialize(); + SavedKeyFocusSchema.Pass2Initialize(); + ScaleKeyframeSchema.Pass2Initialize(); + ScaleLayoutSchema.Pass2Initialize(); + ScaleXKeyframeSchema.Pass2Initialize(); + ScaleYKeyframeSchema.Pass2Initialize(); + ScrollModelSchema.Pass2Initialize(); + ScrollModelBaseSchema.Pass2Initialize(); + ScrollerSchema.Pass2Initialize(); + ScrollingHandlerSchema.Pass2Initialize(); + SelectionManagerSchema.Pass2Initialize(); + SelectionRangeSchema.Pass2Initialize(); + SepiaSchema.Pass2Initialize(); + SepiaInstanceSchema.Pass2Initialize(); + SharedSizeSchema.Pass2Initialize(); + ShortcutHandlerSchema.Pass2Initialize(); + SingleSchema.Pass2Initialize(); + SizeSchema.Pass2Initialize(); + SizeKeyframeSchema.Pass2Initialize(); + SizeXKeyframeSchema.Pass2Initialize(); + SizeYKeyframeSchema.Pass2Initialize(); + SoundSchema.Pass2Initialize(); + SpotLight2DSchema.Pass2Initialize(); + SpotLight2DInstanceSchema.Pass2Initialize(); + StackLayoutSchema.Pass2Initialize(); + StackLayoutInputSchema.Pass2Initialize(); + StringSchema.Pass2Initialize(); + SwitchAnimationSchema.Pass2Initialize(); + TextSchema.Pass2Initialize(); + TextEditingHandlerSchema.Pass2Initialize(); + TextFragmentSchema.Pass2Initialize(); + TextRunDataSchema.Pass2Initialize(); + TextRunRendererSchema.Pass2Initialize(); + TextScrollModelSchema.Pass2Initialize(); + TextStyleSchema.Pass2Initialize(); + TimerSchema.Pass2Initialize(); + TransformAnimationSchema.Pass2Initialize(); + TransformByAttributeAnimationSchema.Pass2Initialize(); + TypeSchemaDefinition.Pass2Initialize(); + TypeConstraintSchema.Pass2Initialize(); + TypeSelectorSchema.Pass2Initialize(); + TypingHandlerSchema.Pass2Initialize(); + UISchema.Pass2Initialize(); + UIStateSchema.Pass2Initialize(); + ValueRangeSchema.Pass2Initialize(); + ValueTransformerSchema.Pass2Initialize(); + Vector2Schema.Pass2Initialize(); + Vector3Schema.Pass2Initialize(); + VideoSchema.Pass2Initialize(); + VideoElementSchema.Pass2Initialize(); + VideoElementInstanceSchema.Pass2Initialize(); + VideoStreamSchema.Pass2Initialize(); + ViewItemSchema.Pass2Initialize(); + VoidSchema.Pass2Initialize(); + WindowSchema.Pass2Initialize(); + } + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXMethodSchema.cs b/UIX/Microsoft/Iris/Markup/UIXMethodSchema.cs new file mode 100644 index 0000000..d73f1fc --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXMethodSchema.cs @@ -0,0 +1,43 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXMethodSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class UIXMethodSchema : MethodSchema + { + private string _name; + private TypeSchema[] _parameterTypes; + private TypeSchema _returnType; + private bool _isStatic; + private InvokeHandler _invoke; + + public UIXMethodSchema( + short ownerTypeID, + string name, + short[] parameterTypeIDs, + short returnTypeID, + InvokeHandler invoke, + bool isStatic) + : base(UIXTypes.MapIDToType(ownerTypeID)) + { + _name = name; + _parameterTypes = UIXTypes.MapIDsToTypes(parameterTypeIDs); + _returnType = UIXTypes.MapIDToType(returnTypeID); + _invoke = invoke; + _isStatic = isStatic; + } + + public override string Name => _name; + + public override TypeSchema[] ParameterTypes => _parameterTypes; + + public override TypeSchema ReturnType => _returnType; + + public override bool IsStatic => _isStatic; + + public override object Invoke(object instance, object[] parameters) => _invoke(instance, parameters); + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXPropertySchema.cs b/UIX/Microsoft/Iris/Markup/UIXPropertySchema.cs new file mode 100644 index 0000000..63855e8 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXPropertySchema.cs @@ -0,0 +1,72 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXPropertySchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal class UIXPropertySchema : PropertySchema + { + private string _name; + private TypeSchema _propertyType; + private TypeSchema _alternateType; + private bool _isStatic; + private ExpressionRestriction _expressionRestriction; + private bool _requiredForCreation; + private RangeValidator _rangeValidator; + private bool _notifiesOnChange; + private GetValueHandler _getValue; + private SetValueHandler _setValue; + + public UIXPropertySchema( + short ownerTypeID, + string name, + short typeID, + short alternateTypeID, + ExpressionRestriction expressionRestriction, + bool requiredForCreation, + RangeValidator rangeValidator, + bool notifiesOnChange, + GetValueHandler getValue, + SetValueHandler setValue, + bool isStatic) + : base(UIXTypes.MapIDToType(ownerTypeID)) + { + _name = name; + _propertyType = UIXTypes.MapIDToType(typeID); + _alternateType = UIXTypes.MapIDToType(alternateTypeID); + _expressionRestriction = expressionRestriction; + _requiredForCreation = requiredForCreation; + _rangeValidator = rangeValidator; + _notifiesOnChange = notifiesOnChange; + _getValue = getValue; + _setValue = setValue; + _isStatic = isStatic; + } + + public override string Name => _name; + + public override TypeSchema PropertyType => _propertyType; + + public override TypeSchema AlternateType => _alternateType; + + public override bool CanRead => _getValue != null; + + public override bool CanWrite => _setValue != null; + + public override bool IsStatic => _isStatic; + + public override ExpressionRestriction ExpressionRestriction => _expressionRestriction; + + public override bool RequiredForCreation => _requiredForCreation; + + public override RangeValidator RangeValidator => _rangeValidator; + + public override bool NotifiesOnChange => _notifiesOnChange; + + public override object GetValue(object instance) => _getValue(instance); + + public override void SetValue(ref object instance, object value) => _setValue(ref instance, value); + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXTypeFlags.cs b/UIX/Microsoft/Iris/Markup/UIXTypeFlags.cs new file mode 100644 index 0000000..472a9e1 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXTypeFlags.cs @@ -0,0 +1,16 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXTypeFlags +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal enum UIXTypeFlags + { + None = 0, + Disposable = 1, + Immutable = 2, + Static = 4, + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXTypeID.cs b/UIX/Microsoft/Iris/Markup/UIXTypeID.cs new file mode 100644 index 0000000..d7857fe --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXTypeID.cs @@ -0,0 +1,256 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXTypeID +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class UIXTypeID + { + public const short None = -1; + public const short Accessible = 0; + public const short AccessibleRole = 1; + public const short Alias = 2; + public const short Alignment = 3; + public const short AlphaKeyframe = 4; + public const short AlphaOperation = 5; + public const short AnchorEdge = 6; + public const short AnchorLayout = 7; + public const short AnchorLayoutInput = 8; + public const short Animation = 9; + public const short AnimationEventType = 10; + public const short AnimationHandle = 11; + public const short BeginDragPolicy = 12; + public const short Blend = 13; + public const short Blur = 14; + public const short Boolean = 15; + public const short BooleanChoice = 16; + public const short Brightness = 17; + public const short BrightnessInstance = 18; + public const short Byte = 19; + public const short ByteRangedValue = 20; + public const short Camera = 21; + public const short CameraAtKeyframe = 22; + public const short CameraEyeKeyframe = 23; + public const short CameraUpKeyframe = 24; + public const short CameraZnKeyframe = 25; + public const short CaretInfo = 26; + public const short Char = 27; + public const short Choice = 28; + public const short Class = 29; + public const short ClassState = 30; + public const short ClickCount = 31; + public const short ClickHandler = 32; + public const short ClickType = 33; + public const short Clip = 34; + public const short Color = 35; + public const short ColorElement = 36; + public const short ColorElementInstance = 37; + public const short ColorOperation = 38; + public const short ColorScheme = 39; + public const short Command = 40; + public const short ContentPositioningPolicy = 41; + public const short Contrast = 42; + public const short ContrastInstance = 43; + public const short Cursor = 44; + public const short DataMapping = 45; + public const short DataQuery = 46; + public const short DataQueryStatus = 47; + public const short DataType = 48; + public const short Debug = 49; + public const short DebugLabelFormat = 50; + public const short DebugOutlineScope = 51; + public const short DebugOutlines = 52; + public const short DefaultLayout = 53; + public const short Desaturate = 54; + public const short DesaturateInstance = 55; + public const short DestinationElement = 56; + public const short DestinationElementInstance = 57; + public const short Dictionary = 58; + public const short DockLayout = 59; + public const short DockLayoutInput = 60; + public const short Double = 61; + public const short DragHandler = 62; + public const short DragSourceHandler = 63; + public const short DropAction = 64; + public const short DropTargetHandler = 65; + public const short EdgeDetection = 66; + public const short EdgeDetectionInstance = 67; + public const short EditableTextData = 68; + public const short Effect = 69; + public const short EffectAnimation = 70; + public const short EffectColorAnimation = 71; + public const short EffectColorKeyframe = 72; + public const short EffectElement = 73; + public const short EffectElementInstance = 74; + public const short EffectFloatAnimation = 75; + public const short EffectFloatKeyframe = 76; + public const short EffectInput = 77; + public const short EffectInstance = 78; + public const short EffectLayer = 79; + public const short EffectOperation = 80; + public const short EffectVector3Animation = 81; + public const short EffectVector3Keyframe = 82; + public const short Emboss = 83; + public const short EmbossDirection = 84; + public const short EmbossInstance = 85; + public const short Enumerator = 86; + public const short Environment = 87; + public const short EventContext = 88; + public const short FlipDirection = 89; + public const short FlowLayout = 90; + public const short FocusChangeReason = 91; + public const short FocusHandler = 92; + public const short Font = 93; + public const short FontStyles = 94; + public const short FormLayoutInput = 95; + public const short GaussianBlurMode = 96; + public const short Graphic = 97; + public const short GraphicsDeviceType = 98; + public const short GridLayout = 99; + public const short Group = 100; + public const short Host = 101; + public const short HostStatus = 102; + public const short HwndHost = 103; + public const short IAnimation = 104; + public const short Image = 105; + public const short ImageElement = 106; + public const short ImageElementInstance = 107; + public const short ImageStatus = 108; + public const short Index = 109; + public const short InputHandler = 110; + public const short InputHandlerModifiers = 111; + public const short InputHandlerStage = 112; + public const short InputHandlerTransition = 113; + public const short Inset = 114; + public const short Int32 = 115; + public const short Int64 = 116; + public const short IntRangedValue = 117; + public const short InterestPoint = 118; + public const short InterpolateElement = 119; + public const short InterpolateElementInstance = 120; + public const short Interpolation = 121; + public const short InterpolationType = 122; + public const short InvAlpha = 123; + public const short InvColor = 124; + public const short Invert = 125; + public const short InvokePriority = 126; + public const short ItemAlignment = 127; + public const short KeyHandler = 128; + public const short KeyHandlerKey = 129; + public const short Keyframe = 130; + public const short KeyframeFilter = 131; + public const short Layout = 132; + public const short LayoutInput = 133; + public const short LayoutOutput = 134; + public const short LightShaft = 135; + public const short LightShaftInstance = 136; + public const short LineAlignment = 137; + public const short List = 138; + public const short MajorMinor = 139; + public const short Mapping = 140; + public const short Markup = 141; + public const short MarkupDataQueryInstance = 142; + public const short MarkupDataTypeInstance = 143; + public const short MarkupError = 144; + public const short Math = 145; + public const short MaximizeMode = 146; + public const short MergeAnimation = 147; + public const short MissingItemPolicy = 148; + public const short MouseTarget = 149; + public const short MouseWheelHandler = 150; + public const short NavigationPolicies = 151; + public const short Null = 152; + public const short Object = 153; + public const short Orientation = 154; + public const short OrientationKeyframe = 155; + public const short Panel = 156; + public const short PlacementMode = 157; + public const short Point = 158; + public const short PointLight2D = 159; + public const short PointLight2DInstance = 160; + public const short PopupLayout = 161; + public const short PopupLayoutInput = 162; + public const short PopupPosition = 163; + public const short PositionKeyframe = 164; + public const short PositionXKeyframe = 165; + public const short PositionYKeyframe = 166; + public const short Random = 167; + public const short RangedValue = 168; + public const short Rectangle = 169; + public const short RelativeEdge = 170; + public const short RelativeTo = 171; + public const short RepeatPolicy = 172; + public const short Repeater = 173; + public const short RotateKeyframe = 174; + public const short RotateLayout = 175; + public const short Rotation = 176; + public const short SavedKeyFocus = 177; + public const short ScaleKeyframe = 178; + public const short ScaleLayout = 179; + public const short ScaleXKeyframe = 180; + public const short ScaleYKeyframe = 181; + public const short ScrollModel = 182; + public const short ScrollModelBase = 183; + public const short Scroller = 184; + public const short ScrollingHandler = 185; + public const short SelectionManager = 186; + public const short SelectionRange = 187; + public const short Sepia = 188; + public const short SepiaInstance = 189; + public const short SharedSize = 190; + public const short SharedSizePolicy = 191; + public const short ShortcutHandler = 192; + public const short ShortcutHandlerCommand = 193; + public const short Single = 194; + public const short Size = 195; + public const short SizeKeyframe = 196; + public const short SizeXKeyframe = 197; + public const short SizeYKeyframe = 198; + public const short SizingPolicy = 199; + public const short SnapshotPolicy = 200; + public const short Sound = 201; + public const short SpotLight2D = 202; + public const short SpotLight2DInstance = 203; + public const short StackLayout = 204; + public const short StackLayoutInput = 205; + public const short StackPriority = 206; + public const short StretchingPolicy = 207; + public const short String = 208; + public const short StripAlignment = 209; + public const short SwitchAnimation = 210; + public const short SystemSoundEvent = 211; + public const short Text = 212; + public const short TextBounds = 213; + public const short TextEditingHandler = 214; + public const short TextFragment = 215; + public const short TextRunData = 216; + public const short TextRunRenderer = 217; + public const short TextScrollModel = 218; + public const short TextSharpness = 219; + public const short TextStyle = 220; + public const short Timer = 221; + public const short TransformAnimation = 222; + public const short TransformAttribute = 223; + public const short TransformByAttributeAnimation = 224; + public const short Type = 225; + public const short TypeConstraint = 226; + public const short TypeSelector = 227; + public const short TypingHandler = 228; + public const short UI = 229; + public const short UIState = 230; + public const short ValueRange = 231; + public const short ValueTransformer = 232; + public const short Vector2 = 233; + public const short Vector3 = 234; + public const short Video = 235; + public const short VideoElement = 236; + public const short VideoElementInstance = 237; + public const short VideoStream = 238; + public const short ViewItem = 239; + public const short Void = 240; + public const short Window = 241; + public const short WindowState = 242; + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs b/UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs new file mode 100644 index 0000000..efcff3a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXTypeSchema.cs @@ -0,0 +1,255 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXTypeSchema +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +using Microsoft.Iris.Library; +using System; + +namespace Microsoft.Iris.Markup +{ + internal class UIXTypeSchema : TypeSchema + { + private short _typeID; + private short _baseTypeID; + private string _name; + private string _alternateName; + private TypeSchema _baseType; + private DefaultConstructHandler _defaultConstructor; + private ConstructorSchema[] _constructors; + private PropertySchema[] _properties; + private MethodSchema[] _methods; + private EventSchema[] _events; + private TypeConverterHandler _typeConverter; + private SupportsTypeConversionHandler _supportsTypeConversion; + private EncodeBinaryHandler _encodeBinary; + private DecodeBinaryHandler _decodeBinary; + private PerformOperationHandler _performOperation; + private SupportsOperationHandler _supportsOperation; + private FindCanonicalInstanceHandler _findCanonicalInstance; + private Type _instanceType; + private UIXTypeFlags _flags; + private static object[] EmptyParameterList = new object[0]; + + public UIXTypeSchema( + short typeID, + string name, + string alternateName, + short baseTypeID, + Type instanceType, + UIXTypeFlags flags) + : base(MarkupSystem.UIXGlobal) + { + _typeID = typeID; + _baseTypeID = baseTypeID; + _name = name; + _alternateName = alternateName; + _instanceType = instanceType; + _flags = flags; + UIXTypes.RegisterTypeForID(typeID, this); + } + + public void Initialize( + DefaultConstructHandler defaultConstructor, + ConstructorSchema[] constructors, + PropertySchema[] properties, + MethodSchema[] methods, + EventSchema[] events, + FindCanonicalInstanceHandler findCanonicalInstance, + TypeConverterHandler typeConverter, + SupportsTypeConversionHandler supportsTypeConversion, + EncodeBinaryHandler encodeBinary, + DecodeBinaryHandler decodeBinary, + PerformOperationHandler performOperation, + SupportsOperationHandler supportsOperation) + { + if (constructors == null) + constructors = ConstructorSchema.EmptyList; + if (properties == null) + properties = PropertySchema.EmptyList; + if (methods == null) + methods = MethodSchema.EmptyList; + if (events == null) + events = EventSchema.EmptyList; + _defaultConstructor = defaultConstructor; + _constructors = constructors; + _properties = properties; + _methods = methods; + _events = events; + _findCanonicalInstance = findCanonicalInstance; + _typeConverter = typeConverter; + _supportsTypeConversion = supportsTypeConversion; + _encodeBinary = encodeBinary; + _decodeBinary = decodeBinary; + _performOperation = performOperation; + _supportsOperation = supportsOperation; + } + + protected override void OnDispose() + { + base.OnDispose(); + foreach (DisposableObject constructor in _constructors) + constructor.Dispose(this); + foreach (DisposableObject property in _properties) + property.Dispose(this); + foreach (DisposableObject method in _methods) + method.Dispose(this); + foreach (DisposableObject disposableObject in _events) + disposableObject.Dispose(this); + } + + public override string Name => _name; + + public override string AlternateName => _alternateName; + + public override TypeSchema Base + { + get + { + if (_baseTypeID != -1 && _baseType == null) + _baseType = UIXTypes.MapIDToType(_baseTypeID); + return _baseType; + } + } + + public override bool Contractual => false; + + public override Type RuntimeType => _instanceType; + + public override bool IsNativeAssignableFrom(object check) => RuntimeType.IsAssignableFrom(check.GetType()); + + public override bool IsNativeAssignableFrom(TypeSchema checkSchema) => false; + + public override bool Disposable => (_flags & UIXTypeFlags.Disposable) != UIXTypeFlags.None; + + public override bool IsStatic => (_flags & UIXTypeFlags.Static) != UIXTypeFlags.None; + + public override object ConstructDefault() => _defaultConstructor(); + + public override bool HasDefaultConstructor => _defaultConstructor != null; + + public override bool HasInitializer => false; + + public override void InitializeInstance(ref object instance) + { + } + + public override ConstructorSchema FindConstructor(TypeSchema[] parameters) + { + for (int index1 = 0; index1 < _constructors.Length; ++index1) + { + ConstructorSchema constructor = _constructors[index1]; + TypeSchema[] parameterTypes = constructor.ParameterTypes; + if (parameters.Length == parameterTypes.Length) + { + bool flag = true; + for (int index2 = 0; index2 < parameters.Length; ++index2) + { + if (!parameterTypes[index2].IsAssignableFrom(parameters[index2])) + { + flag = false; + break; + } + } + if (flag) + return constructor; + } + } + return null; + } + + public override PropertySchema FindProperty(string name) + { + for (int index = 0; index < _properties.Length; ++index) + { + PropertySchema property = _properties[index]; + if (name == property.Name) + return property; + } + return null; + } + + public override ConstructorSchema[] Constructors => _constructors; + + public override PropertySchema[] Properties => _properties; + + public override MethodSchema[] Methods => _methods; + + public override EventSchema[] Events => _events; + + public override MethodSchema FindMethod(string name, TypeSchema[] parameters) + { + for (int index1 = 0; index1 < _methods.Length; ++index1) + { + MethodSchema method = _methods[index1]; + if (name == method.Name) + { + TypeSchema[] parameterTypes = method.ParameterTypes; + if (parameters.Length == parameterTypes.Length) + { + bool flag = true; + for (int index2 = 0; index2 < parameters.Length; ++index2) + { + if (!parameterTypes[index2].IsAssignableFrom(parameters[index2])) + { + flag = false; + break; + } + } + if (flag) + return method; + } + } + } + return null; + } + + public override EventSchema FindEvent(string name) + { + for (int index = 0; index < _events.Length; ++index) + { + EventSchema eventSchema = _events[index]; + if (name == eventSchema.Name) + return eventSchema; + } + return null; + } + + public override object FindCanonicalInstance(string name) => _findCanonicalInstance != null ? _findCanonicalInstance(name) : null; + + public override Result TypeConverter( + object from, + TypeSchema fromType, + out object instance) + { + return _typeConverter(from, fromType, out instance); + } + + public override bool SupportsTypeConversion(TypeSchema fromType) => _supportsTypeConversion != null && _supportsTypeConversion(fromType); + + public override void EncodeBinary(ByteCodeWriter writer, object instance) => _encodeBinary(writer, instance); + + public override object DecodeBinary(ByteCodeReader reader) => _decodeBinary(reader); + + public override bool SupportsBinaryEncoding => _encodeBinary != null; + + public override int FindTypeHint => _typeID; + + public override object PerformOperation(object left, object right, OperationType op) + { + object obj = null; + if (_performOperation != null) + obj = _performOperation(left, right, op); + return obj; + } + + public override bool SupportsOperation(OperationType op) => _supportsOperation != null && _supportsOperation(op); + + public override bool IsNullAssignable => !_instanceType.IsValueType; + + public override bool IsRuntimeImmutable => (_flags & UIXTypeFlags.Immutable) != UIXTypeFlags.None; + + public override string ErrorContextDescription => Name; + } +} diff --git a/UIX/Microsoft/Iris/Markup/UIXTypes.cs b/UIX/Microsoft/Iris/Markup/UIXTypes.cs new file mode 100644 index 0000000..23a558a --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/UIXTypes.cs @@ -0,0 +1,31 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.UIXTypes +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class UIXTypes + { + public static TypeSchema MapIDToType(short ID) => ID != -1 ? UIXLoadResultExports.ExportTable[ID] : null; + + public static TypeSchema[] MapIDsToTypes(short[] IDs) + { + TypeSchema[] typeSchemaArray; + if (IDs == null) + { + typeSchemaArray = TypeSchema.EmptyList; + } + else + { + typeSchemaArray = new TypeSchema[IDs.Length]; + for (int index = 0; index < IDs.Length; ++index) + typeSchemaArray[index] = UIXLoadResultExports.ExportTable[IDs[index]]; + } + return typeSchemaArray; + } + + public static void RegisterTypeForID(short ID, TypeSchema type) => UIXLoadResultExports.ExportTable[ID] = type; + } +} diff --git a/UIX/Microsoft/Iris/Markup/ValidateMessage.cs b/UIX/Microsoft/Iris/Markup/ValidateMessage.cs new file mode 100644 index 0000000..5b6bf63 --- /dev/null +++ b/UIX/Microsoft/Iris/Markup/ValidateMessage.cs @@ -0,0 +1,155 @@ +// Decompiled with JetBrains decompiler +// Type: Microsoft.Iris.Markup.ValidateMessage +// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217 +// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11 +// Assembly location: C:\Program Files\Zune\UIX.dll + +namespace Microsoft.Iris.Markup +{ + internal static class ValidateMessage + { + public const string AliasCycleDetected = "Alias cycle detected: {0} {1}"; + public const string AliasTypeRequired = "Alias Type property must be provided"; + public const string AliasTargetTypeNotFound = "Target type for alias '{0}' could not be found"; + public const string AssemblyLoadFailure = "Failure loading assembly"; + public const string AssemblyLoadFailureSpecific = "Failure loading assembly: '{0}'"; + public const string AssemblyInvalidReferenceNoWhack = "Invalid assembly reference '{0}'. URI must contain a forward slash after the assembly name"; + public const string AttributeMustBeBoolean = "Property '{0}' must be Boolean 'true' or 'false'"; + public const string BaseKeywordCanOnlyBeUsedInOverrideMethod = "'base' keyword can only be used in an override method"; + public const string BaseKeywordCanOnlyCallMethod = "'base' keyword can only be used to call the base virtual method inside an override"; + public const string BaseTypeCannotBeShared = "Base type cannot be a shared Class"; + public const string BaseTypeMustBeClass = "Base type must be a markup-defined Class type"; + public const string BaseTypeMustBeMarkupDefined = "Base type must be a markup-defined type"; + public const string BaseTypeMustBeTypeIdentifier = "Base must be a type identifier (prefix:Type)"; + public const string BaseTypeMustBeUI = "Base type must be a markup-defined UI type"; + public const string BreakMustBeInLoop = "No enclosing loop out of which to break or continue"; + public const string CodeBlockRequiresReturn = "Code block must end with a return of type '{0}'"; + public const string CodeReturnValueTypeMismatch = "Return values are not supported for this code block (currently returning '{0}')"; + public const string CodeMustReturnSomething = "Code block must have at least one return statement of type '{0}'"; + public const string ConstructorNotFoundOnType = "A matching constructor could not be found on '{0}'"; + public const string ContentOverrideTypeMismatch = "Content Name '{0}' exists in base class '{1}' with type '{2}' and type override '{3}' does not match"; + public const string ContentNameNotOverridden = "Missing content name declaration: base type '{0}' has declared content name '{1}' of type '{2}'"; + public const string DataIsMalformedPerEncoding = "Malformed input file. The file contains data which is not valid in the {0} encoding"; + public const string DeclaredTriggersCannotBeBaseOnScopedLocals = "Expression cannot be declared as a trigger since '{0}' is a temporary (scoped) variable"; + public const string DeclaredTriggersMustHaveOuterNotifyingMember = "Expression cannot be declared as a trigger since it does not have an outermost property or event that fires notifications"; + public const string DeclaredTriggerOnlySupportedInScripts = "Expressions can only be used as triggers if they exist within Script blocks"; + public const string DefaultConstructorNotFound = "Type '{0}' may only be created via indirection (i.e. <{0} {0}=\"...\"/>)"; + public const string DictionaryPropertyValuesMustBeNamed = "Dictionary property '{0}' requires all values be named"; + public const string DuplicatePropertyFound = "Property '{0}' was specified more than once"; + public const string DuplicateTypeFound = "Type '{0}' was specified more than once"; + public const string ExpressionCannotBeLValue = "Expression cannot be used as the target an assignment (related symbol: '{0}')"; + public const string ExpressionMemberAccessGetOnly = "Expression access to '{0}' only supports read operations"; + public const string ExpressionMemberAccessSetOnly = "Expression access to '{0}' only supports write operations"; + public const string ExpressionMemberAccessUnavailable = "Expression access to '{0}' is not available"; + public const string ExpressionOperationTypeMismatch = "Operator '{0}' cannot be applied to operands of dissimilar types '{1}' and '{2}'"; + public const string ExpressionOperationUnsupported = "Operator '{0}' cannot be applied to operand of type '{1}'"; + public const string ExpressionConditionalTypeMismatch = "Both expressions for the {0} operator must match: '{1}' and '{2}' are not compatible"; + public const string FoundTypeEnumeratorIsNotCorrectType = "While searching for an enumerator, a 'GetEnumerator' method was found on '{0}', but, it is not of type 'Enumerator' (it is '{1}')"; + public const string InvalidSymbolName = "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"; + public const string InvalidTypeCast = "Cannot cast '{0}' to '{1}'"; + public const string InvalidValue = "Specified value '{0}' is not valid"; + public const string InvalidEscapeSequence = "Invalid escape sequence '{0}' in string literal"; + public const string LexerSyntaxErrorFormat = "Syntax Error: Unexpected character encountered: '{0}'"; + public const string MalformedAssemblyName = "Malformed assembly name '{0}'"; + public const string MarkupTypeCyclicReference = "Circular base class dependency involving '{0}' and '{1}'"; + public const string MemberNotFoundOnType = "Unable to find a Property, Event, or Method called \"{0}\" on '{1}'"; + public const string MethodAlreadyDefined = "Method '{0}' was already defined in this class with the same signature"; + public const string MethodDefinedInBaseNotVirtual = "Method '{0}' was already defined in '{1}' with the same signature and was not declared virtual"; + public const string MethodNoMethodToOverride = "Method '{0}' declared override, but no base method found to override"; + public const string MethodMustUseOverride = "Method '{0}' is virtual in '{1}', must use 'override' to override"; + public const string MethodReturnTypeMustBeTheSame = "Method '{0}' overrides base method from '{1}', but return types do not match: '{2}' on override, '{3}' on base."; + public const string MethodSpecifierConflictVirtualOverride = "Only one of 'virtual' and 'override' is allowed"; + public const string MethodSpecifierDuplicated = "Duplicate modifier '{0}'"; + public const string MethodsAllowedOnClassOnly = "Methods allowed only on , and "; + public const string MethodsSpecifiedMoreThanOnce = "Methods may only be specified once"; + public const string MultipleValuePropertyMustHaveObjectTagValues = "Collection property '{0}' may only have multiple values specified in expanded form"; + public const string NameAlreadyInUse = "Name \"{0}\" is already in use (type '{1}') located in '{2}'"; + public const string NameIsReserved = "Name \"{0}\" is reserved and cannot be used."; + public const string NameOverrideDisallowedCrossOrigin = "Name \"{0}\" (located in {1}) cannot override the same name within base class '{2}' (located in {3}) since overrides cannot cross section types"; + public const string NameOverrideDisallowedForOrigin = "Name \"{0}\" (also defined in base class '{1}') cannot be overridden (tried to override {2}, but can only override Properties and Content)"; + public const string NamePropertyRequired = "'Name' property is required and must be provided"; + public const string NameUsageOutOfScope = "Name \"{0}\" may not be used in this context since the tag is not within a Properties, Locals, Input, or Content block"; + public const string NamedContentAttributeMisconfiguration = "Named Content must have a single 'Name' attribute"; + public const string NegativeValuesUnsupported = "Expecting a non-negative value, but got {0}"; + public const string NestedDeclaredTriggersNotAllowed = "Declared triggers may not exist within other declared triggers"; + public const string NullConstantNotAllowedInNullCoalescing = "Null constant may not be used as the condition for ?? operator"; + public const string OutOfRangeMin = "Expecting a value no smaller than {0}, but got {1}"; + public const string OutOfRangeMinMax = "Expecting a value between {0} and {1}, but got {2}"; + public const string OutOfRangeMinMaxExclusive = "Expecting a value between {0} and {1} (exclusive), but got {2}"; + public const string ParameterizedConstructorNotFoundOnType = "A matching constructor could not be found on '{0}' that accepts parameters '{1}'"; + public const string ParameterizedMethodNotFoundOnType = "Unable to find a Method \"{0}\" that accepts parameters '{1}' on '{2}'"; + public const string ParserSyntaxErrorFormat = "Syntax Error: Unexpected character encountered: '{0}'"; + public const string PropertiesUnsupportedOnIndirectionContainers = "Property sets are not supported on type indirection tag. Property specified was '{0}'"; + public const string PropertyAttributesNotSupported = "Property attributes are not supported on property '{0}'"; + public const string PropertyDoesNotSupportMultiValue = "Property '{0}' does not support multiple values (property type is '{1}')"; + public const string PropertyDoesNotSupportReadingForCollectionAdd = "Property '{0}' must support reading to retrieve its collection for multiple value adds"; + public const string PropertyDoesNotSupportSetting = "Property '{0}' does not support setting"; + public const string PropertyMultipleValueScriptBlocksUnsupported = "Property '{0}' does not support multi-value script blocks"; + public const string PropertyNotFoundOnType = "Property '{0}' does not exist on '{1}'"; + public const string PropertyOverrideFound = "Property '{0}' was specified as Override='false' but a base property was found"; + public const string PropertyOverrideNotFound = "Property '{0}' was specified as Override='true' but no property was found to override"; + public const string PropertyOverrideTypeMismatch = "Property '{0}' exists in base class '{1}' with type '{2}' and type override '{3}' does not match"; + public const string PropertyRequiresValue = "Property '{0}' requires a value to be provided"; + public const string PropertyValueCannotHaveMixedTagCodeValues = "Property '{0}' cannot contain both object-tag and script block values"; + public const string PropertyValueMustBeExpanded = "Property '{0}' values must be in expanded form"; + public const string PropertyValueNotInline = "Property '{0}' does not support expanded value syntax"; + public const string PropertyValueTypeMismatch = "Property '{0}' expects a value of type '{1}' but got a value of type '{2}'"; + public const string RequiredPropertyNotSpecified = "Property '{0}' must be specified for '{1}' to function"; + public const string RequiredPropertyNotProvided = "Property '{0}' must be specified"; + public const string RequiredProperyDeclarationOnlyForMarkupTypes = "'$Required' can't be used in this context. It may only be used for declaring required properties on Classes and UIs"; + public const string ReturnTypeCannotBeInferred = "Return type cannot be determined due to inconsistant return type statements (mismatched types are: '{0}' and '{1}')"; + public const string RightAngleExpected = "Expecting a value of 0, 90, 180, or 270, but got {0}"; + public const string RootElementMustBeClass = "Unexpected root element '{0}', must be , or "; + public const string ScriptAttributeNotFound = "Script attribute '{0}' is unknown"; + public const string ScriptAttributeParameterCountInvalid = "Script attribute '{0}' invalid number of parameters (expecting: {1})"; + public const string ScriptAttributeParameterMustBeBoolean = "Script attribute parameter must be Boolean 'true' or 'false'"; + public const string ScriptInvalidStartCharacter = "Invalid starting script character '{0}'"; + public const string StringConversionFailed = "Unable to convert \"{0}\" to type '{1}'"; + public const string StringConversionFailedOuter = "Problem converting '{0}' ({1})"; + public const string StringConverterUnavailable = "String conversion is not available for '{0}'"; + public const string StringLengthInvalid = "\"{0}\" cannot be longer than {1} characters"; + public const string SymbolNotFound = "Unable to locate symbol \"{0}\" within Properties, Locals, Input, or Content"; + public const string SyntaxErrorUnexpectedEOF = "Unexpected end of script (script beginning at line {0}, column {1})"; + public const string SyntaxErrorTypeCastExpectingSymbol = "Type cast was expecting symbol, found '{0}'"; + public const string TagMismatch = "Mismatched tags found: <{0}> ... "; + public const string TechniqueElementCannotBeNamed = "Element '{0}' has no properties that can be changed dynamically and therefore cannot be named"; + public const string TechniqueElementPropertyNotDynamic = "Element '{0}' property '{1}' is being assigned a value which requires it to be set dynamically, but the property cannot be changed dynamically"; + public const string TechniqueOverrideNotAllowed = "Overriding Techniques property is not allowed; base class has already defined techniques"; + public const string TypeConstraintDefinitionMismatch = "Type '{0}' does not match specified constraint '{1}'"; + public const string TypeConstraintPropertyValueNotConstant = "Type parameter property '{0}' must be supplied a type constant (by name, or via 'typeof')"; + public const string TypeConstraintTypeMismatch = "Type parameter property '{0}' is of type '{1}' which is not compatible with the base type constraint '{2}'"; + public const string TypeConverterUnavailable = "Type conversion is not available for '{0}'"; + public const string TypeIsNotEnumerable = "Type '{0}' is not enumerable"; + public const string TypeMismatch = "'{0}' cannot be used in this context (expecting types compatible with '{1}')"; + public const string TypeMismatchAssignment = "Invalid assignment: Type '{0}' cannot be assigned to type '{1}'"; + public const string TypeMustBeNullAssignable = "The {0} operator must be used with a reference type ('{1}' is not null assignable)"; + public const string TypeNotFound = "Type '{0}' was not found within '{1}'"; + public const string TypeNotPublic = "Type '{0}' is not public in '{1}'"; + public const string UICannotBeShared = "UI cannot be marked as shared"; + public const string UIXRootTagScopeNotFound = "Unknown markup format. Expecting ... root markup tags"; + public const string ValueMustBeCodeBlock = "Expecting