Ejemplo n.º 1
0
 public TestThread(string name, ICUService service, long delay)
 {
     //this.name = name + " ";
     this.service      = service;
     this.delay        = delay;
     this.IsBackground = (true);
 }
Ejemplo n.º 2
0
        /**
         * Convenience override of getDisplayNames(UCultureInfo, Comparer, string) that
         * uses the default collator for the locale as the comparator to
         * sort the display names.
         */
        public IDictionary <string, string> GetDisplayNames(ICUService service, UCultureInfo locale, string matchID)
        {
            //Collator col = Collator.getInstance(locale.toLocale());
            CompareInfo col = CompareInfo.GetCompareInfo(locale.ToCultureInfo().Name);

            return(service.GetDisplayNames(locale, col, matchID));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Convenience override of getDisplayNames(ULocale, Comparator, String) that
        /// uses the default collator for the locale as the comparator to sort the
        /// display names.
        /// </summary>
        ///
        public SortedList GetDisplayNames(ICUService service, ULocale locale,
                                          String matchID)
        {
            Collator col = IBM.ICU.Text.Collator.GetInstance(locale);

            return(service.GetDisplayNames(locale, col, matchID));
        }
Ejemplo n.º 4
0
        /**
         * Convenience override of getDisplayNames(ULocale, Comparator, string) that
         * uses the default collator for the locale as the comparator to
         * sort the display names, and null for the matchID.
         */
        public static IDictionary <string, string> GetDisplayNames(ICUService service, ULocale locale)
        {
            //Collator col;
            //try
            //{
            //    col = Collator.getInstance(locale.ToLocale());
            //}
            //catch (MissingResourceException e)
            //{
            //    // if no collator resources, we can't collate
            //    col = null;
            //}
            CompareInfo col;

            try
            {
                col = CompareInfo.GetCompareInfo(locale.ToLocale().ToString());
            }
            catch (MissingManifestResourceException e)
            {
                // if no collator resources, we can't collate
                col = null;
            }

            return(service.GetDisplayNames(locale, col, null));
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Convenience override of getDisplayNames(ULocale, Comparator, String) that
        /// uses the current default ULocale as the locale, the default collator for
        /// the locale as the comparator to sort the display names, and null for the
        /// matchID.
        /// </summary>
        ///
        public SortedList GetDisplayNames(ICUService service)
        {
            ULocale  locale = IBM.ICU.Util.ULocale.GetDefault();
            Collator col    = IBM.ICU.Text.Collator.GetInstance(locale);

            return(service.GetDisplayNames(locale, col, null));
        }
Ejemplo n.º 6
0
 public TestThread(string name, ICUService service, long delay)
 {
     //this.name = name + " ";
     this.service = service;
     this.delay   = delay;
     this.SetDaemon(true);
 }
Ejemplo n.º 7
0
        /**
         * Convenience override of getDisplayNames(ULocale, Comparator, string) that
         * uses the default collator for the locale as the comparator to
         * sort the display names, and null for the matchID.
         */
        public SortedDictionary <string, string> GetDisplayNames(ICUService service, ULocale locale)
        {
            //Collator col = Collator.getInstance(locale.toLocale());
            CompareInfo col = CompareInfo.GetCompareInfo(locale.ToLocale().Name);

            return(service.GetDisplayNames(locale, col, null));
        }
Ejemplo n.º 8
0
            /// <summary>
            /// Convenience override of getDisplayNames(ULocale, Comparator, String)
            /// that uses the default collator for the locale as the comparator to
            /// sort the display names, and null for the matchID.
            /// </summary>
            ///
            public static SortedList GetDisplayNames(ICUService service,
                                                     ULocale locale)
            {
                Collator col = IBM.ICU.Text.Collator.GetInstance(locale);

                return(service.GetDisplayNames(locale, col, null));
            }
Ejemplo n.º 9
0
            internal UnregisterFactoryThread(string name, ICUService service, long delay)

                : base("UNREG " + name, service, delay)
            {
                r         = new Random();
                factories = service.Factories();
            }
Ejemplo n.º 10
0
        /**
         * Convenience override of getDisplayNames(UCultureInfo, Comparator, string) that
         * uses the current default UCultureInfo as the locale, the default collator for
         * the locale as the comparator to sort the display names, and null for
         * the matchID.
         */
        public IDictionary <string, string> GetDisplayNames(ICUService service)
        {
            UCultureInfo locale = UCultureInfo.CurrentCulture;
            //Collator col = Collator.getInstance(locale.toLocale());
            CompareInfo col = CompareInfo.GetCompareInfo(locale.ToCultureInfo().Name);

            return(service.GetDisplayNames(locale, col, null));
        }
Ejemplo n.º 11
0
 public virtual Object Create(IBM.ICU.Impl.ICUService.Key key, ICUService serviceArg)
 {
     if (key.CurrentID().Equals(greetingID))
     {
         Object previous = serviceArg.GetKey(key, null, this);
         return("A different greeting: \"" + previous + "\"");
     }
     return(null);
 }
Ejemplo n.º 12
0
 public TestThread(String name, ICUService service_0, long delay_1,
                   TestLog log_2)
 {
     // this.name = name + " ";
     this.service  = service_0;
     this.delay    = delay_1;
     this.log      = new AbstractTestLog.DelegatingLog(log_2);
     this.IsDaemon = true;
 }
Ejemplo n.º 13
0
        internal void RegisterFactories(ICUService service_0, ICollection c)
        {
            IIterator iter = new ILOG.J2CsMapping.Collections.IteratorAdapter(c.GetEnumerator());

            while (iter.HasNext())
            {
                service_0.RegisterFactory((IBM.ICU.Impl.ICUService.Factory)iter.Next());
            }
        }
Ejemplo n.º 14
0
 public void ServiceChanged(ICUService s)
 {
     outer_ICUServiceTest.Logln("listener 3 report " + n++ + " service changed...");
     if (s.Get("en_BOINK") == null)
     { // don't recurse on
         // ourselves!!!
         outer_ICUServiceTest.Logln("registering boink...");
         s.RegisterObject("boink", "en_BOINK");
     }
 }
Ejemplo n.º 15
0
            public static void InitRegistry()
            {
                registry = new IBM.ICU.Charset.ICUServiceTestSample.HelloService.Anonymous_C0();

                // initialize
                DoRegister("Hello", "en");
                DoRegister("Bonjour", "fr");
                DoRegister("Ni Hao", "zh_CN");
                DoRegister("Guten Tag", "de");
            }
Ejemplo n.º 16
0
 internal void RegisterFactories(ICUService service, ICollection <IServiceFactory> c)
 {
     using (var iter = c.GetEnumerator())
     {
         while (iter.MoveNext())
         {
             service.RegisterFactory((IServiceFactory)iter.Current);
         }
     }
 }
Ejemplo n.º 17
0
        /// <summary>
        /// Convenience override of getDisplayNames(ULocale, Comparator, String) that
        /// uses the default collator for the locale as the comparator to sort the
        /// display names, and null for the matchID.
        /// </summary>
        ///
        public static SortedList GetDisplayNames(ICUService service, ULocale locale)
        {
            Collator col;

            try {
                col = IBM.ICU.Text.Collator.GetInstance(locale);
            } catch (MissingManifestResourceException e) {
                // if no collator resources, we can't collate
                col = null;
            }
            return(service.GetDisplayNames(locale, col, null));
        }
Ejemplo n.º 18
0
            public override object Create(ICUServiceKey key, ICUService srvc)
            {
                if (!HandlesKey(key) || !(key is LocaleKey))
                {
                    return(null);
                }

                LocaleKey lkey   = (LocaleKey)key;
                object    result = @delegate.CreateFormat(lkey.GetCanonicalCulture(), lkey.Kind);

                if (result == null)
                {
                    result = srvc.GetKey(key, this);
                }
                return(result);
            }
Ejemplo n.º 19
0
 protected override object HandleCreate(UCultureInfo loc, int kind, ICUService service)
 {
     return(factoryID + loc.ToString());
 }
Ejemplo n.º 20
0
 public virtual void ServiceChanged(ICUService service)
 {
     serviceChanged(service, this);
 }
Ejemplo n.º 21
0
 public object Create(ICUServiceKey key, ICUService service)
 {
     return(create != null?create(key, service) : new UCultureInfo(key.CurrentID));
 }
Ejemplo n.º 22
0
 internal GetListThread(string name, ICUService service, long delay, string[] list)
     : base("GETL " + name, service, delay)
 {
     this.list = list;
 }
Ejemplo n.º 23
0
 internal GetThread(string name, ICUService service, long delay)
     : base("GET " + name, service, delay)
 {
     actualID = new string[1];
 }
Ejemplo n.º 24
0
 internal GetDisplayThread(string name, ICUService service, long delay, ULocale locale)
     : base("DIS " + name, service, delay)
 {
     this.locale = locale;
 }