Beispiel #1
0
 public static FigureForm Instance()
 {
     if (instance == null)
     {
         object locker = FigureForm.locker;
         lock (locker)
         {
             if (instance == null || instance.Created == false)
             {
                 instance = new FigureForm();
             }
         }
     }
     return(instance);
 }
        protected override void OnClick(EventArgs e)
        {
            base.OnClick(e);

            if (this.KeyBoard == true)
            {
                if (this.InputType == eInputType.Int)
                {
                    int result = Convert.ToInt32(MIN);
                    if (this.Text.Length != 0)
                    {
                        int.TryParse(this.Text, out result);
                    }
                    if (FigureForm.ShowKeyBoard(Convert.ToInt32(MIN), Convert.ToInt32(MAX), ref result))
                    {
                        this.Text = result.ToString();
                    }
                }
                else if (this.InputType == eInputType.Float)
                {
                    float result = Convert.ToSingle(MIN);
                    if (this.Text.Length != 0)
                    {
                        float.TryParse(this.Text, out result);
                    }
                    if (FigureForm.ShowKeyBoard(Convert.ToSingle(MIN), Convert.ToSingle(MAX), ref result))
                    {
                        this.Text = string.Format("{0:" + Format + "}", result);
                    }
                }
                else
                {
                    string text = this.Text;
                    //if (LettersForm.ShowKeyBoard(ref text))
                    //{
                    //    this.Text = text;
                    //}
                }
            }
        }