[NUI] Introduce CollectionView and related classes. (#2525)
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / RecyclerView / SelectionChangedEventArgs.cs
1 /* Copyright (c) 2021 Samsung Electronics Co., Ltd.
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  *
15  */
16
17 using System;
18 using System.ComponentModel;
19 using System.Collections.Generic;
20
21 namespace Tizen.NUI.Components
22 {
23     /// <summary>
24     /// Selection changed event. this might be deprecated.
25     /// </summary>
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class SelectionChangedEventArgs : EventArgs
28     {
29         static readonly IReadOnlyList<object> selectEmpty = new List<object>(0);
30
31         /// <summary>
32         /// Previous selection list.
33         /// </summary>
34        [EditorBrowsable(EditorBrowsableState.Never)]
35         public IReadOnlyList<object> PreviousSelection { get; }
36
37         /// <summary>
38         /// Current selection list.    
39         ///  </summary>
40         [EditorBrowsable(EditorBrowsableState.Never)]
41         public IReadOnlyList<object> CurrentSelection { get; }
42
43
44         internal SelectionChangedEventArgs(object previousSelection, object currentSelection)
45         {
46             PreviousSelection = previousSelection != null ? new List<object>(1) { previousSelection } : selectEmpty;
47             CurrentSelection = currentSelection != null ? new List<object>(1) { currentSelection } : selectEmpty;
48         }
49
50         internal SelectionChangedEventArgs(IList<object> previousSelection, IList<object> currentSelection)
51         {
52             PreviousSelection = new List<object>(previousSelection ?? throw new ArgumentNullException(nameof(previousSelection)));
53             CurrentSelection = new List<object>(currentSelection ?? throw new ArgumentNullException(nameof(currentSelection)));
54         }
55     }
56 }