Exemplo n.º 1
0
 private void UpdateSuggestions() {
     var source = new AutoCompleteStringCollection();
     source.AddRange(SpeechControll.Keywords.ToArray());
     source.AddRange(MusicCollection.GetAllSongKeywords());
     KeyInput.AutoCompleteCustomSource.Clear();
     KeyInput.AutoCompleteCustomSource = source;
     KeyInput.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     KeyInput.AutoCompleteSource = AutoCompleteSource.CustomSource;
 }
Exemplo n.º 2
0
        public void initGui()
        {
            clg = new dataHandler.catalog(timeout: gpExtension.timeout);
            keyWords = new AutoCompleteStringCollection();
            keyWords.AddRange(  clg.getKeyWords().ToArray() );
            keywordTxt.AutoCompleteSource = AutoCompleteSource.CustomSource;
            keywordTxt.AutoCompleteCustomSource = keyWords;
            gdiThemes = clg.getGDIthemes();
            gdiThemes.Insert(0, "");
            GDIthemeCbx.DataSource = gdiThemes;

            orgNames = clg.getOrganisations();
            orgNames.Insert(0, "");
            orgNameCbx.DataSource = orgNames;

            dataBronnen = clg.getSources();
            List<string> bronnen = dataBronnen.Select(c => c.Key).ToList();
            bronnen.Insert(0, "");
            bronCatCbx.DataSource = bronnen;

            dataTypes = clg.dataTypes;
            List<string> dtypes = dataTypes.Select(c => c.Key).ToList();
            dtypes.Insert(0, "");
            typeCbx.DataSource = dtypes;

            inspKeyw = clg.inspireKeywords();
            inspKeyw.Insert(0, "");
            INSPIREthemeCbx.DataSource = inspKeyw;

            INSPIREannexCbx.DataSource = clg.inpireAnnex;

            INSPIREserviceCbx.DataSource = clg.inspireServiceTypes;

            filterResultsCbx.SelectedIndex = 0;
        }
Exemplo n.º 3
0
        /// <summary>Reloads the repo's objects tree.</summary>
        public void Reload()
        {
            // todo: task exception handling
            Cancel();
            _cancelledTokenSource = new CancellationTokenSource();
            var token = _cancelledTokenSource.Token;
            var tasks = rootNodes.Select(r => r.ReloadTask(token)).ToArray();
            Task.Factory.ContinueWhenAll(tasks,
                (t) =>
                {
                    if (!t.All(r => r.Status == TaskStatus.RanToCompletion))
                    {
                        return;
                    }
                    if (token.IsCancellationRequested)
                    {
                        return;
                    }
                    BeginInvoke(new Action(() =>
                    {
                        var autoCompletionSrc = new AutoCompleteStringCollection();
                        autoCompletionSrc.AddRange(
                            _branchFilterAutoCompletionSrc.ToArray());

                        txtBranchFilter.AutoCompleteCustomSource = autoCompletionSrc;
                    }));
                }, _cancelledTokenSource.Token);
            tasks.ToList().ForEach(t => t.Start());
        }
		private void SetupElements(NationSelectForm nationSelectForm, Nation selectedNation, int numberOfCrewSlots)
		{
			_nationSelectForm = nationSelectForm;
			_selectedNation = selectedNation;
			_numberOfCrewSlots = numberOfCrewSlots;
			_vehicleType = new VehicleType();	// Crappy default value
			_crewSlotData = Helpers.LoadCrewSlotDataFromFile(CrewSlotDataFileName) ?? new List<CrewSlotData>();	// Load from file, if null is returned, creates a new (empty) list

			if (_crewSlotData.Count < 1) // Happens only when nothing comes from reading the file with data.
			{
				_crewSlotData.Add(new CrewSlotData(_selectedNation));
			}

			#region Setup fields for form controls
			List<string> vehicleNames = Helpers.LoadVehicleDataFromJson(Helpers.GetVehicleJsonDataForNation(_selectedNation)).OrderBy(v => v.VehicleName).Select(v => v.VehicleName).ToList();
			_faytVehicleSource = new AutoCompleteStringCollection();
			_faytVehicleSource.AddRange(vehicleNames.ToArray());

			List<string> vehicleTypes = Helpers.LoadVehicleTypesDataFromJson(Helpers.GetVehicleTypesJsonData()).OrderBy(t => t.VehicleTypeLongName).Select(t => t.VehicleTypeLongName).ToList();
			_faytVehicleTypeSource = new AutoCompleteStringCollection();
			_faytVehicleTypeSource.AddRange(vehicleTypes.ToArray());

			_crewSlotConfigurations = new List<CrewSlotConfiguration>();
			_crewSlotGroupBoxes = new Dictionary<int, GroupBox>();
			_crewNameComboBoxes = new Dictionary<int, ComboBox>();
			_crewTrainedMembersNumericScrollers = new Dictionary<int, NumericUpDown>();
			_crewVehicleTypeComboBoxes = new Dictionary<int, ComboBox>();
			#endregion

			SetFormHeight();
			Helpers.ChangeBackground(this, selectedNation);
			PopulateFormControls();
		}
Exemplo n.º 5
0
        public MainWindow()
        {
            InitializeComponent();

            using (var db = new MySqlContext())
            {
                var permissions = from a in db.Permissions
                                  select a.Name;
                this.checkedListBox_permissions.Items.AddRange(permissions.ToArray());
                this.checkedListBox_modificar_permissions.Items.AddRange(permissions.ToArray());

                var users = from b in db.LoginModels
                            select b.User;
                this.checkedListBox_users.Items.AddRange(users.ToArray());
                this.checkedListBox_modificar_users.Items.AddRange(users.ToArray());

                var roles = from r in db.Roles
                            select r.Name;
                AutoCompleteStringCollection accl = new AutoCompleteStringCollection();
                accl.AddRange(roles.ToArray());

                txt_rol_nombre.AutoCompleteMode = AutoCompleteMode.Suggest;
                txt_rol_nombre.AutoCompleteCustomSource = accl;
                txt_rol_nombre.AutoCompleteSource = AutoCompleteSource.CustomSource;

                txt_modificar_nombre.AutoCompleteMode = AutoCompleteMode.Suggest;
                txt_modificar_nombre.AutoCompleteCustomSource = accl;
                txt_modificar_nombre.AutoCompleteSource = AutoCompleteSource.CustomSource;

            }
        }
 public UC_mailSearchWeb()
 {
     InitializeComponent();
     m_identifier = Page.MailSearchWeb;
     m_next = Page.Gesture;
     m_previous = Page.Action;
     lbl_icon.Text = Translation.GetText("C_SearchOpenWeb_lbl_icon");
     m_timer = new Timer();
     m_timer.Interval = 2000;
     m_timer.Tick += new EventHandler(m_timer_Tick);
     m_webIconExtractor = new Favicon();
     m_webIconExtractor.IconObatined += new Favicon.DlgIconObtained(IconObtained);
     m_autoCompleteSearchItems = new AutoCompleteStringCollection();
     m_autoCompleteSearchItems.AddRange(new string[] {
         "http://www.google.com/search?&q=(*)",
         "http://en.wikipedia.org/w/index.php?&search=(*)",
         "http://maps.google.com/maps?q=(*)",
         "http://translate.google.com/#auto|en|(*)",
         "http://www.last.fm/search?q=(*)",
         "http://www.imdb.com/find?s=all&q=(*)",                
         "http://search.yahoo.com/search?p=(*)",
         "http://www.bing.com/search?q=(*)",                
         "http://search.seznam.cz/?q=(*)",
         "http://www.slovnik.seznam.cz/?q=(*)&lang=en_cz",                
         "http://www.mapy.cz/?query=(*)",
         "http://www.csfd.cz/hledani-filmu-hercu-reziseru-ve-filmove-databazi/?search=(*)"
     });
 }
        private void AddRestrictForm_Load(object sender, EventArgs e)
        {
            AutoCompleteStringCollection c = new AutoCompleteStringCollection();
            c.AddRange(this.SuggestProperties);
            txtPropertyName.AutoCompleteCustomSource = c;

            AutoCompleteStringCollection c1 = new AutoCompleteStringCollection();
            c1.AddRange(this.SuggestRoles);
            txtRole.AutoCompleteCustomSource = c1;

            if (Xml != null)
            {
                string type = Xml.GetAttribute("Type");
                if (type.Equals("PropertyEquals",StringComparison.CurrentCulture))
                {
                    rbPropertyEquals.Checked = true;
                    txtPropertyName.Text = Xml.GetAttribute("Property");
                    txtPropertyValue.Text = Xml.GetAttribute("Value");
                }
                else if (type.Equals("RoleContain", StringComparison.CurrentCulture))
                {
                    rbRoleContain.Checked = true;
                    txtRole.Text = Xml.GetAttribute("Role");
                }
                else
                {
                    rbDB.Checked = true;
                    txtSQL.Text = Xml.InnerText.Trim();
                }
            }
        }
Exemplo n.º 8
0
 private void AutoComplete(TextBox txtBox, string[] items)
 {
     var itemCollection = new AutoCompleteStringCollection();
     itemCollection.AddRange(items);
     txtBox.AutoCompleteCustomSource = itemCollection;
     txtBox.AutoCompleteMode = AutoCompleteMode.Suggest;
     txtBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
 }
Exemplo n.º 9
0
 private void LoadCustomer()
 {
     var biz = new CustomerBiz();
     var items = biz.LoadAllCustomerName();
     AutoCompleteStringCollection list = new AutoCompleteStringCollection();
     list.AddRange(items.ToArray());
     textCustomerName.AutoCompleteCustomSource = null;
     textCustomerName.AutoCompleteCustomSource = list;
 }
Exemplo n.º 10
0
 private void setupAutoComplete() { 
     // List
     userSource = new AutoCompleteStringCollection();
     userSource.AddRange(brokerManager.listUsers());
     // AutoComplete properties
     txtBoxUser.AutoCompleteCustomSource = userSource;
     txtBoxUser.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     txtBoxUser.AutoCompleteSource = AutoCompleteSource.CustomSource;
 }
		/// ------------------------------------------------------------------------------------
		public AutoCompleteStringCollection GetAutoCompleteNames()
		{
			var list = (_autoCompleteProvider != null ?
				_autoCompleteProvider.GetValuesForKey("person") : new List<string>(0));

			var autoCompleteValues = new AutoCompleteStringCollection();
			autoCompleteValues.AddRange(list.ToArray());
			return autoCompleteValues;
		}
Exemplo n.º 12
0
 private void Form1_Load(object sender, EventArgs e)
 {
     List<string> allPaises = getPaises();
     textBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     AutoCompleteStringCollection accl = new AutoCompleteStringCollection();            
     accl.AddRange(allPaises.ToArray());
     textBox1.AutoCompleteCustomSource = accl;
     textBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
 }
Exemplo n.º 13
0
 private void kryptonTextBox1_Enter(object sender, EventArgs e)
 {
     if (deafultSearchText == this.searchTextbox.Text)
         this.searchTextbox.Text = String.Empty;
     this.searchTextbox.StateCommon.Content.Color1 = SystemColors.WindowText;
     AutoCompleteStringCollection col = new AutoCompleteStringCollection();
     col.AddRange(DataService.Create().GetAllSearchWords().ToArray());
     this.searchTextbox.AutoCompleteCustomSource = col;
 }
Exemplo n.º 14
0
        private void ConfigureAutoComplete()
        {
            var autoComplete = new AutoCompleteStringCollection();
            autoComplete.AddRange(_dc.EntryEvents.ToArray());

            txtEventName.AutoCompleteMode = AutoCompleteMode.Suggest;
            txtEventName.AutoCompleteSource = AutoCompleteSource.CustomSource;
            txtEventName.AutoCompleteCustomSource = autoComplete;

        }
Exemplo n.º 15
0
        private void LoadAutoComplete()
        {
            List<Processo> processos = (new ProcessoDB()).LoadAll();
            // Create the list to use as the custom source. 
            var source = new AutoCompleteStringCollection();
            source.AddRange((from p in processos select p.NumeroProcesso).ToArray<string>());
            // Create and initialize the text box.
            _textBoxNumeroProcesso.AutoCompleteCustomSource = source;
            _textBoxNumeroProcesso.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            _textBoxNumeroProcesso.AutoCompleteSource = AutoCompleteSource.CustomSource;

            List<Contacto> contactos = (new ContactoDB()).LoadAll();
            // Create the list to use as the custom source. 
            source = new AutoCompleteStringCollection();
            source.AddRange((from c in contactos select c.Nome).ToArray<string>());
            // Create and initialize the text box.
            _textBoxContacto.AutoCompleteCustomSource = source;
            _textBoxContacto.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            _textBoxContacto.AutoCompleteSource = AutoCompleteSource.CustomSource;
            
            List<Instancia> instancias = (new InstanciaDB()).LoadAll();
            // Create the list to use as the custom source. 
            source = new AutoCompleteStringCollection();
            source.AddRange((from i in instancias select i.Nome).ToArray<string>());
            // Create and initialize the text box.
            _textBoxPesquisaInstancia.AutoCompleteCustomSource = source;
            _textBoxPesquisaInstancia.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            _textBoxPesquisaInstancia.AutoCompleteSource = AutoCompleteSource.CustomSource;
            
            List<Capa> capas = (new CapaDB()).LoadAll();
            // Create the list to use as the custom source. 
            source = new AutoCompleteStringCollection();
            source.AddRange((from c in capas select c.Nome).ToArray<string>());
            // Create and initialize the text box.
            _textBoxPesquisaCapa.AutoCompleteCustomSource = source;
            _textBoxPesquisaCapa.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            _textBoxPesquisaCapa.AutoCompleteSource = AutoCompleteSource.CustomSource;

            ///CAPAS ComboBox 
            BindingSource bsCapas = new BindingSource();
            bsCapas.DataSource = capas;
            _comboBoxCapa.ValueMember = "ID";
            _comboBoxCapa.DisplayMember = "Nome";
            _comboBoxCapa.DataSource = bsCapas;

            ///CAPAS ComboBox 
            BindingSource bsInstancias = new BindingSource();
            bsInstancias.DataSource = instancias;
            _comboBoxInstancia.ValueMember = "ID";
            _comboBoxInstancia.DisplayMember = "Nome";
            _comboBoxInstancia.DataSource = bsInstancias;

        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Text += Version;
            var siteUrls = _sharepointService.GetAllSiteUrls().ToArray();
            var aSiteNames = new AutoCompleteStringCollection();
            aSiteNames.AddRange(siteUrls);

            txtSite.AutoCompleteSource = AutoCompleteSource.CustomSource;
            txtSite.AutoCompleteCustomSource = aSiteNames;
            txtSite.AutoCompleteMode = AutoCompleteMode.Suggest;
        }
Exemplo n.º 17
0
 private void DevSiteForm_Load(object sender, EventArgs e)
 {
     AutoCompleteStringCollection c = new AutoCompleteStringCollection();
     c.AddRange(MainForm.Storage.GetPropertyValueNames("DevLoginAP"));
     txtUser.AutoCompleteCustomSource = c;
     
     txtAP.Text = MainForm.Storage.GetProperty("DevLastLoginAP");
     cboContract.Text = MainForm.Storage.GetProperty("DevLastLoginContract");
     txtUser.Text = MainForm.Storage.GetProperty("DevLastLoginName");
     txtPassword.Text = MainForm.Storage.GetProperty("DevLastLoginPassword");
     chkAutoLogin.Checked = (MainForm.Storage.GetProperty("DevAutoLogin") == "true");
 }
Exemplo n.º 18
0
		private void NewHotkeyWindow_Load(object sender, EventArgs e)
		{
			var source = new AutoCompleteStringCollection();
			source.AddRange(Global.Config.HotkeyBindings.Select(x => x.DisplayName).ToArray());

			SearchBox.AutoCompleteCustomSource = source;
			SearchBox.AutoCompleteSource = AutoCompleteSource.CustomSource;

			AutoTabCheckBox.Checked = Global.Config.HotkeyConfigAutoTab;
			DoTabs();
			DoFocus();
		}
Exemplo n.º 19
0
 public SearchTypeDialog(IDictionary<string, TypeVisualUnit> units)
 {
     InitializeComponent();
     lblError.Visible = false;
     this.units = units;
     var source = new AutoCompleteStringCollection();
     string[] stringArray = new string[units.Count];
     units.Keys.CopyTo(stringArray, 0);
     source.AddRange(stringArray);
     tbSearch.AutoCompleteCustomSource = source;
     tbSearch.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     tbSearch.AutoCompleteSource = AutoCompleteSource.CustomSource;
 }
Exemplo n.º 20
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            bot.OnErrorOccured += BotOnOnErrorOccured;
            var source = new AutoCompleteStringCollection();
            source.AddRange(bot.GetUserDefinedCommandList().ToArray());
            txtCommandSearchField.AutoCompleteCustomSource = source;
            txtCommandSearchField.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            txtCommandSearchField.AutoCompleteSource = AutoCompleteSource.CustomSource;
            txtCommandSearchField.Visible = true;

            var screen = Screen.FromPoint(this.Location);
            this.Location = new Point(screen.WorkingArea.Right - this.Width, screen.WorkingArea.Bottom - this.Height);
        }
Exemplo n.º 21
0
 public MainForm()
 {
     InitializeComponent();
     _bs.DataSource = Logger.LogList;
     lstLogs.DataSource = _bs;
     PeriodicTaskFactory.Start(() => { _bs.ResetBindings(false); }, 2000, maxIterations: 10);
     //var list =  Properties.Settings.Default.UrlHistory.Cast<string>().ToList();
     _urlArray = new AutoCompleteStringCollection();
     _urlArray.AddRange(Settings.Default.UrlHistory.Cast<string>().ToArray());
     //urlArray.Cast<string>().ToList().ForEach(Console.WriteLine);
     txtCleanReaderUrl.AutoCompleteCustomSource = _urlArray;
     rbtnIE.Checked = true;
 }
Exemplo n.º 22
0
        private void Initialize()
        {
            // Init Clinic combobox
            var clinic = this._clinicRepo.GetAll();
            this.bdsClinic.DataSource = clinic;
            this.cboClinic.SelectedValue = AppContext.CurrentClinic.Id;

            // Init AutoCompleteSource
            var medicinesName = _medicineRepo.GetMedicinesName();
            var completeSource = new AutoCompleteStringCollection();
            completeSource.AddRange(medicinesName.ToArray());
            txtMedicine.AutoCompleteCustomSource = completeSource;
        }
Exemplo n.º 23
0
 void LoadDatabaseStoredProcedures()
 {
     StoredProcedureBusiness spData = new StoredProcedureBusiness();
     var splist = spData.GetStoredProcedureList(AppTimeConfiguration.MainServer);
     if (splist != null)
     {
         txtspname.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
         txtspname.AutoCompleteSource = AutoCompleteSource.CustomSource;
         var autosource = new AutoCompleteStringCollection();
         autosource.AddRange(splist.Select(x => x.SPName).ToArray());
         txtspname.AutoCompleteCustomSource = autosource;
     }
 }
 private void textBox1_TextChanged(object sender, EventArgs e)
 {
     TextBox t = sender as TextBox;
     if (t != null)
     {
         // say you want to do a search when user types 3 or more chars
         if (t.Text.Length >= 1)
         {
             AutoCompleteStringCollection Collection = new AutoCompleteStringCollection();
             Collection.AddRange((from x in MapNames where x.StartsWith(t.Text) select x).ToArray());
             this.MapNameBox.AutoCompleteCustomSource = Collection;
         }
     }
 }
Exemplo n.º 25
0
        public frmBankOperation(int id, FlagOperation flagOperation)
        {
            InitializeComponent();
            this.flagOperation = flagOperation;

            this.Text = flagOperation == FlagOperation.Debet ? "Приход" : "Расход";
            operationTypeBindingSource.DataSource = new OperationTypesRepository().GetOperationTypes(flagOperation, BankOrKassa.Bank);
            comboBox1.SelectedIndex = -1;
            docTypeBindingSource.DataSource = new DocumentTypeRepository().GetDocTypes();
            comboBox2.SelectedIndex = -1;

            var oper = (id == 0) ?
               new BankOperation()
               {
                   Id = 0,
                   FlagOperation = flagOperation,
                   OperationType = null,
                   DocType = null,
                   DocNum = "",
                   DocDate = DateTime.Now,
                   Contractor = "",
                   Summa = 0M,
                   Osnovanie = "",
                   DateCreated = DateTime.Now,
                   DateModified = DateTime.Now
               } :
               new BankOperationsRepository().GetBankOperationId(id);

            bankOperationBindingSource.DataSource = oper;
            if (oper.OperationType != null)
            {
                operationTypeBindingSource.Position = ((List<OperationType>)operationTypeBindingSource.DataSource).FindIndex(c => c.Id == oper.OperationType.Id);
                comboBox1.SelectedIndex = operationTypeBindingSource.Position;
            }
            if (oper.DocType != null)
            {
                docTypeBindingSource.Position = ((List<DocumentType>)docTypeBindingSource.DataSource).FindIndex(c => c.Id == oper.DocType.Id);
                comboBox2.SelectedIndex = docTypeBindingSource.Position;
            }

            txtContractor.AutoCompleteMode = AutoCompleteMode.Suggest;
            txtContractor.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection acsc = new AutoCompleteStringCollection();
            //foreach(var item in new ContractorRepository().GetContractors("").Select(c=>c.Name))
            acsc.AddRange(new ContractorRepository().GetContractors("").Select(c => c.Name).ToArray());
            txtContractor.AutoCompleteCustomSource = acsc;
        }
Exemplo n.º 26
0
        public void AutoPopulateAutoFill()
        {
            var source = new AutoCompleteStringCollection();
            source.AddRange(Database.GetDistinctCityList().ToArray());
            txtCity.AutoCompleteCustomSource = source;

            source = new AutoCompleteStringCollection();
            source.AddRange(Database.GetDistinctZipList().ToArray());
            txtZip.AutoCompleteCustomSource = source;

            source = new AutoCompleteStringCollection();
            source.AddRange(Database.GetDistinctFirstList().ToArray());
            txtFirstName.AutoCompleteCustomSource = source;

            source = new AutoCompleteStringCollection();
            source.AddRange(Database.GetDistinctLastList().ToArray());
            txtLastName.AutoCompleteCustomSource = source;
        }
        private void ItemValueHistory_Load(object sender, EventArgs e)
        {
            try
            {
                GraphPane pane = priceHistoryGraph.GraphPane;
                pane.Title.Text = "Item price history";

                _recentItems = UserAccount.CurrentGroup.Settings.RecentItems;
                _recentItems.Sort();
                AutoCompleteStringCollection items = new AutoCompleteStringCollection();
                items.AddRange(_recentItems.ToArray());
                txtItem.AutoCompleteCustomSource = items;
                txtItem.AutoCompleteSource = AutoCompleteSource.CustomSource;
                txtItem.AutoCompleteMode = AutoCompleteMode.Suggest;
                txtItem.Leave += new EventHandler(txtItem_Leave);
                txtItem.KeyDown += new KeyEventHandler(txtItem_KeyDown);
                txtItem.Tag = 0;
                txtItem.Text = "";

                EveDataSet.mapRegionsDataTable regions = Regions.GetAllRegions();
                EveDataSet.mapRegionsRow allRegions = regions.NewmapRegionsRow();
                allRegions.regionID = 0;
                allRegions.regionName = "Any Region";
                regions.AddmapRegionsRow(allRegions);
                cmbRegion.DataSource = regions;
                cmbRegion.ValueMember = "regionID";
                cmbRegion.DisplayMember = "regionName";
                cmbRegion.SelectedValue = 0;
                cmbRegion.SelectedValueChanged += new EventHandler(cmbRegion_SelectedValueChanged);
            }
            catch (Exception ex)
            {
                EMMAException emmaEx = ex as EMMAException;
                if (emmaEx == null)
                {
                    emmaEx = new EMMAException(ExceptionSeverity.Error, "Problem loading grid calculator: " +
                        ex.Message, ex);
                }
                MessageBox.Show("Problem loading grid calculator: " + ex.Message, "Error",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public void init()
        {
            var listProfileConfig = UserFactory.GetProfileConfigByUserId(_userInfo.UserID);
            foreach (var profileConfig in listProfileConfig)
            {
                if (profileConfig.Type == (int)ProfileConfig.TypeCode)
                {
                    txtTypeCode.Text = profileConfig.Value;
                    txtTypeName.Text = TypeFactory.FindByCode(profileConfig.Value).TypeName;
                    continue;
                }
                if (profileConfig.Type == (int)ProfileConfig.CustomUnit)
                {
                    txtCustomCode.Text = profileConfig.Value;
                    txtCustomName.Text = CustomsFacory.FindByCode(profileConfig.Value).CustomsName;
                }
                if (profileConfig.Type == (int)ProfileConfig.OverdueDate)
                {
                    txtOverdueVehicleDate.Text = profileConfig.Value;
                }
                if (profileConfig.Type == (int)ProfileConfig.SuperiorCompany)
                {
                    txtSuperiorCompany.Text = profileConfig.Value;
                }
            }

            //Autocomplete
            var autoType = new AutoCompleteStringCollection();
            var lstAutoType = TypeFactory.getAllType().Select(t=>t.TypeCode).ToArray();
            autoType.AddRange(lstAutoType);
            txtTypeCode.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            txtTypeCode.AutoCompleteSource = AutoCompleteSource.CustomSource;
            txtTypeCode.AutoCompleteCustomSource = autoType;

            var autoCustom = new AutoCompleteStringCollection();
            var lstAutoCustom = CustomsFacory.getAll().Select(t => t.CustomsCode).ToArray();
            autoCustom.AddRange(lstAutoCustom);
            txtCustomCode.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            txtCustomCode.AutoCompleteSource = AutoCompleteSource.CustomSource;
            txtCustomCode.AutoCompleteCustomSource = autoCustom;
   
        }
Exemplo n.º 29
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // Creo el autocompletado con una tabla de nombres
            AutoCompleteStringCollection nombres = new AutoCompleteStringCollection();
            nombres.AddRange(new string[] { "Dani", "Pablo", "Manuel", "Miguel", "Jesus", "Julio", "Jose Luis", "Samuel", "Alvaro", "Mancilla", "Quini", "Jorge", "David", "Piniella", "Jaime", "Juan" });
            // Cambio las propiedades del text box necesarias para poder usar el autocompletado
             tb1.AutoCompleteCustomSource = nombres;
             tb1.AutoCompleteMode =AutoCompleteMode.SuggestAppend;
             tb1.AutoCompleteSource = AutoCompleteSource.CustomSource;

             tb2.PasswordChar = '*';
             tb2.TextAlign = HorizontalAlignment.Center;

             tb3.CharacterCasing = CharacterCasing.Upper;
             tb3.Multiline = true;
             tb3.ScrollBars = ScrollBars.Both;

             tb3.Paste("Hola");
             txtEvento.Text ="TextAlignChanged";
        }
Exemplo n.º 30
0
        public ManualDataInput(ref Helpers.LicenseDataBase licData, ref MySettings Settings)
        {
            InitializeComponent();

            txtProduct.Text = "[NAU-1504] CETerm for Windows CE 6.0 / 5.0 / CE .NET";
            _licenseDataBase = licData;
            attachErrorProvider();
            btnSave.Enabled = false;

            // Create the list to use as the custom source.
            var source = new AutoCompleteStringCollection();
            source.AddRange(_licenseDataBase.productList);
            txtProduct.AutoCompleteCustomSource = source;
            txtProduct.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            txtProduct.AutoCompleteSource = AutoCompleteSource.CustomSource;

            //prefill
            _settings = Settings;
            //settings.load();
            txtReceivedBy.Text = _settings.ExchangeUsername;
        }