public FrameworkElement CreateWidgetControl(IDiagram widgetViewModel, ContextMenu contextMenu)
        {
            var buttonHolder = widgetViewModel as TicketExplorerViewModel;

            var ret = new TicketExplorerView { DataContext = buttonHolder, ContextMenu = contextMenu };

            var heightBinding = new Binding("Height") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var widthBinding = new Binding("Width") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var xBinding = new Binding("X") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var yBinding = new Binding("Y") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var radiusBinding = new Binding("CornerRadius") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var buttonColorBinding = new Binding("ButtonColor") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var enabledBinding = new Binding("IsEnabled") { Source = buttonHolder, Mode = BindingMode.OneWay };
            var transformBinding = new Binding("RenderTransform") { Source = buttonHolder, Mode = BindingMode.OneWay };

            ret.SetBinding(InkCanvas.LeftProperty, xBinding);
            ret.SetBinding(InkCanvas.TopProperty, yBinding);
            ret.SetBinding(FrameworkElement.HeightProperty, heightBinding);
            ret.SetBinding(FrameworkElement.WidthProperty, widthBinding);
            //ret.SetBinding(FlexButton.FlexButton.CornerRadiusProperty, radiusBinding);
            //ret.SetBinding(FlexButton.FlexButton.ButtonColorProperty, buttonColorBinding);
            //ret.SetBinding(UIElement.RenderTransformProperty, transformBinding);
            //ret.SetBinding(UIElement.IsEnabledProperty, enabledBinding);

            return ret;
        }
        public FrameworkElement CreateWidgetControl(IDiagram widgetViewModel, ContextMenu contextMenu)
        {
            var buttonHolder = widgetViewModel as EntityButtonWidgetViewModel;

            var ret = new FlexButton.FlexButton { DataContext = buttonHolder, ContextMenu = contextMenu, CommandParameter = buttonHolder };

            var heightBinding = new Binding("Height") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var widthBinding = new Binding("Width") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var xBinding = new Binding("X") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var yBinding = new Binding("Y") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var captionBinding = new Binding("Settings.Caption") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var radiusBinding = new Binding("CornerRadius") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var buttonColorBinding = new Binding("ButtonColor") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var commandBinding = new Binding("ItemClickedCommand") { Source = buttonHolder, Mode = BindingMode.OneWay };
            var enabledBinding = new Binding("IsEnabled") { Source = buttonHolder, Mode = BindingMode.OneWay };
            var rotateTransform = new Binding("RotateTransform") { Source = buttonHolder, Mode = BindingMode.OneWay };

            ret.SetBinding(InkCanvas.LeftProperty, xBinding);
            ret.SetBinding(InkCanvas.TopProperty, yBinding);
            ret.SetBinding(FrameworkElement.HeightProperty, heightBinding);
            ret.SetBinding(FrameworkElement.WidthProperty, widthBinding);
            ret.SetBinding(ContentControl.ContentProperty, captionBinding);
            ret.SetBinding(FlexButton.FlexButton.CornerRadiusProperty, radiusBinding);
            ret.SetBinding(FlexButton.FlexButton.ButtonColorProperty, buttonColorBinding);
            ret.SetBinding(ButtonBase.CommandProperty, commandBinding);
            ret.SetBinding(FrameworkElement.LayoutTransformProperty, rotateTransform);
            //ret.SetBinding(UIElement.IsEnabledProperty, enabledBinding);

            return ret;
        }
Beispiel #3
0
        /// <summary>
        /// Returns a context menu containing commands with commandTags</summary>
        /// <param name="commandTags">Command tags for commands to include on menu</param>
        /// <returns>ContextMenu</returns>
        public ContextMenu GetContextMenu(IEnumerable<object> commandTags)
        {
            m_commandService.SuggestRequery();

            var menu = new ContextMenu();
            menu.SetResourceReference(ContextMenu.StyleProperty, Resources.MenuStyleKey);
            //menu.Style = (Style)Application.Current.FindResource(Resources.MenuStyleKey);

            // Generate view model
            List<ICommandItem> commands = new List<ICommandItem>();
            foreach (var tag in commandTags)
            {
                var command = m_commandService.GetCommand(tag);
                if (command != null)
                {
                    if (!AutoCompact || ((ICommand)command).CanExecute(command))
                        commands.Add(command);
                }
            }
            commands.Sort(new CommandComparer());

            var dummyRootMenu = new Sce.Atf.Wpf.Models.Menu(null, null, null, null, null);
            foreach (var command in commands)
                MenuUtil.BuildSubMenus(command, dummyRootMenu);

            MenuUtil.InsertGroupSeparators(dummyRootMenu);
            menu.ItemsSource = dummyRootMenu.ChildCollection;

            return menu;
        }
Beispiel #4
0
		public ContextMenu XFERContextMenu(){
			if (_XFERContextMenu == null){
				_XFERContextMenu = new ContextMenu();
				_XFERContextMenu.Opened += XFERContextMenuOpened;
			}
			return _XFERContextMenu;
		}
        public static void DefineContextMenu(this InkCanvas canvas)
        {
            var contextMenu = new ContextMenu();
            if (DesignerMainWindow.GetInstance().GetCurrentSlide().Type == SlideType.Empty)
            {
                contextMenu.Items.Add(ContextMenuItems.CanvasSwitchable(canvas.SetNavigable, canvas.IsNavigable()));
                if (canvas.Children.Count == 0)
                {
                    if (DesignerMainWindow.GetInstance().GetCurrentSlideNr() > 0)
                        contextMenu.Items.Add(ContextMenuItems.CanvasCopyChosenSlide(canvas.CopyChosenSlide));
                    contextMenu.Items.Add(new Separator());
                    contextMenu.Items.Add(ContextMenuItems.CanvasAddPhotoalbumSlide(canvas.AddPhotoalbumSlide));
                    contextMenu.Items.Add(ContextMenuItems.CanvasAddFindObjectSlide(canvas.AddFindObjectSlide));
                }
                contextMenu.Items.Add(new Separator());
            }

            contextMenu.Items.Add(ContextMenuItems.CanvasAddImage(Picture.AddPictureToCanvas));
            contextMenu.Items.Add(ContextMenuItems.CanvasAddText(Text.AddTextToCanvas));
            contextMenu.Items.Add(ContextMenuItems.CanvasAddSound(Sound.AddSoundToCanvas));
            contextMenu.Items.Add(ContextMenuItems.CanvasAddVideo(Video.AddVideoToCanvas));
            contextMenu.Items.Add(ContextMenuItems.CanvasAddFlash(FlashAnimation.AddFlashToCanvas));
            contextMenu.Items.Add(ContextMenuItems.CanvasAddArea(new Area().AddAreaToCanvas));
            Practice.ReduceObjectIdByOne(); //mini hack - new Area() enlarges object id.
            contextMenu.Items.Add(new Separator());

            contextMenu.Items.Add(ContextMenuItems.CanvasChangeBackground(canvas.AddBackground));
            contextMenu.Items.Add(new Separator());
            contextMenu.Items.Add(ContextMenuItems.CanvasPaste(CopyPastableExtensions.PasteElement,
                                                                      CopyPastableExtensions.ClipboardEmpty()));
            contextMenu.IsOpen = true;
        }
        public FrameworkElement CreateWidgetControl(IDiagram widgetViewModel, ContextMenu contextMenu)
        {
            var buttonHolder = widgetViewModel as DefaultWidgetViewModel;
            var brd = new Border
                          {
                              DataContext = buttonHolder,
                              ContextMenu = contextMenu,
                              BorderBrush = System.Windows.Media.Brushes.Gray,
                              Background = System.Windows.Media.Brushes.White
                          };

            var ret = new Button { DataContext = buttonHolder, ContextMenu = contextMenu, Content = "New Widget" };

            brd.Child = ret;

            var heightBinding = new Binding("Height") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var widthBinding = new Binding("Width") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var xBinding = new Binding("X") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var yBinding = new Binding("Y") { Source = buttonHolder, Mode = BindingMode.TwoWay };
            var transformBinding = new Binding("RenderTransform") { Source = buttonHolder, Mode = BindingMode.OneWay };

            brd.SetBinding(InkCanvas.LeftProperty, xBinding);
            brd.SetBinding(InkCanvas.TopProperty, yBinding);
            brd.SetBinding(FrameworkElement.HeightProperty, heightBinding);
            brd.SetBinding(FrameworkElement.WidthProperty, widthBinding);
            brd.SetBinding(UIElement.RenderTransformProperty, transformBinding);

            return brd;
        }
 private static void AddMenuItem(ContextMenu menu, string text, string shortcut, EventHandler handler)
 {
     var item = new MenuItem();
     item.Header = text;
     item.Click += (s, e) => handler(s, e);
     menu.Items.Add(item);
 }
 private ContextMenu VideoCM()
 {
     var cm = new ContextMenu();
     cm.Items.Add(ContextMenuItems.Play(PlayVideo));
     cm.Items.Add(ContextMenuItems.Stop(StopVideo));
     return cm;
 }
        private void AddImageToEditPanel(string filename, BitmapImage bimage)
        {
            Image image = new Image();
            image.Margin = new Thickness(0, 5, 10, 5);
            image.MaxHeight = 150;
            image.MaxWidth = 150;
            image.Name = "QImage" + ImagesCount.ToString();
            RegisterName(image.Name, image);
            if (filename != null)
            {
                image.Source = new BitmapImage(new Uri(filename));
            }
            else
            {
                image.Source = bimage;
            }
            ContextMenu contextmenu = new ContextMenu();
            MenuItem delete = new MenuItem();
            delete.Header = "Delete";
            delete.Tag = ImagesCount.ToString();
            delete.Click += AddQRemoveImageCMClicked;
            contextmenu.Items.Add(delete);
            image.ContextMenu = contextmenu;

            ImagesStackPanel.Children.Add(image);
            ImageDictionary.Add(ImagesCount, image.Name);
            ImagesCount++;
        }
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			var converted = (Status)value;
			var links = (IEnumerable<object>)linkConverter.Convert(value, typeof(IEnumerable<object>), null, culture);
			var items = this.Items == null
				? links
				: links != null && links.Any()
					? links.Append(new Separator()).Concat(this.Items.Cast<object>())
					: this.Items.Cast<object>();
			var ctx = new ContextMenu();

			ctx.Opened += (sender, e) =>
			{
				ctx.Items.Clear();

				foreach (var i in items)
				{
					if (i is Control &&
						((Control)i).Parent != null)
						((ItemsControl)((Control)i).Parent).Items.Remove(i);

					ctx.Items.Add(i);
				}
			};
			ctx.Closed += (sender, e) => ctx.Items.Clear();

			return ctx;
		}
Beispiel #11
0
 public void CloseAndSelect(ContextMenu menu, MenuItem menuItem)
 {
     menu.IsOpen = false;
     TabItem newCurrent = menuItem.Tag as TabItem;
     newCurrent.BringIntoView();
     newCurrent.IsSelected = true;
 }
        public TranslationAdornment(SnapshotSpan span, TranslationRequest request, Size viewportSize)
        {
            Span = span.Snapshot.CreateTrackingSpan(span, SpanTrackingMode.EdgeExclusive);
            Request = request;
            Request.TranslationComplete += request_TranslationComplete;

            InitializeComponent();
            DataContext = this;

            SetMaxSize(viewportSize);

            _menu = spListBox.ContextMenu;
            _menu.KeyUp += (sender, args) =>
            {
                if (args.Key == Key.Left || args.Key == Key.Escape)
                {
                    CloseMenu();
                }
            };
            _menu.Opened += (sender, args) => { _closeMenuRequested = false; };
            _menu.Closed += (sender, args) => { _ignoreItemCommand = !_closeMenuRequested; };

            ItemCommand = new RelayCommand<ItemCommandParameter>(ItemCommandExecute);
            ItemOptionsCommand = new RelayCommand<ItemCommandParameter>(ItemOptionsCommandExecute);
            MenuCommand = new RelayCommand<MenuItem>(MenuCommandExecute);
        }
Beispiel #13
0
        protected void AddContextMenu()
        {
            ContextMenu mainMenu = new ContextMenu();

            MenuItem item1 = new MenuItem() { Header = "Copy to Clipboard" };
            mainMenu.Items.Add(item1);

            MenuItem item1a = new MenuItem();
            item1a.Header = "96 dpi";
            item1.Items.Add(item1a);
            item1a.Click += OnClipboardCopy_96dpi;

            MenuItem item1b = new MenuItem();
            item1b.Header = "300 dpi";
            item1.Items.Add(item1b);
            item1b.Click += OnClipboardCopy_300dpi;

            MenuItem item1c = new MenuItem() { Header = "Enhanced Metafile" }; ;
            item1.Items.Add(item1c);
            item1c.Click += CopyToEMF;

            //MenuItem item2 = new MenuItem() { Header = "Print..." };
            //mainMenu.Items.Add(item2);
            //item2.Click += InvokePrint;
            windowsFormsHost.ContextMenu = mainMenu;
        }
        public OptionsMenu()
        {
            InitializeComponent();

            ContextMenu = new ContextMenu();
            button.Click += (s, e) => ShowOptions();
        }
        public FrameworkElement CreateWidgetControl(IDiagram widget, ContextMenu contextMenu)
        {
            var viewModel = widget as EntityGridWidgetViewModel;
            Debug.Assert(viewModel != null);

            if (widget.DesignMode)
            {
                viewModel.RefreshSync();
                foreach (var entityScreenItemViewModel in viewModel.ResourceSelectorViewModel.EntityScreenItems)
                {
                    entityScreenItemViewModel.IsEnabled = false;
                }

            }

            var ret = new EntitySelectorView(viewModel.ResourceSelectorViewModel) { DataContext = viewModel.ResourceSelectorViewModel, ContextMenu = contextMenu, Tag = widget };

            var heightBinding = new Binding("Height") { Source = viewModel, Mode = BindingMode.TwoWay };
            var widthBinding = new Binding("Width") { Source = viewModel, Mode = BindingMode.TwoWay };
            var xBinding = new Binding("X") { Source = viewModel, Mode = BindingMode.TwoWay };
            var yBinding = new Binding("Y") { Source = viewModel, Mode = BindingMode.TwoWay };

            ret.SetBinding(InkCanvas.LeftProperty, xBinding);
            ret.SetBinding(InkCanvas.TopProperty, yBinding);
            ret.SetBinding(FrameworkElement.HeightProperty, heightBinding);
            ret.SetBinding(FrameworkElement.WidthProperty, widthBinding);

            return ret;
        }
    private void AttachContextMenu(object sender, MouseButtonEventArgs e) {
      //this is PreviewMouseRightButtonDown on StackPanel in TreeView
      e.Handled = true;
      StackPanel stackPanel = (StackPanel) sender;
      object item = stackPanel.DataContext;

      if (stackPanel.ContextMenu != null) return;
      ContextMenu menu = new ContextMenu {Tag = item};

      switch (item.GetType().Name) {
        case nameof(ViewModel.Folders): {
          menu.Items.Add(new MenuItem {Command = (ICommand) Resources["FolderAdd"], CommandParameter = item});
          break;
        }
        case nameof(ViewModel.Folder): {
          if (((ViewModel.Folder) item).Parent == null) {
            menu.Items.Add(new MenuItem {Command = (ICommand) Resources["FolderRemove"], CommandParameter = item});
          }
          break;
        }
      }

      if (menu.Items.Count > 0)
        stackPanel.ContextMenu = menu;
    }
Beispiel #17
0
		public DesignerCanvas(PlanDesignerViewModel planDesignerViewModel)
			: base(ServiceFactoryBase.Events)
		{
			GridLineController = new GridLineController(this);
			RemoveGridLinesCommand = new RelayCommand(OnRemoveGridLinesCommand);
			PlanDesignerViewModel = planDesignerViewModel;
			Toolbox = new ToolboxViewModel(this);
			ServiceFactoryBase.DragDropService.DragOver += OnDragServiceDragOver;
			ServiceFactoryBase.DragDropService.Drop += OnDragServiceDrop;
			PainterCache.Initialize(ServiceFactoryBase.ContentService.GetBitmapContent, ServiceFactoryBase.ContentService.GetDrawing);
			Width = 100;
			Height = 100;
			Focusable = false;
			DesignerSurface.AllowDrop = true;
			
			var menuItem = DesignerCanvasHelper.BuildMenuItem(
				"Вставить (Ctrl+V)", 
				"pack://application:,,,/Controls;component/Images/BPaste.png", 
				PlanDesignerViewModel.PasteCommand
			);
			menuItem.CommandParameter = this;
			var pasteItem = menuItem;

			ContextMenu = new ContextMenu();
			ContextMenu.HasDropShadow = false;
			ContextMenu.Items.Add(pasteItem);
			_moveAdorner = new MoveAdorner(this);
		}
        public MainWindow()
        {
            // ColorBrewer2 Set1
            defaultColors.Add(Color.FromRgb(228, 26, 28));
            defaultColors.Add(Color.FromRgb(55, 126, 184));
            defaultColors.Add(Color.FromRgb(77, 175, 74));
            defaultColors.Add(Color.FromRgb(152, 78, 163));
            defaultColors.Add(Color.FromRgb(255, 127, 0));
            defaultColors.Add(Color.FromRgb(255, 255, 51));
            defaultColors.Add(Color.FromRgb(166, 86, 40));
            defaultColors.Add(Color.FromRgb(247, 129, 191));
            defaultColors.Add(Color.FromRgb(153, 153, 153));

            LoadCellGroups();
            this.InitializeComponent();

            // Insert code required on object creation below this point.
            // Setting default color picker style
            colorMenu = (ContextMenu)(this.Resources["leftClickHSVMenu"]);
            // colorMenu = (ContextMenu)(this.Resources["leftClickRGBMenu"]);

            // Should be able to do this in the xaml...
            CollectionViewSource ldv = this.Resources["listingDataView"] as CollectionViewSource;
            if (ldv != null)
            {
                ldv.Source = CellConfigItems;
            }
        }
 public InlineLink Match(string word, Brush lBrush, IStatusUpdate oStatusUpdate)
 {
     MatchCollection mc = _matcher.Matches(word);
     if (mc.Count <= 0)
         return null;
     var cm = new ContextMenu();
     var miIgnore = new MenuItem {Header = "Globally ignore " + mc[0].Value + " hashtag", Tag = mc[0].Value};
     cm.Items.Add(miIgnore);
     var il = new InlineLink
                  {
                      Text = mc[0].Value,
                      FontSize = _textProcessorEngine.FsDefault,
                      FontFamily = _textProcessorEngine.FfDefault,
                      Foreground = lBrush,
                      ToolTip = mc[0].Value,
                      Tag = mc[0].Value,
                      HoverColour = _textProcessorEngine.BrHover,
                      NormalColour = _textProcessorEngine.BrBase,
                      ContextMenu = cm
                  };
     il.ToolTip = "Search for " + word + " in your current tweet stream";
     il.MouseLeftButtonDown +=
         (s, e) => PluginEventHandler.FireEvent("searchHashtag", oStatusUpdate, mc[0].Value);
     miIgnore.Click += (s, e) => _textProcessorEngine.GlobalExcludeSettings.Add(word);
     return il;
 }
        public AudioCanvas()
        {
            /* The background must be set for the canvas mouse interaction to work properly,
             * otherwise the mouse events will fall through to the control "underneath" this one.
             */
            Background = Brushes.Transparent;

            _spaceImage = new Image();
            _waveformImage = new Image();

            //Add the two images in this over so that _space image is drawn over _waveformImage
            Children.Add(_waveformImage);
            Children.Add(_spaceImage);

            /* This method contains a null reference in the designer, causing an exception and not
             * rendering the canvas. This check guards against it.
             */
            if (!DesignerProperties.GetIsInDesignMode(this))
                SetBrushes();

            MouseSelection = CanvasMouseSelection.NoSelection;

            ContextMenu = new ContextMenu();

            InitEventHandlers();
        }
Beispiel #21
0
        public Image GetContextMenuItem()
        {
            Image pb = new Image();
            pb.Width = 50;
            pb.Height = 50;
            pb.Stretch = System.Windows.Media.Stretch.Uniform;
            pb.Source = this.GetImage();
            //pb.Margin = new Padding(10);
            
            ContextMenu menu = new ContextMenu();

            MenuItem actions = new MenuItem();
            actions.Header = "Actions";

            menu.Items.Add(actions);

            foreach (string actionName in this.Template.Actions)
            {
                MenuItem displayAction = GameAction.Get(actionName).GetMenuItemForProp(new ActionEventArgs(Game.Instance.Player, null, this));

                if (displayAction != null)
                {
                    actions.Items.Add(displayAction);
                }
            }

            pb.ContextMenu = menu;

            ToolTip tooltip = new ToolTip();
            tooltip.Content = this.Template.Description;
            pb.ToolTip = tooltip;

            return pb;
        }
 public void SetContextMenu(ContextMenu e_ContextMenu)
 {
     //if(m_TextBox.ContextMenu != null )
     {
         m_TextBox.ContextMenu = e_ContextMenu;
     }
 }
Beispiel #23
0
        public MainWindow(IContainer container)
        {
            InitializeComponent();
            _background = new SolidColorBrush(Color.FromRgb(0x24, 0x27, 0x28));

            //            _background =
            //                new ImageBrush(new BitmapImage(new Uri(@"Images/grid.jpg", UriKind.Relative)))
            //                {
            //                    Stretch = Stretch.None,
            //                    TileMode = TileMode.Tile,
            //                    AlignmentX = AlignmentX.Left,
            //                    AlignmentY = AlignmentY.Top,
            //                    Viewport = new Rect(0, 0, 128, 128),
            //                    ViewportUnits = BrushMappingMode.Absolute
            //                };

            Application.Current.Resources["Dunno"] = Application.Current.Resources["Dunno1"];

            var compositeNode = new CompositeNode(new NodeDispatcher("Graph Dispatcher"));// TestNodes.Test3(new NodeDispatcher("Graph Dispatcher"));
            _compositeNodeViewModel = new CompositeNodeViewModel(compositeNode, new Vector(), new ControlTypesResolver());
            MainNode.DataContext = _compositeNodeViewModel;

            var contextMenu = new ContextMenu();
            MainNode.ContextMenu = contextMenu;

            var nodeTypes = container != null ? container.ResolveNamed<IEnumerable<Type>>("NodeTypes") : Enumerable.Empty<Type>();

            foreach (var nodeType in nodeTypes)
            {
                var menuItem = new MenuItem { Header = nodeType.Name };
                menuItem.Click += (sender, args) => MenuItemOnClick(nodeType, MainNode.TranslatePosition(menuItem.TranslatePoint(new Point(), this)));
                contextMenu.Items.Add(menuItem);
            }
        }
Beispiel #24
0
        private void SetupContextMenu()
        {
            var ctm = new ContextMenu {Background = Brushes.DarkGray};
            var miSmall = new MenuItem();
            miSmall.Click += ChangetoSmall;
            miSmall.Header = "Small";
            miSmall.Foreground = Brushes.White;
            var miNormal = new MenuItem();
            miNormal.Click += ChangetoNormal;
            miNormal.Header = "Normal";
            miNormal.Foreground = Brushes.White;
            var miLarge = new MenuItem();
            miLarge.Click += ChangetoLarge;
            miLarge.Header = "Large";
            miLarge.Foreground = Brushes.White;
            var miChangeSize = new MenuItem
            {
                Header = "Change Size",
                Foreground = Brushes.White
            };
            miChangeSize.Items.Add(miSmall);
            miChangeSize.Items.Add(miNormal);
            miChangeSize.Items.Add(miLarge);
            ctm.Items.Add(miChangeSize);

            ContextMenu = ctm;
        }
        /// <summary>
        /// Open dialog to choose images
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddImagesBtnClicked(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
            dlg.FileName = "SelectImage"; // Default file name
            dlg.DefaultExt = ".jpg"; // Default file extension
            dlg.Filter = "JPG Files (*.jpg)|*.jpg|PNG Files (*.png)|*.png|JPEG Files (*.jpeg)|*.jpeg"; // Filter files by extension

            Nullable<bool> result = dlg.ShowDialog();

            // Process open file dialog box results
            if (result == true)
            {
                // Open document
                string filename = dlg.FileName;
                Image image = new Image();
                image.Margin = new Thickness(0, 5, 10, 5);
                image.MaxHeight = 150;
                image.MaxWidth = 150;
                image.Name = "QImage" + ImagesCount.ToString();
                RegisterName(image.Name, image);
                image.Source = new BitmapImage(new Uri(filename));

                ContextMenu contextmenu = new ContextMenu();
                MenuItem delete = new MenuItem();
                delete.Header = "Delete";
                delete.Tag = ImagesCount.ToString();
                delete.Click += AddQRemoveImageCMClicked;
                contextmenu.Items.Add(delete);
                image.ContextMenu = contextmenu;

                ImagesStackPanel.Children.Add(image);
                ImageDictionary.Add(ImagesCount, image.Name);
                ImagesCount++;
            }
        }
Beispiel #26
0
        public static void ExtendWithContextMenu(this TextEditor rtb)
        {
            ContextMenu ctx = new ContextMenu();

            MenuItem cut = new MenuItem();
            cut.Header = "Cut";
            cut.Click += (sender, e) => rtb.Cut();

            MenuItem copy = new MenuItem();
            copy.Header = "Copy";
            copy.Click += (sender, e) => rtb.Copy();

            MenuItem paste = new MenuItem();
            paste.Header = "Paste";
            paste.Click += (sender, e) => rtb.Paste();

            ctx.Items.Add(cut);
            ctx.Items.Add(copy);
            ctx.Items.Add(paste);

            rtb.ContextMenu = ctx;

            ctx.Opened +=
                (sender, e) =>
                {
                    bool noSelectedText = string.IsNullOrEmpty(rtb.SelectedText);

                    cut.IsEnabled = !noSelectedText;
                    copy.IsEnabled = !noSelectedText;

                    bool noClipboardText = string.IsNullOrEmpty(Clipboard.GetText());

                    paste.IsEnabled = !noClipboardText;
                };
        }
        private void MainWindowContextMenuOpening(object sender, ContextMenuEventArgs e)
        {
            var fe = sender as FrameworkElement;
            var _scriptingUIHelper = CompositionManager.Get<IScriptingUIHelper>();
            var _scriptingConfiguration = CompositionManager.Get<IScriptingConfiguration>();

            if (fe == null)
                return;

            var newcontextualmenu = new ContextMenu();
            if (_scriptingUIHelper != null)
            {
                List<object> menu = _scriptingUIHelper.CreateContextMenusFromScripts(false,
                                                                                     _scriptingConfiguration.
                                                                                         MainWindowContextMenuEntryPoint,
                                                                                     MenuItemClick);

                if (menu != null)
                {
                    foreach (object i in menu)
                        newcontextualmenu.Items.Add(i);
                }
            }

            fe.ContextMenu = newcontextualmenu;
        }
Beispiel #28
0
		public DesignerItemBase(ElementBase element)
			: base(element)
		{
			_contextMenu = null;
			ShowPropertiesCommand = new RelayCommand(OnShowProperties);
			DeleteCommand = new RelayCommand(OnDelete);
		}
Beispiel #29
0
        private void initializeContextMenus()
        {
            MenuItem playItem = new MenuItem();
            playItem.Header = "Play";
            playItem.Click += PlaySongFromMenu_Click;

            Separator sep = new Separator();

            MenuItem removeItem = new MenuItem();
            removeItem.Header = "Remove";
            removeItem.Click += removeItem_Click;

            allMusicMenu = new ContextMenu();
            allMusicMenu.Items.Add(playItem);
            allMusicMenu.Items.Add(sep);
            allMusicMenu.Items.Add(removeItem);
            //playlist context menu

            MenuItem playlistPlayItem = new MenuItem();
            playlistPlayItem.Header = "Play";
            playlistPlayItem.Click += PlaySongFromMenu_Click;
            Separator Playlistsep = new Separator();

            MenuItem removeItemFromPlaylist = new MenuItem();
            removeItemFromPlaylist.Click += removeItemFromPlaylist_Click;
            removeItemFromPlaylist.Header = "Remove From Playlist";

            playlistMenu = new ContextMenu();
            playlistMenu.Items.Add(playlistPlayItem);
            playlistMenu.Items.Add(Playlistsep);
            playlistMenu.Items.Add(removeItemFromPlaylist);
        }
        /// <summary>
        /// Called when the template is changed.
        /// </summary>
        public override void OnApplyTemplate()
        {
            // Unhook existing handlers
            if (null != _splitElement)
            {
                _splitElement.MouseEnter -= new MouseEventHandler(SplitElement_MouseEnter);
                _splitElement.MouseLeave -= new MouseEventHandler(SplitElement_MouseLeave);
                _splitElement = null;
            }
            if (null != _contextMenu)
            {
                _contextMenu.Opened -= new RoutedEventHandler(ContextMenu_Opened);
                _contextMenu.Closed -= new RoutedEventHandler(ContextMenu_Closed);
                _contextMenu = null;
            }

            // Apply new template
            base.OnApplyTemplate();

            // Hook new event handlers
            _splitElement = GetTemplateChild(SplitElementName) as UIElement;
            if (null != _splitElement)
            {
                _splitElement.MouseEnter += new MouseEventHandler(SplitElement_MouseEnter);
                _splitElement.MouseLeave += new MouseEventHandler(SplitElement_MouseLeave);

                _contextMenu = ContextMenuService.GetContextMenu(_splitElement);
                if (null != _contextMenu)
                {
                    _contextMenu.Opened += new RoutedEventHandler(ContextMenu_Opened);
                    _contextMenu.Closed += new RoutedEventHandler(ContextMenu_Closed);
                }
            }
        }
Beispiel #31
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Galatee.Silverlight;component/Parametrage/Wkf/UcWKFListeSousOperations.xaml", System.UriKind.Relative));
     this.LayoutRoot              = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.dtgrdParametre          = ((System.Windows.Controls.DataGrid)(this.FindName("dtgrdParametre")));
     this.MenuContextuel          = ((System.Windows.Controls.ContextMenu)(this.FindName("MenuContextuel")));
     this.MenuContextuelCreer     = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelCreer")));
     this.MenuContextuelConsulter = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelConsulter")));
     this.MenuContextuelModifier  = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelModifier")));
     this.MenuContextuelSupprimer = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelSupprimer")));
     this.GroupBox     = ((SilverlightContrib.Controls.GroupBox)(this.FindName("GroupBox")));
     this.CancelButton = ((System.Windows.Controls.Button)(this.FindName("CancelButton")));
     this.OKButton     = ((System.Windows.Controls.Button)(this.FindName("OKButton")));
 }
        internal static void DisplayItemsMenu(OpenControls.Wpf.TabHeaderControl.TabHeaderControl tabHeaderControl)
        {
            System.Windows.Controls.ContextMenu contextMenu = new System.Windows.Controls.ContextMenu();
            int i = 0;

            foreach (var item in tabHeaderControl.Items)
            {
                ViewModel.TabHeaderItem          tabHeaderItem = item as ViewModel.TabHeaderItem;
                System.Windows.Controls.MenuItem menuItem      = new System.Windows.Controls.MenuItem();
                menuItem.Header           = tabHeaderItem.HeaderText;
                menuItem.IsChecked        = item == tabHeaderControl.SelectedItem;
                menuItem.CommandParameter = i;
                ++i;
                menuItem.Command = new OpenControls.Wpf.Utilities.Command(delegate { tabHeaderControl.SelectedIndex = (int)menuItem.CommandParameter; }, delegate { return(true); });
                contextMenu.Items.Add(menuItem);
            }

            contextMenu.IsOpen = true;
        }
Beispiel #33
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Galatee.Silverlight;component/Parametrage/UcListRues.xaml", System.UriKind.Relative));
     this.LayoutRoot              = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.progressBar1            = ((System.Windows.Controls.ProgressBar)(this.FindName("progressBar1")));
     this.groupBox1               = ((SilverlightContrib.Controls.GroupBox)(this.FindName("groupBox1")));
     this.dtgrdParametre          = ((System.Windows.Controls.DataGrid)(this.FindName("dtgrdParametre")));
     this.MenuContextuel          = ((System.Windows.Controls.ContextMenu)(this.FindName("MenuContextuel")));
     this.MenuContextuelCreer     = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelCreer")));
     this.MenuContextuelConsulter = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelConsulter")));
     this.MenuContextuelEditer    = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelEditer")));
     this.MenuContextuelModifier  = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelModifier")));
     this.MenuContextuelSupprimer = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelSupprimer")));
 }
Beispiel #34
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\Cell.xaml"
                ((SchoolTT_02.Cell)(target)).Drop += new System.Windows.DragEventHandler(this.CellDrop);

            #line default
            #line hidden

            #line 8 "..\..\Cell.xaml"
                ((SchoolTT_02.Cell)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Cell_OnMouseDown);

            #line default
            #line hidden
                return;

            case 2:
                this.ClearMenu = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 3:
                this.ClearItem = ((System.Windows.Controls.MenuItem)(target));

            #line 23 "..\..\Cell.xaml"
                this.ClearItem.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.ContextMenuClearClick);

            #line default
            #line hidden
                return;

            case 4:
                this.CellClassTextBox = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 5:
                this.Discipline = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Galatee.Silverlight;component/Parametrage/Parametrage/CwListeCasReleveIndex.xaml" +
                                                                   "", System.UriKind.Relative));
     this.LayoutRoot              = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.dtgrdParametre          = ((System.Windows.Controls.DataGrid)(this.FindName("dtgrdParametre")));
     this.MenuContextuel          = ((System.Windows.Controls.ContextMenu)(this.FindName("MenuContextuel")));
     this.MenuContextuelCreer     = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelCreer")));
     this.MenuContextuelConsulter = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelConsulter")));
     this.MenuContextuelEditer    = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelEditer")));
     this.MenuContextuelModifier  = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelModifier")));
     this.MenuContextuelSupprimer = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelSupprimer")));
     this.btn_Imprimer            = ((System.Windows.Controls.Button)(this.FindName("btn_Imprimer")));
 }
Beispiel #36
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog fileDialog = new Microsoft.Win32.OpenFileDialog
            {
                DefaultExt  = ".xlsx",
                Filter      = "电子表格文件|*.xlsx;*.xls",
                Multiselect = true
            };
            Nullable <bool> result = fileDialog.ShowDialog();

            if (result == true)
            {
                // prepare for the same menu
                System.Windows.Controls.ContextMenu menu  = new System.Windows.Controls.ContextMenu();
                System.Windows.Controls.MenuItem    clear = new System.Windows.Controls.MenuItem
                {
                    Header      = "清空所有项",
                    IsCheckable = true
                };
                clear.Click += Clear_Items;
                System.Windows.Controls.MenuItem remove = new System.Windows.Controls.MenuItem
                {
                    Header      = "移除所选项",
                    IsCheckable = true
                };
                remove.Click += Remove_Items;
                menu.Items.Add(clear);
                menu.Items.Add(remove);
                // Open document
                string[] filenames = fileDialog.FileNames;
                foreach (string filename in filenames)
                {
                    TextBlock item = new TextBlock
                    {
                        Text = filename,

                        ContextMenu = menu
                    };
                    inputfiles.Items.Add(item);
                }
            }
        }
Beispiel #37
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 13 "..\..\..\Interfaz\Estudios.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItemDelete_Click);

            #line default
            #line hidden
                return;

            case 2:

            #line 18 "..\..\..\Interfaz\Estudios.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItemUpdate_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.lvCarpetas = ((System.Windows.Controls.ListView)(target));
                return;

            case 5:
                this.ZoneIformationList = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 6:
                this.EditZoneInfoContextMenu = ((System.Windows.Controls.MenuItem)(target));

            #line 73 "..\..\..\Interfaz\Estudios.xaml"
                this.EditZoneInfoContextMenu.Click += new System.Windows.RoutedEventHandler(this.EditZoneInfoContextMenu_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #38
0
        private System.Windows.Controls.ContextMenu BuildMenu(WareBase ware)
        {
            System.Windows.Controls.ContextMenu theMenu = new System.Windows.Controls.ContextMenu();
            MenuItem miEdit = new MenuItem();

            miEdit.Header      = "编辑";
            miEdit.DataContext = ware;
            miEdit.Click      += miEdit_Click;
            if (ware is Labware)
            {
                if (((Labware)ware).IsDitiBox)
                {
                    AddSetCurrentMenu(ware, theMenu);
                    AddSetDitiPositionMenu(ware, theMenu);
                }
            }
            theMenu.Items.Add(miEdit);

            return(theMenu);
        }
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Galatee.Silverlight;component/Administration/FrmListeImport.xaml", System.UriKind.Relative));
     this.LayoutRoot              = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.GroupBox                = ((SilverlightContrib.Controls.GroupBox)(this.FindName("GroupBox")));
     this.dgImport                = ((System.Windows.Controls.DataGrid)(this.FindName("dgImport")));
     this.MenuContextuel          = ((System.Windows.Controls.ContextMenu)(this.FindName("MenuContextuel")));
     this.MenuContextuelCreer     = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelCreer")));
     this.MenuContextuelConsulter = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelConsulter")));
     this.MenuContextuelExecuter  = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelExecuter")));
     this.MenuContextuelModifier  = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelModifier")));
     this.MenuContextuelSupprimer = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelSupprimer")));
     this.btn_Valider             = ((System.Windows.Controls.Button)(this.FindName("btn_Valider")));
     this.btn_Annule              = ((System.Windows.Controls.Button)(this.FindName("btn_Annule")));
 }
Beispiel #40
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.dataGrid = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 2:
                this.dgmenu1 = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 3:

            #line 18 "..\..\MainCome.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.label = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.datepicker = ((System.Windows.Controls.DatePicker)(target));
                return;

            case 6:
                this.button = ((System.Windows.Controls.Button)(target));

            #line 24 "..\..\MainCome.xaml"
                this.button.Click += new System.Windows.RoutedEventHandler(this.button_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #41
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            this.PART_TextBox = this.Template.FindName("PART_TextBox", this) as XlyHighlightTextBox;

            if (this.ContextMenuActions == null)
            {
                return;
            }

            ContextMenu menu = new ContextMenu();

            for (int i = 0; i < this.ContextMenuActions.Count; ++i)
            {
                MenuActionInfo info = this.ContextMenuActions[i];
                MenuItem       item = new MenuItem();
                item.Header = info.Header;
                if (!info.Icon.IsNullOrEmptyOrWhiteSpace())
                {
                    Border border = new Border();
                    border.Background = new ImageBrush(StringImageConverter.Convert(info.Icon));
                    item.Icon         = border;
                }
                item.InputGestureText = info.KeyText;

                item.Click += (s, a) =>
                {
                    info.DoOnClick(this, a);
                };

                menu.Items.Add(item);
            }

            if (this.PART_TextBox.PART_RichTextBox == null)
            {
                this.PART_TextBox.ApplyTemplate();
            }

            this.PART_TextBox.PART_RichTextBox.ContextMenu = menu;
        }
Beispiel #42
0
 private void ChangeContextMenu(object sender, RoutedEventArgs e)
 {
     spanel2.Children.Clear();
     btn       = new Button();
     btn.Width = 150;
     btn.HorizontalAlignment = HorizontalAlignment.Left;
     btn.Content             = "Button with ContextMenu";
     contextmenu             = new ContextMenu();
     mi        = new MenuItem();
     mi.Header = "Item 1";
     contextmenu.Items.Add(mi);
     mia        = new MenuItem();
     mia.Header = "Item 2";
     contextmenu.Items.Add(mia);
     btn.ContextMenu = contextmenu;
     spanel2.Children.Add(btn);
     txt = new TextBlock();
     txt.TextWrapping = System.Windows.TextWrapping.WrapWithOverflow;
     txt.Text         = "A context menu enables you to present users with a list of items that specify commands or options associated with a particular control - for example, a button. Users right-click the control to make the menu appear. Typically, clicking a menu item opens a submenu or causes an application to carry out a command. The part of this application that presents the list of the controls for you to select is a context menu attached to a button.";
     spanel2.Children.Add(txt);
 }
Beispiel #43
0
        /// <summary>
        /// Create all menu items.
        /// </summary>
        private void InitializeMenu()
        {
            notifyIcon = new NotifyIcon();

            notifyIcon.ContextMenu = new System.Windows.Forms.ContextMenu();
            notifyIcon.Icon        = System.Drawing.SystemIcons.Application;
            notifyIcon.Visible     = true;

            notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Lock", Menu_Lock));
            notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("-"));
            notifyIcon.ContextMenu.MenuItems.Add(new System.Windows.Forms.MenuItem("Exit", Menu_Exit));

            widgetMenu = new ContextMenu();

            MenuItem menuItem;

            menuItem        = new MenuItem();
            menuItem.Header = "Edit";
            menuItem.Click += Menu_EditWidget;
            widgetMenu.Items.Add(menuItem);
        }
Beispiel #44
0
        void SetContextMenu()
        {
            System.Windows.Controls.ContextMenu cm  = new System.Windows.Controls.ContextMenu();
            System.Windows.Controls.ContextMenu cm2 = new System.Windows.Controls.ContextMenu();

            System.Windows.Controls.MenuItem miClear = new System.Windows.Controls.MenuItem()
            {
                Header = "清除", Tag = "miClear1"
            };
            System.Windows.Controls.MenuItem miClear2 = new System.Windows.Controls.MenuItem()
            {
                Header = "清除", Tag = "miClear2"
            };
            miClear.Click  += mi_Click;
            miClear2.Click += mi_Click;
            cm.Items.Add(miClear);
            cm2.Items.Add(miClear2);

            dgData1.ContextMenu = cm;
            dgData2.ContextMenu = cm2;
        }
        private void VerificarPatrimonio_Click(object sender, RoutedEventArgs e)
        {
            control.MenuItem menuItem = (control.MenuItem)sender;

            control.ContextMenu contextMenu = (control.ContextMenu)menuItem.Parent;

            control.DataGrid item = (control.DataGrid)contextMenu.PlacementTarget;

            if (item.SelectedCells.Count > 0)
            {
                Agendamento agendamento = (Agendamento)item.SelectedCells[0].Item;

                PatrimoniosAgendamento window = new PatrimoniosAgendamento();

                window.AgendamentoSelecionado = agendamento;

                window.ShowDialog();

                AtualizarDG();
            }
        }
Beispiel #46
0
        internal static System.Windows.Controls.ContextMenu CreateContextMenu(IList subItems)
        {
            var contextMenu = new System.Windows.Controls.ContextMenu()
            {
                ItemsSource = new object[1]
            };

            contextMenu.Opened += (sender, args) => {
                contextMenu.ItemsSource = ExpandMenuBuilders(subItems, true);
                args.Handled            = true;
            };

            Style customStyle = System.Windows.Application.Current.TryFindResource("style") as Style;

            if (customStyle != null)
            {
                contextMenu.Style = customStyle;
            }

            return(contextMenu);
        }
Beispiel #47
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tbCommand = ((System.Windows.Controls.TextBox)(target));

            #line 20 "..\..\MainWindow.xaml"
                this.tbCommand.KeyUp += new System.Windows.Input.KeyEventHandler(this.tbCommand_KeyUp);

            #line default
            #line hidden
                return;

            case 2:
                this.btnExec = ((System.Windows.Controls.Button)(target));

            #line 21 "..\..\MainWindow.xaml"
                this.btnExec.Click += new System.Windows.RoutedEventHandler(this.btnExec_Click);

            #line default
            #line hidden
                return;

            case 3:
                this._cm = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 4:
                this.tcQueries = ((System.Windows.Controls.TabControl)(target));

            #line 28 "..\..\MainWindow.xaml"
                this.tcQueries.KeyUp += new System.Windows.Input.KeyEventHandler(this.tcQueries_KeyUp);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #48
0
 public void InitializeComponent()
 {
     if (_contentLoaded)
     {
         return;
     }
     _contentLoaded = true;
     System.Windows.Application.LoadComponent(this, new System.Uri("/Galatee.Silverlight;component/Devis/UcValidationEtudeEp.xaml", System.UriKind.Relative));
     this.LayoutRoot              = ((System.Windows.Controls.Grid)(this.FindName("LayoutRoot")));
     this.MenuContextuel          = ((System.Windows.Controls.ContextMenu)(this.FindName("MenuContextuel")));
     this.MenuContextuelAjouter   = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelAjouter")));
     this.MenuContextuelSupprimer = ((System.Windows.Controls.MenuItem)(this.FindName("MenuContextuelSupprimer")));
     this.Gbo_InformationAccount  = ((SilverlightContrib.Controls.GroupBox)(this.FindName("Gbo_InformationAccount")));
     this.Gbo_InformationDevis    = ((SilverlightContrib.Controls.GroupBox)(this.FindName("Gbo_InformationDevis")));
     this.Txt_NumDevis            = ((System.Windows.Controls.TextBox)(this.FindName("Txt_NumDevis")));
     this.lab_AmountOfDeposit     = ((System.Windows.Controls.Label)(this.FindName("lab_AmountOfDeposit")));
     this.Txt_TypeDevis           = ((System.Windows.Controls.TextBox)(this.FindName("Txt_TypeDevis")));
     this.Txt_Distance            = ((System.Windows.Controls.TextBox)(this.FindName("Txt_Distance")));
     this.lab_Decision            = ((System.Windows.Controls.Label)(this.FindName("lab_Decision")));
     this.Chk_DossierComplet      = ((System.Windows.Controls.CheckBox)(this.FindName("Chk_DossierComplet")));
     this.Chk_DossierImcomplet    = ((System.Windows.Controls.CheckBox)(this.FindName("Chk_DossierImcomplet")));
     this.label1                 = ((System.Windows.Controls.Label)(this.FindName("label1")));
     this.CancelButton           = ((System.Windows.Controls.Button)(this.FindName("CancelButton")));
     this.BtnTransmettre         = ((System.Windows.Controls.Button)(this.FindName("BtnTransmettre")));
     this.OKButton               = ((System.Windows.Controls.Button)(this.FindName("OKButton")));
     this.btn_Rejeter            = ((System.Windows.Controls.Button)(this.FindName("btn_Rejeter")));
     this.dataGridElementDevis   = ((System.Windows.Controls.DataGrid)(this.FindName("dataGridElementDevis")));
     this.Btn_Ajouter            = ((System.Windows.Controls.Button)(this.FindName("Btn_Ajouter")));
     this.Btn_Supprimer          = ((System.Windows.Controls.Button)(this.FindName("Btn_Supprimer")));
     this.button2                = ((System.Windows.Controls.Button)(this.FindName("button2")));
     this.Txt_PrixUnitaire       = ((System.Windows.Controls.TextBox)(this.FindName("Txt_PrixUnitaire")));
     this.Lab_PrixUnitaire       = ((System.Windows.Controls.Label)(this.FindName("Lab_PrixUnitaire")));
     this.Txt_Quantite           = ((Galatee.Silverlight.Library.NumericTextBox)(this.FindName("Txt_Quantite")));
     this.Lab_Quantite           = ((System.Windows.Controls.Label)(this.FindName("Lab_Quantite")));
     this.Rdb_Fourniture         = ((System.Windows.Controls.RadioButton)(this.FindName("Rdb_Fourniture")));
     this.Rdb_Pose               = ((System.Windows.Controls.RadioButton)(this.FindName("Rdb_Pose")));
     this.Rdb_Prestation         = ((System.Windows.Controls.RadioButton)(this.FindName("Rdb_Prestation")));
     this.Txt_MontantTotalG      = ((System.Windows.Controls.TextBox)(this.FindName("Txt_MontantTotalG")));
     this.Lab_TotalMontant_Copy1 = ((System.Windows.Controls.Label)(this.FindName("Lab_TotalMontant_Copy1")));
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.PnlMenuBar = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 2:
                this.BtnEndpointViewMenu5 = ((System.Windows.Controls.Button)(target));
                return;

            case 3:
                this.BtnEndpointViewMenu4 = ((System.Windows.Controls.Button)(target));
                return;

            case 4:
                this.BtnEndpointViewMenu3 = ((System.Windows.Controls.Button)(target));
                return;

            case 5:
                this.BtnEndpointViewMenu2 = ((System.Windows.Controls.Button)(target));

            #line 58 "..\..\..\..\..\UserControls\Endpoint\EndpointViewHeaderElement .xaml"
                this.BtnEndpointViewMenu2.Click += new System.Windows.RoutedEventHandler(this.OnTaskClick);

            #line default
            #line hidden
                return;

            case 6:
                this.TaskCtxMenu = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 7:
                this.BtnEndpointViewMenu1 = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #50
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.SchemeRenderControl = ((Drakon.App.Views.Containers.CanvasControl)(target));
                return;

            case 2:
                this.CanvasRoot = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 3:
                this.SchemeCanvas = ((System.Windows.Controls.Canvas)(target));

            #line 54 "..\..\..\..\..\Views\Containers\CanvasControl.xaml"
                this.SchemeCanvas.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.SchemeCanvas_OnMouseDown);

            #line default
            #line hidden

            #line 55 "..\..\..\..\..\Views\Containers\CanvasControl.xaml"
                this.SchemeCanvas.MouseMove += new System.Windows.Input.MouseEventHandler(this.SchemeCanvas_OnMouseMove);

            #line default
            #line hidden

            #line 56 "..\..\..\..\..\Views\Containers\CanvasControl.xaml"
                this.SchemeCanvas.LayoutUpdated += new System.EventHandler(this.SchemeCanvas_OnLayoutUpdated);

            #line default
            #line hidden
                return;

            case 4:
                this.CanvasContextMenu = ((System.Windows.Controls.ContextMenu)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #51
0
        protected override void OnClick()
        {
            base.OnClick();

            if (this.popup != null)
            {
                this.popup.IsOpen = false;
            }
            else if (this.IsReadOnly == false)
            {
                var popup          = new System.Windows.Controls.ContextMenu();
                var brushConverter = new BrushConverter();

                foreach (var item in TagInfoUtility.Names)
                {
                    var menuItem = new System.Windows.Controls.MenuItem()
                    {
                        Header = item,
                    };
                    popup.Items.Add(menuItem);

                    var value = new TagInfo(item);
                    if (value.Color != null)
                    {
                        menuItem.Background = (Brush)brushConverter.ConvertFrom(value.Color);
                    }

                    menuItem.IsEnabled = (this.Filter & value) == value;
                    menuItem.IsChecked = this.Value == value;
                    menuItem.Click    += MenuItem_Click;
                }

                popup.Closed         += Popup_Closed;
                popup.PlacementTarget = this;
                popup.Placement       = PlacementMode.Right;
                popup.IsOpen          = true;
                this.popup            = popup;
            }
        }
        private void CreateTaskBarIcon()
        {
            ShutdownEvent += ShutdownExecute;
            taskbarIcon    = new TaskbarIcon();
            var icon = System.Drawing.Icon.ExtractAssociatedIcon(Application.ResourceAssembly.Location);

            taskbarIcon.Icon = icon;
            ContextMenu cm = new ContextMenu();

            System.Windows.Controls.MenuItem exitMenuItem = new System.Windows.Controls.MenuItem();
            exitMenuItem.Header = "Beenden";
            exitMenuItem.Click += ShutdownExecute;

            System.Windows.Controls.MenuItem scanMenuItem = new System.Windows.Controls.MenuItem();
            scanMenuItem.Header = "Jetzt nach USB-Zielen suchen";
            scanMenuItem.Click += delegate(object e, RoutedEventArgs f) { CheckUSBMedia(); };

            cm.Items.Add(scanMenuItem);
            cm.Items.Add(exitMenuItem);
            taskbarIcon.ContextMenu = cm;
            taskbarIcon.ToolTipText = "USB-Backup";
        }
Beispiel #53
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.gridContexMenu = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 2:
                this.timerTextBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:
                this.projectcomboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 4:
                this.timerButton = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #54
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ChatBrowser = ((CefSharp.Wpf.ChromiumWebBrowser)(target));
                return;

            case 2:
                this.ChatSettingsElement = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.ContextMenu = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 4:
                this.UsebleLayout = ((System.Windows.Controls.Grid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #55
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.closeDialogQueueButton = ((System.Windows.Controls.Button)(target));
                return;

            case 2:
                this.lvQueueSongs = ((System.Windows.Controls.ListView)(target));
                return;

            case 3:
                this.menuQueue = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 4:
                this.deleteFromQueue = ((System.Windows.Controls.MenuItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.itemList = ((System.Windows.Controls.ListView)(target));
                return;

            case 2:
                this.ZoneIformationList = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 3:
                this.DuplicateAddressContextMenu = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 4:
                this.RemoveAddressContextMenu = ((System.Windows.Controls.MenuItem)(target));
                return;
            }
            this._contentLoaded = true;
        }
Beispiel #57
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.UrlCM = ((System.Windows.Controls.ContextMenu)(target));
                return;

            case 2:

            #line 51 "..\..\..\Views\ConverterControl.xaml"
                ((System.Windows.Controls.TextBox)(target)).PreviewTextInput += new System.Windows.Input.TextCompositionEventHandler(this.TextBox_PreviewTextInput);

            #line default
            #line hidden
                return;

            case 3:
                this.BtnOpenWebsites = ((System.Windows.Controls.Button)(target));
                return;

            case 4:
                this.BtnCancelOpenWebsites = ((System.Windows.Controls.Button)(target));
                return;

            case 5:
                this.BtnSaveWebsites = ((System.Windows.Controls.Button)(target));
                return;

            case 6:
                this.BtnLoadWebsites = ((System.Windows.Controls.Button)(target));
                return;

            case 7:
                this.TxtConfigFilePath = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
        public void AddSound(string filePath, bool doBackup, bool isInitialLoad, int soundID = -1)
        {
            if (File.Exists(filePath) && soundManager.ValidateFile(filePath))
            {
                int    startAt      = filePath.LastIndexOf("\\") + 1;
                int    addedSoundID = soundID;
                string soundName    = filePath.Substring(startAt, filePath.Length - startAt);
                if (!isInitialLoad)
                {
                    SOUND newSound = new SOUND();
                    newSound.filePath = filePath;
                    newSound.isBackup = doBackup;
                    newSound.name     = soundName;
                    soundData.SOUNDs.Add(newSound);
                    soundData.SaveChanges();
                    addedSoundID = (from s in soundData.SOUNDs
                                    orderby s.soundID descending
                                    select s.soundID).First();
                }

                ListBoxItem newItem = new ListBoxItem();
                newItem.Content = soundName;

                newItem.DataContext       = addedSoundID;
                newItem.MouseDoubleClick += (sender, e) => listItem_MouseDoubleClick(sender, e, filePath);
                newItem.PreviewMouseMove += listBoxItemSound_PreviewMouseMoveEvent;

                System.Windows.Controls.ContextMenu listMenu = new System.Windows.Controls.ContextMenu();

                System.Windows.Controls.MenuItem delete = new System.Windows.Controls.MenuItem();
                delete.Header      = "Delete";
                delete.IsCheckable = false;
                delete.Click      += (sender, e) => listItem_Delete(sender, e, addedSoundID);
                listMenu.Items.Add(delete);

                newItem.ContextMenu = listMenu;
                listBoxSounds.Items.Add(newItem);
            }
        }
Beispiel #59
0
        /// <summary>
        /// Создание Контекстного меню для новых вкладок
        /// </summary>
        /// <param name="tabItem"> Вкладка для которой создается Контекстное меню</param>
        private void CreateContextMenuOnTab(TabItem tabItem)
        {
            var contextMenuTab = new System.Windows.Controls.ContextMenu();
            //Закрыть 1 вкладку
            var contextMenuItemTab = new System.Windows.Controls.MenuItem()
            {
                Header = "Close"
            };

            contextMenuItemTab.Click += (sender1, e1) => { DataTabControl.Items.Remove(tabItem); };
            contextMenuTab.Items.Add(contextMenuItemTab);

            //закрыть все вкладки
            contextMenuItemTab = new System.Windows.Controls.MenuItem()
            {
                Header = "CloseAll"
            };
            contextMenuItemTab.Click += (sender1, e1) => { CloseAllTab(2); };
            contextMenuTab.Items.Add(contextMenuItemTab);

            tabItem.ContextMenu = contextMenuTab;
        }
Beispiel #60
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.cmbProperty = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 2:
                this.cmbCondition = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 3:
                this.txtValue = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.menu = ((System.Windows.Controls.ContextMenu)(target));
                return;
            }
            this._contentLoaded = true;
        }