public static bool LoadFromFile(string fileName, out ResourceSecurityTypeUsersUser obj)
 {
     System.Exception exception = null;
     return LoadFromFile(fileName, out obj, out exception);
 }
 /// <summary>
 /// Deserializes xml markup from file into an ResourceSecurityTypeUsersUser object
 /// </summary>
 /// <param name="fileName">string xml file to load and deserialize</param>
 /// <param name="obj">Output ResourceSecurityTypeUsersUser 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 ResourceSecurityTypeUsersUser obj, out System.Exception exception)
 {
     exception = null;
     obj = default(ResourceSecurityTypeUsersUser);
     try {
         obj = LoadFromFile(fileName);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
 public static bool Deserialize(string xml, out ResourceSecurityTypeUsersUser obj)
 {
     System.Exception exception = null;
     return Deserialize(xml, out obj, out exception);
 }
 /// <summary>
 /// Deserializes workflow markup into an ResourceSecurityTypeUsersUser object
 /// </summary>
 /// <param name="xml">string workflow markup to deserialize</param>
 /// <param name="obj">Output ResourceSecurityTypeUsersUser 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 ResourceSecurityTypeUsersUser obj, out System.Exception exception)
 {
     exception = null;
     obj = default(ResourceSecurityTypeUsersUser);
     try {
         obj = Deserialize(xml);
         return true;
     }
     catch (System.Exception ex) {
         exception = ex;
         return false;
     }
 }
Пример #5
0
        private void UpdateListItem(ResourceSecurityTypeUsersUser u, ListViewItem lvi)
        {
            if (u == null)
                lvi.ImageIndex = IHUSER;

            switch (u.Permissions)
            {
                case PermissionsType.rw:
                    lvi.ImageIndex = RWUSER;
                    break;
                case PermissionsType.r:
                    lvi.ImageIndex = ROUSER;
                    break;
                case PermissionsType.n:
                    lvi.ImageIndex = NOUSER;
                    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);
         }
     }
 }