Ejemplo n.º 1
0
 public FileErasureTargetConfigurer()
 {
     InitializeComponent();
     Theming.ApplyTheme(this);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public UpdateForm()
 {
     InitializeComponent();
     Theming.ApplyTheme(this);
     updateListDownloader.RunWorkerAsync();
 }
 public CustomMethodPassEditor()
 {
     InitializeComponent();
     Theming.ApplyTheme(this);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="reports">The list of reports to upload.</param>
 public BlackBoxUploadForm(IList <BlackBoxReport> reports)
 {
     InitializeComponent();
     Theming.ApplyTheme(this);
     UploadWorker.RunWorkerAsync(reports);
 }
Ejemplo n.º 5
0
 private void BlackBoxMainForm_Load(object sender, EventArgs e)
 {
     Theming.ApplyTheme(this);
     RefreshReports();
 }
Ejemplo n.º 6
0
        public AboutForm(Control parent)
        {
            //Create and position the dialog
            InitializeComponent();
            Theming.ApplyTheme(this);
            ClientSize = new Size(parent.ClientSize.Width, parent.ClientSize.Height);
            Point point = parent.PointToScreen(new Point(0, 0));

            Left = point.X;
            Top  = point.Y;

            //Get the parent dialog's screen buffer.
            ParentBitmap = new Bitmap(parent.ClientSize.Width, parent.ClientSize.Height);
            using (Graphics dest = Graphics.FromImage(ParentBitmap))
            {
                parent.Refresh();
                Point parentPos = parent.PointToScreen(new Point(0, 0));
                dest.CopyFromScreen(parentPos, new Point(0, 0), parent.ClientSize);
            }

            //Load the localised About Text
            AboutText = S._(@"Eraser is an advanced security tool for Windows, which allows you to completely remove sensitive data from your hard drive by overwriting it several times with carefully selected patterns. Eraser is Free software and its source code is released under GNU General Public License.

Erasure Method Credits:
Gutmann (35 Pass):	    Copyright Peter Gutmann & Colin Plumb
Gutmann Lite (10 pass):         Copyright Peter Gutmann & Colin Plumb
US DoD (7 pass):			Copyright United States Department of
				Defense
US DoD (3 pass):			Copyright United States Department of
				Defense
US Air Force 5020 (3 pass):	Copyright United States Department of
				Defense
US Army AR380-19 (3 pass):	Copyright United States Department of
				Defense
RCMP TSSIT OPS-II (7 pass):	Copyright Government of Canada,
				Royal Canadian Mounted Police
Schneier's Method (7 pass):	Copyright Bruce Schneier
German VSITR (7 pass):		Copyright Germany BSI Verschlusssachen
				-IT-Richtlinien
British HMG IS5 (3 pass):		Copyright British Government
British HMG IS5 (1 pass):		Copyright British Government
Russian GOST P50739-95 (2 pass):	Copyright Government of the Soviet
				Union 
Pseudorandom data (1 pass):	Public Domain
First/Last 16Kb:			Copyright The Eraser Project

Eraser Copyright " + "\u00A9" + @" The Eraser Project

Eraser Project Members:
" + "\u2022" + @" Sami Tolvanen:		Mentor/Initiator
" + "\u2022" + @" Garrett Trant:		Mentor/Researcher
" + "\u2022" + @" Joel Low:		Lead Developer
" + "\u2022" + @" Kasra Nassiri:		Developer/Security Researcher
" + "\u2022" + @" Dennis van Lith:		Designer");

            //Create the About bitmap localised for the current version (sans scrolling
            //text) so it can be drawn quickly later.
            //First, duplicate the bitmap and scale it according to the resolution of the
            //monitor.
            float dpiScale = 0f;

            using (Graphics controlDC = CreateGraphics())
            {
                Debug.Assert(controlDC.DpiX == controlDC.DpiY);
                dpiScale = controlDC.DpiX / 96.0f;
            }

            Bitmap sourceBitmap = Properties.Resources.AboutDialog;

            AboutBitmap = new Bitmap((int)(sourceBitmap.Width * dpiScale),
                                     (int)(sourceBitmap.Height * dpiScale));
            using (Graphics g = Graphics.FromImage(AboutBitmap))
            {
                g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
                g.ScaleTransform(dpiScale, dpiScale);
                g.DrawImage(sourceBitmap, Point.Empty);

                //Scale the font down since we will be using a scale transform later.
                Font = new Font(Font.FontFamily, Font.SizeInPoints / dpiScale);

                //Version number
                Font   boldFont      = new Font(Font, FontStyle.Bold);
                Font   underlineFont = new Font(Font, FontStyle.Underline);
                Brush  textBrush     = new SolidBrush(Color.White);
                PointF eraserPos     = new PointF(168, 80);
                SizeF  eraserSize    = g.MeasureString(S._("Eraser"), boldFont);
                g.DrawString(S._("Eraser"), boldFont, textBrush, eraserPos);

                                #pragma warning disable 429
                string versionString = BuildInfo.CustomBuild ?
                                       S._("{0} (Built: {1:F}, special build)") : S._("{0} (Built: {1:F})");
                                #pragma warning restore 429

                g.DrawString(string.Format(CultureInfo.CurrentCulture, versionString,
                                           BuildInfo.AssemblyFileVersion, BuildInfo.BuildDate),
                             Font, textBrush, new PointF(eraserPos.X + eraserSize.Width + 3, eraserPos.Y));

                //Copyright and Website
                string copyrightText = S._("copyright \u00a9 2008-2015 The Eraser Project");
                PointF copyrightPos  = new PointF(eraserPos.X, eraserPos.Y + eraserSize.Height);
                SizeF  copyrightSize = g.MeasureString(copyrightText, Font);
                g.DrawString(copyrightText, Font, textBrush, copyrightPos);

                const string websiteText = "http://eraser.heidi.ie/";
                PointF       websitePos  = new PointF(copyrightPos.X, copyrightPos.Y + copyrightSize.Height);
                SizeF        websiteSize = g.MeasureString(websiteText, Font);
                g.DrawString(websiteText, underlineFont, textBrush, websitePos);
                WebsiteRect = new Rectangle((int)websitePos.X, (int)websitePos.Y,
                                            (int)websiteSize.Width, (int)websiteSize.Height);

                //Open source disclaimer.
                string disclaimerText = S._("Eraser is free open-source software!");
                PointF disclaimerPos  = new PointF(websitePos.X, websitePos.Y + websiteSize.Height * 1.5f);
                g.DrawString(disclaimerText, Font, textBrush, disclaimerPos);

                //Donation statement
                string donationText = S._("Please help us to continue developing Eraser - donate some coffee!");
                PointF donationPos  = new PointF(disclaimerPos.X, disclaimerPos.Y + 170);
                SizeF  donationSize = g.MeasureString(donationText, Font);
                g.DrawString(donationText, Font, textBrush, donationPos);
                DonateRect = new Rectangle((int)donationPos.X, (int)donationPos.Y,
                                           (int)donationSize.Width, (int)donationSize.Height);
            }

            //Calculate the position of the About bitmap
            AboutBitmapPos = new Point((ClientSize.Width - AboutBitmap.Width) / 2,
                                       (ClientSize.Height - AboutBitmap.Height) / 2);
            WebsiteRect.X      = (int)(WebsiteRect.X * dpiScale + AboutBitmapPos.X);
            WebsiteRect.Y      = (int)(WebsiteRect.Y * dpiScale + AboutBitmapPos.Y);
            WebsiteRect.Width  = (int)(WebsiteRect.Width * dpiScale);
            WebsiteRect.Height = (int)(WebsiteRect.Height * dpiScale);
            DonateRect.X       = (int)(DonateRect.X * dpiScale + AboutBitmapPos.X);
            DonateRect.Y       = (int)(DonateRect.Y * dpiScale + AboutBitmapPos.Y);
            DonateRect.Width   = (int)(DonateRect.Width * dpiScale);
            DonateRect.Height  = (int)(DonateRect.Height * dpiScale);

            //And calculate the bounds of the About Text.
            AboutTextRect = Rectangle.Truncate(new RectangleF(
                                                   AboutBitmapPos.X + (19 + 149) * dpiScale,
                                                   AboutBitmapPos.Y + (20 + 147) * dpiScale,
                                                   AboutBitmap.Width - (19 + 149 + 20) * dpiScale,
                                                   130 * dpiScale));

            //Create the About Text laid out on screen.
            SizeF aboutTextSize = SizeF.Empty;
            using (Bitmap b = new Bitmap(1, 1))
                using (Graphics g = Graphics.FromImage(b))
                {
                    g.ScaleTransform(dpiScale, dpiScale);
                    aboutTextSize = g.MeasureString(AboutText, Font, AboutTextRect.Width);
                }
            AboutTextBitmap = new Bitmap(AboutTextRect.Width, (int)aboutTextSize.Height);
            using (Graphics g = Graphics.FromImage(AboutTextBitmap))
            {
                g.Clear(Color.FromArgb(0, 0, 0, 0));
                g.ScaleTransform(dpiScale, dpiScale);
                g.DrawString(AboutText, Font, new SolidBrush(Color.White),
                             new RectangleF(0.0f, 0.0f, AboutTextBitmap.Width / dpiScale,
                                            AboutTextBitmap.Height / dpiScale));
            }

            AboutTextScrollTop = AboutTextRect.Height / 2;
            animationTimer_Tick(null, null);
            animationTimer.Start();
        }
Ejemplo n.º 7
0
        public SettingsForm()
        {
            InitializeComponent();
            Theming.ApplyTheme(this);

            //Populate the list of erasure passes, except the FL16KB.
            foreach (IErasureMethod method in Host.Instance.ErasureMethods)
            {
                if (method.Guid != typeof(FirstLast16KB).GUID)
                {
                    fl16MethodCmb.Items.Add(method);
                }
            }

            //Load the settings.
            DefaultPluginSettings settings = DefaultPlugin.Settings;

            if (settings.FL16Method != Guid.Empty)
            {
                foreach (object item in fl16MethodCmb.Items)
                {
                    if (((IErasureMethod)item).Guid == settings.FL16Method)
                    {
                        fl16MethodCmb.SelectedItem = item;
                        break;
                    }
                }
            }

            if (fl16MethodCmb.SelectedIndex == -1)
            {
                Guid methodGuid =
                    Host.Instance.Settings.DefaultFileErasureMethod;
                if (methodGuid == typeof(FirstLast16KB).GUID)
                {
                    methodGuid = typeof(Gutmann).GUID;
                }

                foreach (object item in fl16MethodCmb.Items)
                {
                    if (((IErasureMethod)item).Guid == methodGuid)
                    {
                        fl16MethodCmb.SelectedItem = item;
                        break;
                    }
                }
            }

            if (DefaultPlugin.Settings.EraseCustom != null)
            {
                customMethods = new Dictionary <Guid, CustomErasureMethod>(
                    DefaultPlugin.Settings.EraseCustom);

                //Display the whole set on the list.
                foreach (Guid guid in customMethods.Keys)
                {
                    AddMethod(customMethods[guid]);
                }
            }
            else
            {
                customMethods = new Dictionary <Guid, CustomErasureMethod>();
            }
        }
Ejemplo n.º 8
0
        public MainForm()
        {
            InitializeComponent();
            SettingsPage  = new SettingsPanel();
            SchedulerPage = new SchedulerPanel();
            contentPanel.Controls.Add(SchedulerPage);
            contentPanel.Controls.Add(SettingsPage);
            if (!IsHandleCreated)
            {
                CreateHandle();
            }

            Theming.ApplyTheme(this);
            Theming.ApplyTheme(notificationMenu);

            //We need to see if there are any tools to display
            foreach (IClientTool tool in Host.Instance.ClientTools)
            {
                tool.RegisterTool(tbToolsMenu);
            }
            if (tbToolsMenu.Items.Count == 0)
            {
                //There are none, hide the menu
                tbTools.Visible         = false;
                tbToolsDropDown.Visible = false;
            }

            //We also need to see if we have any notifier classes we need to register.
            foreach (INotifier notifier in Host.Instance.Notifiers)
            {
                notifier.Sink = this;
            }
            Host.Instance.Notifiers.Registered += Notifier_Registered;

            //For every task we need to register the Task Started and Task Finished
            //event handlers for progress notifications
            foreach (Task task in Program.eraserClient.Tasks)
            {
                OnTaskAdded(this, new TaskEventArgs(task));
            }
            Program.eraserClient.TaskAdded   += OnTaskAdded;
            Program.eraserClient.TaskDeleted += OnTaskDeleted;

            //Check if we have tasks running already.
            foreach (Task task in Program.eraserClient.Tasks)
            {
                if (task.Executing)
                {
                    OnTaskProcessing(task, EventArgs.Empty);
                    break;
                }
            }

            //Check the notification area context menu's minimise to tray item.
            hideWhenMinimisedToolStripMenuItem.Checked = EraserSettings.Get().HideWhenMinimised;

            //Set the docking style for each of the pages
            SchedulerPage.Dock   = DockStyle.Fill;
            SettingsPage.Visible = false;

            //Show the default page.
            ChangePage(MainFormPage.Scheduler);
        }