コード例 #1
0
 private void fileSystemWatcher_Changed(object sender, System.IO.FileSystemEventArgs e)
 {
     System.IO.WatcherChangeTypes      w  = e.ChangeType;
     System.Windows.Forms.DialogResult dr = System.Windows.Forms.MessageBox.Show("The timer database has been changed. Would you like to reload it?", "Reload", System.Windows.Forms.MessageBoxButtons.YesNo);
     if (dr == System.Windows.Forms.DialogResult.Yes)
     {
         Reload();
     }
 }
コード例 #2
0
 FileSystemChange(
     System.IO.WatcherChangeTypes changeType,
     FileSystemPath oldPath,
     FileSystemPath newPath
     )
 {
     ChangeType = changeType;
     OldPath    = oldPath;
     NewPath    = newPath;
 }
コード例 #3
0
        public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType, int timeout)
        {
            switch (_platform)
            {
            case Platform.Mono:
                return(_monoFsw.WaitForChanged(changeType, timeout));

            case Platform.OSX:
                return(_osxFsw.WaitForChanged(changeType, timeout));

            default:
                throw new NotImplementedException();
            }
        }
コード例 #4
0
ファイル: Loggers.cs プロジェクト: ryik5/ASTAService
        private void RecordEntry(string filePath, System.IO.WatcherChangeTypes evntChanging)
        {
            string path      = Assembly.GetExecutingAssembly().Location;
            string pathToLog = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(path), System.IO.Path.GetFileNameWithoutExtension(path) + ".log");

            lock (obj)
            {
                string message = $"{DateTime.Now.ToString("yyyy.MM.dd|hh:mm:ss")}|{evntChanging}|{filePath}";

                EvntInfoMessage?.Invoke(this, new TextEventArgs(message));

                using (System.IO.StreamWriter writer = new System.IO.StreamWriter(pathToLog, true))
                {
                    writer.WriteLine(message);
                    writer.Flush();
                }
            }
        }
        public static bool _WaitForChanged_System_IO_FileSystemWatcher_System_IO_WatcherChangeTypes_System_Int32( )
        {
            //Parameters
            System.IO.WatcherChangeTypes changeType = null;
            System.Int32 timeout = null;

            //ReturnType/Value
            System.IO.WaitForChangedResult returnVal_Real        = null;
            System.IO.WaitForChangedResult returnVal_Intercepted = null;

            //Exception
            Exception exception_Real        = null;
            Exception exception_Intercepted = null;

            InterceptionMaintenance.disableInterception( );

            try
            {
                returnValue_Real = System.IO.FileSystemWatcher.WaitForChanged(changeType, timeout);
            }

            catch (Exception e)
            {
                exception_Real = e;
            }


            InterceptionMaintenance.enableInterception( );

            try
            {
                returnValue_Intercepted = System.IO.FileSystemWatcher.WaitForChanged(changeType, timeout);
            }

            catch (Exception e)
            {
                exception_Intercepted = e;
            }


            Return((exception_Real.Messsage == exception_Intercepted.Message) && (returnValue_Real == returnValue_Intercepted));
        }
コード例 #6
0
 public FileSystemEventArgs(System.IO.WatcherChangeTypes changeType, string directory, string name)
 {
 }
コード例 #7
0
 public RenamedEventArgs(System.IO.WatcherChangeTypes changeType, string directory, string name, string oldName) : base(default(System.IO.WatcherChangeTypes), default(string), default(string))
 {
 }
コード例 #8
0
 public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType, int timeout)
 {
     return(default(System.IO.WaitForChangedResult));
 }
コード例 #9
0
 public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType, int timeout)
 {
     throw null;
 }
コード例 #10
0
ファイル: FileSystemWatcher.cs プロジェクト: haacked/Rothko
 /// <summary>
 ///   A synchronous method that returns a structure that contains specific information on the change
 ///   that occurred, given the type of change you want to monitor.
 /// </summary>
 /// <returns>
 ///   A <see cref="T:System.IO.WaitForChangedResult"/> that contains specific information on the
 ///   change that occurred.
 /// </returns>
 /// <param name="changeType">The <see cref="T:System.IO.WatcherChangeTypes"/> to watch for.</param>
 /// <filterpriority>2</filterpriority>
 public System.IO.WaitForChangedResult WaitForChanged(System.IO.WatcherChangeTypes changeType)
 {
     return(inner.WaitForChanged(changeType));
 }
コード例 #11
0
 public NotifyFilesystemEvent(string affectedFullPath, string affectedName, System.IO.WatcherChangeTypes changeType)
 {
     this.AffectedFullPath = affectedFullPath;
     this.AffectedName     = affectedName;
     this.ChangeType       = changeType;
 }