/// <summary> /// Clone action. /// </summary> /// <remarks> /// It is called for the current item when [ShiftF5] is pressed. /// It calls <see cref="UICloneFile"/> if the explorer supports it. /// <para> /// Current file after the operation is defined by <c>Post*</c> in the arguments. /// </para> /// </remarks> public void UIClone() { // can? if (!Explorer.CanCloneFile) { return; } // file var file = CurrentFile; if (file == null) { return; } // call var args = new CloneFileEventArgs(ExplorerModes.None, file); UICloneFile(args); if (args.Result != JobResult.Done) { return; } // post Post(args); // show Update(true); Redraw(); }
/// <summary> /// Calls <see cref="FarNet.Explorer.CloneFile"/> and <see cref="OnThisFileChanged"/>. /// </summary> /// <param name="args">.</param> public virtual void UICloneFile(CloneFileEventArgs args) { if (args == null) { return; } Explorer.CloneFile(args); if (args.Result != JobResult.Ignore) { OnThisFileChanged(args); } }
/// <summary> /// Clones the file. /// </summary> /// <param name="args">.</param> /// <remarks> /// It is normally called for the current item in a panel on [ShiftF5]. /// </remarks> public virtual void CloneFile(CloneFileEventArgs args) { }