Esempio n. 1
0
        private void OnRenamed(object source, RenamedEventArgs args)
        {
            if (!Enabled)
            {
                return;
            }

            // 26 Feb 2021 John Morse
            // https://mcneel.myjetbrains.com/youtrack/issue/RH-62972
            // When saving a 3DM file is finishing it calls ReplaceFileW which causes a renamed
            // instance which has a null e.OldName and a e.Name, this will ignore cases where
            // the old name is null and the new name is not or the new name is null and the old
            // is not.
            try
            {
                if (string.IsNullOrEmpty(args.Name) == string.IsNullOrEmpty(args.OldName))
                {
                    RhinoApp.InvokeOnUiThread(RenamedHook, RuntimeSerialNumber, args.OldFullPath, args.FullPath);
                }
            }
            catch (Exception e)
            {
                RhinoFileEventWatcherHooks.DumpException(e);
            }
        }
Esempio n. 2
0
        // Define the event handlers.
        private void OnChanged(object source, FileSystemEventArgs args)
        {
            if (!Enabled)
            {
                return;
            }

            try
            {
                RhinoApp.InvokeOnUiThread(ChangedHook, RuntimeSerialNumber, (RhinoFileWatcherChangeReason)args.ChangeType, args.FullPath);
            }
            catch (Exception e)
            {
                RhinoFileEventWatcherHooks.DumpException(e);
            }
        }
Esempio n. 3
0
 private void OnRenamed(object source, RenamedEventArgs e)
 {
     RhinoApp.InvokeOnUiThread(RenamedHook, RuntimeSerialNumber, e.OldFullPath, e.FullPath);
 }
Esempio n. 4
0
 // Define the event handlers.
 private void OnChanged(object source, FileSystemEventArgs e)
 {
     RhinoApp.InvokeOnUiThread(ChangedHook, RuntimeSerialNumber, (RhinoFileWatcherChangeReason)e.ChangeType, e.FullPath);
 }
Esempio n. 5
0
 private void OnRenamed(object source, RenamedEventArgs e)
 {
     RhinoApp.InvokeOnUiThread(RenamedHook, Pointer, e.OldFullPath, e.FullPath);
 }