コード例 #1
0
ファイル: Interaction.cs プロジェクト: evstmax/CopyCtrl
        /// <summary>
        /// Starts a FlexDrawJig point drag.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="updateAction">The update action.</param>
        /// <returns>The prompt result.</returns>
        public static PromptResult StartDrag(string message, Func <PromptPointResult, Drawable> updateAction)
        {
            var ed      = Application.DocumentManager.MdiActiveDocument.Editor;
            var options = new JigPromptPointOptions(message); // TODO: other options?
            var jig     = new FlexDrawJig(options, result => updateAction((PromptPointResult)result));

            return(ed.Drag(jig));
        }
コード例 #2
0
ファイル: Interaction.cs プロジェクト: evstmax/CopyCtrl
        /// <summary>
        /// Starts a FlexDrawJig drag.
        /// </summary>
        /// <typeparam name="TOptions">The type of JigPromptOptions.</typeparam>
        /// <typeparam name="TResult">The type of jig PromptResult.</typeparam>
        /// <param name="options">The options.</param>
        /// <param name="updateAction">The update action.</param>
        /// <returns>The prompt result.</returns>
        public static PromptResult StartDrag <TOptions, TResult>(TOptions options, Func <TResult, Drawable> updateAction)
            where TOptions : JigPromptOptions
            where TResult : PromptResult
        {
            var ed  = Application.DocumentManager.MdiActiveDocument.Editor;
            var jig = new FlexDrawJig(options, result => updateAction((TResult)result));

            return(ed.Drag(jig));
        }