/// <summary> /// Конструктор по умолчанию /// </summary> public MainViewModel(Grid visualGrid) { var commandInterpreter = new CommandInterpreter(visualGrid); InitializationGridFields = new InitializationViewModel(commandInterpreter); CommandListManager = new CommandListManagerViewModel(commandInterpreter); FileManager = new FileManagerViewModel(commandInterpreter); }
public FileManagerUserControl() { EnsureApplicationResources(); InitializeComponent(); vm = new FileManagerViewModel(); base.DataContext = vm; ControlIsLoaded = true; }
private void Delete_Directory_Click(object sender, RoutedEventArgs e) { var nodePath = ((INode)((ContextMenu)((MenuItem)sender).Parent).DataContext).Path.ToString(); Directory.Delete(nodePath); var newVm = new FileManagerViewModel(); newVm.SetRoot(vm.Root.Path); vm = newVm; DataContext = newVm; }
private void Delete_File_Click(object sender, RoutedEventArgs e) { var nodePath = ((INode)((ContextMenu)((MenuItem)sender).Parent).DataContext).Path.ToString(); File.SetAttributes(nodePath, File.GetAttributes(nodePath) & ~FileAttributes.ReadOnly); File.Delete(nodePath); var newVm = new FileManagerViewModel(); newVm.SetRoot(vm.Root.Path); vm = newVm; DataContext = newVm; }
public CheckListGroupsView() { InitializeComponent(); var viewModel = new FileManagerViewModel(); viewModel.Navigation = this.Navigation; this.BindingContext = viewModel; //treeView.ItemTapped += TreeView_ItemTapped; //treeView.ItemHolding += TreeView_ItemHolding; }
private void Create_Click(object sender, RoutedEventArgs e) { var nodePath = ((INode)((ContextMenu)((MenuItem)sender).Parent).DataContext).Path.ToString(); var dialog = new CreateFileWindow(nodePath); dialog.ShowDialog(); if (dialog.DialogResult == true) { var newVm = new FileManagerViewModel(); newVm.SetRoot(vm.Root.Path); vm = newVm; DataContext = newVm; } }
// // GET: /AdminContent/FileManager/ public ActionResult Index() { string path = Request.QueryString["path"] ?? string.Empty; string cleanPath = DiskStorage.FileManagerCleanPath(path); FileManagerViewModel model = new FileManagerViewModel(cleanPath); model.Directories = DiskStorage.FileManagerListDirectories(MTApp.CurrentStore.Id, cleanPath); model.Files = DiskStorage.FileManagerListFiles(MTApp.CurrentStore.Id, cleanPath); model.BreadCrumbs = BuildBreadCrumbs(cleanPath); model.BasePreviewUrl = "~/images/sites/" + MTApp.CurrentStore.Id + "/"; return(View(model)); }
// // GET: /AdminContent/FileManager/ public ActionResult Index() { var path = Request.QueryString["path"] ?? string.Empty; var cleanPath = DiskStorage.FileManagerCleanPath(path); var model = new FileManagerViewModel(cleanPath) { Directories = DiskStorage.FileManagerListDirectories(HccApp.CurrentStore.Id, cleanPath), Files = DiskStorage.FileManagerListFiles(HccApp.CurrentStore.Id, cleanPath), BreadCrumbs = BuildBreadCrumbs(cleanPath), BasePreviewUrl = DiskStorage.GetStoreDataPhysicalPath(HccApp.CurrentStore.Id) }; return(View(model)); }
// // GET: /AdminContent/FileManager/ public ActionResult Index() { string path = Request.QueryString["path"] ?? string.Empty; string cleanPath = DiskStorage.FileManagerCleanPath(path); FileManagerViewModel model = new FileManagerViewModel(cleanPath); model.Directories = DiskStorage.FileManagerListDirectories(MTApp.CurrentStore.Id, cleanPath); model.Files = DiskStorage.FileManagerListFiles(MTApp.CurrentStore.Id, cleanPath); model.BasePreviewUrl = "~/images/sites/" + MTApp.CurrentStore.Id + "/"; var breadRender = new code.TemplateEngine.TagHandlers.BreadCrumbs(); ViewBag.BreadCrumbsFinal = breadRender.Render(MTApp, BuildBreadCrumbs(cleanPath)); return(View(model)); }
public FileLoader() { InitializeComponent(); DataContext = new FileManagerViewModel(); }
private void Open_Click(object sender, RoutedEventArgs e) { vm = new FileManagerViewModel(); vm.SetRoot(); DataContext = vm; }