Exemplo n.º 1
0
        public DirectoryMember(IDirectoryMember directoryMember)
        {
            foreach (PropertyInfo p in typeof(IDirectoryMember).GetProperties())
            {
                object v = null;

                try
                {
                    v = p.GetValue(directoryMember, null);
                }
                catch(Exception ex)
                {
                    throw new Exception(String.Format("Could not get value for property {0}", p.Name), ex);
                }

                try
                {
                    p.SetValue(this, v, null);
                }
                catch(Exception ex)
                {
                    throw new Exception(String.Format("Could not set value for property {0}", p.Name), ex);
                }
            }
        }
Exemplo n.º 2
0
        public static string GetFolderPath(IDirectoryMember member, PersonalFolder pf)
        {
            if (pf.NameFormat == PersonalFolderIdFormats.Fullname)
            {
                string name = DirectoryMemberRepository.GetName(member, DirectoryMemberNameFormats.Full | DirectoryMemberNameFormats.Sort) + " - " + member.UserName;

                return Path.Combine(pf.FolderPath, name);
            }
            else
            {
                return Path.Combine(pf.FolderPath, member.UserName);
            }
        }
Exemplo n.º 3
0
 public static string FormatFolderName(IDirectoryMember member, PersonalFolderIdFormats format)
 {
     if (format == PersonalFolderIdFormats.Fullname)
     {
         string name = DirectoryMemberRepository.GetName(member, DirectoryMemberNameFormats.Full | DirectoryMemberNameFormats.Sort) + " - " + member.UserName;
         return name;
     }
     else
     {
         return member.UserName;
     }
 }
Exemplo n.º 4
0
 public static string FormatFolderName(IDirectoryMember member, PersonalFolder pf)
 {
     return FormatFolderName(member, pf.NameFormat);
 }