コード例 #1
0
        static void Main()
        {
            if (Directory.Exists(GetCheetahFolder()) == false)
                Directory.CreateDirectory(GetCheetahFolder());
            WebConfig conf = WebConfig.Default;
#if DEBUG
            conf.LogFile = Application.StartupPath + @"\log.txt";
            conf.LogSeverity = ChromiumEngine.Enum.LogSeverity.Verbose;
#endif
            if (Directory.Exists(GetCheetahFolder() + @"\Cache\") == false)
                Directory.CreateDirectory(GetCheetahFolder() + @"\Cache\");
            conf.CachePath = GetCheetahFolder() + @"\Cache\";
            WebCore.Initialize(conf);
            History.initialize();
            Bookmarking.initialize();
            autocompletedata = new AutoCompleteStringCollection();
            for (int i = 0; i < History.GetItemsCount() - 1; i++)
                autocompletedata.Add(History.Url(i));
            for (int i = 0; i < Bookmarking.GetItemsCount() - 1; i++)
                autocompletedata.Add(Bookmarking.Url(i));
            AuthenticationPasswords.Initialize();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(true);
            Application.Run(new Form1());
            WebCore.ShutDown();
        }
コード例 #2
0
ファイル: SoViewControl.cs プロジェクト: phox/AmbleSystem
        public void FillTheCustomerInfo(custVendor.CustVendorManager.custvendorinfo custInfo)
        {
            AutoCompleteStringCollection contactSource = new AutoCompleteStringCollection();
            if (custInfo.contact1.Length!=0)
            {
                tbContact.Text = custInfo.contact1;
                contactSource.Add(custInfo.contact1);
            }
            if (custInfo.contact2.Length!=0)
            {
                contactSource.Add(custInfo.contact2);
            }
            tbContact.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            tbContact.AutoCompleteSource = AutoCompleteSource.CustomSource;
            tbContact.AutoCompleteCustomSource = contactSource;

            tbCustomerAccount.Text = custInfo.cvnumber;
            tbFreightTerm.Text = custInfo.shippingTerm;
            tbPaymentTerm.Text = custInfo.paymentTerm;
            tbBillto.Text = custInfo.billTo;

            List<custVendor.CustVendorManager.custvendorinfoshipto> shipToList = custVendor.CustVendorManager.CustVenInfoManager.GetShipTo(custInfo.cvId);
            List<string> shipToListString = new List<string>();
            foreach (custVendor.CustVendorManager.custvendorinfoshipto shipto in shipToList)
            {
                shipToListString.Add(shipto.shipTo);
            }
               SetShipToList(shipToListString);
        }
コード例 #3
0
        //Initialization for AutoComplete
        public void AutoComplete_Init(TextBox tbx, string filename)
        {
            filename = path + filename;

            //Instantiation for AutoComplete
            AutoCompleteStringCollection auto_scs = new AutoCompleteStringCollection();
            tbx.AutoCompleteCustomSource = auto_scs;

            string directory = Environment.GetEnvironmentVariable("LOCALAPPDATA") + "\\SCV";

            //Checking of LOCALAPPDATA <C:\Users\AppData\Local> directory and file
            if (Directory.Exists(directory) == false)
            {
                DirectoryInfo di = Directory.CreateDirectory(directory);
            }

            if (File.Exists(filename) == false)
            {
                FileStream fs = File.Create(filename);
                fs.Close();
                this.file_flg = true;
            }

            //Reading file for AutoComplete
            foreach (string row in File.ReadLines(filename, SJIS))
            {
                if(row.Contains(","))
                {
                    string[] data = row.Split(',');
                    auto_scs.Add(data[0]);
                }
                else
                {
                    auto_scs.Add(row);
                }
            }

            //Auto Input from last history
            //Getting file size
            System.IO.FileInfo fi = new System.IO.FileInfo(filename);
            long filesize = fi.Length;
            //File is not null(or brank)
            if (filesize != 0)
            {
                //Reading all row from file
                string[] lines = System.IO.File.ReadAllLines(filename);
                //Input for history from last data   
                if (tbx.Name == "tbxUser")
                {
                    string[] data = (lines[lines.Length - 1]).Split(',');
                    tbx.Text = data[0];
                }
                else
                {
                    string data = lines[lines.Length - 1];
                    tbx.Text = data;
                }
            }
        }
        // Search departmental heads
        public void searchDepartmentalHeads()
        {
            searchDepartmentalHeadStaffIdTextBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            searchDepartmentalHeadStaffIdTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            sqlConnection = new MySqlConnection(databaseConnection);

            try
            {
                sqlConnection.Open();

                MySqlCommand sqlCommand = new MySqlCommand("SELECT * FROM departmental_heads", sqlConnection);
                MySqlDataReader reader = sqlCommand.ExecuteReader();
                while (reader.Read())
                {
                    String name = reader.GetInt64("pfno").ToString();
                    collection.Add(name);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error has occured while seraching departmental head, : " + exception.Message);
            }

            searchDepartmentalHeadStaffIdTextBox.AutoCompleteCustomSource = collection;
        }
コード例 #5
0
        private void AutoCompleteAnimalSerial()
        {
            //auto completes Employee name in check out page.
            textBoxTreatmentSerial.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            textBoxTreatmentSerial.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection1 = new AutoCompleteStringCollection();

            textBoxFoodAnimalSerial.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            textBoxFoodAnimalSerial.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection2 = new AutoCompleteStringCollection();

            SqlConnection connection = new SqlConnection(connectionString);
            string commandString = "SELECT aserial FROM animal";
            SqlCommand command = new SqlCommand(commandString, connection);
            SqlDataReader myReader;
            try
            {
                connection.Open();
                myReader = command.ExecuteReader();
                while (myReader.Read())
                {
                    string value = myReader["aserial"].ToString();
                    collection1.Add(value);
                    collection2.Add(value);
                }
                connection.Close();
            }
            catch (SqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
            textBoxTreatmentSerial.AutoCompleteCustomSource = collection1;
            textBoxFoodAnimalSerial.AutoCompleteCustomSource = collection2;
            NameShadeShow();
        }
コード例 #6
0
ファイル: PlayerDetails.cs プロジェクト: WASP3D/Soccer-App
 public void Initialize()
 {
     SetFormHeader();
     AutoCompleteStringCollection cmbstrName = new AutoCompleteStringCollection();
     AutoCompleteStringCollection cmbstrJer = new AutoCompleteStringCollection();
     DataRow drTeam = ObjUdtprovider.CurrentDataSet.Tables[2].Select("Name = '" + Team+"'").FirstOrDefault();
     if (drTeam != null)
     {
         DataRow[] drPlayers = ObjUdtprovider.CurrentDataSet.Tables[3].Select("T24_ID = '" + drTeam["T24_ID"] + "' AND Playing=true");
         cmbPlayerJer.Items.Clear();
         cmbPlayerName.Items.Clear();
         foreach (DataRow item in drPlayers)
         {
             cmbPlayerName.Items.Add(item["First Name"]);
             cmbstrName.Add(item["First Name"].ToString());
             cmbPlayerJer.Items.Add(item["Jersey No"]);
             cmbstrJer.Add(item["Jersey No"].ToString());
         }
         cmbPlayerName.SelectedIndex = 1;
         cmbPlayerJer.SelectedIndex = 1;
         cmbPlayerName.AutoCompleteMode = AutoCompleteMode.Suggest;
         cmbPlayerName.AutoCompleteSource = AutoCompleteSource.CustomSource;
         cmbPlayerName.AutoCompleteCustomSource = cmbstrName;
         cmbPlayerJer.AutoCompleteMode = AutoCompleteMode.Suggest;
         cmbPlayerJer.AutoCompleteSource = AutoCompleteSource.CustomSource;
         cmbPlayerJer.AutoCompleteCustomSource = cmbstrJer;
     }
 }
コード例 #7
0
ファイル: Form1.cs プロジェクト: sancas/ProgramacionIV
 private void addCarnets(AutoCompleteStringCollection DataCollection)
 {
     foreach (Alumnos Alumno in Alumnos)
     {
         DataCollection.Add(Alumno.carnet + " - " + Alumno.nombres );
     }
 }
コード例 #8
0
 public AutoCompleteStringCollection autoComplete()
 {
     AutoCompleteStringCollection collection = new AutoCompleteStringCollection();
     try
     {
         SqlConnectionObj.Open();
         string query = "select * from tbl_room";
         SqlCommandObj.CommandText = query;
         SqlDataReader reader = SqlCommandObj.ExecuteReader();
         while (reader.Read())
         {
             string roomNo = reader["roomNo"].ToString();
             collection.Add(roomNo);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     finally
     {
         if (SqlConnectionObj != null && SqlConnectionObj.State == ConnectionState.Open)
         {
             SqlConnectionObj.Close();
         }
     }
     return collection;
 }
コード例 #9
0
ファイル: MainForm.Search.cs プロジェクト: GetTabster/Tabster
        private void BuildSearchSuggestions()
        {
            var artistStrings = new List<string>();
            var titleStrings = new List<string>();

            foreach (var item in _libraryManager.GetTablatureItems())
            {
                if (artistStrings.Find(x => x.Equals(item.File.Artist, StringComparison.OrdinalIgnoreCase)) == null)
                    artistStrings.Add(item.File.Artist);

                var title = TablatureUtilities.RemoveVersionConventionFromTitle(item.File.Title);
                if (titleStrings.Find(x => x.Equals(title, StringComparison.OrdinalIgnoreCase)) == null)
                    titleStrings.Add(title);
            }

            var artistSuggestions = new AutoCompleteStringCollection();
            var titleSuggestions = new AutoCompleteStringCollection();

            foreach (var str in artistStrings)
                artistSuggestions.Add(str);

            foreach (var str in titleStrings)
                titleSuggestions.Add(str);

            txtSearchArtist.AutoCompleteCustomSource = artistSuggestions;
            txtSearchTitle.AutoCompleteCustomSource = titleSuggestions;
        }
コード例 #10
0
ファイル: SearchUI.cs プロジェクト: faruk111/MyProjectWork
        void AutoComplte()
        {
            searchTextBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            searchTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection coll=new AutoCompleteStringCollection();

              string  url = @"server=faruk\SQLEXPRESS; database=library; integrated security=true";
              SqlConnection  connection = new SqlConnection(url);

            connection.Open();

            string query = "select * from book_table";
            SqlCommand command = new SqlCommand(query, connection);
            SqlDataReader aReader = command.ExecuteReader();

            if (aReader.HasRows)
            {
                while (aReader.Read())
                {
                    string sname = aReader[1].ToString();
                    coll.Add(sname);
                }

            }

            searchTextBox.AutoCompleteCustomSource= coll;
            connection.Close();
        }
コード例 #11
0
ファイル: cls_scv.cs プロジェクト: OkaMisato/test
        //オートコンプリートの初期化
        public void AutoComplete_Init(TextBox tbx, string filename)
        {
            //オートコンプリート用インスタンス生成
            AutoCompleteStringCollection auto_scs = new AutoCompleteStringCollection();
            tbx.AutoCompleteCustomSource = auto_scs;

            string directory = Environment.GetEnvironmentVariable("LOCALAPPDATA") + "\\SCV";

            //iniファイル用ディレクトリの確認
            if (Directory.Exists(directory) == false)
            {
                DirectoryInfo di = Directory.CreateDirectory(directory);
            }

            //保存用 ini ファイルの読込/作成
            if (File.Exists(filename) == false)
            {
                FileStream fs = File.Create(filename);
                fs.Close();
            }

            //読み込んだファイル内容の反映
            foreach (string row in File.ReadLines(filename, SJIS))
            {
                auto_scs.Add(row);
            }
        }
コード例 #12
0
ファイル: FrmListarLlamadas.cs プロジェクト: TarekMulla/cra
        private void CargarComboClientesTodos(long IdUsuario, string Busqueda)
        {
            var timer = System.Diagnostics.Stopwatch.StartNew();
            //Llena el combo con la lista de Targets
            CboCliente.ResetText();
            IList<clsClienteMaster> ListaClienteMaster = LogicaNegocios.Clientes.clsClientesMaster.ListarClienteMaster(Busqueda, Enums.TipoPersona.Comercial, Enums.Estado.Todos, true);

            ComboBoxItemCollection coll = CboCliente.Properties.Items;
            coll.Add(Utils.Utils.ObtenerPrimerItem());
            foreach (var list in ListaClienteMaster) {
                coll.Add(list);
            }

            CboCliente.SelectedIndex = 0;

            AutoCompleteStringCollection textoAutocompletar = new AutoCompleteStringCollection();
            textoAutocompletar = new AutoCompleteStringCollection();

            CboCliente.MaskBox.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            CboCliente.MaskBox.AutoCompleteSource = AutoCompleteSource.CustomSource;

            foreach (var list in ListaClienteMaster) {
                textoAutocompletar.Add(list.NombreCliente);
            }
            CboCliente.MaskBox.AutoCompleteCustomSource = textoAutocompletar;
            ClsLogPerformance.Save(new LogPerformance(Base.Usuario.UsuarioConectado.Usuario, timer.Elapsed.TotalSeconds));
        }
コード例 #13
0
        //オートコンプリートの初期化
        public void AutoComplete_Init(TextBox tbx, string filename)
        {
            //オートコンプリート用インスタンス生成
            AutoCompleteStringCollection auto_scs = new AutoCompleteStringCollection();
            tbx.AutoCompleteCustomSource = auto_scs;

            string directory = Environment.GetEnvironmentVariable("LOCALAPPDATA") + "\\SCV";

            //保存用 ini ファイルの読込/作成
            if (File.Exists(filename) == false)
            {
                FileStream fs = File.Create(filename);
                fs.Close();
            }

            //読み込んだファイル内容をパスワードを復号化し反映
            foreach (string row in File.ReadLines(filename, SJIS))
            {
                auto_scs.Add(Decrypt(row));
            }


            //ファイルのサイズを取得
            System.IO.FileInfo fi = new System.IO.FileInfo(filename);
            long filesize = fi.Length;
            //ファイルの中身が空ではない場合、テキストボックスに初期値を追記
            if (filesize != 0)
            {
                //テキストファイルからすべての行を読み込む
                string[] lines = System.IO.File.ReadAllLines(filename);
                //最終行の値を追記                
                tbx.Text = (Decrypt(lines[lines.Length - 1]));
            }

        }
        // Search department
        public void searchJobCategory()
        {
            searchJobCategoryName.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            searchJobCategoryName.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            sqlConnection = new MySqlConnection(databaseConnection);

            try
            {
                sqlConnection.Open();

                MySqlCommand sqlCommand = new MySqlCommand("SELECT * FROM job_category", sqlConnection);
                MySqlDataReader reader = sqlCommand.ExecuteReader();
                while (reader.Read())
                {
                    String name = reader.GetString("name");
                    collection.Add(name);
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show("Error has occured while seraching department, : " + exception.Message);
            }

            searchJobCategoryName.AutoCompleteCustomSource = collection;
        }
コード例 #15
0
        private void frmDodjelaPrava_Load(object sender, EventArgs e)
        {
            // key/value for combobox source
            List<KeyValuePair<string, string>> data = new List<KeyValuePair<string, string>>();
            // autocomplete for user's combobox
            AutoCompleteStringCollection autocomplete = new AutoCompleteStringCollection();

            // text inside combobox: Name Surname (username)
            // value: username
            foreach (iUser korisnik in piLogin.GetUser())
            {
                data.Add(new KeyValuePair<string, string> (korisnik.UserName, korisnik.Name + " " + korisnik.Surname + " (" + korisnik.UserName + ")"));
                autocomplete.Add(korisnik.Name + " " + korisnik.Surname + " (" + korisnik.UserName + ")");
            }

            // set datasource for user's combobox
            cmbKorisnik.DataSource = new BindingSource(data, null);
            cmbKorisnik.DisplayMember = "Value";
            cmbKorisnik.ValueMember = "Key";

            // set autocomplete source and mode
            cmbKorisnik.AutoCompleteSource = AutoCompleteSource.CustomSource;
            cmbKorisnik.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            cmbKorisnik.AutoCompleteCustomSource = autocomplete;

            // set role items
            cmbUloga.Items.Add("Odobravanje");
            cmbUloga.Items.Add("Likvidatura");

            // if user is set, select it from combobox
            if (this.korisnik != null)
            {
                cmbKorisnik.SelectedValue = this.korisnik.UserName;
            }
        }
コード例 #16
0
ファイル: frmCategory.cs プロジェクト: balavigneshs/iMgmt
        private void Autocomplete()
        {
            try
            {
                con = new OleDbConnection(cs);
                con.Open();
                OleDbCommand cmd = new OleDbCommand("SELECT distinct Categoryname FROM Category", con);
                DataSet ds = new DataSet();
                OleDbDataAdapter da = new OleDbDataAdapter(cmd);
                da.Fill(ds, "Category");
                AutoCompleteStringCollection col = new AutoCompleteStringCollection();
                int i = 0;
                for (i = 0; i <= ds.Tables[0].Rows.Count - 1; i++)
                {
                    col.Add(ds.Tables[0].Rows[i]["Categoryname"].ToString());

                }
                txtCategoryName.AutoCompleteSource = AutoCompleteSource.CustomSource;
                txtCategoryName.AutoCompleteCustomSource = col;
                txtCategoryName.AutoCompleteMode = AutoCompleteMode.Suggest;

                con.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #17
0
 public frmArticulosBorradoMasivo()
 {
     InitializeComponent();
     System.Drawing.Icon ico = Properties.Resources.icono_app;
     this.Icon = ico;
     this.Text = "  Borrado de artículos sin stock";
     this.ControlBox = true;
     this.MaximizeBox = false;
     FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
     cmbGenero.Validating += new System.ComponentModel.CancelEventHandler(BL.Utilitarios.ValidarComboBox);
     cmbGenero.KeyDown += new System.Windows.Forms.KeyEventHandler(BL.Utilitarios.EnterTab);
     DataTable tblGeneros = BL.GetDataBLL.Generos();
     cmbGenero.ValueMember = "IdGeneroGEN";
     cmbGenero.DisplayMember = "DescripcionGEN";
     cmbGenero.DropDownStyle = ComboBoxStyle.DropDown;
     cmbGenero.DataSource = tblGeneros;
     cmbGenero.SelectedValue = -1;
     AutoCompleteStringCollection generosColection = new AutoCompleteStringCollection();
     foreach (DataRow row in tblGeneros.Rows)
     {
         generosColection.Add(Convert.ToString(row["DescripcionGEN"]));
     }
     cmbGenero.AutoCompleteCustomSource = generosColection;
     cmbGenero.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
     cmbGenero.AutoCompleteSource = AutoCompleteSource.CustomSource;
 }
コード例 #18
0
ファイル: frmContacts.cs プロジェクト: etechuk/hcfcpc
        public frmContacts()
        {
            InitializeComponent();

            Icon = Properties.Resources.logo;

            DataSet ds = Program.DB.SelectAll("SELECT ID,Name FROM Companies;");
            if (ds.Tables.Count > 0)
            {
                AutoCompleteStringCollection asCompanies = new AutoCompleteStringCollection();
                foreach (DataRow r in ds.Tables[0].Rows)
                {
                    string sName = r["Name"].ToString();
                    asCompanies.Add(sName);
                }
                txtCompanies.AutoCompleteCustomSource = asCompanies;
            }

            ds = Program.DB.SelectAll("SELECT ID,NameFirst,NameLast FROM Contacts;");
            if (ds.Tables.Count > 0)
            {
                foreach (DataRow r in ds.Tables[0].Rows)
                {
                    DevComponents.Editors.ComboItem i = new DevComponents.Editors.ComboItem();
                    i.Tag = r["ID"];
                    i.Text = r["NameFirst"].ToString() + " " + r["NameLast"].ToString();
                    cbxContact.Items.Add(i);
                }
            }
        }
コード例 #19
0
        void AutocompleteText()
        {
            textBox5.AutoCompleteMode = AutoCompleteMode.Suggest;
            textBox5.AutoCompleteSource = AutoCompleteSource.CustomSource;
            AutoCompleteStringCollection coll = new AutoCompleteStringCollection();

            try
            {
                if (conn.State != ConnectionState.Open)
                {
                    conn.Open();
                }

                string sqluery = "SELECT * FROM MED_INFO WHERE MED_MGF='" + comboBox1.Text + "' ORDER BY MED_NAME";
                OracleCommand cd = new OracleCommand(sqluery, conn);
                OracleDataReader r;
                r = cd.ExecuteReader();
                while(r.Read())
                {
                    string sn = r.GetString(1);
                    coll.Add(sn);
                }

                r.Dispose();
                cd.Dispose();
                conn.Close();
            }
            catch (Exception exe)
            {
                MessageBox.Show(exe.Message);
            }

            textBox5.AutoCompleteCustomSource = coll;
        }
コード例 #20
0
 public void CargarAutocomplete(AutoCompleteStringCollection col, string query, string name)
 {
     this.EjecutarQuery(query);
     while (this.getLector().Read())
     {
         col.Add(this.getLector()[name].ToString());
     }
 }
 /// <summary>
 /// Stolen from http://stackoverflow.com/a/4678230/1766716
 /// </summary>
 /// <param name="enumerable"></param>
 /// <returns></returns>
 public static AutoCompleteStringCollection ToAutoCompleteStringCollection(
     this IEnumerable<string> enumerable)
 {
     if (enumerable == null) throw new ArgumentNullException("enumerable");
     var autoComplete = new AutoCompleteStringCollection();
     foreach (var item in enumerable) autoComplete.Add(item);
     return autoComplete;
 }
コード例 #22
0
ファイル: frmMain.cs プロジェクト: raykuhnell/Pennyworth
        public frmMain()
        {
            InitializeComponent();

            RegisterHotKey();

            // Load definitions file.
            try
            {
                using (var reader = XmlReader.Create("Definitions.xml"))
                {
                    definitions = (DefinitionCollection)new XmlSerializer(typeof(DefinitionCollection)).Deserialize(reader);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(String.Format("Exception occurred loading definitions file: {0}", ex.ToString()));
            }

            AutoCompleteStringCollection collection = new AutoCompleteStringCollection();

            foreach (Definition d in definitions.Items)
            {
                collection.Add(d.Name);
            }

            // Add applications from Start Menu.
            string[] apps = Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu), "*.lnk", SearchOption.AllDirectories);
            foreach (string app in apps)
            {
                string name = app.Substring(app.LastIndexOf("\\") + 1);
                name = name.Replace(".lnk", "");
                if (!definitions.Items.Any(x => x.Name == name))
                {
                    collection.Add(name);
                    definitions.Items.Add(new Definition() { Name = name, Command = app });
                }
                else
                {
                    Debug.WriteLine(String.Format("Duplicate key attempted to be added: {0}", name));
                }
            }

            txtQuery.AutoCompleteCustomSource = collection;
        }
コード例 #23
0
 void AutoCompleteText()
 {
     AutoCompleteStringCollection col = new AutoCompleteStringCollection();
     for (int i = 0; i < t.ThuocSelectTop5(txtTenThuoc.Text).Rows.Count; i++)
     {
         col.Add(t.ThuocSelectTop5(txtTenThuoc.Text).Rows[i]["TenThuoc"].ToString());
     }
     txtTenThuoc.AutoCompleteCustomSource = col;
 }
コード例 #24
0
		public FormTimeline()
		{
			InitializeComponent();

			AutoCompleteStringCollection autocomplete = new AutoCompleteStringCollection();
			autocomplete.Add(Messages.MyFriends + "...");
			autocomplete.Add(Messages.Everyone + "...");

			textFriend.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
			textFriend.AutoCompleteSource = AutoCompleteSource.CustomSource;
			textFriend.AutoCompleteCustomSource = autocomplete;
			textFriend.Text = Messages.MyFriends + "...";

			LastFriend = textFriend.Text;
			LastStatusId = 1;

			lblError.Visible = false;
		}
コード例 #25
0
ファイル: ROMHandler.cs プロジェクト: zelda180/SceneNavi
        private void FindSceneTable()
        {
            Scenes = new List <ISceneTableEntry>();

            if (IsMajora || !HasZ64TablesHack)
            {
                int increment = (IsMajora ? 16 : 20);

                DMATableEntry dma = Files.OrderBy(x => x.VStart).FirstOrDefault(x => x.FileType == DMATableEntry.FileTypes.Scene);

                for (int i = CodeData.Length - (increment * 2); i > 0; i -= 4)
                {
                    ISceneTableEntry entry = (!IsMajora ? (ISceneTableEntry) new SceneTableEntryOcarina(this, i, true) : (ISceneTableEntry) new SceneTableEntryMajora(this, i, true));
                    if (entry.GetSceneStartAddress() == dma.VStart && entry.GetSceneEndAddress() == dma.VEnd)
                    {
                        SceneTableAddress = i;
                        break;
                    }
                }

                if (SceneTableAddress != -1)
                {
                    for (int i = SceneTableAddress, j = 0; i < CodeData.Length - (16 * 16); i += increment)
                    {
                        ISceneTableEntry scn1 = (!IsMajora ? (ISceneTableEntry) new SceneTableEntryOcarina(this, i, true) : (ISceneTableEntry) new SceneTableEntryMajora(this, i, true));

                        if (!scn1.IsValid() && !scn1.IsAllZero())
                        {
                            break;
                        }

                        scn1.SetNumber((ushort)j);
                        if (!scn1.IsAllZero())
                        {
                            Scenes.Add(scn1);
                        }
                        j++;
                    }
                }
            }
            else
            {
                SceneTableAddress = Endian.SwapInt32(BitConverter.ToInt32(Data, Z64TablesAdrOffset));
                int cnt = Endian.SwapInt32(BitConverter.ToInt32(Data, Z64TablesAdrOffset + 4));
                for (int i = 0; i < cnt; i++)
                {
                    Scenes.Add(new SceneTableEntryOcarina(this, SceneTableAddress + (i * 20), false));
                }
            }

            SceneNameACStrings = new System.Windows.Forms.AutoCompleteStringCollection();
            foreach (ISceneTableEntry ste in Scenes)
            {
                ste.ReadScene();
                SceneNameACStrings.Add(ste.GetName());
            }
        }
コード例 #26
0
ファイル: ImportContactForm.cs プロジェクト: thongvo/myfiles
 private void LoadAccountSuggestion()
 {
     List<AccountDB> list = dbController.GetAllAccounts();
     AutoCompleteStringCollection col = new AutoCompleteStringCollection();
     foreach(AccountDB acc in list)
     {
         col.Add(acc.Username);
     }
     tbox_account.AutoCompleteCustomSource = col;
 }
コード例 #27
0
 public AutoCompleteStringCollection GetAutoCompleteList(string Column, string Table)
 {
     AutoCompleteStringCollection AutoCompleteList = new AutoCompleteStringCollection();
     DataTable td = SelectQuery("Select " + Column + " from " + Table);
     List<string> Product_List = td.AsEnumerable().Select(r => r.Field<string>(Column)).ToList();
     foreach (string item in Product_List)
     {
         AutoCompleteList.Add(item);
     }
     return AutoCompleteList;
 }
コード例 #28
0
        /// <summary>
        /// Retorna uma lista de nomes de servidores
        /// </summary>
        /// <returns></returns>
        public AutoCompleteStringCollection RetornaNomeServidores(string nomeProvedor)
        {
            var servidores = CarregaConexoes(nomeProvedor);
            var dadosLista = new AutoCompleteStringCollection();

            foreach (var serv in servidores.GroupBy(s => s.Servidor))
            {
                dadosLista.Add(serv.Key);
            }
            return dadosLista;
        }
コード例 #29
0
        public static AutoCompleteStringCollection AutoCompletarBuscarMunicipio()
        {
            DataTable dt = DatosAutoCompleteMunicipios();

            AutoCompleteStringCollection sc = new System.Windows.Forms.AutoCompleteStringCollection();

            foreach (DataRow row in dt.Rows)
            {
                sc.Add(Convert.ToString(row["Descripcion"]));
            }
            return(sc);
        }
コード例 #30
0
        //metodo para cargar la coleccion de datos para el autocomplete
        public static AutoCompleteStringCollection AutocompleteClientesCodigo()
        {
            DataTable dt = DatosClientes();

            AutoCompleteStringCollection coleccion = new AutoCompleteStringCollection();
            //recorrer y cargar los items para el autocompletado
            foreach (DataRow row in dt.Rows)
            {
                coleccion.Add(Convert.ToString(row["cod_empre"]));
            }

            return coleccion;
        }
コード例 #31
0
        public static AutoCompleteStringCollection LoadAutoComplete(DataSet ds, string nombre_columna)
        {
            DataTable dt = (DataTable)ds.Tables[0];

            AutoCompleteStringCollection stringCol = new AutoCompleteStringCollection();

            foreach (DataRow row in dt.Rows)
            {
                stringCol.Add(Convert.ToString(row[nombre_columna]));
            }

            return stringCol;
        }
コード例 #32
0
        public static AutoCompleteStringCollection LoadAutoComplete()
        {
            DataTable dt = LoadDataTable();

            AutoCompleteStringCollection stringCol = new AutoCompleteStringCollection();

            foreach (DataRow row in dt.Rows)
            {
                stringCol.Add(Convert.ToString(row["idcuenta"]));
            }

            return stringCol;
        }
コード例 #33
0
ファイル: BLL.cs プロジェクト: TuanAnhNguyen69/QLVLXD_GUI
        public void MakeComboBox(System.Windows.Forms.ComboBox MSComBoBox, List <string> DanhSach)
        {
            System.Windows.Forms.AutoCompleteStringCollection str = new System.Windows.Forms.AutoCompleteStringCollection();

            foreach (string mem in DanhSach)
            {
                MSComBoBox.Items.Add(mem.Trim());
                str.Add(mem.Trim());
            }

            MSComBoBox.AutoCompleteCustomSource = str;
            MSComBoBox.AutoCompleteMode         = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
            MSComBoBox.AutoCompleteSource       = System.Windows.Forms.AutoCompleteSource.CustomSource;
        }
コード例 #34
0
ファイル: Main.cs プロジェクト: Alpha1594/Lucre
        private void LoadData()
        {
            CheckURI();
            if (File.Exists("Data\\Finance.rc"))
            {
                //try
                //{
                FileStream    FS  = new FileStream("Data\\Finance.rc", FileMode.Open);
                XmlSerializer XSR = new XmlSerializer(typeof(SFinanceRC));
                RC = (SFinanceRC)XSR.Deserialize(FS);
                FS.Dispose();
                //}
                //catch { MessageBox.Show("Filestream is being silly pleb"); }
            }
            else
            {
                FinanceRC FRC = new FinanceRC(true);
                FRC.ShowDialog();
            }

            if (File.Exists("Data\\Transactions.xml"))
            {
                FileStream    FS  = new FileStream("Data\\Transactions.xml", FileMode.Open);
                XmlSerializer XSR = new XmlSerializer(typeof(CashFlow));
                Transactions = (CashFlow)XSR.Deserialize(FS);
                FS.Dispose();
                DisplayTransIn();
                DisplayTransOut();
            }

            if (File.Exists("Data\\Companies.xml"))
            {
                FileStream    FS  = new FileStream("Data\\Companies.xml", FileMode.Open);
                XmlSerializer XSR = new XmlSerializer(typeof(List <Company>));
                Companies = (List <Company>)XSR.Deserialize(FS);

                List <string> lACS = new List <string>();
                foreach (Company C in Companies)
                {
                    ACS.Add(C.Name);
                    lACS.Add(C.Name);
                }
                sACS = lACS.ToArray();

                FS.Dispose();
            }
        }
コード例 #35
0
        private void FillFormFromRegistry()
        {
            if (!stateLoaded)
            {
                if (AppCuKey != null)
                {
                    // fill the various textboxes
                    SlurpFileHistory();

                    var s = (string)AppCuKey.GetValue(_rvn_XPathExpression);
                    if (s != null)
                    {
                        this.tbXpath.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Prefix);
                    if (s != null)
                    {
                        this.tbPrefix.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Xmlns);
                    if (s != null)
                    {
                        this.tbXmlns.Text = s;
                    }


                    // get the MRU list of XPath expressions
                    _xpathExpressionMruList = new System.Windows.Forms.AutoCompleteStringCollection();
                    string historyString = (string)AppCuKey.GetValue(_rvn_History, "");
                    if (!String.IsNullOrEmpty(historyString))
                    {
                        string[] items = historyString.Split('¡');
                        if (items != null && items.Length > 0)
                        {
                            //_xpathExpressionMruList.AddRange(items);
                            foreach (string item in items)
                            {
                                _xpathExpressionMruList.Add(item.XmlUnescapeIexcl());
                            }

                            // insert the most recent expression into the box?
                            this.tbXpath.Text = _xpathExpressionMruList[_xpathExpressionMruList.Count - 1];
                        }
                    }


                    // set the geometry of the form
                    s = (string)AppCuKey.GetValue(_rvn_Geometry);
                    if (!String.IsNullOrEmpty(s))
                    {
                        int[] p = Array.ConvertAll <string, int>(s.Split(','),
                                                                 new Converter <string, int>((t) => { return(Int32.Parse(t)); }));
                        if (p != null && p.Length == 5)
                        {
                            this.Bounds = ConstrainToScreen(new System.Drawing.Rectangle(p[0], p[1], p[2], p[3]));
                        }
                    }


                    // workitem 3392 - don't need this
                    // set the splitter
                    // s = (string)AppCuKey.GetValue(_rvn_Splitter);
                    // if (!String.IsNullOrEmpty(s))
                    //   {
                    //     try
                    //     {
                    //         int x = Int32.Parse(s);
                    //         this.splitContainer3.SplitterDistance = x;
                    //     }
                    //     catch { }
                    // }

                    stateLoaded = true;
                }
            }
        }
コード例 #36
0
ファイル: ROMHandler.cs プロジェクト: zelda180/SceneNavi
        private void FindObjectTable()
        {
            Objects            = new List <ObjectTableEntry>();
            ObjectTableAddress = 0;
            ObjectCount        = 0;

            EntranceTableAddress = 0;

            if (!HasZ64TablesHack)
            {
                int inc = 8;
                for (int i = (int)ActorTableAddress; i < CodeData.Length - (8 * 8); i += inc)
                {
                    ObjectCount = Endian.SwapUInt16(BitConverter.ToUInt16(CodeData, i - 2));
                    if (ObjectCount < 0x100 || ObjectCount > 0x300)
                    {
                        continue;
                    }

                    ObjectTableEntry obj1 = new ObjectTableEntry(this, i, true);
                    ObjectTableEntry obj2 = new ObjectTableEntry(this, i + 8, true);
                    ObjectTableEntry obj3 = new ObjectTableEntry(this, i + 16, true);

                    if (obj1.IsEmpty == true && obj2.IsValid == true && obj3.IsValid == true && Objects.Count == 0)
                    {
                        ObjectTableAddress = i;
                        break;
                    }
                }

                if (ObjectTableAddress != 0 && ObjectCount != 0)
                {
                    int i, j = 0;
                    for (i = ObjectTableAddress; i < (ObjectTableAddress + (ObjectCount * 8)); i += 8)
                    {
                        Objects.Add(new ObjectTableEntry(this, i, true, (ushort)j));
                        j++;
                    }

                    if (!IsMajora)
                    {
                        EntranceTableAddress = i + (i % 16);
                    }
                }
            }
            else
            {
                ObjectTableAddress = Endian.SwapInt32(BitConverter.ToInt32(Data, Z64TablesAdrOffset + 8));
                ObjectCount        = (ushort)Endian.SwapInt32(BitConverter.ToInt32(Data, Z64TablesAdrOffset + 12));
                for (int i = 0; i < ObjectCount; i++)
                {
                    Objects.Add(new ObjectTableEntry(this, ObjectTableAddress + i * 8, false, (ushort)i));
                }
            }

            ObjectNameACStrings = new System.Windows.Forms.AutoCompleteStringCollection();
            foreach (ObjectTableEntry obj in Objects)
            {
                ObjectNameACStrings.Add(obj.Name);
            }
        }
コード例 #37
0
        /// This app uses the windows registry to store config data for itself.
        ///     - creates a key for this DotNetZip Winforms app, if one does not exist
        ///     - stores and retrieves the most recent settings.
        ///     - this is done on a per user basis. (HKEY_CURRENT_USER)
        private void FillFormFromRegistry()
        {
            if (!stateLoaded)
            {
                if (AppCuKey != null)
                {
                    var s = (string)AppCuKey.GetValue(_rvn_DirectoryToZip);
                    if (s != null)
                    {
                        this.tbDirectoryToZip.Text     = s;
                        this.tbDirectoryInArchive.Text = System.IO.Path.GetFileName(this.tbDirectoryToZip.Text);
                    }

                    s = (string)AppCuKey.GetValue(_rvn_SelectionToZip);
                    if (s != null)
                    {
                        this.tbSelectionToZip.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_SelectionToExtract);
                    if (s != null)
                    {
                        this.tbSelectionToExtract.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_ZipTarget);
                    if (s != null)
                    {
                        this.tbZipToCreate.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_ZipToOpen);
                    if (s != null)
                    {
                        this.tbZipToOpen.Text = s;
                    }

                    s = (string)AppCuKey.GetValue(_rvn_ExtractLoc);
                    if (s != null)
                    {
                        this.tbExtractDir.Text = s;
                    }
                    else
                    {
                        this.tbExtractDir.Text = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Encoding);
                    if (s != null)
                    {
                        SelectNamedEncoding(s);
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Compression);
                    if (s != null)
                    {
                        SelectNamedCompressionLevel(s);
                    }
                    else
                    {
                        SelectNamedCompressionLevel("Default");
                    }

                    s = (string)AppCuKey.GetValue(_rvn_Encryption);
                    if (s != null)
                    {
                        SelectNamedEncryption(s);
                        this.tbPassword.Text = "";
                    }

                    int x = (Int32)AppCuKey.GetValue(_rvn_ZipFlavor, 0);
                    if (x >= 0 && x <= 2)
                    {
                        this.comboFlavor.SelectedIndex = x;
                    }

                    x = (Int32)AppCuKey.GetValue(_rvn_Zip64Option, 0);
                    if (x >= 0 && x <= 2)
                    {
                        this.comboZip64.SelectedIndex = x;
                    }

                    x = (Int32)AppCuKey.GetValue(_rvn_ExtractExistingFileAction, 0);
                    if (x >= 0 && x <= comboExistingFileAction.Items.Count)
                    {
                        this.comboExistingFileAction.SelectedIndex = x;
                    }

                    x = (Int32)AppCuKey.GetValue(_rvn_FormTab, 1);
                    if (x == 0 || x == 1)
                    {
                        this.tabControl1.SelectedIndex = x;
                    }

                    x = (Int32)AppCuKey.GetValue(_rvn_HidePassword, 1);
                    this.chkHidePassword.Checked = (x != 0);

                    x = (Int32)AppCuKey.GetValue(_rvn_OpenExplorer, 1);
                    this.chkOpenExplorer.Checked = (x != 0);

                    x = (Int32)AppCuKey.GetValue(_rvn_TraverseJunctions, 1);
                    this.chkTraverseJunctions.Checked = (x != 0);

                    x = (Int32)AppCuKey.GetValue(_rvn_RecurseDirs, 1);
                    this.chkRecurse.Checked = (x != 0);

                    x = (Int32)AppCuKey.GetValue(_rvn_RemoveFiles, 1);
                    this.chkRemoveFiles.Checked = (x != 0);


                    // get the MRU list of selection expressions
                    _selectionCompletions = new System.Windows.Forms.AutoCompleteStringCollection();
                    string history = (string)AppCuKey.GetValue(_rvn_SelectionCompletions, "");
                    if (!String.IsNullOrEmpty(history))
                    {
                        string[] items = history.Split('¡');
                        if (items != null && items.Length > 0)
                        {
                            foreach (string item in items)
                            {
                                _selectionCompletions.Add(item.XmlUnescapeIexcl());
                            }
                        }
                    }



                    // set the geometry of the form
                    s = (string)AppCuKey.GetValue(_rvn_Geometry);
                    if (!String.IsNullOrEmpty(s))
                    {
                        int[] p = Array.ConvertAll <string, int>(s.Split(','),
                                                                 new Converter <string, int>((t) => { return(Int32.Parse(t)); }));
                        if (p != null && p.Length == 5)
                        {
                            this.Bounds = ConstrainToScreen(new System.Drawing.Rectangle(p[0], p[1], p[2], p[3]));

                            // Starting a window minimized is confusing...
                            //this.WindowState = (FormWindowState)p[4];
                        }
                    }

                    AppCuKey.Close();
                    AppCuKey = null;

                    tbPassword_TextChanged(null, null);

                    stateLoaded = true;
                }
            }
        }