コード例 #1
0
        /// <summary>
        /// Start the archive.
        /// </summary>
        /// <param name="archive">The <see cref="PartitionArchive"/> to start.</param>
        public override void Start(PartitionArchive archive)
        {
            _partitionArchive = archive;

            LoadServerPartition();

            _nasPath = string.Empty;

            //Nas Archive specific Xml data.
            XmlElement element = archive.ConfigurationXml.DocumentElement;

            foreach (XmlElement node in element.ChildNodes)
            {
                switch (node.Name)
                {
                case "RootDir": _nasPath = node.InnerText; break;

                case "MinimumAvailableSpace": MinimumAvailableSpace = long.Parse(node.InnerText); break;
                }
            }

            // Start the restore service
            _restoreService = new NasRestoreService("NAS Restore", this);
            _restoreService.StartService();

            // If not "readonly", start the archive service.
            if (!_partitionArchive.ReadOnly)
            {
                _archiveService = new NasArchiveService("NAS Archive", this);
                _archiveService.StartService();
            }
        }
コード例 #2
0
        /// <summary>
        /// Stop the archive.
        /// </summary>
        public override void Stop()
        {
            if (_restoreService != null)
            {
                _restoreService.StopService();
                _restoreService = null;
            }

            if (_archiveService != null)
            {
                _archiveService.StopService();
                _archiveService = null;
            }
        }
コード例 #3
0
		/// <summary>
		/// Stop the archive.
		/// </summary>
		public override void Stop()
		{
			if (_restoreService != null)
			{
				_restoreService.StopService();
				_restoreService = null;
			}

			if (_archiveService != null)
			{
				_archiveService.StopService();
				_archiveService = null;
			}
		}
コード例 #4
0
		/// <summary>
		/// Start the archive.
		/// </summary>
		/// <param name="archive">The <see cref="PartitionArchive"/> to start.</param>
		public override void Start(PartitionArchive archive)
		{
			_partitionArchive = archive;

			LoadServerPartition();
		
			_nasPath = string.Empty;

			//Nas Archive specific Xml data.
			XmlElement element = archive.ConfigurationXml.DocumentElement;
			foreach (XmlElement node in element.ChildNodes)
			{
                switch (node.Name)
                {
                    case "RootDir": _nasPath = node.InnerText; break;
                    case "MinimumAvailableSpace": MinimumAvailableSpace = long.Parse(node.InnerText); break;
                 }
            }
			
			// Start the restore service
			_restoreService = new NasRestoreService("NAS Restore", this);
			_restoreService.StartService();

			// If not "readonly", start the archive service.
			if (!_partitionArchive.ReadOnly)
			{
				_archiveService = new NasArchiveService("NAS Archive", this);	
				_archiveService.StartService();
			}			
		}