summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/Picker.cs
diff options
context:
space:
mode:
authorkingces95 <kingces95@users.noreply.github.com>2017-03-07 19:56:24 (GMT)
committerGitHub <noreply@github.com>2017-03-07 19:56:24 (GMT)
commite6d5186c8acbf37b877c7ca3c77a378352a3743d (patch)
treed61ca8ea619f7844e9e0a973dbd7bac794e39147 /Xamarin.Forms.Core/Picker.cs
parent2b92142ab2a501de71d3572efc0e5deb2b7bae9a (diff)
downloadxamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.zip
xamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.tar.gz
xamarin-forms-e6d5186c8acbf37b877c7ca3c77a378352a3743d.tar.bz2
Remove InternalsVisibleTo from Core to XF.Platforms.* (#782)
* Remove InternalsVisibleTo from Core to XF.Platforms.* * Changes per Jason's code review * Move LockableObservableListWrapper to internals namespace * Changes per Stephane's code review * update docs * Touch code to get CI to run tests * Rebase; Update documentation
Diffstat (limited to 'Xamarin.Forms.Core/Picker.cs')
-rw-r--r--Xamarin.Forms.Core/Picker.cs120
1 files changed, 1 insertions, 119 deletions
diff --git a/Xamarin.Forms.Core/Picker.cs b/Xamarin.Forms.Core/Picker.cs
index 0d85ea5..2d706c6 100644
--- a/Xamarin.Forms.Core/Picker.cs
+++ b/Xamarin.Forms.Core/Picker.cs
@@ -5,6 +5,7 @@ using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Runtime.CompilerServices;
+using Xamarin.Forms.Internals;
using Xamarin.Forms.Platform;
namespace Xamarin.Forms
@@ -222,124 +223,5 @@ namespace Xamarin.Forms
void ITextElement.OnTextColorPropertyChanged(Color oldValue, Color newValue)
{
}
-
- internal class LockableObservableListWrapper : IList<string>, ICollection<string>, INotifyCollectionChanged, INotifyPropertyChanged, IReadOnlyList<string>, IReadOnlyCollection<string>, IEnumerable<string>, IEnumerable
- {
- internal readonly ObservableCollection<string> _list = new ObservableCollection<string>();
-
- event NotifyCollectionChangedEventHandler INotifyCollectionChanged.CollectionChanged
- {
- add { ((INotifyCollectionChanged)_list).CollectionChanged += value; }
- remove { ((INotifyCollectionChanged)_list).CollectionChanged -= value; }
- }
-
- event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged {
- add { ((INotifyPropertyChanged)_list).PropertyChanged += value; }
- remove { ((INotifyPropertyChanged)_list).PropertyChanged -= value; }
- }
-
- public bool IsLocked { get; set; }
-
- void ThrowOnLocked()
- {
- if (IsLocked)
- throw new InvalidOperationException("The Items list can not be manipulated if the ItemsSource property is set");
- }
-
- public string this [int index] {
- get { return _list [index]; }
- set {
- ThrowOnLocked();
- _list [index] = value; }
- }
-
- public int Count {
- get { return _list.Count; }
- }
-
- public bool IsReadOnly {
- get { return ((IList<string>)_list).IsReadOnly; }
- }
-
- public void InternalAdd(string item)
- {
- _list.Add(item);
- }
-
- public void Add(string item)
- {
- ThrowOnLocked();
- InternalAdd(item);
- }
-
- public void InternalClear()
- {
- _list.Clear();
- }
-
- public void Clear()
- {
- ThrowOnLocked();
- InternalClear();
- }
-
- public bool Contains(string item)
- {
- return _list.Contains(item);
- }
-
- public void CopyTo(string [] array, int arrayIndex)
- {
- _list.CopyTo(array, arrayIndex);
- }
-
- public IEnumerator<string> GetEnumerator()
- {
- return _list.GetEnumerator();
- }
-
- public int IndexOf(string item)
- {
- return _list.IndexOf(item);
- }
-
- public void InternalInsert(int index, string item)
- {
- _list.Insert(index, item);
- }
-
- public void Insert(int index, string item)
- {
- ThrowOnLocked();
- InternalInsert(index, item);
- }
-
- public bool InternalRemove(string item)
- {
- return _list.Remove(item);
- }
-
- public bool Remove(string item)
- {
- ThrowOnLocked();
- return InternalRemove(item);
- }
-
- public void InternalRemoveAt(int index)
- {
- _list.RemoveAt(index);
- }
-
- public void RemoveAt(int index)
- {
- ThrowOnLocked();
- InternalRemoveAt(index);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return ((IEnumerable)_list).GetEnumerator();
- }
- }
}
} \ No newline at end of file