示例#1
0
 private void listView_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listView.SelectedObjects.Count > 0)
     {
         UseCaseProfile.SelectProfile((NetworkProfile)listView.SelectedObject);
     }
 }
示例#2
0
        /// <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;
            }
        }
示例#3
0
 /// <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);
     }
 }
示例#4
0
        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);
            }
        }
示例#5
0
        /// <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();
        }
示例#6
0
        /// <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);
        }
示例#7
0
 /// <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();
 }
示例#8
0
 /// <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();
 }
示例#9
0
 /// <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();
 }
示例#10
0
 /// <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);
 }
示例#11
0
 /// <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);
 }
示例#12
0
 /// <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();
 }
示例#13
0
 private void rbtnProfileSave_Click(object sender, EventArgs e)
 {
     UseCaseProfile.SaveProfile();
 }
示例#14
0
 /// <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();
 }
示例#15
0
 private void btnView_Click(object sender, EventArgs e)
 {
     UseCaseProfile.ShowCurrent();
 }