public static ImageTool SwitchTo <T>(IVideoOperation videoOperation, IImageToolView imageToolView, ImageTool oldTool) where T : ImageTool, new() { ImageTool instance = new T(); instance.TrySwitchTo(videoOperation, imageToolView, oldTool); return(instance); }
public bool TrySwitchTo(IVideoOperation videoOperation, IImageToolView imageToolView, ImageTool oldTool) { if (!CanSwitchNow()) { return(false); } if (oldTool != null) { oldTool.Deactivate(); } m_VideoOperation = videoOperation; m_ImageToolView = imageToolView; Activate(); return(true); }