Exemple #1
0
 public void Remove(DRowMember member = null)
 {
     if (member == null) member = CurrentMember;
     if (member == null || member.Equals(_firstMember) || member.Equals(_lastMember)) return;
     if (member.PreMember == null || member.NextMember == null) return;
     member.PreMember.NextMember = member.NextMember;
     member.NextMember.PreMember = member.PreMember;
     CurrentMember = member.PreMember;
     member.PreMember = null;
     member.NextMember = null;
     _firstMember.Height = _firstMember.NextMember.Height;
     _lastMember.Height = _lastMember.PreMember.Height;
     this.Width -= member.Width;
     var hmember = GetHighestMember();
     this.Height = hmember.Height;
     ResetPosition(hmember);
 }
Exemple #2
0
 /// <summary>
 /// 将该行某个成员去除
 /// </summary>
 /// <param name="member"></param>
 public void RemoveMember(DRowMember member)
 {
     if (member == null) return;
     if (member.Equals(FirstMember))
     {
         if (member.NextMember == null)
         {
             FirstMember = null;
             return;
         }
         else if (member.NextMember.Equals(LastMember))
         {
             FirstMember = member.NextMember;
             LastMember = null;
             member.NextMember.PreMember = null;
             member.NextMember = null;
             return;
         }
         FirstMember = member.NextMember;
         member.NextMember.PreMember = null;
         member.NextMember = null;
     }
     else if (member.Equals(LastMember))
     {
         if (member.PreMember.Equals(FirstMember))
         {
             member.PreMember.NextMember = null;
             member.PreMember = null;
             LastMember = null;
             return;
         }
         LastMember = member.PreMember;
         member.PreMember.NextMember = null;
         member.PreMember = null;
     }
     else
     {
         if(member.PreMember != null)
             member.PreMember.NextMember = member.NextMember;
         if(member.NextMember != null)
             member.NextMember.PreMember = member.PreMember;
         member.PreMember = null;
         member.NextMember = null;
     }
 }