Exemplo n.º 1
0
        public void Menu_View(object sender, EventArgs args)
        {
            var node = sender as IViewParams;
            if (node == null)
                return;

            var view = new StorageView(UI, Storage, node.GetUser(), node.GetProject());

            UI.ShowView(view, node.IsExternal());
        }
Exemplo n.º 2
0
        public LockMessage(StorageView view, LockErrorType type, List <LockError> errors)
        {
            InitializeComponent();

            ParentView = view;
            Storages   = view.Storages;
            Type       = type;
            Errors     = errors;

            RootPath = view.Storages.GetRootPath(view.UserID, view.ProjectID);
        }
Exemplo n.º 3
0
        public LockMessage(StorageView view, LockErrorType type, List<LockError> errors)
        {
            InitializeComponent();

            ParentView = view;
            Storages = view.Storages;
            Type = type;
            Errors = errors;

            RootPath = view.Storages.GetRootPath(view.UserID, view.ProjectID);
        }
Exemplo n.º 4
0
        public FileItem(StorageView view, FolderNode parent, StorageFile file, bool temp)
        {
            View = view;
            Folder = parent;

            SubItems.Add("");
            SubItems.Add("");

            Details = file;
            Temp = temp;

            UpdateInterface();
        }
Exemplo n.º 5
0
        public void Menu_View(object sender, EventArgs args)
        {
            var node = sender as IViewParams;

            if (node == null)
            {
                return;
            }

            var view = new StorageView(UI, Storage, node.GetUser(), node.GetProject());

            UI.ShowView(view, node.IsExternal());
        }
Exemplo n.º 6
0
        public DetailsForm(StorageView view, FolderNode folder)
        {
            InitializeComponent();

            View = view;
            Trust = View.Trust;
            TargetFolder = folder;

            EnableControls(View.Working != null);

            NameBox.Text = folder.Text;

            SizeLabel.Text = "Contains " + Utilities.CommaIze(CalculateFolderSize(folder, 0)) + " Bytes";

            LoadVis(folder.Details.Scope);
        }
Exemplo n.º 7
0
        public DetailsForm(StorageView view, FolderNode folder)
        {
            InitializeComponent();

            View         = view;
            Trust        = View.Trust;
            TargetFolder = folder;

            EnableControls(View.Working != null);

            NameBox.Text = folder.Text;

            SizeLabel.Text = "Contains " + Utilities.CommaIze(CalculateFolderSize(folder, 0)) + " Bytes";

            LoadVis(folder.Details.Scope);
        }
Exemplo n.º 8
0
        public FileItem(StorageView view, FolderNode folder)
        {
            View = view;
            Folder = folder;

            SubItems.Add("");
            SubItems.Add("");

            IsFolder = true;
            ImageIndex = folder.Details.IsFlagged(StorageFlags.Archived) ? 3 : 2;

            Details = folder.Details;
            Changes = folder.Changes;
            Temp = folder.Temp;

            UpdateInterface();
        }
Exemplo n.º 9
0
        public DetailsForm(StorageView view, FolderNode folder, FileItem file)
        {
            InitializeComponent();

            View = view;
            Core = View.Core;
            Trust = View.Trust;

            TargetFolder = folder;
            TargetFile = file;

            EnableControls(View.Working != null);

            NameBox.Text = file.Text;

            SizeLabel.Text = Utilities.CommaIze(((StorageFile)file.Details).InternalSize) + " Bytes";

            LoadVis(file.Details.Scope);
        }
Exemplo n.º 10
0
        public DetailsForm(StorageView view, FolderNode folder, FileItem file)
        {
            InitializeComponent();

            View  = view;
            Core  = View.Core;
            Trust = View.Trust;

            TargetFolder = folder;
            TargetFile   = file;

            EnableControls(View.Working != null);

            NameBox.Text = file.Text;

            SizeLabel.Text = Utilities.CommaIze(((StorageFile)file.Details).InternalSize) + " Bytes";

            LoadVis(file.Details.Scope);
        }
Exemplo n.º 11
0
        public UnlockForm(StorageView view)
        {
            InitializeComponent();

            View = view;

            // label
            string text = "Unlock ";

            text += View.Trust.GetProjectName(View.ProjectID) + "'s ";
            text += "File System to";

            MainLabel.Text = text;

            // link
            text = View.Core.User.RootPath + Path.DirectorySeparatorChar + View.Trust.GetProjectName(View.ProjectID) + " Storage";

            PathLink.Text = text;
        }
Exemplo n.º 12
0
        public UnlockForm(StorageView view)
        {
            InitializeComponent();

            View = view;

            // label
            string text = "Unlock ";

            text += View.Trust.GetProjectName(View.ProjectID) + "'s ";
            text += "File System to";

            MainLabel.Text = text;

            // link
            text = View.Core.User.RootPath + Path.DirectorySeparatorChar + View.Trust.GetProjectName(View.ProjectID) + " Storage";

            PathLink.Text = text;
        }
Exemplo n.º 13
0
        public static void Alert(StorageView view, List <LockError> errors)
        {
            if (errors.Count == 0)
            {
                return;
            }

            List <LockError> temps   = new List <LockError>();
            List <LockError> blocked = new List <LockError>();

            List <LockError> unexpected = new List <LockError>();
            List <LockError> existing   = new List <LockError>();
            List <LockError> missing    = new List <LockError>();


            foreach (LockError error in errors)
            {
                switch (error.Type)
                {
                case LockErrorType.Temp:
                    temps.Add(error);
                    break;

                case LockErrorType.Blocked:
                    blocked.Add(error);
                    break;

                case LockErrorType.Unexpected:
                    unexpected.Add(error);
                    break;

                case LockErrorType.Existing:
                    existing.Add(error);
                    break;

                case LockErrorType.Missing:
                    missing.Add(error);
                    break;
                }
            }


            LockMessage message = null;

            while (temps.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Temp, temps);
                message.ShowDialog(view);
                temps = message.NewErrors;
            }

            while (blocked.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Blocked, blocked);
                message.ShowDialog(view);
                blocked = message.NewErrors;
            }

            while (unexpected.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Unexpected, unexpected);
                message.ShowDialog(view);
                unexpected = message.NewErrors;
            }

            while (existing.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Existing, existing);
                message.ShowDialog(view);
                existing = message.NewErrors;
            }

            while (missing.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Missing, missing);
                message.ShowDialog(view);
                missing = message.NewErrors;
            }
        }
Exemplo n.º 14
0
        //Nodes - contains sub-folders
        public FolderNode(StorageView view, StorageFolder folder, TreeListNode parent, bool temp)
        {
            Parent = parent; // needs to be set because some nodes (archived) aren't proper children of parents (not in Nodes list), still needed though so getPath works

            if (parent == null)
                throw new Exception("Parent set to null");

            View = view;

            Details = folder;
            Temp = temp;

            Update();
        }
Exemplo n.º 15
0
        public static void Alert(StorageView view, List<LockError> errors)
        {
            if (errors.Count == 0)
                return;

            List<LockError> temps = new List<LockError>();
            List<LockError> blocked = new List<LockError>();

            List<LockError> unexpected = new List<LockError>();
            List<LockError> existing = new List<LockError>();
            List<LockError> missing = new List<LockError>();

            foreach (LockError error in errors)
                switch (error.Type)
                {
                    case LockErrorType.Temp:
                        temps.Add(error);
                        break;

                    case LockErrorType.Blocked:
                        blocked.Add(error);
                        break;

                    case LockErrorType.Unexpected:
                        unexpected.Add(error);
                        break;

                    case LockErrorType.Existing:
                        existing.Add(error);
                        break;

                    case LockErrorType.Missing:
                        missing.Add(error);
                        break;
                }

            LockMessage message = null;

            while (temps.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Temp, temps);
                message.ShowDialog(view);
                temps = message.NewErrors;
            }

            while (blocked.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Blocked, blocked);
                message.ShowDialog(view);
                blocked = message.NewErrors;
            }

            while (unexpected.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Unexpected, unexpected);
                message.ShowDialog(view);
                unexpected = message.NewErrors;
            }

            while (existing.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Existing, existing);
                message.ShowDialog(view);
                existing = message.NewErrors;
            }

            while (missing.Count > 0)
            {
                message = new LockMessage(view, LockErrorType.Missing, missing);
                message.ShowDialog(view);
                missing = message.NewErrors;
            }
        }