Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 5
0
        public CheckListGroupsView()
        {
            InitializeComponent();

            var viewModel = new FileManagerViewModel();

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


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