protected override void OnShown(EventArgs e)
        {
            base.OnShown(e);

            if (_overrideIcon != null)
            {
                Icon = _overrideIcon;
            }
            else if (ParentForm?.Icon != null)
            {
                Icon = ParentForm.Icon;
            }
            else
            {
                try
                {
                    Icon = ProcessTools.GetIconFromEntryExe();
                }
                catch
                {
                    /* Fall back to the default icon */
                }
            }

            SetHeight();
            SetWidth();

            if (StartPosition == FormStartPosition.CenterParent && Owner != null && Owner.Visible)
            {
                this.CenterToForm(Owner);
            }

            Opacity = 1;
        }
        public static StartupManagerWindow ShowManagerWindow()
        {
            var window = new StartupManagerWindow();

            try
            {
                window.Icon = ProcessTools.GetIconFromEntryExe();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            return(window);
        }
Example #3
0
        public MainWindow()
        {
            _handler = new UninstallHandler();
            InitializeComponent();

            try
            {
                Icon = ProcessTools.GetIconFromEntryExe();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }

            _timeSinceStart = Process.GetCurrentProcess().StartTime.ToUniversalTime();
        }
 private void StringEditBox_Shown(object sender, EventArgs e)
 {
     if (ParentForm != null && ParentForm.Icon != null)
     {
         Icon = ParentForm.Icon;
     }
     else
     {
         try
         {
             Icon = ProcessTools.GetIconFromEntryExe();
         }
         catch
         {
             /* Fall back to the default icon */
         }
     }
 }
Example #5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (Owner?.Icon != null)
            {
                Icon = Owner.Icon;
            }
            else
            {
                try
                {
                    Icon = ProcessTools.GetIconFromEntryExe();
                }
                catch
                {
                    /* Fall back to the default icon */
                }
            }
        }
        public UninstallSelection(DirectoryInfo target)
        {
            InitializeComponent();
            targetList1.Populate(target);

            try
            {
                Icon = ProcessTools.GetIconFromEntryExe();
            }
            catch (Exception ex)
            {
                /* Fall back to a low quality icon */
                var handle = Resources.icon.GetHicon();
                Icon = Icon.FromHandle(handle);

                Console.WriteLine(ex);
                LogWriter.WriteMessageToLog(ex.ToString());
            }

            Text = string.Format(Localisation.UninstallSelection_Title, target.Name);
        }