Esempio n. 1
0
        private static IProfileTypeRegistry Create()
        {
            var generic = new GenericProfile();
            var google  = new GoogleProfile();
            var all     = new List <IProfileType> {
                generic, google
            };

            all.Add(new ContactsiCloudProfile());
            all.Add(new FruuxProfile());
            all.Add(new PosteoProfile());
            all.Add(new YandexProfile());
            all.Add(new GmxCalendarProfile());
            all.Add(new SarenetProfile());
            all.Add(new LandmarksProfile());
            all.Add(new SogoProfile());
            all.Add(new CozyProfile());
            all.Add(new NextcloudProfile());
            all.Add(new MailboxOrgProfile());
            all.Add(new OpenXchangeProfile());
            all.Add(new EasyProjectProfile());
            all.Add(new WebDeProfile());
            all.Add(new SmarterMailProfile());
            all.Add(new MailDeProfile());
            all.Add(new KolabProfile());
            all.Add(new SwisscomProfile());

            return(new ProfileTypeRegistry(all, generic, google));
        }
        private void newVideoProfileButton_Click(object sender, EventArgs e)
        {
            string profileName = InputBox.Show("Please give the preset a name", "Please give the preset a name", "");

            if (profileName == null)
            {
                return;
            }
            profileName = profileName.Trim();
            if (profileName.Length == 0)
            {
                return;
            }
            GenericProfile <TSettings> prof = new GenericProfile <TSettings>(profileName, s.Settings);

            if (byName(profileName) != null)
            {
                MessageBox.Show("Sorry, presets must have unique names", "Duplicate preset name", MessageBoxButtons.OK);
            }
            else
            {
                videoProfile.Items.Add(prof);
                videoProfile.SelectedItem = prof;
            }
        }
Esempio n. 3
0
 private ProfileTypeRegistry(IReadOnlyList <IProfileType> allTypes, GenericProfile genericProfile, GoogleProfile googleProfile)
 {
     _genericProfile    = genericProfile;
     _googleProfile     = googleProfile;
     AllTypes           = allTypes;
     _profileTypeByName = allTypes.ToDictionary(GetProfileTypeName);
 }
Esempio n. 4
0
        private void newVideoProfileButton_Click(object sender, EventArgs e)
        {
            string profileName = Microsoft.VisualBasic.Interaction.InputBox("Please give the profile a name", "Please give the profile a name", "", -1, -1);

            if (profileName == null)
            {
                return;
            }
            profileName = profileName.Trim();
            if (profileName.Length == 0)
            {
                return;
            }
            GenericProfile <TProfileSettings> prof = new GenericProfile <TProfileSettings>(profileName, s.Settings);

            if (this.profileManager.AddProfile(prof))
            {
                this.videoProfile.Items.Add(prof);
                this.videoProfile.SelectedItem = prof;
//                this.oldVideoProfile = prof;
            }
            else
            {
                MessageBox.Show("Sorry, profiles must have unique names", "Duplicate name detected", MessageBoxButtons.OK);
            }
        }
Esempio n. 5
0
        private void videoProfile_SelectedIndexChanged(object sender, EventArgs e)
        {
            GenericProfile <TProfileSettings> prof = this.videoProfile.SelectedItem as GenericProfile <TProfileSettings>;

            if (prof == null)
            {
                return;
            }
            this.Settings = prof.Settings;
        }
Esempio n. 6
0
        private void updateButton_Click(object sender, EventArgs e)
        {
            GenericProfile <TProfileSettings> prof = (GenericProfile <TProfileSettings>) this.videoProfile.SelectedItem;

            if (prof == null)
            {
                MessageBox.Show("You must select a profile to update!", "No profile selected", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            prof.Settings = s.Settings;
        }
Esempio n. 7
0
        private void updateButton_Click(object sender, EventArgs e)
        {
            GenericProfile <TSettings> prof = SelectedProfile;

            if (s.Settings.Equals(prof.BaseSettings))
            {
                return;
            }

            prof.Settings    = s.Settings;
            bSettingsChanged = true;
        }
Esempio n. 8
0
        private void deleteVideoProfileButton_Click(object sender, EventArgs e)
        {
            GenericProfile <TProfileSettings> prof = (GenericProfile <TProfileSettings>) this.videoProfile.SelectedItem;

            if (prof == null)
            {
                MessageBox.Show("You must select a profile to delete!", "No profile selected", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            profileManager.DeleteProfile(prof);
            videoProfile.Items.Remove(prof);
            loadDefaultsButton_Click(null, null);
        }
        private void putSettingsInScratchpad()
        {
            TSettings s = Settings;
            GenericProfile <TSettings> p = scratchPadProfile;

            if (p == null)
            {
                p = new GenericProfile <TSettings>(ProfileManager.ScratchPadName, s);
                videoProfile.Items.Add(p);
            }

            p.Settings = s;
            videoProfile.SelectedItem = p;
        }
Esempio n. 10
0
        private static Profile loadProfile <T>(string name)
            where T : GenericSettings
        {
            GenericProfile <T> prof = Util.XmlDeserialize <GenericProfile <T> >(name);

            if (prof == null)
            {
                return(null);
            }

            Type t = typeof(GenericProfile <>).MakeGenericType(prof.Settings.GetType());

            return((Profile)Activator.CreateInstance(t, prof.Name, prof.Settings));
        }
        private void deleteVideoProfileButton_Click(object sender, EventArgs e)
        {
            GenericProfile <TSettings> prof = (GenericProfile <TSettings>) this.videoProfile.SelectedItem;

            Debug.Assert(prof != null);

            videoProfile.Items.Remove(prof);

            if (prof.Name == ProfileManager.ScratchPadName && videoProfile.Items.Count > 0)
            {
                videoProfile.SelectedIndex = 0;
            }
            else
            {
                loadDefaultsButton_Click(null, null);
            }
        }
Esempio n. 12
0
        private void deleteVideoProfileButton_Click(object sender, EventArgs e)
        {
            GenericProfile <TSettings> prof = (GenericProfile <TSettings>) this.videoProfile.SelectedItem;

            Debug.Assert(prof != null);

            if (prof.Name == ProfileManager.ScratchPadName)
            {
                return;
            }

            int iIndex = this.videoProfile.SelectedIndex;

            videoProfile.Items.Remove(prof);
            videoProfile.SelectedIndex = iIndex > 0 ? (iIndex - 1) : 0;
            bSettingsChanged           = true;
        }
Esempio n. 13
0
        private void videoProfile_SelectedIndexChanged(object sender, EventArgs e)
        {
            GenericProfile <TSettings> prof = oldSelectedPreset;

            if (!bIgnoreChanges && prof != null && !s.Settings.Equals(prof.BaseSettings))
            {
                switch (MessageBox.Show("The formerly selected preset has been modified.\nDo you want to save the changes?", "Preset update", MessageBoxButtons.YesNo, MessageBoxIcon.Question))
                {
                case DialogResult.Yes:
                    prof.Settings    = s.Settings;
                    bSettingsChanged = true;
                    break;

                case DialogResult.No:
                    break;
                }
            }

            this.Settings          = SelectedProfile.Settings;
            this.oldSelectedPreset = SelectedProfile;

            deleteVideoProfileButton.Enabled = (SelectedProfile.Name != ProfileManager.ScratchPadName ? true : false);
        }
        private void updateButton_Click(object sender, EventArgs e)
        {
            GenericProfile <TSettings> prof = SelectedProfile;

            prof.Settings = s.Settings;
        }