private void listView_SelectedIndexChanged(object sender, EventArgs e) { if (listView.SelectedObjects.Count > 0) { UseCaseProfile.SelectProfile((NetworkProfile)listView.SelectedObject); } }
/// <summary> /// Handles the DoWork event of the backgroundWorker control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.</param> public void backgroundWorker_DoWork(object sender, DoWorkEventArgs e) { DataModel.BlockAllOperation = true; try { bool runDeviceConfig = true; NetworkProfile profile = (NetworkProfile)e.Argument; if (profile == null) { // autodetect profile = NetworkProfileHelper.AutoDetectNetworkProfile(DataModel.NetworkProfileList); runDeviceConfig = false; } if (profile != null) { UseCaseProfile.Run(profile, backgroundWorker, runDeviceConfig); } e.Result = profile; } finally { DataModel.BlockAllOperation = false; } }
/// <summary> /// Handles the Click event of the mnuDuplicateProfile control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void mnuDuplicateProfile_Click(object sender, EventArgs e) { if (listView.SelectedObjects.Count > 0) { DataModel.SelectedNetworkProfile = (NetworkProfile)listView.SelectedObject; UseCaseProfile.DuplicateProfile(DataModel.SelectedNetworkProfile); } }
private void listView_DoubleClick(object sender, EventArgs e) { if (listView.SelectedObjects.Count > 0) { DataModel.SelectedNetworkProfile = (NetworkProfile)listView.SelectedObject; UseCaseView.ShowProfile((NetworkProfile)listView.SelectedObject); UseCaseProfile.Show((NetworkProfile)listView.SelectedObject); } }
/// <summary> /// Handles the Click event of the btnRunProfile control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void btnRunProfile_Click(object sender, EventArgs e) { if (sender.GetType() == typeof(RibbonButton)) { DataModel.SelectedNetworkProfile = (NetworkProfile)(((RibbonButton)sender)).Tag; } else if (sender.GetType() == typeof(ToolStripMenuItem)) { DataModel.SelectedNetworkProfile = (NetworkProfile)(((ToolStripMenuItem)sender)).Tag; } UseCaseProfile.Run(); }
/// <summary> /// Handles the ColumnClick event of the listView control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.ColumnClickEventArgs"/> instance containing the event data.</param> private void listView_ColumnClick(object sender, ColumnClickEventArgs e) { Console.WriteLine("Item click"); List <NetworkProfile> listaProfile = new List <NetworkProfile>(); foreach (OLVListItem item in listView.Items) { Console.WriteLine("Item " + item.RowObject); listaProfile.Add((NetworkProfile)item.RowObject); } DataModel.NetworkProfileList = listaProfile; UseCaseProfile.Refresh(false); }
/// <summary> /// Handles the Click event of the mnuMoveProfileDown control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void mnuMoveProfileDown_Click(object sender, EventArgs e) { UseCaseProfile.MoveDown(); }
/// <summary> /// Handles the Click event of the mnuRun control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void mnuRun_Click(object sender, EventArgs e) { UseCaseProfile.Run(); }
/// <summary> /// Handles the Click event of the mnuDelete control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void mnuDelete_Click(object sender, EventArgs e) { UseCaseProfile.DeleteProfile(); }
/// <summary> /// Handles the Activated event of the ArgonDockContent control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected override void ArgonDockContent_Activated(object sender, EventArgs e) { base.ArgonDockContent_Activated(sender, e); UseCaseProfile.SelectProfile(Profile); }
/// <summary> /// Handles the FormClosed event of the FormProfile control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.FormClosedEventArgs"/> instance containing the event data.</param> private void FormProfile_FormClosed(object sender, FormClosedEventArgs e) { UseCaseProfile.Hide(this); }
/// <summary> /// Handles the Click event of the rbtnProfileAutorun control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> public void rbtnProfileAutorun_Click(object sender, EventArgs e) { UseCaseProfile.RunAutoDetect(); }
private void rbtnProfileSave_Click(object sender, EventArgs e) { UseCaseProfile.SaveProfile(); }
/// <summary> /// Handles the Click event of the btnProfileRefresh control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void btnProfileRefresh_Click(object sender, EventArgs e) { UseCaseProfile.Refresh(); }
private void btnView_Click(object sender, EventArgs e) { UseCaseProfile.ShowCurrent(); }