void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.grid = ((MonaFramework.Controls.MonaGrid)(target)); return; case 2: this.player = ((System.Windows.Controls.MediaElement)(target)); return; case 3: this.play = ((MonaFramework.Controls.MonaButton)(target)); #line 18 "..\..\..\MainWindow.xaml" this.play.Click += new System.Windows.RoutedEventHandler(this.playMedia); #line default #line hidden return; case 4: this.pause = ((MonaFramework.Controls.MonaButton)(target)); #line 19 "..\..\..\MainWindow.xaml" this.pause.Click += new System.Windows.RoutedEventHandler(this.pauseMedia); #line default #line hidden return; case 5: this.stop = ((MonaFramework.Controls.MonaButton)(target)); #line 20 "..\..\..\MainWindow.xaml" this.stop.Click += new System.Windows.RoutedEventHandler(this.stopMedia); #line default #line hidden return; } this._contentLoaded = true; }
private void initBasicCommands() { MonaWindow thisWindow = this; MonaButton closeButton = new MonaButton(); MonaButton minimizeButton = new MonaButton(); MonaButton maximizeButton = new MonaButton(); MonaButton reduceButton = new MonaButton(); MonaButton restoreButton = new MonaButton(); MonaButton aliasButton = new MonaButton(); closeButton.setAlias("Close"); closeButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { thisWindow.Close(); }); minimizeButton.setAlias("Minimize"); minimizeButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { // TODO: trouver comment retrecir la fenetre thisWindow.WindowState = System.Windows.WindowState.Normal; }); maximizeButton.setAlias("Maximize"); maximizeButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { //TODO: trouver comment agrandir la fenetre thisWindow.WindowState = System.Windows.WindowState.Maximized; }); reduceButton.setAlias("Reduce"); reduceButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { //TODO: trouver comment reduire la fenetre dans la barre des taches thisWindow.WindowState = System.Windows.WindowState.Minimized; }); restoreButton.setAlias("Restore"); restoreButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { //TODO: trouver comment reduire la fenetre dans la barre des taches thisWindow.WindowState = System.Windows.WindowState.Normal; }); aliasButton.setAlias("Alias"); aliasButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { foreach (IAliasAnswerer answerer in __register.getAllComponents()) { try { string alias = answerer.getAlias(); ToolTip tip = new ToolTip(); FrameworkElement element = (FrameworkElement)answerer; tip.Content = alias; ToolTipService.SetPlacementTarget(tip, element); ToolTipService.SetPlacement(tip, System.Windows.Controls.Primitives.PlacementMode.Bottom); /*tip.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom; * ((FrameworkElement)answerer).ToolTip = tip;*/ tip.IsOpen = true; } catch (Exception e) { } } }); __register.registerComponent(closeButton); __register.registerComponent(minimizeButton); __register.registerComponent(maximizeButton); __register.registerComponent(reduceButton); __register.registerComponent(restoreButton); __register.registerComponent(aliasButton); }
private void initBasicCommands() { MonaWindow thisWindow = this; MonaButton closeButton = new MonaButton(); MonaButton minimizeButton = new MonaButton(); MonaButton maximizeButton = new MonaButton(); MonaButton reduceButton = new MonaButton(); MonaButton restoreButton = new MonaButton(); MonaButton aliasButton = new MonaButton(); closeButton.setAlias("Close"); closeButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { thisWindow.Close(); }); minimizeButton.setAlias("Minimize"); minimizeButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { // TODO: trouver comment retrecir la fenetre thisWindow.WindowState = System.Windows.WindowState.Normal; }); maximizeButton.setAlias("Maximize"); maximizeButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { //TODO: trouver comment agrandir la fenetre thisWindow.WindowState = System.Windows.WindowState.Maximized; }); reduceButton.setAlias("Reduce"); reduceButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { //TODO: trouver comment reduire la fenetre dans la barre des taches thisWindow.WindowState = System.Windows.WindowState.Minimized; }); restoreButton.setAlias("Restore"); restoreButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { //TODO: trouver comment reduire la fenetre dans la barre des taches thisWindow.WindowState = System.Windows.WindowState.Normal; }); aliasButton.setAlias("Alias"); aliasButton.Click += new RoutedEventHandler(delegate(object sender, RoutedEventArgs args) { foreach (IAliasAnswerer answerer in __register.getAllComponents()) { try { string alias = answerer.getAlias(); ToolTip tip = new ToolTip(); FrameworkElement element = (FrameworkElement)answerer; tip.Content = alias; ToolTipService.SetPlacementTarget(tip, element); ToolTipService.SetPlacement(tip, System.Windows.Controls.Primitives.PlacementMode.Bottom); /*tip.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom; ((FrameworkElement)answerer).ToolTip = tip;*/ tip.IsOpen = true; } catch (Exception e) { } } }); __register.registerComponent(closeButton); __register.registerComponent(minimizeButton); __register.registerComponent(maximizeButton); __register.registerComponent(reduceButton); __register.registerComponent(restoreButton); __register.registerComponent(aliasButton); }