Exemplo n.º 1
0
        /// <summary>
        /// Starts a FlexEntityJig point drag.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="entity">The entity.</param>
        /// <param name="updateAction">The update action.</param>
        /// <returns>The prompt result.</returns>
        public static PromptResult StartDrag(string message, Entity entity, Func <Entity, PromptPointResult, bool> updateAction)
        {
            var ed      = Application.DocumentManager.MdiActiveDocument.Editor;
            var options = new JigPromptPointOptions(message); // TODO: other options?
            var jig     = new FlexEntityJig(options, entity, (ent, result) => updateAction(ent, (PromptPointResult)result));

            return(ed.Drag(jig));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Starts a FlexEntityJig 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="entity">The entity.</param>
        /// <param name="updateAction">The update action.</param>
        /// <returns>The prompt result.</returns>
        public static PromptResult StartDrag <TOptions, TResult>(TOptions options, Entity entity, Func <Entity, TResult, bool> updateAction)
            where TOptions : JigPromptOptions
            where TResult : PromptResult
        {
            var ed  = Application.DocumentManager.MdiActiveDocument.Editor;
            var jig = new FlexEntityJig(options, entity, (ent, result) => updateAction(ent, (TResult)result));

            return(ed.Drag(jig));
        }