Пример #1
0
        public PromptStatus Execute(Editor ed)
        {
            if (Application.DocumentManager.IsApplicationContext)
            {
                throw new Exception(ErrorStatus.InvalidContext);
            }
            if (!Settings.Variables.NEXTFIBERWORLD)
            {
                Application.ShowAlertDialog("Set NEXTFIBERWORLD = 0 & restart AutoCAD!");
            }
            PromptStatus ps = PromptStatus.None;

            ed.InitCommandVersion(InitCommandVersion);
            IAcedCmdArg name = Argument(FormattedName);

            ps = name.Execute(ed);
            if (!IsActive() || _arguments.Count <= 0)
            {
                return(ps);
            }
            int index = 0;

            while (index < _arguments.Count && ps == PromptStatus.OK && IsActive())
            {
                IAcedCmdArg arg = _arguments[index];
                if (arg == null)
                {
                    int argIndex = index + 1;
                    throw new ArgumentNullException(argIndex.ToString(CultureInfo.InvariantCulture) +
                                                    " argument for command is null");
                }

                ps = arg.Execute(ed);
                index++;
            }
            if (!SendPauseForPrompts)
            {
                return(ps);
            }
            while (IsActive() && ps == PromptStatus.OK)
            {
                ps = Pause().Execute(ed);
            }
            return(ps);
        }