// 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 Player(Color paramColor, List <WriteableBitmap> paramBitmap, double[] paramXY, double[] paramWorldWidthHeight, int paramLives, string paramCodeString, bool paramIsPuter, Key[] paramKeyActions, double paramWorldToScreenOffsetX, double paramWorldToScreenOffsetY) : base(paramBitmap, paramXY, paramWorldWidthHeight, 0, 0, paramWorldToScreenOffsetX, paramWorldToScreenOffsetY) { xVelocity = 0; yVelocity = 0; isPuter = paramIsPuter; _scoreOrLives = paramLives; color = paramColor; brush = new System.Windows.Media.SolidColorBrush(color.tomediacolor()); playerScriptON = paramIsPuter; playerCodeString = paramCodeString; keyActions = paramKeyActions; if (isPuter) { doUpdateBehaviour(); } }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { System.Windows.Media.Color colorPrimaryScreening = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#F9EDFA"); System.Windows.Media.Color colorCytotechReview = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#F7F8DD"); System.Windows.Media.Color colorPathologistReview = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#F7F8DD"); System.Windows.Media.SolidColorBrush whiteBrush = System.Windows.Media.Brushes.WhiteSmoke; System.Windows.Media.SolidColorBrush primaryScreeningBrush = new System.Windows.Media.SolidColorBrush(colorPrimaryScreening); System.Windows.Media.SolidColorBrush cytotechReviewBrush = new System.Windows.Media.SolidColorBrush(colorCytotechReview); System.Windows.Media.SolidColorBrush pathologistReviewBrush = new System.Windows.Media.SolidColorBrush(colorPathologistReview); string screeningType = (string)value; System.Windows.Media.SolidColorBrush result = null; switch (screeningType) { case "Primary Screening": result = primaryScreeningBrush; break; case "Cytotech Review": result = cytotechReviewBrush; break; case "Pathologist Review": result = pathologistReviewBrush; break; default: result = whiteBrush; break; } return result; }
// C'tor internal Player(Definitions.GameDef g, string name, byte id, ulong pkey) { // Init fields this.name = name; this.Id = id; this.PublicKey = pkey; // Register the player all.Add(this); OnPropertyChanged("Color"); // Create the color brushes solidBrush = new System.Windows.Media.SolidColorBrush(Color); solidBrush.Freeze(); transparentBrush = new System.Windows.Media.SolidColorBrush(Color); transparentBrush.Opacity = 0.4; transparentBrush.Freeze(); OnPropertyChanged("Brush"); OnPropertyChanged("TransparentBrush"); // Create counters counters = new Counter[g.PlayerDefinition.Counters != null ? g.PlayerDefinition.Counters.Length : 0]; for (int i = 0; i < Counters.Length; i++) Counters[i] = new Counter(this, g.PlayerDefinition.Counters[i]); // Create variables Variables = new Dictionary<string, int>(); foreach (var varDef in g.Variables.Where(v => !v.Global)) Variables.Add(varDef.Name, varDef.DefaultValue); // Create a hand, if any if (g.PlayerDefinition.Hand != null) hand = new Hand(this, g.PlayerDefinition.Hand); // Create groups groups = new Group[g.PlayerDefinition.Groups != null ? g.PlayerDefinition.Groups.Length + 1 : 1]; groups[0] = hand; for (int i = 1; i < IndexedGroups.Length; i++) groups[i] = new Pile(this, g.PlayerDefinition.Groups[i - 1]); // Raise the event if (PlayerAdded != null) PlayerAdded(null, new PlayerEventArgs(this)); }
public void Compare_BrushWithBrushString_AreEqual() { System.Windows.Media.SolidColorBrush brush = System.Windows.Media.Brushes.Red; bool result = ComparisonLogic.EvaluateImpl(brush, ComparisonConditionType.Equal, "Red"); Assert.IsTrue(result, "Red brush should equal 'Red'"); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Media.SolidColorBrush solidColorBrush1 = new System.Windows.Media.SolidColorBrush(); this.dopGraph = new LiveCharts.WinForms.CartesianChart(); this.SuspendLayout(); // // dopGraph // this.dopGraph.Dock = System.Windows.Forms.DockStyle.Fill; this.dopGraph.Hoverable = true; this.dopGraph.Location = new System.Drawing.Point(0, 0); this.dopGraph.Name = "dopGraph"; solidColorBrush1.Color = System.Windows.Media.Color.FromArgb(((byte)(30)), ((byte)(30)), ((byte)(30)), ((byte)(30))); this.dopGraph.ScrollBarFill = solidColorBrush1; this.dopGraph.ScrollHorizontalFrom = 0D; this.dopGraph.ScrollHorizontalTo = 0D; this.dopGraph.ScrollMode = LiveCharts.ScrollMode.None; this.dopGraph.ScrollVerticalFrom = 0D; this.dopGraph.ScrollVerticalTo = 0D; this.dopGraph.Size = new System.Drawing.Size(538, 337); this.dopGraph.TabIndex = 0; this.dopGraph.Text = "cartesianChart1"; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(538, 337); this.Controls.Add(this.dopGraph); this.Name = "Form1"; this.Text = "Form1"; this.ResumeLayout(false); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { System.Windows.Media.Color colorFinal = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#000000"); System.Windows.Media.Color colorNotFinal = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#E10A38"); System.Windows.Media.SolidColorBrush brushFinal = new System.Windows.Media.SolidColorBrush(colorFinal); System.Windows.Media.SolidColorBrush brushNotFinal = new System.Windows.Media.SolidColorBrush(colorNotFinal); YellowstonePathology.Business.Interface.IPanelSetOrder panelSetOrder = (YellowstonePathology.Business.Interface.IPanelSetOrder)value; if (panelSetOrder != null) { if (panelSetOrder.Final == true) { return(brushFinal); } else { return(brushNotFinal); } } else { return(colorFinal); } }
public void HighLight(System.Windows.Media.DrawingContext dc) { System.Windows.Media.SolidColorBrush brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Gray); System.Windows.Media.Pen pen = new System.Windows.Media.Pen(brush, 1); dc.DrawEllipse(brush, pen, new System.Windows.Point(x * 50 + 25, y * 50 + 25), 20, 20); }
private void UpdateBackgroundGridDisplay() { this.GridCanvas.Children.Clear(); if (this.ButtonGrid != null) { var brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(128, 255, 255, 255)); for (int i = 1; i < this.ButtonGrid.GridWidth; i++) { var line = new System.Windows.Shapes.Line(); line.Stroke = brush; //line.Width = 1; double x = (this.GridCanvas.Width * i) / this.ButtonGrid.GridWidth; line.X1 = x; line.Y1 = 0; line.X2 = x; line.Y2 = this.GridCanvas.Height; this.GridCanvas.Children.Add(line); } for (int i = 1; i < this.ButtonGrid.GridHeight; i++) { var line = new System.Windows.Shapes.Line(); line.Stroke = brush; //line.Width = 1; double y = (this.GridCanvas.Height * i) / this.ButtonGrid.GridHeight; line.X1 = 0; line.Y1 = y; line.X2 = this.GridCanvas.Width; line.Y2 = y; this.GridCanvas.Children.Add(line); } } }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { DateTime incomingDate; bool parsed = DateTime.TryParse(value.ToString(), out incomingDate); Nullable <DateTime> processorStartTime; if (parsed == true) { processorStartTime = new DateTime(incomingDate.Ticks); } else { processorStartTime = null; } System.Windows.Media.SolidColorBrush result = System.Windows.Media.Brushes.Blue; if (processorStartTime.HasValue == true) { if (processorStartTime.Value.Day >= DateTime.Today.Day) { result = System.Windows.Media.Brushes.Red; } } return(result); }
public void SetStrokeColor(Color color) { var c = System.Windows.Media.Color.FromArgb((byte)color.A, (byte)color.R, (byte)color.G, (byte)color.B); _strokeColor = new System.Windows.Media.SolidColorBrush(c); _stroke.Brush = _strokeColor; }
public void SetInteriorColor(System.Windows.Media.SolidColorBrush brush) { bool was_running = Writer.IsRunning(); if (was_running) { Writer.Stop(); } //change out the color! CurrentAnimations.Clear(); AnimationDescriptor desc = new AnimationDescriptor(); desc.Animation = new SolidColor(new Color(brush.Color.R, brush.Color.G, brush.Color.B), 50); desc.CurrentFrame = 0; desc.Chain = PortSide; CurrentAnimations.Add(desc); desc = new AnimationDescriptor(); desc.Animation = new SolidColor(new Color(brush.Color.R, brush.Color.G, brush.Color.B), 50); desc.CurrentFrame = 0; desc.Chain = StarbordSide; CurrentAnimations.Add(desc); if (was_running) { Writer.Start(ComPort); } }
/// <summary> /// Apply Blur Effect on the window /// </summary> /// <param name="win">parent window</param> public static void ApplyEffect(this System.Windows.Window win) { // Create new effective objects System.Windows.Media.Effects.BlurEffect objBlur = new System.Windows.Media.Effects.BlurEffect { Radius = 5 }; System.Windows.Media.SolidColorBrush mask = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.DarkGray) { Opacity = 50 }; // Buffering ... effectBuffer = win.Effect; brushBuffer = win.OpacityMask; // in windows 10, the dispatcher way doesn't seem to work anymore if (Environment.OSVersion.Version.Major >= 10) { win.Effect = objBlur; win.OpacityMask = mask; } else { // Change this.win effective objects win.Dispatcher.Invoke(new Action(delegate { win.Effect = objBlur; }), System.Windows.Threading.DispatcherPriority.Normal); win.Dispatcher.Invoke(new Action(delegate { win.OpacityMask = mask; }), System.Windows.Threading.DispatcherPriority.Normal); } }
public static Brush ToMapsui(this System.Windows.Media.SolidColorBrush brush) { var c = brush.Color.ToMapsui(); var b = new Brush(c); return(b); }
public ActionBaseList(string action, string detial, SolidColorBrush C1, SolidColorBrush C2) { Action = action; Detial = detial; Color1 = (C1); Color2 = (C2); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Windows.Media.SolidColorBrush solidColorBrush1 = new System.Windows.Media.SolidColorBrush(); this.cartesianChart1 = new LiveCharts.WinForms.CartesianChart(); this.SuspendLayout(); // // cartesianChart1 // this.cartesianChart1.Hoverable = true; this.cartesianChart1.Location = new System.Drawing.Point(12, 12); this.cartesianChart1.Name = "cartesianChart1"; solidColorBrush1.Color = System.Windows.Media.Color.FromArgb(((byte)(30)), ((byte)(30)), ((byte)(30)), ((byte)(30))); this.cartesianChart1.ScrollBarFill = solidColorBrush1; this.cartesianChart1.ScrollHorizontalFrom = 0D; this.cartesianChart1.ScrollHorizontalTo = 0D; this.cartesianChart1.ScrollMode = LiveCharts.ScrollMode.None; this.cartesianChart1.ScrollVerticalFrom = 0D; this.cartesianChart1.ScrollVerticalTo = 0D; this.cartesianChart1.Size = new System.Drawing.Size(1172, 787); this.cartesianChart1.TabIndex = 0; this.cartesianChart1.Text = "cartesianChart1"; // // ErrorLineChart // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1184, 811); this.Controls.Add(this.cartesianChart1); this.Name = "ErrorLineChart"; this.Text = "ErrorLineChart"; this.ResumeLayout(false); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { YellowstonePathology.Business.TrackedItemStatusEnum slideStatus = (YellowstonePathology.Business.TrackedItemStatusEnum)Enum.Parse(typeof(YellowstonePathology.Business.TrackedItemStatusEnum), value.ToString()); System.Windows.Media.SolidColorBrush result = System.Windows.Media.Brushes.Yellow; switch (slideStatus) { case YellowstonePathology.Business.TrackedItemStatusEnum.Created: result = System.Windows.Media.Brushes.Gray; break; case YellowstonePathology.Business.TrackedItemStatusEnum.PrintRequested: result = System.Windows.Media.Brushes.MediumPurple; break; case YellowstonePathology.Business.TrackedItemStatusEnum.Printed: result = System.Windows.Media.Brushes.Yellow; break; case YellowstonePathology.Business.TrackedItemStatusEnum.Validated: result = System.Windows.Media.Brushes.Green; break; case YellowstonePathology.Business.TrackedItemStatusEnum.ClientAccessioned: result = System.Windows.Media.Brushes.SteelBlue; break; default: result = System.Windows.Media.Brushes.Gray; break; } return(result); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string result = string.Empty; if (value != null) { DateTime collectionDateTime = DateTime.Parse(value.ToString()); if (YellowstonePathology.Business.Helper.DateTimeExtensions.DoesDateHaveTime(collectionDateTime) == true) { result = "#5CF353"; } else { result = "#EAF353"; } } else { result = "#F35364"; } System.Windows.Media.BrushConverter brushConverter = new System.Windows.Media.BrushConverter(); System.Windows.Media.SolidColorBrush brush = brushConverter.ConvertFromString(result) as System.Windows.Media.SolidColorBrush; return(brush); }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string item = value.ToString(); System.Windows.Media.SolidColorBrush result = System.Windows.Media.Brushes.Yellow; switch (item) { case "Created": result = System.Windows.Media.Brushes.White; break; case "Printed": result = System.Windows.Media.Brushes.Red; break; case "Validated": result = System.Windows.Media.Brushes.Green; break; case "PrintRequested": result = System.Windows.Media.Brushes.MediumPurple; break; } return(result); }
public void SetQPreview() { Preview = QuestionSelect.TextMD; BorderColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(0, 0, 0)); //CurrentChoice = new ChoiceSelector(); BtnChooseVisibility = Visibility.Collapsed; }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { System.Windows.Media.Color colorFinal = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#000000"); System.Windows.Media.Color colorNotFinal = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#E10A38"); System.Windows.Media.SolidColorBrush brushFinal = new System.Windows.Media.SolidColorBrush(colorFinal); System.Windows.Media.SolidColorBrush brushNotFinal = new System.Windows.Media.SolidColorBrush(colorNotFinal); YellowstonePathology.Business.Interface.IPanelSetOrder panelSetOrder = (YellowstonePathology.Business.Interface.IPanelSetOrder)value; if (panelSetOrder != null) { if (panelSetOrder.Final == true) { return brushFinal; } else { return brushNotFinal; } } else { return colorFinal; } }
public override IText AddText(string text, double fontSize, System.Windows.Media.SolidColorBrush brush) { if (cachedTypeface == null) { cachedTypeface = CreateTypeface(); } LOGFONT logfont = new LOGFONT(); logfont.lfFaceName = cachedTypeface.FontFamily.Source; logfont.lfHeight = -(int)fontSize; //logfont.lfOutPrecision = 4; //logfont.lfQuality = 5; MyText myText = new MyText { parent = this, text = text, color = brush.Color.R | (brush.Color.G << 8) | (brush.Color.B << 16), font = CreateFontIndirect(ref logfont) }; //myText.brush = new SolidBrush(myText.color); texts.Add(myText); return(myText); }
public MainWindow() { InitializeComponent(); MemoryMap = new Bitmap(256, 256); for (int y = 0; y < MemoryMap.Height; y++) { for (int x = 0; x < MemoryMap.Width; x++) { MemoryMap.SetPixel(x, y, Color.FromKnownColor(KnownColor.Blue)); } } MemoryMapImage.Source = loadBitmap(MemoryMap); for (int i = 0; i < 64; i++) { Button button = new Button(); button.MouseDown += button_MouseDown; button.Content = String.Format("Kleur: {0}",Convert.ToString(i,16).ToUpper()); button.Foreground = System.Windows.Media.Brushes.Red; byte grayvalue = (byte)Conv6to8(i); System.Windows.Media.SolidColorBrush mySolidColorBrush = new System.Windows.Media.SolidColorBrush(); mySolidColorBrush.Color = System.Windows.Media.Color.FromArgb(255, grayvalue, grayvalue, grayvalue); button.Background = mySolidColorBrush; button.BorderThickness = new Thickness(0); ColorStack.Children.Add(button); } }
public override IText AddText(string text, double fontSize, System.Windows.Media.SolidColorBrush brush) { if (cachedTypeface == null) { cachedTypeface = CreateTypeface(); } var textFormat = d2d.DirectWriteFactory.CreateTextFormat( cachedTypeface.FontFamily.Source, FontWeight.Normal, FontStyle.Normal, FontStretch.Normal, (float)fontSize); textFormat.TextAlignment = TextAlignment.Leading; textFormat.ParagraphAlignment = ParagraphAlignment.Near; var textLayout = d2d.DirectWriteFactory.CreateTextLayout( text, textFormat, 300, 100); MyText myText = new MyText { parent = this, textFormat = textFormat, textLayout = textLayout, color = Color.FromRGB(brush.Color.R / 255f, brush.Color.G / 255f, brush.Color.B / 255f) }; texts.Add(myText); return(myText); }
private static void ChangeColoristics(System.Windows.Media.SolidColorBrush color) { MainWindow.Instance.TopBar.Background = color; MainWindow.Instance.ExitButton.Background = color; MainWindow.Instance.MinimizeButton.Background = color; MainWindow.Instance.MaximizeButton.Background = color; }
public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value == null) { return(Binding.DoNothing); } if (typeof(System.Windows.Media.Brush).IsAssignableFrom(targetType)) { if (value is Color) { Color drawingColor = (Color)value; return(Convert(drawingColor)); } } if (targetType == typeof(Color)) { if (value is System.Windows.Media.SolidColorBrush) { System.Windows.Media.SolidColorBrush mediaBrush = (System.Windows.Media.SolidColorBrush)value; return(ConvertBack(mediaBrush)); } } return(Binding.DoNothing); }
public static void UpdateBorderBrush(object sender, System.Windows.Media.SolidColorBrush brush) { if (sender is System.Windows.Controls.Border) { (sender as System.Windows.Controls.Border).BorderBrush = brush; } }
/// <summary> /// Displays the UI for value selection. /// </summary> public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value) { /* * PropertiesUtils.PropertyWrapper pw; * if ((pw = context.PropertyDescriptor as PropertiesUtils.PropertyWrapper) == null) * return value; * * DependencyObject depObj; * DependencyProperty depProp; * pw.GetWpfObjects(out depObj, out depProp); * if (depObj == null || depProp == null) * return value; */ IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { System.Windows.Forms.ColorDialog cd = new System.Windows.Forms.ColorDialog(); if (cd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { System.Windows.Media.SolidColorBrush scb = new System.Windows.Media.SolidColorBrush(); scb.Color = System.Windows.Media.Color.FromArgb( cd.Color.A, cd.Color.R, cd.Color.G, cd.Color.B); return(scb); } } return(value); }
internal static void RefreshThemeCache() { DocumentPageColor = CommonDocumentColors.PageColorKey.GetGdiColor(); DocumentPageBrush = new WpfBrush(DocumentPageColor.ToWpfColor()); DocumentTextColor = CommonDocumentColors.PageTextColorKey.GetGdiColor(); DocumentTextBrush = new WpfBrush(DocumentTextColor.ToWpfColor()); FileTabProvisionalSelectionBrush = EnvironmentColors.FileTabProvisionalSelectedActiveBrushKey.GetWpfBrush(); ToolWindowBackgroundColor = EnvironmentColors.ToolWindowBackgroundColorKey.GetGdiColor(); TitleBackgroundColor = EnvironmentColors.MainWindowActiveCaptionColorKey.GetWpfColor(); TitleTextBrush = EnvironmentColors.MainWindowActiveCaptionTextBrushKey.GetWpfBrush(); ToolTipBackgroundBrush = EnvironmentColors.ToolTipBrushKey.GetWpfBrush(); ToolWindowTextBrush = EnvironmentColors.ToolWindowTextBrushKey.GetWpfBrush(); ToolWindowBackgroundBrush = EnvironmentColors.ToolWindowBackgroundBrushKey.GetWpfBrush(); MenuTextBrush = EnvironmentColors.SystemMenuTextBrushKey.GetWpfBrush(); MenuBackgroundBrush = EnvironmentColors.SystemMenuBrushKey.GetWpfBrush(); MenuHoverBorderBrush = EnvironmentColors.CommandBarMenuItemMouseOverBrushKey.GetWpfBrush(); MenuHoverBackgroundBrush = EnvironmentColors.CommandBarMenuItemMouseOverBorderBrushKey.GetWpfBrush(); MenuHoverBackgroundColor = EnvironmentColors.CommandBarMenuItemMouseOverBorderColorKey.GetWpfColor(); MenuGlyphBackgroundBrush = EnvironmentColors.CommandBarMenuGlyphBrushKey.GetWpfBrush(); TextBoxBrush = CommonControlsColors.TextBoxTextBrushKey.GetWpfBrush(); TextBoxBackgroundBrush = CommonControlsColors.TextBoxBackgroundBrushKey.GetWpfBrush(); TextBoxBorderBrush = CommonControlsColors.TextBoxBorderBrushKey.GetWpfBrush(); TextSelectionHighlightBrush = CommonControlsColors.ComboBoxTextInputSelectionBrushKey.GetWpfBrush().Alpha(0.6); SystemButtonFaceColor = EnvironmentColors.SystemButtonFaceColorKey.GetWpfColor(); SystemThreeDFaceColor = EnvironmentColors.SystemThreeDFaceColorKey.GetWpfColor(); SystemGrayTextBrush = EnvironmentColors.SystemGrayTextBrushKey.GetWpfBrush(); UpdateToolTipFormatMap(null, EventArgs.Empty); }
public WPF.Media.SolidColorBrush MetroSolidBrush() { System.Drawing.Color inColor = MetroColor(); WPF.Media.SolidColorBrush metroSolidBr = new WPF.Media.SolidColorBrush(); metroSolidBr.Color = WPF.Media.Color.FromArgb(inColor.A, inColor.R, inColor.G, inColor.B); return(metroSolidBr); }
public void LoadSettings() { var fontFamily = new System.Windows.Media.FontFamily(Properties.Settings.Default.font_family); l_ClockDisplay.FontFamily = fontFamily; l_ClockDisplay.FontSize = Properties.Settings.Default.font_size; l_ClockDisplay.FontWeight = Properties.Settings.Default.font_bold ? FontWeights.Bold : FontWeights.Regular; var c = Properties.Settings.Default.font_color.Split(','); byte[] col = new byte[3]; for (int i = 0; i < 3; i++) { byte.TryParse(c[i], out col[i]); } var fgcol = new System.Windows.Media.Color { R = col[0], G = col[1], B = col[2], A = 255 }; var fg = new System.Windows.Media.SolidColorBrush(fgcol); l_ClockDisplay.Foreground = fg; this.Left = Properties.Settings.Default.window_pos.X; this.Top = Properties.Settings.Default.window_pos.Y; l_ClockDisplay.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); this.Width = l_ClockDisplay.DesiredSize.Width; this.Height = l_ClockDisplay.DesiredSize.Height; }
private DiffuseMaterial getMaterial(Autodesk.Revit.DB.Material mat) { if (mat == null) { failedMatParse++; return(this.DefaultMaterial.CloneCurrentValue()); } System.Windows.Media.Brush brush = null; try { System.Windows.Media.Color clr = System.Windows.Media.Color.FromRgb( mat.Color.Red, mat.Color.Green, mat.Color.Blue); float r = 1 - ((float)mat.Transparency) / 100; clr.A = (byte)(r * 255); brush = new System.Windows.Media.SolidColorBrush(clr); } catch (Exception) { failedMatParse++; } if (brush != null) { return(new DiffuseMaterial(brush)); } failedMatParse++; return(this.DefaultMaterial.CloneCurrentValue()); }
public MathDialogBox(IHTMLDocument2 mainWindowDoc, string imagePath, string mathCode, string title, string figCaption, string floatValue) { Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.ProgramLanguage.ToString()); InitializeComponent(); doc = mainWindowDoc; host.Dock = DockStyle.Fill; host.Child = formula; System.Windows.Media.Brush br = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb(255, 255, 255)); formula.BorderBrush = br; formula.BorderThickness = new Thickness(3, 3, 3, 3); inputTextBox.Text = mathCode; titleTextBox.Text = title; captionTextBox.Text = figCaption; imageFolderPath = imagePath; if (floatValue == "none") { noneRadioButton.Checked = true; } else if (floatValue == "left") { leftRadioButton.Checked = true; } else if (floatValue == "right") { rightRadioButton.Checked = true; } }
public static System.Windows.Media.SolidColorBrush ToNativeBrush(this SolidColorBrush brush) { var nativeBrush = new System.Windows.Media.SolidColorBrush(brush.Color.ToNativeColor()); nativeBrush.Freeze(); return(nativeBrush); }
private System.Windows.FrameworkElement Graph(double[] operands) { Grid g = new Grid(); double max = operands[0]; foreach (double d in operands) { max = Math.Max(max, d); } int rows = (int)max; int columns = operands.Length; for (int i = 0;i<columns;i++) { g.ColumnDefinitions.Add(new ColumnDefinition()); } for (int i = 0; i < rows; i++) { g.RowDefinitions.Add(new RowDefinition()); } for (int c = 0; c <columns; c++) { for (int r = (int)operands[c]; r >= 0; r--) { Canvas canvas = new Canvas(); System.Windows.Media.SolidColorBrush brush = new System.Windows.Media.SolidColorBrush(); brush.Color = System.Windows.Media.Colors.Red; canvas.Background = brush; Grid.SetColumn(canvas, c); Grid.SetRow(canvas, rows-r); g.Children.Add(canvas); } } g.Width = 229; g.Height = 229; return g; }
public static void convertStringToColor(string value, out System.Windows.Media.SolidColorBrush brush) { brush = null; // value starts with "0x" if (value.Length == 8 && value[0].Equals('0') && value[1].Equals('x')) { //converting the string from value into RGB bytes byte R = Byte.Parse(value.Substring(2, 2), System.Globalization.NumberStyles.HexNumber); byte G = Byte.Parse(value.Substring(4, 2), System.Globalization.NumberStyles.HexNumber); byte B = Byte.Parse(value.Substring(6, 2), System.Globalization.NumberStyles.HexNumber); byte A = 255; brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(A, R, G, B)); } // value starts with "#" else if (value.Length == 7 && value[0].Equals('#')) { //converting the string from value into RGB bytes byte R = Byte.Parse(value.Substring(1, 2), System.Globalization.NumberStyles.HexNumber); byte G = Byte.Parse(value.Substring(3, 2), System.Globalization.NumberStyles.HexNumber); byte B = Byte.Parse(value.Substring(5, 2), System.Globalization.NumberStyles.HexNumber); byte A = 255; brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(A, R, G, B)); } // value doesn't have the normal hex sign else if (value.Length == 6) { //converting the string from value into RGB bytes byte R = Byte.Parse(value.Substring(0, 2), System.Globalization.NumberStyles.HexNumber); byte G = Byte.Parse(value.Substring(2, 2), System.Globalization.NumberStyles.HexNumber); byte B = Byte.Parse(value.Substring(4, 2), System.Globalization.NumberStyles.HexNumber); byte A = 255; brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(A, R, G, B)); } }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { string result = "#FF0000"; if (value != null) { YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail clientOrderDetail = (YellowstonePathology.Business.ClientOrder.Model.ClientOrderDetail)value; if (clientOrderDetail.Submitted) { result = "#FF0000"; } if (clientOrderDetail.Received) { result = "#FFFF00"; } if (clientOrderDetail.Accessioned) { result = "#FF9E9E"; //"#77933C"; } if (clientOrderDetail.Validated) { result = "#77933C"; //"#FFD700"; } } System.Windows.Media.BrushConverter brushConverter = new System.Windows.Media.BrushConverter(); System.Windows.Media.SolidColorBrush brush = brushConverter.ConvertFromString(result) as System.Windows.Media.SolidColorBrush; return(brush); }
/// <summary> /// Convert a System.Drawing.Color value to System.Windows.Media.SolidColorBrush. /// </summary> /// <param name="value">Color to convert</param> /// <param name="targetType">not used</param> /// <param name="parameter">not used</param> /// <param name="culture">not used</param> /// <returns>System.Windows.Media.SolidColorBrush object</returns> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { System.Drawing.Color color = (System.Drawing.Color)value; System.Windows.Media.SolidColorBrush brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb( color.A, color.R, color.G, color.B)); return brush; }
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { sw.Media.Brush lCol = sw.SystemColors.WindowTextBrush; if (value != null) { var col = (Eto.Drawing.Color)value; if (col != Eto.Drawing.Color.Transparent) lCol = new sw.Media.SolidColorBrush(Generator.Convert(col)); } return lCol; }
public Box() { rectangle = new Rectangle(); rectangle.Stroke = System.Windows.Media.Brushes.FloralWhite; rectangle.Fill = System.Windows.Media.Brushes.DodgerBlue; rectangle.Opacity = 0.8; rectangle.Width = 75f; rectangle.Height = 75f; rectangle.MinWidth = 20f; rectangle.MinHeight = 20f; rectangle.StrokeThickness = 3; color = System.Windows.Media.Brushes.DodgerBlue; }
/// <summary> /// Apply Blur Effect on the window /// </summary> /// <param name="win">parent window</param> public static void ApplyEffect(this System.Windows.Window win) { // Create new effective objects var objBlur = new System.Windows.Media.Effects.BlurEffect { Radius = 5 }; var mask = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.DarkGray) { Opacity = 50 }; // Buffering ... effectBuffer = win.Effect; brushBuffer = win.OpacityMask; // Change this.win effective objects win.Dispatcher.Invoke(new Action(delegate { win.Effect = objBlur; }), System.Windows.Threading.DispatcherPriority.Normal); win.Dispatcher.Invoke(new Action(delegate { win.OpacityMask = mask; }), System.Windows.Threading.DispatcherPriority.Normal); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value != null && value is NodeState) { var state = (NodeState)value; Entry tuple; Color color = Color.Black; if (StateColorMapping.TryGetValue(state, out tuple)) { color = (parameter == null) ? tuple.Fill : tuple.Stroke; } var brush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(color.A, color.R, color.G, color.B)); return brush; } return null; }
private void MainDataGrid_LoadingRow(object sender, DataGridRowEventArgs e) { AnalizeTask.Models.Task task = e.Row.Item as AnalizeTask.Models.Task; if (System.IO.File.Exists(string.Format(@"{0}\{1}", Environment.CurrentDirectory, Properties.Settings.Default["FileStatusTaskColor"]))) { System.Xml.XmlDocument document = new System.Xml.XmlDocument(); document.Load(string.Format(@"{0}\{1}", Environment.CurrentDirectory, Properties.Settings.Default["FileStatusTaskColor"])); System.Xml.XmlNodeList nodeList = document.SelectNodes("TasksStatuses/TaskStatus"); bool find = false; foreach (System.Xml.XmlNode node in nodeList) { System.Xml.XmlNode colorNode = node.SelectSingleNode("Color"); System.Xml.XmlNode idNode = node.SelectSingleNode("Id"); if (idNode.InnerText != task.StatusId) continue; System.Drawing.Color color = System.Drawing.Color.FromArgb(Convert.ToInt32(colorNode.InnerText)); var colorBrush = new System.Windows.Media.SolidColorBrush(this.ColorToColor(color)); e.Row.Background = colorBrush; find = true; break; } if (!find) { System.Drawing.Color color = System.Drawing.Color.Azure; var colorBrush = new System.Windows.Media.SolidColorBrush(this.ColorToColor(color, true)); e.Row.Background = colorBrush; } } else { System.Drawing.Color color = System.Drawing.Color.Azure; var colorBrush = new System.Windows.Media.SolidColorBrush(this.ColorToColor(color)); e.Row.Background = colorBrush; } }
public void InnerTick(int Frame) { if (Health < 0) { Die(this); return; } Progress += 0.01; if (Progress < 0) { this.Visibility = Visibility.Hidden; } else { if (this.Visibility == Visibility.Hidden) { this.Visibility = Visibility.Visible; Arena.instance.AddToArena(this); } if (Progress >= .75)//|| NextCell != CurrentCell.ToTarget[Counter % CurrentCell.ToTarget.Count] { PreviousCell = CurrentCell; lock (CurrentCell.CreepsInCell) { CurrentCell.CreepsInCell.Remove(this); } CurrentCell = NextCell; lock (CurrentCell.CreepsInCell) CurrentCell.CreepsInCell.Add(this); if (CurrentCell.ToTarget.Count == 0) { // no prize for failure. Bounty = 0; // remove the creep from play. Die(this); if (Arena.instance.Lifes-- <= 0) { // Game Over. //MessageBox.Show("Game Over"); } } else// if (CurrentCell.ToTarget.Count == 1) { // NextCell = CurrentCell.ToTarget[0]; //} //else //{ if ((Counter & 1) == 0) { Counter >>= 2; } else { Counter >>= 2; Counter = Counter | 1073741824; } NextCell = CurrentCell.ToTarget[Counter % CurrentCell.ToTarget.Count]; } Progress -= 0.5; // PERF: // Generating Bezier's is expensive; some kind of cache...? or not generate per creep*per frame... // should only be 30 possible curves // Track = new System.Windows.Media.PathGeometry(); System.Windows.Media.PathFigure pf = new System.Windows.Media.PathFigure(); pf.StartPoint = new Point(PreviousCell.CenterPoint.X, PreviousCell.CenterPoint.Y); Point p0 = new Point(CurrentCell.CenterPoint.X, CurrentCell.CenterPoint.Y); //Point p1 = new Point(CurrentCell.CenterPoint.X, CurrentCell.CenterPoint.Y); Point ppa = new Point(NextCell.CenterPoint.X, NextCell.CenterPoint.Y); //System.Windows.Media.BezierSegment bs; //bs = ; pf.Segments.Add(new System.Windows.Media.BezierSegment(p0, p0, ppa, true)); Track.Figures.Add(pf); //CreepTrack.Data = Track; //CreepTrack.Stroke = System.Windows.Media.Brushes.Blue; //CreepTrack.StrokeThickness = .5; //CreepTrack.IsHitTestVisible = false; //Arena.instance.AddToArena(CreepTrack); } Point op; Point ta; //Track.GetPointAtFractionLength((1 / Arena.instance.TrackLength) * (Progress), out op, out ta); //once/if I have a bezier cache, maybe cache the point-at-fraction-lenghts? if (Track!=null) { Track.GetPointAtFractionLength((Progress), out op, out ta); XPos = (float)op.X; YPos = (float)op.Y; SetValue(System.Windows.Controls.Canvas.LeftProperty, op.X); SetValue(System.Windows.Controls.Canvas.TopProperty, op.Y); // this.RenderTransformOrigin = new Point(0, 0); //this.RenderTransform = null; //this.RenderTransform = new System.Windows.Media.RotateTransform(Math.Atan2(ta.Y, ta.X) * 180 / Math.PI, 0, 0); } System.Windows.Media.Brush B = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromRgb((byte)((Health / MaxHealth) * 255), 0, 0)); Stroke = B; this.InvalidateVisual(); } }
public void SetColor(SerializableVector3 vector3) { Color = new System.Windows.Media.SolidColorBrush(vector3.ToSandboxMediaColor()); ColorText = Color.ToString(); ColorHue = vector3.X; ColorSaturation = vector3.Y; ColorLuminance = vector3.Z; RaisePropertyChanged(() => ColorText); RaisePropertyChanged(() => ColorHue); RaisePropertyChanged(() => ColorSaturation); RaisePropertyChanged(() => ColorLuminance); }
public void Draw(TextView textView, System.Windows.Media.DrawingContext drawingContext) { if (markers == null || !textView.VisualLinesValid) { return; } var visualLines = textView.VisualLines; if (visualLines.Count == 0) { return; } int viewStart = visualLines.First().FirstDocumentLine.Offset; int viewEnd = visualLines.Last().LastDocumentLine.EndOffset; foreach (TextMarker marker in markers.FindOverlappingSegments(viewStart, viewEnd - viewStart)) { if (marker.BackgroundColor != null) { var geoBuilder = new BackgroundGeometryBuilder { AlignToWholePixels = true, CornerRadius = 3 }; geoBuilder.AddSegment(textView, marker); System.Windows.Media.Geometry geometry = geoBuilder.CreateGeometry(); if (geometry != null) { System.Windows.Media.Color color = marker.BackgroundColor.Value; var brush = new System.Windows.Media.SolidColorBrush(color); brush.Freeze(); drawingContext.DrawGeometry(brush, null, geometry); } } foreach (System.Windows.Rect r in BackgroundGeometryBuilder.GetRectsForSegment(textView, marker)) { var startPoint = r.BottomLeft; var endPoint = r.BottomRight; var usedPen = new System.Windows.Media.Pen(new System.Windows.Media.SolidColorBrush(marker.MarkerColor), 1); usedPen.Freeze(); const double offset = 2.5; int count = Math.Max((int)((endPoint.X - startPoint.X) / offset) + 1, 4); var geometry = new System.Windows.Media.StreamGeometry(); using (System.Windows.Media.StreamGeometryContext ctx = geometry.Open()) { ctx.BeginFigure(startPoint, false, false); ctx.PolyLineTo(CreatePoints(startPoint, endPoint, offset, count).ToArray(), true, false); } geometry.Freeze(); drawingContext.DrawGeometry(System.Windows.Media.Brushes.Transparent, usedPen, geometry); break; } } }
private void MarkStatus_Click(object sender, RoutedEventArgs e) { View.TaskView taskView = (View.TaskView)MainDataGrid.DataContext; TaskStatusWindow window = new TaskStatusWindow(); BindingList<Models.Task> taskModel = taskView.TaskModel; Models.Task task = (Models.Task)MainDataGrid.Items[MainDataGrid.SelectedIndex]; BindingList<Models.TaskStatus> taskStatus = taskView.TaskStatus; BindingList<Models.TaskStatus> taskStatusNew = new BindingList<Models.TaskStatus>(); View.StatusTaskView statusTaskView = (View.StatusTaskView)window.DataContext; ObservableCollection<AnalizeTask.Models.TaskStatus> filtererdTests; if (task.StatusId != null) { filtererdTests = new ObservableCollection<Models.TaskStatus>(taskStatus.Where(t => t.Id == task.StatusId)); if (statusTaskView.TaskStatus == null) statusTaskView.TaskStatus = new BindingList<Models.TaskStatus>(); statusTaskView.TaskStatus.Add(new Models.TaskStatus() { Name = filtererdTests[0].Name, Description = filtererdTests[0].Description, Id = filtererdTests[0].Id, ImageUrl = filtererdTests[0].ImageUrl, ImageUrl24 = filtererdTests[0].ImageUrl24 }); window.initPicker(); window.ShowDialog(); if (System.IO.File.Exists(string.Format(@"{0}\{1}", Environment.CurrentDirectory, Properties.Settings.Default["FileStatusTaskColor"]))) { System.Xml.XmlDocument document = new System.Xml.XmlDocument(); document.Load(string.Format(@"{0}\{1}", Environment.CurrentDirectory, Properties.Settings.Default["FileStatusTaskColor"])); System.Xml.XmlNodeList nodeList = document.SelectNodes("TasksStatuses/TaskStatus"); foreach (System.Xml.XmlNode node in nodeList) { System.Xml.XmlNode colorNode = node.SelectSingleNode("Color"); System.Xml.XmlNode idNode = node.SelectSingleNode("Id"); if (idNode.InnerText != task.StatusId) continue; //int i = 0; int count = MainDataGrid.Items.Count; for(int i = 0; i != MainDataGrid.Items.Count; i++) { Models.Task taskFind = (Models.Task)MainDataGrid.Items[i]; if(taskFind.StatusId != task.StatusId) continue; DataGridRow row = (DataGridRow)MainDataGrid.ItemContainerGenerator.ContainerFromIndex(i); if (row != null) { MainDataGrid.UpdateLayout(); MainDataGrid.ScrollIntoView(MainDataGrid.Items[i]); System.Drawing.Color color = System.Drawing.Color.FromArgb(Convert.ToInt32(colorNode.InnerText)); var colorBrush = new System.Windows.Media.SolidColorBrush(this.ColorToColor(color)); row.Background = colorBrush; } } break; } } } }
/** * Converts a color string into a SolidColorBrush. * @param value The color string. * @param brush The resulting brush. * @throws InvalidPropertyValueException, */ public static void ConvertStringToColor(string value, out System.Windows.Media.SolidColorBrush brush) { brush = null; System.Windows.Media.SolidColorBrush tempBrush = null; bool invalidColor = false; MoSync.Util.RunActionOnMainThread(() => { try { // value starts with "0x" if (value.Length == 8 && value[0].Equals('0') && value[1].Equals('x')) { //converting the string from value into RGB bytes byte R = Byte.Parse(value.Substring(2, 2), System.Globalization.NumberStyles.HexNumber); byte G = Byte.Parse(value.Substring(4, 2), System.Globalization.NumberStyles.HexNumber); byte B = Byte.Parse(value.Substring(6, 2), System.Globalization.NumberStyles.HexNumber); byte A = 255; tempBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(A, R, G, B)); } // value starts with "#" else if (value.Length == 7 && value[0].Equals('#')) { //converting the string from value into RGB bytes byte R = Byte.Parse(value.Substring(1, 2), System.Globalization.NumberStyles.HexNumber); byte G = Byte.Parse(value.Substring(3, 2), System.Globalization.NumberStyles.HexNumber); byte B = Byte.Parse(value.Substring(5, 2), System.Globalization.NumberStyles.HexNumber); byte A = 255; tempBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(A, R, G, B)); } // value doesn't have the normal hex sign else if (value.Length == 6) { //converting the string from value into RGB bytes byte R = Byte.Parse(value.Substring(0, 2), System.Globalization.NumberStyles.HexNumber); byte G = Byte.Parse(value.Substring(2, 2), System.Globalization.NumberStyles.HexNumber); byte B = Byte.Parse(value.Substring(4, 2), System.Globalization.NumberStyles.HexNumber); byte A = 255; tempBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(A, R, G, B)); } // special case for 0 else if (value.Length == 1 && value[0].Equals('0')) { tempBrush = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 0, 0, 0)); } else { invalidColor = true; } } catch { // a error occured during parsing invalidColor = true; } }, true); if (invalidColor) { throw new InvalidPropertyValueException(); } else { brush = tempBrush; } }
/// <summary> /// Initiates functionality for reading a color value and outputting that cvalue to form controls. /// </summary> private void ReadColour() { foreach (Input _input in _currentioconfig.Inputs) { System.Windows.Media.SolidColorBrush _bg = new System.Windows.Media.SolidColorBrush(); Label _label = (Label)this.FindName("labPreviewBox" + _input.ID); _bg.Color = _detector.GetAverageColour(_currentioconfig.Settings.SampleAccuracy, _input.StartX, _input.StartY, _input.EndX, _input.EndY); _label.Background = _bg; } }
private void setInfoTextWarning(string text, string tooltip = "") { InfoText = text; InfoToolTipText = tooltip; InfoColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Chocolate); }
private void setInfoTextError(string text, string longErrorText) { InfoText = text; InfoToolTipText = longErrorText; InfoColor = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.Crimson); }