예제 #1
1
        // Code compiled into PresentationFramework.dll

        // Initialize known object types
        internal static object CreateKnownElement(KnownElements knownElement) 
        {
            object o = null; 
            switch (knownElement) 
            {
                case KnownElements.AccessText: o = new System.Windows.Controls.AccessText();   break; 
                case KnownElements.AdornedElementPlaceholder: o = new System.Windows.Controls.AdornedElementPlaceholder();   break;
                case KnownElements.AdornerDecorator: o = new System.Windows.Documents.AdornerDecorator();   break;
                case KnownElements.AmbientLight: o = new System.Windows.Media.Media3D.AmbientLight();   break;
                case KnownElements.Application: o = new System.Windows.Application();   break; 
                case KnownElements.ArcSegment: o = new System.Windows.Media.ArcSegment();   break;
                case KnownElements.ArrayExtension: o = new System.Windows.Markup.ArrayExtension();   break; 
                case KnownElements.AxisAngleRotation3D: o = new System.Windows.Media.Media3D.AxisAngleRotation3D();   break; 
                case KnownElements.BeginStoryboard: o = new System.Windows.Media.Animation.BeginStoryboard();   break;
                case KnownElements.BevelBitmapEffect: o = new System.Windows.Media.Effects.BevelBitmapEffect();   break; 
                case KnownElements.BezierSegment: o = new System.Windows.Media.BezierSegment();   break;
                case KnownElements.Binding: o = new System.Windows.Data.Binding();   break;
                case KnownElements.BitmapEffectCollection: o = new System.Windows.Media.Effects.BitmapEffectCollection();   break;
                case KnownElements.BitmapEffectGroup: o = new System.Windows.Media.Effects.BitmapEffectGroup();   break; 
                case KnownElements.BitmapEffectInput: o = new System.Windows.Media.Effects.BitmapEffectInput();   break;
                case KnownElements.BitmapImage: o = new System.Windows.Media.Imaging.BitmapImage();   break; 
                case KnownElements.BlockUIContainer: o = new System.Windows.Documents.BlockUIContainer();   break; 
                case KnownElements.BlurBitmapEffect: o = new System.Windows.Media.Effects.BlurBitmapEffect();   break;
                case KnownElements.BmpBitmapEncoder: o = new System.Windows.Media.Imaging.BmpBitmapEncoder();   break; 
                case KnownElements.Bold: o = new System.Windows.Documents.Bold();   break;
                case KnownElements.BoolIListConverter: o = new System.Windows.Media.Converters.BoolIListConverter();   break;
                case KnownElements.BooleanAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.BooleanAnimationUsingKeyFrames();   break;
                case KnownElements.BooleanConverter: o = new System.ComponentModel.BooleanConverter();   break; 
                case KnownElements.BooleanKeyFrameCollection: o = new System.Windows.Media.Animation.BooleanKeyFrameCollection();   break;
                case KnownElements.BooleanToVisibilityConverter: o = new System.Windows.Controls.BooleanToVisibilityConverter();   break; 
                case KnownElements.Border: o = new System.Windows.Controls.Border();   break; 
                case KnownElements.BorderGapMaskConverter: o = new System.Windows.Controls.BorderGapMaskConverter();   break;
                case KnownElements.BrushConverter: o = new System.Windows.Media.BrushConverter();   break; 
                case KnownElements.BulletDecorator: o = new System.Windows.Controls.Primitives.BulletDecorator();   break;
                case KnownElements.Button: o = new System.Windows.Controls.Button();   break;
                case KnownElements.ByteAnimation: o = new System.Windows.Media.Animation.ByteAnimation();   break;
                case KnownElements.ByteAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ByteAnimationUsingKeyFrames();   break; 
                case KnownElements.ByteConverter: o = new System.ComponentModel.ByteConverter();   break;
                case KnownElements.ByteKeyFrameCollection: o = new System.Windows.Media.Animation.ByteKeyFrameCollection();   break; 
                case KnownElements.Canvas: o = new System.Windows.Controls.Canvas();   break; 
                case KnownElements.CharAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.CharAnimationUsingKeyFrames();   break;
                case KnownElements.CharConverter: o = new System.ComponentModel.CharConverter();   break; 
                case KnownElements.CharIListConverter: o = new System.Windows.Media.Converters.CharIListConverter();   break;
                case KnownElements.CharKeyFrameCollection: o = new System.Windows.Media.Animation.CharKeyFrameCollection();   break;
                case KnownElements.CheckBox: o = new System.Windows.Controls.CheckBox();   break;
                case KnownElements.CollectionContainer: o = new System.Windows.Data.CollectionContainer();   break; 
                case KnownElements.CollectionViewSource: o = new System.Windows.Data.CollectionViewSource();   break;
                case KnownElements.Color: o = new System.Windows.Media.Color();   break; 
                case KnownElements.ColorAnimation: o = new System.Windows.Media.Animation.ColorAnimation();   break; 
                case KnownElements.ColorAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ColorAnimationUsingKeyFrames();   break;
                case KnownElements.ColorConvertedBitmap: o = new System.Windows.Media.Imaging.ColorConvertedBitmap();   break; 
                case KnownElements.ColorConvertedBitmapExtension: o = new System.Windows.ColorConvertedBitmapExtension();   break;
                case KnownElements.ColorConverter: o = new System.Windows.Media.ColorConverter();   break;
                case KnownElements.ColorKeyFrameCollection: o = new System.Windows.Media.Animation.ColorKeyFrameCollection();   break;
                case KnownElements.ColumnDefinition: o = new System.Windows.Controls.ColumnDefinition();   break; 
                case KnownElements.CombinedGeometry: o = new System.Windows.Media.CombinedGeometry();   break;
                case KnownElements.ComboBox: o = new System.Windows.Controls.ComboBox();   break; 
                case KnownElements.ComboBoxItem: o = new System.Windows.Controls.ComboBoxItem();   break; 
                case KnownElements.CommandConverter: o = new System.Windows.Input.CommandConverter();   break;
                case KnownElements.ComponentResourceKey: o = new System.Windows.ComponentResourceKey();   break; 
                case KnownElements.ComponentResourceKeyConverter: o = new System.Windows.Markup.ComponentResourceKeyConverter();   break;
                case KnownElements.Condition: o = new System.Windows.Condition();   break;
                case KnownElements.ContainerVisual: o = new System.Windows.Media.ContainerVisual();   break;
                case KnownElements.ContentControl: o = new System.Windows.Controls.ContentControl();   break; 
                case KnownElements.ContentElement: o = new System.Windows.ContentElement();   break;
                case KnownElements.ContentPresenter: o = new System.Windows.Controls.ContentPresenter();   break; 
                case KnownElements.ContextMenu: o = new System.Windows.Controls.ContextMenu();   break; 
                case KnownElements.Control: o = new System.Windows.Controls.Control();   break;
                case KnownElements.ControlTemplate: o = new System.Windows.Controls.ControlTemplate();   break; 
                case KnownElements.CornerRadius: o = new System.Windows.CornerRadius();   break;
                case KnownElements.CornerRadiusConverter: o = new System.Windows.CornerRadiusConverter();   break;
                case KnownElements.CroppedBitmap: o = new System.Windows.Media.Imaging.CroppedBitmap();   break;
                case KnownElements.CultureInfoConverter: o = new System.ComponentModel.CultureInfoConverter();   break; 
                case KnownElements.CultureInfoIetfLanguageTagConverter: o = new System.Windows.CultureInfoIetfLanguageTagConverter();   break;
                case KnownElements.CursorConverter: o = new System.Windows.Input.CursorConverter();   break; 
                case KnownElements.DashStyle: o = new System.Windows.Media.DashStyle();   break; 
                case KnownElements.DataTemplate: o = new System.Windows.DataTemplate();   break;
                case KnownElements.DataTemplateKey: o = new System.Windows.DataTemplateKey();   break; 
                case KnownElements.DataTrigger: o = new System.Windows.DataTrigger();   break;
                case KnownElements.DateTimeConverter: o = new System.ComponentModel.DateTimeConverter();   break;
                case KnownElements.DateTimeConverter2: o = new System.Windows.Markup.DateTimeConverter2();   break;
                case KnownElements.DecimalAnimation: o = new System.Windows.Media.Animation.DecimalAnimation();   break; 
                case KnownElements.DecimalAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.DecimalAnimationUsingKeyFrames();   break;
                case KnownElements.DecimalConverter: o = new System.ComponentModel.DecimalConverter();   break; 
                case KnownElements.DecimalKeyFrameCollection: o = new System.Windows.Media.Animation.DecimalKeyFrameCollection();   break; 
                case KnownElements.Decorator: o = new System.Windows.Controls.Decorator();   break;
                case KnownElements.DependencyObject: o = new System.Windows.DependencyObject();   break; 
                case KnownElements.DependencyPropertyConverter: o = new System.Windows.Markup.DependencyPropertyConverter();   break;
                case KnownElements.DialogResultConverter: o = new System.Windows.DialogResultConverter();   break;
                case KnownElements.DiffuseMaterial: o = new System.Windows.Media.Media3D.DiffuseMaterial();   break;
                case KnownElements.DirectionalLight: o = new System.Windows.Media.Media3D.DirectionalLight();   break; 
                case KnownElements.DiscreteBooleanKeyFrame: o = new System.Windows.Media.Animation.DiscreteBooleanKeyFrame();   break;
                case KnownElements.DiscreteByteKeyFrame: o = new System.Windows.Media.Animation.DiscreteByteKeyFrame();   break; 
                case KnownElements.DiscreteCharKeyFrame: o = new System.Windows.Media.Animation.DiscreteCharKeyFrame();   break; 
                case KnownElements.DiscreteColorKeyFrame: o = new System.Windows.Media.Animation.DiscreteColorKeyFrame();   break;
                case KnownElements.DiscreteDecimalKeyFrame: o = new System.Windows.Media.Animation.DiscreteDecimalKeyFrame();   break; 
                case KnownElements.DiscreteDoubleKeyFrame: o = new System.Windows.Media.Animation.DiscreteDoubleKeyFrame();   break;
                case KnownElements.DiscreteInt16KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt16KeyFrame();   break;
                case KnownElements.DiscreteInt32KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt32KeyFrame();   break;
                case KnownElements.DiscreteInt64KeyFrame: o = new System.Windows.Media.Animation.DiscreteInt64KeyFrame();   break; 
                case KnownElements.DiscreteMatrixKeyFrame: o = new System.Windows.Media.Animation.DiscreteMatrixKeyFrame();   break;
                case KnownElements.DiscreteObjectKeyFrame: o = new System.Windows.Media.Animation.DiscreteObjectKeyFrame();   break; 
                case KnownElements.DiscretePoint3DKeyFrame: o = new System.Windows.Media.Animation.DiscretePoint3DKeyFrame();   break; 
                case KnownElements.DiscretePointKeyFrame: o = new System.Windows.Media.Animation.DiscretePointKeyFrame();   break;
                case KnownElements.DiscreteQuaternionKeyFrame: o = new System.Windows.Media.Animation.DiscreteQuaternionKeyFrame();   break; 
                case KnownElements.DiscreteRectKeyFrame: o = new System.Windows.Media.Animation.DiscreteRectKeyFrame();   break;
                case KnownElements.DiscreteRotation3DKeyFrame: o = new System.Windows.Media.Animation.DiscreteRotation3DKeyFrame();   break;
                case KnownElements.DiscreteSingleKeyFrame: o = new System.Windows.Media.Animation.DiscreteSingleKeyFrame();   break;
                case KnownElements.DiscreteSizeKeyFrame: o = new System.Windows.Media.Animation.DiscreteSizeKeyFrame();   break; 
                case KnownElements.DiscreteStringKeyFrame: o = new System.Windows.Media.Animation.DiscreteStringKeyFrame();   break;
                case KnownElements.DiscreteThicknessKeyFrame: o = new System.Windows.Media.Animation.DiscreteThicknessKeyFrame();   break; 
                case KnownElements.DiscreteVector3DKeyFrame: o = new System.Windows.Media.Animation.DiscreteVector3DKeyFrame();   break; 
                case KnownElements.DiscreteVectorKeyFrame: o = new System.Windows.Media.Animation.DiscreteVectorKeyFrame();   break;
                case KnownElements.DockPanel: o = new System.Windows.Controls.DockPanel();   break; 
                case KnownElements.DocumentPageView: o = new System.Windows.Controls.Primitives.DocumentPageView();   break;
                case KnownElements.DocumentReference: o = new System.Windows.Documents.DocumentReference();   break;
                case KnownElements.DocumentViewer: o = new System.Windows.Controls.DocumentViewer();   break;
                case KnownElements.DoubleAnimation: o = new System.Windows.Media.Animation.DoubleAnimation();   break; 
                case KnownElements.DoubleAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames();   break;
                case KnownElements.DoubleAnimationUsingPath: o = new System.Windows.Media.Animation.DoubleAnimationUsingPath();   break; 
                case KnownElements.DoubleCollection: o = new System.Windows.Media.DoubleCollection();   break; 
                case KnownElements.DoubleCollectionConverter: o = new System.Windows.Media.DoubleCollectionConverter();   break;
                case KnownElements.DoubleConverter: o = new System.ComponentModel.DoubleConverter();   break; 
                case KnownElements.DoubleIListConverter: o = new System.Windows.Media.Converters.DoubleIListConverter();   break;
                case KnownElements.DoubleKeyFrameCollection: o = new System.Windows.Media.Animation.DoubleKeyFrameCollection();   break;
                case KnownElements.DrawingBrush: o = new System.Windows.Media.DrawingBrush();   break;
                case KnownElements.DrawingCollection: o = new System.Windows.Media.DrawingCollection();   break; 
                case KnownElements.DrawingGroup: o = new System.Windows.Media.DrawingGroup();   break;
                case KnownElements.DrawingImage: o = new System.Windows.Media.DrawingImage();   break; 
                case KnownElements.DrawingVisual: o = new System.Windows.Media.DrawingVisual();   break; 
                case KnownElements.DropShadowBitmapEffect: o = new System.Windows.Media.Effects.DropShadowBitmapEffect();   break;
                case KnownElements.Duration: o = new System.Windows.Duration();   break; 
                case KnownElements.DurationConverter: o = new System.Windows.DurationConverter();   break;
                case KnownElements.DynamicResourceExtension: o = new System.Windows.DynamicResourceExtension();   break;
                case KnownElements.DynamicResourceExtensionConverter: o = new System.Windows.DynamicResourceExtensionConverter();   break;
                case KnownElements.Ellipse: o = new System.Windows.Shapes.Ellipse();   break; 
                case KnownElements.EllipseGeometry: o = new System.Windows.Media.EllipseGeometry();   break;
                case KnownElements.EmbossBitmapEffect: o = new System.Windows.Media.Effects.EmbossBitmapEffect();   break; 
                case KnownElements.EmissiveMaterial: o = new System.Windows.Media.Media3D.EmissiveMaterial();   break; 
                case KnownElements.EventSetter: o = new System.Windows.EventSetter();   break;
                case KnownElements.EventTrigger: o = new System.Windows.EventTrigger();   break; 
                case KnownElements.Expander: o = new System.Windows.Controls.Expander();   break;
                case KnownElements.ExpressionConverter: o = new System.Windows.ExpressionConverter();   break;
                case KnownElements.Figure: o = new System.Windows.Documents.Figure();   break;
                case KnownElements.FigureLength: o = new System.Windows.FigureLength();   break; 
                case KnownElements.FigureLengthConverter: o = new System.Windows.FigureLengthConverter();   break;
                case KnownElements.FixedDocument: o = new System.Windows.Documents.FixedDocument();   break; 
                case KnownElements.FixedDocumentSequence: o = new System.Windows.Documents.FixedDocumentSequence();   break; 
                case KnownElements.FixedPage: o = new System.Windows.Documents.FixedPage();   break;
                case KnownElements.Floater: o = new System.Windows.Documents.Floater();   break; 
                case KnownElements.FlowDocument: o = new System.Windows.Documents.FlowDocument();   break;
                case KnownElements.FlowDocumentPageViewer: o = new System.Windows.Controls.FlowDocumentPageViewer();   break;
                case KnownElements.FlowDocumentReader: o = new System.Windows.Controls.FlowDocumentReader();   break;
                case KnownElements.FlowDocumentScrollViewer: o = new System.Windows.Controls.FlowDocumentScrollViewer();   break; 
                case KnownElements.FontFamily: o = new System.Windows.Media.FontFamily();   break;
                case KnownElements.FontFamilyConverter: o = new System.Windows.Media.FontFamilyConverter();   break; 
                case KnownElements.FontSizeConverter: o = new System.Windows.FontSizeConverter();   break; 
                case KnownElements.FontStretch: o = new System.Windows.FontStretch();   break;
                case KnownElements.FontStretchConverter: o = new System.Windows.FontStretchConverter();   break; 
                case KnownElements.FontStyle: o = new System.Windows.FontStyle();   break;
                case KnownElements.FontStyleConverter: o = new System.Windows.FontStyleConverter();   break;
                case KnownElements.FontWeight: o = new System.Windows.FontWeight();   break;
                case KnownElements.FontWeightConverter: o = new System.Windows.FontWeightConverter();   break; 
                case KnownElements.FormatConvertedBitmap: o = new System.Windows.Media.Imaging.FormatConvertedBitmap();   break;
                case KnownElements.Frame: o = new System.Windows.Controls.Frame();   break; 
                case KnownElements.FrameworkContentElement: o = new System.Windows.FrameworkContentElement();   break; 
                case KnownElements.FrameworkElement: o = new System.Windows.FrameworkElement();   break;
                case KnownElements.FrameworkElementFactory: o = new System.Windows.FrameworkElementFactory();   break; 
                case KnownElements.FrameworkPropertyMetadata: o = new System.Windows.FrameworkPropertyMetadata();   break;
                case KnownElements.GeneralTransformCollection: o = new System.Windows.Media.GeneralTransformCollection();   break;
                case KnownElements.GeneralTransformGroup: o = new System.Windows.Media.GeneralTransformGroup();   break;
                case KnownElements.GeometryCollection: o = new System.Windows.Media.GeometryCollection();   break; 
                case KnownElements.GeometryConverter: o = new System.Windows.Media.GeometryConverter();   break;
                case KnownElements.GeometryDrawing: o = new System.Windows.Media.GeometryDrawing();   break; 
                case KnownElements.GeometryGroup: o = new System.Windows.Media.GeometryGroup();   break; 
                case KnownElements.GeometryModel3D: o = new System.Windows.Media.Media3D.GeometryModel3D();   break;
                case KnownElements.GestureRecognizer: o = new System.Windows.Ink.GestureRecognizer();   break; 
                case KnownElements.GifBitmapEncoder: o = new System.Windows.Media.Imaging.GifBitmapEncoder();   break;
                case KnownElements.GlyphRun: o = new System.Windows.Media.GlyphRun();   break;
                case KnownElements.GlyphRunDrawing: o = new System.Windows.Media.GlyphRunDrawing();   break;
                case KnownElements.GlyphTypeface: o = new System.Windows.Media.GlyphTypeface();   break; 
                case KnownElements.Glyphs: o = new System.Windows.Documents.Glyphs();   break;
                case KnownElements.GradientStop: o = new System.Windows.Media.GradientStop();   break; 
                case KnownElements.GradientStopCollection: o = new System.Windows.Media.GradientStopCollection();   break; 
                case KnownElements.Grid: o = new System.Windows.Controls.Grid();   break;
                case KnownElements.GridLength: o = new System.Windows.GridLength();   break; 
                case KnownElements.GridLengthConverter: o = new System.Windows.GridLengthConverter();   break;
                case KnownElements.GridSplitter: o = new System.Windows.Controls.GridSplitter();   break;
                case KnownElements.GridView: o = new System.Windows.Controls.GridView();   break;
                case KnownElements.GridViewColumn: o = new System.Windows.Controls.GridViewColumn();   break; 
                case KnownElements.GridViewColumnHeader: o = new System.Windows.Controls.GridViewColumnHeader();   break;
                case KnownElements.GridViewHeaderRowPresenter: o = new System.Windows.Controls.GridViewHeaderRowPresenter();   break; 
                case KnownElements.GridViewRowPresenter: o = new System.Windows.Controls.GridViewRowPresenter();   break; 
                case KnownElements.GroupBox: o = new System.Windows.Controls.GroupBox();   break;
                case KnownElements.GroupItem: o = new System.Windows.Controls.GroupItem();   break; 
                case KnownElements.GuidConverter: o = new System.ComponentModel.GuidConverter();   break;
                case KnownElements.GuidelineSet: o = new System.Windows.Media.GuidelineSet();   break;
                case KnownElements.HeaderedContentControl: o = new System.Windows.Controls.HeaderedContentControl();   break;
                case KnownElements.HeaderedItemsControl: o = new System.Windows.Controls.HeaderedItemsControl();   break; 
                case KnownElements.HierarchicalDataTemplate: o = new System.Windows.HierarchicalDataTemplate();   break;
                case KnownElements.HostVisual: o = new System.Windows.Media.HostVisual();   break; 
                case KnownElements.Hyperlink: o = new System.Windows.Documents.Hyperlink();   break; 
                case KnownElements.Image: o = new System.Windows.Controls.Image();   break;
                case KnownElements.ImageBrush: o = new System.Windows.Media.ImageBrush();   break; 
                case KnownElements.ImageDrawing: o = new System.Windows.Media.ImageDrawing();   break;
                case KnownElements.ImageSourceConverter: o = new System.Windows.Media.ImageSourceConverter();   break;
                case KnownElements.InkCanvas: o = new System.Windows.Controls.InkCanvas();   break;
                case KnownElements.InkPresenter: o = new System.Windows.Controls.InkPresenter();   break; 
                case KnownElements.InlineUIContainer: o = new System.Windows.Documents.InlineUIContainer();   break;
                case KnownElements.InputScope: o = new System.Windows.Input.InputScope();   break; 
                case KnownElements.InputScopeConverter: o = new System.Windows.Input.InputScopeConverter();   break; 
                case KnownElements.InputScopeName: o = new System.Windows.Input.InputScopeName();   break;
                case KnownElements.InputScopeNameConverter: o = new System.Windows.Input.InputScopeNameConverter();   break; 
                case KnownElements.Int16Animation: o = new System.Windows.Media.Animation.Int16Animation();   break;
                case KnownElements.Int16AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int16AnimationUsingKeyFrames();   break;
                case KnownElements.Int16Converter: o = new System.ComponentModel.Int16Converter();   break;
                case KnownElements.Int16KeyFrameCollection: o = new System.Windows.Media.Animation.Int16KeyFrameCollection();   break; 
                case KnownElements.Int32Animation: o = new System.Windows.Media.Animation.Int32Animation();   break;
                case KnownElements.Int32AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int32AnimationUsingKeyFrames();   break; 
                case KnownElements.Int32Collection: o = new System.Windows.Media.Int32Collection();   break; 
                case KnownElements.Int32CollectionConverter: o = new System.Windows.Media.Int32CollectionConverter();   break;
                case KnownElements.Int32Converter: o = new System.ComponentModel.Int32Converter();   break; 
                case KnownElements.Int32KeyFrameCollection: o = new System.Windows.Media.Animation.Int32KeyFrameCollection();   break;
                case KnownElements.Int32Rect: o = new System.Windows.Int32Rect();   break;
                case KnownElements.Int32RectConverter: o = new System.Windows.Int32RectConverter();   break;
                case KnownElements.Int64Animation: o = new System.Windows.Media.Animation.Int64Animation();   break; 
                case KnownElements.Int64AnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Int64AnimationUsingKeyFrames();   break;
                case KnownElements.Int64Converter: o = new System.ComponentModel.Int64Converter();   break; 
                case KnownElements.Int64KeyFrameCollection: o = new System.Windows.Media.Animation.Int64KeyFrameCollection();   break; 
                case KnownElements.Italic: o = new System.Windows.Documents.Italic();   break;
                case KnownElements.ItemsControl: o = new System.Windows.Controls.ItemsControl();   break; 
                case KnownElements.ItemsPanelTemplate: o = new System.Windows.Controls.ItemsPanelTemplate();   break;
                case KnownElements.ItemsPresenter: o = new System.Windows.Controls.ItemsPresenter();   break;
                case KnownElements.JournalEntryListConverter: o = new System.Windows.Navigation.JournalEntryListConverter();   break;
                case KnownElements.JournalEntryUnifiedViewConverter: o = new System.Windows.Navigation.JournalEntryUnifiedViewConverter();   break; 
                case KnownElements.JpegBitmapEncoder: o = new System.Windows.Media.Imaging.JpegBitmapEncoder();   break;
                case KnownElements.KeyBinding: o = new System.Windows.Input.KeyBinding();   break; 
                case KnownElements.KeyConverter: o = new System.Windows.Input.KeyConverter();   break; 
                case KnownElements.KeyGestureConverter: o = new System.Windows.Input.KeyGestureConverter();   break;
                case KnownElements.KeySpline: o = new System.Windows.Media.Animation.KeySpline();   break; 
                case KnownElements.KeySplineConverter: o = new System.Windows.KeySplineConverter();   break;
                case KnownElements.KeyTime: o = new System.Windows.Media.Animation.KeyTime();   break;
                case KnownElements.KeyTimeConverter: o = new System.Windows.KeyTimeConverter();   break;
                case KnownElements.Label: o = new System.Windows.Controls.Label();   break; 
                case KnownElements.LengthConverter: o = new System.Windows.LengthConverter();   break;
                case KnownElements.Line: o = new System.Windows.Shapes.Line();   break; 
                case KnownElements.LineBreak: o = new System.Windows.Documents.LineBreak();   break; 
                case KnownElements.LineGeometry: o = new System.Windows.Media.LineGeometry();   break;
                case KnownElements.LineSegment: o = new System.Windows.Media.LineSegment();   break; 
                case KnownElements.LinearByteKeyFrame: o = new System.Windows.Media.Animation.LinearByteKeyFrame();   break;
                case KnownElements.LinearColorKeyFrame: o = new System.Windows.Media.Animation.LinearColorKeyFrame();   break;
                case KnownElements.LinearDecimalKeyFrame: o = new System.Windows.Media.Animation.LinearDecimalKeyFrame();   break;
                case KnownElements.LinearDoubleKeyFrame: o = new System.Windows.Media.Animation.LinearDoubleKeyFrame();   break; 
                case KnownElements.LinearGradientBrush: o = new System.Windows.Media.LinearGradientBrush();   break;
                case KnownElements.LinearInt16KeyFrame: o = new System.Windows.Media.Animation.LinearInt16KeyFrame();   break; 
                case KnownElements.LinearInt32KeyFrame: o = new System.Windows.Media.Animation.LinearInt32KeyFrame();   break; 
                case KnownElements.LinearInt64KeyFrame: o = new System.Windows.Media.Animation.LinearInt64KeyFrame();   break;
                case KnownElements.LinearPoint3DKeyFrame: o = new System.Windows.Media.Animation.LinearPoint3DKeyFrame();   break; 
                case KnownElements.LinearPointKeyFrame: o = new System.Windows.Media.Animation.LinearPointKeyFrame();   break;
                case KnownElements.LinearQuaternionKeyFrame: o = new System.Windows.Media.Animation.LinearQuaternionKeyFrame();   break;
                case KnownElements.LinearRectKeyFrame: o = new System.Windows.Media.Animation.LinearRectKeyFrame();   break;
                case KnownElements.LinearRotation3DKeyFrame: o = new System.Windows.Media.Animation.LinearRotation3DKeyFrame();   break; 
                case KnownElements.LinearSingleKeyFrame: o = new System.Windows.Media.Animation.LinearSingleKeyFrame();   break;
                case KnownElements.LinearSizeKeyFrame: o = new System.Windows.Media.Animation.LinearSizeKeyFrame();   break; 
                case KnownElements.LinearThicknessKeyFrame: o = new System.Windows.Media.Animation.LinearThicknessKeyFrame();   break; 
                case KnownElements.LinearVector3DKeyFrame: o = new System.Windows.Media.Animation.LinearVector3DKeyFrame();   break;
                case KnownElements.LinearVectorKeyFrame: o = new System.Windows.Media.Animation.LinearVectorKeyFrame();   break; 
                case KnownElements.List: o = new System.Windows.Documents.List();   break;
                case KnownElements.ListBox: o = new System.Windows.Controls.ListBox();   break;
                case KnownElements.ListBoxItem: o = new System.Windows.Controls.ListBoxItem();   break;
                case KnownElements.ListItem: o = new System.Windows.Documents.ListItem();   break; 
                case KnownElements.ListView: o = new System.Windows.Controls.ListView();   break;
                case KnownElements.ListViewItem: o = new System.Windows.Controls.ListViewItem();   break; 
                case KnownElements.MaterialCollection: o = new System.Windows.Media.Media3D.MaterialCollection();   break; 
                case KnownElements.MaterialGroup: o = new System.Windows.Media.Media3D.MaterialGroup();   break;
                case KnownElements.Matrix: o = new System.Windows.Media.Matrix();   break; 
                case KnownElements.Matrix3D: o = new System.Windows.Media.Media3D.Matrix3D();   break;
                case KnownElements.Matrix3DConverter: o = new System.Windows.Media.Media3D.Matrix3DConverter();   break;
                case KnownElements.MatrixAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.MatrixAnimationUsingKeyFrames();   break;
                case KnownElements.MatrixAnimationUsingPath: o = new System.Windows.Media.Animation.MatrixAnimationUsingPath();   break; 
                case KnownElements.MatrixCamera: o = new System.Windows.Media.Media3D.MatrixCamera();   break;
                case KnownElements.MatrixConverter: o = new System.Windows.Media.MatrixConverter();   break; 
                case KnownElements.MatrixKeyFrameCollection: o = new System.Windows.Media.Animation.MatrixKeyFrameCollection();   break; 
                case KnownElements.MatrixTransform: o = new System.Windows.Media.MatrixTransform();   break;
                case KnownElements.MatrixTransform3D: o = new System.Windows.Media.Media3D.MatrixTransform3D();   break; 
                case KnownElements.MediaElement: o = new System.Windows.Controls.MediaElement();   break;
                case KnownElements.MediaPlayer: o = new System.Windows.Media.MediaPlayer();   break;
                case KnownElements.MediaTimeline: o = new System.Windows.Media.MediaTimeline();   break;
                case KnownElements.Menu: o = new System.Windows.Controls.Menu();   break; 
                case KnownElements.MenuItem: o = new System.Windows.Controls.MenuItem();   break;
                case KnownElements.MenuScrollingVisibilityConverter: o = new System.Windows.Controls.MenuScrollingVisibilityConverter();   break; 
                case KnownElements.MeshGeometry3D: o = new System.Windows.Media.Media3D.MeshGeometry3D();   break; 
                case KnownElements.Model3DCollection: o = new System.Windows.Media.Media3D.Model3DCollection();   break;
                case KnownElements.Model3DGroup: o = new System.Windows.Media.Media3D.Model3DGroup();   break; 
                case KnownElements.ModelVisual3D: o = new System.Windows.Media.Media3D.ModelVisual3D();   break;
                case KnownElements.ModifierKeysConverter: o = new System.Windows.Input.ModifierKeysConverter();   break;
                case KnownElements.MouseActionConverter: o = new System.Windows.Input.MouseActionConverter();   break;
                case KnownElements.MouseBinding: o = new System.Windows.Input.MouseBinding();   break; 
                case KnownElements.MouseGesture: o = new System.Windows.Input.MouseGesture();   break;
                case KnownElements.MouseGestureConverter: o = new System.Windows.Input.MouseGestureConverter();   break; 
                case KnownElements.MultiBinding: o = new System.Windows.Data.MultiBinding();   break; 
                case KnownElements.MultiDataTrigger: o = new System.Windows.MultiDataTrigger();   break;
                case KnownElements.MultiTrigger: o = new System.Windows.MultiTrigger();   break; 
                case KnownElements.NameScope: o = new System.Windows.NameScope();   break;
                case KnownElements.NavigationWindow: o = new System.Windows.Navigation.NavigationWindow();   break;
                case KnownElements.NullExtension: o = new System.Windows.Markup.NullExtension();   break;
                case KnownElements.NullableBoolConverter: o = new System.Windows.NullableBoolConverter();   break; 
                case KnownElements.NumberSubstitution: o = new System.Windows.Media.NumberSubstitution();   break;
                case KnownElements.Object: o = new System.Object();   break; 
                case KnownElements.ObjectAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ObjectAnimationUsingKeyFrames();   break; 
                case KnownElements.ObjectDataProvider: o = new System.Windows.Data.ObjectDataProvider();   break;
                case KnownElements.ObjectKeyFrameCollection: o = new System.Windows.Media.Animation.ObjectKeyFrameCollection();   break; 
                case KnownElements.OrthographicCamera: o = new System.Windows.Media.Media3D.OrthographicCamera();   break;
                case KnownElements.OuterGlowBitmapEffect: o = new System.Windows.Media.Effects.OuterGlowBitmapEffect();   break;
                case KnownElements.Page: o = new System.Windows.Controls.Page();   break;
                case KnownElements.PageContent: o = new System.Windows.Documents.PageContent();   break; 
                case KnownElements.Paragraph: o = new System.Windows.Documents.Paragraph();   break;
                case KnownElements.ParallelTimeline: o = new System.Windows.Media.Animation.ParallelTimeline();   break; 
                case KnownElements.ParserContext: o = new System.Windows.Markup.ParserContext();   break; 
                case KnownElements.PasswordBox: o = new System.Windows.Controls.PasswordBox();   break;
                case KnownElements.Path: o = new System.Windows.Shapes.Path();   break; 
                case KnownElements.PathFigure: o = new System.Windows.Media.PathFigure();   break;
                case KnownElements.PathFigureCollection: o = new System.Windows.Media.PathFigureCollection();   break;
                case KnownElements.PathFigureCollectionConverter: o = new System.Windows.Media.PathFigureCollectionConverter();   break;
                case KnownElements.PathGeometry: o = new System.Windows.Media.PathGeometry();   break; 
                case KnownElements.PathSegmentCollection: o = new System.Windows.Media.PathSegmentCollection();   break;
                case KnownElements.PauseStoryboard: o = new System.Windows.Media.Animation.PauseStoryboard();   break; 
                case KnownElements.Pen: o = new System.Windows.Media.Pen();   break; 
                case KnownElements.PerspectiveCamera: o = new System.Windows.Media.Media3D.PerspectiveCamera();   break;
                case KnownElements.PixelFormat: o = new System.Windows.Media.PixelFormat();   break; 
                case KnownElements.PixelFormatConverter: o = new System.Windows.Media.PixelFormatConverter();   break;
                case KnownElements.PngBitmapEncoder: o = new System.Windows.Media.Imaging.PngBitmapEncoder();   break;
                case KnownElements.Point: o = new System.Windows.Point();   break;
                case KnownElements.Point3D: o = new System.Windows.Media.Media3D.Point3D();   break; 
                case KnownElements.Point3DAnimation: o = new System.Windows.Media.Animation.Point3DAnimation();   break;
                case KnownElements.Point3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Point3DAnimationUsingKeyFrames();   break; 
                case KnownElements.Point3DCollection: o = new System.Windows.Media.Media3D.Point3DCollection();   break; 
                case KnownElements.Point3DCollectionConverter: o = new System.Windows.Media.Media3D.Point3DCollectionConverter();   break;
                case KnownElements.Point3DConverter: o = new System.Windows.Media.Media3D.Point3DConverter();   break; 
                case KnownElements.Point3DKeyFrameCollection: o = new System.Windows.Media.Animation.Point3DKeyFrameCollection();   break;
                case KnownElements.Point4D: o = new System.Windows.Media.Media3D.Point4D();   break;
                case KnownElements.Point4DConverter: o = new System.Windows.Media.Media3D.Point4DConverter();   break;
                case KnownElements.PointAnimation: o = new System.Windows.Media.Animation.PointAnimation();   break; 
                case KnownElements.PointAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.PointAnimationUsingKeyFrames();   break;
                case KnownElements.PointAnimationUsingPath: o = new System.Windows.Media.Animation.PointAnimationUsingPath();   break; 
                case KnownElements.PointCollection: o = new System.Windows.Media.PointCollection();   break; 
                case KnownElements.PointCollectionConverter: o = new System.Windows.Media.PointCollectionConverter();   break;
                case KnownElements.PointConverter: o = new System.Windows.PointConverter();   break; 
                case KnownElements.PointIListConverter: o = new System.Windows.Media.Converters.PointIListConverter();   break;
                case KnownElements.PointKeyFrameCollection: o = new System.Windows.Media.Animation.PointKeyFrameCollection();   break;
                case KnownElements.PointLight: o = new System.Windows.Media.Media3D.PointLight();   break;
                case KnownElements.PolyBezierSegment: o = new System.Windows.Media.PolyBezierSegment();   break; 
                case KnownElements.PolyLineSegment: o = new System.Windows.Media.PolyLineSegment();   break;
                case KnownElements.PolyQuadraticBezierSegment: o = new System.Windows.Media.PolyQuadraticBezierSegment();   break; 
                case KnownElements.Polygon: o = new System.Windows.Shapes.Polygon();   break; 
                case KnownElements.Polyline: o = new System.Windows.Shapes.Polyline();   break;
                case KnownElements.Popup: o = new System.Windows.Controls.Primitives.Popup();   break; 
                case KnownElements.PriorityBinding: o = new System.Windows.Data.PriorityBinding();   break;
                case KnownElements.ProgressBar: o = new System.Windows.Controls.ProgressBar();   break;
                case KnownElements.PropertyPathConverter: o = new System.Windows.PropertyPathConverter();   break;
                case KnownElements.QuadraticBezierSegment: o = new System.Windows.Media.QuadraticBezierSegment();   break; 
                case KnownElements.Quaternion: o = new System.Windows.Media.Media3D.Quaternion();   break;
                case KnownElements.QuaternionAnimation: o = new System.Windows.Media.Animation.QuaternionAnimation();   break; 
                case KnownElements.QuaternionAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.QuaternionAnimationUsingKeyFrames();   break; 
                case KnownElements.QuaternionConverter: o = new System.Windows.Media.Media3D.QuaternionConverter();   break;
                case KnownElements.QuaternionKeyFrameCollection: o = new System.Windows.Media.Animation.QuaternionKeyFrameCollection();   break; 
                case KnownElements.QuaternionRotation3D: o = new System.Windows.Media.Media3D.QuaternionRotation3D();   break;
                case KnownElements.RadialGradientBrush: o = new System.Windows.Media.RadialGradientBrush();   break;
                case KnownElements.RadioButton: o = new System.Windows.Controls.RadioButton();   break;
                case KnownElements.Rect: o = new System.Windows.Rect();   break; 
                case KnownElements.Rect3D: o = new System.Windows.Media.Media3D.Rect3D();   break;
                case KnownElements.Rect3DConverter: o = new System.Windows.Media.Media3D.Rect3DConverter();   break; 
                case KnownElements.RectAnimation: o = new System.Windows.Media.Animation.RectAnimation();   break; 
                case KnownElements.RectAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.RectAnimationUsingKeyFrames();   break;
                case KnownElements.RectConverter: o = new System.Windows.RectConverter();   break; 
                case KnownElements.RectKeyFrameCollection: o = new System.Windows.Media.Animation.RectKeyFrameCollection();   break;
                case KnownElements.Rectangle: o = new System.Windows.Shapes.Rectangle();   break;
                case KnownElements.RectangleGeometry: o = new System.Windows.Media.RectangleGeometry();   break;
                case KnownElements.RelativeSource: o = new System.Windows.Data.RelativeSource();   break; 
                case KnownElements.RemoveStoryboard: o = new System.Windows.Media.Animation.RemoveStoryboard();   break;
                case KnownElements.RepeatBehavior: o = new System.Windows.Media.Animation.RepeatBehavior();   break; 
                case KnownElements.RepeatBehaviorConverter: o = new System.Windows.Media.Animation.RepeatBehaviorConverter();   break; 
                case KnownElements.RepeatButton: o = new System.Windows.Controls.Primitives.RepeatButton();   break;
                case KnownElements.ResizeGrip: o = new System.Windows.Controls.Primitives.ResizeGrip();   break; 
                case KnownElements.ResourceDictionary: o = new System.Windows.ResourceDictionary();   break;
                case KnownElements.ResumeStoryboard: o = new System.Windows.Media.Animation.ResumeStoryboard();   break;
                case KnownElements.RichTextBox: o = new System.Windows.Controls.RichTextBox();   break;
                case KnownElements.RotateTransform: o = new System.Windows.Media.RotateTransform();   break; 
                case KnownElements.RotateTransform3D: o = new System.Windows.Media.Media3D.RotateTransform3D();   break;
                case KnownElements.Rotation3DAnimation: o = new System.Windows.Media.Animation.Rotation3DAnimation();   break; 
                case KnownElements.Rotation3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Rotation3DAnimationUsingKeyFrames();   break; 
                case KnownElements.Rotation3DKeyFrameCollection: o = new System.Windows.Media.Animation.Rotation3DKeyFrameCollection();   break;
                case KnownElements.RoutedCommand: o = new System.Windows.Input.RoutedCommand();   break; 
                case KnownElements.RoutedEventConverter: o = new System.Windows.Markup.RoutedEventConverter();   break;
                case KnownElements.RoutedUICommand: o = new System.Windows.Input.RoutedUICommand();   break;
                case KnownElements.RowDefinition: o = new System.Windows.Controls.RowDefinition();   break;
                case KnownElements.Run: o = new System.Windows.Documents.Run();   break; 
                case KnownElements.SByteConverter: o = new System.ComponentModel.SByteConverter();   break;
                case KnownElements.ScaleTransform: o = new System.Windows.Media.ScaleTransform();   break; 
                case KnownElements.ScaleTransform3D: o = new System.Windows.Media.Media3D.ScaleTransform3D();   break; 
                case KnownElements.ScrollBar: o = new System.Windows.Controls.Primitives.ScrollBar();   break;
                case KnownElements.ScrollContentPresenter: o = new System.Windows.Controls.ScrollContentPresenter();   break; 
                case KnownElements.ScrollViewer: o = new System.Windows.Controls.ScrollViewer();   break;
                case KnownElements.Section: o = new System.Windows.Documents.Section();   break;
                case KnownElements.SeekStoryboard: o = new System.Windows.Media.Animation.SeekStoryboard();   break;
                case KnownElements.Separator: o = new System.Windows.Controls.Separator();   break; 
                case KnownElements.SetStoryboardSpeedRatio: o = new System.Windows.Media.Animation.SetStoryboardSpeedRatio();   break;
                case KnownElements.Setter: o = new System.Windows.Setter();   break; 
                case KnownElements.SingleAnimation: o = new System.Windows.Media.Animation.SingleAnimation();   break; 
                case KnownElements.SingleAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.SingleAnimationUsingKeyFrames();   break;
                case KnownElements.SingleConverter: o = new System.ComponentModel.SingleConverter();   break; 
                case KnownElements.SingleKeyFrameCollection: o = new System.Windows.Media.Animation.SingleKeyFrameCollection();   break;
                case KnownElements.Size: o = new System.Windows.Size();   break;
                case KnownElements.Size3D: o = new System.Windows.Media.Media3D.Size3D();   break;
                case KnownElements.Size3DConverter: o = new System.Windows.Media.Media3D.Size3DConverter();   break; 
                case KnownElements.SizeAnimation: o = new System.Windows.Media.Animation.SizeAnimation();   break;
                case KnownElements.SizeAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.SizeAnimationUsingKeyFrames();   break; 
                case KnownElements.SizeConverter: o = new System.Windows.SizeConverter();   break; 
                case KnownElements.SizeKeyFrameCollection: o = new System.Windows.Media.Animation.SizeKeyFrameCollection();   break;
                case KnownElements.SkewTransform: o = new System.Windows.Media.SkewTransform();   break; 
                case KnownElements.SkipStoryboardToFill: o = new System.Windows.Media.Animation.SkipStoryboardToFill();   break;
                case KnownElements.Slider: o = new System.Windows.Controls.Slider();   break;
                case KnownElements.SolidColorBrush: o = new System.Windows.Media.SolidColorBrush();   break;
                case KnownElements.SoundPlayerAction: o = new System.Windows.Controls.SoundPlayerAction();   break; 
                case KnownElements.Span: o = new System.Windows.Documents.Span();   break;
                case KnownElements.SpecularMaterial: o = new System.Windows.Media.Media3D.SpecularMaterial();   break; 
                case KnownElements.SplineByteKeyFrame: o = new System.Windows.Media.Animation.SplineByteKeyFrame();   break; 
                case KnownElements.SplineColorKeyFrame: o = new System.Windows.Media.Animation.SplineColorKeyFrame();   break;
                case KnownElements.SplineDecimalKeyFrame: o = new System.Windows.Media.Animation.SplineDecimalKeyFrame();   break; 
                case KnownElements.SplineDoubleKeyFrame: o = new System.Windows.Media.Animation.SplineDoubleKeyFrame();   break;
                case KnownElements.SplineInt16KeyFrame: o = new System.Windows.Media.Animation.SplineInt16KeyFrame();   break;
                case KnownElements.SplineInt32KeyFrame: o = new System.Windows.Media.Animation.SplineInt32KeyFrame();   break;
                case KnownElements.SplineInt64KeyFrame: o = new System.Windows.Media.Animation.SplineInt64KeyFrame();   break; 
                case KnownElements.SplinePoint3DKeyFrame: o = new System.Windows.Media.Animation.SplinePoint3DKeyFrame();   break;
                case KnownElements.SplinePointKeyFrame: o = new System.Windows.Media.Animation.SplinePointKeyFrame();   break; 
                case KnownElements.SplineQuaternionKeyFrame: o = new System.Windows.Media.Animation.SplineQuaternionKeyFrame();   break; 
                case KnownElements.SplineRectKeyFrame: o = new System.Windows.Media.Animation.SplineRectKeyFrame();   break;
                case KnownElements.SplineRotation3DKeyFrame: o = new System.Windows.Media.Animation.SplineRotation3DKeyFrame();   break; 
                case KnownElements.SplineSingleKeyFrame: o = new System.Windows.Media.Animation.SplineSingleKeyFrame();   break;
                case KnownElements.SplineSizeKeyFrame: o = new System.Windows.Media.Animation.SplineSizeKeyFrame();   break;
                case KnownElements.SplineThicknessKeyFrame: o = new System.Windows.Media.Animation.SplineThicknessKeyFrame();   break;
                case KnownElements.SplineVector3DKeyFrame: o = new System.Windows.Media.Animation.SplineVector3DKeyFrame();   break; 
                case KnownElements.SplineVectorKeyFrame: o = new System.Windows.Media.Animation.SplineVectorKeyFrame();   break;
                case KnownElements.SpotLight: o = new System.Windows.Media.Media3D.SpotLight();   break; 
                case KnownElements.StackPanel: o = new System.Windows.Controls.StackPanel();   break; 
                case KnownElements.StaticExtension: o = new System.Windows.Markup.StaticExtension();   break;
                case KnownElements.StaticResourceExtension: o = new System.Windows.StaticResourceExtension();   break; 
                case KnownElements.StatusBar: o = new System.Windows.Controls.Primitives.StatusBar();   break;
                case KnownElements.StatusBarItem: o = new System.Windows.Controls.Primitives.StatusBarItem();   break;
                case KnownElements.StopStoryboard: o = new System.Windows.Media.Animation.StopStoryboard();   break;
                case KnownElements.Storyboard: o = new System.Windows.Media.Animation.Storyboard();   break; 
                case KnownElements.StreamGeometry: o = new System.Windows.Media.StreamGeometry();   break;
                case KnownElements.StreamResourceInfo: o = new System.Windows.Resources.StreamResourceInfo();   break; 
                case KnownElements.StringAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.StringAnimationUsingKeyFrames();   break; 
                case KnownElements.StringConverter: o = new System.ComponentModel.StringConverter();   break;
                case KnownElements.StringKeyFrameCollection: o = new System.Windows.Media.Animation.StringKeyFrameCollection();   break; 
                case KnownElements.StrokeCollection: o = new System.Windows.Ink.StrokeCollection();   break;
                case KnownElements.StrokeCollectionConverter: o = new System.Windows.StrokeCollectionConverter();   break;
                case KnownElements.Style: o = new System.Windows.Style();   break;
                case KnownElements.TabControl: o = new System.Windows.Controls.TabControl();   break; 
                case KnownElements.TabItem: o = new System.Windows.Controls.TabItem();   break;
                case KnownElements.TabPanel: o = new System.Windows.Controls.Primitives.TabPanel();   break; 
                case KnownElements.Table: o = new System.Windows.Documents.Table();   break; 
                case KnownElements.TableCell: o = new System.Windows.Documents.TableCell();   break;
                case KnownElements.TableColumn: o = new System.Windows.Documents.TableColumn();   break; 
                case KnownElements.TableRow: o = new System.Windows.Documents.TableRow();   break;
                case KnownElements.TableRowGroup: o = new System.Windows.Documents.TableRowGroup();   break;
                case KnownElements.TemplateBindingExpressionConverter: o = new System.Windows.TemplateBindingExpressionConverter();   break;
                case KnownElements.TemplateBindingExtension: o = new System.Windows.TemplateBindingExtension();   break; 
                case KnownElements.TemplateBindingExtensionConverter: o = new System.Windows.TemplateBindingExtensionConverter();   break;
                case KnownElements.TemplateKeyConverter: o = new System.Windows.Markup.TemplateKeyConverter();   break; 
                case KnownElements.TextBlock: o = new System.Windows.Controls.TextBlock();   break; 
                case KnownElements.TextBox: o = new System.Windows.Controls.TextBox();   break;
                case KnownElements.TextDecoration: o = new System.Windows.TextDecoration();   break; 
                case KnownElements.TextDecorationCollection: o = new System.Windows.TextDecorationCollection();   break;
                case KnownElements.TextDecorationCollectionConverter: o = new System.Windows.TextDecorationCollectionConverter();   break;
                case KnownElements.TextEffect: o = new System.Windows.Media.TextEffect();   break;
                case KnownElements.TextEffectCollection: o = new System.Windows.Media.TextEffectCollection();   break; 
                case KnownElements.ThemeDictionaryExtension: o = new System.Windows.ThemeDictionaryExtension();   break;
                case KnownElements.Thickness: o = new System.Windows.Thickness();   break; 
                case KnownElements.ThicknessAnimation: o = new System.Windows.Media.Animation.ThicknessAnimation();   break; 
                case KnownElements.ThicknessAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.ThicknessAnimationUsingKeyFrames();   break;
                case KnownElements.ThicknessConverter: o = new System.Windows.ThicknessConverter();   break; 
                case KnownElements.ThicknessKeyFrameCollection: o = new System.Windows.Media.Animation.ThicknessKeyFrameCollection();   break;
                case KnownElements.Thumb: o = new System.Windows.Controls.Primitives.Thumb();   break;
                case KnownElements.TickBar: o = new System.Windows.Controls.Primitives.TickBar();   break;
                case KnownElements.TiffBitmapEncoder: o = new System.Windows.Media.Imaging.TiffBitmapEncoder();   break; 
                case KnownElements.TimeSpanConverter: o = new System.ComponentModel.TimeSpanConverter();   break;
                case KnownElements.TimelineCollection: o = new System.Windows.Media.Animation.TimelineCollection();   break; 
                case KnownElements.ToggleButton: o = new System.Windows.Controls.Primitives.ToggleButton();   break; 
                case KnownElements.ToolBar: o = new System.Windows.Controls.ToolBar();   break;
                case KnownElements.ToolBarOverflowPanel: o = new System.Windows.Controls.Primitives.ToolBarOverflowPanel();   break; 
                case KnownElements.ToolBarPanel: o = new System.Windows.Controls.Primitives.ToolBarPanel();   break;
                case KnownElements.ToolBarTray: o = new System.Windows.Controls.ToolBarTray();   break;
                case KnownElements.ToolTip: o = new System.Windows.Controls.ToolTip();   break;
                case KnownElements.Track: o = new System.Windows.Controls.Primitives.Track();   break; 
                case KnownElements.Transform3DCollection: o = new System.Windows.Media.Media3D.Transform3DCollection();   break;
                case KnownElements.Transform3DGroup: o = new System.Windows.Media.Media3D.Transform3DGroup();   break; 
                case KnownElements.TransformCollection: o = new System.Windows.Media.TransformCollection();   break; 
                case KnownElements.TransformConverter: o = new System.Windows.Media.TransformConverter();   break;
                case KnownElements.TransformGroup: o = new System.Windows.Media.TransformGroup();   break; 
                case KnownElements.TransformedBitmap: o = new System.Windows.Media.Imaging.TransformedBitmap();   break;
                case KnownElements.TranslateTransform: o = new System.Windows.Media.TranslateTransform();   break;
                case KnownElements.TranslateTransform3D: o = new System.Windows.Media.Media3D.TranslateTransform3D();   break;
                case KnownElements.TreeView: o = new System.Windows.Controls.TreeView();   break; 
                case KnownElements.TreeViewItem: o = new System.Windows.Controls.TreeViewItem();   break;
                case KnownElements.Trigger: o = new System.Windows.Trigger();   break; 
                case KnownElements.TypeExtension: o = new System.Windows.Markup.TypeExtension();   break; 
                case KnownElements.TypeTypeConverter: o = new System.Windows.Markup.TypeTypeConverter();   break;
                case KnownElements.UIElement: o = new System.Windows.UIElement();   break; 
                case KnownElements.UInt16Converter: o = new System.ComponentModel.UInt16Converter();   break;
                case KnownElements.UInt32Converter: o = new System.ComponentModel.UInt32Converter();   break;
                case KnownElements.UInt64Converter: o = new System.ComponentModel.UInt64Converter();   break;
                case KnownElements.UShortIListConverter: o = new System.Windows.Media.Converters.UShortIListConverter();   break; 
                case KnownElements.Underline: o = new System.Windows.Documents.Underline();   break;
                case KnownElements.UniformGrid: o = new System.Windows.Controls.Primitives.UniformGrid();   break; 
                case KnownElements.UriTypeConverter: o = new System.UriTypeConverter();   break; 
                case KnownElements.UserControl: o = new System.Windows.Controls.UserControl();   break;
                case KnownElements.Vector: o = new System.Windows.Vector();   break; 
                case KnownElements.Vector3D: o = new System.Windows.Media.Media3D.Vector3D();   break;
                case KnownElements.Vector3DAnimation: o = new System.Windows.Media.Animation.Vector3DAnimation();   break;
                case KnownElements.Vector3DAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.Vector3DAnimationUsingKeyFrames();   break;
                case KnownElements.Vector3DCollection: o = new System.Windows.Media.Media3D.Vector3DCollection();   break; 
                case KnownElements.Vector3DCollectionConverter: o = new System.Windows.Media.Media3D.Vector3DCollectionConverter();   break;
                case KnownElements.Vector3DConverter: o = new System.Windows.Media.Media3D.Vector3DConverter();   break; 
                case KnownElements.Vector3DKeyFrameCollection: o = new System.Windows.Media.Animation.Vector3DKeyFrameCollection();   break; 
                case KnownElements.VectorAnimation: o = new System.Windows.Media.Animation.VectorAnimation();   break;
                case KnownElements.VectorAnimationUsingKeyFrames: o = new System.Windows.Media.Animation.VectorAnimationUsingKeyFrames();   break; 
                case KnownElements.VectorCollection: o = new System.Windows.Media.VectorCollection();   break;
                case KnownElements.VectorCollectionConverter: o = new System.Windows.Media.VectorCollectionConverter();   break;
                case KnownElements.VectorConverter: o = new System.Windows.VectorConverter();   break;
                case KnownElements.VectorKeyFrameCollection: o = new System.Windows.Media.Animation.VectorKeyFrameCollection();   break; 
                case KnownElements.VideoDrawing: o = new System.Windows.Media.VideoDrawing();   break;
                case KnownElements.Viewbox: o = new System.Windows.Controls.Viewbox();   break; 
                case KnownElements.Viewport3D: o = new System.Windows.Controls.Viewport3D();   break; 
                case KnownElements.Viewport3DVisual: o = new System.Windows.Media.Media3D.Viewport3DVisual();   break;
                case KnownElements.VirtualizingStackPanel: o = new System.Windows.Controls.VirtualizingStackPanel();   break; 
                case KnownElements.VisualBrush: o = new System.Windows.Media.VisualBrush();   break;
                case KnownElements.Window: o = new System.Windows.Window();   break;
                case KnownElements.WmpBitmapEncoder: o = new System.Windows.Media.Imaging.WmpBitmapEncoder();   break;
                case KnownElements.WrapPanel: o = new System.Windows.Controls.WrapPanel();   break; 
                case KnownElements.XamlBrushSerializer: o = new System.Windows.Markup.XamlBrushSerializer();   break;
                case KnownElements.XamlInt32CollectionSerializer: o = new System.Windows.Markup.XamlInt32CollectionSerializer();   break; 
                case KnownElements.XamlPathDataSerializer: o = new System.Windows.Markup.XamlPathDataSerializer();   break; 
                case KnownElements.XamlPoint3DCollectionSerializer: o = new System.Windows.Markup.XamlPoint3DCollectionSerializer();   break;
                case KnownElements.XamlPointCollectionSerializer: o = new System.Windows.Markup.XamlPointCollectionSerializer();   break; 
                case KnownElements.XamlStyleSerializer: o = new System.Windows.Markup.XamlStyleSerializer();   break;
                case KnownElements.XamlTemplateSerializer: o = new System.Windows.Markup.XamlTemplateSerializer();   break;
                case KnownElements.XamlVector3DCollectionSerializer: o = new System.Windows.Markup.XamlVector3DCollectionSerializer();   break;
                case KnownElements.XmlDataProvider: o = new System.Windows.Data.XmlDataProvider();   break; 
                case KnownElements.XmlLanguageConverter: o = new System.Windows.Markup.XmlLanguageConverter();   break;
                case KnownElements.XmlNamespaceMapping: o = new System.Windows.Data.XmlNamespaceMapping();   break; 
                case KnownElements.ZoomPercentageConverter: o = new System.Windows.Documents.ZoomPercentageConverter();   break; 
            }
            return o; 
        }
예제 #2
0
        private static void RenderTile(WriteableBitmap bitmap, ITileSchema schema, IViewport viewport, MemoryCache<Feature> memoryCache)
        {
            int level = BruTile.Utilities.GetNearestLevel(schema.Resolutions, viewport.Resolution);
            var tiles = schema.GetTilesInView(viewport.Extent.ToExtent(), level);

            foreach (TileInfo tile in tiles)
            {
                var p = NativeCache.Find(tile.Index);
                if (p != null)
                {
                    bitmap.Render(p, null);
                    continue;
                }

                var image = memoryCache.Find(tile.Index);

                if (image != null)
                {
                    Rect dest = WorldToView(tile.Extent, viewport);
                    dest = GeometryRenderer.RoundToPixel(dest);

                    //See here the clumsy way to write a bitmap in SL/WPF
                    var path = new System.Windows.Shapes.Path();
                    path.Data = new RectangleGeometry { Rect = dest };
                    var bitmapImage = new BitmapImage();
                    bitmapImage.SetSource(((IRaster)image.Geometry).Data);
                    path.Fill = new ImageBrush { ImageSource = bitmapImage };
                    path.CacheMode = new BitmapCache();
                    bitmap.Render(path, null);
                }
            }
        }
예제 #3
0
 public static System.Windows.Controls.MenuItem CreateMenuItem(string header, string path, SolidColorBrush fill = null)
 {
     var mi = new System.Windows.Controls.MenuItem();
     var sp = new StackPanel {Orientation = Orientation.Horizontal};
     var vb = new Viewbox {Width = 15, Height = 15, VerticalAlignment = VerticalAlignment.Center, Margin = new Thickness(8), Opacity = 0.8};
     if (fill == null) fill = Brushes.Black;
     var p = new System.Windows.Shapes.Path {Fill = fill, Data = Geometry.Parse(path)};
     vb.Child = p;
    
     sp.Children.Add(vb);
     sp.Children.Add(new TextBlock {FontFamily = Font, FontSize = FontSize, Text = header, Foreground = Brushes.Black});
     mi.Header = sp;
    // { Header = header, Tag = header, FontFamily = new FontFamily("Segoe360"), FontSize = 20 };
     return mi;
 }
        public RubberbandAdorner(UIElement adornedElement)
            : base(adornedElement)
        {
            this.adornedElement = adornedElement;
            selectRect = new Rect();

            Rubberband = new System.Windows.Shapes.Path();

            geometry = new RectangleGeometry();

            Rubberband.Data = geometry;
            Rubberband.StrokeThickness = 2;
            Rubberband.Stroke = Brushes.Yellow;
            Rubberband.Opacity = .6;
            Rubberband.Visibility = Visibility.Hidden;

            AddVisualChild(Rubberband);
            MouseMove += new MouseEventHandler(DrawSelection);
            MouseUp += new MouseButtonEventHandler(EndSelection);
        }
        //Mouse Up Event - Stop Painting
        private void StopPaint(object sender, MouseButtonEventArgs e)
        {
            using (Graphics g = Graphics.FromImage(_screenshot)) {
                System.Drawing.Pen pen = new System.Drawing.Pen(System.Drawing.Brushes.Red, 4);
                System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath();

                PolyLineSegment pls =
                    (PolyLineSegment)((PathGeometry)_currentPath.Data).Figures.Last().Segments.Last();

                PointF[] points = new PointF[pls.Points.Count];
                for (int i = 0; i < pls.Points.Count; i++)
                {
                    points[i] = new PointF((float)pls.Points[i].X, (float)pls.Points[i].Y);
                }
                path.AddPolygon(points);

                g.DrawPath(pen, path);
            }

            _currentPath = null;
        }
        //Mouse Down Event - Begin Painting
        private void BeginPaint(object sender, MouseButtonEventArgs e)
        {
            if (e.ButtonState == MouseButtonState.Pressed)
            {
                _currentPath = new Path {
                    Data = new PathGeometry {
                        Figures =
                        {
                            new PathFigure {
                                StartPoint = e.GetPosition(null),
                                Segments   = { new PolyLineSegment() }
                            }
                        }
                    },
                    Stroke          = new SolidColorBrush(Colors.Red),
                    StrokeThickness = 4
                };

                PaintSurface.Children.Add(_currentPath);
            }
        }
예제 #7
0
        public static System.Windows.Shapes.Path CreateLineStringPath(VectorStyle style)
        {
            var path = new System.Windows.Shapes.Path {
                Opacity = style.Opacity
            };

            if (style.Outline != null)
            {
                //todo: render an outline around the line.
            }
            path.Stroke          = new SolidColorBrush(style.Line.Color.ToXaml());
            path.StrokeDashArray = style.Line.PenStyle.ToXaml();
            var penStrokeCap = style.Line.PenStrokeCap.ToXaml();

            path.StrokeEndLineCap   = penStrokeCap;
            path.StrokeStartLineCap = penStrokeCap;
            // To make similar to skia: path.StrokeLineJoin = PenLineJoin.Round;
            path.Tag = style.Line.Width; // see #linewidthhack
            path.IsHitTestVisible = false;
            return(path);
        }
예제 #8
0
        public static System.Windows.Shapes.Path CreatePolygonPath(VectorStyle style, double resolution, SymbolCache symbolCache, float rotate = 0f)
        {
            var path = new System.Windows.Shapes.Path {
                Opacity = style.Opacity
            };

            if (style.Outline != null)
            {
                path.Stroke           = new System.Windows.Media.SolidColorBrush(style.Outline.Color.ToXaml());
                path.StrokeThickness  = style.Outline.Width * resolution;
                path.StrokeDashArray  = style.Outline.PenStyle.ToXaml(style.Outline.DashArray);
                path.StrokeDashOffset = style.Outline.DashOffset;
                path.StrokeLineJoin   = style.Outline.StrokeJoin.ToXaml();
                path.StrokeMiterLimit = style.Outline.StrokeMiterLimit;
                path.Tag = style.Outline.Width; // see #linewidthhack
            }

            path.Fill             = style.Fill.ToXaml(symbolCache, rotate);
            path.IsHitTestVisible = false;
            return(path);
        }
예제 #9
0
        /*Draw Spline*/
        public static void DrawSpline(Spline xLine, Canvas mainCanvas)
        {
            System.Windows.Shapes.Path wPath = new System.Windows.Shapes.Path();


            /*List<PolyQuadraticBezierSegment> segments = new List<PolyQuadraticBezierSegment>(1);
             * PolyQuadraticBezierSegment segment = new PolyQuadraticBezierSegment();
             */
            List <PolyBezierSegment> segments = new List <PolyBezierSegment>();
            PolyBezierSegment        segment  = new PolyBezierSegment();

            int i = 0;

            foreach (netDxf.Entities.SplineVertex spVertex in xLine.ControlPoints)
            {
                if (i > 0)
                {
                    segment.Points.Add(TypeConverter.Vertex3ToPoint(spVertex.Position, mainCanvas.Height));
                }
                /*DrawUtils.DrawPoint(spVertex.Position,i.ToString(),mainCanvas,Colors.Red,5,0.5);*/
                i++;
            }
            segments.Add(segment);
            List <PathFigure> figures = new List <PathFigure>();

            System.Windows.Point p0 = TypeConverter.Vertex3ToPoint(xLine.ControlPoints[0].Position, mainCanvas.Height);

            /*System.Windows.Point p0 = new System.Windows.Point(710,mainCanvas.Height+100);*/
            PathFigure pf = new PathFigure(p0, segments, true);

            pf.IsClosed = false;
            figures.Add(pf);

            Geometry g = new PathGeometry(figures, FillRule.EvenOdd, null);

            wPath.Data = g;

            TypeConverter.Entity2Shape(xLine, wPath);
            mainCanvas.Children.Add(wPath);
        }
        private void ImportButton_Click(object sender, RoutedEventArgs e)
        {
            var importdlg = new Microsoft.Win32.OpenFileDialog
            {
                DefaultExt  = "GameSave*.isgsf",
                Filter      = "Immortal Sins GameSave File|GameSave*.isgsf|Immortal Sins Save Archive v2|*.isarc2",
                Title       = "Select the files/archive to import.",
                Multiselect = true
            };

            var importresult = importdlg.ShowDialog();

            if (importresult != true)
            {
                return;
            }
            try
            {
                if (Path.GetExtension(importdlg.SafeFileName) == ".isarc2")
                {
                    if (!Directory.Exists(CommonVariables.SaveLocation))
                    {
                        Directory.CreateDirectory(CommonVariables.SaveLocation);
                    }
                    IoController.ArchiveCodec(true, importdlg.FileName, CommonVariables.SaveLocation);
                }
                else

                {
                    CommonProcedures.ImportCode(importdlg.FileNames, ChangeSaveSlotCheckbox.IsEnabled,
                                                SlotSelector.Value);
                }
                CommonVariables.IsSaveAvailable = CommonProcedures.GetFolderSaves();
                MessageBox.Show(Resources.ImportSavesComplete, Resources.CommonWordsFinish, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception)
            {
                MessageBox.Show(Resources.ImportSavesFailedString, Resources.CommonWordsError, MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #11
0
 public WindowMinimizeButton(BlendWindow window1)
 {
     window = window1;
     p      = new Path
     {
         Data                  = Geometry.Parse("M0,0 L8,0 8,1 8,2 0,2 0,1 z"),
         Fill                  = window.TitleBarButtonForeground,
         Stroke                = window.TitleBarButtonBorder,
         StrokeThickness       = 1,
         RenderTransformOrigin = new Point(0.5, 0.5),
         LayoutTransform       = new ScaleTransform(1, 1),
         Stretch               = Stretch.Fill,
         VerticalAlignment     = VerticalAlignment.Bottom,
         Width                 = 15,
         Height                = 3,
         Margin                = new Thickness(3)
     };
     Content         = p;
     ContentDisabled = p;
     CornerRadius    = new CornerRadius(3, 0, 0, 3);
     Enable();
 }
예제 #12
0
파일: VEdge.cs 프로젝트: KOpenMOS/Mos
        void SetPathStrokeToRailPath(Rail rail, WPath path, byte transparency)
        {
            path.Stroke          = SetStrokeColorForRail(transparency, rail);
            path.StrokeThickness = PathStrokeThickness;

            foreach (var style in Edge.Attr.Styles)
            {
                if (style == Drawing.Style.Dotted)
                {
                    path.StrokeDashArray = new WDoubleCollection {
                        1, 1
                    };
                }
                else if (style == Drawing.Style.Dashed)
                {
                    var f = DashSize();
                    path.StrokeDashArray = new WDoubleCollection {
                        f, f
                    };
                }
            }
        }
예제 #13
0
        private void AddCirclesTest(List <System.Windows.Point> points)
        {
            System.Windows.Shapes.Path path = new System.Windows.Shapes.Path();
            GeometryGroup GeoGroup          = new GeometryGroup();

            var             c      = FittingCircle(points);
            EllipseGeometry circle = new EllipseGeometry(new System.Windows.Point(c.X, c.Y), c.R, c.R);

            GeoGroup.Children.Add(circle);

            path.Stroke = new SolidColorBrush(System.Windows.Media.Colors.White);

            path.Data                 = GeoGroup;
            path.Tag                  = "tu";
            path.StrokeThickness      = 2;
            path.MouseLeftButtonDown += (o, s) =>
            {
                CalculateIntersection(path);
            };

            MyCanvas.Children.Add(path);
        }
예제 #14
0
파일: VEdge.cs 프로젝트: KOpenMOS/Mos
        void SetPathStrokeToPath(WPath path)
        {
            path.Stroke          = Common.BrushFromMsaglColor(Edge.Attr.Color);
            path.StrokeThickness = PathStrokeThickness;

            foreach (var style in Edge.Attr.Styles)
            {
                if (style == Drawing.Style.Dotted)
                {
                    path.StrokeDashArray = new WDoubleCollection {
                        1, 1
                    };
                }
                else if (style == Drawing.Style.Dashed)
                {
                    var f = DashSize();
                    path.StrokeDashArray = new WDoubleCollection {
                        f, f
                    };
                }
            }
        }
예제 #15
0
        private static System.Windows.Shapes.Path GetRandomPath(int maxWidth, int maxHeight)
        {
            var pathFigure = new PathFigure {
                StartPoint = new Point(Random.Next(0, maxWidth / 10), Random.Next(0, maxHeight))
            };
            var pointCollection = new PointCollection(9)
            {
                new Point(Random.Next(maxWidth / 10, maxWidth * 2 / 10), Random.Next(0, maxHeight)),
                new Point(Random.Next(maxWidth * 2 / 10, maxWidth * 3 / 10), Random.Next(0, maxHeight)),
                new Point(Random.Next(maxWidth * 3 / 10, maxWidth * 4 / 10), Random.Next(0, maxHeight)),
                new Point(Random.Next(maxWidth * 4 / 10, maxWidth * 5 / 10), Random.Next(0, maxHeight)),
                new Point(Random.Next(maxWidth * 5 / 10, maxWidth * 6 / 10), Random.Next(0, maxHeight)),
                new Point(Random.Next(maxWidth * 6 / 10, maxWidth * 7 / 10), Random.Next(0, maxHeight)),
                new Point(Random.Next(maxWidth * 7 / 10, maxWidth * 8 / 10), Random.Next(0, maxHeight)),
                new Point(Random.Next(maxWidth * 8 / 10, maxWidth * 9 / 10), Random.Next(0, maxHeight)),
                new Point(Random.Next(maxWidth * 9 / 10, maxWidth), Random.Next(0, maxHeight))
            };

            var bezierSegment = new PolyBezierSegment {
                Points = pointCollection
            };
            var pathSegmentCollection = new PathSegmentCollection {
                bezierSegment
            };

            pathFigure.Segments = pathSegmentCollection;
            var pathFigureCollection = new PathFigureCollection {
                pathFigure
            };
            var pathGeometry = new PathGeometry {
                Figures = pathFigureCollection
            };
            var path = new System.Windows.Shapes.Path {
                Stroke = Brushes.Black, StrokeThickness = 1, Data = pathGeometry
            };

            return(path);
        }
예제 #16
0
        public static System.Windows.Shapes.Path DrawPath(Contour contour)
        {
            System.Windows.Shapes.Path path = new Path();
            path.Stroke          = Brushes.Red;
            path.StrokeThickness = 1;            //path.Fill = Brushes.Black;

            var group = new PathGeometry();

            path.Data = group;

            var polygon = new PathFigure();

            polygon.StartPoint = contour.Pts.First().ToPoint();
            polygon.IsClosed   = true;
            //polygon.IsFilled = true;
            var seg = new PolyLineSegment(contour.Pts.Skip(1).Select(v => v.ToPoint()).ToList(), true);

            polygon.Segments.Add(seg);

            group.Figures.Add(polygon);

            return(path);
        }
예제 #17
0
        private void DisplayShape(System.Windows.Shapes.Path shape, ISvgElement element, bool applyStyle = true)
        {
            if (currentCanvas == null)
            {
                return;
            }

            if (applyStyle)
            {
                var style = CreateStyle(shape, element as SvgStyleableElement);
                if (style != null)
                {
                    shape.Style = style;
                }
            }
            Geometry geom = shape.Data;

            if (geom != null && geom.CanFreeze && !geom.IsFrozen)
            {
                geom.Freeze();
            }
            currentCanvas.Children.Add(shape);
        }
예제 #18
0
        private void SelectionDraw(object sender, System.Windows.Input.MouseEventArgs e)
        {
            if (isDragging)
            {
                Point currentPosition = e.GetPosition(ImageCanvas);

                if (newSelection)
                {
                    ImageCanvas.Children.Add(new Path
                    {
                        Data            = new RectangleGeometry(new Rect(startPosition, currentPosition)),
                        Stroke          = System.Windows.Media.Brushes.Red,
                        StrokeThickness = 1
                    });
                    newSelection = false;
                }
                else
                {
                    Path selection = ImageCanvas.Children.OfType <Path>().Last();
                    selection.Data = new RectangleGeometry(new Rect(startPosition, currentPosition));
                }
            }
        }
예제 #19
0
        /// <summary>
        /// プログレスバーに値を設定
        /// </summary>
        /// <param name="element"></param>
        /// <param name="value">設定値</param>
        /// <param name="isFront">前景(true)/背景(false)</param>
        public static void SetValue(ref System.Windows.Shapes.Path element,
                                    Double value, Boolean isFront)
        {
            Double thick      = element.StrokeThickness / 2.0;
            Double inputValue = Math.Floor(value);
            // 100% ~ 0% の値を360°の何度にあたるか計算
            Double angle = CalcAngle(inputValue);

            // 始点 設定
            var fig = new PathFigure()
            {
                StartPoint = new Point((element.Width / 2.0), thick)
            };

            // 角度と半径から座標を計算
            Double radius   = (element.Width / 2.0) - thick; // 半径
            var    endPoint = CalcEndPint(angle, radius);    // 描画の終点作成

            // 180°を超える(180を含む)場合はフラグをtrue
            Boolean isLargeArcFlg = angle >= STRAIGHT_ANGLE;

            // セグメント生成
            var seg = new ArcSegment()
            {   // 終点は線の太さの修正を入れる
                Point          = new Point(endPoint.X + thick, endPoint.Y + thick),
                Size           = new Size(radius, radius),
                IsLargeArc     = isFront ? isLargeArcFlg : !isLargeArcFlg,
                SweepDirection = isFront ? SweepDirection.Clockwise
                                         : SweepDirection.Counterclockwise,
                RotationAngle = 0
            };

            // Data Set
            fig.Segments.Clear();
            fig.Segments.Add(seg);
            element.Data = new PathGeometry(new PathFigure[] { fig });
        }
예제 #20
0
        private void CreateBarcodeBorder(double width, double height, Color?borderColor = null, Brush backBrush = null)
        {
            if (_vufBarcodeBorder == null)
            {
                _vufBarcodeBorder        = new Border();
                _vufBarcodeBorder.Width  = width;
                _vufBarcodeBorder.Height = height;

                Deployment.Current.Dispatcher.CheckAccess();

                Canvas canvas = new Canvas();
                _vufBarcodeBorder.Child = canvas;

                canvas.HorizontalAlignment = HorizontalAlignment.Left;
                canvas.VerticalAlignment   = VerticalAlignment.Top;

                System.Windows.Shapes.Path path = new System.Windows.Shapes.Path();
                path.StrokeThickness = 4;
                canvas.Children.Add(path);

                if (borderColor == null)
                {
                    borderColor = Colors.White;
                }
                path.Stroke = new SolidColorBrush(borderColor.Value);
                path.Fill   = backBrush;

                PathGeometry pg = new PathGeometry();
                _vufBarcodePolyLine = new PolyLineSegment();
                _vufBarcodePath     = new PathFigure();
                path.Data           = pg;
                pg.Figures.Add(_vufBarcodePath);
                _vufBarcodePath.Segments.Add(_vufBarcodePolyLine);
                _vufBarcodePath.IsClosed = true;
            }
        }
예제 #21
0
        System.Windows.Shapes.Path GetPath(Size size)
        {
            BitmapImage image = new BitmapImage(new Uri(InlineImageViewModel.ImageSource, UriKind.RelativeOrAbsolute));

            image.BaseUri = BaseUriHelper.GetBaseUri(this);
            ImageBrush brush = new ImageBrush()
            {
                ImageSource = image
            };

            System.Windows.Shapes.Path path = new System.Windows.Shapes.Path();
            path.Fill            = brush;
            path.Stroke          = new SolidColorBrush(InlineImageViewModel.Color);
            path.StrokeThickness = InlineImageViewModel.HasBorder ? InlineImageViewModel.BorderWeight : 0;
            path.Stretch         = Stretch.Uniform;
            path.Width           = size.Width;
            path.Height          = size.Height;
            PathData             = Shapes[InlineImageViewModel.ShapeType];
            path.SetBinding(System.Windows.Shapes.Path.DataProperty, new Binding("PathData")
            {
                Source = this, Mode = BindingMode.OneWay
            });
            return(path);
        }
예제 #22
0
        private static void RenderTile(WriteableBitmap bitmap, ITileSchema schema, IViewport viewport, MemoryCache <Feature> memoryCache)
        {
            int level = BruTile.Utilities.GetNearestLevel(schema.Resolutions, viewport.Resolution);
            var tiles = schema.GetTilesInView(viewport.Extent.ToExtent(), level);

            foreach (TileInfo tile in tiles)
            {
                var p = NativeCache.Find(tile.Index);
                if (p != null)
                {
                    bitmap.Render(p, null);
                    continue;
                }

                var image = memoryCache.Find(tile.Index);

                if (image != null)
                {
                    Rect dest = WorldToView(tile.Extent, viewport);
                    dest = GeometryRenderer.RoundToPixel(dest);

                    //See here the clumsy way to write a bitmap in SL/WPF
                    var path = new System.Windows.Shapes.Path();
                    path.Data = new RectangleGeometry {
                        Rect = dest
                    };
                    var bitmapImage = new BitmapImage();
                    bitmapImage.SetSource(((IRaster)image.Geometry).Data);
                    path.Fill = new ImageBrush {
                        ImageSource = bitmapImage
                    };
                    path.CacheMode = new BitmapCache();
                    bitmap.Render(path, null);
                }
            }
        }
예제 #23
0
        public Connector()
        {
            Symbol              = new Path();
            ConnectionPath      = new Path();
            _symbolGeometry     = new PathGeometry();
            _connectionGeometry = new PathGeometry();

            Symbol.SnapsToDevicePixels = true;
            Symbol.Stroke             = _unselectedColor;
            Symbol.StrokeThickness    = ConnectionLine.StrokeThickness;
            Symbol.Fill               = _unselectedColor;
            Symbol.StrokeEndLineCap   = PenLineCap.Round;
            Symbol.StrokeStartLineCap = PenLineCap.Round;
            Symbol.StrokeDashCap      = PenLineCap.Round;
            Symbol.Data               = _symbolGeometry;

            ConnectionPath.SnapsToDevicePixels = true;
            ConnectionPath.Stroke             = _unselectedColor;
            ConnectionPath.StrokeThickness    = ConnectionLine.StrokeThickness;
            ConnectionPath.StrokeEndLineCap   = PenLineCap.Round;
            ConnectionPath.StrokeStartLineCap = PenLineCap.Round;
            ConnectionPath.StrokeDashCap      = PenLineCap.Round;
            ConnectionPath.Data = _connectionGeometry;

            Symbol.CacheMode = new BitmapCache()
            {
                RenderAtScale = 1, EnableClearType = true, SnapsToDevicePixels = true
            };
            ConnectionPath.CacheMode = new BitmapCache()
            {
                RenderAtScale = 1, EnableClearType = true, SnapsToDevicePixels = true
            };

            Symbol.PreviewMouseLeftButtonDown         += SymbolOnPreviewMouseLeftButtonDown;
            ConnectionPath.PreviewMouseLeftButtonDown += SymbolOnPreviewMouseLeftButtonDown;
        }
예제 #24
0
        private void CalculateIntersection(System.Windows.Shapes.Path path)
        {
            path.Stroke = new SolidColorBrush(System.Windows.Media.Colors.Yellow);
            if (path.Tag.ToString() == "line")
            {
                LineGeometry line = (LineGeometry)(((GeometryGroup)path.Data).Children[0]);

                double dx = line.StartPoint.X - line.EndPoint.X;
                double k  = 0;
                double b  = 0;

                if (dx != 0)
                {
                    k = (line.StartPoint.Y - line.EndPoint.Y) / (line.StartPoint.X - line.EndPoint.X);
                    b = line.StartPoint.Y - line.StartPoint.X;
                }
                else
                {
                    k = 1000;
                    b = 1000;
                }
                //line1.Text = string.Format("{0},{1}", k.ToString(), b.ToString());
            }
        }
예제 #25
0
        public static System.Windows.Shapes.Shape RenderPolygon(Polygon polygon, IStyle style, IReadOnlyViewport viewport, SymbolCache symbolCache)
        {
            if (!(style is VectorStyle))
            {
                throw new ArgumentException("Style is not of type VectorStyle");
            }
            var vectorStyle = style as VectorStyle;

            System.Windows.Shapes.Path path = CreatePolygonPath(vectorStyle, viewport.Resolution, symbolCache, (float)viewport.Rotation);
            path.Data = polygon.ToXaml();

            var matrixTransform = new System.Windows.Media.MatrixTransform {
                Matrix = GeometryRenderer.CreateTransformMatrix(viewport)
            };

            path.RenderTransform = matrixTransform;

            if (path.Fill != null)
            {
                path.Fill.Transform = matrixTransform.Inverse as System.Windows.Media.MatrixTransform;
            }
            path.UseLayoutRounding = true;
            return(path);
        }
예제 #26
0
 public ConnectionLine()
 {
     path                 = new System.Windows.Shapes.Path();
     path.Stroke          = Brushes.Black;
     path.StrokeThickness = 2.5;
 }
예제 #27
0
 private void DrawShipFiringBeam(System.Drawing.Point sourceLoc, System.Drawing.Point targetLoc)
 {
     try
     {
         using (RNG rng = new RNG())
         {
             try
             {
                 // random origin and target (to offset beams)
                 Point origin = new Point(((sourceLoc.Y + 1) * 32) - (8 + rng.d(16)), ((sourceLoc.X + 1) * 32) + (rng.d(16)));
                 Point target = new Point(((targetLoc.Y + 1) * 32) - (8 + rng.d(16)), ((targetLoc.X + 1) * 32) + (rng.d(16)));
                 System.Windows.Shapes.Path beam = new System.Windows.Shapes.Path();
                 beam.Stroke = Brushes.Red;
                 beam.StrokeThickness = 1;
                 Point from = TransformToVisual(c).Transform(origin);
                 Point to = TransformToVisual(c).Transform(target);
                 beam.Data = new LineGeometry(from, to);
                 // add and remove actions
                 Action<System.Windows.Shapes.Path> addWeaponAction = new Action<System.Windows.Shapes.Path>(addWeaponPath);
                 Action<System.Windows.Shapes.Path> removeWeaponAction = new Action<System.Windows.Shapes.Path>(removeWeaponPath);
                 // random firing delay, 300-600ms
                 int firingdelay = 100 + rng.d(100);
                 DisplayBeamFiring(addWeaponAction, removeWeaponAction, beam, firingdelay);
             }
             catch (Exception ex)
             {
                 if (LogEverything)
                     Logger(ex);
             }
         }
     }
     catch (Exception ex)
     {
         if (LogEverything)
             Logger(ex);
     }
 }
 public void DrawRubberLine(Point rubberEnd) {
     if (_rubberLinePath == null) {
         _rubberLinePath = new Path
         {
             Stroke = Brushes.Black,
             StrokeThickness = GetBorderPathThickness()*3
         };
         GraphCanvasChildrenAdd(_rubberLinePath);
         //                targetArrowheadPathForRubberLine = new Path {
         //                    Stroke = Brushes.Black,
         //                    StrokeThickness = GetBorderPathThickness()*3
         //                };
         //                graphCanvas.Children.Add(targetArrowheadPathForRubberLine);
     }
     _rubberLinePath.Data =
         GraphmapsEdge.GetICurveWpfGeometry(new LineSegment(_sourcePortLocationForEdgeRouting, rubberEnd));
 }
예제 #29
0
 internal static LineColor Select(this System.Windows.Shapes.Path start) =>
 Items.Where(t => Equals(t.Pair.Item1, start)).Select(t => t.Color).FirstOrDefault();
예제 #30
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (image2.Source == null)
            {
                System.Windows.Forms.MessageBox.Show("First select reference photo",
                                                                "Important Note",
                                                                MessageBoxButtons.OK,
                                                                MessageBoxIcon.Exclamation,
                                                                MessageBoxDefaultButton.Button1);
                return;
            }


            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Title = "Upload Image";
            openFileDialog.Filter = "All Images|*.BMP;*.DIB;*.RLE;*.JPG;*.JPEG;*.JPE;*.JFIF;*.GIF;*.TIF;*.TIFF;*.PNG";
            openFileDialog.FileName = string.Empty;
            openFileDialog.FilterIndex = 1;
            openFileDialog.RestoreDirectory = true;
            openFileDialog.DefaultExt = "jpg";
            DialogResult result = openFileDialog.ShowDialog();
            if (result == System.Windows.Forms.DialogResult.Cancel)
            {
                return;
            }
            String filepath = openFileDialog.FileName;

            BitmapImage bitmap = new BitmapImage();
            bitmap.BeginInit();
            bitmap.UriSource = new Uri(filepath);
            bitmap.DecodePixelHeight = (int)image1.Height;
            bitmap.DecodePixelWidth = (int)image1.Width;
            bitmap.EndInit();
            image1.Source = bitmap;


            PngBitmapEncoder pngE = new PngBitmapEncoder();
            pngE.Frames.Add(BitmapFrame.Create(bitmap));

            using (Stream stream = File.Create(System.Environment.CurrentDirectory + "temp.jpg"))
            {
                pngE.Save(stream);
            }
            DetectResult res = fs.Detection_DetectImg(System.Environment.CurrentDirectory + "temp.jpg");

            DetectResult resRef = fs.Detection_DetectImg("temp.jpg");

            canvas1.Children.Clear();
            label1.Content = "Centre :";
            label2.Content = "Size :";
            label3.Content = "Similarity :";
            for (int i = 0; i < res.face.Count; ++i)
            {
                CompareResult cmpRes = fs.Recognition_Compare(res.face[i].face_id, resRef.face.FirstOrDefault().face_id);
                RectangleGeometry rect = new RectangleGeometry();
                rect.Rect = new Rect(max(res.face[i].position.center.x * image1.Width / 100.0 - res.face[i].position.width * image1.Width / 200.0, 0),
                                     max(res.face[i].position.center.y * image1.Height / 100.0 - res.face[i].position.height * image1.Height / 200.0, 0),
                                     res.face[i].position.width * image1.Width / 100.0, res.face[i].position.height * image1.Height / 100.0);
                System.Windows.Shapes.Path myPath = new System.Windows.Shapes.Path();
                myPath.Stroke = Brushes.Red;
                myPath.StrokeThickness = 3;
                myPath.Data = rect;
                label1.Content = label1.Content + String.Format("({0:F2},{1:F2})", res.face[i].position.center.x, res.face[i].position.center.y);
                label2.Content = label2.Content + String.Format("({0:F2},{1:F2})", res.face[i].position.width, res.face[i].position.height);
                label3.Content = label3.Content + String.Format("{0:F2},", cmpRes.similarity);
                canvas1.Children.Add(myPath);
            }
        }
예제 #31
0
파일: Figure.cs 프로젝트: matryt-8/NPaint
 public Figure(Path adaptedPath)
 {
     this.adaptedPath = adaptedPath;
     PointsList       = new PointCollection();
 }
예제 #32
0
        public DisplayCircularSurface( SlopeCanvas canvas , Point enter , Point exit , double radius )
        {
            this.canvas = canvas;

            surface = new System.Windows.Shapes.Path();
            surface.Stroke = Brushes.Black;
            surface.StrokeThickness = 1;
            surface.Fill = Brushes.Transparent;
            surface.Opacity = 0.8;
            surface.StrokeDashArray.Add( 5 );
            surface.StrokeDashArray.Add( 5 );

            PathGeometry surfaceGeom = new PathGeometry();
            surfaceGeom.FillRule = FillRule.Nonzero;
            surface.Data = surfaceGeom;

            surfaceFigure = new PathFigure();
            surfaceFigure.StartPoint = enter;
            surfaceGeom.Figures.Add( surfaceFigure );

            surfaceArc = new ArcSegment();
            surfaceArc.Size = new Size( radius , radius );
            surfaceArc.Point = exit;
            surfaceArc.SweepDirection = SweepDirection.Counterclockwise;
            surfaceArc.IsLargeArc = false;
            surfaceFigure.Segments.Add( surfaceArc );

            canvas.Children.Add( surface );
        }
예제 #33
0
        private void Ellipse_Mouse_Right_Down(object sender, RoutedEventArgs e)
        {

            currElleipse = sender as System.Windows.Shapes.Path;
        }
예제 #34
0
        private void Add_Station_Ellipse_On_Field(object sender, RoutedEventArgs e)
        {
            if (on)
            {
                if (fieldCanvas.Children.Count > 0 && fieldCanvas.Children[fieldCanvas.Children.Count - 1] is Menu)
                {
                    //clear right click menu in field
                    fieldCanvas.Children.RemoveAt(fieldCanvas.Children.Count - 1);
                }

                if (SubwayLinesLBox.SelectedIndex != -1)
                {
                    double x = Mouse.GetPosition(fieldCanvas).X;
                    double y = Mouse.GetPosition(fieldCanvas).Y;

                    //if too near for window borders
                    if (x < 20 || y < 20 ||
                        x > (fieldCanvas.Width - 20) || y > (fieldCanvas.Height - 20))
                    { return; }

                    Point point = new Point(x, y);
                    foreach (Railway rl in subway.GetRailways)
                    {
                        foreach (Station st in rl.GetStations)
                        {
                            //if too near for 2 any station
                            if (Math.Sqrt((st.Coordinate.X - point.X) * (st.Coordinate.X - point.X) + (st.Coordinate.Y - point.Y) * (st.Coordinate.Y - point.Y)) < 40)
                            {
                                TooNearStationPP.IsOpen = true;
                                return;
                            }
                        }
                    }

                    foreach (Railway rl in subway.GetRailways)
                    {
                        //if too near for station and railway
                        if (rl.GetStations.Count > 1)
                        {
                            for (int i = 0; i < rl.GetStations.Count - 1; i++)
                            {
                                if (IntersectionCircleSegment
                                    (rl.GetStations.ElementAt(i).Coordinate.X, rl.GetStations.ElementAt(i).Coordinate.Y,
                                     rl.GetStations.ElementAt(i + 1).Coordinate.X, rl.GetStations.ElementAt(i + 1).Coordinate.Y,
                                     x, y, 30))
                                {
                                    TooNearPathPP.IsOpen = true;
                                    return;
                                }
                            }
                        }
                    }
                    foreach (Station st in subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations)
                    {
                        //if too near for 2 station at 1 railway
                        if (Math.Sqrt((st.Coordinate.X - point.X) * (st.Coordinate.X - point.X) +
                            (st.Coordinate.Y - point.Y) * (st.Coordinate.Y - point.Y)) < 120)
                        {
                            TooNearStationPP.IsOpen = true;
                            return;
                        }
                    }

                    foreach (Railway rl in subway.GetRailways)
                    {
                        int count = (subway.GetRailways.IndexOf(rl) == SubwayLinesLBox.SelectedIndex) ? rl.GetStations.Count - 1 : rl.GetStations.Count;
                        for (int i = 0; i < count; i++)
                        {
                            //if the railway crosses stations
                            if (subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count > 0)
                            {
                                if (IntersectionCircleSegment
                                           (subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                                     ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 1).Coordinate.X,
                                     subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                                     ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 1).Coordinate.Y,
                                           point.X, point.Y, rl.GetStations.ElementAt(i).Coordinate.X, rl.GetStations.ElementAt(i).Coordinate.Y, 30))
                                {
                                    CrossesStationPP.IsOpen = true;
                                    return;
                                }
                            }
                        }
                    }
                    AddStationWindow win = new AddStationWindow(this);
                    win.Owner = this;
                    win.ShowDialog();

                    if (DialogResultOk)
                    {
                        DialogResultOk = false;
                        //Paint railway and station
                        if (subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count > 1)
                        {
                            System.Windows.Shapes.Path linePath = new System.Windows.Shapes.Path();
                            linePath.Stroke = SwitchFillBrushes(SubwayLinesLBox.SelectedIndex);
                            linePath.StrokeThickness = 4;
                            linePath.HorizontalAlignment = HorizontalAlignment.Center;
                            linePath.VerticalAlignment = VerticalAlignment.Center;
                            List<Point> pointsList = new List<Point>();
                            pointsList.Add(point);
                            pointsList.Add(point);
                            pointsList.Add(point);
                            PathFigure lineFigure = new PathFigure();
                            Point ps = subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                              ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 2).Coordinate;
                            lineFigure.StartPoint = ps;
                            lineFigure.Segments.Add(new PolyBezierSegment(pointsList, true));
                            PathGeometry lineGeometry = new PathGeometry();
                            lineGeometry.Figures.Add(lineFigure);
                            linePath.Data = lineGeometry;
                            linePath.MouseLeftButtonDown += Line_Mouse_Left_Down;
                            linePath.MouseLeftButtonUp += Line_Mouse_Left_Up;
                            Canvas.SetZIndex(linePath, -1);
                            subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                           ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 2).startLinePath = linePath;
                            fieldCanvas.Children.Add(linePath);

                            linePath = new System.Windows.Shapes.Path();
                            lineFigure = new PathFigure();
                            pointsList = new List<Point>();
                            pointsList.Add(ps);
                            pointsList.Add(ps);
                            pointsList.Add(ps);
                            lineFigure.StartPoint = point;
                            lineFigure.Segments.Add(new PolyBezierSegment(pointsList, true));
                            lineGeometry = new PathGeometry();
                            lineGeometry.Figures.Add(lineFigure);
                            linePath.Data = lineGeometry;
                            subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                           ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 1).endLinePath = linePath;
                        }

                        System.Windows.Shapes.Path ellipsePath = new System.Windows.Shapes.Path();
                        ellipsePath.Stroke = Brushes.LightSlateGray;
                        ellipsePath.Fill = SwitchFillBrushes(SubwayLinesLBox.SelectedIndex);
                        ellipsePath.StrokeThickness = 2;
                        ellipsePath.HorizontalAlignment = HorizontalAlignment.Center;
                        ellipsePath.VerticalAlignment = VerticalAlignment.Center;
                        EllipseGeometry myEllipseGeometry = new EllipseGeometry();
                        myEllipseGeometry.Center = new Point(x, y);
                        myEllipseGeometry.RadiusX = 20;
                        myEllipseGeometry.RadiusY = 20;
                        ellipsePath.Data = myEllipseGeometry;
                        ellipsePath.MouseLeftButtonDown += Ellipse_Mouse_Left_Down;
                        ellipsePath.MouseLeftButtonUp += Ellipse_Mouse_Left_Up;
                        ellipsePath.MouseRightButtonDown += Ellipse_Mouse_Right_Down;
                        subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                            ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 1).ellipsePath = ellipsePath;

                        ContextMenu menu = new ContextMenu();
                        MenuItem delete = new MenuItem();
                        delete.Header = "Delete station";
                        menu.Items.Add(delete);
                        delete.Click += Delete_Station_Click;
                        MenuItem board = new MenuItem();
                        board.Header = "Open board";
                        menu.Items.Add(board);
                        board.Click += Open_Board_Click;
                        ellipsePath.ContextMenu = menu;

                        fieldCanvas.Children.Add(ellipsePath);
                        TextBlock stationName = new TextBlock();
                        stationName.FontFamily = new FontFamily("Impact");
                        stationName.FontWeight = FontWeights.Light;
                        stationName.Text = subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                            ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 1).stationName.Text;
                        subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                            ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 1).stationName = stationName;
                        stationName.Margin = new Thickness(x - 35, y - 35, x, y);
                        fieldCanvas.Children.Add(stationName);
                        Canvas.SetZIndex(stationName, 100);
                        //Added  station coordinates
                        subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.
                            ElementAt(subway.GetRailways.ElementAt(SubwayLinesLBox.SelectedIndex).GetStations.Count - 1).
                            Coordinate = new Point(x, y);
                    }
                }
            }
        }
예제 #35
0
 private void LoadAurora()
 {
    // LOAD the aurora header only when it's set (instead of removing it after)
    if (Style == Resources["MetroStyle"] && Settings.Default.StartupBanner && System.IO.File.Exists("AuroraHeader.xaml"))
    {
       try
       {
          System.Windows.FrameworkElement header;
          ErrorRecord error;
          var startup = new System.IO.FileInfo("AuroraHeader.xaml");
          if (startup.TryLoadXaml(out header, out error))
          {
             // Copy over *all* resources from the DOCUMENT to the BANNER
             // NOTE: be careful not to put resources in the document you're not willing to expose
             // NOTE: this will overwrite resources with matching keys, so banner-makers need to be aware
             foreach (string key in buffer.Document.Resources.Keys)
             {
                header.Resources[key] = buffer.Document.Resources[key];
             }
             var wrapperGrid = (Grid)Template.FindName("MetroWrapper", this);
             wrapperGrid.Children.Insert(0, header);
          }
          else
          {
             var geometry = new StreamGeometry();
             using (var ctx = geometry.Open())
             {
                ctx.BeginFigure(new Point(-40, -40), true /* is filled */, true /* is closed */);
                ctx.QuadraticBezierTo(new Point(-120, 80), new Point(-20, 80), false, true);
                ctx.QuadraticBezierTo(new Point(-0, 83), new Point(200, 50), false, true);
                ctx.QuadraticBezierTo(new Point(300, 30), new Point(360, 60), false, true);
                ctx.QuadraticBezierTo(new Point(400, 80), new Point(500, 70), false, true);
                ctx.QuadraticBezierTo(new Point(660, 50), new Point(850, 90), false, true);
                ctx.QuadraticBezierTo(new Point(900, 100), new Point(1000, 60), false, true);
                ctx.QuadraticBezierTo(new Point(1100, 20), new Point(1300, 40), false, true);
                ctx.QuadraticBezierTo(new Point(1540, 80), new Point(2000, -40), false, true);
             }
             var brush =
                new LinearGradientBrush(
                   new GradientStopCollection(
                      new[]
                         {
                            new GradientStop(Color.FromArgb(0x39, 0x29, 0x53, 0x8B), 0),
                            new GradientStop(Color.FromArgb(0x94, 0x12, 0xA6, 0xF3), 0.125),
                            new GradientStop(Color.FromArgb(0x8F, 0x18, 0x41, 0xE8), 0.28),
                            new GradientStop(Color.FromArgb(0x66, 0x51, 0x22, 0xD6), 0.431),
                            new GradientStop(Color.FromArgb(0x6C, 0x63, 0x16, 0xD8), 0.56),
                            new GradientStop(Color.FromArgb(0x8F, 0x15, 0x42, 0xCC), 0.659),
                            new GradientStop(Color.FromArgb(0x92, 0x27, 0x83, 0xB4), 0.828),
                            new GradientStop(Color.FromArgb(0x8F, 0x18, 0x9A, 0xFF), 1)
                         }),
                   new Point(0, 0),
                   new Point(1, 1));
             var path = new System.Windows.Shapes.Path
                {
                   Stroke = Brushes.Transparent,
                   StrokeThickness = 0,
                   Effect = new BlurEffect { Radius = 50 },
                   Data = geometry,
                   Fill = brush
                };
             var wrapperGrid = (Grid)Template.FindName("MetroWrapper", this);
             wrapperGrid.Children.Insert(0, path);
          }
       }
       catch (Exception ex)
       {
          Trace.TraceError(@"Problem loading AuroraHeader.xaml\n{0}", ex.Message);
       }
    }
 }
예제 #36
0
        private void DrawAltLine(List <Bar> resultBarList)
        {
            Random r = new Random();

            foreach (Bar bar in resultBarList)
            {
                System.Windows.Media.Color color = new System.Windows.Media.Color();
                color.R = (byte)r.Next(0, 255);
                color.G = (byte)r.Next(0, 255);
                color.B = (byte)r.Next(0, 255);
                color.A = (byte)255;

                SolidColorBrush scb = new SolidColorBrush();
                scb.Color = color;

                foreach (KeyValuePair <int, Bar> altBar in bar.AltProdBar)
                {
                    System.Windows.Shapes.Path path = new System.Windows.Shapes.Path();
                    path.Stroke = scb;

                    path.StrokeDashArray = new DoubleCollection {
                        10, 1
                    };

                    PathGeometry pg = new PathGeometry();
                    PathFigure   pf = new PathFigure();
                    pg.Figures.Add(pf);
                    pf.StartPoint = bar.GetRightCenterPoint();

                    BezierSegment bs = new BezierSegment();

                    bs.Point1 = bar.GetRightCenterPoint();
                    bs.Point2 = GetBezierSegmentPoint2(bar.GetRightCenterPoint(), altBar.Value.GetRightCenterPoint());
                    bs.Point3 = altBar.Value.GetRightCenterPoint();

                    pf.Segments.Add(bs);

                    PolyLineSegment             poly           = new PolyLineSegment();
                    List <System.Windows.Point> arrowPointList = GetArrowLinePoints(bs.Point2, bs.Point3);

                    foreach (System.Windows.Point p in arrowPointList)
                    {
                        poly.Points.Add(p);
                    }

                    pf.Segments.Add(poly);

                    path.Data = pg;

                    TextBlock pri = CreateTextBlock(altBar.Key.ToString());
                    pri.FontSize = 9;

                    DrawTextBlockByAltLine(pri, bs.Point1, bs.Point2, bs.Point3);

                    if (bar.AltLineList.ContainsKey(altBar.Value) == false)
                    {
                        bar.AltLineList.Add(altBar.Value, new Tuple <System.Windows.Shapes.Path, TextBlock>(path, pri));
                    }

                    if (altBar.Value.PrevAltLineList.ContainsKey(bar) == false)
                    {
                        altBar.Value.PrevAltLineList.Add(bar, new Tuple <System.Windows.Shapes.Path, TextBlock>(path, pri));
                    }

                    this._mainView.canvas1.Children.Add(path);
                    this._mainView.canvas1.Children.Add(pri);
                }
            }
        }
예제 #37
0
		/*Draw Arc*/
		public static void DrawArc(netDxf.Entities.Arc arc, Canvas mainCanvas)
		{
			
			

			System.Windows.Shapes.Path path = new System.Windows.Shapes.Path();
			path.Stroke = System.Windows.Media.Brushes.Black;
			path.StrokeThickness = 1;

			System.Windows.Point endPoint = new System.Windows.Point(
				(arc.Center.X + Math.Cos(arc.StartAngle * Math.PI / 180) * arc.Radius),
				mainCanvas.Height - (arc.Center.Y + Math.Sin(arc.StartAngle * Math.PI / 180) * arc.Radius));

			System.Windows.Point startPoint = new System.Windows.Point(
				(arc.Center.X + Math.Cos(arc.EndAngle * Math.PI / 180) * arc.Radius),
				mainCanvas.Height - (arc.Center.Y + Math.Sin(arc.EndAngle * Math.PI / 180) * arc.Radius));
			

			Debug.WriteLine("debut:"+startPoint.Y+" fin:"+endPoint.Y);

			
			getMaxPt((arc.Center.X + Math.Cos(arc.StartAngle * Math.PI / 180) * arc.Radius),
			         (arc.Center.Y + Math.Sin(arc.StartAngle * Math.PI / 180) * arc.Radius));
			
			getMaxPt((arc.Center.X + Math.Cos(arc.EndAngle * Math.PI / 180) * arc.Radius),
			         (arc.Center.Y + Math.Sin(arc.EndAngle * Math.PI / 180) * arc.Radius));

			
			
			ArcSegment arcSegment = new ArcSegment();
			double sweep = 0.0;
			if (arc.EndAngle < arc.StartAngle)
				sweep = (360 + arc.EndAngle) - arc.StartAngle;
			else sweep = Math.Abs(arc.EndAngle - arc.StartAngle);

			arcSegment.IsLargeArc = sweep >= 180;
			arcSegment.Point = endPoint;
			arcSegment.Size = new System.Windows.Size(arc.Radius, arc.Radius);
			arcSegment.SweepDirection = arc.Normal.Z >= 0 ? SweepDirection.Clockwise : SweepDirection.Counterclockwise;

			PathGeometry geometry = new PathGeometry();
			PathFigure pathFigure = new PathFigure();
			pathFigure.StartPoint = startPoint;
			pathFigure.Segments.Add(arcSegment);
			geometry.Figures.Add(pathFigure);

			path.Data = geometry;
			TypeConverter.Entity2Shape(arc, path);

			
			if(arc.StartAngle <=90 && arc.EndAngle >=90)
			{
				//Debug.WriteLine("ARC Blue "+arc.Center.ToString()+" R:"+arc.Radius+" start:"+arc.StartAngle+" end:"+arc.EndAngle);
				getMaxPt((arc.Center.X),
				         (arc.Center.Y + arc.Radius));
			}
			
			
			if(arc.StartAngle <=180 && arc.EndAngle >=180)
			{
				//Debug.WriteLine("ARC Red "+arc.Center.ToString()+" R:"+arc.Radius+" start:"+arc.StartAngle+" end:"+arc.EndAngle);
				getMaxPt((arc.Center.X - arc.Radius),
				         (arc.Center.Y));
			}
			
			
			if(arc.StartAngle <=270 && arc.EndAngle >=270)
			{
				//Debug.WriteLine("ARC Green "+arc.Center.ToString()+" R:"+arc.Radius+" start:"+arc.StartAngle+" end:"+arc.EndAngle);
				getMaxPt((arc.Center.X),
				         (arc.Center.Y - arc.Radius));
			}
			
			
			if(arc.StartAngle <=380 && arc.EndAngle >=0 && arc.StartAngle>arc.EndAngle)
			{
				//Debug.WriteLine("ARC Green "+arc.Center.ToString()+" R:"+arc.Radius+" start:"+arc.StartAngle+" end:"+arc.EndAngle);
				getMaxPt((arc.Center.X + arc.Radius),
				         (arc.Center.Y));
			}
			

			mainCanvas.Children.Add(path);

		}
예제 #38
0
        internal static void AddContextMenus()
        {
            // Add main contextmenu
            cm = new ContextMenu();
            var scbf = (SolidColorBrush)Application.Current.Resources["MainColorFadedBrush"];

            ///////////////////////////
            ///////////////////////////
            ///     Open           \\\\
            ///////////////////////////
            ///////////////////////////
            var opencm = new MenuItem
            {
                Header           = Application.Current.Resources["Open"] as string,
                InputGestureText = $"{Application.Current.Resources["Ctrl"] as string} + O"
            };
            var opencmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconFile),
                Stretch = Stretch.Fill
            };

            opencmIcon.Width = opencmIcon.Height = 12;
            opencmIcon.Fill  = scbf;
            opencm.Icon      = opencmIcon;
            opencm.Click    += (s, x) => Open();
            cm.Items.Add(opencm);

            ///////////////////////////
            ///////////////////////////
            ///     Save           \\\\
            ///////////////////////////
            ///////////////////////////
            var savecm = new MenuItem()
            {
                Header           = Application.Current.Resources["Save"] as string,
                InputGestureText = $"{Application.Current.Resources["Ctrl"] as string} + S"
            };
            var savecmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconSave),
                Stretch = Stretch.Fill
            };

            savecmIcon.Width = savecmIcon.Height = 12;
            savecmIcon.Fill  = scbf;
            savecm.Icon      = savecmIcon;
            savecm.Click    += (s, x) => SaveFiles();
            cm.Items.Add(savecm);

            ///////////////////////////
            ///////////////////////////
            ///     Print          \\\\
            ///////////////////////////
            ///////////////////////////
            var printcm = new MenuItem
            {
                Header           = Application.Current.Resources["Print"] as string,
                InputGestureText = $"{Application.Current.Resources["Ctrl"] as string} + P"
            };
            var printcmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconPrint),
                Stretch = Stretch.Fill
            };

            printcmIcon.Width = printcmIcon.Height = 12;
            printcmIcon.Fill  = scbf;
            printcm.Icon      = printcmIcon;
            printcm.Click    += (s, x) => Print(Pics[FolderIndex]);
            cm.Items.Add(printcm);

            ///////////////////////////
            ///////////////////////////
            ///     Open With      \\\\
            ///////////////////////////
            ///////////////////////////
            var openwcm = new MenuItem
            {
                Header           = Application.Current.Resources["OpenWith"] as string,
                InputGestureText = "E"
            };
            var openwIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconSend),
                Stretch = Stretch.Fill
            };

            openwIcon.Width = openwIcon.Height = 12;
            openwIcon.Fill  = scbf;
            openwcm.Icon    = openwIcon;
            openwcm.Click  += (s, x) => OpenWith(Pics[FolderIndex]);
            cm.Items.Add(openwcm);

            ///////////////////////////
            ///////////////////////////
            ///     Recent Files   \\\\
            ///////////////////////////
            ///////////////////////////
            cm.Items.Add(new Separator());
            var recentcm = new MenuItem
            {
                Header = Application.Current.Resources["RecentFiles"] as string,
            };
            var recentcmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconPaper),
                Stretch = Stretch.Fill
            };

            recentcmIcon.Width = recentcmIcon.Height = 12;
            recentcmIcon.Fill  = scbf;
            recentcm.Icon      = recentcmIcon;
            cm.Items.Add(recentcm);

            ///////////////////////////
            ///////////////////////////
            ///     Sort Files     \\\\
            ///////////////////////////
            ///////////////////////////
            var sortcm = new MenuItem
            {
                Header = Application.Current.Resources["SortFilesBy"] as string,
            };
            var sortcmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconSort),
                Stretch = Stretch.Fill
            };

            sortcmIcon.Width = sortcmIcon.Height = 12;
            sortcmIcon.Fill  = scbf;
            sortcm.Icon      = sortcmIcon;

            ///////////////////////////
            ///   File Name        \\\\
            ///////////////////////////
            var sortcmChild0       = new MenuItem();
            var sortcmChild0Header = new RadioButton
            {
                Content         = Application.Current.Resources["FileName"] as string,
                BorderThickness = new Thickness(0, 0, 0, 0),
                MinWidth        = 125,
                IsChecked       = Properties.Settings.Default.SortPreference == 0
            };

            sortcmChild0Header.Click += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(0); cm.IsOpen = false; };
            sortcmChild0.Click       += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(0); cm.IsOpen = false; };
            sortcmChild0.Header       = sortcmChild0Header;
            sortcm.Items.Add(sortcmChild0);

            ///////////////////////////
            ///   File Size        \\\\
            ///////////////////////////
            var sortcmChild1       = new MenuItem();
            var sortcmChild1Header = new RadioButton
            {
                Content         = Application.Current.Resources["FileSize"] as string,
                BorderThickness = new Thickness(0, 0, 0, 0),
                MinWidth        = 125,
                IsChecked       = Properties.Settings.Default.SortPreference == 1
            };

            sortcmChild1Header.Click += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(1); cm.IsOpen = false; };
            sortcmChild1.Click       += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(1); cm.IsOpen = false; };
            sortcmChild1.Header       = sortcmChild1Header;
            sortcm.Items.Add(sortcmChild1);

            ///////////////////////////
            ///   Creation Time     \\\\
            ///////////////////////////
            var sortcmChild2       = new MenuItem();
            var sortcmChild2Header = new RadioButton
            {
                Content         = Application.Current.Resources["CreationTime"] as string,
                BorderThickness = new Thickness(0, 0, 0, 0),
                MinWidth        = 125,
                IsChecked       = Properties.Settings.Default.SortPreference == 2
            };

            sortcmChild2Header.Click += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(2); cm.IsOpen = false; };
            sortcmChild2.Click       += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(2); cm.IsOpen = false; };
            sortcmChild2.Header       = sortcmChild2Header;
            sortcm.Items.Add(sortcmChild2);

            ///////////////////////////
            ///   File extension   \\\\
            ///////////////////////////
            var sortcmChild3       = new MenuItem();
            var sortcmChild3Header = new RadioButton
            {
                Content         = Application.Current.Resources["FileExtension"] as string,
                BorderThickness = new Thickness(0, 0, 0, 0),
                MinWidth        = 125,
                IsChecked       = Properties.Settings.Default.SortPreference == 3
            };

            sortcmChild3Header.Click += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(3); cm.IsOpen = false; };
            sortcmChild3.Click       += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(3); cm.IsOpen = false; };
            sortcmChild3.Header       = sortcmChild3Header;
            sortcm.Items.Add(sortcmChild3);

            ///////////////////////////
            ///   Last Access Time \\\\
            ///////////////////////////
            var sortcmChild4       = new MenuItem();
            var sortcmChild4Header = new RadioButton
            {
                Content         = Application.Current.Resources["LastAccessTime"] as string,
                BorderThickness = new Thickness(0, 0, 0, 0),
                MinWidth        = 125,
                IsChecked       = Properties.Settings.Default.SortPreference == 4
            };

            sortcmChild4Header.Click += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(4); cm.IsOpen = false; };
            sortcmChild4.Click       += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(4); cm.IsOpen = false; };
            sortcmChild4.Header       = sortcmChild4Header;
            sortcm.Items.Add(sortcmChild4);

            ///////////////////////////
            ///   Last Write Time  \\\\
            ///////////////////////////
            var sortcmChild5       = new MenuItem();
            var sortcmChild5Header = new RadioButton
            {
                Content         = Application.Current.Resources["LastWriteTime"] as string,
                BorderThickness = new Thickness(0, 0, 0, 0),
                MinWidth        = 125,
                IsChecked       = Properties.Settings.Default.SortPreference == 5
            };

            sortcmChild5Header.Click += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(5); cm.IsOpen = false; };
            sortcmChild5.Click       += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(5); cm.IsOpen = false; };
            sortcmChild5.Header       = sortcmChild5Header;
            sortcm.Items.Add(sortcmChild5);

            ///////////////////////////
            ///   Random        \\\\
            ///////////////////////////
            var sortcmChild6       = new MenuItem();
            var sortcmChild6Header = new RadioButton
            {
                Content         = Application.Current.Resources["Random"] as string,
                BorderThickness = new Thickness(0, 0, 0, 0),
                MinWidth        = 125,
                IsChecked       = Properties.Settings.Default.SortPreference == 6
            };

            sortcmChild6Header.Click += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(6); cm.IsOpen = false; };
            sortcmChild6.Click       += delegate { ConfigureSettings.UpdateUIValues.ChangeSorting(6); cm.IsOpen = false; };
            sortcmChild6.Header       = sortcmChild6Header;
            sortcm.Items.Add(sortcmChild6);
            cm.Items.Add(sortcm);

            ///////////////////////////
            ///////////////////////////
            ///     Settings       \\\\
            ///////////////////////////
            ///////////////////////////
            var settingscm = new MenuItem
            {
                Header = Application.Current.Resources["Settings"] as string,
            };
            var settingscmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconWrench),
                Stretch = Stretch.Fill
            };

            settingscmIcon.Width = settingscmIcon.Height = 12;
            settingscmIcon.Fill  = scbf;
            settingscm.Icon      = settingscmIcon;
            cm.Items.Add(settingscm);

            ///////////////////////////
            ///   Looping          \\\\
            ///////////////////////////
            var settingscmLoop = new MenuItem
            {
                InputGestureText = "L"
            };
            var settingscmLoopHeader = new CheckBox
            {
                IsChecked           = Properties.Settings.Default.Looping,
                Content             = Application.Current.Resources["Looping"] as string,
                FontSize            = 13,
                MinWidth            = 125,
                HorizontalAlignment = HorizontalAlignment.Left,
                Width  = double.NaN,
                Height = double.NaN
            };

            settingscmLoop.Header       = settingscmLoopHeader;
            settingscmLoop.Click       += (s, x) => { ConfigureSettings.UpdateUIValues.SetLooping(s, x); };
            settingscmLoopHeader.Click += (s, x) => { ConfigureSettings.UpdateUIValues.SetLooping(s, x); };
            settingscm.Items.Add(settingscmLoop);

            ///////////////////////////
            ///   Scroll         \\\\
            ///////////////////////////
            var settingscmScroll = new MenuItem
            {
                InputGestureText = "X"
            };
            var settingscmScrollHeader = new CheckBox
            {
                IsChecked           = Properties.Settings.Default.ScrollEnabled,
                Content             = Application.Current.Resources["Scrolling"] as string,
                FontSize            = 13,
                MinWidth            = 125,
                HorizontalAlignment = HorizontalAlignment.Left,
                Width  = double.NaN,
                Height = double.NaN
            };

            settingscmScrollHeader.Click += ConfigureSettings.UpdateUIValues.SetScrolling;
            settingscmScroll.Header       = settingscmScrollHeader;
            settingscmScroll.Click       += (s, x) => { ConfigureSettings.UpdateUIValues.SetScrolling(s, x); settingscmScrollHeader.IsChecked = (bool)settingscmScrollHeader.IsChecked ? false : true; };
            settingscm.Items.Add(settingscmScroll);

            ///////////////////////////
            ///   Alt interface    \\\\
            ///////////////////////////
            var altcm = new MenuItem
            {
                InputGestureText = "Alt + Z"
            };
            var altcmHeader = new CheckBox
            {
                Content             = Application.Current.Resources["ShowHideUI"] as string,
                IsChecked           = Properties.Settings.Default.ShowInterface,
                FontSize            = 13,
                MinWidth            = 125,
                HorizontalAlignment = HorizontalAlignment.Left,
                Width  = double.NaN,
                Height = double.NaN
            };

            altcmHeader.Click += delegate
            {
                if (GalleryFunctions.IsOpen)
                {
                    altcmHeader.IsChecked = Properties.Settings.Default.ShowInterface;
                    return;
                }
                HideInterfaceLogic.ToggleInterface();
            };
            altcm.Header = altcmHeader;
            altcm.Click += delegate { HideInterfaceLogic.ToggleInterface(); };
            settingscm.Items.Add(altcm);

            ///////////////////////////
            ///   Transparent bg   \\\\
            ///////////////////////////
            var transcm = new MenuItem
            {
                InputGestureText = "T"
            };
            var transcmHeader = new Button
            {
                Content             = Application.Current.Resources["ChangeBg"] as string,
                ToolTip             = Application.Current.Resources["ChangeBgTooltip"] as string,
                FontSize            = 13,
                Width               = double.NaN,
                Height              = double.NaN,
                HorizontalAlignment = HorizontalAlignment.Left
            };

            transcmHeader.Click += ConfigureSettings.ConfigColors.ChangeBackground;
            transcm.Header       = transcmHeader;
            transcm.Click       += ConfigureSettings.ConfigColors.ChangeBackground;
            settingscm.Items.Add(transcm);

            cm.Items.Add(new Separator());

            ///////////////////////////
            ///////////////////////////
            ///  Set as            \\\\
            ///////////////////////////
            ///////////////////////////

            var setAsCm = new MenuItem
            {
                Header = Application.Current.Resources["SetAs"] as string,
            };

            var setAsCmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconCamera),
                Stretch = Stretch.Fill
            };

            setAsCmIcon.Width = setAsCmIcon.Height = 12;
            setAsCmIcon.Fill  = scbf;
            setAsCm.Icon      = setAsCmIcon;

            var wallcm = new MenuItem
            {
                Header = Application.Current.Resources["SetAsWallpaper"] as string,
            };

            wallcm.Click += (s, x) => SetWallpaper(WallpaperStyle.Fill);
            var wallcmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconCamera),
                Stretch = Stretch.Fill
            };

            wallcmIcon.Width = wallcmIcon.Height = 12;
            wallcmIcon.Fill  = scbf;
            wallcm.Icon      = wallcmIcon;
            setAsCm.Items.Add(wallcm);

            var lockCm = new MenuItem
            {
                Header = Application.Current.Resources["SetAsLockScreenImage"] as string,
            };

            lockCm.Click += async delegate { await Lockscreen.ChangeLockScreenBackground(Pics[FolderIndex]).ConfigureAwait(false); };
            var lockCmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconCamera),
                Stretch = Stretch.Fill
            };

            lockCmIcon.Width = lockCmIcon.Height = 12;
            lockCmIcon.Fill  = scbf;
            lockCm.Icon      = lockCmIcon;
            setAsCm.Items.Add(lockCm);

            cm.Items.Add(setAsCm);

            ///////////////////////////
            ///////////////////////////
            ///   Locate on disk   \\\\
            ///////////////////////////
            ///////////////////////////
            var lcdcm = new MenuItem
            {
                Header           = Application.Current.Resources["ShowInFolder"] as string,
                InputGestureText = "F3"
            };
            var lcdcmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconSearch),
                Stretch = Stretch.Fill
            };

            lcdcmIcon.Width = lcdcmIcon.Height = 12;
            lcdcmIcon.Fill  = scbf;
            lcdcm.Icon      = lcdcmIcon;
            lcdcm.Click    += (s, x) => Open_In_Explorer();
            cm.Items.Add(lcdcm);

            ///////////////////////////
            ///////////////////////////
            ///   Image Info       \\\\
            ///////////////////////////
            ///////////////////////////
            var fildecm = new MenuItem
            {
                Header = Application.Current.Resources["ImageInfo"] as string,
            };
            var fildecmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconPaperDetails),
                Stretch = Stretch.Fill
            };

            fildecmIcon.Width = fildecmIcon.Height = 12;
            fildecmIcon.Fill  = scbf;
            fildecm.Icon      = fildecmIcon;
            fildecm.Click    += (_, _) => LoadWindows.ImageInfoWindow();
            cm.Items.Add(fildecm);
            cm.Items.Add(new Separator());

            ///////////////////////////
            ///////////////////////////
            ///   Copy             \\\\
            ///////////////////////////
            ///////////////////////////
            var cpm = new MenuItem
            {
                Header = Application.Current.Resources["Copy"] as string,
            };

            var cpmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconCopy),
                Stretch = Stretch.Fill
            };

            cpmIcon.Width = cpmIcon.Height = 12;
            cpmIcon.Fill  = scbf;
            cpm.Icon      = cpmIcon;

            ///////////////////////////
            ///   Copy file        \\\\
            ///////////////////////////
            var cppcm = new MenuItem
            {
                Header  = Application.Current.Resources["CopyFile"] as string,
                ToolTip = Application.Current.Resources["CopyFile"] as string
                          + $" [{Application.Current.Resources["Ctrl"] as string}] + C]",
            };

            cppcm.Click += (s, x) => Copyfile();
            cpm.Items.Add(cppcm);

            ///////////////////////////
            ///   Copy base64      \\\\
            ///////////////////////////
            var cpxcm = new MenuItem
            {
                Header  = Application.Current.Resources["Copy"] as string + " base64",
                ToolTip = Application.Current.Resources["Copy"] as string + " base64"
                          + $" [{Application.Current.Resources["Ctrl"] as string} + " +
                          $"{Application.Current.Resources["Shift"] as string}  + C]",
            };

            cpxcm.Click += async delegate { await Base64.SendToClipboard().ConfigureAwait(false); };
            cpm.Items.Add(cpxcm);

            ///////////////////////////
            ///   Copy bitmap      \\\\
            ///////////////////////////
            var cpxbm = new MenuItem
            {
                Header  = Application.Current.Resources["CopyImage"] as string,
                ToolTip = Application.Current.Resources["CopyImageTooltip"] as string
                          + $" [{Application.Current.Resources["Ctrl"] as string} + " +
                          $"{Application.Current.Resources["Alt"] as string}  + C]",
            };

            cpxbm.Click += (s, x) => CopyBitmap();
            cpm.Items.Add(cpxbm);

            ///////////////////////////
            ///   Copy file path   \\\\
            ///////////////////////////
            var cppfm = new MenuItem
            {
                Header = Application.Current.Resources["FileCopyPath"] as string,
            };

            cppfm.Click += (s, x) => CopyText();
            cpm.Items.Add(cppfm);

            cm.Items.Add(cpm);

            ///////////////////////////
            ///////////////////////////
            ///   Cut File         \\\\
            ///////////////////////////
            ///////////////////////////
            var cpccm = new MenuItem
            {
                Header           = Application.Current.Resources["FileCut"] as string,
                InputGestureText = $"{Application.Current.Resources["Ctrl"] as string} + X"
            };
            var cpccmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconScissor),
                Stretch = Stretch.Fill
            };

            cpccmIcon.Width = cpccmIcon.Height = 12;
            cpccmIcon.Fill  = scbf;
            cpccm.Icon      = cpccmIcon;
            cpccm.Click    += (s, x) => Cut(Pics[FolderIndex]);
            cm.Items.Add(cpccm);

            ///////////////////////////
            ///////////////////////////
            ///   Paste File       \\\\
            ///////////////////////////
            ///////////////////////////
            var pastecm = new MenuItem
            {
                Header           = Application.Current.Resources["FilePaste"] as string,
                InputGestureText = $"{Application.Current.Resources["Ctrl"] as string} + V"
            };
            var pastecmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconPaste),
                Stretch = Stretch.Fill,
                Width   = 12,
                Height  = 12,
                Fill    = scbf
            };

            pastecm.Icon   = pastecmIcon;
            pastecm.Click += (s, x) => Paste();
            cm.Items.Add(pastecm);

            ///////////////////////////
            ///////////////////////////
            ///   Delete File      \\\\
            ///////////////////////////
            ///////////////////////////
            var MovetoRecycleBin = new MenuItem
            {
                Header           = Application.Current.Resources["DeleteFile"] as string,
                InputGestureText = Application.Current.Resources["Delete"] as string,
            };
            var MovetoRecycleBinIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconRecycle),
                Stretch = Stretch.Fill,
                Width   = 12,
                Height  = 12,
                Fill    = scbf
            };

            MovetoRecycleBin.Icon   = MovetoRecycleBinIcon;
            MovetoRecycleBin.Click += delegate { DeleteFile(Pics[FolderIndex], true); };
            cm.Items.Add(MovetoRecycleBin);

            ///////////////////////////
            ///////////////////////////
            ///   Close            \\\\
            ///////////////////////////
            ///////////////////////////
            cm.Items.Add(new Separator());
            var clcm = new MenuItem
            {
                Header           = Application.Current.Resources["Close"] as string,
                InputGestureText = Application.Current.Resources["Esc"] as string,
                StaysOpenOnClick = false
            };
            var mclcmIcon = new System.Windows.Shapes.Path
            {
                Data    = Geometry.Parse(SVGiconClose),
                Stretch = Stretch.Fill,
                Width   = 12,
                Height  = 12,
                Fill    = scbf
            };

            clcm.Icon   = mclcmIcon;
            clcm.Click += (s, x) => { cm.Visibility = Visibility.Collapsed; SystemCommands.CloseWindow(LoadWindows.GetMainWindow); };
            cm.Items.Add(clcm);

            // Add to elements
            LoadWindows.GetMainWindow.MainImage.ContextMenu = LoadWindows.GetMainWindow.ParentContainer.ContextMenu = cm;
            cm.Opened += (tt, yy) => Recentcm_Opened(recentcm);

#if DEBUG
            Trace.WriteLine("Contextmenu loaded");
#endif
        }
예제 #39
0
파일: Figure.cs 프로젝트: matryt-8/NPaint
 public abstract void SetFields(Path path);
예제 #40
0
 private void DrawWarpPointPath(System.Drawing.Point sourceLoc, System.Drawing.Point targetLoc)
 {
     try
     {
         Point origin = new Point(((sourceLoc.Y + 1) * 32) - 16, ((sourceLoc.X) * 32) + 16);
         Point target = new Point(((targetLoc.Y + 1) * 32) - 16, ((targetLoc.X) * 32) + 16);
         System.Windows.Shapes.Path warpPath = new System.Windows.Shapes.Path();
         warpPath.Stroke = Brushes.Gray;
         warpPath.StrokeThickness = 1;
         Point from = grdGalaxyView.TransformToVisual(cnvGalaxyView).Transform(origin);
         Point to = grdGalaxyView.TransformToVisual(cnvGalaxyView).Transform(target);
         warpPath.Data = new LineGeometry(from, to);
         warpPath.SetValue(Panel.ZIndexProperty, 1);
         cnvGalaxyView.Children.Add(warpPath);
     }
     catch (Exception ex)
     {
         if (LogEverything)
             Logger(ex);
     }
 }
예제 #41
0
        /// <summary>
        /// Draws a path
        /// </summary>
        /// <param name="ops"></param>
        /// <param name="pen"></param>
        /// <param name="brush"></param>
        public void DrawPath(IEnumerable<PathOp> ops, Pen pen = null, NGraphics.Brush brush = null)
        {
            if (pen == null && brush == null)
                return;

            var pathEl = new System.Windows.Shapes.Path();

            if (brush != null)
                pathEl.Fill = GetBrush(brush);

            if (pen != null)
            {
                pathEl.Stroke = GetStroke(pen);
                pathEl.StrokeThickness = pen.Width;
            }

            var geo = new StringBuilder();

            foreach (var op in ops)
            {
                var mt = op as MoveTo;
                if (mt != null)
                {
                    geo.AppendFormat(CultureInfo.InvariantCulture, " M {0},{1}", mt.Point.X, mt.Point.Y);
                    continue;
                }

                var lt = op as LineTo;
                if (lt != null)
                {
                    geo.AppendFormat(CultureInfo.InvariantCulture, " L {0},{1}", lt.Point.X, lt.Point.Y);
                    continue;
                }

                var at = op as ArcTo;
                if (at != null)
                {
                    var p = at.Point;
                    var r = at.Radius;

                    geo.AppendFormat(CultureInfo.InvariantCulture, " A {0},{1} 0 {2} {3} {4},{5}",
                        r.Width, r.Height,
                        at.LargeArc ? 1 : 0,
                        at.SweepClockwise ? 1 : 0,
                        p.X, p.Y);
                    continue;
                }

                var ct = op as CurveTo;
                if (ct != null)
                {
                    var p = ct.Point;
                    var c1 = ct.Control1;
                    var c2 = ct.Control2;
                    geo.AppendFormat(CultureInfo.InvariantCulture, " C {0},{1} {2},{3} {4},{5}",
                        c1.X, c1.Y, c2.X, c2.Y, p.X, p.Y);
                    continue;
                }

                var cp = op as ClosePath;
                if (cp != null)
                {
                    geo.Append(" z");
                    continue;
                }
            }

            // Convert path string to geometry
            var b = new Binding { Source = geo.ToString() };
            BindingOperations.SetBinding(pathEl, System.Windows.Shapes.Path.DataProperty, b);

            pathEl.RenderTransform = Conversions.GetTransform(CurrentTransform);
            _canvas.Children.Add(pathEl);
        }
        void CreateFrameworkElementForSkeletonRail(Rail rail) {
            var iCurve = rail.Geometry as ICurve;
            if (iCurve == null) return;
            var path = new Path
            {
                Data = GraphmapsEdge.GetICurveWpfGeometry(iCurve),
            };

            InvalidateSkeletonRail(rail, path);

            path.Tag = rail;
            GraphCanvasChildrenAdd(path);
            _visibleRailsToFrameworkElems[rail] = path;
        }
예제 #43
0
        private void RebuildCurve(Core.Curve.ICurve curve)
        {
            if (!_updatingCurveEnabled)
            {
                return;
            }

            // Keep original selection
            var selectedKeys = new List <Tuple <ICurve, double> >();

            foreach (var e in _SelectionHandler.SelectedElements)
            {
                var cpc = e as CurvePointControl;
                if (cpc == null)
                {
                    continue;
                }
                selectedKeys.Add(new Tuple <ICurve, double>(cpc.Curve, cpc.U));
            }

            //_SelectionHandler.Clear();

            if (!_curvesWithPointControls.ContainsKey(curve))
            {
                _curvesWithPointControls[curve] = new List <CurvePointControl>();
            }

            var curvePointControls = _curvesWithPointControls[curve];

            int  cepIndex        = 0;
            bool reusingControls = true;

            foreach (var pair in curve.GetPoints())
            {
                double u           = pair.Key;
                var    vDefinition = pair.Value;


                // Reuse existing control
                if (reusingControls && cepIndex < curvePointControls.Count)
                {
                    var reusedPointControl = curvePointControls[cepIndex];
                    reusedPointControl.U = u;
                    reusedPointControl.InitFromVDefinition(vDefinition);
                    reusedPointControl.Curve      = curve;
                    reusedPointControl.IsSelected = false;

                    // Was it selected?
                    foreach (var curveTime in selectedKeys)
                    {
                        if (reusedPointControl.Curve == curveTime.Item1 && reusedPointControl.U == curveTime.Item2)
                        {
                            reusedPointControl.IsSelected = true;
                            _SelectionHandler.AddElement(reusedPointControl);
                            break;
                        }
                    }

                    cepIndex++;
                }
                else
                {
                    reusingControls = false;
                    CurvePointControl newPointControl;
                    // Reuse from pool...
                    if (_pointControlRecyclePool.Count > 0)
                    {
                        newPointControl = _pointControlRecyclePool[0];
                        _pointControlRecyclePool.RemoveAt(0);

                        newPointControl.U = u;
                        newPointControl.InitFromVDefinition(vDefinition);
                        newPointControl.Curve      = curve;
                        newPointControl.IsSelected = false;
                    }
                    // Create new control
                    else
                    {
                        newPointControl   = new CurvePointControl(u, vDefinition, curve, this);
                        newPointControl.U = u;
                    }

                    _curvesWithPointControls[curve].Add(newPointControl);
                    XCurvePointCanvas.Children.Add(newPointControl);
                }
            }


            // Move obsolete control points to pool
            if (reusingControls)
            {
                List <CurvePointControl> obsoletePoints = new List <CurvePointControl>();
                while (cepIndex < _curvesWithPointControls[curve].Count)
                {
                    var obsoletePointControl = curvePointControls[cepIndex];
                    _pointControlRecyclePool.Add(obsoletePointControl);
                    XCurvePointCanvas.Children.Remove(obsoletePointControl);
                    obsoletePoints.Add(obsoletePointControl);
                    cepIndex++;
                }
                foreach (var removeThis in obsoletePoints)
                {
                    curvePointControls.Remove(removeThis);
                }
            }


            // Update curve line (Path)
            if (_curvesWithPaths.ContainsKey(curve))
            {
                XCurveLineCanvas.Children.Remove(_curvesWithPaths[curve]);
            }
            var newPath = new Path();

            newPath.Stroke          = Brushes.DarkGray;
            newPath.StrokeThickness = 1;
            _curvesWithPaths[curve] = newPath;
            XCurveLineCanvas.Children.Add(newPath);

            UpdateCurveHighlight();
            UpdateLine(curve);
        }
 void InvalidateSkeletonRail(Rail rail, Path path) {
     path.StrokeThickness = rail.IsUsedOnPreviousLevel ? 2*GetBorderPathThickness() : GetBorderPathThickness();
     path.Stroke = (rail.IsHighlighted
         ? Brushes.Red
         : (rail.IsUsedOnPreviousLevel ? Brushes.SeaGreen : Brushes.Blue));
     UpdateRailZindex(path, rail);
 }
예제 #45
0
        /// <summary>
        /// Draws a path
        /// </summary>
        /// <param name="ops"></param>
        /// <param name="pen"></param>
        /// <param name="brush"></param>
        public void DrawPath(IEnumerable <PathOp> ops, Pen pen = null, NGraphics.Brush brush = null)
        {
            if (pen == null && brush == null)
            {
                return;
            }

            var pathEl = new System.Windows.Shapes.Path();

            if (brush != null)
            {
                pathEl.Fill = GetBrush(brush);
            }

            if (pen != null)
            {
                pathEl.Stroke          = GetStroke(pen);
                pathEl.StrokeThickness = pen.Width;
            }

            var geo = new StringBuilder();

            foreach (var op in ops)
            {
                var mt = op as MoveTo;
                if (mt != null)
                {
                    geo.AppendFormat(CultureInfo.InvariantCulture, " M {0},{1}", mt.Point.X, mt.Point.Y);
                    continue;
                }

                var lt = op as LineTo;
                if (lt != null)
                {
                    geo.AppendFormat(CultureInfo.InvariantCulture, " L {0},{1}", lt.Point.X, lt.Point.Y);
                    continue;
                }

                var at = op as ArcTo;
                if (at != null)
                {
                    var p = at.Point;
                    var r = at.Radius;

                    geo.AppendFormat(CultureInfo.InvariantCulture, " A {0},{1} 0 {2} {3} {4},{5}",
                                     r.Width, r.Height,
                                     at.LargeArc ? 1 : 0,
                                     at.SweepClockwise ? 1 : 0,
                                     p.X, p.Y);
                    continue;
                }

                var ct = op as CurveTo;
                if (ct != null)
                {
                    var p  = ct.Point;
                    var c1 = ct.Control1;
                    var c2 = ct.Control2;
                    geo.AppendFormat(CultureInfo.InvariantCulture, " C {0},{1} {2},{3} {4},{5}",
                                     c1.X, c1.Y, c2.X, c2.Y, p.X, p.Y);
                    continue;
                }

                var cp = op as ClosePath;
                if (cp != null)
                {
                    geo.Append(" z");
                    continue;
                }
            }

            // Convert path string to geometry
            var b = new Binding {
                Source = geo.ToString()
            };

            BindingOperations.SetBinding(pathEl, System.Windows.Shapes.Path.DataProperty, b);

            pathEl.RenderTransform = Conversions.GetTransform(CurrentTransform);
            _canvas.Children.Add(pathEl);
        }
 public void DrawRubberEdge(EdgeGeometry edgeGeometry) {
     if (_rubberEdgePath == null) {
         _rubberEdgePath = new Path
         {
             Stroke = Brushes.Black,
             StrokeThickness = GetBorderPathThickness()*3
         };
         GraphCanvasChildrenAdd(_rubberEdgePath);
         targetArrowheadPathForRubberEdge = new Path
         {
             Stroke = Brushes.Black,
             StrokeThickness = GetBorderPathThickness()*3
         };
         GraphCanvasChildrenAdd(targetArrowheadPathForRubberEdge);
     }
     _rubberEdgePath.Data = GraphmapsEdge.GetICurveWpfGeometry(edgeGeometry.Curve);
     targetArrowheadPathForRubberEdge.Data = GraphmapsEdge.DefiningTargetArrowHead(edgeGeometry,
         edgeGeometry.LineWidth);
 }
 public void StopDrawingRubberEdge() {
     _graphCanvas.Children.Remove(_rubberEdgePath);
     _graphCanvas.Children.Remove(targetArrowheadPathForRubberEdge);
     _rubberEdgePath = null;
     targetArrowheadPathForRubberEdge = null;
 }
예제 #48
0
		public static WMFImage ReadWMF(string fileName)
		{
			#region createTempFile
			var temp = Path.Combine(Path.GetTempPath() + Path.GetRandomFileName());
			temp = temp.Remove(temp.Length - 3) + "xps";
			#endregion
			using (PrintDocument pdx = new PrintDocument())
			{
				pdx.PrintPage += (object printSender, PrintPageEventArgs printE) =>
				{
					var img = System.Drawing.Image.FromFile(fileName);
					printE.Graphics.DrawImageUnscaled(img, printE.PageSettings.Bounds);
					printE.HasMorePages = false;
				};
				pdx.DefaultPageSettings.PaperSize = new PaperSize("", 3500, 8000);
				pdx.DefaultPageSettings.Landscape = true;
				pdx.PrinterSettings.PrinterName = "Microsoft XPS Document Writer";
				pdx.PrinterSettings.PrintToFile = true;
				pdx.PrinterSettings.PrintFileName = temp;
				pdx.PrintController = new StandardPrintController();
				pdx.Print();
			}
			#region WaitForPrinter

			for (int i = 0; i < 10; i++)
			{
				if (File.Exists(temp))
				{
					FileInfo fi = new FileInfo(temp);
					for (int j = 0; i < 10; i++)
					{
						if (fi.Length == 0)
						{
							System.Threading.Thread.Sleep(1000);
							fi = new FileInfo(temp);
						}
						else break;

						if ((fi.Length == 0) && (j == 9))
							throw new Exception("Печать в файл занимает слишком много времени. Либо размер файла слишком большой, либо проблема связана с XPS принтером, либо файл повреждён.");
						break;
					}
					break;
				}
				else
				{
					System.Threading.Thread.Sleep(1000);
				}
			}
			#endregion
			WMFImage wmf = new WMFImage();
			using (XpsDocument xpsDocument = new XpsDocument(temp, FileAccess.Read))
			{
				DocumentReference docReference = xpsDocument.GetFixedDocumentSequence().References.First();
				FixedDocument doc = docReference.GetDocument(false);
				PageContent content = doc.Pages[0];
				var fixedPage = content.GetPageRoot(false);
				wmf.Canvas = new Canvas()
				{
					Width = fixedPage.Width,
					Height = fixedPage.Height,
				};
				for (int i = fixedPage.Children.Count - 1; i >= 0; i--)
				{
					var child = fixedPage.Children[i];
					fixedPage.Children.Remove(child);
					if (child is Glyphs)
					{
						var glyph = (Glyphs)child;
						var glyphRun = glyph.ToGlyphRun();
						var path = new System.Windows.Shapes.Path()
						{
							Fill = glyph.Fill,
							Data = glyphRun.BuildGeometry(),
							RenderTransform = glyph.RenderTransform,
							RenderTransformOrigin = glyph.RenderTransformOrigin,
							RenderSize = glyph.RenderSize,
						};
						wmf.Canvas.Children.Insert(0, path);
					}
					else
						wmf.Canvas.Children.Insert(0, child);
				}
				ReadResources(xpsDocument.FixedDocumentSequenceReader.FixedDocuments[0].FixedPages[0], wmf);
				xpsDocument.Close();
			}
			GC.Collect();
			try
			{
				File.Delete(temp);
			}
			catch
			{
			}
			return wmf;
		}