Example #1
0
        private void pcsLinks_SaveClick(object sender, EventArgs e)
        {
            using (var sfd = new SaveFileDialog())
            {
                sfd.Filter          = FileType.CombineFilters(FileType.TXT, FileType.ALL);
                sfd.FilterIndex     = 0;
                sfd.DefaultExt      = FileType.TXT.Patterns[0];
                sfd.OverwritePrompt = true;
                sfd.SupportMultiDottedExtensions = true;
                sfd.CheckPathExists = true;
                sfd.ValidateNames   = true;

                if (sfd.ShowDialog(this) == DialogResult.OK)
                {
                    var fileName = string.Empty;

                    try
                    {
                        fileName = sfd.FileName;
                        using (var writer = File.CreateText(fileName))
                        {
                            writer.Write(aboutService.GetAboutText());
                            writer.Flush();
                        }
                    }
                    catch (Exception ex)
                    {
                        This.Logger.Error(string.Format("Error while saving data into file file://{0}: {1}",
                                                        fileName, ex.Message), ex);
                        ErrorBox.Show(this, string.Format(SR.ErrorWhileSavingFile, ex.Message));
                    }
                }
            }
        }
Example #2
0
        public bool UpdateApp(
            string appName,
            string displayAppName,
            string appPath,
            string[] executePaths,
            string[] lockProcesses,
            string defaultUpdateUri)
        {
            try
            {
                VersionManifest currentManifest = GetCurrentVersionManifest(appPath);

                return(UpdateApp(
                           currentManifest,
                           appName,
                           displayAppName,
                           appPath,
                           executePaths,
                           lockProcesses,
                           defaultUpdateUri
                           ));
            }
            catch (Exception exc)
            {
                ErrorBox.Show(UpdStr.UPDATER, exc);
            }

            return(false);
        }
Example #3
0
        public bool CheckExistence(NotificationSettings notificationSettings = NotificationSettings.ShowMessages)
        {
            try
            {
                if (repository.HasAny())
                {
                    if (notificationSettings == NotificationSettings.ShowMessages)
                    {
                        InfoBox.Show(ConnectionSuccessfulInfoTitle, ConnectionSuccessfulInfoMessage);
                    }
                }
                else
                {
                    do
                    {
#if DEBUG
                        CreateDefaultEntity();
#else
                        InfoBox.Show(CreateInfoTitle, CreateInfoMessage);
                        window.ShowDialog();
#endif
                    }while (!repository.HasAny());
                }
                return(true);
            }
            catch (Exception ex)
            {
                var details = new ExceptionDetails(ex).Details;
                ErrorBox.Show(CreationErrorTitle, String.Concat(CreationErrorMessage, Environment.NewLine, details));
            }
            return(false);
        }
        private static bool SetBackgroundBmp(string filename)
        {
#if !__MonoCS__
            var spif = SPIF.SPIF_SENDCHANGE | SPIF.SPIF_UPDATEINIFILE | SPIF.SPIF_SENDWININICHANGE;     // SPIF.SPIF_UPDATEINIFILE | SPIF.SPIF_SENDWININICHANGE
            if (!SystemParametersInfo(SystemParameterInfoActionType.SPI_SETDESKWALLPAPER, 0, filename, spif))
            {
                ErrorBox.ShowLastWin32Error();
                return(false);
            }
#else
            var process = new Process();
            process.StartInfo.FileName               = "dconf";
            process.StartInfo.Arguments              = String.Concat("write \"/org/gnome/desktop/background/picture-uri\" \"'file://", filename, "'\"");
            process.StartInfo.UseShellExecute        = false;
            process.StartInfo.RedirectStandardError  = true;
            process.StartInfo.RedirectStandardInput  = true;
            process.StartInfo.RedirectStandardOutput = true;
            process.Start();
            process.WaitForExit();
            var error = process.StandardError.ReadToEnd();
            if (!String.IsNullOrWhiteSpace(error))
            {
                ErrorBox.Show("Change background error", error);
                return(false);
            }
#endif

            return(true);
        }
Example #5
0
        public static void Elevate()
        {
            var  pricipal = new WindowsPrincipal(WindowsIdentity.GetCurrent());
            bool isInAdministratorRole = pricipal.IsInRole(WindowsBuiltInRole.Administrator);

            if (!isInAdministratorRole)
            {
                var startInfo = new ProcessStartInfo
                {
                    UseShellExecute  = true,
                    WorkingDirectory = Environment.CurrentDirectory,
                    FileName         = Application.ExecutablePath,
                    Arguments        = String.Join(" ", Environment.GetCommandLineArgs().Skip(1).Select(arg => $"\"{arg}\"")),
                    Verb             = "runas"
                };
                try
                {
                    Process.Start(startInfo);
                }
                catch (Win32Exception ex)
                {
                    ErrorBox.Show(ex);
                }
                finally
                {
                    Environment.Exit(0);
                }
            }
        }
        private void LoadStory(RichTextBox rtbStory)
        {
            var storyTxt = Path.Combine(Application.StartupPath, "story.txt");
            var storyRtf = Path.Combine(Application.StartupPath, "story.rtf");

            if (File.Exists(storyRtf))
            {
                try
                {
                    rtbStory.LoadFile(storyRtf);
                }
                catch (Exception ex)
                {
                    ErrorBox.Show(ex);
                }
            }
            else if (File.Exists(storyTxt))
            {
                rtbStory.Text = File.ReadAllText(storyTxt);
            }
            else
            {
                rtbStory.Text = String.Concat(Lng.Elem("There is no 'story.rtf' or 'story.txt' file in the folder: "), Application.StartupPath);
            }
        }
Example #7
0
        private void OpenFile(string fileName)
        {
            var fileExtension = Path.GetExtension(fileName);

            try
            {
                switch (fileExtension)
                {
                case ".tmd":
                    OpenDocumentFile(fileName);
                    break;

                case ".resx":
                    ImportResources(fileName, _resXFileReader);
                    break;

                case ".xlsx":
                    ImportResources(fileName, _excelFileReader);
                    break;

                default:
                    DisplayFileFormatWarning(fileName);
                    break;
                }
            }
            catch (FileLoadException e)
            {
                ErrorBox.Show(e.Message);
            }
        }
Example #8
0
        private void HandleException(Exception ex)
        {
            var now = DateTime.UtcNow;

            var errorDetails = new StringBuilder();

            errorDetails.AppendLine($"{now.ToShortDateString()} {now.ToLongTimeString()}");
            errorDetails.Append(new ExceptionDetails(ex).Details);

            fileLogger.Log(errorDetails.ToString());
            if (showUnhandledMessages)
            {
                try
                {
                    ErrorBox.Show(ex, Timeout.Infinite);
                }
                catch
                {
                    ShowException(ex);
                }
            }

            if (exitOnUnhandledException)
            {
                Environment.Exit(-1);
            }
        }
        async void OnAcceptPassphraseAsync(string passphrase)
        {
            if (string.IsNullOrEmpty(passphrase))
            {
                ErrorBox.Show("The passphrase is required.");
                return;
            }


            var op = new LongRunningOperation(p => { }, () => { });

            try
            {
                this.deviceVaultService.TryLoadDecryptAndSetMasterRandomKeyAsync(passphrase, op.Context).ConfigureAwait(false).GetAwaiter().GetResult();
                await this.profileViewModel.LoadProfile();

                await this.cancellation.StartWorkers();

                NavigationService.ShowContactsView();
            }
            catch (Exception ex)
            {
                var result = MockLocalization.ReplaceKey(ex.Message);

                if (result != ex.Message)
                {
                    MessageBox.Query("Device Vault", "\r\nIncorrect Passphrase.", Strings.Ok);
                }
                else
                {
                    ErrorBox.ShowException(ex);
                }
            }
        }
Example #10
0
 public override void HandleEvent(ref Event Event)
 {
     try
     {
         base.HandleEvent(ref Event);
         if ((Event.What & FocusedEvents) != 0)
         {
             Phase = Phases.phPreProcess;
             HandleEach(new HandleEachProc(DoHandleEvent), ref Event);
             Phase = Phases.phPhocused;
             DoHandleEvent(Current, ref Event);
             Phase = Phases.phPostProcess;
             HandleEach(new HandleEachProc(DoHandleEvent), ref Event);
         }
         else
         {
             Phase = Phases.phPhocused;
             if ((Event.What & PositionalEvents) != 0)
             {
                 DoHandleEvent(FirstThatContainsMouse(
                                   new FirstThatContainsMouseProc(ContainsMouse), Event.Where), ref Event);
             }
             else
             {
                 HandleEach(new HandleEachProc(DoHandleEvent), ref Event);
             }
         }
     }
     catch (Exception Ex)
     {
         ErrorBox.Show("Exception : " + Ex.GetType().ToString(), Ex.Message, Ex.StackTrace);
         throw;
     }
 }
Example #11
0
        private void BoxSqlCurrentSubQuery_OnLostKeyboardFocus(object sender, KeyboardFocusChangedEventArgs e)
        {
            if (QBuilder.ActiveUnionSubQuery == null)
            {
                return;
            }
            try
            {
                ErrorBox.Show(null, QBuilder.SyntaxProvider);

                QBuilder.ActiveUnionSubQuery.ParentSubQuery.SQL = ((TextBox)sender).Text;

                var sql = QBuilder.ActiveUnionSubQuery.ParentSubQuery.GetResultSQL(QBuilder.SQLFormattingOptions);

                _transformerSql.Query = new SQLQuery(QBuilder.ActiveUnionSubQuery.SQLContext)
                {
                    SQL = sql
                };
                _lastValidText1 = ((TextBox)sender).Text;
            }
            catch (SQLParsingException ex)
            {
                ErrorBox2.Show(ex.Message, QBuilder.SyntaxProvider);
                _errorPosition1 = ex.ErrorPos.pos;
            }
        }
Example #12
0
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     // 如果应用程序是在调试器外运行的,则使用浏览器的
     // 异常机制报告该异常。在 IE 上,将在状态栏中用一个
     // 黄色警报图标来显示该异常,而 Firefox 则会显示一个脚本错误。
     if (!System.Diagnostics.Debugger.IsAttached)
     {
         // 注意: 这使应用程序可以在已引发异常但尚未处理该异常的情况下
         // 继续运行。
         // 对于生产应用程序,此错误处理应替换为向网站报告错误
         // 并停止应用程序。
         e.Handled = true;
         Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
     }
     else
     {
         Deployment.Current.Dispatcher.BeginInvoke(
             delegate
         {
             ErrorBox errorBox = new ErrorBox();
             errorBox.Error    = e.ExceptionObject;
             e.Handled         = true;
             errorBox.Show();
         }
             );
     }
 }
Example #13
0
        private void HandleUrl(string url)
        {
            if (useSimpleControl)
            {
                return;
            }

            if (string.IsNullOrEmpty(url))
            {
                return;
            }

            if (url.StartsWith("file://")) // Check existence
            {
                string path = url.Substring(7);
                if (string.IsNullOrEmpty(path))
                {
                    return;
                }
                if (!File.Exists(path) && !Directory.Exists(path))
                {
                    ErrorBox.Show(this, string.Format(SR.PathNotFound, path));
                    return;
                }
            }

            try { Process.Start(url); }
            catch (Exception ex)
            {
                ErrorBox.Show(this, string.Format(SR.CantHandleUrl, url, ex.ToFormattedString()));
            }
        }
Example #14
0
        /// <summary>
        /// Processes a given string of command line into this form instance
        /// </summary>
        /// <param name="args">The commang line to process</param>
        public void ProcessCommandLine(string[] args)
        {
            // Load a gif file from the command line arguments
            if (args.Length > 0 && File.Exists(args[0]))
            {
                try
                {
                    LoadGif(args[0]);
                }
                catch (Exception ex)
                {
                    ErrorBox.Show("Error: " + ex.Message, "Error", ex.StackTrace);
                }

                try
                {
                    LoadGifsInFolder(Path.GetDirectoryName(args[0]));
                }
                catch (Exception)
                {
                    // ignored
                }
            }
            else
            {
                if (_currentGif.GifPath == "")
                {
                    _openFile = true;
                }
            }
        }
Example #15
0
        public VncClient(string serverHost, ushort listenerPort)
            : base(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp)
        {
            ListenerPortOfServer = listenerPort;
            this.serverHost      = serverHost;

            ReceiveTimeout = Constants.SOCKET_CONNECTION_TIMEOUT;
            SendTimeout    = Constants.SOCKET_CONNECTION_TIMEOUT;
            SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveBuffer, Constants.MAX_BUFFER_SIZE);
            SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, Constants.MAX_BUFFER_SIZE);

            LingerState  = new LingerOption(true, 1);
            NoDelay      = true;
            DontFragment = true;

            var  result  = BeginConnect(this.serverHost, ListenerPortOfServer, null, null);
            bool success = result.AsyncWaitHandle.WaitOne(Constants.SOCKET_CONNECTION_TIMEOUT, true);

            if (!success)
            {
                ErrorBox.Show("Unable to connect", "Check if VNC server is running, check the service port and the firewall settings");
            }
            else
            {
                DataArrived += new DataArrivedEventHandler(DataArrivedHandler);
                Task.Factory.StartNew(() => { Receiver(); });
            }
        }
        public MainForm()
        {
            try
            {
                string keyName   = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
                string valueName = Path.GetFileName(Application.ExecutablePath);
                if (Registry.GetValue(keyName, valueName, null) == null)
                {
                    Registry.SetValue(keyName, valueName, 32768, RegistryValueKind.DWord);
                }
            }
            catch
            {
                ErrorBox.Show(Lng.Elem("Registry write error"), Lng.Elem(@"You need to start the application with administrator right for the first time if you want to use the map functionality or create HKEY_LOCAL_MACHINE\SOFTWARE\[WOW6432Node\]Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\Storyteller.exe REG_DWORD 0x8000 registry entries."));
            }

            InitializeComponent();

            LoadIcons();

            imageList.Images.Add("0", IconChar.Folder.ToBitmap(16, Color.DarkGoldenrod));
            imageList.Images.Add("1", IconChar.Image.ToBitmap(16, Color.ForestGreen));
            imageList.Images.Add("2", IconChar.FileAudio.ToBitmap(16, Color.LightSeaGreen));
            imageList.Images.Add("3", IconChar.User.ToBitmap(16, Color.BlanchedAlmond));

            DirectoryExtension.CreateApplicationDirectories();

            tvImages.Nodes.GetFilesAndFolders(PathProvider.Maps, 1, ExtensionProvider.ImagesFilter);
            tvMusic.Nodes.GetFilesAndFolders(PathProvider.Music, 2, ExtensionProvider.AudioFilter);
            tvSoundEffects.Nodes.GetFilesAndFolders(PathProvider.SoundEffects, 2, ExtensionProvider.AudioFilter);
            tvCharacters.Nodes.GetFilesAndFolders(PathProvider.Characters, 1, ExtensionProvider.ImagesFilter);
            tvVideoClips.Nodes.GetFilesAndFolders(PathProvider.VideoClips, 1, ExtensionProvider.VideoFilter);

            tvImages.ExpandAll();

            FillListViewGroup(lvMarket, "Accomodation");
            FillListViewGroup(lvMarket, "Animals");
            FillListViewGroup(lvMarket, "Clothes");
            FillListViewGroup(lvMarket, "Debauchery");
            FillListViewGroup(lvMarket, "Food");
            FillListViewGroup(lvMarket, "Other");
            FillListViewGroup(lvMarket, "Trappings");
            FillListViewGroup(lvMarket, "Travelling");

            GetLanguages();

            Lng.Translate(this);

            LoadStory(rtbStory);

            charcterGenerator = new CharcterGenerator
            {
                TopLevel        = false,
                FormBorderStyle = FormBorderStyle.None,
                Dock            = DockStyle.Fill
            };
            pCharacterContent.Controls.Add(charcterGenerator);
            charcterGenerator.Show();
        }
 private void SqlTextEditor_OnTextChanged(object sender, EventArgs e)
 {
     if (_sqlContext == null)
     {
         return;
     }
     ErrorBox.Show(null, sqlTextEditor.SyntaxProvider);
 }
Example #18
0
        static void SpeechRecognitionEngineOnSpeechRecognized(object sender, SpeechRecognizedEventArgs speech_recognized_event_args)
        {
            var recognition_result = speech_recognized_event_args.Result;

            if (recognition_result.Confidence < 0.6)
            {
                return;
            }

            var stopped = false;

            foreach (var command in from command in commands from command_name in command.CommandName.Where(command_name => String.Compare(command_name, speech_recognized_event_args.Result.Text, StringComparison.OrdinalIgnoreCase) == 0) select command)
            {
                try
                {
                    executeCommands |= command is StartListening;
                    if (executeCommands)
                    {
                        if (command is IStopListening)
                        {
                            stopped = true;
                            SpeechRecognitionEngine.RecognizeAsyncStop();
                            if (!(command is IStopListening))
                            {
                                new StopListeningCmd().Execute();
                            }
                        }

                        command.Execute();

                        if (command.StopListening)
                        {
                            new StopListeningCmd().Execute();
                            executeCommands = false;
                        }
                    }
                    //else Read("Use \"Start listening\" command to start recognition.");

                    executeCommands &= !(command is StopListeningCmd);
                }
                catch (Exception ex)
                {
                    ErrorBox.Show(ex);
                }
                finally
                {
                    if ((command is IStopListening) && stopped)
                    {
                        SpeechRecognitionEngine.RecognizeAsync(RecognizeMode.Multiple);
                        if (!(command is IStopListening))
                        {
                            new StartListening().Execute();
                        }
                    }
                }
                break;
            }
        }
Example #19
0
        public int LineStart(int P)
        {
            int i     = 0;
            int start = 0;
            int pc    = 0;
            int LineStart;

            if (P > CurPtr)
            {
                start = (int)GapLen;
                pc    = start;
                i     = (int)(P - CurPtr);
                pc--;
                while (i > 0)
                {
                    if ((buffer[pc] == '\x000A') || (buffer[pc] == '\x000D'))
                    {
                        break;
                    }
                    pc--;
                    i--;
                }
            }
            else
            {
                i = 0;
            }
            if (i == 0)
            {
                start = 0;
                i     = P;
                pc    = start + P;
                pc--;
                while (i > 0)
                {
                    try
                    {
                        if ((buffer[pc] == '\x000A') || (buffer[pc] == '\x000D'))
                        {
                            break;
                        }
                    }
                    catch (Exception Ex)
                    {
                        ErrorBox.Show(Ex.GetType().ToString(), Ex.Message, pc.ToString() + "\n" + Ex.StackTrace);
                    }
                    pc--;
                    i--;
                }
                if (i == 0)
                {
                    LineStart = 0;
                    return(LineStart);
                }
            }
            LineStart = pc - start + 1;
            return(LineStart);
        }
        public virtual void ErrorDataReceived(object sender, DataReceivedEventArgs e)
        {
            if (String.IsNullOrEmpty(e.Data))
            {
                return;
            }

            ErrorBox.Show("Process execution failed", e.Data);
        }
Example #21
0
 void OnPlaybackStopped(object sender, StoppedEventArgs e)
 {
     UpdateAmplitudeDisplay(0, 0);
     if (e.Exception != null)
     {
         ErrorBox.Show(e.Exception.Message, "Playback Device Error");
     }
     Log.Info($"Playback stopped.");
 }
Example #22
0
        private void newToolStripMenuItem_Click(object sender, EventArgs e)
        {
            NewPlug newp = new NewPlug();

            newp.ShowDialog();

            if (newp.DialogResult == DialogResult.OK)
            {
                int get_it = 0;
                if (Directory.Exists(Application.StartupPath + @"/plugins/" + newp.assembly))
                {
                    DialogResult dr = ErrorBox.Show("The plugin \"" + newp.textBox1.Text + "\" is already exists.\r\nContinue?",
                                                    Application.ProductName, ErrorBoxButtons.YesNo, ErrorBoxIcon.Question);

                    if (dr != DialogResult.Yes)
                    {
                        get_it = 1;
                    }
                }

                if (get_it != 1)
                {
                    this.optionsToolStripMenuItem.Enabled        = true;
                    this.startCompilingToolStripMenuItem.Enabled = true;
                    textBoxCode = null;
                    this.codeBox1.richTextBox1.ReadOnly  = false;
                    this.codeBox1.richTextBox1.BackColor = SystemColors.Window;
                    this.Text = Application.ProductName + " - " + newp.textBox1.Text;

                    plug_name  = newp.textBox1.Text;
                    plug_descr = newp.textBox2.Text;
                    assembly   = newp.assembly;

                    Assembly     _assembly = Assembly.GetExecutingAssembly();
                    StreamReader _textStreamReader;

                    //-----+

                    _textStreamReader = new StreamReader(_assembly.GetManifestResourceStream("plugEditor.defaultcode.defaultcode.txt"));
                    if (_textStreamReader.Peek() != -1)
                    {
                        textBoxCode = _textStreamReader.ReadToEnd();
                    }

                    textBoxCode = textBoxCode.Replace("plug_name", plug_name);
                    textBoxCode = textBoxCode.Replace("plug_descr", plug_descr);
                    textBoxCode = textBoxCode.Replace("assembly_name", assembly);

                    //-----+

                    codeEnd  = "}";
                    codeEnd += "}";

                    //-----+
                }
            }
        }
Example #23
0
        private void StartClick(object sender, EventArgs e)
        {
            if (_fuzzOn)
            {
                return;
            }

            _options.MatchPattern   = _textPattern.Text;
            _options.ReversePattern = _reversePattern.Checked;


            GenerateRequestsToFuzz();


            ErrorBox error = new ErrorBox();

            if (!String.IsNullOrWhiteSpace(_fileSelector.Text))
            {
                _outputFile = new TrafficViewerFile();
                _outputFile.Save(_fileSelector.Text);
                if (!File.Exists(_fileSelector.Text))
                {
                    error.Show("Invalid result file location");
                    return;
                }
                _options.OutputFile = _fileSelector.Text;
            }
            else
            {
                _outputFile = TrafficViewer.Instance.TrafficViewerFile;
                _outputFile.SetState(AccessorState.Tailing);
            }

            if (!int.TryParse(_textNumThreads.Text, out _numThreads))
            {
                error.Show("Invalid number of threads specified");

                return;
            }
            _options.NumberOfThreads = _numThreads;
            _options.Save();
            GenerateAndRunPayloads();
        }
Example #24
0
        public override void Error(Exception exception)
        {
            #region Sanity checks
            if (exception == null)
            {
                throw new ArgumentNullException(nameof(exception));
            }
            #endregion

            _owner.Invoke(() => ErrorBox.Show(_owner, exception, LogRtf));
        }
Example #25
0
 public void GoToAppPage()
 {
     try
     {
         Process.Start(Resources.APP_PAGE);
     }
     catch (Exception exc)
     {
         ErrorBox.Show(Strings.APP_MANAGER, exc);
     }
 }
Example #26
0
        public override void Error(Exception exception)
        {
            #region Sanity checks
            if (exception == null)
            {
                throw new ArgumentNullException(nameof(exception));
            }
            #endregion

            ThreadUtils.RunSta(() => ErrorBox.Show(null, exception, LogRtf));
        }
Example #27
0
 public virtual void Run()
 {
     try
     {
         Execute();
     }
     catch (Exception Ex)
     {
         ErrorBox.Show("Exception : " + Ex.GetType().ToString(), Ex.Message, Ex.StackTrace);
     }
 }
 private void Send(string message, string caller)
 {
     try
     {
         vncClient.Send(message);
     }
     catch (Exception ex)
     {
         ErrorBox.Show(caller, ex);
     }
 }
Example #29
0
 private void ShowLogin()
 {
     if (loginForm.ShowDialog() == DialogResult.OK)
     {
         Login(loginForm.LoggedInUser);
     }
     else
     {
         ErrorBox.Show(Lng.Elem("Credentials error"), Lng.Elem("Wrong user name or password"));
     }
 }
Example #30
0
        private void SaveChanges(object sender, EventArgs e, string what)
        {
            DialogResult dr = ErrorBox.Show("Save graph changes?", Application.ProductName,
                                            ErrorBoxButtons.YesNoCancel, ErrorBoxIcon.Question);

            if (what == "new")
            {
                if (dr == DialogResult.Yes)
                {
                    newfile = 1;
                    saveAsToolStripMenuItem_Click(this, e);
                }
                else if (dr == DialogResult.No)
                {
                    file_path = "";
                    if (plug_name != null)
                    {
                        this.Text = Application.ProductName;
                    }
                    dot.Clear();
                    line.Clear();
                    Graph1.count = 0;
                }
            }
            else if (what == "exit")
            {
                if (dr == DialogResult.Yes)
                {
                    saveAsToolStripMenuItem_Click(this, e);
                }
                else if (dr == DialogResult.No)
                {
                    this.Close();
                }
                else if (dr == DialogResult.Cancel)
                {
                    exit = 0;
                }
            }
            else if (what == "open")
            {
                if (dr == DialogResult.Yes)
                {
                    open = 1;
                    saveAsToolStripMenuItem_Click(this, e);
                }
                else if (dr == DialogResult.No)
                {
                    open = 1;
                    openToolStripMenuItem_Click(this, e);
                }
            }
        }