Example #1
1
        // Code compiled into PresentationFramework.dll

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

                    if (RTPC_Info_Number != -1)
                    {
                        string Name = Get_Config.Get_Hash_Name_From_ShortID(ShortID_Now);
                        Event_Info[RTPC_Info_Number].Name = Name;
                    }
                }
                Message_T.Text = "Eventsを適応しました。";
                await Task.Delay(50);
            }
        }
Example #3
0
        //総当たりでShortIDを検索して一致するShortIDの文字列を取得
        public async Task Get_Hash_Name_To_File(string To_File, System.Windows.Controls.TextBlock Message_T)
        {
            if (!IsSelected)
            {
                return;
            }
            StreamWriter stw2 = File.CreateText(To_File);

            stw2.Close();
            List <int> Numbers = new List <int>();

            for (int Number = 0; Number < ID_Line.Count; Number++)
            {
                if (ID_Line[Number][2] == "CAkBus")
                {
                    Numbers.Add(Number);
                }
            }
            foreach (int Number in Numbers)
            {
                string ShortID = ID_Line[Number][0];
                Message_T.Text = ShortID + "を復号化しています...";
                await Task.Delay(50);

                FNV_Hash_Class hasher = new FNV_Hash_Class();
                string         Parse  = hasher.Bruteforce(8, uint.Parse(ShortID));
                StreamWriter   stw    = new StreamWriter(To_File, true);
                stw.WriteLine(ShortID + " = " + Parse + " : 親 = " + ID_Line_Special[Number][0]);
                stw.Close();
            }
        }
Example #4
0
        public static void htmlToTextBlockText(System.Windows.Controls.TextBlock textBlock, string html)
        {
            try
            {
                textBlock.Text = "";
                string xaml = HtmlToXamlConverter.ConvertHtmlToXaml(html, false);
                System.Windows.Documents.InlineCollection xamlLines =
                    (
                        (System.Windows.Documents.Paragraph)(
                            (System.Windows.Documents.Section)System.Windows.Markup.XamlReader.Parse(xaml)
                            ).Blocks.FirstBlock
                    ).Inlines;

                System.Windows.Documents.Inline[] newLines = new System.Windows.Documents.Inline[xamlLines.Count];
                xamlLines.CopyTo(newLines, 0);

                foreach (var item in newLines)
                {
                    textBlock.Inlines.Add(item);
                }
            }
            catch (Exception)
            {
                System.Diagnostics.Debugger.Break();
            }
        }
        /// <summary>
        /// 處理滑鼠左鍵連點在可選/已選項
        /// </summary>
        public void AddClickedItem(object obj)
        {
            System.Windows.Controls.TextBlock itemTextBlock = obj as System.Windows.Controls.TextBlock;
            if (itemTextBlock == null)
            {
                return;
            }

            ItemViewModel itemViewModel;

            foreach (KeyValuePair <int, string> item in AvailableItemList)
            {
                if (item.ToString() == itemTextBlock.Text)
                {
                    itemViewModel            = new ItemViewModel();
                    itemViewModel.Item       = item;
                    itemViewModel.IsSelected = false;
                    if (SelectedItemsInListBox.Count() > 0)
                    {
                        var a = SelectedItemsInListBox.Select(x => x.Item == itemViewModel.Item);
                        if (!a.Contains(true))
                        {
                            SelectedItemsInListBox.Add(itemViewModel);
                            return;
                        }
                    }
                    else
                    {
                        AvailableItemsInListBox.Add(itemViewModel);
                    }
                }
            }
        }
Example #6
0
        /*
         * public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
         * {
         *  return UITypeEditorEditStyle.Modal;
         * }
         *
         * public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
         * {
         *  if (value.GetType() != typeof(ColorProperty))
         *  {
         *      return value;
         *  }
         *
         *  using (ColorDialog form = new ColorDialog())
         *  {
         *      System.Windows.Media.Color color = ((ColorProperty)value).color;
         *      form.Color = System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B);
         *      if (form.ShowDialog() == DialogResult.OK)
         *      {
         *          return new ColorProperty(System.Windows.Media.Color.FromArgb(form.Color.A, form.Color.R, form.Color.G, form.Color.B));
         *      }
         *  }
         *
         *  return value;
         * }
         *
         * public override bool GetPaintValueSupported(ITypeDescriptorContext context)
         * {
         *  return true;
         * }
         *
         * public override void PaintValue(PaintValueEventArgs e)
         * {
         *  System.Windows.Media.Color color = ((ColorProperty)e.Value).color;
         *  using (SolidBrush brush = new SolidBrush(System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B)))
         *  {
         *      e.Graphics.FillRectangle(brush, e.Bounds);
         *  }
         * }
         */

        public FrameworkElement ResolveEditor(PropertyItem propertyItem)
        {
            System.Windows.Controls.StackPanel stackPanel = new System.Windows.Controls.StackPanel();
            stackPanel.Orientation = System.Windows.Controls.Orientation.Horizontal;
            System.Windows.Controls.Button    button = new System.Windows.Controls.Button();
            System.Windows.Controls.TextBlock text   = new System.Windows.Controls.TextBlock();
            text.Text      = "..";
            button.Content = text;
            System.Windows.Controls.TextBlock colorLabel = new System.Windows.Controls.TextBlock();

            ColorProperty property = propertyItem.Value as ColorProperty;

            colorLabel.Text = property.color.ToString();
            stackPanel.Children.Add(colorLabel);
            stackPanel.Children.Add(button);

            button.Click += (sender, e) =>
            {
                using (ColorDialog form = new ColorDialog())
                {
                    System.Windows.Media.Color color = property.color;
                    form.Color = System.Drawing.Color.FromArgb(color.A, color.R, color.G, color.B);
                    if (form.ShowDialog() == DialogResult.OK)
                    {
                        property.changeColor(System.Windows.Media.Color.FromArgb(form.Color.A, form.Color.R, form.Color.G, form.Color.B));
                    }
                }
            };

            return(stackPanel);
        }
        /// <summary>
        /// 處理滑鼠左鍵連點在可選/已選項
        /// </summary>
        public void AddClickedItem(object obj)
        {
            System.Windows.Controls.TextBlock itemTextBlock = obj as System.Windows.Controls.TextBlock;
            if (itemTextBlock == null)
            {
                return;
            }

            foreach (var item in FurnItemsSrc)
            {
                if (item.Description == itemTextBlock.Text)
                {
                    if (SelectedFurnItems.Count() > 0)
                    {
                        var a = SelectedFurnItems.Select(x => x.ItemList == item.ItemList);
                        a = a as IEnumerable <bool>;
                        if (!a.Contains(true))
                        {
                            SelectedFurnItems.Add(item);
                            return;
                        }
                    }
                    else
                    {
                        SelectedFurnItems.Add(item);
                        return;
                    }
                }
            }
        }
Example #8
0
        public static void UpdateInfo(StatusBar sb, System.Windows.Controls.TextBlock tb, string msg, UTIL.InfoType iType = UTIL.InfoType.message, bool async = false)
        {
            if (System.Windows.Threading.Dispatcher.FromThread(System.Threading.Thread.CurrentThread) == null)
            {
                if (async)
                {
                    System.Windows.Application.Current.Dispatcher.BeginInvoke(
                        System.Windows.Threading.DispatcherPriority.Normal,
                        (Action)(() => UpdateInfo(sb, tb, msg, iType, async)));
                }
                else
                {
                    System.Windows.Application.Current.Dispatcher.Invoke(
                        System.Windows.Threading.DispatcherPriority.Normal,
                        (Action)(() => UpdateInfo(sb, tb, msg, iType, async)));
                }
                return;
            }
            switch (iType)
            {
            case UTIL.InfoType.message:
                sb.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0x7A, 0xCC));
                break;

            case UTIL.InfoType.alert:
                sb.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xCA, 0x51, 0x00));
                break;

            case UTIL.InfoType.error:
                sb.Background = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0x00, 0x00));
                break;
            }
            tb.Text = msg;
            return;
        }
Example #9
0
 public ExpressionTextBox()
 {
     _OutputType                    = FieldCalculationParser.TypeEnum.UnDeclared;
     _s                             = new System.Diagnostics.Stopwatch();
     _BW                            = new System.ComponentModel.BackgroundWorker();
     _BW.DoWork                    += swStart;
     _BW.RunWorkerCompleted        += RemoveTextBlock;
     _BW.WorkerSupportsCancellation = true;
     TextWrapping                   = System.Windows.TextWrapping.Wrap;
     _Numlines                      = 1;
     _TextBlock                     = new System.Windows.Controls.TextBlock();
     _TextBlock.TextWrapping        = System.Windows.TextWrapping.Wrap;
     _TextBlock.Margin              = new System.Windows.Thickness(5, 16, 5, 0);
     _TextBlock.Background          = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(230, 240, 240, 240));
     _TextBlock.Effect              = new System.Windows.Media.Effects.DropShadowEffect();
     _TextBlock.Visibility          = System.Windows.Visibility.Hidden;
     _TextBlock.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
     _TextBlock.VerticalAlignment   = System.Windows.VerticalAlignment.Top;
     _TextBlock.MouseEnter         += CancelBackgroundWorker;
     _TextBlock.MouseLeave         += StartBackgroundWorker;
     System.Windows.Controls.Grid.SetRow(_TextBlock, 1);
     _colorList = new List <System.Windows.Media.SolidColorBrush>();
     _colorList.Add(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 0)));
     _colorList.Add(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 0, 255, 0)));
     _colorList.Add(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 0, 255)));
     _colorList.Add(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 0, 204, 204)));
     _colorList.Add(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 255, 130, 0)));
     _colorList.Add(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 0, 255, 128)));
     _colorList.Add(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 157, 0, 255)));
     _colorList.Add(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(255, 102, 204, 0)));
     KeyUp += ExpressionTextBox_KeyUp;
 }
Example #10
0
        public override void BindCellContent(FrameworkElement cellContent, DataGridRow row)
        {
            System.Windows.Controls.TextBlock textBlock = (System.Windows.Controls.TextBlock)cellContent;

            if (Binding == null)
            {
                textBlock.ClearValue(System.Windows.Controls.TextBlock.TextProperty);
                return;
            }

            textBlock.HorizontalAlignment = base.HorizontalAlignment;
            textBlock.VerticalAlignment   = base.VerticalAlignment;
            textBlock.TextWrapping        = TextWrapping;
            textBlock.TextTrimming        = TextTrimming;
            textBlock.Margin = new Thickness(4, 4, 4, 4);
            if (FlowDirection != null)
            {
                textBlock.FlowDirection = (FlowDirection)FlowDirection;
            }
            if (Binding != null)
            {
                Binding newBinding = CopyBinding(Binding);
                newBinding.Source = row.DataItem;
                newBinding.Mode   = BindingMode.OneWay;
                textBlock.SetBinding(System.Windows.Controls.TextBlock.TextProperty, newBinding);
            }
        }
Example #11
0
        private void Grid_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
        {
            string BaseName = System.Text.RegularExpressions.Regex.Replace((sender as System.Windows.Controls.Grid).Name, @"Grid", string.Empty, System.Text.RegularExpressions.RegexOptions.IgnoreCase);

            System.Windows.Shapes.Rectangle LeavedRectangle = FindName("Rectangle" + BaseName) as System.Windows.Shapes.Rectangle;

            int Index = Rectangles.IndexOf(LeavedRectangle);

            if (LeavedRectangle.Style != FindResource("RectangleStyleToday"))
            {
                if (previousIndex == Index)
                {
                    LeavedRectangle.Style = (System.Windows.Style)FindResource("RectangleStyleEventedDay");
                    previousIndex         = -1;
                    return;
                }
            }

            System.Windows.Controls.TextBlock LeavedTextBlock = TextBlocks.ElementAt(Index);

            if ((LeavedRectangle.Style == FindResource("RectangleStyleNone") && LeavedTextBlock.Style == FindResource("TextBlockStyleForOtherMonths")) ||
                LeavedRectangle.Style == FindResource("RectangleStyleToday") ||
                LeavedRectangle.Style == FindResource("RectangleStyleEventedDay"))
            {
                return;
            }

            LeavedRectangle.Style = (System.Windows.Style)FindResource("RectangleStyleNone");
        }
        //! \brief Add text contnet to TextBlock of Qickinfo
        private void AddText(System.Windows.Controls.TextBlock textBlock, Color col, bool bold, bool underline, string text)
        {
            var run = new System.Windows.Documents.Run(text);

            run.MouseLeftButtonUp += this.NotyfieMouseLeftBtnUp;

            run.Foreground = new SolidColorBrush(col);
            if (bold)
            {
                run.FontWeight = System.Windows.FontWeights.Bold;
            }
            if (underline)
            {
                // add collection of text decorations
                run.TextDecorations = new TextDecorationCollection();

                // create undeline text decoration
                TextDecoration underlineDecoration = new TextDecoration();
                Pen            underlinePen        = new Pen();
                underlinePen.Brush      = new SolidColorBrush(col);
                underlinePen.Thickness  = 1.5;
                underlinePen.DashStyle  = DashStyles.Solid;
                underlineDecoration.Pen = underlinePen;
                underlineDecoration.PenThicknessUnit = TextDecorationUnit.FontRecommended;
                run.TextDecorations.Add(underlineDecoration);
            }
            textBlock.Inlines.Add(run);
        }
Example #13
0
        private void NotifyUserAboutBugNo1()
        {
            var href = @"https://github.com/kalaider/kPassKeep/issues/1";
            var link = new System.Windows.Documents.Hyperlink
            {
                NavigateUri = new Uri(href)
            };

            link.Inlines.Add("Read more");
            link.RequestNavigate += (s, e) => { System.Diagnostics.Process.Start(href); };
            var content = new System.Windows.Controls.TextBlock();

            content.Inlines.Add("Looks like you have stumbled upon a bug #1 in our bug tracker. ");
            content.Inlines.Add(link);

            var dlg = new ModernDialog
            {
                Title     = "Error",
                Content   = content,
                MinHeight = 0,
                MinWidth  = 0,
                MaxWidth  = 640,
                Owner     = Application.Current.MainWindow
            };

            dlg.Buttons = dlg.OkButton.Yield();
            dlg.ShowDialog();
        }
        private void InitializeComponent()
        {
            StackPanel = new System.Windows.Controls.StackPanel
            {
                Margin = new Thickness(13)
            };
            PingButton = new System.Windows.Controls.Button
            {
                Content             = "Ping",
                HorizontalAlignment = HorizontalAlignment.Left
            };
            StatusLabel = new System.Windows.Controls.TextBlock
            {
                Text   = "Ready",
                Margin = new Thickness(0, 0, 0, 10)
            };

            Content = StackPanel;

            StackPanel.Children.Add(StatusLabel);
            StackPanel.Children.Add(PingButton);

            PingButton.Click += PingButton_Click;

            MinWidth      = 260;
            MinHeight     = 100;
            SizeToContent = SizeToContent.WidthAndHeight;
            Title         = "Multithreading in WPF";
        }
Example #15
0
        public void RemoveClickedItem(object obj)
        {
            System.Windows.Controls.TextBlock itemTextBlock = obj as System.Windows.Controls.TextBlock;
            DataTable availableItemsDataTable = Database.DBQueryTool.GetFurnItemInfo(SITE_ID);

            foreach (DataRow row in availableItemsDataTable.Rows.Cast <DataRow>())
            {
                if (row["ITEM_NAME"].ToString() == itemTextBlock.Text)
                {
                    SPCItemInfo info = new SPCItemInfo()
                    {
                        ItemList    = row["FURN_ITEM_INDEX"].ToString(),
                        Flag        = "I",
                        Description = row["ITEM_NAME"].ToString(),
                        Title       = row["ITEM_NAME"].ToString()
                    };

                    for (int i = SelectedUnivariateSPCItems.Count; i-- > 0;)
                    {
                        SPCItemInfo item = SelectedUnivariateSPCItems[i];
                        if (item.ItemList == info.ItemList)
                        {
                            SelectedUnivariateSPCItems.RemoveAt(i);
                            return;
                        }
                    }
                }
            }
        }
Example #16
0
        public void CreateToggleButton()
        {
            try
            {
                ToggleButton = new System.Windows.Controls.Primitives.ToggleButton();


                ToggleButton.Content = CreateToggleButtonContent();

                System.Windows.Controls.ToolTip toolTip = new System.Windows.Controls.ToolTip();
                System.Windows.Controls.Border  border  = new System.Windows.Controls.Border();
                border.Background      = System.Windows.Media.Brushes.WhiteSmoke;
                border.BorderThickness = new System.Windows.Thickness(2);
                border.BorderBrush     = System.Windows.Media.Brushes.Black;
                toolTip.Content        = border;

                System.Windows.Controls.TextBlock toolTipTextBlock = new System.Windows.Controls.TextBlock();
                toolTipTextBlock.Text = Description;
                border.Child          = toolTipTextBlock;
                ToggleButton.ToolTip  = toolTip;
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message, "Some Error :(", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
                Schematix.Core.Logger.Log.Error("Load ToolBox data error.", ex);
            }
        }
Example #17
0
        /// <summary>
        /// Changes the Background property of the control.
        /// </summary>
        /// <param name="targetControl">The control instance.</param>
        /// <param name="fromValue">The color to change to before the transition begins./param>
        /// <param name="toValue">The color to change to.</param>
        /// <param name="duration">Transtition Time in Milliseconds.</param>
        public static void Background(System.Windows.Controls.TextBlock targetControl, Color fromValue, Color toValue, int duration)
        {
            ColorAnimation animation = new ColorAnimation(toValue, new Duration(TimeSpan.FromMilliseconds(duration)));

            targetControl.Background = new SolidColorBrush(fromValue);
            targetControl.Background.BeginAnimation(SolidColorBrush.ColorProperty, animation);
        }
        private void InitializeComponent()
        {
            StackPanel = new System.Windows.Controls.StackPanel
            {
                Margin = new Thickness(13)
            };
            PingButton = new System.Windows.Controls.Button
            {
                Content = "Ping",
                HorizontalAlignment = HorizontalAlignment.Left
            };
            StatusLabel = new System.Windows.Controls.TextBlock
            {
                Text = "Ready",
                Margin = new Thickness(0, 0, 0, 10)
            };

            Content = StackPanel;

            StackPanel.Children.Add(StatusLabel);
            StackPanel.Children.Add(PingButton);

            PingButton.Click += PingButton_Click;

            MinWidth = 260;
            MinHeight = 100;
            SizeToContent = SizeToContent.WidthAndHeight;
            Title = "Multithreading in WPF";

        }
Example #19
0
 public disTime(Object parent,Object item)
 {
     mw = parent as MainWindow;
     desItem = item as System.Windows.Controls.TextBlock;
     bindItem();
     initTimer();
 }
Example #20
0
 public bb(float X, float Y, float Scale, Brush color, float Score, float Weight)
 {
     x      = X;
     y      = Y;
     scale  = Scale;
     score  = Score;
     Left   = x;
     Right  = x + (int)scale;
     Top    = y;
     Bottom = y + (int)scale;
     weight = Weight;
     rec    = new Rectangle()
     {
         Width           = Scale,
         Height          = Scale,
         Stroke          = color,
         StrokeThickness = 2,
         Visibility      = System.Windows.Visibility.Visible,
         //                        Fill = System.Windows.Media.Brushes.Blue
     };
     textBlock = new System.Windows.Controls.TextBlock()
     {
         Text       = score.ToString("0.000") + " - " + weight.ToString(),
         FontSize   = 9,
         Foreground = color,
     };
 }
Example #21
0
        private void BackgroundWorkerRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            if (e.Cancelled == true)
            {
                Debug.WriteLine("RunWorkerCompleted: {1}", "", "Canceled!");
            }
            else if (e.Error != null)
            {
                Debug.WriteLine("RunWorkerCompleted: {1}", "", "Error: " + e.Error.Message);
            }
            else
            {
                ClientType client = (ClientType)e.Result;
                client.DoFinish();

                System.Windows.Controls.Image             previewCaptureImage = (System.Windows.Controls.Image)RootElement.FindName("previewCaptureImage");
                System.Windows.Media.Imaging.BitmapSource bs = client.GetRenderTargetBitmapSource();
                // bs.Freeze();
                previewCaptureImage.Source = bs;

                System.Windows.Controls.TextBlock CapturePerSecond = (System.Windows.Controls.TextBlock)RootElement.FindName("CapturePerSecond");
                CapturePerSecond.Text = "FPS: " + client.FPS.ToString();

                System.Windows.Controls.TextBlock UIRedrawsPerSecond = (System.Windows.Controls.TextBlock)RootElement.FindName("UIRedrawsPerSecond");
                UIRedrawsPerSecond.Text = "DPS: " + drawCounter.GetFPS().ToString();



                GC.Collect();
                drawCounter.IncreaseFrame();
            }
        }
Example #22
0
        /// <summary>
        /// Shows the specified notification.
        /// </summary>
        /// <param name="icon">The notification icon.</param>
        /// <param name="title">The notification title.</param>
        /// <param name="content">The notification content.</param>
        /// <param name="displayDuration">The notification display duration.</param>
        /// <param name="isDoubleHeight">Option to double the notification height</param>
        public static void Show(ImageSource icon, string title, object content, TimeSpan displayDuration, bool isDoubleHeight)
        {
            object contentWrapper = content;

            if (content is string)
            {
                // If the content is just a string, we need to put it in a TextBlock so we can wrap the text.
                contentWrapper = new System.Windows.Controls.TextBlock()
                {
                    Text         = (string)content,
                    TextWrapping = TextWrapping.Wrap
                };
            }

            Window window = new Window()
            {
                Content = contentWrapper,
                Icon    = icon,
                Title   = title
            };

            window.Style = (Style)window.FindResource("NotifyBoxWindowStyle");
            if (isDoubleHeight)
            {
                window.Height *= 2;
            }

            Show(window, displayDuration);
        }
Example #23
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Text" /> class.
        /// </summary>
        /// <param name="text">Text that will be drawn.</param>
        /// <param name="font">Font that will be used to draw the text.</param>
        /// <param name="foreground">Brush that will be used to paint the text.</param>
        /// <param name="background">Brush that will be used to paint the text's background.</param>
        /// <param name="left">Left position of the text.</param>
        /// <param name="top">Top position of the text.</param>
        /// <param name="width">Virtual text box width. If value is less than 0, it will be automatically computed.</param>
        /// <param name="height">Virtual text box height. If value is less than 0, it will be automatically computed.</param>
        /// <param name="horizontalAlignment">Text horizontal alignment.</param>
        /// <param name="verticalAlignment">Text vertical alignment.</param>
        /// <param name="wrapping">Text wrapping.</param>
        /// <param name="rotation">Text clockwise rotation in radians.</param>
        public Text(string text, IFont font, IBrush foreground, IBrush background, double left, double top, double width, double height, TextHorizontalAlignment horizontalAlignment, TextVerticalAlignment verticalAlignment, TextWrapping wrapping, double rotation)
        {
            Label               = text;
            Font                = font;
            Background          = background;
            Foreground          = foreground;
            Width               = width;
            Height              = height;
            HorizontalAlignment = horizontalAlignment;
            VerticalAlignment   = verticalAlignment;
            Wrapping            = wrapping;
            Rotation            = rotation;

            System.Windows.FontStyle fontStyle;

            switch (font.Style)
            {
            default:
            case FontStyle.Normal:
                fontStyle = System.Windows.FontStyles.Normal;
                break;

            case FontStyle.Italic:
                fontStyle = System.Windows.FontStyles.Italic;
                break;

            case FontStyle.Oblique:
                fontStyle = System.Windows.FontStyles.Oblique;
                break;
            }
            UIText = new System.Windows.Controls.TextBlock()
            {
                Text = text,
                HorizontalAlignment = (System.Windows.HorizontalAlignment)horizontalAlignment,
                VerticalAlignment   = (System.Windows.VerticalAlignment)((int)verticalAlignment - 1),
                Foreground          = (foreground as Brush)?.UIBrush,
                Background          = (background as Brush)?.UIBrush,
                FontFamily          = new System.Windows.Media.FontFamily(font.Family),
                FontSize            = font.Size,
                FontStyle           = fontStyle,
                FontWeight          = System.Windows.FontWeight.FromOpenTypeWeight((int)font.Weight),
                TextWrapping        = (System.Windows.TextWrapping)((int)wrapping + 1),
            };
            if (width >= 0)
            {
                UIText.Width = width;
            }
            if (height >= 0)
            {
                UIText.Height = height;
            }
            if (rotation != 0)
            {
                UIText.RenderTransform       = new System.Windows.Media.RotateTransform(rotation * 180 / Math.PI);
                UIText.RenderTransformOrigin = new System.Windows.Point(0.5, 0.5);
            }
            System.Windows.Controls.Canvas.SetLeft(UIText, left);
            System.Windows.Controls.Canvas.SetTop(UIText, top);
        }
Example #24
0
 public LabelHandler()
 {
     Control         = new System.Windows.Controls.Label();
     text            = new System.Windows.Controls.TextBlock();
     Control.Content = text;
     HorizontalAlign = HorizontalAlign.Left;
     VerticalAlign   = VerticalAlign.Top;
 }
Example #25
0
 /// <summary>
 /// 用TextBlock初始化,并根据缩放系数还原字号和边距
 /// </summary>
 /// <param name="text">TextBlock</param>
 /// <param name="zoomCoefficient">缩放系数</param>
 public LabelModel(System.Windows.Controls.TextBlock text, double zoomCoefficient)
 {
     文本   = text.Text;
     字体   = text.FontFamily.Source;
     字号   = text.FontSize / zoomCoefficient;
     水平边距 = text.Margin.Left / zoomCoefficient;
     垂直边距 = text.Margin.Top / zoomCoefficient;
     绝对定位 = true;
 }
Example #26
0
            /**
             * Constructor
             */
            public Label()
            {
                mMaxNumberOfLines = 0;

                mLabel = new System.Windows.Controls.TextBlock();
                mLabel.TextWrapping = TextWrapping.Wrap;

                mView = mLabel;
            }
Example #27
0
        private FrameworkElement CreateMessageBoxView(DialogViewModelBase viewModel)
        {
            var textBlock = new System.Windows.Controls.TextBlock();

            textBlock.Margin = new Thickness(4);
            textBlock.SetBinding(System.Windows.Controls.TextBlock.TextProperty, "Message");
            textBlock.TextWrapping = TextWrapping.Wrap;
            return(new Jamiras.Controls.OkCancelView(textBlock));
        }
Example #28
0
 private static System.Windows.Point GetTabHeaderCoordinates(System.Windows.Controls.TextBlock item)
 {
     if (item != null)
     {
         System.Windows.Point locationFromScreen = item.PointToScreen(new System.Windows.Point(0, 0));
         return(locationFromScreen);
     }
     return(new System.Windows.Point(0, 0));
 }
        public void SetFontProperties(string family, float lineHeight, float size, string style, string variant, int weight)
        {
            _fontFamily  = new System.Windows.Media.FontFamily(family);
            _fontStyle   = FontStyles.Normal;
            _fontStretch = FontStretches.Normal;

            if (style == "oblique")
            {
                _fontStyle = FontStyles.Oblique;
            }
            else if (style == "italic")
            {
                _fontStyle = FontStyles.Italic;
            }
            else //if (style == "normal")
            {
                _fontStyle = FontStyles.Normal;
            }

            if (weight >= 700)
            {
                _fontWeight = FontWeights.Bold;
            }
            else if (weight >= 400)
            {
                _fontWeight = FontWeights.Normal;
            }
            else
            {
                _fontWeight = FontWeights.Light;
            }

            _fontSize = size;

            // Compute the baseline offset by processing one character
            var textBlock = new System.Windows.Controls.TextBlock();
            var textRun   = new System.Windows.Documents.Run("k");

            textRun.FontFamily  = _fontFamily;
            textRun.FontSize    = _fontSize;
            textRun.FontWeight  = _fontWeight;
            textRun.FontStyle   = _fontStyle;
            textRun.FontStretch = _fontStretch;

            textBlock.FontFamily          = _fontFamily;
            textBlock.Padding             = new Thickness(0.0);
            textBlock.Margin              = new Thickness(0.0);
            textBlock.TextWrapping        = TextWrapping.NoWrap;
            textBlock.HorizontalAlignment = HorizontalAlignment.Left;
            textBlock.VerticalAlignment   = VerticalAlignment.Top;
            textBlock.Inlines.Add(textRun);
            textBlock.Measure(new Size(System.Double.PositiveInfinity, System.Double.PositiveInfinity));
            textBlock.Arrange(new Rect(textBlock.DesiredSize));

            _baseline = (float)textBlock.BaselineOffset;
        }
Example #30
0
 public MapUploader(string serverName, string databaseName, string username, string password, string columnName, string fileLocation, string tableName, int srid, bool geographyMode, System.Windows.Controls.TextBlock results)
 {
     connectionString   = "Data Source=" + serverName + ";Initial Catalog=" + databaseName + ";Persist Security Info=True;User ID=" + username + ";Password=" + password;
     this.columnName    = columnName;
     this.fileLocation  = fileLocation;
     this.tableName     = tableName;
     this.geographyMode = geographyMode;
     this.srid          = srid;
     this.resultsBox    = results;
 }
Example #31
0
 public MapUploader(string serverName, string databaseName, string username, string password, string columnName, string fileLocation, string tableName, int srid, bool geographyMode, System.Windows.Controls.TextBlock results)
 {
     connectionString = "Data Source=" + serverName + ";Initial Catalog=" + databaseName + ";Persist Security Info=True;User ID=" + username + ";Password=" + password;
     this.columnName = columnName;
     this.fileLocation = fileLocation;
     this.tableName = tableName;
     this.geographyMode = geographyMode;
     this.srid = srid;
     this.resultsBox = results;
 }
        //! \brief create text block with URL
        private System.Windows.Controls.TextBlock CreateTextBlockHRef(Color colDflt, Color colHRef, string text, string url)
        {
            var textBlock = new System.Windows.Controls.TextBlock {
                TextWrapping = System.Windows.TextWrapping.NoWrap
            };

            AddText(textBlock, colDflt, false, false, text + " [");
            AddText(textBlock, colHRef, false, true, url);
            AddText(textBlock, colDflt, false, false, "]");
            return(textBlock);
        }
Example #33
0
 public void color()
 {
     System.Windows.Controls.TextBlock text1 = (System.Windows.Controls.TextBlock)progetto.Window2.w2.FindName("online_text");
     if (Properties.Settings.Default.online == true)
     {
         text1.Foreground = System.Windows.Media.Brushes.Green;
     }
     else
     {
         text1.Foreground = System.Windows.Media.Brushes.Red;
     }
 }
Example #34
0
        private void AddIndex(Point posP, int index)
        {
            System.Windows.Controls.TextBlock textBlock = new System.Windows.Controls.TextBlock();
            textBlock.Text = index.ToString();

            textBlock.Foreground = Brushes.DarkGreen;
            textBlock.FontSize   = indexFontSize;

            textBlock.SetValue(System.Windows.Controls.Canvas.LeftProperty, posP.X);
            textBlock.SetValue(System.Windows.Controls.Canvas.TopProperty, posP.Y);
            canvas.Children.Add(textBlock);
        }
Example #35
0
        public static void AddRoute(string routeXml, Color color)
        {
            Map.Dispatcher.Invoke(() =>
            {
                Route rtz = null;

                try
                {
                    rtz = Serialization.Deserialize <Route>(routeXml);
                }
                catch (Exception)
                {
                }

                if (rtz != null)
                {
                    MapPolyline polyline     = new MapPolyline();
                    polyline.Stroke          = new SolidColorBrush(color);
                    polyline.StrokeThickness = 2;
                    polyline.Opacity         = 0.7;

                    polyline.Locations = new LocationCollection();
                    foreach (var waypoint in rtz.waypoints.waypoint)
                    {
                        polyline.Locations.Add(new Location((double)waypoint.position.lat, (double)waypoint.position.lon));
                    }

                    Map.Children.Add(polyline);

                    var lable        = new System.Windows.Controls.TextBlock();
                    lable.Text       = rtz.routeInfo.routeName;
                    lable.Foreground = new SolidColorBrush(color);
                    lable.FontSize   = 12;
                    lable.FontWeight = System.Windows.FontWeights.Bold;
                    Map.AddChild(lable, polyline.Locations[0]);

                    //Add pushpin for first waypoint
                    var pos      = rtz.waypoints.waypoint.FirstOrDefault().position;
                    Pushpin pin  = new Pushpin();
                    pin.Location = new Location((double)pos.lat, (double)pos.lon);
                    pin.ToolTip  = pos.lat + " " + pos.lon + " " + rtz.waypoints.waypoint.FirstOrDefault().name;
                    Map.Children.Add(pin);

                    //Add pushpin for last waypoint
                    pos          = rtz.waypoints.waypoint.LastOrDefault().position;
                    pin          = new Pushpin();
                    pin.Location = new Location((double)pos.lat, (double)pos.lon);
                    pin.ToolTip  = pos.lat + " " + pos.lon + " " + rtz.waypoints.waypoint.LastOrDefault().name;
                    Map.Children.Add(pin);
                }
            });
        }
        protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.Page> e)
        {
            base.OnElementChanged(e);

            var page = e.NewElement as MySecondPage;

            var stkpanel = new System.Windows.Controls.StackPanel();
            stkpanel.Orientation = System.Windows.Controls.Orientation.Horizontal;

            var label = new System.Windows.Controls.TextBlock
            {
                Text = "2" + page.Heading
            };

            stkpanel.Children.Add(label);

            this.Children.Add(stkpanel);
        }
Example #37
0
            /**
             * Constructor
             */
            public Label()
            {
                mMaxNumberOfLines = 0;

                mLabel = new System.Windows.Controls.TextBlock();
                mLabel.TextWrapping = TextWrapping.Wrap;

                /*
                 * We need to set some default values on the text block. For this, we use
                 * a predefined style.
                 * PhoneTextNormalStyle description:
                 * FontFamily: PhoneFontFamilyNormal
                 * FontSize: PhoneFontSizeNormal
                 * Foreground: PhoneForegroundBrush
                 * Margin: PhoneHorizontalMargin
                 */
                mLabel.Style = (Style)Application.Current.Resources["PhoneTextNormalStyle"];

                mView = mLabel;
            }
        public void MonitorElement(Element element)
        {
            //System.Windows.Controls.Image img = new System.Windows.Controls.Image();
            //img.
            //var gl = GestureService.GetGestureListener(img);
            //gl.DoubleTap += new EventHandler<GestureEventArgs>(GestureListenerDoubleTap);

            //GestureListener gl = new GestureListener();
            //gl.

            // Windows.UI.Input.GestureRecognizer grTap = new  Windows.UI.Input.GestureRecognizer();
            //grTap.GestureSettings = Windows.UI.Input.GestureSettings.DoubleTap | Windows.UI.Input.GestureSettings.Hold | Windows.UI.Input.GestureSettings.CrossSlide;
            System.Windows.Controls.TextBlock el = new System.Windows.Controls.TextBlock();
            el.ManipulationCompleted
            //Label elbn = new Label();
            //elbn.
            //UIElement elem = el as UIElement;
            //GestureService gs = new GestureService();
            //e
            
        }
Example #39
0
            /**
             * Constructor
             */
            public Label()
            {
                mMaxNumberOfLines = 0;
                mParentLayout = new System.Windows.Controls.Grid();

                RowDefinition _rowDef = new RowDefinition();
                _rowDef.Height = new GridLength(1, GridUnitType.Auto);
                RowDefinition _spacerUp = new RowDefinition();
                _rowDef.Height = new GridLength(1, GridUnitType.Auto);
                RowDefinition _spacerDown = new RowDefinition();
                _rowDef.Height = new GridLength(1, GridUnitType.Auto);

                mParentLayout.RowDefinitions.Add(_spacerUp);
                mParentLayout.RowDefinitions.Add(_rowDef);
                mParentLayout.RowDefinitions.Add(_spacerDown);

                mLabel = new System.Windows.Controls.TextBlock();
                mLabel.TextWrapping = TextWrapping.Wrap;

                /*
                 * We need to set some default values on the text block. For this, we use
                 * a predefined style.
                 * PhoneTextNormalStyle description:
                 * FontFamily: PhoneFontFamilyNormal
                 * FontSize: PhoneFontSizeNormal
                 * Foreground: PhoneForegroundBrush
                 * Margin: PhoneHorizontalMargin
                 */
                mLabel.Style = (Style)Application.Current.Resources["PhoneTextNormalStyle"];

                mParentLayout.Children.Add(mLabel);

                Grid.SetRow(mLabel, 1);

                View = mParentLayout;
            }
Example #40
0
            /**
             * Function that creates the TextBlock object and setts the alignment of the text
             */
            private void createTextBlock()
            {
                mText = new System.Windows.Controls.TextBlock();
                mText.TextWrapping = TextWrapping.NoWrap;

                mText.VerticalAlignment = VerticalAlignment.Center;
                mText.HorizontalAlignment = HorizontalAlignment.Center;
                mText.TextAlignment = TextAlignment.Center;
            }
Example #41
0
            /**
            * Constructor
            */
            public ListViewItem()
            {
                mGrid = new System.Windows.Controls.Grid();

                mIcon = new System.Windows.Controls.Image();
                mIcon.VerticalAlignment = VerticalAlignment.Center;
                mStretch = new System.Windows.Media.Stretch();

                mText = new System.Windows.Controls.TextBlock();
                mText.TextWrapping = TextWrapping.NoWrap;
                mText.Margin = new Thickness(10);
                mText.VerticalAlignment = VerticalAlignment.Center;
                mText.TextAlignment = TextAlignment.Left;

                mColumn1 = new ColumnDefinition();
                mColumn1.Width = new GridLength(1, GridUnitType.Auto);

                mColumn2 = new ColumnDefinition();
                mColumn2.Width = new GridLength(1, GridUnitType.Star);

                mRow = new RowDefinition();
                mRow.Height = new GridLength(1, GridUnitType.Auto);

                mGrid.RowDefinitions.Add(mRow);
                mGrid.ColumnDefinitions.Add(mColumn1);
                mGrid.ColumnDefinitions.Add(mColumn2);

                Grid.SetRow(mIcon, 0);
                Grid.SetColumn(mIcon, 0);

                Grid.SetRow(mText, 0);
                Grid.SetColumnSpan(mText, 1);
                Grid.SetColumn(mText, 1);

                mGrid.Children.Add(mIcon);
                mGrid.Children.Add(mText);

                View = mGrid;

                this.ItemSelected = false;
                this.ItemsSourceItemIndex = -1;

                // set the default font color values
                mFontColor = new SolidColorBrush(Colors.White);
                mSubtitleFontColor = new SolidColorBrush(Colors.White);
            }
Example #42
0
 private void ShowLyricsWindow(string title, string lyrics)
 {
     var lyricsWindow = new Window();
     lyricsWindow.Width = 360;
     lyricsWindow.Height = 660;
     lyricsWindow.ResizeMode = ResizeMode.NoResize;
     lyricsWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
     lyricsWindow.Title = title;
     lyricsWindow.Background = lyricsWindowBackground;
     lyricsWindow.Icon = new System.Windows.Media.Imaging.BitmapImage(
         new Uri(Environment.CurrentDirectory + @"\Plugins\VKPlugin\Images\faviconnew.ico"));
     var sw = new System.Windows.Controls.ScrollViewer();
     sw.Margin = new Thickness(0, 0, 0, 10);
     var textBlock = new System.Windows.Controls.TextBlock();
     textBlock.Margin = new Thickness(20, 20, 0, 20);
     textBlock.TextWrapping = TextWrapping.Wrap;
     textBlock.TextAlignment = TextAlignment.Left;
     textBlock.Text = lyrics;
     textBlock.Background = lyricsWindow.Background;
     textBlock.Foreground = lyricsWindowForeground;
     sw.Content = textBlock;
     lyricsWindow.Content = sw;
     lyricsWindow.Show();
 }
Example #43
0
            /**
            * Constructor
            */
            public ListViewItem()
            {
                mItem = new System.Windows.Controls.ListBoxItem();

                mGrid = new System.Windows.Controls.Grid();

                mIcon = new System.Windows.Controls.Image();
                mIcon.VerticalAlignment = VerticalAlignment.Center;
                mStretch = new System.Windows.Media.Stretch();

                mText = new System.Windows.Controls.TextBlock();
                mText.TextWrapping = TextWrapping.NoWrap;
                mText.Margin = new Thickness(10);
                mText.VerticalAlignment = VerticalAlignment.Center;
                mText.TextAlignment = TextAlignment.Left;

                mColumn1 = new ColumnDefinition();
                mColumn1.Width = new GridLength(1, GridUnitType.Auto);

                mColumn2 = new ColumnDefinition();
                mColumn2.Width = new GridLength(1, GridUnitType.Star);

                mRow = new RowDefinition();
                mRow.Height = new GridLength(1, GridUnitType.Auto);

                mGrid.RowDefinitions.Add(mRow);
                mGrid.ColumnDefinitions.Add(mColumn1);
                mGrid.ColumnDefinitions.Add(mColumn2);

                Grid.SetRow(mIcon, 0);
                Grid.SetColumn(mIcon, 0);

                Grid.SetRow(mText, 0);
                Grid.SetColumnSpan(mText, 1);
                Grid.SetColumn(mText, 1);

                mGrid.Children.Add(mIcon);
                mGrid.Children.Add(mText);

                mItem.Content = mGrid;

                mView = mItem;
            }
Example #44
0
        /// <summary>
        /// Shows the specified notification.
        /// </summary>
        /// <param name="icon">The notification icon.</param>
        /// <param name="title">The notification title.</param>
        /// <param name="content">The notification content.</param>
        /// <param name="displayDuration">The notification display duration.</param>
        /// <param name="isDoubleHeight">Option to double the notification height</param>
        public static void Show(ImageSource icon, string title, object content, TimeSpan displayDuration, bool isDoubleHeight)
        {
            object contentWrapper = content;
            if (content is string)
            {
                // If the content is just a string, we need to put it in a TextBlock so we can wrap the text.
                contentWrapper = new System.Windows.Controls.TextBlock()
                {
                    Text = (string)content,
                    TextWrapping = TextWrapping.Wrap
                };
            }

            Window window = new Window()
            {
                Content = contentWrapper,
                Icon = icon,
                Title = title
            };
            window.Style = (Style)window.FindResource("NotifyBoxWindowStyle");
            if (isDoubleHeight)
            {
                window.Height *= 2;
            }

            Show(window, displayDuration);
        }
 public static void SetStatuslabel(System.Windows.Controls.TextBlock buffer)
 {
     _lstatus = buffer;
 }
Example #46
0
 public TextBlock()
 {
     C = new System.Windows.Controls.TextBlock();
 }
Example #47
0
        public SensorTracker(System.Windows.Controls.Image visualisation, MeasurementLoader manager, System.Windows.Controls.TextBlock textBlock)
        {
            System.Diagnostics.Debug.WriteLine("Initialising tracking system...");

            // Store given variables
            this.ScanProcessManager = manager;
            this.displayText = textBlock;
            this.Visualisation = visualisation;

            // Get row pointers, to have as reference rather than calculating every time (used by Highlight)
            rowHeaders = new int[480];
            for (int row = 0; row < 480; row++)
            {
                rowHeaders[row] = row * 640 * 4;
            }

            x_array = new int[3];
            y_array = new int[3];
        }