Exemple #1
0
        /// <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;
        }
Exemple #3
0
        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;
        }
Exemple #4
0
        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;
        }
Exemple #5
0
        public CheckListGroupsView()
        {
            InitializeComponent();

            var viewModel = new FileManagerViewModel();

            viewModel.Navigation = this.Navigation;
            this.BindingContext  = viewModel;


            //treeView.ItemTapped += TreeView_ItemTapped;
            //treeView.ItemHolding += TreeView_ItemHolding;
        }
Exemple #6
0
        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;
            }
        }
Exemple #7
0
        //
        // 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));
        }
Exemple #8
0
        //
        // 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));
        }
Exemple #9
0
        //
        // 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));
        }
Exemple #10
0
 public FileLoader()
 {
     InitializeComponent();
     DataContext = new FileManagerViewModel();
 }
Exemple #11
0
 private void Open_Click(object sender, RoutedEventArgs e)
 {
     vm = new FileManagerViewModel();
     vm.SetRoot();
     DataContext = vm;
 }