1 /* Copyright (c) 2021 Samsung Electronics Co., Ltd.
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
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 using System.ComponentModel;
19 using System.Collections.Generic;
21 namespace Tizen.NUI.Components
24 /// Selection changed event. this might be deprecated.
26 [EditorBrowsable(EditorBrowsableState.Never)]
27 public class SelectionChangedEventArgs : EventArgs
29 static readonly IReadOnlyList<object> selectEmpty = new List<object>(0);
32 /// Previous selection list.
34 [EditorBrowsable(EditorBrowsableState.Never)]
35 public IReadOnlyList<object> PreviousSelection { get; }
38 /// Current selection list.
40 [EditorBrowsable(EditorBrowsableState.Never)]
41 public IReadOnlyList<object> CurrentSelection { get; }
44 internal SelectionChangedEventArgs(object previousSelection, object currentSelection)
46 PreviousSelection = previousSelection != null ? new List<object>(1) { previousSelection } : selectEmpty;
47 CurrentSelection = currentSelection != null ? new List<object>(1) { currentSelection } : selectEmpty;
50 internal SelectionChangedEventArgs(IList<object> previousSelection, IList<object> currentSelection)
52 PreviousSelection = new List<object>(previousSelection ?? throw new ArgumentNullException(nameof(previousSelection)));
53 CurrentSelection = new List<object>(currentSelection ?? throw new ArgumentNullException(nameof(currentSelection)));