Пример #1
0
        /// <summary>
        /// Creates a SyncServer instance that the SyncManager can use to
        /// synchronize with this service.  This method is called during
        /// every synchronization process.  If the same SyncServer object
        /// is returned here, it should be reset as if it were new.
        /// </summary>
        public override SyncServer CreateSyncServer()
        {
            SyncServer server = null;

            string syncPath;

            if (GetConfigSettings(out syncPath))
            {
                path = syncPath;
                if (Directory.Exists(path) == false)
                {
                    try {
                        Directory.CreateDirectory(path);
                    } catch (Exception e) {
                        throw new Exception("Could not create \"" + path + "\": " + e.Message);
                    }
                }

                server = new FileSystemSyncServer(path);
            }
            else
            {
                throw new InvalidOperationException("FileSystemSyncServiceAddin.CreateSyncServer () called without being configured");
            }

            return(server);
        }
Пример #2
0
		public override SyncServer CreateSyncServer ()
		{
			SyncServer server = null;

			// Cancel timer
			unmountTimeout.Cancel ();

			// Mount if necessary
			if (IsConfigured) {
				if (!IsMounted && !MountFuse (true)) // MountFuse may throw TomboySyncException!
					throw new Exception ("Could not mount " + mountPath);
				server = new FileSystemSyncServer (mountPath);
			} else
				throw new InvalidOperationException ("CreateSyncServer called without being configured");

			// Return FileSystemSyncServer
			return server;
		}
		/// <summary>
		/// Creates a SyncServer instance that the SyncManager can use to
		/// synchronize with this service.  This method is called during
		/// every synchronization process.  If the same SyncServer object
		/// is returned here, it should be reset as if it were new.
		/// </summary>
		public override SyncServer CreateSyncServer ()
		{
			SyncServer server = null;

			string syncPath;
			if (GetConfigSettings (out syncPath)) {
				path = syncPath;
				if (Directory.Exists (path) == false) {
					try {
						Directory.CreateDirectory (path);
					} catch (Exception e) {
						throw new Exception ("Could not create \"" + path + "\": " + e.Message);
					}
				}

				server = new FileSystemSyncServer (path);
			} else {
				throw new InvalidOperationException ("FileSystemSyncServiceAddin.CreateSyncServer () called without being configured");
			}

			return server;
		}
Пример #4
0
        public override SyncServer CreateSyncServer()
        {
            SyncServer server = null;

            // Cancel timer
            unmountTimeout.Cancel();

            // Mount if necessary
            if (IsConfigured)
            {
                if (!IsMounted && !MountFuse(true))                  // MountFuse may throw TomboySyncException!
                {
                    throw new Exception("Could not mount " + mountPath);
                }
                server = new FileSystemSyncServer(mountPath);
            }
            else
            {
                throw new InvalidOperationException("CreateSyncServer called without being configured");
            }

            // Return FileSystemSyncServer
            return(server);
        }