Inheritance: System.Web.UI.Page
示例#1
0
 public void AddInitDone()
 {
     activeForm = form.MAIN;
     AddToInit(AIform.getCharacterList());
     AIform.Close();
     this.Show();
 }
示例#2
0
 public Form(form form)
 {
     id        = form.id;
     name      = form.name;
     hr_login  = form.hr_login;
     questions = form.question.AsEnumerable().Select(t1 => new Question(t1)).AsEnumerable();
 }
示例#3
0
        public string Chat(List <MessageDto> messageList, List <UserDto> userList)
        {
            return(Layout("chat", @$ "
<body id='chat-body'>
    <header>
		<h1>My Little Game Chat</h1>
    </header>
	<nav>
        <form action='/logout' method='post'>
            <button>Logout</button>
        </form>
        <label for='channel-select'></label>
        <select name='channel' id='channel-select'>
            <option value='Best Pony'>Best Pony</option>
            <option value='Super Secret Place'>Super Secret Place</option>
        </select>
    </nav>
    <section id='chat-box'>{String.Join(" \ n ", messageList.Select(m => RenderHtmlMessage(m)))}</section>
    <section id='user-list'>
        <h4>Online Users</h4>
        <div id='user-box'>{String.Join(" \ n ", userList.Select(u => RenderHtmlUser(u)))}</div>
    </section>
    <section id='settings'>
        <h4>Settings</h4>
        <form action='/upload-avatar' method='post' enctype='multipart/form-data'>
            <label class='label-file' for='avatar'>Upload avatar</label>
示例#4
0
文件: Fruit.cs 项目: papalos/Quiz
 public Fruit(string name, form shape, double cost, string where)
 {
     this.where = where;
     this.name  = name;
     this._cost = cost;
     this.shape = shape;
 }
        public IHttpActionResult Putform(int id, form form)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != form.id)
            {
                return(BadRequest());
            }

            db.Entry(form).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!formExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#6
0
        public async Task <object> SendCommomMessage(CommomOaSendModel commomOaSendModel)
        {
            DingTalkServerAddressConfig _addressConfig = DingTalkServerAddressConfig.GetInstance();
            HttpsClient _client = new HttpsClient();

            form[]      forms    = new form[] { };
            List <form> formList = new List <form>();

            if (commomOaSendModel.msg != null)
            {
                foreach (var item in commomOaSendModel.msg)
                {
                    formList.Add(new form()
                    {
                        key   = item.Key,
                        value = item.Value
                    }
                                 );
                }
            }
            forms = formList.ToArray();
            oa oa = new oa()
            {
                message_url = commomOaSendModel.linkUrl,
                head        = new head
                {
                    bgcolor = "FFBBBBBB",
                    text    = "头部标题111222"
                },
                body = new body
                {
                    title = commomOaSendModel.title,
                    form  = forms,
                }
            };
            NewOATestModel newOATestModel = new NewOATestModel()
            {
                msgtype = "oa",
                oa      = oa
            };

            DingTalk.Models.SendOAModel sendOAModel = new SendOAModel()
            {
                //E应用agent_id
                agent_id    = long.Parse(DTConfig.AppAgentId),
                userid_list = commomOaSendModel.userId,
                to_all_user = false,
                //dept_id_list = null,
                msg = newOATestModel
            };
            LoginMobileController loginMobileController = new LoginMobileController();
            var access_token = await loginMobileController.GetAccessToken();

            _client.QueryString.Add("access_token", access_token);
            var url    = _addressConfig.GetWorkMsgUrl;
            var result = await _client.UploadModel(url, sendOAModel);

            return(result);
        }
 public ActionResult nope(form f)
 {
     if (ModelState.IsValid)
     {
         return(View());
     }
     return(View("nop"));
 }
示例#8
0
 void Start()
 {
     _form = form.NOTHING;
     _canRelease = false;
     _sphere = GameObject.FindGameObjectWithTag("Sphere");
     _square = GameObject.FindGameObjectWithTag("Square");
     Screen.orientation = ScreenOrientation.LandscapeLeft;
 }
示例#9
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            form form = await db.CADASTRO.FindAsync(id);

            db.CADASTRO.Remove(form);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#10
0
        public ActionResult Edit(form form)
        {
            string state = Request.Form["state"]; //Состояние (могут ли пользователи отвечать на вопросы анкеты)

            form.id_state = (state != null) ? Convert.ToInt32(state) : 2;
            db.form.AddOrUpdate(form);
            db.SaveChanges();
            return(Redirect("/forms/details?id=" + form.id));
        }
示例#11
0
        public async Task <ActionResult> Edit([Bind(Include = "ID,NOME,SOBRENOME,TELEFONE")] form form)
        {
            if (ModelState.IsValid)
            {
                db.Entry(form).State = System.Data.Entity.EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(form));
        }
示例#12
0
        /// <summary>Transform this VerbBuilder into a VerbPhraseBuilder with form <paramref name="phraseForm"/> and this as its head</summary>
        internal VerbPhraseBuilder AsVerbPhrase(form phraseForm)
        {
            VerbPhraseBuilder result = new VerbPhraseBuilder()
            {
                Form = phraseForm
            };

            Parent?.ReplaceChild(this, result);
            result.AddHead(this);
            return(result);
        }
示例#13
0
 public ViewResult RsvpForm(form response)
 {
     if (ModelState.IsValid)
     {
         return(View("Thanks", response));
     }
     else
     {
         return(View());
     }
 }
示例#14
0
        //Удаление формы (включает удаление всех вопросов с вариантами ответов и ответов на них)
        public ActionResult DelForm(int id)
        {
            form f = db.form.Find(id);

            //DELETE ANSWERS
            List <answer_text> a = db.answer_text.Where(p => p.question.id_form == id).ToList();

            db.answer_text.RemoveRange(a);
            List <answer_variant> b = db.answer_variant.Where(p => p.variant.question.id_form == id).ToList();

            db.answer_variant.RemoveRange(b);
            List <answer_else> c = db.answer_else.Where(p => p.question_else.question.id_form == id).ToList();

            db.answer_else.RemoveRange(c);
            List <answer_table> d = db.answer_table.Where(p => p.table_variant.question.id_form == id).ToList();

            db.answer_table.RemoveRange(d);
            List <answer_file> e = db.answer_file.Where(p => p.variant_file.question.id_form == id).ToList();

            db.answer_file.RemoveRange(e);
            db.SaveChanges();
            //DELETE ANSWERS (END)

            //DELETE VARIANT
            List <variant> a1 = db.variant.Where(p => p.question.id_form == id).ToList();

            db.variant.RemoveRange(a1);
            List <variant_file> a2 = db.variant_file.Where(p => p.question.id_form == id).ToList();

            db.variant_file.RemoveRange(a2);
            List <table_variant> a3 = db.table_variant.Where(p => p.question.id_form == id).ToList();

            db.table_variant.RemoveRange(a3);
            db.SaveChanges();
            //DELETE VARIANT (END)

            //DELETE QUESTION
            List <table_question> b1 = db.table_question.Where(p => p.question.id_form == id).ToList();

            db.table_question.RemoveRange(b1);
            List <question_else> b2 = db.question_else.Where(p => p.question.id_form == id).ToList();

            db.question_else.RemoveRange(b2);
            List <question> b3 = db.question.Where(p => p.id_form == id).ToList();

            db.question.RemoveRange(b3);
            db.SaveChanges();
            //DELETE QUESTION (END)

            db.form.Remove(f);
            db.SaveChanges();
            return(Redirect("/Forms/Index"));
        }
示例#15
0
        public async Task <ActionResult> Create([Bind(Include = "ID,NOME,SOBRENOME,TELEFONE")] form form)
        {
            if (ModelState.IsValid)
            {
                db.CADASTRO.Add(form);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(form));
        }
示例#16
0
        //Просмотр анкеты по идентификатору
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            form form = db.form.Find(id);

            if (form == null)
            {
                return(HttpNotFound());
            }
            return(View(form));
        }
示例#17
0
        public ActionResult Create([Bind(Include = "name, id_state,text_after, text_start, text_before_send")] form form)
        {
            if (ModelState.IsValid)
            {
                form.id         = (db.form.Count() > 0) ? (db.form.Max(p => p.id) + 1) : 1;
                form.date_start = DateTime.Now;
                db.form.Add(form);
                db.SaveChanges();
                return(Redirect("/forms/details?id=" + form.id));
            }

            ViewBag.id_state = new SelectList(db.state, "id", "name", form.id_state);
            return(View(form));
        }
        public IHttpActionResult Deleteform(int id)
        {
            form form = db.form.Find(id);

            if (form == null)
            {
                return(NotFound());
            }

            db.form.Remove(form);
            db.SaveChanges();

            return(Ok(form));
        }
示例#19
0
        // GET: forms/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            form form = await db.CADASTRO.FindAsync(id);

            if (form == null)
            {
                return(HttpNotFound());
            }
            return(View(form));
        }
示例#20
0
 public void CreatePlayerDone(bool add)
 {
     activeForm = form.MAIN;
     if (add == false)
     {
         playerList.Remove(CurrentPlayer);
     }
     playerList.Add(CPform.finishedPlayer);
     CurrentPlayer = CPform.finishedPlayer;
     updatePlayers();
     CPform.Close();
     this.Show();
     DisplayPlayer();
 }
示例#21
0
        //Просмотр формы по идентификатору
        public ActionResult Details(int?id)
        {
            ViewBag.type_quest = new SelectList(db.type_question, "id", "name");
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            form form = db.form.Find(id);

            if (form == null)
            {
                return(HttpNotFound());
            }
            return(View(form));
        }
示例#22
0
        //Редактирование формы
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            form form = db.form.Find(id);

            if (form == null)
            {
                return(HttpNotFound());
            }
            ViewBag.id_state = new SelectList(db.state, "id", "name", form.id_state);
            return(View(form));
        }
示例#23
0
        public void CreateNPCDone(bool add)
        {
            activeForm = form.MAIN;
            List <NPC> list = CNform.finishedNPC.ToList();

            if (add == false)
            {
                NPCList.Remove(CurrentNPC);
                CurrentNPC = CNform.finishedNPC[0];
            }
            NPCList.AddRange(CNform.finishedNPC.ToList());
            updateNPCs();
            CNform.Close();
            this.Show();
            DisplayNPC();
        }
        public async Task ShouldNotFailWithWaitForEvent()
        {
            var failed = false;

            TaskScheduler.UnobservedTaskException += (_, e) =>
            {
                e.SetObserved();
                failed = true;
            };

            await Page.GotoAsync(Server.EmptyPage);

            await Page.MainFrame.SetContentAsync(@$ "
<!DOCTYPE html>
<html>
<body>
<form action='{Server.EmptyPage}'>
示例#25
0
 public EmailService(form FormType)
 {
     this.FormType = FormType;
     this.EmailServiceHost = System.Configuration.ConfigurationManager.AppSettings["EmailServiceHost"];
     this.EmailServicePort = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["EmailServicePort"]);
     this.EmailServiceUserName = System.Configuration.ConfigurationManager.AppSettings["EmailServiceUserName"];
     this.EmailServicePassword = System.Configuration.ConfigurationManager.AppSettings["EmailServicePassword"];
     this.EmailServiceFromAddress = System.Configuration.ConfigurationManager.AppSettings["EmailServiceFromAddress"];
     this.EmailAddresses = new MailAddressCollection();
     for (var index = 1; index <= 9; index++)
     {
         var configurationString = String.Format("{0}EmailAddress{1}", this.FormType, index);
         var addressString = System.Configuration.ConfigurationManager.AppSettings[configurationString];
         if (addressString != null)
         {
             this.EmailAddresses.Add(new MailAddress(addressString));
         }
     }
 }
示例#26
0
        /// <summary>
        /// abre el menu y los mozos, deberia cerrar todo lo demas
        /// </summary>
        /// <typeparam name="form"></typeparam>
        internal void AbrirFormEnPanel <form>() where form : Form, new()
        {
            Form formulario;

            formulario = panelDatos.Controls.OfType <Form>().FirstOrDefault();


            //si hay formularios del otro tipo los cerramos

            if (formulario != null)
            {
                cerrarPaneles();
                formulario = panelDatos.Controls.OfType <form>().FirstOrDefault();
            }

            //si el formulario/instancia no existe, creamos nueva instancia y mostramos
            if (formulario == null)
            {
                formulario                 = new form();
                formulario.TopLevel        = false;
                formulario.FormBorderStyle = FormBorderStyle.None;
                formulario.Dock            = DockStyle.Left;

                panelDatos.Controls.Add(formulario);
                panelDatos.Tag = formulario;
                formulario.Show();

                formulario.BringToFront();
            }
            else
            {
                //si la Formulario/instancia existe, lo traemos a frente
                formulario.BringToFront();

                //Si la instancia esta minimizada mostramos
                if (formulario.WindowState == FormWindowState.Minimized)
                {
                    formulario.WindowState = FormWindowState.Normal;
                }
            }
        }
        public IHttpActionResult Postform(form form)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (db.hr.Where(t1 => t1.login == form.hr_login).FirstOrDefault() == null)
            {
                return(NotFound());
            }

            form Form = new form()
            {
                hr_login = form.hr_login, name = form.name
            };

            db.form.Add(Form);
            db.SaveChanges();

            return(Ok(Form.id));
        }
示例#28
0
 public Float(uint prec = default, RoundingMode mode = default, Accuracy acc = default, form form = default, bool neg = default, nat mant = default, int exp = default)
 {
     this.prec = prec;
     this.mode = mode;
     this.acc  = acc;
     this.form = form;
     this.neg  = neg;
     this.mant = mant;
     this.exp  = exp;
 }
        public ActionResult CRTPRD(string category, Product p, bool Tank = false, instalation Instalation = instalation.Напольный, drain Drain = drain.Вертикальный, form Form = form.Ассиметричная, material Material = material.Акрил, int Length = 0, int Width = 0, int Pallet_height = 0)
        {
            MyContext db = new MyContext();

            if (category == "Ванны")
            {
                Bath prod = new Bath();
                prod.Form           = Form;
                prod.Material       = Material;
                prod.Length         = Length;
                prod.Width          = Width;
                prod.Name           = p.Name;
                prod.Description    = p.Description;
                prod.Price          = p.Price;
                prod.PathPicture    = p.PathPicture;
                prod.ManufacturerId = p.ManufacturerId;
                db.Bathes.Add(prod);
                db.SaveChanges();
            }
            else if (category == "Душевые кабинки")
            {
                ShowerCubicle prod = new ShowerCubicle();
                prod.Form           = Form;
                prod.Material       = Material;
                prod.Length         = Length;
                prod.Width          = Width;
                prod.Pallet_height  = Pallet_height;
                prod.Name           = p.Name;
                prod.Description    = p.Description;
                prod.Price          = p.Price;
                prod.PathPicture    = p.PathPicture;
                prod.ManufacturerId = p.ManufacturerId;
                db.ShowerCubicles.Add(prod);
                db.SaveChanges();
            }
            else if (category == "Унитазы")
            {
                Toilet prod = new Toilet();
                prod.Instalation    = Instalation;
                prod.Drain          = Drain;
                prod.Tank           = Tank;
                prod.Name           = p.Name;
                prod.Description    = p.Description;
                prod.Price          = p.Price;
                prod.PathPicture    = p.PathPicture;
                prod.ManufacturerId = p.ManufacturerId;
                db.Toilets.Add(prod);
                db.SaveChanges();
            }
            return(Redirect("/Home/ASDFGHJKL"));
        }
        /// <summary>
        /// Получить форму регистрации/авторизации
        /// </summary>
        /// <param name="user_login_input_id">html dom id/name - идентификатор/имя input-a ввода логина</param>
        /// <param name="user_password_input_id">html dom id/name - идентификатор/имя input-a ввода пароля</param>
        /// <param name="user_password_repeat_input_id">html dom id/name - идентификатор/имя input-a ввода повтора пороля</param>
        /// <param name="reg_new_user_chekbox_id">html dom id/name - идентификатор/имя chekbox-a для регистрации нового пользователя</param>
        /// <param name="button_send_login_form_id">html dom id/name - идентификатор/имя button-a </param>
        /// <param name="re_captcha_key">api - ключ reCaptcha</param>
        /// <param name="collapse_info_new_user_input_css">css класс - области сворачивания и разворачивания для регистрации</param>
        /// <returns></returns>
        public static List <base_dom_root> GetLoginForm(
            string re_captcha_key                   = null,
            string user_password_input_id           = "user_password_input_id",
            string user_password_repeat_input_id    = "user_password_repeat_input_id",
            string user_login_input_id              = "user_login_input_id",
            string reg_new_user_chekbox_id          = "reg_new_user_chekbox_id",
            string button_send_login_form_id        = "button_send_login_form_id",
            string collapse_info_new_user_input_css = "collapse_info_new_user_input")
        {
            List <base_dom_root> dom_elements = new List <base_dom_root>();

            form html_response = new form()
            {
                Id_DOM      = "login_form_id",
                target      = TargetsEnum._self,
                method_form = MethodsFormEnum.POST
            };

            html_response.AddCSS("was-validated");
            html_response.SetAttribute("novalidate", null);

            TextInput textInput = new TextInput("Ваш логин", user_login_input_id)
            {
                InputInfoFooter = "Введите логин для входа"
            };

            textInput.Input.placeholder = "Логин";
            textInput.Input.required    = true;
            html_response.AddDomNode(textInput);

            textInput = new TextInput("Ваш пароль", user_password_input_id)
            {
                InputInfoFooter = "Пароль для входа"
            };
            textInput.Input.type        = InputTypesEnum.password;
            textInput.Input.placeholder = "Пароль";
            html_response.AddDomNode(textInput);

            textInput = new TextInput("Повторите пароль", user_password_repeat_input_id)
            {
                InputInfoFooter = "Повторно введите пароль"
            };
            textInput.Input.type        = InputTypesEnum.password;
            textInput.Input.placeholder = "Повтор";

            textInput.AddCSS("panel-collapse collapse " + collapse_info_new_user_input_css, true);
            html_response.AddDomNode(textInput);

            html_response.Childs[html_response.Childs.Count - 1].AddCSS("panel-collapse collapse " + collapse_info_new_user_input_css, true);

            html_response.Childs.Add(new CheckboxInput("Зарегистрироваться", reg_new_user_chekbox_id));

            p reg_new_user_info = new p("");

            reg_new_user_info.AddCSS("clearfix");
            using (ul panel_collapse = new ul())
            {
                panel_collapse.AddCSS("panel-collapse collapse " + collapse_info_new_user_input_css, true);
                reg_new_user_info.Childs.Add(panel_collapse);
            }

            reg_new_user_info.Childs[0].Childs.Add(new li()
            {
                InnerText = "Придумайте/запомните надёжный логин/пароль и входите"
            });
            reg_new_user_info.Childs[0].Childs.Add(new li()
            {
                InnerText = "Учётная запись будет создана автоматически"
            });

            html_response.Childs.Add(reg_new_user_info);
            if (!string.IsNullOrEmpty(re_captcha_key))
            {
                html_response.Childs.Add(new hr());
                html_response.Childs.Add(new h4("Пройдите проверку reCAPTCHA"));
                div sitekey = new div();
                sitekey.AddCSS("g-recaptcha");
                sitekey.SetAttribute("data-size", "compact");
                sitekey.SetAttribute("data-sitekey", re_captcha_key);
                html_response.Childs.Add(sitekey);
            }
            html_response.Childs.Add(GetButton("Войти", button_send_login_form_id, null, VisualBootstrapStylesEnum.primary, SizingBootstrap.Lg, true));

            dom_elements.Add(Get_DIV_Bootstrap_Card("Вход/Регистрация", html_response));
            return(dom_elements);
        }
示例#31
0
        public ActionResult IeltsForm([Bind(Include = "Mobile")] online online1, Helper help, form ff)
        {
            ff = db.forms.FirstOrDefault();
            string franch  = help.Permission();
            string mobile  = online1.Mobile;
            string message = franch + '/' + mobile;
            // string msg = "http://inquiry.bluebirdimmigrations.com/Ielts?f=" + message;
            string msg = ff.Ielts + message;

            help.sendsms(mobile, "Dear, '" + msg + "' ");
            TempData["Success"] = "Send Message";
            return(RedirectToAction("Form", "onlines"));
        }
示例#32
0
        public ActionResult Form([Bind(Include = "Mobile")] online online1, Helper help, form ff)
        {
            online check = db.onlines.FirstOrDefault(x => x.Mobile == online1.Mobile);

            if (check == null)
            {
                ff = db.forms.FirstOrDefault();
                string franch  = help.Permission();
                string mobile  = online1.Mobile;
                string message = franch + '/' + mobile;
                //  string msg = "http://inquiry.bluebirdimmigrations.com/Default?f=" + message;
                string msg = ff.Immigration + message;

                help.sendsms(mobile, "Dear, '" + msg + "'");
                TempData["Success"] = "Send Message";
                return(View());
            }
            else
            {
                TempData["danger"] = "Mobile No Already Register";
                return(View());
            }
        }
示例#33
0
 private void barButtonItem3_ItemClick(object sender, ItemClickEventArgs e)
 {
     form f = new form();
     f.Show();
 }
示例#34
0
    void Update()
    {
        #if UNITY_STANDALONE_WIN
        if (Input.GetMouseButton(0) || Input.GetMouseButtonDown(0) || Input.GetMouseButtonUp(0))
        {
            Ray screenRay = Camera.main.ScreenPointToRay(Input.mousePosition);
            if (_square.GetComponent<Square>().getActive())
            {
                _form = form.SQUARE;
                _distance = Vector3.Distance(new Vector3(screenRay.origin.x, screenRay.origin.y, 0), _square.transform.position);
            }
            else if (_sphere.GetComponent<Sphere>().getActive())
            {
                _form = form.SPHERE;
                _distance = Vector3.Distance(new Vector3(screenRay.origin.x, screenRay.origin.y, 0), _sphere.transform.position);
            }
            else
                _form = form.NOTHING;
            if (Input.GetMouseButtonDown(0))
            {
                if (_distance < 1.5f)
                {
                    if (_form == form.SQUARE)
                        _square.GetComponent<Square>().OnTouch();
                    else
                        _sphere.GetComponent<Sphere>().OnTouch();
                    _canRelease = true;
                }
            }
            if (Input.GetMouseButtonUp(0))
            {
                if (_canRelease)
                {

                    if (_form == form.SQUARE)
                        _square.GetComponent<Square>().OnRelease();
                    else
                        _sphere.GetComponent<Sphere>().OnRelease();
                    _canRelease = false;
                }
            }
        }
        #endif

        #if UNITY_ANDROID
        touchesOld = new GameObject[touchList.Count];
        touchList.CopyTo(touchesOld);
        touchList.Clear();
        foreach (Touch touch in Input.touches)
        {
            Ray screenRay = Camera.main.ScreenPointToRay(touch.position);
            if (_square.GetComponent<Square>().getActive())
            {
                _form = form.SQUARE;
                _distance = Vector3.Distance(new Vector3(screenRay.origin.x, screenRay.origin.y, 0), _square.transform.position);
            }
            else if (_sphere.GetComponent<Sphere>().getActive())
            {
                _form = form.SPHERE;
                _distance = Vector3.Distance(new Vector3(screenRay.origin.x, screenRay.origin.y, 0), _sphere.transform.position);
            }
            else
                _form = form.NOTHING;
            if (_form != form.NOTHING)
            {
                switch (touch.phase)
                {
                    case TouchPhase.Began:
                        if (_distance < 1.5f)
                        {
                            if (_form == form.SQUARE)
                                _square.GetComponent<Square>().OnTouch();
                            else
                                _sphere.GetComponent<Sphere>().OnTouch();
                            _canRelease = true;
                        }
                        break;
                    case TouchPhase.Ended:
                        if (_canRelease)
                        {
                            if (_form == form.SQUARE)
                                _square.GetComponent<Square>().OnRelease();
                            else
                                _sphere.GetComponent<Sphere>().OnRelease();
                            _canRelease = false;
                        }
                        break;
                }
            }
        }
        #endif
    }