/// <summary> /// The Constructor for this method, creates the search panel /// </summary> /// <param name="fileO">Parent FileOverview control</param> public SearchManager(FileOverview fileO) { fo = fileO; this.filterPanel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right | System.Windows.Forms.AnchorStyles.Bottom))); this.filterPanel.AutoScroll = true; this.filterPanel.Location = new System.Drawing.Point(0, 3); this.filterPanel.Name = "filterPanel"; this.filterPanel.Size = new System.Drawing.Size(243, 466); this.filterPanel.BorderStyle = BorderStyle.Fixed3D; this.searchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); this.searchButton.Location = new System.Drawing.Point(4, 61); this.searchButton.Name = "searchButton"; this.searchButton.Size = new System.Drawing.Size(75, 23); this.searchButton.TabIndex = 1; this.searchButton.Text = "Search"; this.searchButton.Click += new System.EventHandler(this.searchButton_Click); this.searchButton.Enabled = true; this.searchButton.UseVisualStyleBackColor = true; this.plusBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); this.plusBox.Image = global::FamClient.Properties.Resources.plus; this.plusBox.Location = new System.Drawing.Point(196, 61); this.plusBox.Name = "plusBox"; this.plusBox.Size = new System.Drawing.Size(23, 22); this.plusBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.plusBox.TabIndex = 12; this.plusBox.Click += new System.EventHandler(this.plusBox_Click); this.plusBox.TabStop = false; this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); this.button1.Location = new System.Drawing.Point(87, 61); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(75, 23); this.button1.TabIndex = 13; this.button1.Text = "Reset"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); this.filterPanel.Controls.Add(this.searchButton); this.filterPanel.Controls.Add(this.plusBox); this.filterPanel.Controls.Add(this.button1); }
/// <summary> /// Creates the Option window /// </summary> /// <param name="fileO">The parent (FileOverview) control</param> public Options(FamClient.FileOverview fileO) { InitializeComponent(); fo = fileO; fo.Enabled = false; //intOld = fo.GetUpdateInterval() / 1000; this.textBox1.Text = intOld.ToString(); bool checkBoxVal = fo.GetUpdateSate(); if (checkBoxVal) { checkBox1.CheckState = CheckState.Checked; } else { checkBox1.CheckState = CheckState.Unchecked; } this.Show(); }
/// <summary> /// The method get triggered, when the "connect"button is clicked. I loads all relevant values from the textboxes and calls /// the FileOverview. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ConnectButtonClick(object sender, EventArgs e) { string server = serverBox.Text; if (!server.Equals("")) { //this.Enabled = false; if (saveBox.CheckState == CheckState.Checked) { try { RegistryKey key = Registry.LocalMachine.CreateSubKey(regDir); key.SetValue(regKeySrv, server); key.SetValue(regKeyLogin, loginBox.Text); key.Close(); } catch (Exception ex) { MessageBox.Show("You have to be logged in as Administrator or run the program as Administrator in order to save settings.", "Error while trying to save settings", MessageBoxButtons.OK, MessageBoxIcon.Information); } } //this.Visible = false; ConnectionMessage.Text = "Logging into the server. Please wait ..."; this.Update(); //fo = new FileOverview(server, loginBox.Text, passwordBox.Text, this); client = new Client(server, loginBox.Text, passwordBox.Text); if (client.isLogined) { this.Enabled = false; this.Visible = false; fo = new FileOverview(client, server, this); fo.SetVisible(); } else { try { if (!client.isConnected()) ConnectionMessage.Text = "Failed to connect to the server.\nPlease check your ip address."; else ConnectionMessage.Text = "Login failed. Please verify your user id and password."; } catch (System.NullReferenceException) { ConnectionMessage.Text = "Failed to connect to the server.\nPlease check your ip address."; } } } else { MessageBox.Show("Please enter serveraddress", "Address missing", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void dbOpenButton_Click(object sender, EventArgs e) { if (dbNameTextBox.Text != "") { this.Enabled = false; this.Visible = false; fo = new FileOverview(this, dbNameTextBox.Text); fo.SetVisible(); } else { MessageBox.Show("No data found...", "", MessageBoxButtons.OK, MessageBoxIcon.Error); } }