コード例 #1
0
        /// <inheritdoc/>
        public void AddProfile(string profile, string copySettingsFrom)
        {
            if (_solutionLoadInfo.GetProfile(profile) != null)
            {
                throw new ArgumentException("Profile already exists:" + profile);
            }

            SolutionLoadProfile sourceProfile = null;

            if (!string.IsNullOrEmpty(copySettingsFrom))
            {
                sourceProfile = _solutionLoadInfo.GetProfile(copySettingsFrom);
                if (sourceProfile == null)
                {
                    throw new ArgumentException("Profile to copy settings from does not exist:" + copySettingsFrom);
                }
            }

            SolutionLoadProfile newProfile;

            if (sourceProfile != null)
            {
                newProfile             = sourceProfile.Clone();
                newProfile.ProfileName = profile;
            }
            else
            {
                newProfile = new SolutionLoadProfile(profile);
            }

            _solutionLoadInfo.Profiles.Add(newProfile);
            WriteSettings();
        }
コード例 #2
0
        /// <inheritdoc/>
        public void AddProfile(string profile, string copySettingsFrom)
        {
            if (_solutionLoadInfo.GetProfile(profile) != null)
                throw new ArgumentException("Profile already exists:" + profile);

            SolutionLoadProfile sourceProfile = null;
            if (!string.IsNullOrEmpty(copySettingsFrom))
            {
                sourceProfile = _solutionLoadInfo.GetProfile(copySettingsFrom);
                if (sourceProfile == null)
                    throw new ArgumentException("Profile to copy settings from does not exist:" + copySettingsFrom);
            }

            SolutionLoadProfile newProfile;
            if (sourceProfile != null)
            {
                newProfile = sourceProfile.Clone();
                newProfile.ProfileName = profile;
            }
            else
            {
                newProfile = new SolutionLoadProfile(profile);
            }

            _solutionLoadInfo.Profiles.Add(newProfile);
            WriteSettings();
        }