From 95fbc6cd5cd27fe623036c0c453e707d919e7bc6 Mon Sep 17 00:00:00 2001 From: Sandy Armstrong Date: Thu, 5 Dec 2019 10:56:01 -0800 Subject: Sync with vs-editor-core@d160aa851 --- build/Project.targets | 4 +- src/Editor/FPF/Directory.Build.props | 18 + src/Editor/FPF/Directory.Build.targets | 6 + .../FPF/PresentationCore/PresentationCore.csproj | 10 + .../PresentationCore/Properties/AssemblyInfo.cs | 7 + .../PresentationCore/System.Windows.Clipboard.cs | 63 + .../PresentationCore/System.Windows.DataFormats.cs | 29 + .../PresentationCore/System.Windows.DataObject.cs | 91 + .../System.Windows.DragEventArgs.cs | 10 + .../PresentationCore/System.Windows.FontStyle.cs | 11 + .../PresentationCore/System.Windows.FontStyles.cs | 10 + .../PresentationCore/System.Windows.FontWeight.cs | 206 +++ .../PresentationCore/System.Windows.FontWeights.cs | 12 + .../System.Windows.GiveFeedbackEventArgs.cs | 6 + .../System.Windows.IInputElement.cs | 6 + .../System.Windows.Input.InputEventArgs.cs | 6 + .../System.Windows.Input.InputLanguageEventArgs.cs | 6 + .../System.Windows.Input.MouseButton.cs | 11 + .../System.Windows.Input.MouseButtonEventArgs.cs | 12 + .../System.Windows.Input.MouseButtonState.cs | 8 + .../System.Windows.Input.MouseEventArgs.cs | 14 + .../System.Windows.Input.MouseWheelEventArgs.cs | 8 + .../System.Windows.Input.TouchEventArgs.cs | 6 + .../System.Windows.Media.Animation.Animatable.cs | 11 + ...em.Windows.Media.Animation.AnimationTimeline.cs | 6 + ...ystem.Windows.Media.Animation.RepeatBehavior.cs | 9 + .../System.Windows.Media.Animation.Timeline.cs | 10 + .../System.Windows.Media.BitmapScalingMode.cs | 12 + .../PresentationCore/System.Windows.Media.Brush.cs | 11 + .../System.Windows.Media.Brushes.cs | 21 + .../PresentationCore/System.Windows.Media.Color.cs | 694 +++++++ .../System.Windows.Media.Colors.cs | 1905 ++++++++++++++++++++ .../System.Windows.Media.DashStyle.cs | 21 + .../System.Windows.Media.FillRule.cs | 8 + .../System.Windows.Media.GeneralTransform.cs | 8 + .../System.Windows.Media.Geometry.cs | 17 + .../System.Windows.Media.GeometryCollection.cs | 7 + .../System.Windows.Media.GeometryGroup.cs | 27 + .../System.Windows.Media.ImageSource.cs | 8 + .../System.Windows.Media.Imaging.BitmapImage.cs | 15 + .../System.Windows.Media.Imaging.BitmapSource.cs | 5 + .../System.Windows.Media.IntersectionDetail.cs | 11 + .../System.Windows.Media.PathFigure.cs | 14 + .../System.Windows.Media.PathFigureCollection.cs | 7 + .../System.Windows.Media.PathGeometry.cs | 17 + .../System.Windows.Media.PathSegment.cs | 6 + .../System.Windows.Media.PathSegmentCollection.cs | 7 + .../PresentationCore/System.Windows.Media.Pen.cs | 23 + .../System.Windows.Media.PenLineCap.cs | 10 + .../System.Windows.Media.PenLineJoin.cs | 9 + .../System.Windows.Media.RectangleGeometry.cs | 18 + .../System.Windows.Media.SolidColorBrush.cs | 14 + .../System.Windows.Media.TextEffectCollection.cs | 7 + ...ndows.Media.TextFormatting.TextRunProperties.cs | 34 + .../System.Windows.Media.Transform.cs | 6 + .../System.Windows.Media.Typeface.cs | 9 + .../System.Windows.QueryContinueDragEventArgs.cs | 10 + .../PresentationCore/System.Windows.RoutedEvent.cs | 6 + .../System.Windows.RoutedEventArgs.cs | 15 + .../System.Windows.TextDataFormat.cs | 12 + .../System.Windows.TextDecorationCollection.cs | 68 + .../PresentationCore/System.Windows.Visibility.cs | 9 + .../PresentationFramework.csproj | 9 + .../Properties/AssemblyInfo.cs | 5 + .../System.Windows.ResourceDictionary.cs | 101 ++ .../System.Windows.ResourceDictionaryLocation.cs | 9 + .../System.Windows.SystemColors.cs | 30 + .../System.Windows.SystemParameters.cs | 25 + .../System.Windows.ThemeInfoAttribute.cs | 7 + .../System.Windows.Thickness.cs | 215 +++ src/Editor/FPF/README.md | 19 + .../UIAutomationClient/Properties/AssemblyInfo.cs | 5 + .../System.Windows.Automation.AutomationElement.cs | 7 + .../System.Windows.Automation.TextPattern.cs | 15 + .../UIAutomationClient/UIAutomationClient.csproj | 8 + .../Properties/AssemblyInfo.cs | 5 + ...utomation.Provider.AutomationInteropProvider.cs | 8 + ...utomation.Provider.IRawElementProviderSimple.cs | 7 + ...s.Automation.Provider.ISelectionItemProvider.cs | 6 + ...ndows.Automation.Provider.ISelectionProvider.cs | 6 + ...em.Windows.Automation.Provider.ITextProvider.cs | 6 + ...ndows.Automation.Provider.ITextRangeProvider.cs | 6 + ...m.Windows.Automation.Provider.IValueProvider.cs | 6 + .../UIAutomationProvider.csproj | 5 + .../UIAutomationTypes/Properties/AssemblyInfo.cs | 5 + ...dows.Automation.AutomationElementIdentifiers.cs | 7 + ...stem.Windows.Automation.AutomationIdentifier.cs | 8 + ...System.Windows.Automation.AutomationProperty.cs | 6 + ...m.Windows.Automation.AutomationTextAttribute.cs | 6 + ...s.Automation.SelectionItemPatternIdentifiers.cs | 7 + ...em.Windows.Automation.SupportedTextSelection.cs | 9 + ...ows.Automation.Text.TextPatternRangeEndpoint.cs | 8 + .../System.Windows.Automation.Text.TextUnit.cs | 13 + .../FPF/UIAutomationTypes/UIAutomationTypes.csproj | 5 + .../FPF/WindowsBase/Assembly/AssemblyInfo.cs | 81 + src/Editor/FPF/WindowsBase/Consts.cs | 125 ++ src/Editor/FPF/WindowsBase/MonoTODOAttribute.cs | 101 ++ .../CollectionChangedEventManager.cs | 80 + .../INotifyCollectionChanged.cs | 30 + .../NotifyCollectionChangedAction.cs | 30 + .../NotifyCollectionChangedEventArgs.cs | 31 + .../NotifyCollectionChangedEventHandler.cs | 30 + .../DependencyPropertyDescriptor.cs | 165 ++ .../WindowsBase/System.IO/FileFormatException.cs | 95 + .../Int32RectValueSerializer.cs | 59 + .../PointValueSerializer.cs | 59 + .../RectValueSerializer.cs | 58 + .../SizeValueSerializer.cs | 61 + .../VectorValueSerializer.cs | 59 + .../System.Windows.Data/DataSourceProvider.cs | 126 ++ .../FocusNavigationDirection.cs | 41 + .../FPF/WindowsBase/System.Windows.Input/Key.cs | 239 +++ .../System.Windows.Input/KeyConverter.cs | 56 + .../WindowsBase/System.Windows.Input/KeyInterop.cs | 43 + .../System.Windows.Input/KeyValueSerializer.cs | 55 + .../System.Windows.Input/ModifierKeys.cs | 43 + .../System.Windows.Input/ModifierKeysConverter.cs | 61 + .../ModifierKeysValueSerializer.cs | 55 + .../System.Windows.Input/TraversalRequest.cs | 49 + .../System.Windows.Interop/ComponentDispatcher.cs | 73 + .../System.Windows.Interop/IKeyboardInputSink.cs | 55 + .../System.Windows.Interop/IKeyboardInputSite.cs | 42 + .../FPF/WindowsBase/System.Windows.Interop/MSG.cs | 84 + .../ThreadMessageEventHandler.cs | 32 + .../MatrixValueSerializer.cs | 60 + .../DisableDpiAwarenessAttribute.cs | 35 + .../FPF/WindowsBase/System.Windows.Media/Matrix.cs | 456 +++++ .../System.Windows.Media/MatrixConverter.cs | 58 + .../System.Windows.Threading/Dispatcher.cs | 193 ++ .../DispatcherEventArgs.cs | 13 + .../System.Windows.Threading/DispatcherObject.cs | 24 + .../DispatcherOperation.cs | 178 ++ .../DispatcherOperationTaskSource.cs | 24 + .../System.Windows.Threading/DispatcherPriority.cs | 21 + .../DispatcherSynchronizationContext.cs | 37 + .../System.Windows.Threading/DispatcherTimer.cs | 141 ++ .../DispatcherUnhandledExceptionEventArgs.cs | 16 + .../AttachedPropertyBrowsableAttribute.cs | 36 + .../AttachedPropertyBrowsableForTypeAttribute.cs | 59 + ...opertyBrowsableWhenAttributePresentAttribute.cs | 54 + .../System.Windows/CoerceValueCallback.cs | 29 + .../WindowsBase/System.Windows/DependencyObject.cs | 145 ++ .../System.Windows/DependencyObjectType.cs | 89 + .../System.Windows/DependencyProperty.cs | 229 +++ .../DependencyPropertyChangedEventArgs.cs | 83 + .../DependencyPropertyChangedEventHandler.cs | 31 + .../System.Windows/DependencyPropertyKey.cs | 46 + .../FPF/WindowsBase/System.Windows/Expression.cs | 39 + .../System.Windows/ExpressionConverter.cs | 60 + .../FPF/WindowsBase/System.Windows/Freezable.cs | 147 ++ .../System.Windows/IWeakEventListener.cs | 32 + .../FPF/WindowsBase/System.Windows/Int32Rect.cs | 193 ++ .../System.Windows/Int32RectConverter.cs | 57 + .../WindowsBase/System.Windows/LocalValueEntry.cs | 68 + .../System.Windows/LocalValueEnumerator.cs | 88 + .../System.Windows/NumericListTokenizer.cs | 102 ++ src/Editor/FPF/WindowsBase/System.Windows/Point.cs | 196 ++ .../WindowsBase/System.Windows/PointConverter.cs | 57 + .../System.Windows/PropertyChangedCallback.cs | 29 + .../WindowsBase/System.Windows/PropertyMetadata.cs | 121 ++ src/Editor/FPF/WindowsBase/System.Windows/Rect.cs | 501 +++++ .../WindowsBase/System.Windows/RectConverter.cs | 57 + src/Editor/FPF/WindowsBase/System.Windows/Size.cs | 192 ++ .../WindowsBase/System.Windows/SizeConverter.cs | 57 + .../FPF/WindowsBase/System.Windows/SplashScreen.cs | 55 + .../System.Windows/ValidateValueCallback.cs | 29 + .../FPF/WindowsBase/System.Windows/Vector.cs | 284 +++ .../WindowsBase/System.Windows/VectorConverter.cs | 57 + .../WindowsBase/System.Windows/WeakEventManager.cs | 178 ++ src/Editor/FPF/WindowsBase/WindowsBase.csproj | 14 + src/Editor/FPF/winfx3.pub | Bin 0 -> 160 bytes .../Imaging/Def/Catalogs/LightBulbImageCatalog.cs | 26 - .../Imaging/Def/Catalogs/OverviewMarginCatalog.cs | 29 - .../Def/Catalogs/SignatureHelpImageCatalog.cs | 25 - src/Editor/Imaging/Def/IImageService.cs | 28 - src/Editor/Imaging/Def/ImageDescription.cs | 74 - src/Editor/Imaging/Def/ImageTags.cs | 22 - src/Editor/Imaging/Def/Imaging.csproj | 17 - src/Editor/Text/Def/Extras/Extras.csproj | 19 - src/Editor/Text/Def/Extras/Find/FindCommandArgs.cs | 105 -- src/Editor/Text/Def/Extras/Find/IFindPresenter.cs | 21 - .../Text/Def/Extras/Find/IFindPresenterFactory.cs | 19 - .../Def/Extras/GoToLine/GoToLineCommandArgs.cs | 31 - .../Text/Def/Extras/GoToLine/IGoToLinePresenter.cs | 18 - .../Extras/GoToLine/IGoToLinePresenterFactory.cs | 14 - .../Text/Def/Extras/InfoBar/IInfoBarPresenter.cs | 12 - .../Def/Extras/InfoBar/IInfoBarPresenterFactory.cs | 10 - .../Text/Def/Extras/InfoBar/InfoBarViewModel.cs | 51 - .../Text/Def/Extras/PreviewEditorCommandArgs.cs | 23 - .../Def/TextUICocoa/Extras/Find/FindCommandArgs.cs | 105 ++ .../Def/TextUICocoa/Extras/Find/IFindPresenter.cs | 21 + .../Extras/Find/IFindPresenterFactory.cs | 19 + .../Extras/GoToLine/GoToLineCommandArgs.cs | 31 + .../Extras/GoToLine/IGoToLinePresenter.cs | 18 + .../Extras/GoToLine/IGoToLinePresenterFactory.cs | 14 + .../Extras/InfoBar/IInfoBarPresenter.cs | 12 + .../Extras/InfoBar/IInfoBarPresenterFactory.cs | 10 + .../TextUICocoa/Extras/InfoBar/InfoBarViewModel.cs | 51 + .../Imaging/Catalogs/LightBulbImageCatalog.cs | 26 + .../Imaging/Catalogs/OverviewMarginCatalog.cs | 29 + .../Imaging/Catalogs/SignatureHelpImageCatalog.cs | 25 + .../Text/Def/TextUICocoa/Imaging/IImageService.cs | 28 + .../Def/TextUICocoa/Imaging/ImageDescription.cs | 74 + .../Text/Def/TextUICocoa/Imaging/ImageTags.cs | 22 + src/FPF/Directory.Build.props | 18 - src/FPF/Directory.Build.targets | 6 - src/FPF/PresentationCore/PresentationCore.csproj | 10 - .../PresentationCore/Properties/AssemblyInfo.cs | 7 - .../PresentationCore/System.Windows.Clipboard.cs | 63 - .../PresentationCore/System.Windows.DataFormats.cs | 29 - .../PresentationCore/System.Windows.DataObject.cs | 91 - .../System.Windows.DragEventArgs.cs | 10 - .../PresentationCore/System.Windows.FontStyle.cs | 11 - .../PresentationCore/System.Windows.FontStyles.cs | 10 - .../PresentationCore/System.Windows.FontWeight.cs | 206 --- .../PresentationCore/System.Windows.FontWeights.cs | 12 - .../System.Windows.GiveFeedbackEventArgs.cs | 6 - .../System.Windows.IInputElement.cs | 6 - .../System.Windows.Input.InputEventArgs.cs | 6 - .../System.Windows.Input.InputLanguageEventArgs.cs | 6 - .../System.Windows.Input.MouseButton.cs | 11 - .../System.Windows.Input.MouseButtonEventArgs.cs | 12 - .../System.Windows.Input.MouseButtonState.cs | 8 - .../System.Windows.Input.MouseEventArgs.cs | 14 - .../System.Windows.Input.MouseWheelEventArgs.cs | 8 - .../System.Windows.Input.TouchEventArgs.cs | 6 - .../System.Windows.Media.Animation.Animatable.cs | 11 - ...em.Windows.Media.Animation.AnimationTimeline.cs | 6 - ...ystem.Windows.Media.Animation.RepeatBehavior.cs | 9 - .../System.Windows.Media.Animation.Timeline.cs | 10 - .../System.Windows.Media.BitmapScalingMode.cs | 12 - .../PresentationCore/System.Windows.Media.Brush.cs | 11 - .../System.Windows.Media.Brushes.cs | 21 - .../PresentationCore/System.Windows.Media.Color.cs | 694 ------- .../System.Windows.Media.Colors.cs | 1905 -------------------- .../System.Windows.Media.DashStyle.cs | 21 - .../System.Windows.Media.FillRule.cs | 8 - .../System.Windows.Media.GeneralTransform.cs | 8 - .../System.Windows.Media.Geometry.cs | 17 - .../System.Windows.Media.GeometryCollection.cs | 7 - .../System.Windows.Media.GeometryGroup.cs | 27 - .../System.Windows.Media.ImageSource.cs | 8 - .../System.Windows.Media.Imaging.BitmapImage.cs | 15 - .../System.Windows.Media.Imaging.BitmapSource.cs | 5 - .../System.Windows.Media.IntersectionDetail.cs | 11 - .../System.Windows.Media.PathFigure.cs | 14 - .../System.Windows.Media.PathFigureCollection.cs | 7 - .../System.Windows.Media.PathGeometry.cs | 17 - .../System.Windows.Media.PathSegment.cs | 6 - .../System.Windows.Media.PathSegmentCollection.cs | 7 - .../PresentationCore/System.Windows.Media.Pen.cs | 23 - .../System.Windows.Media.PenLineCap.cs | 10 - .../System.Windows.Media.PenLineJoin.cs | 9 - .../System.Windows.Media.RectangleGeometry.cs | 18 - .../System.Windows.Media.SolidColorBrush.cs | 14 - .../System.Windows.Media.TextEffectCollection.cs | 7 - ...ndows.Media.TextFormatting.TextRunProperties.cs | 34 - .../System.Windows.Media.Transform.cs | 6 - .../System.Windows.Media.Typeface.cs | 9 - .../System.Windows.QueryContinueDragEventArgs.cs | 10 - .../PresentationCore/System.Windows.RoutedEvent.cs | 6 - .../System.Windows.RoutedEventArgs.cs | 15 - .../System.Windows.TextDataFormat.cs | 12 - .../System.Windows.TextDecorationCollection.cs | 68 - .../PresentationCore/System.Windows.Visibility.cs | 9 - .../PresentationFramework.csproj | 9 - .../Properties/AssemblyInfo.cs | 5 - .../System.Windows.ResourceDictionary.cs | 101 -- .../System.Windows.ResourceDictionaryLocation.cs | 9 - .../System.Windows.SystemColors.cs | 30 - .../System.Windows.SystemParameters.cs | 25 - .../System.Windows.ThemeInfoAttribute.cs | 7 - .../System.Windows.Thickness.cs | 215 --- src/FPF/README.md | 19 - .../UIAutomationClient/Properties/AssemblyInfo.cs | 5 - .../System.Windows.Automation.AutomationElement.cs | 7 - .../System.Windows.Automation.TextPattern.cs | 15 - .../UIAutomationClient/UIAutomationClient.csproj | 8 - .../Properties/AssemblyInfo.cs | 5 - ...utomation.Provider.AutomationInteropProvider.cs | 8 - ...utomation.Provider.IRawElementProviderSimple.cs | 7 - ...s.Automation.Provider.ISelectionItemProvider.cs | 6 - ...ndows.Automation.Provider.ISelectionProvider.cs | 6 - ...em.Windows.Automation.Provider.ITextProvider.cs | 6 - ...ndows.Automation.Provider.ITextRangeProvider.cs | 6 - ...m.Windows.Automation.Provider.IValueProvider.cs | 6 - .../UIAutomationProvider.csproj | 5 - .../UIAutomationTypes/Properties/AssemblyInfo.cs | 5 - ...dows.Automation.AutomationElementIdentifiers.cs | 7 - ...stem.Windows.Automation.AutomationIdentifier.cs | 8 - ...System.Windows.Automation.AutomationProperty.cs | 6 - ...m.Windows.Automation.AutomationTextAttribute.cs | 6 - ...s.Automation.SelectionItemPatternIdentifiers.cs | 7 - ...em.Windows.Automation.SupportedTextSelection.cs | 9 - ...ows.Automation.Text.TextPatternRangeEndpoint.cs | 8 - .../System.Windows.Automation.Text.TextUnit.cs | 13 - src/FPF/UIAutomationTypes/UIAutomationTypes.csproj | 5 - src/FPF/WindowsBase/Assembly/AssemblyInfo.cs | 81 - src/FPF/WindowsBase/Consts.cs | 125 -- src/FPF/WindowsBase/MonoTODOAttribute.cs | 101 -- .../CollectionChangedEventManager.cs | 80 - .../INotifyCollectionChanged.cs | 30 - .../NotifyCollectionChangedAction.cs | 30 - .../NotifyCollectionChangedEventArgs.cs | 31 - .../NotifyCollectionChangedEventHandler.cs | 30 - .../DependencyPropertyDescriptor.cs | 165 -- .../WindowsBase/System.IO/FileFormatException.cs | 95 - .../Int32RectValueSerializer.cs | 59 - .../PointValueSerializer.cs | 59 - .../RectValueSerializer.cs | 58 - .../SizeValueSerializer.cs | 61 - .../VectorValueSerializer.cs | 59 - .../System.Windows.Data/DataSourceProvider.cs | 126 -- .../FocusNavigationDirection.cs | 41 - src/FPF/WindowsBase/System.Windows.Input/Key.cs | 239 --- .../System.Windows.Input/KeyConverter.cs | 56 - .../WindowsBase/System.Windows.Input/KeyInterop.cs | 43 - .../System.Windows.Input/KeyValueSerializer.cs | 55 - .../System.Windows.Input/ModifierKeys.cs | 43 - .../System.Windows.Input/ModifierKeysConverter.cs | 61 - .../ModifierKeysValueSerializer.cs | 55 - .../System.Windows.Input/TraversalRequest.cs | 49 - .../System.Windows.Interop/ComponentDispatcher.cs | 73 - .../System.Windows.Interop/IKeyboardInputSink.cs | 55 - .../System.Windows.Interop/IKeyboardInputSite.cs | 42 - src/FPF/WindowsBase/System.Windows.Interop/MSG.cs | 84 - .../ThreadMessageEventHandler.cs | 32 - .../MatrixValueSerializer.cs | 60 - .../DisableDpiAwarenessAttribute.cs | 35 - src/FPF/WindowsBase/System.Windows.Media/Matrix.cs | 456 ----- .../System.Windows.Media/MatrixConverter.cs | 58 - .../System.Windows.Threading/Dispatcher.cs | 193 -- .../DispatcherEventArgs.cs | 13 - .../System.Windows.Threading/DispatcherObject.cs | 24 - .../DispatcherOperation.cs | 178 -- .../DispatcherOperationTaskSource.cs | 24 - .../System.Windows.Threading/DispatcherPriority.cs | 21 - .../DispatcherSynchronizationContext.cs | 37 - .../System.Windows.Threading/DispatcherTimer.cs | 141 -- .../DispatcherUnhandledExceptionEventArgs.cs | 16 - .../AttachedPropertyBrowsableAttribute.cs | 36 - .../AttachedPropertyBrowsableForTypeAttribute.cs | 59 - ...opertyBrowsableWhenAttributePresentAttribute.cs | 54 - .../System.Windows/CoerceValueCallback.cs | 29 - .../WindowsBase/System.Windows/DependencyObject.cs | 145 -- .../System.Windows/DependencyObjectType.cs | 89 - .../System.Windows/DependencyProperty.cs | 229 --- .../DependencyPropertyChangedEventArgs.cs | 83 - .../DependencyPropertyChangedEventHandler.cs | 31 - .../System.Windows/DependencyPropertyKey.cs | 46 - src/FPF/WindowsBase/System.Windows/Expression.cs | 39 - .../System.Windows/ExpressionConverter.cs | 60 - src/FPF/WindowsBase/System.Windows/Freezable.cs | 147 -- .../System.Windows/IWeakEventListener.cs | 32 - src/FPF/WindowsBase/System.Windows/Int32Rect.cs | 193 -- .../System.Windows/Int32RectConverter.cs | 57 - .../WindowsBase/System.Windows/LocalValueEntry.cs | 68 - .../System.Windows/LocalValueEnumerator.cs | 88 - .../System.Windows/NumericListTokenizer.cs | 102 -- src/FPF/WindowsBase/System.Windows/Point.cs | 196 -- .../WindowsBase/System.Windows/PointConverter.cs | 57 - .../System.Windows/PropertyChangedCallback.cs | 29 - .../WindowsBase/System.Windows/PropertyMetadata.cs | 121 -- src/FPF/WindowsBase/System.Windows/Rect.cs | 501 ----- .../WindowsBase/System.Windows/RectConverter.cs | 57 - src/FPF/WindowsBase/System.Windows/Size.cs | 192 -- .../WindowsBase/System.Windows/SizeConverter.cs | 57 - src/FPF/WindowsBase/System.Windows/SplashScreen.cs | 55 - .../System.Windows/ValidateValueCallback.cs | 29 - src/FPF/WindowsBase/System.Windows/Vector.cs | 284 --- .../WindowsBase/System.Windows/VectorConverter.cs | 57 - .../WindowsBase/System.Windows/WeakEventManager.cs | 178 -- src/FPF/WindowsBase/WindowsBase.csproj | 14 - src/FPF/winfx3.pub | Bin 160 -> 0 bytes src/OpenSource.Def.projitems | 6 - src/OpenSource.Impl.projitems | 12 +- 376 files changed, 11528 insertions(+), 11593 deletions(-) create mode 100644 src/Editor/FPF/Directory.Build.props create mode 100644 src/Editor/FPF/Directory.Build.targets create mode 100644 src/Editor/FPF/PresentationCore/PresentationCore.csproj create mode 100644 src/Editor/FPF/PresentationCore/Properties/AssemblyInfo.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Clipboard.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.DataFormats.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.DataObject.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.DragEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.FontStyle.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.FontStyles.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.FontWeight.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.FontWeights.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.GiveFeedbackEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.IInputElement.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Input.InputEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Input.InputLanguageEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButton.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButtonEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButtonState.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Input.MouseEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Input.MouseWheelEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Input.TouchEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.Animatable.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.AnimationTimeline.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.RepeatBehavior.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.Timeline.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.BitmapScalingMode.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Brush.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Brushes.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Color.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Colors.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.DashStyle.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.FillRule.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.GeneralTransform.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Geometry.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryCollection.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.ImageSource.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapImage.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapSource.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.IntersectionDetail.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.PathFigure.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.PathFigureCollection.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.PathGeometry.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.PathSegment.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.PathSegmentCollection.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Pen.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.PenLineCap.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.PenLineJoin.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.RectangleGeometry.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.SolidColorBrush.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.TextEffectCollection.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.TextFormatting.TextRunProperties.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Transform.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Media.Typeface.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.QueryContinueDragEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.RoutedEvent.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.RoutedEventArgs.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.TextDataFormat.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.TextDecorationCollection.cs create mode 100644 src/Editor/FPF/PresentationCore/System.Windows.Visibility.cs create mode 100644 src/Editor/FPF/PresentationFramework/PresentationFramework.csproj create mode 100644 src/Editor/FPF/PresentationFramework/Properties/AssemblyInfo.cs create mode 100644 src/Editor/FPF/PresentationFramework/System.Windows.ResourceDictionary.cs create mode 100644 src/Editor/FPF/PresentationFramework/System.Windows.ResourceDictionaryLocation.cs create mode 100644 src/Editor/FPF/PresentationFramework/System.Windows.SystemColors.cs create mode 100644 src/Editor/FPF/PresentationFramework/System.Windows.SystemParameters.cs create mode 100644 src/Editor/FPF/PresentationFramework/System.Windows.ThemeInfoAttribute.cs create mode 100644 src/Editor/FPF/PresentationFramework/System.Windows.Thickness.cs create mode 100644 src/Editor/FPF/README.md create mode 100644 src/Editor/FPF/UIAutomationClient/Properties/AssemblyInfo.cs create mode 100644 src/Editor/FPF/UIAutomationClient/System.Windows.Automation.AutomationElement.cs create mode 100644 src/Editor/FPF/UIAutomationClient/System.Windows.Automation.TextPattern.cs create mode 100644 src/Editor/FPF/UIAutomationClient/UIAutomationClient.csproj create mode 100644 src/Editor/FPF/UIAutomationProvider/Properties/AssemblyInfo.cs create mode 100644 src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.AutomationInteropProvider.cs create mode 100644 src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IRawElementProviderSimple.cs create mode 100644 src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionItemProvider.cs create mode 100644 src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionProvider.cs create mode 100644 src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextProvider.cs create mode 100644 src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextRangeProvider.cs create mode 100644 src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IValueProvider.cs create mode 100644 src/Editor/FPF/UIAutomationProvider/UIAutomationProvider.csproj create mode 100644 src/Editor/FPF/UIAutomationTypes/Properties/AssemblyInfo.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationElementIdentifiers.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationIdentifier.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationProperty.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationTextAttribute.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.SelectionItemPatternIdentifiers.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.SupportedTextSelection.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextPatternRangeEndpoint.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextUnit.cs create mode 100644 src/Editor/FPF/UIAutomationTypes/UIAutomationTypes.csproj create mode 100644 src/Editor/FPF/WindowsBase/Assembly/AssemblyInfo.cs create mode 100644 src/Editor/FPF/WindowsBase/Consts.cs create mode 100644 src/Editor/FPF/WindowsBase/MonoTODOAttribute.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Collections.Specialized/CollectionChangedEventManager.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Collections.Specialized/INotifyCollectionChanged.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedAction.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs create mode 100644 src/Editor/FPF/WindowsBase/System.ComponentModel/DependencyPropertyDescriptor.cs create mode 100644 src/Editor/FPF/WindowsBase/System.IO/FileFormatException.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Converters/Int32RectValueSerializer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Converters/PointValueSerializer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Converters/RectValueSerializer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Converters/VectorValueSerializer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Data/DataSourceProvider.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/FocusNavigationDirection.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/Key.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/KeyConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/KeyInterop.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/KeyValueSerializer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeys.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeysConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeysValueSerializer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Input/TraversalRequest.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Interop/ComponentDispatcher.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSink.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSite.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Interop/MSG.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Interop/ThreadMessageEventHandler.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Media/DisableDpiAwarenessAttribute.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Media/Matrix.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Media/MatrixConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/Dispatcher.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherEventArgs.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherObject.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherOperation.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherOperationTaskSource.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherPriority.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherSynchronizationContext.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherTimer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableAttribute.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableForTypeAttribute.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableWhenAttributePresentAttribute.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/CoerceValueCallback.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/DependencyObject.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/DependencyObjectType.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/DependencyProperty.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventArgs.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventHandler.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyKey.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/Expression.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/ExpressionConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/Freezable.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/IWeakEventListener.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/Int32Rect.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/Int32RectConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/LocalValueEntry.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/LocalValueEnumerator.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/NumericListTokenizer.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/Point.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/PointConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/PropertyChangedCallback.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/PropertyMetadata.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/Rect.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/RectConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/Size.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/SizeConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/SplashScreen.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/ValidateValueCallback.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/Vector.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/VectorConverter.cs create mode 100644 src/Editor/FPF/WindowsBase/System.Windows/WeakEventManager.cs create mode 100644 src/Editor/FPF/WindowsBase/WindowsBase.csproj create mode 100644 src/Editor/FPF/winfx3.pub delete mode 100644 src/Editor/Imaging/Def/Catalogs/LightBulbImageCatalog.cs delete mode 100644 src/Editor/Imaging/Def/Catalogs/OverviewMarginCatalog.cs delete mode 100644 src/Editor/Imaging/Def/Catalogs/SignatureHelpImageCatalog.cs delete mode 100644 src/Editor/Imaging/Def/IImageService.cs delete mode 100644 src/Editor/Imaging/Def/ImageDescription.cs delete mode 100644 src/Editor/Imaging/Def/ImageTags.cs delete mode 100644 src/Editor/Imaging/Def/Imaging.csproj delete mode 100644 src/Editor/Text/Def/Extras/Extras.csproj delete mode 100644 src/Editor/Text/Def/Extras/Find/FindCommandArgs.cs delete mode 100644 src/Editor/Text/Def/Extras/Find/IFindPresenter.cs delete mode 100644 src/Editor/Text/Def/Extras/Find/IFindPresenterFactory.cs delete mode 100644 src/Editor/Text/Def/Extras/GoToLine/GoToLineCommandArgs.cs delete mode 100644 src/Editor/Text/Def/Extras/GoToLine/IGoToLinePresenter.cs delete mode 100644 src/Editor/Text/Def/Extras/GoToLine/IGoToLinePresenterFactory.cs delete mode 100644 src/Editor/Text/Def/Extras/InfoBar/IInfoBarPresenter.cs delete mode 100644 src/Editor/Text/Def/Extras/InfoBar/IInfoBarPresenterFactory.cs delete mode 100644 src/Editor/Text/Def/Extras/InfoBar/InfoBarViewModel.cs delete mode 100644 src/Editor/Text/Def/Extras/PreviewEditorCommandArgs.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/Find/FindCommandArgs.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/Find/IFindPresenter.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/Find/IFindPresenterFactory.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/GoToLineCommandArgs.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/IGoToLinePresenter.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/IGoToLinePresenterFactory.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/IInfoBarPresenter.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/IInfoBarPresenterFactory.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/InfoBarViewModel.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/LightBulbImageCatalog.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/OverviewMarginCatalog.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/SignatureHelpImageCatalog.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Imaging/IImageService.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Imaging/ImageDescription.cs create mode 100644 src/Editor/Text/Def/TextUICocoa/Imaging/ImageTags.cs delete mode 100644 src/FPF/Directory.Build.props delete mode 100644 src/FPF/Directory.Build.targets delete mode 100644 src/FPF/PresentationCore/PresentationCore.csproj delete mode 100644 src/FPF/PresentationCore/Properties/AssemblyInfo.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Clipboard.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.DataFormats.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.DataObject.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.DragEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.FontStyle.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.FontStyles.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.FontWeight.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.FontWeights.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.GiveFeedbackEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.IInputElement.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Input.InputEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Input.InputLanguageEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Input.MouseButton.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Input.MouseButtonEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Input.MouseButtonState.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Input.MouseEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Input.MouseWheelEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Input.TouchEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Animation.Animatable.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Animation.AnimationTimeline.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Animation.RepeatBehavior.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Animation.Timeline.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.BitmapScalingMode.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Brush.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Brushes.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Color.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Colors.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.DashStyle.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.FillRule.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.GeneralTransform.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Geometry.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.GeometryCollection.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.ImageSource.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapImage.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapSource.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.IntersectionDetail.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.PathFigure.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.PathFigureCollection.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.PathGeometry.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.PathSegment.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.PathSegmentCollection.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Pen.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.PenLineCap.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.PenLineJoin.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.RectangleGeometry.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.SolidColorBrush.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.TextEffectCollection.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.TextFormatting.TextRunProperties.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Transform.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Media.Typeface.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.QueryContinueDragEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.RoutedEvent.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.RoutedEventArgs.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.TextDataFormat.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.TextDecorationCollection.cs delete mode 100644 src/FPF/PresentationCore/System.Windows.Visibility.cs delete mode 100644 src/FPF/PresentationFramework/PresentationFramework.csproj delete mode 100644 src/FPF/PresentationFramework/Properties/AssemblyInfo.cs delete mode 100644 src/FPF/PresentationFramework/System.Windows.ResourceDictionary.cs delete mode 100644 src/FPF/PresentationFramework/System.Windows.ResourceDictionaryLocation.cs delete mode 100644 src/FPF/PresentationFramework/System.Windows.SystemColors.cs delete mode 100644 src/FPF/PresentationFramework/System.Windows.SystemParameters.cs delete mode 100644 src/FPF/PresentationFramework/System.Windows.ThemeInfoAttribute.cs delete mode 100644 src/FPF/PresentationFramework/System.Windows.Thickness.cs delete mode 100644 src/FPF/README.md delete mode 100644 src/FPF/UIAutomationClient/Properties/AssemblyInfo.cs delete mode 100644 src/FPF/UIAutomationClient/System.Windows.Automation.AutomationElement.cs delete mode 100644 src/FPF/UIAutomationClient/System.Windows.Automation.TextPattern.cs delete mode 100644 src/FPF/UIAutomationClient/UIAutomationClient.csproj delete mode 100644 src/FPF/UIAutomationProvider/Properties/AssemblyInfo.cs delete mode 100644 src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.AutomationInteropProvider.cs delete mode 100644 src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IRawElementProviderSimple.cs delete mode 100644 src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionItemProvider.cs delete mode 100644 src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionProvider.cs delete mode 100644 src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextProvider.cs delete mode 100644 src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextRangeProvider.cs delete mode 100644 src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IValueProvider.cs delete mode 100644 src/FPF/UIAutomationProvider/UIAutomationProvider.csproj delete mode 100644 src/FPF/UIAutomationTypes/Properties/AssemblyInfo.cs delete mode 100644 src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationElementIdentifiers.cs delete mode 100644 src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationIdentifier.cs delete mode 100644 src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationProperty.cs delete mode 100644 src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationTextAttribute.cs delete mode 100644 src/FPF/UIAutomationTypes/System.Windows.Automation.SelectionItemPatternIdentifiers.cs delete mode 100644 src/FPF/UIAutomationTypes/System.Windows.Automation.SupportedTextSelection.cs delete mode 100644 src/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextPatternRangeEndpoint.cs delete mode 100644 src/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextUnit.cs delete mode 100644 src/FPF/UIAutomationTypes/UIAutomationTypes.csproj delete mode 100644 src/FPF/WindowsBase/Assembly/AssemblyInfo.cs delete mode 100644 src/FPF/WindowsBase/Consts.cs delete mode 100644 src/FPF/WindowsBase/MonoTODOAttribute.cs delete mode 100644 src/FPF/WindowsBase/System.Collections.Specialized/CollectionChangedEventManager.cs delete mode 100644 src/FPF/WindowsBase/System.Collections.Specialized/INotifyCollectionChanged.cs delete mode 100644 src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedAction.cs delete mode 100644 src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs delete mode 100644 src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs delete mode 100644 src/FPF/WindowsBase/System.ComponentModel/DependencyPropertyDescriptor.cs delete mode 100644 src/FPF/WindowsBase/System.IO/FileFormatException.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Converters/Int32RectValueSerializer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Converters/PointValueSerializer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Converters/RectValueSerializer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Converters/VectorValueSerializer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Data/DataSourceProvider.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/FocusNavigationDirection.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/Key.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/KeyConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/KeyInterop.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/KeyValueSerializer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/ModifierKeys.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/ModifierKeysConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/ModifierKeysValueSerializer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Input/TraversalRequest.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Interop/ComponentDispatcher.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSink.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSite.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Interop/MSG.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Interop/ThreadMessageEventHandler.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Media/DisableDpiAwarenessAttribute.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Media/Matrix.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Media/MatrixConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/Dispatcher.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/DispatcherEventArgs.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/DispatcherObject.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/DispatcherOperation.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/DispatcherOperationTaskSource.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/DispatcherPriority.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/DispatcherSynchronizationContext.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/DispatcherTimer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableAttribute.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableForTypeAttribute.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableWhenAttributePresentAttribute.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/CoerceValueCallback.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/DependencyObject.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/DependencyObjectType.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/DependencyProperty.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventArgs.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventHandler.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/DependencyPropertyKey.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/Expression.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/ExpressionConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/Freezable.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/IWeakEventListener.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/Int32Rect.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/Int32RectConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/LocalValueEntry.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/LocalValueEnumerator.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/NumericListTokenizer.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/Point.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/PointConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/PropertyChangedCallback.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/PropertyMetadata.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/Rect.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/RectConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/Size.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/SizeConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/SplashScreen.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/ValidateValueCallback.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/Vector.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/VectorConverter.cs delete mode 100644 src/FPF/WindowsBase/System.Windows/WeakEventManager.cs delete mode 100644 src/FPF/WindowsBase/WindowsBase.csproj delete mode 100644 src/FPF/winfx3.pub diff --git a/build/Project.targets b/build/Project.targets index cc9b081..3ab745b 100644 --- a/build/Project.targets +++ b/build/Project.targets @@ -36,7 +36,7 @@ - $(RepoRootPath)src\FPF\ + $(RepoRootPath)src\Editor\FPF\ $(RepoBinPath)FPF\$(Configuration)\$(TargetFramework)\ @@ -83,7 +83,7 @@ - $(RepoBinPath)StandaloneMacEditor\$(Configuration)\$(TargetFramework)\MonoDevelop.Ide.app\Contents\MacOS\MonoDevelop.Ide + $(RepoBinPath)Editor\Text\Test\Util\StandaloneMacEditor\$(Configuration)\$(TargetFramework)\MonoDevelop.Ide.app\Contents\MacOS\MonoDevelop.Ide diff --git a/src/Editor/FPF/Directory.Build.props b/src/Editor/FPF/Directory.Build.props new file mode 100644 index 0000000..194189d --- /dev/null +++ b/src/Editor/FPF/Directory.Build.props @@ -0,0 +1,18 @@ + + + + + + 67;114;3001;3002;3009;$(NoWarn) + false + + $(RepoBinPath)FPF\ + $(BaseOutputPath)$(Configuration)\ + + true + $(MSBuildThisFileDirectory)winfx3.pub + true + + false + + \ No newline at end of file diff --git a/src/Editor/FPF/Directory.Build.targets b/src/Editor/FPF/Directory.Build.targets new file mode 100644 index 0000000..b3d5603 --- /dev/null +++ b/src/Editor/FPF/Directory.Build.targets @@ -0,0 +1,6 @@ + + + + Microsoft.VisualStudio.FPF.$(AssemblyName) + + \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/PresentationCore.csproj b/src/Editor/FPF/PresentationCore/PresentationCore.csproj new file mode 100644 index 0000000..e8cefc0 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/PresentationCore.csproj @@ -0,0 +1,10 @@ + + + $(TargetFramework) + + + + + + + \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/Properties/AssemblyInfo.cs b/src/Editor/FPF/PresentationCore/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8341535 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/Properties/AssemblyInfo.cs @@ -0,0 +1,7 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; + +[assembly: CLSCompliant(true)] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly:InternalsVisibleTo("PresentationFramework, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Clipboard.cs b/src/Editor/FPF/PresentationCore/System.Windows.Clipboard.cs new file mode 100644 index 0000000..f45967c --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Clipboard.cs @@ -0,0 +1,63 @@ +using AppKit; +using Foundation; + +namespace System.Windows +{ + public static class Clipboard + { + static readonly NSPasteboard pasteboard = NSPasteboard.GeneralPasteboard; + static readonly string[] textTypes = { DataFormats.UnicodeText }; + + public static bool ContainsText() + => pasteboard.CanReadItemWithDataConformingToTypes(textTypes); + + public static void SetDataObject(object data, bool copy) + { + if (data is DataObject dataObject) + { + pasteboard.ClearContents(); + + foreach (var item in dataObject.Items) + { + switch (item.Data) + { + case string stringData: + pasteboard.SetStringForType( + stringData, + item.Format); + break; + case bool boolItem: + pasteboard.SetDataForType( + NSData.FromArray(new byte[] { boolItem ? (byte)1 : (byte)0 }), + item.Format); + break; + } + } + } + } + + public static IDataObject GetDataObject() + { + var dataObject = new DataObject (); + // Beside copying and pasting UnicodeText to/from pasteboard + // editor inserts booleans like "VisualStudioEditorOperationsLineCutCopyClipboardTag" + // which allows editor to know whole line was copied into pasteboard so on paste + // it inserts line into new line, so we enumerate over all types and if length == 1 + // we just assume it's boolean we set in method above + foreach (var type in pasteboard.Types) + { + if (type == DataFormats.UnicodeText) + { + dataObject.SetText (pasteboard.GetStringForType (type)); + continue; + } + var data = pasteboard.GetDataForType (type); + if (data != null && data.Length == 1) + { + dataObject.SetData (type, data: data [0] != 0); + } + } + return dataObject; + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.DataFormats.cs b/src/Editor/FPF/PresentationCore/System.Windows.DataFormats.cs new file mode 100644 index 0000000..3ca9ae2 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.DataFormats.cs @@ -0,0 +1,29 @@ +namespace System.Windows +{ + public static class DataFormats + { + public static readonly string Text = "public.utf8-plain-text"; + public static readonly string UnicodeText = "public.utf8-plain-text"; + public static readonly string Rtf = "public.rtf"; + public static readonly string Html = "public.html"; + public static readonly string CommaSeparatedValue = "public.utf8-tab-separated-values-text"; + public static readonly string FileDrop = ""; + + internal static string ConvertToDataFormats(TextDataFormat textDataformat) + { + switch (textDataformat) + { + case TextDataFormat.Text: + return Text; + case TextDataFormat.UnicodeText: + return UnicodeText; + case TextDataFormat.Rtf: + return Rtf; + case TextDataFormat.Html: + return Html; + default: + return UnicodeText; + } + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.DataObject.cs b/src/Editor/FPF/PresentationCore/System.Windows.DataObject.cs new file mode 100644 index 0000000..6dc13dc --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.DataObject.cs @@ -0,0 +1,91 @@ +using System.Collections.Generic; + +namespace System.Windows +{ + public interface IDataObject + { + bool GetDataPresent(string format, bool autoConvert); + bool GetDataPresent(Type format); + bool GetDataPresent(string format); + object GetData(string format); + object GetData(string format, bool autoConvert); + string[] GetFormats(); + } + + public sealed class DataObject : IDataObject + { + public readonly struct DataItem + { + public readonly string Format; + public readonly object Data; + + public DataItem (string format, object data) + { + Format = format; + Data = data; + } + } + + readonly List items = new List(4); + public IReadOnlyList Items => items; + + public void SetData(string format, object data) + => items.Add(new DataItem(format, data)); + + public void SetText(string textData) + => SetText(textData, TextDataFormat.UnicodeText); + + public void SetText(string textData, TextDataFormat format) + => SetData(DataFormats.ConvertToDataFormats(format), textData); + + public bool GetDataPresent(Type format) + { + if (format == typeof(string)) + return GetDataPresent(DataFormats.Text); + + return GetDataPresent(format.FullName); + } + + public bool GetDataPresent(string format) + => GetDataPresent(format, true); + + public bool GetDataPresent(string format, bool autoConvert) + { + foreach (var item in items) + { + if (string.Equals(item.Format, format, StringComparison.OrdinalIgnoreCase)) + return true; + } + + return false; + } + + public object GetData(string format) + => GetData(format, true); + + public object GetData(string format, bool autoConvert) + { + foreach (var item in items) + { + if (string.Equals(item.Format, format, StringComparison.OrdinalIgnoreCase)) + { + if (item.Data is string tsv && + string.Equals(item.Format, DataFormats.CommaSeparatedValue)) + return tsv.Replace('\t', ','); + + return item.Data; + } + } + + return null; + } + + public string[] GetFormats() + { + var formats = new string[items.Count]; + for (int i = 0; i < items.Count; i++) + formats[i] = items[i].Format; + return formats; + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.DragEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.DragEventArgs.cs new file mode 100644 index 0000000..dcd7938 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.DragEventArgs.cs @@ -0,0 +1,10 @@ +namespace System.Windows +{ + public class DragEventArgs : System.Windows.RoutedEventArgs + { + + + + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.FontStyle.cs b/src/Editor/FPF/PresentationCore/System.Windows.FontStyle.cs new file mode 100644 index 0000000..6558730 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.FontStyle.cs @@ -0,0 +1,11 @@ +namespace System.Windows +{ + public struct FontStyle + { + public static bool operator ==(FontStyle p1, FontStyle p2) { return true; } + public static bool operator !=(FontStyle p1, FontStyle p2) { return false; } + + public override bool Equals(object obj) => true; + public override int GetHashCode() => 0; + } +} diff --git a/src/Editor/FPF/PresentationCore/System.Windows.FontStyles.cs b/src/Editor/FPF/PresentationCore/System.Windows.FontStyles.cs new file mode 100644 index 0000000..46c28ec --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.FontStyles.cs @@ -0,0 +1,10 @@ +namespace System.Windows +{ + public abstract class FontStyles : System.Object + { + + public static System.Windows.FontStyle Italic { get { return new FontStyle(); } } + public static System.Windows.FontStyle Normal { get { return new FontStyle(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.FontWeight.cs b/src/Editor/FPF/PresentationCore/System.Windows.FontWeight.cs new file mode 100644 index 0000000..0d094c9 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.FontWeight.cs @@ -0,0 +1,206 @@ +namespace System.Windows +{ + public struct FontWeight : IFormattable + { + internal FontWeight(int weight) + { + // We want the default zero value of new FontWeight() to correspond to FontWeights.Normal. + // Therefore, the _weight value is shifted by 400 relative to the OpenType weight value. + _weight = weight - 400; + } + + /// + /// Creates a new FontWeight object that corresponds to the OpenType usWeightClass value. + /// + /// An integer value between 1 and 999 that corresponds + /// to the usWeightClass definition in the OpenType specification. + /// A new FontWeight object that corresponds to the weightValue parameter. + // Important note: when changing this method signature please make sure to update FontWeightConverter accordingly. + public static FontWeight FromOpenTypeWeight(int weightValue) + { + if (weightValue < 1 || weightValue > 999) + throw new ArgumentOutOfRangeException(); + return new FontWeight(weightValue); + } + + /// + /// Obtains OpenType usWeightClass value that corresponds to the FontWeight object. + /// + /// An integer value between 1 and 999 that corresponds + /// to the usWeightClass definition in the OpenType specification. + // Important note: when changing this method signature please make sure to update FontWeightConverter accordingly. + public int ToOpenTypeWeight() + { + return RealWeight; + } + + /// + /// Compares two font weight values and returns an indication of their relative values. + /// + /// First object to compare. + /// Second object to compare. + /// A 32-bit signed integer indicating the lexical relationship between the two comparands. + /// When the return value is less than zero this means that left is less than right. + /// When the return value is zero this means that left is equal to right. + /// When the return value is greater than zero this means that left is greater than right. + /// + public static int Compare(FontWeight left, FontWeight right) + { + return left._weight - right._weight; + } + + /// + /// Checks whether a font weight is less than another. + /// + /// First object to compare. + /// Second object to compare. + /// True if left is less than right, false otherwise. + public static bool operator <(FontWeight left, FontWeight right) + { + return Compare(left, right) < 0; + } + + /// + /// Checks whether a font weight is less or equal than another. + /// + /// First object to compare. + /// Second object to compare. + /// True if left is less or equal than right, false otherwise. + public static bool operator <=(FontWeight left, FontWeight right) + { + return Compare(left, right) <= 0; + } + + /// + /// Checks whether a font weight is greater than another. + /// + /// First object to compare. + /// Second object to compare. + /// True if left is greater than right, false otherwise. + public static bool operator >(FontWeight left, FontWeight right) + { + return Compare(left, right) > 0; + } + + /// + /// Checks whether a font weight is greater or equal than another. + /// + /// First object to compare. + /// Second object to compare. + /// True if left is greater or equal than right, false otherwise. + public static bool operator >=(FontWeight left, FontWeight right) + { + return Compare(left, right) >= 0; + } + + /// + /// Checks whether two font weight objects are equal. + /// + /// First object to compare. + /// Second object to compare. + /// Returns true when the font weight values are equal for both objects, + /// and false otherwise. + public static bool operator ==(FontWeight left, FontWeight right) + { + return Compare(left, right) == 0; + } + + /// + /// Checks whether two font weight objects are not equal. + /// + /// First object to compare. + /// Second object to compare. + /// Returns false when the font weight values are equal for both objects, + /// and true otherwise. + public static bool operator !=(FontWeight left, FontWeight right) + { + return !(left == right); + } + + /// + /// Checks whether the object is equal to another FontWeight object. + /// + /// FontWeight object to compare with. + /// Returns true when the object is equal to the input object, + /// and false otherwise. + public bool Equals(FontWeight obj) + { + return this == obj; + } + + /// + /// Checks whether an object is equal to another character hit object. + /// + /// FontWeight object to compare with. + /// Returns true when the object is equal to the input object, + /// and false otherwise. + public override bool Equals(object obj) + { + if (!(obj is FontWeight)) + return false; + return this == (FontWeight)obj; + } + + /// + /// Compute hash code for this object. + /// + /// A 32-bit signed integer hash code. + public override int GetHashCode() + { + return RealWeight; + } + + /// + /// Creates a string representation of this object based on the current culture. + /// + /// + /// A string representation of this object. + /// + public override string ToString() + { + // Delegate to the internal method which implements all ToString calls. + return ConvertToString(null, null); + } + + /// + /// Creates a string representation of this object based on the format string + /// and IFormatProvider passed in. + /// If the provider is null, the CurrentCulture is used. + /// See the documentation for IFormattable for more information. + /// + /// + /// A string representation of this object. + /// + string IFormattable.ToString(string format, IFormatProvider provider) + { + // Delegate to the internal method which implements all ToString calls. + return ConvertToString(format, provider); + } + + /// + /// Creates a string representation of this object based on the format string + /// and IFormatProvider passed in. + /// If the provider is null, the CurrentCulture is used. + /// See the documentation for IFormattable for more information. + /// + /// + /// A string representation of this object. + /// + private string ConvertToString(string format, IFormatProvider provider) + { + throw new NotImplementedException(); + } + + /// + /// We want the default zero value of new FontWeight() to correspond to FontWeights.Normal. + /// Therefore, _weight value is shifted by 400 relative to the OpenType weight value. + /// + private int RealWeight { + get { + return _weight + 400; + } + } + + private int _weight; + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.FontWeights.cs b/src/Editor/FPF/PresentationCore/System.Windows.FontWeights.cs new file mode 100644 index 0000000..dca1e0f --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.FontWeights.cs @@ -0,0 +1,12 @@ +namespace System.Windows +{ + public abstract class FontWeights : System.Object + { + + + public static System.Windows.FontWeight Bold { get { return new FontWeight(); } } + public static System.Windows.FontWeight Normal { get { return new FontWeight(); } } + public static System.Windows.FontWeight Regular { get { return new FontWeight(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.GiveFeedbackEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.GiveFeedbackEventArgs.cs new file mode 100644 index 0000000..776c7da --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.GiveFeedbackEventArgs.cs @@ -0,0 +1,6 @@ +namespace System.Windows +{ + public class GiveFeedbackEventArgs : System.Windows.RoutedEventArgs + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.IInputElement.cs b/src/Editor/FPF/PresentationCore/System.Windows.IInputElement.cs new file mode 100644 index 0000000..e7fe80c --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.IInputElement.cs @@ -0,0 +1,6 @@ +namespace System.Windows +{ + public interface IInputElement + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Input.InputEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.Input.InputEventArgs.cs new file mode 100644 index 0000000..3ff7fe5 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Input.InputEventArgs.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Input +{ + public class InputEventArgs : System.Windows.RoutedEventArgs + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Input.InputLanguageEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.Input.InputLanguageEventArgs.cs new file mode 100644 index 0000000..09061c6 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Input.InputLanguageEventArgs.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Input +{ + public abstract class InputLanguageEventArgs : System.EventArgs + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButton.cs b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButton.cs new file mode 100644 index 0000000..e22e8c0 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButton.cs @@ -0,0 +1,11 @@ +namespace System.Windows.Input +{ + public enum MouseButton + { Left, + Middle, + Right, + XButton1, + XButton2, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButtonEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButtonEventArgs.cs new file mode 100644 index 0000000..3709e5f --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButtonEventArgs.cs @@ -0,0 +1,12 @@ +namespace System.Windows.Input +{ + public class MouseButtonEventArgs : System.Windows.Input.MouseEventArgs + { + + + public System.Int32 ClickCount { get { throw new System.NotImplementedException(); } } + public System.Windows.Input.MouseButton ChangedButton { get { throw new System.NotImplementedException(); } } + public System.Windows.Input.MouseButtonState ButtonState { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButtonState.cs b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButtonState.cs new file mode 100644 index 0000000..a4d6b09 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseButtonState.cs @@ -0,0 +1,8 @@ +namespace System.Windows.Input +{ + public enum MouseButtonState + { Released, + Pressed, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseEventArgs.cs new file mode 100644 index 0000000..cef60a9 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseEventArgs.cs @@ -0,0 +1,14 @@ +namespace System.Windows.Input +{ + public class MouseEventArgs : System.Windows.Input.InputEventArgs + { + + + + + public System.Windows.Point GetPosition(object param0){throw new System.NotImplementedException();} + public System.Windows.Input.MouseButtonState LeftButton { get { throw new System.NotImplementedException(); } } + public System.Windows.Input.MouseButtonState MiddleButton { get { throw new System.NotImplementedException(); } } + public System.Windows.Input.MouseButtonState RightButton { get { throw new System.NotImplementedException(); } } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseWheelEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseWheelEventArgs.cs new file mode 100644 index 0000000..10cee09 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Input.MouseWheelEventArgs.cs @@ -0,0 +1,8 @@ +namespace System.Windows.Input +{ + public class MouseWheelEventArgs : System.Windows.Input.MouseEventArgs + { + public System.Int32 Delta { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Input.TouchEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.Input.TouchEventArgs.cs new file mode 100644 index 0000000..9a2df37 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Input.TouchEventArgs.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Input +{ + public class TouchEventArgs : System.Windows.Input.InputEventArgs + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.Animatable.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.Animatable.cs new file mode 100644 index 0000000..52cc7b1 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.Animatable.cs @@ -0,0 +1,11 @@ +namespace System.Windows.Media.Animation +{ + public abstract class Animatable : System.Windows.Freezable + { public virtual void BeginAnimation(System.Windows.DependencyProperty param0, System.Windows.Media.Animation.AnimationTimeline param1){throw new System.NotImplementedException();} + + protected override Freezable CreateInstanceCore() + { + return null; + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.AnimationTimeline.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.AnimationTimeline.cs new file mode 100644 index 0000000..adbae0e --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.AnimationTimeline.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Media.Animation +{ + public abstract class AnimationTimeline : System.Windows.Media.Animation.Timeline + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.RepeatBehavior.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.RepeatBehavior.cs new file mode 100644 index 0000000..2246d6b --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.RepeatBehavior.cs @@ -0,0 +1,9 @@ +namespace System.Windows.Media.Animation +{ + public struct RepeatBehavior + { public RepeatBehavior(System.Double param0){} + + public static System.Windows.Media.Animation.RepeatBehavior Forever { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.Timeline.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.Timeline.cs new file mode 100644 index 0000000..1c7aaf4 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Animation.Timeline.cs @@ -0,0 +1,10 @@ +namespace System.Windows.Media.Animation +{ + public abstract class Timeline : System.Windows.Media.Animation.Animatable + { + + public event System.EventHandler Completed; + public System.Windows.Media.Animation.RepeatBehavior RepeatBehavior { set { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.BitmapScalingMode.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.BitmapScalingMode.cs new file mode 100644 index 0000000..83b709c --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.BitmapScalingMode.cs @@ -0,0 +1,12 @@ +namespace System.Windows.Media +{ + public enum BitmapScalingMode + { Unspecified, + LowQuality, + HighQuality, + Linear, + Fant, + NearestNeighbor, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Brush.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Brush.cs new file mode 100644 index 0000000..677e0a4 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Brush.cs @@ -0,0 +1,11 @@ +namespace System.Windows.Media +{ + public abstract class Brush : System.Windows.Media.Animation.Animatable + { + public System.String ToString(System.IFormatProvider param0){throw new System.NotImplementedException();} + + public new System.Windows.Media.Brush Clone() { return this; } + public System.Double Opacity { get; set; } = 1.0; + + } +} diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Brushes.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Brushes.cs new file mode 100644 index 0000000..dc99d71 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Brushes.cs @@ -0,0 +1,21 @@ +namespace System.Windows.Media +{ + public class Brushes : System.Object + { + static SolidColorBrush pink = new SolidColorBrush(Colors.Pink); + public static System.Windows.Media.SolidColorBrush Black { get => pink; } + public static System.Windows.Media.SolidColorBrush Blue { get => pink; } + public static System.Windows.Media.SolidColorBrush DarkGray { get => pink; } + public static System.Windows.Media.SolidColorBrush Gray { get => pink; } + public static System.Windows.Media.SolidColorBrush LightBlue { get => pink; } + public static System.Windows.Media.SolidColorBrush LightGray { get => pink; } + public static System.Windows.Media.SolidColorBrush LightYellow { get => pink; } + public static System.Windows.Media.SolidColorBrush PaleVioletRed { get => pink; } + public static System.Windows.Media.SolidColorBrush Red { get => pink; } + public static System.Windows.Media.SolidColorBrush Transparent { get; } = new SolidColorBrush(Colors.Transparent); + public static System.Windows.Media.SolidColorBrush White { get => pink; } + public static System.Windows.Media.SolidColorBrush Yellow { get => pink; } + public static System.Windows.Media.SolidColorBrush Green { get => pink; } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Color.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Color.cs new file mode 100644 index 0000000..1af2af3 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Color.cs @@ -0,0 +1,694 @@ +using System.Runtime.InteropServices; +using System.Text; + +namespace System.Windows.Media +{ + public struct Color : IFormattable, IEquatable + { + //------------------------------------------------------ + // + // Constructors + // + //------------------------------------------------------ + + #region Constructors + + + + /// + /// FromAValues - general constructor for multichannel color values with explicit alpha channel and color context, i.e. spectral colors + /// + public static Color FromAValues(float a, float[] values, Uri profileUri) + { + throw new NotImplementedException(); + } + + /// + /// FromValues - general color constructor for multichannel color values with opaque alpha channel and explicit color context, i.e. spectral colors + /// + public static Color FromValues(float[] values, Uri profileUri) + { + Color c1 = Color.FromAValues(1.0f, values, profileUri); + + return c1; + } + + /// + /// Color - sRgb legacy interface, assumes Rgb values are sRgb + /// + internal static Color FromUInt32(uint argb)// internal legacy sRGB interface + { + Color c1 = new Color(); + + c1.sRgbColor.a = (byte)((argb & 0xff000000) >> 24); + c1.sRgbColor.r = (byte)((argb & 0x00ff0000) >> 16); + c1.sRgbColor.g = (byte)((argb & 0x0000ff00) >> 8); + c1.sRgbColor.b = (byte)(argb & 0x000000ff); + c1.scRgbColor.a = (float)c1.sRgbColor.a / 255.0f; + c1.scRgbColor.r = sRgbToScRgb(c1.sRgbColor.r); // note that context is undefined and thus unloaded + c1.scRgbColor.g = sRgbToScRgb(c1.sRgbColor.g); + c1.scRgbColor.b = sRgbToScRgb(c1.sRgbColor.b); + c1.context = null; + + c1.isFromScRgb = false; + + return c1; + } + + /// + /// FromScRgb + /// + public static Color FromScRgb(float a, float r, float g, float b) + { + Color c1 = new Color(); + + c1.scRgbColor.r = r; + c1.scRgbColor.g = g; + c1.scRgbColor.b = b; + c1.scRgbColor.a = a; + if (a < 0.0f) { + a = 0.0f; + } else if (a > 1.0f) { + a = 1.0f; + } + + c1.sRgbColor.a = (byte)((a * 255.0f) + 0.5f); + c1.sRgbColor.r = ScRgbTosRgb(c1.scRgbColor.r); + c1.sRgbColor.g = ScRgbTosRgb(c1.scRgbColor.g); + c1.sRgbColor.b = ScRgbTosRgb(c1.scRgbColor.b); + c1.context = null; + + c1.isFromScRgb = true; + + return c1; + } + + /// + /// Color - sRgb legacy interface, assumes Rgb values are sRgb, alpha channel is linear 1.0 gamma + /// + public static Color FromArgb(byte a, byte r, byte g, byte b)// legacy sRGB interface, bytes are required to properly round trip + { + Color c1 = new Color(); + + c1.scRgbColor.a = (float)a / 255.0f; + c1.scRgbColor.r = sRgbToScRgb(r); // note that context is undefined and thus unloaded + c1.scRgbColor.g = sRgbToScRgb(g); + c1.scRgbColor.b = sRgbToScRgb(b); + c1.context = null; + c1.sRgbColor.a = a; + c1.sRgbColor.r = ScRgbTosRgb(c1.scRgbColor.r); + c1.sRgbColor.g = ScRgbTosRgb(c1.scRgbColor.g); + c1.sRgbColor.b = ScRgbTosRgb(c1.scRgbColor.b); + + c1.isFromScRgb = false; + + return c1; + } + + /// + /// Color - sRgb legacy interface, assumes Rgb values are sRgb + /// + public static Color FromRgb(byte r, byte g, byte b)// legacy sRGB interface, bytes are required to properly round trip + { + Color c1 = Color.FromArgb(0xff, r, g, b); + return c1; + } + #endregion Constructors + + //------------------------------------------------------ + // + // Public Methods + // + //------------------------------------------------------ + + #region Public Methods + /// + /// GetHashCode + /// + public override int GetHashCode() + { + return this.scRgbColor.GetHashCode(); //^this.context.GetHashCode(); + } + + /// + /// Creates a string representation of this object based on the current culture. + /// + /// + /// A string representation of this object. + /// + public override string ToString() + { + // Delegate to the internal method which implements all ToString calls. + + string format = isFromScRgb ? c_scRgbFormat : null; + + return ConvertToString(format, null); + } + + /// + /// Creates a string representation of this object based on the IFormatProvider + /// passed in. If the provider is null, the CurrentCulture is used. + /// + /// + /// A string representation of this object. + /// + public string ToString(IFormatProvider provider) + { + // Delegate to the internal method which implements all ToString calls. + + string format = isFromScRgb ? c_scRgbFormat : null; + + return ConvertToString(format, provider); + } + + /// + /// Creates a string representation of this object based on the format string + /// and IFormatProvider passed in. + /// If the provider is null, the CurrentCulture is used. + /// See the documentation for IFormattable for more information. + /// + /// + /// A string representation of this object. + /// + string IFormattable.ToString(string format, IFormatProvider provider) + { + // Delegate to the internal method which implements all ToString calls. + return ConvertToString(format, provider); + } + + /// + /// Creates a string representation of this object based on the format string + /// and IFormatProvider passed in. + /// If the provider is null, the CurrentCulture is used. + /// See the documentation for IFormattable for more information. + /// + /// + /// A string representation of this object. + /// + internal string ConvertToString(string format, IFormatProvider provider) + { + throw new NotImplementedException(); + } + + /// + /// Compares two colors for fuzzy equality. This function + /// helps compensate for the fact that float values can + /// acquire error when operated upon + /// + /// The first color to compare + /// The second color to compare + /// Whether or not the two colors are equal + public static bool AreClose(Color color1, Color color2) + { + return color1.IsClose(color2); + } + + /// + /// Compares two colors for fuzzy equality. This function + /// helps compensate for the fact that float values can + /// acquire error when operated upon + /// + /// The color to compare to this + /// Whether or not the two colors are equal + private bool IsClose(Color color) + { + throw new NotImplementedException(); ; + } + + /// + /// Clamp - the color channels to the gamut [0..1]. If a channel is out + /// of gamut, it will be set to 1, which represents full saturation. + /// todo: sync up context values if they exist + /// + public void Clamp() + { + scRgbColor.r = (scRgbColor.r < 0) ? 0 : (scRgbColor.r > 1.0f) ? 1.0f : scRgbColor.r; + scRgbColor.g = (scRgbColor.g < 0) ? 0 : (scRgbColor.g > 1.0f) ? 1.0f : scRgbColor.g; + scRgbColor.b = (scRgbColor.b < 0) ? 0 : (scRgbColor.b > 1.0f) ? 1.0f : scRgbColor.b; + scRgbColor.a = (scRgbColor.a < 0) ? 0 : (scRgbColor.a > 1.0f) ? 1.0f : scRgbColor.a; + sRgbColor.a = (byte)(scRgbColor.a * 255f); + sRgbColor.r = ScRgbTosRgb(scRgbColor.r); + sRgbColor.g = ScRgbTosRgb(scRgbColor.g); + sRgbColor.b = ScRgbTosRgb(scRgbColor.b); + + // + } + + /// + /// GetNativeColorValues - return color values from color context + /// + public float[] GetNativeColorValues() + { + if (context != null) { + return (float[])nativeColorValue.Clone(); + } else { + throw new InvalidOperationException(); + } + } + #endregion Public Methods + + //------------------------------------------------------ + // + // Public Operators + // + //------------------------------------------------------ + + #region Public Operators + /// + /// Addition operator - Adds each channel of the second color to each channel of the + /// first and returns the result + /// + public static Color operator +(Color color1, Color color2) + { + throw new NotImplementedException(); + } + + /// + /// Addition method - Adds each channel of the second color to each channel of the + /// first and returns the result + /// + public static Color Add(Color color1, Color color2) + { + return (color1 + color2); + } + + /// + /// Subtract operator - substracts each channel of the second color from each channel of the + /// first and returns the result + /// + /// The minuend + /// The subtrahend + /// Returns the unclamped differnce + public static Color operator -(Color color1, Color color2) + { + + throw new NotImplementedException(); + } + + /// + /// Subtract method - subtracts each channel of the second color from each channel of the + /// first and returns the result + /// + public static Color Subtract(Color color1, Color color2) + { + return (color1 - color2); + } + + /// + /// Multiplication operator - Multiplies each channel of the color by a coefficient and returns the result + /// + /// The color + /// The coefficient + /// Returns the unclamped product + public static Color operator *(Color color, float coefficient) + { + Color c1 = FromScRgb(color.scRgbColor.a * coefficient, color.scRgbColor.r * coefficient, color.scRgbColor.g * coefficient, color.scRgbColor.b * coefficient); + + if (color.context == null) { + return c1; + } else { + c1.context = color.context; + +#pragma warning disable 6506 // c1.context is obviously not null + c1.ComputeNativeValues(0); +#pragma warning restore 6506 + } + + return c1; + } + + /// + /// Multiplication method - Multiplies each channel of the color by a coefficient and returns the result + /// + public static Color Multiply(Color color, float coefficient) + { + return (color * coefficient); + } + + /// + /// Equality method for two colors - return true of colors are equal, otherwise returns false + /// + public static bool Equals(Color color1, Color color2) + { + return (color1 == color2); + } + + /// + /// Compares two colors for exact equality. Note that float values can acquire error + /// when operated upon, such that an exact comparison between two values which are logically + /// equal may fail. see cref="AreClose" for a "fuzzy" version of this comparison. + /// + /// The color to compare to "this" + /// Whether or not the two colors are equal + public bool Equals(Color color) + { + return this == color; + } + + /// + /// Compares two colors for exact equality. Note that float values can acquire error + /// when operated upon, such that an exact comparison between two vEquals(color);alues which are logically + /// equal may fail. see cref="AreClose" for a "fuzzy" version of this comparison. + /// + /// The object to compare to "this" + /// Whether or not the two colors are equal + public override bool Equals(object o) + { + if (o is Color) { + Color color = (Color)o; + + return (this == color); + } else { + return false; + } + } + + /// + /// IsEqual operator - Compares two colors for exact equality. Note that float values can acquire error + /// when operated upon, such that an exact comparison between two values which are logically + /// equal may fail. see cref="AreClose". + /// + public static bool operator ==(Color color1, Color color2) + { + if (color1.scRgbColor.r != color2.scRgbColor.r) { + return false; + } + + if (color1.scRgbColor.g != color2.scRgbColor.g) { + return false; + } + + if (color1.scRgbColor.b != color2.scRgbColor.b) { + return false; + } + + if (color1.scRgbColor.a != color2.scRgbColor.a) { + return false; + } + + return true; + } + + /// + /// != + /// + public static bool operator !=(Color color1, Color color2) + { + return (!(color1 == color2)); + } + #endregion Public Operators + + //------------------------------------------------------ + // + // Public Properties + // + //------------------------------------------------------ + + #region Public Properties + + + /// + /// A + /// + public byte A { + get { + return sRgbColor.a; + } + set { + scRgbColor.a = (float)value / 255.0f; + sRgbColor.a = value; + } + } + + /// The Red channel as a byte whose range is [0..255]. + /// the value is not allowed to be out of range + /// + /// R + /// + public byte R { + get { + return sRgbColor.r; + } + set { + if (context == null) { + scRgbColor.r = sRgbToScRgb(value); + sRgbColor.r = value; + } else { + throw new InvalidOperationException(); + } + } + } + + ///The Green channel as a byte whose range is [0..255]. + /// the value is not allowed to be out of range + /// G + /// + public byte G { + get { + return sRgbColor.g; + } + set { + if (context == null) { + scRgbColor.g = sRgbToScRgb(value); + sRgbColor.g = value; + } else { + throw new InvalidOperationException(); + } + } + } + + ///The Blue channel as a byte whose range is [0..255]. + /// the value is not allowed to be out of range + /// B + /// + public byte B { + get { + return sRgbColor.b; + } + set { + if (context == null) { + scRgbColor.b = sRgbToScRgb(value); + sRgbColor.b = value; + } else { + throw new InvalidOperationException(); + } + } + } + + ///The Alpha channel as a float whose range is [0..1]. + /// the value is allowed to be out of range + /// ScA + /// + public float ScA { + get { + return scRgbColor.a; + } + set { + scRgbColor.a = value; + if (value < 0.0f) { + sRgbColor.a = 0; + } else if (value > 1.0f) { + sRgbColor.a = (byte)255; + } else { + sRgbColor.a = (byte)(value * 255f); + } + } + } + + ///The Red channel as a float whose range is [0..1]. + /// the value is allowed to be out of range + /// + /// ScR + /// + public float ScR { + get { + return scRgbColor.r; + // throw new ArgumentException(SR.Get(SRID.Color_ColorContextNotsRgb_or_ScRgb, null)); + } + set { + if (context == null) { + scRgbColor.r = value; + sRgbColor.r = ScRgbTosRgb(value); + } else { + throw new InvalidOperationException(); + } + } + } + + ///The Green channel as a float whose range is [0..1]. + /// the value is allowed to be out of range + /// ScG + /// + public float ScG { + get { + return scRgbColor.g; + // throw new ArgumentException(SR.Get(SRID.Color_ColorContextNotsRgb_or_ScRgb, null)); + } + set { + if (context == null) { + scRgbColor.g = value; + sRgbColor.g = ScRgbTosRgb(value); + } else { + throw new InvalidOperationException(); + } + } + } + + ///The Blue channel as a float whose range is [0..1]. + /// the value is allowed to be out of range + /// ScB + /// + public float ScB { + get { + return scRgbColor.b; + // throw new ArgumentException(SR.Get(SRID.Color_ColorContextNotsRgb_or_ScRgb, null)); + } + set { + if (context == null) { + scRgbColor.b = value; + sRgbColor.b = ScRgbTosRgb(value); + } else { + throw new InvalidOperationException(); + } + } + } + + #endregion Public Properties + + //------------------------------------------------------ + // + // Public Events + // + //------------------------------------------------------ + //------------------------------------------------------ + // + // Public Events + // + //------------------------------------------------------ + //------------------------------------------------------ + // + // Protected Methods + // + //------------------------------------------------------ + //------------------------------------------------------ + // + // Internal Properties + // + //------------------------------------------------------ + //------------------------------------------------------ + // + // Internal Events + // + //------------------------------------------------------ + //------------------------------------------------------ + // + // Internal Methods + // + //------------------------------------------------------ + //------------------------------------------------------ + // + // Private Methods + // + //------------------------------------------------------ + #region Private Methods + + /// + /// private helper function to set context values from a color value with a set context and ScRgb values + /// + private static float sRgbToScRgb(byte bval) + { + float val = ((float)bval / 255.0f); + + if (!(val > 0.0)) // Handles NaN case too. (Though, NaN isn't actually + // possible in this case.) + { + return (0.0f); + } else if (val <= 0.04045) { + return (val / 12.92f); + } else if (val < 1.0f) { + return (float)Math.Pow(((double)val + 0.055) / 1.055, 2.4); + } else { + return (1.0f); + } + } + + /// + /// private helper function to set context values from a color value with a set context and ScRgb values + /// + /// + private static byte ScRgbTosRgb(float val) + { + if (!(val > 0.0)) // Handles NaN case too + { + return (0); + } else if (val <= 0.0031308) { + return ((byte)((255.0f * val * 12.92f) + 0.5f)); + } else if (val < 1.0) { + return ((byte)((255.0f * ((1.055f * (float)Math.Pow((double)val, (1.0 / 2.4))) - 0.055f)) + 0.5f)); + } else { + return (255); + } + } + + /// + /// private helper function to set context values from a color value with a set context and ScRgb values + /// + /// + private void ComputeScRgbValues() + { + throw new NotImplementedException(); + } + + private void ComputeNativeValues(int numChannels) + { + throw new NotImplementedException(); + } + + #endregion Private Methods + + //------------------------------------------------------ + // + // Private Properties + // + //------------------------------------------------------ + //------------------------------------------------------ + // + // Private Events + // + //------------------------------------------------------ + //------------------------------------------------------ + // + // Private Fields + // + //------------------------------------------------------ + + #region Private Fields + + [MarshalAs(UnmanagedType.Interface)] + object context; + + private struct MILColorF // this structure is the "milrendertypes.h" structure and should be identical for performance + { + public float a, r, g, b; + }; + + private MILColorF scRgbColor; + + private struct MILColor + { + public byte a, r, g, b; + } + + private MILColor sRgbColor; + +#pragma warning disable 649 + private float[] nativeColorValue; +#pragma warning restore 649 + + private bool isFromScRgb; + + private const string c_scRgbFormat = "R"; + + #endregion Private Fields + } +} diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Colors.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Colors.cs new file mode 100644 index 0000000..fc3e487 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Colors.cs @@ -0,0 +1,1905 @@ +using System.Collections.Generic; + +namespace System.Windows.Media +{ + /// Enum containing handles to all known colors + /// Since the first element is 0, second is 1, etc, we can use this to index + /// directly into an array + internal enum KnownColor : uint + { + // We've reserved the value "1" as unknown. If for some odd reason "1" is added to the + // list, redefined UnknownColor + + AliceBlue = 0xFFF0F8FF, + AntiqueWhite = 0xFFFAEBD7, + Aqua = 0xFF00FFFF, + Aquamarine = 0xFF7FFFD4, + Azure = 0xFFF0FFFF, + Beige = 0xFFF5F5DC, + Bisque = 0xFFFFE4C4, + Black = 0xFF000000, + BlanchedAlmond = 0xFFFFEBCD, + Blue = 0xFF0000FF, + BlueViolet = 0xFF8A2BE2, + Brown = 0xFFA52A2A, + BurlyWood = 0xFFDEB887, + CadetBlue = 0xFF5F9EA0, + Chartreuse = 0xFF7FFF00, + Chocolate = 0xFFD2691E, + Coral = 0xFFFF7F50, + CornflowerBlue = 0xFF6495ED, + Cornsilk = 0xFFFFF8DC, + Crimson = 0xFFDC143C, + Cyan = 0xFF00FFFF, + DarkBlue = 0xFF00008B, + DarkCyan = 0xFF008B8B, + DarkGoldenrod = 0xFFB8860B, + DarkGray = 0xFFA9A9A9, + DarkGreen = 0xFF006400, + DarkKhaki = 0xFFBDB76B, + DarkMagenta = 0xFF8B008B, + DarkOliveGreen = 0xFF556B2F, + DarkOrange = 0xFFFF8C00, + DarkOrchid = 0xFF9932CC, + DarkRed = 0xFF8B0000, + DarkSalmon = 0xFFE9967A, + DarkSeaGreen = 0xFF8FBC8F, + DarkSlateBlue = 0xFF483D8B, + DarkSlateGray = 0xFF2F4F4F, + DarkTurquoise = 0xFF00CED1, + DarkViolet = 0xFF9400D3, + DeepPink = 0xFFFF1493, + DeepSkyBlue = 0xFF00BFFF, + DimGray = 0xFF696969, + DodgerBlue = 0xFF1E90FF, + Firebrick = 0xFFB22222, + FloralWhite = 0xFFFFFAF0, + ForestGreen = 0xFF228B22, + Fuchsia = 0xFFFF00FF, + Gainsboro = 0xFFDCDCDC, + GhostWhite = 0xFFF8F8FF, + Gold = 0xFFFFD700, + Goldenrod = 0xFFDAA520, + Gray = 0xFF808080, + Green = 0xFF008000, + GreenYellow = 0xFFADFF2F, + Honeydew = 0xFFF0FFF0, + HotPink = 0xFFFF69B4, + IndianRed = 0xFFCD5C5C, + Indigo = 0xFF4B0082, + Ivory = 0xFFFFFFF0, + Khaki = 0xFFF0E68C, + Lavender = 0xFFE6E6FA, + LavenderBlush = 0xFFFFF0F5, + LawnGreen = 0xFF7CFC00, + LemonChiffon = 0xFFFFFACD, + LightBlue = 0xFFADD8E6, + LightCoral = 0xFFF08080, + LightCyan = 0xFFE0FFFF, + LightGoldenrodYellow = 0xFFFAFAD2, + LightGreen = 0xFF90EE90, + LightGray = 0xFFD3D3D3, + LightPink = 0xFFFFB6C1, + LightSalmon = 0xFFFFA07A, + LightSeaGreen = 0xFF20B2AA, + LightSkyBlue = 0xFF87CEFA, + LightSlateGray = 0xFF778899, + LightSteelBlue = 0xFFB0C4DE, + LightYellow = 0xFFFFFFE0, + Lime = 0xFF00FF00, + LimeGreen = 0xFF32CD32, + Linen = 0xFFFAF0E6, + Magenta = 0xFFFF00FF, + Maroon = 0xFF800000, + MediumAquamarine = 0xFF66CDAA, + MediumBlue = 0xFF0000CD, + MediumOrchid = 0xFFBA55D3, + MediumPurple = 0xFF9370DB, + MediumSeaGreen = 0xFF3CB371, + MediumSlateBlue = 0xFF7B68EE, + MediumSpringGreen = 0xFF00FA9A, + MediumTurquoise = 0xFF48D1CC, + MediumVioletRed = 0xFFC71585, + MidnightBlue = 0xFF191970, + MintCream = 0xFFF5FFFA, + MistyRose = 0xFFFFE4E1, + Moccasin = 0xFFFFE4B5, + NavajoWhite = 0xFFFFDEAD, + Navy = 0xFF000080, + OldLace = 0xFFFDF5E6, + Olive = 0xFF808000, + OliveDrab = 0xFF6B8E23, + Orange = 0xFFFFA500, + OrangeRed = 0xFFFF4500, + Orchid = 0xFFDA70D6, + PaleGoldenrod = 0xFFEEE8AA, + PaleGreen = 0xFF98FB98, + PaleTurquoise = 0xFFAFEEEE, + PaleVioletRed = 0xFFDB7093, + PapayaWhip = 0xFFFFEFD5, + PeachPuff = 0xFFFFDAB9, + Peru = 0xFFCD853F, + Pink = 0xFFFFC0CB, + Plum = 0xFFDDA0DD, + PowderBlue = 0xFFB0E0E6, + Purple = 0xFF800080, + Red = 0xFFFF0000, + RosyBrown = 0xFFBC8F8F, + RoyalBlue = 0xFF4169E1, + SaddleBrown = 0xFF8B4513, + Salmon = 0xFFFA8072, + SandyBrown = 0xFFF4A460, + SeaGreen = 0xFF2E8B57, + SeaShell = 0xFFFFF5EE, + Sienna = 0xFFA0522D, + Silver = 0xFFC0C0C0, + SkyBlue = 0xFF87CEEB, + SlateBlue = 0xFF6A5ACD, + SlateGray = 0xFF708090, + Snow = 0xFFFFFAFA, + SpringGreen = 0xFF00FF7F, + SteelBlue = 0xFF4682B4, + Tan = 0xFFD2B48C, + Teal = 0xFF008080, + Thistle = 0xFFD8BFD8, + Tomato = 0xFFFF6347, + Transparent = 0x00FFFFFF, + Turquoise = 0xFF40E0D0, + Violet = 0xFFEE82EE, + Wheat = 0xFFF5DEB3, + White = 0xFFFFFFFF, + WhiteSmoke = 0xFFF5F5F5, + Yellow = 0xFFFFFF00, + YellowGreen = 0xFF9ACD32, + UnknownColor = 0x00000001 + } + + internal static class KnownColors + { +#if !PBTCOMPILER + + static KnownColors() + { + Array knownColorValues = Enum.GetValues(typeof(KnownColor)); + foreach (KnownColor colorValue in knownColorValues) { + string aRGBString = String.Format("#{0,8:X8}", (uint)colorValue); + s_knownArgbColors[aRGBString] = colorValue; + } + } + + /// Return the solid color brush from a color string. If there's no match, null + public static SolidColorBrush ColorStringToKnownBrush(string s) + { + if (null != s) { + KnownColor result = ColorStringToKnownColor(s); + + // If the result is UnknownColor, that means this string wasn't found + if (result != KnownColor.UnknownColor) { + // Otherwise, return the appropriate SolidColorBrush + return SolidColorBrushFromUint((uint)result); + } + } + return null; + } + + public static bool IsKnownSolidColorBrush(SolidColorBrush scp) + { + lock (s_solidColorBrushCache) { + return s_solidColorBrushCache.ContainsValue(scp); + } + } + + public static SolidColorBrush SolidColorBrushFromUint(uint argb) + { + SolidColorBrush scp = null; + + lock (s_solidColorBrushCache) { + // Attempt to retrieve the color. If it fails create it. + if (!s_solidColorBrushCache.TryGetValue(argb, out scp)) { + scp = new SolidColorBrush(Color.FromUInt32(argb)); + scp.Freeze(); + s_solidColorBrushCache[argb] = scp; + } +#if DEBUG + else { + s_count++; + } +#endif + } + + return scp; + } +#endif + + /// Return the KnownColor from a color string. If there's no match, KnownColor.UnknownColor + internal static KnownColor ColorStringToKnownColor(string colorString) + { + if (null != colorString) { + // We use invariant culture because we don't globalize our color names + string colorUpper = colorString.ToUpper(System.Globalization.CultureInfo.InvariantCulture); + + // Use String.Equals because it does explicit equality + // StartsWith/EndsWith are culture sensitive and are 4-7 times slower than Equals + + switch (colorUpper.Length) { + case 3: + if (colorUpper.Equals("RED")) return KnownColor.Red; + if (colorUpper.Equals("TAN")) return KnownColor.Tan; + break; + case 4: + switch (colorUpper[0]) { + case 'A': + if (colorUpper.Equals("AQUA")) return KnownColor.Aqua; + break; + case 'B': + if (colorUpper.Equals("BLUE")) return KnownColor.Blue; + break; + case 'C': + if (colorUpper.Equals("CYAN")) return KnownColor.Cyan; + break; + case 'G': + if (colorUpper.Equals("GOLD")) return KnownColor.Gold; + if (colorUpper.Equals("GRAY")) return KnownColor.Gray; + break; + case 'L': + if (colorUpper.Equals("LIME")) return KnownColor.Lime; + break; + case 'N': + if (colorUpper.Equals("NAVY")) return KnownColor.Navy; + break; + case 'P': + if (colorUpper.Equals("PERU")) return KnownColor.Peru; + if (colorUpper.Equals("PINK")) return KnownColor.Pink; + if (colorUpper.Equals("PLUM")) return KnownColor.Plum; + break; + case 'S': + if (colorUpper.Equals("SNOW")) return KnownColor.Snow; + break; + case 'T': + if (colorUpper.Equals("TEAL")) return KnownColor.Teal; + break; + } + break; + case 5: + switch (colorUpper[0]) { + case 'A': + if (colorUpper.Equals("AZURE")) return KnownColor.Azure; + break; + case 'B': + if (colorUpper.Equals("BEIGE")) return KnownColor.Beige; + if (colorUpper.Equals("BLACK")) return KnownColor.Black; + if (colorUpper.Equals("BROWN")) return KnownColor.Brown; + break; + case 'C': + if (colorUpper.Equals("CORAL")) return KnownColor.Coral; + break; + case 'G': + if (colorUpper.Equals("GREEN")) return KnownColor.Green; + break; + case 'I': + if (colorUpper.Equals("IVORY")) return KnownColor.Ivory; + break; + case 'K': + if (colorUpper.Equals("KHAKI")) return KnownColor.Khaki; + break; + case 'L': + if (colorUpper.Equals("LINEN")) return KnownColor.Linen; + break; + case 'O': + if (colorUpper.Equals("OLIVE")) return KnownColor.Olive; + break; + case 'W': + if (colorUpper.Equals("WHEAT")) return KnownColor.Wheat; + if (colorUpper.Equals("WHITE")) return KnownColor.White; + break; + } + break; + case 6: + switch (colorUpper[0]) { + case 'B': + if (colorUpper.Equals("BISQUE")) return KnownColor.Bisque; + break; + case 'I': + if (colorUpper.Equals("INDIGO")) return KnownColor.Indigo; + break; + case 'M': + if (colorUpper.Equals("MAROON")) return KnownColor.Maroon; + break; + case 'O': + if (colorUpper.Equals("ORANGE")) return KnownColor.Orange; + if (colorUpper.Equals("ORCHID")) return KnownColor.Orchid; + break; + case 'P': + if (colorUpper.Equals("PURPLE")) return KnownColor.Purple; + break; + case 'S': + if (colorUpper.Equals("SALMON")) return KnownColor.Salmon; + if (colorUpper.Equals("SIENNA")) return KnownColor.Sienna; + if (colorUpper.Equals("SILVER")) return KnownColor.Silver; + break; + case 'T': + if (colorUpper.Equals("TOMATO")) return KnownColor.Tomato; + break; + case 'V': + if (colorUpper.Equals("VIOLET")) return KnownColor.Violet; + break; + case 'Y': + if (colorUpper.Equals("YELLOW")) return KnownColor.Yellow; + break; + } + break; + case 7: + switch (colorUpper[0]) { + case 'C': + if (colorUpper.Equals("CRIMSON")) return KnownColor.Crimson; + break; + case 'D': + if (colorUpper.Equals("DARKRED")) return KnownColor.DarkRed; + if (colorUpper.Equals("DIMGRAY")) return KnownColor.DimGray; + break; + case 'F': + if (colorUpper.Equals("FUCHSIA")) return KnownColor.Fuchsia; + break; + case 'H': + if (colorUpper.Equals("HOTPINK")) return KnownColor.HotPink; + break; + case 'M': + if (colorUpper.Equals("MAGENTA")) return KnownColor.Magenta; + break; + case 'O': + if (colorUpper.Equals("OLDLACE")) return KnownColor.OldLace; + break; + case 'S': + if (colorUpper.Equals("SKYBLUE")) return KnownColor.SkyBlue; + break; + case 'T': + if (colorUpper.Equals("THISTLE")) return KnownColor.Thistle; + break; + } + break; + case 8: + switch (colorUpper[0]) { + case 'C': + if (colorUpper.Equals("CORNSILK")) return KnownColor.Cornsilk; + break; + case 'D': + if (colorUpper.Equals("DARKBLUE")) return KnownColor.DarkBlue; + if (colorUpper.Equals("DARKCYAN")) return KnownColor.DarkCyan; + if (colorUpper.Equals("DARKGRAY")) return KnownColor.DarkGray; + if (colorUpper.Equals("DEEPPINK")) return KnownColor.DeepPink; + break; + case 'H': + if (colorUpper.Equals("HONEYDEW")) return KnownColor.Honeydew; + break; + case 'L': + if (colorUpper.Equals("LAVENDER")) return KnownColor.Lavender; + break; + case 'M': + if (colorUpper.Equals("MOCCASIN")) return KnownColor.Moccasin; + break; + case 'S': + if (colorUpper.Equals("SEAGREEN")) return KnownColor.SeaGreen; + if (colorUpper.Equals("SEASHELL")) return KnownColor.SeaShell; + break; + } + break; + case 9: + switch (colorUpper[0]) { + case 'A': + if (colorUpper.Equals("ALICEBLUE")) return KnownColor.AliceBlue; + break; + case 'B': + if (colorUpper.Equals("BURLYWOOD")) return KnownColor.BurlyWood; + break; + case 'C': + if (colorUpper.Equals("CADETBLUE")) return KnownColor.CadetBlue; + if (colorUpper.Equals("CHOCOLATE")) return KnownColor.Chocolate; + break; + case 'D': + if (colorUpper.Equals("DARKGREEN")) return KnownColor.DarkGreen; + if (colorUpper.Equals("DARKKHAKI")) return KnownColor.DarkKhaki; + break; + case 'F': + if (colorUpper.Equals("FIREBRICK")) return KnownColor.Firebrick; + break; + case 'G': + if (colorUpper.Equals("GAINSBORO")) return KnownColor.Gainsboro; + if (colorUpper.Equals("GOLDENROD")) return KnownColor.Goldenrod; + break; + case 'I': + if (colorUpper.Equals("INDIANRED")) return KnownColor.IndianRed; + break; + case 'L': + if (colorUpper.Equals("LAWNGREEN")) return KnownColor.LawnGreen; + if (colorUpper.Equals("LIGHTBLUE")) return KnownColor.LightBlue; + if (colorUpper.Equals("LIGHTCYAN")) return KnownColor.LightCyan; + if (colorUpper.Equals("LIGHTGRAY")) return KnownColor.LightGray; + if (colorUpper.Equals("LIGHTPINK")) return KnownColor.LightPink; + if (colorUpper.Equals("LIMEGREEN")) return KnownColor.LimeGreen; + break; + case 'M': + if (colorUpper.Equals("MINTCREAM")) return KnownColor.MintCream; + if (colorUpper.Equals("MISTYROSE")) return KnownColor.MistyRose; + break; + case 'O': + if (colorUpper.Equals("OLIVEDRAB")) return KnownColor.OliveDrab; + if (colorUpper.Equals("ORANGERED")) return KnownColor.OrangeRed; + break; + case 'P': + if (colorUpper.Equals("PALEGREEN")) return KnownColor.PaleGreen; + if (colorUpper.Equals("PEACHPUFF")) return KnownColor.PeachPuff; + break; + case 'R': + if (colorUpper.Equals("ROSYBROWN")) return KnownColor.RosyBrown; + if (colorUpper.Equals("ROYALBLUE")) return KnownColor.RoyalBlue; + break; + case 'S': + if (colorUpper.Equals("SLATEBLUE")) return KnownColor.SlateBlue; + if (colorUpper.Equals("SLATEGRAY")) return KnownColor.SlateGray; + if (colorUpper.Equals("STEELBLUE")) return KnownColor.SteelBlue; + break; + case 'T': + if (colorUpper.Equals("TURQUOISE")) return KnownColor.Turquoise; + break; + } + break; + case 10: + switch (colorUpper[0]) { + case 'A': + if (colorUpper.Equals("AQUAMARINE")) return KnownColor.Aquamarine; + break; + case 'B': + if (colorUpper.Equals("BLUEVIOLET")) return KnownColor.BlueViolet; + break; + case 'C': + if (colorUpper.Equals("CHARTREUSE")) return KnownColor.Chartreuse; + break; + case 'D': + if (colorUpper.Equals("DARKORANGE")) return KnownColor.DarkOrange; + if (colorUpper.Equals("DARKORCHID")) return KnownColor.DarkOrchid; + if (colorUpper.Equals("DARKSALMON")) return KnownColor.DarkSalmon; + if (colorUpper.Equals("DARKVIOLET")) return KnownColor.DarkViolet; + if (colorUpper.Equals("DODGERBLUE")) return KnownColor.DodgerBlue; + break; + case 'G': + if (colorUpper.Equals("GHOSTWHITE")) return KnownColor.GhostWhite; + break; + case 'L': + if (colorUpper.Equals("LIGHTCORAL")) return KnownColor.LightCoral; + if (colorUpper.Equals("LIGHTGREEN")) return KnownColor.LightGreen; + break; + case 'M': + if (colorUpper.Equals("MEDIUMBLUE")) return KnownColor.MediumBlue; + break; + case 'P': + if (colorUpper.Equals("PAPAYAWHIP")) return KnownColor.PapayaWhip; + if (colorUpper.Equals("POWDERBLUE")) return KnownColor.PowderBlue; + break; + case 'S': + if (colorUpper.Equals("SANDYBROWN")) return KnownColor.SandyBrown; + break; + case 'W': + if (colorUpper.Equals("WHITESMOKE")) return KnownColor.WhiteSmoke; + break; + } + break; + case 11: + switch (colorUpper[0]) { + case 'D': + if (colorUpper.Equals("DARKMAGENTA")) return KnownColor.DarkMagenta; + if (colorUpper.Equals("DEEPSKYBLUE")) return KnownColor.DeepSkyBlue; + break; + case 'F': + if (colorUpper.Equals("FLORALWHITE")) return KnownColor.FloralWhite; + if (colorUpper.Equals("FORESTGREEN")) return KnownColor.ForestGreen; + break; + case 'G': + if (colorUpper.Equals("GREENYELLOW")) return KnownColor.GreenYellow; + break; + case 'L': + if (colorUpper.Equals("LIGHTSALMON")) return KnownColor.LightSalmon; + if (colorUpper.Equals("LIGHTYELLOW")) return KnownColor.LightYellow; + break; + case 'N': + if (colorUpper.Equals("NAVAJOWHITE")) return KnownColor.NavajoWhite; + break; + case 'S': + if (colorUpper.Equals("SADDLEBROWN")) return KnownColor.SaddleBrown; + if (colorUpper.Equals("SPRINGGREEN")) return KnownColor.SpringGreen; + break; + case 'T': + if (colorUpper.Equals("TRANSPARENT")) return KnownColor.Transparent; + break; + case 'Y': + if (colorUpper.Equals("YELLOWGREEN")) return KnownColor.YellowGreen; + break; + } + break; + case 12: + switch (colorUpper[0]) { + case 'A': + if (colorUpper.Equals("ANTIQUEWHITE")) return KnownColor.AntiqueWhite; + break; + case 'D': + if (colorUpper.Equals("DARKSEAGREEN")) return KnownColor.DarkSeaGreen; + break; + case 'L': + if (colorUpper.Equals("LIGHTSKYBLUE")) return KnownColor.LightSkyBlue; + if (colorUpper.Equals("LEMONCHIFFON")) return KnownColor.LemonChiffon; + break; + case 'M': + if (colorUpper.Equals("MEDIUMORCHID")) return KnownColor.MediumOrchid; + if (colorUpper.Equals("MEDIUMPURPLE")) return KnownColor.MediumPurple; + if (colorUpper.Equals("MIDNIGHTBLUE")) return KnownColor.MidnightBlue; + break; + } + break; + case 13: + switch (colorUpper[0]) { + case 'D': + if (colorUpper.Equals("DARKSLATEBLUE")) return KnownColor.DarkSlateBlue; + if (colorUpper.Equals("DARKSLATEGRAY")) return KnownColor.DarkSlateGray; + if (colorUpper.Equals("DARKGOLDENROD")) return KnownColor.DarkGoldenrod; + if (colorUpper.Equals("DARKTURQUOISE")) return KnownColor.DarkTurquoise; + break; + case 'L': + if (colorUpper.Equals("LIGHTSEAGREEN")) return KnownColor.LightSeaGreen; + if (colorUpper.Equals("LAVENDERBLUSH")) return KnownColor.LavenderBlush; + break; + case 'P': + if (colorUpper.Equals("PALEGOLDENROD")) return KnownColor.PaleGoldenrod; + if (colorUpper.Equals("PALETURQUOISE")) return KnownColor.PaleTurquoise; + if (colorUpper.Equals("PALEVIOLETRED")) return KnownColor.PaleVioletRed; + break; + } + break; + case 14: + switch (colorUpper[0]) { + case 'B': + if (colorUpper.Equals("BLANCHEDALMOND")) return KnownColor.BlanchedAlmond; + break; + case 'C': + if (colorUpper.Equals("CORNFLOWERBLUE")) return KnownColor.CornflowerBlue; + break; + case 'D': + if (colorUpper.Equals("DARKOLIVEGREEN")) return KnownColor.DarkOliveGreen; + break; + case 'L': + if (colorUpper.Equals("LIGHTSLATEGRAY")) return KnownColor.LightSlateGray; + if (colorUpper.Equals("LIGHTSTEELBLUE")) return KnownColor.LightSteelBlue; + break; + case 'M': + if (colorUpper.Equals("MEDIUMSEAGREEN")) return KnownColor.MediumSeaGreen; + break; + } + break; + case 15: + if (colorUpper.Equals("MEDIUMSLATEBLUE")) return KnownColor.MediumSlateBlue; + if (colorUpper.Equals("MEDIUMTURQUOISE")) return KnownColor.MediumTurquoise; + if (colorUpper.Equals("MEDIUMVIOLETRED")) return KnownColor.MediumVioletRed; + break; + case 16: + if (colorUpper.Equals("MEDIUMAQUAMARINE")) return KnownColor.MediumAquamarine; + break; + case 17: + if (colorUpper.Equals("MEDIUMSPRINGGREEN")) return KnownColor.MediumSpringGreen; + break; + case 20: + if (colorUpper.Equals("LIGHTGOLDENRODYELLOW")) return KnownColor.LightGoldenrodYellow; + break; + } + } + // colorString was null or not found + return KnownColor.UnknownColor; + } + +#if !PBTCOMPILER + internal static KnownColor ArgbStringToKnownColor(string argbString) + { + string argbUpper = argbString.Trim().ToUpper(System.Globalization.CultureInfo.InvariantCulture); + + KnownColor color; + if (s_knownArgbColors.TryGetValue(argbUpper, out color)) + return color; + + return KnownColor.UnknownColor; + } +#if DEBUG + private static int s_count = 0; +#endif + + private static Dictionary s_solidColorBrushCache = new Dictionary(); + private static Dictionary s_knownArgbColors = new Dictionary(); +#endif + } + +#if !PBTCOMPILER + /// + /// Colors - A collection of well-known Colors + /// + public sealed class Colors + { + #region Constructors + + // Colors only has static members, so it shouldn't be constructable. + private Colors() + { + } + + #endregion Constructors + + #region static Known Colors + + /// + /// Well-known color: AliceBlue + /// + public static Color AliceBlue { + get { + return Color.FromUInt32((uint)KnownColor.AliceBlue); + } + } + + /// + /// Well-known color: AntiqueWhite + /// + public static Color AntiqueWhite { + get { + return Color.FromUInt32((uint)KnownColor.AntiqueWhite); + } + } + + /// + /// Well-known color: Aqua + /// + public static Color Aqua { + get { + return Color.FromUInt32((uint)KnownColor.Aqua); + } + } + + /// + /// Well-known color: Aquamarine + /// + public static Color Aquamarine { + get { + return Color.FromUInt32((uint)KnownColor.Aquamarine); + } + } + + /// + /// Well-known color: Azure + /// + public static Color Azure { + get { + return Color.FromUInt32((uint)KnownColor.Azure); + } + } + + /// + /// Well-known color: Beige + /// + public static Color Beige { + get { + return Color.FromUInt32((uint)KnownColor.Beige); + } + } + + /// + /// Well-known color: Bisque + /// + public static Color Bisque { + get { + return Color.FromUInt32((uint)KnownColor.Bisque); + } + } + + /// + /// Well-known color: Black + /// + public static Color Black { + get { + return Color.FromUInt32((uint)KnownColor.Black); + } + } + + /// + /// Well-known color: BlanchedAlmond + /// + public static Color BlanchedAlmond { + get { + return Color.FromUInt32((uint)KnownColor.BlanchedAlmond); + } + } + + /// + /// Well-known color: Blue + /// + public static Color Blue { + get { + return Color.FromUInt32((uint)KnownColor.Blue); + } + } + + /// + /// Well-known color: BlueViolet + /// + public static Color BlueViolet { + get { + return Color.FromUInt32((uint)KnownColor.BlueViolet); + } + } + + /// + /// Well-known color: Brown + /// + public static Color Brown { + get { + return Color.FromUInt32((uint)KnownColor.Brown); + } + } + + /// + /// Well-known color: BurlyWood + /// + public static Color BurlyWood { + get { + return Color.FromUInt32((uint)KnownColor.BurlyWood); + } + } + + /// + /// Well-known color: CadetBlue + /// + public static Color CadetBlue { + get { + return Color.FromUInt32((uint)KnownColor.CadetBlue); + } + } + + /// + /// Well-known color: Chartreuse + /// + public static Color Chartreuse { + get { + return Color.FromUInt32((uint)KnownColor.Chartreuse); + } + } + + /// + /// Well-known color: Chocolate + /// + public static Color Chocolate { + get { + return Color.FromUInt32((uint)KnownColor.Chocolate); + } + } + + /// + /// Well-known color: Coral + /// + public static Color Coral { + get { + return Color.FromUInt32((uint)KnownColor.Coral); + } + } + + /// + /// Well-known color: CornflowerBlue + /// + public static Color CornflowerBlue { + get { + return Color.FromUInt32((uint)KnownColor.CornflowerBlue); + } + } + + /// + /// Well-known color: Cornsilk + /// + public static Color Cornsilk { + get { + return Color.FromUInt32((uint)KnownColor.Cornsilk); + } + } + + /// + /// Well-known color: Crimson + /// + public static Color Crimson { + get { + return Color.FromUInt32((uint)KnownColor.Crimson); + } + } + + /// + /// Well-known color: Cyan + /// + public static Color Cyan { + get { + return Color.FromUInt32((uint)KnownColor.Cyan); + } + } + + /// + /// Well-known color: DarkBlue + /// + public static Color DarkBlue { + get { + return Color.FromUInt32((uint)KnownColor.DarkBlue); + } + } + + /// + /// Well-known color: DarkCyan + /// + public static Color DarkCyan { + get { + return Color.FromUInt32((uint)KnownColor.DarkCyan); + } + } + + /// + /// Well-known color: DarkGoldenrod + /// + public static Color DarkGoldenrod { + get { + return Color.FromUInt32((uint)KnownColor.DarkGoldenrod); + } + } + + /// + /// Well-known color: DarkGray + /// + public static Color DarkGray { + get { + return Color.FromUInt32((uint)KnownColor.DarkGray); + } + } + + /// + /// Well-known color: DarkGreen + /// + public static Color DarkGreen { + get { + return Color.FromUInt32((uint)KnownColor.DarkGreen); + } + } + + /// + /// Well-known color: DarkKhaki + /// + public static Color DarkKhaki { + get { + return Color.FromUInt32((uint)KnownColor.DarkKhaki); + } + } + + /// + /// Well-known color: DarkMagenta + /// + public static Color DarkMagenta { + get { + return Color.FromUInt32((uint)KnownColor.DarkMagenta); + } + } + + /// + /// Well-known color: DarkOliveGreen + /// + public static Color DarkOliveGreen { + get { + return Color.FromUInt32((uint)KnownColor.DarkOliveGreen); + } + } + + /// + /// Well-known color: DarkOrange + /// + public static Color DarkOrange { + get { + return Color.FromUInt32((uint)KnownColor.DarkOrange); + } + } + + /// + /// Well-known color: DarkOrchid + /// + public static Color DarkOrchid { + get { + return Color.FromUInt32((uint)KnownColor.DarkOrchid); + } + } + + /// + /// Well-known color: DarkRed + /// + public static Color DarkRed { + get { + return Color.FromUInt32((uint)KnownColor.DarkRed); + } + } + + /// + /// Well-known color: DarkSalmon + /// + public static Color DarkSalmon { + get { + return Color.FromUInt32((uint)KnownColor.DarkSalmon); + } + } + + /// + /// Well-known color: DarkSeaGreen + /// + public static Color DarkSeaGreen { + get { + return Color.FromUInt32((uint)KnownColor.DarkSeaGreen); + } + } + + /// + /// Well-known color: DarkSlateBlue + /// + public static Color DarkSlateBlue { + get { + return Color.FromUInt32((uint)KnownColor.DarkSlateBlue); + } + } + + /// + /// Well-known color: DarkSlateGray + /// + public static Color DarkSlateGray { + get { + return Color.FromUInt32((uint)KnownColor.DarkSlateGray); + } + } + + /// + /// Well-known color: DarkTurquoise + /// + public static Color DarkTurquoise { + get { + return Color.FromUInt32((uint)KnownColor.DarkTurquoise); + } + } + + /// + /// Well-known color: DarkViolet + /// + public static Color DarkViolet { + get { + return Color.FromUInt32((uint)KnownColor.DarkViolet); + } + } + + /// + /// Well-known color: DeepPink + /// + public static Color DeepPink { + get { + return Color.FromUInt32((uint)KnownColor.DeepPink); + } + } + + /// + /// Well-known color: DeepSkyBlue + /// + public static Color DeepSkyBlue { + get { + return Color.FromUInt32((uint)KnownColor.DeepSkyBlue); + } + } + + /// + /// Well-known color: DimGray + /// + public static Color DimGray { + get { + return Color.FromUInt32((uint)KnownColor.DimGray); + } + } + + /// + /// Well-known color: DodgerBlue + /// + public static Color DodgerBlue { + get { + return Color.FromUInt32((uint)KnownColor.DodgerBlue); + } + } + + /// + /// Well-known color: Firebrick + /// + public static Color Firebrick { + get { + return Color.FromUInt32((uint)KnownColor.Firebrick); + } + } + + /// + /// Well-known color: FloralWhite + /// + public static Color FloralWhite { + get { + return Color.FromUInt32((uint)KnownColor.FloralWhite); + } + } + + /// + /// Well-known color: ForestGreen + /// + public static Color ForestGreen { + get { + return Color.FromUInt32((uint)KnownColor.ForestGreen); + } + } + + /// + /// Well-known color: Fuchsia + /// + public static Color Fuchsia { + get { + return Color.FromUInt32((uint)KnownColor.Fuchsia); + } + } + + /// + /// Well-known color: Gainsboro + /// + public static Color Gainsboro { + get { + return Color.FromUInt32((uint)KnownColor.Gainsboro); + } + } + + /// + /// Well-known color: GhostWhite + /// + public static Color GhostWhite { + get { + return Color.FromUInt32((uint)KnownColor.GhostWhite); + } + } + + /// + /// Well-known color: Gold + /// + public static Color Gold { + get { + return Color.FromUInt32((uint)KnownColor.Gold); + } + } + + /// + /// Well-known color: Goldenrod + /// + public static Color Goldenrod { + get { + return Color.FromUInt32((uint)KnownColor.Goldenrod); + } + } + + /// + /// Well-known color: Gray + /// + public static Color Gray { + get { + return Color.FromUInt32((uint)KnownColor.Gray); + } + } + + /// + /// Well-known color: Green + /// + public static Color Green { + get { + return Color.FromUInt32((uint)KnownColor.Green); + } + } + + /// + /// Well-known color: GreenYellow + /// + public static Color GreenYellow { + get { + return Color.FromUInt32((uint)KnownColor.GreenYellow); + } + } + + /// + /// Well-known color: Honeydew + /// + public static Color Honeydew { + get { + return Color.FromUInt32((uint)KnownColor.Honeydew); + } + } + + /// + /// Well-known color: HotPink + /// + public static Color HotPink { + get { + return Color.FromUInt32((uint)KnownColor.HotPink); + } + } + + /// + /// Well-known color: IndianRed + /// + public static Color IndianRed { + get { + return Color.FromUInt32((uint)KnownColor.IndianRed); + } + } + + /// + /// Well-known color: Indigo + /// + public static Color Indigo { + get { + return Color.FromUInt32((uint)KnownColor.Indigo); + } + } + + /// + /// Well-known color: Ivory + /// + public static Color Ivory { + get { + return Color.FromUInt32((uint)KnownColor.Ivory); + } + } + + /// + /// Well-known color: Khaki + /// + public static Color Khaki { + get { + return Color.FromUInt32((uint)KnownColor.Khaki); + } + } + + /// + /// Well-known color: Lavender + /// + public static Color Lavender { + get { + return Color.FromUInt32((uint)KnownColor.Lavender); + } + } + + /// + /// Well-known color: LavenderBlush + /// + public static Color LavenderBlush { + get { + return Color.FromUInt32((uint)KnownColor.LavenderBlush); + } + } + + /// + /// Well-known color: LawnGreen + /// + public static Color LawnGreen { + get { + return Color.FromUInt32((uint)KnownColor.LawnGreen); + } + } + + /// + /// Well-known color: LemonChiffon + /// + public static Color LemonChiffon { + get { + return Color.FromUInt32((uint)KnownColor.LemonChiffon); + } + } + + /// + /// Well-known color: LightBlue + /// + public static Color LightBlue { + get { + return Color.FromUInt32((uint)KnownColor.LightBlue); + } + } + + /// + /// Well-known color: LightCoral + /// + public static Color LightCoral { + get { + return Color.FromUInt32((uint)KnownColor.LightCoral); + } + } + + /// + /// Well-known color: LightCyan + /// + public static Color LightCyan { + get { + return Color.FromUInt32((uint)KnownColor.LightCyan); + } + } + + /// + /// Well-known color: LightGoldenrodYellow + /// + public static Color LightGoldenrodYellow { + get { + return Color.FromUInt32((uint)KnownColor.LightGoldenrodYellow); + } + } + + /// + /// Well-known color: LightGray + /// + public static Color LightGray { + get { + return Color.FromUInt32((uint)KnownColor.LightGray); + } + } + + /// + /// Well-known color: LightGreen + /// + public static Color LightGreen { + get { + return Color.FromUInt32((uint)KnownColor.LightGreen); + } + } + + /// + /// Well-known color: LightPink + /// + public static Color LightPink { + get { + return Color.FromUInt32((uint)KnownColor.LightPink); + } + } + + /// + /// Well-known color: LightSalmon + /// + public static Color LightSalmon { + get { + return Color.FromUInt32((uint)KnownColor.LightSalmon); + } + } + + /// + /// Well-known color: LightSeaGreen + /// + public static Color LightSeaGreen { + get { + return Color.FromUInt32((uint)KnownColor.LightSeaGreen); + } + } + + /// + /// Well-known color: LightSkyBlue + /// + public static Color LightSkyBlue { + get { + return Color.FromUInt32((uint)KnownColor.LightSkyBlue); + } + } + + /// + /// Well-known color: LightSlateGray + /// + public static Color LightSlateGray { + get { + return Color.FromUInt32((uint)KnownColor.LightSlateGray); + } + } + + /// + /// Well-known color: LightSteelBlue + /// + public static Color LightSteelBlue { + get { + return Color.FromUInt32((uint)KnownColor.LightSteelBlue); + } + } + + /// + /// Well-known color: LightYellow + /// + public static Color LightYellow { + get { + return Color.FromUInt32((uint)KnownColor.LightYellow); + } + } + + /// + /// Well-known color: Lime + /// + public static Color Lime { + get { + return Color.FromUInt32((uint)KnownColor.Lime); + } + } + + /// + /// Well-known color: LimeGreen + /// + public static Color LimeGreen { + get { + return Color.FromUInt32((uint)KnownColor.LimeGreen); + } + } + + /// + /// Well-known color: Linen + /// + public static Color Linen { + get { + return Color.FromUInt32((uint)KnownColor.Linen); + } + } + + /// + /// Well-known color: Magenta + /// + public static Color Magenta { + get { + return Color.FromUInt32((uint)KnownColor.Magenta); + } + } + + /// + /// Well-known color: Maroon + /// + public static Color Maroon { + get { + return Color.FromUInt32((uint)KnownColor.Maroon); + } + } + + /// + /// Well-known color: MediumAquamarine + /// + public static Color MediumAquamarine { + get { + return Color.FromUInt32((uint)KnownColor.MediumAquamarine); + } + } + + /// + /// Well-known color: MediumBlue + /// + public static Color MediumBlue { + get { + return Color.FromUInt32((uint)KnownColor.MediumBlue); + } + } + + /// + /// Well-known color: MediumOrchid + /// + public static Color MediumOrchid { + get { + return Color.FromUInt32((uint)KnownColor.MediumOrchid); + } + } + + /// + /// Well-known color: MediumPurple + /// + public static Color MediumPurple { + get { + return Color.FromUInt32((uint)KnownColor.MediumPurple); + } + } + + /// + /// Well-known color: MediumSeaGreen + /// + public static Color MediumSeaGreen { + get { + return Color.FromUInt32((uint)KnownColor.MediumSeaGreen); + } + } + + /// + /// Well-known color: MediumSlateBlue + /// + public static Color MediumSlateBlue { + get { + return Color.FromUInt32((uint)KnownColor.MediumSlateBlue); + } + } + + /// + /// Well-known color: MediumSpringGreen + /// + public static Color MediumSpringGreen { + get { + return Color.FromUInt32((uint)KnownColor.MediumSpringGreen); + } + } + + /// + /// Well-known color: MediumTurquoise + /// + public static Color MediumTurquoise { + get { + return Color.FromUInt32((uint)KnownColor.MediumTurquoise); + } + } + + /// + /// Well-known color: MediumVioletRed + /// + public static Color MediumVioletRed { + get { + return Color.FromUInt32((uint)KnownColor.MediumVioletRed); + } + } + + /// + /// Well-known color: MidnightBlue + /// + public static Color MidnightBlue { + get { + return Color.FromUInt32((uint)KnownColor.MidnightBlue); + } + } + + /// + /// Well-known color: MintCream + /// + public static Color MintCream { + get { + return Color.FromUInt32((uint)KnownColor.MintCream); + } + } + + /// + /// Well-known color: MistyRose + /// + public static Color MistyRose { + get { + return Color.FromUInt32((uint)KnownColor.MistyRose); + } + } + + /// + /// Well-known color: Moccasin + /// + public static Color Moccasin { + get { + return Color.FromUInt32((uint)KnownColor.Moccasin); + } + } + + /// + /// Well-known color: NavajoWhite + /// + public static Color NavajoWhite { + get { + return Color.FromUInt32((uint)KnownColor.NavajoWhite); + } + } + + /// + /// Well-known color: Navy + /// + public static Color Navy { + get { + return Color.FromUInt32((uint)KnownColor.Navy); + } + } + + /// + /// Well-known color: OldLace + /// + public static Color OldLace { + get { + return Color.FromUInt32((uint)KnownColor.OldLace); + } + } + + /// + /// Well-known color: Olive + /// + public static Color Olive { + get { + return Color.FromUInt32((uint)KnownColor.Olive); + } + } + + /// + /// Well-known color: OliveDrab + /// + public static Color OliveDrab { + get { + return Color.FromUInt32((uint)KnownColor.OliveDrab); + } + } + + /// + /// Well-known color: Orange + /// + public static Color Orange { + get { + return Color.FromUInt32((uint)KnownColor.Orange); + } + } + + /// + /// Well-known color: OrangeRed + /// + public static Color OrangeRed { + get { + return Color.FromUInt32((uint)KnownColor.OrangeRed); + } + } + + /// + /// Well-known color: Orchid + /// + public static Color Orchid { + get { + return Color.FromUInt32((uint)KnownColor.Orchid); + } + } + + /// + /// Well-known color: PaleGoldenrod + /// + public static Color PaleGoldenrod { + get { + return Color.FromUInt32((uint)KnownColor.PaleGoldenrod); + } + } + + /// + /// Well-known color: PaleGreen + /// + public static Color PaleGreen { + get { + return Color.FromUInt32((uint)KnownColor.PaleGreen); + } + } + + /// + /// Well-known color: PaleTurquoise + /// + public static Color PaleTurquoise { + get { + return Color.FromUInt32((uint)KnownColor.PaleTurquoise); + } + } + + /// + /// Well-known color: PaleVioletRed + /// + public static Color PaleVioletRed { + get { + return Color.FromUInt32((uint)KnownColor.PaleVioletRed); + } + } + + /// + /// Well-known color: PapayaWhip + /// + public static Color PapayaWhip { + get { + return Color.FromUInt32((uint)KnownColor.PapayaWhip); + } + } + + /// + /// Well-known color: PeachPuff + /// + public static Color PeachPuff { + get { + return Color.FromUInt32((uint)KnownColor.PeachPuff); + } + } + + /// + /// Well-known color: Peru + /// + public static Color Peru { + get { + return Color.FromUInt32((uint)KnownColor.Peru); + } + } + + /// + /// Well-known color: Pink + /// + public static Color Pink { + get { + return Color.FromUInt32((uint)KnownColor.Pink); + } + } + + /// + /// Well-known color: Plum + /// + public static Color Plum { + get { + return Color.FromUInt32((uint)KnownColor.Plum); + } + } + + /// + /// Well-known color: PowderBlue + /// + public static Color PowderBlue { + get { + return Color.FromUInt32((uint)KnownColor.PowderBlue); + } + } + + /// + /// Well-known color: Purple + /// + public static Color Purple { + get { + return Color.FromUInt32((uint)KnownColor.Purple); + } + } + + /// + /// Well-known color: Red + /// + public static Color Red { + get { + return Color.FromUInt32((uint)KnownColor.Red); + } + } + + /// + /// Well-known color: RosyBrown + /// + public static Color RosyBrown { + get { + return Color.FromUInt32((uint)KnownColor.RosyBrown); + } + } + + /// + /// Well-known color: RoyalBlue + /// + public static Color RoyalBlue { + get { + return Color.FromUInt32((uint)KnownColor.RoyalBlue); + } + } + + /// + /// Well-known color: SaddleBrown + /// + public static Color SaddleBrown { + get { + return Color.FromUInt32((uint)KnownColor.SaddleBrown); + } + } + + /// + /// Well-known color: Salmon + /// + public static Color Salmon { + get { + return Color.FromUInt32((uint)KnownColor.Salmon); + } + } + + /// + /// Well-known color: SandyBrown + /// + public static Color SandyBrown { + get { + return Color.FromUInt32((uint)KnownColor.SandyBrown); + } + } + + /// + /// Well-known color: SeaGreen + /// + public static Color SeaGreen { + get { + return Color.FromUInt32((uint)KnownColor.SeaGreen); + } + } + + /// + /// Well-known color: SeaShell + /// + public static Color SeaShell { + get { + return Color.FromUInt32((uint)KnownColor.SeaShell); + } + } + + /// + /// Well-known color: Sienna + /// + public static Color Sienna { + get { + return Color.FromUInt32((uint)KnownColor.Sienna); + } + } + + /// + /// Well-known color: Silver + /// + public static Color Silver { + get { + return Color.FromUInt32((uint)KnownColor.Silver); + } + } + + /// + /// Well-known color: SkyBlue + /// + public static Color SkyBlue { + get { + return Color.FromUInt32((uint)KnownColor.SkyBlue); + } + } + + /// + /// Well-known color: SlateBlue + /// + public static Color SlateBlue { + get { + return Color.FromUInt32((uint)KnownColor.SlateBlue); + } + } + + /// + /// Well-known color: SlateGray + /// + public static Color SlateGray { + get { + return Color.FromUInt32((uint)KnownColor.SlateGray); + } + } + + /// + /// Well-known color: Snow + /// + public static Color Snow { + get { + return Color.FromUInt32((uint)KnownColor.Snow); + } + } + + /// + /// Well-known color: SpringGreen + /// + public static Color SpringGreen { + get { + return Color.FromUInt32((uint)KnownColor.SpringGreen); + } + } + + /// + /// Well-known color: SteelBlue + /// + public static Color SteelBlue { + get { + return Color.FromUInt32((uint)KnownColor.SteelBlue); + } + } + + /// + /// Well-known color: Tan + /// + public static Color Tan { + get { + return Color.FromUInt32((uint)KnownColor.Tan); + } + } + + /// + /// Well-known color: Teal + /// + public static Color Teal { + get { + return Color.FromUInt32((uint)KnownColor.Teal); + } + } + + /// + /// Well-known color: Thistle + /// + public static Color Thistle { + get { + return Color.FromUInt32((uint)KnownColor.Thistle); + } + } + + /// + /// Well-known color: Tomato + /// + public static Color Tomato { + get { + return Color.FromUInt32((uint)KnownColor.Tomato); + } + } + + /// + /// Well-known color: Transparent + /// + public static Color Transparent { + get { + return Color.FromUInt32((uint)KnownColor.Transparent); + } + } + + /// + /// Well-known color: Turquoise + /// + public static Color Turquoise { + get { + return Color.FromUInt32((uint)KnownColor.Turquoise); + } + } + + /// + /// Well-known color: Violet + /// + public static Color Violet { + get { + return Color.FromUInt32((uint)KnownColor.Violet); + } + } + + /// + /// Well-known color: Wheat + /// + public static Color Wheat { + get { + return Color.FromUInt32((uint)KnownColor.Wheat); + } + } + + /// + /// Well-known color: White + /// + public static Color White { + get { + return Color.FromUInt32((uint)KnownColor.White); + } + } + + /// + /// Well-known color: WhiteSmoke + /// + public static Color WhiteSmoke { + get { + return Color.FromUInt32((uint)KnownColor.WhiteSmoke); + } + } + + /// + /// Well-known color: Yellow + /// + public static Color Yellow { + get { + return Color.FromUInt32((uint)KnownColor.Yellow); + } + } + + /// + /// Well-known color: YellowGreen + /// + public static Color YellowGreen { + get { + return Color.FromUInt32((uint)KnownColor.YellowGreen); + } + } + + #endregion static Known Colors + } +#endif +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.DashStyle.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.DashStyle.cs new file mode 100644 index 0000000..cb0ef52 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.DashStyle.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace System.Windows.Media +{ + public class DashStyle + { + public double Offset { get; } + public double [] Dashes { get; } + + public DashStyle (IEnumerable dashes, Double offset) + { + Offset = offset; + if (dashes is double [] arr) + Dashes = arr; + else + Dashes = dashes.ToArray (); + } + } +} diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.FillRule.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.FillRule.cs new file mode 100644 index 0000000..3c65882 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.FillRule.cs @@ -0,0 +1,8 @@ +namespace System.Windows.Media +{ + public enum FillRule + { EvenOdd, + Nonzero, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.GeneralTransform.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.GeneralTransform.cs new file mode 100644 index 0000000..57ead83 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.GeneralTransform.cs @@ -0,0 +1,8 @@ +namespace System.Windows.Media +{ + public abstract class GeneralTransform : System.Windows.Media.Animation.Animatable + { public System.Windows.Point Transform(System.Windows.Point param0){throw new System.NotImplementedException();} + public abstract System.Windows.Rect TransformBounds(System.Windows.Rect param0); + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Geometry.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Geometry.cs new file mode 100644 index 0000000..0cd52b8 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Geometry.cs @@ -0,0 +1,17 @@ +namespace System.Windows.Media +{ + public abstract class Geometry : System.Windows.Media.Animation.Animatable + { public abstract System.Boolean IsEmpty(); + + + public static System.Windows.Media.Geometry Parse(System.String param0) { throw new System.NotImplementedException(); } + public System.Windows.Media.IntersectionDetail FillContainsWithDetail(System.Windows.Media.Geometry param0) { throw new System.NotImplementedException(); } + public System.Windows.Media.PathGeometry GetOutlinedPathGeometry() { throw new System.NotImplementedException(); } + + + public System.Windows.Media.Transform Transform { get { throw new System.NotImplementedException(); } set { throw new System.NotImplementedException(); } } + public static System.Windows.Media.Geometry Empty { get; } = new GeometryGroup(); + public virtual System.Windows.Rect Bounds { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryCollection.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryCollection.cs new file mode 100644 index 0000000..c7698b7 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryCollection.cs @@ -0,0 +1,7 @@ +namespace System.Windows.Media +{ + public class GeometryCollection : System.Windows.Media.Animation.Animatable + { public virtual void Add(System.Windows.Media.Geometry param0){throw new System.NotImplementedException();} + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs new file mode 100644 index 0000000..3bfc123 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Linq; + +namespace System.Windows.Media +{ + public class GeometryGroup : System.Windows.Media.Geometry + { + public List Children { get; } = new List(); + + public override Rect Bounds + { + get + { + if (Children.Count == 0) + return Rect.Empty; + var union = Children[0].Bounds; + foreach (var c in Children.Skip(1)) + union.Union(c.Bounds); + return union; + } + } + public override bool IsEmpty() + { + return !Children.Any(c => !c.IsEmpty()); + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.ImageSource.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.ImageSource.cs new file mode 100644 index 0000000..6db3b26 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.ImageSource.cs @@ -0,0 +1,8 @@ +namespace System.Windows.Media +{ + public abstract class ImageSource : System.Windows.Media.Animation.Animatable + { + public abstract System.Double Height { get; } + public abstract System.Double Width { get; } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapImage.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapImage.cs new file mode 100644 index 0000000..2e0796b --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapImage.cs @@ -0,0 +1,15 @@ +namespace System.Windows.Media.Imaging +{ + public class BitmapImage : System.Windows.Media.Imaging.BitmapSource + { public BitmapImage(){} + public virtual void BeginInit(){throw new System.NotImplementedException();} + public virtual void EndInit(){throw new System.NotImplementedException();} + + + public System.IO.Stream StreamSource { set { throw new System.NotImplementedException(); } } + + public override double Height => throw new NotImplementedException(); + + public override double Width => throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapSource.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapSource.cs new file mode 100644 index 0000000..5ea7a9e --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapSource.cs @@ -0,0 +1,5 @@ +namespace System.Windows.Media.Imaging +{ + public abstract class BitmapSource : System.Windows.Media.ImageSource + {} +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.IntersectionDetail.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.IntersectionDetail.cs new file mode 100644 index 0000000..ecf2468 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.IntersectionDetail.cs @@ -0,0 +1,11 @@ +namespace System.Windows.Media +{ + public enum IntersectionDetail + { NotCalculated, + Empty, + FullyInside, + FullyContains, + Intersects, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.PathFigure.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathFigure.cs new file mode 100644 index 0000000..2fa79a9 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathFigure.cs @@ -0,0 +1,14 @@ +namespace System.Windows.Media +{ + public class PathFigure : System.Windows.Media.Animation.Animatable + { public PathFigure(){} + public PathFigure(System.Windows.Point param0, System.Collections.Generic.IEnumerable param1, System.Boolean param2){} + + + + public System.Boolean IsClosed { set { throw new System.NotImplementedException(); } } + public System.Windows.Point StartPoint { set { throw new System.NotImplementedException(); } } + public System.Windows.Media.PathSegmentCollection Segments { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.PathFigureCollection.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathFigureCollection.cs new file mode 100644 index 0000000..670519d --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathFigureCollection.cs @@ -0,0 +1,7 @@ +namespace System.Windows.Media +{ + public class PathFigureCollection : System.Windows.Media.Animation.Animatable + { public virtual void Add(System.Windows.Media.PathFigure param0){throw new System.NotImplementedException();} + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.PathGeometry.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathGeometry.cs new file mode 100644 index 0000000..e60c849 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathGeometry.cs @@ -0,0 +1,17 @@ +namespace System.Windows.Media +{ + public class PathGeometry : System.Windows.Media.Geometry + { public PathGeometry(){} + public PathGeometry(System.Collections.Generic.IEnumerable param0){} + public void AddGeometry(System.Windows.Media.Geometry param0){throw new System.NotImplementedException();} + + public override bool IsEmpty() + { + throw new NotImplementedException(); + } + + public System.Windows.Media.FillRule FillRule { set { throw new System.NotImplementedException(); } } + public System.Windows.Media.PathFigureCollection Figures { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.PathSegment.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathSegment.cs new file mode 100644 index 0000000..b23eabe --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathSegment.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Media +{ + public abstract class PathSegment : System.Windows.Media.Animation.Animatable + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.PathSegmentCollection.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathSegmentCollection.cs new file mode 100644 index 0000000..07af3b2 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.PathSegmentCollection.cs @@ -0,0 +1,7 @@ +namespace System.Windows.Media +{ + public class PathSegmentCollection : System.Windows.Media.Animation.Animatable + { public virtual void Add(System.Windows.Media.PathSegment param0){throw new System.NotImplementedException();} + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Pen.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Pen.cs new file mode 100644 index 0000000..48df6cc --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Pen.cs @@ -0,0 +1,23 @@ +namespace System.Windows.Media +{ + public class Pen : Animation.Animatable + { + public Brush Brush { get; set; } + public double Thickness { get; set; } + public PenLineCap EndLineCap { get; set; } + public PenLineJoin LineJoin { get; set; } + public double MiterLimit { get; set; } + public PenLineCap StartLineCap { get; set; } + public DashStyle DashStyle { get; set; } + + public Pen () { } + + public Pen (Brush brush, double thickness) + { + Thickness = thickness; + Brush = brush; + } + + public new Pen Clone () { throw new NotImplementedException (); } + } +} diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.PenLineCap.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.PenLineCap.cs new file mode 100644 index 0000000..301aec5 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.PenLineCap.cs @@ -0,0 +1,10 @@ +namespace System.Windows.Media +{ + public enum PenLineCap + { Flat, + Square, + Round, + Triangle, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.PenLineJoin.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.PenLineJoin.cs new file mode 100644 index 0000000..6ee6427 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.PenLineJoin.cs @@ -0,0 +1,9 @@ +namespace System.Windows.Media +{ + public enum PenLineJoin + { Miter, + Bevel, + Round, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.RectangleGeometry.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.RectangleGeometry.cs new file mode 100644 index 0000000..cbd4481 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.RectangleGeometry.cs @@ -0,0 +1,18 @@ +namespace System.Windows.Media +{ + public class RectangleGeometry : System.Windows.Media.Geometry + { + public Rect Rectangle; + public RectangleGeometry(Rect rectangle) + { + this.Rectangle = rectangle; + } + + public override Rect Bounds => Rectangle; + + public override bool IsEmpty() + { + return Rectangle.IsEmpty; + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.SolidColorBrush.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.SolidColorBrush.cs new file mode 100644 index 0000000..b26bfa4 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.SolidColorBrush.cs @@ -0,0 +1,14 @@ +namespace System.Windows.Media +{ + public class SolidColorBrush : System.Windows.Media.Brush + { + public SolidColorBrush(System.Windows.Media.Color color) + { + this.Color = color; + } + + public new System.Windows.Media.SolidColorBrush Clone() { return new SolidColorBrush(Color); } + public System.Windows.Media.Color Color { get; set; } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.TextEffectCollection.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.TextEffectCollection.cs new file mode 100644 index 0000000..732e3bb --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.TextEffectCollection.cs @@ -0,0 +1,7 @@ +namespace System.Windows.Media +{ + public class TextEffectCollection : System.Windows.Media.Animation.Animatable + { public TextEffectCollection(){} + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.TextFormatting.TextRunProperties.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.TextFormatting.TextRunProperties.cs new file mode 100644 index 0000000..da49466 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.TextFormatting.TextRunProperties.cs @@ -0,0 +1,34 @@ +//----------------------------------------------------------------------- +// +// Microsoft Windows Client Platform +// Copyright (C) Microsoft Corporation +// +// File: TextRunProperties.cs +// +// Contents: Text run properties +// +// Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc +// +// Created: 1-7-2005 Worachai Chaoweeraprasit (wchao) +// +//------------------------------------------------------------------------ + + +using System; +using System.Globalization; +using System.Windows; + +namespace System.Windows.Media.TextFormatting +{ + /// + /// Properties that can change from one run to the next, such as typeface or foreground brush. + /// + /// + /// The client provides a concrete implementation of this abstract run properties class. This + /// allows client to implement their run properties the way that fits with their run formatting + /// store. + /// + public abstract class TextRunProperties + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Transform.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Transform.cs new file mode 100644 index 0000000..3cc4852 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Transform.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Media +{ + public abstract class Transform : System.Windows.Media.GeneralTransform + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Media.Typeface.cs b/src/Editor/FPF/PresentationCore/System.Windows.Media.Typeface.cs new file mode 100644 index 0000000..e1a3eef --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Media.Typeface.cs @@ -0,0 +1,9 @@ +namespace System.Windows.Media +{ + public class Typeface : System.Object + { + public System.Windows.FontStyle Style { get; set; } + public System.Windows.FontWeight Weight { get; set; } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.QueryContinueDragEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.QueryContinueDragEventArgs.cs new file mode 100644 index 0000000..bd90c9c --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.QueryContinueDragEventArgs.cs @@ -0,0 +1,10 @@ +namespace System.Windows +{ + public class QueryContinueDragEventArgs : System.Windows.RoutedEventArgs + { + + + public System.Boolean EscapePressed { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.RoutedEvent.cs b/src/Editor/FPF/PresentationCore/System.Windows.RoutedEvent.cs new file mode 100644 index 0000000..a685cc5 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.RoutedEvent.cs @@ -0,0 +1,6 @@ +namespace System.Windows +{ + public class RoutedEvent : System.Object + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.RoutedEventArgs.cs b/src/Editor/FPF/PresentationCore/System.Windows.RoutedEventArgs.cs new file mode 100644 index 0000000..8325f4e --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.RoutedEventArgs.cs @@ -0,0 +1,15 @@ +namespace System.Windows +{ + public class RoutedEventArgs : System.EventArgs + { + + + + + public System.Boolean Handled { get { throw new System.NotImplementedException(); } set { throw new System.NotImplementedException(); } } + public System.Object OriginalSource { get { throw new System.NotImplementedException(); } } + public System.Object Source { get { throw new System.NotImplementedException(); } } + public System.Windows.RoutedEvent RoutedEvent { set { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.TextDataFormat.cs b/src/Editor/FPF/PresentationCore/System.Windows.TextDataFormat.cs new file mode 100644 index 0000000..f7313e2 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.TextDataFormat.cs @@ -0,0 +1,12 @@ +namespace System.Windows +{ + public enum TextDataFormat + { Text, + UnicodeText, + Rtf, + Html, + CommaSeparatedValue, + Xaml, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.TextDecorationCollection.cs b/src/Editor/FPF/PresentationCore/System.Windows.TextDecorationCollection.cs new file mode 100644 index 0000000..8eab60f --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.TextDecorationCollection.cs @@ -0,0 +1,68 @@ +using System.Collections; +using System.Collections.Generic; +using System.Windows.Media; +using System.Windows.Media.Animation; + +namespace System.Windows +{ + public static class TextDecorations + { + public static TextDecoration Baseline { get; } = new TextDecoration(); + public static TextDecoration Overline { get; } = new TextDecoration(); + public static TextDecoration Strikethrough { get; } = new TextDecoration(); + public static TextDecoration Underline { get; } = new TextDecoration(); + } + + public sealed class TextDecoration : Animatable + { + public Pen Pen { get; set; } + } + + public sealed class TextDecorationCollection : Animatable, IList + { + readonly List textDecorations = new List(); + + public TextDecoration this[int index] + { + get => textDecorations[index]; + set => textDecorations[index] = value; + } + + public int Count => textDecorations.Count; + + public bool IsReadOnly => false; + + public void Add(IEnumerable textDecorations) + => this.textDecorations.AddRange(textDecorations); + + public void Add(TextDecoration textDecoration) + => this.textDecorations.Add(textDecoration); + + public void Clear() + => textDecorations.Clear(); + + public bool Contains(TextDecoration item) + => textDecorations.Contains(item); + + public void CopyTo(TextDecoration[] array, int arrayIndex) + => textDecorations.CopyTo(array, arrayIndex); + + public int IndexOf(TextDecoration item) + => textDecorations.IndexOf(item); + + public void Insert(int index, TextDecoration item) + => textDecorations.Insert(index, item); + + public bool Remove(TextDecoration item) + => textDecorations.Remove(item); + + public void RemoveAt(int index) + => textDecorations.RemoveAt(index); + + public IEnumerator GetEnumerator() + => ((IList)textDecorations).GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => ((IList)textDecorations).GetEnumerator(); + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationCore/System.Windows.Visibility.cs b/src/Editor/FPF/PresentationCore/System.Windows.Visibility.cs new file mode 100644 index 0000000..bb4de51 --- /dev/null +++ b/src/Editor/FPF/PresentationCore/System.Windows.Visibility.cs @@ -0,0 +1,9 @@ +namespace System.Windows +{ + public enum Visibility + { Visible, + Hidden, + Collapsed, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationFramework/PresentationFramework.csproj b/src/Editor/FPF/PresentationFramework/PresentationFramework.csproj new file mode 100644 index 0000000..10e9077 --- /dev/null +++ b/src/Editor/FPF/PresentationFramework/PresentationFramework.csproj @@ -0,0 +1,9 @@ + + + $(TargetFramework) + + + + + + \ No newline at end of file diff --git a/src/Editor/FPF/PresentationFramework/Properties/AssemblyInfo.cs b/src/Editor/FPF/PresentationFramework/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ca0bd7d --- /dev/null +++ b/src/Editor/FPF/PresentationFramework/Properties/AssemblyInfo.cs @@ -0,0 +1,5 @@ +using System; +using System.Reflection; + +[assembly: CLSCompliant(true)] +[assembly: AssemblyVersion("4.0.0.0")] \ No newline at end of file diff --git a/src/Editor/FPF/PresentationFramework/System.Windows.ResourceDictionary.cs b/src/Editor/FPF/PresentationFramework/System.Windows.ResourceDictionary.cs new file mode 100644 index 0000000..6444913 --- /dev/null +++ b/src/Editor/FPF/PresentationFramework/System.Windows.ResourceDictionary.cs @@ -0,0 +1,101 @@ +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.Linq; + +namespace System.Windows +{ + public class ResourceDictionary : System.Object, IDictionary + { + public System.Boolean Contains(System.Object param0) { + if (innerDictionary.ContainsKey (param0)) + return true; + if (_mergedDictionaries != null) { + for (int i = MergedDictionaries.Count - 1; i >= 0; i--) { + var mergedDictionary = MergedDictionaries[i]; + if (mergedDictionary != null && mergedDictionary.Contains(param0)) + return true; + } + } + return false; + } + + public ResourceDictionary() { } + public void Add(System.Object param0, System.Object param1) { innerDictionary[param0] = param1; } + + public void Clear() + { + innerDictionary.Clear(); + } + + public IDictionaryEnumerator GetEnumerator() + { + throw new NotImplementedException(); + } + + public void Remove(object key) + { + innerDictionary.Remove(key); + } + + public void CopyTo(Array array, int index) + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return innerDictionary.GetEnumerator(); + } + + private ObservableCollection _mergedDictionaries = null; + public System.Collections.ObjectModel.Collection MergedDictionaries { + get { + if (_mergedDictionaries == null) { + _mergedDictionaries = new ObservableCollection(); + } + return _mergedDictionaries; + } + } + + public bool IsFixedSize => throw new NotImplementedException(); + + public bool IsReadOnly => throw new NotImplementedException(); + + public ICollection Keys => innerDictionary.Keys; + + public ICollection Values => innerDictionary.Values; + + public int Count => throw new NotImplementedException(); + + public bool IsSynchronized => throw new NotImplementedException(); + + public object SyncRoot => throw new NotImplementedException(); + + public bool HasImplicitDataTemplates { get; set; } + public bool HasImplicitStyles { get; private set; } + public bool IsThemeDictionary { get; private set; } + public bool IsInitialized { get; private set; } + public bool InvalidatesImplicitDataTemplateResources { get; private set; } + + Dictionary innerDictionary = new Dictionary(); + + public object this[object key] { + get { + if (innerDictionary.TryGetValue(key, out var val)) + return val; + for (int i = MergedDictionaries.Count - 1; i >= 0; i--) + { + var merged = MergedDictionaries [i]; + val = merged [key]; + if (val != null) + return val; + } + + return null; + } + set { innerDictionary[key] = value; } + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationFramework/System.Windows.ResourceDictionaryLocation.cs b/src/Editor/FPF/PresentationFramework/System.Windows.ResourceDictionaryLocation.cs new file mode 100644 index 0000000..b471f0d --- /dev/null +++ b/src/Editor/FPF/PresentationFramework/System.Windows.ResourceDictionaryLocation.cs @@ -0,0 +1,9 @@ +namespace System.Windows +{ + public enum ResourceDictionaryLocation + { None, + SourceAssembly, + ExternalAssembly, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationFramework/System.Windows.SystemColors.cs b/src/Editor/FPF/PresentationFramework/System.Windows.SystemColors.cs new file mode 100644 index 0000000..a6adb3d --- /dev/null +++ b/src/Editor/FPF/PresentationFramework/System.Windows.SystemColors.cs @@ -0,0 +1,30 @@ +namespace System.Windows +{ + public abstract class SystemColors : System.Object + { + static System.Windows.Media.Color pinkColor = new Media.Color { + R = 255, G = 192, B = 203, A = 255 + }; + public static System.Windows.Media.Color ControlColor { get { return pinkColor; } } + public static System.Windows.Media.Color ControlTextColor { get { return pinkColor; } } + public static System.Windows.Media.Color GrayTextColor { get { return pinkColor; } } + public static System.Windows.Media.Color HighlightColor { get { return pinkColor; } } + public static System.Windows.Media.Color HighlightTextColor { get { return pinkColor; } } + public static System.Windows.Media.SolidColorBrush ActiveBorderBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush ActiveCaptionBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush ControlBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush ControlDarkBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush ControlLightBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush ControlLightLightBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush GrayTextBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush HighlightBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush HotTrackBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush InfoBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush InfoTextBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush WindowBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush WindowFrameBrush { get { return new Media.SolidColorBrush(pinkColor); } } + public static System.Windows.Media.SolidColorBrush WindowTextBrush { + get { return new Windows.Media.SolidColorBrush(new Media.Color { R = 0, G = 0, B = 0, A = 255 }); } + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationFramework/System.Windows.SystemParameters.cs b/src/Editor/FPF/PresentationFramework/System.Windows.SystemParameters.cs new file mode 100644 index 0000000..f24e07b --- /dev/null +++ b/src/Editor/FPF/PresentationFramework/System.Windows.SystemParameters.cs @@ -0,0 +1,25 @@ +namespace System.Windows +{ + public abstract class SystemParameters : System.Object + { + + + + + + + + + + + public static System.Boolean HighContrast { get { return false; } } + public static System.Boolean IsMenuDropRightAligned { get { throw new System.NotImplementedException(); } } + public static System.Boolean MenuDropAlignment { get { throw new System.NotImplementedException(); } } + public static System.Double MinimumHorizontalDragDistance { get { return 5; } } + public static System.Double MinimumVerticalDragDistance { get { return 5; } } + public static System.Double PrimaryScreenHeight { get { throw new System.NotImplementedException(); } } + public static System.Double PrimaryScreenWidth { get { throw new System.NotImplementedException(); } } + public static System.Int32 WheelScrollLines { get { throw new System.NotImplementedException(); } } + public static System.Windows.Rect WorkArea { get { throw new System.NotImplementedException(); } } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationFramework/System.Windows.ThemeInfoAttribute.cs b/src/Editor/FPF/PresentationFramework/System.Windows.ThemeInfoAttribute.cs new file mode 100644 index 0000000..2b6a550 --- /dev/null +++ b/src/Editor/FPF/PresentationFramework/System.Windows.ThemeInfoAttribute.cs @@ -0,0 +1,7 @@ +namespace System.Windows +{ + public class ThemeInfoAttribute : System.Attribute + { public ThemeInfoAttribute(System.Windows.ResourceDictionaryLocation param0, System.Windows.ResourceDictionaryLocation param1){} + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/PresentationFramework/System.Windows.Thickness.cs b/src/Editor/FPF/PresentationFramework/System.Windows.Thickness.cs new file mode 100644 index 0000000..bd7be9b --- /dev/null +++ b/src/Editor/FPF/PresentationFramework/System.Windows.Thickness.cs @@ -0,0 +1,215 @@ +//--------------------------------------------------------------------------- +// +// Copyright (C) Microsoft Corporation. All rights reserved. +// +// File: Thickness.cs +// +// Description: Contains the Thickness (double x4) value type. +// +// History: +// 06/02/2003 : greglett - created. +// +//--------------------------------------------------------------------------- + +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows +{ + /// + /// Thickness is a value type used to describe the thickness of frame around a rectangle. + /// It contains four doubles each corresponding to a side: Left, Top, Right, Bottom. + /// + public struct Thickness : IEquatable + { + //------------------------------------------------------------------- + // + // Constructors + // + //------------------------------------------------------------------- + + #region Constructors + /// + /// This constructur builds a Thickness with a specified value on every side. + /// + /// The specified uniform length. + public Thickness(double uniformLength) + { + _Left = _Top = _Right = _Bottom = uniformLength; + } + + /// + /// This constructor builds a Thickness with the specified number of pixels on each side. + /// + /// The thickness for the left side. + /// The thickness for the top side. + /// The thickness for the right side. + /// The thickness for the bottom side. + public Thickness(double left, double top, double right, double bottom) + { + _Left = left; + _Top = top; + _Right = right; + _Bottom = bottom; + } + + + #endregion + + + //------------------------------------------------------------------- + // + // Public Methods + // + //------------------------------------------------------------------- + + #region Public Methods + + /// + /// This function compares to the provided object for type and value equality. + /// + /// Object to compare + /// True if object is a Thickness and all sides of it are equal to this Thickness'. + public override bool Equals(object obj) + { + if (obj is Thickness) + { + Thickness otherObj = (Thickness)obj; + return (this == otherObj); + } + return (false); + } + + /// + /// Compares this instance of Thickness with another instance. + /// + /// Thickness instance to compare. + /// trueif this Thickness instance has the same value + /// and unit type as thickness. + public bool Equals(Thickness thickness) + { + return (this == thickness); + } + + /// + /// This function returns a hash code. + /// + /// Hash code + public override int GetHashCode() + { + return _Left.GetHashCode() ^ _Top.GetHashCode() ^ _Right.GetHashCode() ^ _Bottom.GetHashCode(); + } + + #endregion + + + //------------------------------------------------------------------- + // + // Public Operators + // + //------------------------------------------------------------------- + + #region Public Operators + + /// + /// Overloaded operator to compare two Thicknesses for equality. + /// + /// first Thickness to compare + /// second Thickness to compare + /// True if all sides of the Thickness are equal, false otherwise + // SEEALSO + public static bool operator ==(Thickness t1, Thickness t2) + { + return ((t1._Left == t2._Left || (double.IsNaN(t1._Left) && double.IsNaN(t2._Left))) + && (t1._Top == t2._Top || (double.IsNaN(t1._Top) && double.IsNaN(t2._Top))) + && (t1._Right == t2._Right || (double.IsNaN(t1._Right) && double.IsNaN(t2._Right))) + && (t1._Bottom == t2._Bottom || (double.IsNaN(t1._Bottom) && double.IsNaN(t2._Bottom))) + ); + } + + /// + /// Overloaded operator to compare two Thicknesses for inequality. + /// + /// first Thickness to compare + /// second Thickness to compare + /// False if all sides of the Thickness are equal, true otherwise + // SEEALSO + public static bool operator !=(Thickness t1, Thickness t2) + { + return (!(t1 == t2)); + } + + #endregion + + + //------------------------------------------------------------------- + // + // Public Properties + // + //------------------------------------------------------------------- + + #region Public Properties + + /// This property is the Length on the thickness' left side + public double Left + { + get { return _Left; } + set { _Left = value; } + } + + /// This property is the Length on the thickness' top side + public double Top + { + get { return _Top; } + set { _Top = value; } + } + + /// This property is the Length on the thickness' right side + public double Right + { + get { return _Right; } + set { _Right = value; } + } + + /// This property is the Length on the thickness' bottom side + public double Bottom + { + get { return _Bottom; } + set { _Bottom = value; } + } + #endregion + + //------------------------------------------------------------------- + // + // INternal API + // + //------------------------------------------------------------------- + + #region Internal API + + internal Size Size + { + get + { + return new Size(_Left + _Right, _Top + _Bottom); + } + } + + #endregion + + //------------------------------------------------------------------- + // + // Private Fields + // + //------------------------------------------------------------------- + + #region Private Fields + + private double _Left; + private double _Top; + private double _Right; + private double _Bottom; + + #endregion + } +} \ No newline at end of file diff --git a/src/Editor/FPF/README.md b/src/Editor/FPF/README.md new file mode 100644 index 0000000..0ea55f0 --- /dev/null +++ b/src/Editor/FPF/README.md @@ -0,0 +1,19 @@ +# FPF: Fake Presentation Foundation + +FPF stubs just enough of the WPF APIs that the editor depends on. Notably +we require some primitives such as `Color`, `Brush`, `Point`, etc. This is +a very minimal approach to bootstrap the editor on macOS, and over time we +anticipate eliminating this support layer entirely. + +For `WindowsBase`, we have simply imported a subset of +[Mono's version][mwb] and made changes to the `Dispatcher` to use macOS' +[Grand Central Dispatch][gcd], since the editor uses this extensively, +we wanted it to be highly performant. + +For the other assemblies we generated necessary stubs and filled in the +basic primitives. + +FPF depends on Xamarin.Mac to build at this point. + +[mwb]: https://github.com/mono/mono/tree/master/mcs/class/WindowsBase +[gcd]: https://developer.apple.com/documentation/dispatch \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationClient/Properties/AssemblyInfo.cs b/src/Editor/FPF/UIAutomationClient/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ca0bd7d --- /dev/null +++ b/src/Editor/FPF/UIAutomationClient/Properties/AssemblyInfo.cs @@ -0,0 +1,5 @@ +using System; +using System.Reflection; + +[assembly: CLSCompliant(true)] +[assembly: AssemblyVersion("4.0.0.0")] \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationClient/System.Windows.Automation.AutomationElement.cs b/src/Editor/FPF/UIAutomationClient/System.Windows.Automation.AutomationElement.cs new file mode 100644 index 0000000..83e0cfc --- /dev/null +++ b/src/Editor/FPF/UIAutomationClient/System.Windows.Automation.AutomationElement.cs @@ -0,0 +1,7 @@ +namespace System.Windows.Automation +{ + public class AutomationElement : System.Object + { public static System.Object NotSupported; + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationClient/System.Windows.Automation.TextPattern.cs b/src/Editor/FPF/UIAutomationClient/System.Windows.Automation.TextPattern.cs new file mode 100644 index 0000000..624a50a --- /dev/null +++ b/src/Editor/FPF/UIAutomationClient/System.Windows.Automation.TextPattern.cs @@ -0,0 +1,15 @@ +namespace System.Windows.Automation +{ + public class TextPattern + { public static System.Object MixedAttributeValue; + public static System.Windows.Automation.AutomationTextAttribute BackgroundColorAttribute; + public static System.Windows.Automation.AutomationTextAttribute CultureAttribute; + public static System.Windows.Automation.AutomationTextAttribute FontNameAttribute; + public static System.Windows.Automation.AutomationTextAttribute FontSizeAttribute; + public static System.Windows.Automation.AutomationTextAttribute FontWeightAttribute; + public static System.Windows.Automation.AutomationTextAttribute ForegroundColorAttribute; + public static System.Windows.Automation.AutomationTextAttribute IsItalicAttribute; + public static System.Windows.Automation.AutomationTextAttribute IsReadOnlyAttribute; + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationClient/UIAutomationClient.csproj b/src/Editor/FPF/UIAutomationClient/UIAutomationClient.csproj new file mode 100644 index 0000000..e179f75 --- /dev/null +++ b/src/Editor/FPF/UIAutomationClient/UIAutomationClient.csproj @@ -0,0 +1,8 @@ + + + $(TargetFramework) + + + + + \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/Properties/AssemblyInfo.cs b/src/Editor/FPF/UIAutomationProvider/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ca0bd7d --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/Properties/AssemblyInfo.cs @@ -0,0 +1,5 @@ +using System; +using System.Reflection; + +[assembly: CLSCompliant(true)] +[assembly: AssemblyVersion("4.0.0.0")] \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.AutomationInteropProvider.cs b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.AutomationInteropProvider.cs new file mode 100644 index 0000000..399ba9d --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.AutomationInteropProvider.cs @@ -0,0 +1,8 @@ +namespace System.Windows.Automation.Provider +{ + public abstract class AutomationInteropProvider : System.Object + { + public static System.Boolean ClientsAreListening { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IRawElementProviderSimple.cs b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IRawElementProviderSimple.cs new file mode 100644 index 0000000..2292ca2 --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IRawElementProviderSimple.cs @@ -0,0 +1,7 @@ +namespace System.Windows.Automation.Provider +{ + public interface IRawElementProviderSimple + { System.Object GetPropertyValue(System.Int32 param0); + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionItemProvider.cs b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionItemProvider.cs new file mode 100644 index 0000000..12bc0e0 --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionItemProvider.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Automation.Provider +{ + public interface ISelectionItemProvider + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionProvider.cs b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionProvider.cs new file mode 100644 index 0000000..0ecbb29 --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionProvider.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Automation.Provider +{ + public interface ISelectionProvider + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextProvider.cs b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextProvider.cs new file mode 100644 index 0000000..2e8068b --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextProvider.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Automation.Provider +{ + public interface ITextProvider + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextRangeProvider.cs b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextRangeProvider.cs new file mode 100644 index 0000000..869918b --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextRangeProvider.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Automation.Provider +{ + public interface ITextRangeProvider + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IValueProvider.cs b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IValueProvider.cs new file mode 100644 index 0000000..e31790e --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IValueProvider.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Automation.Provider +{ + public interface IValueProvider + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationProvider/UIAutomationProvider.csproj b/src/Editor/FPF/UIAutomationProvider/UIAutomationProvider.csproj new file mode 100644 index 0000000..e6e8e6b --- /dev/null +++ b/src/Editor/FPF/UIAutomationProvider/UIAutomationProvider.csproj @@ -0,0 +1,5 @@ + + + $(TargetFramework) + + \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/Properties/AssemblyInfo.cs b/src/Editor/FPF/UIAutomationTypes/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ca0bd7d --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/Properties/AssemblyInfo.cs @@ -0,0 +1,5 @@ +using System; +using System.Reflection; + +[assembly: CLSCompliant(true)] +[assembly: AssemblyVersion("4.0.0.0")] \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationElementIdentifiers.cs b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationElementIdentifiers.cs new file mode 100644 index 0000000..d55027f --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationElementIdentifiers.cs @@ -0,0 +1,7 @@ +namespace System.Windows.Automation +{ + public abstract class AutomationElementIdentifiers : System.Object + { public static System.Windows.Automation.AutomationProperty BoundingRectangleProperty; + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationIdentifier.cs b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationIdentifier.cs new file mode 100644 index 0000000..c5e2017 --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationIdentifier.cs @@ -0,0 +1,8 @@ +namespace System.Windows.Automation +{ + public class AutomationIdentifier : System.Object + { + public System.Int32 Id { get { throw new System.NotImplementedException(); } } + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationProperty.cs b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationProperty.cs new file mode 100644 index 0000000..e477d8e --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationProperty.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Automation +{ + public class AutomationProperty : System.Windows.Automation.AutomationIdentifier + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationTextAttribute.cs b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationTextAttribute.cs new file mode 100644 index 0000000..6aaa162 --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.AutomationTextAttribute.cs @@ -0,0 +1,6 @@ +namespace System.Windows.Automation +{ + public class AutomationTextAttribute : System.Windows.Automation.AutomationIdentifier + { + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.SelectionItemPatternIdentifiers.cs b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.SelectionItemPatternIdentifiers.cs new file mode 100644 index 0000000..b12dd05 --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.SelectionItemPatternIdentifiers.cs @@ -0,0 +1,7 @@ +namespace System.Windows.Automation +{ + public abstract class SelectionItemPatternIdentifiers : System.Object + { public static System.Windows.Automation.AutomationProperty IsSelectedProperty; + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.SupportedTextSelection.cs b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.SupportedTextSelection.cs new file mode 100644 index 0000000..d2c7bd7 --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.SupportedTextSelection.cs @@ -0,0 +1,9 @@ +namespace System.Windows.Automation +{ + public enum SupportedTextSelection + { None, + Single, + Multiple, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextPatternRangeEndpoint.cs b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextPatternRangeEndpoint.cs new file mode 100644 index 0000000..81745f2 --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextPatternRangeEndpoint.cs @@ -0,0 +1,8 @@ +namespace System.Windows.Automation.Text +{ + public enum TextPatternRangeEndpoint + { Start, + End, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextUnit.cs b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextUnit.cs new file mode 100644 index 0000000..b3ac854 --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextUnit.cs @@ -0,0 +1,13 @@ +namespace System.Windows.Automation.Text +{ + public enum TextUnit + { Character, + Format, + Word, + Line, + Paragraph, + Page, + Document, + + } +} \ No newline at end of file diff --git a/src/Editor/FPF/UIAutomationTypes/UIAutomationTypes.csproj b/src/Editor/FPF/UIAutomationTypes/UIAutomationTypes.csproj new file mode 100644 index 0000000..e6e8e6b --- /dev/null +++ b/src/Editor/FPF/UIAutomationTypes/UIAutomationTypes.csproj @@ -0,0 +1,5 @@ + + + $(TargetFramework) + + \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/Assembly/AssemblyInfo.cs b/src/Editor/FPF/WindowsBase/Assembly/AssemblyInfo.cs new file mode 100644 index 0000000..0e831d2 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/Assembly/AssemblyInfo.cs @@ -0,0 +1,81 @@ +// +// AssemblyInfo.cs +// +// Author: +// Andreas Nahr (ClassDevelopment@A-SoftTech.com) +// +// (C) 2003 Ximian, Inc. http://www.ximian.com +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System; +using System.Reflection; +using System.Resources; +using System.Security; +using System.Security.Permissions; +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows.Markup; + +[assembly: AssemblyCompany (Consts.MonoCompany)] +[assembly: AssemblyProduct (Consts.MonoProduct)] +[assembly: AssemblyCopyright (Consts.MonoCopyright)] +[assembly: AssemblyVersion (Consts.FxVersion)] +[assembly: AssemblyFileVersion (Consts.FxFileVersion)] + +[assembly: NeutralResourcesLanguage ("en")] +[assembly: CLSCompliant (true)] +[assembly: AssemblyDelaySign (true)] + +[assembly: ComVisible (false)] +[assembly: AllowPartiallyTrustedCallers] + +[assembly: SecurityCritical] + +[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/xps/2005/06", "metro")] +[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "wpf")] +[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "av")] + +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows.Media")] +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows.Input")] +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows")] + +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml", "System.Windows.Markup")] + +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Media")] +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Input")] +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows")] +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Diagnostics")] + +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/composite-font", "System.Windows.Media")] + +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows.Media")] +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows.Input")] +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows")] +[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Diagnostics")] + +#if !MOBILE +[assembly: TypeForwardedTo (typeof (ValueSerializerAttribute))] +#endif + diff --git a/src/Editor/FPF/WindowsBase/Consts.cs b/src/Editor/FPF/WindowsBase/Consts.cs new file mode 100644 index 0000000..c901887 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/Consts.cs @@ -0,0 +1,125 @@ +// +// Consts.cs.in +// +// Author: +// Kornél Pál +// +// Copyright (C) 2005-2006 Kornél Pál +// + +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +static class Consts +{ + // + // Use these assembly version constants to make code more maintainable. + // + + public const string MonoVersion = "@MONO_VERSION@"; + public const string MonoCompany = "Mono development team"; + public const string MonoProduct = "Mono Common Language Infrastructure"; + public const string MonoCopyright = "(c) Various Mono authors"; + public const int MonoCorlibVersion = 0; + +#if MOBILE + // Versions of .NET Framework for Silverlight 4.0 + public const string FxVersion = "2.0.5.0"; + public const string VsVersion = "9.0.0.0"; // unused, but needed for compilation + public const string FxFileVersion = "4.0.50524.0"; + public const string EnvironmentVersion = FxFileVersion; + + public const string VsFileVersion = "9.0.50727.42"; // unused, but needed for compilation +#elif NET_4_6 + public const string FxVersion = "4.0.0.0"; + public const string FxFileVersion = "4.6.57.0"; + public const string EnvironmentVersion = "4.0.30319.42000"; + + public const string VsVersion = "0.0.0.0"; // Useless ? + public const string VsFileVersion = "11.0.0.0"; // TODO: +#elif NET_4_5 + public const string FxVersion = "4.0.0.0"; + public const string FxFileVersion = "4.0.30319.17020"; + public const string EnvironmentVersion = FxFileVersion; + + public const string VsVersion = "0.0.0.0"; // Useless ? + public const string VsFileVersion = "11.0.0.0"; // TODO: +#elif NET_4_0 + #error Profile NET_4_0 is not supported. +#elif NET_3_5 + #error Profile NET_3_5 is not supported. +#elif NET_3_0 + #error Profile NET_3_0 is not supported. +#elif NET_2_0 + #error Profile NET_2_0 is not supported. +#elif NET_1_1 + #error Profile NET_1_1 is not supported. +#elif NET_1_0 + #error Profile NET_1_0 is not supported. +#else +#error No profile symbols defined. +#endif + +#if MOBILE + const string PublicKeyToken = "7cec85d7bea7798e"; +#else + const string PublicKeyToken = "b77a5c561934e089"; +#endif + + // + // Use these assembly name constants to make code more maintainable. + // + + public const string AssemblyI18N = "I18N, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; + public const string AssemblyMicrosoft_JScript = "Microsoft.JScript, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblyMicrosoft_VisualStudio = "Microsoft.VisualStudio, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblyMicrosoft_VisualStudio_Web = "Microsoft.VisualStudio.Web, Version=" + VsVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblyMicrosoft_VSDesigner = "Microsoft.VSDesigner, Version=" + VsVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblyMono_Http = "Mono.Http, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; + public const string AssemblyMono_Posix = "Mono.Posix, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; + public const string AssemblyMono_Security = "Mono.Security, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; + public const string AssemblyMono_Messaging_RabbitMQ = "Mono.Messaging.RabbitMQ, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; + public const string AssemblyCorlib = "mscorlib, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=" + PublicKeyToken; + public const string AssemblySystem = "System, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; + public const string AssemblySystem_Data = "System.Data, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; + public const string AssemblySystem_Design = "System.Design, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblySystem_DirectoryServices = "System.DirectoryServices, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblySystem_Drawing = "System.Drawing, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblySystem_Drawing_Design = "System.Drawing.Design, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblySystem_Messaging = "System.Messaging, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblySystem_Security = "System.Security, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblySystem_ServiceProcess = "System.ServiceProcess, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblySystem_Web = "System.Web, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; + public const string AssemblySystem_Windows_Forms = "System.Windows.Forms, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; +#if NET_4_0 + public const string AssemblySystem_2_0 = "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + public const string AssemblySystemCore_3_5 = "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; + public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; + public const string WindowsBase_3_0 = "WindowsBase, Version=3.0.0.0, PublicKeyToken=31bf3856ad364e35"; + public const string AssemblyWindowsBase = "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + public const string AssemblyPresentationCore_3_5 = "PresentationCore, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + public const string AssemblyPresentationCore_4_0 = "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + public const string AssemblyPresentationFramework_3_5 = "PresentationFramework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; + public const string AssemblySystemServiceModel_3_0 = "System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; +#elif MOBILE + public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; +#endif +} diff --git a/src/Editor/FPF/WindowsBase/MonoTODOAttribute.cs b/src/Editor/FPF/WindowsBase/MonoTODOAttribute.cs new file mode 100644 index 0000000..33bf695 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/MonoTODOAttribute.cs @@ -0,0 +1,101 @@ +// +// MonoTODOAttribute.cs +// +// Authors: +// Ravi Pratap (ravi@ximian.com) +// Eyal Alaluf +// +// (C) Ximian, Inc. http://www.ximian.com +// + +// +// Copyright (C) 2004 Novell, Inc (http://www.novell.com) +// Copyright (C) 2006 Mainsoft, Inc (http://www.mainsoft.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +namespace System { +#pragma warning disable 436 + [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] + internal class MonoTODOAttribute : Attribute { + + string comment; + + public MonoTODOAttribute () + { + } + + public MonoTODOAttribute (string comment) + { + this.comment = comment; + } + + public string Comment { + get { return comment; } + } + } + + [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] + internal class MonoDocumentationNoteAttribute : MonoTODOAttribute { + + public MonoDocumentationNoteAttribute (string comment) + : base (comment) + { + } + } + + [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] + internal class MonoExtensionAttribute : MonoTODOAttribute { + + public MonoExtensionAttribute (string comment) + : base (comment) + { + } + } + + [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] + internal class MonoInternalNoteAttribute : MonoTODOAttribute { + + public MonoInternalNoteAttribute (string comment) + : base (comment) + { + } + } + + [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] + internal class MonoLimitationAttribute : MonoTODOAttribute { + + public MonoLimitationAttribute (string comment) + : base (comment) + { + } + } + + [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] + internal class MonoNotSupportedAttribute : MonoTODOAttribute { + + public MonoNotSupportedAttribute (string comment) + : base (comment) + { + } + } +#pragma warning restore 436 +} diff --git a/src/Editor/FPF/WindowsBase/System.Collections.Specialized/CollectionChangedEventManager.cs b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/CollectionChangedEventManager.cs new file mode 100644 index 0000000..5cdf2f8 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/CollectionChangedEventManager.cs @@ -0,0 +1,80 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Windows; + +namespace System.Collections.Specialized { + + public class CollectionChangedEventManager : WeakEventManager + { + internal CollectionChangedEventManager () + { + } + + public static void AddListener (INotifyCollectionChanged source, IWeakEventListener listener) + { + CurrentManager.ProtectedAddListener (source, listener); + } + + public static void RemoveListener (INotifyCollectionChanged source, IWeakEventListener listener) + { + CurrentManager.ProtectedAddListener (source, listener); + } + + protected override void StartListening (object source) + { + INotifyCollectionChanged inotify = (INotifyCollectionChanged) source; + inotify.CollectionChanged += OnCollectionChanged; + } + + protected override void StopListening (object source) + { + INotifyCollectionChanged inotify = (INotifyCollectionChanged) source; + inotify.CollectionChanged -= OnCollectionChanged; + } + + private void OnCollectionChanged (object sender, NotifyCollectionChangedEventArgs e) + { + DeliverEvent (sender, e); + } + + private static object CurrentManagerLock = new object (); + + private static CollectionChangedEventManager CurrentManager { + get { + lock (CurrentManagerLock) { + CollectionChangedEventManager manager = (CollectionChangedEventManager)GetCurrentManager (typeof (CollectionChangedEventManager)); + if (manager == null) { + manager = new CollectionChangedEventManager (); + SetCurrentManager (typeof (CollectionChangedEventManager), manager); + } + return manager; + } + } + } + } +} + diff --git a/src/Editor/FPF/WindowsBase/System.Collections.Specialized/INotifyCollectionChanged.cs b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/INotifyCollectionChanged.cs new file mode 100644 index 0000000..a6a2e57 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/INotifyCollectionChanged.cs @@ -0,0 +1,30 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + + +using System.Collections.Specialized; +using System.Runtime.CompilerServices; +[assembly:TypeForwardedTo (typeof (INotifyCollectionChanged))] + diff --git a/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedAction.cs b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedAction.cs new file mode 100644 index 0000000..f9a24bb --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedAction.cs @@ -0,0 +1,30 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + + +using System.Collections.Specialized; +using System.Runtime.CompilerServices; +[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedAction))] + diff --git a/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs new file mode 100644 index 0000000..993f547 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs @@ -0,0 +1,31 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// Brian O'Keefe (zer0keefie@gmail.com) +// + + +using System.Collections.Specialized; +using System.Runtime.CompilerServices; +[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedEventArgs))] + diff --git a/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs new file mode 100644 index 0000000..8fa9fb0 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs @@ -0,0 +1,30 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + + +using System.Collections.Specialized; +using System.Runtime.CompilerServices; +[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedEventHandler))] + diff --git a/src/Editor/FPF/WindowsBase/System.ComponentModel/DependencyPropertyDescriptor.cs b/src/Editor/FPF/WindowsBase/System.ComponentModel/DependencyPropertyDescriptor.cs new file mode 100644 index 0000000..2a0f5cc --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.ComponentModel/DependencyPropertyDescriptor.cs @@ -0,0 +1,165 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Windows; + +namespace System.ComponentModel { + + public sealed class DependencyPropertyDescriptor : PropertyDescriptor { + internal DependencyPropertyDescriptor () : base (null) + { + } + + public override AttributeCollection Attributes + { + get { throw new NotImplementedException (); } + } + public override string Category + { + get { throw new NotImplementedException (); } + } + public override Type ComponentType + { + get { throw new NotImplementedException (); } + } + public override TypeConverter Converter + { + get { throw new NotImplementedException (); } + } + public DependencyProperty DependencyProperty + { + get { throw new NotImplementedException (); } + } + public override string Description + { + get { throw new NotImplementedException (); } + } + public override bool DesignTimeOnly + { + get { throw new NotImplementedException (); } + } + public override string DisplayName + { + get { throw new NotImplementedException (); } + } + public bool IsAttached + { + get { throw new NotImplementedException (); } + } + public override bool IsBrowsable + { + get { throw new NotImplementedException (); } + } + public override bool IsLocalizable + { + get { throw new NotImplementedException (); } + } + public override bool IsReadOnly + { + get { throw new NotImplementedException (); } + } + public PropertyMetadata Metadata + { + get { throw new NotImplementedException (); } + } + public override Type PropertyType + { + get { throw new NotImplementedException (); } + } + public override bool SupportsChangeEvents + { + get { throw new NotImplementedException (); } + } + + public override void AddValueChanged (object component, EventHandler handler) + { + throw new NotImplementedException (); + } + public override bool CanResetValue (object component) + { + throw new NotImplementedException (); + } + public override bool Equals (object obj) + { + throw new NotImplementedException (); + } + public override PropertyDescriptorCollection GetChildProperties (object instance, Attribute[] filter) + { + throw new NotImplementedException (); + } + public override object GetEditor (Type editorBaseType) + { + throw new NotImplementedException (); + } + public override int GetHashCode () + { + throw new NotImplementedException (); + } + public override object GetValue (object component) + { + throw new NotImplementedException (); + } + public override void RemoveValueChanged (object component, EventHandler handler) + { + throw new NotImplementedException (); + } + public override void ResetValue (object component) + { + throw new NotImplementedException (); + } + public override void SetValue (object component, object value) + { + throw new NotImplementedException (); + } + public override bool ShouldSerializeValue (object component) + { + throw new NotImplementedException (); + } + public override string ToString () + { + throw new NotImplementedException (); + } + + public static DependencyPropertyDescriptor FromName (string name, Type ownerType, Type targetType) + { + throw new NotImplementedException (); + } + public static DependencyPropertyDescriptor FromProperty (PropertyDescriptor property) + { + throw new NotImplementedException (); + } + public static DependencyPropertyDescriptor FromProperty (DependencyProperty dependencyProperty, Type targetType) + { + throw new NotImplementedException (); + } + + public CoerceValueCallback DesignerCoerceValueCallback { + get { throw new NotImplementedException (); } + set { throw new NotImplementedException (); } + } + } + +} diff --git a/src/Editor/FPF/WindowsBase/System.IO/FileFormatException.cs b/src/Editor/FPF/WindowsBase/System.IO/FileFormatException.cs new file mode 100644 index 0000000..38ae5d5 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.IO/FileFormatException.cs @@ -0,0 +1,95 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// Miguel de Icaza (miguel@ximian.com) +// + +using System; +using System.Runtime.Serialization; +using System.Security; + +namespace System.IO { + + [Serializable] + public class FileFormatException : FormatException, ISerializable + { + Uri source_uri; + + public FileFormatException () : base () + { + } + + public FileFormatException (string message) : base (message) + { + } + + public FileFormatException (Uri sourceUri) + { + this.source_uri = sourceUri; + } + + protected FileFormatException (SerializationInfo info, StreamingContext context) + : base (info, context) + { + if (info == null) + throw new ArgumentNullException ("info"); + + source_uri = (Uri) info.GetValue ("sourceUri", typeof (Uri)); + } + + public FileFormatException (string message, Exception innerException) + : base (message, innerException) + { + } + + public FileFormatException (Uri sourceUri, Exception innerException) + : base ("", innerException) + { + source_uri = sourceUri; + } + + public FileFormatException (Uri sourceUri, string message) + : base (message) + { + source_uri = sourceUri; + } + + public FileFormatException (Uri sourceUri, string message, Exception innerException) + : base (message, innerException) + { + source_uri = sourceUri; + } + + public Uri SourceUri { + get { return source_uri; } + } + + [SecurityCritical] + public override void GetObjectData (SerializationInfo info, StreamingContext context) + { + base.GetObjectData (info, context); + info.AddValue ("sourceUri", source_uri); + } + } +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Converters/Int32RectValueSerializer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Converters/Int32RectValueSerializer.cs new file mode 100644 index 0000000..acaa7b2 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Converters/Int32RectValueSerializer.cs @@ -0,0 +1,59 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System.Globalization; +using System.Windows.Markup; + +namespace System.Windows.Converters { + + public class Int32RectValueSerializer : ValueSerializer + { + public override bool CanConvertFromString (string value, IValueSerializerContext context) + { + return true; + } + + public override bool CanConvertToString (object value, IValueSerializerContext context) + { + return value is Int32Rect; + } + + public override object ConvertFromString (string value, IValueSerializerContext context) + { + if (value == null) + throw new NotSupportedException ("value != null"); + return Int32Rect.Parse (value); + } + + public override string ConvertToString (object value, IValueSerializerContext context) + { + if (value is Int32Rect int32Rect) + return int32Rect.ToString (CultureInfo.InvariantCulture); + return base.ConvertToString (value, context); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Converters/PointValueSerializer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Converters/PointValueSerializer.cs new file mode 100644 index 0000000..150c2e8 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Converters/PointValueSerializer.cs @@ -0,0 +1,59 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System.Globalization; +using System.Windows.Markup; + +namespace System.Windows.Converters { + + public class PointValueSerializer : ValueSerializer + { + public override bool CanConvertFromString (string value, IValueSerializerContext context) + { + return true; + } + + public override bool CanConvertToString (object value, IValueSerializerContext context) + { + return value is Point; + } + + public override object ConvertFromString (string value, IValueSerializerContext context) + { + if (value == null) + throw new NotSupportedException ("value != null"); + return Point.Parse (value); + } + + public override string ConvertToString (object value, IValueSerializerContext context) + { + if (value is Point point) + return point.ToString (CultureInfo.InvariantCulture); + return base.ConvertToString (value, context); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Converters/RectValueSerializer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Converters/RectValueSerializer.cs new file mode 100644 index 0000000..623c0d6 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Converters/RectValueSerializer.cs @@ -0,0 +1,58 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// +using System.Globalization; +using System.Windows.Markup; + +namespace System.Windows.Converters { + + public class RectValueSerializer : ValueSerializer + { + public override bool CanConvertFromString (string value, IValueSerializerContext context) + { + return true; + } + + public override bool CanConvertToString (object value, IValueSerializerContext context) + { + return value is Rect; + } + + public override object ConvertFromString (string value, IValueSerializerContext context) + { + if (value == null) + throw new NotSupportedException ("value != null"); + return Rect.Parse (value); + } + + public override string ConvertToString (object value, IValueSerializerContext context) + { + if (value is Rect rect) + return rect.ToString (CultureInfo.InvariantCulture); + return base.ConvertToString (value, context); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs new file mode 100644 index 0000000..2765b73 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs @@ -0,0 +1,61 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Diagnostics; +using System.Globalization; +using System.Windows.Markup; + +namespace System.Windows.Converters { + + public class SizeValueSerializer : ValueSerializer + { + public override bool CanConvertFromString (string value, IValueSerializerContext context) + { + return true; + } + + public override bool CanConvertToString (object value, IValueSerializerContext context) + { + return value is Size; + } + + public override object ConvertFromString (string value, IValueSerializerContext context) + { + if (value == null) + throw new NotSupportedException ("value != null"); + return Size.Parse (value); + } + + public override string ConvertToString (object value, IValueSerializerContext context) + { + if (value is Size size) + return size.ToString (CultureInfo.InvariantCulture); + return base.ConvertToString (value, context); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Converters/VectorValueSerializer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Converters/VectorValueSerializer.cs new file mode 100644 index 0000000..6ec7ae6 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Converters/VectorValueSerializer.cs @@ -0,0 +1,59 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System.Globalization; +using System.Windows.Markup; + +namespace System.Windows.Converters { + + public class VectorValueSerializer : ValueSerializer + { + public override bool CanConvertFromString (string value, IValueSerializerContext context) + { + return true; + } + + public override bool CanConvertToString (object value, IValueSerializerContext context) + { + return value is Vector; + } + + public override object ConvertFromString (string value, IValueSerializerContext context) + { + if (value == null) + throw new NotSupportedException ("value != null"); + return Vector.Parse (value); + } + + public override string ConvertToString (object value, IValueSerializerContext context) + { + if (value is Vector vector) + return vector.ToString (CultureInfo.InvariantCulture); + return base.ConvertToString (value, context); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Data/DataSourceProvider.cs b/src/Editor/FPF/WindowsBase/System.Windows.Data/DataSourceProvider.cs new file mode 100644 index 0000000..2f0c66e --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Data/DataSourceProvider.cs @@ -0,0 +1,126 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; +using System.Windows.Threading; + +namespace System.Windows.Data { + + public abstract class DataSourceProvider : INotifyPropertyChanged, ISupportInitialize + { + protected DataSourceProvider () + { + throw new NotImplementedException (); + } + + [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] + public object Data { + get { throw new NotImplementedException (); } + } + + protected Dispatcher Dispatcher { + get { throw new NotImplementedException (); } + set { throw new NotImplementedException (); } + } + + public Exception Error { + get { throw new NotImplementedException (); } + } + + [DefaultValue (true)] + public bool IsInitialLoadEnabled { + get { throw new NotImplementedException (); } + set { throw new NotImplementedException (); } + } + + protected bool IsRefreshDeferred { + get { throw new NotImplementedException (); } + } + + public event EventHandler DataChanged; + + protected virtual event PropertyChangedEventHandler PropertyChanged; + + event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { + add { PropertyChanged += value; } + remove { PropertyChanged -= value; } + } + + protected virtual void BeginInit () + { + throw new NotImplementedException (); + } + void ISupportInitialize.BeginInit () + { + BeginInit (); + } + + protected virtual void EndInit () + { + throw new NotImplementedException (); + } + void ISupportInitialize.EndInit () + { + EndInit (); + } + + protected virtual void BeginQuery () + { + throw new NotImplementedException (); + } + + public virtual IDisposable DeferRefresh () + { + throw new NotImplementedException (); + } + + public void InitialLoad () + { + throw new NotImplementedException (); + } + + protected virtual void OnPropertyChanged (PropertyChangedEventArgs e) + { + throw new NotImplementedException (); + } + + protected void OnQueryFinished (object newData) + { + throw new NotImplementedException (); + } + + protected virtual void OnQueryFinished (object newData, Exception error, DispatcherOperationCallback completionWork, object callbackArguments) + { + throw new NotImplementedException (); + } + + public void Refresh () + { + throw new NotImplementedException (); + } + } +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/FocusNavigationDirection.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/FocusNavigationDirection.cs new file mode 100644 index 0000000..45e22bf --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/FocusNavigationDirection.cs @@ -0,0 +1,41 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@novell.com) +// + +using System; + +namespace System.Windows.Input { + + public enum FocusNavigationDirection + { + Next, + Previous, + First, + Last, + Left, + Right, + Up, + Down + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/Key.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/Key.cs new file mode 100644 index 0000000..40f1a93 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/Key.cs @@ -0,0 +1,239 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; +using System.Windows.Markup; + +namespace System.Windows.Input { + + [ValueSerializer (typeof (KeyValueSerializer))] + [TypeConverter (typeof (KeyConverter))] + public enum Key + { + None, + Cancel, + Back, + Tab, + LineFeed, + Clear, + Return, + Enter = Return, + Pause, + CapsLock, + Capital = CapsLock, + HangulMode, + KanaMode = HangulMode, + JunjaMode, + FinalMode, + KanjiMode, + HanjaMode = KanjiMode, + Escape, + ImeConvert, + ImeNonConvert, + ImeAccept, + ImeModeChange, + Space, + PageUp, + Prior = PageUp, + PageDown, + Next = PageDown, + End, + Home, + Left, + Up, + Right, + Down, + Select, + Print, + Execute, + PrintScreen, + Snapshot = PrintScreen, + Insert, + Delete, + Help, + D0, + D1, + D2, + D3, + D4, + D5, + D6, + D7, + D8, + D9, + A, + B, + C, + D, + E, + F, + G, + H, + I, + J, + K, + L, + M, + N, + O, + P, + Q, + R, + S, + T, + U, + V, + W, + X, + Y, + Z, + LWin, + RWin, + Apps, + Sleep, + NumPad0, + NumPad1, + NumPad2, + NumPad3, + NumPad4, + NumPad5, + NumPad6, + NumPad7, + NumPad8, + NumPad9, + Multiply, + Add, + Separator, + Subtract, + Decimal, + Divide, + F1, + F2, + F3, + F4, + F5, + F6, + F7, + F8, + F9, + F10, + F11, + F12, + F13, + F14, + F15, + F16, + F17, + F18, + F19, + F20, + F21, + F22, + F23, + F24, + NumLock, + Scroll, + LeftShift, + RightShift, + LeftCtrl, + RightCtrl, + LeftAlt, + RightAlt, + BrowserBack, + BrowserForward, + BrowserRefresh, + BrowserStop, + BrowserSearch, + BrowserFavorites, + BrowserHome, + VolumeMute, + VolumeDown, + VolumeUp, + MediaNextTrack, + MediaPreviousTrack, + MediaStop, + MediaPlayPause, + LaunchMail, + SelectMedia, + LaunchApplication1, + LaunchApplication2, + Oem1, + OemSemicolon = Oem1, + OemPlus, + OemComma, + OemMinus, + OemPeriod, + Oem2, + OemQuestion = Oem2, + Oem3, + OemTilde = Oem3, + AbntC1, + AbntC2, + Oem4, + OemOpenBrackets = Oem4, + Oem5, + OemPipe = Oem5, + Oem6, + OemCloseBrackets = Oem6, + Oem7, + OemQuotes = Oem7, + Oem8, + Oem102, + OemBackslash = Oem102, + ImeProcessed, + System, + OemAttn, + DbeAlphanumeric = OemAttn, + OemFinish, + DbeKatakana = OemFinish, + OemCopy, + DbeHiragana = OemCopy, + OemAuto, + DbeSbcsChar = OemAuto, + OemEnlw, + DbeDbcsChar = OemEnlw, + OemBackTab, + DbeRoman = OemBackTab, + Attn, + DbeNoRoman = Attn, + CrSel, + DbeEnterWordRegisterMode = CrSel, + ExSel, + DbeEnterImeConfigureMode = ExSel, + EraseEof, + DbeFlushString = EraseEof, + Play, + DbeCodeInput = Play, + Zoom, + DbeNoCodeInput = Zoom, + NoName, + DbeDetermineString = NoName, + Pa1, + DbeEnterDialogConversionMode = Pa1, + OemClear, + DeadCharProcessed + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyConverter.cs new file mode 100644 index 0000000..4855371 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyConverter.cs @@ -0,0 +1,56 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows.Input { + + public class KeyConverter : TypeConverter + { + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + throw new NotImplementedException (); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + throw new NotImplementedException (); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object source) + { + throw new NotImplementedException (); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + throw new NotImplementedException (); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyInterop.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyInterop.cs new file mode 100644 index 0000000..b69e13d --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyInterop.cs @@ -0,0 +1,43 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; + +namespace System.Windows.Input { + + public static class KeyInterop + { + public static Key KeyFromVirtualKey (int virtualKey) + { + throw new NotImplementedException (); + } + + public static int VirtualKeyFromKey (Key key) + { + throw new NotImplementedException (); + } + } + +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyValueSerializer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyValueSerializer.cs new file mode 100644 index 0000000..d7b3d07 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/KeyValueSerializer.cs @@ -0,0 +1,55 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Windows.Markup; + +namespace System.Windows.Input { + + public class KeyValueSerializer : ValueSerializer + { + public override bool CanConvertFromString (string value, IValueSerializerContext context) + { + throw new NotImplementedException (); + } + + public override bool CanConvertToString (object value, IValueSerializerContext context) + { + throw new NotImplementedException (); + } + + public override object ConvertFromString (string value, IValueSerializerContext context) + { + throw new NotImplementedException (); + } + + public override string ConvertToString (object value, IValueSerializerContext context) + { + throw new NotImplementedException (); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeys.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeys.cs new file mode 100644 index 0000000..cd78943 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeys.cs @@ -0,0 +1,43 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; +using System.Windows.Markup; + +namespace System.Windows.Input { + + [Flags] + [ValueSerializer (typeof (ModifierKeysValueSerializer))] + [TypeConverter (typeof (ModifierKeysConverter))] + public enum ModifierKeys { + None = 0, + Alt = 1, + Control = 2, + Shift = 4, + Windows = 8 + } +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeysConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeysConverter.cs new file mode 100644 index 0000000..3752b9d --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeysConverter.cs @@ -0,0 +1,61 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows.Input { + + public class ModifierKeysConverter : TypeConverter + { + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + throw new NotImplementedException (); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + throw new NotImplementedException (); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object source) + { + throw new NotImplementedException (); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + throw new NotImplementedException (); + } + + public static bool IsDefinedModifierKeys (ModifierKeys modifierKeys) + { + throw new NotImplementedException (); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeysValueSerializer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeysValueSerializer.cs new file mode 100644 index 0000000..11310ad --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/ModifierKeysValueSerializer.cs @@ -0,0 +1,55 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Windows.Markup; + +namespace System.Windows.Input { + + public class ModifierKeysValueSerializer : ValueSerializer + { + public override bool CanConvertFromString (string value, IValueSerializerContext context) + { + throw new NotImplementedException (); + } + + public override bool CanConvertToString (object value, IValueSerializerContext context) + { + throw new NotImplementedException (); + } + + public override object ConvertFromString (string value, IValueSerializerContext context) + { + throw new NotImplementedException (); + } + + public override string ConvertToString (object value, IValueSerializerContext context) + { + throw new NotImplementedException (); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Input/TraversalRequest.cs b/src/Editor/FPF/WindowsBase/System.Windows.Input/TraversalRequest.cs new file mode 100644 index 0000000..a132971 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Input/TraversalRequest.cs @@ -0,0 +1,49 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@novell.com) +// + +using System; + +namespace System.Windows.Input { + + public class TraversalRequest + { + bool wrapped; + FocusNavigationDirection focusNavigationDirection; + + public TraversalRequest (FocusNavigationDirection focusNavigationDirection) + { + this.focusNavigationDirection = focusNavigationDirection; + } + + public FocusNavigationDirection FocusNavigationDirection { + get { return focusNavigationDirection; } + } + + public bool Wrapped { + get { return wrapped; } + set { wrapped = value; } + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Interop/ComponentDispatcher.cs b/src/Editor/FPF/WindowsBase/System.Windows.Interop/ComponentDispatcher.cs new file mode 100644 index 0000000..0665b4d --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Interop/ComponentDispatcher.cs @@ -0,0 +1,73 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Security; + +namespace System.Windows.Interop { + + public static class ComponentDispatcher + { + public static MSG CurrentKeyboardMessage { + [SecurityCritical] + get { throw new NotImplementedException (); } + } + + public static bool IsThreadModal { + [SecurityCritical] + get { throw new NotImplementedException (); } + } + + public static event EventHandler EnterThreadModal; + public static event EventHandler LeaveThreadModal; + public static event ThreadMessageEventHandler ThreadFilterMessage; + public static event EventHandler ThreadIdle; + public static event ThreadMessageEventHandler ThreadPreprocessMessage; + + [SecurityCritical] + public static void PopModal() + { + throw new NotImplementedException (); + } + + [SecurityCritical] + public static void PushModal() + { + throw new NotImplementedException (); + } + + [SecurityCritical] + public static void RaiseIdle() + { + throw new NotImplementedException (); + } + + [SecurityCritical] + public static bool RaiseThreadMessage (ref MSG msg) + { + throw new NotImplementedException (); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSink.cs b/src/Editor/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSink.cs new file mode 100644 index 0000000..fa8f4fe --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSink.cs @@ -0,0 +1,55 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Security; +using System.Windows.Input; + +namespace System.Windows.Interop { + + public interface IKeyboardInputSink + { + IKeyboardInputSite KeyboardInputSite { + get; + [SecurityCritical] + set; + } + + bool TabInto (TraversalRequest request); + bool HasFocusWithin (); + + [SecurityCritical] + bool OnMnemonic (ref MSG msg, ModifierKeys modifiers); + + [SecurityCritical] + IKeyboardInputSite RegisterKeyboardInputSink (IKeyboardInputSink sink); + + [SecurityCritical] + bool TranslateAccelerator (ref MSG msg, ModifierKeys modifiers); + + [SecurityCritical] + bool TranslateChar (ref MSG msg, ModifierKeys modifiers); + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSite.cs b/src/Editor/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSite.cs new file mode 100644 index 0000000..8ffa1e0 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSite.cs @@ -0,0 +1,42 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Security; +using System.Windows.Input; + +namespace System.Windows.Interop { + + public interface IKeyboardInputSite + { + IKeyboardInputSink Sink { get; } + + bool OnNoMoreTabStops (TraversalRequest request); + + [SecurityCritical] + void Unregister (); + } + +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Interop/MSG.cs b/src/Editor/FPF/WindowsBase/System.Windows.Interop/MSG.cs new file mode 100644 index 0000000..abcbd52 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Interop/MSG.cs @@ -0,0 +1,84 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Security; + +namespace System.Windows.Interop { + + [Serializable] + public struct MSG + { + public IntPtr hwnd { + [SecurityCritical] + get { throw new NotImplementedException (); } + [SecurityCritical] + set { throw new NotImplementedException (); } + } + + public IntPtr lParam { + [SecurityCritical] + get { throw new NotImplementedException (); } + [SecurityCritical] + set { throw new NotImplementedException (); } + } + + + public IntPtr wParam { + [SecurityCritical] + get { throw new NotImplementedException (); } + [SecurityCritical] + set { throw new NotImplementedException (); } + } + public int message { + [SecurityCritical] + get { throw new NotImplementedException (); } + [SecurityCritical] + set { throw new NotImplementedException (); } + } + + public int pt_x { + [SecurityCritical] + get { throw new NotImplementedException (); } + [SecurityCritical] + set { throw new NotImplementedException (); } + } + + public int pt_y { + [SecurityCritical] + get { throw new NotImplementedException (); } + [SecurityCritical] + set { throw new NotImplementedException (); } + } + + public int time { + [SecurityCritical] + get { throw new NotImplementedException (); } + [SecurityCritical] + set { throw new NotImplementedException (); } + } + } +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Interop/ThreadMessageEventHandler.cs b/src/Editor/FPF/WindowsBase/System.Windows.Interop/ThreadMessageEventHandler.cs new file mode 100644 index 0000000..638c8e3 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Interop/ThreadMessageEventHandler.cs @@ -0,0 +1,32 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; + +namespace System.Windows.Interop { + + public delegate void ThreadMessageEventHandler (ref MSG msg, ref bool handled); + +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs new file mode 100644 index 0000000..5a7b951 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs @@ -0,0 +1,60 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.Globalization; +using System.Windows.Markup; + +namespace System.Windows.Media.Converters { + + public class MatrixValueSerializer : ValueSerializer + { + public override bool CanConvertFromString (string value, IValueSerializerContext context) + { + return true; + } + + public override bool CanConvertToString (object value, IValueSerializerContext context) + { + return value is Matrix; + } + + public override object ConvertFromString (string value, IValueSerializerContext context) + { + if (value == null) + throw new NotSupportedException ("value != null"); + return Matrix.Parse (value); + } + + public override string ConvertToString (object value, IValueSerializerContext context) + { + if (value is Matrix matrix) + return matrix.ToString (CultureInfo.InvariantCulture); + return base.ConvertToString (value, context); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Media/DisableDpiAwarenessAttribute.cs b/src/Editor/FPF/WindowsBase/System.Windows.Media/DisableDpiAwarenessAttribute.cs new file mode 100644 index 0000000..00c2be5 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Media/DisableDpiAwarenessAttribute.cs @@ -0,0 +1,35 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; + +namespace System.Windows.Media { + + [AttributeUsage (AttributeTargets.Assembly, AllowMultiple = false)] + public sealed class DisableDpiAwarenessAttribute : Attribute + { + } +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Media/Matrix.cs b/src/Editor/FPF/WindowsBase/System.Windows.Media/Matrix.cs new file mode 100644 index 0000000..49e0548 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Media/Matrix.cs @@ -0,0 +1,456 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; +using System.Globalization; +using System.Windows.Markup; +using System.Windows.Media.Converters; +using System.Windows.Threading; + +namespace System.Windows.Media { + + [Serializable] + [TypeConverter (typeof(MatrixConverter))] + [ValueSerializer (typeof (MatrixValueSerializer))] + public struct Matrix : IFormattable { + + double _m11; + double _m12; + double _m21; + double _m22; + double _offsetX; + double _offsetY; + + public Matrix (double m11, + double m12, + double m21, + double m22, + double offsetX, + double offsetY) + { + this._m11 = m11; + this._m12 = m12; + this._m21 = m21; + this._m22 = m22; + this._offsetX = offsetX; + this._offsetY = offsetY; + } + + public void Append (Matrix matrix) + { + double _m11; + double _m21; + double _m12; + double _m22; + double _offsetX; + double _offsetY; + + _m11 = this._m11 * matrix.M11 + this._m12 * matrix.M21; + _m12 = this._m11 * matrix.M12 + this._m12 * matrix.M22; + _m21 = this._m21 * matrix.M11 + this._m22 * matrix.M21; + _m22 = this._m21 * matrix.M12 + this._m22 * matrix.M22; + + _offsetX = this._offsetX * matrix.M11 + this._offsetY * matrix.M21 + matrix.OffsetX; + _offsetY = this._offsetX * matrix.M12 + this._offsetY * matrix.M22 + matrix.OffsetY; + + this._m11 = _m11; + this._m12 = _m12; + this._m21 = _m21; + this._m22 = _m22; + this._offsetX = _offsetX; + this._offsetY = _offsetY; + } + + public bool Equals (Matrix value) + { + return (_m11 == value.M11 && + _m12 == value.M12 && + _m21 == value.M21 && + _m22 == value.M22 && + _offsetX == value.OffsetX && + _offsetY == value.OffsetY); + } + + public override bool Equals (object o) + { + if (!(o is Matrix)) + return false; + + return Equals ((Matrix)o); + } + + public static bool Equals (Matrix matrix1, + Matrix matrix2) + { + return matrix1.Equals (matrix2); + } + + public override int GetHashCode () + { + unchecked + { + var hashCode = _m11.GetHashCode (); + hashCode = (hashCode * 397) ^ _m12.GetHashCode (); + hashCode = (hashCode * 397) ^ _m21.GetHashCode (); + hashCode = (hashCode * 397) ^ _m22.GetHashCode (); + hashCode = (hashCode * 397) ^ _offsetX.GetHashCode (); + hashCode = (hashCode * 397) ^ _offsetY.GetHashCode (); + return hashCode; + } + } + + public void Invert () + { + if (!HasInverse) + throw new InvalidOperationException ("Transform is not invertible."); + + double d = Determinant; + + /* 1/(ad-bc)[d -b; -c a] */ + + double _m11 = this._m22; + double _m12 = -this._m12; + double _m21 = -this._m21; + double _m22 = this._m11; + + double _offsetX = this._m21 * this._offsetY - this._m22 * this._offsetX; + double _offsetY = this._m12 * this._offsetX - this._m11 * this._offsetY; + + this._m11 = _m11 / d; + this._m12 = _m12 / d; + this._m21 = _m21 / d; + this._m22 = _m22 / d; + this._offsetX = _offsetX / d; + this._offsetY = _offsetY / d; + } + + public static Matrix Multiply (Matrix trans1, + Matrix trans2) + { + Matrix m = trans1; + m.Append (trans2); + return m; + } + + public static bool operator == (Matrix matrix1, + Matrix matrix2) + { + return matrix1.Equals (matrix2); + } + + public static bool operator != (Matrix matrix1, + Matrix matrix2) + { + return !matrix1.Equals (matrix2); + } + + public static Matrix operator * (Matrix trans1, + Matrix trans2) + { + Matrix result = trans1; + result.Append (trans2); + return result; + } + + public static Matrix Parse (string source) + { + if (source == null) + throw new ArgumentNullException ("source"); + Matrix value; + if (source.Trim () == "Identity") + { + value = Identity; + } + else + { + var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); + double m11; + double m12; + double m21; + double m22; + double offsetX; + double offsetY; + if (double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out m11) + && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out m12) + && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out m21) + && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out m22) + && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out offsetX) + && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out offsetY)) + { + if (!tokenizer.HasNoMoreTokens ()) + { + throw new InvalidOperationException ("Invalid Matrix format: " + source); + } + value = new Matrix (m11, m12, m21, m22, offsetX, offsetY); + } + else + { + throw new FormatException (string.Format ("Invalid Matrix format: {0}", source)); + } + } + return value; + } + + public void Prepend (Matrix matrix) + { + double _m11; + double _m21; + double _m12; + double _m22; + double _offsetX; + double _offsetY; + + _m11 = matrix.M11 * this._m11 + matrix.M12 * this._m21; + _m12 = matrix.M11 * this._m12 + matrix.M12 * this._m22; + _m21 = matrix.M21 * this._m11 + matrix.M22 * this._m21; + _m22 = matrix.M21 * this._m12 + matrix.M22 * this._m22; + + _offsetX = matrix.OffsetX * this._m11 + matrix.OffsetY * this._m21 + this._offsetX; + _offsetY = matrix.OffsetX * this._m12 + matrix.OffsetY * this._m22 + this._offsetY; + + this._m11 = _m11; + this._m12 = _m12; + this._m21 = _m21; + this._m22 = _m22; + this._offsetX = _offsetX; + this._offsetY = _offsetY; + } + + public void Rotate (double angle) + { + // R_theta==[costheta -sintheta; sintheta costheta], + double theta = angle * Math.PI / 180; + + Matrix r_theta = new Matrix (Math.Cos (theta), Math.Sin(theta), + -Math.Sin (theta), Math.Cos(theta), + 0, 0); + + Append (r_theta); + } + + public void RotateAt (double angle, + double centerX, + double centerY) + { + Translate (-centerX, -centerY); + Rotate (angle); + Translate (centerX, centerY); + } + + public void RotateAtPrepend (double angle, + double centerX, + double centerY) + { + Matrix m = Matrix.Identity; + m.RotateAt (angle, centerX, centerY); + Prepend (m); + } + + public void RotatePrepend (double angle) + { + Matrix m = Matrix.Identity; + m.Rotate (angle); + Prepend (m); + } + + public void Scale (double scaleX, + double scaleY) + { + Matrix scale = new Matrix (scaleX, 0, + 0, scaleY, + 0, 0); + + Append (scale); + } + + public void ScaleAt (double scaleX, + double scaleY, + double centerX, + double centerY) + { + Translate (-centerX, -centerY); + Scale (scaleX, scaleY); + Translate (centerX, centerY); + } + + public void ScaleAtPrepend (double scaleX, + double scaleY, + double centerX, + double centerY) + { + Matrix m = Matrix.Identity; + m.ScaleAt (scaleX, scaleY, centerX, centerY); + Prepend (m); + } + + public void ScalePrepend (double scaleX, + double scaleY) + { + Matrix m = Matrix.Identity; + m.Scale (scaleX, scaleY); + Prepend (m); + } + + public void SetIdentity () + { + _m11 = _m22 = 1.0; + _m12 = _m21 = 0.0; + _offsetX = _offsetY = 0.0; + } + + public void Skew (double skewX, + double skewY) + { + Matrix skew_m = new Matrix (1, Math.Tan (skewY * Math.PI / 180), + Math.Tan (skewX * Math.PI / 180), 1, + 0, 0); + Append (skew_m); + } + + public void SkewPrepend (double skewX, + double skewY) + { + Matrix m = Matrix.Identity; + m.Skew (skewX, skewY); + Prepend (m); + } + + public override string ToString () + { + return ToString (null); + } + + public string ToString (IFormatProvider provider) + { + return ToString (null, provider); + } + + string IFormattable.ToString (string format, + IFormatProvider provider) + { + return ToString (provider); + } + + private string ToString (string format, IFormatProvider provider) + { + if (IsIdentity) + return "Identity"; + + if (provider == null) + provider = CultureInfo.CurrentCulture; + + if (format == null) + format = string.Empty; + + var separator = NumericListTokenizer.GetSeparator (provider); + + var matrixFormat = string.Format ( + "{{0:{0}}}{1}{{1:{0}}}{1}{{2:{0}}}{1}{{3:{0}}}{1}{{4:{0}}}{1}{{5:{0}}}", + format, separator); + return string.Format (provider, matrixFormat, + _m11, _m12, _m21, _m22, _offsetX, _offsetY); + } + + public Point Transform (Point point) + { + return Point.Multiply (point, this); + } + + public void Transform (Point[] points) + { + for (int i = 0; i < points.Length; i ++) + points[i] = Transform (points[i]); + } + + public Vector Transform (Vector vector) + { + return Vector.Multiply (vector, this); + } + + public void Transform (Vector[] vectors) + { + for (int i = 0; i < vectors.Length; i ++) + vectors[i] = Transform (vectors[i]); + } + + public void Translate (double offsetX, + double offsetY) + { + this._offsetX += offsetX; + this._offsetY += offsetY; + } + + public void TranslatePrepend (double offsetX, + double offsetY) + { + Matrix m = Matrix.Identity; + m.Translate (offsetX, offsetY); + Prepend (m); + } + + public double Determinant { + get { return _m11 * _m22 - _m12 * _m21; } + } + + public bool HasInverse { + get { return Determinant != 0; } + } + + public static Matrix Identity { + get { return new Matrix (1.0, 0.0, 0.0, 1.0, 0.0, 0.0); } + } + + public bool IsIdentity { + get { return Equals (Matrix.Identity); } + } + + public double M11 { + get { return _m11; } + set { _m11 = value; } + } + public double M12 { + get { return _m12; } + set { _m12 = value; } + } + public double M21 { + get { return _m21; } + set { _m21 = value; } + } + public double M22 { + get { return _m22; } + set { _m22 = value; } + } + public double OffsetX { + get { return _offsetX; } + set { _offsetX = value; } + } + public double OffsetY { + get { return _offsetY; } + set { _offsetY = value; } + } + } + +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Media/MatrixConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows.Media/MatrixConverter.cs new file mode 100644 index 0000000..596d211 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Media/MatrixConverter.cs @@ -0,0 +1,58 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows.Media { + + public sealed class MatrixConverter : TypeConverter + { + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof (string); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + return destinationType == typeof (string); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (!(value is string)) + throw new NotSupportedException ("MatrixConverter only supports converting from strings"); + return Matrix.Parse ((string)value); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + return ((Matrix)value).ToString (culture); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/Dispatcher.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/Dispatcher.cs new file mode 100644 index 0000000..6a92f34 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/Dispatcher.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Threading; + +namespace System.Windows.Threading +{ + public sealed class Dispatcher + { + public Thread Thread { get; } + + internal DispatcherSynchronizationContext DefaultSynchronizationContext { get; } + + public event DispatcherUnhandledExceptionEventHandler UnhandledException; + + internal void OnUnhandledException(Exception exception) + { + var unhandledException = UnhandledException; + if (unhandledException != null) + { + var args = new DispatcherUnhandledExceptionEventArgs(this, exception); + + unhandledException(this, args); + + if (args.Handled) + return; + } + + throw new Exception( + $"Unhandled exception in dispatcher thread {Thread.ManagedThreadId} '{Thread.Name}'", + exception); + } + + [EditorBrowsable(EditorBrowsableState.Never)] + public bool CheckAccess() + => Thread.CurrentThread == Thread; + + [EditorBrowsable(EditorBrowsableState.Never)] + public void VerifyAccess() + { + if (Thread.CurrentThread != Thread) + throw new InvalidOperationException("Invoked from a different thread"); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + static void ValidateArguments(Delegate method, DispatcherPriority priority) + { + if (method == null) + throw new ArgumentNullException(nameof(method)); + + if (priority < 0 || priority > DispatcherPriority.Send) + throw new InvalidEnumArgumentException(nameof(priority)); + + if (priority == DispatcherPriority.Inactive) + throw new ArgumentException("priority must not be inactive", nameof(priority)); + } + + public DispatcherOperation BeginInvoke (DispatcherPriority priority, Delegate method, object arg) + => BeginInvoke (method, priority, arg); + + public DispatcherOperation BeginInvoke(Delegate method, params object[] args) + => BeginInvoke(method, DispatcherPriority.Normal, args); + + public DispatcherOperation BeginInvoke(Delegate method, DispatcherPriority priority, params object[] args) + { + ValidateArguments(method, priority); + return new DispatcherOperation( + this, + method, + priority, + args, + CancellationToken.None, + null).BeginInvoke(); + } + + public DispatcherOperation InvokeAsync(Action callback) + => InvokeAsync(callback, DispatcherPriority.Normal, null, default); + + public DispatcherOperation InvokeAsync(Action callback, DispatcherPriority priority) + => InvokeAsync(callback, priority, null, default); + + public DispatcherOperation InvokeAsync(Action callback, DispatcherPriority priority, CancellationToken cancellationToken) + => InvokeAsync(callback, priority, null, cancellationToken); + + DispatcherOperation InvokeAsync(Delegate method, DispatcherPriority priority, object[] args, CancellationToken cancellationToken) + { + ValidateArguments(method, priority); + return new DispatcherOperation( + this, + method, + priority, + args, + cancellationToken, + new DispatcherOperationTaskSource()).InvokeAsync(); + } + + public void Invoke(Action callback) + => Invoke(callback, DispatcherPriority.Send, CancellationToken.None, Timeout.InfiniteTimeSpan); + + public void Invoke(Action callback, DispatcherPriority priority) + => Invoke(callback, priority, CancellationToken.None, Timeout.InfiniteTimeSpan); + + void Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken) + => Invoke(callback, priority, cancellationToken, Timeout.InfiniteTimeSpan); + + void Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) + { + ValidateArguments(callback, priority); + new DispatcherOperation( + this, + callback, + priority, + null, + cancellationToken, + null).Invoke(timeout); + } + + #region Adapted directly from WPF Dispatcher + + Dispatcher() + { + tlsDispatcher = this; // use TLS for ownership only + Thread = Thread.CurrentThread; + + lock (globalLock) + dispatchers.Add(new WeakReference(this)); + + DefaultSynchronizationContext = new DispatcherSynchronizationContext(this); + } + + [ThreadStatic] + static Dispatcher tlsDispatcher; // use TLS for ownership only + + static readonly object globalLock = new object(); + static readonly List dispatchers = new List(); + static WeakReference possibleDispatcher = new WeakReference(null); + + public static Dispatcher CurrentDispatcher + => FromThread(Thread.CurrentThread) ?? new Dispatcher(); + + public static Dispatcher FromThread(Thread thread) + { + if (thread == null) + return null; + + lock (globalLock) + { + Dispatcher dispatcher = null; + + dispatcher = possibleDispatcher.Target as Dispatcher; + if (dispatcher == null || dispatcher.Thread != thread) + { + dispatcher = null; + + for (int i = 0; i < dispatchers.Count; i++) + { + if (dispatchers[i].Target is Dispatcher dispatcherForThread) + { + if (dispatcherForThread.Thread == thread) + dispatcher = dispatcherForThread; + } + else + { + dispatchers.RemoveAt(i); + i--; + } + } + + if (dispatcher != null) + { + if (possibleDispatcher.IsAlive) + possibleDispatcher.Target = dispatcher; + else + possibleDispatcher = new WeakReference(dispatcher); + } + } + + return dispatcher; + } + } + + public bool HasShutdownStarted => false; + public bool HasShutdownFinished => false; + + public event EventHandler ShutdownStarted { add { } remove { } } + public event EventHandler ShutdownFinished { add { } remove { } } + + #endregion + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherEventArgs.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherEventArgs.cs new file mode 100644 index 0000000..02347c5 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherEventArgs.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace System.Windows.Threading +{ + public class DispatcherEventArgs : EventArgs + { + public Dispatcher Dispatcher { get; } + + internal DispatcherEventArgs(Dispatcher dispatcher) + => Dispatcher = dispatcher; + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherObject.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherObject.cs new file mode 100644 index 0000000..3782345 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherObject.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ComponentModel; + +namespace System.Windows.Threading +{ + public abstract class DispatcherObject + { + [EditorBrowsable(EditorBrowsableState.Never)] + public Dispatcher Dispatcher { get; } + + protected DispatcherObject () + => Dispatcher = Dispatcher.CurrentDispatcher; + + [EditorBrowsable(EditorBrowsableState.Never)] + public bool CheckAccess() + => Dispatcher.CheckAccess(); + + [EditorBrowsable(EditorBrowsableState.Never)] + public void VerifyAccess() + => Dispatcher.VerifyAccess(); + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherOperation.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherOperation.cs new file mode 100644 index 0000000..256ccb8 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherOperation.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.ComponentModel; +using System.Runtime.CompilerServices; +using System.Threading; +using System.Threading.Tasks; + +using CoreFoundation; +using Foundation; + +namespace System.Windows.Threading +{ + public enum DispatcherOperationStatus + { + Pending, + Aborted, + Completed, + Executing + } + + public delegate object DispatcherOperationCallback(object arg); + + public sealed class DispatcherOperation + { + readonly Delegate method; + readonly object[] args; + readonly CancellationToken cancellationToken; + readonly DispatcherOperationTaskSource taskSource; + + public Dispatcher Dispatcher { get; } + public DispatcherPriority Priority { get; } + + Exception exception; + public object Result { get; private set; } + public DispatcherOperationStatus Status { get; private set; } + + public event EventHandler Aborted; + public event EventHandler Completed; + + internal DispatcherOperation( + Dispatcher dispatcher, + Delegate method, + DispatcherPriority priority, + object[] args, + CancellationToken cancellationToken, + DispatcherOperationTaskSource taskSource) + { + Dispatcher = dispatcher; + this.method = method; + Priority = priority; + this.args = args; + this.cancellationToken = cancellationToken; + this.taskSource = taskSource; + Status = DispatcherOperationStatus.Pending; + } + + internal DispatcherOperation BeginInvoke() + { + NSRunLoop.Main.BeginInvokeOnMainThread(() => + { + CoreInvoke(beginInvokeBehavior: true); + if (exception != null) + Dispatcher.OnUnhandledException(exception); + }); + + return this; + } + + internal DispatcherOperation InvokeAsync() + { + if (taskSource == null) + throw new InvalidOperationException(); + + NSRunLoop.Main.BeginInvokeOnMainThread(() => + { + try + { + CoreInvoke(beginInvokeBehavior: false); + } + catch (OperationCanceledException) + { + taskSource.SetCanceled(); + return; + } + + if (cancellationToken.IsCancellationRequested) + taskSource.SetCanceled(); + else if (exception != null) + taskSource.SetException(exception); + else + taskSource.SetResult(); + }); + + return this; + } + + internal void Invoke(TimeSpan timeout) + { + if (timeout != Timeout.InfiniteTimeSpan) + throw new NotSupportedException("timeouts are not supported"); + + var mainQueue = DispatchQueue.MainQueue; + + if (DispatchQueue.CurrentQueue != mainQueue) + NSRunLoop.Main.InvokeOnMainThread(() => CoreInvoke(beginInvokeBehavior: false)); + else + CoreInvoke(beginInvokeBehavior: false); + + if (exception != null) + throw exception; + } + + void CoreInvoke(bool beginInvokeBehavior) + { + Status = DispatcherOperationStatus.Executing; + + var oldSynchronizationContext = SynchronizationContext.Current; + + try + { + SynchronizationContext.SetSynchronizationContext(Dispatcher.DefaultSynchronizationContext); + + try + { + if (method is Action action) + action(); + else + Result = method.DynamicInvoke(args); + } + catch (Exception e) + { + exception = e; + } + + if (beginInvokeBehavior) + { + if (exception is OperationCanceledException) + { + Status = DispatcherOperationStatus.Aborted; + exception = null; + Aborted?.Invoke(this, EventArgs.Empty); + } + else + { + Status = DispatcherOperationStatus.Completed; + Completed?.Invoke(this, EventArgs.Empty); + } + } + } + finally + { + SynchronizationContext.SetSynchronizationContext(oldSynchronizationContext); + } + } + + [Browsable(false)] + [EditorBrowsable(EditorBrowsableState.Never)] + public TaskAwaiter GetAwaiter() + { + if (taskSource == null) + throw new InvalidOperationException(); + + return taskSource.GetTask().GetAwaiter(); + } + + public Task Task + { + get + { + if (taskSource == null) + throw new InvalidOperationException(); + + return taskSource.GetTask(); + } + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherOperationTaskSource.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherOperationTaskSource.cs new file mode 100644 index 0000000..627be8d --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherOperationTaskSource.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; + +namespace System.Windows.Threading +{ + sealed class DispatcherOperationTaskSource + { + readonly TaskCompletionSource taskCompletionSource = new TaskCompletionSource(); + + public Task GetTask() + => taskCompletionSource.Task; + + public void SetCanceled() + => taskCompletionSource.SetCanceled(); + + public void SetResult() + => taskCompletionSource.SetResult(true); + + public void SetException(Exception exception) + => taskCompletionSource.SetException(exception); + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherPriority.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherPriority.cs new file mode 100644 index 0000000..d15c798 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherPriority.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace System.Windows.Threading +{ + public enum DispatcherPriority + { + Invalid = -1, + Inactive = 0, + SystemIdle = 1, + ApplicationIdle = 2, + ContextIdle = 3, + Background = 4, + Input = 5, + Loaded = 6, + Render = 7, + DataBind = 8, + Normal = 9, + Send = 10, + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherSynchronizationContext.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherSynchronizationContext.cs new file mode 100644 index 0000000..687c786 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherSynchronizationContext.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading; + +namespace System.Windows.Threading +{ + public sealed class DispatcherSynchronizationContext : SynchronizationContext + { + readonly Dispatcher dispatcher; + readonly DispatcherPriority priority; + + public DispatcherSynchronizationContext(Dispatcher dispatcher, DispatcherPriority priority) + { + this.dispatcher = dispatcher + ?? throw new ArgumentNullException(nameof(dispatcher)); + this.priority = priority; + } + + public DispatcherSynchronizationContext(Dispatcher dispatcher) : this(dispatcher, DispatcherPriority.Normal) + { + } + + public DispatcherSynchronizationContext() : this(Dispatcher.CurrentDispatcher) + { + } + + public override SynchronizationContext CreateCopy() + => new DispatcherSynchronizationContext(dispatcher, priority); + + public override void Post(SendOrPostCallback d, object state) + => dispatcher.BeginInvoke(d, priority, state); + + public override void Send(SendOrPostCallback d, object state) + => dispatcher.Invoke(() => d(state), priority); + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherTimer.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherTimer.cs new file mode 100644 index 0000000..bef8f76 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherTimer.cs @@ -0,0 +1,141 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2006 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Miguel de Icaza (miguel@novell.com) +// +using System; +using System.Collections; +using System.Threading; + +namespace System.Windows.Threading { + public class DispatcherTimer { + DispatcherPriority priority; + Dispatcher target_dispatcher; + long interval; + EventHandler callback; + Timer timer; + object tag; + + public DispatcherTimer () + : this (DispatcherPriority.Background, Dispatcher.CurrentDispatcher) + { + } + + public DispatcherTimer (DispatcherPriority priority) + : this (priority, Dispatcher.CurrentDispatcher) + { + } + + public DispatcherTimer (DispatcherPriority priority, Dispatcher dispatcher) + : this (TimeSpan.Zero, priority, null, dispatcher) + { + } + + public DispatcherTimer (TimeSpan interval, DispatcherPriority priority, + EventHandler callback, Dispatcher dispatcher) + { + this.priority = priority; + this.target_dispatcher = dispatcher; + this.interval = interval.Ticks; + this.callback = callback; + } + + public void Start () + { + if (timer == null){ + long repeat_interval = interval; + if (repeat_interval == 0) + repeat_interval = 1; + timer = new Timer (new TimerCallback (timer_tick), + null, new TimeSpan (interval), + new TimeSpan (repeat_interval)); + } + } + + void timer_tick (object state) + { + target_dispatcher.BeginInvoke ((ThreadStart) delegate { + EventHandler h = Tick; + if (h != null) + h (this, EventArgs.Empty); + if (callback != null) + callback (this, EventArgs.Empty); + }, priority); + } + + public void Stop () + { + if (timer == null) + return; + + timer.Dispose (); + timer = null; + } + + public Dispatcher Dispatcher { + get { + return target_dispatcher; + } + } + + public TimeSpan Interval { + get { + return new TimeSpan (interval); + } + + set { + if (interval == value.Ticks) + return; + + interval = value.Ticks; + + if (timer != null) + timer.Change (new TimeSpan (interval), + new TimeSpan (interval)); + } + } + + public bool IsEnabled { + get { + return timer != null; + } + + set { + if (value && timer == null) + Start (); + if (value == false && timer != null) + Stop (); + } + } + + public object Tag { + get { + return tag; + } + + set { + tag = value; + } + } + public event EventHandler Tick; + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs new file mode 100644 index 0000000..43f0f2a --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs @@ -0,0 +1,16 @@ +namespace System.Windows.Threading +{ + public delegate void DispatcherUnhandledExceptionEventHandler( + object sender, + DispatcherUnhandledExceptionEventArgs e); + + public sealed class DispatcherUnhandledExceptionEventArgs : DispatcherEventArgs + { + public Exception Exception { get; } + public bool Handled { get; set; } + + internal DispatcherUnhandledExceptionEventArgs(Dispatcher dispatcher, Exception exception) + : base(dispatcher) + => Exception = exception; + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableAttribute.cs b/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableAttribute.cs new file mode 100644 index 0000000..e78ac8c --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableAttribute.cs @@ -0,0 +1,36 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; + +namespace System.Windows { + + public abstract class AttachedPropertyBrowsableAttribute : Attribute + { + protected AttachedPropertyBrowsableAttribute () + { + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableForTypeAttribute.cs b/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableForTypeAttribute.cs new file mode 100644 index 0000000..d1f77f6 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableForTypeAttribute.cs @@ -0,0 +1,59 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; + +namespace System.Windows { + + [AttributeUsage (AttributeTargets.Method, AllowMultiple = true)] + public sealed class AttachedPropertyBrowsableForTypeAttribute : AttachedPropertyBrowsableAttribute + { + Type targetType; + + public AttachedPropertyBrowsableForTypeAttribute (Type targetType) + { + this.targetType = targetType; + } + + public Type TargetType { + get { return targetType; } + } + + public override object TypeId { + get { throw new NotImplementedException (); } + } + + public override bool Equals (object obj) + { + throw new NotImplementedException (); + } + + public override int GetHashCode () + { + throw new NotImplementedException (); + } + } + +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableWhenAttributePresentAttribute.cs b/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableWhenAttributePresentAttribute.cs new file mode 100644 index 0000000..6796520 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableWhenAttributePresentAttribute.cs @@ -0,0 +1,54 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; + +namespace System.Windows { + + [AttributeUsage (AttributeTargets.Method, AllowMultiple = false)] + public sealed class AttachedPropertyBrowsableWhenAttributePresentAttribute : AttachedPropertyBrowsableAttribute + { + Type attributeType; + + public AttachedPropertyBrowsableWhenAttributePresentAttribute (Type attributeType) + { + this.attributeType = attributeType; + } + + public Type AttributeType { + get { return attributeType; } + } + + public override bool Equals (object obj) + { + throw new NotImplementedException (); + } + + public override int GetHashCode () + { + throw new NotImplementedException (); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/CoerceValueCallback.cs b/src/Editor/FPF/WindowsBase/System.Windows/CoerceValueCallback.cs new file mode 100644 index 0000000..33eee8c --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/CoerceValueCallback.cs @@ -0,0 +1,29 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +namespace System.Windows { + + public delegate object CoerceValueCallback (DependencyObject d, object baseValue); +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/DependencyObject.cs b/src/Editor/FPF/WindowsBase/System.Windows/DependencyObject.cs new file mode 100644 index 0000000..8eb923a --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/DependencyObject.cs @@ -0,0 +1,145 @@ +// +// DependencyObject.cs +// +// Author: +// Iain McCoy (iain@mccoy.id.au) +// Chris Toshok (toshok@ximian.com) +// +// (C) 2005 Iain McCoy +// (C) 2007 Novell, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System.Collections.Generic; +using System.Windows.Threading; + +namespace System.Windows { + public class DependencyObject : DispatcherObject { + private static Dictionary> propertyDeclarations = new Dictionary>(); + private Dictionary properties = new Dictionary(); + + [MonoTODO] + public bool IsSealed { + get { return false; } + } + + public DependencyObjectType DependencyObjectType { + get { return DependencyObjectType.FromSystemType (GetType()); } + } + + public void ClearValue(DependencyProperty dp) + { + if (IsSealed) + throw new InvalidOperationException ("Cannot manipulate property values on a sealed DependencyObject"); + + properties[dp] = null; + } + + public void ClearValue(DependencyPropertyKey key) + { + ClearValue (key.DependencyProperty); + } + + public void CoerceValue (DependencyProperty dp) + { + PropertyMetadata pm = dp.GetMetadata (this); + if (pm.CoerceValueCallback != null) + pm.CoerceValueCallback (this, GetValue (dp)); + } + + public sealed override bool Equals (object obj) + { + return base.Equals(obj); + } + + public sealed override int GetHashCode () + { + return base.GetHashCode(); + } + + [MonoTODO] + public LocalValueEnumerator GetLocalValueEnumerator() + { + return new LocalValueEnumerator(properties); + } + + public object GetValue(DependencyProperty dp) + { + object val = properties.ContainsKey (dp) ? properties [dp] : null; + return val == null ? dp.DefaultMetadata.DefaultValue : val; + } + + [MonoTODO] + public void InvalidateProperty(DependencyProperty dp) + { + throw new NotImplementedException("InvalidateProperty(DependencyProperty dp)"); + } + + protected virtual void OnPropertyChanged(DependencyPropertyChangedEventArgs e) + { + PropertyMetadata pm = e.Property.GetMetadata (this); + if (pm.PropertyChangedCallback != null) + pm.PropertyChangedCallback (this, e); + } + + public object ReadLocalValue(DependencyProperty dp) + { + object val = properties.ContainsKey (dp) ? properties [dp] : null; + return val == null ? DependencyProperty.UnsetValue : val; + } + + public void SetValue(DependencyProperty dp, object value) + { + if (IsSealed) + throw new InvalidOperationException ("Cannot manipulate property values on a sealed DependencyObject"); + + if (!dp.IsValidType (value)) + throw new ArgumentException ("value not of the correct type for this DependencyProperty"); + + ValidateValueCallback validate = dp.ValidateValueCallback; + if (validate != null && !validate(value)) + throw new Exception("Value does not validate"); + else + properties[dp] = value; + } + + public void SetValue(DependencyPropertyKey key, object value) + { + SetValue (key.DependencyProperty, value); + } + + protected virtual bool ShouldSerializeProperty (DependencyProperty dp) + { + throw new NotImplementedException (); + } + + internal static void register(Type t, DependencyProperty dp) + { + if (!propertyDeclarations.ContainsKey (t)) + propertyDeclarations[t] = new Dictionary(); + Dictionary typeDeclarations = propertyDeclarations[t]; + if (!typeDeclarations.ContainsKey(dp.Name)) + typeDeclarations[dp.Name] = dp; + else + throw new ArgumentException("A property named " + dp.Name + " already exists on " + t.Name); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/DependencyObjectType.cs b/src/Editor/FPF/WindowsBase/System.Windows/DependencyObjectType.cs new file mode 100644 index 0000000..53ec8ab --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/DependencyObjectType.cs @@ -0,0 +1,89 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// (C) 2005 Iain McCoy +// (C) 2007 Novell, Inc. +// +// Authors: +// Iain McCoy (iain@mccoy.id.au) +// Chris Toshok (toshok@ximian.com) +// +// + +using System.Collections.Generic; + +namespace System.Windows { + public class DependencyObjectType { + + private static Dictionary typeMap = new Dictionary(); + private static int current_id; + + private int id; + private Type systemType; + + private DependencyObjectType (int id, Type systemType) + { + this.id = id; + this.systemType = systemType; + } + + public DependencyObjectType BaseType { + get { return DependencyObjectType.FromSystemType (systemType.BaseType); } + } + + public int Id { + get { return id; } + } + + public string Name { + get { return systemType.Name; } + } + + public Type SystemType { + get { return systemType; } + } + + public static DependencyObjectType FromSystemType(Type systemType) + { + if (typeMap.ContainsKey (systemType)) + return typeMap[systemType]; + + DependencyObjectType dot; + + typeMap[systemType] = dot = new DependencyObjectType (current_id++, systemType); + + return dot; + } + + public bool IsInstanceOfType(DependencyObject dependencyObject) + { + return systemType.IsInstanceOfType (dependencyObject); + } + + public bool IsSubclassOf(DependencyObjectType dependencyObjectType) + { + return systemType.IsSubclassOf (dependencyObjectType.SystemType); + } + + public override int GetHashCode () + { + throw new NotImplementedException (); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/DependencyProperty.cs b/src/Editor/FPF/WindowsBase/System.Windows/DependencyProperty.cs new file mode 100644 index 0000000..71a1ead --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/DependencyProperty.cs @@ -0,0 +1,229 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// (C) 2005 Iain McCoy +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Iain McCoy (iain@mccoy.id.au) +// Chris Toshok (toshok@ximian.com) +// + +using System.Collections.Generic; + +namespace System.Windows { + public sealed class DependencyProperty { + private Dictionary metadataByType = new Dictionary(); + + public static readonly object UnsetValue = new object (); + + private DependencyProperty (bool isAttached, string name, Type propertyType, Type ownerType, + PropertyMetadata defaultMetadata, + ValidateValueCallback validateValueCallback) + { + IsAttached = isAttached; + DefaultMetadata = (defaultMetadata == null ? new PropertyMetadata() : defaultMetadata); + Name = name; + OwnerType = ownerType; + PropertyType = propertyType; + ValidateValueCallback = validateValueCallback; + } + + internal bool IsAttached { get; set; } + public bool ReadOnly { get; private set; } + public PropertyMetadata DefaultMetadata { get; private set; } + public string Name { get; private set; } + public Type OwnerType { get; private set; } + public Type PropertyType { get; private set; } + public ValidateValueCallback ValidateValueCallback { get; private set; } + + public int GlobalIndex { + get { throw new NotImplementedException (); } + } + + + public DependencyProperty AddOwner(Type ownerType) + { + return AddOwner (ownerType, null); + } + + public DependencyProperty AddOwner(Type ownerType, PropertyMetadata typeMetadata) + { + if (typeMetadata == null) typeMetadata = new PropertyMetadata (); + OverrideMetadata (ownerType, typeMetadata); + + // MS seems to always return the same DependencyProperty + return this; + } + + public PropertyMetadata GetMetadata(Type forType) + { + if (metadataByType.ContainsKey (forType)) + return metadataByType[forType]; + return null; + } + + public PropertyMetadata GetMetadata(DependencyObject dependencyObject) + { + if (metadataByType.ContainsKey (dependencyObject.GetType())) + return metadataByType[dependencyObject.GetType()]; + return null; + } + + public PropertyMetadata GetMetadata(DependencyObjectType dependencyObjectType) + { + if (metadataByType.ContainsKey (dependencyObjectType.SystemType)) + return metadataByType[dependencyObjectType.SystemType]; + return null; + } + + + public bool IsValidType(object value) + { + return PropertyType.IsInstanceOfType (value); + } + + public bool IsValidValue(object value) + { + if (!IsValidType (value)) + return false; + if (ValidateValueCallback == null) + return true; + return ValidateValueCallback (value); + } + + public void OverrideMetadata(Type forType, PropertyMetadata typeMetadata) + { + if (forType == null) + throw new ArgumentNullException ("forType"); + if (typeMetadata == null) + throw new ArgumentNullException ("typeMetadata"); + + if (ReadOnly) + throw new InvalidOperationException (String.Format ("Cannot override metadata on readonly property '{0}' without using a DependencyPropertyKey", Name)); + + typeMetadata.DoMerge (DefaultMetadata, this, forType); + metadataByType.Add (forType, typeMetadata); + } + + public void OverrideMetadata (Type forType, PropertyMetadata typeMetadata, DependencyPropertyKey key) + { + if (forType == null) + throw new ArgumentNullException ("forType"); + if (typeMetadata == null) + throw new ArgumentNullException ("typeMetadata"); + + + // further checking? should we check + // key.DependencyProperty == this? + + typeMetadata.DoMerge (DefaultMetadata, this, forType); + metadataByType.Add (forType, typeMetadata); + } + + public override string ToString () + { + return Name; + } + + public override int GetHashCode () + { + return Name.GetHashCode() ^ PropertyType.GetHashCode() ^ OwnerType.GetHashCode(); + } + + public static DependencyProperty Register(string name, Type propertyType, Type ownerType) + { + return Register(name, propertyType, ownerType, null, null); + } + + public static DependencyProperty Register(string name, Type propertyType, Type ownerType, + PropertyMetadata typeMetadata) + { + return Register(name, propertyType, ownerType, typeMetadata, null); + } + + public static DependencyProperty Register(string name, Type propertyType, Type ownerType, + PropertyMetadata typeMetadata, + ValidateValueCallback validateValueCallback) + { + if (typeMetadata == null) + typeMetadata = new PropertyMetadata(); + + DependencyProperty dp = new DependencyProperty(false, name, propertyType, ownerType, + typeMetadata, validateValueCallback); + DependencyObject.register(ownerType, dp); + + dp.OverrideMetadata (ownerType, typeMetadata); + + return dp; + } + + public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType) + { + return RegisterAttached(name, propertyType, ownerType, null, null); + } + + public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType, + PropertyMetadata defaultMetadata) + { + return RegisterAttached(name, propertyType, ownerType, defaultMetadata, null); + } + + public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType, + PropertyMetadata defaultMetadata, + ValidateValueCallback validateValueCallback) + { + DependencyProperty dp = new DependencyProperty(true, name, propertyType, ownerType, + defaultMetadata, validateValueCallback); + DependencyObject.register(ownerType, dp); + return dp; + } + + public static DependencyPropertyKey RegisterAttachedReadOnly(string name, Type propertyType, Type ownerType, + PropertyMetadata defaultMetadata) + { + throw new NotImplementedException("RegisterAttachedReadOnly(string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata)"); + } + + public static DependencyPropertyKey RegisterAttachedReadOnly(string name, Type propertyType, Type ownerType, + PropertyMetadata defaultMetadata, + ValidateValueCallback validateValueCallback) + { + throw new NotImplementedException("RegisterAttachedReadOnly(string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, ValidateValueCallback validateValueCallback)"); + } + + public static DependencyPropertyKey RegisterReadOnly(string name, Type propertyType, Type ownerType, + PropertyMetadata typeMetadata) + { + return RegisterReadOnly (name, propertyType, ownerType, typeMetadata, null); + } + + + public static DependencyPropertyKey RegisterReadOnly(string name, Type propertyType, Type ownerType, + PropertyMetadata typeMetadata, + ValidateValueCallback validateValueCallback) + { + DependencyProperty prop = Register (name, propertyType, ownerType, typeMetadata, validateValueCallback); + prop.ReadOnly = true; + return new DependencyPropertyKey (prop); + } + + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventArgs.cs b/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventArgs.cs new file mode 100644 index 0000000..782e881 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventArgs.cs @@ -0,0 +1,83 @@ +// +// DependencyPropertyChangedEventArgs.cs +// +// Author: +// Chris Toshok (toshok@ximian.com) +// +// (C) 2007 Novell, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +namespace System.Windows { + public struct DependencyPropertyChangedEventArgs { + + public DependencyPropertyChangedEventArgs (DependencyProperty property, object oldValue, object newValue) + : this () + { + this.Property = property; + this.OldValue = oldValue; + this.NewValue = newValue; + } + + public object NewValue { + get; private set; + } + + public object OldValue { + get; private set; + } + + public DependencyProperty Property { + get; private set; + } + + public override bool Equals (object obj) + { + if (!(obj is DependencyPropertyChangedEventArgs)) + return false; + + return Equals ((DependencyPropertyChangedEventArgs)obj); + } + + public bool Equals (DependencyPropertyChangedEventArgs args) + { + return (Property == args.Property && + NewValue == args.NewValue && + OldValue == args.OldValue); + } + + public static bool operator != (DependencyPropertyChangedEventArgs left, DependencyPropertyChangedEventArgs right) + { + throw new NotImplementedException (); + } + + public static bool operator == (DependencyPropertyChangedEventArgs left, DependencyPropertyChangedEventArgs right) + { + throw new NotImplementedException (); + } + + public override int GetHashCode() + { + throw new NotImplementedException (); + } + + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventHandler.cs b/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventHandler.cs new file mode 100644 index 0000000..7673af4 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventHandler.cs @@ -0,0 +1,31 @@ +// +// DependencyPropertyChangedEventHandler.cs +// +// Author: +// Chris Toshok (toshok@ximian.com) +// +// (C) 2007 Novell, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +namespace System.Windows { + public delegate void DependencyPropertyChangedEventHandler (object sender, DependencyPropertyChangedEventArgs e); +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyKey.cs b/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyKey.cs new file mode 100644 index 0000000..7f530ed --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/DependencyPropertyKey.cs @@ -0,0 +1,46 @@ +// +// DependencyPropertyKey.cs +// +// Author: +// Iain McCoy (iain@mccoy.id.au) +// +// (C) 2005 Iain McCoy +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +namespace System.Windows { + public sealed class DependencyPropertyKey { + internal DependencyPropertyKey (DependencyProperty dependencyProperty) + { + this.dependencyProperty = dependencyProperty; + } + + private DependencyProperty dependencyProperty; + public DependencyProperty DependencyProperty { + get { return dependencyProperty; } + } + + public void OverrideMetadata(Type forType, PropertyMetadata typeMetadata) + { + dependencyProperty.OverrideMetadata (forType, typeMetadata, this); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/Expression.cs b/src/Editor/FPF/WindowsBase/System.Windows/Expression.cs new file mode 100644 index 0000000..d3a02f0 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/Expression.cs @@ -0,0 +1,39 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; + +namespace System.Windows { + + [TypeConverter (typeof (ExpressionConverter))] + public class Expression + { + internal Expression () + { + } + } + +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/ExpressionConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows/ExpressionConverter.cs new file mode 100644 index 0000000..480424e --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/ExpressionConverter.cs @@ -0,0 +1,60 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows { + + public class ExpressionConverter : TypeConverter + { + public ExpressionConverter () + { + } + + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + throw new NotImplementedException (); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + throw new NotImplementedException (); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) + { + throw new NotImplementedException (); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + throw new NotImplementedException (); + } + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows/Freezable.cs b/src/Editor/FPF/WindowsBase/System.Windows/Freezable.cs new file mode 100644 index 0000000..f11dac2 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/Freezable.cs @@ -0,0 +1,147 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +namespace System.Windows { + + public abstract class Freezable : DependencyObject { + protected Freezable () { + } + + public Freezable Clone () + { + throw new NotImplementedException (); + } + + protected virtual void CloneCore (Freezable sourceFreezable) + { + throw new NotImplementedException (); + } + + public Freezable CloneCurrentValue () + { + throw new NotImplementedException (); + } + + protected virtual void CloneCurrentValueCore (Freezable sourceFreezable) + { + throw new NotImplementedException (); + } + + protected Freezable CreateInstance () + { + throw new NotImplementedException (); + } + + protected abstract Freezable CreateInstanceCore (); + + public void Freeze () + { + IsFrozen = true; + } + + protected static bool Freeze (Freezable freezable, + bool isChecking) + { + throw new NotImplementedException (); + } + + protected virtual bool FreezeCore (bool isChecking) + { + IsFrozen = true; + return true; + } + + public Freezable GetAsFrozen () + { + throw new NotImplementedException (); + } + + protected virtual void GetAsFrozenCore (Freezable sourceFreezable) + { + throw new NotImplementedException (); + } + + public Freezable GetCurrentValueAsFrozen () + { + throw new NotImplementedException (); + } + + protected virtual void GetCurrentValueAsFrozenCore (Freezable sourceFreezable) + { + throw new NotImplementedException (); + } + + protected virtual void OnChanged () + { + throw new NotImplementedException (); + } + + protected void OnFreezablePropertyChanged (DependencyObject oldValue, + DependencyObject newValue) + + { + throw new NotImplementedException (); + } + + protected void OnFreezablePropertyChanged (DependencyObject oldValue, + DependencyObject newValue, + DependencyProperty property) + { + throw new NotImplementedException (); + } + + protected override void OnPropertyChanged (DependencyPropertyChangedEventArgs e) + { + throw new NotImplementedException (); + } + + protected void ReadPreamble () + { + throw new NotImplementedException (); + } + + protected void WritePostscript () + { + throw new NotImplementedException (); + } + + protected void WritePreamble () + { + throw new NotImplementedException (); + } + + public bool CanFreeze { + get { return FreezeCore (true); } + } + + public bool IsFrozen { + get; private set; + } + + public event EventHandler Changed; + } + +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows/IWeakEventListener.cs b/src/Editor/FPF/WindowsBase/System.Windows/IWeakEventListener.cs new file mode 100644 index 0000000..95c2365 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/IWeakEventListener.cs @@ -0,0 +1,32 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok +// + +using System; + +namespace System.Windows { + public interface IWeakEventListener { + bool ReceiveWeakEvent (Type managerType, object sender, EventArgs e); + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/Int32Rect.cs b/src/Editor/FPF/WindowsBase/System.Windows/Int32Rect.cs new file mode 100644 index 0000000..815fee0 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/Int32Rect.cs @@ -0,0 +1,193 @@ +// +// DependencyPropertyChangedEventArgs.cs +// +// Author: +// Chris Toshok (toshok@ximian.com) +// +// (C) 2007 Novell, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System.ComponentModel; +using System.Globalization; +using System.Windows.Converters; +using System.Windows.Markup; + +namespace System.Windows { + + [Serializable] + [TypeConverter (typeof(Int32RectConverter))] + [ValueSerializer (typeof(Int32RectValueSerializer))] + public struct Int32Rect : IFormattable + { + int _x, _y, _width, _height; + + public Int32Rect (int x, int y, int width, int height) + { + this._x = x; + this._y = y; + this._width = width; + this._height = height; + } + + public static bool operator != (Int32Rect int32Rect1, Int32Rect int32Rect2) + { + return !int32Rect1.Equals(int32Rect2); + } + + public static bool operator == (Int32Rect int32Rect1, Int32Rect int32Rect2) + { + return int32Rect1.Equals(int32Rect2); + } + + public static Int32Rect Empty { + get { return new Int32Rect (0, 0, 0, 0); } + } + + public int Height { + get { return _height; } + set { _height = value; } + } + + public bool IsEmpty { + get { return _width == 0 && _height == 0; } + } + + public int Width { + get { return _width; } + set { _width = value; } + } + + public int X { + get { return _x; } + set { _x = value; } + } + + public int Y { + get { return _y; } + set { _y = value; } + } + + public bool Equals (Int32Rect value) + { + return (_x == value._x && + _y == value._y && + _width == value._width && + _height == value._height); + } + + public override bool Equals (object o) + { + if (!(o is Int32Rect)) + return false; + + return Equals ((Int32Rect)o); + } + + public static bool Equals (Int32Rect int32Rect1, Int32Rect int32Rect2) + { + return int32Rect1.Equals (int32Rect2); + } + + public override int GetHashCode () + { + unchecked + { + var hashCode = _x; + hashCode = (hashCode * 397) ^ _y; + hashCode = (hashCode * 397) ^ _width; + hashCode = (hashCode * 397) ^ _height; + return hashCode; + } + } + + public static Int32Rect Parse (string source) + { + if (source == null) + throw new ArgumentNullException ("source"); + Int32Rect value; + if (source.Trim () == "Empty") + { + value = Empty; + } + else + { + var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); + int x; + int y; + int width; + int height; + if (int.TryParse (tokenizer.GetNextToken (), NumberStyles.Integer, CultureInfo.InvariantCulture, out x) + && int.TryParse (tokenizer.GetNextToken (), NumberStyles.Integer, CultureInfo.InvariantCulture, out y) + && int.TryParse (tokenizer.GetNextToken (), NumberStyles.Integer, CultureInfo.InvariantCulture, out width) + && int.TryParse (tokenizer.GetNextToken (), NumberStyles.Integer, CultureInfo.InvariantCulture, out height)) + { + if (!tokenizer.HasNoMoreTokens ()) + { + throw new InvalidOperationException ("Invalid Int32Rect format: " + source); + } + value = new Int32Rect (x, y, width, height); + } + else + { + throw new FormatException (string.Format ("Invalid Int32Rect format: {0}", source)); + } + } + return value; + } + + public override string ToString () + { + return ToString (null); + } + + public string ToString (IFormatProvider provider) + { + return ToString (null, provider); + } + + string IFormattable.ToString (string format, IFormatProvider provider) + { + return ToString (provider); + } + + private string ToString (string format, IFormatProvider provider) + { + if (IsEmpty) + return "Empty"; + + if (provider == null) + provider = CultureInfo.CurrentCulture; + + if (format == null) + format = string.Empty; + + var separator = NumericListTokenizer.GetSeparator (provider); + + var rectFormat = string.Format ( + "{{0:{0}}}{1}{{1:{0}}}{1}{{2:{0}}}{1}{{3:{0}}}", + format, separator); + return string.Format (provider, rectFormat, + _x, _y, _width, _height); + } + } +} + diff --git a/src/Editor/FPF/WindowsBase/System.Windows/Int32RectConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows/Int32RectConverter.cs new file mode 100644 index 0000000..990b385 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/Int32RectConverter.cs @@ -0,0 +1,57 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows { + + public sealed class Int32RectConverter : TypeConverter + { + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof (string); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + return destinationType == typeof (string); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (!(value is string)) + throw new NotSupportedException ("Int32RectConvert only supports converting from strings"); + + return Int32Rect.Parse ((string)value); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + return ((Int32Rect)value).ToString (culture); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/LocalValueEntry.cs b/src/Editor/FPF/WindowsBase/System.Windows/LocalValueEntry.cs new file mode 100644 index 0000000..8ef695a --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/LocalValueEntry.cs @@ -0,0 +1,68 @@ +// +// LocalValueEntry.cs +// +// Author: +// Iain McCoy (iain@mccoy.id.au) +// +// (C) 2005 Iain McCoy +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +namespace System.Windows { + public struct LocalValueEntry { + private DependencyProperty property; + private object value; + + internal LocalValueEntry(DependencyProperty property, object value) + { + this.property = property; + this.value = value; + } + + public DependencyProperty Property { + get { return property; } + } + + public object Value { + get { return value; } + } + + public static bool operator != (LocalValueEntry obj1, LocalValueEntry obj2) + { + throw new NotImplementedException (); + } + + public static bool operator == (LocalValueEntry obj1, LocalValueEntry obj2) + { + throw new NotImplementedException (); + } + + public override bool Equals (object obj) + { + throw new NotImplementedException (); + } + + public override int GetHashCode () + { + throw new NotImplementedException (); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/LocalValueEnumerator.cs b/src/Editor/FPF/WindowsBase/System.Windows/LocalValueEnumerator.cs new file mode 100644 index 0000000..bbabfca --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/LocalValueEnumerator.cs @@ -0,0 +1,88 @@ +// +// LocalValueEnumerator.cs +// +// Author: +// Iain McCoy (iain@mccoy.id.au) +// +// (C) 2005 Iain McCoy +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + + +using System.Collections; +using System.Collections.Generic; + +namespace System.Windows { + public struct LocalValueEnumerator : IEnumerator { + private IDictionaryEnumerator propertyEnumerator; + private Dictionary properties; + + private int count; + + internal LocalValueEnumerator(Dictionary properties) + { + this.count = properties.Count; + this.properties = properties; + this.propertyEnumerator = properties.GetEnumerator(); + } + + public int Count { + get { return count; } + } + + public LocalValueEntry Current { + get { return new LocalValueEntry((DependencyProperty)propertyEnumerator.Key, + propertyEnumerator.Value); } + } + object IEnumerator.Current { + get { return this.Current; } + } + + public bool MoveNext() + { + return propertyEnumerator.MoveNext(); + } + public void Reset() + { + propertyEnumerator.Reset(); + } + + public static bool operator != (LocalValueEnumerator obj1, LocalValueEnumerator obj2) + { + throw new NotImplementedException (); + } + + public static bool operator == (LocalValueEnumerator obj1, LocalValueEnumerator obj2) + { + throw new NotImplementedException (); + } + + public override bool Equals (object obj) + { + throw new NotImplementedException (); + } + + public override int GetHashCode () + { + throw new NotImplementedException (); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/NumericListTokenizer.cs b/src/Editor/FPF/WindowsBase/System.Windows/NumericListTokenizer.cs new file mode 100644 index 0000000..81905ec --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/NumericListTokenizer.cs @@ -0,0 +1,102 @@ +using System.Globalization; + +namespace System.Windows +{ + /// + /// Helper class for parsing serialized data structures from the System.Windows namespace. + /// + internal class NumericListTokenizer + { + private readonly string _str; + private readonly char _separator; + private int _position; + + private enum Symbol + { + Token, + Separator, + Whitspace, + EndOfLine + } + + public NumericListTokenizer (string str, IFormatProvider formatProvider) + { + _str = str ?? throw new ArgumentNullException (nameof(str)); + _separator = GetSeparator (formatProvider ?? throw new ArgumentNullException (nameof(formatProvider))); + } + + public static char GetSeparator (IFormatProvider formatProvider) + { + // By convention, string representations of target classes always use ';' as a separator + // if the decimal number separator is ','. Otherwise, the separator is ','. + return NumberFormatInfo.GetInstance (formatProvider).NumberDecimalSeparator != "," ? ',' : ';'; + } + + private Symbol GetCurrentSymbol () + { + if (_position >= _str.Length) + return Symbol.EndOfLine; + if (_str[_position] == _separator) + return Symbol.Separator; + if (char.IsWhiteSpace (_str, _position)) + return Symbol.Whitspace; + return Symbol.Token; + } + + private void SkipAllWhitespaces () + { + while (GetCurrentSymbol () == Symbol.Whitspace) + { + _position++; + } + } + + private void SkipNextDelimeter () + { + SkipAllWhitespaces (); + switch (GetCurrentSymbol ()) + { + case Symbol.Token: + return; + case Symbol.Separator: + _position++; + SkipAllWhitespaces (); + return; + default: + throw new InvalidOperationException ("Separator not found"); + } + } + + public bool HasNoMoreTokens () + { + SkipAllWhitespaces (); + return GetCurrentSymbol () == Symbol.EndOfLine; + } + + public string GetNextToken () + { + var length = 0; + if (_position == 0) + { + SkipAllWhitespaces (); + } + else + { + SkipNextDelimeter (); + } + + while (GetCurrentSymbol () == Symbol.Token) + { + _position++; + length++; + } + + if (length == 0) + { + throw new InvalidOperationException ("Next token not found"); + } + + return _str.Substring (_position - length, length); + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows/Point.cs b/src/Editor/FPF/WindowsBase/System.Windows/Point.cs new file mode 100644 index 0000000..af57f92 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/Point.cs @@ -0,0 +1,196 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@novell.com) +// + +using System; +using System.ComponentModel; +using System.Windows.Converters; +using System.Windows.Markup; +using System.Windows.Media; +using System.Globalization; + +namespace System.Windows { + + [Serializable] + [TypeConverter (typeof (PointConverter))] + [ValueSerializer (typeof (PointValueSerializer))] + public struct Point : IFormattable + { + public Point (double x, double y) + { + this._x = x; + this._y = y; + } + + public double X { + get { return _x; } + set { _x = value; } + } + + public double Y { + get { return _y; } + set { _y = value; } + } + + public override bool Equals (object o) + { + if (!(o is Point)) + return false; + return Equals ((Point)o); + } + + public bool Equals (Point value) + { + return _x == value.X && _y == value.Y; + } + + public override int GetHashCode () + { + return (_x.GetHashCode() ^ _y.GetHashCode()); + } + + + public void Offset (double offsetX, double offsetY) + { + _x += offsetX; + _y += offsetY; + } + + public static Point Add (Point point, Vector vector) + { + return new Point (point.X + vector.X, point.Y + vector.Y); + } + + public static bool Equals (Point point1, Point point2) + { + return point1.Equals (point2); + } + + public static Point Multiply (Point point, Matrix matrix) + { + return new Point (point.X * matrix.M11 + point.Y * matrix.M21 + matrix.OffsetX, + point.X * matrix.M12 + point.Y * matrix.M22 + matrix.OffsetY); + } + + public static Vector Subtract (Point point1, Point point2) + { + return new Vector (point1.X - point2.X, point1.Y - point2.Y); + } + + public static Point Subtract (Point point, Vector vector) + { + return new Point (point.X - vector.X, point.Y - vector.Y); + } + + /* operators */ + + public static Vector operator -(Point point1, Point point2) + { + return Subtract (point1, point2); + } + + public static Point operator -(Point point, Vector vector) + { + return Subtract (point, vector); + } + + public static Point operator + (Point point, Vector vector) + { + return Add (point, vector); + } + + public static Point operator * (Point point, Matrix matrix) + { + return Multiply (point, matrix); + } + + public static bool operator != (Point point1, Point point2) + { + return !point1.Equals(point2); + } + + public static bool operator == (Point point1, Point point2) + { + return point1.Equals(point2); + } + + public static explicit operator Size (Point point) + { + return new Size (point.X, point.Y); + } + + public static explicit operator Vector (Point point) + { + return new Vector (point.X, point.Y); + } + + public static Point Parse (string source) + { + if (source == null) + throw new ArgumentNullException ("source"); + var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); + double x; + double y; + if (!double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out x) || + !double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out y)) + { + throw new FormatException (string.Format ("Invalid Point format: {0}", source)); + } + if (!tokenizer.HasNoMoreTokens ()) + { + throw new InvalidOperationException ("Invalid Point format: " + source); + } + return new Point(x, y); + } + + public override string ToString () + { + return this.ToString(null, null); + } + + public string ToString (IFormatProvider provider) + { + return this.ToString(null, provider); + } + + private string ToString(string format,IFormatProvider formatProvider) + { + if (formatProvider == null) + formatProvider = CultureInfo.CurrentCulture; + if (format == null) + format = string.Empty; + var separator = NumericListTokenizer.GetSeparator (formatProvider); + var pointFormat = string.Format ("{{0:{0}}}{1}{{1:{0}}}", format, separator); + return string.Format (formatProvider, pointFormat, _x, _y); + } + + string IFormattable.ToString (string format, IFormatProvider formatProvider) + { + return this.ToString(format, formatProvider); + } + + double _x; + double _y; + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/PointConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows/PointConverter.cs new file mode 100644 index 0000000..eef6c52 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/PointConverter.cs @@ -0,0 +1,57 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows { + + public sealed class PointConverter : TypeConverter + { + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof (string); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + return destinationType == typeof (string); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (!(value is string)) + throw new NotSupportedException ("PointConverter only supports converting from strings"); + + return Point.Parse ((string)value); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + return ((Point)value).ToString (culture); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/PropertyChangedCallback.cs b/src/Editor/FPF/WindowsBase/System.Windows/PropertyChangedCallback.cs new file mode 100644 index 0000000..dfcfee2 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/PropertyChangedCallback.cs @@ -0,0 +1,29 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +namespace System.Windows { + + public delegate void PropertyChangedCallback (DependencyObject d, DependencyPropertyChangedEventArgs e); +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/PropertyMetadata.cs b/src/Editor/FPF/WindowsBase/System.Windows/PropertyMetadata.cs new file mode 100644 index 0000000..1432b0b --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/PropertyMetadata.cs @@ -0,0 +1,121 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// (C) 2005 Iain McCoy +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Iain McCoy (iain@mccoy.id.au) +// Chris Toshok (toshok@ximian.com) +// + +namespace System.Windows { + public class PropertyMetadata { + private object defaultValue; + private bool isSealed; + private PropertyChangedCallback propertyChangedCallback; + private CoerceValueCallback coerceValueCallback; + + protected bool IsSealed { + get { return isSealed; } + } + + public object DefaultValue { + get { return defaultValue; } + set { + if (IsSealed) + throw new InvalidOperationException ("Cannot change metadata once it has been applied to a property"); + if (value == DependencyProperty.UnsetValue) + throw new ArgumentException ("Cannot set property metadata's default value to 'Unset'"); + + defaultValue = value; + } + } + + public PropertyChangedCallback PropertyChangedCallback { + get { return propertyChangedCallback; } + set { + if (IsSealed) + throw new InvalidOperationException ("Cannot change metadata once it has been applied to a property"); + propertyChangedCallback = value; + } + } + + public CoerceValueCallback CoerceValueCallback { + get { return coerceValueCallback; } + set { + if (IsSealed) + throw new InvalidOperationException ("Cannot change metadata once it has been applied to a property"); + coerceValueCallback = value; + } + } + + public PropertyMetadata() + : this (null, null, null) + { + } + + public PropertyMetadata(object defaultValue) + : this (defaultValue, null, null) + { + } + + public PropertyMetadata (PropertyChangedCallback propertyChangedCallback) + : this (null, propertyChangedCallback, null) + { + } + + public PropertyMetadata (object defaultValue, PropertyChangedCallback propertyChangedCallback) + : this (defaultValue, propertyChangedCallback, null) + { + } + + public PropertyMetadata (object defaultValue, PropertyChangedCallback propertyChangedCallback, CoerceValueCallback coerceValueCallback) + { + if (defaultValue == DependencyProperty.UnsetValue) + throw new ArgumentException ("Cannot initialize property metadata's default value to 'Unset'"); + + this.defaultValue = defaultValue; + this.propertyChangedCallback = propertyChangedCallback; + this.coerceValueCallback = coerceValueCallback; + } + + protected virtual void Merge (PropertyMetadata baseMetadata, DependencyProperty dp) + { + if (defaultValue == null) + defaultValue = baseMetadata.defaultValue; + if (propertyChangedCallback == null) + propertyChangedCallback = baseMetadata.propertyChangedCallback; + if (coerceValueCallback == null) + coerceValueCallback = baseMetadata.coerceValueCallback; + } + + protected virtual void OnApply (DependencyProperty dp, Type targetType) + { + } + + internal void DoMerge (PropertyMetadata baseMetadata, DependencyProperty dp, Type targetType) + { + Merge (baseMetadata, dp); + OnApply (dp, targetType); + isSealed = true; + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/Rect.cs b/src/Editor/FPF/WindowsBase/System.Windows/Rect.cs new file mode 100644 index 0000000..6e2e3d9 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/Rect.cs @@ -0,0 +1,501 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok +// Sebastien Pouliot +// + +using System.ComponentModel; +using System.Globalization; +using System.Windows.Converters; +using System.Windows.Markup; +using System.Windows.Media; + +namespace System.Windows { + + [Serializable] + [ValueSerializer (typeof (RectValueSerializer))] + [TypeConverter (typeof (RectConverter))] + public struct Rect : IFormattable + { + public Rect (Size size) + { + _x = _y = 0.0; + _width = size.Width; + _height = size.Height; + } + + public Rect (Point point, Vector vector) : this (point, Point.Add (point, vector)) + { } + + public Rect (Point point1, Point point2) + { + if (point1.X < point2.X) { + _x = point1.X; + _width = point2.X - point1.X; + } + else { + _x = point2.X; + _width = point1.X - point2.X; + } + + if (point1.Y < point2.Y) { + _y = point1.Y; + _height = point2.Y - point1.Y; + } + else { + _y = point2.Y; + _height = point1.Y - point2.Y; + } + } + + public Rect (double x, double y, double width, double height) + { + if (width < 0 || height < 0) + throw new ArgumentException ("width and height must be non-negative."); + this._x = x; + this._y = y; + this._width = width; + this._height = height; + } + + public Rect (Point location, Size size) + { + _x = location.X; + _y = location.Y; + _width = size.Width; + _height = size.Height; + } + + public bool Equals (Rect value) + { + return (_x == value.X && + _y == value.Y && + _width == value.Width && + _height == value.Height); + } + + public static bool operator != (Rect rect1, Rect rect2) + { + return !(rect1.Location == rect2.Location && rect1.Size == rect2.Size); + } + + public static bool operator == (Rect rect1, Rect rect2) + { + return rect1.Location == rect2.Location && rect1.Size == rect2.Size; + } + + public override bool Equals (object o) + { + if (!(o is Rect)) + return false; + + return Equals ((Rect)o); + } + + public static bool Equals (Rect rect1, Rect rect2) + { + return rect1.Equals (rect2); + } + + public override int GetHashCode () + { + unchecked + { + var hashCode = _x.GetHashCode (); + hashCode = (hashCode * 397) ^ _y.GetHashCode (); + hashCode = (hashCode * 397) ^ _width.GetHashCode (); + hashCode = (hashCode * 397) ^ _height.GetHashCode (); + return hashCode; + } + } + + public bool Contains (Rect rect) + { + if (rect.Left < this.Left || + rect.Right > this.Right) + return false; + + if (rect.Top < this.Top || + rect.Bottom > this.Bottom) + return false; + + return true; + } + + public bool Contains (double x, double y) + { + if (x < Left || x > Right) + return false; + if (y < Top || y > Bottom) + return false; + + return true; + } + + public bool Contains (Point point) + { + return Contains (point.X, point.Y); + } + + public static Rect Inflate (Rect rect, double width, double height) + { + if (width < rect.Width * -2) + return Rect.Empty; + if (height < rect.Height * -2) + return Rect.Empty; + + Rect result = rect; + result.Inflate (width, height); + return result; + } + + public static Rect Inflate (Rect rect, Size size) + { + return Rect.Inflate (rect, size.Width, size.Height); + } + + public void Inflate (double width, double height) + { + // XXX any error checking like in the static case? + _x -= width; + _y -= height; + + this._width += 2*width; + this._height += 2*height; + } + + public void Inflate (Size size) + { + Inflate (size.Width, size.Height); + } + + public bool IntersectsWith(Rect rect) + { + return !((Left >= rect.Right) || (Right <= rect.Left) || + (Top >= rect.Bottom) || (Bottom <= rect.Top)); + } + + public void Intersect(Rect rect) + { + double _x = Math.Max (this._x, rect._x); + double _y = Math.Max (this._y, rect._y); + double _width = Math.Min (Right, rect.Right) - _x; + double _height = Math.Min (Bottom, rect.Bottom) - _y; + + if (_width < 0 || _height < 0) { + this._x = this._y = Double.PositiveInfinity; + this._width = this._height = Double.NegativeInfinity; + } + else { + this._x = _x; + this._y = _y; + this._width = _width; + this._height = _height; + } + } + + public static Rect Intersect(Rect rect1, Rect rect2) + { + Rect result = rect1; + result.Intersect (rect2); + return result; + } + + public void Offset(double offsetX, double offsetY) + { + _x += offsetX; + _y += offsetY; + } + + public static Rect Offset(Rect rect, double offsetX, double offsetY) + { + Rect result = rect; + result.Offset (offsetX, offsetY); + return result; + } + + public void Offset (Vector offsetVector) + { + _x += offsetVector.X; + _y += offsetVector.Y; + } + + public static Rect Offset (Rect rect, Vector offsetVector) + { + Rect result = rect; + result.Offset (offsetVector); + return result; + } + + public void Scale(double scaleX, double scaleY) + { + _x *= scaleX; + _y *= scaleY; + _width *= scaleX; + _height *= scaleY; + } + + public void Transform (Matrix matrix) + { + throw new NotImplementedException (); + } + + public static Rect Transform (Rect rect, Matrix matrix) + { + Rect result = rect; + result.Transform (matrix); + return result; + } + + public static Rect Union(Rect rect1, Rect rect2) + { + Rect result = rect1; + result.Union (rect2); + return result; + } + + public static Rect Union(Rect rect, Point point) + { + Rect result = rect; + result.Union (point); + return result; + } + + public void Union(Rect rect) + { + var left = Math.Min (Left, rect.Left); + var top = Math.Min (Top, rect.Top); + var right = Math.Max (Right, rect.Right); + var bottom = Math.Max (Bottom, rect.Bottom); + + _x = left; + _y = top; + _width = right - left; + _height = bottom - top; + } + + public void Union(Point point) + { + Union (new Rect (point, point)); + } + + public static Rect Parse (string source) + { + if (source == null) + throw new ArgumentNullException ("source"); + Rect value; + if (source.Trim () == "Empty") + { + value = Empty; + } + else + { + var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); + double x; + double y; + double width; + double height; + if (double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out x) + && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out y) + && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out width) + && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out height)) + { + if (!tokenizer.HasNoMoreTokens ()) + { + throw new InvalidOperationException ("Invalid Rect format: " + source); + } + value = new Rect (x, y, width, height); + } + else + { + throw new FormatException (string.Format ("Invalid Rect format: {0}", source)); + } + } + return value; + } + + public override string ToString () + { + return ToString (null); + } + + public string ToString (IFormatProvider provider) + { + return ToString (null, provider); + } + + string IFormattable.ToString (string format, IFormatProvider provider) + { + return ToString (format, provider); + } + + private string ToString (string format, IFormatProvider provider) + { + if (IsEmpty) + return "Empty"; + + if (provider == null) + provider = CultureInfo.CurrentCulture; + + if (format == null) + format = string.Empty; + + var separator = NumericListTokenizer.GetSeparator (provider); + + var rectFormat = string.Format ( + "{{0:{0}}}{1}{{1:{0}}}{1}{{2:{0}}}{1}{{3:{0}}}", + format, separator); + return string.Format (provider, rectFormat, + _x, _y, _width, _height); + } + + public static Rect Empty { + get { + Rect r = new Rect (); + r._x = r._y = Double.PositiveInfinity; + r._width = r._height = Double.NegativeInfinity; + return r; + } + } + + public bool IsEmpty { + get { + return (_x == Double.PositiveInfinity && + _y == Double.PositiveInfinity && + _width == Double.NegativeInfinity && + _height == Double.NegativeInfinity); + } + } + + public Point Location { + get { + return new Point (_x, _y); + } + set { + if (IsEmpty) + throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); + + _x = value.X; + _y = value.Y; + } + } + + public Size Size { + get { + if (IsEmpty) + return Size.Empty; + return new Size (_width, _height); + } + set { + if (IsEmpty) + throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); + + _width = value.Width; + _height = value.Height; + } + } + + public double X { + get { return _x; } + set { + if (IsEmpty) + throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); + + _x = value; + } + } + + public double Y { + get { return _y; } + set { + if (IsEmpty) + throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); + + _y = value; + } + } + + public double Width { + get { return _width; } + set { + if (IsEmpty) + throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); + + if (value < 0) + throw new ArgumentException ("width must be non-negative."); + + _width = value; + } + } + + public double Height { + get { return _height; } + set { + if (IsEmpty) + throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); + + if (value < 0) + throw new ArgumentException ("height must be non-negative."); + + _height = value; + } + } + + public double Left { + get { return _x; } + } + + public double Top { + get { return _y; } + } + + public double Right { + get { return _x + _width; } + } + + public double Bottom { + get { return _y + _height; } + } + + public Point TopLeft { + get { return new Point (Left, Top); } + } + + public Point TopRight { + get { return new Point (Right, Top); } + } + + public Point BottomLeft { + get { return new Point (Left, Bottom); } + } + + public Point BottomRight { + get { return new Point (Right, Bottom); } + } + + double _x; + double _y; + double _width; + double _height; + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/RectConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows/RectConverter.cs new file mode 100644 index 0000000..07fe262 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/RectConverter.cs @@ -0,0 +1,57 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows { + + public sealed class RectConverter : TypeConverter + { + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof (string); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + return destinationType == typeof (string); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (!(value is string)) + throw new NotSupportedException ("RectConverter only supports converting from strings"); + + return Rect.Parse ((string)value); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + return ((Rect)value).ToString (culture); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/Size.cs b/src/Editor/FPF/WindowsBase/System.Windows/Size.cs new file mode 100644 index 0000000..c1095ab --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/Size.cs @@ -0,0 +1,192 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@novell.com) +// + +using System; +using System.ComponentModel; +using System.Globalization; +using System.Windows.Converters; +using System.Windows.Markup; + +namespace System.Windows { + + [Serializable] + [ValueSerializer (typeof (SizeValueSerializer))] + [TypeConverter (typeof (SizeConverter))] + public struct Size : IFormattable + { + public Size (double width, double height) + { + if (width < 0 || height < 0) + throw new ArgumentException ("Width and Height must be non-negative."); + + this._width = width; + this._height = height; + } + + public bool Equals (Size value) + { + return _width == value.Width && _height == value.Height; + } + + public override bool Equals (object o) + { + if (!(o is Size)) + return false; + + return Equals ((Size)o); + } + + public static bool Equals (Size size1, Size size2) + { + return size1.Equals (size2); + } + + public override int GetHashCode () + { + unchecked + { + return (_width.GetHashCode () * 397) ^ _height.GetHashCode (); + } + } + + public static Size Parse (string source) + { + if (source == null) + throw new ArgumentNullException ("source"); + + if (source.Trim () == "Empty") + { + return Empty; + } + var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); + double width; + double height; + if (!double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out width) || + !double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out height)) + { + throw new FormatException (string.Format ("Invalid Size format: {0}", source)); + } + if (!tokenizer.HasNoMoreTokens ()) + { + throw new InvalidOperationException ("Invalid Size format: " + source); + } + return new Size(width, height); + } + + public override string ToString () + { + return ConvertToString (null, null); + } + + public string ToString (IFormatProvider provider) + { + return ConvertToString (null, provider); + } + + string IFormattable.ToString (string format, IFormatProvider provider) + { + return ConvertToString (format, provider); + } + + private string ConvertToString (string format, IFormatProvider provider) + { + if (IsEmpty) + return "Empty"; + + if (provider == null) + provider = CultureInfo.CurrentCulture; + if (format == null) + format = string.Empty; + var separator = NumericListTokenizer.GetSeparator (provider); + var vectorFormat = string.Format ("{{0:{0}}}{1}{{1:{0}}}", format, separator); + return string.Format (provider, vectorFormat, _width, _height); + } + + public bool IsEmpty { + get { + return (_width == Double.NegativeInfinity && + _height == Double.NegativeInfinity); + } + } + + public double Height { + get { return _height; } + set { + if (IsEmpty) + throw new InvalidOperationException ("Cannot modify this property on the Empty Size."); + + if (value < 0) + throw new ArgumentException ("height must be non-negative."); + + _height = value; + } + } + + public double Width { + get { return _width; } + set { + if (IsEmpty) + throw new InvalidOperationException ("Cannot modify this property on the Empty Size."); + + if (value < 0) + throw new ArgumentException ("width must be non-negative."); + + _width = value; + } + } + + public static Size Empty { + get { + Size s = new Size (); + s._width = s._height = Double.NegativeInfinity; + return s; + } + } + + /* operators */ + public static explicit operator Point (Size size) + { + return new Point (size.Width, size.Height); + } + + public static explicit operator Vector (Size size) + { + return new Vector (size.Width, size.Height); + } + + public static bool operator ==(Size size1, Size size2) + { + return size1.Equals (size2); + } + + public static bool operator !=(Size size1, Size size2) + { + return !size1.Equals (size2); + } + + double _width; + double _height; + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/SizeConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows/SizeConverter.cs new file mode 100644 index 0000000..59a2c0d --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/SizeConverter.cs @@ -0,0 +1,57 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows { + + public sealed class SizeConverter : TypeConverter + { + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof (string); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + return destinationType == typeof (string); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (!(value is string)) + throw new NotSupportedException ("SizeConverter only supports converting from strings"); + + return Size.Parse ((string)value); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + return ((Size)value).ToString (culture); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/SplashScreen.cs b/src/Editor/FPF/WindowsBase/System.Windows/SplashScreen.cs new file mode 100644 index 0000000..16b2ecc --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/SplashScreen.cs @@ -0,0 +1,55 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) +// +// Author: +// Chris Toshok (toshok@ximian.com) +// + +using System.Reflection; +using System.Security; + +namespace System.Windows { + public class SplashScreen { + + [SecurityCritical] + public SplashScreen (Assembly resourceAssembly, string resourceName) + { + throw new NotImplementedException (); + } + + public SplashScreen (string resourceName) + { + throw new NotImplementedException (); + } + + [SecurityCritical] + public void Show (bool autoClose) + { + throw new NotImplementedException (); + } + + [SecurityCritical] + public void Close (TimeSpan fadeoutDuration) + { + throw new NotImplementedException (); + } + } +} \ No newline at end of file diff --git a/src/Editor/FPF/WindowsBase/System.Windows/ValidateValueCallback.cs b/src/Editor/FPF/WindowsBase/System.Windows/ValidateValueCallback.cs new file mode 100644 index 0000000..30be3df --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/ValidateValueCallback.cs @@ -0,0 +1,29 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@ximian.com) +// + +namespace System.Windows { + + public delegate bool ValidateValueCallback (object value); +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/Vector.cs b/src/Editor/FPF/WindowsBase/System.Windows/Vector.cs new file mode 100644 index 0000000..88b2305 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/Vector.cs @@ -0,0 +1,284 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok (toshok@novell.com) +// + +using System.ComponentModel; +using System.Globalization; +using System.Windows.Converters; +using System.Windows.Markup; +using System.Windows.Media; + +namespace System.Windows { + + [Serializable] + [ValueSerializer (typeof (VectorValueSerializer))] + [TypeConverter (typeof (VectorConverter))] + public struct Vector : IFormattable + { + public Vector (double x, double y) + { + this._x = x; + this._y = y; + } + + public bool Equals (Vector value) + { + return _x == value.X && _y == value.Y; + } + + public override bool Equals (object o) + { + if (!(o is Vector)) + return false; + + return Equals ((Vector)o); + } + + public override int GetHashCode () + { + unchecked + { + return (_x.GetHashCode () * 397) ^ _y.GetHashCode (); + } + } + + public static bool Equals (Vector vector1, Vector vector2) + { + return vector1.Equals (vector2); + } + + public static Point Add (Vector vector, Point point) + { + return new Point (vector.X + point.X, vector.Y + point.Y); + } + + public static Vector Add (Vector vector1, Vector vector2) + { + return new Vector (vector1.X + vector2.X, + vector1.Y + vector2.Y); + } + + public static double AngleBetween (Vector vector1, Vector vector2) + { + double cos_theta = (vector1.X * vector2.X + vector1.Y * vector2.Y) / (vector1.Length * vector2.Length); + + return Math.Acos (cos_theta) / Math.PI * 180; + } + + public static double CrossProduct (Vector vector1, Vector vector2) + { + // ... what operation is this exactly? + return vector1.X * vector2.Y - vector1.Y * vector2.X; + } + + public static double Determinant (Vector vector1, Vector vector2) + { + // same as CrossProduct, it appears. + return vector1.X * vector2.Y - vector1.Y * vector2.X; + } + + public static Vector Divide (Vector vector, double scalar) + { + return new Vector (vector.X / scalar, vector.Y / scalar); + } + + public static double Multiply (Vector vector1, Vector vector2) + { + return vector1.X * vector2.X + vector1.Y * vector2.Y; + } + + public static Vector Multiply (Vector vector, Matrix matrix) + { + return new Vector (vector.X * matrix.M11 + vector.Y * matrix.M21, + vector.X * matrix.M12 + vector.Y * matrix.M22); + } + + public static Vector Multiply (double scalar, Vector vector) + { + return new Vector (scalar * vector.X, scalar * vector.Y); + } + + public static Vector Multiply (Vector vector, double scalar) + { + return new Vector (scalar * vector.X, scalar * vector.Y); + } + + public void Negate () + { + _x = -_x; + _y = -_y; + } + + public void Normalize () + { + double ls = LengthSquared; + if (ls == 1) + return; + + double l = Math.Sqrt (ls); + _x /= l; + _y /= l; + } + + public static Vector Subtract (Vector vector1, Vector vector2) + { + return new Vector (vector1.X - vector2.X, vector1.Y - vector2.Y); + } + + public static Vector Parse (string source) + { + if (source == null) + throw new ArgumentNullException ("source"); + var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); + double x; + double y; + if (!double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out x) || + !double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out y)) + { + throw new FormatException (string.Format ("Invalid Vector format: {0}", source)); + } + if (!tokenizer.HasNoMoreTokens ()) + { + throw new InvalidOperationException("Invalid Vector format: " + source); + } + return new Vector(x, y); + } + + public override string ToString () + { + return ToString(null); + } + + public string ToString (IFormatProvider provider) + { + return ToString (null, provider); + } + + string IFormattable.ToString (string format, IFormatProvider provider) + { + return ToString (format, provider); + } + + private string ToString(string format,IFormatProvider formatProvider) + { + if (formatProvider == null) + formatProvider = CultureInfo.CurrentCulture; + if (format == null) + format = string.Empty; + var separator = NumericListTokenizer.GetSeparator (formatProvider); + var vectorFormat = string.Format ("{{0:{0}}}{1}{{1:{0}}}", format, separator); + return string.Format (formatProvider, vectorFormat, _x, _y); + } + + public double Length { + get { return Math.Sqrt (LengthSquared); } + } + + public double LengthSquared { + get { return _x * _x + _y * _y; } + } + + public double X { + get { return _x; } + set { _x = value; } + } + + public double Y { + get { return _y; } + set { _y = value; } + } + + /* operators */ + public static explicit operator Point (Vector vector) + { + return new Point (vector.X, vector.Y); + } + + public static explicit operator Size (Vector vector) + { + return new Size (vector.X, vector.Y); + } + + public static Vector operator - (Vector vector1, Vector vector2) + { + return Subtract (vector1, vector2); + } + + public static Vector operator - (Vector vector) + { + Vector result = vector; + result.Negate (); + return result; + } + + public static bool operator != (Vector vector1, Vector vector2) + { + return !Equals (vector1, vector2); + } + + public static bool operator == (Vector vector1, Vector vector2) + { + return Equals (vector1, vector2); + } + + public static double operator * (Vector vector1, Vector vector2) + { + return Multiply (vector1, vector2); + } + + public static Vector operator * (Vector vector, Matrix matrix) + { + return Multiply (vector, matrix); + } + + public static Vector operator * (double scalar, Vector vector) + { + return Multiply (scalar, vector); + } + + public static Vector operator * (Vector vector, double scalar) + { + return Multiply (vector, scalar); + } + + public static Vector operator / (Vector vector, double scalar) + { + return Divide (vector, scalar); + } + + public static Point operator + (Vector vector, Point point) + { + return Add (vector, point); + } + + public static Vector operator + (Vector vector1, Vector vector2) + { + return Add (vector1, vector2); + } + + double _x; + double _y; + } + +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/VectorConverter.cs b/src/Editor/FPF/WindowsBase/System.Windows/VectorConverter.cs new file mode 100644 index 0000000..69823c1 --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/VectorConverter.cs @@ -0,0 +1,57 @@ +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// +// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) +// +// Authors: +// Chris Toshok +// + +using System; +using System.ComponentModel; +using System.Globalization; + +namespace System.Windows { + + public sealed class VectorConverter : TypeConverter + { + public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) + { + return sourceType == typeof (string); + } + + public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) + { + return destinationType == typeof (string); + } + + public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) + { + if (!(value is string)) + throw new NotSupportedException ("VectorConverter only supports converting from strings"); + + return Vector.Parse ((string)value); + } + + public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) + { + return ((Vector)value).ToString (culture); + } + } +} diff --git a/src/Editor/FPF/WindowsBase/System.Windows/WeakEventManager.cs b/src/Editor/FPF/WindowsBase/System.Windows/WeakEventManager.cs new file mode 100644 index 0000000..ff5c29c --- /dev/null +++ b/src/Editor/FPF/WindowsBase/System.Windows/WeakEventManager.cs @@ -0,0 +1,178 @@ +// +// WeakEventManager.cs +// +// Author: +// Chris Toshok (toshok@ximian.com) +// +// (C) 2007 Novell, Inc. +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +using System.Collections; +using System.Windows.Threading; + +namespace System.Windows { + + public abstract class WeakEventManager : DispatcherObject + { + Hashtable sourceData; + + protected WeakEventManager () + { + sourceData = new Hashtable (); + } + + protected IDisposable ReadLock { + get { throw new NotImplementedException (); } + } + + protected IDisposable WriteLock { + get { throw new NotImplementedException (); } + } + + protected object this [object source] { + get { return sourceData[source]; } + set { sourceData[source] = value; } + } + + protected void DeliverEvent (object sender, EventArgs args) + { + DeliverEventToList (sender, args, (ListenerList)this[sender]); + } + + protected void DeliverEventToList (object sender, EventArgs args, ListenerList list) + { + for (int i = 0; i < list.Count; i ++) { + IWeakEventListener listener = list[i]; + listener.ReceiveWeakEvent (GetType(), sender, args); + } + } + + protected void ProtectedAddListener (object source, IWeakEventListener listener) + { + ListenerList list = sourceData[source] as ListenerList; + if (list != null) + list.Add (listener); + } + + protected void ProtectedRemoveListener (object source, IWeakEventListener listener) + { + ListenerList list = sourceData[source] as ListenerList; + if (list != null) + list.Remove (listener); + } + + protected virtual bool Purge (object source, object data, bool purgeAll) + { + throw new NotImplementedException (); + } + + protected void Remove (object source) + { + throw new NotImplementedException (); + } + + protected void ScheduleCleanup () + { + throw new NotImplementedException (); + } + + protected abstract void StartListening (object source); + protected abstract void StopListening (object source); + + + protected static WeakEventManager GetCurrentManager (Type managerType) + { + throw new NotImplementedException (); + } + + protected static void SetCurrentManager (Type managerType, WeakEventManager manager) + { + throw new NotImplementedException (); + } + + + protected class ListenerList + { + public ListenerList () + { + throw new NotImplementedException (); + } + + public ListenerList (int capacity) + { + throw new NotImplementedException (); + } + + public int Count { + get { throw new NotImplementedException (); } + } + + public static ListenerList Empty { + get { throw new NotImplementedException (); } + } + + public bool IsEmpty { + get { throw new NotImplementedException (); } + } + + public IWeakEventListener this[int index] { + get { throw new NotImplementedException (); } + } + + public void Add (IWeakEventListener listener) + { + throw new NotImplementedException (); + } + + public bool BeginUse () + { + throw new NotImplementedException (); + } + + public WeakEventManager.ListenerList Clone () + { + throw new NotImplementedException (); + } + + public void EndUse () + { + throw new NotImplementedException (); + } + + public static bool PrepareForWriting (ref WeakEventManager.ListenerList list) + { + throw new NotImplementedException (); + } + + public bool Purge () + { + throw new NotImplementedException (); + } + + public void Remove (IWeakEventListener listener) + { + throw new NotImplementedException (); + } + } + } + +} diff --git a/src/Editor/FPF/WindowsBase/WindowsBase.csproj b/src/Editor/FPF/WindowsBase/WindowsBase.csproj new file mode 100644 index 0000000..dcd2c2d --- /dev/null +++ b/src/Editor/FPF/WindowsBase/WindowsBase.csproj @@ -0,0 +1,14 @@ + + + 1699,67,618 + true + TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS + false + false + $(TargetFramework) + + + + + + \ No newline at end of file diff --git a/src/Editor/FPF/winfx3.pub b/src/Editor/FPF/winfx3.pub new file mode 100644 index 0000000..695f1b3 Binary files /dev/null and b/src/Editor/FPF/winfx3.pub differ diff --git a/src/Editor/Imaging/Def/Catalogs/LightBulbImageCatalog.cs b/src/Editor/Imaging/Def/Catalogs/LightBulbImageCatalog.cs deleted file mode 100644 index 09b0f47..0000000 --- a/src/Editor/Imaging/Def/Catalogs/LightBulbImageCatalog.cs +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -using System; - -using Microsoft.VisualStudio.Core.Imaging; - -namespace Microsoft.VisualStudio.Language.Intellisense -{ - public static class LightBulbImageCatalog - { - public static readonly Guid CatalogId = new Guid("f09c8ce2-d515-4226-a430-dec104c81f05"); - - public static object GetImage(this IImageService imageService, LightBulbImageId imageId, ImageTags imageTags = default) - => imageService.GetImage(new ImageDescription(new ImageId(CatalogId, (int)imageId), 16, imageTags)); - } - - public enum LightBulbImageId - { - OnlyActions = 1, - Fixes, - ErrorFixes, - } -} diff --git a/src/Editor/Imaging/Def/Catalogs/OverviewMarginCatalog.cs b/src/Editor/Imaging/Def/Catalogs/OverviewMarginCatalog.cs deleted file mode 100644 index c177e17..0000000 --- a/src/Editor/Imaging/Def/Catalogs/OverviewMarginCatalog.cs +++ /dev/null @@ -1,29 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -using System; - -using Microsoft.VisualStudio.Core.Imaging; - -namespace Microsoft.VisualStudio.Text.OverviewMargin -{ - public static class OverviewMarginCatalog - { - public static readonly Guid CatalogId = new Guid("47efec21-fd36-445d-99a4-238f66ab764c"); - - public static object GetImage(this IImageService imageService, OverviewMarginImageId imageId, ImageTags imageTags = default) - => imageService.GetImage(new ImageDescription(new ImageId(CatalogId, (int)imageId), 16, imageTags)); - } - - public enum OverviewMarginImageId - { - Busy = 1, - Ok, - Warning, - Error, - Suggestion, - Hide - } -} diff --git a/src/Editor/Imaging/Def/Catalogs/SignatureHelpImageCatalog.cs b/src/Editor/Imaging/Def/Catalogs/SignatureHelpImageCatalog.cs deleted file mode 100644 index 857b0fd..0000000 --- a/src/Editor/Imaging/Def/Catalogs/SignatureHelpImageCatalog.cs +++ /dev/null @@ -1,25 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -using System; - -using Microsoft.VisualStudio.Core.Imaging; - -namespace Microsoft.VisualStudio.Language.Intellisense -{ - public static class SignatureHelpImageCatalog - { - public static readonly Guid CatalogId = new Guid("95fdedcb-dc13-48a8-8165-ed1fff877d9a"); - - public static object GetImage(this IImageService imageService, SignatureHelpImageId imageId) - => imageService.GetImage(new ImageDescription(new ImageId(CatalogId, (int)imageId), 16, ImageTags.Template)) as object; - } - - public enum SignatureHelpImageId - { - PreviousSignatureButton = 1, - NextSignatureButton - } -} diff --git a/src/Editor/Imaging/Def/IImageService.cs b/src/Editor/Imaging/Def/IImageService.cs deleted file mode 100644 index cecb445..0000000 --- a/src/Editor/Imaging/Def/IImageService.cs +++ /dev/null @@ -1,28 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -namespace Microsoft.VisualStudio.Core.Imaging -{ - public interface IImageService - { - object GetImage(ImageDescription description); - } - - public static class ImageServiceExtensions - { - public static object GetImage( - this IImageService imageService, - ImageId id, - ImageTags tags = ImageTags.None) - => imageService.GetImage(new ImageDescription(id, tags)); - - public static object GetImage( - this IImageService imageService, - ImageId id, - int size, - ImageTags tags = ImageTags.None) - => imageService.GetImage(new ImageDescription(id, size, tags)); - } -} diff --git a/src/Editor/Imaging/Def/ImageDescription.cs b/src/Editor/Imaging/Def/ImageDescription.cs deleted file mode 100644 index 33f89b3..0000000 --- a/src/Editor/Imaging/Def/ImageDescription.cs +++ /dev/null @@ -1,74 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -using System; - -namespace Microsoft.VisualStudio.Core.Imaging -{ - public readonly struct ImageDescription : IEquatable - { - public readonly ImageId Id; - public readonly int Width; - public readonly int Height; - public readonly ImageTags Tags; - - public ImageDescription(ImageId id, ImageTags tags) - : this(id, 0, 0, tags) - { - } - - public ImageDescription(ImageId id, int size) - : this(id, size, size, ImageTags.None) - { - } - - public ImageDescription(ImageId id, int size, ImageTags tags) - : this(id, size, size, tags) - { - } - - public ImageDescription(ImageId id, int width, int height, ImageTags tags) - { - Id = id; - Width = width; - Height = height; - Tags = tags; - } - - public ImageDescription WithAdditionalTags(ImageTags tags) - => new ImageDescription(Id, Width, Height, Tags | tags); - - public ImageDescription WithoutTags(ImageTags tags) - => new ImageDescription(Id, Width, Height, Tags & ~tags); - - public override string ToString () - => $"'{Id}' @ {Width}x{Height} [{Tags}]"; - - public bool Equals(ImageDescription other) - => Width == other.Width && - Height == other.Height && - Tags == other.Tags && - Id.Equals(other.Id); - - public override bool Equals(object obj) - => obj is ImageDescription other && Equals(other); - - public override int GetHashCode() - { - var hash = 23; - hash = hash * 31 + Id.GetHashCode(); - hash = hash * 31 + (int)Tags; - hash = hash * 31 + Width; - hash = hash * 31 + Height; - return hash; - } - - public static bool operator ==(ImageDescription left, ImageDescription right) - => left.Equals(right); - - public static bool operator !=(ImageDescription left, ImageDescription right) - => !(left == right); - } -} diff --git a/src/Editor/Imaging/Def/ImageTags.cs b/src/Editor/Imaging/Def/ImageTags.cs deleted file mode 100644 index 6e2163d..0000000 --- a/src/Editor/Imaging/Def/ImageTags.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -using System; - -namespace Microsoft.VisualStudio.Core.Imaging -{ - [Flags] - public enum ImageTags - { - None = 0 << 0, - Dark = 1 << 0, - Disabled = 1 << 1, - Error = 1 << 2, - Hover = 1 << 3, - Pressed = 1 << 4, - Selected = 1 << 5, - Template = 1 << 6 - } -} diff --git a/src/Editor/Imaging/Def/Imaging.csproj b/src/Editor/Imaging/Def/Imaging.csproj deleted file mode 100644 index 06606e4..0000000 --- a/src/Editor/Imaging/Def/Imaging.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - Microsoft.VisualStudio.Editor.Imaging - Microsoft.VisualStudio.Imaging - true - 649;436;$(NoWarn) - true - false - true - true - $(TargetFramework) - - - - - diff --git a/src/Editor/Text/Def/Extras/Extras.csproj b/src/Editor/Text/Def/Extras/Extras.csproj deleted file mode 100644 index 01dd776..0000000 --- a/src/Editor/Text/Def/Extras/Extras.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - Microsoft.VisualStudio.Text.Extras - $(AssemblyName) - 649;436;$(NoWarn) - true - $(TargetFramework) - - - - - - - - - - - \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/Find/FindCommandArgs.cs b/src/Editor/Text/Def/Extras/Find/FindCommandArgs.cs deleted file mode 100644 index e605417..0000000 --- a/src/Editor/Text/Def/Extras/Find/FindCommandArgs.cs +++ /dev/null @@ -1,105 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -namespace Microsoft.VisualStudio.Text.Editor.Commanding.Commands -{ - public sealed class FindCommandArgs : EditorCommandArgs - { - public FindCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class FindNextCommandArgs : EditorCommandArgs - { - public FindNextCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class FindNextLikeSelectionCommandArgs : EditorCommandArgs - { - public FindNextLikeSelectionCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class FindPreviousCommandArgs : EditorCommandArgs - { - public FindPreviousCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class FindPreviousLikeSelectionCommandArgs : EditorCommandArgs - { - public FindPreviousLikeSelectionCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class ReplaceCommandArgs : EditorCommandArgs - { - public ReplaceCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class ReplaceNextCommandArgs : EditorCommandArgs - { - public ReplaceNextCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class ReplaceAllCommandArgs : EditorCommandArgs - { - public ReplaceAllCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class ToggleMatchCaseCommandArgs : EditorCommandArgs - { - public ToggleMatchCaseCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class ToggleMatchWholeWordCommandArgs : EditorCommandArgs - { - public ToggleMatchWholeWordCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class ToggleUseRegularExpressionsCommandArgs : EditorCommandArgs - { - public ToggleUseRegularExpressionsCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class HideFindCommandArgs : EditorCommandArgs - { - public HideFindCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class HideReplaceCommandArgs : EditorCommandArgs - { - public HideReplaceCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class SetSearchStringFromSelectionCommandArgs : EditorCommandArgs - { - public SetSearchStringFromSelectionCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } -} diff --git a/src/Editor/Text/Def/Extras/Find/IFindPresenter.cs b/src/Editor/Text/Def/Extras/Find/IFindPresenter.cs deleted file mode 100644 index a399c43..0000000 --- a/src/Editor/Text/Def/Extras/Find/IFindPresenter.cs +++ /dev/null @@ -1,21 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -namespace Microsoft.VisualStudio.Text.Find -{ - /// - /// Encapsulates the Find/Replace UI that can be provided by an extension. - /// A presenter is per view, is associated with its underlying FindController - /// and is instantiated by the IFindPresenterFactory. - /// - public interface IFindPresenter - { - void ShowFind(bool usePreviousTerm = false, bool takeFocus = true); - void ShowReplace(); - void Hide(); - bool IsVisible { get; } - bool IsFocused { get; } - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/Find/IFindPresenterFactory.cs b/src/Editor/Text/Def/Extras/Find/IFindPresenterFactory.cs deleted file mode 100644 index 2997be2..0000000 --- a/src/Editor/Text/Def/Extras/Find/IFindPresenterFactory.cs +++ /dev/null @@ -1,19 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -using Microsoft.VisualStudio.Text.Editor; - -namespace Microsoft.VisualStudio.Text.Find -{ - /// - /// Instantiates a Find/Replace UI presenter for a given text view. - /// The factory is a singleton that is provided via a MEF [Export] - /// and can be consumed via a MEF [Import]. - /// - public interface IFindPresenterFactory - { - IFindPresenter TryGetFindPresenter(ITextView textView); - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/GoToLine/GoToLineCommandArgs.cs b/src/Editor/Text/Def/Extras/GoToLine/GoToLineCommandArgs.cs deleted file mode 100644 index e3c0727..0000000 --- a/src/Editor/Text/Def/Extras/GoToLine/GoToLineCommandArgs.cs +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -using Microsoft.VisualStudio.Text.Editor; -using Microsoft.VisualStudio.Text.Editor.Commanding; - -namespace Microsoft.VisualStudio.Text.Extras.GoToLine -{ - public class GoToLineCommandArgs : EditorCommandArgs - { - public int? LineNumber { get; private set; } - - public GoToLineCommandArgs( - ITextView textView, - ITextBuffer subjectBuffer) - : this(textView, subjectBuffer, null) - { - } - - public GoToLineCommandArgs( - ITextView textView, - ITextBuffer subjectBuffer, - int? lineNumber) - : base(textView, subjectBuffer) - { - LineNumber = lineNumber; - } - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/GoToLine/IGoToLinePresenter.cs b/src/Editor/Text/Def/Extras/GoToLine/IGoToLinePresenter.cs deleted file mode 100644 index ccf427e..0000000 --- a/src/Editor/Text/Def/Extras/GoToLine/IGoToLinePresenter.cs +++ /dev/null @@ -1,18 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -namespace Microsoft.VisualStudio.Text.Extras.GoToLine -{ - /// - /// Encapsulates the Go To Line UI in a similar fashion to - /// - /// - public interface IGoToLinePresenter - { - void Show(); - void Hide(); - bool NavigateToLine(int lineNumber); - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/GoToLine/IGoToLinePresenterFactory.cs b/src/Editor/Text/Def/Extras/GoToLine/IGoToLinePresenterFactory.cs deleted file mode 100644 index f64ad6f..0000000 --- a/src/Editor/Text/Def/Extras/GoToLine/IGoToLinePresenterFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// - -using Microsoft.VisualStudio.Text.Editor; - -namespace Microsoft.VisualStudio.Text.Extras.GoToLine -{ - public interface IGoToLinePresenterFactory - { - bool TryGetGoToLinePresenter(ITextView textView, out IGoToLinePresenter goToLinePresenter); - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/InfoBar/IInfoBarPresenter.cs b/src/Editor/Text/Def/Extras/InfoBar/IInfoBarPresenter.cs deleted file mode 100644 index b56232d..0000000 --- a/src/Editor/Text/Def/Extras/InfoBar/IInfoBarPresenter.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.VisualStudio.Text.Editor -{ - public interface IInfoBarPresenter - { - void Present(InfoBarViewModel viewModel); - void Dismiss(InfoBarViewModel viewModel); - void DismissAll(); - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/InfoBar/IInfoBarPresenterFactory.cs b/src/Editor/Text/Def/Extras/InfoBar/IInfoBarPresenterFactory.cs deleted file mode 100644 index 12df913..0000000 --- a/src/Editor/Text/Def/Extras/InfoBar/IInfoBarPresenterFactory.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.VisualStudio.Text.Editor -{ - public interface IInfoBarPresenterFactory - { - IInfoBarPresenter TryGetInfoBarPresenter(ITextView textView); - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/InfoBar/InfoBarViewModel.cs b/src/Editor/Text/Def/Extras/InfoBar/InfoBarViewModel.cs deleted file mode 100644 index 4913e40..0000000 --- a/src/Editor/Text/Def/Extras/InfoBar/InfoBarViewModel.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Collections.Generic; - -namespace Microsoft.VisualStudio.Text.Editor -{ - public readonly struct InfoBarAction - { - public string Title { get; } - public Action Handler { get; } - public bool IsDefault { get; } - - public InfoBarAction(string title, Action handler, bool isDefault = false) - { - Title = title; - Handler = handler; - IsDefault = isDefault; - } - - public void Invoke() - => Handler?.Invoke(); - } - - public sealed class InfoBarViewModel - { - public string PrimaryLabelText { get; } - - public string SecondaryLabelText { get; } - - public IReadOnlyList Actions { get; } - - public Action DismissedHandler { get; } - - public InfoBarViewModel( - string primaryLabelText, - string secondaryLabelText, - IReadOnlyList actions, - Action dismissedHandler = null) - { - PrimaryLabelText = primaryLabelText; - SecondaryLabelText = secondaryLabelText; - Actions = actions; - DismissedHandler = dismissedHandler; - } - - public void InvokeDismissed() - => DismissedHandler?.Invoke(); - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/Extras/PreviewEditorCommandArgs.cs b/src/Editor/Text/Def/Extras/PreviewEditorCommandArgs.cs deleted file mode 100644 index dcb173d..0000000 --- a/src/Editor/Text/Def/Extras/PreviewEditorCommandArgs.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace Microsoft.VisualStudio.Text.Editor.Commanding.Commands -{ - public sealed class ProvideEditorFeedbackCommandArgs : EditorCommandArgs - { - public ProvideEditorFeedbackCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class DisableEditorPreviewCommandArgs : EditorCommandArgs - { - public DisableEditorPreviewCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } - - public sealed class LearnAboutTheEditorCommandArgs : EditorCommandArgs - { - public LearnAboutTheEditorCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) - { - } - } -} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/Find/FindCommandArgs.cs b/src/Editor/Text/Def/TextUICocoa/Extras/Find/FindCommandArgs.cs new file mode 100644 index 0000000..e605417 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/Find/FindCommandArgs.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +namespace Microsoft.VisualStudio.Text.Editor.Commanding.Commands +{ + public sealed class FindCommandArgs : EditorCommandArgs + { + public FindCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class FindNextCommandArgs : EditorCommandArgs + { + public FindNextCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class FindNextLikeSelectionCommandArgs : EditorCommandArgs + { + public FindNextLikeSelectionCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class FindPreviousCommandArgs : EditorCommandArgs + { + public FindPreviousCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class FindPreviousLikeSelectionCommandArgs : EditorCommandArgs + { + public FindPreviousLikeSelectionCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class ReplaceCommandArgs : EditorCommandArgs + { + public ReplaceCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class ReplaceNextCommandArgs : EditorCommandArgs + { + public ReplaceNextCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class ReplaceAllCommandArgs : EditorCommandArgs + { + public ReplaceAllCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class ToggleMatchCaseCommandArgs : EditorCommandArgs + { + public ToggleMatchCaseCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class ToggleMatchWholeWordCommandArgs : EditorCommandArgs + { + public ToggleMatchWholeWordCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class ToggleUseRegularExpressionsCommandArgs : EditorCommandArgs + { + public ToggleUseRegularExpressionsCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class HideFindCommandArgs : EditorCommandArgs + { + public HideFindCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class HideReplaceCommandArgs : EditorCommandArgs + { + public HideReplaceCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } + + public sealed class SetSearchStringFromSelectionCommandArgs : EditorCommandArgs + { + public SetSearchStringFromSelectionCommandArgs(ITextView textView, ITextBuffer subjectBuffer) : base(textView, subjectBuffer) + { + } + } +} diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/Find/IFindPresenter.cs b/src/Editor/Text/Def/TextUICocoa/Extras/Find/IFindPresenter.cs new file mode 100644 index 0000000..a399c43 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/Find/IFindPresenter.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +namespace Microsoft.VisualStudio.Text.Find +{ + /// + /// Encapsulates the Find/Replace UI that can be provided by an extension. + /// A presenter is per view, is associated with its underlying FindController + /// and is instantiated by the IFindPresenterFactory. + /// + public interface IFindPresenter + { + void ShowFind(bool usePreviousTerm = false, bool takeFocus = true); + void ShowReplace(); + void Hide(); + bool IsVisible { get; } + bool IsFocused { get; } + } +} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/Find/IFindPresenterFactory.cs b/src/Editor/Text/Def/TextUICocoa/Extras/Find/IFindPresenterFactory.cs new file mode 100644 index 0000000..2997be2 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/Find/IFindPresenterFactory.cs @@ -0,0 +1,19 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using Microsoft.VisualStudio.Text.Editor; + +namespace Microsoft.VisualStudio.Text.Find +{ + /// + /// Instantiates a Find/Replace UI presenter for a given text view. + /// The factory is a singleton that is provided via a MEF [Export] + /// and can be consumed via a MEF [Import]. + /// + public interface IFindPresenterFactory + { + IFindPresenter TryGetFindPresenter(ITextView textView); + } +} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/GoToLineCommandArgs.cs b/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/GoToLineCommandArgs.cs new file mode 100644 index 0000000..e3c0727 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/GoToLineCommandArgs.cs @@ -0,0 +1,31 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using Microsoft.VisualStudio.Text.Editor; +using Microsoft.VisualStudio.Text.Editor.Commanding; + +namespace Microsoft.VisualStudio.Text.Extras.GoToLine +{ + public class GoToLineCommandArgs : EditorCommandArgs + { + public int? LineNumber { get; private set; } + + public GoToLineCommandArgs( + ITextView textView, + ITextBuffer subjectBuffer) + : this(textView, subjectBuffer, null) + { + } + + public GoToLineCommandArgs( + ITextView textView, + ITextBuffer subjectBuffer, + int? lineNumber) + : base(textView, subjectBuffer) + { + LineNumber = lineNumber; + } + } +} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/IGoToLinePresenter.cs b/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/IGoToLinePresenter.cs new file mode 100644 index 0000000..ccf427e --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/IGoToLinePresenter.cs @@ -0,0 +1,18 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +namespace Microsoft.VisualStudio.Text.Extras.GoToLine +{ + /// + /// Encapsulates the Go To Line UI in a similar fashion to + /// + /// + public interface IGoToLinePresenter + { + void Show(); + void Hide(); + bool NavigateToLine(int lineNumber); + } +} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/IGoToLinePresenterFactory.cs b/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/IGoToLinePresenterFactory.cs new file mode 100644 index 0000000..f64ad6f --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/GoToLine/IGoToLinePresenterFactory.cs @@ -0,0 +1,14 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using Microsoft.VisualStudio.Text.Editor; + +namespace Microsoft.VisualStudio.Text.Extras.GoToLine +{ + public interface IGoToLinePresenterFactory + { + bool TryGetGoToLinePresenter(ITextView textView, out IGoToLinePresenter goToLinePresenter); + } +} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/IInfoBarPresenter.cs b/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/IInfoBarPresenter.cs new file mode 100644 index 0000000..b56232d --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/IInfoBarPresenter.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.VisualStudio.Text.Editor +{ + public interface IInfoBarPresenter + { + void Present(InfoBarViewModel viewModel); + void Dismiss(InfoBarViewModel viewModel); + void DismissAll(); + } +} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/IInfoBarPresenterFactory.cs b/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/IInfoBarPresenterFactory.cs new file mode 100644 index 0000000..12df913 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/IInfoBarPresenterFactory.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.VisualStudio.Text.Editor +{ + public interface IInfoBarPresenterFactory + { + IInfoBarPresenter TryGetInfoBarPresenter(ITextView textView); + } +} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/InfoBarViewModel.cs b/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/InfoBarViewModel.cs new file mode 100644 index 0000000..4913e40 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Extras/InfoBar/InfoBarViewModel.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; + +namespace Microsoft.VisualStudio.Text.Editor +{ + public readonly struct InfoBarAction + { + public string Title { get; } + public Action Handler { get; } + public bool IsDefault { get; } + + public InfoBarAction(string title, Action handler, bool isDefault = false) + { + Title = title; + Handler = handler; + IsDefault = isDefault; + } + + public void Invoke() + => Handler?.Invoke(); + } + + public sealed class InfoBarViewModel + { + public string PrimaryLabelText { get; } + + public string SecondaryLabelText { get; } + + public IReadOnlyList Actions { get; } + + public Action DismissedHandler { get; } + + public InfoBarViewModel( + string primaryLabelText, + string secondaryLabelText, + IReadOnlyList actions, + Action dismissedHandler = null) + { + PrimaryLabelText = primaryLabelText; + SecondaryLabelText = secondaryLabelText; + Actions = actions; + DismissedHandler = dismissedHandler; + } + + public void InvokeDismissed() + => DismissedHandler?.Invoke(); + } +} \ No newline at end of file diff --git a/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/LightBulbImageCatalog.cs b/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/LightBulbImageCatalog.cs new file mode 100644 index 0000000..09b0f47 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/LightBulbImageCatalog.cs @@ -0,0 +1,26 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using System; + +using Microsoft.VisualStudio.Core.Imaging; + +namespace Microsoft.VisualStudio.Language.Intellisense +{ + public static class LightBulbImageCatalog + { + public static readonly Guid CatalogId = new Guid("f09c8ce2-d515-4226-a430-dec104c81f05"); + + public static object GetImage(this IImageService imageService, LightBulbImageId imageId, ImageTags imageTags = default) + => imageService.GetImage(new ImageDescription(new ImageId(CatalogId, (int)imageId), 16, imageTags)); + } + + public enum LightBulbImageId + { + OnlyActions = 1, + Fixes, + ErrorFixes, + } +} diff --git a/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/OverviewMarginCatalog.cs b/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/OverviewMarginCatalog.cs new file mode 100644 index 0000000..c177e17 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/OverviewMarginCatalog.cs @@ -0,0 +1,29 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using System; + +using Microsoft.VisualStudio.Core.Imaging; + +namespace Microsoft.VisualStudio.Text.OverviewMargin +{ + public static class OverviewMarginCatalog + { + public static readonly Guid CatalogId = new Guid("47efec21-fd36-445d-99a4-238f66ab764c"); + + public static object GetImage(this IImageService imageService, OverviewMarginImageId imageId, ImageTags imageTags = default) + => imageService.GetImage(new ImageDescription(new ImageId(CatalogId, (int)imageId), 16, imageTags)); + } + + public enum OverviewMarginImageId + { + Busy = 1, + Ok, + Warning, + Error, + Suggestion, + Hide + } +} diff --git a/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/SignatureHelpImageCatalog.cs b/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/SignatureHelpImageCatalog.cs new file mode 100644 index 0000000..857b0fd --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Imaging/Catalogs/SignatureHelpImageCatalog.cs @@ -0,0 +1,25 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using System; + +using Microsoft.VisualStudio.Core.Imaging; + +namespace Microsoft.VisualStudio.Language.Intellisense +{ + public static class SignatureHelpImageCatalog + { + public static readonly Guid CatalogId = new Guid("95fdedcb-dc13-48a8-8165-ed1fff877d9a"); + + public static object GetImage(this IImageService imageService, SignatureHelpImageId imageId) + => imageService.GetImage(new ImageDescription(new ImageId(CatalogId, (int)imageId), 16, ImageTags.Template)) as object; + } + + public enum SignatureHelpImageId + { + PreviousSignatureButton = 1, + NextSignatureButton + } +} diff --git a/src/Editor/Text/Def/TextUICocoa/Imaging/IImageService.cs b/src/Editor/Text/Def/TextUICocoa/Imaging/IImageService.cs new file mode 100644 index 0000000..cecb445 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Imaging/IImageService.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +namespace Microsoft.VisualStudio.Core.Imaging +{ + public interface IImageService + { + object GetImage(ImageDescription description); + } + + public static class ImageServiceExtensions + { + public static object GetImage( + this IImageService imageService, + ImageId id, + ImageTags tags = ImageTags.None) + => imageService.GetImage(new ImageDescription(id, tags)); + + public static object GetImage( + this IImageService imageService, + ImageId id, + int size, + ImageTags tags = ImageTags.None) + => imageService.GetImage(new ImageDescription(id, size, tags)); + } +} diff --git a/src/Editor/Text/Def/TextUICocoa/Imaging/ImageDescription.cs b/src/Editor/Text/Def/TextUICocoa/Imaging/ImageDescription.cs new file mode 100644 index 0000000..33f89b3 --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Imaging/ImageDescription.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using System; + +namespace Microsoft.VisualStudio.Core.Imaging +{ + public readonly struct ImageDescription : IEquatable + { + public readonly ImageId Id; + public readonly int Width; + public readonly int Height; + public readonly ImageTags Tags; + + public ImageDescription(ImageId id, ImageTags tags) + : this(id, 0, 0, tags) + { + } + + public ImageDescription(ImageId id, int size) + : this(id, size, size, ImageTags.None) + { + } + + public ImageDescription(ImageId id, int size, ImageTags tags) + : this(id, size, size, tags) + { + } + + public ImageDescription(ImageId id, int width, int height, ImageTags tags) + { + Id = id; + Width = width; + Height = height; + Tags = tags; + } + + public ImageDescription WithAdditionalTags(ImageTags tags) + => new ImageDescription(Id, Width, Height, Tags | tags); + + public ImageDescription WithoutTags(ImageTags tags) + => new ImageDescription(Id, Width, Height, Tags & ~tags); + + public override string ToString () + => $"'{Id}' @ {Width}x{Height} [{Tags}]"; + + public bool Equals(ImageDescription other) + => Width == other.Width && + Height == other.Height && + Tags == other.Tags && + Id.Equals(other.Id); + + public override bool Equals(object obj) + => obj is ImageDescription other && Equals(other); + + public override int GetHashCode() + { + var hash = 23; + hash = hash * 31 + Id.GetHashCode(); + hash = hash * 31 + (int)Tags; + hash = hash * 31 + Width; + hash = hash * 31 + Height; + return hash; + } + + public static bool operator ==(ImageDescription left, ImageDescription right) + => left.Equals(right); + + public static bool operator !=(ImageDescription left, ImageDescription right) + => !(left == right); + } +} diff --git a/src/Editor/Text/Def/TextUICocoa/Imaging/ImageTags.cs b/src/Editor/Text/Def/TextUICocoa/Imaging/ImageTags.cs new file mode 100644 index 0000000..6e2163d --- /dev/null +++ b/src/Editor/Text/Def/TextUICocoa/Imaging/ImageTags.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// + +using System; + +namespace Microsoft.VisualStudio.Core.Imaging +{ + [Flags] + public enum ImageTags + { + None = 0 << 0, + Dark = 1 << 0, + Disabled = 1 << 1, + Error = 1 << 2, + Hover = 1 << 3, + Pressed = 1 << 4, + Selected = 1 << 5, + Template = 1 << 6 + } +} diff --git a/src/FPF/Directory.Build.props b/src/FPF/Directory.Build.props deleted file mode 100644 index 548aff7..0000000 --- a/src/FPF/Directory.Build.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - 67;114;3001;3002;3009;$(NoWarn) - false - - $(RepoBinPath)FPF\ - $(BaseOutputPath)$(Configuration)\ - - true - $(MSBuildThisFileDirectory)winfx3.pub - true - - false - - \ No newline at end of file diff --git a/src/FPF/Directory.Build.targets b/src/FPF/Directory.Build.targets deleted file mode 100644 index b3d5603..0000000 --- a/src/FPF/Directory.Build.targets +++ /dev/null @@ -1,6 +0,0 @@ - - - - Microsoft.VisualStudio.FPF.$(AssemblyName) - - \ No newline at end of file diff --git a/src/FPF/PresentationCore/PresentationCore.csproj b/src/FPF/PresentationCore/PresentationCore.csproj deleted file mode 100644 index e8cefc0..0000000 --- a/src/FPF/PresentationCore/PresentationCore.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - $(TargetFramework) - - - - - - - \ No newline at end of file diff --git a/src/FPF/PresentationCore/Properties/AssemblyInfo.cs b/src/FPF/PresentationCore/Properties/AssemblyInfo.cs deleted file mode 100644 index 8341535..0000000 --- a/src/FPF/PresentationCore/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: CLSCompliant(true)] -[assembly: AssemblyVersion("4.0.0.0")] -[assembly:InternalsVisibleTo("PresentationFramework, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Clipboard.cs b/src/FPF/PresentationCore/System.Windows.Clipboard.cs deleted file mode 100644 index f45967c..0000000 --- a/src/FPF/PresentationCore/System.Windows.Clipboard.cs +++ /dev/null @@ -1,63 +0,0 @@ -using AppKit; -using Foundation; - -namespace System.Windows -{ - public static class Clipboard - { - static readonly NSPasteboard pasteboard = NSPasteboard.GeneralPasteboard; - static readonly string[] textTypes = { DataFormats.UnicodeText }; - - public static bool ContainsText() - => pasteboard.CanReadItemWithDataConformingToTypes(textTypes); - - public static void SetDataObject(object data, bool copy) - { - if (data is DataObject dataObject) - { - pasteboard.ClearContents(); - - foreach (var item in dataObject.Items) - { - switch (item.Data) - { - case string stringData: - pasteboard.SetStringForType( - stringData, - item.Format); - break; - case bool boolItem: - pasteboard.SetDataForType( - NSData.FromArray(new byte[] { boolItem ? (byte)1 : (byte)0 }), - item.Format); - break; - } - } - } - } - - public static IDataObject GetDataObject() - { - var dataObject = new DataObject (); - // Beside copying and pasting UnicodeText to/from pasteboard - // editor inserts booleans like "VisualStudioEditorOperationsLineCutCopyClipboardTag" - // which allows editor to know whole line was copied into pasteboard so on paste - // it inserts line into new line, so we enumerate over all types and if length == 1 - // we just assume it's boolean we set in method above - foreach (var type in pasteboard.Types) - { - if (type == DataFormats.UnicodeText) - { - dataObject.SetText (pasteboard.GetStringForType (type)); - continue; - } - var data = pasteboard.GetDataForType (type); - if (data != null && data.Length == 1) - { - dataObject.SetData (type, data: data [0] != 0); - } - } - return dataObject; - } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.DataFormats.cs b/src/FPF/PresentationCore/System.Windows.DataFormats.cs deleted file mode 100644 index 3ca9ae2..0000000 --- a/src/FPF/PresentationCore/System.Windows.DataFormats.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace System.Windows -{ - public static class DataFormats - { - public static readonly string Text = "public.utf8-plain-text"; - public static readonly string UnicodeText = "public.utf8-plain-text"; - public static readonly string Rtf = "public.rtf"; - public static readonly string Html = "public.html"; - public static readonly string CommaSeparatedValue = "public.utf8-tab-separated-values-text"; - public static readonly string FileDrop = ""; - - internal static string ConvertToDataFormats(TextDataFormat textDataformat) - { - switch (textDataformat) - { - case TextDataFormat.Text: - return Text; - case TextDataFormat.UnicodeText: - return UnicodeText; - case TextDataFormat.Rtf: - return Rtf; - case TextDataFormat.Html: - return Html; - default: - return UnicodeText; - } - } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.DataObject.cs b/src/FPF/PresentationCore/System.Windows.DataObject.cs deleted file mode 100644 index 6dc13dc..0000000 --- a/src/FPF/PresentationCore/System.Windows.DataObject.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System.Collections.Generic; - -namespace System.Windows -{ - public interface IDataObject - { - bool GetDataPresent(string format, bool autoConvert); - bool GetDataPresent(Type format); - bool GetDataPresent(string format); - object GetData(string format); - object GetData(string format, bool autoConvert); - string[] GetFormats(); - } - - public sealed class DataObject : IDataObject - { - public readonly struct DataItem - { - public readonly string Format; - public readonly object Data; - - public DataItem (string format, object data) - { - Format = format; - Data = data; - } - } - - readonly List items = new List(4); - public IReadOnlyList Items => items; - - public void SetData(string format, object data) - => items.Add(new DataItem(format, data)); - - public void SetText(string textData) - => SetText(textData, TextDataFormat.UnicodeText); - - public void SetText(string textData, TextDataFormat format) - => SetData(DataFormats.ConvertToDataFormats(format), textData); - - public bool GetDataPresent(Type format) - { - if (format == typeof(string)) - return GetDataPresent(DataFormats.Text); - - return GetDataPresent(format.FullName); - } - - public bool GetDataPresent(string format) - => GetDataPresent(format, true); - - public bool GetDataPresent(string format, bool autoConvert) - { - foreach (var item in items) - { - if (string.Equals(item.Format, format, StringComparison.OrdinalIgnoreCase)) - return true; - } - - return false; - } - - public object GetData(string format) - => GetData(format, true); - - public object GetData(string format, bool autoConvert) - { - foreach (var item in items) - { - if (string.Equals(item.Format, format, StringComparison.OrdinalIgnoreCase)) - { - if (item.Data is string tsv && - string.Equals(item.Format, DataFormats.CommaSeparatedValue)) - return tsv.Replace('\t', ','); - - return item.Data; - } - } - - return null; - } - - public string[] GetFormats() - { - var formats = new string[items.Count]; - for (int i = 0; i < items.Count; i++) - formats[i] = items[i].Format; - return formats; - } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.DragEventArgs.cs b/src/FPF/PresentationCore/System.Windows.DragEventArgs.cs deleted file mode 100644 index dcd7938..0000000 --- a/src/FPF/PresentationCore/System.Windows.DragEventArgs.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace System.Windows -{ - public class DragEventArgs : System.Windows.RoutedEventArgs - { - - - - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.FontStyle.cs b/src/FPF/PresentationCore/System.Windows.FontStyle.cs deleted file mode 100644 index 6558730..0000000 --- a/src/FPF/PresentationCore/System.Windows.FontStyle.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace System.Windows -{ - public struct FontStyle - { - public static bool operator ==(FontStyle p1, FontStyle p2) { return true; } - public static bool operator !=(FontStyle p1, FontStyle p2) { return false; } - - public override bool Equals(object obj) => true; - public override int GetHashCode() => 0; - } -} diff --git a/src/FPF/PresentationCore/System.Windows.FontStyles.cs b/src/FPF/PresentationCore/System.Windows.FontStyles.cs deleted file mode 100644 index 46c28ec..0000000 --- a/src/FPF/PresentationCore/System.Windows.FontStyles.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace System.Windows -{ - public abstract class FontStyles : System.Object - { - - public static System.Windows.FontStyle Italic { get { return new FontStyle(); } } - public static System.Windows.FontStyle Normal { get { return new FontStyle(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.FontWeight.cs b/src/FPF/PresentationCore/System.Windows.FontWeight.cs deleted file mode 100644 index 0d094c9..0000000 --- a/src/FPF/PresentationCore/System.Windows.FontWeight.cs +++ /dev/null @@ -1,206 +0,0 @@ -namespace System.Windows -{ - public struct FontWeight : IFormattable - { - internal FontWeight(int weight) - { - // We want the default zero value of new FontWeight() to correspond to FontWeights.Normal. - // Therefore, the _weight value is shifted by 400 relative to the OpenType weight value. - _weight = weight - 400; - } - - /// - /// Creates a new FontWeight object that corresponds to the OpenType usWeightClass value. - /// - /// An integer value between 1 and 999 that corresponds - /// to the usWeightClass definition in the OpenType specification. - /// A new FontWeight object that corresponds to the weightValue parameter. - // Important note: when changing this method signature please make sure to update FontWeightConverter accordingly. - public static FontWeight FromOpenTypeWeight(int weightValue) - { - if (weightValue < 1 || weightValue > 999) - throw new ArgumentOutOfRangeException(); - return new FontWeight(weightValue); - } - - /// - /// Obtains OpenType usWeightClass value that corresponds to the FontWeight object. - /// - /// An integer value between 1 and 999 that corresponds - /// to the usWeightClass definition in the OpenType specification. - // Important note: when changing this method signature please make sure to update FontWeightConverter accordingly. - public int ToOpenTypeWeight() - { - return RealWeight; - } - - /// - /// Compares two font weight values and returns an indication of their relative values. - /// - /// First object to compare. - /// Second object to compare. - /// A 32-bit signed integer indicating the lexical relationship between the two comparands. - /// When the return value is less than zero this means that left is less than right. - /// When the return value is zero this means that left is equal to right. - /// When the return value is greater than zero this means that left is greater than right. - /// - public static int Compare(FontWeight left, FontWeight right) - { - return left._weight - right._weight; - } - - /// - /// Checks whether a font weight is less than another. - /// - /// First object to compare. - /// Second object to compare. - /// True if left is less than right, false otherwise. - public static bool operator <(FontWeight left, FontWeight right) - { - return Compare(left, right) < 0; - } - - /// - /// Checks whether a font weight is less or equal than another. - /// - /// First object to compare. - /// Second object to compare. - /// True if left is less or equal than right, false otherwise. - public static bool operator <=(FontWeight left, FontWeight right) - { - return Compare(left, right) <= 0; - } - - /// - /// Checks whether a font weight is greater than another. - /// - /// First object to compare. - /// Second object to compare. - /// True if left is greater than right, false otherwise. - public static bool operator >(FontWeight left, FontWeight right) - { - return Compare(left, right) > 0; - } - - /// - /// Checks whether a font weight is greater or equal than another. - /// - /// First object to compare. - /// Second object to compare. - /// True if left is greater or equal than right, false otherwise. - public static bool operator >=(FontWeight left, FontWeight right) - { - return Compare(left, right) >= 0; - } - - /// - /// Checks whether two font weight objects are equal. - /// - /// First object to compare. - /// Second object to compare. - /// Returns true when the font weight values are equal for both objects, - /// and false otherwise. - public static bool operator ==(FontWeight left, FontWeight right) - { - return Compare(left, right) == 0; - } - - /// - /// Checks whether two font weight objects are not equal. - /// - /// First object to compare. - /// Second object to compare. - /// Returns false when the font weight values are equal for both objects, - /// and true otherwise. - public static bool operator !=(FontWeight left, FontWeight right) - { - return !(left == right); - } - - /// - /// Checks whether the object is equal to another FontWeight object. - /// - /// FontWeight object to compare with. - /// Returns true when the object is equal to the input object, - /// and false otherwise. - public bool Equals(FontWeight obj) - { - return this == obj; - } - - /// - /// Checks whether an object is equal to another character hit object. - /// - /// FontWeight object to compare with. - /// Returns true when the object is equal to the input object, - /// and false otherwise. - public override bool Equals(object obj) - { - if (!(obj is FontWeight)) - return false; - return this == (FontWeight)obj; - } - - /// - /// Compute hash code for this object. - /// - /// A 32-bit signed integer hash code. - public override int GetHashCode() - { - return RealWeight; - } - - /// - /// Creates a string representation of this object based on the current culture. - /// - /// - /// A string representation of this object. - /// - public override string ToString() - { - // Delegate to the internal method which implements all ToString calls. - return ConvertToString(null, null); - } - - /// - /// Creates a string representation of this object based on the format string - /// and IFormatProvider passed in. - /// If the provider is null, the CurrentCulture is used. - /// See the documentation for IFormattable for more information. - /// - /// - /// A string representation of this object. - /// - string IFormattable.ToString(string format, IFormatProvider provider) - { - // Delegate to the internal method which implements all ToString calls. - return ConvertToString(format, provider); - } - - /// - /// Creates a string representation of this object based on the format string - /// and IFormatProvider passed in. - /// If the provider is null, the CurrentCulture is used. - /// See the documentation for IFormattable for more information. - /// - /// - /// A string representation of this object. - /// - private string ConvertToString(string format, IFormatProvider provider) - { - throw new NotImplementedException(); - } - - /// - /// We want the default zero value of new FontWeight() to correspond to FontWeights.Normal. - /// Therefore, _weight value is shifted by 400 relative to the OpenType weight value. - /// - private int RealWeight { - get { - return _weight + 400; - } - } - - private int _weight; - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.FontWeights.cs b/src/FPF/PresentationCore/System.Windows.FontWeights.cs deleted file mode 100644 index dca1e0f..0000000 --- a/src/FPF/PresentationCore/System.Windows.FontWeights.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace System.Windows -{ - public abstract class FontWeights : System.Object - { - - - public static System.Windows.FontWeight Bold { get { return new FontWeight(); } } - public static System.Windows.FontWeight Normal { get { return new FontWeight(); } } - public static System.Windows.FontWeight Regular { get { return new FontWeight(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.GiveFeedbackEventArgs.cs b/src/FPF/PresentationCore/System.Windows.GiveFeedbackEventArgs.cs deleted file mode 100644 index 776c7da..0000000 --- a/src/FPF/PresentationCore/System.Windows.GiveFeedbackEventArgs.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows -{ - public class GiveFeedbackEventArgs : System.Windows.RoutedEventArgs - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.IInputElement.cs b/src/FPF/PresentationCore/System.Windows.IInputElement.cs deleted file mode 100644 index e7fe80c..0000000 --- a/src/FPF/PresentationCore/System.Windows.IInputElement.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows -{ - public interface IInputElement - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Input.InputEventArgs.cs b/src/FPF/PresentationCore/System.Windows.Input.InputEventArgs.cs deleted file mode 100644 index 3ff7fe5..0000000 --- a/src/FPF/PresentationCore/System.Windows.Input.InputEventArgs.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Input -{ - public class InputEventArgs : System.Windows.RoutedEventArgs - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Input.InputLanguageEventArgs.cs b/src/FPF/PresentationCore/System.Windows.Input.InputLanguageEventArgs.cs deleted file mode 100644 index 09061c6..0000000 --- a/src/FPF/PresentationCore/System.Windows.Input.InputLanguageEventArgs.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Input -{ - public abstract class InputLanguageEventArgs : System.EventArgs - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Input.MouseButton.cs b/src/FPF/PresentationCore/System.Windows.Input.MouseButton.cs deleted file mode 100644 index e22e8c0..0000000 --- a/src/FPF/PresentationCore/System.Windows.Input.MouseButton.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace System.Windows.Input -{ - public enum MouseButton - { Left, - Middle, - Right, - XButton1, - XButton2, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Input.MouseButtonEventArgs.cs b/src/FPF/PresentationCore/System.Windows.Input.MouseButtonEventArgs.cs deleted file mode 100644 index 3709e5f..0000000 --- a/src/FPF/PresentationCore/System.Windows.Input.MouseButtonEventArgs.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace System.Windows.Input -{ - public class MouseButtonEventArgs : System.Windows.Input.MouseEventArgs - { - - - public System.Int32 ClickCount { get { throw new System.NotImplementedException(); } } - public System.Windows.Input.MouseButton ChangedButton { get { throw new System.NotImplementedException(); } } - public System.Windows.Input.MouseButtonState ButtonState { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Input.MouseButtonState.cs b/src/FPF/PresentationCore/System.Windows.Input.MouseButtonState.cs deleted file mode 100644 index a4d6b09..0000000 --- a/src/FPF/PresentationCore/System.Windows.Input.MouseButtonState.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Windows.Input -{ - public enum MouseButtonState - { Released, - Pressed, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Input.MouseEventArgs.cs b/src/FPF/PresentationCore/System.Windows.Input.MouseEventArgs.cs deleted file mode 100644 index cef60a9..0000000 --- a/src/FPF/PresentationCore/System.Windows.Input.MouseEventArgs.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace System.Windows.Input -{ - public class MouseEventArgs : System.Windows.Input.InputEventArgs - { - - - - - public System.Windows.Point GetPosition(object param0){throw new System.NotImplementedException();} - public System.Windows.Input.MouseButtonState LeftButton { get { throw new System.NotImplementedException(); } } - public System.Windows.Input.MouseButtonState MiddleButton { get { throw new System.NotImplementedException(); } } - public System.Windows.Input.MouseButtonState RightButton { get { throw new System.NotImplementedException(); } } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Input.MouseWheelEventArgs.cs b/src/FPF/PresentationCore/System.Windows.Input.MouseWheelEventArgs.cs deleted file mode 100644 index 10cee09..0000000 --- a/src/FPF/PresentationCore/System.Windows.Input.MouseWheelEventArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Windows.Input -{ - public class MouseWheelEventArgs : System.Windows.Input.MouseEventArgs - { - public System.Int32 Delta { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Input.TouchEventArgs.cs b/src/FPF/PresentationCore/System.Windows.Input.TouchEventArgs.cs deleted file mode 100644 index 9a2df37..0000000 --- a/src/FPF/PresentationCore/System.Windows.Input.TouchEventArgs.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Input -{ - public class TouchEventArgs : System.Windows.Input.InputEventArgs - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Animation.Animatable.cs b/src/FPF/PresentationCore/System.Windows.Media.Animation.Animatable.cs deleted file mode 100644 index 52cc7b1..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Animation.Animatable.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace System.Windows.Media.Animation -{ - public abstract class Animatable : System.Windows.Freezable - { public virtual void BeginAnimation(System.Windows.DependencyProperty param0, System.Windows.Media.Animation.AnimationTimeline param1){throw new System.NotImplementedException();} - - protected override Freezable CreateInstanceCore() - { - return null; - } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Animation.AnimationTimeline.cs b/src/FPF/PresentationCore/System.Windows.Media.Animation.AnimationTimeline.cs deleted file mode 100644 index adbae0e..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Animation.AnimationTimeline.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Media.Animation -{ - public abstract class AnimationTimeline : System.Windows.Media.Animation.Timeline - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Animation.RepeatBehavior.cs b/src/FPF/PresentationCore/System.Windows.Media.Animation.RepeatBehavior.cs deleted file mode 100644 index 2246d6b..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Animation.RepeatBehavior.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace System.Windows.Media.Animation -{ - public struct RepeatBehavior - { public RepeatBehavior(System.Double param0){} - - public static System.Windows.Media.Animation.RepeatBehavior Forever { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Animation.Timeline.cs b/src/FPF/PresentationCore/System.Windows.Media.Animation.Timeline.cs deleted file mode 100644 index 1c7aaf4..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Animation.Timeline.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace System.Windows.Media.Animation -{ - public abstract class Timeline : System.Windows.Media.Animation.Animatable - { - - public event System.EventHandler Completed; - public System.Windows.Media.Animation.RepeatBehavior RepeatBehavior { set { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.BitmapScalingMode.cs b/src/FPF/PresentationCore/System.Windows.Media.BitmapScalingMode.cs deleted file mode 100644 index 83b709c..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.BitmapScalingMode.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace System.Windows.Media -{ - public enum BitmapScalingMode - { Unspecified, - LowQuality, - HighQuality, - Linear, - Fant, - NearestNeighbor, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Brush.cs b/src/FPF/PresentationCore/System.Windows.Media.Brush.cs deleted file mode 100644 index 677e0a4..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Brush.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace System.Windows.Media -{ - public abstract class Brush : System.Windows.Media.Animation.Animatable - { - public System.String ToString(System.IFormatProvider param0){throw new System.NotImplementedException();} - - public new System.Windows.Media.Brush Clone() { return this; } - public System.Double Opacity { get; set; } = 1.0; - - } -} diff --git a/src/FPF/PresentationCore/System.Windows.Media.Brushes.cs b/src/FPF/PresentationCore/System.Windows.Media.Brushes.cs deleted file mode 100644 index dc99d71..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Brushes.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace System.Windows.Media -{ - public class Brushes : System.Object - { - static SolidColorBrush pink = new SolidColorBrush(Colors.Pink); - public static System.Windows.Media.SolidColorBrush Black { get => pink; } - public static System.Windows.Media.SolidColorBrush Blue { get => pink; } - public static System.Windows.Media.SolidColorBrush DarkGray { get => pink; } - public static System.Windows.Media.SolidColorBrush Gray { get => pink; } - public static System.Windows.Media.SolidColorBrush LightBlue { get => pink; } - public static System.Windows.Media.SolidColorBrush LightGray { get => pink; } - public static System.Windows.Media.SolidColorBrush LightYellow { get => pink; } - public static System.Windows.Media.SolidColorBrush PaleVioletRed { get => pink; } - public static System.Windows.Media.SolidColorBrush Red { get => pink; } - public static System.Windows.Media.SolidColorBrush Transparent { get; } = new SolidColorBrush(Colors.Transparent); - public static System.Windows.Media.SolidColorBrush White { get => pink; } - public static System.Windows.Media.SolidColorBrush Yellow { get => pink; } - public static System.Windows.Media.SolidColorBrush Green { get => pink; } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Color.cs b/src/FPF/PresentationCore/System.Windows.Media.Color.cs deleted file mode 100644 index 1af2af3..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Color.cs +++ /dev/null @@ -1,694 +0,0 @@ -using System.Runtime.InteropServices; -using System.Text; - -namespace System.Windows.Media -{ - public struct Color : IFormattable, IEquatable - { - //------------------------------------------------------ - // - // Constructors - // - //------------------------------------------------------ - - #region Constructors - - - - /// - /// FromAValues - general constructor for multichannel color values with explicit alpha channel and color context, i.e. spectral colors - /// - public static Color FromAValues(float a, float[] values, Uri profileUri) - { - throw new NotImplementedException(); - } - - /// - /// FromValues - general color constructor for multichannel color values with opaque alpha channel and explicit color context, i.e. spectral colors - /// - public static Color FromValues(float[] values, Uri profileUri) - { - Color c1 = Color.FromAValues(1.0f, values, profileUri); - - return c1; - } - - /// - /// Color - sRgb legacy interface, assumes Rgb values are sRgb - /// - internal static Color FromUInt32(uint argb)// internal legacy sRGB interface - { - Color c1 = new Color(); - - c1.sRgbColor.a = (byte)((argb & 0xff000000) >> 24); - c1.sRgbColor.r = (byte)((argb & 0x00ff0000) >> 16); - c1.sRgbColor.g = (byte)((argb & 0x0000ff00) >> 8); - c1.sRgbColor.b = (byte)(argb & 0x000000ff); - c1.scRgbColor.a = (float)c1.sRgbColor.a / 255.0f; - c1.scRgbColor.r = sRgbToScRgb(c1.sRgbColor.r); // note that context is undefined and thus unloaded - c1.scRgbColor.g = sRgbToScRgb(c1.sRgbColor.g); - c1.scRgbColor.b = sRgbToScRgb(c1.sRgbColor.b); - c1.context = null; - - c1.isFromScRgb = false; - - return c1; - } - - /// - /// FromScRgb - /// - public static Color FromScRgb(float a, float r, float g, float b) - { - Color c1 = new Color(); - - c1.scRgbColor.r = r; - c1.scRgbColor.g = g; - c1.scRgbColor.b = b; - c1.scRgbColor.a = a; - if (a < 0.0f) { - a = 0.0f; - } else if (a > 1.0f) { - a = 1.0f; - } - - c1.sRgbColor.a = (byte)((a * 255.0f) + 0.5f); - c1.sRgbColor.r = ScRgbTosRgb(c1.scRgbColor.r); - c1.sRgbColor.g = ScRgbTosRgb(c1.scRgbColor.g); - c1.sRgbColor.b = ScRgbTosRgb(c1.scRgbColor.b); - c1.context = null; - - c1.isFromScRgb = true; - - return c1; - } - - /// - /// Color - sRgb legacy interface, assumes Rgb values are sRgb, alpha channel is linear 1.0 gamma - /// - public static Color FromArgb(byte a, byte r, byte g, byte b)// legacy sRGB interface, bytes are required to properly round trip - { - Color c1 = new Color(); - - c1.scRgbColor.a = (float)a / 255.0f; - c1.scRgbColor.r = sRgbToScRgb(r); // note that context is undefined and thus unloaded - c1.scRgbColor.g = sRgbToScRgb(g); - c1.scRgbColor.b = sRgbToScRgb(b); - c1.context = null; - c1.sRgbColor.a = a; - c1.sRgbColor.r = ScRgbTosRgb(c1.scRgbColor.r); - c1.sRgbColor.g = ScRgbTosRgb(c1.scRgbColor.g); - c1.sRgbColor.b = ScRgbTosRgb(c1.scRgbColor.b); - - c1.isFromScRgb = false; - - return c1; - } - - /// - /// Color - sRgb legacy interface, assumes Rgb values are sRgb - /// - public static Color FromRgb(byte r, byte g, byte b)// legacy sRGB interface, bytes are required to properly round trip - { - Color c1 = Color.FromArgb(0xff, r, g, b); - return c1; - } - #endregion Constructors - - //------------------------------------------------------ - // - // Public Methods - // - //------------------------------------------------------ - - #region Public Methods - /// - /// GetHashCode - /// - public override int GetHashCode() - { - return this.scRgbColor.GetHashCode(); //^this.context.GetHashCode(); - } - - /// - /// Creates a string representation of this object based on the current culture. - /// - /// - /// A string representation of this object. - /// - public override string ToString() - { - // Delegate to the internal method which implements all ToString calls. - - string format = isFromScRgb ? c_scRgbFormat : null; - - return ConvertToString(format, null); - } - - /// - /// Creates a string representation of this object based on the IFormatProvider - /// passed in. If the provider is null, the CurrentCulture is used. - /// - /// - /// A string representation of this object. - /// - public string ToString(IFormatProvider provider) - { - // Delegate to the internal method which implements all ToString calls. - - string format = isFromScRgb ? c_scRgbFormat : null; - - return ConvertToString(format, provider); - } - - /// - /// Creates a string representation of this object based on the format string - /// and IFormatProvider passed in. - /// If the provider is null, the CurrentCulture is used. - /// See the documentation for IFormattable for more information. - /// - /// - /// A string representation of this object. - /// - string IFormattable.ToString(string format, IFormatProvider provider) - { - // Delegate to the internal method which implements all ToString calls. - return ConvertToString(format, provider); - } - - /// - /// Creates a string representation of this object based on the format string - /// and IFormatProvider passed in. - /// If the provider is null, the CurrentCulture is used. - /// See the documentation for IFormattable for more information. - /// - /// - /// A string representation of this object. - /// - internal string ConvertToString(string format, IFormatProvider provider) - { - throw new NotImplementedException(); - } - - /// - /// Compares two colors for fuzzy equality. This function - /// helps compensate for the fact that float values can - /// acquire error when operated upon - /// - /// The first color to compare - /// The second color to compare - /// Whether or not the two colors are equal - public static bool AreClose(Color color1, Color color2) - { - return color1.IsClose(color2); - } - - /// - /// Compares two colors for fuzzy equality. This function - /// helps compensate for the fact that float values can - /// acquire error when operated upon - /// - /// The color to compare to this - /// Whether or not the two colors are equal - private bool IsClose(Color color) - { - throw new NotImplementedException(); ; - } - - /// - /// Clamp - the color channels to the gamut [0..1]. If a channel is out - /// of gamut, it will be set to 1, which represents full saturation. - /// todo: sync up context values if they exist - /// - public void Clamp() - { - scRgbColor.r = (scRgbColor.r < 0) ? 0 : (scRgbColor.r > 1.0f) ? 1.0f : scRgbColor.r; - scRgbColor.g = (scRgbColor.g < 0) ? 0 : (scRgbColor.g > 1.0f) ? 1.0f : scRgbColor.g; - scRgbColor.b = (scRgbColor.b < 0) ? 0 : (scRgbColor.b > 1.0f) ? 1.0f : scRgbColor.b; - scRgbColor.a = (scRgbColor.a < 0) ? 0 : (scRgbColor.a > 1.0f) ? 1.0f : scRgbColor.a; - sRgbColor.a = (byte)(scRgbColor.a * 255f); - sRgbColor.r = ScRgbTosRgb(scRgbColor.r); - sRgbColor.g = ScRgbTosRgb(scRgbColor.g); - sRgbColor.b = ScRgbTosRgb(scRgbColor.b); - - // - } - - /// - /// GetNativeColorValues - return color values from color context - /// - public float[] GetNativeColorValues() - { - if (context != null) { - return (float[])nativeColorValue.Clone(); - } else { - throw new InvalidOperationException(); - } - } - #endregion Public Methods - - //------------------------------------------------------ - // - // Public Operators - // - //------------------------------------------------------ - - #region Public Operators - /// - /// Addition operator - Adds each channel of the second color to each channel of the - /// first and returns the result - /// - public static Color operator +(Color color1, Color color2) - { - throw new NotImplementedException(); - } - - /// - /// Addition method - Adds each channel of the second color to each channel of the - /// first and returns the result - /// - public static Color Add(Color color1, Color color2) - { - return (color1 + color2); - } - - /// - /// Subtract operator - substracts each channel of the second color from each channel of the - /// first and returns the result - /// - /// The minuend - /// The subtrahend - /// Returns the unclamped differnce - public static Color operator -(Color color1, Color color2) - { - - throw new NotImplementedException(); - } - - /// - /// Subtract method - subtracts each channel of the second color from each channel of the - /// first and returns the result - /// - public static Color Subtract(Color color1, Color color2) - { - return (color1 - color2); - } - - /// - /// Multiplication operator - Multiplies each channel of the color by a coefficient and returns the result - /// - /// The color - /// The coefficient - /// Returns the unclamped product - public static Color operator *(Color color, float coefficient) - { - Color c1 = FromScRgb(color.scRgbColor.a * coefficient, color.scRgbColor.r * coefficient, color.scRgbColor.g * coefficient, color.scRgbColor.b * coefficient); - - if (color.context == null) { - return c1; - } else { - c1.context = color.context; - -#pragma warning disable 6506 // c1.context is obviously not null - c1.ComputeNativeValues(0); -#pragma warning restore 6506 - } - - return c1; - } - - /// - /// Multiplication method - Multiplies each channel of the color by a coefficient and returns the result - /// - public static Color Multiply(Color color, float coefficient) - { - return (color * coefficient); - } - - /// - /// Equality method for two colors - return true of colors are equal, otherwise returns false - /// - public static bool Equals(Color color1, Color color2) - { - return (color1 == color2); - } - - /// - /// Compares two colors for exact equality. Note that float values can acquire error - /// when operated upon, such that an exact comparison between two values which are logically - /// equal may fail. see cref="AreClose" for a "fuzzy" version of this comparison. - /// - /// The color to compare to "this" - /// Whether or not the two colors are equal - public bool Equals(Color color) - { - return this == color; - } - - /// - /// Compares two colors for exact equality. Note that float values can acquire error - /// when operated upon, such that an exact comparison between two vEquals(color);alues which are logically - /// equal may fail. see cref="AreClose" for a "fuzzy" version of this comparison. - /// - /// The object to compare to "this" - /// Whether or not the two colors are equal - public override bool Equals(object o) - { - if (o is Color) { - Color color = (Color)o; - - return (this == color); - } else { - return false; - } - } - - /// - /// IsEqual operator - Compares two colors for exact equality. Note that float values can acquire error - /// when operated upon, such that an exact comparison between two values which are logically - /// equal may fail. see cref="AreClose". - /// - public static bool operator ==(Color color1, Color color2) - { - if (color1.scRgbColor.r != color2.scRgbColor.r) { - return false; - } - - if (color1.scRgbColor.g != color2.scRgbColor.g) { - return false; - } - - if (color1.scRgbColor.b != color2.scRgbColor.b) { - return false; - } - - if (color1.scRgbColor.a != color2.scRgbColor.a) { - return false; - } - - return true; - } - - /// - /// != - /// - public static bool operator !=(Color color1, Color color2) - { - return (!(color1 == color2)); - } - #endregion Public Operators - - //------------------------------------------------------ - // - // Public Properties - // - //------------------------------------------------------ - - #region Public Properties - - - /// - /// A - /// - public byte A { - get { - return sRgbColor.a; - } - set { - scRgbColor.a = (float)value / 255.0f; - sRgbColor.a = value; - } - } - - /// The Red channel as a byte whose range is [0..255]. - /// the value is not allowed to be out of range - /// - /// R - /// - public byte R { - get { - return sRgbColor.r; - } - set { - if (context == null) { - scRgbColor.r = sRgbToScRgb(value); - sRgbColor.r = value; - } else { - throw new InvalidOperationException(); - } - } - } - - ///The Green channel as a byte whose range is [0..255]. - /// the value is not allowed to be out of range - /// G - /// - public byte G { - get { - return sRgbColor.g; - } - set { - if (context == null) { - scRgbColor.g = sRgbToScRgb(value); - sRgbColor.g = value; - } else { - throw new InvalidOperationException(); - } - } - } - - ///The Blue channel as a byte whose range is [0..255]. - /// the value is not allowed to be out of range - /// B - /// - public byte B { - get { - return sRgbColor.b; - } - set { - if (context == null) { - scRgbColor.b = sRgbToScRgb(value); - sRgbColor.b = value; - } else { - throw new InvalidOperationException(); - } - } - } - - ///The Alpha channel as a float whose range is [0..1]. - /// the value is allowed to be out of range - /// ScA - /// - public float ScA { - get { - return scRgbColor.a; - } - set { - scRgbColor.a = value; - if (value < 0.0f) { - sRgbColor.a = 0; - } else if (value > 1.0f) { - sRgbColor.a = (byte)255; - } else { - sRgbColor.a = (byte)(value * 255f); - } - } - } - - ///The Red channel as a float whose range is [0..1]. - /// the value is allowed to be out of range - /// - /// ScR - /// - public float ScR { - get { - return scRgbColor.r; - // throw new ArgumentException(SR.Get(SRID.Color_ColorContextNotsRgb_or_ScRgb, null)); - } - set { - if (context == null) { - scRgbColor.r = value; - sRgbColor.r = ScRgbTosRgb(value); - } else { - throw new InvalidOperationException(); - } - } - } - - ///The Green channel as a float whose range is [0..1]. - /// the value is allowed to be out of range - /// ScG - /// - public float ScG { - get { - return scRgbColor.g; - // throw new ArgumentException(SR.Get(SRID.Color_ColorContextNotsRgb_or_ScRgb, null)); - } - set { - if (context == null) { - scRgbColor.g = value; - sRgbColor.g = ScRgbTosRgb(value); - } else { - throw new InvalidOperationException(); - } - } - } - - ///The Blue channel as a float whose range is [0..1]. - /// the value is allowed to be out of range - /// ScB - /// - public float ScB { - get { - return scRgbColor.b; - // throw new ArgumentException(SR.Get(SRID.Color_ColorContextNotsRgb_or_ScRgb, null)); - } - set { - if (context == null) { - scRgbColor.b = value; - sRgbColor.b = ScRgbTosRgb(value); - } else { - throw new InvalidOperationException(); - } - } - } - - #endregion Public Properties - - //------------------------------------------------------ - // - // Public Events - // - //------------------------------------------------------ - //------------------------------------------------------ - // - // Public Events - // - //------------------------------------------------------ - //------------------------------------------------------ - // - // Protected Methods - // - //------------------------------------------------------ - //------------------------------------------------------ - // - // Internal Properties - // - //------------------------------------------------------ - //------------------------------------------------------ - // - // Internal Events - // - //------------------------------------------------------ - //------------------------------------------------------ - // - // Internal Methods - // - //------------------------------------------------------ - //------------------------------------------------------ - // - // Private Methods - // - //------------------------------------------------------ - #region Private Methods - - /// - /// private helper function to set context values from a color value with a set context and ScRgb values - /// - private static float sRgbToScRgb(byte bval) - { - float val = ((float)bval / 255.0f); - - if (!(val > 0.0)) // Handles NaN case too. (Though, NaN isn't actually - // possible in this case.) - { - return (0.0f); - } else if (val <= 0.04045) { - return (val / 12.92f); - } else if (val < 1.0f) { - return (float)Math.Pow(((double)val + 0.055) / 1.055, 2.4); - } else { - return (1.0f); - } - } - - /// - /// private helper function to set context values from a color value with a set context and ScRgb values - /// - /// - private static byte ScRgbTosRgb(float val) - { - if (!(val > 0.0)) // Handles NaN case too - { - return (0); - } else if (val <= 0.0031308) { - return ((byte)((255.0f * val * 12.92f) + 0.5f)); - } else if (val < 1.0) { - return ((byte)((255.0f * ((1.055f * (float)Math.Pow((double)val, (1.0 / 2.4))) - 0.055f)) + 0.5f)); - } else { - return (255); - } - } - - /// - /// private helper function to set context values from a color value with a set context and ScRgb values - /// - /// - private void ComputeScRgbValues() - { - throw new NotImplementedException(); - } - - private void ComputeNativeValues(int numChannels) - { - throw new NotImplementedException(); - } - - #endregion Private Methods - - //------------------------------------------------------ - // - // Private Properties - // - //------------------------------------------------------ - //------------------------------------------------------ - // - // Private Events - // - //------------------------------------------------------ - //------------------------------------------------------ - // - // Private Fields - // - //------------------------------------------------------ - - #region Private Fields - - [MarshalAs(UnmanagedType.Interface)] - object context; - - private struct MILColorF // this structure is the "milrendertypes.h" structure and should be identical for performance - { - public float a, r, g, b; - }; - - private MILColorF scRgbColor; - - private struct MILColor - { - public byte a, r, g, b; - } - - private MILColor sRgbColor; - -#pragma warning disable 649 - private float[] nativeColorValue; -#pragma warning restore 649 - - private bool isFromScRgb; - - private const string c_scRgbFormat = "R"; - - #endregion Private Fields - } -} diff --git a/src/FPF/PresentationCore/System.Windows.Media.Colors.cs b/src/FPF/PresentationCore/System.Windows.Media.Colors.cs deleted file mode 100644 index fc3e487..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Colors.cs +++ /dev/null @@ -1,1905 +0,0 @@ -using System.Collections.Generic; - -namespace System.Windows.Media -{ - /// Enum containing handles to all known colors - /// Since the first element is 0, second is 1, etc, we can use this to index - /// directly into an array - internal enum KnownColor : uint - { - // We've reserved the value "1" as unknown. If for some odd reason "1" is added to the - // list, redefined UnknownColor - - AliceBlue = 0xFFF0F8FF, - AntiqueWhite = 0xFFFAEBD7, - Aqua = 0xFF00FFFF, - Aquamarine = 0xFF7FFFD4, - Azure = 0xFFF0FFFF, - Beige = 0xFFF5F5DC, - Bisque = 0xFFFFE4C4, - Black = 0xFF000000, - BlanchedAlmond = 0xFFFFEBCD, - Blue = 0xFF0000FF, - BlueViolet = 0xFF8A2BE2, - Brown = 0xFFA52A2A, - BurlyWood = 0xFFDEB887, - CadetBlue = 0xFF5F9EA0, - Chartreuse = 0xFF7FFF00, - Chocolate = 0xFFD2691E, - Coral = 0xFFFF7F50, - CornflowerBlue = 0xFF6495ED, - Cornsilk = 0xFFFFF8DC, - Crimson = 0xFFDC143C, - Cyan = 0xFF00FFFF, - DarkBlue = 0xFF00008B, - DarkCyan = 0xFF008B8B, - DarkGoldenrod = 0xFFB8860B, - DarkGray = 0xFFA9A9A9, - DarkGreen = 0xFF006400, - DarkKhaki = 0xFFBDB76B, - DarkMagenta = 0xFF8B008B, - DarkOliveGreen = 0xFF556B2F, - DarkOrange = 0xFFFF8C00, - DarkOrchid = 0xFF9932CC, - DarkRed = 0xFF8B0000, - DarkSalmon = 0xFFE9967A, - DarkSeaGreen = 0xFF8FBC8F, - DarkSlateBlue = 0xFF483D8B, - DarkSlateGray = 0xFF2F4F4F, - DarkTurquoise = 0xFF00CED1, - DarkViolet = 0xFF9400D3, - DeepPink = 0xFFFF1493, - DeepSkyBlue = 0xFF00BFFF, - DimGray = 0xFF696969, - DodgerBlue = 0xFF1E90FF, - Firebrick = 0xFFB22222, - FloralWhite = 0xFFFFFAF0, - ForestGreen = 0xFF228B22, - Fuchsia = 0xFFFF00FF, - Gainsboro = 0xFFDCDCDC, - GhostWhite = 0xFFF8F8FF, - Gold = 0xFFFFD700, - Goldenrod = 0xFFDAA520, - Gray = 0xFF808080, - Green = 0xFF008000, - GreenYellow = 0xFFADFF2F, - Honeydew = 0xFFF0FFF0, - HotPink = 0xFFFF69B4, - IndianRed = 0xFFCD5C5C, - Indigo = 0xFF4B0082, - Ivory = 0xFFFFFFF0, - Khaki = 0xFFF0E68C, - Lavender = 0xFFE6E6FA, - LavenderBlush = 0xFFFFF0F5, - LawnGreen = 0xFF7CFC00, - LemonChiffon = 0xFFFFFACD, - LightBlue = 0xFFADD8E6, - LightCoral = 0xFFF08080, - LightCyan = 0xFFE0FFFF, - LightGoldenrodYellow = 0xFFFAFAD2, - LightGreen = 0xFF90EE90, - LightGray = 0xFFD3D3D3, - LightPink = 0xFFFFB6C1, - LightSalmon = 0xFFFFA07A, - LightSeaGreen = 0xFF20B2AA, - LightSkyBlue = 0xFF87CEFA, - LightSlateGray = 0xFF778899, - LightSteelBlue = 0xFFB0C4DE, - LightYellow = 0xFFFFFFE0, - Lime = 0xFF00FF00, - LimeGreen = 0xFF32CD32, - Linen = 0xFFFAF0E6, - Magenta = 0xFFFF00FF, - Maroon = 0xFF800000, - MediumAquamarine = 0xFF66CDAA, - MediumBlue = 0xFF0000CD, - MediumOrchid = 0xFFBA55D3, - MediumPurple = 0xFF9370DB, - MediumSeaGreen = 0xFF3CB371, - MediumSlateBlue = 0xFF7B68EE, - MediumSpringGreen = 0xFF00FA9A, - MediumTurquoise = 0xFF48D1CC, - MediumVioletRed = 0xFFC71585, - MidnightBlue = 0xFF191970, - MintCream = 0xFFF5FFFA, - MistyRose = 0xFFFFE4E1, - Moccasin = 0xFFFFE4B5, - NavajoWhite = 0xFFFFDEAD, - Navy = 0xFF000080, - OldLace = 0xFFFDF5E6, - Olive = 0xFF808000, - OliveDrab = 0xFF6B8E23, - Orange = 0xFFFFA500, - OrangeRed = 0xFFFF4500, - Orchid = 0xFFDA70D6, - PaleGoldenrod = 0xFFEEE8AA, - PaleGreen = 0xFF98FB98, - PaleTurquoise = 0xFFAFEEEE, - PaleVioletRed = 0xFFDB7093, - PapayaWhip = 0xFFFFEFD5, - PeachPuff = 0xFFFFDAB9, - Peru = 0xFFCD853F, - Pink = 0xFFFFC0CB, - Plum = 0xFFDDA0DD, - PowderBlue = 0xFFB0E0E6, - Purple = 0xFF800080, - Red = 0xFFFF0000, - RosyBrown = 0xFFBC8F8F, - RoyalBlue = 0xFF4169E1, - SaddleBrown = 0xFF8B4513, - Salmon = 0xFFFA8072, - SandyBrown = 0xFFF4A460, - SeaGreen = 0xFF2E8B57, - SeaShell = 0xFFFFF5EE, - Sienna = 0xFFA0522D, - Silver = 0xFFC0C0C0, - SkyBlue = 0xFF87CEEB, - SlateBlue = 0xFF6A5ACD, - SlateGray = 0xFF708090, - Snow = 0xFFFFFAFA, - SpringGreen = 0xFF00FF7F, - SteelBlue = 0xFF4682B4, - Tan = 0xFFD2B48C, - Teal = 0xFF008080, - Thistle = 0xFFD8BFD8, - Tomato = 0xFFFF6347, - Transparent = 0x00FFFFFF, - Turquoise = 0xFF40E0D0, - Violet = 0xFFEE82EE, - Wheat = 0xFFF5DEB3, - White = 0xFFFFFFFF, - WhiteSmoke = 0xFFF5F5F5, - Yellow = 0xFFFFFF00, - YellowGreen = 0xFF9ACD32, - UnknownColor = 0x00000001 - } - - internal static class KnownColors - { -#if !PBTCOMPILER - - static KnownColors() - { - Array knownColorValues = Enum.GetValues(typeof(KnownColor)); - foreach (KnownColor colorValue in knownColorValues) { - string aRGBString = String.Format("#{0,8:X8}", (uint)colorValue); - s_knownArgbColors[aRGBString] = colorValue; - } - } - - /// Return the solid color brush from a color string. If there's no match, null - public static SolidColorBrush ColorStringToKnownBrush(string s) - { - if (null != s) { - KnownColor result = ColorStringToKnownColor(s); - - // If the result is UnknownColor, that means this string wasn't found - if (result != KnownColor.UnknownColor) { - // Otherwise, return the appropriate SolidColorBrush - return SolidColorBrushFromUint((uint)result); - } - } - return null; - } - - public static bool IsKnownSolidColorBrush(SolidColorBrush scp) - { - lock (s_solidColorBrushCache) { - return s_solidColorBrushCache.ContainsValue(scp); - } - } - - public static SolidColorBrush SolidColorBrushFromUint(uint argb) - { - SolidColorBrush scp = null; - - lock (s_solidColorBrushCache) { - // Attempt to retrieve the color. If it fails create it. - if (!s_solidColorBrushCache.TryGetValue(argb, out scp)) { - scp = new SolidColorBrush(Color.FromUInt32(argb)); - scp.Freeze(); - s_solidColorBrushCache[argb] = scp; - } -#if DEBUG - else { - s_count++; - } -#endif - } - - return scp; - } -#endif - - /// Return the KnownColor from a color string. If there's no match, KnownColor.UnknownColor - internal static KnownColor ColorStringToKnownColor(string colorString) - { - if (null != colorString) { - // We use invariant culture because we don't globalize our color names - string colorUpper = colorString.ToUpper(System.Globalization.CultureInfo.InvariantCulture); - - // Use String.Equals because it does explicit equality - // StartsWith/EndsWith are culture sensitive and are 4-7 times slower than Equals - - switch (colorUpper.Length) { - case 3: - if (colorUpper.Equals("RED")) return KnownColor.Red; - if (colorUpper.Equals("TAN")) return KnownColor.Tan; - break; - case 4: - switch (colorUpper[0]) { - case 'A': - if (colorUpper.Equals("AQUA")) return KnownColor.Aqua; - break; - case 'B': - if (colorUpper.Equals("BLUE")) return KnownColor.Blue; - break; - case 'C': - if (colorUpper.Equals("CYAN")) return KnownColor.Cyan; - break; - case 'G': - if (colorUpper.Equals("GOLD")) return KnownColor.Gold; - if (colorUpper.Equals("GRAY")) return KnownColor.Gray; - break; - case 'L': - if (colorUpper.Equals("LIME")) return KnownColor.Lime; - break; - case 'N': - if (colorUpper.Equals("NAVY")) return KnownColor.Navy; - break; - case 'P': - if (colorUpper.Equals("PERU")) return KnownColor.Peru; - if (colorUpper.Equals("PINK")) return KnownColor.Pink; - if (colorUpper.Equals("PLUM")) return KnownColor.Plum; - break; - case 'S': - if (colorUpper.Equals("SNOW")) return KnownColor.Snow; - break; - case 'T': - if (colorUpper.Equals("TEAL")) return KnownColor.Teal; - break; - } - break; - case 5: - switch (colorUpper[0]) { - case 'A': - if (colorUpper.Equals("AZURE")) return KnownColor.Azure; - break; - case 'B': - if (colorUpper.Equals("BEIGE")) return KnownColor.Beige; - if (colorUpper.Equals("BLACK")) return KnownColor.Black; - if (colorUpper.Equals("BROWN")) return KnownColor.Brown; - break; - case 'C': - if (colorUpper.Equals("CORAL")) return KnownColor.Coral; - break; - case 'G': - if (colorUpper.Equals("GREEN")) return KnownColor.Green; - break; - case 'I': - if (colorUpper.Equals("IVORY")) return KnownColor.Ivory; - break; - case 'K': - if (colorUpper.Equals("KHAKI")) return KnownColor.Khaki; - break; - case 'L': - if (colorUpper.Equals("LINEN")) return KnownColor.Linen; - break; - case 'O': - if (colorUpper.Equals("OLIVE")) return KnownColor.Olive; - break; - case 'W': - if (colorUpper.Equals("WHEAT")) return KnownColor.Wheat; - if (colorUpper.Equals("WHITE")) return KnownColor.White; - break; - } - break; - case 6: - switch (colorUpper[0]) { - case 'B': - if (colorUpper.Equals("BISQUE")) return KnownColor.Bisque; - break; - case 'I': - if (colorUpper.Equals("INDIGO")) return KnownColor.Indigo; - break; - case 'M': - if (colorUpper.Equals("MAROON")) return KnownColor.Maroon; - break; - case 'O': - if (colorUpper.Equals("ORANGE")) return KnownColor.Orange; - if (colorUpper.Equals("ORCHID")) return KnownColor.Orchid; - break; - case 'P': - if (colorUpper.Equals("PURPLE")) return KnownColor.Purple; - break; - case 'S': - if (colorUpper.Equals("SALMON")) return KnownColor.Salmon; - if (colorUpper.Equals("SIENNA")) return KnownColor.Sienna; - if (colorUpper.Equals("SILVER")) return KnownColor.Silver; - break; - case 'T': - if (colorUpper.Equals("TOMATO")) return KnownColor.Tomato; - break; - case 'V': - if (colorUpper.Equals("VIOLET")) return KnownColor.Violet; - break; - case 'Y': - if (colorUpper.Equals("YELLOW")) return KnownColor.Yellow; - break; - } - break; - case 7: - switch (colorUpper[0]) { - case 'C': - if (colorUpper.Equals("CRIMSON")) return KnownColor.Crimson; - break; - case 'D': - if (colorUpper.Equals("DARKRED")) return KnownColor.DarkRed; - if (colorUpper.Equals("DIMGRAY")) return KnownColor.DimGray; - break; - case 'F': - if (colorUpper.Equals("FUCHSIA")) return KnownColor.Fuchsia; - break; - case 'H': - if (colorUpper.Equals("HOTPINK")) return KnownColor.HotPink; - break; - case 'M': - if (colorUpper.Equals("MAGENTA")) return KnownColor.Magenta; - break; - case 'O': - if (colorUpper.Equals("OLDLACE")) return KnownColor.OldLace; - break; - case 'S': - if (colorUpper.Equals("SKYBLUE")) return KnownColor.SkyBlue; - break; - case 'T': - if (colorUpper.Equals("THISTLE")) return KnownColor.Thistle; - break; - } - break; - case 8: - switch (colorUpper[0]) { - case 'C': - if (colorUpper.Equals("CORNSILK")) return KnownColor.Cornsilk; - break; - case 'D': - if (colorUpper.Equals("DARKBLUE")) return KnownColor.DarkBlue; - if (colorUpper.Equals("DARKCYAN")) return KnownColor.DarkCyan; - if (colorUpper.Equals("DARKGRAY")) return KnownColor.DarkGray; - if (colorUpper.Equals("DEEPPINK")) return KnownColor.DeepPink; - break; - case 'H': - if (colorUpper.Equals("HONEYDEW")) return KnownColor.Honeydew; - break; - case 'L': - if (colorUpper.Equals("LAVENDER")) return KnownColor.Lavender; - break; - case 'M': - if (colorUpper.Equals("MOCCASIN")) return KnownColor.Moccasin; - break; - case 'S': - if (colorUpper.Equals("SEAGREEN")) return KnownColor.SeaGreen; - if (colorUpper.Equals("SEASHELL")) return KnownColor.SeaShell; - break; - } - break; - case 9: - switch (colorUpper[0]) { - case 'A': - if (colorUpper.Equals("ALICEBLUE")) return KnownColor.AliceBlue; - break; - case 'B': - if (colorUpper.Equals("BURLYWOOD")) return KnownColor.BurlyWood; - break; - case 'C': - if (colorUpper.Equals("CADETBLUE")) return KnownColor.CadetBlue; - if (colorUpper.Equals("CHOCOLATE")) return KnownColor.Chocolate; - break; - case 'D': - if (colorUpper.Equals("DARKGREEN")) return KnownColor.DarkGreen; - if (colorUpper.Equals("DARKKHAKI")) return KnownColor.DarkKhaki; - break; - case 'F': - if (colorUpper.Equals("FIREBRICK")) return KnownColor.Firebrick; - break; - case 'G': - if (colorUpper.Equals("GAINSBORO")) return KnownColor.Gainsboro; - if (colorUpper.Equals("GOLDENROD")) return KnownColor.Goldenrod; - break; - case 'I': - if (colorUpper.Equals("INDIANRED")) return KnownColor.IndianRed; - break; - case 'L': - if (colorUpper.Equals("LAWNGREEN")) return KnownColor.LawnGreen; - if (colorUpper.Equals("LIGHTBLUE")) return KnownColor.LightBlue; - if (colorUpper.Equals("LIGHTCYAN")) return KnownColor.LightCyan; - if (colorUpper.Equals("LIGHTGRAY")) return KnownColor.LightGray; - if (colorUpper.Equals("LIGHTPINK")) return KnownColor.LightPink; - if (colorUpper.Equals("LIMEGREEN")) return KnownColor.LimeGreen; - break; - case 'M': - if (colorUpper.Equals("MINTCREAM")) return KnownColor.MintCream; - if (colorUpper.Equals("MISTYROSE")) return KnownColor.MistyRose; - break; - case 'O': - if (colorUpper.Equals("OLIVEDRAB")) return KnownColor.OliveDrab; - if (colorUpper.Equals("ORANGERED")) return KnownColor.OrangeRed; - break; - case 'P': - if (colorUpper.Equals("PALEGREEN")) return KnownColor.PaleGreen; - if (colorUpper.Equals("PEACHPUFF")) return KnownColor.PeachPuff; - break; - case 'R': - if (colorUpper.Equals("ROSYBROWN")) return KnownColor.RosyBrown; - if (colorUpper.Equals("ROYALBLUE")) return KnownColor.RoyalBlue; - break; - case 'S': - if (colorUpper.Equals("SLATEBLUE")) return KnownColor.SlateBlue; - if (colorUpper.Equals("SLATEGRAY")) return KnownColor.SlateGray; - if (colorUpper.Equals("STEELBLUE")) return KnownColor.SteelBlue; - break; - case 'T': - if (colorUpper.Equals("TURQUOISE")) return KnownColor.Turquoise; - break; - } - break; - case 10: - switch (colorUpper[0]) { - case 'A': - if (colorUpper.Equals("AQUAMARINE")) return KnownColor.Aquamarine; - break; - case 'B': - if (colorUpper.Equals("BLUEVIOLET")) return KnownColor.BlueViolet; - break; - case 'C': - if (colorUpper.Equals("CHARTREUSE")) return KnownColor.Chartreuse; - break; - case 'D': - if (colorUpper.Equals("DARKORANGE")) return KnownColor.DarkOrange; - if (colorUpper.Equals("DARKORCHID")) return KnownColor.DarkOrchid; - if (colorUpper.Equals("DARKSALMON")) return KnownColor.DarkSalmon; - if (colorUpper.Equals("DARKVIOLET")) return KnownColor.DarkViolet; - if (colorUpper.Equals("DODGERBLUE")) return KnownColor.DodgerBlue; - break; - case 'G': - if (colorUpper.Equals("GHOSTWHITE")) return KnownColor.GhostWhite; - break; - case 'L': - if (colorUpper.Equals("LIGHTCORAL")) return KnownColor.LightCoral; - if (colorUpper.Equals("LIGHTGREEN")) return KnownColor.LightGreen; - break; - case 'M': - if (colorUpper.Equals("MEDIUMBLUE")) return KnownColor.MediumBlue; - break; - case 'P': - if (colorUpper.Equals("PAPAYAWHIP")) return KnownColor.PapayaWhip; - if (colorUpper.Equals("POWDERBLUE")) return KnownColor.PowderBlue; - break; - case 'S': - if (colorUpper.Equals("SANDYBROWN")) return KnownColor.SandyBrown; - break; - case 'W': - if (colorUpper.Equals("WHITESMOKE")) return KnownColor.WhiteSmoke; - break; - } - break; - case 11: - switch (colorUpper[0]) { - case 'D': - if (colorUpper.Equals("DARKMAGENTA")) return KnownColor.DarkMagenta; - if (colorUpper.Equals("DEEPSKYBLUE")) return KnownColor.DeepSkyBlue; - break; - case 'F': - if (colorUpper.Equals("FLORALWHITE")) return KnownColor.FloralWhite; - if (colorUpper.Equals("FORESTGREEN")) return KnownColor.ForestGreen; - break; - case 'G': - if (colorUpper.Equals("GREENYELLOW")) return KnownColor.GreenYellow; - break; - case 'L': - if (colorUpper.Equals("LIGHTSALMON")) return KnownColor.LightSalmon; - if (colorUpper.Equals("LIGHTYELLOW")) return KnownColor.LightYellow; - break; - case 'N': - if (colorUpper.Equals("NAVAJOWHITE")) return KnownColor.NavajoWhite; - break; - case 'S': - if (colorUpper.Equals("SADDLEBROWN")) return KnownColor.SaddleBrown; - if (colorUpper.Equals("SPRINGGREEN")) return KnownColor.SpringGreen; - break; - case 'T': - if (colorUpper.Equals("TRANSPARENT")) return KnownColor.Transparent; - break; - case 'Y': - if (colorUpper.Equals("YELLOWGREEN")) return KnownColor.YellowGreen; - break; - } - break; - case 12: - switch (colorUpper[0]) { - case 'A': - if (colorUpper.Equals("ANTIQUEWHITE")) return KnownColor.AntiqueWhite; - break; - case 'D': - if (colorUpper.Equals("DARKSEAGREEN")) return KnownColor.DarkSeaGreen; - break; - case 'L': - if (colorUpper.Equals("LIGHTSKYBLUE")) return KnownColor.LightSkyBlue; - if (colorUpper.Equals("LEMONCHIFFON")) return KnownColor.LemonChiffon; - break; - case 'M': - if (colorUpper.Equals("MEDIUMORCHID")) return KnownColor.MediumOrchid; - if (colorUpper.Equals("MEDIUMPURPLE")) return KnownColor.MediumPurple; - if (colorUpper.Equals("MIDNIGHTBLUE")) return KnownColor.MidnightBlue; - break; - } - break; - case 13: - switch (colorUpper[0]) { - case 'D': - if (colorUpper.Equals("DARKSLATEBLUE")) return KnownColor.DarkSlateBlue; - if (colorUpper.Equals("DARKSLATEGRAY")) return KnownColor.DarkSlateGray; - if (colorUpper.Equals("DARKGOLDENROD")) return KnownColor.DarkGoldenrod; - if (colorUpper.Equals("DARKTURQUOISE")) return KnownColor.DarkTurquoise; - break; - case 'L': - if (colorUpper.Equals("LIGHTSEAGREEN")) return KnownColor.LightSeaGreen; - if (colorUpper.Equals("LAVENDERBLUSH")) return KnownColor.LavenderBlush; - break; - case 'P': - if (colorUpper.Equals("PALEGOLDENROD")) return KnownColor.PaleGoldenrod; - if (colorUpper.Equals("PALETURQUOISE")) return KnownColor.PaleTurquoise; - if (colorUpper.Equals("PALEVIOLETRED")) return KnownColor.PaleVioletRed; - break; - } - break; - case 14: - switch (colorUpper[0]) { - case 'B': - if (colorUpper.Equals("BLANCHEDALMOND")) return KnownColor.BlanchedAlmond; - break; - case 'C': - if (colorUpper.Equals("CORNFLOWERBLUE")) return KnownColor.CornflowerBlue; - break; - case 'D': - if (colorUpper.Equals("DARKOLIVEGREEN")) return KnownColor.DarkOliveGreen; - break; - case 'L': - if (colorUpper.Equals("LIGHTSLATEGRAY")) return KnownColor.LightSlateGray; - if (colorUpper.Equals("LIGHTSTEELBLUE")) return KnownColor.LightSteelBlue; - break; - case 'M': - if (colorUpper.Equals("MEDIUMSEAGREEN")) return KnownColor.MediumSeaGreen; - break; - } - break; - case 15: - if (colorUpper.Equals("MEDIUMSLATEBLUE")) return KnownColor.MediumSlateBlue; - if (colorUpper.Equals("MEDIUMTURQUOISE")) return KnownColor.MediumTurquoise; - if (colorUpper.Equals("MEDIUMVIOLETRED")) return KnownColor.MediumVioletRed; - break; - case 16: - if (colorUpper.Equals("MEDIUMAQUAMARINE")) return KnownColor.MediumAquamarine; - break; - case 17: - if (colorUpper.Equals("MEDIUMSPRINGGREEN")) return KnownColor.MediumSpringGreen; - break; - case 20: - if (colorUpper.Equals("LIGHTGOLDENRODYELLOW")) return KnownColor.LightGoldenrodYellow; - break; - } - } - // colorString was null or not found - return KnownColor.UnknownColor; - } - -#if !PBTCOMPILER - internal static KnownColor ArgbStringToKnownColor(string argbString) - { - string argbUpper = argbString.Trim().ToUpper(System.Globalization.CultureInfo.InvariantCulture); - - KnownColor color; - if (s_knownArgbColors.TryGetValue(argbUpper, out color)) - return color; - - return KnownColor.UnknownColor; - } -#if DEBUG - private static int s_count = 0; -#endif - - private static Dictionary s_solidColorBrushCache = new Dictionary(); - private static Dictionary s_knownArgbColors = new Dictionary(); -#endif - } - -#if !PBTCOMPILER - /// - /// Colors - A collection of well-known Colors - /// - public sealed class Colors - { - #region Constructors - - // Colors only has static members, so it shouldn't be constructable. - private Colors() - { - } - - #endregion Constructors - - #region static Known Colors - - /// - /// Well-known color: AliceBlue - /// - public static Color AliceBlue { - get { - return Color.FromUInt32((uint)KnownColor.AliceBlue); - } - } - - /// - /// Well-known color: AntiqueWhite - /// - public static Color AntiqueWhite { - get { - return Color.FromUInt32((uint)KnownColor.AntiqueWhite); - } - } - - /// - /// Well-known color: Aqua - /// - public static Color Aqua { - get { - return Color.FromUInt32((uint)KnownColor.Aqua); - } - } - - /// - /// Well-known color: Aquamarine - /// - public static Color Aquamarine { - get { - return Color.FromUInt32((uint)KnownColor.Aquamarine); - } - } - - /// - /// Well-known color: Azure - /// - public static Color Azure { - get { - return Color.FromUInt32((uint)KnownColor.Azure); - } - } - - /// - /// Well-known color: Beige - /// - public static Color Beige { - get { - return Color.FromUInt32((uint)KnownColor.Beige); - } - } - - /// - /// Well-known color: Bisque - /// - public static Color Bisque { - get { - return Color.FromUInt32((uint)KnownColor.Bisque); - } - } - - /// - /// Well-known color: Black - /// - public static Color Black { - get { - return Color.FromUInt32((uint)KnownColor.Black); - } - } - - /// - /// Well-known color: BlanchedAlmond - /// - public static Color BlanchedAlmond { - get { - return Color.FromUInt32((uint)KnownColor.BlanchedAlmond); - } - } - - /// - /// Well-known color: Blue - /// - public static Color Blue { - get { - return Color.FromUInt32((uint)KnownColor.Blue); - } - } - - /// - /// Well-known color: BlueViolet - /// - public static Color BlueViolet { - get { - return Color.FromUInt32((uint)KnownColor.BlueViolet); - } - } - - /// - /// Well-known color: Brown - /// - public static Color Brown { - get { - return Color.FromUInt32((uint)KnownColor.Brown); - } - } - - /// - /// Well-known color: BurlyWood - /// - public static Color BurlyWood { - get { - return Color.FromUInt32((uint)KnownColor.BurlyWood); - } - } - - /// - /// Well-known color: CadetBlue - /// - public static Color CadetBlue { - get { - return Color.FromUInt32((uint)KnownColor.CadetBlue); - } - } - - /// - /// Well-known color: Chartreuse - /// - public static Color Chartreuse { - get { - return Color.FromUInt32((uint)KnownColor.Chartreuse); - } - } - - /// - /// Well-known color: Chocolate - /// - public static Color Chocolate { - get { - return Color.FromUInt32((uint)KnownColor.Chocolate); - } - } - - /// - /// Well-known color: Coral - /// - public static Color Coral { - get { - return Color.FromUInt32((uint)KnownColor.Coral); - } - } - - /// - /// Well-known color: CornflowerBlue - /// - public static Color CornflowerBlue { - get { - return Color.FromUInt32((uint)KnownColor.CornflowerBlue); - } - } - - /// - /// Well-known color: Cornsilk - /// - public static Color Cornsilk { - get { - return Color.FromUInt32((uint)KnownColor.Cornsilk); - } - } - - /// - /// Well-known color: Crimson - /// - public static Color Crimson { - get { - return Color.FromUInt32((uint)KnownColor.Crimson); - } - } - - /// - /// Well-known color: Cyan - /// - public static Color Cyan { - get { - return Color.FromUInt32((uint)KnownColor.Cyan); - } - } - - /// - /// Well-known color: DarkBlue - /// - public static Color DarkBlue { - get { - return Color.FromUInt32((uint)KnownColor.DarkBlue); - } - } - - /// - /// Well-known color: DarkCyan - /// - public static Color DarkCyan { - get { - return Color.FromUInt32((uint)KnownColor.DarkCyan); - } - } - - /// - /// Well-known color: DarkGoldenrod - /// - public static Color DarkGoldenrod { - get { - return Color.FromUInt32((uint)KnownColor.DarkGoldenrod); - } - } - - /// - /// Well-known color: DarkGray - /// - public static Color DarkGray { - get { - return Color.FromUInt32((uint)KnownColor.DarkGray); - } - } - - /// - /// Well-known color: DarkGreen - /// - public static Color DarkGreen { - get { - return Color.FromUInt32((uint)KnownColor.DarkGreen); - } - } - - /// - /// Well-known color: DarkKhaki - /// - public static Color DarkKhaki { - get { - return Color.FromUInt32((uint)KnownColor.DarkKhaki); - } - } - - /// - /// Well-known color: DarkMagenta - /// - public static Color DarkMagenta { - get { - return Color.FromUInt32((uint)KnownColor.DarkMagenta); - } - } - - /// - /// Well-known color: DarkOliveGreen - /// - public static Color DarkOliveGreen { - get { - return Color.FromUInt32((uint)KnownColor.DarkOliveGreen); - } - } - - /// - /// Well-known color: DarkOrange - /// - public static Color DarkOrange { - get { - return Color.FromUInt32((uint)KnownColor.DarkOrange); - } - } - - /// - /// Well-known color: DarkOrchid - /// - public static Color DarkOrchid { - get { - return Color.FromUInt32((uint)KnownColor.DarkOrchid); - } - } - - /// - /// Well-known color: DarkRed - /// - public static Color DarkRed { - get { - return Color.FromUInt32((uint)KnownColor.DarkRed); - } - } - - /// - /// Well-known color: DarkSalmon - /// - public static Color DarkSalmon { - get { - return Color.FromUInt32((uint)KnownColor.DarkSalmon); - } - } - - /// - /// Well-known color: DarkSeaGreen - /// - public static Color DarkSeaGreen { - get { - return Color.FromUInt32((uint)KnownColor.DarkSeaGreen); - } - } - - /// - /// Well-known color: DarkSlateBlue - /// - public static Color DarkSlateBlue { - get { - return Color.FromUInt32((uint)KnownColor.DarkSlateBlue); - } - } - - /// - /// Well-known color: DarkSlateGray - /// - public static Color DarkSlateGray { - get { - return Color.FromUInt32((uint)KnownColor.DarkSlateGray); - } - } - - /// - /// Well-known color: DarkTurquoise - /// - public static Color DarkTurquoise { - get { - return Color.FromUInt32((uint)KnownColor.DarkTurquoise); - } - } - - /// - /// Well-known color: DarkViolet - /// - public static Color DarkViolet { - get { - return Color.FromUInt32((uint)KnownColor.DarkViolet); - } - } - - /// - /// Well-known color: DeepPink - /// - public static Color DeepPink { - get { - return Color.FromUInt32((uint)KnownColor.DeepPink); - } - } - - /// - /// Well-known color: DeepSkyBlue - /// - public static Color DeepSkyBlue { - get { - return Color.FromUInt32((uint)KnownColor.DeepSkyBlue); - } - } - - /// - /// Well-known color: DimGray - /// - public static Color DimGray { - get { - return Color.FromUInt32((uint)KnownColor.DimGray); - } - } - - /// - /// Well-known color: DodgerBlue - /// - public static Color DodgerBlue { - get { - return Color.FromUInt32((uint)KnownColor.DodgerBlue); - } - } - - /// - /// Well-known color: Firebrick - /// - public static Color Firebrick { - get { - return Color.FromUInt32((uint)KnownColor.Firebrick); - } - } - - /// - /// Well-known color: FloralWhite - /// - public static Color FloralWhite { - get { - return Color.FromUInt32((uint)KnownColor.FloralWhite); - } - } - - /// - /// Well-known color: ForestGreen - /// - public static Color ForestGreen { - get { - return Color.FromUInt32((uint)KnownColor.ForestGreen); - } - } - - /// - /// Well-known color: Fuchsia - /// - public static Color Fuchsia { - get { - return Color.FromUInt32((uint)KnownColor.Fuchsia); - } - } - - /// - /// Well-known color: Gainsboro - /// - public static Color Gainsboro { - get { - return Color.FromUInt32((uint)KnownColor.Gainsboro); - } - } - - /// - /// Well-known color: GhostWhite - /// - public static Color GhostWhite { - get { - return Color.FromUInt32((uint)KnownColor.GhostWhite); - } - } - - /// - /// Well-known color: Gold - /// - public static Color Gold { - get { - return Color.FromUInt32((uint)KnownColor.Gold); - } - } - - /// - /// Well-known color: Goldenrod - /// - public static Color Goldenrod { - get { - return Color.FromUInt32((uint)KnownColor.Goldenrod); - } - } - - /// - /// Well-known color: Gray - /// - public static Color Gray { - get { - return Color.FromUInt32((uint)KnownColor.Gray); - } - } - - /// - /// Well-known color: Green - /// - public static Color Green { - get { - return Color.FromUInt32((uint)KnownColor.Green); - } - } - - /// - /// Well-known color: GreenYellow - /// - public static Color GreenYellow { - get { - return Color.FromUInt32((uint)KnownColor.GreenYellow); - } - } - - /// - /// Well-known color: Honeydew - /// - public static Color Honeydew { - get { - return Color.FromUInt32((uint)KnownColor.Honeydew); - } - } - - /// - /// Well-known color: HotPink - /// - public static Color HotPink { - get { - return Color.FromUInt32((uint)KnownColor.HotPink); - } - } - - /// - /// Well-known color: IndianRed - /// - public static Color IndianRed { - get { - return Color.FromUInt32((uint)KnownColor.IndianRed); - } - } - - /// - /// Well-known color: Indigo - /// - public static Color Indigo { - get { - return Color.FromUInt32((uint)KnownColor.Indigo); - } - } - - /// - /// Well-known color: Ivory - /// - public static Color Ivory { - get { - return Color.FromUInt32((uint)KnownColor.Ivory); - } - } - - /// - /// Well-known color: Khaki - /// - public static Color Khaki { - get { - return Color.FromUInt32((uint)KnownColor.Khaki); - } - } - - /// - /// Well-known color: Lavender - /// - public static Color Lavender { - get { - return Color.FromUInt32((uint)KnownColor.Lavender); - } - } - - /// - /// Well-known color: LavenderBlush - /// - public static Color LavenderBlush { - get { - return Color.FromUInt32((uint)KnownColor.LavenderBlush); - } - } - - /// - /// Well-known color: LawnGreen - /// - public static Color LawnGreen { - get { - return Color.FromUInt32((uint)KnownColor.LawnGreen); - } - } - - /// - /// Well-known color: LemonChiffon - /// - public static Color LemonChiffon { - get { - return Color.FromUInt32((uint)KnownColor.LemonChiffon); - } - } - - /// - /// Well-known color: LightBlue - /// - public static Color LightBlue { - get { - return Color.FromUInt32((uint)KnownColor.LightBlue); - } - } - - /// - /// Well-known color: LightCoral - /// - public static Color LightCoral { - get { - return Color.FromUInt32((uint)KnownColor.LightCoral); - } - } - - /// - /// Well-known color: LightCyan - /// - public static Color LightCyan { - get { - return Color.FromUInt32((uint)KnownColor.LightCyan); - } - } - - /// - /// Well-known color: LightGoldenrodYellow - /// - public static Color LightGoldenrodYellow { - get { - return Color.FromUInt32((uint)KnownColor.LightGoldenrodYellow); - } - } - - /// - /// Well-known color: LightGray - /// - public static Color LightGray { - get { - return Color.FromUInt32((uint)KnownColor.LightGray); - } - } - - /// - /// Well-known color: LightGreen - /// - public static Color LightGreen { - get { - return Color.FromUInt32((uint)KnownColor.LightGreen); - } - } - - /// - /// Well-known color: LightPink - /// - public static Color LightPink { - get { - return Color.FromUInt32((uint)KnownColor.LightPink); - } - } - - /// - /// Well-known color: LightSalmon - /// - public static Color LightSalmon { - get { - return Color.FromUInt32((uint)KnownColor.LightSalmon); - } - } - - /// - /// Well-known color: LightSeaGreen - /// - public static Color LightSeaGreen { - get { - return Color.FromUInt32((uint)KnownColor.LightSeaGreen); - } - } - - /// - /// Well-known color: LightSkyBlue - /// - public static Color LightSkyBlue { - get { - return Color.FromUInt32((uint)KnownColor.LightSkyBlue); - } - } - - /// - /// Well-known color: LightSlateGray - /// - public static Color LightSlateGray { - get { - return Color.FromUInt32((uint)KnownColor.LightSlateGray); - } - } - - /// - /// Well-known color: LightSteelBlue - /// - public static Color LightSteelBlue { - get { - return Color.FromUInt32((uint)KnownColor.LightSteelBlue); - } - } - - /// - /// Well-known color: LightYellow - /// - public static Color LightYellow { - get { - return Color.FromUInt32((uint)KnownColor.LightYellow); - } - } - - /// - /// Well-known color: Lime - /// - public static Color Lime { - get { - return Color.FromUInt32((uint)KnownColor.Lime); - } - } - - /// - /// Well-known color: LimeGreen - /// - public static Color LimeGreen { - get { - return Color.FromUInt32((uint)KnownColor.LimeGreen); - } - } - - /// - /// Well-known color: Linen - /// - public static Color Linen { - get { - return Color.FromUInt32((uint)KnownColor.Linen); - } - } - - /// - /// Well-known color: Magenta - /// - public static Color Magenta { - get { - return Color.FromUInt32((uint)KnownColor.Magenta); - } - } - - /// - /// Well-known color: Maroon - /// - public static Color Maroon { - get { - return Color.FromUInt32((uint)KnownColor.Maroon); - } - } - - /// - /// Well-known color: MediumAquamarine - /// - public static Color MediumAquamarine { - get { - return Color.FromUInt32((uint)KnownColor.MediumAquamarine); - } - } - - /// - /// Well-known color: MediumBlue - /// - public static Color MediumBlue { - get { - return Color.FromUInt32((uint)KnownColor.MediumBlue); - } - } - - /// - /// Well-known color: MediumOrchid - /// - public static Color MediumOrchid { - get { - return Color.FromUInt32((uint)KnownColor.MediumOrchid); - } - } - - /// - /// Well-known color: MediumPurple - /// - public static Color MediumPurple { - get { - return Color.FromUInt32((uint)KnownColor.MediumPurple); - } - } - - /// - /// Well-known color: MediumSeaGreen - /// - public static Color MediumSeaGreen { - get { - return Color.FromUInt32((uint)KnownColor.MediumSeaGreen); - } - } - - /// - /// Well-known color: MediumSlateBlue - /// - public static Color MediumSlateBlue { - get { - return Color.FromUInt32((uint)KnownColor.MediumSlateBlue); - } - } - - /// - /// Well-known color: MediumSpringGreen - /// - public static Color MediumSpringGreen { - get { - return Color.FromUInt32((uint)KnownColor.MediumSpringGreen); - } - } - - /// - /// Well-known color: MediumTurquoise - /// - public static Color MediumTurquoise { - get { - return Color.FromUInt32((uint)KnownColor.MediumTurquoise); - } - } - - /// - /// Well-known color: MediumVioletRed - /// - public static Color MediumVioletRed { - get { - return Color.FromUInt32((uint)KnownColor.MediumVioletRed); - } - } - - /// - /// Well-known color: MidnightBlue - /// - public static Color MidnightBlue { - get { - return Color.FromUInt32((uint)KnownColor.MidnightBlue); - } - } - - /// - /// Well-known color: MintCream - /// - public static Color MintCream { - get { - return Color.FromUInt32((uint)KnownColor.MintCream); - } - } - - /// - /// Well-known color: MistyRose - /// - public static Color MistyRose { - get { - return Color.FromUInt32((uint)KnownColor.MistyRose); - } - } - - /// - /// Well-known color: Moccasin - /// - public static Color Moccasin { - get { - return Color.FromUInt32((uint)KnownColor.Moccasin); - } - } - - /// - /// Well-known color: NavajoWhite - /// - public static Color NavajoWhite { - get { - return Color.FromUInt32((uint)KnownColor.NavajoWhite); - } - } - - /// - /// Well-known color: Navy - /// - public static Color Navy { - get { - return Color.FromUInt32((uint)KnownColor.Navy); - } - } - - /// - /// Well-known color: OldLace - /// - public static Color OldLace { - get { - return Color.FromUInt32((uint)KnownColor.OldLace); - } - } - - /// - /// Well-known color: Olive - /// - public static Color Olive { - get { - return Color.FromUInt32((uint)KnownColor.Olive); - } - } - - /// - /// Well-known color: OliveDrab - /// - public static Color OliveDrab { - get { - return Color.FromUInt32((uint)KnownColor.OliveDrab); - } - } - - /// - /// Well-known color: Orange - /// - public static Color Orange { - get { - return Color.FromUInt32((uint)KnownColor.Orange); - } - } - - /// - /// Well-known color: OrangeRed - /// - public static Color OrangeRed { - get { - return Color.FromUInt32((uint)KnownColor.OrangeRed); - } - } - - /// - /// Well-known color: Orchid - /// - public static Color Orchid { - get { - return Color.FromUInt32((uint)KnownColor.Orchid); - } - } - - /// - /// Well-known color: PaleGoldenrod - /// - public static Color PaleGoldenrod { - get { - return Color.FromUInt32((uint)KnownColor.PaleGoldenrod); - } - } - - /// - /// Well-known color: PaleGreen - /// - public static Color PaleGreen { - get { - return Color.FromUInt32((uint)KnownColor.PaleGreen); - } - } - - /// - /// Well-known color: PaleTurquoise - /// - public static Color PaleTurquoise { - get { - return Color.FromUInt32((uint)KnownColor.PaleTurquoise); - } - } - - /// - /// Well-known color: PaleVioletRed - /// - public static Color PaleVioletRed { - get { - return Color.FromUInt32((uint)KnownColor.PaleVioletRed); - } - } - - /// - /// Well-known color: PapayaWhip - /// - public static Color PapayaWhip { - get { - return Color.FromUInt32((uint)KnownColor.PapayaWhip); - } - } - - /// - /// Well-known color: PeachPuff - /// - public static Color PeachPuff { - get { - return Color.FromUInt32((uint)KnownColor.PeachPuff); - } - } - - /// - /// Well-known color: Peru - /// - public static Color Peru { - get { - return Color.FromUInt32((uint)KnownColor.Peru); - } - } - - /// - /// Well-known color: Pink - /// - public static Color Pink { - get { - return Color.FromUInt32((uint)KnownColor.Pink); - } - } - - /// - /// Well-known color: Plum - /// - public static Color Plum { - get { - return Color.FromUInt32((uint)KnownColor.Plum); - } - } - - /// - /// Well-known color: PowderBlue - /// - public static Color PowderBlue { - get { - return Color.FromUInt32((uint)KnownColor.PowderBlue); - } - } - - /// - /// Well-known color: Purple - /// - public static Color Purple { - get { - return Color.FromUInt32((uint)KnownColor.Purple); - } - } - - /// - /// Well-known color: Red - /// - public static Color Red { - get { - return Color.FromUInt32((uint)KnownColor.Red); - } - } - - /// - /// Well-known color: RosyBrown - /// - public static Color RosyBrown { - get { - return Color.FromUInt32((uint)KnownColor.RosyBrown); - } - } - - /// - /// Well-known color: RoyalBlue - /// - public static Color RoyalBlue { - get { - return Color.FromUInt32((uint)KnownColor.RoyalBlue); - } - } - - /// - /// Well-known color: SaddleBrown - /// - public static Color SaddleBrown { - get { - return Color.FromUInt32((uint)KnownColor.SaddleBrown); - } - } - - /// - /// Well-known color: Salmon - /// - public static Color Salmon { - get { - return Color.FromUInt32((uint)KnownColor.Salmon); - } - } - - /// - /// Well-known color: SandyBrown - /// - public static Color SandyBrown { - get { - return Color.FromUInt32((uint)KnownColor.SandyBrown); - } - } - - /// - /// Well-known color: SeaGreen - /// - public static Color SeaGreen { - get { - return Color.FromUInt32((uint)KnownColor.SeaGreen); - } - } - - /// - /// Well-known color: SeaShell - /// - public static Color SeaShell { - get { - return Color.FromUInt32((uint)KnownColor.SeaShell); - } - } - - /// - /// Well-known color: Sienna - /// - public static Color Sienna { - get { - return Color.FromUInt32((uint)KnownColor.Sienna); - } - } - - /// - /// Well-known color: Silver - /// - public static Color Silver { - get { - return Color.FromUInt32((uint)KnownColor.Silver); - } - } - - /// - /// Well-known color: SkyBlue - /// - public static Color SkyBlue { - get { - return Color.FromUInt32((uint)KnownColor.SkyBlue); - } - } - - /// - /// Well-known color: SlateBlue - /// - public static Color SlateBlue { - get { - return Color.FromUInt32((uint)KnownColor.SlateBlue); - } - } - - /// - /// Well-known color: SlateGray - /// - public static Color SlateGray { - get { - return Color.FromUInt32((uint)KnownColor.SlateGray); - } - } - - /// - /// Well-known color: Snow - /// - public static Color Snow { - get { - return Color.FromUInt32((uint)KnownColor.Snow); - } - } - - /// - /// Well-known color: SpringGreen - /// - public static Color SpringGreen { - get { - return Color.FromUInt32((uint)KnownColor.SpringGreen); - } - } - - /// - /// Well-known color: SteelBlue - /// - public static Color SteelBlue { - get { - return Color.FromUInt32((uint)KnownColor.SteelBlue); - } - } - - /// - /// Well-known color: Tan - /// - public static Color Tan { - get { - return Color.FromUInt32((uint)KnownColor.Tan); - } - } - - /// - /// Well-known color: Teal - /// - public static Color Teal { - get { - return Color.FromUInt32((uint)KnownColor.Teal); - } - } - - /// - /// Well-known color: Thistle - /// - public static Color Thistle { - get { - return Color.FromUInt32((uint)KnownColor.Thistle); - } - } - - /// - /// Well-known color: Tomato - /// - public static Color Tomato { - get { - return Color.FromUInt32((uint)KnownColor.Tomato); - } - } - - /// - /// Well-known color: Transparent - /// - public static Color Transparent { - get { - return Color.FromUInt32((uint)KnownColor.Transparent); - } - } - - /// - /// Well-known color: Turquoise - /// - public static Color Turquoise { - get { - return Color.FromUInt32((uint)KnownColor.Turquoise); - } - } - - /// - /// Well-known color: Violet - /// - public static Color Violet { - get { - return Color.FromUInt32((uint)KnownColor.Violet); - } - } - - /// - /// Well-known color: Wheat - /// - public static Color Wheat { - get { - return Color.FromUInt32((uint)KnownColor.Wheat); - } - } - - /// - /// Well-known color: White - /// - public static Color White { - get { - return Color.FromUInt32((uint)KnownColor.White); - } - } - - /// - /// Well-known color: WhiteSmoke - /// - public static Color WhiteSmoke { - get { - return Color.FromUInt32((uint)KnownColor.WhiteSmoke); - } - } - - /// - /// Well-known color: Yellow - /// - public static Color Yellow { - get { - return Color.FromUInt32((uint)KnownColor.Yellow); - } - } - - /// - /// Well-known color: YellowGreen - /// - public static Color YellowGreen { - get { - return Color.FromUInt32((uint)KnownColor.YellowGreen); - } - } - - #endregion static Known Colors - } -#endif -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.DashStyle.cs b/src/FPF/PresentationCore/System.Windows.Media.DashStyle.cs deleted file mode 100644 index cb0ef52..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.DashStyle.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace System.Windows.Media -{ - public class DashStyle - { - public double Offset { get; } - public double [] Dashes { get; } - - public DashStyle (IEnumerable dashes, Double offset) - { - Offset = offset; - if (dashes is double [] arr) - Dashes = arr; - else - Dashes = dashes.ToArray (); - } - } -} diff --git a/src/FPF/PresentationCore/System.Windows.Media.FillRule.cs b/src/FPF/PresentationCore/System.Windows.Media.FillRule.cs deleted file mode 100644 index 3c65882..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.FillRule.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Windows.Media -{ - public enum FillRule - { EvenOdd, - Nonzero, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.GeneralTransform.cs b/src/FPF/PresentationCore/System.Windows.Media.GeneralTransform.cs deleted file mode 100644 index 57ead83..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.GeneralTransform.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Windows.Media -{ - public abstract class GeneralTransform : System.Windows.Media.Animation.Animatable - { public System.Windows.Point Transform(System.Windows.Point param0){throw new System.NotImplementedException();} - public abstract System.Windows.Rect TransformBounds(System.Windows.Rect param0); - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Geometry.cs b/src/FPF/PresentationCore/System.Windows.Media.Geometry.cs deleted file mode 100644 index 0cd52b8..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Geometry.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace System.Windows.Media -{ - public abstract class Geometry : System.Windows.Media.Animation.Animatable - { public abstract System.Boolean IsEmpty(); - - - public static System.Windows.Media.Geometry Parse(System.String param0) { throw new System.NotImplementedException(); } - public System.Windows.Media.IntersectionDetail FillContainsWithDetail(System.Windows.Media.Geometry param0) { throw new System.NotImplementedException(); } - public System.Windows.Media.PathGeometry GetOutlinedPathGeometry() { throw new System.NotImplementedException(); } - - - public System.Windows.Media.Transform Transform { get { throw new System.NotImplementedException(); } set { throw new System.NotImplementedException(); } } - public static System.Windows.Media.Geometry Empty { get; } = new GeometryGroup(); - public virtual System.Windows.Rect Bounds { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.GeometryCollection.cs b/src/FPF/PresentationCore/System.Windows.Media.GeometryCollection.cs deleted file mode 100644 index c7698b7..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.GeometryCollection.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows.Media -{ - public class GeometryCollection : System.Windows.Media.Animation.Animatable - { public virtual void Add(System.Windows.Media.Geometry param0){throw new System.NotImplementedException();} - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs b/src/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs deleted file mode 100644 index 3bfc123..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.GeometryGroup.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Collections.Generic; -using System.Linq; - -namespace System.Windows.Media -{ - public class GeometryGroup : System.Windows.Media.Geometry - { - public List Children { get; } = new List(); - - public override Rect Bounds - { - get - { - if (Children.Count == 0) - return Rect.Empty; - var union = Children[0].Bounds; - foreach (var c in Children.Skip(1)) - union.Union(c.Bounds); - return union; - } - } - public override bool IsEmpty() - { - return !Children.Any(c => !c.IsEmpty()); - } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.ImageSource.cs b/src/FPF/PresentationCore/System.Windows.Media.ImageSource.cs deleted file mode 100644 index 6db3b26..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.ImageSource.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Windows.Media -{ - public abstract class ImageSource : System.Windows.Media.Animation.Animatable - { - public abstract System.Double Height { get; } - public abstract System.Double Width { get; } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapImage.cs b/src/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapImage.cs deleted file mode 100644 index 2e0796b..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapImage.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace System.Windows.Media.Imaging -{ - public class BitmapImage : System.Windows.Media.Imaging.BitmapSource - { public BitmapImage(){} - public virtual void BeginInit(){throw new System.NotImplementedException();} - public virtual void EndInit(){throw new System.NotImplementedException();} - - - public System.IO.Stream StreamSource { set { throw new System.NotImplementedException(); } } - - public override double Height => throw new NotImplementedException(); - - public override double Width => throw new NotImplementedException(); - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapSource.cs b/src/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapSource.cs deleted file mode 100644 index 5ea7a9e..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Imaging.BitmapSource.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace System.Windows.Media.Imaging -{ - public abstract class BitmapSource : System.Windows.Media.ImageSource - {} -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.IntersectionDetail.cs b/src/FPF/PresentationCore/System.Windows.Media.IntersectionDetail.cs deleted file mode 100644 index ecf2468..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.IntersectionDetail.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace System.Windows.Media -{ - public enum IntersectionDetail - { NotCalculated, - Empty, - FullyInside, - FullyContains, - Intersects, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.PathFigure.cs b/src/FPF/PresentationCore/System.Windows.Media.PathFigure.cs deleted file mode 100644 index 2fa79a9..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.PathFigure.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace System.Windows.Media -{ - public class PathFigure : System.Windows.Media.Animation.Animatable - { public PathFigure(){} - public PathFigure(System.Windows.Point param0, System.Collections.Generic.IEnumerable param1, System.Boolean param2){} - - - - public System.Boolean IsClosed { set { throw new System.NotImplementedException(); } } - public System.Windows.Point StartPoint { set { throw new System.NotImplementedException(); } } - public System.Windows.Media.PathSegmentCollection Segments { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.PathFigureCollection.cs b/src/FPF/PresentationCore/System.Windows.Media.PathFigureCollection.cs deleted file mode 100644 index 670519d..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.PathFigureCollection.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows.Media -{ - public class PathFigureCollection : System.Windows.Media.Animation.Animatable - { public virtual void Add(System.Windows.Media.PathFigure param0){throw new System.NotImplementedException();} - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.PathGeometry.cs b/src/FPF/PresentationCore/System.Windows.Media.PathGeometry.cs deleted file mode 100644 index e60c849..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.PathGeometry.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace System.Windows.Media -{ - public class PathGeometry : System.Windows.Media.Geometry - { public PathGeometry(){} - public PathGeometry(System.Collections.Generic.IEnumerable param0){} - public void AddGeometry(System.Windows.Media.Geometry param0){throw new System.NotImplementedException();} - - public override bool IsEmpty() - { - throw new NotImplementedException(); - } - - public System.Windows.Media.FillRule FillRule { set { throw new System.NotImplementedException(); } } - public System.Windows.Media.PathFigureCollection Figures { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.PathSegment.cs b/src/FPF/PresentationCore/System.Windows.Media.PathSegment.cs deleted file mode 100644 index b23eabe..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.PathSegment.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Media -{ - public abstract class PathSegment : System.Windows.Media.Animation.Animatable - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.PathSegmentCollection.cs b/src/FPF/PresentationCore/System.Windows.Media.PathSegmentCollection.cs deleted file mode 100644 index 07af3b2..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.PathSegmentCollection.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows.Media -{ - public class PathSegmentCollection : System.Windows.Media.Animation.Animatable - { public virtual void Add(System.Windows.Media.PathSegment param0){throw new System.NotImplementedException();} - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Pen.cs b/src/FPF/PresentationCore/System.Windows.Media.Pen.cs deleted file mode 100644 index 48df6cc..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Pen.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace System.Windows.Media -{ - public class Pen : Animation.Animatable - { - public Brush Brush { get; set; } - public double Thickness { get; set; } - public PenLineCap EndLineCap { get; set; } - public PenLineJoin LineJoin { get; set; } - public double MiterLimit { get; set; } - public PenLineCap StartLineCap { get; set; } - public DashStyle DashStyle { get; set; } - - public Pen () { } - - public Pen (Brush brush, double thickness) - { - Thickness = thickness; - Brush = brush; - } - - public new Pen Clone () { throw new NotImplementedException (); } - } -} diff --git a/src/FPF/PresentationCore/System.Windows.Media.PenLineCap.cs b/src/FPF/PresentationCore/System.Windows.Media.PenLineCap.cs deleted file mode 100644 index 301aec5..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.PenLineCap.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace System.Windows.Media -{ - public enum PenLineCap - { Flat, - Square, - Round, - Triangle, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.PenLineJoin.cs b/src/FPF/PresentationCore/System.Windows.Media.PenLineJoin.cs deleted file mode 100644 index 6ee6427..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.PenLineJoin.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace System.Windows.Media -{ - public enum PenLineJoin - { Miter, - Bevel, - Round, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.RectangleGeometry.cs b/src/FPF/PresentationCore/System.Windows.Media.RectangleGeometry.cs deleted file mode 100644 index cbd4481..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.RectangleGeometry.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace System.Windows.Media -{ - public class RectangleGeometry : System.Windows.Media.Geometry - { - public Rect Rectangle; - public RectangleGeometry(Rect rectangle) - { - this.Rectangle = rectangle; - } - - public override Rect Bounds => Rectangle; - - public override bool IsEmpty() - { - return Rectangle.IsEmpty; - } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.SolidColorBrush.cs b/src/FPF/PresentationCore/System.Windows.Media.SolidColorBrush.cs deleted file mode 100644 index b26bfa4..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.SolidColorBrush.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace System.Windows.Media -{ - public class SolidColorBrush : System.Windows.Media.Brush - { - public SolidColorBrush(System.Windows.Media.Color color) - { - this.Color = color; - } - - public new System.Windows.Media.SolidColorBrush Clone() { return new SolidColorBrush(Color); } - public System.Windows.Media.Color Color { get; set; } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.TextEffectCollection.cs b/src/FPF/PresentationCore/System.Windows.Media.TextEffectCollection.cs deleted file mode 100644 index 732e3bb..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.TextEffectCollection.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows.Media -{ - public class TextEffectCollection : System.Windows.Media.Animation.Animatable - { public TextEffectCollection(){} - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.TextFormatting.TextRunProperties.cs b/src/FPF/PresentationCore/System.Windows.Media.TextFormatting.TextRunProperties.cs deleted file mode 100644 index da49466..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.TextFormatting.TextRunProperties.cs +++ /dev/null @@ -1,34 +0,0 @@ -//----------------------------------------------------------------------- -// -// Microsoft Windows Client Platform -// Copyright (C) Microsoft Corporation -// -// File: TextRunProperties.cs -// -// Contents: Text run properties -// -// Spec: http://team/sites/Avalon/Specs/Text%20Formatting%20API.doc -// -// Created: 1-7-2005 Worachai Chaoweeraprasit (wchao) -// -//------------------------------------------------------------------------ - - -using System; -using System.Globalization; -using System.Windows; - -namespace System.Windows.Media.TextFormatting -{ - /// - /// Properties that can change from one run to the next, such as typeface or foreground brush. - /// - /// - /// The client provides a concrete implementation of this abstract run properties class. This - /// allows client to implement their run properties the way that fits with their run formatting - /// store. - /// - public abstract class TextRunProperties - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Transform.cs b/src/FPF/PresentationCore/System.Windows.Media.Transform.cs deleted file mode 100644 index 3cc4852..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Transform.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Media -{ - public abstract class Transform : System.Windows.Media.GeneralTransform - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Media.Typeface.cs b/src/FPF/PresentationCore/System.Windows.Media.Typeface.cs deleted file mode 100644 index e1a3eef..0000000 --- a/src/FPF/PresentationCore/System.Windows.Media.Typeface.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace System.Windows.Media -{ - public class Typeface : System.Object - { - public System.Windows.FontStyle Style { get; set; } - public System.Windows.FontWeight Weight { get; set; } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.QueryContinueDragEventArgs.cs b/src/FPF/PresentationCore/System.Windows.QueryContinueDragEventArgs.cs deleted file mode 100644 index bd90c9c..0000000 --- a/src/FPF/PresentationCore/System.Windows.QueryContinueDragEventArgs.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace System.Windows -{ - public class QueryContinueDragEventArgs : System.Windows.RoutedEventArgs - { - - - public System.Boolean EscapePressed { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.RoutedEvent.cs b/src/FPF/PresentationCore/System.Windows.RoutedEvent.cs deleted file mode 100644 index a685cc5..0000000 --- a/src/FPF/PresentationCore/System.Windows.RoutedEvent.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows -{ - public class RoutedEvent : System.Object - { - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.RoutedEventArgs.cs b/src/FPF/PresentationCore/System.Windows.RoutedEventArgs.cs deleted file mode 100644 index 8325f4e..0000000 --- a/src/FPF/PresentationCore/System.Windows.RoutedEventArgs.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace System.Windows -{ - public class RoutedEventArgs : System.EventArgs - { - - - - - public System.Boolean Handled { get { throw new System.NotImplementedException(); } set { throw new System.NotImplementedException(); } } - public System.Object OriginalSource { get { throw new System.NotImplementedException(); } } - public System.Object Source { get { throw new System.NotImplementedException(); } } - public System.Windows.RoutedEvent RoutedEvent { set { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.TextDataFormat.cs b/src/FPF/PresentationCore/System.Windows.TextDataFormat.cs deleted file mode 100644 index f7313e2..0000000 --- a/src/FPF/PresentationCore/System.Windows.TextDataFormat.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace System.Windows -{ - public enum TextDataFormat - { Text, - UnicodeText, - Rtf, - Html, - CommaSeparatedValue, - Xaml, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.TextDecorationCollection.cs b/src/FPF/PresentationCore/System.Windows.TextDecorationCollection.cs deleted file mode 100644 index 8eab60f..0000000 --- a/src/FPF/PresentationCore/System.Windows.TextDecorationCollection.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Windows.Media; -using System.Windows.Media.Animation; - -namespace System.Windows -{ - public static class TextDecorations - { - public static TextDecoration Baseline { get; } = new TextDecoration(); - public static TextDecoration Overline { get; } = new TextDecoration(); - public static TextDecoration Strikethrough { get; } = new TextDecoration(); - public static TextDecoration Underline { get; } = new TextDecoration(); - } - - public sealed class TextDecoration : Animatable - { - public Pen Pen { get; set; } - } - - public sealed class TextDecorationCollection : Animatable, IList - { - readonly List textDecorations = new List(); - - public TextDecoration this[int index] - { - get => textDecorations[index]; - set => textDecorations[index] = value; - } - - public int Count => textDecorations.Count; - - public bool IsReadOnly => false; - - public void Add(IEnumerable textDecorations) - => this.textDecorations.AddRange(textDecorations); - - public void Add(TextDecoration textDecoration) - => this.textDecorations.Add(textDecoration); - - public void Clear() - => textDecorations.Clear(); - - public bool Contains(TextDecoration item) - => textDecorations.Contains(item); - - public void CopyTo(TextDecoration[] array, int arrayIndex) - => textDecorations.CopyTo(array, arrayIndex); - - public int IndexOf(TextDecoration item) - => textDecorations.IndexOf(item); - - public void Insert(int index, TextDecoration item) - => textDecorations.Insert(index, item); - - public bool Remove(TextDecoration item) - => textDecorations.Remove(item); - - public void RemoveAt(int index) - => textDecorations.RemoveAt(index); - - public IEnumerator GetEnumerator() - => ((IList)textDecorations).GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() - => ((IList)textDecorations).GetEnumerator(); - } -} \ No newline at end of file diff --git a/src/FPF/PresentationCore/System.Windows.Visibility.cs b/src/FPF/PresentationCore/System.Windows.Visibility.cs deleted file mode 100644 index bb4de51..0000000 --- a/src/FPF/PresentationCore/System.Windows.Visibility.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace System.Windows -{ - public enum Visibility - { Visible, - Hidden, - Collapsed, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationFramework/PresentationFramework.csproj b/src/FPF/PresentationFramework/PresentationFramework.csproj deleted file mode 100644 index 10e9077..0000000 --- a/src/FPF/PresentationFramework/PresentationFramework.csproj +++ /dev/null @@ -1,9 +0,0 @@ - - - $(TargetFramework) - - - - - - \ No newline at end of file diff --git a/src/FPF/PresentationFramework/Properties/AssemblyInfo.cs b/src/FPF/PresentationFramework/Properties/AssemblyInfo.cs deleted file mode 100644 index ca0bd7d..0000000 --- a/src/FPF/PresentationFramework/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System; -using System.Reflection; - -[assembly: CLSCompliant(true)] -[assembly: AssemblyVersion("4.0.0.0")] \ No newline at end of file diff --git a/src/FPF/PresentationFramework/System.Windows.ResourceDictionary.cs b/src/FPF/PresentationFramework/System.Windows.ResourceDictionary.cs deleted file mode 100644 index 6444913..0000000 --- a/src/FPF/PresentationFramework/System.Windows.ResourceDictionary.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Linq; - -namespace System.Windows -{ - public class ResourceDictionary : System.Object, IDictionary - { - public System.Boolean Contains(System.Object param0) { - if (innerDictionary.ContainsKey (param0)) - return true; - if (_mergedDictionaries != null) { - for (int i = MergedDictionaries.Count - 1; i >= 0; i--) { - var mergedDictionary = MergedDictionaries[i]; - if (mergedDictionary != null && mergedDictionary.Contains(param0)) - return true; - } - } - return false; - } - - public ResourceDictionary() { } - public void Add(System.Object param0, System.Object param1) { innerDictionary[param0] = param1; } - - public void Clear() - { - innerDictionary.Clear(); - } - - public IDictionaryEnumerator GetEnumerator() - { - throw new NotImplementedException(); - } - - public void Remove(object key) - { - innerDictionary.Remove(key); - } - - public void CopyTo(Array array, int index) - { - throw new NotImplementedException(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return innerDictionary.GetEnumerator(); - } - - private ObservableCollection _mergedDictionaries = null; - public System.Collections.ObjectModel.Collection MergedDictionaries { - get { - if (_mergedDictionaries == null) { - _mergedDictionaries = new ObservableCollection(); - } - return _mergedDictionaries; - } - } - - public bool IsFixedSize => throw new NotImplementedException(); - - public bool IsReadOnly => throw new NotImplementedException(); - - public ICollection Keys => innerDictionary.Keys; - - public ICollection Values => innerDictionary.Values; - - public int Count => throw new NotImplementedException(); - - public bool IsSynchronized => throw new NotImplementedException(); - - public object SyncRoot => throw new NotImplementedException(); - - public bool HasImplicitDataTemplates { get; set; } - public bool HasImplicitStyles { get; private set; } - public bool IsThemeDictionary { get; private set; } - public bool IsInitialized { get; private set; } - public bool InvalidatesImplicitDataTemplateResources { get; private set; } - - Dictionary innerDictionary = new Dictionary(); - - public object this[object key] { - get { - if (innerDictionary.TryGetValue(key, out var val)) - return val; - for (int i = MergedDictionaries.Count - 1; i >= 0; i--) - { - var merged = MergedDictionaries [i]; - val = merged [key]; - if (val != null) - return val; - } - - return null; - } - set { innerDictionary[key] = value; } - } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationFramework/System.Windows.ResourceDictionaryLocation.cs b/src/FPF/PresentationFramework/System.Windows.ResourceDictionaryLocation.cs deleted file mode 100644 index b471f0d..0000000 --- a/src/FPF/PresentationFramework/System.Windows.ResourceDictionaryLocation.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace System.Windows -{ - public enum ResourceDictionaryLocation - { None, - SourceAssembly, - ExternalAssembly, - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationFramework/System.Windows.SystemColors.cs b/src/FPF/PresentationFramework/System.Windows.SystemColors.cs deleted file mode 100644 index a6adb3d..0000000 --- a/src/FPF/PresentationFramework/System.Windows.SystemColors.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace System.Windows -{ - public abstract class SystemColors : System.Object - { - static System.Windows.Media.Color pinkColor = new Media.Color { - R = 255, G = 192, B = 203, A = 255 - }; - public static System.Windows.Media.Color ControlColor { get { return pinkColor; } } - public static System.Windows.Media.Color ControlTextColor { get { return pinkColor; } } - public static System.Windows.Media.Color GrayTextColor { get { return pinkColor; } } - public static System.Windows.Media.Color HighlightColor { get { return pinkColor; } } - public static System.Windows.Media.Color HighlightTextColor { get { return pinkColor; } } - public static System.Windows.Media.SolidColorBrush ActiveBorderBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush ActiveCaptionBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush ControlBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush ControlDarkBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush ControlLightBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush ControlLightLightBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush GrayTextBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush HighlightBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush HotTrackBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush InfoBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush InfoTextBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush WindowBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush WindowFrameBrush { get { return new Media.SolidColorBrush(pinkColor); } } - public static System.Windows.Media.SolidColorBrush WindowTextBrush { - get { return new Windows.Media.SolidColorBrush(new Media.Color { R = 0, G = 0, B = 0, A = 255 }); } - } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationFramework/System.Windows.SystemParameters.cs b/src/FPF/PresentationFramework/System.Windows.SystemParameters.cs deleted file mode 100644 index f24e07b..0000000 --- a/src/FPF/PresentationFramework/System.Windows.SystemParameters.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace System.Windows -{ - public abstract class SystemParameters : System.Object - { - - - - - - - - - - - public static System.Boolean HighContrast { get { return false; } } - public static System.Boolean IsMenuDropRightAligned { get { throw new System.NotImplementedException(); } } - public static System.Boolean MenuDropAlignment { get { throw new System.NotImplementedException(); } } - public static System.Double MinimumHorizontalDragDistance { get { return 5; } } - public static System.Double MinimumVerticalDragDistance { get { return 5; } } - public static System.Double PrimaryScreenHeight { get { throw new System.NotImplementedException(); } } - public static System.Double PrimaryScreenWidth { get { throw new System.NotImplementedException(); } } - public static System.Int32 WheelScrollLines { get { throw new System.NotImplementedException(); } } - public static System.Windows.Rect WorkArea { get { throw new System.NotImplementedException(); } } - } -} \ No newline at end of file diff --git a/src/FPF/PresentationFramework/System.Windows.ThemeInfoAttribute.cs b/src/FPF/PresentationFramework/System.Windows.ThemeInfoAttribute.cs deleted file mode 100644 index 2b6a550..0000000 --- a/src/FPF/PresentationFramework/System.Windows.ThemeInfoAttribute.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows -{ - public class ThemeInfoAttribute : System.Attribute - { public ThemeInfoAttribute(System.Windows.ResourceDictionaryLocation param0, System.Windows.ResourceDictionaryLocation param1){} - - } -} \ No newline at end of file diff --git a/src/FPF/PresentationFramework/System.Windows.Thickness.cs b/src/FPF/PresentationFramework/System.Windows.Thickness.cs deleted file mode 100644 index bd7be9b..0000000 --- a/src/FPF/PresentationFramework/System.Windows.Thickness.cs +++ /dev/null @@ -1,215 +0,0 @@ -//--------------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All rights reserved. -// -// File: Thickness.cs -// -// Description: Contains the Thickness (double x4) value type. -// -// History: -// 06/02/2003 : greglett - created. -// -//--------------------------------------------------------------------------- - -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows -{ - /// - /// Thickness is a value type used to describe the thickness of frame around a rectangle. - /// It contains four doubles each corresponding to a side: Left, Top, Right, Bottom. - /// - public struct Thickness : IEquatable - { - //------------------------------------------------------------------- - // - // Constructors - // - //------------------------------------------------------------------- - - #region Constructors - /// - /// This constructur builds a Thickness with a specified value on every side. - /// - /// The specified uniform length. - public Thickness(double uniformLength) - { - _Left = _Top = _Right = _Bottom = uniformLength; - } - - /// - /// This constructor builds a Thickness with the specified number of pixels on each side. - /// - /// The thickness for the left side. - /// The thickness for the top side. - /// The thickness for the right side. - /// The thickness for the bottom side. - public Thickness(double left, double top, double right, double bottom) - { - _Left = left; - _Top = top; - _Right = right; - _Bottom = bottom; - } - - - #endregion - - - //------------------------------------------------------------------- - // - // Public Methods - // - //------------------------------------------------------------------- - - #region Public Methods - - /// - /// This function compares to the provided object for type and value equality. - /// - /// Object to compare - /// True if object is a Thickness and all sides of it are equal to this Thickness'. - public override bool Equals(object obj) - { - if (obj is Thickness) - { - Thickness otherObj = (Thickness)obj; - return (this == otherObj); - } - return (false); - } - - /// - /// Compares this instance of Thickness with another instance. - /// - /// Thickness instance to compare. - /// trueif this Thickness instance has the same value - /// and unit type as thickness. - public bool Equals(Thickness thickness) - { - return (this == thickness); - } - - /// - /// This function returns a hash code. - /// - /// Hash code - public override int GetHashCode() - { - return _Left.GetHashCode() ^ _Top.GetHashCode() ^ _Right.GetHashCode() ^ _Bottom.GetHashCode(); - } - - #endregion - - - //------------------------------------------------------------------- - // - // Public Operators - // - //------------------------------------------------------------------- - - #region Public Operators - - /// - /// Overloaded operator to compare two Thicknesses for equality. - /// - /// first Thickness to compare - /// second Thickness to compare - /// True if all sides of the Thickness are equal, false otherwise - // SEEALSO - public static bool operator ==(Thickness t1, Thickness t2) - { - return ((t1._Left == t2._Left || (double.IsNaN(t1._Left) && double.IsNaN(t2._Left))) - && (t1._Top == t2._Top || (double.IsNaN(t1._Top) && double.IsNaN(t2._Top))) - && (t1._Right == t2._Right || (double.IsNaN(t1._Right) && double.IsNaN(t2._Right))) - && (t1._Bottom == t2._Bottom || (double.IsNaN(t1._Bottom) && double.IsNaN(t2._Bottom))) - ); - } - - /// - /// Overloaded operator to compare two Thicknesses for inequality. - /// - /// first Thickness to compare - /// second Thickness to compare - /// False if all sides of the Thickness are equal, true otherwise - // SEEALSO - public static bool operator !=(Thickness t1, Thickness t2) - { - return (!(t1 == t2)); - } - - #endregion - - - //------------------------------------------------------------------- - // - // Public Properties - // - //------------------------------------------------------------------- - - #region Public Properties - - /// This property is the Length on the thickness' left side - public double Left - { - get { return _Left; } - set { _Left = value; } - } - - /// This property is the Length on the thickness' top side - public double Top - { - get { return _Top; } - set { _Top = value; } - } - - /// This property is the Length on the thickness' right side - public double Right - { - get { return _Right; } - set { _Right = value; } - } - - /// This property is the Length on the thickness' bottom side - public double Bottom - { - get { return _Bottom; } - set { _Bottom = value; } - } - #endregion - - //------------------------------------------------------------------- - // - // INternal API - // - //------------------------------------------------------------------- - - #region Internal API - - internal Size Size - { - get - { - return new Size(_Left + _Right, _Top + _Bottom); - } - } - - #endregion - - //------------------------------------------------------------------- - // - // Private Fields - // - //------------------------------------------------------------------- - - #region Private Fields - - private double _Left; - private double _Top; - private double _Right; - private double _Bottom; - - #endregion - } -} \ No newline at end of file diff --git a/src/FPF/README.md b/src/FPF/README.md deleted file mode 100644 index 0ea55f0..0000000 --- a/src/FPF/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# FPF: Fake Presentation Foundation - -FPF stubs just enough of the WPF APIs that the editor depends on. Notably -we require some primitives such as `Color`, `Brush`, `Point`, etc. This is -a very minimal approach to bootstrap the editor on macOS, and over time we -anticipate eliminating this support layer entirely. - -For `WindowsBase`, we have simply imported a subset of -[Mono's version][mwb] and made changes to the `Dispatcher` to use macOS' -[Grand Central Dispatch][gcd], since the editor uses this extensively, -we wanted it to be highly performant. - -For the other assemblies we generated necessary stubs and filled in the -basic primitives. - -FPF depends on Xamarin.Mac to build at this point. - -[mwb]: https://github.com/mono/mono/tree/master/mcs/class/WindowsBase -[gcd]: https://developer.apple.com/documentation/dispatch \ No newline at end of file diff --git a/src/FPF/UIAutomationClient/Properties/AssemblyInfo.cs b/src/FPF/UIAutomationClient/Properties/AssemblyInfo.cs deleted file mode 100644 index ca0bd7d..0000000 --- a/src/FPF/UIAutomationClient/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System; -using System.Reflection; - -[assembly: CLSCompliant(true)] -[assembly: AssemblyVersion("4.0.0.0")] \ No newline at end of file diff --git a/src/FPF/UIAutomationClient/System.Windows.Automation.AutomationElement.cs b/src/FPF/UIAutomationClient/System.Windows.Automation.AutomationElement.cs deleted file mode 100644 index 83e0cfc..0000000 --- a/src/FPF/UIAutomationClient/System.Windows.Automation.AutomationElement.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows.Automation -{ - public class AutomationElement : System.Object - { public static System.Object NotSupported; - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationClient/System.Windows.Automation.TextPattern.cs b/src/FPF/UIAutomationClient/System.Windows.Automation.TextPattern.cs deleted file mode 100644 index 624a50a..0000000 --- a/src/FPF/UIAutomationClient/System.Windows.Automation.TextPattern.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace System.Windows.Automation -{ - public class TextPattern - { public static System.Object MixedAttributeValue; - public static System.Windows.Automation.AutomationTextAttribute BackgroundColorAttribute; - public static System.Windows.Automation.AutomationTextAttribute CultureAttribute; - public static System.Windows.Automation.AutomationTextAttribute FontNameAttribute; - public static System.Windows.Automation.AutomationTextAttribute FontSizeAttribute; - public static System.Windows.Automation.AutomationTextAttribute FontWeightAttribute; - public static System.Windows.Automation.AutomationTextAttribute ForegroundColorAttribute; - public static System.Windows.Automation.AutomationTextAttribute IsItalicAttribute; - public static System.Windows.Automation.AutomationTextAttribute IsReadOnlyAttribute; - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationClient/UIAutomationClient.csproj b/src/FPF/UIAutomationClient/UIAutomationClient.csproj deleted file mode 100644 index e179f75..0000000 --- a/src/FPF/UIAutomationClient/UIAutomationClient.csproj +++ /dev/null @@ -1,8 +0,0 @@ - - - $(TargetFramework) - - - - - \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/Properties/AssemblyInfo.cs b/src/FPF/UIAutomationProvider/Properties/AssemblyInfo.cs deleted file mode 100644 index ca0bd7d..0000000 --- a/src/FPF/UIAutomationProvider/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System; -using System.Reflection; - -[assembly: CLSCompliant(true)] -[assembly: AssemblyVersion("4.0.0.0")] \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.AutomationInteropProvider.cs b/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.AutomationInteropProvider.cs deleted file mode 100644 index 399ba9d..0000000 --- a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.AutomationInteropProvider.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Windows.Automation.Provider -{ - public abstract class AutomationInteropProvider : System.Object - { - public static System.Boolean ClientsAreListening { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IRawElementProviderSimple.cs b/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IRawElementProviderSimple.cs deleted file mode 100644 index 2292ca2..0000000 --- a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IRawElementProviderSimple.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows.Automation.Provider -{ - public interface IRawElementProviderSimple - { System.Object GetPropertyValue(System.Int32 param0); - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionItemProvider.cs b/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionItemProvider.cs deleted file mode 100644 index 12bc0e0..0000000 --- a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionItemProvider.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Automation.Provider -{ - public interface ISelectionItemProvider - { - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionProvider.cs b/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionProvider.cs deleted file mode 100644 index 0ecbb29..0000000 --- a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ISelectionProvider.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Automation.Provider -{ - public interface ISelectionProvider - { - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextProvider.cs b/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextProvider.cs deleted file mode 100644 index 2e8068b..0000000 --- a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextProvider.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Automation.Provider -{ - public interface ITextProvider - { - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextRangeProvider.cs b/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextRangeProvider.cs deleted file mode 100644 index 869918b..0000000 --- a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.ITextRangeProvider.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Automation.Provider -{ - public interface ITextRangeProvider - { - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IValueProvider.cs b/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IValueProvider.cs deleted file mode 100644 index e31790e..0000000 --- a/src/FPF/UIAutomationProvider/System.Windows.Automation.Provider.IValueProvider.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Automation.Provider -{ - public interface IValueProvider - { - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationProvider/UIAutomationProvider.csproj b/src/FPF/UIAutomationProvider/UIAutomationProvider.csproj deleted file mode 100644 index e6e8e6b..0000000 --- a/src/FPF/UIAutomationProvider/UIAutomationProvider.csproj +++ /dev/null @@ -1,5 +0,0 @@ - - - $(TargetFramework) - - \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/Properties/AssemblyInfo.cs b/src/FPF/UIAutomationTypes/Properties/AssemblyInfo.cs deleted file mode 100644 index ca0bd7d..0000000 --- a/src/FPF/UIAutomationTypes/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,5 +0,0 @@ -using System; -using System.Reflection; - -[assembly: CLSCompliant(true)] -[assembly: AssemblyVersion("4.0.0.0")] \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationElementIdentifiers.cs b/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationElementIdentifiers.cs deleted file mode 100644 index d55027f..0000000 --- a/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationElementIdentifiers.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows.Automation -{ - public abstract class AutomationElementIdentifiers : System.Object - { public static System.Windows.Automation.AutomationProperty BoundingRectangleProperty; - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationIdentifier.cs b/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationIdentifier.cs deleted file mode 100644 index c5e2017..0000000 --- a/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationIdentifier.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Windows.Automation -{ - public class AutomationIdentifier : System.Object - { - public System.Int32 Id { get { throw new System.NotImplementedException(); } } - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationProperty.cs b/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationProperty.cs deleted file mode 100644 index e477d8e..0000000 --- a/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationProperty.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Automation -{ - public class AutomationProperty : System.Windows.Automation.AutomationIdentifier - { - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationTextAttribute.cs b/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationTextAttribute.cs deleted file mode 100644 index 6aaa162..0000000 --- a/src/FPF/UIAutomationTypes/System.Windows.Automation.AutomationTextAttribute.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace System.Windows.Automation -{ - public class AutomationTextAttribute : System.Windows.Automation.AutomationIdentifier - { - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/System.Windows.Automation.SelectionItemPatternIdentifiers.cs b/src/FPF/UIAutomationTypes/System.Windows.Automation.SelectionItemPatternIdentifiers.cs deleted file mode 100644 index b12dd05..0000000 --- a/src/FPF/UIAutomationTypes/System.Windows.Automation.SelectionItemPatternIdentifiers.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace System.Windows.Automation -{ - public abstract class SelectionItemPatternIdentifiers : System.Object - { public static System.Windows.Automation.AutomationProperty IsSelectedProperty; - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/System.Windows.Automation.SupportedTextSelection.cs b/src/FPF/UIAutomationTypes/System.Windows.Automation.SupportedTextSelection.cs deleted file mode 100644 index d2c7bd7..0000000 --- a/src/FPF/UIAutomationTypes/System.Windows.Automation.SupportedTextSelection.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace System.Windows.Automation -{ - public enum SupportedTextSelection - { None, - Single, - Multiple, - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextPatternRangeEndpoint.cs b/src/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextPatternRangeEndpoint.cs deleted file mode 100644 index 81745f2..0000000 --- a/src/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextPatternRangeEndpoint.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace System.Windows.Automation.Text -{ - public enum TextPatternRangeEndpoint - { Start, - End, - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextUnit.cs b/src/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextUnit.cs deleted file mode 100644 index b3ac854..0000000 --- a/src/FPF/UIAutomationTypes/System.Windows.Automation.Text.TextUnit.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace System.Windows.Automation.Text -{ - public enum TextUnit - { Character, - Format, - Word, - Line, - Paragraph, - Page, - Document, - - } -} \ No newline at end of file diff --git a/src/FPF/UIAutomationTypes/UIAutomationTypes.csproj b/src/FPF/UIAutomationTypes/UIAutomationTypes.csproj deleted file mode 100644 index e6e8e6b..0000000 --- a/src/FPF/UIAutomationTypes/UIAutomationTypes.csproj +++ /dev/null @@ -1,5 +0,0 @@ - - - $(TargetFramework) - - \ No newline at end of file diff --git a/src/FPF/WindowsBase/Assembly/AssemblyInfo.cs b/src/FPF/WindowsBase/Assembly/AssemblyInfo.cs deleted file mode 100644 index 0e831d2..0000000 --- a/src/FPF/WindowsBase/Assembly/AssemblyInfo.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// AssemblyInfo.cs -// -// Author: -// Andreas Nahr (ClassDevelopment@A-SoftTech.com) -// -// (C) 2003 Ximian, Inc. http://www.ximian.com -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System; -using System.Reflection; -using System.Resources; -using System.Security; -using System.Security.Permissions; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows.Markup; - -[assembly: AssemblyCompany (Consts.MonoCompany)] -[assembly: AssemblyProduct (Consts.MonoProduct)] -[assembly: AssemblyCopyright (Consts.MonoCopyright)] -[assembly: AssemblyVersion (Consts.FxVersion)] -[assembly: AssemblyFileVersion (Consts.FxFileVersion)] - -[assembly: NeutralResourcesLanguage ("en")] -[assembly: CLSCompliant (true)] -[assembly: AssemblyDelaySign (true)] - -[assembly: ComVisible (false)] -[assembly: AllowPartiallyTrustedCallers] - -[assembly: SecurityCritical] - -[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/xps/2005/06", "metro")] -[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "wpf")] -[assembly: XmlnsPrefixAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "av")] - -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows.Media")] -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows.Input")] -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/xps/2005/06", "System.Windows")] - -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml", "System.Windows.Markup")] - -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Media")] -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows.Input")] -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Windows")] -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "System.Diagnostics")] - -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/winfx/2006/xaml/composite-font", "System.Windows.Media")] - -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows.Media")] -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows.Input")] -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Windows")] -[assembly: XmlnsDefinitionAttribute ("http://schemas.microsoft.com/netfx/2007/xaml/presentation", "System.Diagnostics")] - -#if !MOBILE -[assembly: TypeForwardedTo (typeof (ValueSerializerAttribute))] -#endif - diff --git a/src/FPF/WindowsBase/Consts.cs b/src/FPF/WindowsBase/Consts.cs deleted file mode 100644 index c901887..0000000 --- a/src/FPF/WindowsBase/Consts.cs +++ /dev/null @@ -1,125 +0,0 @@ -// -// Consts.cs.in -// -// Author: -// Kornél Pál -// -// Copyright (C) 2005-2006 Kornél Pál -// - -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -static class Consts -{ - // - // Use these assembly version constants to make code more maintainable. - // - - public const string MonoVersion = "@MONO_VERSION@"; - public const string MonoCompany = "Mono development team"; - public const string MonoProduct = "Mono Common Language Infrastructure"; - public const string MonoCopyright = "(c) Various Mono authors"; - public const int MonoCorlibVersion = 0; - -#if MOBILE - // Versions of .NET Framework for Silverlight 4.0 - public const string FxVersion = "2.0.5.0"; - public const string VsVersion = "9.0.0.0"; // unused, but needed for compilation - public const string FxFileVersion = "4.0.50524.0"; - public const string EnvironmentVersion = FxFileVersion; - - public const string VsFileVersion = "9.0.50727.42"; // unused, but needed for compilation -#elif NET_4_6 - public const string FxVersion = "4.0.0.0"; - public const string FxFileVersion = "4.6.57.0"; - public const string EnvironmentVersion = "4.0.30319.42000"; - - public const string VsVersion = "0.0.0.0"; // Useless ? - public const string VsFileVersion = "11.0.0.0"; // TODO: -#elif NET_4_5 - public const string FxVersion = "4.0.0.0"; - public const string FxFileVersion = "4.0.30319.17020"; - public const string EnvironmentVersion = FxFileVersion; - - public const string VsVersion = "0.0.0.0"; // Useless ? - public const string VsFileVersion = "11.0.0.0"; // TODO: -#elif NET_4_0 - #error Profile NET_4_0 is not supported. -#elif NET_3_5 - #error Profile NET_3_5 is not supported. -#elif NET_3_0 - #error Profile NET_3_0 is not supported. -#elif NET_2_0 - #error Profile NET_2_0 is not supported. -#elif NET_1_1 - #error Profile NET_1_1 is not supported. -#elif NET_1_0 - #error Profile NET_1_0 is not supported. -#else -#error No profile symbols defined. -#endif - -#if MOBILE - const string PublicKeyToken = "7cec85d7bea7798e"; -#else - const string PublicKeyToken = "b77a5c561934e089"; -#endif - - // - // Use these assembly name constants to make code more maintainable. - // - - public const string AssemblyI18N = "I18N, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; - public const string AssemblyMicrosoft_JScript = "Microsoft.JScript, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblyMicrosoft_VisualStudio = "Microsoft.VisualStudio, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblyMicrosoft_VisualStudio_Web = "Microsoft.VisualStudio.Web, Version=" + VsVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblyMicrosoft_VSDesigner = "Microsoft.VSDesigner, Version=" + VsVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblyMono_Http = "Mono.Http, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; - public const string AssemblyMono_Posix = "Mono.Posix, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; - public const string AssemblyMono_Security = "Mono.Security, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; - public const string AssemblyMono_Messaging_RabbitMQ = "Mono.Messaging.RabbitMQ, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=0738eb9f132ed756"; - public const string AssemblyCorlib = "mscorlib, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=" + PublicKeyToken; - public const string AssemblySystem = "System, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; - public const string AssemblySystem_Data = "System.Data, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; - public const string AssemblySystem_Design = "System.Design, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblySystem_DirectoryServices = "System.DirectoryServices, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblySystem_Drawing = "System.Drawing, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblySystem_Drawing_Design = "System.Drawing.Design, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblySystem_Messaging = "System.Messaging, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblySystem_Security = "System.Security, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblySystem_ServiceProcess = "System.ServiceProcess, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblySystem_Web = "System.Web, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"; - public const string AssemblySystem_Windows_Forms = "System.Windows.Forms, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; -#if NET_4_0 - public const string AssemblySystem_2_0 = "System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; - public const string AssemblySystemCore_3_5 = "System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; - public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; - public const string WindowsBase_3_0 = "WindowsBase, Version=3.0.0.0, PublicKeyToken=31bf3856ad364e35"; - public const string AssemblyWindowsBase = "WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; - public const string AssemblyPresentationCore_3_5 = "PresentationCore, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; - public const string AssemblyPresentationCore_4_0 = "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; - public const string AssemblyPresentationFramework_3_5 = "PresentationFramework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; - public const string AssemblySystemServiceModel_3_0 = "System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"; -#elif MOBILE - public const string AssemblySystem_Core = "System.Core, Version=" + FxVersion + ", Culture=neutral, PublicKeyToken=b77a5c561934e089"; -#endif -} diff --git a/src/FPF/WindowsBase/MonoTODOAttribute.cs b/src/FPF/WindowsBase/MonoTODOAttribute.cs deleted file mode 100644 index 33bf695..0000000 --- a/src/FPF/WindowsBase/MonoTODOAttribute.cs +++ /dev/null @@ -1,101 +0,0 @@ -// -// MonoTODOAttribute.cs -// -// Authors: -// Ravi Pratap (ravi@ximian.com) -// Eyal Alaluf -// -// (C) Ximian, Inc. http://www.ximian.com -// - -// -// Copyright (C) 2004 Novell, Inc (http://www.novell.com) -// Copyright (C) 2006 Mainsoft, Inc (http://www.mainsoft.com) -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System { -#pragma warning disable 436 - [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] - internal class MonoTODOAttribute : Attribute { - - string comment; - - public MonoTODOAttribute () - { - } - - public MonoTODOAttribute (string comment) - { - this.comment = comment; - } - - public string Comment { - get { return comment; } - } - } - - [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] - internal class MonoDocumentationNoteAttribute : MonoTODOAttribute { - - public MonoDocumentationNoteAttribute (string comment) - : base (comment) - { - } - } - - [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] - internal class MonoExtensionAttribute : MonoTODOAttribute { - - public MonoExtensionAttribute (string comment) - : base (comment) - { - } - } - - [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] - internal class MonoInternalNoteAttribute : MonoTODOAttribute { - - public MonoInternalNoteAttribute (string comment) - : base (comment) - { - } - } - - [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] - internal class MonoLimitationAttribute : MonoTODOAttribute { - - public MonoLimitationAttribute (string comment) - : base (comment) - { - } - } - - [AttributeUsage (AttributeTargets.All, AllowMultiple=true)] - internal class MonoNotSupportedAttribute : MonoTODOAttribute { - - public MonoNotSupportedAttribute (string comment) - : base (comment) - { - } - } -#pragma warning restore 436 -} diff --git a/src/FPF/WindowsBase/System.Collections.Specialized/CollectionChangedEventManager.cs b/src/FPF/WindowsBase/System.Collections.Specialized/CollectionChangedEventManager.cs deleted file mode 100644 index 5cdf2f8..0000000 --- a/src/FPF/WindowsBase/System.Collections.Specialized/CollectionChangedEventManager.cs +++ /dev/null @@ -1,80 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Windows; - -namespace System.Collections.Specialized { - - public class CollectionChangedEventManager : WeakEventManager - { - internal CollectionChangedEventManager () - { - } - - public static void AddListener (INotifyCollectionChanged source, IWeakEventListener listener) - { - CurrentManager.ProtectedAddListener (source, listener); - } - - public static void RemoveListener (INotifyCollectionChanged source, IWeakEventListener listener) - { - CurrentManager.ProtectedAddListener (source, listener); - } - - protected override void StartListening (object source) - { - INotifyCollectionChanged inotify = (INotifyCollectionChanged) source; - inotify.CollectionChanged += OnCollectionChanged; - } - - protected override void StopListening (object source) - { - INotifyCollectionChanged inotify = (INotifyCollectionChanged) source; - inotify.CollectionChanged -= OnCollectionChanged; - } - - private void OnCollectionChanged (object sender, NotifyCollectionChangedEventArgs e) - { - DeliverEvent (sender, e); - } - - private static object CurrentManagerLock = new object (); - - private static CollectionChangedEventManager CurrentManager { - get { - lock (CurrentManagerLock) { - CollectionChangedEventManager manager = (CollectionChangedEventManager)GetCurrentManager (typeof (CollectionChangedEventManager)); - if (manager == null) { - manager = new CollectionChangedEventManager (); - SetCurrentManager (typeof (CollectionChangedEventManager), manager); - } - return manager; - } - } - } - } -} - diff --git a/src/FPF/WindowsBase/System.Collections.Specialized/INotifyCollectionChanged.cs b/src/FPF/WindowsBase/System.Collections.Specialized/INotifyCollectionChanged.cs deleted file mode 100644 index a6a2e57..0000000 --- a/src/FPF/WindowsBase/System.Collections.Specialized/INotifyCollectionChanged.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - - -using System.Collections.Specialized; -using System.Runtime.CompilerServices; -[assembly:TypeForwardedTo (typeof (INotifyCollectionChanged))] - diff --git a/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedAction.cs b/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedAction.cs deleted file mode 100644 index f9a24bb..0000000 --- a/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedAction.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - - -using System.Collections.Specialized; -using System.Runtime.CompilerServices; -[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedAction))] - diff --git a/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs b/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs deleted file mode 100644 index 993f547..0000000 --- a/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventArgs.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// Brian O'Keefe (zer0keefie@gmail.com) -// - - -using System.Collections.Specialized; -using System.Runtime.CompilerServices; -[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedEventArgs))] - diff --git a/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs b/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs deleted file mode 100644 index 8fa9fb0..0000000 --- a/src/FPF/WindowsBase/System.Collections.Specialized/NotifyCollectionChangedEventHandler.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - - -using System.Collections.Specialized; -using System.Runtime.CompilerServices; -[assembly:TypeForwardedTo (typeof (NotifyCollectionChangedEventHandler))] - diff --git a/src/FPF/WindowsBase/System.ComponentModel/DependencyPropertyDescriptor.cs b/src/FPF/WindowsBase/System.ComponentModel/DependencyPropertyDescriptor.cs deleted file mode 100644 index 2a0f5cc..0000000 --- a/src/FPF/WindowsBase/System.ComponentModel/DependencyPropertyDescriptor.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Windows; - -namespace System.ComponentModel { - - public sealed class DependencyPropertyDescriptor : PropertyDescriptor { - internal DependencyPropertyDescriptor () : base (null) - { - } - - public override AttributeCollection Attributes - { - get { throw new NotImplementedException (); } - } - public override string Category - { - get { throw new NotImplementedException (); } - } - public override Type ComponentType - { - get { throw new NotImplementedException (); } - } - public override TypeConverter Converter - { - get { throw new NotImplementedException (); } - } - public DependencyProperty DependencyProperty - { - get { throw new NotImplementedException (); } - } - public override string Description - { - get { throw new NotImplementedException (); } - } - public override bool DesignTimeOnly - { - get { throw new NotImplementedException (); } - } - public override string DisplayName - { - get { throw new NotImplementedException (); } - } - public bool IsAttached - { - get { throw new NotImplementedException (); } - } - public override bool IsBrowsable - { - get { throw new NotImplementedException (); } - } - public override bool IsLocalizable - { - get { throw new NotImplementedException (); } - } - public override bool IsReadOnly - { - get { throw new NotImplementedException (); } - } - public PropertyMetadata Metadata - { - get { throw new NotImplementedException (); } - } - public override Type PropertyType - { - get { throw new NotImplementedException (); } - } - public override bool SupportsChangeEvents - { - get { throw new NotImplementedException (); } - } - - public override void AddValueChanged (object component, EventHandler handler) - { - throw new NotImplementedException (); - } - public override bool CanResetValue (object component) - { - throw new NotImplementedException (); - } - public override bool Equals (object obj) - { - throw new NotImplementedException (); - } - public override PropertyDescriptorCollection GetChildProperties (object instance, Attribute[] filter) - { - throw new NotImplementedException (); - } - public override object GetEditor (Type editorBaseType) - { - throw new NotImplementedException (); - } - public override int GetHashCode () - { - throw new NotImplementedException (); - } - public override object GetValue (object component) - { - throw new NotImplementedException (); - } - public override void RemoveValueChanged (object component, EventHandler handler) - { - throw new NotImplementedException (); - } - public override void ResetValue (object component) - { - throw new NotImplementedException (); - } - public override void SetValue (object component, object value) - { - throw new NotImplementedException (); - } - public override bool ShouldSerializeValue (object component) - { - throw new NotImplementedException (); - } - public override string ToString () - { - throw new NotImplementedException (); - } - - public static DependencyPropertyDescriptor FromName (string name, Type ownerType, Type targetType) - { - throw new NotImplementedException (); - } - public static DependencyPropertyDescriptor FromProperty (PropertyDescriptor property) - { - throw new NotImplementedException (); - } - public static DependencyPropertyDescriptor FromProperty (DependencyProperty dependencyProperty, Type targetType) - { - throw new NotImplementedException (); - } - - public CoerceValueCallback DesignerCoerceValueCallback { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - } - -} diff --git a/src/FPF/WindowsBase/System.IO/FileFormatException.cs b/src/FPF/WindowsBase/System.IO/FileFormatException.cs deleted file mode 100644 index 38ae5d5..0000000 --- a/src/FPF/WindowsBase/System.IO/FileFormatException.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// Miguel de Icaza (miguel@ximian.com) -// - -using System; -using System.Runtime.Serialization; -using System.Security; - -namespace System.IO { - - [Serializable] - public class FileFormatException : FormatException, ISerializable - { - Uri source_uri; - - public FileFormatException () : base () - { - } - - public FileFormatException (string message) : base (message) - { - } - - public FileFormatException (Uri sourceUri) - { - this.source_uri = sourceUri; - } - - protected FileFormatException (SerializationInfo info, StreamingContext context) - : base (info, context) - { - if (info == null) - throw new ArgumentNullException ("info"); - - source_uri = (Uri) info.GetValue ("sourceUri", typeof (Uri)); - } - - public FileFormatException (string message, Exception innerException) - : base (message, innerException) - { - } - - public FileFormatException (Uri sourceUri, Exception innerException) - : base ("", innerException) - { - source_uri = sourceUri; - } - - public FileFormatException (Uri sourceUri, string message) - : base (message) - { - source_uri = sourceUri; - } - - public FileFormatException (Uri sourceUri, string message, Exception innerException) - : base (message, innerException) - { - source_uri = sourceUri; - } - - public Uri SourceUri { - get { return source_uri; } - } - - [SecurityCritical] - public override void GetObjectData (SerializationInfo info, StreamingContext context) - { - base.GetObjectData (info, context); - info.AddValue ("sourceUri", source_uri); - } - } -} - diff --git a/src/FPF/WindowsBase/System.Windows.Converters/Int32RectValueSerializer.cs b/src/FPF/WindowsBase/System.Windows.Converters/Int32RectValueSerializer.cs deleted file mode 100644 index acaa7b2..0000000 --- a/src/FPF/WindowsBase/System.Windows.Converters/Int32RectValueSerializer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System.Globalization; -using System.Windows.Markup; - -namespace System.Windows.Converters { - - public class Int32RectValueSerializer : ValueSerializer - { - public override bool CanConvertFromString (string value, IValueSerializerContext context) - { - return true; - } - - public override bool CanConvertToString (object value, IValueSerializerContext context) - { - return value is Int32Rect; - } - - public override object ConvertFromString (string value, IValueSerializerContext context) - { - if (value == null) - throw new NotSupportedException ("value != null"); - return Int32Rect.Parse (value); - } - - public override string ConvertToString (object value, IValueSerializerContext context) - { - if (value is Int32Rect int32Rect) - return int32Rect.ToString (CultureInfo.InvariantCulture); - return base.ConvertToString (value, context); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Converters/PointValueSerializer.cs b/src/FPF/WindowsBase/System.Windows.Converters/PointValueSerializer.cs deleted file mode 100644 index 150c2e8..0000000 --- a/src/FPF/WindowsBase/System.Windows.Converters/PointValueSerializer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System.Globalization; -using System.Windows.Markup; - -namespace System.Windows.Converters { - - public class PointValueSerializer : ValueSerializer - { - public override bool CanConvertFromString (string value, IValueSerializerContext context) - { - return true; - } - - public override bool CanConvertToString (object value, IValueSerializerContext context) - { - return value is Point; - } - - public override object ConvertFromString (string value, IValueSerializerContext context) - { - if (value == null) - throw new NotSupportedException ("value != null"); - return Point.Parse (value); - } - - public override string ConvertToString (object value, IValueSerializerContext context) - { - if (value is Point point) - return point.ToString (CultureInfo.InvariantCulture); - return base.ConvertToString (value, context); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Converters/RectValueSerializer.cs b/src/FPF/WindowsBase/System.Windows.Converters/RectValueSerializer.cs deleted file mode 100644 index 623c0d6..0000000 --- a/src/FPF/WindowsBase/System.Windows.Converters/RectValueSerializer.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// -using System.Globalization; -using System.Windows.Markup; - -namespace System.Windows.Converters { - - public class RectValueSerializer : ValueSerializer - { - public override bool CanConvertFromString (string value, IValueSerializerContext context) - { - return true; - } - - public override bool CanConvertToString (object value, IValueSerializerContext context) - { - return value is Rect; - } - - public override object ConvertFromString (string value, IValueSerializerContext context) - { - if (value == null) - throw new NotSupportedException ("value != null"); - return Rect.Parse (value); - } - - public override string ConvertToString (object value, IValueSerializerContext context) - { - if (value is Rect rect) - return rect.ToString (CultureInfo.InvariantCulture); - return base.ConvertToString (value, context); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs b/src/FPF/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs deleted file mode 100644 index 2765b73..0000000 --- a/src/FPF/WindowsBase/System.Windows.Converters/SizeValueSerializer.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Diagnostics; -using System.Globalization; -using System.Windows.Markup; - -namespace System.Windows.Converters { - - public class SizeValueSerializer : ValueSerializer - { - public override bool CanConvertFromString (string value, IValueSerializerContext context) - { - return true; - } - - public override bool CanConvertToString (object value, IValueSerializerContext context) - { - return value is Size; - } - - public override object ConvertFromString (string value, IValueSerializerContext context) - { - if (value == null) - throw new NotSupportedException ("value != null"); - return Size.Parse (value); - } - - public override string ConvertToString (object value, IValueSerializerContext context) - { - if (value is Size size) - return size.ToString (CultureInfo.InvariantCulture); - return base.ConvertToString (value, context); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Converters/VectorValueSerializer.cs b/src/FPF/WindowsBase/System.Windows.Converters/VectorValueSerializer.cs deleted file mode 100644 index 6ec7ae6..0000000 --- a/src/FPF/WindowsBase/System.Windows.Converters/VectorValueSerializer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System.Globalization; -using System.Windows.Markup; - -namespace System.Windows.Converters { - - public class VectorValueSerializer : ValueSerializer - { - public override bool CanConvertFromString (string value, IValueSerializerContext context) - { - return true; - } - - public override bool CanConvertToString (object value, IValueSerializerContext context) - { - return value is Vector; - } - - public override object ConvertFromString (string value, IValueSerializerContext context) - { - if (value == null) - throw new NotSupportedException ("value != null"); - return Vector.Parse (value); - } - - public override string ConvertToString (object value, IValueSerializerContext context) - { - if (value is Vector vector) - return vector.ToString (CultureInfo.InvariantCulture); - return base.ConvertToString (value, context); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Data/DataSourceProvider.cs b/src/FPF/WindowsBase/System.Windows.Data/DataSourceProvider.cs deleted file mode 100644 index 2f0c66e..0000000 --- a/src/FPF/WindowsBase/System.Windows.Data/DataSourceProvider.cs +++ /dev/null @@ -1,126 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; -using System.Windows.Threading; - -namespace System.Windows.Data { - - public abstract class DataSourceProvider : INotifyPropertyChanged, ISupportInitialize - { - protected DataSourceProvider () - { - throw new NotImplementedException (); - } - - [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] - public object Data { - get { throw new NotImplementedException (); } - } - - protected Dispatcher Dispatcher { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - public Exception Error { - get { throw new NotImplementedException (); } - } - - [DefaultValue (true)] - public bool IsInitialLoadEnabled { - get { throw new NotImplementedException (); } - set { throw new NotImplementedException (); } - } - - protected bool IsRefreshDeferred { - get { throw new NotImplementedException (); } - } - - public event EventHandler DataChanged; - - protected virtual event PropertyChangedEventHandler PropertyChanged; - - event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged { - add { PropertyChanged += value; } - remove { PropertyChanged -= value; } - } - - protected virtual void BeginInit () - { - throw new NotImplementedException (); - } - void ISupportInitialize.BeginInit () - { - BeginInit (); - } - - protected virtual void EndInit () - { - throw new NotImplementedException (); - } - void ISupportInitialize.EndInit () - { - EndInit (); - } - - protected virtual void BeginQuery () - { - throw new NotImplementedException (); - } - - public virtual IDisposable DeferRefresh () - { - throw new NotImplementedException (); - } - - public void InitialLoad () - { - throw new NotImplementedException (); - } - - protected virtual void OnPropertyChanged (PropertyChangedEventArgs e) - { - throw new NotImplementedException (); - } - - protected void OnQueryFinished (object newData) - { - throw new NotImplementedException (); - } - - protected virtual void OnQueryFinished (object newData, Exception error, DispatcherOperationCallback completionWork, object callbackArguments) - { - throw new NotImplementedException (); - } - - public void Refresh () - { - throw new NotImplementedException (); - } - } -} - diff --git a/src/FPF/WindowsBase/System.Windows.Input/FocusNavigationDirection.cs b/src/FPF/WindowsBase/System.Windows.Input/FocusNavigationDirection.cs deleted file mode 100644 index 45e22bf..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/FocusNavigationDirection.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@novell.com) -// - -using System; - -namespace System.Windows.Input { - - public enum FocusNavigationDirection - { - Next, - Previous, - First, - Last, - Left, - Right, - Up, - Down - } -} diff --git a/src/FPF/WindowsBase/System.Windows.Input/Key.cs b/src/FPF/WindowsBase/System.Windows.Input/Key.cs deleted file mode 100644 index 40f1a93..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/Key.cs +++ /dev/null @@ -1,239 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; -using System.Windows.Markup; - -namespace System.Windows.Input { - - [ValueSerializer (typeof (KeyValueSerializer))] - [TypeConverter (typeof (KeyConverter))] - public enum Key - { - None, - Cancel, - Back, - Tab, - LineFeed, - Clear, - Return, - Enter = Return, - Pause, - CapsLock, - Capital = CapsLock, - HangulMode, - KanaMode = HangulMode, - JunjaMode, - FinalMode, - KanjiMode, - HanjaMode = KanjiMode, - Escape, - ImeConvert, - ImeNonConvert, - ImeAccept, - ImeModeChange, - Space, - PageUp, - Prior = PageUp, - PageDown, - Next = PageDown, - End, - Home, - Left, - Up, - Right, - Down, - Select, - Print, - Execute, - PrintScreen, - Snapshot = PrintScreen, - Insert, - Delete, - Help, - D0, - D1, - D2, - D3, - D4, - D5, - D6, - D7, - D8, - D9, - A, - B, - C, - D, - E, - F, - G, - H, - I, - J, - K, - L, - M, - N, - O, - P, - Q, - R, - S, - T, - U, - V, - W, - X, - Y, - Z, - LWin, - RWin, - Apps, - Sleep, - NumPad0, - NumPad1, - NumPad2, - NumPad3, - NumPad4, - NumPad5, - NumPad6, - NumPad7, - NumPad8, - NumPad9, - Multiply, - Add, - Separator, - Subtract, - Decimal, - Divide, - F1, - F2, - F3, - F4, - F5, - F6, - F7, - F8, - F9, - F10, - F11, - F12, - F13, - F14, - F15, - F16, - F17, - F18, - F19, - F20, - F21, - F22, - F23, - F24, - NumLock, - Scroll, - LeftShift, - RightShift, - LeftCtrl, - RightCtrl, - LeftAlt, - RightAlt, - BrowserBack, - BrowserForward, - BrowserRefresh, - BrowserStop, - BrowserSearch, - BrowserFavorites, - BrowserHome, - VolumeMute, - VolumeDown, - VolumeUp, - MediaNextTrack, - MediaPreviousTrack, - MediaStop, - MediaPlayPause, - LaunchMail, - SelectMedia, - LaunchApplication1, - LaunchApplication2, - Oem1, - OemSemicolon = Oem1, - OemPlus, - OemComma, - OemMinus, - OemPeriod, - Oem2, - OemQuestion = Oem2, - Oem3, - OemTilde = Oem3, - AbntC1, - AbntC2, - Oem4, - OemOpenBrackets = Oem4, - Oem5, - OemPipe = Oem5, - Oem6, - OemCloseBrackets = Oem6, - Oem7, - OemQuotes = Oem7, - Oem8, - Oem102, - OemBackslash = Oem102, - ImeProcessed, - System, - OemAttn, - DbeAlphanumeric = OemAttn, - OemFinish, - DbeKatakana = OemFinish, - OemCopy, - DbeHiragana = OemCopy, - OemAuto, - DbeSbcsChar = OemAuto, - OemEnlw, - DbeDbcsChar = OemEnlw, - OemBackTab, - DbeRoman = OemBackTab, - Attn, - DbeNoRoman = Attn, - CrSel, - DbeEnterWordRegisterMode = CrSel, - ExSel, - DbeEnterImeConfigureMode = ExSel, - EraseEof, - DbeFlushString = EraseEof, - Play, - DbeCodeInput = Play, - Zoom, - DbeNoCodeInput = Zoom, - NoName, - DbeDetermineString = NoName, - Pa1, - DbeEnterDialogConversionMode = Pa1, - OemClear, - DeadCharProcessed - } -} diff --git a/src/FPF/WindowsBase/System.Windows.Input/KeyConverter.cs b/src/FPF/WindowsBase/System.Windows.Input/KeyConverter.cs deleted file mode 100644 index 4855371..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/KeyConverter.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows.Input { - - public class KeyConverter : TypeConverter - { - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - throw new NotImplementedException (); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - throw new NotImplementedException (); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object source) - { - throw new NotImplementedException (); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - throw new NotImplementedException (); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Input/KeyInterop.cs b/src/FPF/WindowsBase/System.Windows.Input/KeyInterop.cs deleted file mode 100644 index b69e13d..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/KeyInterop.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; - -namespace System.Windows.Input { - - public static class KeyInterop - { - public static Key KeyFromVirtualKey (int virtualKey) - { - throw new NotImplementedException (); - } - - public static int VirtualKeyFromKey (Key key) - { - throw new NotImplementedException (); - } - } - -} diff --git a/src/FPF/WindowsBase/System.Windows.Input/KeyValueSerializer.cs b/src/FPF/WindowsBase/System.Windows.Input/KeyValueSerializer.cs deleted file mode 100644 index d7b3d07..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/KeyValueSerializer.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Windows.Markup; - -namespace System.Windows.Input { - - public class KeyValueSerializer : ValueSerializer - { - public override bool CanConvertFromString (string value, IValueSerializerContext context) - { - throw new NotImplementedException (); - } - - public override bool CanConvertToString (object value, IValueSerializerContext context) - { - throw new NotImplementedException (); - } - - public override object ConvertFromString (string value, IValueSerializerContext context) - { - throw new NotImplementedException (); - } - - public override string ConvertToString (object value, IValueSerializerContext context) - { - throw new NotImplementedException (); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Input/ModifierKeys.cs b/src/FPF/WindowsBase/System.Windows.Input/ModifierKeys.cs deleted file mode 100644 index cd78943..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/ModifierKeys.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; -using System.Windows.Markup; - -namespace System.Windows.Input { - - [Flags] - [ValueSerializer (typeof (ModifierKeysValueSerializer))] - [TypeConverter (typeof (ModifierKeysConverter))] - public enum ModifierKeys { - None = 0, - Alt = 1, - Control = 2, - Shift = 4, - Windows = 8 - } -} - diff --git a/src/FPF/WindowsBase/System.Windows.Input/ModifierKeysConverter.cs b/src/FPF/WindowsBase/System.Windows.Input/ModifierKeysConverter.cs deleted file mode 100644 index 3752b9d..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/ModifierKeysConverter.cs +++ /dev/null @@ -1,61 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows.Input { - - public class ModifierKeysConverter : TypeConverter - { - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - throw new NotImplementedException (); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - throw new NotImplementedException (); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object source) - { - throw new NotImplementedException (); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - throw new NotImplementedException (); - } - - public static bool IsDefinedModifierKeys (ModifierKeys modifierKeys) - { - throw new NotImplementedException (); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Input/ModifierKeysValueSerializer.cs b/src/FPF/WindowsBase/System.Windows.Input/ModifierKeysValueSerializer.cs deleted file mode 100644 index 11310ad..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/ModifierKeysValueSerializer.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Windows.Markup; - -namespace System.Windows.Input { - - public class ModifierKeysValueSerializer : ValueSerializer - { - public override bool CanConvertFromString (string value, IValueSerializerContext context) - { - throw new NotImplementedException (); - } - - public override bool CanConvertToString (object value, IValueSerializerContext context) - { - throw new NotImplementedException (); - } - - public override object ConvertFromString (string value, IValueSerializerContext context) - { - throw new NotImplementedException (); - } - - public override string ConvertToString (object value, IValueSerializerContext context) - { - throw new NotImplementedException (); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Input/TraversalRequest.cs b/src/FPF/WindowsBase/System.Windows.Input/TraversalRequest.cs deleted file mode 100644 index a132971..0000000 --- a/src/FPF/WindowsBase/System.Windows.Input/TraversalRequest.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@novell.com) -// - -using System; - -namespace System.Windows.Input { - - public class TraversalRequest - { - bool wrapped; - FocusNavigationDirection focusNavigationDirection; - - public TraversalRequest (FocusNavigationDirection focusNavigationDirection) - { - this.focusNavigationDirection = focusNavigationDirection; - } - - public FocusNavigationDirection FocusNavigationDirection { - get { return focusNavigationDirection; } - } - - public bool Wrapped { - get { return wrapped; } - set { wrapped = value; } - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows.Interop/ComponentDispatcher.cs b/src/FPF/WindowsBase/System.Windows.Interop/ComponentDispatcher.cs deleted file mode 100644 index 0665b4d..0000000 --- a/src/FPF/WindowsBase/System.Windows.Interop/ComponentDispatcher.cs +++ /dev/null @@ -1,73 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Security; - -namespace System.Windows.Interop { - - public static class ComponentDispatcher - { - public static MSG CurrentKeyboardMessage { - [SecurityCritical] - get { throw new NotImplementedException (); } - } - - public static bool IsThreadModal { - [SecurityCritical] - get { throw new NotImplementedException (); } - } - - public static event EventHandler EnterThreadModal; - public static event EventHandler LeaveThreadModal; - public static event ThreadMessageEventHandler ThreadFilterMessage; - public static event EventHandler ThreadIdle; - public static event ThreadMessageEventHandler ThreadPreprocessMessage; - - [SecurityCritical] - public static void PopModal() - { - throw new NotImplementedException (); - } - - [SecurityCritical] - public static void PushModal() - { - throw new NotImplementedException (); - } - - [SecurityCritical] - public static void RaiseIdle() - { - throw new NotImplementedException (); - } - - [SecurityCritical] - public static bool RaiseThreadMessage (ref MSG msg) - { - throw new NotImplementedException (); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSink.cs b/src/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSink.cs deleted file mode 100644 index fa8f4fe..0000000 --- a/src/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSink.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Security; -using System.Windows.Input; - -namespace System.Windows.Interop { - - public interface IKeyboardInputSink - { - IKeyboardInputSite KeyboardInputSite { - get; - [SecurityCritical] - set; - } - - bool TabInto (TraversalRequest request); - bool HasFocusWithin (); - - [SecurityCritical] - bool OnMnemonic (ref MSG msg, ModifierKeys modifiers); - - [SecurityCritical] - IKeyboardInputSite RegisterKeyboardInputSink (IKeyboardInputSink sink); - - [SecurityCritical] - bool TranslateAccelerator (ref MSG msg, ModifierKeys modifiers); - - [SecurityCritical] - bool TranslateChar (ref MSG msg, ModifierKeys modifiers); - } -} diff --git a/src/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSite.cs b/src/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSite.cs deleted file mode 100644 index 8ffa1e0..0000000 --- a/src/FPF/WindowsBase/System.Windows.Interop/IKeyboardInputSite.cs +++ /dev/null @@ -1,42 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Security; -using System.Windows.Input; - -namespace System.Windows.Interop { - - public interface IKeyboardInputSite - { - IKeyboardInputSink Sink { get; } - - bool OnNoMoreTabStops (TraversalRequest request); - - [SecurityCritical] - void Unregister (); - } - -} diff --git a/src/FPF/WindowsBase/System.Windows.Interop/MSG.cs b/src/FPF/WindowsBase/System.Windows.Interop/MSG.cs deleted file mode 100644 index abcbd52..0000000 --- a/src/FPF/WindowsBase/System.Windows.Interop/MSG.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Security; - -namespace System.Windows.Interop { - - [Serializable] - public struct MSG - { - public IntPtr hwnd { - [SecurityCritical] - get { throw new NotImplementedException (); } - [SecurityCritical] - set { throw new NotImplementedException (); } - } - - public IntPtr lParam { - [SecurityCritical] - get { throw new NotImplementedException (); } - [SecurityCritical] - set { throw new NotImplementedException (); } - } - - - public IntPtr wParam { - [SecurityCritical] - get { throw new NotImplementedException (); } - [SecurityCritical] - set { throw new NotImplementedException (); } - } - public int message { - [SecurityCritical] - get { throw new NotImplementedException (); } - [SecurityCritical] - set { throw new NotImplementedException (); } - } - - public int pt_x { - [SecurityCritical] - get { throw new NotImplementedException (); } - [SecurityCritical] - set { throw new NotImplementedException (); } - } - - public int pt_y { - [SecurityCritical] - get { throw new NotImplementedException (); } - [SecurityCritical] - set { throw new NotImplementedException (); } - } - - public int time { - [SecurityCritical] - get { throw new NotImplementedException (); } - [SecurityCritical] - set { throw new NotImplementedException (); } - } - } -} - diff --git a/src/FPF/WindowsBase/System.Windows.Interop/ThreadMessageEventHandler.cs b/src/FPF/WindowsBase/System.Windows.Interop/ThreadMessageEventHandler.cs deleted file mode 100644 index 638c8e3..0000000 --- a/src/FPF/WindowsBase/System.Windows.Interop/ThreadMessageEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; - -namespace System.Windows.Interop { - - public delegate void ThreadMessageEventHandler (ref MSG msg, ref bool handled); - -} diff --git a/src/FPF/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs b/src/FPF/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs deleted file mode 100644 index 5a7b951..0000000 --- a/src/FPF/WindowsBase/System.Windows.Media.Converters/MatrixValueSerializer.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.Globalization; -using System.Windows.Markup; - -namespace System.Windows.Media.Converters { - - public class MatrixValueSerializer : ValueSerializer - { - public override bool CanConvertFromString (string value, IValueSerializerContext context) - { - return true; - } - - public override bool CanConvertToString (object value, IValueSerializerContext context) - { - return value is Matrix; - } - - public override object ConvertFromString (string value, IValueSerializerContext context) - { - if (value == null) - throw new NotSupportedException ("value != null"); - return Matrix.Parse (value); - } - - public override string ConvertToString (object value, IValueSerializerContext context) - { - if (value is Matrix matrix) - return matrix.ToString (CultureInfo.InvariantCulture); - return base.ConvertToString (value, context); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Media/DisableDpiAwarenessAttribute.cs b/src/FPF/WindowsBase/System.Windows.Media/DisableDpiAwarenessAttribute.cs deleted file mode 100644 index 00c2be5..0000000 --- a/src/FPF/WindowsBase/System.Windows.Media/DisableDpiAwarenessAttribute.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; - -namespace System.Windows.Media { - - [AttributeUsage (AttributeTargets.Assembly, AllowMultiple = false)] - public sealed class DisableDpiAwarenessAttribute : Attribute - { - } -} - diff --git a/src/FPF/WindowsBase/System.Windows.Media/Matrix.cs b/src/FPF/WindowsBase/System.Windows.Media/Matrix.cs deleted file mode 100644 index 49e0548..0000000 --- a/src/FPF/WindowsBase/System.Windows.Media/Matrix.cs +++ /dev/null @@ -1,456 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; -using System.Globalization; -using System.Windows.Markup; -using System.Windows.Media.Converters; -using System.Windows.Threading; - -namespace System.Windows.Media { - - [Serializable] - [TypeConverter (typeof(MatrixConverter))] - [ValueSerializer (typeof (MatrixValueSerializer))] - public struct Matrix : IFormattable { - - double _m11; - double _m12; - double _m21; - double _m22; - double _offsetX; - double _offsetY; - - public Matrix (double m11, - double m12, - double m21, - double m22, - double offsetX, - double offsetY) - { - this._m11 = m11; - this._m12 = m12; - this._m21 = m21; - this._m22 = m22; - this._offsetX = offsetX; - this._offsetY = offsetY; - } - - public void Append (Matrix matrix) - { - double _m11; - double _m21; - double _m12; - double _m22; - double _offsetX; - double _offsetY; - - _m11 = this._m11 * matrix.M11 + this._m12 * matrix.M21; - _m12 = this._m11 * matrix.M12 + this._m12 * matrix.M22; - _m21 = this._m21 * matrix.M11 + this._m22 * matrix.M21; - _m22 = this._m21 * matrix.M12 + this._m22 * matrix.M22; - - _offsetX = this._offsetX * matrix.M11 + this._offsetY * matrix.M21 + matrix.OffsetX; - _offsetY = this._offsetX * matrix.M12 + this._offsetY * matrix.M22 + matrix.OffsetY; - - this._m11 = _m11; - this._m12 = _m12; - this._m21 = _m21; - this._m22 = _m22; - this._offsetX = _offsetX; - this._offsetY = _offsetY; - } - - public bool Equals (Matrix value) - { - return (_m11 == value.M11 && - _m12 == value.M12 && - _m21 == value.M21 && - _m22 == value.M22 && - _offsetX == value.OffsetX && - _offsetY == value.OffsetY); - } - - public override bool Equals (object o) - { - if (!(o is Matrix)) - return false; - - return Equals ((Matrix)o); - } - - public static bool Equals (Matrix matrix1, - Matrix matrix2) - { - return matrix1.Equals (matrix2); - } - - public override int GetHashCode () - { - unchecked - { - var hashCode = _m11.GetHashCode (); - hashCode = (hashCode * 397) ^ _m12.GetHashCode (); - hashCode = (hashCode * 397) ^ _m21.GetHashCode (); - hashCode = (hashCode * 397) ^ _m22.GetHashCode (); - hashCode = (hashCode * 397) ^ _offsetX.GetHashCode (); - hashCode = (hashCode * 397) ^ _offsetY.GetHashCode (); - return hashCode; - } - } - - public void Invert () - { - if (!HasInverse) - throw new InvalidOperationException ("Transform is not invertible."); - - double d = Determinant; - - /* 1/(ad-bc)[d -b; -c a] */ - - double _m11 = this._m22; - double _m12 = -this._m12; - double _m21 = -this._m21; - double _m22 = this._m11; - - double _offsetX = this._m21 * this._offsetY - this._m22 * this._offsetX; - double _offsetY = this._m12 * this._offsetX - this._m11 * this._offsetY; - - this._m11 = _m11 / d; - this._m12 = _m12 / d; - this._m21 = _m21 / d; - this._m22 = _m22 / d; - this._offsetX = _offsetX / d; - this._offsetY = _offsetY / d; - } - - public static Matrix Multiply (Matrix trans1, - Matrix trans2) - { - Matrix m = trans1; - m.Append (trans2); - return m; - } - - public static bool operator == (Matrix matrix1, - Matrix matrix2) - { - return matrix1.Equals (matrix2); - } - - public static bool operator != (Matrix matrix1, - Matrix matrix2) - { - return !matrix1.Equals (matrix2); - } - - public static Matrix operator * (Matrix trans1, - Matrix trans2) - { - Matrix result = trans1; - result.Append (trans2); - return result; - } - - public static Matrix Parse (string source) - { - if (source == null) - throw new ArgumentNullException ("source"); - Matrix value; - if (source.Trim () == "Identity") - { - value = Identity; - } - else - { - var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); - double m11; - double m12; - double m21; - double m22; - double offsetX; - double offsetY; - if (double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out m11) - && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out m12) - && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out m21) - && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out m22) - && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out offsetX) - && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out offsetY)) - { - if (!tokenizer.HasNoMoreTokens ()) - { - throw new InvalidOperationException ("Invalid Matrix format: " + source); - } - value = new Matrix (m11, m12, m21, m22, offsetX, offsetY); - } - else - { - throw new FormatException (string.Format ("Invalid Matrix format: {0}", source)); - } - } - return value; - } - - public void Prepend (Matrix matrix) - { - double _m11; - double _m21; - double _m12; - double _m22; - double _offsetX; - double _offsetY; - - _m11 = matrix.M11 * this._m11 + matrix.M12 * this._m21; - _m12 = matrix.M11 * this._m12 + matrix.M12 * this._m22; - _m21 = matrix.M21 * this._m11 + matrix.M22 * this._m21; - _m22 = matrix.M21 * this._m12 + matrix.M22 * this._m22; - - _offsetX = matrix.OffsetX * this._m11 + matrix.OffsetY * this._m21 + this._offsetX; - _offsetY = matrix.OffsetX * this._m12 + matrix.OffsetY * this._m22 + this._offsetY; - - this._m11 = _m11; - this._m12 = _m12; - this._m21 = _m21; - this._m22 = _m22; - this._offsetX = _offsetX; - this._offsetY = _offsetY; - } - - public void Rotate (double angle) - { - // R_theta==[costheta -sintheta; sintheta costheta], - double theta = angle * Math.PI / 180; - - Matrix r_theta = new Matrix (Math.Cos (theta), Math.Sin(theta), - -Math.Sin (theta), Math.Cos(theta), - 0, 0); - - Append (r_theta); - } - - public void RotateAt (double angle, - double centerX, - double centerY) - { - Translate (-centerX, -centerY); - Rotate (angle); - Translate (centerX, centerY); - } - - public void RotateAtPrepend (double angle, - double centerX, - double centerY) - { - Matrix m = Matrix.Identity; - m.RotateAt (angle, centerX, centerY); - Prepend (m); - } - - public void RotatePrepend (double angle) - { - Matrix m = Matrix.Identity; - m.Rotate (angle); - Prepend (m); - } - - public void Scale (double scaleX, - double scaleY) - { - Matrix scale = new Matrix (scaleX, 0, - 0, scaleY, - 0, 0); - - Append (scale); - } - - public void ScaleAt (double scaleX, - double scaleY, - double centerX, - double centerY) - { - Translate (-centerX, -centerY); - Scale (scaleX, scaleY); - Translate (centerX, centerY); - } - - public void ScaleAtPrepend (double scaleX, - double scaleY, - double centerX, - double centerY) - { - Matrix m = Matrix.Identity; - m.ScaleAt (scaleX, scaleY, centerX, centerY); - Prepend (m); - } - - public void ScalePrepend (double scaleX, - double scaleY) - { - Matrix m = Matrix.Identity; - m.Scale (scaleX, scaleY); - Prepend (m); - } - - public void SetIdentity () - { - _m11 = _m22 = 1.0; - _m12 = _m21 = 0.0; - _offsetX = _offsetY = 0.0; - } - - public void Skew (double skewX, - double skewY) - { - Matrix skew_m = new Matrix (1, Math.Tan (skewY * Math.PI / 180), - Math.Tan (skewX * Math.PI / 180), 1, - 0, 0); - Append (skew_m); - } - - public void SkewPrepend (double skewX, - double skewY) - { - Matrix m = Matrix.Identity; - m.Skew (skewX, skewY); - Prepend (m); - } - - public override string ToString () - { - return ToString (null); - } - - public string ToString (IFormatProvider provider) - { - return ToString (null, provider); - } - - string IFormattable.ToString (string format, - IFormatProvider provider) - { - return ToString (provider); - } - - private string ToString (string format, IFormatProvider provider) - { - if (IsIdentity) - return "Identity"; - - if (provider == null) - provider = CultureInfo.CurrentCulture; - - if (format == null) - format = string.Empty; - - var separator = NumericListTokenizer.GetSeparator (provider); - - var matrixFormat = string.Format ( - "{{0:{0}}}{1}{{1:{0}}}{1}{{2:{0}}}{1}{{3:{0}}}{1}{{4:{0}}}{1}{{5:{0}}}", - format, separator); - return string.Format (provider, matrixFormat, - _m11, _m12, _m21, _m22, _offsetX, _offsetY); - } - - public Point Transform (Point point) - { - return Point.Multiply (point, this); - } - - public void Transform (Point[] points) - { - for (int i = 0; i < points.Length; i ++) - points[i] = Transform (points[i]); - } - - public Vector Transform (Vector vector) - { - return Vector.Multiply (vector, this); - } - - public void Transform (Vector[] vectors) - { - for (int i = 0; i < vectors.Length; i ++) - vectors[i] = Transform (vectors[i]); - } - - public void Translate (double offsetX, - double offsetY) - { - this._offsetX += offsetX; - this._offsetY += offsetY; - } - - public void TranslatePrepend (double offsetX, - double offsetY) - { - Matrix m = Matrix.Identity; - m.Translate (offsetX, offsetY); - Prepend (m); - } - - public double Determinant { - get { return _m11 * _m22 - _m12 * _m21; } - } - - public bool HasInverse { - get { return Determinant != 0; } - } - - public static Matrix Identity { - get { return new Matrix (1.0, 0.0, 0.0, 1.0, 0.0, 0.0); } - } - - public bool IsIdentity { - get { return Equals (Matrix.Identity); } - } - - public double M11 { - get { return _m11; } - set { _m11 = value; } - } - public double M12 { - get { return _m12; } - set { _m12 = value; } - } - public double M21 { - get { return _m21; } - set { _m21 = value; } - } - public double M22 { - get { return _m22; } - set { _m22 = value; } - } - public double OffsetX { - get { return _offsetX; } - set { _offsetX = value; } - } - public double OffsetY { - get { return _offsetY; } - set { _offsetY = value; } - } - } - -} diff --git a/src/FPF/WindowsBase/System.Windows.Media/MatrixConverter.cs b/src/FPF/WindowsBase/System.Windows.Media/MatrixConverter.cs deleted file mode 100644 index 596d211..0000000 --- a/src/FPF/WindowsBase/System.Windows.Media/MatrixConverter.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows.Media { - - public sealed class MatrixConverter : TypeConverter - { - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof (string); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - return destinationType == typeof (string); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) - { - if (!(value is string)) - throw new NotSupportedException ("MatrixConverter only supports converting from strings"); - return Matrix.Parse ((string)value); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - return ((Matrix)value).ToString (culture); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows.Threading/Dispatcher.cs b/src/FPF/WindowsBase/System.Windows.Threading/Dispatcher.cs deleted file mode 100644 index 6a92f34..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/Dispatcher.cs +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Collections.Generic; -using System.ComponentModel; -using System.Runtime.CompilerServices; -using System.Threading; - -namespace System.Windows.Threading -{ - public sealed class Dispatcher - { - public Thread Thread { get; } - - internal DispatcherSynchronizationContext DefaultSynchronizationContext { get; } - - public event DispatcherUnhandledExceptionEventHandler UnhandledException; - - internal void OnUnhandledException(Exception exception) - { - var unhandledException = UnhandledException; - if (unhandledException != null) - { - var args = new DispatcherUnhandledExceptionEventArgs(this, exception); - - unhandledException(this, args); - - if (args.Handled) - return; - } - - throw new Exception( - $"Unhandled exception in dispatcher thread {Thread.ManagedThreadId} '{Thread.Name}'", - exception); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public bool CheckAccess() - => Thread.CurrentThread == Thread; - - [EditorBrowsable(EditorBrowsableState.Never)] - public void VerifyAccess() - { - if (Thread.CurrentThread != Thread) - throw new InvalidOperationException("Invoked from a different thread"); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - static void ValidateArguments(Delegate method, DispatcherPriority priority) - { - if (method == null) - throw new ArgumentNullException(nameof(method)); - - if (priority < 0 || priority > DispatcherPriority.Send) - throw new InvalidEnumArgumentException(nameof(priority)); - - if (priority == DispatcherPriority.Inactive) - throw new ArgumentException("priority must not be inactive", nameof(priority)); - } - - public DispatcherOperation BeginInvoke (DispatcherPriority priority, Delegate method, object arg) - => BeginInvoke (method, priority, arg); - - public DispatcherOperation BeginInvoke(Delegate method, params object[] args) - => BeginInvoke(method, DispatcherPriority.Normal, args); - - public DispatcherOperation BeginInvoke(Delegate method, DispatcherPriority priority, params object[] args) - { - ValidateArguments(method, priority); - return new DispatcherOperation( - this, - method, - priority, - args, - CancellationToken.None, - null).BeginInvoke(); - } - - public DispatcherOperation InvokeAsync(Action callback) - => InvokeAsync(callback, DispatcherPriority.Normal, null, default); - - public DispatcherOperation InvokeAsync(Action callback, DispatcherPriority priority) - => InvokeAsync(callback, priority, null, default); - - public DispatcherOperation InvokeAsync(Action callback, DispatcherPriority priority, CancellationToken cancellationToken) - => InvokeAsync(callback, priority, null, cancellationToken); - - DispatcherOperation InvokeAsync(Delegate method, DispatcherPriority priority, object[] args, CancellationToken cancellationToken) - { - ValidateArguments(method, priority); - return new DispatcherOperation( - this, - method, - priority, - args, - cancellationToken, - new DispatcherOperationTaskSource()).InvokeAsync(); - } - - public void Invoke(Action callback) - => Invoke(callback, DispatcherPriority.Send, CancellationToken.None, Timeout.InfiniteTimeSpan); - - public void Invoke(Action callback, DispatcherPriority priority) - => Invoke(callback, priority, CancellationToken.None, Timeout.InfiniteTimeSpan); - - void Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken) - => Invoke(callback, priority, cancellationToken, Timeout.InfiniteTimeSpan); - - void Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) - { - ValidateArguments(callback, priority); - new DispatcherOperation( - this, - callback, - priority, - null, - cancellationToken, - null).Invoke(timeout); - } - - #region Adapted directly from WPF Dispatcher - - Dispatcher() - { - tlsDispatcher = this; // use TLS for ownership only - Thread = Thread.CurrentThread; - - lock (globalLock) - dispatchers.Add(new WeakReference(this)); - - DefaultSynchronizationContext = new DispatcherSynchronizationContext(this); - } - - [ThreadStatic] - static Dispatcher tlsDispatcher; // use TLS for ownership only - - static readonly object globalLock = new object(); - static readonly List dispatchers = new List(); - static WeakReference possibleDispatcher = new WeakReference(null); - - public static Dispatcher CurrentDispatcher - => FromThread(Thread.CurrentThread) ?? new Dispatcher(); - - public static Dispatcher FromThread(Thread thread) - { - if (thread == null) - return null; - - lock (globalLock) - { - Dispatcher dispatcher = null; - - dispatcher = possibleDispatcher.Target as Dispatcher; - if (dispatcher == null || dispatcher.Thread != thread) - { - dispatcher = null; - - for (int i = 0; i < dispatchers.Count; i++) - { - if (dispatchers[i].Target is Dispatcher dispatcherForThread) - { - if (dispatcherForThread.Thread == thread) - dispatcher = dispatcherForThread; - } - else - { - dispatchers.RemoveAt(i); - i--; - } - } - - if (dispatcher != null) - { - if (possibleDispatcher.IsAlive) - possibleDispatcher.Target = dispatcher; - else - possibleDispatcher = new WeakReference(dispatcher); - } - } - - return dispatcher; - } - } - - public bool HasShutdownStarted => false; - public bool HasShutdownFinished => false; - - public event EventHandler ShutdownStarted { add { } remove { } } - public event EventHandler ShutdownFinished { add { } remove { } } - - #endregion - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherEventArgs.cs b/src/FPF/WindowsBase/System.Windows.Threading/DispatcherEventArgs.cs deleted file mode 100644 index 02347c5..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherEventArgs.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace System.Windows.Threading -{ - public class DispatcherEventArgs : EventArgs - { - public Dispatcher Dispatcher { get; } - - internal DispatcherEventArgs(Dispatcher dispatcher) - => Dispatcher = dispatcher; - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherObject.cs b/src/FPF/WindowsBase/System.Windows.Threading/DispatcherObject.cs deleted file mode 100644 index 3782345..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherObject.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.ComponentModel; - -namespace System.Windows.Threading -{ - public abstract class DispatcherObject - { - [EditorBrowsable(EditorBrowsableState.Never)] - public Dispatcher Dispatcher { get; } - - protected DispatcherObject () - => Dispatcher = Dispatcher.CurrentDispatcher; - - [EditorBrowsable(EditorBrowsableState.Never)] - public bool CheckAccess() - => Dispatcher.CheckAccess(); - - [EditorBrowsable(EditorBrowsableState.Never)] - public void VerifyAccess() - => Dispatcher.VerifyAccess(); - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherOperation.cs b/src/FPF/WindowsBase/System.Windows.Threading/DispatcherOperation.cs deleted file mode 100644 index 256ccb8..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherOperation.cs +++ /dev/null @@ -1,178 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.ComponentModel; -using System.Runtime.CompilerServices; -using System.Threading; -using System.Threading.Tasks; - -using CoreFoundation; -using Foundation; - -namespace System.Windows.Threading -{ - public enum DispatcherOperationStatus - { - Pending, - Aborted, - Completed, - Executing - } - - public delegate object DispatcherOperationCallback(object arg); - - public sealed class DispatcherOperation - { - readonly Delegate method; - readonly object[] args; - readonly CancellationToken cancellationToken; - readonly DispatcherOperationTaskSource taskSource; - - public Dispatcher Dispatcher { get; } - public DispatcherPriority Priority { get; } - - Exception exception; - public object Result { get; private set; } - public DispatcherOperationStatus Status { get; private set; } - - public event EventHandler Aborted; - public event EventHandler Completed; - - internal DispatcherOperation( - Dispatcher dispatcher, - Delegate method, - DispatcherPriority priority, - object[] args, - CancellationToken cancellationToken, - DispatcherOperationTaskSource taskSource) - { - Dispatcher = dispatcher; - this.method = method; - Priority = priority; - this.args = args; - this.cancellationToken = cancellationToken; - this.taskSource = taskSource; - Status = DispatcherOperationStatus.Pending; - } - - internal DispatcherOperation BeginInvoke() - { - NSRunLoop.Main.BeginInvokeOnMainThread(() => - { - CoreInvoke(beginInvokeBehavior: true); - if (exception != null) - Dispatcher.OnUnhandledException(exception); - }); - - return this; - } - - internal DispatcherOperation InvokeAsync() - { - if (taskSource == null) - throw new InvalidOperationException(); - - NSRunLoop.Main.BeginInvokeOnMainThread(() => - { - try - { - CoreInvoke(beginInvokeBehavior: false); - } - catch (OperationCanceledException) - { - taskSource.SetCanceled(); - return; - } - - if (cancellationToken.IsCancellationRequested) - taskSource.SetCanceled(); - else if (exception != null) - taskSource.SetException(exception); - else - taskSource.SetResult(); - }); - - return this; - } - - internal void Invoke(TimeSpan timeout) - { - if (timeout != Timeout.InfiniteTimeSpan) - throw new NotSupportedException("timeouts are not supported"); - - var mainQueue = DispatchQueue.MainQueue; - - if (DispatchQueue.CurrentQueue != mainQueue) - NSRunLoop.Main.InvokeOnMainThread(() => CoreInvoke(beginInvokeBehavior: false)); - else - CoreInvoke(beginInvokeBehavior: false); - - if (exception != null) - throw exception; - } - - void CoreInvoke(bool beginInvokeBehavior) - { - Status = DispatcherOperationStatus.Executing; - - var oldSynchronizationContext = SynchronizationContext.Current; - - try - { - SynchronizationContext.SetSynchronizationContext(Dispatcher.DefaultSynchronizationContext); - - try - { - if (method is Action action) - action(); - else - Result = method.DynamicInvoke(args); - } - catch (Exception e) - { - exception = e; - } - - if (beginInvokeBehavior) - { - if (exception is OperationCanceledException) - { - Status = DispatcherOperationStatus.Aborted; - exception = null; - Aborted?.Invoke(this, EventArgs.Empty); - } - else - { - Status = DispatcherOperationStatus.Completed; - Completed?.Invoke(this, EventArgs.Empty); - } - } - } - finally - { - SynchronizationContext.SetSynchronizationContext(oldSynchronizationContext); - } - } - - [Browsable(false)] - [EditorBrowsable(EditorBrowsableState.Never)] - public TaskAwaiter GetAwaiter() - { - if (taskSource == null) - throw new InvalidOperationException(); - - return taskSource.GetTask().GetAwaiter(); - } - - public Task Task - { - get - { - if (taskSource == null) - throw new InvalidOperationException(); - - return taskSource.GetTask(); - } - } - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherOperationTaskSource.cs b/src/FPF/WindowsBase/System.Windows.Threading/DispatcherOperationTaskSource.cs deleted file mode 100644 index 627be8d..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherOperationTaskSource.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Threading.Tasks; - -namespace System.Windows.Threading -{ - sealed class DispatcherOperationTaskSource - { - readonly TaskCompletionSource taskCompletionSource = new TaskCompletionSource(); - - public Task GetTask() - => taskCompletionSource.Task; - - public void SetCanceled() - => taskCompletionSource.SetCanceled(); - - public void SetResult() - => taskCompletionSource.SetResult(true); - - public void SetException(Exception exception) - => taskCompletionSource.SetException(exception); - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherPriority.cs b/src/FPF/WindowsBase/System.Windows.Threading/DispatcherPriority.cs deleted file mode 100644 index d15c798..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherPriority.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace System.Windows.Threading -{ - public enum DispatcherPriority - { - Invalid = -1, - Inactive = 0, - SystemIdle = 1, - ApplicationIdle = 2, - ContextIdle = 3, - Background = 4, - Input = 5, - Loaded = 6, - Render = 7, - DataBind = 8, - Normal = 9, - Send = 10, - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherSynchronizationContext.cs b/src/FPF/WindowsBase/System.Windows.Threading/DispatcherSynchronizationContext.cs deleted file mode 100644 index 687c786..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherSynchronizationContext.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Threading; - -namespace System.Windows.Threading -{ - public sealed class DispatcherSynchronizationContext : SynchronizationContext - { - readonly Dispatcher dispatcher; - readonly DispatcherPriority priority; - - public DispatcherSynchronizationContext(Dispatcher dispatcher, DispatcherPriority priority) - { - this.dispatcher = dispatcher - ?? throw new ArgumentNullException(nameof(dispatcher)); - this.priority = priority; - } - - public DispatcherSynchronizationContext(Dispatcher dispatcher) : this(dispatcher, DispatcherPriority.Normal) - { - } - - public DispatcherSynchronizationContext() : this(Dispatcher.CurrentDispatcher) - { - } - - public override SynchronizationContext CreateCopy() - => new DispatcherSynchronizationContext(dispatcher, priority); - - public override void Post(SendOrPostCallback d, object state) - => dispatcher.BeginInvoke(d, priority, state); - - public override void Send(SendOrPostCallback d, object state) - => dispatcher.Invoke(() => d(state), priority); - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherTimer.cs b/src/FPF/WindowsBase/System.Windows.Threading/DispatcherTimer.cs deleted file mode 100644 index bef8f76..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherTimer.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2006 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Miguel de Icaza (miguel@novell.com) -// -using System; -using System.Collections; -using System.Threading; - -namespace System.Windows.Threading { - public class DispatcherTimer { - DispatcherPriority priority; - Dispatcher target_dispatcher; - long interval; - EventHandler callback; - Timer timer; - object tag; - - public DispatcherTimer () - : this (DispatcherPriority.Background, Dispatcher.CurrentDispatcher) - { - } - - public DispatcherTimer (DispatcherPriority priority) - : this (priority, Dispatcher.CurrentDispatcher) - { - } - - public DispatcherTimer (DispatcherPriority priority, Dispatcher dispatcher) - : this (TimeSpan.Zero, priority, null, dispatcher) - { - } - - public DispatcherTimer (TimeSpan interval, DispatcherPriority priority, - EventHandler callback, Dispatcher dispatcher) - { - this.priority = priority; - this.target_dispatcher = dispatcher; - this.interval = interval.Ticks; - this.callback = callback; - } - - public void Start () - { - if (timer == null){ - long repeat_interval = interval; - if (repeat_interval == 0) - repeat_interval = 1; - timer = new Timer (new TimerCallback (timer_tick), - null, new TimeSpan (interval), - new TimeSpan (repeat_interval)); - } - } - - void timer_tick (object state) - { - target_dispatcher.BeginInvoke ((ThreadStart) delegate { - EventHandler h = Tick; - if (h != null) - h (this, EventArgs.Empty); - if (callback != null) - callback (this, EventArgs.Empty); - }, priority); - } - - public void Stop () - { - if (timer == null) - return; - - timer.Dispose (); - timer = null; - } - - public Dispatcher Dispatcher { - get { - return target_dispatcher; - } - } - - public TimeSpan Interval { - get { - return new TimeSpan (interval); - } - - set { - if (interval == value.Ticks) - return; - - interval = value.Ticks; - - if (timer != null) - timer.Change (new TimeSpan (interval), - new TimeSpan (interval)); - } - } - - public bool IsEnabled { - get { - return timer != null; - } - - set { - if (value && timer == null) - Start (); - if (value == false && timer != null) - Stop (); - } - } - - public object Tag { - get { - return tag; - } - - set { - tag = value; - } - } - public event EventHandler Tick; - } -} diff --git a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs b/src/FPF/WindowsBase/System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs deleted file mode 100644 index 43f0f2a..0000000 --- a/src/FPF/WindowsBase/System.Windows.Threading/DispatcherUnhandledExceptionEventArgs.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace System.Windows.Threading -{ - public delegate void DispatcherUnhandledExceptionEventHandler( - object sender, - DispatcherUnhandledExceptionEventArgs e); - - public sealed class DispatcherUnhandledExceptionEventArgs : DispatcherEventArgs - { - public Exception Exception { get; } - public bool Handled { get; set; } - - internal DispatcherUnhandledExceptionEventArgs(Dispatcher dispatcher, Exception exception) - : base(dispatcher) - => Exception = exception; - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableAttribute.cs b/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableAttribute.cs deleted file mode 100644 index e78ac8c..0000000 --- a/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; - -namespace System.Windows { - - public abstract class AttachedPropertyBrowsableAttribute : Attribute - { - protected AttachedPropertyBrowsableAttribute () - { - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableForTypeAttribute.cs b/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableForTypeAttribute.cs deleted file mode 100644 index d1f77f6..0000000 --- a/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableForTypeAttribute.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; - -namespace System.Windows { - - [AttributeUsage (AttributeTargets.Method, AllowMultiple = true)] - public sealed class AttachedPropertyBrowsableForTypeAttribute : AttachedPropertyBrowsableAttribute - { - Type targetType; - - public AttachedPropertyBrowsableForTypeAttribute (Type targetType) - { - this.targetType = targetType; - } - - public Type TargetType { - get { return targetType; } - } - - public override object TypeId { - get { throw new NotImplementedException (); } - } - - public override bool Equals (object obj) - { - throw new NotImplementedException (); - } - - public override int GetHashCode () - { - throw new NotImplementedException (); - } - } - -} diff --git a/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableWhenAttributePresentAttribute.cs b/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableWhenAttributePresentAttribute.cs deleted file mode 100644 index 6796520..0000000 --- a/src/FPF/WindowsBase/System.Windows/AttachedPropertyBrowsableWhenAttributePresentAttribute.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; - -namespace System.Windows { - - [AttributeUsage (AttributeTargets.Method, AllowMultiple = false)] - public sealed class AttachedPropertyBrowsableWhenAttributePresentAttribute : AttachedPropertyBrowsableAttribute - { - Type attributeType; - - public AttachedPropertyBrowsableWhenAttributePresentAttribute (Type attributeType) - { - this.attributeType = attributeType; - } - - public Type AttributeType { - get { return attributeType; } - } - - public override bool Equals (object obj) - { - throw new NotImplementedException (); - } - - public override int GetHashCode () - { - throw new NotImplementedException (); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/CoerceValueCallback.cs b/src/FPF/WindowsBase/System.Windows/CoerceValueCallback.cs deleted file mode 100644 index 33eee8c..0000000 --- a/src/FPF/WindowsBase/System.Windows/CoerceValueCallback.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -namespace System.Windows { - - public delegate object CoerceValueCallback (DependencyObject d, object baseValue); -} diff --git a/src/FPF/WindowsBase/System.Windows/DependencyObject.cs b/src/FPF/WindowsBase/System.Windows/DependencyObject.cs deleted file mode 100644 index 8eb923a..0000000 --- a/src/FPF/WindowsBase/System.Windows/DependencyObject.cs +++ /dev/null @@ -1,145 +0,0 @@ -// -// DependencyObject.cs -// -// Author: -// Iain McCoy (iain@mccoy.id.au) -// Chris Toshok (toshok@ximian.com) -// -// (C) 2005 Iain McCoy -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections.Generic; -using System.Windows.Threading; - -namespace System.Windows { - public class DependencyObject : DispatcherObject { - private static Dictionary> propertyDeclarations = new Dictionary>(); - private Dictionary properties = new Dictionary(); - - [MonoTODO] - public bool IsSealed { - get { return false; } - } - - public DependencyObjectType DependencyObjectType { - get { return DependencyObjectType.FromSystemType (GetType()); } - } - - public void ClearValue(DependencyProperty dp) - { - if (IsSealed) - throw new InvalidOperationException ("Cannot manipulate property values on a sealed DependencyObject"); - - properties[dp] = null; - } - - public void ClearValue(DependencyPropertyKey key) - { - ClearValue (key.DependencyProperty); - } - - public void CoerceValue (DependencyProperty dp) - { - PropertyMetadata pm = dp.GetMetadata (this); - if (pm.CoerceValueCallback != null) - pm.CoerceValueCallback (this, GetValue (dp)); - } - - public sealed override bool Equals (object obj) - { - return base.Equals(obj); - } - - public sealed override int GetHashCode () - { - return base.GetHashCode(); - } - - [MonoTODO] - public LocalValueEnumerator GetLocalValueEnumerator() - { - return new LocalValueEnumerator(properties); - } - - public object GetValue(DependencyProperty dp) - { - object val = properties.ContainsKey (dp) ? properties [dp] : null; - return val == null ? dp.DefaultMetadata.DefaultValue : val; - } - - [MonoTODO] - public void InvalidateProperty(DependencyProperty dp) - { - throw new NotImplementedException("InvalidateProperty(DependencyProperty dp)"); - } - - protected virtual void OnPropertyChanged(DependencyPropertyChangedEventArgs e) - { - PropertyMetadata pm = e.Property.GetMetadata (this); - if (pm.PropertyChangedCallback != null) - pm.PropertyChangedCallback (this, e); - } - - public object ReadLocalValue(DependencyProperty dp) - { - object val = properties.ContainsKey (dp) ? properties [dp] : null; - return val == null ? DependencyProperty.UnsetValue : val; - } - - public void SetValue(DependencyProperty dp, object value) - { - if (IsSealed) - throw new InvalidOperationException ("Cannot manipulate property values on a sealed DependencyObject"); - - if (!dp.IsValidType (value)) - throw new ArgumentException ("value not of the correct type for this DependencyProperty"); - - ValidateValueCallback validate = dp.ValidateValueCallback; - if (validate != null && !validate(value)) - throw new Exception("Value does not validate"); - else - properties[dp] = value; - } - - public void SetValue(DependencyPropertyKey key, object value) - { - SetValue (key.DependencyProperty, value); - } - - protected virtual bool ShouldSerializeProperty (DependencyProperty dp) - { - throw new NotImplementedException (); - } - - internal static void register(Type t, DependencyProperty dp) - { - if (!propertyDeclarations.ContainsKey (t)) - propertyDeclarations[t] = new Dictionary(); - Dictionary typeDeclarations = propertyDeclarations[t]; - if (!typeDeclarations.ContainsKey(dp.Name)) - typeDeclarations[dp.Name] = dp; - else - throw new ArgumentException("A property named " + dp.Name + " already exists on " + t.Name); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/DependencyObjectType.cs b/src/FPF/WindowsBase/System.Windows/DependencyObjectType.cs deleted file mode 100644 index 53ec8ab..0000000 --- a/src/FPF/WindowsBase/System.Windows/DependencyObjectType.cs +++ /dev/null @@ -1,89 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// (C) 2005 Iain McCoy -// (C) 2007 Novell, Inc. -// -// Authors: -// Iain McCoy (iain@mccoy.id.au) -// Chris Toshok (toshok@ximian.com) -// -// - -using System.Collections.Generic; - -namespace System.Windows { - public class DependencyObjectType { - - private static Dictionary typeMap = new Dictionary(); - private static int current_id; - - private int id; - private Type systemType; - - private DependencyObjectType (int id, Type systemType) - { - this.id = id; - this.systemType = systemType; - } - - public DependencyObjectType BaseType { - get { return DependencyObjectType.FromSystemType (systemType.BaseType); } - } - - public int Id { - get { return id; } - } - - public string Name { - get { return systemType.Name; } - } - - public Type SystemType { - get { return systemType; } - } - - public static DependencyObjectType FromSystemType(Type systemType) - { - if (typeMap.ContainsKey (systemType)) - return typeMap[systemType]; - - DependencyObjectType dot; - - typeMap[systemType] = dot = new DependencyObjectType (current_id++, systemType); - - return dot; - } - - public bool IsInstanceOfType(DependencyObject dependencyObject) - { - return systemType.IsInstanceOfType (dependencyObject); - } - - public bool IsSubclassOf(DependencyObjectType dependencyObjectType) - { - return systemType.IsSubclassOf (dependencyObjectType.SystemType); - } - - public override int GetHashCode () - { - throw new NotImplementedException (); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/DependencyProperty.cs b/src/FPF/WindowsBase/System.Windows/DependencyProperty.cs deleted file mode 100644 index 71a1ead..0000000 --- a/src/FPF/WindowsBase/System.Windows/DependencyProperty.cs +++ /dev/null @@ -1,229 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// (C) 2005 Iain McCoy -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Iain McCoy (iain@mccoy.id.au) -// Chris Toshok (toshok@ximian.com) -// - -using System.Collections.Generic; - -namespace System.Windows { - public sealed class DependencyProperty { - private Dictionary metadataByType = new Dictionary(); - - public static readonly object UnsetValue = new object (); - - private DependencyProperty (bool isAttached, string name, Type propertyType, Type ownerType, - PropertyMetadata defaultMetadata, - ValidateValueCallback validateValueCallback) - { - IsAttached = isAttached; - DefaultMetadata = (defaultMetadata == null ? new PropertyMetadata() : defaultMetadata); - Name = name; - OwnerType = ownerType; - PropertyType = propertyType; - ValidateValueCallback = validateValueCallback; - } - - internal bool IsAttached { get; set; } - public bool ReadOnly { get; private set; } - public PropertyMetadata DefaultMetadata { get; private set; } - public string Name { get; private set; } - public Type OwnerType { get; private set; } - public Type PropertyType { get; private set; } - public ValidateValueCallback ValidateValueCallback { get; private set; } - - public int GlobalIndex { - get { throw new NotImplementedException (); } - } - - - public DependencyProperty AddOwner(Type ownerType) - { - return AddOwner (ownerType, null); - } - - public DependencyProperty AddOwner(Type ownerType, PropertyMetadata typeMetadata) - { - if (typeMetadata == null) typeMetadata = new PropertyMetadata (); - OverrideMetadata (ownerType, typeMetadata); - - // MS seems to always return the same DependencyProperty - return this; - } - - public PropertyMetadata GetMetadata(Type forType) - { - if (metadataByType.ContainsKey (forType)) - return metadataByType[forType]; - return null; - } - - public PropertyMetadata GetMetadata(DependencyObject dependencyObject) - { - if (metadataByType.ContainsKey (dependencyObject.GetType())) - return metadataByType[dependencyObject.GetType()]; - return null; - } - - public PropertyMetadata GetMetadata(DependencyObjectType dependencyObjectType) - { - if (metadataByType.ContainsKey (dependencyObjectType.SystemType)) - return metadataByType[dependencyObjectType.SystemType]; - return null; - } - - - public bool IsValidType(object value) - { - return PropertyType.IsInstanceOfType (value); - } - - public bool IsValidValue(object value) - { - if (!IsValidType (value)) - return false; - if (ValidateValueCallback == null) - return true; - return ValidateValueCallback (value); - } - - public void OverrideMetadata(Type forType, PropertyMetadata typeMetadata) - { - if (forType == null) - throw new ArgumentNullException ("forType"); - if (typeMetadata == null) - throw new ArgumentNullException ("typeMetadata"); - - if (ReadOnly) - throw new InvalidOperationException (String.Format ("Cannot override metadata on readonly property '{0}' without using a DependencyPropertyKey", Name)); - - typeMetadata.DoMerge (DefaultMetadata, this, forType); - metadataByType.Add (forType, typeMetadata); - } - - public void OverrideMetadata (Type forType, PropertyMetadata typeMetadata, DependencyPropertyKey key) - { - if (forType == null) - throw new ArgumentNullException ("forType"); - if (typeMetadata == null) - throw new ArgumentNullException ("typeMetadata"); - - - // further checking? should we check - // key.DependencyProperty == this? - - typeMetadata.DoMerge (DefaultMetadata, this, forType); - metadataByType.Add (forType, typeMetadata); - } - - public override string ToString () - { - return Name; - } - - public override int GetHashCode () - { - return Name.GetHashCode() ^ PropertyType.GetHashCode() ^ OwnerType.GetHashCode(); - } - - public static DependencyProperty Register(string name, Type propertyType, Type ownerType) - { - return Register(name, propertyType, ownerType, null, null); - } - - public static DependencyProperty Register(string name, Type propertyType, Type ownerType, - PropertyMetadata typeMetadata) - { - return Register(name, propertyType, ownerType, typeMetadata, null); - } - - public static DependencyProperty Register(string name, Type propertyType, Type ownerType, - PropertyMetadata typeMetadata, - ValidateValueCallback validateValueCallback) - { - if (typeMetadata == null) - typeMetadata = new PropertyMetadata(); - - DependencyProperty dp = new DependencyProperty(false, name, propertyType, ownerType, - typeMetadata, validateValueCallback); - DependencyObject.register(ownerType, dp); - - dp.OverrideMetadata (ownerType, typeMetadata); - - return dp; - } - - public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType) - { - return RegisterAttached(name, propertyType, ownerType, null, null); - } - - public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType, - PropertyMetadata defaultMetadata) - { - return RegisterAttached(name, propertyType, ownerType, defaultMetadata, null); - } - - public static DependencyProperty RegisterAttached(string name, Type propertyType, Type ownerType, - PropertyMetadata defaultMetadata, - ValidateValueCallback validateValueCallback) - { - DependencyProperty dp = new DependencyProperty(true, name, propertyType, ownerType, - defaultMetadata, validateValueCallback); - DependencyObject.register(ownerType, dp); - return dp; - } - - public static DependencyPropertyKey RegisterAttachedReadOnly(string name, Type propertyType, Type ownerType, - PropertyMetadata defaultMetadata) - { - throw new NotImplementedException("RegisterAttachedReadOnly(string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata)"); - } - - public static DependencyPropertyKey RegisterAttachedReadOnly(string name, Type propertyType, Type ownerType, - PropertyMetadata defaultMetadata, - ValidateValueCallback validateValueCallback) - { - throw new NotImplementedException("RegisterAttachedReadOnly(string name, Type propertyType, Type ownerType, PropertyMetadata defaultMetadata, ValidateValueCallback validateValueCallback)"); - } - - public static DependencyPropertyKey RegisterReadOnly(string name, Type propertyType, Type ownerType, - PropertyMetadata typeMetadata) - { - return RegisterReadOnly (name, propertyType, ownerType, typeMetadata, null); - } - - - public static DependencyPropertyKey RegisterReadOnly(string name, Type propertyType, Type ownerType, - PropertyMetadata typeMetadata, - ValidateValueCallback validateValueCallback) - { - DependencyProperty prop = Register (name, propertyType, ownerType, typeMetadata, validateValueCallback); - prop.ReadOnly = true; - return new DependencyPropertyKey (prop); - } - - } -} diff --git a/src/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventArgs.cs b/src/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventArgs.cs deleted file mode 100644 index 782e881..0000000 --- a/src/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventArgs.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// DependencyPropertyChangedEventArgs.cs -// -// Author: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Windows { - public struct DependencyPropertyChangedEventArgs { - - public DependencyPropertyChangedEventArgs (DependencyProperty property, object oldValue, object newValue) - : this () - { - this.Property = property; - this.OldValue = oldValue; - this.NewValue = newValue; - } - - public object NewValue { - get; private set; - } - - public object OldValue { - get; private set; - } - - public DependencyProperty Property { - get; private set; - } - - public override bool Equals (object obj) - { - if (!(obj is DependencyPropertyChangedEventArgs)) - return false; - - return Equals ((DependencyPropertyChangedEventArgs)obj); - } - - public bool Equals (DependencyPropertyChangedEventArgs args) - { - return (Property == args.Property && - NewValue == args.NewValue && - OldValue == args.OldValue); - } - - public static bool operator != (DependencyPropertyChangedEventArgs left, DependencyPropertyChangedEventArgs right) - { - throw new NotImplementedException (); - } - - public static bool operator == (DependencyPropertyChangedEventArgs left, DependencyPropertyChangedEventArgs right) - { - throw new NotImplementedException (); - } - - public override int GetHashCode() - { - throw new NotImplementedException (); - } - - } -} diff --git a/src/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventHandler.cs b/src/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventHandler.cs deleted file mode 100644 index 7673af4..0000000 --- a/src/FPF/WindowsBase/System.Windows/DependencyPropertyChangedEventHandler.cs +++ /dev/null @@ -1,31 +0,0 @@ -// -// DependencyPropertyChangedEventHandler.cs -// -// Author: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Windows { - public delegate void DependencyPropertyChangedEventHandler (object sender, DependencyPropertyChangedEventArgs e); -} diff --git a/src/FPF/WindowsBase/System.Windows/DependencyPropertyKey.cs b/src/FPF/WindowsBase/System.Windows/DependencyPropertyKey.cs deleted file mode 100644 index 7f530ed..0000000 --- a/src/FPF/WindowsBase/System.Windows/DependencyPropertyKey.cs +++ /dev/null @@ -1,46 +0,0 @@ -// -// DependencyPropertyKey.cs -// -// Author: -// Iain McCoy (iain@mccoy.id.au) -// -// (C) 2005 Iain McCoy -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Windows { - public sealed class DependencyPropertyKey { - internal DependencyPropertyKey (DependencyProperty dependencyProperty) - { - this.dependencyProperty = dependencyProperty; - } - - private DependencyProperty dependencyProperty; - public DependencyProperty DependencyProperty { - get { return dependencyProperty; } - } - - public void OverrideMetadata(Type forType, PropertyMetadata typeMetadata) - { - dependencyProperty.OverrideMetadata (forType, typeMetadata, this); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/Expression.cs b/src/FPF/WindowsBase/System.Windows/Expression.cs deleted file mode 100644 index d3a02f0..0000000 --- a/src/FPF/WindowsBase/System.Windows/Expression.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; - -namespace System.Windows { - - [TypeConverter (typeof (ExpressionConverter))] - public class Expression - { - internal Expression () - { - } - } - -} diff --git a/src/FPF/WindowsBase/System.Windows/ExpressionConverter.cs b/src/FPF/WindowsBase/System.Windows/ExpressionConverter.cs deleted file mode 100644 index 480424e..0000000 --- a/src/FPF/WindowsBase/System.Windows/ExpressionConverter.cs +++ /dev/null @@ -1,60 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows { - - public class ExpressionConverter : TypeConverter - { - public ExpressionConverter () - { - } - - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - throw new NotImplementedException (); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - throw new NotImplementedException (); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) - { - throw new NotImplementedException (); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - throw new NotImplementedException (); - } - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows/Freezable.cs b/src/FPF/WindowsBase/System.Windows/Freezable.cs deleted file mode 100644 index f11dac2..0000000 --- a/src/FPF/WindowsBase/System.Windows/Freezable.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -namespace System.Windows { - - public abstract class Freezable : DependencyObject { - protected Freezable () { - } - - public Freezable Clone () - { - throw new NotImplementedException (); - } - - protected virtual void CloneCore (Freezable sourceFreezable) - { - throw new NotImplementedException (); - } - - public Freezable CloneCurrentValue () - { - throw new NotImplementedException (); - } - - protected virtual void CloneCurrentValueCore (Freezable sourceFreezable) - { - throw new NotImplementedException (); - } - - protected Freezable CreateInstance () - { - throw new NotImplementedException (); - } - - protected abstract Freezable CreateInstanceCore (); - - public void Freeze () - { - IsFrozen = true; - } - - protected static bool Freeze (Freezable freezable, - bool isChecking) - { - throw new NotImplementedException (); - } - - protected virtual bool FreezeCore (bool isChecking) - { - IsFrozen = true; - return true; - } - - public Freezable GetAsFrozen () - { - throw new NotImplementedException (); - } - - protected virtual void GetAsFrozenCore (Freezable sourceFreezable) - { - throw new NotImplementedException (); - } - - public Freezable GetCurrentValueAsFrozen () - { - throw new NotImplementedException (); - } - - protected virtual void GetCurrentValueAsFrozenCore (Freezable sourceFreezable) - { - throw new NotImplementedException (); - } - - protected virtual void OnChanged () - { - throw new NotImplementedException (); - } - - protected void OnFreezablePropertyChanged (DependencyObject oldValue, - DependencyObject newValue) - - { - throw new NotImplementedException (); - } - - protected void OnFreezablePropertyChanged (DependencyObject oldValue, - DependencyObject newValue, - DependencyProperty property) - { - throw new NotImplementedException (); - } - - protected override void OnPropertyChanged (DependencyPropertyChangedEventArgs e) - { - throw new NotImplementedException (); - } - - protected void ReadPreamble () - { - throw new NotImplementedException (); - } - - protected void WritePostscript () - { - throw new NotImplementedException (); - } - - protected void WritePreamble () - { - throw new NotImplementedException (); - } - - public bool CanFreeze { - get { return FreezeCore (true); } - } - - public bool IsFrozen { - get; private set; - } - - public event EventHandler Changed; - } - -} - diff --git a/src/FPF/WindowsBase/System.Windows/IWeakEventListener.cs b/src/FPF/WindowsBase/System.Windows/IWeakEventListener.cs deleted file mode 100644 index 95c2365..0000000 --- a/src/FPF/WindowsBase/System.Windows/IWeakEventListener.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok -// - -using System; - -namespace System.Windows { - public interface IWeakEventListener { - bool ReceiveWeakEvent (Type managerType, object sender, EventArgs e); - } -} diff --git a/src/FPF/WindowsBase/System.Windows/Int32Rect.cs b/src/FPF/WindowsBase/System.Windows/Int32Rect.cs deleted file mode 100644 index 815fee0..0000000 --- a/src/FPF/WindowsBase/System.Windows/Int32Rect.cs +++ /dev/null @@ -1,193 +0,0 @@ -// -// DependencyPropertyChangedEventArgs.cs -// -// Author: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.ComponentModel; -using System.Globalization; -using System.Windows.Converters; -using System.Windows.Markup; - -namespace System.Windows { - - [Serializable] - [TypeConverter (typeof(Int32RectConverter))] - [ValueSerializer (typeof(Int32RectValueSerializer))] - public struct Int32Rect : IFormattable - { - int _x, _y, _width, _height; - - public Int32Rect (int x, int y, int width, int height) - { - this._x = x; - this._y = y; - this._width = width; - this._height = height; - } - - public static bool operator != (Int32Rect int32Rect1, Int32Rect int32Rect2) - { - return !int32Rect1.Equals(int32Rect2); - } - - public static bool operator == (Int32Rect int32Rect1, Int32Rect int32Rect2) - { - return int32Rect1.Equals(int32Rect2); - } - - public static Int32Rect Empty { - get { return new Int32Rect (0, 0, 0, 0); } - } - - public int Height { - get { return _height; } - set { _height = value; } - } - - public bool IsEmpty { - get { return _width == 0 && _height == 0; } - } - - public int Width { - get { return _width; } - set { _width = value; } - } - - public int X { - get { return _x; } - set { _x = value; } - } - - public int Y { - get { return _y; } - set { _y = value; } - } - - public bool Equals (Int32Rect value) - { - return (_x == value._x && - _y == value._y && - _width == value._width && - _height == value._height); - } - - public override bool Equals (object o) - { - if (!(o is Int32Rect)) - return false; - - return Equals ((Int32Rect)o); - } - - public static bool Equals (Int32Rect int32Rect1, Int32Rect int32Rect2) - { - return int32Rect1.Equals (int32Rect2); - } - - public override int GetHashCode () - { - unchecked - { - var hashCode = _x; - hashCode = (hashCode * 397) ^ _y; - hashCode = (hashCode * 397) ^ _width; - hashCode = (hashCode * 397) ^ _height; - return hashCode; - } - } - - public static Int32Rect Parse (string source) - { - if (source == null) - throw new ArgumentNullException ("source"); - Int32Rect value; - if (source.Trim () == "Empty") - { - value = Empty; - } - else - { - var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); - int x; - int y; - int width; - int height; - if (int.TryParse (tokenizer.GetNextToken (), NumberStyles.Integer, CultureInfo.InvariantCulture, out x) - && int.TryParse (tokenizer.GetNextToken (), NumberStyles.Integer, CultureInfo.InvariantCulture, out y) - && int.TryParse (tokenizer.GetNextToken (), NumberStyles.Integer, CultureInfo.InvariantCulture, out width) - && int.TryParse (tokenizer.GetNextToken (), NumberStyles.Integer, CultureInfo.InvariantCulture, out height)) - { - if (!tokenizer.HasNoMoreTokens ()) - { - throw new InvalidOperationException ("Invalid Int32Rect format: " + source); - } - value = new Int32Rect (x, y, width, height); - } - else - { - throw new FormatException (string.Format ("Invalid Int32Rect format: {0}", source)); - } - } - return value; - } - - public override string ToString () - { - return ToString (null); - } - - public string ToString (IFormatProvider provider) - { - return ToString (null, provider); - } - - string IFormattable.ToString (string format, IFormatProvider provider) - { - return ToString (provider); - } - - private string ToString (string format, IFormatProvider provider) - { - if (IsEmpty) - return "Empty"; - - if (provider == null) - provider = CultureInfo.CurrentCulture; - - if (format == null) - format = string.Empty; - - var separator = NumericListTokenizer.GetSeparator (provider); - - var rectFormat = string.Format ( - "{{0:{0}}}{1}{{1:{0}}}{1}{{2:{0}}}{1}{{3:{0}}}", - format, separator); - return string.Format (provider, rectFormat, - _x, _y, _width, _height); - } - } -} - diff --git a/src/FPF/WindowsBase/System.Windows/Int32RectConverter.cs b/src/FPF/WindowsBase/System.Windows/Int32RectConverter.cs deleted file mode 100644 index 990b385..0000000 --- a/src/FPF/WindowsBase/System.Windows/Int32RectConverter.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows { - - public sealed class Int32RectConverter : TypeConverter - { - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof (string); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - return destinationType == typeof (string); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) - { - if (!(value is string)) - throw new NotSupportedException ("Int32RectConvert only supports converting from strings"); - - return Int32Rect.Parse ((string)value); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - return ((Int32Rect)value).ToString (culture); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/LocalValueEntry.cs b/src/FPF/WindowsBase/System.Windows/LocalValueEntry.cs deleted file mode 100644 index 8ef695a..0000000 --- a/src/FPF/WindowsBase/System.Windows/LocalValueEntry.cs +++ /dev/null @@ -1,68 +0,0 @@ -// -// LocalValueEntry.cs -// -// Author: -// Iain McCoy (iain@mccoy.id.au) -// -// (C) 2005 Iain McCoy -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -namespace System.Windows { - public struct LocalValueEntry { - private DependencyProperty property; - private object value; - - internal LocalValueEntry(DependencyProperty property, object value) - { - this.property = property; - this.value = value; - } - - public DependencyProperty Property { - get { return property; } - } - - public object Value { - get { return value; } - } - - public static bool operator != (LocalValueEntry obj1, LocalValueEntry obj2) - { - throw new NotImplementedException (); - } - - public static bool operator == (LocalValueEntry obj1, LocalValueEntry obj2) - { - throw new NotImplementedException (); - } - - public override bool Equals (object obj) - { - throw new NotImplementedException (); - } - - public override int GetHashCode () - { - throw new NotImplementedException (); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/LocalValueEnumerator.cs b/src/FPF/WindowsBase/System.Windows/LocalValueEnumerator.cs deleted file mode 100644 index bbabfca..0000000 --- a/src/FPF/WindowsBase/System.Windows/LocalValueEnumerator.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// LocalValueEnumerator.cs -// -// Author: -// Iain McCoy (iain@mccoy.id.au) -// -// (C) 2005 Iain McCoy -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - - -using System.Collections; -using System.Collections.Generic; - -namespace System.Windows { - public struct LocalValueEnumerator : IEnumerator { - private IDictionaryEnumerator propertyEnumerator; - private Dictionary properties; - - private int count; - - internal LocalValueEnumerator(Dictionary properties) - { - this.count = properties.Count; - this.properties = properties; - this.propertyEnumerator = properties.GetEnumerator(); - } - - public int Count { - get { return count; } - } - - public LocalValueEntry Current { - get { return new LocalValueEntry((DependencyProperty)propertyEnumerator.Key, - propertyEnumerator.Value); } - } - object IEnumerator.Current { - get { return this.Current; } - } - - public bool MoveNext() - { - return propertyEnumerator.MoveNext(); - } - public void Reset() - { - propertyEnumerator.Reset(); - } - - public static bool operator != (LocalValueEnumerator obj1, LocalValueEnumerator obj2) - { - throw new NotImplementedException (); - } - - public static bool operator == (LocalValueEnumerator obj1, LocalValueEnumerator obj2) - { - throw new NotImplementedException (); - } - - public override bool Equals (object obj) - { - throw new NotImplementedException (); - } - - public override int GetHashCode () - { - throw new NotImplementedException (); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/NumericListTokenizer.cs b/src/FPF/WindowsBase/System.Windows/NumericListTokenizer.cs deleted file mode 100644 index 81905ec..0000000 --- a/src/FPF/WindowsBase/System.Windows/NumericListTokenizer.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System.Globalization; - -namespace System.Windows -{ - /// - /// Helper class for parsing serialized data structures from the System.Windows namespace. - /// - internal class NumericListTokenizer - { - private readonly string _str; - private readonly char _separator; - private int _position; - - private enum Symbol - { - Token, - Separator, - Whitspace, - EndOfLine - } - - public NumericListTokenizer (string str, IFormatProvider formatProvider) - { - _str = str ?? throw new ArgumentNullException (nameof(str)); - _separator = GetSeparator (formatProvider ?? throw new ArgumentNullException (nameof(formatProvider))); - } - - public static char GetSeparator (IFormatProvider formatProvider) - { - // By convention, string representations of target classes always use ';' as a separator - // if the decimal number separator is ','. Otherwise, the separator is ','. - return NumberFormatInfo.GetInstance (formatProvider).NumberDecimalSeparator != "," ? ',' : ';'; - } - - private Symbol GetCurrentSymbol () - { - if (_position >= _str.Length) - return Symbol.EndOfLine; - if (_str[_position] == _separator) - return Symbol.Separator; - if (char.IsWhiteSpace (_str, _position)) - return Symbol.Whitspace; - return Symbol.Token; - } - - private void SkipAllWhitespaces () - { - while (GetCurrentSymbol () == Symbol.Whitspace) - { - _position++; - } - } - - private void SkipNextDelimeter () - { - SkipAllWhitespaces (); - switch (GetCurrentSymbol ()) - { - case Symbol.Token: - return; - case Symbol.Separator: - _position++; - SkipAllWhitespaces (); - return; - default: - throw new InvalidOperationException ("Separator not found"); - } - } - - public bool HasNoMoreTokens () - { - SkipAllWhitespaces (); - return GetCurrentSymbol () == Symbol.EndOfLine; - } - - public string GetNextToken () - { - var length = 0; - if (_position == 0) - { - SkipAllWhitespaces (); - } - else - { - SkipNextDelimeter (); - } - - while (GetCurrentSymbol () == Symbol.Token) - { - _position++; - length++; - } - - if (length == 0) - { - throw new InvalidOperationException ("Next token not found"); - } - - return _str.Substring (_position - length, length); - } - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows/Point.cs b/src/FPF/WindowsBase/System.Windows/Point.cs deleted file mode 100644 index af57f92..0000000 --- a/src/FPF/WindowsBase/System.Windows/Point.cs +++ /dev/null @@ -1,196 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@novell.com) -// - -using System; -using System.ComponentModel; -using System.Windows.Converters; -using System.Windows.Markup; -using System.Windows.Media; -using System.Globalization; - -namespace System.Windows { - - [Serializable] - [TypeConverter (typeof (PointConverter))] - [ValueSerializer (typeof (PointValueSerializer))] - public struct Point : IFormattable - { - public Point (double x, double y) - { - this._x = x; - this._y = y; - } - - public double X { - get { return _x; } - set { _x = value; } - } - - public double Y { - get { return _y; } - set { _y = value; } - } - - public override bool Equals (object o) - { - if (!(o is Point)) - return false; - return Equals ((Point)o); - } - - public bool Equals (Point value) - { - return _x == value.X && _y == value.Y; - } - - public override int GetHashCode () - { - return (_x.GetHashCode() ^ _y.GetHashCode()); - } - - - public void Offset (double offsetX, double offsetY) - { - _x += offsetX; - _y += offsetY; - } - - public static Point Add (Point point, Vector vector) - { - return new Point (point.X + vector.X, point.Y + vector.Y); - } - - public static bool Equals (Point point1, Point point2) - { - return point1.Equals (point2); - } - - public static Point Multiply (Point point, Matrix matrix) - { - return new Point (point.X * matrix.M11 + point.Y * matrix.M21 + matrix.OffsetX, - point.X * matrix.M12 + point.Y * matrix.M22 + matrix.OffsetY); - } - - public static Vector Subtract (Point point1, Point point2) - { - return new Vector (point1.X - point2.X, point1.Y - point2.Y); - } - - public static Point Subtract (Point point, Vector vector) - { - return new Point (point.X - vector.X, point.Y - vector.Y); - } - - /* operators */ - - public static Vector operator -(Point point1, Point point2) - { - return Subtract (point1, point2); - } - - public static Point operator -(Point point, Vector vector) - { - return Subtract (point, vector); - } - - public static Point operator + (Point point, Vector vector) - { - return Add (point, vector); - } - - public static Point operator * (Point point, Matrix matrix) - { - return Multiply (point, matrix); - } - - public static bool operator != (Point point1, Point point2) - { - return !point1.Equals(point2); - } - - public static bool operator == (Point point1, Point point2) - { - return point1.Equals(point2); - } - - public static explicit operator Size (Point point) - { - return new Size (point.X, point.Y); - } - - public static explicit operator Vector (Point point) - { - return new Vector (point.X, point.Y); - } - - public static Point Parse (string source) - { - if (source == null) - throw new ArgumentNullException ("source"); - var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); - double x; - double y; - if (!double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out x) || - !double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out y)) - { - throw new FormatException (string.Format ("Invalid Point format: {0}", source)); - } - if (!tokenizer.HasNoMoreTokens ()) - { - throw new InvalidOperationException ("Invalid Point format: " + source); - } - return new Point(x, y); - } - - public override string ToString () - { - return this.ToString(null, null); - } - - public string ToString (IFormatProvider provider) - { - return this.ToString(null, provider); - } - - private string ToString(string format,IFormatProvider formatProvider) - { - if (formatProvider == null) - formatProvider = CultureInfo.CurrentCulture; - if (format == null) - format = string.Empty; - var separator = NumericListTokenizer.GetSeparator (formatProvider); - var pointFormat = string.Format ("{{0:{0}}}{1}{{1:{0}}}", format, separator); - return string.Format (formatProvider, pointFormat, _x, _y); - } - - string IFormattable.ToString (string format, IFormatProvider formatProvider) - { - return this.ToString(format, formatProvider); - } - - double _x; - double _y; - } -} diff --git a/src/FPF/WindowsBase/System.Windows/PointConverter.cs b/src/FPF/WindowsBase/System.Windows/PointConverter.cs deleted file mode 100644 index eef6c52..0000000 --- a/src/FPF/WindowsBase/System.Windows/PointConverter.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows { - - public sealed class PointConverter : TypeConverter - { - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof (string); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - return destinationType == typeof (string); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) - { - if (!(value is string)) - throw new NotSupportedException ("PointConverter only supports converting from strings"); - - return Point.Parse ((string)value); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - return ((Point)value).ToString (culture); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/PropertyChangedCallback.cs b/src/FPF/WindowsBase/System.Windows/PropertyChangedCallback.cs deleted file mode 100644 index dfcfee2..0000000 --- a/src/FPF/WindowsBase/System.Windows/PropertyChangedCallback.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -namespace System.Windows { - - public delegate void PropertyChangedCallback (DependencyObject d, DependencyPropertyChangedEventArgs e); -} diff --git a/src/FPF/WindowsBase/System.Windows/PropertyMetadata.cs b/src/FPF/WindowsBase/System.Windows/PropertyMetadata.cs deleted file mode 100644 index 1432b0b..0000000 --- a/src/FPF/WindowsBase/System.Windows/PropertyMetadata.cs +++ /dev/null @@ -1,121 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// (C) 2005 Iain McCoy -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Iain McCoy (iain@mccoy.id.au) -// Chris Toshok (toshok@ximian.com) -// - -namespace System.Windows { - public class PropertyMetadata { - private object defaultValue; - private bool isSealed; - private PropertyChangedCallback propertyChangedCallback; - private CoerceValueCallback coerceValueCallback; - - protected bool IsSealed { - get { return isSealed; } - } - - public object DefaultValue { - get { return defaultValue; } - set { - if (IsSealed) - throw new InvalidOperationException ("Cannot change metadata once it has been applied to a property"); - if (value == DependencyProperty.UnsetValue) - throw new ArgumentException ("Cannot set property metadata's default value to 'Unset'"); - - defaultValue = value; - } - } - - public PropertyChangedCallback PropertyChangedCallback { - get { return propertyChangedCallback; } - set { - if (IsSealed) - throw new InvalidOperationException ("Cannot change metadata once it has been applied to a property"); - propertyChangedCallback = value; - } - } - - public CoerceValueCallback CoerceValueCallback { - get { return coerceValueCallback; } - set { - if (IsSealed) - throw new InvalidOperationException ("Cannot change metadata once it has been applied to a property"); - coerceValueCallback = value; - } - } - - public PropertyMetadata() - : this (null, null, null) - { - } - - public PropertyMetadata(object defaultValue) - : this (defaultValue, null, null) - { - } - - public PropertyMetadata (PropertyChangedCallback propertyChangedCallback) - : this (null, propertyChangedCallback, null) - { - } - - public PropertyMetadata (object defaultValue, PropertyChangedCallback propertyChangedCallback) - : this (defaultValue, propertyChangedCallback, null) - { - } - - public PropertyMetadata (object defaultValue, PropertyChangedCallback propertyChangedCallback, CoerceValueCallback coerceValueCallback) - { - if (defaultValue == DependencyProperty.UnsetValue) - throw new ArgumentException ("Cannot initialize property metadata's default value to 'Unset'"); - - this.defaultValue = defaultValue; - this.propertyChangedCallback = propertyChangedCallback; - this.coerceValueCallback = coerceValueCallback; - } - - protected virtual void Merge (PropertyMetadata baseMetadata, DependencyProperty dp) - { - if (defaultValue == null) - defaultValue = baseMetadata.defaultValue; - if (propertyChangedCallback == null) - propertyChangedCallback = baseMetadata.propertyChangedCallback; - if (coerceValueCallback == null) - coerceValueCallback = baseMetadata.coerceValueCallback; - } - - protected virtual void OnApply (DependencyProperty dp, Type targetType) - { - } - - internal void DoMerge (PropertyMetadata baseMetadata, DependencyProperty dp, Type targetType) - { - Merge (baseMetadata, dp); - OnApply (dp, targetType); - isSealed = true; - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/Rect.cs b/src/FPF/WindowsBase/System.Windows/Rect.cs deleted file mode 100644 index 6e2e3d9..0000000 --- a/src/FPF/WindowsBase/System.Windows/Rect.cs +++ /dev/null @@ -1,501 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok -// Sebastien Pouliot -// - -using System.ComponentModel; -using System.Globalization; -using System.Windows.Converters; -using System.Windows.Markup; -using System.Windows.Media; - -namespace System.Windows { - - [Serializable] - [ValueSerializer (typeof (RectValueSerializer))] - [TypeConverter (typeof (RectConverter))] - public struct Rect : IFormattable - { - public Rect (Size size) - { - _x = _y = 0.0; - _width = size.Width; - _height = size.Height; - } - - public Rect (Point point, Vector vector) : this (point, Point.Add (point, vector)) - { } - - public Rect (Point point1, Point point2) - { - if (point1.X < point2.X) { - _x = point1.X; - _width = point2.X - point1.X; - } - else { - _x = point2.X; - _width = point1.X - point2.X; - } - - if (point1.Y < point2.Y) { - _y = point1.Y; - _height = point2.Y - point1.Y; - } - else { - _y = point2.Y; - _height = point1.Y - point2.Y; - } - } - - public Rect (double x, double y, double width, double height) - { - if (width < 0 || height < 0) - throw new ArgumentException ("width and height must be non-negative."); - this._x = x; - this._y = y; - this._width = width; - this._height = height; - } - - public Rect (Point location, Size size) - { - _x = location.X; - _y = location.Y; - _width = size.Width; - _height = size.Height; - } - - public bool Equals (Rect value) - { - return (_x == value.X && - _y == value.Y && - _width == value.Width && - _height == value.Height); - } - - public static bool operator != (Rect rect1, Rect rect2) - { - return !(rect1.Location == rect2.Location && rect1.Size == rect2.Size); - } - - public static bool operator == (Rect rect1, Rect rect2) - { - return rect1.Location == rect2.Location && rect1.Size == rect2.Size; - } - - public override bool Equals (object o) - { - if (!(o is Rect)) - return false; - - return Equals ((Rect)o); - } - - public static bool Equals (Rect rect1, Rect rect2) - { - return rect1.Equals (rect2); - } - - public override int GetHashCode () - { - unchecked - { - var hashCode = _x.GetHashCode (); - hashCode = (hashCode * 397) ^ _y.GetHashCode (); - hashCode = (hashCode * 397) ^ _width.GetHashCode (); - hashCode = (hashCode * 397) ^ _height.GetHashCode (); - return hashCode; - } - } - - public bool Contains (Rect rect) - { - if (rect.Left < this.Left || - rect.Right > this.Right) - return false; - - if (rect.Top < this.Top || - rect.Bottom > this.Bottom) - return false; - - return true; - } - - public bool Contains (double x, double y) - { - if (x < Left || x > Right) - return false; - if (y < Top || y > Bottom) - return false; - - return true; - } - - public bool Contains (Point point) - { - return Contains (point.X, point.Y); - } - - public static Rect Inflate (Rect rect, double width, double height) - { - if (width < rect.Width * -2) - return Rect.Empty; - if (height < rect.Height * -2) - return Rect.Empty; - - Rect result = rect; - result.Inflate (width, height); - return result; - } - - public static Rect Inflate (Rect rect, Size size) - { - return Rect.Inflate (rect, size.Width, size.Height); - } - - public void Inflate (double width, double height) - { - // XXX any error checking like in the static case? - _x -= width; - _y -= height; - - this._width += 2*width; - this._height += 2*height; - } - - public void Inflate (Size size) - { - Inflate (size.Width, size.Height); - } - - public bool IntersectsWith(Rect rect) - { - return !((Left >= rect.Right) || (Right <= rect.Left) || - (Top >= rect.Bottom) || (Bottom <= rect.Top)); - } - - public void Intersect(Rect rect) - { - double _x = Math.Max (this._x, rect._x); - double _y = Math.Max (this._y, rect._y); - double _width = Math.Min (Right, rect.Right) - _x; - double _height = Math.Min (Bottom, rect.Bottom) - _y; - - if (_width < 0 || _height < 0) { - this._x = this._y = Double.PositiveInfinity; - this._width = this._height = Double.NegativeInfinity; - } - else { - this._x = _x; - this._y = _y; - this._width = _width; - this._height = _height; - } - } - - public static Rect Intersect(Rect rect1, Rect rect2) - { - Rect result = rect1; - result.Intersect (rect2); - return result; - } - - public void Offset(double offsetX, double offsetY) - { - _x += offsetX; - _y += offsetY; - } - - public static Rect Offset(Rect rect, double offsetX, double offsetY) - { - Rect result = rect; - result.Offset (offsetX, offsetY); - return result; - } - - public void Offset (Vector offsetVector) - { - _x += offsetVector.X; - _y += offsetVector.Y; - } - - public static Rect Offset (Rect rect, Vector offsetVector) - { - Rect result = rect; - result.Offset (offsetVector); - return result; - } - - public void Scale(double scaleX, double scaleY) - { - _x *= scaleX; - _y *= scaleY; - _width *= scaleX; - _height *= scaleY; - } - - public void Transform (Matrix matrix) - { - throw new NotImplementedException (); - } - - public static Rect Transform (Rect rect, Matrix matrix) - { - Rect result = rect; - result.Transform (matrix); - return result; - } - - public static Rect Union(Rect rect1, Rect rect2) - { - Rect result = rect1; - result.Union (rect2); - return result; - } - - public static Rect Union(Rect rect, Point point) - { - Rect result = rect; - result.Union (point); - return result; - } - - public void Union(Rect rect) - { - var left = Math.Min (Left, rect.Left); - var top = Math.Min (Top, rect.Top); - var right = Math.Max (Right, rect.Right); - var bottom = Math.Max (Bottom, rect.Bottom); - - _x = left; - _y = top; - _width = right - left; - _height = bottom - top; - } - - public void Union(Point point) - { - Union (new Rect (point, point)); - } - - public static Rect Parse (string source) - { - if (source == null) - throw new ArgumentNullException ("source"); - Rect value; - if (source.Trim () == "Empty") - { - value = Empty; - } - else - { - var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); - double x; - double y; - double width; - double height; - if (double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out x) - && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out y) - && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out width) - && double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out height)) - { - if (!tokenizer.HasNoMoreTokens ()) - { - throw new InvalidOperationException ("Invalid Rect format: " + source); - } - value = new Rect (x, y, width, height); - } - else - { - throw new FormatException (string.Format ("Invalid Rect format: {0}", source)); - } - } - return value; - } - - public override string ToString () - { - return ToString (null); - } - - public string ToString (IFormatProvider provider) - { - return ToString (null, provider); - } - - string IFormattable.ToString (string format, IFormatProvider provider) - { - return ToString (format, provider); - } - - private string ToString (string format, IFormatProvider provider) - { - if (IsEmpty) - return "Empty"; - - if (provider == null) - provider = CultureInfo.CurrentCulture; - - if (format == null) - format = string.Empty; - - var separator = NumericListTokenizer.GetSeparator (provider); - - var rectFormat = string.Format ( - "{{0:{0}}}{1}{{1:{0}}}{1}{{2:{0}}}{1}{{3:{0}}}", - format, separator); - return string.Format (provider, rectFormat, - _x, _y, _width, _height); - } - - public static Rect Empty { - get { - Rect r = new Rect (); - r._x = r._y = Double.PositiveInfinity; - r._width = r._height = Double.NegativeInfinity; - return r; - } - } - - public bool IsEmpty { - get { - return (_x == Double.PositiveInfinity && - _y == Double.PositiveInfinity && - _width == Double.NegativeInfinity && - _height == Double.NegativeInfinity); - } - } - - public Point Location { - get { - return new Point (_x, _y); - } - set { - if (IsEmpty) - throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); - - _x = value.X; - _y = value.Y; - } - } - - public Size Size { - get { - if (IsEmpty) - return Size.Empty; - return new Size (_width, _height); - } - set { - if (IsEmpty) - throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); - - _width = value.Width; - _height = value.Height; - } - } - - public double X { - get { return _x; } - set { - if (IsEmpty) - throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); - - _x = value; - } - } - - public double Y { - get { return _y; } - set { - if (IsEmpty) - throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); - - _y = value; - } - } - - public double Width { - get { return _width; } - set { - if (IsEmpty) - throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); - - if (value < 0) - throw new ArgumentException ("width must be non-negative."); - - _width = value; - } - } - - public double Height { - get { return _height; } - set { - if (IsEmpty) - throw new InvalidOperationException ("Cannot modify this property on the Empty Rect."); - - if (value < 0) - throw new ArgumentException ("height must be non-negative."); - - _height = value; - } - } - - public double Left { - get { return _x; } - } - - public double Top { - get { return _y; } - } - - public double Right { - get { return _x + _width; } - } - - public double Bottom { - get { return _y + _height; } - } - - public Point TopLeft { - get { return new Point (Left, Top); } - } - - public Point TopRight { - get { return new Point (Right, Top); } - } - - public Point BottomLeft { - get { return new Point (Left, Bottom); } - } - - public Point BottomRight { - get { return new Point (Right, Bottom); } - } - - double _x; - double _y; - double _width; - double _height; - } -} diff --git a/src/FPF/WindowsBase/System.Windows/RectConverter.cs b/src/FPF/WindowsBase/System.Windows/RectConverter.cs deleted file mode 100644 index 07fe262..0000000 --- a/src/FPF/WindowsBase/System.Windows/RectConverter.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows { - - public sealed class RectConverter : TypeConverter - { - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof (string); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - return destinationType == typeof (string); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) - { - if (!(value is string)) - throw new NotSupportedException ("RectConverter only supports converting from strings"); - - return Rect.Parse ((string)value); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - return ((Rect)value).ToString (culture); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/Size.cs b/src/FPF/WindowsBase/System.Windows/Size.cs deleted file mode 100644 index c1095ab..0000000 --- a/src/FPF/WindowsBase/System.Windows/Size.cs +++ /dev/null @@ -1,192 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@novell.com) -// - -using System; -using System.ComponentModel; -using System.Globalization; -using System.Windows.Converters; -using System.Windows.Markup; - -namespace System.Windows { - - [Serializable] - [ValueSerializer (typeof (SizeValueSerializer))] - [TypeConverter (typeof (SizeConverter))] - public struct Size : IFormattable - { - public Size (double width, double height) - { - if (width < 0 || height < 0) - throw new ArgumentException ("Width and Height must be non-negative."); - - this._width = width; - this._height = height; - } - - public bool Equals (Size value) - { - return _width == value.Width && _height == value.Height; - } - - public override bool Equals (object o) - { - if (!(o is Size)) - return false; - - return Equals ((Size)o); - } - - public static bool Equals (Size size1, Size size2) - { - return size1.Equals (size2); - } - - public override int GetHashCode () - { - unchecked - { - return (_width.GetHashCode () * 397) ^ _height.GetHashCode (); - } - } - - public static Size Parse (string source) - { - if (source == null) - throw new ArgumentNullException ("source"); - - if (source.Trim () == "Empty") - { - return Empty; - } - var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); - double width; - double height; - if (!double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out width) || - !double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out height)) - { - throw new FormatException (string.Format ("Invalid Size format: {0}", source)); - } - if (!tokenizer.HasNoMoreTokens ()) - { - throw new InvalidOperationException ("Invalid Size format: " + source); - } - return new Size(width, height); - } - - public override string ToString () - { - return ConvertToString (null, null); - } - - public string ToString (IFormatProvider provider) - { - return ConvertToString (null, provider); - } - - string IFormattable.ToString (string format, IFormatProvider provider) - { - return ConvertToString (format, provider); - } - - private string ConvertToString (string format, IFormatProvider provider) - { - if (IsEmpty) - return "Empty"; - - if (provider == null) - provider = CultureInfo.CurrentCulture; - if (format == null) - format = string.Empty; - var separator = NumericListTokenizer.GetSeparator (provider); - var vectorFormat = string.Format ("{{0:{0}}}{1}{{1:{0}}}", format, separator); - return string.Format (provider, vectorFormat, _width, _height); - } - - public bool IsEmpty { - get { - return (_width == Double.NegativeInfinity && - _height == Double.NegativeInfinity); - } - } - - public double Height { - get { return _height; } - set { - if (IsEmpty) - throw new InvalidOperationException ("Cannot modify this property on the Empty Size."); - - if (value < 0) - throw new ArgumentException ("height must be non-negative."); - - _height = value; - } - } - - public double Width { - get { return _width; } - set { - if (IsEmpty) - throw new InvalidOperationException ("Cannot modify this property on the Empty Size."); - - if (value < 0) - throw new ArgumentException ("width must be non-negative."); - - _width = value; - } - } - - public static Size Empty { - get { - Size s = new Size (); - s._width = s._height = Double.NegativeInfinity; - return s; - } - } - - /* operators */ - public static explicit operator Point (Size size) - { - return new Point (size.Width, size.Height); - } - - public static explicit operator Vector (Size size) - { - return new Vector (size.Width, size.Height); - } - - public static bool operator ==(Size size1, Size size2) - { - return size1.Equals (size2); - } - - public static bool operator !=(Size size1, Size size2) - { - return !size1.Equals (size2); - } - - double _width; - double _height; - } -} diff --git a/src/FPF/WindowsBase/System.Windows/SizeConverter.cs b/src/FPF/WindowsBase/System.Windows/SizeConverter.cs deleted file mode 100644 index 59a2c0d..0000000 --- a/src/FPF/WindowsBase/System.Windows/SizeConverter.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows { - - public sealed class SizeConverter : TypeConverter - { - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof (string); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - return destinationType == typeof (string); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) - { - if (!(value is string)) - throw new NotSupportedException ("SizeConverter only supports converting from strings"); - - return Size.Parse ((string)value); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - return ((Size)value).ToString (culture); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/SplashScreen.cs b/src/FPF/WindowsBase/System.Windows/SplashScreen.cs deleted file mode 100644 index 16b2ecc..0000000 --- a/src/FPF/WindowsBase/System.Windows/SplashScreen.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2008 Novell, Inc. (http://www.novell.com) -// -// Author: -// Chris Toshok (toshok@ximian.com) -// - -using System.Reflection; -using System.Security; - -namespace System.Windows { - public class SplashScreen { - - [SecurityCritical] - public SplashScreen (Assembly resourceAssembly, string resourceName) - { - throw new NotImplementedException (); - } - - public SplashScreen (string resourceName) - { - throw new NotImplementedException (); - } - - [SecurityCritical] - public void Show (bool autoClose) - { - throw new NotImplementedException (); - } - - [SecurityCritical] - public void Close (TimeSpan fadeoutDuration) - { - throw new NotImplementedException (); - } - } -} \ No newline at end of file diff --git a/src/FPF/WindowsBase/System.Windows/ValidateValueCallback.cs b/src/FPF/WindowsBase/System.Windows/ValidateValueCallback.cs deleted file mode 100644 index 30be3df..0000000 --- a/src/FPF/WindowsBase/System.Windows/ValidateValueCallback.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@ximian.com) -// - -namespace System.Windows { - - public delegate bool ValidateValueCallback (object value); -} diff --git a/src/FPF/WindowsBase/System.Windows/Vector.cs b/src/FPF/WindowsBase/System.Windows/Vector.cs deleted file mode 100644 index 88b2305..0000000 --- a/src/FPF/WindowsBase/System.Windows/Vector.cs +++ /dev/null @@ -1,284 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok (toshok@novell.com) -// - -using System.ComponentModel; -using System.Globalization; -using System.Windows.Converters; -using System.Windows.Markup; -using System.Windows.Media; - -namespace System.Windows { - - [Serializable] - [ValueSerializer (typeof (VectorValueSerializer))] - [TypeConverter (typeof (VectorConverter))] - public struct Vector : IFormattable - { - public Vector (double x, double y) - { - this._x = x; - this._y = y; - } - - public bool Equals (Vector value) - { - return _x == value.X && _y == value.Y; - } - - public override bool Equals (object o) - { - if (!(o is Vector)) - return false; - - return Equals ((Vector)o); - } - - public override int GetHashCode () - { - unchecked - { - return (_x.GetHashCode () * 397) ^ _y.GetHashCode (); - } - } - - public static bool Equals (Vector vector1, Vector vector2) - { - return vector1.Equals (vector2); - } - - public static Point Add (Vector vector, Point point) - { - return new Point (vector.X + point.X, vector.Y + point.Y); - } - - public static Vector Add (Vector vector1, Vector vector2) - { - return new Vector (vector1.X + vector2.X, - vector1.Y + vector2.Y); - } - - public static double AngleBetween (Vector vector1, Vector vector2) - { - double cos_theta = (vector1.X * vector2.X + vector1.Y * vector2.Y) / (vector1.Length * vector2.Length); - - return Math.Acos (cos_theta) / Math.PI * 180; - } - - public static double CrossProduct (Vector vector1, Vector vector2) - { - // ... what operation is this exactly? - return vector1.X * vector2.Y - vector1.Y * vector2.X; - } - - public static double Determinant (Vector vector1, Vector vector2) - { - // same as CrossProduct, it appears. - return vector1.X * vector2.Y - vector1.Y * vector2.X; - } - - public static Vector Divide (Vector vector, double scalar) - { - return new Vector (vector.X / scalar, vector.Y / scalar); - } - - public static double Multiply (Vector vector1, Vector vector2) - { - return vector1.X * vector2.X + vector1.Y * vector2.Y; - } - - public static Vector Multiply (Vector vector, Matrix matrix) - { - return new Vector (vector.X * matrix.M11 + vector.Y * matrix.M21, - vector.X * matrix.M12 + vector.Y * matrix.M22); - } - - public static Vector Multiply (double scalar, Vector vector) - { - return new Vector (scalar * vector.X, scalar * vector.Y); - } - - public static Vector Multiply (Vector vector, double scalar) - { - return new Vector (scalar * vector.X, scalar * vector.Y); - } - - public void Negate () - { - _x = -_x; - _y = -_y; - } - - public void Normalize () - { - double ls = LengthSquared; - if (ls == 1) - return; - - double l = Math.Sqrt (ls); - _x /= l; - _y /= l; - } - - public static Vector Subtract (Vector vector1, Vector vector2) - { - return new Vector (vector1.X - vector2.X, vector1.Y - vector2.Y); - } - - public static Vector Parse (string source) - { - if (source == null) - throw new ArgumentNullException ("source"); - var tokenizer = new NumericListTokenizer (source, CultureInfo.InvariantCulture); - double x; - double y; - if (!double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out x) || - !double.TryParse (tokenizer.GetNextToken (), NumberStyles.Float, CultureInfo.InvariantCulture, out y)) - { - throw new FormatException (string.Format ("Invalid Vector format: {0}", source)); - } - if (!tokenizer.HasNoMoreTokens ()) - { - throw new InvalidOperationException("Invalid Vector format: " + source); - } - return new Vector(x, y); - } - - public override string ToString () - { - return ToString(null); - } - - public string ToString (IFormatProvider provider) - { - return ToString (null, provider); - } - - string IFormattable.ToString (string format, IFormatProvider provider) - { - return ToString (format, provider); - } - - private string ToString(string format,IFormatProvider formatProvider) - { - if (formatProvider == null) - formatProvider = CultureInfo.CurrentCulture; - if (format == null) - format = string.Empty; - var separator = NumericListTokenizer.GetSeparator (formatProvider); - var vectorFormat = string.Format ("{{0:{0}}}{1}{{1:{0}}}", format, separator); - return string.Format (formatProvider, vectorFormat, _x, _y); - } - - public double Length { - get { return Math.Sqrt (LengthSquared); } - } - - public double LengthSquared { - get { return _x * _x + _y * _y; } - } - - public double X { - get { return _x; } - set { _x = value; } - } - - public double Y { - get { return _y; } - set { _y = value; } - } - - /* operators */ - public static explicit operator Point (Vector vector) - { - return new Point (vector.X, vector.Y); - } - - public static explicit operator Size (Vector vector) - { - return new Size (vector.X, vector.Y); - } - - public static Vector operator - (Vector vector1, Vector vector2) - { - return Subtract (vector1, vector2); - } - - public static Vector operator - (Vector vector) - { - Vector result = vector; - result.Negate (); - return result; - } - - public static bool operator != (Vector vector1, Vector vector2) - { - return !Equals (vector1, vector2); - } - - public static bool operator == (Vector vector1, Vector vector2) - { - return Equals (vector1, vector2); - } - - public static double operator * (Vector vector1, Vector vector2) - { - return Multiply (vector1, vector2); - } - - public static Vector operator * (Vector vector, Matrix matrix) - { - return Multiply (vector, matrix); - } - - public static Vector operator * (double scalar, Vector vector) - { - return Multiply (scalar, vector); - } - - public static Vector operator * (Vector vector, double scalar) - { - return Multiply (vector, scalar); - } - - public static Vector operator / (Vector vector, double scalar) - { - return Divide (vector, scalar); - } - - public static Point operator + (Vector vector, Point point) - { - return Add (vector, point); - } - - public static Vector operator + (Vector vector1, Vector vector2) - { - return Add (vector1, vector2); - } - - double _x; - double _y; - } - -} diff --git a/src/FPF/WindowsBase/System.Windows/VectorConverter.cs b/src/FPF/WindowsBase/System.Windows/VectorConverter.cs deleted file mode 100644 index 69823c1..0000000 --- a/src/FPF/WindowsBase/System.Windows/VectorConverter.cs +++ /dev/null @@ -1,57 +0,0 @@ -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -// Copyright (c) 2007 Novell, Inc. (http://www.novell.com) -// -// Authors: -// Chris Toshok -// - -using System; -using System.ComponentModel; -using System.Globalization; - -namespace System.Windows { - - public sealed class VectorConverter : TypeConverter - { - public override bool CanConvertFrom (ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof (string); - } - - public override bool CanConvertTo (ITypeDescriptorContext context, Type destinationType) - { - return destinationType == typeof (string); - } - - public override object ConvertFrom (ITypeDescriptorContext context, CultureInfo culture, object value) - { - if (!(value is string)) - throw new NotSupportedException ("VectorConverter only supports converting from strings"); - - return Vector.Parse ((string)value); - } - - public override object ConvertTo (ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) - { - return ((Vector)value).ToString (culture); - } - } -} diff --git a/src/FPF/WindowsBase/System.Windows/WeakEventManager.cs b/src/FPF/WindowsBase/System.Windows/WeakEventManager.cs deleted file mode 100644 index ff5c29c..0000000 --- a/src/FPF/WindowsBase/System.Windows/WeakEventManager.cs +++ /dev/null @@ -1,178 +0,0 @@ -// -// WeakEventManager.cs -// -// Author: -// Chris Toshok (toshok@ximian.com) -// -// (C) 2007 Novell, Inc. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// - -using System.Collections; -using System.Windows.Threading; - -namespace System.Windows { - - public abstract class WeakEventManager : DispatcherObject - { - Hashtable sourceData; - - protected WeakEventManager () - { - sourceData = new Hashtable (); - } - - protected IDisposable ReadLock { - get { throw new NotImplementedException (); } - } - - protected IDisposable WriteLock { - get { throw new NotImplementedException (); } - } - - protected object this [object source] { - get { return sourceData[source]; } - set { sourceData[source] = value; } - } - - protected void DeliverEvent (object sender, EventArgs args) - { - DeliverEventToList (sender, args, (ListenerList)this[sender]); - } - - protected void DeliverEventToList (object sender, EventArgs args, ListenerList list) - { - for (int i = 0; i < list.Count; i ++) { - IWeakEventListener listener = list[i]; - listener.ReceiveWeakEvent (GetType(), sender, args); - } - } - - protected void ProtectedAddListener (object source, IWeakEventListener listener) - { - ListenerList list = sourceData[source] as ListenerList; - if (list != null) - list.Add (listener); - } - - protected void ProtectedRemoveListener (object source, IWeakEventListener listener) - { - ListenerList list = sourceData[source] as ListenerList; - if (list != null) - list.Remove (listener); - } - - protected virtual bool Purge (object source, object data, bool purgeAll) - { - throw new NotImplementedException (); - } - - protected void Remove (object source) - { - throw new NotImplementedException (); - } - - protected void ScheduleCleanup () - { - throw new NotImplementedException (); - } - - protected abstract void StartListening (object source); - protected abstract void StopListening (object source); - - - protected static WeakEventManager GetCurrentManager (Type managerType) - { - throw new NotImplementedException (); - } - - protected static void SetCurrentManager (Type managerType, WeakEventManager manager) - { - throw new NotImplementedException (); - } - - - protected class ListenerList - { - public ListenerList () - { - throw new NotImplementedException (); - } - - public ListenerList (int capacity) - { - throw new NotImplementedException (); - } - - public int Count { - get { throw new NotImplementedException (); } - } - - public static ListenerList Empty { - get { throw new NotImplementedException (); } - } - - public bool IsEmpty { - get { throw new NotImplementedException (); } - } - - public IWeakEventListener this[int index] { - get { throw new NotImplementedException (); } - } - - public void Add (IWeakEventListener listener) - { - throw new NotImplementedException (); - } - - public bool BeginUse () - { - throw new NotImplementedException (); - } - - public WeakEventManager.ListenerList Clone () - { - throw new NotImplementedException (); - } - - public void EndUse () - { - throw new NotImplementedException (); - } - - public static bool PrepareForWriting (ref WeakEventManager.ListenerList list) - { - throw new NotImplementedException (); - } - - public bool Purge () - { - throw new NotImplementedException (); - } - - public void Remove (IWeakEventListener listener) - { - throw new NotImplementedException (); - } - } - } - -} diff --git a/src/FPF/WindowsBase/WindowsBase.csproj b/src/FPF/WindowsBase/WindowsBase.csproj deleted file mode 100644 index dcd2c2d..0000000 --- a/src/FPF/WindowsBase/WindowsBase.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - 1699,67,618 - true - TRACE;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;MULTIPLEX_OS - false - false - $(TargetFramework) - - - - - - \ No newline at end of file diff --git a/src/FPF/winfx3.pub b/src/FPF/winfx3.pub deleted file mode 100644 index 695f1b3..0000000 Binary files a/src/FPF/winfx3.pub and /dev/null differ diff --git a/src/OpenSource.Def.projitems b/src/OpenSource.Def.projitems index 8e38981..f8fee42 100644 --- a/src/OpenSource.Def.projitems +++ b/src/OpenSource.Def.projitems @@ -5,9 +5,6 @@ $(ReferencesVSEditorCopyToOutput) - - $(ReferencesVSEditorCopyToOutput) - $(ReferencesVSEditorCopyToOutput) @@ -29,9 +26,6 @@ $(ReferencesVSEditorCopyToOutput) - - $(ReferencesVSEditorCopyToOutput) - $(ReferencesVSEditorCopyToOutput) diff --git a/src/OpenSource.Impl.projitems b/src/OpenSource.Impl.projitems index e8a3ffa..edc92a9 100644 --- a/src/OpenSource.Impl.projitems +++ b/src/OpenSource.Impl.projitems @@ -2,27 +2,27 @@ - + FPF $(ReferencesVSEditorCopyToOutput) - + FPF $(ReferencesVSEditorCopyToOutput) - + FPF $(ReferencesVSEditorCopyToOutput) - + FPF $(ReferencesVSEditorCopyToOutput) - + FPF $(ReferencesVSEditorCopyToOutput) - + FPF $(ReferencesVSEditorCopyToOutput) -- cgit v1.2.3