コード例 #1
0
 public static bool LoadFromFile(string fileName, out ResourceSecurityTypeGroupsGroup obj)
 {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
コード例 #2
0
 /// <summary>
 /// Deserializes xml markup from file into an ResourceSecurityTypeGroupsGroup object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output ResourceSecurityTypeGroupsGroup object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool LoadFromFile(string fileName, out ResourceSecurityTypeGroupsGroup obj, out System.Exception exception)
 {
     exception = null;
     obj = default(ResourceSecurityTypeGroupsGroup);
     try {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
コード例 #3
0
 public static bool Deserialize(string xml, out ResourceSecurityTypeGroupsGroup obj)
 {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
コード例 #4
0
 /// <summary>
 /// Deserializes workflow markup into an ResourceSecurityTypeGroupsGroup object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output ResourceSecurityTypeGroupsGroup object</param>
 /// <param name="exception">output Exception value if deserialize failed</param>
 /// <returns>true if this XmlSerializer can deserialize the object; otherwise, false</returns>
 public static bool Deserialize(string xml, out ResourceSecurityTypeGroupsGroup obj, out System.Exception exception)
 {
     exception = null;
     obj = default(ResourceSecurityTypeGroupsGroup);
     try {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
コード例 #5
0
        private void UpdateListItem(ResourceSecurityTypeGroupsGroup g, ListViewItem lvi)
        {
            if (g == null)
                lvi.ImageIndex = IHGROUP;

            switch (g.Permissions)
            {
                case PermissionsType.rw:
                    lvi.ImageIndex = RWGROUP;
                    break;
                case PermissionsType.r:
                    lvi.ImageIndex = ROGROUP;
                    break;
                case PermissionsType.n:
                    lvi.ImageIndex = NOGROUP;
                    break;
            }
            lvi.SubItems[2].Text = StatusNames[lvi.ImageIndex];
        }
コード例 #6
0
 private void ReadSecurityData(IList<ResourceSecurityTypeGroupsGroup> groups, IList<ResourceSecurityTypeUsersUser> users)
 {
     foreach (ListViewItem lvi in UsersAndGroups.Items)
     {
         if (lvi.Tag as UserListUser != null)
         {
             ResourceSecurityTypeUsersUser u = new ResourceSecurityTypeUsersUser();
             u.Name = (lvi.Tag as UserListUser).Name;
             if (lvi.ImageIndex == RWUSER)
                 u.Permissions = PermissionsType.rw;
             else if (lvi.ImageIndex == ROUSER)
                 u.Permissions = PermissionsType.r;
             else if (lvi.ImageIndex == NOUSER)
                 u.Permissions = PermissionsType.n;
             else
                 continue;
             users.Add(u);
         }
         else if (lvi.Tag as GroupListGroup != null && lvi.ImageIndex != IHGROUP)
         {
             ResourceSecurityTypeGroupsGroup g = new ResourceSecurityTypeGroupsGroup();
             g.Name = (lvi.Tag as GroupListGroup).Name;
             if (lvi.ImageIndex == RWGROUP)
                 g.Permissions = PermissionsType.rw;
             else if (lvi.ImageIndex == ROGROUP)
                 g.Permissions = PermissionsType.r;
             else if (lvi.ImageIndex == NOGROUP)
                 g.Permissions = PermissionsType.n;
             else
                 continue;
             groups.Add(g);
         }
     }
 }