public bool Init(Form form, GridFilter gridFilter, TextEdit txtSearchDelay, RadioGroup rgrSearAfter) { _rgrSearAfter = rgrSearAfter; _txtSearchDelay = txtSearchDelay; _GridFilter = gridFilter; // event form.KeyPress += frmSearch_Staff_KeyPress; txtSearchDelay.KeyPress += txtSearchDelay_KeyPress; txtSearchDelay.TextChanged += txtSearchDelay_TextChanged; rgrSearAfter.SelectedIndexChanged += rgrSearAfter_SelectedIndexChanged; // assign form.KeyPreview = true; rgrSearAfter.SelectedIndex = Properties.Settings.Default.rgrSearchAfter; txtSearchDelay.Text = Properties.Settings.Default.searchDelayTime.ToString(); return true; }
protected internal override void onCreate(Bundle savedInstanceState) { base.onCreate(savedInstanceState); ContentView = R.layout.activity_main; logicalNameEditText = (EditText) findViewById(R.id.editTextLogicalName); widthEditText = (EditText) findViewById(R.id.editTextWidth); pageEditText = (EditText) findViewById(R.id.editTextPage); brightnessEditText = (EditText) findViewById(R.id.editTextBrightness); alignmentRadioGroup = (RadioGroup) findViewById(R.id.radioGroupAlignment); findViewById(R.id.buttonOCE).OnClickListener = this; findViewById(R.id.buttonPrintPDF).OnClickListener = this; findViewById(R.id.buttonClose).OnClickListener = this; createConfigFile(); if (posPrinter == null) { posPrinter = new POSPrinter(this); } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.RideInformatioin); //pickup location m_txtPickupLocation = (TextView)FindViewById(Resource.Id.txtPickupLocation); m_txtPickupLocation.Touch += PopupPickupLocation; m_txtPickupLocation.SetBinding( () => Facade.Instance.CurrentRide.PickUpLocation, () => m_txtPickupLocation.Text, BindingMode.TwoWay) .UpdateSourceTrigger("DropOffLocationChanges"); //dropoff location m_txtDropoffLocation = (TextView)FindViewById(Resource.Id.txtDropoffLocation); m_txtDropoffLocation.Touch += PopupDropoffLocation; m_txtDropoffLocation.SetBinding( () => Facade.Instance.CurrentRide.DropOffLocation, () => m_txtDropoffLocation.Text, BindingMode.TwoWay) .UpdateSourceTrigger("DropOffLocationChanges"); //passengers or hours m_switchPH = (Switch)FindViewById(Resource.Id.switchPorH); m_switchPH.CheckedChange += delegate(object sender, CompoundButton.CheckedChangeEventArgs e) { Facade.Instance.CurrentRide.ReservationType = e.IsChecked; m_spinnerHours.Enabled = e.IsChecked; GetFares(); }; //number of passengers/hours m_spinnerPassengers = (Spinner)FindViewById(Resource.Id.spPassengers); m_spinnerHours = (Spinner)FindViewById(Resource.Id.spHours); var adapter = new ArrayAdapter(this, global::Android.Resource.Layout.SimpleSpinnerItem); m_spinnerPassengers.Adapter = adapter; m_spinnerHours.Adapter = adapter; for (var i = 1; i <= 100; i++) { adapter.Add(i); } m_spinnerPassengers.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(OnPassengerChanged); m_spinnerHours.ItemSelected += new EventHandler <AdapterView.ItemSelectedEventArgs>(OnHourChanged); //upto of vehicle m_rgUpto = (RadioGroup)FindViewById(Resource.Id.rgUpto); m_rgUpto.CheckedChange += (s, e) => { var indexView = m_rgUpto.FindViewById(e.CheckedId); var selectedIndex = m_rgUpto.IndexOfChild(indexView); m_selectedRideTypeValue = selectedIndex; SetFare(); }; //type of vehicle m_rgVehicle = (RadioGroup)FindViewById(Resource.Id.rgVehicle); m_rgVehicle.CheckedChange += (s, e) => { var indexView = m_rgVehicle.FindViewById(e.CheckedId); var selectedIndex = m_rgVehicle.IndexOfChild(indexView); SetRideType(selectedIndex); }; m_txtComment = (TextView)FindViewById(Resource.Id.txtComment); m_txtComment.Text = "Complete all fields above"; var btnGotoLocation = (Button)FindViewById(Resource.Id.btn_GoToLocation); btnGotoLocation.SetCommand("Click", Facade.Instance.CurrentRide.GoToTheFlightInformation); var btnBack = (ImageButton)FindViewById(Resource.Id.btn_back); btnBack.Click += delegate(object sender, EventArgs e) { OnBack(); }; if (IsFirstTime) { IsFirstTime = false; SetBindingsOnce(); } GetFares(); }
/// <summary> /// 根据选择的是税票还是收据隐藏和显示税率,税额,不含税金额等 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void repositoryItemRadioGroup1_SelectedIndexChanged(object sender, EventArgs e) { RadioGroup radioGroup = (RadioGroup)sender; inoutHelper.RadioGroupSelectIndexChange(radioGroup, gcTax, gcTaxFee, gcTotalMoney, gcFeeNotContainsTax, "销售金额"); }
public override void Setup() { var statusBar = new StatusBar(new StatusItem [] { new StatusItem(Key.ControlQ, "~^Q~ Quit", () => Quit()), new StatusItem(Key.F2, "~F2~ Toggle Frame Ruler", () => { ConsoleDriver.Diagnostics ^= ConsoleDriver.DiagnosticFlags.FrameRuler; Top.SetNeedsDisplay(); }), new StatusItem(Key.F3, "~F3~ Toggle Frame Padding", () => { ConsoleDriver.Diagnostics ^= ConsoleDriver.DiagnosticFlags.FramePadding; Top.SetNeedsDisplay(); }), }); Top.Add(statusBar); _viewClasses = GetAllViewClassesCollection() .OrderBy(t => t.Name) .Select(t => new KeyValuePair <string, Type> (t.Name, t)) .ToDictionary(t => t.Key, t => t.Value); _leftPane = new Window("Classes") { X = 0, Y = 0, Width = 15, Height = Dim.Fill(1), // for status bar CanFocus = false, ColorScheme = Colors.TopLevel, }; _classListView = new ListView(_viewClasses.Keys.ToList()) { X = 0, Y = 0, Width = Dim.Fill(0), Height = Dim.Fill(0), AllowsMarking = false, ColorScheme = Colors.TopLevel, }; _classListView.OpenSelectedItem += (a) => { _settingsPane.SetFocus(); }; _classListView.SelectedItemChanged += (args) => { ClearClass(_curView); _curView = CreateClass(_viewClasses.Values.ToArray() [_classListView.SelectedItem]); }; _leftPane.Add(_classListView); _settingsPane = new FrameView("Settings") { X = Pos.Right(_leftPane), Y = 0, // for menu Width = Dim.Fill(), Height = 10, CanFocus = false, ColorScheme = Colors.TopLevel, }; _computedCheckBox = new CheckBox("Computed Layout", true) { X = 0, Y = 0 }; _computedCheckBox.Toggled += (previousState) => { if (_curView != null) { _curView.LayoutStyle = previousState ? LayoutStyle.Absolute : LayoutStyle.Computed; _hostPane.LayoutSubviews(); } }; _settingsPane.Add(_computedCheckBox); var radioItems = new ustring [] { "Percent(x)", "AnchorEnd(x)", "Center", "At(x)" }; _locationFrame = new FrameView("Location (Pos)") { X = Pos.Left(_computedCheckBox), Y = Pos.Bottom(_computedCheckBox), Height = 3 + radioItems.Length, Width = 36, }; _settingsPane.Add(_locationFrame); var label = new Label("x:") { X = 0, Y = 0 }; _locationFrame.Add(label); _xRadioGroup = new RadioGroup(radioItems) { X = 0, Y = Pos.Bottom(label), SelectedItemChanged = (selected) => DimPosChanged(_curView), }; _xText = new TextField($"{_xVal}") { X = Pos.Right(label) + 1, Y = 0, Width = 4 }; _xText.TextChanged += (args) => { try { _xVal = int.Parse(_xText.Text.ToString()); DimPosChanged(_curView); } catch { } }; _locationFrame.Add(_xText); _locationFrame.Add(_xRadioGroup); radioItems = new ustring [] { "Percent(y)", "AnchorEnd(y)", "Center", "At(y)" }; label = new Label("y:") { X = Pos.Right(_xRadioGroup) + 1, Y = 0 }; _locationFrame.Add(label); _yText = new TextField($"{_yVal}") { X = Pos.Right(label) + 1, Y = 0, Width = 4 }; _yText.TextChanged += (args) => { try { _yVal = int.Parse(_yText.Text.ToString()); DimPosChanged(_curView); } catch { } }; _locationFrame.Add(_yText); _yRadioGroup = new RadioGroup(radioItems) { X = Pos.X(label), Y = Pos.Bottom(label), SelectedItemChanged = (selected) => DimPosChanged(_curView), }; _locationFrame.Add(_yRadioGroup); _sizeFrame = new FrameView("Size (Dim)") { X = Pos.Right(_locationFrame), Y = Pos.Y(_locationFrame), Height = 3 + radioItems.Length, Width = 40, }; radioItems = new ustring [] { "Percent(width)", "Fill(width)", "Sized(width)" }; label = new Label("width:") { X = 0, Y = 0 }; _sizeFrame.Add(label); _wRadioGroup = new RadioGroup(radioItems) { X = 0, Y = Pos.Bottom(label), SelectedItemChanged = (selected) => DimPosChanged(_curView) }; _wText = new TextField($"{_wVal}") { X = Pos.Right(label) + 1, Y = 0, Width = 4 }; _wText.TextChanged += (args) => { try { _wVal = int.Parse(_wText.Text.ToString()); DimPosChanged(_curView); } catch { } }; _sizeFrame.Add(_wText); _sizeFrame.Add(_wRadioGroup); radioItems = new ustring [] { "Percent(height)", "Fill(height)", "Sized(height)" }; label = new Label("height:") { X = Pos.Right(_wRadioGroup) + 1, Y = 0 }; _sizeFrame.Add(label); _hText = new TextField($"{_hVal}") { X = Pos.Right(label) + 1, Y = 0, Width = 4 }; _hText.TextChanged += (args) => { try { _hVal = int.Parse(_hText.Text.ToString()); DimPosChanged(_curView); } catch { } }; _sizeFrame.Add(_hText); _hRadioGroup = new RadioGroup(radioItems) { X = Pos.X(label), Y = Pos.Bottom(label), SelectedItemChanged = (selected) => DimPosChanged(_curView), }; _sizeFrame.Add(_hRadioGroup); _settingsPane.Add(_sizeFrame); _hostPane = new FrameView("") { X = Pos.Right(_leftPane), Y = Pos.Bottom(_settingsPane), Width = Dim.Fill(), Height = Dim.Fill(1), // + 1 for status bar ColorScheme = Colors.Dialog, }; Top.Add(_leftPane, _settingsPane, _hostPane); _curView = CreateClass(_viewClasses.First().Value); }
private void BtnTeach_Click(object sender, EventArgs e) { var language = Intent.GetStringExtra("Language"); RadioGroup rg = FindViewById <RadioGroup>(Resource.Id.radioGroup1); string radiovalue = (FindViewById <RadioButton>(rg.CheckedRadioButtonId)).Text; Intent intentIgbo = new Intent(this, typeof(TeachMeWords)); Intent intentLingala = new Intent(this, typeof(TeachMeWordsLingala)); Intent intentMashi = new Intent(this, typeof(TeachMeWordsMashi)); Intent intentIsiZulu = new Intent(this, typeof(TeachMeWordsIsiZulu)); Intent intentIsiXhosa = new Intent(this, typeof(TeachMeWordsIsiXhosa)); Intent intentSwati = new Intent(this, typeof(TeachMeWordsSwati)); Intent intentIton = new Intent(this, typeof(TeachMeWordsIton)); intentIgbo.PutExtra("Hear", radiovalue); intentIgbo.PutExtra("Language", language); intentLingala.PutExtra("Hear", radiovalue); intentLingala.PutExtra("Language", language); intentMashi.PutExtra("Hear", radiovalue); intentMashi.PutExtra("Language", language); intentIsiZulu.PutExtra("Hear", radiovalue); intentIsiZulu.PutExtra("Language", language); intentIsiXhosa.PutExtra("Hear", radiovalue); intentIsiXhosa.PutExtra("Language", language); intentSwati.PutExtra("Hear", radiovalue); intentSwati.PutExtra("Language", language); intentIton.PutExtra("Hear", radiovalue); intentIton.PutExtra("Language", language); if (language == "Igbo") { StartActivity(intentIgbo); } if (language == "Lingala") { StartActivity(intentLingala); } if (language == "Mashi") { StartActivity(intentMashi); } if (language == "IsiZulu") { StartActivity(intentIsiZulu); } if (language == "IsiXhosa") { StartActivity(intentIsiXhosa); } if (language == "Swati") { StartActivity(intentSwati); } if (language == "Iton") { StartActivity(intentIton); } }
/// <summary> /// radiogroup的选择切换事件 /// </summary> /// <param name="group">Group.</param> /// <param name="checkedId">Checked identifier.</param> public void OnCheckedChanged(RadioGroup group, int checkedId) { _adviceType = View.FindViewById <RadioButton> (checkedId).Tag.ToString(); //留言类型切换设置自动刷新view lv_recordAdviceRefreshListView.Refreshing = true; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.groupControl1 = new DevExpress.XtraEditors.GroupControl(); this.comboBoxEdit1 = new DevExpress.XtraEditors.ComboBoxEdit(); this.spinEdit1 = new DevExpress.XtraEditors.SpinEdit(); this.textbh = new DevExpress.XtraEditors.TextEdit(); this.textEdit1 = new DevExpress.XtraEditors.TextEdit(); this.radioGroup1 = new DevExpress.XtraEditors.RadioGroup(); this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton(); ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit(); this.groupControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.spinEdit1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.textbh.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).BeginInit(); this.SuspendLayout(); // // groupControl1 // this.groupControl1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupControl1.Controls.Add(this.comboBoxEdit1); this.groupControl1.Controls.Add(this.spinEdit1); this.groupControl1.Controls.Add(this.textbh); this.groupControl1.Controls.Add(this.textEdit1); this.groupControl1.Controls.Add(this.radioGroup1); this.groupControl1.Location = new System.Drawing.Point(13, 28); this.groupControl1.Name = "groupControl1"; this.groupControl1.Size = new System.Drawing.Size(267, 199); this.groupControl1.TabIndex = 0; this.groupControl1.Text = "��ѯ����"; // // comboBoxEdit1 // this.comboBoxEdit1.Enabled = false; this.comboBoxEdit1.Location = new System.Drawing.Point(113, 104); this.comboBoxEdit1.Name = "comboBoxEdit1"; this.comboBoxEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); this.comboBoxEdit1.Size = new System.Drawing.Size(136, 21); this.comboBoxEdit1.TabIndex = 7; this.comboBoxEdit1.SelectedIndexChanged += new System.EventHandler(this.comboBoxEdit1_SelectedIndexChanged); // // spinEdit1 // this.spinEdit1.EditValue = new decimal(new int[] { 0, 0, 0, 0}); this.spinEdit1.Enabled = false; this.spinEdit1.Location = new System.Drawing.Point(113, 68); this.spinEdit1.Name = "spinEdit1"; this.spinEdit1.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton()}); this.spinEdit1.Size = new System.Drawing.Size(136, 21); this.spinEdit1.TabIndex = 6; // // textbh // this.textbh.Location = new System.Drawing.Point(112, 137); this.textbh.Name = "textbh"; this.textbh.Size = new System.Drawing.Size(136, 21); this.textbh.TabIndex = 5; this.textbh.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textbh_KeyPress); // // textEdit1 // this.textEdit1.Location = new System.Drawing.Point(114, 32); this.textEdit1.Name = "textEdit1"; this.textEdit1.Size = new System.Drawing.Size(136, 21); this.textEdit1.TabIndex = 5; this.textEdit1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textEdit1_KeyPress); this.textEdit1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textEdit1_KeyDown); // // radioGroup1 // this.radioGroup1.EditValue = "0"; this.radioGroup1.Location = new System.Drawing.Point(6, 21); this.radioGroup1.Name = "radioGroup1"; this.radioGroup1.Properties.Appearance.BackColor = System.Drawing.Color.Transparent; this.radioGroup1.Properties.Appearance.Options.UseBackColor = true; this.radioGroup1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; this.radioGroup1.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] { new DevExpress.XtraEditors.Controls.RadioGroupItem("0", "�豸���Ƽ���"), new DevExpress.XtraEditors.Controls.RadioGroupItem("1", "��ѹ�ȼ�����"), new DevExpress.XtraEditors.Controls.RadioGroupItem("2", "���˹�ϵ����"), new DevExpress.XtraEditors.Controls.RadioGroupItem("3", "�豸��ż���")}); this.radioGroup1.Size = new System.Drawing.Size(101, 144); this.radioGroup1.TabIndex = 4; this.radioGroup1.SelectedIndexChanged += new System.EventHandler(this.radioGroup1_SelectedIndexChanged); // // simpleButton1 // this.simpleButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.simpleButton1.Location = new System.Drawing.Point(37, 246); this.simpleButton1.Name = "simpleButton1"; this.simpleButton1.Size = new System.Drawing.Size(75, 28); this.simpleButton1.TabIndex = 1; this.simpleButton1.Text = "ȷ��"; this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click); // // simpleButton2 // this.simpleButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.simpleButton2.Location = new System.Drawing.Point(200, 246); this.simpleButton2.Name = "simpleButton2"; this.simpleButton2.Size = new System.Drawing.Size(75, 28); this.simpleButton2.TabIndex = 2; this.simpleButton2.Text = "ȡ��"; this.simpleButton2.Click += new System.EventHandler(this.simpleButton2_Click); // // XtraSelectfrm // this.ClientSize = new System.Drawing.Size(292, 291); this.Controls.Add(this.simpleButton2); this.Controls.Add(this.simpleButton1); this.Controls.Add(this.groupControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "XtraSelectfrm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "�����豸"; ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit(); this.groupControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.spinEdit1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.textbh.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.textEdit1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).EndInit(); this.ResumeLayout(false); }
protected void Page_Load(object sender, EventArgs e) { EnvelopeDefinition envDef = new EnvelopeDefinition(); envDef.CompositeTemplates = new List <CompositeTemplate>(); CompositeTemplate ct = new CompositeTemplate(); ct.CompositeTemplateId = "1"; ct.ServerTemplates = new List <ServerTemplate>(); ServerTemplate st = new ServerTemplate(); st.Sequence = "1"; ct.InlineTemplates = new List <InlineTemplate>(); InlineTemplate it = new InlineTemplate(); it.Sequence = "1"; it.Recipients = new Recipients(); it.Recipients.Signers = new List <Signer>(); Signer Signer1 = new Signer(); Signer1.RecipientId = "1"; Signer1.Tabs = new Tabs(); Signer1.Tabs.TextTabs = new List <Text>(); Signer1.Tabs.CheckboxTabs = new List <Checkbox>(); Signer1.Tabs.ListTabs = new List <List>(); Signer1.Tabs.RadioGroupTabs = new List <RadioGroup>(); Signer Signer2 = new Signer(); Signer2.RecipientId = "2"; Signer2.Tabs = new Tabs(); Signer2.Tabs.TextTabs = new List <Text>(); Signer2.Tabs.CheckboxTabs = new List <Checkbox>(); Signer2.Tabs.ListTabs = new List <List>(); Signer2.Tabs.RadioGroupTabs = new List <RadioGroup>(); const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; foreach (string key in Request.Form) { if (key.Length > 9) { switch (key.Substring(0, 10)) { case "signer1_us": Signer1.Name = Request[key]; break; case "signer1_em": Signer1.Email = Request[key]; break; case "signer1_ro": Signer1.RoleName = Request[key]; envelope.dsSigner1Role = Request[key]; break; case "signer1_ty": if (Request[key] == "embedded") { Random random1 = new Random(); envelope.dsSigner1CID = new string(Enumerable.Repeat(chars, 10) .Select(s => s[random1.Next(s.Length)]).ToArray()); Signer1.ClientUserId = envelope.dsSigner1CID; } break; case "signer1_au": envelope.dsSigner1AuthMethod = Request[key]; break; case "signer1_nu": envelope.dsSigner1AuthNumber = Request[key]; break; case "signer1_si": envelope.dsSigner1SP = Request[key]; break; case "signer1_tx": Text tempText1 = new Text(); string tempTxtLabel = key; tempTxtLabel = tempTxtLabel.Substring(12); tempText1.TabLabel = tempTxtLabel; tempText1.Value = Request[key]; Signer1.Tabs.TextTabs.Add(tempText1); break; case "signer1_rb": RadioGroup tempRG1 = new RadioGroup(); string tempRBLabel = key; tempRBLabel = tempRBLabel.Substring(11); tempRG1.GroupName = tempRBLabel; tempRG1.Radios = new List <Radio>(); Radio tempRB1 = new Radio(); tempRB1.Selected = "true"; tempRB1.Value = Request[key]; tempRG1.Radios.Add(tempRB1); Signer1.Tabs.RadioGroupTabs.Add(tempRG1); break; case "signer1_li": List tempList1 = new List(); string tempListLabel = key; tempListLabel = tempListLabel.Substring(13); tempList1.TabLabel = tempListLabel; tempList1.Value = Request[key]; Signer1.Tabs.ListTabs.Add(tempList1); break; case "signer1_cb": Checkbox tempCB1 = new Checkbox(); string tempCBLabel = key; tempCBLabel = tempCBLabel.Substring(11); tempCB1.TabLabel = tempCBLabel; tempCB1.Selected = "true"; Signer1.Tabs.CheckboxTabs.Add(tempCB1); break; case "signer2_us": Signer2.Name = Request[key]; envelope.dsSigner2Name = Signer2.Name; break; case "signer2_em": Signer2.Email = Request[key]; envelope.dsSigner2Email = Request[key]; break; case "signer2_ro": Signer2.RoleName = Request[key]; envelope.dsSigner2Role = Request[key]; break; case "signer2_ty": if (Request[key] == "embedded") { Random random2 = new Random(); envelope.dsSigner2CID = new string(Enumerable.Repeat(chars, 10) .Select(s => s[random2.Next(s.Length)]).ToArray()); Signer2.ClientUserId = envelope.dsSigner2CID; } break; case "signer2_au": envelope.dsSigner2AuthMethod = Request[key]; break; case "signer2_nu": envelope.dsSigner2AuthNumber = Request[key]; break; case "signer2_si": envelope.dsSigner2SP = Request[key]; break; case "signer2_tx": Text tempText2 = new Text(); string tempTxtLabel2 = key; tempTxtLabel2 = tempTxtLabel2.Substring(12); tempText2.TabLabel = tempTxtLabel2; tempText2.Value = Request[key]; Signer2.Tabs.TextTabs.Add(tempText2); break; case "signer2_rb": RadioGroup tempRG2 = new RadioGroup(); string tempRBLabel2 = key; tempRBLabel2 = tempRBLabel2.Substring(11); tempRG2.GroupName = tempRBLabel2; tempRG2.Radios = new List <Radio>(); Radio tempRB2 = new Radio(); tempRB2.Selected = "true"; tempRB2.Value = Request[key]; tempRG2.Radios.Add(tempRB2); Signer2.Tabs.RadioGroupTabs.Add(tempRG2); break; case "signer2_li": List tempList2 = new List(); string tempListLabel2 = key; tempListLabel2 = tempListLabel2.Substring(13); tempList2.TabLabel = tempListLabel2; tempList2.Value = Request[key]; Signer2.Tabs.ListTabs.Add(tempList2); break; case "signer2_cb": Checkbox tempCB2 = new Checkbox(); string tempCBLabel2 = key; tempCBLabel2 = tempCBLabel2.Substring(13); tempCB2.TabLabel = tempCBLabel2; tempCB2.Selected = "true"; Signer2.Tabs.CheckboxTabs.Add(tempCB2); break; case "accountnum": envelope.dsAccountId = Request[key]; break; default: break; } } else { switch (key) { case "usr": envelope.dsUser = Request[key]; break; case "pd": envelope.dsPassword = Request[key]; break; case "dst": envelope.dsTemplateId = Request[key]; break; case "logo": envelope.dsLogo = Request[key]; break; default: break; } } } switch (envelope.dsSigner1AuthMethod.ToLower()) { case "access code": Signer1.AccessCode = envelope.dsSigner1AuthNumber; break; case "sms": Signer1.IdCheckConfigurationName = "SMS Auth $"; Signer1.RequireIdLookup = "true"; Signer1.SmsAuthentication = new RecipientSMSAuthentication(); Signer1.SmsAuthentication.SenderProvidedNumbers = new List <string>(); Signer1.SmsAuthentication.SenderProvidedNumbers.Add("+" + envelope.dsSigner1AuthNumber); break; case "phone": Signer1.IdCheckConfigurationName = "Phone Auth $"; Signer1.RequireIdLookup = "true"; Signer1.PhoneAuthentication = new RecipientPhoneAuthentication(); Signer1.PhoneAuthentication.SenderProvidedNumbers = new List <string>(); Signer1.PhoneAuthentication.SenderProvidedNumbers.Add("+" + envelope.dsSigner1AuthNumber); Signer1.PhoneAuthentication.RecipMayProvideNumber = "false"; break; case "idcheck": Signer1.IdCheckConfigurationName = "ID Check $"; Signer1.RequireIdLookup = "true"; break; default: break; } switch (envelope.dsSigner1SP.ToLower()) { case "ds electronic": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspE = new RecipientSignatureProvider(); rspE.SignatureProviderName = "UniversalSignaturePen_ImageOnly"; Signer1.RecipientSignatureProviders.Add(rspE); break; case "ds express": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspD = new RecipientSignatureProvider(); rspD.SignatureProviderName = "UniversalSignaturePen_Default"; Signer1.RecipientSignatureProviders.Add(rspD); break; case "ds aes ac": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspAESAC = new RecipientSignatureProvider(); rspAESAC.SignatureProviderName = "UniversalSignaturePen_OpenTrust_Hash_TSP"; rspAESAC.SignatureProviderOptions = new RecipientSignatureProviderOptions(); rspAESAC.SignatureProviderOptions.OneTimePassword = envelope.dsSigner1AuthNumber; Signer1.RecipientSignatureProviders.Add(rspAESAC); break; case "ds aes sms": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspAESSMS = new RecipientSignatureProvider(); rspAESSMS.SignatureProviderName = "UniversalSignaturePen_OpenTrust_Hash_TSP"; rspAESSMS.SignatureProviderOptions = new RecipientSignatureProviderOptions(); rspAESSMS.SignatureProviderOptions.Sms = "+" + envelope.dsSigner1AuthNumber; Signer1.RecipientSignatureProviders.Add(rspAESSMS); break; case "dsa": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspDSA = new RecipientSignatureProvider(); rspDSA.SignatureProviderName = "universalsignaturepen_docusignsigningappliance_tsp"; Signer1.RecipientSignatureProviders.Add(rspDSA); break; case "id now": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspIDNOW = new RecipientSignatureProvider(); rspIDNOW.SignatureProviderName = "UniversalSignaturePen_IDNow_TSP"; Signer1.RecipientSignatureProviders.Add(rspIDNOW); break; case "us piv": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspUSPIV = new RecipientSignatureProvider(); rspUSPIV.SignatureProviderName = "UniversalSignaturePen_PIV_Test_TSP"; Signer1.RecipientSignatureProviders.Add(rspUSPIV); break; case "it agile": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspAgile = new RecipientSignatureProvider(); rspAgile.SignatureProviderName = "UniversalSignaturePen_ItAgile_TSP"; Signer1.RecipientSignatureProviders.Add(rspAgile); break; case "icp": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspICP = new RecipientSignatureProvider(); rspICP.SignatureProviderName = "UniversalSignaturePen_ICP_SmartCard_TSP"; Signer1.RecipientSignatureProviders.Add(rspICP); break; case "ds smart card": Signer1.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspSMART = new RecipientSignatureProvider(); rspSMART.SignatureProviderName = "universalsignaturepen_ds_smartcard_tsp"; Signer1.RecipientSignatureProviders.Add(rspSMART); break; default: break; } switch (envelope.dsSigner2AuthMethod.ToLower()) { case "access code": Signer2.AccessCode = envelope.dsSigner2AuthNumber; break; case "sms": Signer2.IdCheckConfigurationName = "SMS Auth $"; Signer2.RequireIdLookup = "true"; Signer2.SmsAuthentication = new RecipientSMSAuthentication(); Signer2.SmsAuthentication.SenderProvidedNumbers = new List <string>(); Signer2.SmsAuthentication.SenderProvidedNumbers.Add("+" + envelope.dsSigner2AuthNumber); break; case "phone": Signer2.IdCheckConfigurationName = "Phone Auth $"; Signer2.RequireIdLookup = "true"; Signer2.PhoneAuthentication = new RecipientPhoneAuthentication(); Signer2.PhoneAuthentication.SenderProvidedNumbers = new List <string>(); Signer2.PhoneAuthentication.SenderProvidedNumbers.Add("+" + envelope.dsSigner2AuthNumber); Signer2.PhoneAuthentication.RecipMayProvideNumber = "false"; break; case "idcheck": Signer2.IdCheckConfigurationName = "ID Check $"; Signer2.RequireIdLookup = "true"; break; default: break; } switch (envelope.dsSigner2SP.ToLower()) { case "ds electronic": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspE = new RecipientSignatureProvider(); rspE.SignatureProviderName = "UniversalSignaturePen_ImageOnly"; Signer2.RecipientSignatureProviders.Add(rspE); break; case "ds express": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspD = new RecipientSignatureProvider(); rspD.SignatureProviderName = "UniversalSignaturePen_Default"; Signer2.RecipientSignatureProviders.Add(rspD); break; case "ds aes ac": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspAESAC = new RecipientSignatureProvider(); rspAESAC.SignatureProviderName = "UniversalSignaturePen_OpenTrust_Hash_TSP"; rspAESAC.SignatureProviderOptions = new RecipientSignatureProviderOptions(); rspAESAC.SignatureProviderOptions.OneTimePassword = envelope.dsSigner1AuthNumber; Signer2.RecipientSignatureProviders.Add(rspAESAC); break; case "ds aes sms": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspAESSMS = new RecipientSignatureProvider(); rspAESSMS.SignatureProviderName = "UniversalSignaturePen_OpenTrust_Hash_TSP"; rspAESSMS.SignatureProviderOptions = new RecipientSignatureProviderOptions(); rspAESSMS.SignatureProviderOptions.Sms = "+" + envelope.dsSigner1AuthNumber; Signer2.RecipientSignatureProviders.Add(rspAESSMS); break; case "dsa": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspDSA = new RecipientSignatureProvider(); rspDSA.SignatureProviderName = "universalsignaturepen_docusignsigningappliance_tsp"; Signer2.RecipientSignatureProviders.Add(rspDSA); break; case "id now": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspIDNOW = new RecipientSignatureProvider(); rspIDNOW.SignatureProviderName = "UniversalSignaturePen_IDNow_TSP"; Signer2.RecipientSignatureProviders.Add(rspIDNOW); break; case "us piv": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspUSPIV = new RecipientSignatureProvider(); rspUSPIV.SignatureProviderName = "UniversalSignaturePen_PIV_Test_TSP"; Signer2.RecipientSignatureProviders.Add(rspUSPIV); break; case "it agile": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspAgile = new RecipientSignatureProvider(); rspAgile.SignatureProviderName = "UniversalSignaturePen_ItAgile_TSP"; Signer2.RecipientSignatureProviders.Add(rspAgile); break; case "icp": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspICP = new RecipientSignatureProvider(); rspICP.SignatureProviderName = "UniversalSignaturePen_ICP_SmartCard_TSP"; Signer2.RecipientSignatureProviders.Add(rspICP); break; case "ds smart card": Signer2.RecipientSignatureProviders = new List <RecipientSignatureProvider>(); RecipientSignatureProvider rspSMART = new RecipientSignatureProvider(); rspSMART.SignatureProviderName = "universalsignaturepen_ds_smartcard_tsp"; Signer2.RecipientSignatureProviders.Add(rspSMART); break; default: break; } it.Recipients.Signers.Add(Signer1); if (Signer2.Email != "") { it.Recipients.Signers.Add(Signer2); } st.TemplateId = envelope.dsTemplateId; ct.ServerTemplates.Add(st); ct.InlineTemplates.Add(it); envDef.CompositeTemplates.Add(ct); envDef.Status = "sent"; string json = JsonConvert.SerializeObject(envDef, Formatting.Indented); System.Diagnostics.Debug.Write(json); ApiClient apiClient = new ApiClient("https://demo.docusign.net/restapi"); Configuration.Default.ApiClient = apiClient; envelope.dsAuthHeader = "{\"Username\":\"" + envelope.dsUser + "\", \"Password\":\"" + envelope.dsPassword + "\", \"IntegratorKey\":\"49cfeb67-7406-4cef-bac9-7594a8802986\"}"; Configuration.Default.DefaultHeader.Remove("X-DocuSign-Authentication"); Configuration.Default.AddDefaultHeader("X-DocuSign-Authentication", envelope.dsAuthHeader); TemplatesApi tempApi = new TemplatesApi(); EnvelopeTemplate tempInfo = tempApi.Get(envelope.dsAccountId, envelope.dsTemplateId); string brandId = tempInfo.BrandId; AccountsApi acctApi = new AccountsApi(); Brand brandInfo = acctApi.GetBrand(envelope.dsAccountId, brandId); foreach (var key in brandInfo.Colors) { if (key.Name == "headerBackground") { envelope.dsHeaderColor = key.Value; } if (key.Name == "headerText") { envelope.dsFontColor = key.Value; } } if (envelope.dsHeaderColor == "") { envelope.dsHeaderColor = "#5376B7"; } if (envelope.dsFontColor == "") { envelope.dsFontColor = "#FFFFFF"; } EnvelopesApi envelopesApi = new EnvelopesApi(); EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(envelope.dsAccountId, envDef); envelope.dsEnvelopeId = envelopeSummary.EnvelopeId; using (StreamWriter file = File.CreateText(Server.MapPath("~/json/" + envelope.dsEnvelopeId + ".json"))) { JsonSerializer serializer = new JsonSerializer(); serializer.Serialize(file, envDef); } if (Signer1.ClientUserId != null && Signer2.ClientUserId != null) { RecipientViewRequest viewOptions = new RecipientViewRequest() { ReturnUrl = "https://innov8ive.app/hmd/signer2start.aspx", ClientUserId = envelope.dsSigner1CID, AuthenticationMethod = "email", UserName = Signer1.Name, Email = Signer1.Email }; ViewUrl recipientView = envelopesApi.CreateRecipientView(envelope.dsAccountId, envelope.dsEnvelopeId, viewOptions); Response.Redirect(recipientView.Url); } else if (Signer1.ClientUserId != null && Signer2.ClientUserId == null) { RecipientViewRequest viewOptions = new RecipientViewRequest() { ReturnUrl = "https://innov8ive.app/hmd/status.aspx", ClientUserId = envelope.dsSigner1CID, AuthenticationMethod = "email", UserName = Signer1.Name, Email = Signer1.Email }; ViewUrl recipientView = envelopesApi.CreateRecipientView(envelope.dsAccountId, envelope.dsEnvelopeId, viewOptions); Response.Redirect(recipientView.Url); } else { Response.Redirect("~/status.aspx"); } }
public override void Setup() { const float fractionStep = 0.01F; const int pbWidth = 20; var pbFormatEnum = Enum.GetValues(typeof(ProgressBarFormat)).Cast <ProgressBarFormat> ().ToList(); var rbPBFormat = new RadioGroup(pbFormatEnum.Select(e => NStack.ustring.Make(e.ToString())).ToArray()) { X = Pos.Center(), Y = 1 }; Win.Add(rbPBFormat); var ckbBidirectional = new CheckBox("BidirectionalMarquee", true) { X = Pos.Center(), Y = Pos.Bottom(rbPBFormat) + 1 }; Win.Add(ckbBidirectional); var label = new Label("Blocks") { X = Pos.Center(), Y = Pos.Bottom(ckbBidirectional) + 1 }; Win.Add(label); var blocksPB = new ProgressBar() { X = Pos.Center(), Y = Pos.Y(label) + 1, Width = pbWidth }; Win.Add(blocksPB); label = new Label("Continuous") { X = Pos.Center(), Y = Pos.Bottom(blocksPB) + 1 }; Win.Add(label); var continuousPB = new ProgressBar() { X = Pos.Center(), Y = Pos.Y(label) + 1, Width = pbWidth, ProgressBarStyle = ProgressBarStyle.Continuous }; Win.Add(continuousPB); var button = new Button("Start timer") { X = Pos.Center(), Y = Pos.Bottom(continuousPB) + 1 }; button.Clicked += () => { if (_fractionTimer == null) { button.Enabled = false; blocksPB.Fraction = 0; continuousPB.Fraction = 0; float fractionSum = 0; _fractionTimer = new Timer((_) => { fractionSum += fractionStep; blocksPB.Fraction = fractionSum; continuousPB.Fraction = fractionSum; if (fractionSum > 1) { _fractionTimer.Dispose(); _fractionTimer = null; button.Enabled = true; } Application.MainLoop.Driver.Wakeup(); }, null, 0, _timerTick); } }; Win.Add(button); label = new Label("Marquee Blocks") { X = Pos.Center(), Y = Pos.Y(button) + 3 }; Win.Add(label); var marqueesBlocksPB = new ProgressBar() { X = Pos.Center(), Y = Pos.Y(label) + 1, Width = pbWidth, ProgressBarStyle = ProgressBarStyle.MarqueeBlocks }; Win.Add(marqueesBlocksPB); label = new Label("Marquee Continuous") { X = Pos.Center(), Y = Pos.Bottom(marqueesBlocksPB) + 1 }; Win.Add(label); var marqueesContinuousPB = new ProgressBar() { X = Pos.Center(), Y = Pos.Y(label) + 1, Width = pbWidth, ProgressBarStyle = ProgressBarStyle.MarqueeContinuous }; Win.Add(marqueesContinuousPB); rbPBFormat.SelectedItemChanged += (e) => { blocksPB.ProgressBarFormat = (ProgressBarFormat)e.SelectedItem; continuousPB.ProgressBarFormat = (ProgressBarFormat)e.SelectedItem; marqueesBlocksPB.ProgressBarFormat = (ProgressBarFormat)e.SelectedItem; marqueesContinuousPB.ProgressBarFormat = (ProgressBarFormat)e.SelectedItem; }; ckbBidirectional.Toggled += (e) => { ckbBidirectional.Checked = marqueesBlocksPB.BidirectionalMarquee = marqueesContinuousPB.BidirectionalMarquee = !e; }; _pulseTimer = new Timer((_) => { marqueesBlocksPB.Text = marqueesContinuousPB.Text = DateTime.Now.TimeOfDay.ToString(); marqueesBlocksPB.Pulse(); marqueesContinuousPB.Pulse(); Application.MainLoop.Driver.Wakeup(); }, null, 0, 300); Top.Unloaded += Top_Unloaded; void Top_Unloaded() { if (_pulseTimer != null) { _pulseTimer.Dispose(); _pulseTimer = null; Top.Unloaded -= Top_Unloaded; } } }
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position) { TaskViewHolder vh; Type thisType = holder.GetType(); OnBind = true; if (Curator) { if (position == 0) { return; } } if (position == 0 || (Curator && position == 1)) { // Activity description + entered names (if required) vh = holder as TaskViewHolderName; if (vh == null) { return; } vh.Title.Text = description; vh.Description.Text = context.Resources.GetString(Resource.String.TasksTitle); ((TaskViewHolderName)vh).NameSection.Visibility = (reqName) ? ViewStates.Visible : ViewStates.Gone; ((TaskViewHolderName)vh).EnteredNames.Text = names; return; } if (position == Items.Count - 1) { // Finish button if (holder is ButtonViewHolder bvh) { bvh.Button.Enabled = true; } return; } string taskType = Items[position].TaskType.IdName; if (thisType == typeof(TaskViewHolderInfo)) { AdditionalInfoData taskInfo = JsonConvert.DeserializeObject <AdditionalInfoData>(Items[position].JsonData); vh = holder as TaskViewHolderInfo; Items[position].IsCompleted = true; if (!string.IsNullOrWhiteSpace(taskInfo.ImageUrl)) { Items[position].ImageUrl = taskInfo.ImageUrl; } TaskViewHolderInfo taskViewHolderInfo = (TaskViewHolderInfo)vh; if (taskViewHolderInfo != null) { taskViewHolderInfo.Button.Visibility = (string.IsNullOrWhiteSpace(taskInfo.ExternalUrl)) ? ViewStates.Gone : ViewStates.Visible; } } else if (thisType == typeof(TaskViewHolderRecordAudio)) { vh = holder as TaskViewHolderRecordAudio; if (vh != null) { ((TaskViewHolderRecordAudio)vh).StartTaskButton.Text = context.Resources.GetString(Resource.String.StartBtn); if (!string.IsNullOrWhiteSpace(Items[position].CompletionData.JsonData)) { List <string> audioPaths = JsonConvert.DeserializeObject <List <string> >(Items[position].CompletionData.JsonData); ((TaskViewHolderRecordAudio)vh).ShowResults(audioPaths, context); Items[position].IsCompleted = true; } else { Items[position].IsCompleted = false; ((TaskViewHolderRecordAudio)vh).ClearResults(); } } } else if (thisType == typeof(TaskViewHolderRecordVideo)) { vh = holder as TaskViewHolderRecordVideo; if (vh != null) { ((TaskViewHolderRecordVideo)vh).StartTaskButton.Text = context.Resources.GetString(Resource.String.RecBtn); if (!string.IsNullOrWhiteSpace(Items[position].CompletionData.JsonData)) { List <string> videoPaths = JsonConvert.DeserializeObject <List <string> >(Items[position].CompletionData.JsonData); ((TaskViewHolderRecordVideo)vh).ShowResults(videoPaths, context); Items[position].IsCompleted = true; } else { Items[position].IsCompleted = false; ((TaskViewHolderRecordVideo)vh).ClearResults(); } } } else if (thisType == typeof(TaskViewHolderResultList)) { vh = holder as TaskViewHolderResultList; bool btnEnabled = true; string btnText; if (taskType == "DRAW" || taskType == "DRAW_PHOTO") { btnText = context.Resources.GetString(Resource.String.StartDrawBtn); if (taskType == "DRAW_PHOTO") { btnEnabled = !int.TryParse(Items[position].JsonData, out var idResult) || GetTaskWithId(idResult).IsCompleted; if (!btnEnabled) { btnText = context.Resources.GetString(Resource.String.TaskBtnNotReady); } } } else { btnText = context.Resources.GetString(Resource.String.TakePhotoBtn); } if (vh != null) { ((TaskViewHolderResultList)vh).StartTaskButton.Text = btnText; ((TaskViewHolderResultList)vh).StartTaskButton.Enabled = btnEnabled; if (!string.IsNullOrWhiteSpace(Items[position].CompletionData.JsonData)) { List <string> photoPaths = JsonConvert.DeserializeObject <List <string> >(Items[position].CompletionData.JsonData); ((TaskViewHolderResultList)vh).ShowResults(photoPaths, context); Items[position].IsCompleted = true; } else { Items[position].IsCompleted = false; ((TaskViewHolderResultList)vh).ClearResults(); } } } else if (thisType == typeof(TaskViewHolderBtn)) { vh = holder as TaskViewHolderBtn; string btnText = context.Resources.GetString(Resource.String.TaskBtn); if (taskType == "LISTEN_AUDIO") { btnText = context.Resources.GetString(Resource.String.ListenBtn); } TaskViewHolderBtn viewHolderBtn = (TaskViewHolderBtn)vh; if (viewHolderBtn != null) { viewHolderBtn.Button.Text = btnText; } } else if (thisType == typeof(TaskViewHolderTextEntry)) { vh = holder as TaskViewHolderTextEntry; if (vh != null) { ((TaskViewHolderTextEntry)vh).TextField.Text = Items[position].CompletionData.JsonData; Items[position].IsCompleted = !string.IsNullOrWhiteSpace(((TaskViewHolderTextEntry)vh).TextField.Text); } } else { if (thisType == typeof(TaskViewHolderMultipleChoice)) { vh = holder as TaskViewHolderMultipleChoice; RadioGroup radios = ((TaskViewHolderMultipleChoice)vh)?.RadioGroup; string[] choices = JsonConvert.DeserializeObject <string[]>(Items[position].JsonData); int.TryParse(Items[position].CompletionData.JsonData, out var answeredInd); if (radios != null && radios.ChildCount == 0) { int index = 0; foreach (string option in choices) { RadioButton rad = new RadioButton(context) { Text = option }; rad.SetPadding(0, 0, 0, 5); rad.TextSize = 16; radios.AddView(rad); if (Items[position].IsCompleted && answeredInd == index) { ((RadioButton)radios.GetChildAt(answeredInd)).Checked = true; } index++; } } if (answeredInd == -1) { Items[position].IsCompleted = false; } if (radios != null) { radios.CheckedChange += (sender, e) => { Items[position].IsCompleted = true; int radioButtonId = radios.CheckedRadioButtonId; View radioButton = radios.FindViewById(radioButtonId); int idx = radios.IndexOfChild(radioButton); Items[position].CompletionData.JsonData = idx.ToString(); NotifyItemChanged(Items.Count - 1); }; } } else if (thisType == typeof(TaskViewHolderMap)) { vh = holder as TaskViewHolderMap; TaskViewHolderMap mapHolder = ((TaskViewHolderMap)vh); if (taskType == "MAP_MARK") { List <Map_Location> points = JsonConvert.DeserializeObject <List <Map_Location> >(Items[position].CompletionData.JsonData); if (points != null && points.Count > 0) { if (mapHolder != null) { mapHolder.EnteredLocationsView.Visibility = ViewStates.Visible; mapHolder.EnteredLocationsView.Text = string.Format( context.Resources.GetString(Resource.String.ChosenLocations), points.Count, (points.Count > 1) ? "s" : ""); } Items[position].IsCompleted = true; } else { if (mapHolder != null) { mapHolder.EnteredLocationsView.Visibility = ViewStates.Gone; } Items[position].IsCompleted = false; } } } else { vh = holder as TaskViewHolder; } } // These apply to all task types: AndroidUtils.LoadTaskTypeIcon(Items[position].TaskType, ((TaskViewHolder)holder).TaskTypeIcon); if (!string.IsNullOrWhiteSpace(Items[position].ImageUrl)) { AndroidUtils.LoadActivityImageIntoView(vh.TaskImage, Items[position].ImageUrl, activityId, 350); } else { if (vh != null) { vh.TaskImage.Visibility = ViewStates.Gone; } } vh.Description.Text = Items[position].Description; vh.Title.Text = Items[position].TaskType.DisplayName; bool hasChildren = Items[position].ChildTasks != null && Items[position].ChildTasks.Any(); if (Items[position].TaskType.IdName == "ENTER_TEXT") { vh.LockedChildrenTease.Visibility = ViewStates.Gone; } else if (hasChildren && !Items[position].IsCompleted) { vh.LockedChildrenTease.Visibility = ViewStates.Visible; int childCount = Items[position].ChildTasks.Count(); vh.LockedChildrenTease.Text = string.Format( context.GetString(Resource.String.taskLockedParent), childCount, (childCount > 1) ? "s" : ""); } else if (hasChildren && Items[position].IsCompleted) { vh.LockedChildrenTease.Visibility = ViewStates.Visible; vh.LockedChildrenTease.Text = context.GetString(Resource.String.taskUnlockedParent); } else { vh.LockedChildrenTease.Visibility = ViewStates.Gone; } OnBind = false; }
/// <summary> /// This method is called when the activity is starting. /// The list of followers/following is displayed here. /// </summary> /// <param name="savedInstanceState"> a Bundle that contains the data the activity most recently /// supplied if the activity is being re-initialized after previously being shut down. </param> protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.CreateRecipe); _loggedId = Intent.GetStringExtra("LoggedId"); recipeNameEditText = FindViewById <EditText>(Resource.Id.editText); recipePortionsEditText = FindViewById <EditText>(Resource.Id.editText2); recipeDurationEditText = FindViewById <EditText>(Resource.Id.editText3); recipeIngredientEditText = FindViewById <EditText>(Resource.Id.editText4); recipeQuantityEditText = FindViewById <EditText>(Resource.Id.editText5); recipeUnitEditText = FindViewById <EditText>(Resource.Id.editText6); recipeInstructionEditText = FindViewById <EditText>(Resource.Id.editText7); radioGroupDiff = FindViewById <RadioGroup>(Resource.Id.radioGroupDiff); radioGroupTime = FindViewById <RadioGroup>(Resource.Id.radioGroupTime); radioGroupType = FindViewById <RadioGroup>(Resource.Id.radioGroupType); checkBox = FindViewById <CheckBox>(Resource.Id.checkBox); checkBox2 = FindViewById <CheckBox>(Resource.Id.checkBox2); checkBox3 = FindViewById <CheckBox>(Resource.Id.checkBox3); checkBox4 = FindViewById <CheckBox>(Resource.Id.checkBox4); checkBox5 = FindViewById <CheckBox>(Resource.Id.checkBox5); checkBox6 = FindViewById <CheckBox>(Resource.Id.checkBox6); btnIngredient = FindViewById <Button>(Resource.Id.btnIngredient); btnInstruction = FindViewById <Button>(Resource.Id.btnInstruction); btnImage = FindViewById <Button>(Resource.Id.btnImage); btnPost = FindViewById <Button>(Resource.Id.btnPost); btnIngredient.Click += (sender, args) => { if (recipeIngredientEditText.Text.Equals("") || recipeQuantityEditText.Text.Equals("") || recipeUnitEditText.Text.Equals("")) { toastText = "Please fill in all of the ingredient information"; } else { toastText = "Ingredient added!"; ingredients.Add(recipeIngredientEditText.Text + ";" + recipeQuantityEditText.Text + ";" + recipeUnitEditText.Text); recipeIngredientEditText.Text = ""; recipeQuantityEditText.Text = ""; recipeUnitEditText.Text = ""; } _toast = Toast.MakeText(this, toastText, ToastLength.Short); _toast.Show(); }; btnInstruction.Click += (sender, args) => { if (recipeInstructionEditText.Text.Equals("")) { toastText = "Please fill in the instruction"; } else { toastText = "Instruction added!"; instructions.Add(recipeInstructionEditText.Text); recipeInstructionEditText.Text = ""; } _toast = Toast.MakeText(this, toastText, ToastLength.Short); _toast.Show(); }; btnImage.Click += (sender, args) => { Intent gallery = new Intent(); gallery.SetType("image/*"); gallery.SetAction(Intent.ActionGetContent); this.StartActivityForResult(Intent.CreateChooser(gallery, "select a photo"), 0); }; btnPost.Click += (sender, args) => { if (checkBox.Checked || checkBox2.Checked || checkBox3.Checked || checkBox4.Checked || checkBox5.Checked || checkBox6.Checked) { tagsChecked = true; } else { tagsChecked = false; } if (recipeNameEditText.Text.Equals("") || recipePortionsEditText.Text.Equals("") || recipeDurationEditText.Text.Equals("") || instructions.Count == 0 || ingredients.Count == 0 || radioGroupDiff.CheckedRadioButtonId == -1 || radioGroupTime.CheckedRadioButtonId == -1 || radioGroupType.CheckedRadioButtonId == -1 || !tagsChecked || !imageSelected) { toastText = "Please fill in all of the required information"; if (!imageSelected) { toastText = "You must select an image to continue"; } } else { toastText = "Recipe posted!"; var name = recipeNameEditText.Text; var portions = int.Parse(recipePortionsEditText.Text); var duration = int.Parse(recipeDurationEditText.Text); var checkedDiff = radioGroupDiff.CheckedRadioButtonId; var checkedTime = radioGroupTime.CheckedRadioButtonId; var checkedType = radioGroupType.CheckedRadioButtonId; var diff = int.Parse(FindViewById <RadioButton>(checkedDiff).Text); var time = FindViewById <RadioButton>(checkedTime).Text; var type = FindViewById <RadioButton>(checkedType).Text; if (checkBox.Checked) { tags.Add(checkBox.Text); } if (checkBox2.Checked) { tags.Add(checkBox2.Text); } if (checkBox3.Checked) { tags.Add(checkBox3.Text); } if (checkBox4.Checked) { tags.Add(checkBox4.Text); } if (checkBox5.Checked) { tags.Add(checkBox5.Text); } if (checkBox6.Checked) { tags.Add(checkBox6.Text); } var recipe = new Recipe(_loggedId, name, _picture64, diff, tags, time, type, duration, ingredients, instructions, portions, 0, 0); var recipeJson = JsonConvert.SerializeObject(recipe); using var webClient = new WebClient { BaseAddress = "http://" + MainActivity.Ipv4 + ":8080/CookTime_war/cookAPI/" }; var url = "resources/createRecipe"; webClient.Headers[HttpRequestHeader.ContentType] = "application/json"; webClient.UploadString(url, recipeJson); url = "resources/getUser?id=" + _loggedId; webClient.Headers[HttpRequestHeader.ContentType] = "application/json"; var userJson = webClient.DownloadString(url); var intent = new Intent(this, typeof(MyProfileActivity)); intent.PutExtra("User", userJson); intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTask); StartActivity(intent); OverridePendingTransition(Android.Resource.Animation.SlideInLeft, Android.Resource.Animation.SlideOutRight); } _toast = Toast.MakeText(this, toastText, ToastLength.Short); _toast.Show(); }; }
protected override void OnCreate(Bundle savedInstanceState) { examen = 2; base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Quiz); //if (!GetString(Resource.String.google_app_id).Equals("1:593192999279:android:7fd609f7126dc407")) // throw new System.Exception("Invalid Json file"); //Task.Run(() => //{ // var instanceId = FirebaseInstanceId.Instance; // instanceId.DeleteInstanceId(); // Android.Util.Log.Debug("TAG", "{0} {1}", instanceId.Token, instanceId.GetToken(GetString(Resource.String.gcm_defaultSenderId), Firebase.Messaging.FirebaseMessaging.InstanceIdScope)); //}); //spinner1 = FindViewById<Spinner>(Resource.Id.spinner1); //spinner1.ItemSelected += new EventHandler<AdapterView.ItemSelectedEventArgs>(spinner_ItemSelected); //var adapter = ArrayAdapter.CreateFromResource( // this, Resource.Array.listaTiempo, Android.Resource.Layout.SimpleSpinnerItem); //adapter.SetDropDownViewResource(Android.Resource.Layout.SimpleSpinnerDropDownItem); //spinner1.Adapter = adapter; bEnviar = FindViewById <Button>(Resource.Id.bEnviar); bEnviar.Click += Aceptar_Click; //bEmpezar = FindViewById<Button>(Resource.Id.bEmpezar); //bEmpezar.Click += Empezar_Click; pregunta = FindViewById <TextView>(Resource.Id.pregunta); Opciones = FindViewById <RadioGroup>(Resource.Id.Opciones); //textSegundos = FindViewById<TextView>(Resource.Id.textSegundos); //txtTiempo = FindViewById<TextView>(Resource.Id.txtTiempo); //txtSelecciona = FindViewById<TextView>(Resource.Id.txtSelecciona); Validar = FindViewById <TextView>(Resource.Id.txtValidar); Respuesta = FindViewById <EditText>(Resource.Id.TextboxQuiz); imagen = FindViewById <ImageView>(Resource.Id.ImagenQuiz); ContadorPreg = FindViewById <TextView>(Resource.Id.ContPreguntas); pre = Pregunta.obtenerAleatoria(examen); r = new RadioButton[] { FindViewById <RadioButton>(Resource.Id.opcion1), FindViewById <RadioButton>(Resource.Id.Opcion2), FindViewById <RadioButton>(Resource.Id.Opcion3), FindViewById <RadioButton>(Resource.Id.Opcion4), FindViewById <RadioButton>(Resource.Id.Opcion5), FindViewById <RadioButton>(Resource.Id.Opcion6), FindViewById <RadioButton>(Resource.Id.Opcion7), FindViewById <RadioButton>(Resource.Id.Opcion8), FindViewById <RadioButton>(Resource.Id.Opcion9), FindViewById <RadioButton>(Resource.Id.Opcion10), FindViewById <RadioButton>(Resource.Id.Opcion11) }; mostrarPregunta(pre); contPregunta = 0; calificacion = 0; ContadorPreg.Text = (contPregunta + 1) + " de 10"; }
public override View GetSampleContent(Context con) { LinearLayout linear = new LinearLayout(con); linear.SetBackgroundColor(Android.Graphics.Color.White); linear.Orientation = Orientation.Vertical; linear.SetPadding(10, 10, 10, 10); TextView text2 = new TextView(con); text2.TextSize = 17; text2.TextAlignment = TextAlignment.Center; text2.Text = "This sample demonstrates how to insert and update the Table of Contents (TOC) in a Word document using Essential DocIO."; text2.SetTextColor(Android.Graphics.Color.ParseColor("#262626")); text2.SetPadding(5, 5, 5, 5); linear.AddView(text2); TextView space1 = new TextView(con); space1.TextSize = 10; linear.AddView(space1); m_context = con; LinearLayout radioLinearLayout = new LinearLayout(con); radioLinearLayout.Orientation = Orientation.Horizontal; TextView imageType = new TextView(con); imageType.Text = "Save As : "; imageType.TextSize = 19; radioLinearLayout.AddView(imageType); radioGroup = new RadioGroup(con); radioGroup.TextAlignment = TextAlignment.Center; radioGroup.Orientation = Orientation.Horizontal; docxButton = new RadioButton(con); docxButton.Text = "DOCX"; radioGroup.AddView(docxButton); pdfButton = new RadioButton(con); pdfButton.Text = "PDF"; radioGroup.AddView(pdfButton); radioGroup.Check(1); radioLinearLayout.AddView(radioGroup); linear.AddView(radioLinearLayout); docxButton.Checked = true; TextView space2 = new TextView(con); space2.TextSize = 10; linear.AddView(space2); Button generateButton = new Button(con); generateButton.Text = "Generate"; generateButton.Click += OnButtonClicked; linear.AddView(generateButton); return(linear); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var v = inflater.Inflate(Resource.Layout.MemberRegisterLayout, container, false); txtName = v.FindViewById <EditText>(Resource.Id.txtMemberName); datePickerBirthDay = v.FindViewById <DatePicker>(Resource.Id.datePickerBirthday); radioGroupGend = v.FindViewById <RadioGroup>(Resource.Id.radioGroupGender); radioGendReset = v.FindViewById <RadioButton>(Resource.Id.radioButtonMale); radioGroupPreg = v.FindViewById <RadioGroup>(Resource.Id.radioGroupPregnancy); radioPregReset = v.FindViewById <RadioButton>(Resource.Id.radioButtonYes); txtDiseases = v.FindViewById <EditText>(Resource.Id.txtDiseases); Button button = v.FindViewById <Button>(Resource.Id.btnMemberReg); button.Click += delegate { try { string dpPath = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal), "appdb.db3"); var db = new SQLiteConnection(dpPath); // db.CreateTable<MembersTable>(); MembersTable tbl = new MembersTable(); tbl.name = txtName.Text; tbl.birthday = datePickerBirthDay.DateTime.ToString(); //RadioGroup use check Gender. RadioButton checkedGender = v.FindViewById <RadioButton>(radioGroupGend.CheckedRadioButtonId); if (checkedGender.Text == "Female") { tbl.gender = checkedGender.Text; } else { tbl.gender = checkedGender.Text; } //RadioGroup use Check Pregnat or not. RadioButton checkedPreg = v.FindViewById <RadioButton>(radioGroupPreg.CheckedRadioButtonId); if (checkedPreg.Text == "Yes") { tbl.pregnancy = checkedPreg.Text; } else { tbl.pregnancy = checkedPreg.Text; } tbl.diseases = txtDiseases.Text; //SET MALE CHECKED THEN PREGNANCY RADIO GROUP ENABLE FALSE CODE SECTION //if (radioGendReset.Checked == true) // radioGroupPreg.Enabled = false; //else // radioGroupPreg.Enabled = true; db.Insert(tbl); Toast.MakeText(this.Activity, "Record Added Successfully...,", ToastLength.Short).Show(); //Reset all inputs for defalt value txtName.Text = ""; radioGendReset.Checked = true; radioPregReset.Checked = true; txtDiseases.Text = ""; radioGroupPreg.Enabled = true; } catch (Exception ex) { Toast.MakeText(this.Activity, ex.ToString(), ToastLength.Short); } }; return(v); }
public override void onCheckedChanged(RadioGroup group, int checkedId) { if (checkedId == R.id.udp_reliable_btn) { outerInstance.send_mode = outerInstance.MODE_RELIABLE; } else if (checkedId == R.id.udp_semi_reliable_btn) { outerInstance.send_mode = outerInstance.MODE_SEMIRELIABLE; } else if (checkedId == R.id.udp_unreliable_btn) { outerInstance.send_mode = outerInstance.MODE_UNRELIABLE; } }
/// <summary> /// radiogroup的选择切换事件 /// </summary> /// <param name="group">Group.</param> /// <param name="checkedId">Checked identifier.</param> public void OnCheckedChanged(RadioGroup group, int checkedId) { _adviceType = View.FindViewById <RadioButton> (checkedId).Tag.ToString(); }
/// <summary> /// Get the index of the selected RadioButton in a RadioGroup /// </summary> /// <param name="group"></param> /// <returns></returns> private int GetIndexOfSelectedChild(RadioGroup group) => group.IndexOfChild(group.FindViewById <RadioButton>(group.CheckedRadioButtonId));
public OnClickListenerAnonymousInnerClassHelper12(AlertDialog dialog, EditText editText, RadioGroup radioGroup) { this.dialog = dialog; this.editText = editText; this.radioGroup = radioGroup; }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.ShoppingCartLayout); dbConfig.ServiceURL = "https://026821060357.signin.aws.amazon.com/console/dynamobdb/"; dbConfig.AuthenticationRegion = "dynamodb.us-east-1.amazonaws.com"; dbConfig.RegionEndpoint = RegionEndpoint.USEast1; AmazonDynamoDBClient dynDBClient = new AmazonDynamoDBClient("AKIAIMDIMZSEHYRAI6CQ", "6B2FRtd4JZiwq2iqiQJOmJPytboQ7EDOb08xovN3", dbConfig.RegionEndpoint); //dynDBClient.Config.ServiceURL= "https://console.aws.amazon.com/dynamodb/"; dynDBClient.Config.ServiceURL = "https://026821060357.signin.aws.amazon.com/console/dynamodb/"; dynDBClient.Config.RegionEndpoint = RegionEndpoint.USEast1; DynamoDBContext dynContext = new DynamoDBContext(dynDBClient); AsyncSearch <ShoppingCart> listDataCartItems = dynContext.FromScanAsync <ShoppingCart>(new ScanOperationConfig() { ConsistentRead = true }); List <ShoppingCart> dataCartItems = await listDataCartItems.GetRemainingAsync(); Button btnCheckout = FindViewById <Button>(Resource.Id.btnCheckout); Button btnBack = FindViewById <Button>(Resource.Id.btnBack); Button btnEnterOrder = FindViewById <Button>(Resource.Id.btnEnterOrder); GridLayout grdOrderEntry = FindViewById <GridLayout>(Resource.Id.grdOrderEntry); TextView tvCustName = FindViewById <TextView>(Resource.Id.tvCustName); EditText edtItemDescription = FindViewById <EditText>(Resource.Id.edtItemDescription); EditText edtPrice = FindViewById <EditText>(Resource.Id.edtPrice); EditText edtQuant = FindViewById <EditText>(Resource.Id.edtQuant); DateTime dtOrderDate = DateTime.Today; strOrderDate = dtOrderDate.ToString("MM/dd/yyyy"); strCustFName = this.Intent.GetStringExtra("CustomerFName"); strCustLName = this.Intent.GetStringExtra("CustomerLName"); strStoreName = this.Intent.GetStringExtra("SelectedStore"); strZipCode = this.Intent.GetStringExtra("UserZipCode"); strSelectItem = this.Intent.GetStringExtra("ProductType"); var dlgCustomerName = new AlertDialog.Builder(this); GridLayout grdShoppingCart = FindViewById <GridLayout>(Resource.Id.grdShoppingCart); GridLayout grdCustName = new GridLayout(this); grdCustName.RowCount = 2; grdCustName.ColumnCount = 2; TextView tvFName = new TextView(this); tvFName.Text = "First Name:"; grdCustName.AddView(tvFName); EditText edtFName = new EditText(this); grdCustName.AddView(edtFName); TextView tvLName = new TextView(this); tvLName.Text = "Last Name"; grdCustName.AddView(tvLName); EditText edtLName = new EditText(this); grdCustName.AddView(edtLName); dlgCustomerName.SetTitle("PLEASE ENTER YOUR NAME"); dlgCustomerName.SetView(grdCustName); dlgCustomerName.SetPositiveButton("OK", delegate { strCustFName = edtFName.Text; strCustLName = edtLName.Text; tvCustName.Text = string.Concat(strCustFName, " ", strCustLName); listCartItems(dataCartItems, grdShoppingCart); }); dlgCustomerName.SetNegativeButton("CANCEL", delegate { }); dlgCustomerName.Show(); var theCart = from aCartItem in dataCartItems where aCartItem.CustomerFname == strCustFName && aCartItem.CustomerLname == strCustLName && aCartItem.CheckedOut == false select aCartItem; TextView tvCustStore = FindViewById <TextView>(Resource.Id.tvCustStore); tvCustStore.Text = strStoreName; listCartItems(dataCartItems, grdShoppingCart); btnCheckout.Click += (sender, e) => { var dlgCheckout = new AlertDialog.Builder(this); dlgCheckout.SetMessage("Are you sure you want to check out your order?"); GridLayout grdPurchase = new GridLayout(this); grdPurchase.ColumnCount = 1; grdPurchase.RowCount = 10; RadioGroup rgCreditCards = new RadioGroup(this); RadioButton rbVisa = new RadioButton(this); rbVisa.Text = "VISA"; rgCreditCards.AddView(rbVisa); RadioButton rbMasterCard = new RadioButton(this); rbMasterCard.Text = "MASTER CARD"; rgCreditCards.AddView(rbMasterCard); RadioButton rbDiscover = new RadioButton(this); rbDiscover.Text = "DISCOVER"; rgCreditCards.AddView(rbDiscover); RadioButton rbAmEx = new RadioButton(this); rbAmEx.Text = "AMERICAN EXPRESS"; rgCreditCards.AddView(rbAmEx); grdPurchase.AddView(rgCreditCards); TextView tvCCPrompt = new TextView(this); tvCCPrompt.Text = "YOUR CREDIT CARD NUMBER:"; grdPurchase.AddView(tvCCPrompt); EditText edtCCNum = new EditText(this); grdPurchase.AddView(edtCCNum); TextView tvExpDate = new TextView(this); tvExpDate.Text = "EXPIRATION DATE (mmyy):"; EditText edtExpDate = new EditText(this); grdPurchase.AddView(tvExpDate); grdPurchase.AddView(edtExpDate); TextView tvVerifyCode = new TextView(this); tvVerifyCode.Text = "YOUR THREE-DIGIT VERIFICATION CODE:"; EditText edtVerifyCode = new EditText(this); grdPurchase.AddView(tvVerifyCode); grdPurchase.AddView(edtVerifyCode); dlgCheckout.SetView(grdPurchase); string strCCName = ""; bool boolCCSelected = false; //Toast.MakeText(this, grdPurchase.ChildCount.ToString(), ToastLength.Long).Show(); dlgCheckout.SetPositiveButton("OK", async delegate { // EditText edtTheNumber = (EditText)grdPurchase.GetChildAt(2); string strCCNum = edtCCNum.Text; string strExpDate = edtExpDate.Text; string strVerifyCode = edtVerifyCode.Text; string strExpDatePattern = @"^(0[1-9]|1[012])\d{2}$"; for (int iCCN = 0; iCCN < rgCreditCards.ChildCount; iCCN++) { RadioButton rbCC = (RadioButton)rgCreditCards.GetChildAt(iCCN); if (rbCC.Checked) { boolCCSelected = true; strCCName = rbCC.Text; break; } } if (!boolCCSelected) { Toast.MakeText(this, "PLEASE SELECT A CREDIT CARD", ToastLength.Long).Show(); } else if (strCCNum.Trim() == "") { Toast.MakeText(this, "PLEASE ENTER YOUR CREDIT INFORMATION", ToastLength.Long).Show(); } else if (Regex.IsMatch(strExpDate, strExpDatePattern) == false) { Toast.MakeText(this, "PLEASE ENTER YOUR EXPIRATION DATE IN FORM mmyy", ToastLength.Long).Show(); } else { AsyncSearch <CreditCard> listPurchases = dynContext.FromScanAsync <CreditCard>(new ScanOperationConfig() { ConsistentRead = true }); List <CreditCard> listDataPurchases = await listPurchases.GetRemainingAsync(); int iCountAllPurchases = listDataPurchases.Count; listDataCartItems = dynContext.FromScanAsync <ShoppingCart>(new ScanOperationConfig() { ConsistentRead = true }); dataCartItems = await listDataCartItems.GetRemainingAsync(); theCart = from aCartItem in dataCartItems where aCartItem.CustomerFname == strCustFName && aCartItem.CustomerLname == strCustLName && aCartItem.CheckedOut == false && aCartItem.OrderID != "0" select aCartItem; Table tblShoppingCart = Table.LoadTable(dynDBClient, "ShoppingCart"); Table tblCreditCard = Table.LoadTable(dynDBClient, "CreditCard"); foreach (ShoppingCart aCartItem in theCart) { Document docCartItem = new Document(); Document docPurchase = new Document(); docCartItem["OrderID"] = aCartItem.OrderID; docCartItem["CheckedOut"] = 1; docPurchase["ChargeID"] = (iCountAllPurchases++).ToString(); docPurchase["CardNumber"] = strCCNum; docPurchase["Amount"] = aCartItem.TotalCost; docPurchase["CardName"] = strCCName; docPurchase["CustomerName"] = string.Concat(strCustFName, " ", strCustLName); docPurchase["Expiration"] = strExpDate; docPurchase["ItemDescription"] = aCartItem.ProductDescription; docPurchase["Verification"] = strVerifyCode; docPurchase["Merchant"] = aCartItem.StoreName; docPurchase["PurchaseDate"] = strOrderDate; docPurchase["NewCharge"] = 1; await tblCreditCard.PutItemAsync(docPurchase); // await tblShoppingCart.UpdateItemAsync(docCartItem); await tblShoppingCart.DeleteItemAsync(docCartItem); } Intent intentDeliveryPickup = new Intent(this, typeof(DeliveryPickupActivity)); StartActivity(intentDeliveryPickup); } }); dlgCheckout.SetNegativeButton("NO", delegate { }); dlgCheckout.Show(); }; btnEnterOrder.Click += async(sender, e) => { AsyncSearch <ShoppingCart> listUpdateDataCartItems = dynContext.FromScanAsync <ShoppingCart>(new ScanOperationConfig() { ConsistentRead = true }); List <ShoppingCart> dataUpdateCartItems = await listUpdateDataCartItems.GetRemainingAsync(); int iOrderCount = dataUpdateCartItems.Count; string strDescription = edtItemDescription.Text.Trim(); string strPrice = edtPrice.Text.Trim(); string strQuant = edtQuant.Text.Trim(); if (strDescription == "") { Toast.MakeText(this, "PLEASE ENTER A PRODUCT DESCRIPTION", ToastLength.Long).Show(); return; } Double dblNum = 0.00; if (Double.TryParse(strPrice, out dblNum) == false) { Toast.MakeText(this, "PLEASE ENTER PRICE AS A REAL NUMBER", ToastLength.Long).Show(); return; } int iNum = 0; if (int.TryParse(strQuant, out iNum) == false) { Toast.MakeText(this, "PLEASE ENTER QUANTITY AS AN INTEGER NUMBER", ToastLength.Long).Show(); return; } else if (Convert.ToInt32(strQuant) <= 0) { Toast.MakeText(this, "PLEASE ENTER A POSITIVE NUMBER (>=1)", ToastLength.Long).Show(); return; } Table tblCart = Table.LoadTable(dynDBClient, "ShoppingCart"); Document docMerchandise = new Document(); double dblUnitPrice = Convert.ToDouble(strPrice); int iQuant = Convert.ToInt32(strQuant); double dblTotalCost = Convert.ToDouble(iQuant) * dblUnitPrice; docMerchandise["OrderID"] = iOrderCount.ToString(); docMerchandise["ProductDescription"] = strDescription; docMerchandise["CustomerFname"] = strCustFName; docMerchandise["CustomerLname"] = strCustLName; docMerchandise["StoreName"] = strStoreName; docMerchandise["UnitPrice"] = dblUnitPrice; docMerchandise["Quantity"] = iQuant; docMerchandise["TotalCost"] = dblTotalCost; docMerchandise["OrderDate"] = strOrderDate; docMerchandise["CheckedOut"] = 0; await tblCart.PutItemAsync(docMerchandise); listCartItems(dataCartItems, grdShoppingCart); // double dblRunningTotal += dblTotalCost; edtItemDescription.Text = ""; edtPrice.Text = ""; edtQuant.Text = ""; // dblTotalPurchase = dblRunningTotal; }; btnBack.Click += (sender, e) => { Intent intentItems = new Intent(this, typeof(ItemsActivity)); intentItems.PutExtra("CustomerFname", strCustFName); intentItems.PutExtra("CustomerLname", strCustLName); intentItems.PutExtra("SelectedStore", strStoreName); intentItems.PutExtra("UserZipCode", strZipCode); intentItems.PutExtra("OrderDate", strOrderDate); intentItems.PutExtra("ProductType", strSelectItem); StartActivity(intentItems); }; }
/// <summary> /// 创建自定义控件 /// </summary> public void CreateDynamicControl() { if (DynamicMasterTableData.Select("bSystemColumn=0").Length > 0) { pnlDynamic.Visible = true; //每行控件数 int iControlColumn = Convert.ToInt32(DynamicMasterTableData.Rows[0]["iControlColumn"]); //控件间距 int iControlSpace = Convert.ToInt32(DynamicMasterTableData.Rows[0]["iControlSpace"]); //先计算需要生成控件的数据,去除如果在自定义字段权限设置中设置为不可见的数据 List<DataRow> drs = DynamicMasterTableData.Select("bSystemColumn=0 AND bShowInPanel=1").ToList(); if (!SecurityCenter.IsAdmin && FormFieldSetting.Rows.Count > 0) { for (int i = 0; i < drs.Count; i++) { //取只有是主表/单表的数据 foreach (DataRow drField in FormFieldSetting.Select("sTableName='" + MasterTableName + "'")) { if (drs[i]["sFieldName"].ToString() == drField["sFieldName"].ToString() && !Convert.ToBoolean(drField["bVisiable"])) { drs.Remove(drs[i]); } } } } //计算控件总共行数 int iRows = 0; if (drs.Count > 0) { if (drs.Count % iControlColumn != 0) { iRows = (int)Math.Floor(Convert.ToDecimal(drs.Count / iControlColumn)) + 1; } else { iRows = Convert.ToInt32(drs.Count / iControlColumn); } //设置控件数计数 int iControl = 0; for (int j = 0; j < iRows; j++) { for (int i = 0; i < iControlColumn; i++) { //控件类型 string sControlType = drs[iControl]["sControlType"].ToString(); //创建控件 //Lable大小控制为80X21,其他输入控件大小为120X21 Label lblControl = new Label(); lblControl.AutoSize = false; lblControl.Size = new Size(80, 21); lblControl.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i, ControlY + (21 + 10) * j); //控件命名规则:lbl+字段名 lblControl.Name = "lbl" + drs[iControl]["sFieldName"].ToString(); lblControl.TextAlign = ContentAlignment.BottomLeft; //当控件类型为复选框\单选\Label标签时不创建Lable控件 if (sControlType != "chk" && sControlType != "rad" && sControlType != "lbl") { lblControl.Text = LangCenter.Instance.IsDefaultLanguage ? drs[iControl]["sCaption"].ToString() : drs[iControl]["sCaption"].ToString(); } else lblControl.Visible = false; pnlDynamic.Controls.Add(lblControl); switch (sControlType) { case "txt": { TextEdit txt = new TextEdit(); txt.Size = new Size(120, 21); txt.Name = "txt" + drs[iControl]["sFieldName"].ToString(); txt.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); pnlDynamic.Controls.Add(txt); break; } case "mtxt": { MemoEdit mtxt = new MemoEdit(); mtxt.Size = new Size(120, 21); mtxt.Name = "mtxt" + drs[iControl]["sFieldName"].ToString(); mtxt.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); pnlDynamic.Controls.Add(mtxt); break; } case "btxt": { MemoExEdit btxt = new MemoExEdit(); btxt.Size = new Size(120, 21); btxt.Name = "btxt" + drs[iControl]["sFieldName"].ToString(); btxt.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); pnlDynamic.Controls.Add(btxt); break; } case "cbx": { ImageComboBoxEdit cbx = new ImageComboBoxEdit(); cbx.Size = new Size(120, 21); cbx.Name = "cbx" + drs[iControl]["sFieldName"].ToString(); cbx.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); pnlDynamic.Controls.Add(cbx); break; } case "chk": { CheckEdit chk = new CheckEdit(); chk.Size = new Size(120, 21); chk.Name = "chk" + drs[iControl]["sFieldName"].ToString(); chk.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); chk.CheckState = CheckState.Unchecked; chk.Text = LangCenter.Instance.IsDefaultLanguage ? drs[iControl]["sCaption"].ToString() : drs[iControl]["sEngCaption"].ToString(); pnlDynamic.Controls.Add(chk); break; } case "det": { DateEdit det = new DateEdit(); det.Size = new Size(120, 21); det.Name = "det" + drs[iControl]["sFieldName"].ToString(); det.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); det.EditValue = null; pnlDynamic.Controls.Add(det); break; } case "dett": { DateEdit dett = new DateEdit(); dett.Size = new Size(120, 21); dett.Name = "dett" + drs[iControl]["sFieldName"].ToString(); dett.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); dett.EditValue = null; dett.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.DateTime; dett.Properties.DisplayFormat.FormatString = "g"; dett.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.DateTime; dett.Properties.EditFormat.FormatString = "g"; dett.Properties.EditMask = "g"; pnlDynamic.Controls.Add(dett); break; } case "img": { ImageEdit img = new ImageEdit(); img.Size = new Size(120, 21); img.Name = "img" + drs[iControl]["sFieldName"].ToString(); img.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); pnlDynamic.Controls.Add(img); break; } case "lbl": { LabelControl lbl = new LabelControl(); lbl.Size = new Size(120, 21); lbl.Name = "lbl" + drs[iControl]["sFieldName"].ToString() + iControl.ToString(); lbl.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); lbl.Text = LangCenter.Instance.IsDefaultLanguage ? drs[iControl]["sCaption"].ToString() : drs[iControl]["sEngCaption"].ToString(); pnlDynamic.Controls.Add(lbl); break; } case "lkp": { SunriseLookUp lkp = new SunriseLookUp(); lkp.Size = new Size(120, 21); lkp.Name = "lkp" + drs[iControl]["sFieldName"].ToString(); lkp.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); pnlDynamic.Controls.Add(lkp); break; } case "mlkp": { SunriseMLookUp mlkp = new SunriseMLookUp(); mlkp.Size = new Size(120, 21); mlkp.Name = "mlkp" + drs[iControl]["sFieldName"].ToString(); mlkp.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); pnlDynamic.Controls.Add(mlkp); break; } case "rad": { RadioGroup rad = new RadioGroup(); rad.Size = new Size(120, 21); rad.Name = "rad" + drs[iControl]["sFieldName"].ToString(); rad.Location = new Point(ControlX + (80 + 120 + iControlSpace) * i + 80, ControlY + 4 + (21 + 10) * j); pnlDynamic.Controls.Add(rad); break; } } iControl++; //当计数大于等于要创建的控件数量时则退出循环 if (iControl >= drs.Count) break; } } } pnlDynamic.Height = ControlY + iRows * 31; } //初始化数据绑定 InitDataBindings(); }
protected override void OnCreate(Bundle savedInstanceState) { SetTheme(ActivityCommon.SelectedThemeId); base.OnCreate(savedInstanceState); SupportActionBar.SetHomeButtonEnabled(true); SupportActionBar.SetDisplayShowHomeEnabled(true); SupportActionBar.SetDisplayHomeAsUpEnabled(true); SetContentView(Resource.Layout.settings); SetResult(Android.App.Result.Canceled); _selection = Intent.GetStringExtra(ExtraSelection); _activityCommon = new ActivityCommon(this); _radioButtonLocaleDefault = FindViewById <RadioButton>(Resource.Id.radioButtonLocaleDefault); _radioButtonLocaleEn = FindViewById <RadioButton>(Resource.Id.radioButtonLocaleEn); _radioButtonLocaleDe = FindViewById <RadioButton>(Resource.Id.radioButtonLocaleDe); _radioButtonLocaleRu = FindViewById <RadioButton>(Resource.Id.radioButtonLocaleRu); _radioButtonThemeDark = FindViewById <RadioButton>(Resource.Id.radioButtonThemeDark); _radioButtonThemeLight = FindViewById <RadioButton>(Resource.Id.radioButtonThemeLight); _checkBoxAutoHideTitleBar = FindViewById <CheckBox>(Resource.Id.checkBoxAutoHideTitleBar); _checkBoxSuppressTitleBar = FindViewById <CheckBox>(Resource.Id.checkBoxSuppressTitleBar); _checkBoxFullScreenMode = FindViewById <CheckBox>(Resource.Id.checkBoxFullScreenMode); ViewStates viewStateMultiWindow = Build.VERSION.SdkInt >= BuildVersionCodes.N ? ViewStates.Visible : ViewStates.Gone; _textViewCaptionMultiWindow = FindViewById <TextView>(Resource.Id.textViewCaptionMultiWindow); _checkBoxSwapMultiWindowOrientation = FindViewById <CheckBox>(Resource.Id.checkBoxSwapMultiWindowOrientation); _textViewCaptionMultiWindow.Visibility = viewStateMultiWindow; _checkBoxSwapMultiWindowOrientation.Visibility = viewStateMultiWindow; ViewStates viewStateInternet = Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop ? ViewStates.Visible : ViewStates.Gone; _textViewCaptionInternet = FindViewById <TextView>(Resource.Id.textViewCaptionInternet); _radioGroupInternet = FindViewById <RadioGroup>(Resource.Id.radioGroupInternet); _textViewCaptionInternet.Visibility = viewStateInternet; _radioGroupInternet.Visibility = viewStateInternet; _radioButtonInternetCellular = FindViewById <RadioButton>(Resource.Id.radioButtonInternetCellular); _radioButtonInternetWifi = FindViewById <RadioButton>(Resource.Id.radioButtonInternetWifi); _radioButtonInternetEthernet = FindViewById <RadioButton>(Resource.Id.radioButtonInternetEthernet); _radioButtonAskForBtEnable = FindViewById <RadioButton>(Resource.Id.radioButtonAskForBtEnable); _radioButtonAlwaysEnableBt = FindViewById <RadioButton>(Resource.Id.radioButtonAlwaysEnableBt); _radioButtonNoBtHandling = FindViewById <RadioButton>(Resource.Id.radioButtonNoBtHandling); _checkBoxDisableBtAtExit = FindViewById <CheckBox>(Resource.Id.checkBoxDisableBtAtExit); _radioButtonCommLockNone = FindViewById <RadioButton>(Resource.Id.radioButtonCommLockNone); _radioButtonCommLockCpu = FindViewById <RadioButton>(Resource.Id.radioButtonCommLockCpu); _radioButtonCommLockDim = FindViewById <RadioButton>(Resource.Id.radioButtonCommLockDim); _radioButtonCommLockBright = FindViewById <RadioButton>(Resource.Id.radioButtonCommLockBright); _radioButtonLogLockNone = FindViewById <RadioButton>(Resource.Id.radioButtonLogLockNone); _radioButtonLogLockCpu = FindViewById <RadioButton>(Resource.Id.radioButtonLogLockCpu); _radioButtonLogLockDim = FindViewById <RadioButton>(Resource.Id.radioButtonLogLockDim); _radioButtonLogLockBright = FindViewById <RadioButton>(Resource.Id.radioButtonLogLockBright); _checkBoxStoreDataLogSettings = FindViewById <CheckBox>(Resource.Id.checkBoxStoreDataLogSettings); _radioButtonStartOffline = FindViewById <RadioButton>(Resource.Id.radioButtonStartOffline); _radioButtonStartConnect = FindViewById <RadioButton>(Resource.Id.radioButtonStartConnect); _radioButtonStartConnectClose = FindViewById <RadioButton>(Resource.Id.radioButtonStartConnectClose); _checkBoxDoubleClickForAppExit = FindViewById <CheckBox>(Resource.Id.checkBoxDoubleClickForAppExit); _checkBoxSendDataBroadcast = FindViewById <CheckBox>(Resource.Id.checkBoxSendDataBroadcast); _radioButtonUpdateOff = FindViewById <RadioButton>(Resource.Id.radioButtonUpdateOff); _radioButtonUpdate1Day = FindViewById <RadioButton>(Resource.Id.radioButtonUpdate1Day); _radioButtonUpdate1Week = FindViewById <RadioButton>(Resource.Id.radioButtonUpdate1Week); _textViewCaptionCpuUsage = FindViewById <TextView>(Resource.Id.textViewCaptionCpuUsage); _checkBoxCheckCpuUsage = FindViewById <CheckBox>(Resource.Id.checkBoxCheckCpuUsage); ViewStates viewStateCpuUsage = ActivityCommon.IsCpuStatisticsSupported() ? ViewStates.Visible : ViewStates.Gone; _textViewCaptionCpuUsage.Visibility = viewStateCpuUsage; _checkBoxCheckCpuUsage.Visibility = viewStateCpuUsage; _checkBoxCheckEcuFiles = FindViewById <CheckBox>(Resource.Id.checkBoxCheckEcuFiles); _checkBoxShowBatteryVoltageWarning = FindViewById <CheckBox>(Resource.Id.checkBoxShowBatteryVoltageWarning); _checkBoxOldVagMode = FindViewById <CheckBox>(Resource.Id.checkBoxOldVagMode); _checkBoxUseBmwDatabase = FindViewById <CheckBox>(Resource.Id.checkBoxUseBmwDatabase); _checkBoxScanAllEcus = FindViewById <CheckBox>(Resource.Id.checkBoxScanAllEcus); _buttonStorageLocation = FindViewById <Button>(Resource.Id.buttonStorageLocation); _buttonStorageLocation.Click += (sender, args) => { SelectMedia(); }; ViewStates viewStateNotifications = Build.VERSION.SdkInt >= BuildVersionCodes.O ? ViewStates.Visible : ViewStates.Gone; _textViewCaptionNotifications = FindViewById <TextView>(Resource.Id.textViewCaptionNotifications); _buttonManageNotifications = FindViewById <Button>(Resource.Id.buttonManageNotifications); _buttonManageNotifications.Click += (sender, args) => { ShowNotificationSettings(); }; _textViewCaptionNotifications.Visibility = viewStateNotifications; _buttonManageNotifications.Visibility = viewStateNotifications; _checkBoxCollectDebugInfo = FindViewById <CheckBox>(Resource.Id.checkBoxCollectDebugInfo); ViewStates viewStateSnoopLog = _activityCommon.GetConfigHciSnoopLog(out bool _) ? ViewStates.Visible : ViewStates.Gone; _checkBoxHciSnoopLog = FindViewById <CheckBox>(Resource.Id.checkBoxHciSnoopLog); _checkBoxHciSnoopLog.Visibility = viewStateSnoopLog; _checkBoxHciSnoopLog.Enabled = false; _buttonHciSnoopLog = FindViewById <Button>(Resource.Id.buttonHciSnoopLog); _buttonHciSnoopLog.Visibility = viewStateSnoopLog; _buttonHciSnoopLog.Click += (sender, args) => { ShowDevelopmentSettings(); }; _buttonDefaultSettings = FindViewById <Button>(Resource.Id.buttonDefaultSettings); _buttonDefaultSettings.Click += (sender, args) => { DefaultSettings(); }; ReadSettings(); CheckSelection(_selection); }
public override void Setup() { var frame = new FrameView("MessageBox Options") { X = Pos.Center(), Y = 1, Width = Dim.Percent(75), Height = 10 }; Win.Add(frame); var label = new Label("width:") { X = 0, Y = 0, Width = 15, Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right, }; frame.Add(label); var widthEdit = new TextField("0") { X = Pos.Right(label) + 1, Y = Pos.Top(label), Width = 5, Height = 1 }; frame.Add(widthEdit); label = new Label("height:") { X = 0, Y = Pos.Bottom(label), Width = Dim.Width(label), Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right, }; frame.Add(label); var heightEdit = new TextField("0") { X = Pos.Right(label) + 1, Y = Pos.Top(label), Width = 5, Height = 1 }; frame.Add(heightEdit); frame.Add(new Label("If height & width are both 0,") { X = Pos.Right(widthEdit) + 2, Y = Pos.Top(widthEdit), }); frame.Add(new Label("the MessageBox will be sized automatically.") { X = Pos.Right(heightEdit) + 2, Y = Pos.Top(heightEdit), }); label = new Label("Title:") { X = 0, Y = Pos.Bottom(label), Width = Dim.Width(label), Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right, }; frame.Add(label); var titleEdit = new TextField("Title") { X = Pos.Right(label) + 1, Y = Pos.Top(label), Width = Dim.Fill(), Height = 1 }; frame.Add(titleEdit); label = new Label("Message:") { X = 0, Y = Pos.Bottom(label), Width = Dim.Width(label), Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right, }; frame.Add(label); var messageEdit = new TextView() { Text = "Message", X = Pos.Right(label) + 1, Y = Pos.Top(label), Width = Dim.Fill(), Height = 5, ColorScheme = Colors.Dialog, }; frame.Add(messageEdit); label = new Label("Num Buttons:") { X = 0, Y = Pos.Bottom(messageEdit), Width = Dim.Width(label), Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right, }; frame.Add(label); var numButtonsEdit = new TextField("3") { X = Pos.Right(label) + 1, Y = Pos.Top(label), Width = 5, Height = 1 }; frame.Add(numButtonsEdit); label = new Label("Default Button:") { X = 0, Y = Pos.Bottom(label), Width = Dim.Width(label), Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right, }; frame.Add(label); var defaultButtonEdit = new TextField("0") { X = Pos.Right(label) + 1, Y = Pos.Top(label), Width = 5, Height = 1 }; frame.Add(defaultButtonEdit); label = new Label("Style:") { X = 0, Y = Pos.Bottom(label), Width = Dim.Width(label), Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right, }; frame.Add(label); var styleRadioGroup = new RadioGroup(new ustring [] { "_Query", "_Error" }) { X = Pos.Right(label) + 1, Y = Pos.Top(label), }; frame.Add(styleRadioGroup); void Top_Loaded() { frame.Height = Dim.Height(widthEdit) + Dim.Height(heightEdit) + Dim.Height(titleEdit) + Dim.Height(messageEdit) + Dim.Height(numButtonsEdit) + Dim.Height(defaultButtonEdit) + Dim.Height(styleRadioGroup) + 2; Top.Loaded -= Top_Loaded; } Top.Loaded += Top_Loaded; label = new Label("Button Pressed:") { X = Pos.Center(), Y = Pos.Bottom(frame) + 4, Height = 1, TextAlignment = Terminal.Gui.TextAlignment.Right, }; Win.Add(label); var buttonPressedLabel = new Label(" ") { X = Pos.Center(), Y = Pos.Bottom(frame) + 5, Width = 25, Height = 1, ColorScheme = Colors.Error, TextAlignment = Terminal.Gui.TextAlignment.Centered }; //var btnText = new [] { "_Zero", "_One", "T_wo", "_Three", "_Four", "Fi_ve", "Si_x", "_Seven", "_Eight", "_Nine" }; var showMessageBoxButton = new Button("Show MessageBox") { X = Pos.Center(), Y = Pos.Bottom(frame) + 2, IsDefault = true, }; showMessageBoxButton.Clicked += () => { try { int width = int.Parse(widthEdit.Text.ToString()); int height = int.Parse(heightEdit.Text.ToString()); int numButtons = int.Parse(numButtonsEdit.Text.ToString()); int defaultButton = int.Parse(defaultButtonEdit.Text.ToString()); var btns = new List <ustring> (); for (int i = 0; i < numButtons; i++) { //btns.Add(btnText[i % 10]); btns.Add(NumberToWords.Convert(i)); } if (styleRadioGroup.SelectedItem == 0) { buttonPressedLabel.Text = $"{MessageBox.Query (width, height, titleEdit.Text.ToString (), messageEdit.Text.ToString (), defaultButton, btns.ToArray ())}"; } else { buttonPressedLabel.Text = $"{MessageBox.ErrorQuery (width, height, titleEdit.Text.ToString (), messageEdit.Text.ToString (), defaultButton, btns.ToArray ())}"; } } catch (FormatException) { buttonPressedLabel.Text = "Invalid Options"; } }; Win.Add(showMessageBoxButton); Win.Add(buttonPressedLabel); }
private void InitializeComponent() { this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); this.spinEditWidth = new DevExpress.XtraEditors.SpinEdit(); this.radioGroup1 = new DevExpress.XtraEditors.RadioGroup(); this.txtFPS = new DevExpress.XtraEditors.SpinEdit(); this.btnBrowse = new DevExpress.XtraEditors.SimpleButton(); this.spinEditHeight = new DevExpress.XtraEditors.SpinEdit(); this.txtOpenFile = new DevExpress.XtraEditors.TextEdit(); this.btnOK = new DevExpress.XtraEditors.SimpleButton(); this.btnCancel = new DevExpress.XtraEditors.SimpleButton(); this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem(); this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem(); this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem(); this.emptySpaceItem3 = new DevExpress.XtraLayout.EmptySpaceItem(); this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem8 = new DevExpress.XtraLayout.LayoutControlItem(); this.dxErrorProvider1 = new DevExpress.XtraEditors.DXErrorProvider.DXErrorProvider(); ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); this.layoutControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.spinEditWidth.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.txtFPS.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.spinEditHeight.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.txtOpenFile.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider1)).BeginInit(); this.SuspendLayout(); // // layoutControl1 // this.layoutControl1.Controls.Add(this.spinEditWidth); this.layoutControl1.Controls.Add(this.radioGroup1); this.layoutControl1.Controls.Add(this.txtFPS); this.layoutControl1.Controls.Add(this.btnBrowse); this.layoutControl1.Controls.Add(this.spinEditHeight); this.layoutControl1.Controls.Add(this.txtOpenFile); this.layoutControl1.Controls.Add(this.btnOK); this.layoutControl1.Controls.Add(this.btnCancel); this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl1.Location = new System.Drawing.Point(0, 0); this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.Root = this.layoutControlGroup1; this.layoutControl1.Size = new System.Drawing.Size(434, 178); this.layoutControl1.TabIndex = 0; this.layoutControl1.Text = "layoutControl1"; // // spinEditWidth // this.spinEditWidth.EditValue = new decimal(new int[] { 1024, 0, 0, 0 }); this.spinEditWidth.Enabled = false; this.spinEditWidth.Location = new System.Drawing.Point(39, 118); this.spinEditWidth.Name = "spinEditWidth"; this.spinEditWidth.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); this.spinEditWidth.Properties.MaxValue = new decimal(new int[] { 10000000, 0, 0, 0 }); this.spinEditWidth.Properties.MinValue = new decimal(new int[] { 1, 0, 0, 0 }); this.spinEditWidth.Size = new System.Drawing.Size(176, 22); this.spinEditWidth.StyleController = this.layoutControl1; this.spinEditWidth.TabIndex = 4; // // radioGroup1 // this.radioGroup1.EditValue = 0; this.radioGroup1.Location = new System.Drawing.Point(39, 12); this.radioGroup1.Name = "radioGroup1"; this.radioGroup1.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] { new DevExpress.XtraEditors.Controls.RadioGroupItem(0, "视频"), new DevExpress.XtraEditors.Controls.RadioGroupItem(1, "序列帧") }); this.radioGroup1.Size = new System.Drawing.Size(383, 50); this.radioGroup1.StyleController = this.layoutControl1; this.radioGroup1.TabIndex = 0; this.radioGroup1.SelectedIndexChanged += new System.EventHandler(this.radioGroup1_SelectedIndexChanged); // // txtFPS // this.txtFPS.EditValue = new decimal(new int[] { 25, 0, 0, 0 }); this.txtFPS.Location = new System.Drawing.Point(39, 92); this.txtFPS.Name = "txtFPS"; this.txtFPS.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); this.txtFPS.Properties.MaxValue = new decimal(new int[] { 30, 0, 0, 0 }); this.txtFPS.Properties.MinValue = new decimal(new int[] { 20, 0, 0, 0 }); this.txtFPS.Size = new System.Drawing.Size(383, 22); this.txtFPS.StyleController = this.layoutControl1; this.txtFPS.TabIndex = 3; this.txtFPS.ToolTip = "请输入20~30之间的数"; this.txtFPS.Validating += new System.ComponentModel.CancelEventHandler(this.txtFPS_Validating); // // btnBrowse // this.btnBrowse.Location = new System.Drawing.Point(351, 66); this.btnBrowse.Name = "btnBrowse"; this.btnBrowse.Size = new System.Drawing.Size(71, 22); this.btnBrowse.StyleController = this.layoutControl1; this.btnBrowse.TabIndex = 2; this.btnBrowse.Text = "浏览"; this.btnBrowse.Click += new System.EventHandler(this.btnBrowse_Click); // // spinEditHeight // this.spinEditHeight.EditValue = new decimal(new int[] { 1024, 0, 0, 0 }); this.spinEditHeight.Enabled = false; this.spinEditHeight.Location = new System.Drawing.Point(246, 118); this.spinEditHeight.Name = "spinEditHeight"; this.spinEditHeight.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton() }); this.spinEditHeight.Properties.MaxValue = new decimal(new int[] { 10000000, 0, 0, 0 }); this.spinEditHeight.Properties.MinValue = new decimal(new int[] { 1, 0, 0, 0 }); this.spinEditHeight.Size = new System.Drawing.Size(176, 22); this.spinEditHeight.StyleController = this.layoutControl1; this.spinEditHeight.TabIndex = 5; // // txtOpenFile // this.txtOpenFile.Location = new System.Drawing.Point(39, 66); this.txtOpenFile.Name = "txtOpenFile"; this.txtOpenFile.Size = new System.Drawing.Size(308, 22); this.txtOpenFile.StyleController = this.layoutControl1; this.txtOpenFile.TabIndex = 1; // // btnOK // this.btnOK.Location = new System.Drawing.Point(206, 144); this.btnOK.Name = "btnOK"; this.btnOK.Size = new System.Drawing.Size(86, 22); this.btnOK.StyleController = this.layoutControl1; this.btnOK.TabIndex = 6; this.btnOK.Text = "确定"; this.btnOK.Click += new System.EventHandler(this.btnOK_Click); // // btnCancel // this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.btnCancel.Location = new System.Drawing.Point(306, 144); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new System.Drawing.Size(88, 22); this.btnCancel.StyleController = this.layoutControl1; this.btnCancel.TabIndex = 7; this.btnCancel.Text = "取消"; this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // // layoutControlGroup1 // this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1"; this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; this.layoutControlGroup1.GroupBordersVisible = false; this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { this.layoutControlItem1, this.layoutControlItem2, this.layoutControlItem3, this.layoutControlItem5, this.emptySpaceItem1, this.emptySpaceItem2, this.layoutControlItem6, this.emptySpaceItem3, this.layoutControlItem4, this.layoutControlItem7, this.layoutControlItem8 }); this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0); this.layoutControlGroup1.Name = "Root"; this.layoutControlGroup1.Size = new System.Drawing.Size(434, 178); this.layoutControlGroup1.Text = "Root"; this.layoutControlGroup1.TextVisible = false; // // layoutControlItem1 // this.layoutControlItem1.Control = this.txtOpenFile; this.layoutControlItem1.CustomizationFormText = "layoutControlItem1"; this.layoutControlItem1.Location = new System.Drawing.Point(0, 54); this.layoutControlItem1.Name = "layoutControlItem1"; this.layoutControlItem1.Size = new System.Drawing.Size(339, 26); this.layoutControlItem1.Text = "位置"; this.layoutControlItem1.TextSize = new System.Drawing.Size(24, 14); // // layoutControlItem2 // this.layoutControlItem2.Control = this.btnBrowse; this.layoutControlItem2.CustomizationFormText = "layoutControlItem2"; this.layoutControlItem2.Location = new System.Drawing.Point(339, 54); this.layoutControlItem2.Name = "layoutControlItem2"; this.layoutControlItem2.Size = new System.Drawing.Size(75, 26); this.layoutControlItem2.Text = "layoutControlItem2"; this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem2.TextToControlDistance = 0; this.layoutControlItem2.TextVisible = false; // // layoutControlItem3 // this.layoutControlItem3.Control = this.txtFPS; this.layoutControlItem3.CustomizationFormText = "帧数"; this.layoutControlItem3.Location = new System.Drawing.Point(0, 80); this.layoutControlItem3.Name = "layoutControlItem3"; this.layoutControlItem3.Size = new System.Drawing.Size(414, 26); this.layoutControlItem3.Text = "帧数"; this.layoutControlItem3.TextSize = new System.Drawing.Size(24, 14); // // layoutControlItem5 // this.layoutControlItem5.Control = this.btnOK; this.layoutControlItem5.CustomizationFormText = "layoutControlItem5"; this.layoutControlItem5.Location = new System.Drawing.Point(194, 132); this.layoutControlItem5.Name = "layoutControlItem5"; this.layoutControlItem5.Size = new System.Drawing.Size(90, 26); this.layoutControlItem5.Text = "layoutControlItem5"; this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem5.TextToControlDistance = 0; this.layoutControlItem5.TextVisible = false; // // emptySpaceItem1 // this.emptySpaceItem1.AllowHotTrack = false; this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1"; this.emptySpaceItem1.Location = new System.Drawing.Point(0, 132); this.emptySpaceItem1.Name = "emptySpaceItem1"; this.emptySpaceItem1.Size = new System.Drawing.Size(194, 26); this.emptySpaceItem1.Text = "emptySpaceItem1"; this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); // // emptySpaceItem2 // this.emptySpaceItem2.AllowHotTrack = false; this.emptySpaceItem2.CustomizationFormText = "emptySpaceItem2"; this.emptySpaceItem2.Location = new System.Drawing.Point(284, 132); this.emptySpaceItem2.Name = "emptySpaceItem2"; this.emptySpaceItem2.Size = new System.Drawing.Size(10, 26); this.emptySpaceItem2.Text = "emptySpaceItem2"; this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0); // // layoutControlItem6 // this.layoutControlItem6.Control = this.btnCancel; this.layoutControlItem6.CustomizationFormText = "layoutControlItem6"; this.layoutControlItem6.Location = new System.Drawing.Point(294, 132); this.layoutControlItem6.Name = "layoutControlItem6"; this.layoutControlItem6.Size = new System.Drawing.Size(92, 26); this.layoutControlItem6.Text = "layoutControlItem6"; this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem6.TextToControlDistance = 0; this.layoutControlItem6.TextVisible = false; // // emptySpaceItem3 // this.emptySpaceItem3.AllowHotTrack = false; this.emptySpaceItem3.CustomizationFormText = "emptySpaceItem3"; this.emptySpaceItem3.Location = new System.Drawing.Point(386, 132); this.emptySpaceItem3.Name = "emptySpaceItem3"; this.emptySpaceItem3.Size = new System.Drawing.Size(28, 26); this.emptySpaceItem3.Text = "emptySpaceItem3"; this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0); // // layoutControlItem4 // this.layoutControlItem4.Control = this.radioGroup1; this.layoutControlItem4.CustomizationFormText = "类型"; this.layoutControlItem4.Location = new System.Drawing.Point(0, 0); this.layoutControlItem4.Name = "layoutControlItem4"; this.layoutControlItem4.Size = new System.Drawing.Size(414, 54); this.layoutControlItem4.Text = "类型"; this.layoutControlItem4.TextSize = new System.Drawing.Size(24, 14); // // layoutControlItem7 // this.layoutControlItem7.Control = this.spinEditWidth; this.layoutControlItem7.CustomizationFormText = "宽度"; this.layoutControlItem7.Location = new System.Drawing.Point(0, 106); this.layoutControlItem7.Name = "layoutControlItem7"; this.layoutControlItem7.Size = new System.Drawing.Size(207, 26); this.layoutControlItem7.Text = "宽度"; this.layoutControlItem7.TextSize = new System.Drawing.Size(24, 14); // // layoutControlItem8 // this.layoutControlItem8.Control = this.spinEditHeight; this.layoutControlItem8.CustomizationFormText = "高度"; this.layoutControlItem8.Location = new System.Drawing.Point(207, 106); this.layoutControlItem8.Name = "layoutControlItem8"; this.layoutControlItem8.Size = new System.Drawing.Size(207, 26); this.layoutControlItem8.Text = "高度"; this.layoutControlItem8.TextSize = new System.Drawing.Size(24, 14); // // dxErrorProvider1 // this.dxErrorProvider1.ContainerControl = this; // // ExportVideoDlg // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(434, 178); this.Controls.Add(this.layoutControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ExportVideoDlg"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "导出视频(序列帧图)"; ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); this.layoutControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.spinEditWidth.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.txtFPS.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.spinEditHeight.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.txtOpenFile.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem8)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dxErrorProvider1)).EndInit(); this.ResumeLayout(false); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); Button button = FindViewById <Button>(Resource.Id.btn); button.Click += delegate { var cifra = FindViewById <TextView>(Resource.Id.cifraText); var chave = FindViewById <TextView>(Resource.Id.chaveText); var res = FindViewById <TextView>(Resource.Id.result); RadioGroup radioGroup = FindViewById <RadioGroup>(Resource.Id.cifrar_decifrar); RadioButton check = FindViewById <RadioButton>(radioGroup.CheckedRadioButtonId); if (check.Text.Equals("Cifrar")) { if (!(cifra.Text == "" || chave.Text == "")) { string cifrada = cifrar(Convert.ToString(cifra.Text).ToLower(), Convert.ToInt32(chave.Text)); //res.SetText(cifrada); AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Resultado"); alert.SetMessage("Resultado: " + cifrada); alert.Show(); } else { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Erro"); alert.SetMessage("Por favor digite todos os campos"); alert.Show(); } } if (check.Text.Equals("Decifrar")) { if (!(cifra.Text == "" || chave.Text == "")) { string decifrada = decifrar(Convert.ToString(cifra.Text), Convert.ToInt32(chave.Text)); AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Resultado"); alert.SetMessage("Resultado: " + decifrada); alert.Show(); } else { AlertDialog.Builder alert = new AlertDialog.Builder(this); alert.SetTitle("Erro"); alert.SetMessage("Por favor digite todos os campos"); alert.Show(); } } }; }
public override void Setup() { var menu = new MenuBar(new MenuBarItem [] { new MenuBarItem("_Файл", new MenuItem [] { new MenuItem("_Создать", "Creates new file", null), new MenuItem("_Открыть", "", null), new MenuItem("Со_хранить", "", null), new MenuItem("_Выход", "", () => Application.RequestStop()) }), new MenuBarItem("_Edit", new MenuItem [] { new MenuItem("_Copy", "", null), new MenuItem("C_ut", "", null), new MenuItem("_Paste", "", null) }) }); Top.Add(menu); var label = new Label("Button:") { X = 0, Y = 1 }; Win.Add(label); var button2 = new Button("Со_хранить") { X = 15, Y = Pos.Y(label), Width = Dim.Percent(50), }; Win.Add(button2); label = new Label("CheckBox:") { X = Pos.X(label), Y = Pos.Bottom(label) + 1 }; Win.Add(label); var checkBox = new CheckBox(" ~ s gui.cs master ↑10") { X = 15, Y = Pos.Y(label), Width = Dim.Percent(50) }; Win.Add(checkBox); label = new Label("ComboBox:") { X = Pos.X(label), Y = Pos.Bottom(label) + 1 }; Win.Add(label); var comboBox = new ComboBox(1, 1, 30, 5, new List <string> () { "item #1", " ~ s gui.cs master ↑10", "Со_хранить" }) { X = 15, Y = Pos.Y(label), Width = 30, ColorScheme = Colors.Error }; Win.Add(comboBox); comboBox.Text = " ~ s gui.cs master ↑10"; label = new Label("HexView:") { X = Pos.X(label), Y = Pos.Bottom(label) + 2 }; Win.Add(label); var hexView = new HexView(new System.IO.MemoryStream(Encoding.ASCII.GetBytes(" ~ s gui.cs master ↑10 Со_хранить"))) { X = 15, Y = Pos.Y(label), Width = Dim.Percent(60), Height = 5 }; Win.Add(hexView); label = new Label("ListView:") { X = Pos.X(label), Y = Pos.Bottom(hexView) + 1 }; Win.Add(label); var listView = new ListView(new List <string> () { "item #1", " ~ s gui.cs master ↑10", "Со_хранить" }) { X = 15, Y = Pos.Y(label), Width = Dim.Percent(60), Height = 3, ColorScheme = Colors.Menu }; Win.Add(listView); label = new Label("RadioGroup:") { X = Pos.X(label), Y = Pos.Bottom(listView) + 1 }; Win.Add(label); var radioGroup = new RadioGroup(new [] { "item #1", " ~ s gui.cs master ↑10", "Со_хранить" }, selected: 0) { X = 15, Y = Pos.Y(label), Width = Dim.Percent(60), ColorScheme = Colors.Menu }; Win.Add(radioGroup); label = new Label("TextField:") { X = Pos.X(label), Y = Pos.Bottom(radioGroup) + 1 }; Win.Add(label); var textField = new TextField(" ~ s gui.cs master ↑10 = Со_хранить") { X = 15, Y = Pos.Y(label), Width = Dim.Percent(60) }; Win.Add(textField); label = new Label("TextView:") { X = Pos.X(label), Y = Pos.Bottom(textField) + 1 }; Win.Add(label); var textView = new TextView() { X = 15, Y = Pos.Y(label), Width = Dim.Percent(60), Height = 3, ColorScheme = Colors.Menu, Text = " ~ s gui.cs master ↑10\nСо_хранить", }; Win.Add(textView); //label = new Label ("Charset:") { // X = Pos.Percent(75) + 1, // Y = 0, //}; //Win.Add (label); //var charset = new Label ("") { // X = Pos.Percent(75) + 1, // Y = Pos.Y (label) + 1, // Width = Dim.Fill (1), // Height = Dim.Fill (), // ColorScheme = Colors.Dialog //}; //Win.Add (charset); // Move Win down to row 1, below menu Win.Y = 1; Top.LayoutSubviews(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Disable auto rotation of the app. RequestedOrientation = Android.Content.PM.ScreenOrientation.Nosensor; // Get current rotation angle of the screen from its default/natural orientation. var windowManager = (IWindowManager)ApplicationContext.GetSystemService(Context.WindowService).JavaCast <IWindowManager>(); var rotation = windowManager.DefaultDisplay.Rotation; // Determine width/height in pixels based on the rotation angle. DisplayMetrics dm = new DisplayMetrics(); WindowManager.DefaultDisplay.GetMetrics(dm); int width = 0; int height = 0; switch (rotation) { case SurfaceOrientation.Rotation0: width = dm.WidthPixels; height = dm.HeightPixels; break; case SurfaceOrientation.Rotation90: case SurfaceOrientation.Rotation270: width = dm.WidthPixels; height = dm.HeightPixels; break; default: break; } // Set corresponding layout dynamically based on the default/natural orientation. if (width > height) { SetContentView(Resource.Layout.Landscape); } else { SetContentView(Resource.Layout.Portrait); } statusTextView = (TextView)FindViewById(Resource.Id.textViewStatus) as TextView; pwrRadioGroup = (RadioGroup)FindViewById(Resource.Id.radioGroupPwr) as RadioGroup; pwrRadioSuspend = (RadioButton)FindViewById(Resource.Id.radioSuspend) as RadioButton; pwrRadioReset = (RadioButton)FindViewById(Resource.Id.radioReset) as RadioButton; // Set listener to the button AddSetButtonListener(); // The EMDKManager object will be created and returned in the callback EMDKResults results = EMDKManager.GetEMDKManager(Application.Context, this); // Check the return status of processProfile if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { // EMDKManager object initialization failed statusTextView.Text = "EMDKManager object creation failed ..."; } else { // EMDKManager object initialization succeeded statusTextView.Text = "EMDKManager object creation succeeded ..."; } }
private void InitializeComponent() { this.layoutControl1 = new LayoutControl(); this.sbtn_Reset = new SimpleButton(); this.sbtn_Cancel = new SimpleButton(); this.sbtn_Split = new SimpleButton(); this.radioGroup1 = new RadioGroup(); this.sbtn_BrowseFile = new SimpleButton(); this.textEdit_FilePath = new TextEdit(); this.layoutControlGroup1 = new LayoutControlGroup(); this.emptySpaceItem1 = new EmptySpaceItem(); this.layoutControlGroup2 = new LayoutControlGroup(); this.layoutControlItem1 = new LayoutControlItem(); this.layoutControlItem2 = new LayoutControlItem(); this.layoutControlItem3 = new LayoutControlItem(); this.layoutControlItem6 = new LayoutControlItem(); this.emptySpaceItem2 = new EmptySpaceItem(); this.emptySpaceItem3 = new EmptySpaceItem(); this.layoutControlItem4 = new LayoutControlItem(); this.layoutControlItem5 = new LayoutControlItem(); ((System.ComponentModel.ISupportInitialize) this.layoutControl1).BeginInit(); this.layoutControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize) this.radioGroup1.Properties).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.textEdit_FilePath.Properties).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlGroup1).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem1).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlGroup2).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem1).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem2).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem3).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem6).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem2).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem3).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem4).BeginInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem5).BeginInit(); base.SuspendLayout(); this.layoutControl1.Controls.Add(this.sbtn_Reset); this.layoutControl1.Controls.Add(this.sbtn_Cancel); this.layoutControl1.Controls.Add(this.sbtn_Split); this.layoutControl1.Controls.Add(this.radioGroup1); this.layoutControl1.Controls.Add(this.sbtn_BrowseFile); this.layoutControl1.Controls.Add(this.textEdit_FilePath); this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl1.Location = new System.Drawing.Point(0, 0); this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle?(new System.Drawing.Rectangle(392, 79, 250, 350)); this.layoutControl1.Root = this.layoutControlGroup1; this.layoutControl1.Size = new System.Drawing.Size(358, 147); this.layoutControl1.TabIndex = 0; this.layoutControl1.Text = "layoutControl1"; this.sbtn_Reset.Location = new System.Drawing.Point(304, 39); this.sbtn_Reset.Name = "sbtn_Reset"; this.sbtn_Reset.Size = new System.Drawing.Size(35, 22); this.sbtn_Reset.StyleController = this.layoutControl1; this.sbtn_Reset.TabIndex = 9; this.sbtn_Reset.Text = "重置"; this.sbtn_Reset.Click += new System.EventHandler(this.sbtn_Reset_Click); this.sbtn_Cancel.Location = new System.Drawing.Point(197, 106); this.sbtn_Cancel.Name = "sbtn_Cancel"; this.sbtn_Cancel.Size = new System.Drawing.Size(97, 22); this.sbtn_Cancel.StyleController = this.layoutControl1; this.sbtn_Cancel.TabIndex = 8; this.sbtn_Cancel.Text = "取消"; this.sbtn_Cancel.Click += new System.EventHandler(this.sbtn_Cancel_Click); this.sbtn_Split.Location = new System.Drawing.Point(63, 106); this.sbtn_Split.Name = "sbtn_Split"; this.sbtn_Split.Size = new System.Drawing.Size(85, 22); this.sbtn_Split.StyleController = this.layoutControl1; this.sbtn_Split.TabIndex = 7; this.sbtn_Split.Text = "拆分"; this.sbtn_Split.Click += new System.EventHandler(this.sbtn_Split_Click); this.radioGroup1.Location = new System.Drawing.Point(19, 39); this.radioGroup1.Name = "radioGroup1"; this.radioGroup1.Properties.Items.AddRange(new RadioGroupItem[] { new RadioGroupItem(null, "文件导入"), new RadioGroupItem(null, "绘制") }); this.radioGroup1.Size = new System.Drawing.Size(281, 25); this.radioGroup1.StyleController = this.layoutControl1; this.radioGroup1.TabIndex = 6; this.radioGroup1.SelectedIndexChanged += new System.EventHandler(this.radioGroup1_SelectedIndexChanged); this.sbtn_BrowseFile.Location = new System.Drawing.Point(304, 68); this.sbtn_BrowseFile.Name = "sbtn_BrowseFile"; this.sbtn_BrowseFile.Size = new System.Drawing.Size(35, 22); this.sbtn_BrowseFile.StyleController = this.layoutControl1; this.sbtn_BrowseFile.TabIndex = 5; this.sbtn_BrowseFile.Text = "..."; this.sbtn_BrowseFile.Click += new System.EventHandler(this.sbtn_BrowseFile_Click); this.textEdit_FilePath.Location = new System.Drawing.Point(19, 68); this.textEdit_FilePath.Name = "textEdit_FilePath"; this.textEdit_FilePath.Properties.ReadOnly = true; this.textEdit_FilePath.Size = new System.Drawing.Size(281, 20); this.textEdit_FilePath.StyleController = this.layoutControl1; this.textEdit_FilePath.TabIndex = 4; this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1"; this.layoutControlGroup1.EnableIndentsWithoutBorders = DefaultBoolean.True; this.layoutControlGroup1.GroupBordersVisible = false; this.layoutControlGroup1.Items.AddRange(new BaseLayoutItem[] { this.emptySpaceItem1, this.layoutControlGroup2, this.emptySpaceItem2, this.emptySpaceItem3, this.layoutControlItem4, this.layoutControlItem5 }); this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0); this.layoutControlGroup1.Name = "layoutControlGroup1"; this.layoutControlGroup1.Padding = new DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5); this.layoutControlGroup1.Size = new System.Drawing.Size(358, 147); this.layoutControlGroup1.Text = "layoutControlGroup1"; this.layoutControlGroup1.TextVisible = false; this.emptySpaceItem1.AllowHotTrack = false; this.emptySpaceItem1.CustomizationFormText = "emptySpaceItem1"; this.emptySpaceItem1.Location = new System.Drawing.Point(0, 99); this.emptySpaceItem1.Name = "emptySpaceItem1"; this.emptySpaceItem1.Size = new System.Drawing.Size(56, 38); this.emptySpaceItem1.Text = "emptySpaceItem1"; this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); this.layoutControlGroup2.CustomizationFormText = "范围多边形"; this.layoutControlGroup2.Items.AddRange(new BaseLayoutItem[] { this.layoutControlItem1, this.layoutControlItem2, this.layoutControlItem3, this.layoutControlItem6 }); this.layoutControlGroup2.Location = new System.Drawing.Point(0, 0); this.layoutControlGroup2.Name = "layoutControlGroup2"; this.layoutControlGroup2.Size = new System.Drawing.Size(348, 99); this.layoutControlGroup2.Text = "范围多边形"; this.layoutControlItem1.Control = this.textEdit_FilePath; this.layoutControlItem1.CustomizationFormText = "layoutControlItem1"; this.layoutControlItem1.Location = new System.Drawing.Point(0, 29); this.layoutControlItem1.Name = "layoutControlItem1"; this.layoutControlItem1.Size = new System.Drawing.Size(285, 26); this.layoutControlItem1.Text = "layoutControlItem1"; this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem1.TextToControlDistance = 0; this.layoutControlItem1.TextVisible = false; this.layoutControlItem2.Control = this.sbtn_BrowseFile; this.layoutControlItem2.CustomizationFormText = "layoutControlItem2"; this.layoutControlItem2.Location = new System.Drawing.Point(285, 29); this.layoutControlItem2.Name = "layoutControlItem2"; this.layoutControlItem2.Size = new System.Drawing.Size(39, 26); this.layoutControlItem2.Text = "layoutControlItem2"; this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem2.TextToControlDistance = 0; this.layoutControlItem2.TextVisible = false; this.layoutControlItem3.Control = this.radioGroup1; this.layoutControlItem3.CustomizationFormText = "layoutControlItem3"; this.layoutControlItem3.Location = new System.Drawing.Point(0, 0); this.layoutControlItem3.Name = "layoutControlItem3"; this.layoutControlItem3.Size = new System.Drawing.Size(285, 29); this.layoutControlItem3.Text = "layoutControlItem3"; this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem3.TextToControlDistance = 0; this.layoutControlItem3.TextVisible = false; this.layoutControlItem6.Control = this.sbtn_Reset; this.layoutControlItem6.CustomizationFormText = "layoutControlItem6"; this.layoutControlItem6.Location = new System.Drawing.Point(285, 0); this.layoutControlItem6.Name = "layoutControlItem6"; this.layoutControlItem6.Size = new System.Drawing.Size(39, 29); this.layoutControlItem6.Text = "layoutControlItem6"; this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem6.TextToControlDistance = 0; this.layoutControlItem6.TextVisible = false; this.emptySpaceItem2.AllowHotTrack = false; this.emptySpaceItem2.CustomizationFormText = "emptySpaceItem2"; this.emptySpaceItem2.Location = new System.Drawing.Point(291, 99); this.emptySpaceItem2.Name = "emptySpaceItem2"; this.emptySpaceItem2.Size = new System.Drawing.Size(57, 38); this.emptySpaceItem2.Text = "emptySpaceItem2"; this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0); this.emptySpaceItem3.AllowHotTrack = false; this.emptySpaceItem3.CustomizationFormText = "emptySpaceItem3"; this.emptySpaceItem3.Location = new System.Drawing.Point(145, 99); this.emptySpaceItem3.Name = "emptySpaceItem3"; this.emptySpaceItem3.Size = new System.Drawing.Size(45, 38); this.emptySpaceItem3.Text = "emptySpaceItem3"; this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem4.Control = this.sbtn_Split; this.layoutControlItem4.CustomizationFormText = "layoutControlItem4"; this.layoutControlItem4.Location = new System.Drawing.Point(56, 99); this.layoutControlItem4.Name = "layoutControlItem4"; this.layoutControlItem4.Size = new System.Drawing.Size(89, 38); this.layoutControlItem4.Text = "layoutControlItem4"; this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem4.TextToControlDistance = 0; this.layoutControlItem4.TextVisible = false; this.layoutControlItem5.Control = this.sbtn_Cancel; this.layoutControlItem5.CustomizationFormText = "layoutControlItem5"; this.layoutControlItem5.Location = new System.Drawing.Point(190, 99); this.layoutControlItem5.Name = "layoutControlItem5"; this.layoutControlItem5.Size = new System.Drawing.Size(101, 38); this.layoutControlItem5.Text = "layoutControlItem5"; this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem5.TextToControlDistance = 0; this.layoutControlItem5.TextVisible = false; base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 14f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.ClientSize = new System.Drawing.Size(358, 147); base.Controls.Add(this.layoutControl1); base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; base.Name = "SplitDlg"; base.ShowInTaskbar = false; base.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "拆分"; base.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.SplitDlg_FormClosed); ((System.ComponentModel.ISupportInitialize) this.layoutControl1).EndInit(); this.layoutControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize) this.radioGroup1.Properties).EndInit(); ((System.ComponentModel.ISupportInitialize) this.textEdit_FilePath.Properties).EndInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlGroup1).EndInit(); ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem1).EndInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlGroup2).EndInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem1).EndInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem2).EndInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem3).EndInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem6).EndInit(); ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem2).EndInit(); ((System.ComponentModel.ISupportInitialize) this.emptySpaceItem3).EndInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem4).EndInit(); ((System.ComponentModel.ISupportInitialize) this.layoutControlItem5).EndInit(); base.ResumeLayout(false); }
public void Include(RadioGroup radioGroup) { radioGroup.CheckedChange += (sender, args) => radioGroup.Check(args.CheckedId); }
private EnvelopeTemplate MakeTemplate(string resultsTemplateName) { // Data for this method // resultsTemplateName // document 1 (pdf) has tag /sn1/ // // The template has two recipient roles. // recipient 1 - signer // recipient 2 - cc // The template will be sent first to the signer. // After it is signed, a copy is sent to the cc person. // read file from a local directory // The reads could raise an exception if the file is not available! // add the documents Document doc = new Document(); string docB64 = Convert.ToBase64String(System.IO.File.ReadAllBytes("World_Wide_Corp_fields.pdf")); doc.DocumentBase64 = docB64; doc.Name = "Lorem Ipsum"; // can be different from actual file name doc.FileExtension = "pdf"; doc.DocumentId = "1"; // create a signer recipient to sign the document, identified by name and email // We're setting the parameters via the object creation Signer signer1 = new Signer(); signer1.RoleName = "signer"; signer1.RecipientId = "1"; signer1.RoutingOrder = "1"; // routingOrder (lower means earlier) determines the order of deliveries // to the recipients. Parallel routing order is supported by using the // same integer as the order for two or more recipients. // create a cc recipient to receive a copy of the documents, identified by name and email // We're setting the parameters via setters CarbonCopy cc1 = new CarbonCopy(); cc1.RoleName = "cc"; cc1.RoutingOrder = "2"; cc1.RecipientId = "2"; // Create fields using absolute positioning: SignHere signHere = new SignHere(); signHere.DocumentId = "1"; signHere.PageNumber = "1"; signHere.XPosition = "191"; signHere.YPosition = "148"; Checkbox check1 = new Checkbox(); check1.DocumentId = "1"; check1.PageNumber = "1"; check1.XPosition = "75"; check1.YPosition = "417"; check1.TabLabel = "ckAuthorization"; Checkbox check2 = new Checkbox(); check2.DocumentId = "1"; check2.PageNumber = "1"; check2.XPosition = "75"; check2.YPosition = "447"; check2.TabLabel = "ckAuthentication"; Checkbox check3 = new Checkbox(); check3.DocumentId = "1"; check3.PageNumber = "1"; check3.XPosition = "75"; check3.YPosition = "478"; check3.TabLabel = "ckAgreement"; Checkbox check4 = new Checkbox(); check4.DocumentId = "1"; check4.PageNumber = "1"; check4.XPosition = "75"; check4.YPosition = "508"; check4.TabLabel = "ckAcknowledgement"; List list1 = new List(); list1.DocumentId = "1"; list1.PageNumber = "1"; list1.XPosition = "142"; list1.YPosition = "291"; list1.Font = "helvetica"; list1.FontSize = "size14"; list1.TabLabel = "list"; list1.Required = "false"; list1.ListItems = new List <ListItem> { new ListItem { Text = "Red", Value = "Red" }, new ListItem { Text = "Orange", Value = "Orange" }, new ListItem { Text = "Yellow", Value = "Yellow" }, new ListItem { Text = "Green", Value = "Green" }, new ListItem { Text = "Blue", Value = "Blue" }, new ListItem { Text = "Indigo", Value = "Indigo" }, new ListItem { Text = "Violet", Value = "Violet" }, }; // The SDK can't create a number tab at this time. Bug DCM-2732 // Until it is fixed, use a text tab instead. // , number = docusign.Number.constructFromObject({ // documentId: "1", pageNumber: "1", xPosition: "163", yPosition: "260", // font: "helvetica", fontSize: "size14", tabLabel: "numbersOnly", // height: "23", width: "84", required: "false"}) Text textInsteadOfNumber = new Text(); textInsteadOfNumber.DocumentId = "1"; textInsteadOfNumber.PageNumber = "1"; textInsteadOfNumber.XPosition = "153"; textInsteadOfNumber.YPosition = "260"; textInsteadOfNumber.Font = "helvetica"; textInsteadOfNumber.FontSize = "size14"; textInsteadOfNumber.TabLabel = "numbersOnly"; textInsteadOfNumber.Height = "23"; textInsteadOfNumber.Width = "84"; textInsteadOfNumber.Required = "false"; RadioGroup radioGroup = new RadioGroup(); radioGroup.DocumentId = "1"; radioGroup.GroupName = "radio1"; radioGroup.Radios = new List <Radio> { new Radio { PageNumber = "1", Value = "white", XPosition = "142", YPosition = "384", Required = "false" }, new Radio { PageNumber = "1", Value = "red", XPosition = "74", YPosition = "384", Required = "false" }, new Radio { PageNumber = "1", Value = "blue", XPosition = "220", YPosition = "384", Required = "false" } }; Text text = new Text(); text.DocumentId = "1"; text.PageNumber = "1"; text.XPosition = "153"; text.YPosition = "230"; text.Font = "helvetica"; text.FontSize = "size14"; text.TabLabel = "text"; text.Height = "23"; text.Width = "84"; text.Required = "false"; // Tabs are set per recipient / signer Tabs signer1Tabs = new Tabs(); signer1Tabs.CheckboxTabs = new List <Checkbox> { check1, check2, check3, check4 }; signer1Tabs.ListTabs = new List <List> { list1 }; // numberTabs: [number], signer1Tabs.RadioGroupTabs = new List <RadioGroup> { radioGroup }; signer1Tabs.SignHereTabs = new List <SignHere> { signHere }; signer1Tabs.TextTabs = new List <Text> { text, textInsteadOfNumber }; signer1.Tabs = signer1Tabs; // Add the recipients to the env object Recipients recipients = new Recipients(); recipients.Signers = new List <Signer> { signer1 }; recipients.CarbonCopies = new List <CarbonCopy> { cc1 }; // create the overall template definition EnvelopeTemplate template = new EnvelopeTemplate(); // The order in the docs array determines the order in the env template.Description = "Example template created via the API"; template.Name = resultsTemplateName; template.Documents = new List <Document> { doc }; template.EmailSubject = "Please sign this document"; template.Recipients = recipients; template.Status = "created"; return(template); }
private void InitializeComponent() { this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); this.te_Port = new DevExpress.XtraEditors.SpinEdit(); this.sbtn_Cancel = new DevExpress.XtraEditors.SimpleButton(); this.sbtn_OK = new DevExpress.XtraEditors.SimpleButton(); this.te_DataSet = new DevExpress.XtraEditors.TextEdit(); this.te_DataSource = new DevExpress.XtraEditors.TextEdit(); this.te_ServerAddr = new DevExpress.XtraEditors.TextEdit(); this.te_Pwd = new DevExpress.XtraEditors.TextEdit(); this.sbtn_Browser = new DevExpress.XtraEditors.SimpleButton(); this.te_Path = new DevExpress.XtraEditors.TextEdit(); this.radioGroup1 = new DevExpress.XtraEditors.RadioGroup(); this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); this.lb_Path = new DevExpress.XtraLayout.LayoutControlItem(); this.lb_Browser = new DevExpress.XtraLayout.LayoutControlItem(); this.lb_Pwd = new DevExpress.XtraLayout.LayoutControlItem(); this.lb_Server = new DevExpress.XtraLayout.LayoutControlItem(); this.lb_DataSource = new DevExpress.XtraLayout.LayoutControlItem(); this.lb_DataSet = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem9 = new DevExpress.XtraLayout.LayoutControlItem(); this.layoutControlItem10 = new DevExpress.XtraLayout.LayoutControlItem(); this.lb_Port = new DevExpress.XtraLayout.LayoutControlItem(); ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit(); this.layoutControl1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.te_Port.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.te_DataSet.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.te_DataSource.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.te_ServerAddr.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.te_Pwd.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.te_Path.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Path)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Browser)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Pwd)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Server)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_DataSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_DataSet)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Port)).BeginInit(); this.SuspendLayout(); // // layoutControl1 // this.layoutControl1.Controls.Add(this.te_Port); this.layoutControl1.Controls.Add(this.sbtn_Cancel); this.layoutControl1.Controls.Add(this.sbtn_OK); this.layoutControl1.Controls.Add(this.te_DataSet); this.layoutControl1.Controls.Add(this.te_DataSource); this.layoutControl1.Controls.Add(this.te_ServerAddr); this.layoutControl1.Controls.Add(this.te_Pwd); this.layoutControl1.Controls.Add(this.sbtn_Browser); this.layoutControl1.Controls.Add(this.te_Path); this.layoutControl1.Controls.Add(this.radioGroup1); this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.layoutControl1.Location = new System.Drawing.Point(0, 0); this.layoutControl1.Name = "layoutControl1"; this.layoutControl1.Root = this.layoutControlGroup1; this.layoutControl1.Size = new System.Drawing.Size(268, 235); this.layoutControl1.TabIndex = 0; this.layoutControl1.Text = "layoutControl1"; // // te_Port // this.te_Port.EditValue = new decimal(new int[] { 8040, 0, 0, 0 }); this.te_Port.Location = new System.Drawing.Point(87, 71); this.te_Port.Name = "te_Port"; this.te_Port.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo) }); this.te_Port.Properties.IsFloatValue = false; this.te_Port.Properties.Mask.EditMask = "N00"; this.te_Port.Properties.MaxValue = new decimal(new int[] { 65535, 0, 0, 0 }); this.te_Port.Size = new System.Drawing.Size(169, 22); this.te_Port.StyleController = this.layoutControl1; this.te_Port.TabIndex = 14; // // sbtn_Cancel // this.sbtn_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.sbtn_Cancel.Location = new System.Drawing.Point(136, 201); this.sbtn_Cancel.Name = "sbtn_Cancel"; this.sbtn_Cancel.Size = new System.Drawing.Size(120, 22); this.sbtn_Cancel.StyleController = this.layoutControl1; this.sbtn_Cancel.TabIndex = 13; this.sbtn_Cancel.Text = "取消"; this.sbtn_Cancel.Click += new System.EventHandler(this.sbtn_Cancel_Click); // // sbtn_OK // this.sbtn_OK.Location = new System.Drawing.Point(12, 201); this.sbtn_OK.Name = "sbtn_OK"; this.sbtn_OK.Size = new System.Drawing.Size(120, 22); this.sbtn_OK.StyleController = this.layoutControl1; this.sbtn_OK.TabIndex = 12; this.sbtn_OK.Text = "确定"; this.sbtn_OK.Click += new System.EventHandler(this.sbtn_OK_Click); // // te_DataSet // this.te_DataSet.Location = new System.Drawing.Point(87, 123); this.te_DataSet.Name = "te_DataSet"; this.te_DataSet.Size = new System.Drawing.Size(169, 22); this.te_DataSet.StyleController = this.layoutControl1; this.te_DataSet.TabIndex = 11; // // te_DataSource // this.te_DataSource.Location = new System.Drawing.Point(87, 97); this.te_DataSource.Name = "te_DataSource"; this.te_DataSource.Size = new System.Drawing.Size(169, 22); this.te_DataSource.StyleController = this.layoutControl1; this.te_DataSource.TabIndex = 10; // // te_ServerAddr // this.te_ServerAddr.Location = new System.Drawing.Point(87, 45); this.te_ServerAddr.Name = "te_ServerAddr"; this.te_ServerAddr.Size = new System.Drawing.Size(169, 22); this.te_ServerAddr.StyleController = this.layoutControl1; this.te_ServerAddr.TabIndex = 8; // // te_Pwd // this.te_Pwd.Location = new System.Drawing.Point(87, 175); this.te_Pwd.Name = "te_Pwd"; this.te_Pwd.Properties.PasswordChar = '*'; this.te_Pwd.Size = new System.Drawing.Size(169, 22); this.te_Pwd.StyleController = this.layoutControl1; this.te_Pwd.TabIndex = 7; // // sbtn_Browser // this.sbtn_Browser.Location = new System.Drawing.Point(233, 149); this.sbtn_Browser.Name = "sbtn_Browser"; this.sbtn_Browser.Size = new System.Drawing.Size(23, 22); this.sbtn_Browser.StyleController = this.layoutControl1; this.sbtn_Browser.TabIndex = 6; this.sbtn_Browser.Text = "..."; this.sbtn_Browser.Click += new System.EventHandler(this.sbtn_Browser_Click); // // te_Path // this.te_Path.Location = new System.Drawing.Point(87, 149); this.te_Path.Name = "te_Path"; this.te_Path.Size = new System.Drawing.Size(142, 22); this.te_Path.StyleController = this.layoutControl1; this.te_Path.TabIndex = 5; // // radioGroup1 // this.radioGroup1.Location = new System.Drawing.Point(12, 12); this.radioGroup1.Name = "radioGroup1"; this.radioGroup1.Properties.Columns = 2; this.radioGroup1.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] { new DevExpress.XtraEditors.Controls.RadioGroupItem(0, "地形文件"), new DevExpress.XtraEditors.Controls.RadioGroupItem(1, "网络服务") }); this.radioGroup1.Size = new System.Drawing.Size(244, 29); this.radioGroup1.StyleController = this.layoutControl1; this.radioGroup1.TabIndex = 4; this.radioGroup1.SelectedIndexChanged += new System.EventHandler(this.radioGroup1_SelectedIndexChanged); // // layoutControlGroup1 // this.layoutControlGroup1.CustomizationFormText = "layoutControlGroup1"; this.layoutControlGroup1.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True; this.layoutControlGroup1.GroupBordersVisible = false; this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { this.layoutControlItem1, this.lb_Path, this.lb_Browser, this.lb_Pwd, this.lb_Server, this.lb_DataSource, this.lb_DataSet, this.layoutControlItem9, this.layoutControlItem10, this.lb_Port }); this.layoutControlGroup1.Location = new System.Drawing.Point(0, 0); this.layoutControlGroup1.Name = "layoutControlGroup1"; this.layoutControlGroup1.Size = new System.Drawing.Size(268, 235); this.layoutControlGroup1.Text = "layoutControlGroup1"; this.layoutControlGroup1.TextVisible = false; // // layoutControlItem1 // this.layoutControlItem1.Control = this.radioGroup1; this.layoutControlItem1.CustomizationFormText = "layoutControlItem1"; this.layoutControlItem1.Location = new System.Drawing.Point(0, 0); this.layoutControlItem1.Name = "layoutControlItem1"; this.layoutControlItem1.Size = new System.Drawing.Size(248, 33); this.layoutControlItem1.Text = "layoutControlItem1"; this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem1.TextToControlDistance = 0; this.layoutControlItem1.TextVisible = false; // // lb_Path // this.lb_Path.Control = this.te_Path; this.lb_Path.CustomizationFormText = "路径:"; this.lb_Path.Location = new System.Drawing.Point(0, 137); this.lb_Path.Name = "lb_Path"; this.lb_Path.Size = new System.Drawing.Size(221, 26); this.lb_Path.Text = "路径:"; this.lb_Path.TextSize = new System.Drawing.Size(72, 14); // // lb_Browser // this.lb_Browser.Control = this.sbtn_Browser; this.lb_Browser.CustomizationFormText = "lb_Browser"; this.lb_Browser.Location = new System.Drawing.Point(221, 137); this.lb_Browser.Name = "lb_Browser"; this.lb_Browser.Size = new System.Drawing.Size(27, 26); this.lb_Browser.Text = "lb_Browser"; this.lb_Browser.TextSize = new System.Drawing.Size(0, 0); this.lb_Browser.TextToControlDistance = 0; this.lb_Browser.TextVisible = false; // // lb_Pwd // this.lb_Pwd.Control = this.te_Pwd; this.lb_Pwd.CustomizationFormText = "密码:"; this.lb_Pwd.Location = new System.Drawing.Point(0, 163); this.lb_Pwd.Name = "lb_Pwd"; this.lb_Pwd.Size = new System.Drawing.Size(248, 26); this.lb_Pwd.Text = "密码:"; this.lb_Pwd.TextSize = new System.Drawing.Size(72, 14); // // lb_Server // this.lb_Server.Control = this.te_ServerAddr; this.lb_Server.CustomizationFormText = "服务器地址:"; this.lb_Server.Location = new System.Drawing.Point(0, 33); this.lb_Server.Name = "lb_Server"; this.lb_Server.Size = new System.Drawing.Size(248, 26); this.lb_Server.Text = "服务器地址:"; this.lb_Server.TextSize = new System.Drawing.Size(72, 14); // // lb_DataSource // this.lb_DataSource.Control = this.te_DataSource; this.lb_DataSource.CustomizationFormText = "数据源:"; this.lb_DataSource.Location = new System.Drawing.Point(0, 85); this.lb_DataSource.Name = "lb_DataSource"; this.lb_DataSource.Size = new System.Drawing.Size(248, 26); this.lb_DataSource.Text = "数据源:"; this.lb_DataSource.TextSize = new System.Drawing.Size(72, 14); // // lb_DataSet // this.lb_DataSet.Control = this.te_DataSet; this.lb_DataSet.CustomizationFormText = "数据集:"; this.lb_DataSet.Location = new System.Drawing.Point(0, 111); this.lb_DataSet.Name = "lb_DataSet"; this.lb_DataSet.Size = new System.Drawing.Size(248, 26); this.lb_DataSet.Text = "数据集:"; this.lb_DataSet.TextSize = new System.Drawing.Size(72, 14); // // layoutControlItem9 // this.layoutControlItem9.Control = this.sbtn_OK; this.layoutControlItem9.CustomizationFormText = "layoutControlItem9"; this.layoutControlItem9.Location = new System.Drawing.Point(0, 189); this.layoutControlItem9.Name = "layoutControlItem9"; this.layoutControlItem9.Size = new System.Drawing.Size(124, 26); this.layoutControlItem9.Text = "layoutControlItem9"; this.layoutControlItem9.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem9.TextToControlDistance = 0; this.layoutControlItem9.TextVisible = false; // // layoutControlItem10 // this.layoutControlItem10.Control = this.sbtn_Cancel; this.layoutControlItem10.CustomizationFormText = "layoutControlItem10"; this.layoutControlItem10.Location = new System.Drawing.Point(124, 189); this.layoutControlItem10.Name = "layoutControlItem10"; this.layoutControlItem10.Size = new System.Drawing.Size(124, 26); this.layoutControlItem10.Text = "layoutControlItem10"; this.layoutControlItem10.TextSize = new System.Drawing.Size(0, 0); this.layoutControlItem10.TextToControlDistance = 0; this.layoutControlItem10.TextVisible = false; // // lb_Port // this.lb_Port.Control = this.te_Port; this.lb_Port.CustomizationFormText = "端口号:"; this.lb_Port.Location = new System.Drawing.Point(0, 59); this.lb_Port.Name = "lb_Port"; this.lb_Port.Size = new System.Drawing.Size(248, 26); this.lb_Port.Text = "端口号:"; this.lb_Port.TextSize = new System.Drawing.Size(72, 14); // // FormAdd3DTile // this.AcceptButton = this.sbtn_OK; this.CancelButton = this.sbtn_Cancel; this.ClientSize = new System.Drawing.Size(268, 235); this.Controls.Add(this.layoutControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "FormAdd3DTile"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "加载瓦片图层"; ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit(); this.layoutControl1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.te_Port.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.te_DataSet.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.te_DataSource.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.te_ServerAddr.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.te_Pwd.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.te_Path.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Path)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Browser)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Pwd)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Server)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_DataSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_DataSet)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem9)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem10)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.lb_Port)).EndInit(); this.ResumeLayout(false); }
public async void OnCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case Resource.Id.settings_general_english: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("en"); break; case Resource.Id.settings_general_bokmal: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("nb"); break; case Resource.Id.settings_general_nynorsk: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("nn"); break; case Resource.Id.settings_general_polish: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("pl"); break; case Resource.Id.settings_general_somali: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("so"); break; case Resource.Id.settings_general_tigrinya: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("ti"); break; case Resource.Id.settings_general_arabic: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("ar"); break; case Resource.Id.settings_general_urdu: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("ur"); break; case Resource.Id.settings_general_lithuanian: await DialogUtils.DisplayDialogAsync(_self, GetChangeLanguageViewModel); LocalPreferencesHelper.SetAppLanguage("lt"); break; } LocalesService.SetInternationalization(); _self._resetViews.ResetViews(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.groupBox4 = new System.Windows.Forms.GroupBox(); this.panelControl1 = new DevExpress.XtraEditors.PanelControl(); this.radioGroup1 = new DevExpress.XtraEditors.RadioGroup(); this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton(); this.groupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).BeginInit(); this.SuspendLayout(); // // groupBox4 // this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox4.Controls.Add(this.panelControl1); this.groupBox4.Controls.Add(this.radioGroup1); this.groupBox4.ForeColor = System.Drawing.Color.RoyalBlue; this.groupBox4.Location = new System.Drawing.Point(12, 13); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(210, 80); this.groupBox4.TabIndex = 1; this.groupBox4.TabStop = false; this.groupBox4.Text = "����ѡ��"; // // panelControl1 // this.panelControl1.Appearance.BackColor = System.Drawing.Color.Red; this.panelControl1.Appearance.Options.UseBackColor = true; this.panelControl1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple; this.panelControl1.Location = new System.Drawing.Point(31, 38); this.panelControl1.Name = "panelControl1"; this.panelControl1.Size = new System.Drawing.Size(67, 12); this.panelControl1.TabIndex = 2; this.panelControl1.Text = "panelControl1"; this.panelControl1.Paint += new System.Windows.Forms.PaintEventHandler(this.panelControl1_Paint); // // radioGroup1 // this.radioGroup1.EditValue = "0"; this.radioGroup1.Location = new System.Drawing.Point(117, 12); this.radioGroup1.Name = "radioGroup1"; this.radioGroup1.Properties.Appearance.BackColor = System.Drawing.Color.Transparent; this.radioGroup1.Properties.Appearance.Options.UseBackColor = true; this.radioGroup1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; this.radioGroup1.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] { new DevExpress.XtraEditors.Controls.RadioGroupItem("0", "���߷�"), new DevExpress.XtraEditors.Controls.RadioGroupItem("1", "���߷�")}); this.radioGroup1.Size = new System.Drawing.Size(77, 62); this.radioGroup1.TabIndex = 3; this.radioGroup1.SelectedIndexChanged += new System.EventHandler(this.radioGroup1_SelectedIndexChanged); // // simpleButton2 // this.simpleButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.simpleButton2.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.simpleButton2.Location = new System.Drawing.Point(141, 99); this.simpleButton2.Name = "simpleButton2"; this.simpleButton2.Size = new System.Drawing.Size(75, 23); this.simpleButton2.TabIndex = 3; this.simpleButton2.Text = "ȡ��"; this.simpleButton2.Click += new System.EventHandler(this.simpleButton2_Click); // // simpleButton1 // this.simpleButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.simpleButton1.DialogResult = System.Windows.Forms.DialogResult.OK; this.simpleButton1.Location = new System.Drawing.Point(12, 99); this.simpleButton1.Name = "simpleButton1"; this.simpleButton1.Size = new System.Drawing.Size(75, 23); this.simpleButton1.TabIndex = 2; this.simpleButton1.Text = "ȷ��"; this.simpleButton1.Click += new System.EventHandler(this.simpleButton1_Click); // // JorJform // this.ClientSize = new System.Drawing.Size(228, 134); this.Controls.Add(this.simpleButton2); this.Controls.Add(this.simpleButton1); this.Controls.Add(this.groupBox4); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "JorJform"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "JorJform"; this.groupBox4.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).EndInit(); this.ResumeLayout(false); }
private void Init() { ImageButton backButton = FindViewById <ImageButton>(Resource.Id.arrow_back_general); backButton.ContentDescription = BACK_BUTTON_ACCESSIBILITY_TEXT; TextView titleField = FindViewById <TextView>(Resource.Id.settings_general_title); TextView explanationOne = FindViewById <TextView>(Resource.Id.settings_general_explanation); TextView explanationTwo = FindViewById <TextView>(Resource.Id.settings_general_explanation_two); TextView mobileDataHeader = FindViewById <TextView>(Resource.Id.settings_general_mobile_data_header); TextView mobileDataDesc = FindViewById <TextView>(Resource.Id.settings_general_mobile_data_desc); TextView languageHeader = FindViewById <TextView>(Resource.Id.settings_general_select_lang_header); TextView languageDesc = FindViewById <TextView>(Resource.Id.settings_general_select_lang_desc_one); TextView languageLink = FindViewById <TextView>(Resource.Id.settings_general_link); TextView linkLayout = FindViewById <TextView>(Resource.Id.settings_general_link); titleField.Text = SETTINGS_GENERAL_TITLE; explanationOne.Text = SETTINGS_GENERAL_EXPLANATION_ONE; explanationTwo.Text = SETTINGS_GENERAL_EXPLANATION_TWO; mobileDataHeader.Text = SETTINGS_GENERAL_MOBILE_DATA_HEADER; mobileDataDesc.Text = SETTINGS_GENERAL_MOBILE_DATA_DESC; languageHeader.Text = SETTINGS_GENERAL_CHOOSE_LANGUAGE_HEADER; languageDesc.Text = SETTINGS_GENERAL_RESTART_REQUIRED_TEXT; languageLink.TextAlignment = TextAlignment.ViewStart; languageLink.ContentDescription = SETTINGS_GENERAL_ACCESSIBILITY_MORE_INFO_BUTTON_TEXT; titleField.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate()); mobileDataHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate()); languageHeader.SetAccessibilityDelegate(AccessibilityUtils.GetHeadingAccessibilityDelegate()); languageLink.TextFormatted = HtmlCompat.FromHtml($"<a href=\"{SETTINGS_GENERAL_MORE_INFO_LINK}\">{SETTINGS_GENERAL_MORE_INFO_BUTTON_TEXT}</a>", HtmlCompat.FromHtmlModeLegacy); languageLink.MovementMethod = new Android.Text.Method.LinkMovementMethod(); RadioGroup radioGroup = FindViewById <RadioGroup>(Resource.Id.settings_general_select_lang_radio_group); RadioButton englishRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_english); RadioButton bokmalRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_bokmal); RadioButton nynorskRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_nynorsk); RadioButton polishRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_polish); RadioButton somaliRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_somali); RadioButton tigrinyaRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_tigrinya); RadioButton arabicRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_arabic); RadioButton urduRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_urdu); RadioButton lithuanianRadioButton = FindViewById <RadioButton>(Resource.Id.settings_general_lithuanian); englishRadioButton.Text = SETTINGS_GENERAL_EN; bokmalRadioButton.Text = SETTINGS_GENERAL_NB; nynorskRadioButton.Text = SETTINGS_GENERAL_NN; polishRadioButton.Text = SETTINGS_GENERAL_PL; somaliRadioButton.Text = SETTINGS_GENERAL_SO; tigrinyaRadioButton.Text = SETTINGS_GENERAL_TI; arabicRadioButton.Text = SETTINGS_GENERAL_AR; urduRadioButton.Text = SETTINGS_GENERAL_UR; lithuanianRadioButton.Text = SETTINGS_GENERAL_LT; string appLanguage = LocalesService.GetLanguage(); switch (appLanguage) { case "en": englishRadioButton.Checked = true; break; case "nn": nynorskRadioButton.Checked = true; break; case "pl": polishRadioButton.Checked = true; break; case "so": somaliRadioButton.Checked = true; break; case "ti": tigrinyaRadioButton.Checked = true; break; case "ar": arabicRadioButton.Checked = true; break; case "ur": urduRadioButton.Checked = true; break; case "lt": lithuanianRadioButton.Checked = true; break; default: bokmalRadioButton.Checked = true; break; } radioGroup.SetOnCheckedChangeListener(new OnCheckedChangeListener(this)); SwitchCompat switchButton = FindViewById <SwitchCompat>(Resource.Id.settings_general_switch); switchButton.Checked = _viewModel.GetStoredCheckedState(); switchButton.CheckedChange += OnCheckedChange; backButton.Click += new StressUtils.SingleClick((sender, args) => Finish()).Run; // Layout direction logic View rootView = Window.DecorView.RootView; rootView.LayoutDirection = LayoutUtils.GetLayoutDirection(); backButton.SetBackgroundResource(LayoutUtils.GetBackArrow()); languageLink.SetCompoundDrawablesRelativeWithIntrinsicBounds(null, null, ContextCompat.GetDrawable(this, LayoutUtils.GetForwardArrow()), null); }
public override void onCheckedChanged(RadioGroup group, int checkedId) { switch (checkedId) { case R.id.radioNotEnabled: try { msr.DataEncryptionAlgorithm = MSRConst.MSR_DE_NONE; } catch (JposException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); MessageDialogFragment.showDialog(FragmentManager, "Excepction", e.Message); } break; case R.id.radioTripleDES: try { msr.DataEncryptionAlgorithm = MSRConst.MSR_DE_3DEA_DUKPT; } catch (JposException e) { Console.WriteLine(e.ToString()); Console.Write(e.StackTrace); MessageDialogFragment.showDialog(FragmentManager, "Excepction", e.Message); } break; } }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.Scout_Form_Edit); //get controls from layout and assign event handlers textTitle = FindViewById <TextView>(Resource.Id.textEventTitle); vMatchNumber = FindViewById <EditText>(Resource.Id.vMatchNumber); vTeamNumber = FindViewById <EditText>(Resource.Id.vTeamNumber); position = FindViewById <Spinner>(Resource.Id.vPosition); position.ItemSelected += SpinnerClick; table = FindViewById <CheckBox>(Resource.Id.table); radioLevel = FindViewById <RadioGroup>(Resource.Id.radioLevel); radioLevel.CheckedChange += RadioClicked; radioSandstorm = FindViewById <RadioGroup>(Resource.Id.radioSandstorm); radioSandstorm.CheckedChange += RadioClicked; sandCargo = FindViewById <CheckBox>(Resource.Id.sandCargo); sandHatch = FindViewById <CheckBox>(Resource.Id.sandHatch); sandHab = FindViewById <CheckBox>(Resource.Id.sandHab); cargo = FindViewById <CheckBox>(Resource.Id.cargo); cargo.CheckedChange += CheckboxClicked; cargoWell = FindViewById <CheckBox>(Resource.Id.cargoWell); cargoWell.CheckedChange += CheckboxClicked; cargoBarely = FindViewById <CheckBox>(Resource.Id.cargoBarely); cargoBarely.CheckedChange += CheckboxClicked; hatch = FindViewById <CheckBox>(Resource.Id.hatch); hatch.CheckedChange += CheckboxClicked; hatchWell = FindViewById <CheckBox>(Resource.Id.hatchWell); hatchWell.CheckedChange += CheckboxClicked; hatchBarely = FindViewById <CheckBox>(Resource.Id.hatchBarely); hatchBarely.CheckedChange += CheckboxClicked; radioClimb = FindViewById <RadioGroup>(Resource.Id.radioClimb); radioClimb.CheckedChange += RadioClicked; radioDrivers = FindViewById <RadioGroup>(Resource.Id.radioDrivers); radioDrivers.CheckedChange += RadioClicked; radioRecommend = FindViewById <RadioGroup>(Resource.Id.radioRecommend); radioRecommend.CheckedChange += RadioClicked; radioResult = FindViewById <RadioGroup>(Resource.Id.radioResult); radioResult.CheckedChange += RadioClicked; comments = FindViewById <MultiAutoCompleteTextView>(Resource.Id.comments); bFinish = FindViewById <Button>(Resource.Id.bFinish); bFinish.Click += ButtonClicked; //put positions into dropdown string[] positions = new string[] { "Red 1", "Red 2", "Red 3", "Blue 1", "Blue 2", "Blue 3" }; ArrayAdapter posAdapt = new ArrayAdapter <string>(this, Android.Resource.Layout.SimpleListItem1, positions); position.Adapter = posAdapt; //get current event and set title text currentEvent = eData.GetCurrentEvent(); currentMatch = eData.GetCurrentMatch(); textTitle.Text += currentMatch.matchNumber.ToString() + "'"; //set options to match properties vMatchNumber.Text = currentMatch.matchNumber.ToString(); vTeamNumber.Text = currentMatch.teamNumber.ToString(); position.SetSelection(currentMatch.position); table.Checked = currentMatch.isTable; ((RadioButton)radioLevel.GetChildAt(currentMatch.sandstormStartLevel - 1)).Checked = true; ((RadioButton)radioSandstorm.GetChildAt(currentMatch.sandstormMode)).Checked = true; sandCargo.Checked = currentMatch.sandstormCargo; sandHatch.Checked = currentMatch.sandstormHatch; sandHab.Checked = currentMatch.sandstormLine; cargo.Checked = currentMatch.cargo; cargoWell.Checked = currentMatch.cargoWell; cargoBarely.Checked = currentMatch.cargoBarely; hatch.Checked = currentMatch.hatch; hatchWell.Checked = currentMatch.hatchWell; hatchBarely.Checked = currentMatch.hatchBarely; try { ((RadioButton)radioClimb.GetChildAt(currentMatch.climb - 2)).Checked = true; } catch { ((RadioButton)radioClimb.GetChildAt(2)).Checked = true; } ((RadioButton)radioDrivers.GetChildAt(Convert.ToInt16(!currentMatch.goodDrivers))).Checked = true; ((RadioButton)radioRecommend.GetChildAt(currentMatch.wouldRecommend)).Checked = true; ((RadioButton)radioResult.GetChildAt(currentMatch.result)).Checked = true; comments.Text = currentMatch.additionalComments; }
public virtual void onCheckedChanged(RadioGroup group, int checkedId) { editText.Enabled = checkedId == R.id.radio0; }
public void list() { try { linearLayout1.RemoveAllViews(); using (var client = new WebClient()) { var json = client.DownloadString("http://joremtongwebsite.000webhostapp.com/quizall.php?quizID=" + quizID); dynamic jsonData = JsonConvert.DeserializeObject(json); foreach (dynamic jsonDatas in jsonData) { var choiceanswer = new TextView(this); choiceanswer.SetTextColor(Color.Black); choiceanswer.Text = "Sample"; choiceanswer.SetTypeface(Typeface.Default, TypefaceStyle.BoldItalic); choiceanswer.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 0); choiceanswer.SetPadding(20, 0, 20, 8); var qanswer = new TextView(this); qanswer.SetTextColor(Color.White); qanswer.SetTypeface(Typeface.Default, TypefaceStyle.BoldItalic); qanswer.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 0); qanswer.Text = jsonDatas["correctanswer"].ToString(); qanswer.SetPadding(20, 0, 20, 8); var layout = new LinearLayout(this); layout.Orientation = Orientation.Vertical; var layoutParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent); layoutParams.SetMargins(0, 0, 0, 20); layout.SetBackgroundResource(Resource.Drawable.layout_bg); layout.SetPadding(0, 0, 0, 0); layout.LayoutParameters = layoutParams; var question = new TextView(this); question.SetTextColor(Color.White); question.SetTypeface(Typeface.Default, TypefaceStyle.Bold); question.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 20); question.Text = jsonDatas["question"].ToString(); question.SetPadding(20, 0, 20, 8); var group = new RadioGroup(this); group.Orientation = Orientation.Vertical; LayoutParams rgroup = new LayoutParams(RadioGroup.LayoutParams.MatchParent, RadioGroup.LayoutParams.WrapContent); rgroup.SetMargins(5, 5, 5, 5); group.SetBackgroundColor(Color.Rgb(37, 36, 36)); var choice1 = new RadioButton(this); choice1.SetTextColor(Color.White); choice1.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 15); choice1.Text = jsonDatas["choiceone"].ToString(); choice1.Click += delegate { choiceanswer.Text = ""; choiceanswer.Text = choice1.Text; if (choiceanswer.Text == qanswer.Text) { total++; } }; choice1.SetPadding(20, 0, 20, 0); var choice2 = new RadioButton(this); choice2.SetTextColor(Color.White); choice2.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 15); choice2.Text = jsonDatas["choicetwo"].ToString(); choice2.Click += delegate { choiceanswer.Text = ""; choiceanswer.Text = choice2.Text; if (choiceanswer.Text == qanswer.Text) { total++; } }; choice2.SetPadding(20, 0, 20, 0); var choice3 = new RadioButton(this); choice3.SetTextColor(Color.White); choice3.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 15); choice3.Text = jsonDatas["choicethree"].ToString(); choice3.Click += delegate { choiceanswer.Text = ""; choiceanswer.Text = choice3.Text; if (choiceanswer.Text == qanswer.Text) { total++; } }; choice3.SetPadding(20, 0, 20, 0); var choice4 = new RadioButton(this); choice4.SetTextColor(Color.White); choice4.SetTextSize(global::Android.Util.ComplexUnitType.Dip, 15); choice4.Text = jsonDatas["choicefour"].ToString(); choice4.Click += delegate { choiceanswer.Text = ""; choiceanswer.Text = choice4.Text; if (choiceanswer.Text == qanswer.Text) { total++; } }; choice4.SetPadding(20, 0, 20, 0); layout.AddView(question); group.AddView(choice1); group.AddView(choice2); group.AddView(choice3); group.AddView(choice4); layout.AddView(group); layout.AddView(qanswer); layout.AddView(choiceanswer); linearLayout1.AddView(layout); } } } catch (Exception i) { Toast.MakeText(this, i.Message, ToastLength.Long).Show(); } }
/// <summary> /// 绑定RadioGroup组控件的数据源 /// </summary> /// <param name="edit">RadioGroup组控件</param> /// <param name="dataSource">数据源</param> /// <param name="bindField">取值字段</param> public static void BindingRadioEdit(RadioGroup edit, object dataSource, string bindField) { try { edit.DataBindings.Clear(); Binding b = new Binding("EditValue", dataSource, bindField); edit.DataBindings.Add(b); } catch (Exception ex) { Msg.ShowException(ex); } }
public void BuildEditGroupDialog(Group group) { GrouD = new Dialog(this); GrouD.SetContentView(Resource.Layout.MyDialog); GrouD.SetCancelable(true); // LinearLayout OAGroupsLayout = GrouD.FindViewById <LinearLayout>(Resource.Id.AbcDEF); OAGroupsLayout.Orientation = Orientation.Vertical; LinearLayout l2 = new LinearLayout(this); l2.LayoutParameters = new LinearLayout.LayoutParams(750, 850); l2.Orientation = Orientation.Vertical; l2.SetBackgroundResource(Resource.Drawable.BlackOutLine); // #region Title TitleLayout = new LinearLayout(this) { LayoutParameters = WrapContParams, Orientation = Orientation.Horizontal, }; TitleTV = new TextView(this) { LayoutParameters = WrapContParams, Text = "Edit Group ", TextSize = 40, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; TitleLayout.AddView(TitleTV); #endregion #region Location Defining LocationLayout = new LinearLayout(this) { LayoutParameters = WrapContParams, Orientation = Orientation.Horizontal, }; // LocTV = new TextView(this) { LayoutParameters = WrapContParams, Text = "Location: ", TextSize = 25, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; LocTV.SetTextColor(Color.DarkRed); // LocET = new TextInputEditText(this) { LayoutParameters = WrapContParams, Text = group.Location, TextSize = 20, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; TextInputLayout Loc = new TextInputLayout(this) { LayoutParameters = WrapContParams, Orientation = Orientation.Horizontal, }; LocationLayout.AddView(LocTV); LocationLayout.AddView(LocET); #endregion #region Age Defining AgeLayout = new LinearLayout(this) { LayoutParameters = WrapContParams, Orientation = Orientation.Horizontal, }; // AgeTV = new TextView(this) { LayoutParameters = WrapContParams, Text = "Age: ", TextSize = 25, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; AgeTV.SetTextColor(Color.DarkRed); // AgeET = new TextInputEditText(this) { LayoutParameters = WrapContParams, Text = group.age, TextSize = 20, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; AgeLayout.AddView(AgeTV); AgeLayout.AddView(AgeET); #endregion #region Level Defining LVLLayout = new LinearLayout(this) { LayoutParameters = WrapContParams, Orientation = Orientation.Horizontal, }; // LVLTV = new TextView(this) { LayoutParameters = WrapContParams, Text = "Group Level: ", TextSize = 25, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; LVLTV.SetTextColor(Color.DarkRed); // LVLET = new TextInputEditText(this) { LayoutParameters = WrapContParams, Text = group.geoupLevel, TextSize = 20, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; LVLLayout.AddView(LVLTV); LVLLayout.AddView(LVLET); #endregion #region Competetive defining CompRG = new RadioGroup(this); CompRG.Orientation = Orientation.Vertical; //Defining Competitive group Radio Button CompRB = new RadioButton(this) { Text = "Competetive", TextSize = 25, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; CompRB.SetTextColor(Android.Graphics.Color.DarkBlue); CompRB.Click += this.RB_Click; //Defining not Competetive group radio Button NotCompRB = new RadioButton(this) { Text = "Not Competetive", TextSize = 25, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; NotCompRB.SetTextColor(Android.Graphics.Color.DarkBlue); NotCompRB.Click += this.RB_Click; CompRG.AddView(CompRB); CompRG.AddView(NotCompRB); if (group.competetive) { CompRG.Check(CompRB.Id); } else { CompRG.Check(NotCompRB.Id); } #endregion #region Time And Date TimeAndDateLayout = new LinearLayout(this) { LayoutParameters = WrapContParams, Orientation = Orientation.Horizontal, }; TimeButton = new Button(this) { LayoutParameters = WrapContParams, Text = group.time, TextSize = 25, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; TimeButton.SetTextColor(Color.Red); TimeButton.Click += this.TimeButton_Click; TimeAndDateLayout.AddView(TimeButton); #endregion #region Save Button SaveLayout = new LinearLayout(this) { LayoutParameters = WrapContParams, Orientation = Orientation.Horizontal, }; SaveButton = new Button(this) { LayoutParameters = WrapContParams, Text = "Save", TextSize = 25, Typeface = Typeface.CreateFromAsset(Assets, "Katanf.ttf"), }; SaveButton.SetBackgroundColor(Color.BurlyWood); SaveButton.Click += this.SaveButton_Click; SaveLayout.AddView(SaveButton); #endregion l2.AddView(TitleLayout); l2.AddView(LocationLayout); l2.AddView(AgeLayout); l2.AddView(LVLLayout); l2.AddView(CompRG); l2.AddView(TimeAndDateLayout); l2.AddView(SaveLayout); OAGroupsLayout.AddView(l2); // GrouD.Show(); }
private void RenderGenreMapping() { int i = 0; foreach (GenreMapping map in _genreMapping) { LabelControl lblSource = new LabelControl(); lblSource.Name = "lblSource" + i; lblSource.Text = map.SourceGenre; lblSource.Dock = DockStyle.Fill; tableLayoutPanel1.Controls.Add(lblSource); ComboBoxEdit cbeGenre = new ComboBoxEdit(); cbeGenre.Name = "cbeGenre" + i; cbeGenre.Text = map.DestinationGenre; cbeGenre.Properties.Items.AddRange(_genreList); // Add the genre from the plugin into the combo box if not allready there. if (!_genreList.Contains(map.SourceGenre)) { cbeGenre.Properties.Items.Add(map.SourceGenre); } cbeGenre.Dock = DockStyle.Fill; tableLayoutPanel1.Controls.Add(cbeGenre); RadioGroup grpActions = new RadioGroup(); grpActions.Name = "grpActions" + i; grpActions.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(MapActionEnum.Ignore, "Ignore")); grpActions.Properties.Items.Add(new DevExpress.XtraEditors.Controls.RadioGroupItem(MapActionEnum.Map, "Map")); grpActions.SelectedIndex = map.Action == MapActionEnum.Ignore ? 0 : 1; grpActions.Properties.Columns = 2; grpActions.Height = 25; grpActions.Dock = DockStyle.Fill; tableLayoutPanel1.Controls.Add(grpActions); i++; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.comboBoxEdit3 = new DevExpress.XtraEditors.ComboBoxEdit(); this.label2 = new System.Windows.Forms.Label(); this.simpleButton1 = new DevExpress.XtraEditors.SimpleButton(); this.simpleButton2 = new DevExpress.XtraEditors.SimpleButton(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.panelControl2 = new DevExpress.XtraEditors.PanelControl(); this.radioGroup2 = new DevExpress.XtraEditors.RadioGroup(); this.panelControl1 = new DevExpress.XtraEditors.PanelControl(); this.radioGroup1 = new DevExpress.XtraEditors.RadioGroup(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.panelControl4 = new DevExpress.XtraEditors.PanelControl(); this.radioGroup4 = new DevExpress.XtraEditors.RadioGroup(); ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit3.Properties)).BeginInit(); this.groupBox4.SuspendLayout(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.panelControl2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup2.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).BeginInit(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.panelControl4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup4.Properties)).BeginInit(); this.SuspendLayout(); // // comboBoxEdit3 // this.comboBoxEdit3.EditValue = ""; this.comboBoxEdit3.Location = new System.Drawing.Point(73, 12); this.comboBoxEdit3.Name = "comboBoxEdit3"; this.comboBoxEdit3.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] { new DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)}); this.comboBoxEdit3.Properties.Items.AddRange(new object[] { "����ӵ�", "����ӵ�", "�������", "�������"}); this.comboBoxEdit3.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor; this.comboBoxEdit3.Size = new System.Drawing.Size(161, 21); this.comboBoxEdit3.TabIndex = 12; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(12, 15); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(55, 14); this.label2.TabIndex = 11; this.label2.Text = "��·����"; // // simpleButton1 // this.simpleButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.simpleButton1.DialogResult = System.Windows.Forms.DialogResult.OK; this.simpleButton1.Location = new System.Drawing.Point(12, 232); this.simpleButton1.Name = "simpleButton1"; this.simpleButton1.Size = new System.Drawing.Size(75, 23); this.simpleButton1.TabIndex = 14; this.simpleButton1.Text = "ȷ��"; // // simpleButton2 // this.simpleButton2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.simpleButton2.DialogResult = System.Windows.Forms.DialogResult.No; this.simpleButton2.Location = new System.Drawing.Point(134, 232); this.simpleButton2.Name = "simpleButton2"; this.simpleButton2.Size = new System.Drawing.Size(75, 23); this.simpleButton2.TabIndex = 15; this.simpleButton2.Text = "ȡ��"; // // groupBox4 // this.groupBox4.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox4.Controls.Add(this.groupBox1); this.groupBox4.Controls.Add(this.panelControl1); this.groupBox4.Controls.Add(this.radioGroup1); this.groupBox4.ForeColor = System.Drawing.Color.RoyalBlue; this.groupBox4.Location = new System.Drawing.Point(12, 53); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(218, 80); this.groupBox4.TabIndex = 16; this.groupBox4.TabStop = false; this.groupBox4.Text = "����ѡ��"; // // groupBox1 // this.groupBox1.Anchor = System.Windows.Forms.AnchorStyles.None; this.groupBox1.Controls.Add(this.panelControl2); this.groupBox1.Controls.Add(this.radioGroup2); this.groupBox1.ForeColor = System.Drawing.Color.RoyalBlue; this.groupBox1.Location = new System.Drawing.Point(10, 80); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(141, 80); this.groupBox1.TabIndex = 17; this.groupBox1.TabStop = false; this.groupBox1.Text = "����ѡ��"; // // panelControl2 // this.panelControl2.Appearance.BackColor = System.Drawing.Color.Red; this.panelControl2.Appearance.Options.UseBackColor = true; this.panelControl2.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple; this.panelControl2.Location = new System.Drawing.Point(17, 38); this.panelControl2.Name = "panelControl2"; this.panelControl2.Size = new System.Drawing.Size(67, 12); this.panelControl2.TabIndex = 2; this.panelControl2.Text = "panelControl2"; // // radioGroup2 // this.radioGroup2.EditValue = "1"; this.radioGroup2.Location = new System.Drawing.Point(90, 12); this.radioGroup2.Name = "radioGroup2"; this.radioGroup2.Properties.Appearance.BackColor = System.Drawing.Color.Transparent; this.radioGroup2.Properties.Appearance.Options.UseBackColor = true; this.radioGroup2.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; this.radioGroup2.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] { new DevExpress.XtraEditors.Controls.RadioGroupItem("1", "ȫ�����"), new DevExpress.XtraEditors.Controls.RadioGroupItem("2", "�����·����")}); this.radioGroup2.Size = new System.Drawing.Size(119, 62); this.radioGroup2.TabIndex = 3; // // panelControl1 // this.panelControl1.Appearance.BackColor = System.Drawing.Color.Red; this.panelControl1.Appearance.Options.UseBackColor = true; this.panelControl1.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple; this.panelControl1.Location = new System.Drawing.Point(17, 38); this.panelControl1.Name = "panelControl1"; this.panelControl1.Size = new System.Drawing.Size(67, 12); this.panelControl1.TabIndex = 2; this.panelControl1.Text = "panelControl1"; this.panelControl1.Paint += new System.Windows.Forms.PaintEventHandler(this.panelControl1_Paint); // // radioGroup1 // this.radioGroup1.EditValue = "2"; this.radioGroup1.Location = new System.Drawing.Point(99, 12); this.radioGroup1.Name = "radioGroup1"; this.radioGroup1.Properties.Appearance.BackColor = System.Drawing.Color.Transparent; this.radioGroup1.Properties.Appearance.Options.UseBackColor = true; this.radioGroup1.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; this.radioGroup1.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] { new DevExpress.XtraEditors.Controls.RadioGroupItem("0", "ȫ�����"), new DevExpress.XtraEditors.Controls.RadioGroupItem("2", "�����·����")}); this.radioGroup1.Size = new System.Drawing.Size(113, 62); this.radioGroup1.TabIndex = 3; this.radioGroup1.SelectedIndexChanged += new System.EventHandler(this.radioGroup1_SelectedIndexChanged); // // groupBox2 // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox2.Controls.Add(this.panelControl4); this.groupBox2.Controls.Add(this.radioGroup4); this.groupBox2.ForeColor = System.Drawing.Color.RoyalBlue; this.groupBox2.Location = new System.Drawing.Point(12, 139); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(218, 80); this.groupBox2.TabIndex = 18; this.groupBox2.TabStop = false; this.groupBox2.Text = "��������"; // // panelControl4 // this.panelControl4.Appearance.BackColor = System.Drawing.Color.Red; this.panelControl4.Appearance.Options.UseBackColor = true; this.panelControl4.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.Simple; this.panelControl4.Location = new System.Drawing.Point(17, 38); this.panelControl4.Name = "panelControl4"; this.panelControl4.Size = new System.Drawing.Size(67, 12); this.panelControl4.TabIndex = 2; this.panelControl4.Text = "panelControl4"; this.panelControl4.Paint += new System.Windows.Forms.PaintEventHandler(this.panelControl4_Paint); // // radioGroup4 // this.radioGroup4.EditValue = "1"; this.radioGroup4.Location = new System.Drawing.Point(99, 12); this.radioGroup4.Name = "radioGroup4"; this.radioGroup4.Properties.Appearance.BackColor = System.Drawing.Color.Transparent; this.radioGroup4.Properties.Appearance.Options.UseBackColor = true; this.radioGroup4.Properties.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder; this.radioGroup4.Properties.Items.AddRange(new DevExpress.XtraEditors.Controls.RadioGroupItem[] { new DevExpress.XtraEditors.Controls.RadioGroupItem("1", "ʵ�ü���"), new DevExpress.XtraEditors.Controls.RadioGroupItem("2", "��������")}); this.radioGroup4.Size = new System.Drawing.Size(113, 62); this.radioGroup4.TabIndex = 3; this.radioGroup4.SelectedIndexChanged += new System.EventHandler(this.radioGroup4_SelectedIndexChanged); // // ShortTform // this.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(184)))), ((int)(((byte)(210)))), ((int)(((byte)(248))))); this.Appearance.Options.UseBackColor = true; this.ClientSize = new System.Drawing.Size(245, 261); this.Controls.Add(this.groupBox2); this.Controls.Add(this.simpleButton2); this.Controls.Add(this.simpleButton1); this.Controls.Add(this.comboBoxEdit3); this.Controls.Add(this.label2); this.Controls.Add(this.groupBox4); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ShortTform"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "��·����"; ((System.ComponentModel.ISupportInitialize)(this.comboBoxEdit3.Properties)).EndInit(); this.groupBox4.ResumeLayout(false); this.groupBox1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.panelControl2)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup2.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.panelControl1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup1.Properties)).EndInit(); this.groupBox2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.panelControl4)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.radioGroup4.Properties)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
public void AddEvent() { LayoutControl lcMain = _data.FrmMain.Controls.Find("lcMain", true)[0] as LayoutControl; RadioGroup radioEdit1 = new RadioGroup(); object[] itemValues = new object[] { 0, 1 }; string[] itemDescriptions = new string[] { "Theo tháng", "Theo lần phát sinh" }; for (int i = 0; i < itemValues.Length; i++) { radioEdit1.Properties.Items.Add(new RadioGroupItem(itemValues[i], itemDescriptions[i])); } radioEdit1.BackColor = System.Drawing.Color.Transparent; radioEdit1.Properties.Columns = 1; radioEdit1.BorderStyle = BorderStyles.NoBorder; radioEdit1.Name = "radioEdit1"; LayoutControlItem item6 = GetElementByName(lcMain, "InputDate"); item6.TextVisible = false; LayoutControlItem item7 = GetElementByName(lcMain, "KyBKBRTTDB"); item7.TextVisible = false; LayoutControlItem item5 = new LayoutControlItem(lcMain, radioEdit1); item5.Parent = lcMain.Root; item5.Move(item7, InsertType.Left); item6.Move(item5, InsertType.Right); item7.Move(item6, InsertType.Top); item5.TextVisible = false; item5.Width = 120; item5.Height = 48; item5.Name = "radioEdit1"; item5.AppearanceItemCaption.Options.UseBackColor = false; _data.FrmMain.Controls.Add(lcMain); item5 = lcMain.Root.AddItem(); this._data.FrmMain.Load += new EventHandler(Frm_Load); radioEdit1.SelectedIndexChanged += new EventHandler(radioEdit1_SelectedIndexChanged); radioEdit1_SelectedIndexChanged(null, null); SpinEdit sepKy = _data.FrmMain.Controls.Find("KyBKBRTTDB", true)[0] as SpinEdit; DateEdit dtmInputDate = _data.FrmMain.Controls.Find("InputDate", true)[0] as DateEdit; sepKy.EditValueChanged += new EventHandler(sepKy_EditValueChanged); dtmInputDate.EditValueChanged += new EventHandler(dtmInputDate_EditValueChanged); }