示例#1
0
        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);
        }
示例#2
0
        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);
        }