コード例 #1
1
ファイル: KnownTypes.cs プロジェクト: sjyanxin/WPFSource
        // Code compiled into PresentationFramework.dll

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

            Load();
            _comboBoxTimeFrame.Items.Add(TimeFrame.Min5);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Min10);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Min15);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Min30);


            _comboBoxTimeFrame.SelectedItem = TimeFrame;

            _comboBoxTimeFrame.SelectionChanged += _comboBoxTimeFrame_SelectionChanged1;

            _textBoxSourceFile.Text = _sourceFile;
            _textBoxExitFile.Text   = _exitFile;

            _timeFrameBuilder = new TimeFrameBuilder();

            Log log = new Log("OsDataMaster", StartProgram.IsOsData);

            log.StartPaint(logFormsHost);
            log.Listen(this);
        }
コード例 #4
0
        public static bool ValidarApellidoNombreTextBox(System.Windows.Controls.TextBox mitextbox)
        {
            String texto  = mitextbox.Text.ToString();
            bool   valido = false;



            foreach (char c in texto)
            {
                if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '\'' || (c >= 'á' && c <= 'Ñ') || c == 'ü' || c == 'Ü' || c == ' ' || c == 'é' || c == 'Á' || c == 'É' || c == 'Í' || c == 'Ó' || c == 'Ú' || c == 'ç' || c == 'Ç')
                {
                    valido = true;
                }
                else
                {
                    valido = false;
                }

                if (!valido)
                {
                    return(false);
                }
            }

            return(valido);
        }
コード例 #5
0
        public void TextUpdated(object sender)
        {
            if (sender == null)
            {
                return;
            }

            System.Windows.Controls.TextBox tb = (System.Windows.Controls.TextBox)sender;

            if (tb.Text == "")
            {
                return;
            }

            if (int.TryParse(tb.Text, out newVal))
            {
                if (newVal <= 0)
                {
                    MessageBox.Show("Hey, we need an positive integer over there.");
                    return;
                }
            }
            else
            {
                MessageBox.Show("Hey, we need an integer over there.");
            }
        }
コード例 #6
0
 private void FillBlankTextBoxValues(System.Windows.Controls.TextBox tb)
 {
     if (string.IsNullOrEmpty(tb.Text) || tb.Text == "-")
     {
         tb.Text = "0";
     }
 }
コード例 #7
0
        public bool TextBox_KeyDown(System.Windows.Controls.TextBox tb, System.Windows.Input.KeyEventArgs e)
        {
            bool blnReturn = true;
            int  ascii     = KeyInterop.VirtualKeyFromKey(e.Key);

            if (tb.Text.Length == 10)
            {
                ascii = ((ascii == 13) || (ascii == 8)) ? ascii : 0;  /* backspace OR horizontal tab */
            }

            switch (ascii)
            {
            case  8:      /* horizontal tab*/
                blnReturn = false;
                break;

            case 13:      /* return moves to next tab index*/
                SendKeys.Send("\t");
                ascii     = 0;
                blnReturn = false;
                break;

            case int n when(n < 32) || (n >= 48 && n <= 57):       /* space OR nos 0 to 9*/
                blnReturn = false;

                break;

            default:
                ascii = 0;
                break;
            }
            return(blnReturn);
        }
コード例 #8
0
        public MainViewModel(OpenGL gl, System.Windows.Controls.ScrollViewer scrollViewer, System.Windows.Controls.TextBox outputWindowTextBox,
                             GestureLibrary gestureLibraryControl, EditStaticGesture editStaticGestureControl, EditDynamicGesture editDynamicGestureControl,
                             RecognitionMonitor recognitionMonitorControl, Controller controller)
        {
            _gl                    = gl;
            _controller            = controller;
            _camera                = new Camera(_gl);
            _scrollViewer          = scrollViewer;
            _outputWindowTextBox   = outputWindowTextBox;
            _gestureLibraryControl = gestureLibraryControl;
            _gestureLibraryControl.SetMvm(this);
            _editStaticGestureControl = editStaticGestureControl;
            _editStaticGestureControl.SetMvm(this);
            _editDynamicGestureControl = editDynamicGestureControl;
            _editDynamicGestureControl.SetMvm(this);
            _sqliteProvider = new SQLiteProvider(Constants.SQLiteFileName);
            _config         = new LGR_Configuration(_sqliteProvider);
            _glHelper       = new SharpGLHelper(_gl, _config.BoneColors);

            UpdateStaticGestureLibrary();
            UpdateDynamicGestureLibrary();

            initMenuBar();

            // Needs to be initialized after UpdateGestureLibrary()
            _classifier = new StatisticalClassifier(StaticGestures, DynamicGestures);

            _recognitionMonitorControl    = recognitionMonitorControl;
            _recognitionMonitorControl.VM = new RecognitionMonitorViewModel(_classifier);

            FrameReceived += _recognitionMonitorControl.VM.OnFrameReceived;
        }
コード例 #9
0
        public static void SetControlText(System.Windows.Controls.TextBox TextBoxControl, string FilteredString)
        {
            int    cursorPos      = TextBoxControl.SelectionStart; // Get the cursor position
            string textBoxContent = TextBoxControl.Text;

            if (FilteredString.Length < textBoxContent.Length)             // this might mean that an invalid character was entered part way through the string
            {
                cursorPos--;                                               // Step back one character
                textBoxContent      = textBoxContent.Remove(cursorPos, 1); // Remove the offending character
                TextBoxControl.Text = textBoxContent;                      // Set the string
            }
            else
            {
                TextBoxControl.Text = FilteredString;
            }

            if (cursorPos >= TextBoxControl.Text.Length) // If the cursor was at the end of the text
            {
                TextBoxControl.SelectionStart = TextBoxControl.Text.Length;
            }
            else
            {
                TextBoxControl.SelectionStart = cursorPos;
            }
        }
コード例 #10
0
        private void CharacterInfo_Load(object sender, EventArgs e)
        {
            profBox = (prof.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            personalityTraitsBox = (personalityTraits.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            idealsBox            = (ideals.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            bondsBox             = (bonds.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            flawsBox             = (flaws.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            backstoryBox         = (backstory.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            alliesBox            = (allies.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;
            notesBox             = (notes.Controls[0] as ElementHost).Child as System.Windows.Controls.TextBox;


            Form1 form1 = this.Owner as Form1;

            if (form1.portrait != null)
            {
                portraitBytes     = ((Form1)this.Owner).portrait;
                portrait.Image    = (Bitmap)((new ImageConverter()).ConvertFrom(portraitBytes));
                portrait.SizeMode = PictureBoxSizeMode.StretchImage;
            }
            profBox.Text = form1.charInfo[0];
            personalityTraitsBox.Text = form1.charInfo[1];
            idealsBox.Text            = form1.charInfo[2];
            bondsBox.Text             = form1.charInfo[3];
            flawsBox.Text             = form1.charInfo[4];
            backstoryBox.Text         = form1.charInfo[5];
            alliesBox.Text            = form1.charInfo[6];
            notesBox.Text             = form1.charInfo[7];
            profBox.Select(prof.Text.Length, 0);
        }
コード例 #11
0
        /// <summary>
        /// Changes the SelectionBrush 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 SelectionBrush(System.Windows.Controls.TextBox targetControl, Color fromValue, Color toValue, int duration)
        {
            ColorAnimation animation = new ColorAnimation(toValue, new Duration(TimeSpan.FromMilliseconds(duration)));

            targetControl.SelectionBrush = new SolidColorBrush(fromValue);
            targetControl.SelectionBrush.BeginAnimation(SolidColorBrush.ColorProperty, animation);
        }
コード例 #12
0
 public void TextClear(System.Windows.Controls.TextBox text, string str)
 {
     if (str == text.Text)
     {
         text.Text = "";
     }
 }
コード例 #13
0
        public BasicSettingsData(System.Windows.Controls.TextBox processTextfield)
        {
            var helper = new WindowInteropHelper(Application.Current.MainWindow);

            helper.EnsureHandle();  //get a handle witthout the need to show the window
            hotkeyListener = new Hotkey.HotkeyListener(helper.Handle);
            hotkeyListener?.RegisterHotKey(HotkeyMod1._Value | HotkeyMod2._Value, HotkeyKey._Value);

            this.bot = new Bot.Bot(new Input.Keyboard.User32_SendInput_VirtualKeycode());
            hotkeyListener.OnHotKeyPressed += () => {
                if (this.IsBotRunning)
                {
                    bot.Stop();
                }
                else
                {
                    bot.Start("\r" + this.HotkeyAction + "\r");
                }

                this.IsBotRunning = !this.IsBotRunning;
            };

            Application.Current.Dispatcher.ShutdownStarted += Dispatcher_ShutdownStarted;
            procChecker = new Timer(checkProcess, null, -1, -1); // init timer, but don`t start
            processTextfield.IsVisibleChanged += DependentUIElement_IsVisibleChanged;
            processTextfield.KeyUp            += (a, b) => { procChecker.Change(TimeSpan.FromSeconds(0), TimeSpan.FromSeconds(1)); };
        }
コード例 #14
0
        /// <summary>
        /// конструктор
        /// </summary>
        /// <param name="textBoxSourceFile">контрол для источника тиков</param>
        /// <param name="textBoxExitFile">контрол для исходящего файла</param>
        /// <param name="comboBoxTimeFrame">контрол для таймФрейма создаваемых свечек</param>
        /// <param name="logFormsHost">хост для лога</param>
        public OsConverterMaster(TextBox textBoxSourceFile, TextBox textBoxExitFile, ComboBox comboBoxTimeFrame, WindowsFormsHost logFormsHost)
        {
            _textBoxSourceFile = textBoxSourceFile;
            _textBoxExitFile   = textBoxExitFile;
            _comboBoxTimeFrame = comboBoxTimeFrame;
            TimeFrame          = TimeFrame.Sec1;

            Load();

            _comboBoxTimeFrame.Items.Add(TimeFrame.Sec1);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Sec2);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Sec5);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Sec10);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Sec15);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Sec20);
            _comboBoxTimeFrame.Items.Add(TimeFrame.Sec30);

            _comboBoxTimeFrame.SelectedItem = TimeFrame;

            _comboBoxTimeFrame.SelectionChanged += _comboBoxTimeFrame_SelectionChanged;

            _textBoxSourceFile.Text = _sourceFile;
            _textBoxExitFile.Text   = _exitFile;

            Log log = new Log("OsDataMaster");

            log.StartPaint(logFormsHost);
            log.Listen(this);
        }
コード例 #15
0
        /// <summary>
        /// Stop drawing connector elements
        /// остановить прорисовывание элементов коннектора
        /// </summary>
        public void StopPaint()
        {
            try
            {
                if (_glassBox != null && _glassBox.InvokeRequired)
                {
                    _glassBox.Invoke(new Action(StopPaint));
                    return;
                }

                if (_textBoxLimitPrice != null)
                {
                    _textBoxLimitPrice.TextChanged -= _textBoxLimitPrice_TextChanged;
                    _textBoxLimitPrice              = null;
                }

                if (_hostGlass != null)
                {
                    _hostGlass.Child = null;
                    _hostGlass       = null;
                }
            }
            catch (Exception error)
            {
                SendNewLogMessage(error.ToString(), LogMessageType.Error);
            }
        }
コード例 #16
0
        private void TextOnFocus(object sender, RoutedEventArgs e)
        {
            TextBox textBox = (TextBox)sender;

            textBox.Text      = string.Empty;
            textBox.GotFocus -= this.TextOnFocus;
        }
コード例 #17
0
ファイル: TextBox.cs プロジェクト: nirex0/NDC
        /// <summary>
        /// Changes the Background property of the control.
        /// </summary>
        /// <param name="targetControl">The control instance.</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.TextBox targetControl, Color toValue, int duration)
        {
            ColorAnimation animation = new ColorAnimation(toValue, new Duration(TimeSpan.FromMilliseconds(duration)));

            targetControl.Background = new SolidColorBrush(((SolidColorBrush)targetControl.Background).Color);
            targetControl.Background.BeginAnimation(SolidColorBrush.ColorProperty, animation);
        }
コード例 #18
0
        /// <summary>
        /// 验证文本框数字(最小,最大)
        /// </summary>
        /// <param name="textbox"></param>
        /// <param name="min"></param>
        /// <param name="max">最大值里面的小数并不代表真实的小数位</param>
        /// <param name="decimalPlace">小数有几位</param>
        //public static bool ValidateTextBox(string text, float min, float max, int decimalPlace)
        //{
        //    string strText = text;
        //    if (string.IsNullOrEmpty(strText))
        //    {
        //        return true;
        //    }
        //    //先把数字拆开
        //    string szFormat = "F" + decimalPlace.ToString();
        //    string szMax = max.ToString(szFormat);
        //    string szMaxIntPart = ((int)max).ToString() + ".";
        //    string szMaxDecimalPart = szMax.Replace(szMaxIntPart, "");
        //    string szMin = min.ToString(szFormat).PadLeft(szMax.Length, '0');
        //    string szMinIntPart = szMin.Substring(0, szMaxIntPart.Length);
        //    string szMinDecimalPart = szMin.Replace(szMinIntPart, "");

        //    if (Convert.ToInt32(strText.TrimEnd('.')) >= Convert.ToInt32(szMinIntPart.TrimEnd('.'))
        //   && Convert.ToInt32(strText.TrimEnd('.')) <= Convert.ToInt32(szMaxIntPart.TrimEnd('.'))
        //   )
        //        return true;
        //    else
        //        return false;

        //}

        /// <summary>
        /// check bar number
        /// </summary>
        /// <param name="textbox"></param>
        /// <param name="barLength"></param>
        public static void ValidateTextBoxBarNumber(System.Windows.Controls.TextBox textbox, int barLength = 28)
        {
            if (textbox == null)
            {
                return;
            }
            string strText = textbox.Text;

            if (string.IsNullOrEmpty(strText))
            {
                return;
            }
            int length = strText.Length;

            if (!HasOnlyLetterOrDigitByRegex(strText)) // if not bar code
            {
                textbox.Text           = strText.Substring(0, length - 1);
                textbox.SelectionStart = textbox.Text.Length;
                return;
            }
            if (length >= barLength &&
                !IsBarCode(textbox.Text)
                )
            {
                textbox.Text           = strText.Substring(0, length - 1);
                textbox.SelectionStart = textbox.Text.Length;
                return;
            }
        }
コード例 #19
0
        private void ToggleShortcut_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            e.Handled = true;
            var    converter      = new KeysConverter();
            string modifierString = converter.ConvertToString(e.KeyboardDevice.Modifiers);
            string key            = converter.ConvertToString(e.Key);

            // Supress unwanted keys
            if (key == "LeftCtrl" || key == "RightCtrl" || key == "LeftShift" || key == "RightShift" || key == "System" || key == "LWin" || key == "RWin")
            {
                key = "";
            }
            System.Windows.Controls.TextBox textbox = (System.Windows.Controls.TextBox)sender;

            switch (textbox.Name)
            {
            case "toggleShortcutBox":
                toggleKeyboardShortcut = new KBShortcut("Toggle Lights", e.KeyboardDevice.Modifiers, e.Key);
                textbox.Text           = toggleKeyboardShortcut.description;
                break;

            case "brightnessUpShortcut":
                increaseBrightnessShortcut = new KBShortcut("Brightness Up", e.KeyboardDevice.Modifiers, e.Key);
                textbox.Text = increaseBrightnessShortcut.description;
                break;

            case "brightnessDownShortcut":
                decreaseBrightnessShortcut = new KBShortcut("Brightness Down", e.KeyboardDevice.Modifiers, e.Key);
                textbox.Text = decreaseBrightnessShortcut.description;
                break;
            }
        }
コード例 #20
0
        public static void Input(this System.Windows.Controls.TextBox textBox, string text, int?maxInput = null)
        {
            int    selectionStart = textBox.SelectionStart;
            string tempText;

            if (textBox.SelectionLength > 0)
            {
                tempText = textBox.Text.Substring(0, textBox.SelectionStart) + text
                           + textBox.Text.Substring(textBox.SelectionStart + textBox.SelectionLength);
                if (maxInput.HasValue && tempText.Length > maxInput.Value)
                {
                    return;
                }

                textBox.Text            = tempText;
                textBox.SelectionStart  = selectionStart + textBox.SelectionLength + 1;
                textBox.SelectionLength = 0;
            }
            else
            {
                tempText = textBox.Text.Substring(0, textBox.SelectionStart) + text
                           + textBox.Text.Substring(textBox.SelectionStart);
                if (maxInput.HasValue && tempText.Length > maxInput.Value)
                {
                    return;
                }

                textBox.Text            = tempText;
                textBox.SelectionStart  = selectionStart + text.Length;
                textBox.SelectionLength = 0;
            }
        }
コード例 #21
0
ファイル: Manage.cs プロジェクト: vidalouiswang/Anything_wpf
 /// <summary>
 /// 用于设置搜索框的显示相关
 /// </summary>
 /// <param name="txtMain"></param>
 /// <param name="Show"></param>
 /// <param name="FillText"></param>
 /// <returns></returns>
 public static int ClearOrFillText(ref System.Windows.Controls.TextBox txtMain, bool Show, string FillText = "Use keyword to search")
 {
     if (txtMain != null)
     {
         if (Show)
         {
             if (txtMain.Text.Trim() == "Use keyword to search")
             {
                 txtMain.Text = "";
             }
         }
         else
         {
             if (string.IsNullOrEmpty(txtMain.Text.Trim()))
             {
                 txtMain.Text = FillText;
             }
         }
     }
     else
     {
         return(-1);
     }
     return(0);
 }
コード例 #22
0
        private void digestAreaEntry(object sender)
        {
            System.Windows.Controls.TextBox tb = sender as System.Windows.Controls.TextBox;
            string   strNewOpArea = tb.Text;
            UnitType clipUnit     = UnitType.UT_Area;
            Units    thisDocUnits = _doc.GetUnits();
            double   userNewOpArea;

            UnitFormatUtils.TryParse(thisDocUnits, clipUnit, strNewOpArea,
                                     out userNewOpArea);
            switch (tb.Name)
            {
            case "pfXOpArea":
                YOpDist          = userNewOpArea / XOpDist;
                pfYdistance.Text = AsRevitDistanceFormat(YOpDist);
                break;

            case "pfYOpArea":
                XOpDist          = userNewOpArea / YOpDist;
                pfXdistance.Text = AsRevitDistanceFormat(XOpDist);
                break;

            default:
                break;
            }
            CalcOpArea();
            UpdateOpAreas();
            tb.CaretIndex = tb.Text.Length;  /// reset cursor to end of text
        }
コード例 #23
0
        public TextSearchFilter(ICollectionView filteredView, TextBox searchCharBox)
        {
            string filterText = "";

            filteredView.Filter = delegate(object obj)
            {
                if (String.IsNullOrEmpty(filterText))
                {
                    return(true);
                }
                string str = obj as string;
                if (String.IsNullOrEmpty(str))
                {
                    return(false);
                }
                int index = str.IndexOf(filterText, 0, StringComparison.InvariantCultureIgnoreCase);
                return(index > -1);
            };

            searchCharBox.TextChanged += delegate
            {
                filterText = searchCharBox.Text;
                filteredView.Refresh();
            };
        }
コード例 #24
0
        private static void UnifySlidertoTextValue(RangeBase sli, TextBox tb)
        {
            if (!Regex.IsMatch(tb.Text, @"^[0-9]+$"))
            {
                return;
            }

            var tbNum = int.Parse(tb.Text);

            if (tbNum > sli.Maximum)
            {
                tb.Text   = ((int)sli.Maximum).ToString();
                sli.Value = sli.Maximum;

                return;
            }

            if (tbNum < sli.Minimum)
            {
                tb.Text   = ((int)sli.Minimum).ToString();
                sli.Value = sli.Minimum;

                return;
            }

            sli.Value = int.Parse(tb.Text);
        }
コード例 #25
0
 /// <summary>
 /// テキストボックスにドロップしたときにムービー情報をセットする
 /// </summary>
 /// <param name="lbl"></param>
 /// <param name="txt"></param>
 /// <param name="i">DISPLAYクラス</param>
 /// <param name="fileInfo">セットする情報</param>
 private void SetMovieInfo(System.Windows.Controls.Label lbl, System.Windows.Controls.TextBox txt, int i, string fileInfo)
 {
     txt.Text    = fileInfo;
     lbl.Content = _main.SetMoviePath(i, txt.Text);
     AddLog(_main.JdgReady());
     btn_movie.IsEnabled = _main.dispReady;
 }
コード例 #26
0
        /// <summary>
        /// to start drawing the connector elements
        /// начать прорисовывать элементы коннектора
        /// </summary>
        public void StartPaint(WindowsFormsHost glass, System.Windows.Controls.TextBox textBoxLimitPrice)
        {
            try
            {
                if (_glassBox == null)
                {
                    return;
                }
                if (_glassBox.InvokeRequired)
                {
                    _glassBox.Invoke(new Action <WindowsFormsHost, System.Windows.Controls.TextBox>(StartPaint), glass, textBoxLimitPrice);
                    return;
                }

                _textBoxLimitPrice              = textBoxLimitPrice;
                _textBoxLimitPrice.TextChanged += _textBoxLimitPrice_TextChanged;
                _hostGlass = glass;

                ProcessBidAsk(_bid, _ask);
                _hostGlass.Child = _glassBox;
                _hostGlass.Child.Refresh();

                _textBoxLimitPrice.Text = Convert.ToDouble(_lastSelectPrice).ToString(new CultureInfo("RU-ru"));

                ProcessMarketDepth(_lastMarketDepth);
            }
            catch (Exception error)
            {
                SendNewLogMessage(error.ToString(), LogMessageType.Error);
            }
        }
コード例 #27
0
        public static void Listener(TcpListener tcpListener, System.Windows.Controls.TextBox textbox)
        {
            while (th_b)
            {
                try
                {
                    TcpClient     tcpClient     = tcpListener.AcceptTcpClient();
                    NetworkStream networkStream = tcpClient.GetStream();

                    byte[] buffer = new byte[0x1000];
                    networkStream.Read(buffer, 0, 0x1000);
                    networkStream.WriteByte(1);
                    networkStream.Close();
                    tcpClient.Close();

                    string receiveString = Encoding.Default.GetString(buffer).Trim('\0');

                    textbox.Dispatcher.Invoke(() =>
                    {
                        textbox.Text += receiveString + "\n\n";
                    });

                    // Console.WriteLine(receiveString);
                }
                catch (Exception e)
                {
                    //throw e;
                }
            }
        }
コード例 #28
0
ファイル: WPFHelpers.cs プロジェクト: denis-adamchuk/mrHelper
 internal static System.Windows.Controls.TextBox CreateWPFTextBox(
     System.Windows.Forms.Integration.ElementHost host, bool isReadOnly, string text, bool multiline,
     bool isSpellCheckEnabled, bool softwareOnlyRenderMode)
 {
     System.Windows.Controls.TextBox textbox = new System.Windows.Controls.TextBox
     {
         AcceptsReturn = multiline,
         IsReadOnly    = isReadOnly,
         Text          = text,
         TextWrapping  = System.Windows.TextWrapping.Wrap,
         HorizontalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Auto,
         VerticalScrollBarVisibility   = System.Windows.Controls.ScrollBarVisibility.Auto
     };
     if (softwareOnlyRenderMode)
     {
         textbox.Loaded += (s, e) =>
         {
             var source = System.Windows.PresentationSource.FromVisual(textbox);
             if (source.CompositionTarget is System.Windows.Interop.HwndTarget hwndTarget)
             {
                 hwndTarget.RenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
             }
         };
     }
     textbox.SpellCheck.IsEnabled = isSpellCheckEnabled;
     host.Child = textbox;
     return(textbox);
 }
コード例 #29
0
    /// <summary>
    /// shows how to create a event delayer and use it to listen to the events from a text box and call if no further changes for 2 seconds.
    /// </summary>
    private static void ShowUsage(System.Windows.Controls.TextBox textBox)
    {
        EventDelayer eventDelayer = new EventDelayer(TimeSpan.FromSeconds(2));

        textBox.TextChanged       += eventDelayer.Enqueue;
        eventDelayer.DelayedEvent += eventDelayer_DelayedEvent;
    }
コード例 #30
0
        public static StringCollection GetLinesCollectionFromTextBox(System.Windows.Controls.TextBox textBox)
        {
            var lines = new StringCollection();

            lines.AddRange(textBox.Text.Split('\n'));
            return(lines);
        }
コード例 #31
0
        //Compares the text in a textbox to a regex and deletes the character that's invalid + makes a system sound
        private void inputcontrol(System.Windows.Controls.TextBox textbox, Regex regex)
        {
            if (textbox.Text.Length > 0)
            {
                string a         = textbox.Text;
                string validated = "";
                int    i         = 0;

                foreach (Match m in regex.Matches(a))
                {
                    validated += m;
                    i++;
                }

                if (i < a.Length)
                {
                    textbox.Text = validated;
                    System.Media.SystemSounds.Exclamation.Play();
                }
                else
                {
                    //all input is valid
                }
            }
            else
            {
                //Textbox is empty, nothing to do here
            }
        }
コード例 #32
0
		public void Dispose()
		{
			if (_view != null)
			{
				_view = null;
			}
		}
コード例 #33
0
ファイル: Monitor.xaml.cs プロジェクト: bejo4ever/antrian
 private void UpdateLoket(string number)
 {
     var textBox = new TextBox();
     textBox.Foreground = new SolidColorBrush(Color.FromRgb(255, 255, 255));
     textBox.Background = new SolidColorBrush(Color.FromRgb(0, 0, 0));
     textBox.Text = number;
     textBox.BorderThickness = new Thickness(0.0);
     loketTransitionBox.Content = textBox;
 }
コード例 #34
0
		public DataDisplayController()
		{
			_view = new System.Windows.Controls.TextBox();
			_view.TextWrapping = System.Windows.TextWrapping.NoWrap;
			_view.AcceptsReturn = true;
			_view.AcceptsTab = true;
			_view.VerticalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Visible;
			_view.HorizontalScrollBarVisibility = System.Windows.Controls.ScrollBarVisibility.Visible;
			_view.FontFamily = new System.Windows.Media.FontFamily("Global Monospace");

			Current.SetDataDisplayService(this);
		}
コード例 #35
0
 /// <summary>
 /// Sets textbox to output to.
 /// </summary>
 /// <param name="box">Textbox to output debug info to.</param>
 public static void SetBox(System.Windows.Controls.TextBox box, System.Windows.Controls.ScrollViewer scroller)
 {
     try
     {
         LastPrint = DateTime.Now;
         UpdateTimer.Interval = TimeSpan.FromSeconds(0.5);
         UpdateTimer.Tick += UpdateTimer_Tick;
         UpdateTimer.Start();
         rtb = box;
         Scroller = scroller;
     }
     catch { }
 }
コード例 #36
0
        public WindowsForm()
        {
            InitializeComponent();

            System.Windows.Controls.Button wpfButton = new System.Windows.Controls.Button();
            System.Windows.Controls.TextBox wpfTextBox = new System.Windows.Controls.TextBox();
            wpfButton.Resources.MergedDictionaries.Add(System.Windows.Application.Current.Resources);
            wpfButton.Content = wpfTextBox;
            
            ElementHost elementHost = new ElementHost();
            elementHost.Child = wpfButton;
            panel1.Controls.Add(elementHost);
        }
コード例 #37
0
 private void UpdateDeep()
 {
     Children.Clear();
     if(Searchable)
     {
         searchTextBox = new System.Windows.Controls.TextBox
         {
             Text = ValuePattern
         };
         searchTextBox.TextChanged += SearchTextBox_TextChanged;
         Children.Add(searchTextBox);
     }
     var dictionary = KeyValuePair.GetValue(DataContext) as IDictionary;
     if (dictionary != null)
     {
         string[] unique_types = IDictionaryExtension.CollectUniqueStrings(dictionary, Key);
         Array.Sort(unique_types, (x, y) => String.Compare(x, y));
         foreach (var type in unique_types)
         {
             if (type.Contains(ValuePattern))
             {
                 var instances = IDictionaryExtension.DeepCollect<IDictionary>(dictionary,
                         new KeyValueFilter { Key = Key, Values = { type } }.Include);
                 if (instances.Count > 0)
                 {
                     var expander = new InstanceExpander
                     {
                         Key = Key,
                         ValuePattern = type,
                         DataContext = instances
                     };
                     expander.ListBox.SelectionChanged += ListBox_SelectionChanged;
                     Children.Add(expander);
                 }
             }
         }
     }
 }
コード例 #38
0
 public PythonStream(System.Windows.Controls.TextBox textbox)
 {
     _output = textbox;
 }
コード例 #39
0
        private void ShowFontDialog(TextBox textBox)
        {
            var fontChooser = new FontChooser
            {
                Owner = this,
                PreviewSampleText = textBox.SelectedText
            };

            fontChooser.SetPropertiesFromObject(textBox);

            var result = fontChooser.ShowDialog();

            if (result == null || !result.Value)
            {
                return;
            }

            var fontDefinition = new FontDefinition();

            fontChooser.ApplyPropertiesToObject(textBox);
            fontChooser.ApplyPropertiesToObject(fontDefinition);

            textBox.Text = fontDefinition.ToString();
        }
コード例 #40
0
        /// <summary>
        /// Starts debugger if not already started. Prints basic info if required.
        /// </summary>
        /// <param name="toolName">Name of tool where debugging is to be started from.</param>
        public static void StartDebugger(string toolName)
        {
            if (AllErrors == null)
                AllErrors = new MTObservableCollection<Error>();

            string appender = "";
            if (rtb == null)
            {
                UpdateTimer = new DispatcherTimer();

                if (debugFileWriter == null)
                {
                    // KFreon: Deal with file in use
                    for (int i = 0; i < 10; i++)
                    {
                        try
                        {
                            DebugFilePath = Path.Combine(MEDirectories.MEDirectories.StorageFolder, $"DebugOutput{appender}.txt");
                            debugFileWriter = new StreamWriter(DebugFilePath, true);
                            break;
                        }
                        catch
                        {
                            var t = i;
                            appender = $"_{t.ToString()}";
                        }
                    }
                }

                if (debugFileWriter == null)
                    PrintLn("Failed to open any debug output files. Disk cached debugging disabled for this session.");

                // TESTING
                DebugWindow debugger = new DebugWindow();
                debugger.WindowState = System.Windows.WindowState.Minimized;
                debugger.Closed += (sender, args) =>
                {
                    rtb = null;  // Nullify rtb to indicate window is closed.
                    debugger.Dispatcher.InvokeShutdown();
                };
                debugger.Show();

                Closer = new Action(() =>
                {
                    if (!debugger.Dispatcher.HasShutdownStarted)
                        try
                        {
                            debugger.Dispatcher.Invoke(() => debugger.Close());
                        }
                        catch { } // Fails when closing toolset when debugger has already been closed.
                });

                // KFreon: Thread debugger
                /*Thread thread = new Thread(() =>
                {
                    DebugWindow Debugger = new DebugWindow();
                    Debugger.WindowState = System.Windows.WindowState.Minimized;
                    Debugger.Show();
                    Debugger.Closed += (sender, args) =>
                    {
                        rtb = null;  // Nullify rtb to indicate window is closed.
                        Debugger.Dispatcher.InvokeShutdown();
                    };

                    Closer = new Action(() =>
                    {
                        if (!Debugger.Dispatcher.HasShutdownStarted)
                            try
                            {
                                Debugger.Dispatcher.Invoke(() => Debugger.Close());
                            }
                            catch { } // Fails when closing toolset when debugger has already been closed.
                    });

                    Dispatcher.Run();
                });
                thread.SetApartmentState(ApartmentState.STA);
                thread.Start();*/


                waiting = new StringBuilder();

                // KFreon: Print basic info
                System.Threading.Thread.Sleep(200);
                PrintLn($"-----New Execution of {toolName}-----");
                PrintLn(".........Environment Information.........");
                PrintLn($"Build Version: {ToolsetInfo.Version}");
                PrintLn($"OS Version: {Environment.OSVersion}");
                PrintLn($"Architecture: " + (Environment.Is64BitOperatingSystem ? "x64 (64 bit)" : "x86 (32 bit)"));
                PrintLn($"Using debug file: {DebugFilePath}");
                PrintLn(".........................................");
                PrintLn();
            }
            else
                PrintLn($"-----New Execution of {toolName}-----");
        }
コード例 #41
0
ファイル: Logger.cs プロジェクト: rundfunk47/italo
 /*private*/
 /*public string GetLogfilePath()
 {
     string path = System.Environment.GetEnvironmentVariable("TEMP");
     if (!path.EndsWith("\\")) path += "\\";
         return (path + _filename);
 }
 */
 public Logger(System.Windows.Controls.TextBox tl)
 {
     _textLog = tl;
 }
コード例 #42
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     txtFilter = new System.Windows.Controls.TextBox();
 }
コード例 #43
0
 public MainWindow()
 {
     InitializeComponent();
     tbResult = TextBoxRESULTINFO;
 }
コード例 #44
0
 private void OpenFileDialogAndBindToInput(TextBox textBox)
 {
     if (_fileDialogPicker.ShowDialog() == DialogResult.OK)
     {
         textBox.Text = _fileDialogPicker.Selection;
         _binder.ApplyChangesToModel();
     }
 }
コード例 #45
0
ファイル: Spinner.cs プロジェクト: fengyuqi/Fluent.Ribbon
        /// <summary>
        /// When overridden in a derived class, is invoked whenever application code or internal processes call <see cref="M:System.Windows.FrameworkElement.ApplyTemplate"/>.
        /// </summary>
        public override void OnApplyTemplate()
        {
            if (this.IsTemplateValid())
            {
                this.buttonUp.Click -= this.OnButtonUpClick;
                this.buttonDown.Click -= this.OnButtonDownClick;
                BindingOperations.ClearAllBindings(this.buttonDown);
                BindingOperations.ClearAllBindings(this.buttonUp);
            }

            // Get template childs
            this.textBox = this.GetTemplateChild("PART_TextBox") as System.Windows.Controls.TextBox;
            this.buttonUp = this.GetTemplateChild("PART_ButtonUp") as RepeatButton;
            this.buttonDown = this.GetTemplateChild("PART_ButtonDown") as RepeatButton;

            // Check template
            if (this.IsTemplateValid() == false)
            {
                Debug.WriteLine("Template for Spinner control is invalid");
                return;
            }

            // Bindings
            Bind(this, this.buttonUp, "Delay", RepeatButton.DelayProperty, BindingMode.OneWay);
            Bind(this, this.buttonDown, "Delay", RepeatButton.DelayProperty, BindingMode.OneWay);
            Bind(this, this.buttonUp, "Interval", RepeatButton.IntervalProperty, BindingMode.OneWay);
            Bind(this, this.buttonDown, "Interval", RepeatButton.IntervalProperty, BindingMode.OneWay);


            // Events subscribing
            this.buttonUp.Click += this.OnButtonUpClick;
            this.buttonDown.Click += this.OnButtonDownClick;
            this.textBox.LostKeyboardFocus += this.OnTextBoxLostKeyboardFocus;
            this.textBox.PreviewKeyDown += this.OnTextBoxPreviewKeyDown;

            this.ValueToTextBoxText();
        }
コード例 #46
0
            /**
             * Constructor
             */
            public EditBox()
            {
                mEditBox = new System.Windows.Controls.TextBox();
                mPasswordBox = new System.Windows.Controls.PasswordBox();
                // by default, the password box is not visible
                mPasswordBox.Visibility = Visibility.Collapsed;

                CreateTheEditBoxGrid();

                View = mEditBoxGrid;

                mIsPasswordMode = false;
                mIsWatermarkMode = false;
                mPlaceholderText = "";

                // by default, the placeholder font color is gray
                mWaterMarkBrush = new SolidColorBrush();
                mWaterMarkBrush.Color = Colors.Gray;

                mForegroundColor = mEditBox.Foreground;

                /**
                 * @brief Sent from the Edit box when it gains focus(the user selects the widget).
                 * The virtual keyboard is shown.
                 *        MAW_EVENT_EDIT_BOX_EDITING_DID_BEGIN
                 */
                mEditBox.GotFocus += new RoutedEventHandler(
                    delegate(object from, RoutedEventArgs args)
                    {
                        /**
                          * simulating the placeholder/watermark
                          */
                        // if watermark present and no user char has been entered
                        if (mIsWatermarkMode && mFirstChar)
                        {
                            // move the cursor to the first position
                            mEditBox.Select(0, 0);
                            SetWatermarkMode(false);
                        }

                        /**
                         * post the event to MoSync runtime
                         */
                        Memory eventData = new Memory(8);
                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_EDIT_BOX_EDITING_DID_BEGIN);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    }
                ); // end of mEditBox.GotFocus

                /**
                  * @brief Sent from the Edit box when it loses focus.
                  * The virtual keyboard is hidden.
                  *        MAW_EVENT_EDIT_BOX_EDITING_DID_END
                  */
                mEditBox.LostFocus += new RoutedEventHandler(
                    delegate(object from, RoutedEventArgs args)
                    {
                        /**
                         * simulating the placeholder/watermark
                         */
                        // if no text has been entered by the user than leave the watermark text
                        if (mEditBox.Text.Equals(""))
                        {
                            SetWatermarkMode(true);
                        }

                        /**
                         * post the event to MoSync runtime
                         */
                        Memory eventData = new Memory(8);
                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_EDIT_BOX_EDITING_DID_END);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    }
                ); // end of mEditBox.LostFocus

                /**
                  * @brief Sent from the Edit box when the text was changed.
                  *        MAW_EVENT_EDIT_BOX_TEXT_CHANGED
                  */
                mFirstChar = true;
                mEditBox.TextInputStart += new TextCompositionEventHandler(
                    delegate(object from, TextCompositionEventArgs args)
                    {
                        /**
                          * simulating the placeholder/watermark
                          */
                        if (mFirstChar)
                        {
                            SetWatermarkMode(false);
                        }

                        /**
                         * post the event to MoSync runtime
                         */
                        Memory eventData = new Memory(8);
                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_EDIT_BOX_TEXT_CHANGED);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    }
                ); // end of TextInputStart

                /**
                 * @brief Sent from the Password box when it gains focus(the user selects the widget).
                 * The virtual keyboard is shown.
                 *        MAW_EVENT_EDIT_BOX_EDITING_DID_BEGIN
                 */
                mPasswordBox.GotFocus += new RoutedEventHandler(
                    delegate(object from, RoutedEventArgs args)
                    {
                        /**
                         * post the event to MoSync runtime
                         */
                        Memory eventData = new Memory(8);
                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_EDIT_BOX_EDITING_DID_BEGIN);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    }
                ); // end of mPasswordBox.GotFocus

                /**
                  * @brief Sent from the Password box when it loses focus.
                  * The virtual keyboard is hidden.
                  *        MAW_EVENT_EDIT_BOX_EDITING_DID_END
                  */
                mPasswordBox.LostFocus += new RoutedEventHandler(
                    delegate(object from, RoutedEventArgs args)
                    {
                        /**
                         * post the event to MoSync runtime
                         */
                        Memory eventData = new Memory(8);
                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_EDIT_BOX_EDITING_DID_END);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    }
                ); // end of mPasswordBox.LostFocus

                /**
                  * @brief Sent from the Password box when the text was changed.
                  *        MAW_EVENT_EDIT_BOX_TEXT_CHANGED
                  */
                mPasswordBox.TextInputStart += new TextCompositionEventHandler(
                    delegate(object from, TextCompositionEventArgs args)
                    {
                        /**
                         * post the event to MoSync runtime
                         */
                        Memory eventData = new Memory(8);
                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_EDIT_BOX_TEXT_CHANGED);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    }
                ); // end of mPasswordBox.TextInputStart

                /**
                 * @brief Sent from the Edit box when the return button was pressed.
                 * On iphone platform the virtual keyboard is not closed after receiving this event.
                 * EDIT_BOX_RETURN
                 */
                // Not available on Windows Phone 7.1
            }
コード例 #47
0
 public TextBoxCommands(System.Windows.Controls.TextBox textBox)
 {
     _textBox = textBox;
 }
コード例 #48
0
 public static void SetLogBuffer(System.Windows.Controls.TextBox buffer)
 {
     _buffer = buffer;
 }
コード例 #49
0
ファイル: Builder.cs プロジェクト: jcoder58/WPFSharp
 public TextBox()
 {
     C = new System.Windows.Controls.TextBox();
 }
コード例 #50
0
ファイル: MoSyncSearchBar.cs プロジェクト: ronald132/MoSync
            /**
             * Constructor
             */
            public SearchBar()
            {
                mSearchBar = new System.Windows.Controls.TextBox();

                mView = mSearchBar;

                mIsWatermarkMode = false;
                mPlaceholderText = "";

                // by default, the placeholder font color is gray
                mWaterMarkBrush = new SolidColorBrush();
                mWaterMarkBrush.Color = Colors.Gray;

                mForegroundColor = mSearchBar.Foreground;

                /**
                 * @brief Sent from the Search bar when it gains focus(the user selects the widget).
                 * The virtual keyboard is shown.
                 */
                mSearchBar.GotFocus += new RoutedEventHandler(
                    delegate(object from, RoutedEventArgs args)
                    {
                        /**
                          * simulating the placeholder/watermark
                          */

                        // if watermark present and no user char has been entered
                        if (mIsWatermarkMode && mFirstChar)
                        {
                            // move the cursor to the first position
                            mSearchBar.Select(0, 0);
                        }
                    }
                ); // end of mEditBox.GotFocus

                /**
                 * @brief Sent from the Search bar when it loses focus.
                 * The virtual keyboard is hidden.
                 */
                mSearchBar.LostFocus += new RoutedEventHandler(
                    delegate(object from, RoutedEventArgs args)
                    {
                        /**
                         * simulating the placeholder/watermark
                         */

                        // if no text has been entered by the user than leave the watermark text
                        if (mSearchBar.Text.Equals(""))
                        {
                            setWatermarkMode(true);
                        }
                    }
                ); // end of mEditBox.LostFocus

                /**
                  * @brief Sent from the Search bar when the text was changed.
                  * As the search bar allows searching while the user types, this is
                  * the place where we send the search event (the MAW_EVENT_CLICKED with
                  * the search button click 0 (0 = OK, 1 = CANCEL).
                  * The cancel search is not handled on the windows phone platform.
                  */
                mFirstChar = true;
                mSearchBar.TextInputStart += new TextCompositionEventHandler(
                    delegate(object from, TextCompositionEventArgs args)
                    {
                        /**
                          * simulating the placeholder/watermark
                          */
                        if (mFirstChar)
                        {
                            setWatermarkMode(false);
                        }

                        /**
                         * post the event to MoSync runtime
                         * MAW_EVENT_CLICKED + search button clicked = 0 (0 = OK, 1 = CANCEL)
                         */
                        Memory eventData = new Memory(12);
                        const int MAWidgetEventData_eventType = 0;
                        const int MAWidgetEventData_widgetHandle = 4;
                        const int MAWidgetEventData_searchButtonClicked = 8;
                        eventData.WriteInt32(MAWidgetEventData_eventType, MoSync.Constants.MAW_EVENT_CLICKED);
                        eventData.WriteInt32(MAWidgetEventData_widgetHandle, mHandle);
                        eventData.WriteInt32(MAWidgetEventData_searchButtonClicked, 0);
                        mRuntime.PostCustomEvent(MoSync.Constants.EVENT_TYPE_WIDGET, eventData);
                    }
                ); // end of TextInputStart
            }
コード例 #51
0
 private void UpdateShallow()
 {
     Children.Clear();
     if (Searchable)
     {
         searchTextBox = new System.Windows.Controls.TextBox
         {
             Text = ValuePattern
         };
         searchTextBox.TextChanged += SearchTextBox_TextChanged;
         Children.Add(searchTextBox);
     }
     var dictionary = KeyValuePair.GetValue(DataContext) as IDictionary;
     if (dictionary != null)
     {
         var unique_types = new List<string>();
         foreach(var k in dictionary.Keys)
         {
             var d = dictionary[k] as IDictionary;
             if(d != null)
             {
                 if(d.Contains(Key))
                 {
                     var value = d[Key].ToString();
                     if(!unique_types.Contains(value))
                     {
                         unique_types.Add(value);
                     }
                 }
             }
         }
         foreach (var type in unique_types)
         {
             if (type.Contains(ValuePattern))
             {
                 var instances = IDictionaryExtension.Collect<IDictionary>(dictionary,
                         new KeyValueFilter { Key = Key, Values = { type } }.Include);
                 
                 if (instances.Count > 0)
                 {
                     var expander = new InstanceExpander
                     {
                         Key = Key,
                         ValuePattern = type,
                         DataContext = instances
                     };
                     expander.ListBox.SelectionChanged += ListBox_SelectionChanged;
                     Children.Add(expander);
                 }
             }
         }
     }
 }
コード例 #52
0
        private void OpenFileDialog(TextBox tb)
        {
            OpenFileDialog newDialog = new OpenFileDialog();

            if (newDialog.ShowDialog() == DialogResult.OK)
            {
                tb.Text = newDialog.FileName;
            }
        }