コード例 #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;
        }
コード例 #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);
        }
コード例 #3
0
ファイル: AdmCategory.cs プロジェクト: magenta-aps/cprbroker
 internal void AddPolicy(AdmPolicy policy)
 {
     policies.Add(policy);
 }
コード例 #4
0
ファイル: AdmCategory.cs プロジェクト: wuyingyou/uniframework
		internal void AddPolicy(AdmPolicy policy)
		{
			this.policies.Add(policy);
		}