示例#1
0
        public void MsgBoxButtons(String title, String msg, object btn2lst)
        {
            invisible();
            Dialog.SetTitle(title);
            Button1.SetText("CANCEL", TextView.BufferType.Normal);
            Button2.SetText("OK", TextView.BufferType.Normal);
            Text1.Visibility   = ViewStates.Visible;
            Button1.Visibility = ViewStates.Visible;
            Button2.Visibility = ViewStates.Visible;

            Button1.Click += delegate {  };
            Button2.Click += delegate {  };

//			btn1.SetOnClickListener (View.IOnClickListener );//{ public void onClick(View v){dialog.cancel();}});
//			btn2.SetOnClickListener(btn2lst);
            Text1.SetText(msg, TextView.BufferType.Normal);
            try
            {
                Dialog.Show();
            }
            catch (Exception err)
            {
                Log.Debug("xxx", err.Message);
            }
        }
示例#2
0
 public void MsgBoxButtons(String title, String msg, String button1name, String button2name, String button3name, EventHandler btn1lst, EventHandler btn2lst, EventHandler btn3lst, bool usesave)
 {
     invisible();
     Dialog.SetTitle(title);
     Button1.SetText(button1name, TextView.BufferType.Normal);
     Button2.SetText(button2name, TextView.BufferType.Normal);
     Button3.SetText(button3name, TextView.BufferType.Normal);
     Text1.Visibility   = ViewStates.Visible;
     Button1.Visibility = ViewStates.Visible;
     Button2.Visibility = ViewStates.Visible;
     Button3.Visibility = ViewStates.Visible;
     Button1.Click     += btn1lst;
     Button2.Click     += btn2lst;
     Button3.Click     += btn3lst;
     Text1.SetText(msg, TextView.BufferType.Normal);
     if (usesave)
     {
         CheckBoxSaveText.Visibility = ViewStates.Visible;
         CheckBoxSave.Visibility     = ViewStates.Visible;
     }
     try
     {
         Dialog.Show();
     }
     catch (Exception err)
     {
         Log.Debug("xxx", err.Message);
     }
 }
示例#3
0
        private void UpdatePanel(ResultPanelType result)
        {
            switch (result)
            {
            case ResultPanelType.NoContent:
                Text1.SetResourceReference(TextBlock.TextProperty, "Dialog_NoContentFound_NoMatchingResultsTitle");
                Text2.SetResourceReference(TextBlock.TextProperty, "Dialog_NoContentFound_NoMatchingResultsText");
                break;

            case ResultPanelType.NoNews:
                Text1.SetResourceReference(TextBlock.TextProperty, "Dialog_NoNewsContentFound_NoMatchingResultsTitle");
                Text2.SetResourceReference(TextBlock.TextProperty, "Dialog_NoNewsContentFound_NoMatchingResultsText");
                break;

            case ResultPanelType.Loading:
                Text1.SetResourceReference(TextBlock.TextProperty, "Dialog_ResultPanel_Loading_Title");
                Text2.SetResourceReference(TextBlock.TextProperty, "Dialog_ResultPanel_Loading_Text");
                break;

            case ResultPanelType.Error:
                Text1.SetResourceReference(TextBlock.TextProperty, "Dialog_ResultPanel_Error_Title");
                Text2.SetResourceReference(TextBlock.TextProperty, "Dialog_ResultPanel_Error_Text");
                break;
            }
        }
示例#4
0
        public MainWindow()
        {
            InitializeComponent();

            Button1.Click        += Button1_Click;
            TextBox1.TextChanged += TextBox1_TextChanged;

            foreach (var ctl in new UIElement[] { Border1, Grid1, Button1, TextBlock1, TextBox1, })
            {
                ctl.PreviewMouseDown += MouseButtonEventHandler;
                ctl.MouseDown        += MouseButtonEventHandler;
                ctl.PreviewMouseUp   += MouseButtonEventHandler;
                ctl.MouseUp          += MouseButtonEventHandler;

                ctl.PreviewKeyDown += KeyEventHandler;
                ctl.KeyDown        += KeyEventHandler;
                ctl.PreviewKeyUp   += KeyEventHandler;
                ctl.KeyUp          += KeyEventHandler;
            }

            //// 「添付イベント」として親要素でイベントを拾うことも可能。
            //// XAML では次のように書く。
            //// <Border x:Name="Border1" Button.Click="Button1_Click">
            //// C# では、以下のように
            //Border1.AddHandler(Button.ClickEvent, new RoutedEventHandler(Button1_Click));
            //Grid1.AddHandler(Button.ClickEvent, new RoutedEventHandler(Button1_Click));

            // テスト用: 他アプリをアクティブにしてからこのアプリをアクティブにすると、表示をクリア
            this.Activated += (s, e) => Text1.Clear();
        }
示例#5
0
        // Stuff for putting the focus on the content
        private void MainPage_LayoutUpdated(object sender, object e)
        {
            if (_isPageLoaded == true)
            {
                Text1.Focus(FocusState.Programmatic); // Set focus on the main content so the user can start typing right away

                //set default font to UIs that still not depend on binding
                Fonts.PlaceholderText = QSetting.DefaultFont;
                Fonts.SelectedItem    = QSetting.DefaultFont;
                FontSelected.Text     = Convert.ToString(Fonts.SelectedItem);
                Text1.Document.Selection.CharacterFormat.Name = QSetting.DefaultFont;

                //check what default font color is

                if (QSetting.DefaultFontColor == "Default")
                {
                    SelectedDefaultFontColor = 0;
                }
                else
                {
                    SelectedDefaultFontColor = FontColorCollections.IndexOf(FontColorCollections.First(i => i.TechnicalName == QSetting.DefaultFontColor));
                }

                Text1.Document.Selection.CharacterFormat.Size = QSetting.DefaultFontSize;

                LaunchCheck(); //call method to check what mode the app should launch in

                _isPageLoaded = false;
            }
        }
示例#6
0
        protected override void Execute(CodeActivityContext context)
        {
            string text1  = Text1.Get(context);
            string text2  = Text2.Get(context);
            string apiKey = APIKey.Get(context);
            string seKey  = SecretKey.Get(context);

            try
            {
                var client = new Baidu.Aip.Nlp.Nlp(apiKey, seKey);
                //修改超时时间
                client.Timeout = 60000;
                //设置可选参数
                var options = new Dictionary <string, object>
                {
                    { "model", model }
                };
                //带参数调用短文本相似度
                string result = client.Simnet(text1, text2, options).ToString();
                Result.Set(context, result);
            }
            catch (Exception e)
            {
                SharedObject.Instance.Output(SharedObject.enOutputType.Error, "有一个错误产生", e.Message);
            }
        }
        void ReleaseDesignerOutlets()
        {
            if (GreetingLabel != null)
            {
                GreetingLabel.Dispose();
                GreetingLabel = null;
            }

            if (Text1 != null)
            {
                Text1.Dispose();
                Text1 = null;
            }

            if (Button1 != null)
            {
                Button1.Dispose();
                Button1 = null;
            }

            if (FooterLabel != null)
            {
                FooterLabel.Dispose();
                FooterLabel = null;
            }
        }
示例#8
0
        private void OnTimedEvent1(object sender, ElapsedEventArgs e)
        {
            BarraProgresso2.ProgressTo(1, 5000, Easing.Linear);

            Text1.TranslateTo(-500, 0, 500, Easing.Linear);

            Text2.TranslateTo(370, 0, 500, Easing.Linear);

            Text3.TranslateTo(70, 0, 500, Easing.Linear);
            Text3.FadeTo(0, 600, Easing.SinInOut);


            Imagens.FadeTo(1, 500, Easing.SinInOut);

            Planet.TranslateTo(-80, 175, 500, Easing.Linear);
            Planet.ScaleTo(2.5, 500);

            Timer timer = new Timer();

            timer.Interval = 5000;

            timer.Elapsed += OnTimedEvent2;

            timer.AutoReset = false;

            timer.Enabled = true;
        }
示例#9
0
 private void Command2_Click(System.Object _sender, System.EventArgs _e1)
 {
     Adodc1.Recordset.Find("No_TP='" + Text1.Text + "'", nce.adodb.SearchDirection.adSearchForward, 1);
     if (!(Adodc1.Recordset.Eof))
     {
         MessageBox.Show("Kode TP sudah ada sebelumnya atau nomor urut telah ada sebelumnya", "Project1");
     }
     else
     {
         if (Text1.Text == "" || Text2.Text == "" || Text3.Text == "")
         {
             MessageBox.Show("Data Kurang Lengkap", "Project1", MessageBoxButtons.OK, MessageBoxIcon.Error);
             Text1.Focus();
         }
         else
         {
             Adodc1.Recordset.Fields["No_TP"].Value   = Text1.Text;
             Adodc1.Recordset.Fields["Nama_TP"].Value = Text2.Text;
             Adodc1.Recordset.Fields["alamat"].Value  = Text3.Text;
             Adodc1.Recordset.Update();
             Adodc1.Refresh();
             TDBGrid1.Refresh();
             Text1.Text       = "";
             Text2.Text       = "";
             Text3.Text       = "";
             Command2.Enabled = false;
             Command1.Enabled = true;
         }
     }
 }
示例#10
0
        private void Search_Click(object sender, EventArgs e)
        {
            Text1.Clear();
            Book book = OurBook();

            if (!LINQ_button.Checked && !DOM_button.Checked && !SAX_button.Checked)
            {
                MessageBox.Show("Ви повинні обрати спосіб пошуку (LINQ, DOM або SAX)");
            }
            // MessageBox.Show(book.BookShop);
            if (LINQ_button.Checked)
            {
                ISearcher currentSearcher = new Linq(path);
                book.Algo = currentSearcher;
                final     = book.Algorithm(book);
                OutPut(final);
            }
            if (DOM_button.Checked)
            {
                ISearcher currentSearcher = new DOM(path);
                book.Algo = currentSearcher;
                final     = book.Algorithm(book);
                OutPut(final);
            }
            if (SAX_button.Checked)
            {
                ISearcher currentSearcher = new SAX(path);
                book.Algo = currentSearcher;
                final     = book.Algorithm(book);
                OutPut(final);
            }
        }
 public AtmButtonControl(AtmButton atmButton)
 {
     InitializeComponent();
     ButtonText0   = atmButton.Text0;
     ButtonText1   = atmButton.Text1;
     ButtonText2   = atmButton.Text2;
     ButtonText3   = atmButton.Text3;
     Text0Color    = atmButton.Text0Color.ToString() != "#00000000" ? atmButton.Text0Color : Colors.White;
     Text1Color    = atmButton.Text1Color.ToString() != "#00000000" ? atmButton.Text1Color : Colors.White;
     Text2Color    = atmButton.Text2Color.ToString() != "#00000000" ? atmButton.Text2Color : Colors.White;
     Text3Color    = atmButton.Text3Color.ToString() != "#00000000" ? atmButton.Text3Color : Colors.White;
     MainText.Text = atmButton.MainText;
     ImagePath     = atmButton.ImagePath;
     Name          = atmButton.Name + DateTime.Now.Ticks;
     ButtonImage.SetValue(NameProperty, Name);
     MainText.SetValue(NameProperty, Name);
     Text0.SetValue(NameProperty, Name);
     Text1.SetValue(NameProperty, Name);
     Text2.SetValue(NameProperty, Name);
     Text3.SetValue(NameProperty, Name);
     IsRightButton = atmButton.IsRightButton;
     if (IsRightButton)
     {
         ButtonGrid.HorizontalAlignment = HorizontalAlignment.Right;
     }
 }
示例#12
0
        public void MsgBoxLogin(String login, String psw, View.IOnClickListener btn2lst)
        {
            invisible();
            Dialog.SetTitle("Login/Password");
            Edit1.SetText(login, TextView.BufferType.Normal);
            Edit2.SetText(psw, TextView.BufferType.Normal);
            Button1.SetText("CANCEL", TextView.BufferType.Normal);
            Button2.SetText("OK", TextView.BufferType.Normal);
            Text1.Visibility = ViewStates.Visible;
            Text1.SetText("Login", TextView.BufferType.Normal);
            Text2.Visibility = ViewStates.Visible;
            Text2.SetText("Password", TextView.BufferType.Normal);
            Button1.Visibility = ViewStates.Visible;
            Button2.Visibility = ViewStates.Visible;
            Edit1.Visibility   = ViewStates.Visible;
            Edit2.Visibility   = ViewStates.Visible;
//			btn1.SetOnClickListener (new View.IOnClickListener ());//{public void onClick(View v){dialog.cancel();}});
//			btn2.SetOnClickListener(btn2lst);
            try
            {
                Dialog.Show();
            }
            catch (Exception err)
            {
                Log.Debug("xxx", err.Message);
            }
        }
示例#13
0
        private void DeleteSetBtn_Click(object sender, EventArgs e)
        {
            ChooseSet.Text = "";
            ChooseSet.Items.Remove(currentSet.SetName);

            Text1.Clear();
            Text2.Clear();
            Title1.Clear();
            Title2.Clear();
            PointerInput.Clear();
            PointerVal.Text = "";

            Querey querey = new Querey();

            using (querey.connection = querey.NewConn)
            {
                string[][] tables = { new string[] { "Sets", "Id" }, new string[] { "Flashcards", "SetId" }, new string[] { "Permissions", "SetId" }, new string[] { "SetProgress", "SetId" } };

                foreach (string[] table in tables)
                {
                    using (querey.command = querey.NewComm)
                    {
                        querey.command.CommandText = "DELETE FROM " + table[0] + " WHERE " + table[1] + "= @setid;";
                        querey.AddParameter("@setid", currentCard.setId);
                        querey.command.ExecuteNonQuery();
                    }
                }
            }

            currentSet = null;

            ChangeEdit(false);
            SaveChanges();
            new MessageForm("deleted").Show();
        }
示例#14
0
        private void KursButton_Click(object sender, EventArgs e)
        {
            Text1 tmp2 = new Text1(KursNamnTxtBox.Text, SalNrTxtBox.Text);

            text1.Add(tmp2);
            PrintText1List();
        }
示例#15
0
 public StringLengthCounterModel()
 {
     this.Text2 =
         Text1
         .Select(x => string.IsNullOrEmpty(x) ? "0文字" : x.Length + "文字")
         .ToReadOnlyReactivePropertySlim();
 }
示例#16
0
        public override string GenerateJson(bool topLevel)
        {
            var b = new StringBuilder(base.GenerateJson(false));

            var s = Text1.GenerateJson(false);

            if (!string.IsNullOrWhiteSpace(s) && s != "\"\"")
            {
                b.AppendFormat(s.StartsWith("\"") ? "Text1:{0}," : "Text1:\"{0}\",", s);
            }

            s = Text2.GenerateJson(false);
            if (!string.IsNullOrWhiteSpace(s) && s != "\"\"")
            {
                b.AppendFormat(s.StartsWith("\"") ? "Text2:{0}," : "Text2:\"{0}\",", s);
            }

            s = Text3.GenerateJson(false);
            if (!string.IsNullOrWhiteSpace(s) && s != "\"\"")
            {
                b.AppendFormat(s.StartsWith("\"") ? "Text3:{0}," : "Text3:\"{0}\",", s);
            }

            s = Text4.GenerateJson(false);
            if (!string.IsNullOrWhiteSpace(s) && s != "\"\"")
            {
                b.AppendFormat(s.StartsWith("\"") ? "Text4:{0}," : "Text4:\"{0}\",", s);
            }

            return(b.ToString());
        }
示例#17
0
 protected override void Prepare(EndianBinaryWriter w)
 {
     Position.Write(w);
     WriteString8(w, Text1.Serialize());
     WriteString8(w, Text2.Serialize());
     WriteString8(w, Text3.Serialize());
     WriteString8(w, Text4.Serialize());
 }
示例#18
0
    // Start is called before the first frame update
    void Start()
    {
        Gamemana    = GameObject.Find("GameManager");
        Gamemanager = Gamemana.GetComponent <GameManager>();

        Text1.SetActive(false);
        Text2.SetActive(false);
        Text3.SetActive(false);
        //Trajectory.SetActive(false);
        //ResultCamera.SetActive(false);
    }
示例#19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["UserType"] == null || Convert.ToInt32(Session["UserType"]) != Global.AdminUserType) //admin
     {
         Global.Application_AccessDenied(sender, e);
     }
     else
     {
         SqlDataSource1.ConnectionString = Global.getConnectionString();
     }
     Text1.Focus();
 }
示例#20
0
        // Actions on the person
        private void AddGuest_Click(object sender, EventArgs e)
        {
            personToEdit = false;

            Text1.Clear();
            Text2.Clear();
            Text3.Clear();
            Text4.Clear();
            TPDateOfBirth.Value = DateTime.Today;

            Panel_Reservation.Enabled = false;
            Panel_Guest.Visible       = true;
        }
示例#21
0
 public override void Show(ZuHeTool tool, string searchInput)
 {
     if (!string.IsNullOrEmpty(searchInput) && Text1.ToLower().Contains(searchInput.ToLower()))
     {
         MyCreate.Box_Hei(() =>
         {
             tool.SelectTextText_B(Text1, Text2);
         });
     }
     else
     {
         tool.SelectTextText(Text1, Text2);
     }
 }
示例#22
0
 public void MsgBox(String msg)
 {
     invisible();
     Text1.Visibility = ViewStates.Visible;
     Text1.SetText(msg, TextView.BufferType.Normal);
     try
     {
         Dialog.Show();
     }
     catch (Exception err)
     {
         Log.Debug("xxx", err.Message);
     }
 }
示例#23
0
 private void Command3_Click(System.Object _sender, System.EventArgs _e1)
 {
     if (Adodc1.Recordset.RecordCount == 0)
     {
         MessageBox.Show("Data Tidak Ada", "Project1", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
     else
     {
         Adodc1.Recordset.Delete();
         Adodc1.Recordset.Update();
         Adodc1.Refresh();
         TDBGrid1.Refresh();
         Text1.Focus();
     }
 }
示例#24
0
        private void Add_Click(object sender, EventArgs e)
        {
            if (_num < 64)
            {
                _data[_num, 0] = Text1.Text;
                _data[_num, 1] = Text2.Text;
                _num++;
            }
            else
            {
                MessageForm errorForm = new MessageForm("You can have a maximum of 64 cards");
            }

            Text1.Clear();
            Text2.Clear();
        }
        public void Execute(IBaseDelegateExecution execution)
        {
            string value1 = (string)Text1.GetValue(execution);

            execution.SetVariable("var1", string.Join("", value1.Reverse()));

            string value2 = (string)Text2.GetValue(execution);

            execution.SetVariable("var2", string.Join("", value2.Reverse()));

            if (Text3 != null)
            {
                string value3 = (string)Text3.GetValue(execution);
                execution.SetVariable("var3", value3);
            }
        }
示例#26
0
        public bool Check()
        {
            var text1 = String.Concat(Text1.Where(c => !Char.IsWhiteSpace(c)));
            var text2 = String.Concat(Text2.Where(c => !Char.IsWhiteSpace(c)));

            if (text1.Length != text2.Length)
            {
                return(false);
            }
            //c => c .... identicka anonymni funkce, ktera nic nedela, jen to OrderBy potrebuje funkci
            //LINQ
            text1 = String.Concat(text1.ToLower().OrderBy(c => c));
            text2 = String.Concat(text2.ToLower().OrderBy(c => c));

            return(text1 == text2);
        }
示例#27
0
 public override void Show(ZuHeTool tool, string searchInput)
 {
     if (string.IsNullOrEmpty(searchInput))
     {
         TextShow(tool);
     }
     else
     {
         if (Text1.ToLower().Contains(searchInput.ToLower()))
         {
             MyCreate.Box_Hei(() =>
             {
                 TextShow(tool);
             });
         }
     }
 }
示例#28
0
 public override void Show(ZuHeTool tool, string searchInput)
 {
     if (!string.IsNullOrEmpty(searchInput))
     {
         string input = searchInput.ToLower();
         if (Text1.ToLower().Contains(input) || Text2.Contains(input))
         {
             MyCreate.Box(() =>
             {
                 tool.TextText_OY(Text1, Text2);
             });
         }
     }
     else
     {
         tool.TextText_BL(Text1, Text2);
     }
 }
示例#29
0
        void initBindings()
        {
            //解体氚测量仪
            Binding nowding1 = new Binding();

            nowding1.Source = cabInArtwork.Devices[0];
            nowding1.Path   = new PropertyPath("NowValue");
            Text1.SetBinding(TextBlock.TextProperty, nowding1);

            //1 3 号设备是pump

            ////房间氚测量仪
            Binding nowding2 = new Binding();

            nowding2.Source = cabInArtwork.Devices[2];
            nowding2.Path   = new PropertyPath("NowValue");
            Text2.SetBinding(TextBlock.TextProperty, nowding2);
        }
示例#30
0
 void OnCollisionStay(Collision col)
 {
     if (col.gameObject.tag == "hinanIn")
     {
         Text1.SetActive(true);
         if (Input.GetKey(KeyCode.U))
         {
             this.transform.position = Out.transform.position;
         }
     }
     else
     {
         Text1.SetActive(false);
     }
     if (col.gameObject.tag == "yama")
     {
         Text2.SetActive(true);
         if (Input.GetKey(KeyCode.D))
         {
             this.transform.position = In.transform.position;
         }
     }
     else
     {
         Text2.SetActive(false);
     }
     if (col.gameObject.tag == "Finish")
     {
         Text3.SetActive(true);
         if (Input.GetKey(KeyCode.Q))
         {
             //Quit();
             //OtherCamera.SetActive(false);
             //ResultCamera.SetActive(true);
             //Trajectory.SetActive(true);
             Gamemanager.SinarioFlag = 5;
             Debug.Log("避難が完了した。");
         }
     }
     else
     {
         Text3.SetActive(false);
     }
 }