Esempio n. 1
0
        /// <summary>
        /// Ends the current policy.
        /// </summary>
        /// <exception cref="InvalidOperationException">when there is no current policy.</exception>
        public void EndPolicy()
        {
            CheckStartedPolicy();

            categoriesStack.Peek().AddPolicy(currentPolicy);
            currentPolicy = null;
        }
Esempio n. 2
0
        /// <summary>
        /// Starts a new policy on the current category.
        /// </summary>
        /// <param name="policyName">The name for the new policy.</param>
        /// <param name="policyKey">The registry key for the new policy.</param>
        /// <exception cref="InvalidOperationException">when there is no current category.</exception>
        /// <exception cref="InvalidOperationException">when there is an unfinished policy being built.</exception>
        public void StartPolicy(String policyName, String policyKey)
        {
            CheckPolicyName(policyName);
            CheckKeyName(policyKey, true);
            CheckCurrentCategory();
            CheckNoStartedPolicy();

            currentPolicy = new AdmPolicy(policyName, policyKey, AvailableValueName);
        }
Esempio n. 3
0
 internal void AddPolicy(AdmPolicy policy)
 {
     policies.Add(policy);
 }
Esempio n. 4
0
		internal void AddPolicy(AdmPolicy policy)
		{
			this.policies.Add(policy);
		}