当前位置: 首页>>代码示例>>C#>>正文


C# WatcherChangeTypes类代码示例

本文整理汇总了C#中WatcherChangeTypes的典型用法代码示例。如果您正苦于以下问题:C# WatcherChangeTypes类的具体用法?C# WatcherChangeTypes怎么用?C# WatcherChangeTypes使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WatcherChangeTypes类属于命名空间,在下文中一共展示了WatcherChangeTypes类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FileEvent

 public FileEvent(Int64 num, WatcherChangeTypes type, string path, string oldpath)
 {
     eventnum = num;
     eventtype = type;
     eventpath = path;
     oldevpath = oldpath;
 }
开发者ID:fmaj7,项目名称:HoneyBadger,代码行数:7,代码来源:Process.cs

示例2: OnFileChanged

		private void OnFileChanged(string path, WatcherChangeTypes changeType)
		{
			if (!_enableEvents) return;

			_actions.Enqueue(new TreeChange { Path = path, Type = SimplifyType(changeType) });
			_eventFlusher.Change(DebounceInMs, Timeout.Infinite);
		}
开发者ID:OlegJytnik,项目名称:Rainbow,代码行数:7,代码来源:TreeWatcher.cs

示例3: FilterIgnored

 protected static FileBehavior FilterIgnored(string path, WatcherChangeTypes type)
 {
     if(Regex.IsMatch(path, Init.Singleton.JsonData.regexIgnoreFiles, RegexOptions.IgnoreCase) || new FileInfo(path).Length <= 0)
         return new FileIgnored(path, type);
     else
         return new FileOK(path, type);
 }
开发者ID:vkobel,项目名称:cCloud-Sync,代码行数:7,代码来源:FileBehavior.cs

示例4: FileTriggerAttribute

 /// <summary>
 /// Constructs a new instance.
 /// </summary>
 /// <param name="path">The root path that this trigger is configured to watch for files on.</param>
 /// <param name="filter">The optional file filter that will be used.</param>
 /// <param name="changeTypes">The <see cref="WatcherChangeTypes"/> that will be used by the file watcher. The Default is Created.</param>
 /// <param name="autoDelete">True if processed files should be deleted automatically, false otherwise. The default is False.</param>
 public FileTriggerAttribute(string path, string filter, WatcherChangeTypes changeTypes = WatcherChangeTypes.Created, bool autoDelete = false)
 {
     this.Path = path;
     this.Filter = filter;
     this.ChangeTypes = changeTypes;
     this.AutoDelete = autoDelete;
 }
开发者ID:brendankowitz,项目名称:azure-webjobs-sdk-extensions,代码行数:14,代码来源:FileTriggerAttribute.cs

示例5: Changed

 protected void Changed(WatcherChangeTypes changeType, IVirtualItem item)
 {
     if (this.OnChanged != null)
     {
         this.OnChanged(this, new VirtualItemChangedEventArgs(changeType, item));
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:7,代码来源:CustomVirtualFolder.cs

示例6: FileBehavior

 protected FileBehavior(string fp, WatcherChangeTypes ct)
 {
     fullPath = fp;
     changeType = ct;
     fileDT = new FileInfo(fp).LastWriteTime;
     sysTime = DateTime.Now;
 }
开发者ID:vkobel,项目名称:cCloud-Sync,代码行数:7,代码来源:FileBehavior.cs

示例7: WaitForChangedResult

 internal WaitForChangedResult(WatcherChangeTypes changeType, string name, string oldName, bool timedOut)
 {
     ChangeType = changeType;
     Name = name;
     OldName = oldName;
     TimedOut = timedOut;
 }
开发者ID:ESgarbi,项目名称:corefx,代码行数:7,代码来源:WaitForChangedResult.cs

示例8: FilterFileSize

 protected static FileBehavior FilterFileSize(string path, WatcherChangeTypes type)
 {
     if(new FileInfo(path).Length <= Init.Singleton.JsonData.maxSize)
         return new FileOK(path, type);
     else
         return new FileTooLarge(path, type);
 }
开发者ID:vkobel,项目名称:cCloud-Sync,代码行数:7,代码来源:FileBehavior.cs

示例9: TestNestedDirectoriesHelper

        public static void TestNestedDirectoriesHelper(
            string testDirectory,
            WatcherChangeTypes change,
            Action<AutoResetEvent, TempDirectory> action,
            NotifyFilters changeFilers = NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName)
        {
            using (var dir = new TempDirectory(testDirectory))
            using (var watcher = new FileSystemWatcher())
            {
                AutoResetEvent createdOccurred = WatchForEvents(watcher, WatcherChangeTypes.Created); // not "using" to avoid race conditions with FSW callbacks
                AutoResetEvent eventOccurred = WatchForEvents(watcher, change);

                watcher.Path = Path.GetFullPath(dir.Path);
                watcher.Filter = "*";
                watcher.NotifyFilter = changeFilers;
                watcher.IncludeSubdirectories = true;
                watcher.EnableRaisingEvents = true;

                using (var firstDir = new TempDirectory(Path.Combine(dir.Path, "dir1")))
                {
                    ExpectEvent(createdOccurred, "dir1 created");

                    using (var nestedDir = new TempDirectory(Path.Combine(firstDir.Path, "nested")))
                    {
                        ExpectEvent(createdOccurred, "nested created");

                        action(eventOccurred, nestedDir);
                    }
                }
            }
        }
开发者ID:SGuyGe,项目名称:corefx,代码行数:31,代码来源:FileSystemWatcherTest.cs

示例10: WaitForChangedResult

 internal WaitForChangedResult(WatcherChangeTypes changeType, string name, string oldName, bool timedOut)
 {
     this.changeType = changeType;
     this.name = name;
     this.oldName = oldName;
     this.timedOut = timedOut;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:WaitForChangedResult.cs

示例11: FileSystemEventArgs

	// Constructor.
	public FileSystemEventArgs(WatcherChangeTypes changeType,
							   String directory, String name)
			{
				this.changeType = changeType;
				this.directory = directory;
				this.name = name;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:FileSystemEventArgs.cs

示例12: FSEvent

 /// <summary>
 /// A file system event.
 /// For instance, a file was renamed.
 /// </summary>
 public FSEvent(WatcherChangeTypes type, string path) {
     if(path == null) {
         throw new ArgumentNullException("Argument null in FSEvent Constructor","path");
     }
     Type = type;
     Path = path;
 }
开发者ID:j2m2,项目名称:CmisSync,代码行数:11,代码来源:FSEvent.cs

示例13: RenamedEventArgs

	// Constructor.
	public RenamedEventArgs(WatcherChangeTypes changeType,
							String directory, String name,
							String oldName)
			: base(changeType, directory, name)
			{
				this.oldName = oldName;
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:8,代码来源:RenamedEventArgs.cs

示例14: HandleChangeInternal

        protected override bool HandleChangeInternal(string objectName, WatcherChangeTypes changeType)
        {
            Trace.TraceInformation("Running MSBuild to compile type script files");

            ProcessStartInfo startInfo = new ProcessStartInfo("msbuild.exe");
            startInfo.Arguments =
                string.Format("\"{0}\" /p:Configuration=Debug,BuildingProject=true /t:CompileTypeScript",
                              _projectFilePath);
            startInfo.CreateNoWindow = true;
            startInfo.WindowStyle = ProcessWindowStyle.Hidden;
            Process proc = Process.Start(startInfo);
            if (null != proc)
            {
                proc.WaitForExit();
                Trace.TraceInformation("MSBuild exited with code {0}", proc.ExitCode);
                if (proc.ExitCode != 0)
                    Console.Beep();
            }
            else
                Trace.TraceWarning("MSBuild executable not found");

            RefreshBrowser();

            return true;
        }
开发者ID:modulexcite,项目名称:WebSync,代码行数:25,代码来源:TypeScriptChangeHandler.cs

示例15: FileEventArgs

 public FileEventArgs(WatcherChangeTypes changeType, string fullname, string name, RenamedEventArgs renameArgs)
 {
     this.ChangeType = changeType;
     this.FullPath = fullname;
     this.Name = name;
     RenameName = renameArgs;
 }
开发者ID:wykoooo,项目名称:copy-dotnet-library,代码行数:7,代码来源:FileWatcher.cs


注:本文中的WatcherChangeTypes类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。