Пример #1
0
        /// creates a new copy of a FolderModel object

        /**
         * DuplicateFolder creates an copy of the object.
         * The new object has differnt ID and Name as the original.
         * The Folder.Status is unmounted.
         *
         *
         * @return new FolderModel object
         *
         */
        public FolderModel DuplicateFolder()
        {
            FolderModel r = (FolderModel)this.MemberwiseClone();

            r.ID     = Guid.NewGuid();
            r.Status = DriveStatus.Unmounted;
            return(r);
        }
Пример #2
0
        /// creates a new copy of a ServerModel object

        /**
         * DuplicateServer creates an copy of the object.
         * The new object has differnt ID and Name as the original.
         * The folderlist is copied as well. The ID's and names are
         * different, too. The Folder.Status is unmounted.
         *
         *
         * @return new ServerModel object
         *
         */
        public ServerModel DuplicateServer()
        {
            ServerModel r = (ServerModel)this.MemberwiseClone();

            r.ID = Guid.NewGuid();

            r.Folders = new List <FolderModel>();
            foreach (FolderModel F in this.Folders)
            {
                FolderModel nF = F.DuplicateFolder();
                r.Folders.Add(nF);
                nF.ID     = Guid.NewGuid();
                nF.Status = DriveStatus.Unmounted;
            }

            return(r);
        }
Пример #3
0
 public void Set(FolderModel F)
 {
     use_global_login = F.use_global_login;
     ID                 = F.ID;
     Name               = F.Name;
     Note               = F.Note;
     Folder             = F.Folder;
     Letter             = F.Letter;
     Username           = F.Username;
     Password           = F.Password;
     Passphrase         = F.Passphrase;
     PrivateKey         = F.PrivateKey;
     Status             = F.Status;
     Type               = F.Type;
     VirtualDriveFolder = F.VirtualDriveFolder;
     use_virtual_drive  = F.use_virtual_drive;
     Automount          = F.Automount;
 }
Пример #4
0
 public FolderModel(FolderModel F)
 {
     this.Set(F);
 }