Пример #1
0
        private void LoadDates()
        {
            CalendarData    calData = new CalendarData(fLocale, calendar.GetType());
            UResourceBundle rb      = calData.Get("fields", "day", "relative");

            ILOG.J2CsMapping.Collections.ISet datesSet = new SortedSet(new RelativeDateFormat.Anonymous_C0());

            for (UResourceBundleIterator i = rb.GetIterator(); i.HasNext();)
            {
                UResourceBundle line = i.Next();

                String k = line.GetKey();
                String v = line.GetString();
                RelativeDateFormat.URelativeString rs = new RelativeDateFormat.URelativeString(k, v);
                ILOG.J2CsMapping.Collections.Generics.Collections.Add(datesSet, rs);
            }
            fDates = new RelativeDateFormat.URelativeString [0];
            fDates = (RelativeDateFormat.URelativeString [])ILOG.J2CsMapping.Collections.Generics.Collections.ToArray(datesSet, fDates);
        }
Пример #2
0
            internal UResourceTestData(ResourceModule module, UResourceBundle defaultHeader_0, UResourceBundle theRes)
            {
                outer_ResourceModule = module;
                IBM.ICU.Charset.ResourceModule.Assert_is(theRes != null &&
                                                         theRes.GetType() == IBM.ICU.Util.UResourceBundle.TABLE);
                res = theRes;
                // unfortunately, actually, data can be either ARRAY or STRING
                data = IBM.ICU.Charset.ResourceModule.GetFromTable(res, IBM.ICU.Charset.ResourceModule.DATA, new int[] { IBM.ICU.Util.UResourceBundle.ARRAY,
                                                                                                                         IBM.ICU.Util.UResourceBundle.STRING });

                try {
                    // unfortunately, actually, data can be either ARRAY or STRING
                    header = IBM.ICU.Charset.ResourceModule.GetFromTable(res, IBM.ICU.Charset.ResourceModule.HEADER, new int[] {
                        IBM.ICU.Util.UResourceBundle.ARRAY, IBM.ICU.Util.UResourceBundle.STRING
                    });
                } catch (MissingManifestResourceException e) {
                    if (defaultHeader_0 == null)
                    {
                        throw new TestDataModule_Constants.DataModuleFormatError(
                                  "Unable to find a header for test data '"
                                  + res.GetKey()
                                  + "' and no default header exist.");
                    }
                    else
                    {
                        header = defaultHeader_0;
                    }
                }
                try {
                    settings = IBM.ICU.Charset.ResourceModule.GetFromTable(res, IBM.ICU.Charset.ResourceModule.SETTINGS, IBM.ICU.Util.UResourceBundle.ARRAY);
                    info     = IBM.ICU.Charset.ResourceModule.GetFromTable(res, IBM.ICU.Charset.ResourceModule.INFO, IBM.ICU.Util.UResourceBundle.TABLE);
                } catch (MissingManifestResourceException e_1) {
                    // do nothing, left them null;
                    settings = data;
                }
            }
Пример #3
0
 public virtual String GetName()
 {
     return(res.GetKey());
 }