Пример #1
1
        // Code compiled into PresentationFramework.dll

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

            System.Windows.Application wpfApp = new System.Windows.Application();
            wpfApp.Run(wnd);
        }
Пример #3
0
        public Main()
        {
            InitializeComponent();

            _iconWindow = ResourceHelper.GetIcon("gmail-classic.ico");

            // since we're using the native jumplist stuff, we really shouldn't need this. we'll see.
            //_taskbarManager.ApplicationId = String.Concat("Gmail-Notifier-Plus-", Shellscape.Utilities.AssemblyMeta.Guid, "-", Shellscape.Utilities.AssemblyMeta.Version);

            _jumpList = new JumpList(); //JumpList.GetJumpList(System.Windows.Application.Current);
            _jumpList.ShowFrequentCategory = false;
            _jumpList.ShowRecentCategory = false;

            var app = new System.Windows.Application();

            JumpList.SetJumpList(app, _jumpList);
            TaskbarItemInfo info = new TaskbarItemInfo();

            info.ProgressState = TaskbarItemProgressState.Indeterminate;
            info.ProgressValue = 20;

            this.Icon = _iconWindow;
            this.Location = new Point(-10000, -10000);
            this.Text = this._TrayIcon.Text = GmailNotifierPlus.Resources.WindowTitle;

            this.CreateInstances();

            _config.Saved += _Config_Saved;
            _config.Accounts.AccountChanged += _Account_Changed;

            _Timer.Tick += _Timer_Tick;
            _Timer.Interval = Math.Max(1, _config.Interval) * 1000;
            _Timer.Enabled = true;
        }
Пример #4
0
        private void CreateNotifyIcon()
        {
            _notifyIcon = new NotifyIcon();
            StreamResourceInfo info = Application.GetResourceStream(new Uri("/Resources/google.ico", UriKind.Relative));

            using (Stream iconStream = info.Stream)
            {
                _notifyIcon.Icon = new Icon(iconStream);
            }
            _notifyIcon.Visible      = false;
            _notifyIcon.DoubleClick += (sender, args) => DisplaySplashScreen.Raise(this);

            ToolStripMenuItem toTheGoogleCaveMenuItem = new ToolStripMenuItem {
                Text = "To the GoogleCave!"
            };

            toTheGoogleCaveMenuItem.Font   = new Font(toTheGoogleCaveMenuItem.Font, FontStyle.Bold);
            toTheGoogleCaveMenuItem.Click += (sender, args) => DisplaySplashScreen.Raise(this);
            toTheGoogleCaveMenuItem.ShortcutKeyDisplayString = "Win+G";

            _runAtStartupMenuItem        = new ToolStripMenuItem();
            _runAtStartupMenuItem.Text   = "Start with Windows";
            _runAtStartupMenuItem.Click += (sender, args) => ChangeRunAtStartup.Raise(this);

            _notifyIcon.ContextMenuStrip = new ContextMenuStrip();
            _notifyIcon.ContextMenuStrip.Items.AddRange(
                new ToolStripItem[]
            {
                toTheGoogleCaveMenuItem,
                _runAtStartupMenuItem,
                new ToolStripMenuItem("About", null, (sender, args) => DisplayAboutDialog.Raise(this)),
                new ToolStripSeparator(),
                new ToolStripMenuItem("Exit", null, (sender, args) => ExitApplication.Raise(this))
            });
        }
        //"pack: //application:,,,/Tauron.Application.Localizer;component/Theme.xaml"

        public static async Task Main(string[] args)
        {
            SyncfusionLicenseProvider.RegisterLicense("MjY0ODk0QDMxMzgyZTMxMmUzMEx6Vkt0M1ZIRFVPRWFqMEcwbWVrK3dqUldkYzZiaXA3TGFlWDFORDFNSms9");

            var builder = ActorApplication.Create(args);

            builder
            .ConfigureLogging((context, configuration) => configuration.ConfigDefaultLogging("Localizer").WriteTo.Sink <SeriLogViewerSink>())
            .ConfigureAutoFac(cb => cb.RegisterModule <MainModule>().RegisterModule <UIModule>())
            .ConfigurateAkkaSystem((context, system) => system.RegisterLocalization())
            .UseWpf <MainWindow>(c => c.WithAppFactory(() =>
            {
                var runapp = new System.Windows.Application();
                //{
                //    Resources = new ResourceDictionary
                //    {
                //        Source = new Uri("/Theme.xaml", UriKind.Relative)
                //    }
                //};


                return(runapp);
            }));

            using var app = builder.Build();
            await app.Run();
        }
 public Application(ScriptEngine engine)
     : base(engine)
 {
     application = new System.Windows.Application();
     window      = new System.Windows.Window();
     this.PopulateFunctions();
 }
Пример #7
0
 /// <summary>
 /// Gets the currently active window of the application.
 /// </summary>
 /// <param name="application">The application.</param>
 /// <returns>
 /// The active window of the application or null in case of none window is opened.
 /// </returns>
 public static System.Windows.Window GetActiveWindow(this System.Windows.Application application)
 {
     return(application.Dispatcher.Invoke(new Func <System.Windows.Window>(() =>
     {
         return GetActiveWindowForApplication(application);
     })) as System.Windows.Window);
 }
Пример #8
0
        public static void Apply()
        {
            if (Environment.OSVersion.Version.Major >= 6 && Environment.OSVersion.Version.Minor >= 1)
            {
                JumpList jumpList = new JumpList();

                for (int id = 0; id < Settings.GetInt("Log/JumpLists"); id++)
                {
                    jumpList.JumpItems.Add(new JumpTask()
                    {
                        ApplicationPath = Application.ExecutablePath + "WvsGame.exe",
                        Title           = "Launch Channel " + id.ToString(),
                        Arguments       = id.ToString()
                    });
                }

                jumpList.Apply();

                if (System.Windows.Application.Current == null)
                {
                    var newApplication = new System.Windows.Application();
                }

                JumpList.SetJumpList(System.Windows.Application.Current, jumpList);
            }
        }
        private void Run()
        {
            var application = new System.Windows.Application();
            var window      = new System.Windows.Window();

            application.Run(window);
        }
Пример #10
0
        public Result Execute(
            ExternalCommandData commandData,
            ref string message,
            ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;
            UIDocument    uidoc = uiapp.ActiveUIDocument;
            Application   app   = uiapp.Application;
            Document      doc   = uidoc.Document;

            RevitApplicationService.RevitApplication = uiapp;

            // Initialize App
            if (System.Windows.Application.Current == null)
            {
                System.Windows.Application app1 = new System.Windows.Application {
                    ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown
                };
                app1.Resources.Add("Bootstrapper", new Bootstrapper());
            }

            //Run App
            GetBootStrapper().StartSpecApp();

            return(Result.Succeeded);
        }
        static void Main(string[] args)
        {
            System.Windows.Application _wpfApp = new System.Windows.Application();
            MainWindow _window = new MainWindow();

            _wpfApp.Run(_window);
        }
Пример #12
0
        static void Main(string[] args)
        {
            try
            {
                PresentationTraceSources.Refresh();
                PresentationTraceSources.DataBindingSource.Listeners.Add(new DefaultTraceListener());

                PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning | SourceLevels.Error;

                ThemeManager.ApplicationThemeName = Theme.VS2010Name;
                // bool bdownload = DataUtils.ActivityUtils.DownLoadActivity(Loadprocess);
                DXSplashScreen.Show <SplashScreen_AMTS>();
                //DXSplashScreen.Progress(10);
                DXSplashScreen.SetState("Start Loding...");
                DataUtils.StaticInfo.ExecutePath         = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
                DataUtils.StaticInfo.LoginUser           = "******";
                DataUtils.StaticInfo.LocalModel          = ConfigurationManager.AppSettings["LocalModel"] == null ? "" : ConfigurationManager.AppSettings["LocalModel"].ToUpper();
                DataUtils.StaticInfo.AutoConnect         = ConfigurationManager.AppSettings["AutoConnect"] == null ? "" : ConfigurationManager.AppSettings["AutoConnect"].ToUpper();
                DataUtils.StaticInfo.ProcessName         = ConfigurationManager.AppSettings["ProcessName"] == null ? "" : ConfigurationManager.AppSettings["ProcessName"].ToUpper();
                DataUtils.StaticInfo.AutoLoadStateBySN   = ConfigurationManager.AppSettings["AutoLoadStateBySN"] == null ? "" : ConfigurationManager.AppSettings["AutoLoadStateBySN"].ToUpper();
                DataUtils.StaticInfo.AutoLoadStateFile   = ConfigurationManager.AppSettings["AutoLoadStateFile"] == null ? "" : ConfigurationManager.AppSettings["AutoLoadStateFile"].ToUpper();
                DataUtils.StaticInfo.ATEKind             = ConfigurationManager.AppSettings["ATEKind"] == null ? "" : ConfigurationManager.AppSettings["ATEKind"].ToUpper();
                DataUtils.StaticInfo.ATEStatusFile       = ConfigurationManager.AppSettings["ATEStatusFile"] == null ? "" : ConfigurationManager.AppSettings["ATEStatusFile"].ToUpper();
                DataUtils.StaticInfo.MesMode             = ConfigurationManager.AppSettings["MesMode"] == null ? "" : ConfigurationManager.AppSettings["MesMode"].ToUpper();
                DataUtils.StaticInfo.ResultString        = ConfigurationManager.AppSettings["ResultListerner"] == null ? "" : ConfigurationManager.AppSettings["ResultListerner"].ToUpper().Replace("\n", "").Replace(" ", "").Replace("\t", "").Replace("\r", "").Trim();
                AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ApplicationUtils.CurrentDomain_AssemblyResolve);
                DXSplashScreen.SetState("Loading The ApplicationTheme");
                DXSplashScreen.SetState("Check File Revisions...");
                DXSplashScreen.Progress(Loadprocess = 5);
                DXSplashScreen.SetState("Loading Application Instance");

                //string url = System.Reflection.Assembly.GetExecutingAssembly().Location + ";component/App.xaml";
                //string uri = "";
                //string param = "";
                //if (GetAssemblyInstanse(url, ref uri, ref param) == null) { throw new Exception("GetAssemblyInstanse is NULL!"); };
                //(System.Windows.Application)System.Windows.Application.LoadComponent(new System.Uri(uri, System.UriKind.Relative));
                System.Windows.Application app = new System.Windows.Application();
                app.DispatcherUnhandledException += new System.Windows.Threading.DispatcherUnhandledExceptionEventHandler(app_DispatcherUnhandledException);
                DXSplashScreen.SetState("Loading Main FrameWork");
                DXSplashScreen.Progress(Loadprocess = 70);
                System.Windows.Window MainWindow = new MainWindow();
                DXSplashScreen.SetState("Run MainWindow");
                DXSplashScreen.Progress(Loadprocess = 90);
                app.Run(MainWindow);
            }
            catch (Exception ex)
            {
                LOG.WriteLog(ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine + ex.Source);
                if (DXSplashScreen.IsActive)
                {
                    DXSplashScreen.Close();
                }
                ApplicationUtils.SaveException(ex);
                System.Windows.MessageBox.Show(ex.Message);
                if (DXSplashScreen.IsActive)
                {
                    DXSplashScreen.Close();
                }
            }
        }
Пример #13
0
        public static void InitializeNotifyIcon()
        {
            _notifyIcon = new NotifyIcon();
            var streamResourceInfo =
                Application.GetResourceStream(
                    new Uri("pack://application:,,,/TUnicodeEmoticons;component/Icons/TUnicodeEmoticons.ico"));

            if (streamResourceInfo == null)
            {
                throw new Exception("Could not load icon.");
            }

            using (var iconStream = streamResourceInfo.Stream)
            {
                _notifyIcon.Icon = new Icon(iconStream);
            }

            var menuItems = new MenuItem[2];

            menuItems[0]        = new MenuItem("Settings");
            menuItems[0].Click += SettingsMenuItemClick;

            menuItems[1]            = new MenuItem("Exit");
            menuItems[1].Click     += ExitMenuItemClick;
            _notifyIcon.ContextMenu = new ContextMenu(menuItems);

            _notifyIcon.Visible = true;
            _notifyIcon.ShowBalloonTip(5000, "TUnicodeEmoticons", "TUnicodeEmoticons is now ready for use.",
                                       ToolTipIcon.None);
        }
Пример #14
0
        public void run_application()
        {
            var waitForApplicationStart = new ManualResetEvent(false);

            _thread = new Thread(() =>
            {
                _app          = new System.Windows.Application();
                _app.Startup += (s, e) =>
                {
                    waitForApplicationStart.Set();
                    _app.MainWindow = new Window();
                    _app.MainWindow.ShowDialog();
                };
                _app.Run();
            });
            _thread.IsBackground = true;
            _thread.SetApartmentState(ApartmentState.STA);
            _thread.Name = "Application under testing";
            _thread.Start();
            waitForApplicationStart.WaitOne();

            _dispatcher = Dispatcher.FromThread(_thread);
            _dispatcher.Invoke(new ThreadStart(() => _window = _app.MainWindow as TestApp.Window));

            _process          = Process.GetCurrentProcess();
            _application      = new Application(_process);
            _windowAutomation = _application.FindWindow("MainWindow");
            //  Thread.Sleep(TimeSpan.FromSeconds(20));
        }
Пример #15
0
        public static void AssemblyInitialize(TestContext context)
        {
            var waitForApplicationRun = new TaskCompletionSource <bool>();

            System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(() =>
                                                                                                     //Task.Run(() =>
            {
                var application = new System.Windows.Application();

                application.Startup += (s, e) => {
                    application.Dispatcher.Invoke(() =>
                    {
                        application.MainWindow            = window = new System.Windows.Window();
                        application.MainWindow.Background = new SolidColorBrush(Colors.Black);
                        window.Content = new System.Windows.Controls.ContentControl();
                        window.Show();
                        waitForApplicationRun.SetResult(true);
                    });
                };
                application.Run();
                return;
            }));
            t.SetApartmentState(System.Threading.ApartmentState.STA);
            t.Start();
            UIThread = t;
            waitForApplicationRun.Task.Wait();
        }
Пример #16
0
        /// <summary>
        /// Gets the currently active window of the application.
        /// </summary>
        /// <param name="application">The application.</param>
        /// <returns>
        /// The active window of the application or null in case of none window is opened.
        /// </returns>
        public static System.Windows.Window GetActiveWindow(this System.Windows.Application application)
        {
            System.Windows.Window activeWindow = null;

            // CTL-687: Only allow windows that have an actual size (been shown at least once)
            Func <System.Windows.Window, bool> predicate = x => x.ActualWidth > 0d && x.ActualHeight > 0d;

            if (application != null && application.Windows.Count > 0)
            {
                var windowList = new List <System.Windows.Window>(application.Windows.Cast <System.Windows.Window>());

                activeWindow = windowList.FirstOrDefault(x => x.IsActive && predicate(x));
                if (activeWindow is null && windowList.Count == 1 && windowList[0].Topmost)
                {
                    activeWindow = windowList[0];
                }

                if (activeWindow is null)
                {
                    activeWindow = windowList.LastOrDefault(predicate);
                }
            }

            return(activeWindow);
        }
Пример #17
0
        public void run_application()
        {
            var waitForApplicationStart = new ManualResetEvent(false);

            _thread = new Thread(() =>
                                     {
                                         _app = new System.Windows.Application();
                                         _app.Startup += (s, e) =>
                                                             {
                                                                 waitForApplicationStart.Set();
                                                                 _app.MainWindow = new Window();
                                                                 _app.MainWindow.ShowDialog();
                                                             };
                                         _app.Run();
                                     });
            _thread.IsBackground = true;
            _thread.SetApartmentState(ApartmentState.STA);
            _thread.Name = "Application under testing";
            _thread.Start();
            waitForApplicationStart.WaitOne();

            _dispatcher = Dispatcher.FromThread(_thread);
            _dispatcher.Invoke(new ThreadStart(() => _window = _app.MainWindow as TestApp.Window));

            _process = Process.GetCurrentProcess();
            _application = new Application(_process);
            _windowAutomation = _application.FindWindow("MainWindow");
              //  Thread.Sleep(TimeSpan.FromSeconds(20));
        }
Пример #18
0
        private void UnLoadXamlApplicationResources()
        {
            Int64 startTicks = Log.APPLICATION_END("Enter", Common.LOG_CATEGORY);

            try
            {
                if (null != _XamlApp)
                {
                    _XamlApp.Shutdown();
                    _XamlApp = null;
                }
                if (null != _prismApplication)
                {
                    _prismApplication.Shutdown();
                    _prismApplication = null;
                }
            }
            catch (Exception ex)
            {
                Common.DeveloperMode = true;
                Common.WriteToDebugWindow(ex.ToString());
                Common.DeveloperMode = false;
            }

            Log.APPLICATION_END("Exit", Common.LOG_CATEGORY, startTicks);
        }
Пример #19
0
        public BallonNotifierFactory()
        {
            const string iconUri = "pack://application:,,,/AdmiralRoom;Component/Icons/app.ico";

            Uri uri;

            if (!Uri.TryCreate(iconUri, UriKind.Absolute, out uri))
            {
                return;
            }

            var streamResourceInfo = Application.GetResourceStream(uri);

            if (streamResourceInfo == null)
            {
                return;
            }

            using (var stream = streamResourceInfo.Stream)
            {
                notifyIcon = new NotifyIcon
                {
                    Text    = "提督の部屋",
                    Icon    = new Icon(stream),
                    Visible = true
                };
            }
        }
Пример #20
0
        static void Main()
        {
#if true
            // set TestGuiComponent.Program as "Startup object" in this project's Property window

#if false
            // WPF: dynamically loaded window.
            System.Windows.Application app = new System.Windows.Application();
            app.Run(new DynamicallyLoadedWindow());
#elif false
            // WPF
            System.Windows.Application app = new System.Windows.Application();
            app.Run(new MyWindow());
#elif false
            // WPF
            System.Windows.Application app = new System.Windows.Application();
            System.Windows.Navigation.NavigationWindow window = new System.Windows.Navigation.NavigationWindow();
            MyPage page = new MyPage();
            window.Navigate(page);
            app.Run(window);
#else
            // Windows Forms
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
#endif
#else
            // set TestGuiComponent.App as "Startup object" in this project's Property window

            // WPF
            //System.Windows.Application app = new TestGuiComponent.App();
            //app.InitializeComponent();
            //app.Run();
#endif
        }
Пример #21
0
 /// <summary>
 /// Threadsafe Application Shutdown.
 /// </summary>
 /// <param name="value">The <see cref="System.Windows.Application">Application Instance</see> to End.</param>
 /// <exception cref="System.NullReferenceException">Can occur when either the The <see cref="System.Windows.Application">Application Instance</see> or its The <see cref="System.Windows.Application">Application Instance</see> Dispatcher object is null.</exception>
 public static void Close(this System.Windows.Application value)
 {
     value.Invoke(delegate
     {
         value?.Shutdown();
     });
 }
Пример #22
0
            public void AddToApplicationResources()
            {
                var app = new System.Windows.Application();

                System.Windows.Threading.Dispatcher.CurrentDispatcher.BeginInvoke((Action)(() => app.Run()));

                AssertHelper.ExpectedException <ArgumentException>(() => ResourceHelper.AddToApplicationResources((string)null !, "test"));
                AssertHelper.ExpectedException <ArgumentException>(() => ResourceHelper.AddToApplicationResources("", "test"));
                AssertHelper.ExpectedException <ArgumentNullException>(() => ResourceHelper.AddToApplicationResources("test", null !));
                AssertHelper.ExpectedException <ArgumentException>(() => ResourceHelper.AddToApplicationResources("test", ""));
                AssertHelper.ExpectedException <ArgumentNullException>(() => ResourceHelper.AddToApplicationResources((Assembly)null !, "test"));
                AssertHelper.ExpectedException <ArgumentNullException>(() => ResourceHelper.AddToApplicationResources(typeof(ResourceHelperTest).Assembly, null !));
                AssertHelper.ExpectedException <ArgumentException>(() => ResourceHelper.AddToApplicationResources(typeof(ResourceHelperTest).Assembly, ""));

                Assert.AreEqual(0, app.Resources.MergedDictionaries.Count);
                ResourceHelper.AddToApplicationResources(typeof(ResourceHelperTest).Assembly,
                                                         "Presentation/Resources/BrushResources.xaml", "Presentation/Resources/LayoutResources.xaml");
                Assert.AreEqual(2, app.Resources.MergedDictionaries.Count);
                Assert.AreEqual("pack://application:,,,/System.Waf.Wpf.Test;Component/Presentation/Resources/BrushResources.xaml",
                                app.Resources.MergedDictionaries[0].Source.ToString());
                Assert.AreEqual("pack://application:,,,/System.Waf.Wpf.Test;Component/Presentation/Resources/LayoutResources.xaml",
                                app.Resources.MergedDictionaries[1].Source.ToString());

                app.Shutdown();
            }
Пример #23
0
        public void Initialize()
        {
            const string iconUri = "pack://application:,,,/KanColleViewer;Component/Assets/app.ico";

            Uri uri;

            if (!Uri.TryCreate(iconUri, UriKind.Absolute, out uri))
            {
                return;
            }

            var streamResourceInfo = Application.GetResourceStream(uri);

            if (streamResourceInfo == null)
            {
                return;
            }

            using (var stream = streamResourceInfo.Stream)
            {
                this.notifyIcon = new NotifyIcon
                {
                    Text    = App.ProductInfo.Title,
                    Icon    = new Icon(stream),
                    Visible = true,
                };
            }
        }
Пример #24
0
        static void Main(string[] args)
        {
            string fileLaunch = null;

            if (args.Length > 0)
            {
                fileLaunch = args[0];
            }

            System.Windows.Application app = new System.Windows.Application();
            FaceSortUI.MainWindow      m   = new FaceSortUI.MainWindow(fileLaunch);

            #region Hookup
            Distance         distance         = new Distance();
            Layout           layOut           = new Layout(1000, 1000);
            BoostLBPDistance boostLBPDistance = new BoostLBPDistance();

            //m.MainCanvas.DistanceCalculationDelegate += new FaceSortUI.BackgroundCanvas.BackendDelegate(distance.RankOneDistance);
            m.MainCanvas.DistanceCalculationDelegate += new FaceSortUI.BackgroundCanvas.BackendDelegate(boostLBPDistance.LBPDistance);

            //m.MainCanvas.runMdsDelegate += new FaceSortUI.BackgroundCanvas.BackendDelegate(layOut.InitialLayout);
            m.MainCanvas.runMdsDelegate += new FaceSortUI.BackgroundCanvas.BackendDelegate(layOut.HierachicalLayout);
            m.MainCanvas.runMdsUpdate   += new FaceSortUI.BackgroundCanvas.BackendDelegate(layOut.DynamicLayout);
            #endregion Hookup

            app.Run(m);

            return;
        }
Пример #25
0
        public static System.Windows.Application CreateUIApplication(int width = 500, int height = 250)
        {
            var waitForApplicationRun = new TaskCompletionSource <System.Windows.Application>();

            System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(() =>
            {
                var application = new System.Windows.Application();

                application.Startup += (s, e) =>
                {
                    application.Dispatcher.Invoke(() =>
                    {
                        var window = application.MainWindow = new System.Windows.Window()
                        {
                            Width = width, Height = height
                        };
                        window.Content = new System.Windows.Controls.ContentControl();
                        window.Show();
                        if (window.IsLoaded)
                        {
                            waitForApplicationRun.TrySetResult(application);
                        }
                        else
                        {
                            window.Loaded += (s2, e2) => waitForApplicationRun.TrySetResult(application);
                        }
                    });
                };
                application.Run();
            }));
            t.SetApartmentState(System.Threading.ApartmentState.STA);
            t.Start();
            waitForApplicationRun.Task.Wait();
            return(waitForApplicationRun.Task.Result);
        }
    public void openUI()
    {
        var application = new System.Windows.Application();
        var ui          = new Window();

        application.Run(ui);
        application.Shutdown();
    }
    public void Test1()
    {
        testDomain.DoCallBack(() => {
            var app = new System.Windows.Application();

            ...
            // assert
        });
Пример #28
0
        public override void InitializeApplication()
        {
            application = new System.Windows.Application();

            WidgetRegistry.RegisterBackend(typeof(Window), typeof(WindowBackend));
            WidgetRegistry.RegisterBackend(typeof(Menu), typeof(MenuBackend));
            WidgetRegistry.RegisterBackend(typeof(MenuItem), typeof(MenuItemBackend));
        }
Пример #29
0
        public static void ShowModel(ModelOutput modelFields)
        {
            var app = new System.Windows.Application();

            var w = new ModelFieldsWindow(modelFields);

            app.Run(w);
        }
 public static void RegisterWpfResource()
 {
     if (_wpfApp == null &&
         WPFAPP.Current != null)
     {
         _wpfApp = WPFAPP.Current;
     }
 }
Пример #31
0
 /// <summary>
 /// Threadsafe Invocation of <see cref="System.Action">delegate code</see> returning a value.
 /// </summary>
 /// <typeparam name="T">System.Type: The System.Type of the return value.</typeparam>
 /// <param name="value">The <see cref="System.Windows.Application">Application</see> Current instance.</param>
 /// <param name="action">System.Func(T): The <see cref="System.Action">delegate code</see>(<see cref="System.Func{TResult}">Func<![CDATA[<T>]]></see>) to execute and return.</param>
 /// <returns>T: The value returned from the delegate as T.</returns>
 public static T Invoke <T>(this System.Windows.Application value, System.Func <T> action)
 {
     if (value == null || value.Dispatcher == null)
     {
         return(action.Invoke());
     }
     return(value.Dispatcher.Invoke <T>(action));
 }
Пример #32
0
        public override void InitializeApplication()
        {
            application = new System.Windows.Application ();

            WidgetRegistry.RegisterBackend (typeof (Window), typeof (WindowBackend));
            WidgetRegistry.RegisterBackend (typeof (Menu), typeof (MenuBackend));
            WidgetRegistry.RegisterBackend (typeof (MenuItem), typeof (MenuItemBackend));
        }
Пример #33
0
        void run()
        {
            load_data();
            var results = train_network();
            var wpfApp  = new System.Windows.Application();

            wpfApp.Run(new PlotWindow(results));
        }
Пример #34
0
 /// <summary>Wraps an Exsisting instance of an object</summary>
 /// <param name="o">Instance of the object to wrap</param>
 public static Microsoft.Test.Security.Wrappers.ApplicationSW Wrap(System.Windows.Application o)
 {
     if (o == null)
     {
         return(null);
     }
     return(new Microsoft.Test.Security.Wrappers.ApplicationSW(o));
 }
Пример #35
0
        static void Main()
        {
            System.Windows.Application myApp = new System.Windows.Application();
            MainWindow myWindow = new MainWindow();
            MainWindowViewModel viewModel = new MainWindowViewModel();

            myWindow.DataContext = viewModel;
            myApp.ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose;
            myApp.Run(myWindow);
        }
Пример #36
0
 /// <summary>
 /// Constructor
 /// </summary>
 private ViewModel()
 {
     var app = new System.Windows.Application();
     AutoRestart = false;
     StartTime = DateTime.Now.ToString("g");
     Log = new ObservableCollection<string>();
     CaptureImageCommand = new RelayCommand(DoCaptureImage, CanCaptureImage);
     PlayCommand = new RelayCommand(DoPlay, CanPlay);
     PauseCommand = new RelayCommand(DoPause, CanPause);
     RestartCommand = new RelayCommand(DoRestart, CanRestart);
     StopCommand = new RelayCommand(DoStop, CanStop);
     DefaultSettings = new ObservableCollection<DefaultSetting>();
 }
Пример #37
0
        public Form1()
        {
            InitializeComponent();

            var app = new System.Windows.Application();
            app.Resources.MergedDictionaries.Add(ResourceHelper.GetResourceDictionary());
            app.ShutdownMode = System.Windows.ShutdownMode.OnExplicitShutdown;
            // Load the ressources
            //var uriStyles = new System.Uri("DataGridStyle.xaml", UriKind.Relative);
            //var resourcesStyles = System.Windows.Application.LoadComponent(uriStyles) as System.Windows.ResourceDictionary;
            // Merge it on application level

            //System.Windows.Application.GetResourceStream()
        }
Пример #38
0
		public Main() {

			InitializeComponent();

			_jumpList = new JumpList();
			_jumpList.ShowFrequentCategory = false;
			_jumpList.ShowRecentCategory = false;

			var app = new System.Windows.Application();

			JumpList.SetJumpList(app, _jumpList);

			this.Icon = Resources.Icons.Window;
			this.StartPosition = FormStartPosition.Manual;
			this.Location = new Point(-10000, -10000);
			this.Text = this._TrayIcon.Text = GmailNotifierPlus.Resources.Strings.WindowTitle;

			this.CreateInstances();

			_config.Saved += _Config_Saved;

			_config.LanguageChanged += delegate(Config sender) {
				InitJumpList();
			};

			_config.Accounts.AccountChanged += _Account_Changed;

			_Timer.Tick += _Timer_Tick;
			_Timer.Interval = Math.Max(1, _config.Interval) * 1000;
			_Timer.Enabled = true;

			_TrayIcon.ContextMenuStrip = new ContextMenuStrip();
			_TrayIcon.MouseClick += delegate(object sender, MouseEventArgs e) {
				if(e.Button == MouseButtons.Left) {
					MethodInfo mi = typeof(NotifyIcon).GetMethod("ShowContextMenu", BindingFlags.Instance | BindingFlags.NonPublic);
					mi.Invoke(_TrayIcon, null);
				}
			};

			Shellscape.UpdateManager.Current.UpdateAvailable += _Updates_UpdatesAvailable;
			Shellscape.UpdateManager.Current.Start();

		}
Пример #39
0
        public Main()
        {
            InitializeComponent();

            _jumpList = new JumpList();
            _jumpList.ShowFrequentCategory = false;
            _jumpList.ShowRecentCategory = false;

            var app = new System.Windows.Application();

            JumpList.SetJumpList(app, _jumpList);
            TaskbarItemInfo info = new TaskbarItemInfo();

            info.ProgressState = TaskbarItemProgressState.Indeterminate;
            info.ProgressValue = 20;

            this.Icon = Resources.Icons.Window;
            this.StartPosition = FormStartPosition.Manual;
            this.Location = new Point(-10000, -10000);
            this.Text = this._TrayIcon.Text = GmailNotifierPlus.Resources.Strings.WindowTitle;

            this.CreateInstances();

            _config.Saved += _Config_Saved;

            _config.LanguageChanged += delegate(Config sender) {
                InitJumpList();
            };

            _config.Accounts.AccountChanged += _Account_Changed;

            _Timer.Tick += _Timer_Tick;
            _Timer.Interval = Math.Max(1, _config.Interval) * 1000;
            _Timer.Enabled = true;

            Shellscape.UpdateManager.Current.UpdateAvailable += _Updates_UpdatesAvailable;
            Shellscape.UpdateManager.Current.Start();
        }
        static void Main()
        {
            #if true
            // set TestGuiComponent.Program as "Startup object" in this project's Property window

            #if false
            // WPF: dynamically loaded window.
            System.Windows.Application app = new System.Windows.Application();
            app.Run(new DynamicallyLoadedWindow());
            #elif false
            // WPF
            System.Windows.Application app = new System.Windows.Application();
            app.Run(new MyWindow());
            #elif false
            // WPF
            System.Windows.Application app = new System.Windows.Application();
            System.Windows.Navigation.NavigationWindow window = new System.Windows.Navigation.NavigationWindow();
            MyPage page = new MyPage();
            window.Navigate(page);
            app.Run(window);
            #else
            // Windows Forms
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
            #endif

            #else
            // set TestGuiComponent.App as "Startup object" in this project's Property window

            // WPF
            //System.Windows.Application app = new TestGuiComponent.App();
            //app.InitializeComponent();
            //app.Run();
            #endif
        }
Пример #41
0
		/// <summary>Starts the window of the application, and then runs the provided installer program.</summary>
		/// <param name="installer">The installer program to run..</param>
		private static void StartVisualApp(UpdateInstaller installer, bool showInstallationWindow, int timeoutAfterSuccessfullInstallation)
		{
			if (null == app)
			{
				app = new System.Windows.Application();
			}
			if (null == mainWindow)
			{
				mainWindow = new InstallerMainWindow(showInstallationWindow, timeoutAfterSuccessfullInstallation);
				mainWindow._installer = installer;
				app.Run(mainWindow);
			}
		}
Пример #42
0
        private static void Main(string[] args)
        {
            try
            {
            //				if (IsWriteAccess() == false)
            //					return;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                StreamResourceInfo sri = System.Windows.Application.GetResourceStream(
                    new Uri("App.xaml", UriKind.Relative));
                var resources = (System.Windows.ResourceDictionary)Load(sri.Stream);
                var app = new System.Windows.Application();
                app.Resources.MergedDictionaries.Add(resources);
                Starter(args);
                ClearTypeOn();
                //new SettingsWpfForm().ShowDialog();
                //var controller = new TaskShowController(new Task());
                //controller.Window.ShowDialog();

                Application.Run();

            }
            catch (Exception e)
            {
                new ErrorBox("We are very sorry, but the program crashed. Please contact support at " +
                             "http://code.google.com/p/minder/issues/list. Thank you for your patience.\n\n" +
                             "P.S. you can copy error message by pressing clr + C. Have a nice day."); // This shows error box and writes to log.
                try
                {
                    log4net.ILog log = log4net.LogManager.GetLogger(typeof(BootStrap));
                    log.Fatal(e);
                }
                catch{} //Jei konfigai neužkrauti

                Application.Exit();
            }
        }
        private static void Askpass(string[] args)
        {
            if (args == null || args.Length == 0)
                throw new ArgumentException("Arguments cannot be empty.");

            Match match;
            if ((match = AskPasswordRegex.Match(args[0])).Success
                || (match = AskPassphraseRegex.Match(args[0])).Success)
            {
                Git.Trace.WriteLine("querying for passphrase key.");

                if (match.Groups.Count < 2)
                    throw new ArgumentException("Unable to understand command.");

                string request = match.Groups[0].Value;
                string resource = match.Groups[1].Value;

                Git.Trace.WriteLine($"open dialog for '{resource}'.");

                System.Windows.Application application = new System.Windows.Application();
                Gui.PassphraseWindow prompt = new Gui.PassphraseWindow(resource);
                application.Run(prompt);

                if (!prompt.Cancelled && !string.IsNullOrEmpty(prompt.Passphrase))
                {
                    string passphase = prompt.Passphrase;

                    Git.Trace.WriteLine("passphase acquired.");

                    Console.Out.Write(passphase + "\n");
                    return;
                }

                Git.Trace.WriteLine("failed to interactively acquire credentials.");
            }

            if ((match = AskCredentialRegex.Match(args[0])).Success)
            {
                Git.Trace.WriteLine("querying for HTTPS credentials.");

                if (match.Groups.Count < 3)
                    throw new ArgumentException("Unable to understand command.");

                string seeking = match.Groups[1].Value;
                string targetUrl = match.Groups[2].Value;

                Uri targetUri;

                if (Uri.TryCreate(targetUrl, UriKind.Absolute, out targetUri))
                {
                    Git.Trace.WriteLine($"success parsing URL, targetUri = '{targetUri}'.");

                    // config stored credentials come in the format of <username>[:<password>]@<url> with password being optional
                    // scheme terminator is actually "://" so we need adjust to get the correct index
                    int schemeTerminator = targetUrl.IndexOf(':') + 2;
                    int credentialTerminator = targetUrl.IndexOf('@', schemeTerminator + 1);

                    if (credentialTerminator > 0)
                    {
                        Git.Trace.WriteLine("'@' symbol found in URL, assuming credential prefix.");

                        string username = null;
                        string password = null;

                        int passwordTerminator = targetUrl.IndexOf(':', schemeTerminator + 1);

                        if (passwordTerminator > 0)
                        {
                            Git.Trace.WriteLine("':' symbol found in URL, assuming credential prefix contains password.");

                            username = targetUrl.Substring(schemeTerminator + 1, passwordTerminator - schemeTerminator - 1);
                            password = targetUrl.Substring(passwordTerminator + 1, credentialTerminator - passwordTerminator + 1);

                            // print the password if it sought
                            if (seeking.Equals("Password", StringComparison.OrdinalIgnoreCase))
                            {
                                Console.Out.Write(password + '\n');
                                return;
                            }
                        }
                        else
                        {
                            username = targetUrl.Substring(schemeTerminator + 1, credentialTerminator - schemeTerminator - 1);
                        }

                        // print the username if it sought
                        if (seeking.Equals("Username", StringComparison.OrdinalIgnoreCase))
                        {
                            Console.Out.Write(username + '\n');
                            return;
                        }
                    }

                    // create a target Url with the credential portion stripped, because Git doesn't report hosts with credentials
                    targetUrl = String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}://{1}", targetUri.Scheme, targetUri.Host);

                    // retain the port if specified
                    if (!targetUri.IsDefaultPort)
                    {
                        targetUrl += $":{targetUri.Port}";
                    }

                    // retain the path if specified
                    if (!String.IsNullOrWhiteSpace(targetUri.LocalPath))
                    {
                        targetUrl += targetUri.LocalPath;
                    }

                    if (Uri.TryCreate(targetUrl, UriKind.Absolute, out targetUri))
                    {
                        Git.Trace.WriteLine($"success parsing URL, targetUri = '{targetUri}'.");

                        OperationArguments operationArguments = new OperationArguments(targetUri);

                        // load up the operation arguments, enable tracing, and query for credentials
                        LoadOperationArguments(operationArguments);
                        EnableTraceLogging(operationArguments);

                        if (QueryCredentials(operationArguments))
                        {
                            if (seeking.Equals("Username", StringComparison.OrdinalIgnoreCase))
                            {
                                Git.Trace.WriteLine($"username for '{targetUrl}' asked for and found.");

                                Console.Out.Write(operationArguments.CredUsername + '\n');
                                return;
                            }

                            if (seeking.Equals("Password", StringComparison.OrdinalIgnoreCase))
                            {
                                Git.Trace.WriteLine($"password for '{targetUrl}' asked for and found.");

                                Console.Out.Write(operationArguments.CredPassword + '\n');
                                return;
                            }
                        }
                    }
                    else
                    {
                        Git.Trace.WriteLine("error: unable to parse target URL.");
                    }
                }
                else
                {
                    Git.Trace.WriteLine("error: unable to parse supplied URL.");
                }

                Git.Trace.WriteLine($"failed to detect {seeking} in target URL.");
            }

            Git.Trace.WriteLine("failed to acquire credentials.");
        }
Пример #44
0
 static void Main(string[] args)
 {
     var app = new System.Windows.Application();
     app.Run(new HandWritingCanvas());
 }
Пример #45
0
        static void Main(string[] args)
        {
            bool createdNew;
            using (new Mutex(true, "SevenUpdate.Admin", out createdNew))
            {
                if (createdNew)
                {
                    StartWcfHost();
                    SystemEvents.SessionEnding += PreventClose;
                    Search.SearchCompleted += SearchCompleted;
                    Search.ErrorOccurred += ErrorOccurred;
                    Download.DownloadCompleted += DownloadCompleted;
                    Download.DownloadProgressChanged += DownloadProgressChanged;
                    Utilities.ErrorOccurred += ErrorOccurred;
                    Install.InstallCompleted += InstallCompleted;
                    Install.InstallProgressChanged += InstallProgressChanged;
                    Install.UpdateInstalled += AddHistory;
                    if (!Directory.Exists(AllUserStore))
                    {
                        Directory.CreateDirectory(AllUserStore);
                    }
                }
            }

            var app = new Application();

            using (notifyIcon = new NotifyIcon())
            {
                notifyIcon.Icon = Resources.TrayIcon;
                notifyIcon.Text = Resources.CheckingForUpdates;
                notifyIcon.Visible = false;

                ProcessArgs(args);

                using (var timer = new Timer(3000))
                {
                    timer.Elapsed += CheckIfRunning;
                    timer.Start();
                    app.Run();
                }

                if (client != null)
                {
                    client.ElevatedProcessStopped();
                    client.Close();
                }

                try
                {
                    File.Delete(Path.Combine(Environment.ExpandEnvironmentVariables("%WINDIR%"), "Temp", "abort.lock"));
                }
                catch (IOException e)
                {
                    ErrorOccurred(
                        null, new ErrorOccurredEventArgs(Utilities.GetExceptionAsString(e), ErrorType.FatalError));
                }

                notifyIcon.Icon = null;
            }

            SystemEvents.SessionEnding -= PreventClose;
        }
Пример #46
0
		public TrayIcon(System.Windows.Application application)
		{
			_application = application;
		}
Пример #47
0
		/// <summary>Starts the window of the application, and then presents the provided error message message.</summary>
		/// <param name="eventName">Name of the event that is used to signal to Altaxo that Altaxo should be stopped.</param>
		/// <param name="message">The error message to present.</param>
		private static void StartVisualAppWithErrorMessage(string eventName, string message)
		{
			if (null != eventName)
				UpdateInstaller.SetEvent(eventName); // Altaxo is waiting for this event to finish itself

			if (null == app)
			{
				app = new System.Windows.Application();
			}
			if (null == mainWindow)
			{
				mainWindow = new InstallerMainWindow(true, int.MaxValue);
				mainWindow.SetErrorMessage(message);
				app.Run(mainWindow);
			}
			else
			{
				mainWindow.SetErrorMessage(message);
			}
		}