Ejemplo n.º 1
0
 // Window is closing -> Stop driver
 private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     notifyIcon.Visible = false;
     try
     {
         config.Write(configFilename);
     }
     catch (Exception)
     {
     }
     StopDriver();
 }
Ejemplo n.º 2
0
        // Window is closing -> Stop driver
        private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            // Close tablet view
            if (tabletView != null)
            {
                tabletView.Close();
            }

            // Hide notify icon
            notifyIcon.Visible = false;

            // Write configuration to XML file
            try { config.Write(configFilename); }
            catch (Exception) { }

            // Stop driver
            StopDriver();
        }
Ejemplo n.º 3
0
        // Window is closing -> Stop driver
        private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            // Close tablet view
            if (tabletView != null)
            {
                tabletView.Close();
            }

            // Hide notify icon
            notifyIcon.Visible = false;

            // Write configuration to XML file
            try { config.Write(configFilename); }
            catch (Exception) { }

            // Remove static event to avoid memory leak
            SystemEvents.DisplaySettingsChanged -= DisplaySettingsChanged;

            // Stop driver
            StopDriver();
        }
Ejemplo n.º 4
0
        private void profileNew_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.InitialDirectory = (Environment.CurrentDirectory + "/" + ConfigurationManager.DefaultConfigPath).Replace('/', '\\');
            saveFileDialog.Filter           = "eXtensible Markup Language|*.xml";
            if (saveFileDialog.ShowDialog() == true)
            {
                Configuration            c = new Configuration();
                System.Drawing.Rectangle r = GetVirtualDesktopSize();
                c.DesktopWidth       = r.Width;
                c.DesktopHeight      = r.Height;
                c.DesktopSize.Width  = r.Width;
                c.DesktopSize.Height = r.Height;
                c.ScreenArea.Width   = c.DesktopSize.Width;
                c.ScreenArea.Height  = c.DesktopSize.Height;
                c.ScreenArea.X       = 0;
                c.ScreenArea.Y       = 0;
                string f = saveFileDialog.FileName;
                c.ConfigFilename = "config/" + f.Split('\\').Last();
                c.Write();
                Button_Click(sender, e);
            }
        }
Ejemplo n.º 5
0
        private void SaveProfile()
        {
            Configuration c = ConfigurationManager.Configurations[profilesList.SelectedIndex];

            c.Write();
        }