Esempio n. 1
0
        private void btnInnerException_Click(object sender, EventArgs e)
        {
            var errorViewer = new ErrorViewer(_exception.InnerException);
            errorViewer.ShowDialog();

            errorViewer.Dispose();
            GC.Collect(1);
        }
        private void btnInnerException_Click(object sender, EventArgs e)
        {
            var errorViewer = new ErrorViewer(_exception.InnerException);

            errorViewer.ShowDialog();

            errorViewer.Dispose();
            GC.Collect(1);
        }
Esempio n. 3
0
        static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            LogWriter.Log(e.Exception, "Thread Exception");

            var errorViewer = new ErrorViewer(e.Exception);
            errorViewer.ShowDialog();

            Environment.Exit(1);
        }
Esempio n. 4
0
        static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            var ex = (Exception)e.ExceptionObject;
            LogWriter.Log(ex, "Unhandled Exception");

            var errorViewer = new ErrorViewer(ex);
            errorViewer.ShowDialog();

            Environment.Exit(2);
        }
Esempio n. 5
0
        private void AddPictures(string fileName)
        {
            try
            {
                Cursor = Cursors.WaitCursor;

                if (_listFramesEdit.Any())
                {
                    ResetUndoProp();
                }

                Size imageSize = _listFramesEdit.Count == 0 ? new Size(0, 0) : _listFramesEdit[0].From().Size;

                // Insert the frame(s) and set the last delay used.
                List<Bitmap> bitmapsList = ImageUtil.GetBitmapsFromFile(fileName, _listFramesEdit.Count, imageSize);

                bitmapsList.Reverse();

                int frame = 0;
                foreach (Bitmap item in bitmapsList)
                {
                    string endName = String.Format("{0}{1}I{2}.bmp", _pathTemp, frame, DateTime.Now.ToString("yyyy-MM-dd hh-mm-ss"));

                    item.Save(endName, ImageFormat.Bmp);
                    _listFramesEdit.Insert(trackBar.Value, endName);
                    _listDelayEdit.Insert(trackBar.Value, _delay); //TODO: Get the delay.

                    frame++;
                }

                tvFrames.Add(bitmapsList.Count);

                bitmapsList.Clear();
                bitmapsList = null;

                GC.Collect();
            }
            catch (Exception ex)
            {
                LogWriter.Log(ex, "Error importing image");

                var errorViewer = new ErrorViewer(ex);
                errorViewer.ShowDialog();
            }
            finally
            {
                // Update the content for user
                trackBar.Maximum = _listFramesEdit.Count - 1;
                pictureBitmap.Image = _listFramesEdit[trackBar.Value].From();
                this.Text = Resources.Title_EditorFrame + trackBar.Value + " - " + (_listFramesEdit.Count - 1);
                this.Cursor = Cursors.Default;

                DelayUpdate();
            }
        }