Exemple #1
0
        private static void Main()
        {
            ServicePointManager.ServerCertificateValidationCallback += delegate
            {
                return(true);
            };

            ClrTmp(true);

            Utils.CurrentRandom = new Random();

            Settings.Default.PropertyChanged += Default_PropertyChanged;

            if (Settings.Default.AppsXml == "")
            {
                Settings.Default.AppsXml = Resources.DefaultISOs;
            }
            ISOInfo.RefreshISOs();


            Thread.CurrentThread.CurrentCulture   = new CultureInfo(Settings.Default.Lang);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Lang);

            Application.ApplicationExit += Application_ApplicationExit;
            Application.ThreadException += Application_ThreadException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainWindow());

            ClrTmp();
        }
Exemple #2
0
 private void theupdate()
 {
     mniUpdate.Visible = true;
     checkForUpdates();
     mniUpdate.Visible = true;
     ISOInfo.RefreshISOs();
 }
Exemple #3
0
        private static void Main()
        {
            ServicePointManager.ServerCertificateValidationCallback += delegate { return(true); };

            FileIO.ClrTmp(true);

            Settings.Default.PropertyChanged += Default_PropertyChanged;

            if (Settings.Default.AppsXml == "")
            {
                Settings.Default.AppsXml = Resources.DefaultISOs;
            }
            ISOInfo.RefreshISOs();

            Localization.UpdateThreadCulture();

            Application.ApplicationExit += delegate { FileIO.ClrTmp(); };
            Application.ThreadException += (_, e) => Utils.HandleUnhandled(e.Exception, "Thread exception");
            AppDomain.CurrentDomain.UnhandledException += (_, e) => Utils.HandleUnhandled((Exception)e.ExceptionObject);

            W7RUtils.Install();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainWindow());

            FileIO.ClrTmp();
        }
Exemple #4
0
 public static void SetAppLng(CultureInfo c)
 {
     Settings.Default.Lang = c.Name;
     Settings.Default.Save();
     Thread.CurrentThread.CurrentCulture   = new CultureInfo(Settings.Default.Lang);
     Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Lang);
     Settings.Default.Save();
     ISOInfo.RefreshISOs();
 }
Exemple #5
0
 private static void Default_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     Settings.Default.Save();
     if (e.PropertyName == "Lang")
     {
         Localization.UpdateThreadCulture();
         ISOInfo.RefreshISOs();
     }
 }
Exemple #6
0
 private static void Default_PropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     Settings.Default.Save();
     if (e.PropertyName == "Lang")
     {
         Thread.CurrentThread.CurrentCulture   = new CultureInfo(Settings.Default.Lang);
         Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.Default.Lang);
         ISOInfo.RefreshISOs();
     }
 }
Exemple #7
0
        public void AddImage(string filePath, ISOV ver = null)
        {
            if (CurImages.Count(x => x.FilePath == filePath) != 0)
            {
                return;
            }

            var name = Path.GetFileNameWithoutExtension(filePath);
            var desc = "";
            var cat  = "";

            if (ver?.Hash == "nover")
            {
                name = ver.Parent.Name;
                desc = ver.Parent.Description;
                cat  = ver.Parent.CategoryTxt;
            }
            else
            {
                if (automaticallyAddISOInfoToolStripMenuItem.Checked && ver?.Hash != "other")
                {
                    ver = ver ?? (ISOInfo.GetFromFile(filePath, new FileInfo(filePath).Length > 750000000));
                    if (ver == null)
                    {
                        MessageBox.Show(Path.GetFileName(filePath) + "\n\n" + Strings.CouldntDetect, "SharpBoot",
                                        MessageBoxButtons.OK,
                                        MessageBoxIcon.Information);
                    }
                    else
                    {
                        name = ver.Name;
                        desc = ver.Parent.Description;
                        cat  = ver.Parent.CategoryTxt;
                    }
                }
            }


            var im = new ImageLine(name, filePath, desc, cat,
                                   typ: filePath.ToLower().EndsWith("img") ? EntryType.IMG : EntryType.ISO);

            CurImages.Add(im);

            SetSize();


            lvIsos.Rows.Add(name, Program.GetFileSizeString(filePath), cat, desc, filePath);
        }
Exemple #8
0
        private void md5stuff()
        {
            th = new Thread(() =>
            {
                Invoke((MethodInvoker)(() => pbxLoading.Visible = true));

                var sw = new Stopwatch();
                sw.Start();
                var resk = ISOInfo.GetFromFile(ISOPath, false);
                sw.Stop();

                Invoke((MethodInvoker)(() =>
                {
                    if (resk == null)
                    {
                        cbxDetIso.SelectedIndex = 0;
                    }
                    else
                    {
                        IsoV = resk;
                        for (var index = 0; index < cbxDetIso.Items.Count; index++)
                        {
                            dynamic it = cbxDetIso.Items[index];
                            if (it.Val == resk.Parent)
                            {
                                changing = true;
                                cbxDetIso.SelectedIndex = index;

                                break;
                            }
                        }
                    }
                    pbxLoading.Visible = false;
                }));
                changing = false;
            })
            {
                CurrentCulture   = CultureInfo.CurrentCulture,
                CurrentUICulture = CultureInfo.CurrentUICulture
            };
            th.Start();
        }