Esempio n. 1
0
        public static RuntimeObject FromType(Type type)
        {
            SharedObjectHandle sharedValue = default;

            if (hashtable[type] is SharedObjectHandle o)
            {
                sharedValue = o;
            }
            else
            {
                lock (hashtable) {
                    if (hashtable[type] is SharedObjectHandle o2)
                    {
                        sharedValue = o2;
                    }
                    else
                    {
                        using (RuntimeRealm.SharedObjectContainer container = new RuntimeRealm.SharedObjectContainer()) {
                            RuntimeObject o3 = new ReflectedNativeObjectPrototype(container, type, false);
                            sharedValue     = container.Add(o3);
                            hashtable[type] = sharedValue;
                        }
                    }
                }
            }
            return(RuntimeRealm.Current.GetRuntimeObject(sharedValue));
        }
Esempio n. 2
0
        static IntlModule()
        {
            IntlModule module = RuntimeRealm.RegisterModule <IntlModule>();

            Intl                        = module.GetSharedObjectHandle(IntlObjectKind.Intl);
            Locale                      = module.GetSharedObjectHandle(IntlObjectKind.Locale);
            LocalePrototype             = module.GetSharedObjectHandle(IntlObjectKind.LocalePrototype);
            Collator                    = module.GetSharedObjectHandle(IntlObjectKind.Collator);
            CollatorPrototype           = module.GetSharedObjectHandle(IntlObjectKind.CollatorPrototype);
            NumberFormat                = module.GetSharedObjectHandle(IntlObjectKind.NumberFormat);
            NumberFormatPrototype       = module.GetSharedObjectHandle(IntlObjectKind.NumberFormatPrototype);
            DateTimeFormat              = module.GetSharedObjectHandle(IntlObjectKind.DateTimeFormat);
            DateTimeFormatPrototype     = module.GetSharedObjectHandle(IntlObjectKind.DateTimeFormatPrototype);
            PluralRules                 = module.GetSharedObjectHandle(IntlObjectKind.PluralRules);
            PluralRulesPrototype        = module.GetSharedObjectHandle(IntlObjectKind.PluralRulesPrototype);
            ListFormat                  = module.GetSharedObjectHandle(IntlObjectKind.ListFormat);
            ListFormatPrototype         = module.GetSharedObjectHandle(IntlObjectKind.ListFormatPrototype);
            RelativeTimeFormat          = module.GetSharedObjectHandle(IntlObjectKind.RelativeTimeFormat);
            RelativeTimeFormatPrototype = module.GetSharedObjectHandle(IntlObjectKind.RelativeTimeFormatPrototype);
        }
Esempio n. 3
0
 public IntlProvider(SharedObjectHandle proto, ICollection <string> locale, T options)
     : base(proto)
 {
     Init(IntlUtility.CanonicalizeLocaleList(locale), options);
 }
Esempio n. 4
0
 public IntlProvider(SharedObjectHandle proto, string locale, T options)
     : base(proto)
 {
     Init(IntlUtility.CanonicalizeLocaleList(new[] { locale }), options);
 }
Esempio n. 5
0
 public IntlProvider(SharedObjectHandle proto)
     : base(proto)
 {
 }