tailieunhanh - Expert VB 2005 Business Objects Second Edition phần 5

với các giá trị trong cơ sở dữ liệu, sau đó đối tượng không phải là bẩn. Rất hầu như không thể để luôn luôn biết cho dù giá trị của đối tượng phù hợp với những người trong cơ sở dữ liệu, do đó, việc thực hiện hiển thị ở đây hành vi trên thi hành "đoán tốt nhất." | CHAPTER 5 COMPLETING THE FRAMEWORK 253 Implementing a read-only sorted view of a collection is relatively straightforward but implementing a view that is bidirectionally updatable is quite complex. And that s exactly what SortedBindingList does. Acting As a View Let s look at the simple things first. The original collection as an ICollection has a set of properties such as Count and SyncRoot that are simply exposed by SortedBindingList. For instance here s the Count property Public Readonly Property Count As Integer _ Implements _ Of T .Count Get Return End Get End Property This technique is repeated for all the ICollection IList and lEnumerable properties. The notable exception to this is the default property which is quite a bit more complex and is discussed later. If the original collection implements IBindingList it has a broader set of properties. It might be editable and it might not. It might allow adding of new items or not. All these capabilities are exposed through its IBindingList interface and SortedBindingList merely assumes the same settings. For instance here s the AllowEdit property Public ReadOnly Property AllowEdit As Boolean _ Implements Get If mSupportsBinding Then Return Else Return False End If End Get End Property Recall from the constructor that if the original collection doesn t implement IBindingList then mSupportsBinding will be False. In that case AllowEdit returns False because in-place editing isn t valid unless the original collection implements IBindingList. This technique is repeated for all the IBindingList properties. Applying a Sort The IBindingList interface allows a sort to be applied to a collection either ascending or descending based on a single property. This is done through the ApplySort method. ApplySort Method SortedBindingList implements two overloads of ApplySort .

TÀI LIỆU MỚI ĐĂNG
9    210    0    28-03-2024
44    181    0    28-03-2024
23    147    0    28-03-2024
24    127    0    28-03-2024
5    114    0    28-03-2024
41    106    0    28-03-2024
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.