Beispiel #1
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);
        }
Beispiel #2
0
        public ServerModel(ServerModel S)
        {
            Name       = S.Name;
            ID         = S.ID;
            Notes      = S.Notes;
            PrivateKey = S.PrivateKey;
            Password   = S.Password;
            Passphrase = S.Passphrase;
            Username   = S.Username;
            Host       = S.Host;
            Port       = S.Port;
            Type       = S.Type;

            List <FolderModel> Folders = new List <FolderModel>();

            foreach (FolderModel F in S.Folders)
            {
                Folders.Add(new FolderModel(F));
            }
        }