Пример #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);
                }
            }
        }
Пример #2
0
        public Int32 CompareTo(IDirectoryMember other)
        {
            IconImage other2 = other as IconImage;

            if (other2 == null)
            {
                return(-1);
            }

            return(CompareTo(other2));
        }
Пример #3
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);
            }
        }
Пример #4
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;
     }
 }
Пример #5
0
 public static string FormatFolderName(IDirectoryMember member, PersonalFolder pf)
 {
     return FormatFolderName(member, pf.NameFormat);
 }
Пример #6
0
 public Boolean Equals(IDirectoryMember other)
 {
     return(Equals(other as IconImage));
 }