예제 #1
0
        /// <summary>
        /// Executes this command.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        /// <param name="target">The target.</param>
        public override void Execute(object parameter, object target)
        {
            string dllList;

            using (var form = new FormText {
                Text = "Enter searched DLLs"
            })
            {
                if (form.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                dllList = form.EditText;
            }
            if (string.IsNullOrEmpty(dllList))
            {
                AddLog("List is empty");
                return;
            }
            AddLog("Start Dll Check Existence Command");
            using (var reader = new StringReader(dllList))
            {
                string line;
                do
                {
                    line = reader.ReadLine();
                    CheckExistence(line);
                } while (line != null);
            }
            AddLog("End Dll Check Existence Command");
        }
예제 #2
0
        public FormText ExportFormText()
        {
            FormText formText = new FormText();
            var      sb       = new System.Text.StringBuilder();

            for (var i = 0; i < numOfParticles; ++i)
            {
                // var e = GetParticleAt(i);
                //sb.AppendLine(string.Format("p {0}", e.ExportJson()));
            }
            sb.AppendLine();
            for (var i = 0; i < numOfSprings; ++i)
            {
                // var e = GetSpringAt(i);
                // sb.AppendLine(string.Format("sc {0}", e.ExportJson()));
            }
            sb.AppendLine();
            for (var i = 0; i < numOfAngles; ++i)
            {
                // var e = GetAngleAt(i);
                // sb.AppendLine(string.Format("ac {0}", e.ExportJson()));
            }
            sb.AppendLine();
            for (var i = 0; i < numOfPins; ++i)
            {
                // var e = GetPinAt(i);
                // sb.AppendLine(string.Format("pc {0}", e.ExportJson()));
            }

            formText.text = sb.ToString();
            return(formText);
        }
예제 #3
0
    public void RefreshForm(FormInput formInput)
    {
        if (formInput != form)
        {
            return;
        }

        FormItem[] inputs = form.inputs;
        for (int i = 0; i < inputs.Length; i++)
        {
            if (inputs[i] is FormElement)
            {
                FormElement  formElement  = (FormElement)inputs[i];
                InputElement inputElement = (InputElement)inputBases[i];
                inputElement.Refresh(formElement);
            }
            else if (inputs[i] is FormNum)
            {
                FormNum  formNum  = (FormNum)inputs[i];
                InputNum inputNum = (InputNum)inputBases[i];
                inputNum.Refresh(formNum);
            }
            else if (inputs[i] is FormText)
            {
                FormText  formText  = (FormText)inputs[i];
                InputText inputText = (InputText)inputBases[i];
                inputText.Refresh(formText);
            }
        }
    }
예제 #4
0
        /// <summary>
        /// Handles the Click event of the findInToolStripMenuItem control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void FindInToolStripMenuItemClick(object sender, EventArgs e)
        {
            if (tvObjects.SelectedNode == null)
            {
                return;
            }
            if (tvObjects.SelectedNode.ImageIndex != (int)images.IndClass)
            {
                MessageBoxEx.ShowWaring(null, "Search", "Search only in types");
                return;
            }
            var frm = new FormText();

            if (frm.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            var typ             = (Type)(tvObjects.SelectedNode.Tag);
            var arrayMemberInfo = typ.FindMembers(MemberTypes.All, 0, DelegateToSearchCriteria, frm.Value);

            for (int index = 0; index <= arrayMemberInfo.Length - 1; index++)
            {
                Console.WriteLine("Result of FindMembers -\t" + arrayMemberInfo[index] + "\n");
            }
        }
예제 #5
0
 public void MouseDoubleClick(IDisplay display, System.Windows.Forms.MouseEventArgs e)
 {
     FormText dlg = new FormText(this._text);
     if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         this._text = dlg.SelectedText;
     }
 }
        private void MenuItem_Click_2(object sender, RoutedEventArgs e)
        {
            // inserts a new ApplicationField of type FORMTEXT
            FormText ftField = new FormText();

            ftField.Text = "[新表单文本框字段]";

            textControl1.ApplicationFields.Add(ftField.ApplicationField);
        }
예제 #7
0
    private InputText AddInputText(FormText formText)
    {
        GameObject go = GameObject.Instantiate(InputTextPrefab.gameObject);

        go.transform.SetParent(transform, false);

        InputText inputText = go.GetComponent <InputText>();

        inputText.Init(formText);
        return(inputText);
    }
        private void formTextToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // create a new FormText field and add it to TextControl
            FormText tbField = new FormText();

            tbField.ApplicationField.Deleteable           = false;
            tbField.ApplicationField.Editable             = false;
            tbField.ApplicationField.DoubledInputPosition = true;

            textControl1.ApplicationFields.Add(tbField.ApplicationField);
        }
        private void MenuItem_Click_3(object sender, RoutedEventArgs e)
        {
            // casts an ApplicationField of type FORMTEXT to a FormTextBox object
            // and opens the appropriate dialog box
            if (textControl1.ApplicationFields.GetItem().TypeName == "FORMTEXT")
            {
                FormText curFormText = new FormText(textControl1.ApplicationFields.GetItem());

                curFormText.ShowDialog();
            }
        }
예제 #10
0
        /// <summary>
        /// Inputs the text.
        /// </summary>
        /// <param name="initilaValue">The initila value.</param>
        /// <returns></returns>
        private string InputText(string initilaValue)
        {
            using (var form = new FormText())
            {
                form.Text      = "Чего покупаем.";
                form.Multiline = false;
                form.Height    = 100;
                form.Value     = initilaValue;

                if (form.ShowDialog() != DialogResult.OK)
                {
                    return(null);
                }
                return(form.Value.Trim());
            }
        }
예제 #11
0
        private void listAddresees_DoubleClick(object sender, EventArgs e)
        {
            var adr = (Address)listAddresees.SelectedItem;

            if (adr == null)
            {
                return;
            }

            using (var frm = new FormText())
            {
                frm.Value = adr.Key;
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    adr.Key = frm.Value;
                }
            }
        }
예제 #12
0
    private void SetForm(FormInput formInput)
    {
        if (state != InputPanelState.Normal)
        {
            return;
        }

        form = formInput;
        FormItem[] inputs = form.inputs;
        inputBases = new InputBase[inputs.Length];

        inputables = new List <Inputable>();
        for (int i = 0; i < inputs.Length; i++)
        {
            if (inputs[i] is FormElement)
            {
                FormElement  formElement  = (FormElement)inputs[i];
                InputElement inputElement = AddInputElement(formElement);
                inputables.Add(inputElement);
                inputBases[i] = inputElement;
            }
            else if (inputs[i] is FormNum)
            {
                FormNum  formNum  = (FormNum)inputs[i];
                InputNum inputNum = AddInputNum(formNum);
                inputables.Add(inputNum);
                inputBases[i] = inputNum;
            }
            else if (inputs[i] is FormText)
            {
                FormText  formText  = (FormText)inputs[i];
                InputText inputText = AddInputText(formText);
                inputBases[i] = inputText;
            }
        }

        RefreshLayout();
    }
예제 #13
0
        private void OpenTextFile(string fname)
        {
            FormText frm = new FormText(fname, Program.Log);

            frm.ShowDialog(this);
        }
예제 #14
0
파일: InputText.cs 프로젝트: Y-dc/GeoSpace
 public void Refresh(FormText formText)
 {
     text           = formText.label;
     textField.text = text;
 }
        private void ApplicationFieldActivate(TXTextControl.ApplicationField ApplicationField)
        {
            // remove all child controls
            textControl1.Controls.Clear();

            // check the field type in order to display the proper control
            switch (ApplicationField.TypeName)
            {
            case "FORMDROPDOWN":
                // create a FormDropDown field
                FormDropDown fddField = new FormDropDown(ApplicationField);

                // create a new System.Windows.Forms.ComboBox and add the
                // FormDropDown's items
                ComboBox cb = new ComboBox();

                cb.Items.AddRange(fddField.ListEntries.ToArray <string>());

                Point cbLocation = new Point((fddField.ApplicationField.Bounds.Location.X -
                                              textControl1.ScrollLocation.X) / dpiX,
                                             (fddField.ApplicationField.Bounds.Location.Y -
                                              textControl1.ScrollLocation.Y) / dpiX);

                cb.Location              = cbLocation;
                cb.Tag                   = fddField;
                cb.SelectedText          = fddField.ApplicationField.Text;
                cb.SelectedIndexChanged += new EventHandler(cb_SelectedIndexChanged);
                cb.LostFocus            += new EventHandler(cb_LostFocus);

                // show the ComboBox on top of TextControl
                textControl1.Controls.Add(cb);
                cb.Focus();

                break;

            case "FORMCHECKBOX":
                // create a FormCheckBox field
                FormCheckBox fcbField = new FormCheckBox(ApplicationField);

                fcbField.Checked = !fcbField.Checked;
                // change the text according to the current state
                fcbField.Text = fcbField.Checked == true ? CHECKED : UNCHECKED;
                break;

            case "DATE":
                // create a DateField field
                DateField dField = new DateField(ApplicationField);

                // create a new System.Windows.Forms.DateTimePicker and set the
                // date to the current DateField date
                DateTimePicker dtPicker = new DateTimePicker();
                dtPicker.Tag   = dField;
                dtPicker.Value = DateTime.Parse(dField.Text);

                Point dtpLocation = new Point((dField.ApplicationField.Bounds.Location.X -
                                               textControl1.ScrollLocation.X) / dpiX,
                                              (dField.ApplicationField.Bounds.Location.Y -
                                               textControl1.ScrollLocation.Y) / dpiX);

                dtPicker.Location = dtpLocation;

                dtPicker.ValueChanged += new EventHandler(dtPicker_ValueChanged);
                dtPicker.LostFocus    += new EventHandler(dtPicker_LostFocus);

                // show the DateTimePicker on top of TextControl
                textControl1.Controls.Add(dtPicker);
                dtPicker.Focus();

                break;

            case "FORMTEXT":
                // create a FormText field
                FormText ftField = new FormText(ApplicationField);

                // create a new System.Windows.Forms.TextBox and set the
                // text to the current FormText text
                TextBox tb = new TextBox();

                tb.Text      = ftField.Text;
                ftField.Text = "";

                Point tbLocation = new Point((ftField.ApplicationField.Bounds.Location.X -
                                              textControl1.ScrollLocation.X) / dpiX,
                                             (ftField.ApplicationField.Bounds.Location.Y -
                                              textControl1.ScrollLocation.Y) / dpiX);

                tb.Location   = tbLocation;
                tb.Tag        = ftField;
                tb.LostFocus += new EventHandler(tb_LostFocus);
                tb.KeyPress  += new KeyPressEventHandler(tb_KeyPress);
                tb.SelectAll();

                // show the TextBox on top of TextControl
                textControl1.Controls.Add(tb);
                tb.Focus();
                break;
            }
        }
예제 #16
0
파일: InputText.cs 프로젝트: Y-dc/GeoSpace
 public void Init(FormText formText)
 {
     Init();
     Refresh(formText);
 }
예제 #17
0
    public void Classify(String str)
    {
        str = str.ToUpper();
        str = str.Replace(" ", "");

        /*
         * 正方体/立方体ABCD-A1B1C1D1
         * 三棱锥P-ABC
         * 旋转体  矩形旋转体、三角形旋转体
         * 长宽高
         *
         * 作空间中一点A(1,1,1)
         * 作两点、线段中点              作AB中点C
         *      线段描点                     取AB上一点C
         *  作平面重心                   作面ABC..重心M
         *  连接两点                     连接MN
         * 过点作线段垂线               过点A作线段MN垂线交线段于点P
         *  过点作平面垂线               过点A作面ABC..垂线交面于点Q
         * 连接点作平面                 连接ABC..作平面
         * 测量长度、角度、面积          ...的长度/角度/面积
         */
        if (state != GeoState.Normal)
        {
            return;
        }
        if (str == "旋转")
        {
            Debug.Log("旋转");
            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[0];
            //Debug.Log(tool.Type);  //reslovedBody
            SetState(GeoState.Auxiliary);

            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            currentOperation.Start();
        }
        else if (str == "展开")
        {
            Debug.Log("展开");
            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[1];
            //Debug.Log(tool.Type);  //reslovedBody
            SetState(GeoState.Auxiliary);

            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            currentOperation.Start();
        }
        else if (str.Length < 3)
        {
            Debug.Log("input error");
        }
        else if (str.Substring(0, 3) == "正方体" || str.Substring(0, 3) == "立方体")
        {
            Debug.Log("正方体");
            Tool tool = geoUI.toolPanel.toolGroups[0].Tools[0];
            currentOperation = new GeometryOperation(this, toolController, stateController, tool, geometryBehaviour);
            String list = "";

            if (str.Length > 3)
            {
                //Debug.Log(str.Substring(3));
                String cuboidName = str.Substring(3);

                if (cuboidName.Length >= 9)
                {
                    for (int i = 0; i < cuboidName.Length; i++)
                    {
                        String item = cuboidName.Substring(i, 1);
                        if (Regex.IsMatch(cuboidName.Substring(i, 1), @"^[A-Za-z]+$"))
                        {
                            if (i == cuboidName.Length - 1)
                            {
                                list += item;
                            }
                            else
                            {
                                if (Regex.IsMatch(cuboidName.Substring(i + 1, 1), @"^[0-9]*$"))
                                {
                                    list += cuboidName.Substring(i, 2);
                                    if (i != cuboidName.Length - 2)
                                    {
                                        list += " ";
                                    }
                                    i++;
                                }
                                else
                                {
                                    list += item + " ";
                                }
                            }
                        }
                    }
                    //Debug.Log(list);
                    GeometryOperation opt = (GeometryOperation)currentOperation;
                    opt.ReSetSign(list);
                }
                else
                {
                    // default name
                }
            }

            currentOperation.Start();
        }
        else if (str.Substring(0, 3) == "三棱锥")
        {
            Debug.Log("三棱锥");
            Tool tool = geoUI.toolPanel.toolGroups[0].Tools[1];
            currentOperation = new GeometryOperation(this, toolController, stateController, tool, geometryBehaviour);
            String list = "";

            if (str.Length > 3)
            {
                Debug.Log(str.Substring(3));
                String triName = str.Substring(3);

                if (triName.Length >= 5)
                {
                    for (int i = 0; i < triName.Length; i++)
                    {
                        String item = triName.Substring(i, 1);
                        if (Regex.IsMatch(triName.Substring(i, 1), @"^[A-Za-z]+$"))
                        {
                            if (i == triName.Length - 1)
                            {
                                list += item;
                            }
                            else
                            {
                                if (Regex.IsMatch(triName.Substring(i + 1, 1), @"^[0-9]*$"))
                                {
                                    list += triName.Substring(i, 2);
                                    if (i != triName.Length - 2)
                                    {
                                        list += " ";
                                    }
                                    i++;
                                }
                                else
                                {
                                    list += item + " ";
                                }
                            }
                        }
                    }
                    Debug.Log(list);
                    GeometryOperation opt = (GeometryOperation)currentOperation;
                    opt.ReSetSign(list);
                }
                else
                {
                    // default name
                }
            }

            currentOperation.Start();
        }
        else if (str.IndexOf("旋转体") != -1)
        {
            Debug.Log("旋转体");
            Tool tool = geoUI.toolPanel.toolGroups[0].Tools[2];
            currentOperation = new GeometryOperation(this, toolController, stateController, tool, geometryBehaviour);
            currentOperation.Start();
            if (str == "矩形旋转体" || str == "长方形旋转体")
            {
                Tool tool1 = geoUI.toolPanel.toolGroups[1].Tools[0];
                Debug.Log(tool1.Description);
                //Debug.Log(tool1.Type);

                SetState(GeoState.Condition);

                currentOperation = new AddConditionOperation(this, stateController, geometry, geometryBehaviour, geoUI, tool1);
                currentOperation.Start();
            }
            else if (str == "三角形旋转体")
            {
                Tool tool1 = geoUI.toolPanel.toolGroups[1].Tools[1];
                Debug.Log(tool1.Description);
                //Debug.Log(tool1.Type);

                SetState(GeoState.Condition);

                currentOperation = new AddConditionOperation(this, stateController, geometry, geometryBehaviour, geoUI, tool1);
                currentOperation.Start();
            }
        }
        else if (str.IndexOf("空间一点") != -1)
        {
            Debug.Log("取空间一点");
        }
        else if (str.IndexOf("中点") != -1)
        {
            Debug.Log("中点");
            String line = "";
            for (int i = 1; i < str.Length - 2; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        line += str.Substring(i, 1) + str.Substring(i + 1, 1) + " ";
                    }
                    else
                    {
                        line += str.Substring(i, 1) + " ";
                    }
                }
            }

            FormText    text1 = new FormText("作");
            String[]    eles  = line.Split(' ');
            FormElement ele1  = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele1.fields[i] = eles[i];
            }
            FormText    text2 = new FormText("中点");
            FormElement ele2  = new FormElement(1);
            if (Regex.IsMatch(str.Substring(str.Length - 2), @"^[A-Za-z0-9]+$"))
            {
                ele2.fields[0] = str.Substring(str.Length - 2);
            }
            else
            {
                ele2.fields[0] = str.Substring(str.Length - 1);
            }

            FormInput writeInput = new FormInput(4);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;
            writeInput.inputs[3] = ele2;

            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[1];
            SetState(GeoState.Auxiliary);


            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddAuxiliaryOperation opt = (AddAuxiliaryOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if ((str.IndexOf("一点") != -1 && str.IndexOf("线段") != -1) || ((str.IndexOf("作线段") != -1 || str.IndexOf("做线段") != -1) && str.IndexOf("的点") != -1))
        {
            Debug.Log("取线段一点");

            String line = "";
            for (int i = 1; i < str.Length - 2; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        line += str.Substring(i, 1) + str.Substring(i + 1, 1) + " ";
                    }
                    else
                    {
                        line += str.Substring(i, 1) + " ";
                    }
                }
            }
            //Debug.Log(line);
            FormText    text1 = new FormText("作线段");
            String[]    eles  = line.Split(' ');
            FormElement ele1  = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele1.fields[i] = eles[i];
            }
            FormText    text2 = new FormText("的点");
            FormElement ele2  = new FormElement(1);
            if (Regex.IsMatch(str.Substring(str.Length - 2), @"^[A-Za-z0-9]+$"))
            {
                ele2.fields[0] = str.Substring(str.Length - 2);
            }
            else
            {
                ele2.fields[0] = str.Substring(str.Length - 1);
            }
            //Debug.Log(ele2.fields[0]);
            FormInput writeInput = new FormInput(4);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;
            writeInput.inputs[3] = ele2;

            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[2];
            SetState(GeoState.Auxiliary);


            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddAuxiliaryOperation opt = (AddAuxiliaryOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if (str.IndexOf("重心") != -1 || str.IndexOf("中心") != -1)
        {
            Debug.Log("重心");
            String face = "";
            for (int i = 1; i < str.Length - 3; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        face += str.Substring(i, 1) + str.Substring(i + 1, 1) + " ";
                    }
                    else
                    {
                        face += str.Substring(i, 1) + " ";
                    }
                }
            }

            FormText    text1 = new FormText("作平面");
            String[]    eles  = face.Split(' ');
            FormElement ele1  = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele1.fields[i] = eles[i];
            }
            FormText    text2 = new FormText("的重心");
            FormElement ele2  = new FormElement(1);
            if (Regex.IsMatch(str.Substring(str.Length - 2), @"^[A-Za-z0-9]+$"))
            {
                ele2.fields[0] = str.Substring(str.Length - 2);
            }
            else
            {
                ele2.fields[0] = str.Substring(str.Length - 1);
            }
            FormInput writeInput = new FormInput(4);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;
            writeInput.inputs[3] = ele2;

            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[3];
            SetState(GeoState.Auxiliary);


            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddAuxiliaryOperation opt = (AddAuxiliaryOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if (str.IndexOf("连接") != -1 && Regex.IsMatch(str.Substring(2), @"^[A-Za-z0-9]+$"))
        {
            Debug.Log("连接两点");

            String line = "";
            for (int i = 2; i < str.Length - 1; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        line += str.Substring(i, 1) + str.Substring(i + 1, 1) + " ";
                    }
                    else
                    {
                        line += str.Substring(i, 1) + " ";
                        if (i == str.Length - 2)
                        {
                            line += str.Substring(i + 1);
                        }
                    }
                }
                else
                {
                    break;
                }
            }

            FormText    text1 = new FormText("连接");
            String[]    eles  = line.Split(' ');
            FormElement ele1  = new FormElement(eles.Length);
            for (int i = 0; i < eles.Length; i++)
            {
                ele1.fields[i] = eles[i];
            }
            FormText text2 = new FormText("作线段");

            FormInput writeInput = new FormInput(3);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;

            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[4];
            SetState(GeoState.Auxiliary);


            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddAuxiliaryOperation opt = (AddAuxiliaryOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if (str.IndexOf("垂线") != -1 && str.IndexOf("线段") != -1)
        {
            Debug.Log("线段垂线");
            String point1 = "";
            for (int i = 1; i < 4; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        point1 += str.Substring(i, 2);
                        //Debug.Log(point1 + "---");
                        break;
                    }
                    else
                    {
                        point1 += str.Substring(i, 1);
                        break;
                    }
                }
            }

            String face = "";
            for (int i = 5; i < str.Length - 2; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        face += str.Substring(i, 2) + " ";
                        i++;
                    }
                    else
                    {
                        face += str.Substring(i, 1) + " ";
                    }
                }
            }

            String point2 = "";
            if (Regex.IsMatch(str.Substring(str.Length - 2), @"^[A-Za-z0-9]+$"))
            {
                point2 = str.Substring(str.Length - 2);
            }
            else if (Regex.IsMatch(str.Substring(str.Length - 1), @"^[A-Za-z]+$"))
            {
                point2 = str.Substring(str.Length - 1);
            }
            else
            {
                Debug.Log("point lost error");
                return;
            }

            FormText text1 = new FormText("过点");
            //Debug.Log(text1);
            FormElement ele1 = new FormElement(1);
            ele1.fields[0] = point1;
            //Debug.Log(ele1);
            FormText text2 = new FormText("作平面");
            //Debug.Log(text2);
            String[]    eles = face.Split(' ');
            FormElement ele2 = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele2.fields[i] = eles[i];
                //Debug.Log(eles[i] +"*");
            }
            FormText text3 = new FormText("的垂线");
            //Debug.Log(text3);
            FormText text4 = new FormText("交于点");
            //Debug.Log(text4);
            FormElement ele3 = new FormElement(1);
            ele3.fields[0] = point2;
            //Debug.Log(point2);

            FormInput writeInput = new FormInput(7);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;
            writeInput.inputs[3] = ele2;
            writeInput.inputs[4] = text3;
            writeInput.inputs[5] = text4;
            writeInput.inputs[6] = ele3;

            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[5];
            SetState(GeoState.Auxiliary);


            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddAuxiliaryOperation opt = (AddAuxiliaryOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if (str.IndexOf("垂线") != -1 && str.IndexOf("平面") != -1)
        {
            Debug.Log("面垂线");

            String point1 = "";
            for (int i = 1; i < 4; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        point1 += str.Substring(i, 2);
                        //Debug.Log(point1 + "---");
                        break;
                    }
                    else
                    {
                        point1 += str.Substring(i, 1);
                        break;
                    }
                }
            }

            String line = "";
            for (int i = 5; i < str.Length - 2; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        line += str.Substring(i, 2) + " ";
                        i++;
                    }
                    else
                    {
                        line += str.Substring(i, 1) + " ";
                    }
                }
            }

            String point2 = "";
            if (Regex.IsMatch(str.Substring(str.Length - 2), @"^[A-Za-z0-9]+$"))
            {
                point2 = str.Substring(str.Length - 2);
            }
            else if (Regex.IsMatch(str.Substring(str.Length - 1), @"^[A-Za-z]+$"))
            {
                point2 = str.Substring(str.Length - 1);
            }
            else
            {
                Debug.Log("point lost error");
                return;
            }

            FormText text1 = new FormText("过点");
            //Debug.Log(text1);
            FormElement ele1 = new FormElement(1);
            ele1.fields[0] = point1;
            //Debug.Log(ele1);
            FormText text2 = new FormText("作线段");
            //Debug.Log(text2);
            String[]    eles = line.Split(' ');
            FormElement ele2 = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele2.fields[i] = eles[i];
                //Debug.Log(eles[i] +"*");
            }
            FormText text3 = new FormText("的垂线");
            //Debug.Log(text3);
            FormText text4 = new FormText("交于点");
            //Debug.Log(text4);
            FormElement ele3 = new FormElement(1);
            ele3.fields[0] = point2;
            //Debug.Log(point2);

            FormInput writeInput = new FormInput(7);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;
            writeInput.inputs[3] = ele2;
            writeInput.inputs[4] = text3;
            writeInput.inputs[5] = text4;
            writeInput.inputs[6] = ele3;

            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[6];
            SetState(GeoState.Auxiliary);


            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddAuxiliaryOperation opt = (AddAuxiliaryOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if (str.IndexOf("连接") != -1 && (str.IndexOf("作平面") != -1 || str.IndexOf("做平面") != -1))
        {
            Debug.Log("平面");

            String face = "";
            for (int i = 2; i < str.Length - 3; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        face += str.Substring(i, 1) + str.Substring(i + 1, 1) + " ";
                    }
                    else
                    {
                        face += str.Substring(i, 1) + " ";
                    }
                }
            }

            FormText    text1 = new FormText("连接");
            String[]    eles  = face.Split(' ');
            FormElement ele1  = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele1.fields[i] = eles[i];
            }
            FormText  text2      = new FormText("作平面");
            FormInput writeInput = new FormInput(3);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;

            Tool tool = geoUI.toolPanel.toolGroups[2].Tools[7];
            SetState(GeoState.Auxiliary);


            currentOperation = new AddAuxiliaryOperation(this, geoCamera, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddAuxiliaryOperation opt = (AddAuxiliaryOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if (str.IndexOf("长度") != -1)
        {
            Debug.Log("测量长度");

            String line = "";
            for (int i = 0; i < str.Length - 1; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        line += str.Substring(i, 1) + str.Substring(i + 1, 1) + " ";
                    }
                    else
                    {
                        line += str.Substring(i, 1) + " ";
                    }
                }
            }

            FormText    text1 = new FormText("线段");
            String[]    eles  = line.Split(' ');
            FormElement ele1  = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele1.fields[i] = eles[i];
            }
            FormText  text2      = new FormText("的长度");
            FormInput writeInput = new FormInput(3);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;

            Tool tool = geoUI.toolPanel.toolGroups[3].Tools[0];
            SetState(GeoState.Measure);

            currentOperation = new AddMeasureOperation(this, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddMeasureOperation opt = (AddMeasureOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if (str.IndexOf("角度") != -1)
        {
            Debug.Log("测量角度");

            String angle = "";
            for (int i = 0; i < str.Length - 1; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        angle += str.Substring(i, 1) + str.Substring(i + 1, 1) + " ";
                    }
                    else
                    {
                        angle += str.Substring(i, 1) + " ";
                    }
                }
            }

            FormText text1 = new FormText("∠");
            String[] eles  = angle.Split(' ');
            if (eles.Length - 1 != 3)
            {
                Debug.Log("angle input error");
                return;
            }
            FormElement ele1 = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele1.fields[i] = eles[i];
            }
            FormText  text2      = new FormText("的角度");
            FormInput writeInput = new FormInput(3);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;

            Tool tool = geoUI.toolPanel.toolGroups[3].Tools[1];
            SetState(GeoState.Measure);

            currentOperation = new AddMeasureOperation(this, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddMeasureOperation opt = (AddMeasureOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else if (str.IndexOf("面积") != -1)
        {
            Debug.Log("测量面积");

            String face = "";
            for (int i = 1; i < str.Length - 1; i++)
            {
                if (Regex.IsMatch(str.Substring(i, 1), @"^[A-Za-z]+$"))
                {
                    if (Regex.IsMatch(str.Substring(i + 1, 1), @"^[0-9]*$"))
                    {
                        face += str.Substring(i, 1) + str.Substring(i + 1, 1) + " ";
                    }
                    else
                    {
                        face += str.Substring(i, 1) + " ";
                    }
                }
            }

            FormText    text1 = new FormText("平面");
            String[]    eles  = face.Split(' ');
            FormElement ele1  = new FormElement(eles.Length - 1);
            for (int i = 0; i < eles.Length - 1; i++)
            {
                ele1.fields[i] = eles[i];
            }
            FormText  text2      = new FormText("的面积");
            FormInput writeInput = new FormInput(3);
            writeInput.inputs[0] = text1;
            writeInput.inputs[1] = ele1;
            writeInput.inputs[2] = text2;

            Tool tool = geoUI.toolPanel.toolGroups[3].Tools[2];
            SetState(GeoState.Measure);

            currentOperation = new AddMeasureOperation(this, stateController, geometry, geometryBehaviour, geoUI, tool);
            AddMeasureOperation opt = (AddMeasureOperation)currentOperation;
            opt.SetWriteInput(writeInput);
            currentOperation.Start();
        }
        else
        {
            Debug.Log("analysis error");
        }
    }