// 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; }
private void ShowNotifyIconContextMenu() { if (_notifyIconContextMenu is null) { _notifyIconContextMenu = new ContextMenu(); var showWindowItem = new MenuItem { Header = "Show Application Window" }; showWindowItem.Click += (_, __) => Deminimize(); _notifyIconContextMenu.Items.Add(showWindowItem); var openProjectPageItem = new MenuItem { Header = "Open Project Page" }; openProjectPageItem.Click += (_, __) => { Process.Start(new ProcessStartInfo() { FileName = Properties.Resources.ProjectPageUrl, UseShellExecute = true }); }; _notifyIconContextMenu.Items.Add(openProjectPageItem); var exitItem = new MenuItem { Header = "Exit" }; exitItem.Click += (_, __) => Application.Current.Shutdown(); _notifyIconContextMenu.Items.Add(exitItem); } _notifyIconContextMenu.IsOpen = true; }
public override void SetupCustomUIElements(object ui) { var nodeUI = ui as dynNodeView; //add an edit window option to the //main context window var editWindowItem = new System.Windows.Controls.MenuItem(); editWindowItem.Header = "Edit..."; editWindowItem.IsCheckable = false; nodeUI.MainContextMenu.Items.Add(editWindowItem); editWindowItem.Click += new RoutedEventHandler(editWindowItem_Click); //add a text box to the input grid of the control var tb = new DynamoTextBox(); tb.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch; tb.VerticalAlignment = System.Windows.VerticalAlignment.Center; nodeUI.inputGrid.Children.Add(tb); System.Windows.Controls.Grid.SetColumn(tb, 0); System.Windows.Controls.Grid.SetRow(tb, 0); tb.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0x88, 0xFF, 0xFF, 0xFF)); tb.DataContext = this; tb.BindToProperty(new System.Windows.Data.Binding("Value") { Mode = BindingMode.TwoWay, Converter = new RevitProjectUnitsConverter(), //ConverterParameter = Measure, NotifyOnValidationError = false, Source = this, UpdateSourceTrigger = UpdateSourceTrigger.Explicit }); tb.OnChangeCommitted += delegate { RequiresRecalc = true; }; }
/// <summary> /// Changes the BorderBrush property of the control. /// </summary> /// <param name="targetControl">The control instance.</param> /// <param name="toValue">The color to change to.</param> /// <param name="duration">Transtition Time in Milliseconds.</param> public static void BorderBrush(System.Windows.Controls.MenuItem targetControl, Color toValue, int duration) { ColorAnimation animation = new ColorAnimation(toValue, new Duration(TimeSpan.FromMilliseconds(duration))); targetControl.BorderBrush = new SolidColorBrush(((SolidColorBrush)targetControl.BorderBrush).Color); targetControl.BorderBrush.BeginAnimation(SolidColorBrush.ColorProperty, animation); }
public dynLeapController() { // This input will drive the acquire of a frame of data from the Leap. // Attaching a timer node to it will then generate a flow of data from // the Leap into the system. InPortData.Add(new PortData("Read", "Read a frame of data from the Leap", typeof(object))); // Output from this node is the data from a single frame OutPortData.Add(new PortData("Leap", "The Leap controller", typeof(object))); NodeUI.RegisterAllPorts(); NodeUI.dynNodeDestroyed += new dynNodeUI.dynElementDestroyedHandler(OnDynLeapMotionDestroyed); NodeUI.dynNodeReadyToDestroy += new dynNodeUI.dynElementReadyToDestroyHandler(OnDynLeapMotionReadyToDestroy); // Create a menuitem to enable/disable the Leap device menuItemLeapEnabled = new System.Windows.Controls.MenuItem(); menuItemLeapEnabled.Header = "Enable Leap"; menuItemLeapEnabled.IsCheckable = true; menuItemLeapEnabled.IsChecked = (leapController != null); menuItemLeapEnabled.Checked += new System.Windows.RoutedEventHandler(menuItemLeapEnabled_Checked); NodeUI.MainContextMenu.Items.Add(menuItemLeapEnabled); LeapEnable(true); }
private void btnBrowse_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (NavigationManager.PathHistory.Count > 0) { browseContextMenu.Items.Clear(); for (int i = 0; i < NavigationManager.PathHistory.Count; i++) { System.Windows.Controls.MenuItem locationMenuItem = new System.Windows.Controls.MenuItem(); locationMenuItem.Header = GetCleanFolderName(NavigationManager.PathHistory[i]); locationMenuItem.Tag = i; locationMenuItem.Click += LocationMenuItem_Click; browseContextMenu.Items.Add(locationMenuItem); } browseContextMenu.Items.Add(new System.Windows.Controls.Separator()); System.Windows.Controls.MenuItem clearHistoryMenuItem = new System.Windows.Controls.MenuItem { Header = Localization.DisplayString.sDesktop_ClearHistory }; clearHistoryMenuItem.Click += ClearHistoryMenuItem_Click; browseContextMenu.Items.Add(clearHistoryMenuItem); browseContextMenu.IsOpen = true; // this value is set so that if we click away from the context menu, the desktop overlay does not get toggled ToolbarOwner.IsToolbarContextMenuOpen = true; e.Handled = true; } }
private void btnBrowse_MouseRightButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (NavigationManager.PathHistory.Count > 0) { browseContextMenu.Items.Clear(); for (int i = 0; i < NavigationManager.PathHistory.Count; i++) { System.Windows.Controls.MenuItem locationMenuItem = new System.Windows.Controls.MenuItem(); locationMenuItem.Header = GetCleanFolderName(NavigationManager.PathHistory[i]); locationMenuItem.Tag = i; locationMenuItem.Click += LocationMenuItem_Click; browseContextMenu.Items.Add(locationMenuItem); } browseContextMenu.Items.Add(new System.Windows.Controls.Separator()); System.Windows.Controls.MenuItem clearHistoryMenuItem = new System.Windows.Controls.MenuItem { Header = Localization.DisplayString.sDesktop_ClearHistory }; clearHistoryMenuItem.Click += ClearHistoryMenuItem_Click; browseContextMenu.Items.Add(clearHistoryMenuItem); browseContextMenu.IsOpen = true; e.Handled = true; } }
public App() { Stream iconStream = Application.GetResourceStream(new Uri("pack://application:,,,/OctoUploader;component/Resources/octoprintupload.ico")).Stream; tbi.Icon = new System.Drawing.Icon(iconStream); tbi.ToolTipText = System.Diagnostics.Process.GetCurrentProcess().ProcessName; tbi.TrayMouseDoubleClick += Tbi_TrayMouseDoubleClick; tbi.MouseLeftButtonUp += Tbi_MouseLeftButtonUp; System.Windows.Controls.ContextMenu cm = new System.Windows.Controls.ContextMenu(); System.Windows.Controls.MenuItem menuItemSettings = new System.Windows.Controls.MenuItem { Header = "S_ettings" }; menuItemSettings.Click += settings_Click; System.Windows.Controls.MenuItem menuItemExit = new System.Windows.Controls.MenuItem { Header = "E_xit" }; menuItemExit.Click += exit_Click; cm.Items.Add(menuItemSettings); cm.Items.Add(menuItemExit); tbi.ContextMenu = cm; if (OctoUploader.Properties.Settings.Default.ServerAddress != "") { StartWatching(); } else { ShowSettings(); } }
private MenuItem BuildMenuItemForCommandHandler() { var parent = Parent; if (parent?.Connection == null) { return(null); } var builder = new SqlConnectionStringBuilder(parent.Connection.ConnectionString); builder.InitialCatalog = parent.InvariantName; var dbInfo = new DatabaseInfo { DatabaseType = DatabaseType.SQLServer, ConnectionString = builder.ConnectionString }; var menuItem = new MenuItem { CommandParameter = new DatabaseMenuCommandParameters { ExplorerControl = null, DatabaseInfo = dbInfo } }; return(menuItem); }
public IEnumerable <object> BuildItems(Codon codon, object owner) { // search either as part of IFileService or directly as service IRecentOpen var recentOpen = Altaxo.Current.GetService <IFileService>()?.RecentOpen ?? Altaxo.Current.GetService <IRecentOpen>(); if (null != recentOpen && recentOpen.RecentFiles.Count > 0) { var items = new System.Windows.Controls.MenuItem[recentOpen.RecentFiles.Count]; for (int i = 0; i < recentOpen.RecentFiles.Count; ++i) { // variable inside loop, so that anonymous method refers to correct recent file string recentFile = recentOpen.RecentFiles[i]; string accelaratorKeyPrefix = i < 10 ? "_" + ((i + 1) % 10) + " " : ""; items[i] = new System.Windows.Controls.MenuItem() { Header = accelaratorKeyPrefix + recentFile }; items[i].Click += delegate { Altaxo.Current.GetRequiredService <IFileService>().OpenFile(new FileName(recentFile)); }; } return(items); } else { return(new[] { new System.Windows.Controls.MenuItem { Header = StringParser.Parse("${res:Dialog.Componnents.RichMenuItem.NoRecentFilesString}"), IsEnabled = false } }); } }
/// <summary> /// Populate "recent entries" mmenu items /// </summary> /// <param name="InializeMenuEntries">Use to tell the app to initialize recent entries even with dummy ones.</param> private void PopulateRecentFilesMenuItems(bool InializeMenuEntries = false) { System.Windows.Controls.MenuItem FileMenuItem = (System.Windows.Controls.MenuItem) this.MainMenu.Items[0]; System.Windows.Controls.MenuItem RecentFilesItem = (System.Windows.Controls.MenuItem)FileMenuItem.Items[2]; byte RecentFilesCount = (byte)Properties.Settings.Default.RecentFiles.Count; byte RecentFilesIndex = (byte)Properties.Settings.Default.RecentFilesIndex; byte Index = (byte)((RecentFilesIndex + RecentFilesCount - 1) % RecentFilesCount); int IndexEntry = 0; do { String RecentFilePath = Properties.Settings.Default.RecentFiles[Index]; System.Windows.Controls.MenuItem newRecentFileItem = new System.Windows.Controls.MenuItem(); newRecentFileItem.Header = System.IO.Path.GetFileName(RecentFilePath); newRecentFileItem.DataContext = RecentFilePath; newRecentFileItem.Click += new RoutedEventHandler(RecentFileCommandBinding_Clicked); // application initialization if (InializeMenuEntries) { FileMenuItem.Items.Insert(3, newRecentFileItem); } else // update elem { FileMenuItem.Items[FileMenuItem.Items.Count - 3 - IndexEntry] = newRecentFileItem; } Index = (byte)((Index - 1 + RecentFilesCount) % RecentFilesCount); IndexEntry = IndexEntry + 1; } while (Index != Properties.Settings.Default.RecentFilesIndex); }
public dynArduino() { InPortData.Add(new PortData("exec", "Execution Interval", typeof(object))); OutPortData.Add(new PortData("arduino", "Serial port for later read/write", typeof(object))); NodeUI.RegisterAllPorts(); string[] serialPortNames = System.IO.Ports.SerialPort.GetPortNames(); if (port == null) { port = new SerialPort(); } port.BaudRate = 9600; port.NewLine = "\r\n"; port.DtrEnable = true; foreach (string portName in serialPortNames) { if (lastComItem != null) { lastComItem.IsChecked = false; // uncheck last checked item } comItem = new System.Windows.Controls.MenuItem(); comItem.Header = portName; comItem.IsCheckable = true; comItem.IsChecked = true; comItem.Checked += new System.Windows.RoutedEventHandler(comItem_Checked); NodeUI.MainContextMenu.Items.Add(comItem); port.PortName = portName; lastComItem = comItem; } }
/// <summary> /// /// </summary> /// <param name="menuItem"></param> public static void InvalidateSubmenuCommands(System.Windows.Controls.MenuItem menuItem) { if (menuItem == null) { return; } foreach (var item in menuItem.Items) { var mi = item as System.Windows.Controls.MenuItem; if (mi == null) { continue; } if (mi.Command != null) { mi.IsEnabled = mi.Command.CanExecute(mi.CommandParameter); } if (mi.HasItems) { InvalidateSubmenuCommands(mi); } } }
public IEnumerable <object> BuildItems(Codon codon, object owner) { var ctrl = Current.Workbench.ActiveViewContent as Altaxo.Gui.Graph.Gdi.Viewing.GraphController; if (null == ctrl) { return(null); } var activeLayer = ctrl.ActiveLayer as XYPlotLayer; if (null == activeLayer) { return(null); } int actPA = ctrl.CurrentPlotNumber; int len = activeLayer.PlotItems.Flattened.Length; var items = new List <object>(); for (int i = 0; i < len; i++) { IGPlotItem pa = activeLayer.PlotItems.Flattened[i]; var item = new System.Windows.Controls.MenuItem() { Header = pa.ToString() }; item.Click += EhWpfMenuItem_Clicked; item.IsChecked = (i == actPA); item.Tag = i; items.Add(item); } return(items); }
protected override void OnClick() { base.OnClick(); var menuItemData = this.DataContext as MenuItem; if (menuItemData != null) { if (menuItemData.IsCategory) { if (menuItemData.Count == 1 && menuItemData[0].Count == 0 && !menuItemData[0].IsCategory) { // Menu has only a single child, so clicking the top level (category) item // will automatically "click" that child ApplicationEx.Instance.ApplicationMenu.SelectedItem = menuItemData; ApplicationEx.Instance.CreateActivityContainer(menuItemData[0].ActivityName, menuItemData[0].ActivityStyle, null, null); } else { // Need to create the context menu each time, as otherwise the positioning // of the context menu for the next time is incorrect (bug). var menuItem = new System.Windows.Controls.ContextMenu(); foreach (MenuItem childMenuItemData in menuItemData) { var childMenuItem = new System.Windows.Controls.MenuItem(); childMenuItem.Header = childMenuItemData.Title; childMenuItem.DataContext = childMenuItemData; childMenuItem.Click += MenuItem_Click; // TODO: Change to command to avoid memory leak? menuItem.Items.Add(childMenuItem); } menuItem.Closed += Menu_Closed; int dropdownYOffset = GetDropdownYOffset(); #if WPF menuItem.Placement = PlacementMode.Bottom; menuItem.PlacementTarget = this; menuItem.VerticalOffset = dropdownYOffset; #else GeneralTransform transform = this.TransformToVisual(null); Point topLeftCorner = transform.Transform(new Point()); menuItem.HorizontalOffset = topLeftCorner.X + 1; menuItem.VerticalOffset = topLeftCorner.Y + this.ActualHeight - 2 + dropdownYOffset; #endif menuItem.IsOpen = true; } } else { // Launch the activity ApplicationEx.Instance.ApplicationMenu.SelectedItem = menuItemData; ApplicationEx.Instance.CreateActivityContainer(menuItemData.ActivityName, menuItemData.ActivityStyle, null, null); } } }
private void SetBindingForIsChecked(System.Windows.Controls.MenuItem childMenuitem, string converterParameter) { Binding binding = new Binding("TagManager.Sorting"); binding.Converter = TagSortingToBool; binding.ConverterParameter = converterParameter; childMenuitem.SetBinding(System.Windows.Controls.MenuItem.IsCheckedProperty, binding); }
private void AddMainMenu() { _mainMenu = new System.Windows.Controls.MenuItem(); _mainMenu.Header = MainMenuHeader; _mainMenu.Click += NotificationMenu_Click; PluginInitialization._work.MainForm.Menu(_mainMenu); _mainMenu.IsEnabled = true; }
private void AddSubmenuItem(ToolStripItemCollection destinationItems, System.Windows.Controls.MenuItem menuItem) { string MenuHeader = (string)menuItem.Header; ToolStripMenuItem NewMenuItem = new ToolStripMenuItem(MenuHeader); ConvertToolStripMenuItems(menuItem.Items, NewMenuItem.DropDownItems); destinationItems.Add(NewMenuItem); }
private void ExitClick(object sender, EventArgs args) { // Close the application by triggering the File-Exit menu item click handler. System.Windows.Controls.MenuItem exitMenuItem = (System.Windows.Controls.MenuItem)_window.FindName("menuFileExit"); if (exitMenuItem != null) { exitMenuItem.RaiseEvent(new RoutedEventArgs(System.Windows.Controls.MenuItem.ClickEvent, exitMenuItem)); } }
private void RecentFileCommandBinding_Clicked(object sender, RoutedEventArgs e) { System.Windows.Controls.MenuItem RecentFile = sender as System.Windows.Controls.MenuItem; String RecentFilePath = RecentFile.DataContext as String; if (RecentFilePath.Length != 0) { OpenNewDependencyWindow(RecentFilePath); } }
public IDisposable AddInputBinding( HotKey hotkey, System.Windows.Controls.MenuItem item, ICommand command) { var binding = Tuple.Create(hotkey, item, command); _bindings.OnNext(_bindings.Value.Add(binding)); return(Disposable.Create(() => _bindings.OnNext(_bindings.Value.Remove(binding)))); }
/// <summary> /// An IUI element which is a windows-desktop application style MenuItem. /// </summary> /// <param name="title">the text displayed on the menu item</param> public MenuItem(string title, bool visible = true) { menuItem = new System.Windows.Controls.MenuItem(); menuItem.Header = title; menuItem.VerticalAlignment = VerticalAlignment.Center; menuItem.Foreground = new SolidColorBrush(Color.FromRgb(0, 0, 0)); menuItem.FontSize = 14; menuItem.Click += (object sender, RoutedEventArgs e) => output?.Execute(); menuItem.Visibility = visible ? Visibility.Visible : Visibility.Collapsed; }
public System.Windows.Controls.MenuItem AddMenuItem(LinearGradientBrush brush) { var miRemove = new System.Windows.Controls.MenuItem() { Header = "", FontFamily = new FontFamily("Segoe360"), FontSize = 18 }; //var c = (Color)ColorConverter.ConvertFromString(header as string); miRemove.Background = brush; miRemove.Width = 200; miRemove.Click += miRemove_Click; Items.Add(miRemove); return miRemove; }
private void ShowGroundSelectAtomMenu(object sender, structTransportCommonProperty minDistAtom) { System.Windows.Application.Current.MainWindow.ContextMenu = null; // System.Windows.Controls.ContextMenu contextmenu = new System.Windows.Controls.ContextMenu(); contextmenu = new System.Windows.Controls.ContextMenu(); System.Windows.Controls.MenuItem miName = new System.Windows.Controls.MenuItem(); miName.Header = Properties.Resources.strNameColon + " " + minDistAtom.AtomName;///+ " " + minDistAtom.TextValue.Replace("_", "__"); ; miName.Focusable = false; contextmenu.Items.Add(miName); System.Windows.Controls.Separator Sp2 = new System.Windows.Controls.Separator(); contextmenu.Items.Add(Sp2); System.Windows.Controls.MenuItem miGroundMission = new System.Windows.Controls.MenuItem(); miGroundMission.Header = "Activity";// "Force Mission"; miGroundMission.Name = "miGroundMission"; miGroundMission.Tag = minDistAtom; miGroundMission.Click += new System.Windows.RoutedEventHandler(mnuGroundMission_Click); contextmenu.Items.Add(miGroundMission); System.Windows.Controls.MenuItem miMove = new System.Windows.Controls.MenuItem(); miMove.Header = Properties.Resources.strMove; // "Move"; miMove.Tag = minDistAtom; miMove.Name = "mnuMove"; miMove.Click += miMove_Click; // new System.Windows.RoutedEventHandler(mnuMove_Click); contextmenu.Items.Add(miMove); if (VMMainViewModel.Instance.CurrentGameStatus != typGamestatus.EDIT_STATUS) { miMove.IsEnabled = false; } System.Windows.Controls.MenuItem miDeleteAtom = new System.Windows.Controls.MenuItem(); miDeleteAtom.Header = Properties.Resources.strUndeploy;// Properties.Resources.strDelete; miDeleteAtom.Name = "miDeleteAtom"; miDeleteAtom.Tag = minDistAtom; miDeleteAtom.Click += miDeleteAtom_Click; contextmenu.Items.Add(miDeleteAtom); // System.Windows.Application.Current.MainWindow.ContextMenu = new System.Windows.Controls.ContextMenu(); System.Windows.Application.Current.MainWindow.ContextMenu = contextmenu; contextmenu.Visibility = Visibility.Visible; System.Windows.Application.Current.MainWindow.ContextMenu.Visibility = Visibility.Visible; System.Windows.Application.Current.MainWindow.ContextMenu.IsOpen = true; // System.Windows.Application.Current.MainWindow.ContextMenu.Width = 1000; }
/// <summary> /// 切换语言 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SwitchLang(Object sender, RoutedEventArgs e) { foreach (System.Windows.Controls.MenuItem item in menuItemLanguages.Items) { item.IsChecked = false; } System.Windows.Controls.MenuItem mi = sender as System.Windows.Controls.MenuItem; mi.IsChecked = true; LocaleUtil.SwitchLanguage(this, mi.Tag.ToString()); ToolIcon(); }
public static void AddMenuElement(String name, int height, System.Windows.Controls.Image Ico, RoutedEventHandler Click, Map map) { System.Windows.Controls.MenuItem MenuElement = new System.Windows.Controls.MenuItem { Header = name, Height = height, Icon = Ico }; MenuElement.Click += Click; map.MainWin.menu.Items.Add(MenuElement); }
public void ToolLoad() { if (Properties.Settings.Default.FirstRun) { Properties.Settings.Default.FirstRun = false; Properties.Settings.Default.Adapter = PCC.GetInstanceNames()[0]; Properties.Settings.Default.Left = Top; Properties.Settings.Default.Top = Left; Properties.Settings.Default.Save(); } else { Top = Properties.Settings.Default.Top; Left = Properties.Settings.Default.Left; } LocalAdapter = Properties.Settings.Default.Adapter; Topmost = true; foreach (var item in PCC.GetInstanceNames()) { MenuItem menuItem = new MenuItem { Header = item }; menuItem.Click += Set_Instance; if (LocalAdapter == item) { menuItem.IsChecked = true; } Adapter.Items.Add(menuItem); } using (RegistryKey key = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true)) { if (key.GetValueNames().Contains("Net Speed")) { AutoStart.IsChecked = true; } else { AutoStart.IsChecked = false; } } tokenSource = new CancellationTokenSource(); token = tokenSource.Token; Worker = new Task(() => Get_Speed(), token); Worker.RunSynchronously(); }
public override void OnApplyTemplate() { base.OnApplyTemplate(); var col = this.Content as TableViewColumn; if (col != null) { this.ContentTemplate = col.TitleTemplate; this.Tag = col.Tag; if (col.UseHistogramm) { if (this.ContextMenu == null) { this.ContextMenu = new System.Windows.Controls.ContextMenu(); } System.Windows.Controls.MenuItem mi1 = new System.Windows.Controls.MenuItem(); mi1.Header = "Показать гистограмму"; mi1.IsCheckable = true; mi1.IsChecked = col.ShowHistogramm; mi1.Command = new Shared.Commands.DelegateCommand <TableViewColumn>(c => { TableViewColumn tableViewColumn = c; tableViewColumn.ShowHistogramm = !tableViewColumn.ShowHistogramm; }); mi1.CommandParameter = col; Binding b = new Binding("ShowHistogramm"); BindingOperations.SetBinding(mi1, ToggleButton.IsCheckedProperty, b); this.ContextMenu.Items.Add(mi1); } if (col.ContextMenu != null && col.ContextMenu.Items != null) { if (this.ContextMenu == null) { this.ContextMenu = new System.Windows.Controls.ContextMenu(); } foreach (System.Windows.Controls.MenuItem item in col.ContextMenu.Items) { System.Windows.Controls.MenuItem mi2 = new System.Windows.Controls.MenuItem(); mi2.Header = item.Header; mi2.Command = item.Command; mi2.CommandParameter = item.CommandParameter; mi2.Tag = item.Tag; this.ContextMenu.Items.Add(mi2); } } } }
/*************************************/ protected System.Windows.Controls.MenuItem AppendMenuItem(System.Windows.Controls.MenuItem menu, string text, bool @checked = false, bool enabled = true) { System.Windows.Controls.MenuItem item = new System.Windows.Controls.MenuItem { Header = text, IsChecked = @checked, IsEnabled = enabled }; item.Click += Item_CheckedChanged; menu.Items.Add(item); m_MenuItems[text] = item; return(item); }
private void ContextMenu_MenuItem_MoveSourceUpOrDown(object sender, RoutedEventArgs e) { MenuItem mi = sender as MenuItem; if (mi == null) { return; } SourceItem selectedItem = this.ListView_Sources.SelectedItem as SourceItem; this.MoveSourceItemUpOrDown(selectedItem, (string)mi.Tag == "up"); }
/// <summary> /// 显示&隐藏桌面插件 /// </summary> private void WhetherToDisplay_Click(object sender, EventArgs e) { Dal dal = new Dal(); //状态 string state = string.Empty; try { System.Windows.Controls.MenuItem mi = (System.Windows.Controls.MenuItem)sender; state = mi.Tag.ToString(); } catch { try { MenuItem mi = (MenuItem)sender; state = mi.Tag.ToString(); } catch { } } if (state == "hide") { this.Visibility = Visibility.Hidden; //解决最小化到任务栏可以强行关闭程序的问题。 this.ShowInTaskbar = false;//使Form不在任务栏上显示 md.Display = 0; dal.SetData(md); if (Tips.Function == false) { Tips tp = new Tips("桌面插件已经隐藏~"); tp.Show(); } } else { this.Visibility = Visibility.Visible; //解决最小化到任务栏可以强行关闭程序的问题。 this.ShowInTaskbar = false;//使Form不在任务栏上显示 this.Activate(); md.Display = 1; dal.SetData(md); if (Tips.Function == false) { Tips tp = new Tips("桌面插件已经恢复显示~"); tp.Show(); } } }
private void Grid_MouseRightButtonDown(object sender, MouseButtonEventArgs e) { System.Windows.Controls.ContextMenu m = new System.Windows.Controls.ContextMenu(); System.Windows.Controls.MenuItem item = new System.Windows.Controls.MenuItem(); item.Header = "Configure..."; m.IsOpen = true; m.Items.Add(item); System.Windows.Controls.MenuItem item1 = new System.Windows.Controls.MenuItem(); item1.Header = "Exit"; m.Items.Add(item1); item1.Click += Item1_Click; item.Click += Item_Click; }
private void mLanguage_Loaded(object sender, RoutedEventArgs e) { mLanguage.Items.Clear(); List <String> languages = Languages.list(); foreach (String l in languages) { System.Windows.Controls.MenuItem item = new System.Windows.Controls.MenuItem { Header = l }; item.Click += new RoutedEventHandler(changeLanguage); mLanguage.Items.Add(item); } }
public void StartPlugin(System.Xml.Linq.XElement XSettings, IMainApp app, IWorkClass work) { App = app; Work = work; work.AddSpoofingAttributesOfObject(MapEditorTablePutList, ReplaceAttrForm); GetParams(); LoadMedCheckParams(); CalcCanSyncAutoMapWaybills(); if (CreationAllowedTasks()) { LoadOdh(); LoadTypes(); LoadZones(); System.Windows.Controls.MenuItem menuTasks = new System.Windows.Controls.MenuItem(); menuTasks.Header = "Задания"; System.Windows.Controls.MenuItem menuTasksMng = new System.Windows.Controls.MenuItem(); menuTasksMng.Header = "Управление заданиями"; menuTasksMng.Click += menuTasks_Click; menuTasks.Items.Add(menuTasksMng); System.Windows.Controls.MenuItem menuRoutesMng = new System.Windows.Controls.MenuItem(); menuRoutesMng.Header = "Управление маршрутами"; menuRoutesMng.Click += menuRoutesMng_Click; menuTasks.Items.Add(menuRoutesMng); work.MainForm.Menu(menuTasks); } var t = app.getTableInfoOfNameDB("v_employees"); if (t != null) { var write_259 = app.getTableRight(t.idTable); if (EmployeesSync.Url != null && write_259 != null && write_259.write) { work.AddMenuInTable(259, () => { ToolStripMenuItem menu = new ToolStripMenuItem("Синхронизация"); ToolStripMenuItem menu2 = new ToolStripMenuItem("Синхронизация c МедСервисом"); //menu2.Click += Employees_Sync; menu2.Click += menu2_Click; menu.DropDownItems.Add(menu2); return(menu); }); } } }
public static void OpenASavedPlaceTrigger(object sender, RoutedEventArgs e) { System.Windows.Controls.MenuItem item = sender as System.Windows.Controls.MenuItem; string savedPlaceDir = item.Header.ToString().Replace('/', '\\'); if (Directory.Exists(savedPlaceDir)) { OpenFolder(savedPlaceDir); } else { System.Windows.MessageBox.Show("This Folder does not exist! " + string.Format("({0})", savedPlaceDir), "ERROR"); } }
private void InitializeMenu() { var myMenu = new System.Windows.Controls.MenuItem() { Header = "FileLoader" }; // this one will be registered in region manager, after that event will be sent var regionManager = _serviceLocator.Resolve<RegionManager>(); var menuRegion = regionManager.GetRegion("mainMenu"); menuRegion.AddView(myMenu); regionManager.AttachRegion("FileLoaderMenu", myMenu); var region = regionManager.GetRegion("FileLoaderMenu"); var about = new System.Windows.Controls.MenuItem() { Header = "About" }; about.Click += (x, y) => System.Windows.Forms.MessageBox.Show("File Loader 1.0.1"); region.AddView(about); _eventAggregator.Publish(new FileLoaderMenuRegionRegisteredMessage("FileLoaderMenu")); }
public WPFLogger() : base() { listView = new ListView { MinHeight = 210 }; var copyText = new MenuItem { Header = "Copy" }; copyText.Click += OnCopy; var rc = new ContextMenu(); rc.Items.Add(copyText); listView.ContextMenu = rc; listView.SelectionMode = SelectionMode.Multiple; listView.CommandBindings.Add(new CommandBinding(ApplicationCommands.Copy, OnCopy)); listView.InputBindings.Add(new KeyBinding(ApplicationCommands.SelectAll, new KeyGesture(Key.A, ModifierKeys.Control))); listView.CommandBindings.Add(new CommandBinding(ApplicationCommands.SelectAll, (sender, args) => listView.SelectAll())); }
public Tray() { tbiField.Icon = Properties.Resources.Icon; tbiField.ToolTipText = "Программа работает"; tbiField.ContextMenu = new System.Windows.Controls.ContextMenu(); //List<System.Windows.Controls.MenuItem> myItems = new List<System.Windows.Controls.MenuItem>(); for (int i = 0; i < stringsContextMenuField.Length; i++) { System.Windows.Controls.MenuItem item = new System.Windows.Controls.MenuItem(); item.Header = stringsContextMenuField[i]; if (i == 0) item.Click += PostChange; if (i == 1) item.Click += stopTimer; if (i == 2) item.Click += Exit; tbiField.ContextMenu.Items.Add(item); } timerRun(); }
void tg_Area_VertexSelected(object sender, VertexSelectedEventArgs args) { if (args.MouseArgs.LeftButton == MouseButtonState.Pressed && tg_edgeMode.SelectedIndex == 1) { tg_Area.GenerateEdgesForVertex(args.VertexControl, (EdgesType)tg_edgeType.SelectedItem); } if (args.MouseArgs.RightButton == MouseButtonState.Pressed) { args.VertexControl.ContextMenu = new System.Windows.Controls.ContextMenu(); var menuitem = new System.Windows.Controls.MenuItem() { Header = "Delete item", Tag = args.VertexControl }; menuitem.Click += tg_deleteitem_Click; args.VertexControl.ContextMenu.Items.Add(menuitem); var str = new StringBuilder(); using (var writer = new StringWriter(str)) XamlWriter.Save(args.VertexControl.ContextMenu.Template, writer); Debug.Write(str); } }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); _contextMenu = (System.Windows.Controls.ContextMenu)this.FindResource("_notifierContextMenu"); _contextMenu.Items.Clear(); foreach (var device in _deviceNames) { var thisDevice = device; var menuItem = new System.Windows.Controls.MenuItem { Header = thisDevice.Name }; menuItem.Click += (a, b) => SetDefaultDevice(thisDevice.Id); _contextMenu.Items.Add(menuItem); } _icon = new NotifyIcon { ContextMenuStrip = new ContextMenuStrip(), Text = "Default Audio Device Switcher", Icon = Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location), Visible = true }; _icon.MouseClick += IconClicked; _icon.MouseDoubleClick += IconClicked; }
/// <summary> /// Setup the context menu for the results area. /// </summary> /// <history> /// [Curtis_Beard] 10/10/2012 Initial: 3575509, show copy/select all context menu /// [Curtis_Beard] 04/08/2015 CHG: changes for CustomTextEditor /// </history> private void AddContextMenuForResults() { var menu = new System.Windows.Controls.ContextMenu(); var item = new System.Windows.Controls.MenuItem(); item.Click += openFile_Click; item.Header = Language.GetGenericText("ResultsContextMenu.OpenFileCurrentLine"); item.IsEnabled = false; menu.Items.Add(item); menu.Items.Add(new System.Windows.Controls.Separator()); item = new System.Windows.Controls.MenuItem(); item.Click += copyItem_Click; item.Header = Language.GetGenericText("ResultsContextMenu.Copy"); menu.Items.Add(item); item = new System.Windows.Controls.MenuItem(); item.Header = Language.GetGenericText("ResultsContextMenu.SelectAll"); item.Click += selectAllItem_Click; menu.Items.Add(item); txtHits.ContextMenu = menu; txtHits.ContextMenuOpening += menu_ContextMenuOpening; }
/// <summary> /// Manually add ContextMenuOptions /// </summary> private void SetContextMenuOptions() { var cm = new System.Windows.Controls.ContextMenu(); TaskbarIcon.MenuActivation = PopupActivationMode.RightClick; TaskbarIcon.ContextMenu = cm; var m8 = new System.Windows.Controls.MenuItem { Header = "Upload collected data" }; m8.Click += (o, i) => UploadTrackedData(); if (Settings.IsUploadEnabled) TaskbarIcon.ContextMenu.Items.Add(m8); var m4 = new System.Windows.Controls.MenuItem { Header = "Open collected data" }; m4.Click += (o, i) => OpenDataExportDirectory(); TaskbarIcon.ContextMenu.Items.Add(m4); var m6 = new System.Windows.Controls.MenuItem { Header = "Settings" }; m6.Click += (o, i) => OpenSettings(); TaskbarIcon.ContextMenu.Items.Add(m6); var m2 = new System.Windows.Controls.MenuItem { Header = "Answer pop-up now" }; m2.Click += (o, i) => ManuallyStartUserSurvey(); if (_settings.IsUserEfficiencyTrackerEnabled()) TaskbarIcon.ContextMenu.Items.Add(m2); var m1 = new System.Windows.Controls.MenuItem { Header = "Show Retrospection" }; m1.Click += (o, i) => Retrospection.Handler.GetInstance().OpenRetrospection(); TaskbarIcon.ContextMenu.Items.Add(m1); #if DEBUG var m5 = new System.Windows.Controls.MenuItem { Header = "Show Retrospection (in browser)" }; m5.Click += (o, i) => Retrospection.Handler.GetInstance().OpenRetrospectionInBrowser(); TaskbarIcon.ContextMenu.Items.Add(m5); #endif var m3 = new System.Windows.Controls.MenuItem { Header = "Pause Tracker" }; m3.Click += (o, i) => PauseContinueTracker(m3); TaskbarIcon.ContextMenu.Items.Add(m3); _pauseContinueMenuItem = m3; var m7 = new System.Windows.Controls.MenuItem { Header = "Shutdown Tracker" }; m7.Click += (o, i) => Stop(true); TaskbarIcon.ContextMenu.Items.Add(m7); // Styling //var converter = new System.Windows.Media.BrushConverter(); //var brush = (System.Windows.Media.Brush)converter.ConvertFromString("#FFFFFF90"); //cm.Background = brush; //cm.Width = 200; //cm.Height = 100; //var style = App.Current.TryFindResource("SysTrayMenu"); //_taskbarIcon.ContextMenu = (System.Windows.Controls.ContextMenu)style; }
public MenuItemBackend() { item = new System.Windows.Controls.MenuItem (); }
public dynPython() { //add an edit window option to the //main context window var editWindowItem = new System.Windows.Controls.MenuItem(); editWindowItem.Header = "Edit..."; editWindowItem.IsCheckable = false; NodeUI.MainContextMenu.Items.Add(editWindowItem); editWindowItem.Click += new RoutedEventHandler(editWindowItem_Click); InPortData.Add(new PortData("IN", "Input", typeof(object))); OutPortData.Add(new PortData("OUT", "Result of the python script", typeof(object))); NodeUI.RegisterAllPorts(); //topControl.Height = 200; //topControl.Width = 300; NodeUI.UpdateLayout(); }
private void ShowGroundSelectAtomMenu(object sender,structTransportCommonProperty minDistAtom) { System.Windows.Application.Current.MainWindow.ContextMenu = null; // System.Windows.Controls.ContextMenu contextmenu = new System.Windows.Controls.ContextMenu(); contextmenu = new System.Windows.Controls.ContextMenu(); System.Windows.Controls.MenuItem miName = new System.Windows.Controls.MenuItem(); miName.Header = Properties.Resources.strNameColon + " " + minDistAtom.AtomName;///+ " " + minDistAtom.TextValue.Replace("_", "__"); ; miName.Focusable = false; contextmenu.Items.Add(miName); System.Windows.Controls.Separator Sp2 = new System.Windows.Controls.Separator(); contextmenu.Items.Add(Sp2); System.Windows.Controls.MenuItem miGroundMission = new System.Windows.Controls.MenuItem(); miGroundMission.Header = "Activity";// "Force Mission"; miGroundMission.Name = "miGroundMission"; miGroundMission.Tag = minDistAtom; miGroundMission.Click += new System.Windows.RoutedEventHandler(mnuGroundMission_Click); contextmenu.Items.Add(miGroundMission); System.Windows.Controls.MenuItem miMove = new System.Windows.Controls.MenuItem(); miMove.Header = Properties.Resources.strMove; // "Move"; miMove.Tag = minDistAtom; miMove.Name = "mnuMove"; miMove.Click += miMove_Click; // new System.Windows.RoutedEventHandler(mnuMove_Click); contextmenu.Items.Add(miMove); if(VMMainViewModel.Instance.CurrentGameStatus!= typGamestatus.EDIT_STATUS) { miMove.IsEnabled = false; } System.Windows.Controls.MenuItem miDeleteAtom = new System.Windows.Controls.MenuItem(); miDeleteAtom.Header = Properties.Resources.strUndeploy;// Properties.Resources.strDelete; miDeleteAtom.Name = "miDeleteAtom"; miDeleteAtom.Tag = minDistAtom; miDeleteAtom.Click += miDeleteAtom_Click; contextmenu.Items.Add(miDeleteAtom); // System.Windows.Application.Current.MainWindow.ContextMenu = new System.Windows.Controls.ContextMenu(); System.Windows.Application.Current.MainWindow.ContextMenu = contextmenu; contextmenu.Visibility = Visibility.Visible; System.Windows.Application.Current.MainWindow.ContextMenu.Visibility = Visibility.Visible; System.Windows.Application.Current.MainWindow.ContextMenu.IsOpen = true; // System.Windows.Application.Current.MainWindow.ContextMenu.Width = 1000; }
void MapOnRightClickWPF(object sender, MapMouseEventArgsWPF e) { double SearchRadius = 2000; double SearchNeiborRadiuse = 200; double minDistance = double.MaxValue; structTransportCommonProperty minDistAtom = null; List<structTransportCommonProperty> NeighborList = new List<structTransportCommonProperty>(); double resolution = 0; double zoom = VMMainViewModel.Instance.MyMainMap.Zoom; //* Math.Cos(TerrainService.MathEngine.DegreesToRadians(e.MapYLongLatWGS84)) resolution = (156543) / Math.Pow(2, zoom); SearchNeiborRadiuse = resolution * 10; System.Windows.Application.Current.MainWindow.ContextMenu = null; // System.Windows.Controls.ContextMenu contextmenu = new System.Windows.Controls.ContextMenu(); // if (VMMainViewModel.Instance.currSelectionType == enSelection.Ground) { minDistance = double.MaxValue; if (VMMainViewModel.Instance.colGroundAtoms != null) { foreach (structTransportCommonProperty Tr in VMMainViewModel.Instance.colGroundAtoms.Values) { double Distance = Utilites.GreatCircleDistance(Tr.X, Tr.Y, e.MapXLongLatWGS84, e.MapYLongLatWGS84); if (Distance < minDistance && Distance > 0) { minDistance = Distance; minDistAtom = Tr; } } } } SelectMenu = new System.Windows.Controls.ContextMenu(); SelectMenu.Style = null; DPoint coordinates = new DPoint(e.MapXLongLatWGS84, e.MapYLongLatWGS84); // add menu item for adding barriers System.Windows.Controls.MenuItem mBarrier = new System.Windows.Controls.MenuItem(); mBarrier.Header = "Add Barrier"; mBarrier.Tag = coordinates; mBarrier.Click += miAddBarier_Click; SelectMenu.Items.Add(mBarrier); System.Windows.Controls.MenuItem mCoordinates = new System.Windows.Controls.MenuItem(); mCoordinates.Header = e.MapXLongLatWGS84.ToString() + " " + e.MapYLongLatWGS84.ToString(); mCoordinates.Tag = coordinates; mCoordinates.Click += miCoordinates_Click; SelectMenu.Items.Add(mCoordinates); System.Windows.Application.Current.MainWindow.ContextMenu = SelectMenu; //if (minDistAtom != null && minDistance < SearchRadius) // { // //Create PopUP menu // if (minDistAtom.AtomClass == "TDSServer.GroundTask.clsGroundAtom") // { // foreach (structTransportCommonProperty Tr in VMMainViewModel.Instance.colGroundAtoms.Values) // { // double Distance = TerrainService.MathEngine.CalcDistanceForPerformance(Tr.X, Tr.Y, minDistAtom.X, minDistAtom.Y); // if (Distance <= SearchNeiborRadiuse) // { // NeighborList.Add(Tr); // } // } // if (NeighborList.Count==1) // { // ShowGroundSelectAtomMenu(null, minDistAtom); // } // else // { // // System.Windows.Controls.ContextMenu SelectMenu = new System.Windows.Controls.ContextMenu(); // SelectMenu = new System.Windows.Controls.ContextMenu(); // SelectMenu.Style = null; // for (int i = 0; i < NeighborList.Count; i++) // { // // System.Windows.Controls.MenuItem mSelectGroundAtom = new System.Windows.Controls.MenuItem(); // // mSelectGroundAtom.Style = null; // System.Windows.Controls.MenuItem mSelectGroundAtom = new System.Windows.Controls.MenuItem(); // mSelectGroundAtom.Header = NeighborList[i].AtomName; // mSelectGroundAtom.Tag = NeighborList[i]; // mSelectGroundAtom.Focusable = false; // mSelectGroundAtom.Click += miName_Click; // SelectMenu.Items.Add(mSelectGroundAtom); // } // System.Windows.Application.Current.MainWindow.ContextMenu = SelectMenu; // return; // } // } // } }
public System.Collections.ICollection BuildItems(Codon codon, object owner) { RecentOpen recentOpen = FileService.RecentOpen; if (recentOpen.RecentProject.Count > 0) { var items = new System.Windows.Controls.MenuItem[recentOpen.RecentProject.Count]; for (int i = 0; i < recentOpen.RecentProject.Count; ++i) { // variable inside loop, so that anonymous method refers to correct recent file string recentProject = recentOpen.RecentProject[i]; string accelaratorKeyPrefix = i < 10 ? "_" + ((i + 1) % 10) + " " : ""; items[i] = new System.Windows.Controls.MenuItem() { Header = accelaratorKeyPrefix + recentProject }; items[i].Click += delegate { // Original SharpDevelop: ProjectService.LoadSolution(recentProject); FileUtility.ObservedLoad(new NamedFileOperationDelegate(fileName => Current.ProjectService.OpenProject(fileName, false)), recentProject); }; } return items; } else { return new[] { new System.Windows.Controls.MenuItem { Header = StringParser.Parse("${res:Dialog.Componnents.RichMenuItem.NoRecentProjectsString}"), IsEnabled = false } }; } /* if (recentOpen.RecentProject.Count > 0) { MenuCommand[] items = new MenuCommand[recentOpen.RecentProject.Count]; for (int i = 0; i < recentOpen.RecentProject.Count; ++i) { string accelaratorKeyPrefix = i < 10 ? "&" + ((i + 1) % 10) + " " : ""; items[i] = new MenuCommand(accelaratorKeyPrefix + recentOpen.RecentProject[i], new EventHandler(LoadRecentProject)); items[i].Tag = recentOpen.RecentProject[i].ToString(); items[i].Description = StringParser.Parse(ResourceService.GetString("Dialog.Componnents.RichMenuItem.LoadProjectDescription"), new string[,] { { "PROJECT", recentOpen.RecentProject[i].ToString() } }); } return items; } MenuCommand defaultMenu = new MenuCommand("${res:Dialog.Componnents.RichMenuItem.NoRecentProjectsString}"); defaultMenu.Enabled = false; return new MenuCommand[] { defaultMenu }; */ }
public override void SetupCustomUIElements(Controls.dynNodeView nodeUI) { string[] serialPortNames = System.IO.Ports.SerialPort.GetPortNames(); foreach (string portName in serialPortNames) { if (lastComItem != null) { lastComItem.IsChecked = false; // uncheck last checked item } comItem = new System.Windows.Controls.MenuItem(); comItem.Header = portName; comItem.IsCheckable = true; comItem.IsChecked = true; comItem.Checked += new System.Windows.RoutedEventHandler(comItem_Checked); nodeUI.MainContextMenu.Items.Add(comItem); port.PortName = portName; lastComItem = comItem; } }
void comItem_Checked(object sender, System.Windows.RoutedEventArgs e) { System.Windows.Controls.MenuItem comItem = e.Source as System.Windows.Controls.MenuItem; if (lastComItem != null) { lastComItem.IsChecked = false; // uncheck last checked item } if (port != null) { if (port.IsOpen) port.Close(); } port.PortName = comItem.Header.ToString(); comItem.IsChecked = true; lastComItem = comItem; }
public void RequestToCreateHandle() { this.ItemHandle = new Views.UserControl1().hoge; }
public MenuItem() { C = new System.Windows.Controls.MenuItem(); }
public override void SetupCustomUIElements(Controls.dynNodeView nodeUI) { //topControl.Height = 200; //topControl.Width = 300; //add an edit window option to the //main context window var editWindowItem = new System.Windows.Controls.MenuItem(); editWindowItem.Header = "Edit..."; editWindowItem.IsCheckable = false; nodeUI.MainContextMenu.Items.Add(editWindowItem); editWindowItem.Click += new RoutedEventHandler(editWindowItem_Click); nodeUI.UpdateLayout(); nodeUI.MouseDown += new MouseButtonEventHandler(nodeUI_MouseDown); }
public System.Collections.ICollection BuildItems(Codon codon, object owner) { var ctrl = Current.Workbench.ActiveViewContent as Altaxo.Gui.SharpDevelop.SDGraph3DViewContent; if (null == ctrl) return null; var activeLayer = ctrl.Controller.ActiveLayer as XYZPlotLayer; if (null == activeLayer) return null; int actPA = ctrl.Controller.CurrentPlotNumber; int len = activeLayer.PlotItems.Flattened.Length; var items = new System.Collections.ArrayList(); for (int i = 0; i < len; i++) { IGPlotItem pa = activeLayer.PlotItems.Flattened[i]; var item = new System.Windows.Controls.MenuItem() { Header = pa.ToString() }; item.Click += EhWpfMenuItem_Clicked; item.IsChecked = (i == actPA); item.Tag = i; items.Add(item); } return items; }
/** Note Event Handling **/ // Very important functions happen during note taking: // Every submittal saves the note to disk (data is always safe) // Type of note can be changed easily at all times, by pressing up/down private void NoteContent_KeyUp(object sender, System.Windows.Input.KeyEventArgs e) { int notesLenght = currentSession.noteTypes.Length - 1; //TWITTER!!!! // Updates the Character Counter if current stage is notes and Twitter is enabled. if (currentStage == sessionStartingStage.notes && TwitterAddon.twitter) { if (e.Key == Key.Left || e.Key == Key.Right) { // Ignore if pressing left or right key } else { CharCounter(); } } // 1) Up/Down // 2) Enter // 3) Esc // TODO: Ctrl--, Ctrl-+, Ctrl-S, Crl-N // 1) // Up and Down cycles through the note types if ((e.Key == Key.Down || e.Key == Key.Up) && currentStage == sessionStartingStage.notes) { // Algorithm is spelled out: If at end, forward goes to beginning, if at beginning back goes to end, step by 1 otherwise. if (e.Key == Key.Up) { prevNoteType = currentNoteType; if (currentNoteType > 0) { currentNoteType--; } else { currentNoteType = notesLenght; } if (nextNoteType > 0) { nextNoteType--; } else { nextNoteType = notesLenght; } } else if (e.Key == Key.Down) { nextNoteType = currentNoteType; if (currentNoteType < notesLenght) { currentNoteType++; } else { currentNoteType = 0; } if (prevNoteType < notesLenght) { prevNoteType++; } else { prevNoteType = 0; } } Logger.record("\t[NoteContent_KeyUp]: Changing note to " + currentSession.noteTypes[currentNoteType], "SMWidget", "info"); NoteType.Text = currentSession.noteTypes[currentNoteType] + ":"; prevType.Text = "↓ " + currentSession.noteTypes[prevNoteType] + ":"; nextType.Text = "↑ " + currentSession.noteTypes[nextNoteType] + ":"; // Updates Character Counter if Twitter is enabled. if (TwitterAddon.twitter) { CharCounter(); } } // 2) // Enter keys accept the note into the report else if (e.Key == Key.Enter) { //TWITTER!! // Disables Twitter if Twitter PIN is left blank. if (e.Key == Key.Enter && currentStage == sessionStartingStage.twitterAccount && NoteContent.Text.Trim().Length == 0) { TwitterAddon.twitter = false; StateMove(sessionStartingStage.tester); } // Ignore empty inputs if (e.Key == Key.Enter && NoteContent.Text.Trim().Length != 0) { Logger.record("\t[NoteContent_KeyUp]: Enter pressed...", "SMWidget", "info"); //TWITTER!! if (currentStage == sessionStartingStage.twitterAccount) { currentSession.twitterAccount = NoteContent.Text.Replace("\"", "''").Replace(",", ";").Trim(); TwitterAddon.twitterPIN = currentSession.twitterAccount; if (TwitterAddon.twitterPIN.Length != 7) { MessageBox.Show("Invalid pin. Try again later.", "Error"); return; } TwitterAddon.TwitterOAuth(); FlickrInlogg.IsEnabled = true; StateMove(sessionStartingStage.tester); } else if (currentStage == sessionStartingStage.tester) { currentSession.tester = NoteContent.Text.Replace("\"", "''").Replace(",", ";").Trim(); StateMove(sessionStartingStage.charter); } else if (currentStage == sessionStartingStage.charter) { currentSession.charter = NoteContent.Text.Replace("\"", "''").Replace(",", ";").Trim(); StateMove(sessionStartingStage.notes); } else { // What we do when adding a note: // - 1) We add to the session notes // - 2) We add to the history context menu // - 3) We clear notes and attachments to make place for new ones /*1*/ currentSession.UpdateNotes(currentNoteType, NoteContent.Text.Replace("\"", "''").Replace(",", ";").Trim(), screenshotName, rtfNoteName); /*2*/ System.Windows.Controls.MenuItem item = new System.Windows.Controls.MenuItem(); item.Header = NoteContent.Text; item.Click += delegate { GetHistory(item.Header.ToString()); }; NoteHistory.Items.Add(item); NoteHistory.Visibility = Visibility.Visible; Logger.record("\t\t[NoteContent_KeyUp]: Note added.", "SMWidget", "info"); } /*3*/ ClearNote(); } } // 3) // Escape key cancels the note, cancels the note attachments else if (e.Key == Key.Escape)// This was here before, seems like not needed: && currentStage == sessionStartingStage.notes) { Logger.record("[NoteContent_KeyUp]: (note aborted)", "SMWidget", "info"); ClearNote(); } }
/// <summary> /// Helper method that builds the card view's context menu /// </summary> private void BuildContextMenu() { contextMenu.Opened += OnContextMenuOpen; System.Windows.Controls.MenuItem select = new System.Windows.Controls.MenuItem(); select.Header = "Select Highlighted Item"; select.Name = "SelectItem"; select.Click += OnSelectItemClicked; contextMenu.Items.Add(select); System.Windows.Controls.MenuItem deselect = new System.Windows.Controls.MenuItem(); deselect.Header = "Deselect Item"; deselect.Name = "DeselectItem"; deselect.Click += OnDeselectItemClicked; contextMenu.Items.Add(deselect); contextMenu.Items.Add(new System.Windows.Controls.Separator()); System.Windows.Controls.MenuItem addImage = new System.Windows.Controls.MenuItem(); addImage.Header = "Add Image"; addImage.InputGestureText = "Ctrl-I"; addImage.Name = "AddImage"; addImage.Click += OnAddImageClicked; contextMenu.Items.Add(addImage); System.Windows.Controls.MenuItem addText = new System.Windows.Controls.MenuItem(); addText.Header = "Add Text Item"; addText.InputGestureText = "Ctrl-T"; addText.Name = "AddText"; addText.Click += OnAddTextClicked; contextMenu.Items.Add(addText); System.Windows.Controls.MenuItem addQsosBox = new System.Windows.Controls.MenuItem(); addQsosBox.Header = "Add Qsos Box"; addQsosBox.Name = "AddQsosBox"; addQsosBox.Click += OnAddQsosBoxClicked; contextMenu.Items.Add(addQsosBox); contextMenu.Items.Add(new System.Windows.Controls.Separator()); System.Windows.Controls.MenuItem deleteItem = new System.Windows.Controls.MenuItem(); deleteItem.Header = "Delete Selected Item"; deleteItem.InputGestureText = "Delete"; deleteItem.Name = "DeleteItem"; deleteItem.Click += OnDeleteItemClicked; contextMenu.Items.Add(deleteItem); System.Windows.Controls.MenuItem clearBackground = new System.Windows.Controls.MenuItem(); clearBackground.Header = "Clear Background Image"; clearBackground.InputGestureText = "Ctrl-Delete"; clearBackground.Name = "ClearBackgroundItem"; clearBackground.Click += OnClearBackgroundClicked; contextMenu.Items.Add(clearBackground); }
public override void SetupCustomUIElements(object ui) { var nodeUI = ui as dynNodeView; //topControl.Height = 200; //topControl.Width = 300; //add an edit window option to the //main context window var editWindowItem = new System.Windows.Controls.MenuItem { Header = "Edit...", IsCheckable = false }; nodeUI.MainContextMenu.Items.Add(editWindowItem); editWindowItem.Click += delegate { EditScriptContent(); }; nodeUI.UpdateLayout(); nodeUI.MouseDown += new MouseButtonEventHandler(nodeUI_MouseDown); }
void Items_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Add) { foreach (var a in e.NewItems) { var mi = new System.Windows.Controls.MenuItem() { Tag = a }; if (!string.IsNullOrEmpty(DisplayProperty)) { PropertyInfo displayInfo = a.GetType().GetProperty(DisplayProperty); mi.Header = displayInfo.GetValue(a, null); } else { mi.Header = a.ToString(); } mi.FontSize = 20; mi.FontFamily = new FontFamily("Segoe360"); Items.Add(mi); mi.Click += MiClick; mi.TouchDown += MiClick; } } }
public override void SetupCustomUIElements(object ui) { var nodeUI = ui as dynNodeView; //topControl.Height = 200; //topControl.Width = 300; //add an edit window option to the //main context window var editWindowItem = new System.Windows.Controls.MenuItem { Header = "Edit...", IsCheckable = false }; nodeUI.MainContextMenu.Items.Add(editWindowItem); editWindowItem.Click += new RoutedEventHandler(editWindowItem_Click); nodeUI.UpdateLayout(); nodeUI.MouseDown += new MouseButtonEventHandler(nodeUI_MouseDown); base.SetupCustomUIElements(nodeUI); // call the base class method to setup the +/- buttons }
public void AddMenuItems(string[] headers) { foreach (var header in headers) { var miRemove = new System.Windows.Controls.MenuItem { Header = header, Tag = header, FontFamily = new FontFamily("Segoe360"), FontSize = 20 }; miRemove.Click += miRemove_Click; Items.Add(miRemove); } }