예제 #1
0
        public static Profile WithUniqueNameCandidate(this Profile profile, int maxLength)
        {
            var p = profile.Clone();

            if (string.IsNullOrEmpty(p.OriginalName))
            {
                p.OriginalName    = p.Name;
                p.UniqueNameIndex = 0;
            }

            p.Name = NameCandidate(p.OriginalName, p.UniqueNameIndex, maxLength);

            return(p);
        }
예제 #2
0
        public static Profile WithStatus(this Profile profile, ProfileStatus value)
        {
            var p = profile.Clone();

            p.Status = value;

            if (value == ProfileStatus.Synced)
            {
                p.OriginalName    = null;
                p.UniqueNameIndex = 0;
            }

            return(p);
        }
예제 #3
0
 private static Profile Map(Profile profile)
 {
     return(profile.Clone());
 }