Beispiel #1
0
 protected override Task OnInitializedAsync()
 {
     FormEventLog           = new List <FormElementEvent>();
     FormModel              = DemoForm.CreateForm();
     FormModel.OnTriggered += FormModelOnOnTriggered;
     return(Task.CompletedTask);
 }
        private void Button_Click(object sender, EventArgs e)
        {
            var Form   = new DemoForm();
            var Helper = new FormOwnerHelper(System.Windows.Application.Current.MainWindow);

            Form.ShowDialog(Helper);
        }
		public void CallingStartWillShowTheForm()
		{
			DemoForm shell = new DemoForm();
			DefaultApplicationContext context = new DefaultApplicationContext(shell, new IModuleLoader[] { });
			context.Start();
			Assert.IsTrue(shell.WasShown);
		}
        public void CallingStartWillShowTheForm()
        {
            DemoForm shell = new DemoForm();
            DefaultApplicationContext context = new DefaultApplicationContext(shell, new IModuleLoader[] { });

            context.Start();
            Assert.IsTrue(shell.WasShown);
        }
        public ActionResult HelloWorld(DemoForm demoForm)
        {
            ResponseResult response  = new ResponseResult();
            DemoModel      demoModel = new DemoModel();

            demoModel.UserName = demoForm.Message;
            if (string.IsNullOrEmpty(demoForm.SerialNumber))
            {
                Log4NetUtil.LogWarn(demoForm.ToJson());
                response.Code    = ResponseResultType.ParamError;
                response.Message = "参数错误";
                return(Content(response.ToJson()));
            }

            response.SerialNumber = "2";
            response.Code         = ResponseResultType.Success;
            response.Message      = _env.EnvironmentName;
            response.Data         = demoModel;

            return(Content(response.ToJson()));
        }
 private void Button_Click(object sender, EventArgs e)
 {
     var Form = new DemoForm();
     var Helper = new FormOwnerHelper(System.Windows.Application.Current.MainWindow);
     Form.ShowDialog(Helper);
 }
        private void btnStartDemo_Click(object sender, EventArgs e)
        {
            var form = new DemoForm();

            form.Show();
        }
 public void DemoFormEventHandlerListHasHead()
 {
     var eventHandlerList = new DemoForm().GetEventHandlerList();
     Assert.AreEqual("ListEntry", eventHandlerList.GetHead().GetType().Name);
 }
 public void RetrieveListEntryWithReflection()
 {
     var head = new DemoForm().GetEventHandlerList().GetHead();
     ApprovalTests.Approvals.Verify(head.GetType().FullName);
 }
Beispiel #10
0
        public HttpResponseMessage GetDiscussionBords(string Mytext)
        {
            HttpResponseMessage message = null;

            try
            {
                string tea        = Mytext;
                string baad       = "";
                bool   nothavenum = true;
                bool   notarabizi = false;
                if (tea.Contains("2") || tea.Contains("3") || tea.Contains("4") || tea.Contains("5") || tea.Contains("7") || tea.Contains("9"))
                {
                    baad = showresponce("arz");
                    //return;
                    nothavenum = false;
                }
                else if (nothavenum)
                {
                    string[] string1 = x1.Split(',');
                    string[] string2 = tea.Split(' ');
                    string[] m       = string1.Distinct().ToArray();
                    string[] n       = string2.Distinct().ToArray();
                    string   Test;
                    var      results = m.Intersect(n, StringComparer.OrdinalIgnoreCase);
                    Test = String.Join(" ", results);
                    //return Test;
                    var aad = Test;
                    if (aad != null && aad != "")
                    {
                        baad = showresponce("arz");
                    }
                    else
                    {
                        notarabizi = true;
                    }
                }

                if (notarabizi)
                {
                    DemoForm kjsdfn = new DemoForm();
                    //var kdjffd = kjsdfn.


                    //this.cbLangCompare.SelectedIndex = -1;
                    //var ty = okjk.ClassifyTextSimple(tea);

                    DialogueMaster.Classification.ICategoryList result = okjk.ClassifyText(tea);
                    //this.tbResult.Text = result.ToString();
                    if (result.Count > 0)
                    {
                        var infoooo = GetLanguageCulture(result[0].Name);
                        //this.cbLangCompare.SelectedItem = GetLanguageCulture(result[0].Name);

                        baad = showresponce(infoooo.Name);
                    }
                }


                if (baad != null && baad != "")
                {
                }
                else
                {
                    baad = "Error Occured";//la langue détectée est
                }



                message = this.Request.CreateResponse(HttpStatusCode.OK, baad);
            }
            catch (Exception ex)
            {
                message = this.Request.CreateResponse(HttpStatusCode.BadRequest, ex);
            }

            return(message);
        }