/// <remarks/>
 public void SetSystemPoliciesAsync(Policy[] Policies)
 {
     this.SetSystemPoliciesAsync(Policies, null);
 }
 /// <remarks/>
 public void SetSystemPoliciesAsync(Policy[] Policies, object userState)
 {
     if ((this.SetSystemPoliciesOperationCompleted == null)) {
         this.SetSystemPoliciesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetSystemPoliciesOperationCompleted);
     }
     this.InvokeAsync("SetSystemPolicies", new object[] {
                 Policies}, this.SetSystemPoliciesOperationCompleted, userState);
 }
 /// <remarks/>
 public void SetPoliciesAsync(string Item, Policy[] Policies)
 {
     this.SetPoliciesAsync(Item, Policies, null);
 }
 public void SetSystemPolicies(Policy[] Policies)
 {
     this.Invoke("SetSystemPolicies", new object[] {
                 Policies});
 }
 public void SetPolicies(string Item, Policy[] Policies)
 {
     this.Invoke("SetPolicies", new object[] {
                 Item,
                 Policies});
 }
 /// <remarks/>
 public void SetModelItemPoliciesAsync(string Model, string ModelItemID, Policy[] Policies)
 {
     this.SetModelItemPoliciesAsync(Model, ModelItemID, Policies, null);
 }
 public void SetModelItemPolicies(string Model, string ModelItemID, Policy[] Policies)
 {
     this.Invoke("SetModelItemPolicies", new object[] {
                 Model,
                 ModelItemID,
                 Policies});
 }
        //Event to Save Users and the corresponding roles
        //There is no way we can append the current user to the existing users list, we have to save them all once again
        private void SaveUsers()
        {
            Policy[] eachPolicy = new Policy[userpermissionsGridview.Rows.Count];
                int i = 0;
                int j = 0;

                foreach (DataGridViewRow dgvr in userpermissionsGridview.Rows)
                {
                    Policy currentPolicy = new Policy();
                    currentPolicy.GroupUserName = dgvr.Cells[0].Value.ToString();

                    j = 0;
                    foreach (DataGridViewCell dgvc in dgvr.Cells)
                    {
                        if (dgvc.FormattedValue.ToString() == "True")
                        {
                            j++;
                        }
                    }

                    Role[] roles = new Role[j];
                    j = 0;
                    foreach (DataGridViewCell dgvc in dgvr.Cells)
                    {
                        Role currentRole = new Role();
                        if (dgvc.FormattedValue.ToString() == "True")
                        {
                            currentRole.Name = dgvc.OwningColumn.Name;
                            roles[j] = currentRole;
                            j++;
                        }
                    }

                    currentPolicy.Roles = roles;
                    eachPolicy[i] = currentPolicy;
                    i++;
                }

            //This method call with save all the users and the corresponding roles to the current report item.
                m_rs.SetPolicies(m_strPath, eachPolicy);
        }
        //Returns the Policies defined on the Item path
        public Policy[] ReturnPolicy(string itemPath)
        {
            Policy[] pols = new Policy[1];
            Boolean val = true;
            pols = m_rs.GetPolicies(itemPath, out val);

            return pols;
        }