예제 #1
0
 public TemplateDialogViewModel()
 {
     m_showCloseButton = false;
       m_runCommand = new ManualCommand(Run);
       m_browseForFileCommand = new GenericManualCommand<TemplateParameterViewModel>(BrowseForFile);
       m_canClose = CloseAutoComplete;
 }
예제 #2
0
 public FolderBrowserDialogViewModel()
 {
     m_browsForFolderCommand = new ManualCommand(BrowseForFolder);
       m_okCommand = new ManualCommand(() => { m_canceled = false; IsShown = false;});
       m_cancelCommand = new ManualCommand(() => { IsShown = false; });
       m_showCloseButton = false;
 }
예제 #3
0
 public ReloadFilesDialogViewModel()
 {
     m_showCloseButton = false;
       m_ignorAllCommand = new ManualCommand(IgnoreAll);
       m_reloadAllCommand = new ManualCommand(ReloadAll);
       m_toggleCommand = new ManualCommand(() => { if (m_selectedFile != null) m_selectedFile.IsChecked = !m_selectedFile.IsChecked;});
       m_reloadSelectedCommand = new ManualCommand(ReloadSelected);
 }
예제 #4
0
 public FileSearchDialogViewModel(MainViewModel mainViewModel)
 {
     m_mainViewModel = mainViewModel;
       m_filteredFiles = new FilteredObservableCollection<FileViewModel>(null, n => n.Name.Contains(m_searchString));
       m_showCloseButton = false;
       m_openCommand = new ManualCommand(OpenFile);
       m_changeIndexCommand = new GenericManualCommand<int>(ChangeIndex, null, n => int.Parse((string) n));
 }
예제 #5
0
 public ImageViewerViewModel()
 {
     m_rotateLeftCommand = new ManualCommand(RotateLeft);
       m_rotateRightCommand = new ManualCommand(RotateRight);
       m_applySizeCommand = new ManualCommand(Resize);
       m_mouseDownCommand = new ManualCommand(MouseDown);
       m_mouseUpCommand = new ManualCommand(MouseUp);
       m_cropCommand = new ManualCommand(Crop);
 }
예제 #6
0
 public BaseDialogViewModel()
 {
     m_closeCommand = new ManualCommand(() => IsShown = false);
 }
예제 #7
0
        public BaseTextEditorViewModel(MainViewModel mainViewModel)
        {
            m_mainViewModel = mainViewModel;
              SetHighLight(Properties.Resources.Json_Mode, new[] {".json"}, "Json highlighting");
              SetHighLight(Properties.Resources.CSharp_Mode, new[] { ".cs" }, "C# highlighting");
              SetHighLight(Properties.Resources.CPP_Mode, new[] { ".c", ".h", ".cpp", ".hpp" }, "c/c++ highlighting");
              SetHighLight(Properties.Resources.CSS_Mode, new[] { ".css" }, "Css highlighting");
              SetHighLight(Properties.Resources.HTML_Mode, new[] { ".html", ".htm" }, "Html highlighting");
              SetHighLight(Properties.Resources.JavaScript_Mode, new[] { ".js" }, "Javascript highlighting");
              SetHighLight(Properties.Resources.XmlDoc, new[] { ".xml", ".xshd" }, "Xml highlighting");
              SetHighLight(Properties.Resources.Lua, new[] { ".lua", ".luac" }, "Lua highlighting");

              m_textDocument = new TextDocument();
              m_textDocument.TextChanged += TextDocumentOnTextChanged;

              m_findNextCommand = new ManualCommand(FindNext);
              m_replaceCommand = new ManualCommand(Replace);
              m_replaceAllCommand = new ManualCommand(ReplaceAll);
              m_settningsSchema = GetSettingsSchema(m_mainViewModel.SchemaManager);
              Settings = GetSettings();
        }
예제 #8
0
    public MainViewModel()
    {
      m_window = new MainWindow {DataContext = this};
      m_layoutManager = new LayoutManager(this);

      m_tabTrees = Enum.GetValues(typeof(TabTrees)).Cast<TabTrees>().ToList();
      m_closeFileCommand = new GenericManualCommand<IFileViewModel>(CloseFile);
      m_saveFileCommand = new ManualCommand(Save, () => LayoutManager.ActiveLayoutElement != null && LayoutManager.ActiveLayoutElement.SelectedFile != null && LayoutManager.ActiveLayoutElement.SelectedFile.HasUnsavedChanges);
      m_saveAllFilesCommand = new ManualCommand(SaveAll, () => LayoutManager.LayoutElements.Any(layout => layout.OpenFiles.Any(n => n.HasUnsavedChanges)));
      m_openFileViewModelCommand = new GenericManualCommand<IFileViewModel>(file => OpenFile(file));
      m_openFileCommand = new ManualCommand(OpenFile);
      m_openFolderCommand = new ManualCommand(OpenFolder);
      m_exitCommand = new ManualCommand(() => Environment.Exit(0));
      m_newFileCommand = new ManualCommand(CreateNewFile);
      m_changeSettingsPathCommand = new ManualCommand(ChangeSettingsPath);
      m_renameSelectedNodeCommand = new ManualCommand(() => m_selectedNode.IsRenaming = true);
      m_renameSelectedNodeDoneCommand = new ManualCommand(() => m_selectedNode.IsRenaming = false);
      m_renameSelectedNodeCancelCommand = new ManualCommand(() => { m_selectedNode.RenameString = null; m_selectedNode.IsRenaming = false; });
      m_createFileCommand = new GenericManualCommand<string>(s => CreateNewFileAtSelectedNode(s));
      m_reloadFilesDialogViewModel = new ReloadFilesDialogViewModel();
      m_createFolderCommand = new ManualCommand(() => CreateFolder("Newfolder"));
      m_deleteSelectedNodeCommand = new ManualCommand(DeleteSelectedNode);

      m_dialogHelper = new DialogHelper(this);
      ServiceProvider.Registre<IDialogHelper>(DialogHelper);

      if (string.IsNullOrEmpty(Properties.Settings.Default.SettingPath) ||
          !Directory.Exists(Properties.Settings.Default.SettingPath))
      {
        m_folderBrowserDialogViewModel = new FolderBrowserDialogViewModel();
        m_folderBrowserDialogViewModel.PropertyChanged += StartFolderBrowserDialogViewModelOnPropertyChanged;
        m_folderBrowserDialogViewModel.Title = "Select settings path";
        m_folderBrowserDialogViewModel.Path = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\sharpE\\settings";
        DialogHelper.ShowDialog(m_folderBrowserDialogViewModel);
      }
      else
      {
        Init();
      }
    }
예제 #9
0
 public MessageBoxViewModel(ResourceManager resourceManager = null)
 {
     m_resourceManager = resourceManager;
       m_closeCommand = new ManualCommand(Close);
 }