示例#1
0
        public void Startup()
        {
            char?driveLetter = _settings.Settings.DriveLetter;

            if (!driveLetter.HasValue)
            {
                // First time initialization
                driveLetter = GetDefaultDriveLetter();
            }

            _settings.SettingsChanged += Restart;

            if (driveLetter.HasValue)
            {
                _dokanExecutor = Dokan.Dokan.Install(driveLetter.Value);
            }

            if (_dokanExecutor == null)
            {
                ServiceRegistration.Get <ILogger>().Warn("ResourceMountingService: Due to problems in DOKAN, resources cannot be mounted into the local filesystem");
            }
            else
            {
                // We share the same synchronization object to avoid multithreading issues between the two classes
                _syncObj = _dokanExecutor.SyncObj;
            }
        }
 public void Shutdown()
 {
     if (_dokanExecutor == null)
     {
         return;
     }
     _dokanExecutor.Dispose();
     _dokanExecutor = null;
 }
示例#3
0
 public void Shutdown()
 {
     _settings.SettingsChanged -= Restart;
     if (_dokanExecutor == null)
     {
         return;
     }
     _dokanExecutor.Dispose();
     _dokanExecutor = null;
 }
        public void Startup()
        {
            IPathManager pathManager = ServiceRegistration.Get <IPathManager>();
            string       mountPoint  = pathManager.GetPath("<REMOTERESOURCES>");

            if (!Directory.Exists(mountPoint))
            {
                Directory.CreateDirectory(mountPoint);
            }

            _dokanExecutor = Dokan.Dokan.Install(mountPoint);

            if (_dokanExecutor == null)
            {
                ServiceRegistration.Get <ILogger>().Warn("ResourceMountingService: Due to problems in DOKAN, resources cannot be mounted into the local filesystem");
            }
            else
            {
                // We share the same synchronization object to avoid multithreading issues between the two classes
                _syncObj = _dokanExecutor.SyncObj;
            }
        }
        public void Startup()
        {
            char?driveLetter = ReadDriveLetterFromSettings();

            if (!driveLetter.HasValue)
            {
                ISystemResolver systemResolver = ServiceRegistration.Get <ISystemResolver>();
                driveLetter = systemResolver.SystemType == SystemType.Server ? ResourceMountingSettings.DEFAULT_DRIVE_LETTER_SERVER :
                              ResourceMountingSettings.DEFAULT_DRIVE_LETTER_CLIENT;
                // Save the current default setting to be able to change it in config file
                SaveDefaultDriveSettings(driveLetter.Value);
            }
            _dokanExecutor = Dokan.Dokan.Install(driveLetter.Value);
            if (_dokanExecutor == null)
            {
                ServiceRegistration.Get <ILogger>().Warn("ResourceMountingService: Due to problems in DOKAN, resources cannot be mounted into the local filesystem");
            }
            else
            {
                // We share the same synchronization object to avoid multithreading issues between the two classes
                _syncObj = _dokanExecutor.SyncObj;
            }
        }
    public void Startup()
    {
      char? driveLetter = _settings.Settings.DriveLetter;
      if (!driveLetter.HasValue)
        // First time initialization
        driveLetter = GetDefaultDriveLetter();

      _settings.SettingsChanged += Restart;

      if (driveLetter.HasValue)
        _dokanExecutor = Dokan.Dokan.Install(driveLetter.Value);

      if (_dokanExecutor == null)
        ServiceRegistration.Get<ILogger>().Warn("ResourceMountingService: Due to problems in DOKAN, resources cannot be mounted into the local filesystem");
      else
        // We share the same synchronization object to avoid multithreading issues between the two classes
        _syncObj = _dokanExecutor.SyncObj;
    }
 public void Shutdown()
 {
   _settings.SettingsChanged -= Restart;
   if (_dokanExecutor == null)
     return;
   _dokanExecutor.Dispose();
   _dokanExecutor = null;
 }
 public void Shutdown()
 {
   if (_dokanExecutor == null)
     return;
   _dokanExecutor.Dispose();
   _dokanExecutor = null;
 }
 public void Startup()
 {
   char? driveLetter = ReadDriveLetterFromSettings();
   if (!driveLetter.HasValue)
   {
     ISystemResolver systemResolver = ServiceRegistration.Get<ISystemResolver>();
     driveLetter = systemResolver.SystemType == SystemType.Server ? ResourceMountingSettings.DEFAULT_DRIVE_LETTER_SERVER :
         ResourceMountingSettings.DEFAULT_DRIVE_LETTER_CLIENT;
     // Save the current default setting to be able to change it in config file
     SaveDefaultDriveSettings(driveLetter.Value);
   }
   _dokanExecutor = Dokan.Dokan.Install(driveLetter.Value);
   if (_dokanExecutor == null)
     ServiceRegistration.Get<ILogger>().Warn("ResourceMountingService: Due to problems in DOKAN, resources cannot be mounted into the local filesystem");
   else
     // We share the same synchronization object to avoid multithreading issues between the two classes
     _syncObj = _dokanExecutor.SyncObj;
 }