// 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; }
public override void DrawOnto(System.Windows.Controls.Canvas ShapeCanvas, int x, int y) { int squareSide = (int)Width; SolidColorBrush mediaFillColor = new SolidColorBrush(); mediaFillColor.Color = System.Windows.Media.Color.FromArgb(FillColor.A, FillColor.R, FillColor.G, FillColor.B); SolidColorBrush mediaBorderColor = new SolidColorBrush(); mediaBorderColor.Color = System.Windows.Media.Color.FromArgb(BorderColor.A, BorderColor.R, BorderColor.B, BorderColor.G); System.Windows.Shapes.Polygon mySquare = new System.Windows.Shapes.Polygon(); mySquare.Stroke = mediaBorderColor; mySquare.Fill = mediaFillColor; mySquare.StrokeThickness = 2; System.Windows.Point Point1 = new System.Windows.Point(x, y); System.Windows.Point Point2 = new System.Windows.Point(x + (double)Width, y); System.Windows.Point Point3 = new System.Windows.Point(x + (double)Width, y + (double)Height); System.Windows.Point Point4 = new System.Windows.Point(x, y + (double)Height); PointCollection myPointCollection = new PointCollection(); myPointCollection.Add(Point1); myPointCollection.Add(Point2); myPointCollection.Add(Point3); myPointCollection.Add(Point4); mySquare.Points = myPointCollection; ShapeCanvas.Children.Add(mySquare); }
public Canvas CreateRoomCanvas(Room room) { int max = 0; Canvas canvas = new Canvas(); List <Position> coordinates = Room.ToList(room.Positions); PointCollection points = new PointCollection(); for (int i = 0; i < coordinates.Count; i++) { max = coordinates[i].X > max ? coordinates[i].X : max; points.Add(new Point(coordinates[i].X, coordinates[i].Y)); } Polygon roomPolygon = new Polygon { Stroke = Brushes.Black, Fill = Brushes.Gray, StrokeThickness = 1, HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Center, Points = points }; // Zet de dimensies van de ruimte polygon roomPolygon.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); canvas.Children.Add(roomPolygon); double scale = 270.00 / max; canvas.RenderTransform = new ScaleTransform(scale, scale); return(canvas); }
public override bool Draw(Canvas canvas, Brush fillColor, Brush strokeColor, double strokeThickness, PointCollection points) { var trapezoidPoints = new PointCollection(4); Point p1, p2, p3, p4; p1.X = points[0].X; p1.Y = points[1].Y; trapezoidPoints.Add(p1); p2.X = points[0].X + (points[1].X - points[0].X) / 3; p2.Y = points[0].Y; trapezoidPoints.Add(p2); p3.X = points[0].X + (points[1].X - points[0].X) / 3 * 2; p3.Y = points[0].Y; trapezoidPoints.Add(p3); p4.X = points[1].X; p4.Y = points[1].Y; trapezoidPoints.Add(p4); var polygon = new System.Windows.Shapes.Polygon { Points = trapezoidPoints, Fill = fillColor, VerticalAlignment = VerticalAlignment.Center, Stroke = strokeColor, StrokeThickness = strokeThickness }; canvas.Children.Add(polygon); return(true); }
public void Make() { MainWindow main = (MainWindow)System.Windows.Application.Current.MainWindow; System.Windows.Shapes.Polygon rectangle = new System.Windows.Shapes.Polygon(); PointCollection rectaglePoints = new PointCollection(); rectaglePoints.Add(point1); rectaglePoints.Add(point2); rectaglePoints.Add(point3); rectaglePoints.Add(point4); rectangle.Points = rectaglePoints; main.mainCanvas.Children.Clear(); main.mainCanvas.Children.Add(rectangle); main.perimeter.Content = "Perimeter: " + Perimeter(); main.area.Content = "Area " + Area(rectaglePoints); //Additional settings: BrushConverter bc = new BrushConverter(); Brush brush = (Brush)bc.ConvertFrom(((ListBoxItem)main.Colors.SelectedValue).Content.ToString()); rectangle.Fill = brush; brush = (Brush)bc.ConvertFrom(((ListBoxItem)main.StrokeColors.SelectedValue).Content.ToString()); rectangle.Stroke = brush; string s = ((ListBoxItem)main.StrokeSize.SelectedValue).Content.ToString(); rectangle.StrokeThickness = double.Parse(((ListBoxItem)main.StrokeSize.SelectedValue).Content.ToString()); }
public static void DrawOrigin(Canvas mainCanvas) { Vector3 V0 = new Vector3(0, 0, 0); Vector3 Vx = new Vector3(20, 0, 0); Vector3 Vy = new Vector3(0, 20, 0); System.Windows.Shapes.Line lx = GetLine(V0, Vx, mainCanvas); lx.Stroke = new SolidColorBrush(Colors.Red); lx.StrokeThickness = 0.5; lx.X2 = lx.X2 - 3; mainCanvas.Children.Add(lx); System.Windows.Shapes.Polygon arrowX = DrawUtils.GetArrowhead(TypeConverter.Vertex3ToVertex2(Vx), TypeConverter.Vertex3ToVertex2(V0), mainCanvas); arrowX.Stroke = new SolidColorBrush(Colors.Red); arrowX.StrokeThickness = 0.1; arrowX.Fill = arrowX.Stroke; mainCanvas.Children.Add(arrowX); System.Windows.Shapes.Line ly = GetLine(V0, Vy, mainCanvas); ly.Stroke = new SolidColorBrush(Colors.Green); ly.StrokeThickness = 0.5; ly.Y2 = ly.Y2 + 3; mainCanvas.Children.Add(ly); System.Windows.Shapes.Polygon arrowY = DrawUtils.GetArrowhead(TypeConverter.Vertex3ToVertex2(Vy), TypeConverter.Vertex3ToVertex2(V0), mainCanvas); arrowY.Stroke = new SolidColorBrush(Colors.Green); arrowY.StrokeThickness = 0.1; arrowY.Fill = arrowY.Stroke; mainCanvas.Children.Add(arrowY); }
public override void DrawOnto(Canvas ShapeCanvas, int x, int y) { double trapshortbase = Convert.ToDouble(ShortBase); double trapheight = Convert.ToDouble(Height); double traptopbase = Convert.ToDouble(LongBase); double trapwing = Convert.ToDouble(WingLength); System.Windows.Shapes.Polygon myPolygon = new System.Windows.Shapes.Polygon(); myPolygon.Stroke = System.Windows.Media.Brushes.Tomato; myPolygon.Fill = System.Windows.Media.Brushes.Bisque; myPolygon.StrokeThickness = 2; Point point1 = new Point(x, y); Point point2 = new Point(x + trapshortbase, y); Point point3 = new Point(x + trapshortbase + trapwing, y + trapheight); Point point4 = new Point(x - trapwing, y + trapheight); PointCollection myPointCollection = new PointCollection(); myPointCollection.Add(point1); myPointCollection.Add(point2); myPointCollection.Add(point3); myPointCollection.Add(point4); myPolygon.Points = myPointCollection; ShapeCanvas.Children.Add(myPolygon); }
public override void Draw(Canvas canvas) { Point thirdPoint = new Point(); PointCollection pointCollection = new PointCollection(); thirdPoint.X = firstPoint.X - (secondPoint.X - firstPoint.X); thirdPoint.Y = secondPoint.Y; height = (int)Math.Abs(firstPoint.Y - secondPoint.Y); width = (int)Math.Abs(secondPoint.X - thirdPoint.X) / 2; pointCollection.Clear(); pointCollection.Add(firstPoint); pointCollection.Add(secondPoint); pointCollection.Add(thirdPoint); System.Windows.Shapes.Polygon triangle = new System.Windows.Shapes.Polygon() { Points = pointCollection, Stroke = Brushes.Black, StrokeThickness = thickness, Fill = new SolidColorBrush(Colors.Wheat) }; hash = triangle.GetHashCode(); canvas.Children.Add(triangle); }
/*Draw Leader*/ public static void DrawLeader(Leader xLeader, Canvas mainCanvas) { Size txtSize = new Size(0, 0); /*ajout du texte*/ if (xLeader.Annotation.Type == EntityType.MText) { netDxf.Entities.MText mText = (netDxf.Entities.MText)xLeader.Annotation; txtSize = DrawMText(mText, mainCanvas); } if (xLeader.Annotation.Type == EntityType.Text) { netDxf.Entities.Text mText = (netDxf.Entities.Text)xLeader.Annotation; DrawText(mText, mainCanvas); } if (xLeader.Annotation.Type == EntityType.Insert) { netDxf.Entities.Insert mText = (netDxf.Entities.Insert)xLeader.Annotation; DrawInsert(mText, mainCanvas); } System.Windows.Shapes.Polyline wPoly = new System.Windows.Shapes.Polyline(); foreach (netDxf.Vector2 xVertex in xLeader.Vertexes) { System.Windows.Point myPt = TypeConverter.Vertex2ToPoint(xVertex); myPt.Y = mainCanvas.Height - myPt.Y; wPoly.Points.Add(myPt); } System.Windows.Point myPt2 = TypeConverter.Vertex2ToPoint(xLeader.Hook); myPt2.Y = mainCanvas.Height - myPt2.Y; wPoly.Points.Add(myPt2); if (txtSize.Width > 0) { myPt2.X = myPt2.X + txtSize.Width; wPoly.Points.Add(myPt2); } xLeader.Lineweight = Lineweight.W0; TypeConverter.Entity2Shape(xLeader, wPoly); if (xLeader.ShowArrowhead == true) { System.Windows.Shapes.Polygon arrow = DrawUtils.GetArrowhead(xLeader.Vertexes[0], xLeader.Vertexes[1], mainCanvas); TypeConverter.Entity2Shape(xLeader, arrow); arrow.StrokeThickness = 0.1; arrow.Fill = arrow.Stroke; mainCanvas.Children.Add(arrow); } mainCanvas.Children.Add(wPoly); }
public override void Draw(Canvas canvas) { _points = new PointCollection(); if ((FirstPoint.X < SecondPoint.X) && (FirstPoint.Y < SecondPoint.Y)) { _up.X = FirstPoint.X; _up.Y = FirstPoint.Y; _left.X = FirstPoint.X; _left.Y = SecondPoint.Y; _right.X = SecondPoint.X; _right.Y = SecondPoint.Y; } else if ((FirstPoint.X < SecondPoint.X) && (FirstPoint.Y > SecondPoint.Y)) { _up.X = FirstPoint.X; _up.Y = SecondPoint.Y; _left.X = FirstPoint.X; _left.Y = FirstPoint.Y; _right.X = SecondPoint.X; _right.Y = FirstPoint.Y; } else if ((FirstPoint.X > SecondPoint.X) && (FirstPoint.Y < SecondPoint.Y)) { _up.X = SecondPoint.X; _up.Y = FirstPoint.Y; _left.X = SecondPoint.X; _left.Y = SecondPoint.Y; _right.X = FirstPoint.X; _right.Y = SecondPoint.Y; } else { _up.X = SecondPoint.X; _up.Y = SecondPoint.Y; _left.X = SecondPoint.X; _left.Y = FirstPoint.Y; _right.X = FirstPoint.X; _right.Y = FirstPoint.Y; } _points.Add(_up); _points.Add(_left); _points.Add(_right); var triangle = new System.Windows.Shapes.Polygon() { Points = _points, Stroke = Color, StrokeThickness = Thickness, Tag = Tag }; Tag = triangle.GetHashCode(); canvas.Children.Add(triangle); }
/*Draw Face3d*/ public static void DrawFace3d(Face3d xPoly, Canvas mainCanvas) { System.Windows.Shapes.Polygon wPoly = new System.Windows.Shapes.Polygon(); wPoly.Points.Add(TypeConverter.Vertex3ToPoint(xPoly.FirstVertex, mainCanvas.Height)); wPoly.Points.Add(TypeConverter.Vertex3ToPoint(xPoly.SecondVertex, mainCanvas.Height)); wPoly.Points.Add(TypeConverter.Vertex3ToPoint(xPoly.ThirdVertex, mainCanvas.Height)); wPoly.Points.Add(TypeConverter.Vertex3ToPoint(xPoly.FourthVertex, mainCanvas.Height)); TypeConverter.Entity2Shape(xPoly, wPoly); mainCanvas.Children.Add(wPoly); }
/// <summary> /// Transform the polygonal approximation of the region created in the back end into /// the point collection for the UI Polygon. /// </summary> /// <param name="shading">The UI polygon for the region. Will have its points set.</param> /// <param name="cs">The coordinate system for the UI drawing.</param> private void SetPolygonPoints(System.Windows.Shapes.Polygon shading, CoordinateSystem cs) { //Create the points collection for the polygon PointCollection points = new PointCollection(); foreach (GeometryTutorLib.ConcreteAST.Point p in Region.GetPolygonalized().points) { points.Add(ToPhysical(cs, new Point(p.X, p.Y))); } shading.Points = points; }
public override void Draw(Canvas canvas) { System.Windows.Shapes.Polygon polygon = new System.Windows.Shapes.Polygon { Fill = new SolidColorBrush(FigureColor), Stroke = new SolidColorBrush(LineColor), Points = { Point1, Point2, Point3 } }; canvas.Children.Add(polygon); }
/*Draw Solid*/ public static void DrawSolid(Solid xPoly, Canvas mainCanvas) { System.Windows.Shapes.Polygon wPoly = new System.Windows.Shapes.Polygon(); wPoly.Points.Add(TypeConverter.Vertex2ToPoint(xPoly.FirstVertex, mainCanvas.Height)); wPoly.Points.Add(TypeConverter.Vertex2ToPoint(xPoly.SecondVertex, mainCanvas.Height)); wPoly.Points.Add(TypeConverter.Vertex2ToPoint(xPoly.FourthVertex, mainCanvas.Height)); wPoly.Points.Add(TypeConverter.Vertex2ToPoint(xPoly.ThirdVertex, mainCanvas.Height)); /*TypeConverter.Entity2Shape(xPoly,wPoly);*/ wPoly.Fill = DrawUtils.GetFillBrush(xPoly.getColor(), xPoly.Transparency.Value); mainCanvas.Children.Add(wPoly); }
internal Arrow(Point startPoint, System.Windows.Controls.Canvas canvas) { _startPoint = startPoint; pommel[0] = (new Point(0, -0.75)); //0 startpoint - 0.5 pommel[1] = (new Point(4.5, -5.25)); //1 Pommel pommel[2] = (new Point(9, -5.25)); //2 Pommel pommel[3] = (new Point(13.5, -2.5)); //3 Pommel head[0] = (new Point(-10, -2.5)); //4 head[1] = (new Point(-10, -8.25)); //5 Head upper head[2] = (new Point(0, 0)); //6 Endpoint head[3] = (new Point(-10, 8.25)); //7 Head lower head[4] = (new Point(-10, 2.5)); //8 pommel[4] = (new Point(13.5, 2.5)); //9 Pommel pommel[5] = (new Point(9, 5.25)); //10 Pommel pommel[6] = (new Point(4.5, 5.25)); //11 Pommel pommel[7] = (new Point(0, 0.75)); //12 startpoint + 0.5 arrowPoly = new System.Windows.Shapes.Polygon(); for (int i = 0; i < 4; i++) { arrowPoly.Points.Add(new Point(pommel[i].X + startPoint.X, pommel[i].Y + startPoint.Y)); } for (int i = 0; i < 5; i++) { arrowPoly.Points.Add(new Point(head[i].X + startPoint.X, head[i].Y + startPoint.Y)); } for (int i = 4; i < 8; i++) { arrowPoly.Points.Add(new Point(pommel[i].X + startPoint.X, pommel[i].Y + startPoint.Y)); } headPoly = new System.Windows.Shapes.Polygon(); foreach (Point p in head) { headPoly.Points.Add(p); } pommelPoly = new System.Windows.Shapes.Polygon(); foreach (Point p in pommel) { pommelPoly.Points.Add(p); } canvas.Children.Add(arrowPoly); //canvas.Children.Add(head); //canvas.Children.Add(pommel); arrowPoly.Tag = this; headPoly.Tag = this; pommelPoly.Tag = this; }
public static System.Windows.Shapes.Polygon ToSystemPolygon(Polygon p, Brush stroke, Brush fill) { System.Windows.Shapes.Polygon o = new System.Windows.Shapes.Polygon(); o.StrokeThickness = 2; foreach (IntPoint i in p) { o.Points.Add(new Point(i.X + 0.5 * (o.StrokeThickness % 2), i.Y + 0.5 * (o.StrokeThickness % 2))); } o.Stroke = stroke; o.Fill = fill; return(o); }
/*Draw PolyfaceMesh*/ public static void DrawPolyfaceMesh(PolyfaceMesh xPoly, Canvas mainCanvas) { System.Windows.Shapes.Polygon wPoly = new System.Windows.Shapes.Polygon(); foreach (netDxf.Entities.PolyfaceMeshVertex xVertex in xPoly.Vertexes) { System.Windows.Point myPt = TypeConverter.Vertex3ToPoint(xVertex.Location); getMaxPt(myPt); myPt.Y = mainCanvas.Height - myPt.Y; wPoly.Points.Add(myPt); } TypeConverter.Entity2Shape(xPoly, wPoly); mainCanvas.Children.Add(wPoly); }
/*Draw Wipeout*/ public static void DrawWipeout(Wipeout xPoly, Canvas mainCanvas) { System.Windows.Shapes.Polygon wPoly = new System.Windows.Shapes.Polygon(); foreach (netDxf.Vector2 xVertex in xPoly.ClippingBoundary.Vertexes) { System.Windows.Point myPt = TypeConverter.Vertex2ToPoint(xVertex); getMaxPt(myPt); myPt.Y = mainCanvas.Height - myPt.Y; wPoly.Points.Add(myPt); } TypeConverter.Entity2Shape(xPoly, wPoly); wPoly.Fill = new SolidColorBrush(DXF2WPF.Window_bgColor); mainCanvas.Children.Add(wPoly); }
/// <summary> /// Creates red "invalid" x /// </summary> /// <returns></returns> private System.Windows.Shapes.Shape Invalid() { System.Windows.Shapes.Polygon Cross = new System.Windows.Shapes.Polygon(); Cross.Stroke = Brushes.Red; Cross.Fill = Brushes.Red; Cross.StrokeThickness = 1; #region Cross Points // This is more complicated than it needs to be. If someone could get polyline // drawing (System.Windows.Shapes.Polyline) to work, that would be excellent. // Create a cross System.Windows.Point P1 = new System.Windows.Point(0, HEIGHT / 3.0); System.Windows.Point P2 = new System.Windows.Point(WIDTH / 3.0, HEIGHT / 3.0); System.Windows.Point P3 = new System.Windows.Point(WIDTH / 3.0, 0); System.Windows.Point P4 = new System.Windows.Point(2 * WIDTH / 3.0, 0); System.Windows.Point P5 = new System.Windows.Point(2 * WIDTH / 3.0, HEIGHT / 3.0); System.Windows.Point P6 = new System.Windows.Point(WIDTH, HEIGHT / 3.0); System.Windows.Point P7 = new System.Windows.Point(WIDTH, 2 * HEIGHT / 3.0); System.Windows.Point P8 = new System.Windows.Point(2 * WIDTH / 3.0, 2 * HEIGHT / 3.0); System.Windows.Point P9 = new System.Windows.Point(2 * WIDTH / 3.0, HEIGHT); System.Windows.Point P10 = new System.Windows.Point(WIDTH / 3.0, HEIGHT); System.Windows.Point P11 = new System.Windows.Point(WIDTH / 3.0, 2 * HEIGHT / 3.0); System.Windows.Point P12 = new System.Windows.Point(0, 2 * HEIGHT / 3.0); PointCollection CrossPoints = new PointCollection(); CrossPoints.Add(P1); CrossPoints.Add(P2); CrossPoints.Add(P3); CrossPoints.Add(P4); CrossPoints.Add(P5); CrossPoints.Add(P6); CrossPoints.Add(P7); CrossPoints.Add(P8); CrossPoints.Add(P9); CrossPoints.Add(P10); CrossPoints.Add(P11); CrossPoints.Add(P12); // Ok, now rotate it for (int i = 0; i < 12; i++) { double X = WIDTH / 2.0 + ((CrossPoints[i].X - WIDTH / 2.0) * Math.Cos(Math.PI / 4.0) - (CrossPoints[i].Y - HEIGHT / 2.0) * Math.Sin(Math.PI / 4.0)); double Y = WIDTH / 2.0 + ((CrossPoints[i].X - WIDTH / 2.0) * Math.Sin(Math.PI / 4.0) + (CrossPoints[i].Y - HEIGHT / 2.0) * Math.Cos(Math.PI / 4.0)); CrossPoints[i] = new System.Windows.Point(X, Y); } #endregion Cross.Points = CrossPoints; return(Cross); }
public override bool Draw(Canvas canvas, Brush fillColor, Brush strokeColor, double strokeThickness, PointCollection points) { var polygon = new System.Windows.Shapes.Polygon { Points = points, Fill = fillColor, VerticalAlignment = VerticalAlignment.Center, Stroke = strokeColor, StrokeThickness = strokeThickness }; canvas.Children.Add(polygon); return(false); }
/// <summary> /// Determines the point (as a polygon) at a specified coordinate /// </summary> protected static System.Windows.Shapes.Polygon PointPolygonFor(Coordinate coord, double angle, double size, Brush brush) { var polygon = new System.Windows.Shapes.Polygon(); var cd1 = Coordinate.NewAtDistanceAngleFrom(coord, size, angle - Math.PI / 2.0 + Math.PI / 10); var cd2 = Coordinate.NewAtDistanceAngleFrom(coord, size, angle - Math.PI / 2.0 - Math.PI / 10); polygon.Points = new System.Windows.Media.PointCollection(); polygon.Points.Add(new System.Windows.Point(coord.X, coord.Y)); polygon.Points.Add(new System.Windows.Point(cd1.X, cd1.Y)); polygon.Points.Add(new System.Windows.Point(cd2.X, cd2.Y)); polygon.Points.Add(new System.Windows.Point(coord.X, coord.Y)); polygon.Stroke = brush; polygon.Fill = brush; return(polygon); }
public static System.Windows.Shapes.Polygon GetArrowhead(Vector2 p1, Vector2 p2, Canvas mainCanvas) { System.Windows.Shapes.Polygon wPoly = new System.Windows.Shapes.Polygon(); Vector2 A1 = p2 - p1; Vector2 A2 = new Vector2(0, 10); System.Windows.Point p = new System.Windows.Point(); /*DrawUtils.DrawPoint(p1,mainCanvas,Colors.Green,10,0.1); * /*DrawUtils.DrawPoint(p2,mainCanvas,Colors.Red,10,0); * DrawUtils.DrawPoint(A1,mainCanvas,Colors.Yellow,10,0);*/ wPoly.Points.Add(TypeConverter.Vertex2ToPoint(p1, mainCanvas.Height)); p.X = p1.X + 0.5; p.Y = mainCanvas.Height - (p1.Y + 3); wPoly.Points.Add(p); p.X = p1.X - 0.5; p.Y = mainCanvas.Height - (p1.Y + 3); wPoly.Points.Add(p); wPoly.Points.Add(TypeConverter.Vertex2ToPoint(p1, mainCanvas.Height)); double a1 = 0; /*Vector2.Angle(p1)*(180/Math.PI)*/ if (p1.X > p2.X) { a1 = -Vector2.AngleBetween(A1, A2) * (180 / Math.PI); } else { a1 = Vector2.AngleBetween(A2, A1) * (180 / Math.PI); } RotateTransform rotat = new RotateTransform(a1); rotat.CenterX = p1.X; rotat.CenterY = mainCanvas.Height - p1.Y; wPoly.RenderTransform = rotat; return(wPoly); }
/// <summary> /// Do the actual projection of the supplied polygon into the canvas /// Before the actual projection the polyhedron is rotation by the yaw angle around a vertical Y axis through the pivot point /// at the center of the root Face. /// The viewpoint is raised vertically and turned to look down towards the polyhedron (an X axis rotation) /// The the persective transformation is applied before the Polygons are generated. The z dimension in Vector3 /// is used to generate the z-index in the xaml polygons /// </summary> /// <param name="polyhedron"></param> /// <param name="yaw"></param> /// <param name="pivot"></param> /// <param name="mag"></param> /// <param name="canvas"></param> public static void Project(Polyhedron polyhedron, float yaw, Vector3 pivot, float mag, Canvas canvas) { float angle = (float)Math.PI / 4; float w = spread(polyhedron, pivot) * mag; Vector3 viewPoint = new Vector3(0, w * 0.6f, w); pivot.Y = -w / 2; if (polyhedron.Faces.Count <= 8) { pivot.Y += w / 4; } Matrix projection = Matrix.Translation(-pivot) * Matrix.RotationY(yaw) * Matrix.RotationX(angle) * Matrix.Translation(viewPoint) * Geometry.Perspective(5); Canvas childCanvas = new Canvas(); childCanvas.Width = canvas.Width; childCanvas.Height = canvas.Height; Vector3 projectedPivot = Vector3.TransformCoordinate(pivot, projection); foreach (Face face in polyhedron.Faces) { Vector3[] p = Vector3.TransformCoordinate(face.Points, projection); Vector3 c = Geometry.Center(p); int zIndex = -(int)(c.Z * int.MaxValue / 200); System.Windows.Shapes.Polygon pg = new System.Windows.Shapes.Polygon(); pg.SetValue(Canvas.ZIndexProperty, zIndex); Point[] points = Geometry.Vector3ToPoint(p, projectedPivot.X - w / 2, projectedPivot.Y - w / 2, w, (float)canvas.Width, (float)canvas.Height); //pg.Points. = points; ////// CHANGE !!!! foreach (Point pt in points) { pg.Points.Add(pt); } pg.StrokeThickness = 1; pg.Stroke = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Black); System.Windows.Media.Color col = PolyhedronPalette.Lookup(face.NumSides); pg.Fill = new System.Windows.Media.SolidColorBrush(col); pg.Opacity = 0.8; childCanvas.Children.Add(pg); } canvas.Children.Clear(); canvas.Children.Add(childCanvas); }
/*Draw Mesh*/ public static void DrawMesh(Mesh xMesh, Canvas mainCanvas) { System.Windows.Shapes.Polygon wPoly = new System.Windows.Shapes.Polygon(); foreach (netDxf.Entities.MeshEdge xEdge in xMesh.Edges) { System.Windows.Point myPt1 = TypeConverter.Vertex3ToPoint(xMesh.Vertexes[xEdge.StartVertexIndex]); System.Windows.Point myPt2 = TypeConverter.Vertex3ToPoint(xMesh.Vertexes[xEdge.EndVertexIndex]); myPt1.Y = mainCanvas.Height - myPt1.Y; myPt2.Y = mainCanvas.Height - myPt2.Y; System.Windows.Shapes.Line wLine = DrawUtils.GetLine(myPt1.X, myPt1.Y, myPt2.X, myPt2.Y); TypeConverter.Entity2Shape(xMesh, wLine); mainCanvas.Children.Add(wLine); } }
public LandPlot(ICollection <System.Windows.Shapes.Polyline> polylines, LandInfo landInfo) { Polylines = polylines; LandInfo = landInfo; tempPints = new List <System.Windows.Point>(); foreach (var polyline in polylines) { tempPints.AddRange(polyline.Points); } Polygon = new System.Windows.Shapes.Polygon { Stroke = Brushes.Red, StrokeThickness = 2, Points = new PointCollection(), Fill = Brushes.White, }; GetSortPoint(); }
public override UIElement Draw() { System.Windows.Shapes.Polygon myPolygon = new System.Windows.Shapes.Polygon(); myPolygon.Stroke = System.Windows.Media.Brushes.Black; myPolygon.Fill = System.Windows.Media.Brushes.Transparent; double angleRadians = this.Angle * (Math.PI / 180.0); System.Windows.Point Point3 = new System.Windows.Point(this.sideWidth2 * Math.Cos(angleRadians), 0); System.Windows.Point Point1 = new System.Windows.Point(0, this.sideWidth2 * Math.Sin(angleRadians)); System.Windows.Point Point2 = new System.Windows.Point(this.sideWidth1 * Math.Cos(0), this.sideWidth1 * Math.Sin(0) + this.sideWidth2 * Math.Sin(angleRadians)); PointCollection myPointCollection = new PointCollection(); myPointCollection.Add(Point1); myPointCollection.Add(Point2); myPointCollection.Add(Point3); myPolygon.Points = myPointCollection; System.Windows.Controls.Canvas.SetLeft(myPolygon, this.Left); System.Windows.Controls.Canvas.SetTop(myPolygon, this.Top); return((UIElement)myPolygon); }
/// <summary> /// Draw the shaded region as an approximated polygon and return the polygon /// The Zindex, Top, and Left attributes will also be set and the shading will be added to the drawing. /// </summary> /// <param name="drawing">The current drawing</param> /// <param name="shadingBrush">The brush to shade the region with</param> /// <returns>The graphical representation of the region.</returns> public UIElement Draw(Drawing drawing, Brush shadingBrush) { //Create the polygon with the correct physical points Shading = new System.Windows.Shapes.Polygon(); SetPolygonPoints(Shading, drawing.CoordinateSystem); //Color the polygon Shading.Fill = shadingBrush; Shading.Stroke = new SolidColorBrush(Colors.DarkGray); Shading.StrokeThickness = 1; //Orient the polygon Canvas.SetTop(Shading, 0); Canvas.SetLeft(Shading, 0); Canvas.SetZIndex(Shading, (int)ZOrder.Shading); //Add to the drawing drawing.AddRegionShading(this); return(Shading); }
public static System.Windows.Shapes.Polygon Polygon(this List <LineSegment> list) { System.Windows.Shapes.Polygon polygon = new System.Windows.Shapes.Polygon(); if (list[0].PointA == list[list.Count - 1].PointB) { polygon.Points.Add(list[0].PointA); for (int i = 1; i < list.Count; i++) { if (list[i - 1].PointB == list[i].PointA) { polygon.Points.Add(list[i].PointA); } else { return(null); } } return(polygon); } return(null); }
public override void DrawOnto(Canvas ShapeCanvas, int x, int y) { System.Windows.Shapes.Polygon myPolygon = new System.Windows.Shapes.Polygon(); myPolygon.Stroke = System.Windows.Media.Brushes.Tomato; myPolygon.Fill = System.Windows.Media.Brushes.Bisque; myPolygon.StrokeThickness = 2; myPolygon.HorizontalAlignment = HorizontalAlignment.Left; myPolygon.VerticalAlignment = VerticalAlignment.Center; Point point1 = new Point(10, 50); Point point2 = new Point(10, 80); Point point3 = new Point(50, 80); Point point4 = new Point(50, 50); PointCollection myPointCollection = new PointCollection(); myPointCollection.Add(point1); myPointCollection.Add(point2); myPointCollection.Add(point3); myPointCollection.Add(point4); myPolygon.Points = myPointCollection; ShapeCanvas.Children.Add(myPolygon); }
public void CreateAPolygon(float x, float y) { // Create a blue and a black Brush SolidColorBrush yellowBrush = new SolidColorBrush(); yellowBrush.Color = Colors.Yellow; SolidColorBrush blackBrush = new SolidColorBrush(); blackBrush.Color = Colors.Black; // Create a Polygon System.Windows.Shapes.Polygon yellowPolygon = new System.Windows.Shapes.Polygon(); yellowPolygon.Stroke = blackBrush; yellowPolygon.Fill = yellowBrush; yellowPolygon.StrokeThickness = 1; int ammount = 5; // Create a collection of points for a polygon System.Windows.Point Point1 = new System.Windows.Point(x - ammount, y - ammount); System.Windows.Point Point2 = new System.Windows.Point(x - ammount, y + ammount); System.Windows.Point Point3 = new System.Windows.Point(x + ammount, y - ammount); System.Windows.Point Point4 = new System.Windows.Point(x + ammount, y + ammount); PointCollection polygonPoints = new PointCollection(); polygonPoints.Add(Point1); polygonPoints.Add(Point2); polygonPoints.Add(Point3); polygonPoints.Add(Point4); // Set Polygon.Points properties yellowPolygon.Points = polygonPoints; // Add Polygon to the page MainWindow.mainGrid.Children.Add(yellowPolygon); }
public override void DrawOnto(System.Windows.Controls.Canvas ShapeCanvas, int x, int y) { double rectwidth = Convert.ToDouble(width); double rectheight = Convert.ToDouble(height); System.Windows.Shapes.Polygon myPolygon = new System.Windows.Shapes.Polygon(); myPolygon.Stroke = System.Windows.Media.Brushes.Tomato; myPolygon.Fill = System.Windows.Media.Brushes.Bisque; myPolygon.StrokeThickness = 2; Point point1 = new Point(x, y); Point point2 = new Point(x, y + rectheight); Point point3 = new Point(x + rectwidth, y + rectheight); Point point4 = new Point(x + rectwidth, y); PointCollection myPointCollection = new PointCollection(); myPointCollection.Add(point1); myPointCollection.Add(point2); myPointCollection.Add(point3); myPointCollection.Add(point4); myPolygon.Points = myPointCollection; ShapeCanvas.Children.Add(myPolygon); }
/// <summary> /// Draw the shaded region as an approximated polygon and return the polygon /// The Zindex, Top, and Left attributes will also be set and the shading will be added to the drawing. /// </summary> /// <param name="drawing">The current drawing</param> /// <param name="shadingBrush">The brush to shade the region with</param> /// <returns>The graphical representation of the region.</returns> public UIElement Draw(Drawing drawing, Brush shadingBrush) { //Create the polygon with the correct physical points Shading = new System.Windows.Shapes.Polygon(); SetPolygonPoints(Shading, drawing.CoordinateSystem); //Color the polygon Shading.Fill = shadingBrush; Shading.Stroke = new SolidColorBrush(Colors.DarkGray); Shading.StrokeThickness = 1; //Orient the polygon Canvas.SetTop(Shading, 0); Canvas.SetLeft(Shading, 0); Canvas.SetZIndex(Shading, (int)ZOrder.Shading); //Add to the drawing drawing.AddRegionShading(this); return Shading; }
public void AddShapefile(string filePath, GroupLayer curGrLayer) { Execute.OnUIThread(() => { var grLay = new ShapeGraphicsLayer(filePath); //var grLay = new GraphicsLayer(); var fi = new FileInfo(filePath); var settingsXml = fi.Directory + "/" + fi.Name + ".xml"; var settings = new ShapeLayerSettings(); if (File.Exists(settingsXml)) { settings = GetSettings(settingsXml); } grLay.ID = fi.Name; grLay.Visible = false; grLay.Initialize(); curGrLayer.ChildLayers.Add(grLay); using (var shapeFile = new Shapefile.Shapefile(filePath)) { foreach (var shape in shapeFile) { //string[] metadataNames = shape.GetMetadataNames(); // if (metadataNames != null) // { // Console.WriteLine("Metadata:"); // var str = string.Empty; // foreach (string metadataName in metadataNames) // { // str += String.Format("{0}={1} ({2})", metadataName, shape.GetMetadata(metadataName), shape.DataRecord.GetDataTypeName(shape.DataRecord.GetOrdinal(metadataName))) + Environment.NewLine; // } // Console.WriteLine(); // } switch (shape.Type) { case ShapeType.Polygon: var shapePolygon = shape as ShapePolygon; if (shapePolygon != null) foreach (var part in shapePolygon.Parts) { //Console.WriteLine("Polygon part:"); var wpfShape = new System.Windows.Shapes.Polygon(); var points = new System.Windows.Media.PointCollection(); foreach (var point in part) { //Console.WriteLine("{0}, {1}", point.X, point.Y); double lat, lon; //lat = point.Y; //lon = point.X; CoordinateUtils.Rd2LonLat(point.X, point.Y, out lon, out lat); wpfShape.Points.Add(new Point(lon, lat)); points.Add(new Point(lon, lat)); } shapeList.Add(wpfShape); DrawPolygon(points, grLay, settings); } break; case ShapeType.PolyLine: var shapePolyline = shape as ShapePolyLine; if (shapePolyline != null) foreach (var part in shapePolyline.Parts) { //Console.WriteLine("Polygon part:"); var wpfShape = new System.Windows.Shapes.Polygon(); var points = new System.Windows.Media.PointCollection(); foreach (var point in part) { //Console.WriteLine("{0}, {1}", point.X, point.Y); //CoordinateUtils.Rd2LonLat(point.X,point.Y,out lon, out lat); var lat = point.Y; var lon = point.X; wpfShape.Points.Add(new Point(lon, lat)); points.Add(new Point(lon, lat)); } shapeList.Add(wpfShape); DrawPolyline(points, grLay, settings); } break; } } } }); }