コード例 #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
 public DownLoadInfo(Thread thr, string p, System.Windows.Controls.ProgressBar prBar,System.IO.Stream strm,  System.Windows.Controls.Label lb)
 {
     complete = false;
     thread = thr;
     path = p;
     progressBar = prBar;
     stream = strm;
     label = lb;
 }
コード例 #3
0
        public IntegrationBaseNode(Core.VplControl hostCanvas)
            : base(hostCanvas)
        {
            AddOutputPortToNode("IntegrationBase", typeof (object));
            DataContext = this;

            var lbl = new System.Windows.Controls.Label {Content = "IntegrationBase"};
            AddControlToNode(lbl);

            Calculate();
        }
コード例 #4
0
 private void HighlightLabel(Label label)
 {
     label.Background = Brushes.Coral;
 }
コード例 #5
0
 private void ClearLabel(Label label)
 {
     label.Background = Brushes.LightGray;
 }
コード例 #6
0
        public static void Run(string imgFormat, string _path, System.Windows.Controls.ProgressBar bar, System.Windows.Controls.Label lblTotalFiles)
        {
            var dirs      = Directory.GetFiles(_path, imgFormat);
            var filesDone = 0;

            lblTotalFiles.Content = "0";
            for (var i = 0; i < dirs.Length - 1; i++)
            {
                var f1 = new FileInfo(dirs[i]);
                var f2 = new FileInfo(dirs[i + 1]);
                if (!FilesAreEqual(f1, f2))
                {
                    continue;
                }
                f1.Delete();
                Application.DoEvents();
                lblTotalFiles.Content = (++filesDone).ToString();
            }
        }
コード例 #7
0
        private void PerformPairWiseAnalysis()
        {
            if (folds.Count == 0)
            {
                MessageBox.Show("No proteins detected.  Make sure you use the TFold test on an experiment that has replicates and that at least one protein is detected in the number of replicates specified in the Min Replicates parameter.");
                return;
            }

            double overallFoldChange = folds.Average();


            //Now plot for BelaGraph
            //BelaGraph
            belaGraphControl1.ClearDataBuffer();
            belaGraphControl1.XLabel = "-Log2(p)";
            belaGraphControl1.YLabel = "Log2(Fold)";
            belaGraphControl1.XRound = 2;
            belaGraphControl1.YRound = 2;


            SolidColorBrush bluebrush   = System.Windows.Media.Brushes.Blue.Clone(); bluebrush.Opacity = 0.55;
            SolidColorBrush greenbrush  = System.Windows.Media.Brushes.Green.Clone(); greenbrush.Opacity = 0.55;
            SolidColorBrush orangebrush = System.Windows.Media.Brushes.Orange.Clone(); orangebrush.Opacity = 0.55;
            SolidColorBrush redbrush    = System.Windows.Media.Brushes.Red.Clone(); redbrush.Opacity = 0.55;


            BelaGraph.DataVector blueDV   = new BelaGraph.DataVector(BelaGraph.GraphStyle.Bubble, "Blue Dots", bluebrush);
            BelaGraph.DataVector orangeDV = new BelaGraph.DataVector(BelaGraph.GraphStyle.Bubble, "Orange Dots", orangebrush);
            BelaGraph.DataVector greenDV  = new BelaGraph.DataVector(BelaGraph.GraphStyle.Bubble, "Green Dots", greenbrush);
            BelaGraph.DataVector redDV    = new BelaGraph.DataVector(BelaGraph.GraphStyle.Bubble, "Red Dots", redbrush);

            int           noLabels       = plp.MySparseMatrix.ExtractLabels().Count;
            int           pointsExcluded = 0;
            List <double> allPValues     = theData.Select(a => a.pValue).OrderBy(a => a).ToList();

            double userQvalue          = (double)numericUpDownQValue.Value;
            double quantitationCuttoff = GetQuantitationCuttoff();

            theData.Sort((a, b) => a.pValue.CompareTo(b.pValue));
            double qValueFractionCounter = 0;

            List <XFoldStruct> greenOrBlue = theData.FindAll(a => GetPointColorVFold(a, allPValues[1], (double)numericUpDownA.Value, userQvalue, 1, quantitationCuttoff) <= 2).OrderBy(a => a.pValue).ThenBy(a => a.GPI).ToList();
            List <XFoldStruct> orange      = greenOrBlue.FindAll(a => a.QuantitationNegativeClass < quantitationCuttoff && a.QuantitationPositiveClass < quantitationCuttoff);

            greenOrBlue = greenOrBlue.Except(orange).ToList();

            theData.Sort((a, b) => a.pValue.CompareTo(b.pValue));

            foreach (XFoldStruct dataPoint in theData)
            {
                //We need to find the denominator; ie, all items that are green or blue
                if (!orange.Contains(dataPoint))
                {
                    qValueFractionCounter += 1 / (double)greenOrBlue.Count;
                }

                List <double> signalPos = plp.MySparseMatrix.ExtractDimValues(dataPoint.GPI, 1, false);
                List <double> signalNeg = plp.MySparseMatrix.ExtractDimValues(dataPoint.GPI, -1, false);

                dataPoint.QuantitationPositiveClass = pTools.Average(signalPos);
                dataPoint.QuantitationNegativeClass = pTools.Average(signalNeg);


                BelaGraph.PointCav pc = new BelaGraph.PointCav();
                pc.Y = Math.Log(dataPoint.FoldChange, 2);
                pc.X = Math.Log(dataPoint.pValue, 2) * (-1);
                pc.ExtraParamNumeric = dataPoint.pValue;


                double correctedFoldChange = dataPoint.CorrectedFold();

                double theAbsFold = Math.Abs(dataPoint.CorrectedFold());
                string tip        = "";
                if (plp.MySparseMatrix.ClassDescriptionDictionary.ContainsKey(1) && plp.MySparseMatrix.ClassDescriptionDictionary.ContainsKey(-1))
                {
                    tip += "PositiveClass: " + Regex.Replace(plp.MySparseMatrix.ClassDescriptionDictionary[1], "\n", "") + "\n";
                    tip += "NegativeClass: " + Regex.Replace(plp.MySparseMatrix.ClassDescriptionDictionary[-1], "\n", "") + "\n";
                }

                tip += "p-value = " + Math.Round(dataPoint.pValue, 5) + "\nFoldChange = " + correctedFoldChange + "\nIndex = " + dataPoint.GPI + "\nLocus = " + plp.MyIndex.GetName(dataPoint.GPI) + "\nMeanSignal(+) = " + Math.Round(dataPoint.QuantitationPositiveClass, 6) + "\nMeanSignal(-) = " + Math.Round(dataPoint.QuantitationNegativeClass, 5);


                tip += "\nSignalPos :";
                foreach (double s in signalPos)
                {
                    tip += " " + Math.Round(s, 6).ToString();
                }
                tip += "\n";
                tip += "SignalNeg :";
                foreach (double s in signalNeg)
                {
                    tip += " " + Math.Round(s, 6).ToString();
                }
                tip += "\nDescription = " + plp.MyIndex.GetDescription(dataPoint.GPI);

                pc.MouseOverTip = tip;


                //Perform the clipping
                if (dataPoint.pValue < (double)numericUpDownPValueLowerClip.Value)
                {
                    pc.X = Math.Log((double)numericUpDownPValueLowerClip.Value, 2) * (-1);
                }

                if (theAbsFold >= (double)numericUpDownUpperYScale.Value)
                {
                    if (dataPoint.CorrectedFold() < 0)
                    {
                        pc.Y = Math.Log((double)numericUpDownUpperYScale.Value, 2) * -1;
                    }
                    else
                    {
                        pc.Y = Math.Log((double)numericUpDownUpperYScale.Value, 2);
                    }
                }


                if (pc.X.Equals(double.NegativeInfinity))
                {
                    pointsExcluded++;
                    continue;
                }


                int theColor = GetPointColorVFold(dataPoint, allPValues[1], (double)numericUpDownA.Value, userQvalue, qValueFractionCounter, quantitationCuttoff);


                if (theColor == 0)
                {
                    blueDV.AddPoint(pc);
                }
                else if (theColor == 1)
                {
                    orangeDV.AddPoint(pc);
                }
                else if (theColor == 2)
                {
                    greenDV.AddPoint(pc);
                }
                else if (theColor == 3)
                {
                    redDV.AddPoint(pc);
                }

                dataPoint.Color = theColor;
            }

            belaGraphControl1.AddDataVector(blueDV);
            belaGraphControl1.AddDataVector(orangeDV);
            belaGraphControl1.AddDataVector(greenDV);
            belaGraphControl1.AddDataVector(redDV);



            belaGraphControl1.Plot(BelaGraph.BackgroundOption.YellowXGradient, true, true, new System.Drawing.Font("Courier New", 12));

            //Lets  add some labels

            if (plp.MySparseMatrix.ClassDescriptionDictionary.ContainsKey(1) && plp.MySparseMatrix.ClassDescriptionDictionary.ContainsKey(-1))
            {
                string descTop    = plp.MySparseMatrix.ClassDescriptionDictionary[-1];
                string descBottom = plp.MySparseMatrix.ClassDescriptionDictionary[1];


                System.Windows.Controls.Label TopLabel = new System.Windows.Controls.Label();
                TopLabel.Content = descTop;

                System.Windows.Controls.Label BottomLabel = new System.Windows.Controls.Label();
                BottomLabel.Content = descBottom;


                belaGraphControl1.MyCanvas.Children.Add(TopLabel);

                belaGraphControl1.MyCanvas.Children.Add(BottomLabel);
                belaGraphControl1.SetBottom(BottomLabel, 0);
            }
            //


            //Update the dot lables
            double totalDots = greenDV.ThePoints.Count + blueDV.ThePoints.Count + redDV.ThePoints.Count + orangeDV.ThePoints.Count;

            this.labelGreenDots.Text   = greenDV.ThePoints.Count + " (" + Math.Round(((double)greenDV.ThePoints.Count / (double)totalDots) * 100, 1) + "%)";
            this.labelBlueDots.Text    = blueDV.ThePoints.Count + " (" + Math.Round(((double)blueDV.ThePoints.Count / (double)totalDots) * 100, 1) + "%)";
            this.labelOrangeDots.Text  = orangeDV.ThePoints.Count + " (" + Math.Round(((double)orangeDV.ThePoints.Count / (double)totalDots) * 100, 1) + "%)";
            this.labelRedDots.Text     = redDV.ThePoints.Count + " (" + Math.Round(((double)redDV.ThePoints.Count / (double)totalDots) * 100, 1) + "%)";
            this.labelTotalNumber.Text = totalDots.ToString();
            this.labelLCuttoff.Text    = quantitationCuttoff.ToString();
            this.labelAvgFold.Text     = Math.Round(overallFoldChange, 2).ToString();
        }
コード例 #8
0
ファイル: Openmiracle.cs プロジェクト: hnjm/OneAccount
        /// <summary>
        /// Function to Add Product
        /// </summary>
        /// <param name="infoProduct"></param>
        /// <returns></returns>
        public void AddProduct(List <ProductInfofroOpenAccount> lstProduct, ref string Mess, System.Windows.Controls.Label Message)
        {
            int Skated = 0;

            try
            {
                foreach (ProductInfofroOpenAccount infoProduct in lstProduct)
                {
                    if (SavingValidation_Product(infoProduct))
                    {
                        functionConnectionState();
                        SqlCommand sqlcmd = new SqlCommand("productAdd", sqlcon);
                        sqlcmd.CommandType = CommandType.StoredProcedure;
                        sqlcmd.Parameters.Add("@productCode", SqlDbType.VarChar).Value     = (infoProduct.ProductCode == "Tally Demo Code") ? "MS00" + functionGenerateProductCode() : infoProduct.ProductCode;
                        sqlcmd.Parameters.Add("@productName", SqlDbType.VarChar).Value     = infoProduct.ProductName;
                        sqlcmd.Parameters.Add("@groupId", SqlDbType.Decimal).Value         = infoProduct.Group;
                        sqlcmd.Parameters.Add("@brandId", SqlDbType.Decimal).Value         = 1;
                        sqlcmd.Parameters.Add("@unitId", SqlDbType.Decimal).Value          = infoProduct.UnitId;
                        sqlcmd.Parameters.Add("@sizeId", SqlDbType.Decimal).Value          = 1;
                        sqlcmd.Parameters.Add("@modelNoId", SqlDbType.Decimal).Value       = 1;
                        sqlcmd.Parameters.Add("@taxId", SqlDbType.Decimal).Value           = infoProduct.TaxId;
                        sqlcmd.Parameters.Add("@taxapplicableOn", SqlDbType.VarChar).Value = "MRP";
                        sqlcmd.Parameters.Add("@purchaseRate", SqlDbType.Decimal).Value    = infoProduct.PurchaseRate;
                        sqlcmd.Parameters.Add("@salesRate", SqlDbType.Decimal).Value       = infoProduct.SalesRate;
                        sqlcmd.Parameters.Add("@mrp", SqlDbType.Decimal).Value             = infoProduct.MRP;
                        sqlcmd.Parameters.Add("@minimumStock", SqlDbType.Decimal).Value    = infoProduct.MinimumStock;
                        sqlcmd.Parameters.Add("@maximumStock", SqlDbType.Decimal).Value    = infoProduct.MaximumStock;
                        sqlcmd.Parameters.Add("@reorderLevel", SqlDbType.Decimal).Value    = infoProduct.ReorderLevel;
                        sqlcmd.Parameters.Add("@godownId", SqlDbType.Decimal).Value        = infoProduct.GodownId;
                        sqlcmd.Parameters.Add("@rackId", SqlDbType.Decimal).Value          = infoProduct.RackId;
                        sqlcmd.Parameters.Add("@isallowBatch", SqlDbType.Bit).Value        = infoProduct.AllowBatch;
                        sqlcmd.Parameters.Add("@ismultipleunit", SqlDbType.Bit).Value      = infoProduct.MultipleUnit;
                        sqlcmd.Parameters.Add("@isBom", SqlDbType.Bit).Value          = false;
                        sqlcmd.Parameters.Add("@isopeningstock", SqlDbType.Bit).Value = infoProduct.OpeningStock;
                        sqlcmd.Parameters.Add("@narration", SqlDbType.VarChar).Value  = infoProduct.Narration;
                        sqlcmd.Parameters.Add("@isActive", SqlDbType.Bit).Value       = true;
                        sqlcmd.Parameters.Add("@isshowRemember", SqlDbType.Bit).Value = false;
                        sqlcmd.Parameters.Add("@extra1", SqlDbType.VarChar).Value     = string.Empty;
                        sqlcmd.Parameters.Add("@extra2", SqlDbType.VarChar).Value     = string.Empty;
                        sqlcmd.Parameters.Add("@extraDate", SqlDbType.DateTime).Value = DateTime.Today;
                        object  obj          = sqlcmd.ExecuteScalar();
                        decimal decProductId = Convert.ToDecimal(obj);
                        decimal decBatchId   = 1;
                        int     inBarcode    = 1;
                        if (obj != null && int.Parse(obj.ToString()) != 0)
                        {
                            SqlCommand SqlCmd = new SqlCommand("AutomaticBarcodeGeneration", sqlcon);
                            SqlCmd.CommandType = CommandType.StoredProcedure;
                            inBarcode          = Convert.ToInt32(SqlCmd.ExecuteScalar());
                            SqlCommand sqlCmdd = new SqlCommand("BatchAddWithBarCode", sqlcon);
                            sqlCmdd.CommandType = CommandType.StoredProcedure;
                            sqlCmdd.Parameters.Add("@batchNo", SqlDbType.VarChar).Value            = "NA";
                            sqlCmdd.Parameters.Add("@productId", SqlDbType.Decimal).Value          = decProductId;
                            sqlCmdd.Parameters.Add("@manufacturingDate", SqlDbType.DateTime).Value = DateTime.Now;
                            sqlCmdd.Parameters.Add("@expiryDate", SqlDbType.DateTime).Value        = DateTime.Now;
                            sqlCmdd.Parameters.Add("@extra1", SqlDbType.VarChar).Value             = string.Empty;
                            sqlCmdd.Parameters.Add("@extra2", SqlDbType.VarChar).Value             = string.Empty;
                            sqlCmdd.Parameters.Add("@extraDate", SqlDbType.DateTime).Value         = DateTime.Now;
                            sqlCmdd.Parameters.Add("@narration", SqlDbType.VarChar).Value          = string.Empty;
                            sqlCmdd.Parameters.Add("@barcode", SqlDbType.VarChar).Value            = inBarcode;
                            sqlCmdd.Parameters.Add("@partNo", SqlDbType.VarChar).Value             = string.Empty;
                            object obj1 = sqlCmdd.ExecuteScalar();
                            decBatchId = Convert.ToDecimal(obj1);
                        }

                        if (infoProduct.MultipleUnit)
                        {
                            SqlCommand sqlCmdd = new SqlCommand("UnitConvertionAdd", sqlcon);
                            sqlCmdd.CommandType = CommandType.StoredProcedure;
                            sqlCmdd.Parameters.Add("@productId", SqlDbType.Decimal).Value      = decProductId;
                            sqlCmdd.Parameters.Add("@unitId", SqlDbType.Decimal).Value         = infoProduct.UnitId;
                            sqlCmdd.Parameters.Add("@conversionRate", SqlDbType.Decimal).Value = infoProduct.ConversionRate;
                            sqlCmdd.Parameters.Add("@quantities", SqlDbType.VarChar).Value     = 0;
                            sqlCmdd.Parameters.Add("@extra1", SqlDbType.VarChar).Value         = string.Empty;
                            sqlCmdd.Parameters.Add("@extra2", SqlDbType.VarChar).Value         = string.Empty;
                            sqlCmdd.Parameters.Add("@extraDate", SqlDbType.DateTime).Value     = DateTime.Now;
                            sqlCmdd.ExecuteScalar();
                        }
                        SqlCommand sqlCmd = new SqlCommand("UnitConvertionAdd", sqlcon);
                        sqlCmd.CommandType = CommandType.StoredProcedure;
                        sqlCmd.Parameters.Add("@conversionRate", SqlDbType.Decimal).Value = 1;
                        sqlCmd.Parameters.Add("@quantities", SqlDbType.Decimal).Value     = DBNull.Value;
                        sqlCmd.Parameters.Add("@unitId", SqlDbType.Decimal).Value         = infoProduct.UnitId;
                        sqlCmd.Parameters.Add("@productId", SqlDbType.Decimal).Value      = decProductId;
                        sqlCmd.Parameters.Add("@extra1", SqlDbType.VarChar).Value         = string.Empty;
                        sqlCmd.Parameters.Add("@extra2", SqlDbType.VarChar).Value         = string.Empty;
                        sqlCmd.Parameters.Add("@extraDate", SqlDbType.DateTime).Value     = DateTime.Now;
                        sqlCmd.ExecuteScalar();
                        sqlcon.Close();
                        Message.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                                                  new Action(
                                                      delegate()
                        {
                            Message.Content = (Skated++).ToString() + " Datas succesfully skated.";
                        }));
                    }
                }
            }
            catch (Exception ex)
            {
                System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => new wdoMessageBox(ex.Message).ShowDialog()));
            }
            Mess = Skated + " Datas succesfully skated.";
        }
コード例 #9
0
ファイル: NodeXLControl.cs プロジェクト: haisreekanth/NetMap
        //*************************************************************************
        //  Method: CreateDefaultVertexToolTip()
        //
        /// <summary>
        /// Creates a UIElement to use as a default vertex tooltip.
        /// </summary>
        ///
        /// <param name="sToolTip">
        /// The tooltip string to use.  Can be empty but not null.
        /// </param>
        ///
        /// <returns>
        /// A UIElement.
        /// </returns>
        //*************************************************************************
        protected UIElement CreateDefaultVertexToolTip(
            String sToolTip
            )
        {
            Debug.Assert(sToolTip != null);
            AssertValid();

            // Use a Label as a default tooltip.

            System.Windows.Controls.Label oLabel =
            new System.Windows.Controls.Label();

            oLabel.Background = SystemColors.InfoBrush;
            oLabel.BorderBrush = SystemColors.WindowFrameBrush;
            oLabel.BorderThickness = new Thickness(1);
            oLabel.Padding = new Thickness(3, 2, 3, 1);
            oLabel.Content = sToolTip;

            return (oLabel);
        }
コード例 #10
0
 private void setNextBonus(Label label, IResearchType researchType, int level)
 {
     if (level >= 0 && level < researchType.GetMaxLevel())
     {
         label.Content = researchType.GetResearchBonus(level + 1).GetFirstBonus() + " %";
     }
     else
     {
         label.Content = "No research bonus next";
     }
 }
コード例 #11
0
ファイル: Builder.cs プロジェクト: jcoder58/WPFSharp
 public Label()
 {
     C = new System.Windows.Controls.Label();
 }
コード例 #12
0
        private void worker_OnProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            if (e.ProgressPercentage != -1)
            {
                if (e.ProgressPercentage == 0)
                {
                    List <Tuple <int, double, BitmapImage> > data = (List <Tuple <int, double, BitmapImage> >)e.UserState;

                    for (int i = 0; i < data.Count; i++)
                    {
                        System.Windows.Controls.StackPanel wrapper = new System.Windows.Controls.StackPanel();
                        string className = "";

                        if (window.idToClassName.ContainsKey(data[i].Item1))
                        {
                            className = window.idToClassName[data[i].Item1];
                        }
                        else
                        {
                            className = data[i].Item1 + "";
                        }

                        System.Windows.Controls.Label info = new System.Windows.Controls.Label
                        {
                            Content = "Class: " + className + " Score: " + data[i].Item2.ToString("0.###")
                        };

                        System.Windows.Controls.Image img = new System.Windows.Controls.Image
                        {
                            Source = data[i].Item3,
                        };

                        int ratio = getRatio(data.Count);

                        img.Height = (window.containerExplainedImages.ActualHeight - data.Count * 2 * 5) / ratio;
                        img.Width  = (window.containerExplainedImages.ActualWidth - data.Count * 2 * 5) / ratio;


                        wrapper.Margin = new Thickness(5);
                        wrapper.Children.Add(info);
                        wrapper.Children.Add(img);

                        window.containerExplainedImages.Children.Add(wrapper);
                    }

                    window.containerImageToBeExplained.Visibility = Visibility.Hidden;
                    //window.explanationImage.Source = data[0].Item3;
                    window.explainingLabel.Visibility = Visibility.Hidden;
                    BlurEffect blur = new BlurEffect();
                    blur.Radius = 0;
                    window.containerImageToBeExplained.Effect = blur;
                    window.explanationButton.IsEnabled        = true;
                    window.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
                }
                else if (e.ProgressPercentage == 1)
                {
                    Tuple <int, double, BitmapImage> data = (Tuple <int, double, BitmapImage>)e.UserState;

                    //windowInnvestigate.explanationImage.Source = data.Item3;

                    System.Windows.Controls.StackPanel wrapper = new System.Windows.Controls.StackPanel();
                    string className = "";

                    if (windowInnvestigate.idToClassName.ContainsKey(data.Item1))
                    {
                        className = windowInnvestigate.idToClassName[data.Item1];
                    }
                    else
                    {
                        className = data.Item1 + "";
                    }

                    System.Windows.Controls.Label info = new System.Windows.Controls.Label
                    {
                        Content = "Class: " + className + " Score: " + data.Item2.ToString("0.###")
                    };

                    System.Windows.Controls.Image img = new System.Windows.Controls.Image
                    {
                        Source = data.Item3,
                    };

                    wrapper.Margin = new Thickness(5);
                    wrapper.Children.Add(info);
                    wrapper.Children.Add(img);

                    windowInnvestigate.containerExplainedImages.Children.Add(wrapper);

                    windowInnvestigate.containerImageToBeExplained.Visibility = Visibility.Hidden;
                    windowInnvestigate.explainingLabel.Visibility             = Visibility.Hidden;
                    BlurEffect blur = new BlurEffect();
                    blur.Radius = 0;
                    windowInnvestigate.explanationImage.Effect     = blur;
                    windowInnvestigate.explanationButton.IsEnabled = true;
                    windowInnvestigate.Dispatcher.Invoke(DispatcherPriority.Render, EmptyDelegate);
                }
            }
        }
コード例 #13
0
ファイル: Common.cs プロジェクト: mukeshdepani/ParaRD
        public static void CreateCrossTabulation(string filePath, DataTable dt, List <SQLBuilder.Clauses.Column> SelectedColumns, ResultViewModel rvm)
        {
            FileInfo f = new FileInfo(filePath);

            if (f.Exists)
            {
                f.Delete();
            }

            SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create(filePath, SpreadsheetDocumentType.Workbook);
            WorkbookPart        workbookpart        = spreadsheetDocument.AddWorkbookPart();
            var        stylesPart = spreadsheetDocument.WorkbookPart.AddNewPart <WorkbookStylesPart>();
            Stylesheet styles     = new CustomStylesheet();

            styles.Save(stylesPart);
            workbookpart.Workbook = new DocumentFormat.OpenXml.Spreadsheet.Workbook();

            WorksheetPart worksheetPart = workbookpart.AddNewPart <WorksheetPart>();

            worksheetPart.Worksheet = new DocumentFormat.OpenXml.Spreadsheet.Worksheet(new DocumentFormat.OpenXml.Spreadsheet.SheetData());

            DocumentFormat.OpenXml.Spreadsheet.Sheets sheets = (spreadsheetDocument.WorkbookPart.Workbook.AppendChild <Sheets>(new Sheets()));

            Sheet sheet = new Sheet()
            {
                Id = spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "mySheet"
            };

            sheets.Append(sheet);
            string cl  = "A";
            uint   row = 1;

            int  index;
            Cell cell = new Cell();

            System.Windows.Controls.Label colRow = new System.Windows.Controls.Label();
            int lineNumber = 0;

            colRow.Content  = "Cross Tabulation by " + rvm.QueryBulder.CrossTabulationResults.CrossTabColumn.AliasName;
            cell            = InsertCellInWorksheet(cl, row, worksheetPart);
            cell.CellValue  = new CellValue(Convert.ToString(colRow.Content));
            cell.DataType   = new EnumValue <CellValues>(CellValues.SharedString);
            cell.StyleIndex = 7;

            row++;

            List <List <string> > groupByColumnValues = rvm.QueryBulder.CrossTabulationResults.GroupByColumnValueList;

            for (int groupByColIndex = 0; groupByColIndex < rvm.QueryBulder.CrossTabulationResults.GroupByColumns.Count; groupByColIndex++)
            {
                SQLBuilder.Clauses.Column groupByCol = rvm.QueryBulder.CrossTabulationResults.GroupByColumns.ElementAt <SQLBuilder.Clauses.Column>(groupByColIndex);

                string colFormat = SQLBuilder.Common.ColumnFormat.Instance.getColumnFormat(groupByCol.Format);
                CrossTabulationViewGroupByControl ctvgCntrl = new CrossTabulationViewGroupByControl();
                colRow.Content = Common.getColumnNameOrAlias(groupByCol);

                for (int i = 0; i <= groupByColumnValues.Count + 1; i++)
                {
                    if (groupByColIndex >= 26)
                    {
                        cl = Convert.ToString(Convert.ToChar(65 + ((groupByColIndex / 26) - 1))) + Convert.ToString(Convert.ToChar(65 + groupByColIndex % 26));
                    }
                    else
                    {
                        cl = Convert.ToString(Convert.ToChar(65 + groupByColIndex));
                    }
                    SharedStringTablePart shareStringPart;
                    if (spreadsheetDocument.WorkbookPart.GetPartsOfType <SharedStringTablePart>().Count() > 0)
                    {
                        shareStringPart = spreadsheetDocument.WorkbookPart.GetPartsOfType <SharedStringTablePart>().First();
                    }
                    else
                    {
                        shareStringPart = spreadsheetDocument.WorkbookPart.AddNewPart <SharedStringTablePart>();
                    }
                    if (row == 2)
                    {
                        index           = InsertSharedStringItem(dt.Columns[groupByColIndex].ColumnName, shareStringPart);
                        cell            = InsertCellInWorksheet(cl, row, worksheetPart);
                        cell.CellValue  = new CellValue(Convert.ToString(dt.Columns[groupByColIndex]));
                        cell.DataType   = new EnumValue <CellValues>(CellValues.SharedString);
                        cell.StyleIndex = 7;
                    }
                    else if (row > 3)
                    {
                        cell           = InsertCellInWorksheet(cl, row, worksheetPart);
                        cell.CellValue = new CellValue(Convert.ToString(groupByColumnValues.ElementAt <List <string> >(i - 2).ElementAt <string>(groupByColIndex)));
                    }
                    lineNumber = lineNumber + 1;
                    row++;
                }
                row = 2;
            }

            int groupByColCount                 = rvm.QueryBulder.CrossTabulationResults.GroupByColumns.Count;
            int summarrizeValueIndex            = groupByColCount + 1;
            Dictionary <string, Object> dataMap = rvm.QueryBulder.CrossTabulationResults.DataMap;

            row = 1;
            foreach (string summaryMainValue in rvm.QueryBulder.CrossTabulationResults.CrossTabColumnVaues)
            {
                CrossTabulationViewSummaryMainControl summaryMain = new CrossTabulationViewSummaryMainControl();
                summaryMain.lblSummaryHeader.Content = summaryMainValue;
                int totalcolumn = rvm.QueryBulder.CrossTabulationResults.SummarizeColumns.Count + groupByColCount;
                for (int summaryColIndex = 0; summaryColIndex < rvm.QueryBulder.CrossTabulationResults.SummarizeColumns.Count; summaryColIndex++)
                {
                    SQLBuilder.Clauses.Column summaryCol = rvm.QueryBulder.CrossTabulationResults.SummarizeColumns.ElementAt <SQLBuilder.Clauses.Column>(summaryColIndex);
                    string summaryColName   = summaryCol.AliasName;
                    string summarycolFormat = SQLBuilder.Common.ColumnFormat.Instance.getColumnFormat(summaryCol.Format);
                    CrossTabulationViewSummaryControl ctvsCtrl = new CrossTabulationViewSummaryControl();

                    for (int keyIndex = 0; keyIndex <= rvm.QueryBulder.CrossTabulationResults.KeyPrefixes.Count + 2; keyIndex++)
                    {
                        if (summaryColIndex >= 26)
                        {
                            cl = Convert.ToString(Convert.ToChar(65 + ((summarrizeValueIndex / 26) - 1))) + Convert.ToString(Convert.ToChar(65 + summarrizeValueIndex % 26));
                        }
                        else
                        {
                            cl = Convert.ToString(Convert.ToChar(65 + summarrizeValueIndex));
                        }
                        SharedStringTablePart shareStringPart;
                        if (spreadsheetDocument.WorkbookPart.GetPartsOfType <SharedStringTablePart>().Count() > 0)
                        {
                            shareStringPart = spreadsheetDocument.WorkbookPart.GetPartsOfType <SharedStringTablePart>().First();
                        }
                        else
                        {
                            shareStringPart = spreadsheetDocument.WorkbookPart.AddNewPart <SharedStringTablePart>();
                        }
                        if (row == 1)
                        {
                            index           = InsertSharedStringItem(summaryMainValue, shareStringPart);
                            cell            = InsertCellInWorksheet(cl, row, worksheetPart);
                            cell.CellValue  = new CellValue(Convert.ToString(summaryMainValue));
                            cell.DataType   = new EnumValue <CellValues>(CellValues.SharedString);
                            cell.StyleIndex = 7;
                        }
                        else if (row == 2)
                        {
                            index           = InsertSharedStringItem(summaryColName, shareStringPart);
                            cell            = InsertCellInWorksheet(cl, row, worksheetPart);
                            cell.CellValue  = new CellValue(Convert.ToString(summaryColName));
                            cell.DataType   = new EnumValue <CellValues>(CellValues.SharedString);
                            cell.StyleIndex = 7;
                        }
                        else if (row > 3)
                        {
                            string key = rvm.QueryBulder.CrossTabulationResults.KeyPrefixes.ElementAt <string>(keyIndex - 3);

                            string keyValue = key + summaryMainValue + summaryColIndex;

                            cell = InsertCellInWorksheet(cl, row, worksheetPart);
                            if (dataMap.ContainsKey(keyValue))
                            {
                                if (summarycolFormat != null)
                                {
                                    cell.CellValue = new CellValue(String.Format(summarycolFormat, dataMap[keyValue]));
                                }
                                else
                                {
                                    cell.CellValue = new CellValue(Convert.ToString(dataMap[keyValue]));
                                }
                            }
                            else
                            {
                                cell.CellValue = new CellValue(Convert.ToString("00"));
                            }
                        }
                        lineNumber = lineNumber + 1;

                        if (row > rvm.QueryBulder.CrossTabulationResults.KeyPrefixes.Count + 2)
                        {
                            row = 1;
                            summarrizeValueIndex = summarrizeValueIndex + 1;
                        }
                        else
                        {
                            row++;
                        }
                    }
                    lineNumber = 0;
                }
                row             = 1;
                groupByColCount = groupByColCount + 1;
            }
            worksheetPart.Worksheet.Save();
            workbookpart.Workbook.Save();
            spreadsheetDocument.Close();
        }
コード例 #14
0
ファイル: SandboxListener.cs プロジェクト: RossDay/Leap
 public SandboxListener(System.Windows.Controls.Label log)
 {
     Log = log;
     Log.Content += "Let's go!\n";
     grabAndScroll = new GrabAndScroll(SafeWriteLine);
 }
コード例 #15
0
        /*CarExpLabel, HouseExpLabel, sportExpLabel, EatExpLabel, RestaurantExpLabel, HobbiesExpLabel, BuyExpLabel, HealthExpLabel, allExpValue*/

        public void showIncOnMain(System.Windows.Controls.Label a, System.Windows.Controls.Label b,
                                  System.Windows.Controls.Label c, System.Windows.Controls.Label d, System.Windows.Controls.Label e, System.Windows.Controls.Label f)
        {
            a.Content = salary + " Br";
            b.Content = freelance + " Br";
            c.Content = sell + " Br";
            d.Content = rent + " Br";
            e.Content = sumAll();
            f.Content = sumAll();
        }
コード例 #16
0
        private int FlipAnswer(int ansIndex, ref System.Windows.Shapes.Rectangle blankBoardFlip, ref System.Windows.Controls.Label answerBox, ref System.Windows.Controls.Label blankBox, ref System.Windows.Controls.Label pointsBox)
        {
            string answerText = QuestionManager.questions[qList.SelectedIndex].a[ansIndex];

            blankBoardFlip.Fill = itemAnsBg;

            answerBox.Content    = answerText;
            answerBox.FontSize   = calcFontSize(answerText, (int)audience.audWnd.a_1.Width); //294
            answerBox.Visibility = Visibility.Visible;

            blankBox.Visibility = Visibility.Hidden;

            pointsBox.Content    = QuestionManager.questions[qList.SelectedIndex].p[ansIndex].ToString();
            pointsBox.Visibility = Visibility.Visible;

            return((int)QuestionManager.questions[qList.SelectedIndex].p[ansIndex]);
        }
コード例 #17
0
 public LabelAutomationPeer(System.Windows.Controls.Label owner) : base(default(System.Windows.FrameworkElement))
 {
 }
コード例 #18
0
 private void setBonus(Label label, IResearchType researchType, int level)
 {
     if (level > 0 && level <= researchType.GetMaxLevel())
     {
         label.Content = researchType.GetResearchBonus(level).GetFirstBonus() + " %";
     }
 }
コード例 #19
0
ファイル: Folder.cs プロジェクト: evgenfesuk/fileRenamer
        public static void Create(string imgFormat, string _path, System.Windows.Controls.ProgressBar bar, System.Windows.Controls.Label lbl_totalFiles)
        {
            string[] dirs = Directory.GetFiles(_path, imgFormat);
            string   dn;

            int filesCount = 0, filesDone = 0;

            foreach (string path in dirs)
            {
                filesCount++;
            }

            p_bar.Init(bar, filesCount);

            foreach (string path in dirs)
            {
                if (char.IsDigit(Path.GetFileNameWithoutExtension(path).Substring(0, 1), 0))
                {
                    dn = Path.Combine(Path.GetDirectoryName(path) + "\\" + Path.GetFileNameWithoutExtension(path).Substring(0, 4) + "\\");
                    if (!Directory.Exists(dn))
                    {
                        Directory.CreateDirectory(dn);
                    }
                    FileInfo f = new FileInfo(path);
                    f.MoveTo(dn + Path.GetFileName(path));
                    filesDone++;
                    p_bar.Run(bar, filesCount, lbl_totalFiles, filesDone);
                }
            }
        }
コード例 #20
0
 //public string
 public void SetMyLabel(System.Windows.Controls.Label label)
 {
     myLabel = label;
 }
コード例 #21
0
        public static async Task SetBarStaticGeneric(List <Rectangle> bars, Func <int> function, System.Windows.Controls.Label info, Func <bool> growing)
        {
            while (true)
            {
                int perc = function();
                int amount;
                if (perc != 0)
                {
                    amount = perc * bars.Count / 100;
                }
                else
                {
                    amount = 1;
                    perc   = 1;
                }
                if (info != null)
                {
                    info.Content = perc + "%";
                }
                for (int i = 0; i < bars.Count; i++)
                {
                    if (i > amount)
                    {
                        bars[i].Visibility = Visibility.Hidden;
                    }
                    else
                    {
                        bars[i].Visibility = Visibility.Visible;
                    }
                }
                if (growing())
                {
                    for (int i = amount + 1; i < bars.Count; i++)
                    {
                        if (!growing())
                        {
                            break;
                        }
                        bars[i].Visibility = Visibility.Visible;
                        await Task.Delay(300);
                    }
                    for (int i = amount + 1; i < bars.Count; i++)
                    {
                        bars[i].Visibility = Visibility.Hidden;
                    }
                }

                await Task.Delay(700);
            }
        }
コード例 #22
0
        private void Exec(int whoareu, Label label)
        {
            if (!Setting.Sharing)
            {
                MessageBox.Show(rm.GetString("sharingAlert"), "Pass", MessageBoxButtons.OK);
                return;
            }
            if (fileOpened == null || fileOpened.Equals("null"))
            {
                MessageBox.Show(rm.GetString("nosel"), "Pass");
                return;
            }
            if (Setting.AskBeforeShare)
            {
                DialogResult opti = MessageBox.Show(rm.GetString("askBeforeShare1") + fileOpened + rm.GetString("askBeforeShare2"), "Pass", MessageBoxButtons.YesNo);
                if (opti == System.Windows.Forms.DialogResult.No)
                {
                    return;
                }
            }
            string ip     = IP[whoareu];
            string origin = label.Content.ToString();

            label.FontWeight = FontWeights.Bold;
            label.Content    = rm.GetString("sending");
            label.Foreground = Brushes.LawnGreen;
            Task.Run(() => {
                int result = internet.WannaSendTo(ip, fileOpened);
                Log.clientLog("Result: " + Internet.reason);
                if (result == Internet.DENIED)
                {
                    label.Dispatcher.Invoke(() =>
                    {
                        label.Content    = rm.GetString("denied");
                        label.Foreground = Brushes.Red;
                    });
                }
                else if (result == Internet.ERROR)
                {
                    label.Dispatcher.Invoke(() =>
                    {
                        label.Content    = rm.GetString("error");
                        label.Foreground = Brushes.Red;
                    });
                }
                else if (result == Internet.SUCESS)
                {
                    label.Dispatcher.Invoke(() =>
                    {
                        label.Content = rm.GetString("sent");
                    });
                }
                Thread.Sleep(1000);
                label.Dispatcher.Invoke(() =>
                {
                    label.Content    = origin;
                    label.Foreground = Brushes.White;
                    label.FontWeight = FontWeights.Normal;
                });
                if (exitOnDone)
                {
                    Environment.Exit(0);
                }
            });
        }
コード例 #23
0
ファイル: Openmiracle.cs プロジェクト: hnjm/OneAccount
        public void AddAccountGroup(List <AccountGroupInfoforOpenAccount> lstinfoAccountGroup, ref string Mess, System.Windows.Controls.Label Message)
        {
            int Skated = 0;

            foreach (AccountGroupInfoforOpenAccount infoAccountGroup in lstinfoAccountGroup)
            {
                try
                {
                    if (SavingValidation_AccountingGroup(infoAccountGroup))
                    {
                        functionConnectionState();
                        SqlCommand sqlcmd = new SqlCommand("AccountGroupAddWithIdentity", sqlcon);
                        sqlcmd.CommandType = CommandType.StoredProcedure;
                        sqlcmd.Parameters.Add("@accountGroupName", SqlDbType.VarChar).Value  = infoAccountGroup.Name;
                        sqlcmd.Parameters.Add("@groupUnder", SqlDbType.Decimal).Value        = infoAccountGroup.Under;
                        sqlcmd.Parameters.Add("@nature", SqlDbType.VarChar).Value            = infoAccountGroup.Nature;
                        sqlcmd.Parameters.Add("@narration", SqlDbType.VarChar).Value         = infoAccountGroup.Narration;
                        sqlcmd.Parameters.Add("@affectGrossProfit", SqlDbType.VarChar).Value = infoAccountGroup.Affect_Gross_Profit;
                        sqlcmd.Parameters.Add("@isDefault", SqlDbType.Bit).Value             = false;
                        sqlcmd.Parameters.Add("@extra1", SqlDbType.VarChar).Value            = string.Empty;
                        sqlcmd.Parameters.Add("@extra2", SqlDbType.VarChar).Value            = string.Empty;
                        sqlcmd.ExecuteScalar();
                        sqlcon.Close();
                        Message.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                                                  new Action(
                                                      delegate()
                        {
                            Message.Content = (Skated++).ToString() + " Datas succesfully skated.";
                        }));
                    }
                }
                catch (Exception ex)
                {
                    System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => new wdoMessageBox(ex.Message).ShowDialog()));
                }
            }
            Mess = Skated + " Datas succesfully skated.";
        }
コード例 #24
0
        public int Init(string fileName, System.Windows.Controls.Image image, System.Windows.Controls.Image Dimage, System.Windows.Controls.Label startTime, System.Windows.Controls.Slider slider, System.Windows.Controls.Slider slider2)
        {
            ffmpeg.avcodec_register_all();

            AVFormatContext *pFormatCtx;

            pFormatCtx      = ffmpeg.avformat_alloc_context();
            this.pFormatCtx = pFormatCtx;

            ffmpeg.avformat_open_input(&pFormatCtx, fileName, null, null);
            ffmpeg.avformat_find_stream_info(pFormatCtx, null);

            for (int i = 0; i < pFormatCtx->nb_streams; i++)
            {
                if (pFormatCtx->streams[i]->codec->codec_type == AVMediaType.AVMEDIA_TYPE_VIDEO)
                {
                    videoIndex = i;
                    Console.WriteLine("video.............." + videoIndex);
                }
                if (pFormatCtx->streams[i]->codec->codec_type == AVMediaType.AVMEDIA_TYPE_AUDIO)
                {
                    audioIndex = i;
                    Console.WriteLine("audio.............." + audioIndex);
                }
            }

            if (videoIndex == -1)
            {
                Console.WriteLine("Couldn't find a video stream.");
                return(-1);
            }
            if (audioIndex == -1)
            {
                Console.WriteLine("Couldn't find a audio stream.");
                return(-1);
            }

            if (videoIndex > -1)
            {
                pCodecCtxVideo = pFormatCtx->streams[videoIndex]->codec;
                pCodecVideo    = ffmpeg.avcodec_find_decoder(pCodecCtxVideo->codec_id);

                if (pCodecVideo == null)
                {
                    return(-1);
                }

                pCodecCtxVideo->codec_id = pCodecVideo->id;
                pCodecCtxVideo->lowres   = 0;

                if (pCodecCtxVideo->lowres > pCodecVideo->max_lowres)
                {
                    pCodecCtxVideo->lowres = pCodecVideo->max_lowres;
                }

                pCodecCtxVideo->idct_algo         = ffmpeg.FF_IDCT_AUTO;
                pCodecCtxVideo->error_concealment = 3;

                if (ffmpeg.avcodec_open2(pCodecCtxVideo, pCodecVideo, null) < 0)
                {
                    return(-1);
                }
                Console.WriteLine("Find a video stream. channel = " + videoIndex);

                frameSize = new System.Windows.Size(pCodecCtxVideo->width, pCodecCtxVideo->height);
                double frameRate = ffmpeg.av_q2d(pFormatCtx->streams[videoIndex]->r_frame_rate);
                frameGap = (int)(1000 / frameRate);

                double frameWidth  = frameSize.Width;
                double frameHeight = frameSize.Height;

                fsrcnn = FSRCNN_construct();
                FSRCNN_init(fsrcnn, (int)frameHeight, (int)frameWidth);

                image.Dispatcher.BeginInvoke((Action)(() =>
                {
                    slider2.Visibility = System.Windows.Visibility.Visible;
                    if (frameWidth >= 1000)
                    {
                        ((MainWindow)System.Windows.Application.Current.MainWindow).WindowState = WindowState.Maximized;
                        double tempRate = ((MainWindow)System.Windows.Application.Current.MainWindow).Width / frameWidth;
                        frameWidth = ((MainWindow)System.Windows.Application.Current.MainWindow).Width;
                        frameHeight *= tempRate;
                    }
                    ((MainWindow)System.Windows.Application.Current.MainWindow).Width = frameWidth;
                    ((MainWindow)System.Windows.Application.Current.MainWindow).Height = frameHeight + 140;

                    image.Width = frameWidth;
                    image.Height = frameHeight;
                    Dimage.Width = frameWidth;
                    Dimage.Height = frameHeight;
                    grid3.Width = frameWidth;
                    grid.Width = frameWidth;
                    grid2.Width = frameWidth;
                    slider.Width = frameWidth - 140;
                    slider2.Width = frameWidth - 140;


                    if (initCheck == false)
                    {
                        originalHeight = ((MainWindow)System.Windows.Application.Current.MainWindow).Height;
                        originalWidth = ((MainWindow)System.Windows.Application.Current.MainWindow).Width;
                        ((MainWindow)System.Windows.Application.Current.MainWindow).Width = 800;
                        ((MainWindow)System.Windows.Application.Current.MainWindow).Height = 800 * (originalHeight / originalWidth);
                    }

                    ((MainWindow)System.Windows.Application.Current.MainWindow).SizeChanged += new SizeChangedEventHandler(Window_SizeChanged);
                    ((MainWindow)System.Windows.Application.Current.MainWindow).WindowState = WindowState.Maximized;
                }));

                pFrameVideo = ffmpeg.av_frame_alloc();
                swsCtxVideo = new SwsContext *[4];
                for (int i = 0; i < scalerNum; i++)
                {
                    swsCtxVideo[i] = ffmpeg.sws_getContext(
                        (int)frameSize.Width,
                        (int)frameSize.Height,
                        pCodecCtxVideo->pix_fmt,
                        (int)frameSize.Width,
                        (int)frameSize.Height,
                        AVPixelFormat.AV_PIX_FMT_BGR24,
                        ffmpeg.SWS_FAST_BILINEAR, null, null, null);
                }
            }
            if (audioIndex > -1)
            {
                pCodecAudio   = ffmpeg.avcodec_find_decoder(pFormatCtx->streams[audioIndex]->codecpar->codec_id);
                pCodeCtxAudio = ffmpeg.avcodec_alloc_context3(pCodecAudio);
                ffmpeg.avcodec_parameters_to_context(pCodeCtxAudio, pFormatCtx->streams[audioIndex]->codecpar);

                if (pCodecAudio == null)
                {
                    return(-1);
                }
                if (ffmpeg.avcodec_open2(pCodeCtxAudio, pCodecAudio, null) < 0)
                {
                    return(-1);
                }
                Console.WriteLine("Find a audio stream. channel = " + audioIndex);

                sdlAudio = new SDLAudio();
                sdlAudio.SDL_Init(pCodeCtxAudio);

                pFrameAudio = ffmpeg.av_frame_alloc();
                swrCtxAudio = ffmpeg.swr_alloc();

                ffmpeg.av_opt_set_channel_layout(swrCtxAudio, "in_channel_layout", (long)pCodeCtxAudio->channel_layout, 0);
                ffmpeg.av_opt_set_channel_layout(swrCtxAudio, "out_channel_layout", (long)pCodeCtxAudio->channel_layout, 0);
                ffmpeg.av_opt_set_int(swrCtxAudio, "in_sample_rate", pCodeCtxAudio->sample_rate, 0);
                ffmpeg.av_opt_set_int(swrCtxAudio, "out_sample_rate", pCodeCtxAudio->sample_rate, 0);
                ffmpeg.av_opt_set_sample_fmt(swrCtxAudio, "in_sample_fmt", pCodeCtxAudio->sample_fmt, 0);
                ffmpeg.av_opt_set_sample_fmt(swrCtxAudio, "out_sample_fmt", AVSampleFormat.AV_SAMPLE_FMT_FLT, 0);
                ffmpeg.swr_init(swrCtxAudio);
            }

            this.image     = image;
            this.Dimage    = Dimage;
            entirePlayTime = pFormatCtx->duration;
            this.startTime = startTime;
            this.slider    = slider;


            scalerId = 0;
            rasterId = 0;

            videoPool = new PacketPool();
            audioPool = new PacketPool();
            fPool     = new FrameBuffer(frameSize);

            isEOF = false;
            state = State.Init;

            decodeSeek = false;
            srSeek     = false;
            drawSeek   = false;
            scaleSeek  = new bool[scalerNum];
            for (int i = 0; i < scalerNum; i++)
            {
                scaleSeek[i] = false;
            }
            rasterSeek = new bool[rasterNum];
            for (int i = 0; i < rasterNum; i++)
            {
                rasterSeek[i] = false;
            }

            return(0);
        }
コード例 #25
0
ファイル: Openmiracle.cs プロジェクト: hnjm/OneAccount
        internal void AddPriceLevel(List <PriceLevelInfofroOpenAccount> lstObjPriceLevel, ref string Mess, System.Windows.Controls.Label Message)
        {
            int Skated = 0;

            foreach (PriceLevelInfofroOpenAccount infoPricingLevel in lstObjPriceLevel)
            {
                try
                {
                    if (SavingValidation_PricingLevel(infoPricingLevel))
                    {
                        functionConnectionState();
                        SqlCommand sqlcmd = new SqlCommand("PricingLevelAddWithoutSamePricingLevel", sqlcon);
                        sqlcmd.CommandType = CommandType.StoredProcedure;
                        sqlcmd.Parameters.Add("@pricinglevelName", SqlDbType.VarChar).Value = infoPricingLevel.PricingLevelName;
                        sqlcmd.Parameters.Add("@narration", SqlDbType.VarChar).Value        = infoPricingLevel.Narration;
                        sqlcmd.Parameters.Add("@extra1", SqlDbType.VarChar).Value           = string.Empty;
                        sqlcmd.Parameters.Add("@extra2", SqlDbType.VarChar).Value           = string.Empty;
                        sqlcmd.ExecuteScalar();
                        sqlcon.Close();
                        Message.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                                                  new Action(
                                                      delegate()
                        {
                            Message.Content = (Skated++).ToString() + " Datas succesfully skated.";
                        }));
                    }
                }
                catch (Exception ex)
                {
                    System.Windows.Application.Current.Dispatcher.Invoke((Action)(() => new wdoMessageBox(ex.Message).ShowDialog()));
                }
                Mess = Skated + " Datas succesfully skated.";
            }
        }
コード例 #26
0
 public DownLoadInfo(Thread thr, string p, System.Windows.Controls.ProgressBar prBar, System.IO.Stream strm, System.Windows.Controls.Label lb)
 {
     complete    = false;
     thread      = thr;
     path        = p;
     progressBar = prBar;
     stream      = strm;
     label       = lb;
 }
コード例 #27
0
ファイル: Common.cs プロジェクト: mukeshdepani/ParaRD
        public static void CreateCrossTabulation(string filePath, DataTable dt, List<SQLBuilder.Clauses.Column> SelectedColumns, ResultViewModel rvm)
        {
            FileInfo f = new FileInfo(filePath);
            if (f.Exists)
                f.Delete();

            SpreadsheetDocument spreadsheetDocument = SpreadsheetDocument.Create(filePath, SpreadsheetDocumentType.Workbook);
            WorkbookPart workbookpart = spreadsheetDocument.AddWorkbookPart();
            var stylesPart = spreadsheetDocument.WorkbookPart.AddNewPart<WorkbookStylesPart>();
            Stylesheet styles = new CustomStylesheet();
            styles.Save(stylesPart);
            workbookpart.Workbook = new DocumentFormat.OpenXml.Spreadsheet.Workbook();

            WorksheetPart worksheetPart = workbookpart.AddNewPart<WorksheetPart>();
            worksheetPart.Worksheet = new DocumentFormat.OpenXml.Spreadsheet.Worksheet(new DocumentFormat.OpenXml.Spreadsheet.SheetData());

            DocumentFormat.OpenXml.Spreadsheet.Sheets sheets = (spreadsheetDocument.WorkbookPart.Workbook.AppendChild<Sheets>(new Sheets()));

            Sheet sheet = new Sheet() { Id = spreadsheetDocument.WorkbookPart.GetIdOfPart(worksheetPart), SheetId = 1, Name = "mySheet" };
            sheets.Append(sheet);
            string cl = "A";
            uint row = 1;

            int index;
            Cell cell = new Cell();
            System.Windows.Controls.Label colRow = new System.Windows.Controls.Label();
            int lineNumber = 0;

            colRow.Content = "Cross Tabulation by " + rvm.QueryBulder.CrossTabulationResults.CrossTabColumn.AliasName;
            cell = InsertCellInWorksheet(cl, row, worksheetPart);
            cell.CellValue = new CellValue(Convert.ToString(colRow.Content));
            cell.DataType = new EnumValue<CellValues>(CellValues.SharedString);
            cell.StyleIndex = 7;

            row++;

            List<List<string>> groupByColumnValues = rvm.QueryBulder.CrossTabulationResults.GroupByColumnValueList;

            for (int groupByColIndex = 0; groupByColIndex < rvm.QueryBulder.CrossTabulationResults.GroupByColumns.Count; groupByColIndex++)
            {
                SQLBuilder.Clauses.Column groupByCol = rvm.QueryBulder.CrossTabulationResults.GroupByColumns.ElementAt<SQLBuilder.Clauses.Column>(groupByColIndex);

                string colFormat = SQLBuilder.Common.ColumnFormat.Instance.getColumnFormat(groupByCol.Format);
                CrossTabulationViewGroupByControl ctvgCntrl = new CrossTabulationViewGroupByControl();
                colRow.Content = Common.getColumnNameOrAlias(groupByCol);

                for (int i = 0; i <= groupByColumnValues.Count + 1; i++)
                {
                    if (groupByColIndex >= 26)
                    {
                        cl = Convert.ToString(Convert.ToChar(65 + ((groupByColIndex / 26) - 1))) + Convert.ToString(Convert.ToChar(65 + groupByColIndex % 26));
                    }
                    else
                    {
                        cl = Convert.ToString(Convert.ToChar(65 + groupByColIndex));
                    }
                    SharedStringTablePart shareStringPart;
                    if (spreadsheetDocument.WorkbookPart.GetPartsOfType<SharedStringTablePart>().Count() > 0)
                    {
                        shareStringPart = spreadsheetDocument.WorkbookPart.GetPartsOfType<SharedStringTablePart>().First();
                    }
                    else
                    {
                        shareStringPart = spreadsheetDocument.WorkbookPart.AddNewPart<SharedStringTablePart>();
                    }
                    if (row == 2)
                    {
                        index = InsertSharedStringItem(dt.Columns[groupByColIndex].ColumnName, shareStringPart);
                        cell = InsertCellInWorksheet(cl, row, worksheetPart);
                        cell.CellValue = new CellValue(Convert.ToString(dt.Columns[groupByColIndex]));
                        cell.DataType = new EnumValue<CellValues>(CellValues.SharedString);
                        cell.StyleIndex = 7;
                    }
                    else if (row > 3)
                    {
                        cell = InsertCellInWorksheet(cl, row, worksheetPart);
                        cell.CellValue = new CellValue(Convert.ToString(groupByColumnValues.ElementAt<List<string>>(i - 2).ElementAt<string>(groupByColIndex)));
                    }
                    lineNumber = lineNumber + 1;
                    row++;
                }
                row = 2;
            }

            int groupByColCount = rvm.QueryBulder.CrossTabulationResults.GroupByColumns.Count;
            int summarrizeValueIndex = groupByColCount + 1;
            Dictionary<string, Object> dataMap = rvm.QueryBulder.CrossTabulationResults.DataMap;
            row = 1;
            foreach (string summaryMainValue in rvm.QueryBulder.CrossTabulationResults.CrossTabColumnVaues)
            {

                CrossTabulationViewSummaryMainControl summaryMain = new CrossTabulationViewSummaryMainControl();
                summaryMain.lblSummaryHeader.Content = summaryMainValue;
                int totalcolumn = rvm.QueryBulder.CrossTabulationResults.SummarizeColumns.Count + groupByColCount;
                for (int summaryColIndex = 0; summaryColIndex < rvm.QueryBulder.CrossTabulationResults.SummarizeColumns.Count; summaryColIndex++)
                {
                    SQLBuilder.Clauses.Column summaryCol = rvm.QueryBulder.CrossTabulationResults.SummarizeColumns.ElementAt<SQLBuilder.Clauses.Column>(summaryColIndex);
                    string summaryColName = summaryCol.AliasName;
                    string summarycolFormat = SQLBuilder.Common.ColumnFormat.Instance.getColumnFormat(summaryCol.Format);
                    CrossTabulationViewSummaryControl ctvsCtrl = new CrossTabulationViewSummaryControl();

                    for (int keyIndex = 0; keyIndex <= rvm.QueryBulder.CrossTabulationResults.KeyPrefixes.Count + 2; keyIndex++)
                    {
                        if (summaryColIndex >= 26)
                        {
                            cl = Convert.ToString(Convert.ToChar(65 + ((summarrizeValueIndex / 26) - 1))) + Convert.ToString(Convert.ToChar(65 + summarrizeValueIndex % 26));
                        }
                        else
                        {
                            cl = Convert.ToString(Convert.ToChar(65 + summarrizeValueIndex));
                        }
                        SharedStringTablePart shareStringPart;
                        if (spreadsheetDocument.WorkbookPart.GetPartsOfType<SharedStringTablePart>().Count() > 0)
                        {
                            shareStringPart = spreadsheetDocument.WorkbookPart.GetPartsOfType<SharedStringTablePart>().First();
                        }
                        else
                        {
                            shareStringPart = spreadsheetDocument.WorkbookPart.AddNewPart<SharedStringTablePart>();
                        }
                        if (row == 1)
                        {
                            index = InsertSharedStringItem(summaryMainValue, shareStringPart);
                            cell = InsertCellInWorksheet(cl, row, worksheetPart);
                            cell.CellValue = new CellValue(Convert.ToString(summaryMainValue));
                            cell.DataType = new EnumValue<CellValues>(CellValues.SharedString);
                            cell.StyleIndex = 7;
                        }
                        else if (row == 2)
                        {
                            index = InsertSharedStringItem(summaryColName, shareStringPart);
                            cell = InsertCellInWorksheet(cl, row, worksheetPart);
                            cell.CellValue = new CellValue(Convert.ToString(summaryColName));
                            cell.DataType = new EnumValue<CellValues>(CellValues.SharedString);
                            cell.StyleIndex = 7;
                        }
                        else if (row > 3)
                        {
                            string key = rvm.QueryBulder.CrossTabulationResults.KeyPrefixes.ElementAt<string>(keyIndex - 3);

                            string keyValue = key + summaryMainValue + summaryColIndex;

                            cell = InsertCellInWorksheet(cl, row, worksheetPart);
                            if (dataMap.ContainsKey(keyValue))
                            {
                                if (summarycolFormat != null)
                                {
                                    cell.CellValue = new CellValue(String.Format(summarycolFormat, dataMap[keyValue]));
                                }
                                else
                                {
                                    cell.CellValue = new CellValue(Convert.ToString(dataMap[keyValue]));
                                }
                            }
                            else
                            {
                                cell.CellValue = new CellValue(Convert.ToString("00"));
                            }

                        }
                        lineNumber = lineNumber + 1;

                        if (row > rvm.QueryBulder.CrossTabulationResults.KeyPrefixes.Count + 2)
                        {
                            row = 1;
                            summarrizeValueIndex = summarrizeValueIndex + 1;
                        }
                        else
                        {
                            row++;
                        }
                    }
                    lineNumber = 0;
                }
                row = 1;
                groupByColCount = groupByColCount + 1;
            }
            worksheetPart.Worksheet.Save();
            workbookpart.Workbook.Save();
            spreadsheetDocument.Close();
        }
コード例 #28
0
        private void Create_WPF_Window()
        {
            //int scrnHeight = Convert.ToInt32(System.Windows.SystemParameters.PrimaryScreenHeight);
            int scrnWidth = Convert.ToInt32(System.Windows.SystemParameters.PrimaryScreenWidth);

            /****************************
            * WPF Window
            ****************************/
            WPFControl1 n = new WPFControl1();

            n.Left   = GetCursorPosition().X;
            n.Top    = GetCursorPosition().Y + 5;
            n.Height = 200;
            n.Width  = 450;
            n.Show();


            /****************************
            * Label for WPF content
            ****************************/
            System.Windows.Controls.Label _fs = new System.Windows.Controls.Label();
            _fs.Foreground = System.Windows.Media.Brushes.White;
            //_fs.Foreground = System.Windows.Media.Brushes.
            _fs.Foreground = new System.Windows.Media.SolidColorBrush(System.Windows.Media.Color.FromArgb(SMS_ToolTip.fontColor[0], SMS_ToolTip.fontColor[1], SMS_ToolTip.fontColor[2], SMS_ToolTip.fontColor[3]));
            _fs.FontFamily = new System.Windows.Media.FontFamily("Segoe UI");
            _fs.FontSize   = 18;
            _fs.FontWeight = System.Windows.FontWeights.Bold;
            _fs.Effect     = new DropShadowEffect
            {
                Color = new System.Windows.Media.Color {
                    A = 255, R = 0, G = 0, B = 0
                },
                Direction   = 0,
                ShadowDepth = 0,
                Opacity     = 1
            };
            _fs.Opacity = 1;
            n.Content   = _fs;


            /****************************
            * Timer to lock window to
            * cursor pos and keep
            * label.text up to date
            ****************************/
            System.Windows.Forms.Timer _t1 = new System.Windows.Forms.Timer();
            int _tt = 0;

            _t1.Tick += (sender, e) =>
            {
                if (_tt >= 220)
                {
                    _t1.Enabled = false;
                    DoubleAnimation anim = new DoubleAnimation(0, (System.Windows.Duration)TimeSpan.FromSeconds(1));
                    anim.Completed += (s, _) => n.Close();
                    n.BeginAnimation(System.Windows.UIElement.OpacityProperty, anim);

                    return;
                }
                string[] lines = ((RichTextBox)Threads[SMS_ToolTip.SelectedTab].richBox).Lines;
                int      v;
                string   sample;

                _fs.Content = string.Format("Name: {0}\r\nRecommended Value: {1}", lines.Length > 1 ? lines[1] : "E", ((Label)Threads[SMS_ToolTip.SelectedTab].valueBox).Text);
                v           = string.Format("Name: {0}", lines.Length > 1 ? lines[1] : "E").Length > string.Format("Recommended Value: {0}", ((Label)Threads[SMS_ToolTip.SelectedTab].valueBox).Text).Length ? 1 : 2;

                if (v == 2)
                {
                    sample = string.Format("Recommended Value: {0}", ((Label)Threads[SMS_ToolTip.SelectedTab].valueBox).Text);
                }
                else
                {
                    sample = string.Format("Name: {0}", lines.Length > 1 ? lines[1] : "E");
                }


                System.Windows.Media.Typeface      myTypeface = new System.Windows.Media.Typeface("Segoe UI");
                System.Windows.Media.FormattedText ft         = new System.Windows.Media.FormattedText(sample, CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, myTypeface, 20, System.Windows.Media.Brushes.White);

                if ((GetCursorPosition().X + ft.Width) + 25 > scrnWidth)
                {
                    n.Left = (GetCursorPosition().X - 25) - ft.Width;
                    n.Top  = GetCursorPosition().Y;
                }
                else
                {
                    n.Left = GetCursorPosition().X + 25;
                    n.Top  = GetCursorPosition().Y;
                }
                _tt++;
            };
            _t1.Interval = 10;
            _t1.Enabled  = true;
        }