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

43 lines
943 B
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 ();
}
}
}
}