/// <summary>
        /// Calls openFile with a FileInfo array then closes the OpenFile dialog window.
        /// </summary>
        /// <param name="openFile"></param>
        /// <param name="closeCommand"></param>
        private async void OpenSelectedItemCommandMethod(Func <IEnumerable <FileInfo>, Task> openFile, RoutedCommand closeCommand)
        {
            if (SelectedItem?.FileInfo?.FullName != null)
            {
                await openFile(FileAndDirectoryValidator(SelectedItem.FileInfo.FullName));

                closeCommand?.Execute(null, null);
            }
            else if (!string.IsNullOrEmpty(_selectedTreeViewItemPath))
            {
                await openFile(FileAndDirectoryValidator(_selectedTreeViewItemPath));

                closeCommand?.Execute(null, null);
            }
            else
            {
                //TODO: Notify user to select a folder or file
            }
        }
Beispiel #2
0
 /// <summary>
 /// Translate igp file to C file and compile it to executable program using WinAVR and load it to iRobot.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void LoadToMicrocontrollerCmdExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     TranslateToMicrocontrollerCCmd.Execute(null, this);
     BuildCmd.Execute(null, this);
     LoadCmd.Execute(null, this);
 }
Beispiel #3
0
 public void Execute(object parameter)
 {
     _routedCommand.Execute(parameter, GetTextArea(GetEditor(parameter)));
 }
Beispiel #4
0
 /// <summary>
 ///     OK ボタンが押されたときの処理:変更を適用してウィンドウを閉じる
 /// </summary>
 private void okButton_Click(object sender, RoutedEventArgs e)
 {
     ApplyCommand.Execute(null, this);
     Close();
 }
Beispiel #5
0
 public void ToolBarButtonOrderForm_Click(object sender, RoutedEventArgs args)
 {
     this.m_MainWindowCommandButtonHandler.OnShowOrderForm();
     ShowOrderFormCommand.Execute(null, null);
 }
 public static void CloseOtherItems(DragablzItem dragablzItem) => CloseOtherItemsCommand.Execute(dragablzItem, dragablzItem);
Beispiel #7
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     CommandRefreshDeviceList.Execute(null, null);
 }
Beispiel #8
0
 private void StatusBarItemEM_MouseDown(object sender, MouseButtonEventArgs e)
 {
     SettingCmd.Execute(null, this);
 }
Beispiel #9
0
        private void Day_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            try
            {
                if (String.Format("{0:d/M/yyyy}", new DateTime(_Year, _Month, Int32.Parse(((TextBlock)sender).Text))) != String.Format("{0:d/M/yyyy}", DateTime.Now))
                {
                    ((TextBlock)sender).Background = new SolidColorBrush(Colors.Red);
                }
            }
            catch { ((TextBlock)sender).Background = new SolidColorBrush(Colors.Red); }
            foreach (UIElement i in grd.Children)
            {
                TextBlock a = i as TextBlock;
                if (a != null && getDayTime != null)
                {
                    try
                    {
                        if (getDayTime.Day == Int32.Parse((a).Text) && String.Format("{0:d/M/yyyy}", new DateTime(_Year, _Month, getDayTime.Day)) != String.Format("{0:d/M/yyyy}", DateTime.Now))
                        {
                            (i as TextBlock).Background = new SolidColorBrush(Colors.WhiteSmoke);
                        }
                    }
                    catch { (i as TextBlock).Background = new SolidColorBrush(Colors.WhiteSmoke); }
                }
            }
            try
            {
                if (getDayTime != new DateTime(_Year, _Month, Int32.Parse(((TextBlock)sender).Text)))
                {
                    getDayTime = new DateTime(_Year, _Month, Int32.Parse(((TextBlock)sender).Text));
                }
                else
                {
                    getDayTime = DateTime.Now;
                }
            }
            catch
            {
                if (getDayTime != new DateTime(_Year, _Month - 1, Int32.Parse(((TextBlock)sender).Text)))
                {
                    getDayTime = new DateTime(_Year, _Month - 1, Int32.Parse(((TextBlock)sender).Text));
                }
                else
                {
                    getDayTime = DateTime.Now;
                }
            }

            if (((TextBlock)sender).Foreground.ToString() == (new SolidColorBrush(Colors.Bisque)).ToString())
            {
                if (Int32.Parse(((TextBlock)sender).Text) < 10)
                {
                    if (_Month < 12)
                    {
                        getDayTime = new DateTime(_Year, _Month + 1, Int32.Parse(((TextBlock)sender).Text));

                        BtnNext_Click(null, null);
                    }
                }
                else
                {
                    if (_Month > 1)
                    {
                        getDayTime = new DateTime(_Year, _Month - 1, Int32.Parse(((TextBlock)sender).Text));

                        BtnPre_Click(null, null);
                    }
                }
            }
            Point relativePoint = ((TextBlock)sender).TransformToAncestor(this).Transform(new Point(0, 0));

            EventDayVIew ab = new EventDayVIew(); if (relativePoint.X > 750)

            {
                ab.Left = relativePoint.X - 410;
            }

            else
            {
                ab.Left = relativePoint.X + 205;
            }
            ab.Top    = relativePoint.Y;
            ab.Height = 400;
            ab.Width  = 490;

            ab.ShowDialog();

            TextBlock Event = new TextBlock()
            {
                Background = new SolidColorBrush(Colors.WhiteSmoke)
            };

            Event.Text = "vu khac hoi";

            Event.Height                = 30;
            Event.RenderTransform       = new ScaleTransform();
            Event.RenderTransformOrigin = new Point(0.5, 0.5);
            Event.SetResourceReference(Control.StyleProperty, "triggerTextbox");
            Event.Margin = new Thickness(0, 10, 0, 0);
            Panel.SetZIndex(Event, Panel.GetZIndex((TextBlock)sender) - 1);
            Grid.SetRow(Event, Grid.GetRow((TextBlock)sender));
            Grid.SetColumn(Event, Grid.GetColumn((TextBlock)sender));
            MessageBox.Show(Grid.GetRow(Event).ToString());



            int isIndex = 0; int k = 0;

            for (isIndex = 10; isIndex > 0; isIndex--)
            {
                try
                {
                    if (Grid.GetColumn(grd.Children[grd.Children.IndexOf((TextBlock)sender) + isIndex]) == Grid.GetColumn((TextBlock)sender) && Grid.GetRow(grd.Children[grd.Children.IndexOf((TextBlock)sender) + isIndex]) == Grid.GetRow((TextBlock)sender))
                    {
                        k = 1;
                        break;
                    }
                }
                catch { }
            }

            if (k != 0)
            {
                Event.Margin = new Thickness(0, (grd.Children[grd.Children.IndexOf((TextBlock)sender) + isIndex] as TextBlock).Margin.Top + 50, 0, 0);
                grd.Children.Insert(grd.Children.IndexOf((TextBlock)sender) + isIndex + 1, Event); return;
            }
            grd.Children.Insert(grd.Children.IndexOf((TextBlock)sender) + 1, Event);



            // add even ClickDay
            RoutedEventArgs args = new RoutedEventArgs(CalendarCustom.ClickEvent);

            RaiseEvent(args);
            //add command
            if (Command != null)
            {
                RoutedCommand rc = Command as RoutedCommand;
                if (rc != null)
                {
                    rc.Execute(CommandParameter, CommandTarget);
                }
                else
                {
                    Command.Execute(CommandParameter);
                }
            }
        }
Beispiel #10
0
 public static void ExecuteLogout()
 {
     logoutCommand.Execute(null, null);
 }
Beispiel #11
0
 public static void ExecutebackPage()
 {
     backPage.Execute(null, null);
 }
Beispiel #12
0
        /// <summary>Replaces the current selection in the <see cref="T:System.Windows.Controls.PasswordBox" /> with the contents of the Clipboard.</summary>
        // Token: 0x0600531E RID: 21278 RVA: 0x001721A4 File Offset: 0x001703A4
        public void Paste()
        {
            RoutedCommand paste = ApplicationCommands.Paste;

            paste.Execute(null, this);
        }
Beispiel #13
0
        private void CheckStory(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            List <Warning> warns = new List <Warning>();

            foreach (var v in Story.DialogOptions.Where(x => x.TargetID.IsNullOrEmpty()))
            {
                warns.Add(new Warning("TRGNULL", $"Dialog option \"{v.Name}\" has no target.", WarningType.Warning, () =>
                {
                    (tree.ItemContainerGenerator.ContainerFromItem(Story.FindParent(v)) as TreeViewItem).IsExpanded = true;
                    v.Selected = true;
                }));
            }
            if (Story.StartDialog == null)
            {
                warns.Add(new Warning("NOSTART", "Your story has no start dialog", WarningType.Error));
            }
            if (Story.Title.IsNullOrEmpty())
            {
                warns.Add(new Warning("NAMNULL", "Your story has no name", WarningType.Error, () => ShowPropertiesCmd.Execute(null, this)));
            }
            if (Story.Description.IsNullOrEmpty())
            {
                warns.Add(new Warning("DSCNULL", "Your story has no description", WarningType.Warning, () => ShowPropertiesCmd.Execute(null, this)));
            }
            Dispatcher.Invoke(() =>
            {
                errors.ItemsSource = warns;
                txtWarnings.Text   = warns.Where(x => x.Type == WarningType.Warning).Count().ToString();
                txtErrors.Text     = warns.Where(x => x.Type == WarningType.Error).Count().ToString();
            });
        }
Beispiel #14
0
 public void ToolBarButtonPatientLink_Click(object sender, RoutedEventArgs e)
 {
     PatientLinkingCommand.Execute(null, null);
 }
Beispiel #15
0
 public void ToolBarButtonAssign_Click(object sender, RoutedEventArgs args)
 {
     this.m_MainWindowCommandButtonHandler.OnAssignCase();
     AssignCommand.Execute(null, null);
 }
Beispiel #16
0
 private void RunOnEmulatorCmdExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     TranslateToEmulatorCCmd.Execute(null, this);
     BuildEmulatorCmd.Execute(null, this);
     RunEmulatorCmd.Execute(null, this);
 }
Beispiel #17
0
 private void StatusBarItemMC_MouseDown(object sender, MouseButtonEventArgs e)
 {
     WinAvrConfigCmd.Execute(null, this);
 }
Beispiel #18
0
        //------------------------------------------------------
        //
        //  Public Methods
        //
        //------------------------------------------------------

        #region Public Methods

        /// <summary>
        /// Replaces the current selection in the passwordbox with the contents
        /// of the Clipboard
        /// </summary>
        public void Paste()
        {
            RoutedCommand command = ApplicationCommands.Paste;

            command.Execute(null, this);
        }
Beispiel #19
0
 void ExecutedRoutedCommandHandler(RoutedCommand command, object parameter)
 {
     command.Execute(parameter, this);
 }
 public static void MoveItemToNewWindow(DragablzItem dragablzItem) => MoveItemToNewWindowCommand.Execute(dragablzItem, dragablzItem);
 public static void CloseItem(DragablzItem dragablzItem) => CloseItemCommand.Execute(dragablzItem, dragablzItem);
 public void ExecuteCommand(RoutedCommand command, object commandParameter)
 {
     command.Execute(commandParameter, ProxiedElement);
 }
 public static void CloseFollowingItems(DragablzItem dragablzItem) => CloseFollowingItemsCommand.Execute(dragablzItem, dragablzItem);
 /// <summary>
 /// Executes the wrapped <see cref="RoutedCommand"/>.
 /// </summary>
 public void Execute(object parameter)
 {
     _originalCommand.Execute(parameter, _target);
 }