Example #1
0
        private void btnApplyLast_Click(object sender, EventArgs e)
        {
            DiffProfile profile = DiffProfile.Load("lastPatches.xml");

            if (profile == null)
            {
                MessageBox.Show("Error loading last patches!");
                return;
            }

            profile.Apply(ref lstPatches, ref file);
        }
Example #2
0
        private void frmProfiles_Shown(object sender, EventArgs e)
        {
            lstProfiles.Items.Clear();

            if (!Directory.Exists("profiles"))
            {
                return;
            }

            DirectoryInfo dir = new DirectoryInfo("profiles");

            FileInfo[] files = dir.GetFiles("*.xml", SearchOption.TopDirectoryOnly);

            foreach (FileInfo f in files)
            {
                try
                {
                    DiffProfile profile = DiffProfile.Load(f.FullName);
                    if (profile == null)
                    {
                        continue;
                    }

                    Profiles.Add(profile);
                    if (f.Name.Replace(".xml", "") == profile.Name)
                    {
                        lstProfiles.Items.Add(profile.Name);
                    }
                    else
                    {
                        lstProfiles.Items.Add(profile.Name + "(" + f.Name + ")");
                    }
                }
                catch (Exception)
                {
                    continue;
                }
            }

            lstProfiles_SelectedIndexChanged(null, null);
        }