コード例 #1
0
		public FileChangeNotificationSystemEntry (string dirPath, FileChangeNotificationSystem owner)
		{
			if (String.IsNullOrEmpty (dirPath))
				throw new ArgumentNullException ("dirPath");

			if (owner == null)
				throw new ArgumentNullException ("owner");
			
			watchedDirPath = dirPath;
			this.owner = owner;
		}
コード例 #2
0
        public FileChangeNotificationSystemEntry(string dirPath, FileChangeNotificationSystem owner)
        {
            if (String.IsNullOrEmpty(dirPath))
            {
                throw new ArgumentNullException("dirPath");
            }

            if (owner == null)
            {
                throw new ArgumentNullException("owner");
            }

            watchedDirPath = dirPath;
            this.owner     = owner;
        }
コード例 #3
0
 private static void InitFCN()
 {
     if (s_fcn == null)
     {
         IFileChangeNotificationSystem fcn = null;
         IServiceProvider host             = ObjectCache.Host;
         if (host != null)
         {
             fcn = host.GetService(typeof(IFileChangeNotificationSystem)) as IFileChangeNotificationSystem;
         }
         if (fcn == null)
         {
             fcn = new FileChangeNotificationSystem();
         }
         Interlocked.CompareExchange(ref s_fcn, fcn, null);
     }
 }
コード例 #4
0
        private static void InitFCN()
        {
            if (s_fcn == null)
            {
                IFileChangeNotificationSystem fcn = null;
                IServiceProvider host             = ObjectCache.Host;
                if (host != null)
                {
                    fcn = host.GetService(typeof(IFileChangeNotificationSystem)) as IFileChangeNotificationSystem;
                }
                if (fcn == null)
                {
#if NET5_0_OR_GREATER
                    if (OperatingSystem.IsBrowser() || (OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()) || OperatingSystem.IsTvOS())
                    {
                        throw new PlatformNotSupportedException();
                    }
#endif

                    fcn = new FileChangeNotificationSystem();
                }
                Interlocked.CompareExchange(ref s_fcn, fcn, null);
            }
        }
コード例 #5
0
 private static void InitFCN() {
     if (s_fcn == null) {
         IFileChangeNotificationSystem fcn = null;
         IServiceProvider host = ObjectCache.Host;
         if (host != null) {
             fcn = host.GetService(typeof(IFileChangeNotificationSystem)) as IFileChangeNotificationSystem;
         }
         if (fcn == null) {
             fcn = new FileChangeNotificationSystem();
         }
         Interlocked.CompareExchange(ref s_fcn, fcn, null);
     }
 }