Exemplo n.º 1
0
 /*
  * --------------------------- Command Implementation ------------------------------
  */
 /// Closes the window provided as a parameter
 public static void CloseWindowCommandExecute(object sender, ExecutedRoutedEventArgs e){
     ((Window)e.Parameter).Close();
 }
Exemplo n.º 2
0
 public void HorizontallyMirror(object sender, ExecutedRoutedEventArgs e)
 {
     ImageHelper.MirrorHorizontally();
 }
Exemplo n.º 3
0
 private void ExtendedLaplacianFilter(object sender, ExecutedRoutedEventArgs e)
 {
     ImageHelper.ExtendedLaplacianFilter();
 }
Exemplo n.º 4
0
 public void GrayscaleHistogramEqualization(object sender, ExecutedRoutedEventArgs e)
 {
     ImageHelper.GrayscaleHistogramEqualization();
 }
Exemplo n.º 5
0
 public void LightnessHistogramEqualization(object sender, ExecutedRoutedEventArgs e)
 {
     ImageHelper.LightnessHistogramEqualization();
 }
Exemplo n.º 6
0
 private void ExitCmd_OnExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     Close();
     Environment.Exit(0);
 }
Exemplo n.º 7
0
 /// <summary>
 /// View help for this editor
 /// </summary>
 /// <param name="sender">The sender of the event</param>
 /// <param name="e">The event arguments</param>
 private void cmdHelp_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     Utility.ShowHelpTopic("3dd5fe3b-1bc3-42e5-8900-56165e3f9aed");
 }
Exemplo n.º 8
0
 public static void DoInvokeViewModel(object sender, ExecutedRoutedEventArgs e)
 {
     ViewModelHelper.InvokeDataContext(sender, e);
 }
Exemplo n.º 9
0
        private void ApplyCommandExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            var settings = SelectedSettings;

            if (SettingsPanel.IsLocal == settings.UseLocal &&
                //SettingsPanel.IsAlphabetic == settings.IsAlphabetic &&
                (SettingsPanel.IsLocal ? SettingsPanel.Path : SettingsPanel.Address) == settings.Path &&
                SettingsPanel.Login == settings.Credentials.Login &&
                SettingsPanel.Password == settings.Credentials.Password)
            {
                return;
            }

            settings.UseLocal = SettingsPanel.IsLocal;
            //settings.IsAlphabetic = SettingsPanel.IsAlphabetic;
            settings.Path = SettingsPanel.IsLocal ? SettingsPanel.Path : SettingsPanel.Address;
            settings.Credentials.Login    = SettingsPanel.Login;
            settings.Credentials.Password = SettingsPanel.Password;

            if (SettingsPanel.IsLocal)
            {
                if (!Directory.Exists(settings.Path))
                {
                    var res = new MessageBoxBuilder()
                              .Owner(this)
                              .Text(LocalizedStrings.Str3263)
                              .Warning()
                              .YesNo()
                              .Show();

                    if (res != MessageBoxResult.Yes)
                    {
                        return;
                    }
                }
            }
            else
            {
                var wnd = new MarketDataConfirmWindow
                {
                    SecurityTypes = new[]
                    {
                        SecurityTypes.Currency,
                        SecurityTypes.Index,
                        SecurityTypes.Stock,
                        SecurityTypes.Future
                    }
                };

                if (wnd.ShowModal(this))
                {
                    BusyIndicator.IsBusy = true;

                    var progress = BusyIndicator.FindVisualChild <ProgressBar>();
                    var cancel   = (Button)BusyIndicator.FindVisualChild <StackPanel>().Children[2];

                    var secTypes = wnd.SecurityTypes.ToArray();

                    progress.Maximum = secTypes.Length;
                    cancel.Click    += (s1, e1) =>
                    {
                        _isCancelled         = true;
                        BusyIndicator.IsBusy = false;
                    };

                    new RefreshSecurities(settings, secTypes,
                                          () => _isCancelled,
                                          count => this.GuiAsync(() => progress.Value = count),
                                          count => this.GuiAsync(() =>
                    {
                        BusyIndicator.IsBusy = false;

                        new MessageBoxBuilder()
                        .Owner(this)
                        .Text(LocalizedStrings.Str3264Params.Put(count))
                        .Show();

                        RefreshGrid();
                    })).Process(this);
                }
            }

            ConfigManager.GetService <MarketDataSettingsCache>().Save();
        }
Exemplo n.º 10
0
 private void NewProject_Execute(object sender, ExecutedRoutedEventArgs e)
 {
     CreateNewProject();
 }
Exemplo n.º 11
0
 private void SaveProject_Execute(object sender, ExecutedRoutedEventArgs e)
 {
     SaveProject();
 }
Exemplo n.º 12
0
 private void Undo_Execute(object sender, ExecutedRoutedEventArgs e)
 {
     TaskNavigator.TaskManager.Undo();
 }
Exemplo n.º 13
0
 private void Search_Execute(object sender, ExecutedRoutedEventArgs e)
 {
     toolBoxSearchBar.Focus();
 }
Exemplo n.º 14
0
        private async void RunDebug_Execute(object sender, ExecutedRoutedEventArgs e)
        {
            // TODO: Compile
            var proj = this.Model.SelectedProject;

            if (proj == null)
            {
                MessageBox.Show("대상 프로젝트를 찾을 수 없습니다.", "DeXign", MessageBoxButton.OK);
                return;
            }

            GlobalModel.Instance.IsDebugging     = true;
            GlobalModel.Instance.CompileProgress = 0;

            messagePanel.Show();

            await t.Task.Delay(300);

            // 저장
            proj.Save();

            // 컴파일 옵션
            var dxCompileOption = new DXCompileOption()
            {
                ApplicationName = proj.Manifest.ProjectName,
                RootNamespace   = proj.Manifest.PackageName,
                TargetPlatform  = this.Model.StoryboardPage.Model.SelectedPlatform,
                Directory       = $"{Path.GetDirectoryName(proj.FileName)}"
            };

            PContentPage[] screens     = proj.Screens.ToArray();
            PBinderHost[]  binderHosts = screens
                                         .Select(s => s.GetRenderer())                                   // PContentPage -> IRenderer
                                         .SelectMany(r => r.FindChildrens <IRenderer>())                 // 모든 렌더러 자식 (하위 포함)
                                         .Where(r => r.ProvideValue().Items.Sum(b => b.Items.Count) > 0) // 연결된 아이템들
                                         .Select(r => r.ProvideValue() as PBinderHost)                   // BinderHost 선택
                                         .ToArray();

            BaseCompilerService service =
                DXCompiler.GetCompilerService(dxCompileOption.TargetPlatform).FirstOrDefault();

            // 컴파일 프로그레스 등록
            service.ProgressChanged += Compile_ProgressChanged;

            DXCompileResult result = await DXCompiler.Compile(
                new DXCompileParameter(dxCompileOption, screens, binderHosts));

            // 컴파일 프로그레스 등록해제
            service.ProgressChanged -= Compile_ProgressChanged;

            messagePanel.Hide();

            if (result.IsSuccess)
            {
                await OnCompileSuccess(result);
            }
            else
            {
                OnCompileError(result);
            }
        }
Exemplo n.º 15
0
        }// end:CloseDocument

        // ----------------------------- OnPrint ------------------------------
        /// <summary>
        ///   Handles the user "File | Print" menu operation.</summary>
        private void OnPrint(object target, ExecutedRoutedEventArgs args)
        {
            PrintDocument();
        }// end:OnClose()
Exemplo n.º 16
0
 private void ExecutedLogin(object sender, ExecutedRoutedEventArgs e)
 {
     TryLogin();
 }
Exemplo n.º 17
0
 private void CloseCommand_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     CustomControl.CommonFunction.CloseUserControl(this);
 }
Exemplo n.º 18
0
 private void ExitCommand_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     Application.Current.Shutdown();
 }
Exemplo n.º 19
0
 public void OnNew(object sender, ExecutedRoutedEventArgs e)
 {
     _files.Add(new FileViewModel());
     ActiveDocument = _files.Last();
 }
Exemplo n.º 20
0
 // Restore
 private void CommandBinding_Executed_Restore(object sender, ExecutedRoutedEventArgs e)
 {
     SystemCommands.RestoreWindow(this);
 }
Exemplo n.º 21
0
 private void SaveExecuted(object sender, ExecutedRoutedEventArgs e)
 {
     domainModel.Save();
 }
Exemplo n.º 22
0
 // Close
 private void CommandBinding_Executed_Close(object sender, ExecutedRoutedEventArgs e)
 {
     // SystemCommands.CloseWindow(this);
 }
Exemplo n.º 23
0
 public void SaturationHistogramEqualization(object sender, ExecutedRoutedEventArgs e)
 {
     ImageHelper.SaturationHistogramEqualization();
 }
 private void OnMinimizeWindow(object target, ExecutedRoutedEventArgs e)
 {
     SystemCommands.MinimizeWindow(this);
 }
Exemplo n.º 25
0
 public void LightnessLinearStretch(object sender, ExecutedRoutedEventArgs e)
 {
     ImageHelper.LightnessLinearStretch();
 }
 private void OnRestoreWindow(object target, ExecutedRoutedEventArgs e)
 {
     SystemCommands.RestoreWindow(this);
 }
Exemplo n.º 27
0
 public void VerticallyMirror(object sender, ExecutedRoutedEventArgs e)
 {
     ImageHelper.MirrorVertically();
 }
Exemplo n.º 28
0
 private void ViewCommand_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     onView();
 }
Exemplo n.º 29
0
 private void SaveImage(object sender, ExecutedRoutedEventArgs e)
 {
     ImageHelper.Save();
 }
Exemplo n.º 30
0
 private void HelpCommand_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     onHelp();
 }
Exemplo n.º 31
0
 private void ExecuteCustomCommand(object sender, ExecutedRoutedEventArgs e)
 {
     MessageBox.Show(string.Format("My custom command: Find {0}", e.Parameter));
 }
Exemplo n.º 32
0
 private void InstallPip_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     InstallPip_ExecutedAsync(sender, e).DoNotWait();
 }