Ooui-tws-port/Ooui.Forms/ResourcesProvider.cs

52 lines
1.0 KiB
C#
Raw Normal View History

2017-11-09 07:57:04 +00:00
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using Xamarin.Forms.Internals;
namespace Ooui.Forms
{
public class ResourcesProvider : ISystemResourcesProvider
{
readonly Res res = new Res ();
public IResourceDictionary GetSystemResources ()
{
return res;
}
class Res : IResourceDictionary
{
readonly ConcurrentDictionary<string, object> values =
new ConcurrentDictionary<string, object> ();
2017-11-09 21:03:56 +00:00
#pragma warning disable 67
2017-11-09 07:57:04 +00:00
public event EventHandler<ResourcesChangedEventArgs> ValuesChanged;
2017-11-09 21:03:56 +00:00
#pragma warning restore 67
2017-11-09 07:57:04 +00:00
public bool TryGetValue (string key, out object value)
{
return values.TryGetValue (key, out value);
}
public IEnumerator<KeyValuePair<string, object>> GetEnumerator ()
{
return values.GetEnumerator ();
}
IEnumerator IEnumerable.GetEnumerator ()
{
return values.GetEnumerator ();
}
}
}
}
2018-03-10 05:28:39 +00:00
#if PCL
namespace System.Collections.Concurrent
{
class ConcurrentDictionary<K, V> : Dictionary<K, V>
{
}
}
#endif