Ejemplo n.º 1
0
        public static IReadOnlyList <DWriteLocalizedString> GetNames(this IDWriteLocalizedStrings strings)
        {
            if (strings == null)
            {
                throw new ArgumentNullException(nameof(strings));
            }

            var list = new List <DWriteLocalizedString>((int)strings.GetCount());

            for (var i = 0; i < list.Capacity; i++)
            {
                var name = new DWriteLocalizedString();
                strings.GetLocaleNameLength((uint)i, out var len).ThrowOnError();
                name.LocaleName = new string('\0', (int)len);
                strings.GetLocaleName((uint)i, name.LocaleName, len + 1);

                strings.GetStringLength((uint)i, out len).ThrowOnError();
                name.String = new string('\0', (int)len);
                strings.GetString((uint)i, name.String, len + 1);

                list.Add(name);
            }
            return(list);
        }
 internal DWriteLocalizedStrings(IDWriteLocalizedStrings handle)
 {
     this.handle = handle;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructs a LocalizedStrings object.
 /// </summary>
 /// <param name="localizedStrings">The DWrite localized Strings object that
 /// this class wraps.</param>
 public LocalizedStrings()
 {
     _localizedStrings = null;
     _keys             = null;
     _values           = null;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructs a LocalizedStrings object.
 /// </summary>
 /// <param name="localizedStrings">The DWrite localized Strings object that
 /// this class wraps.</param>
 internal LocalizedStrings(IDWriteLocalizedStrings localizedStrings)
 {
     _localizedStrings = localizedStrings;
     _keys             = null;
     _values           = null;
 }
 internal DWriteLocalizedStrings(IDWriteLocalizedStrings handle)
 {
     this.handle = handle;
 }