Beispiel #1
0
        protected override T GetEntry(int id)
        {
            int fi, si;

            if (Common.E(id, out fi, out si))
            {
                using (XLDNavigator nav = this.XLDPath.OpenXLD(fi))
                {
                    nav.GoToSubfile((short)si);
                    if (nav.SubfileLength == 0)
                    {
                        return(default(T));
                    }
                    return(init(id, nav, nav.SubfileLength));
                }
            }
            else
            {
                return(default(T));
            }
        }
Beispiel #2
0
 protected override IEnumerable <KeyValuePair <int, T> > GetPairEnumerator()
 {
     foreach (var pair in this.XLDPath.EnumerateFiles())
     {
         using (XLDNavigator nav = new XLDNavigator(pair.Value))
         {
             for (short i = 0; i < nav.NumSubfiles; i++)
             {
                 nav.GoToSubfile(i);
                 int id = Common.E(pair.Key, i);
                 T   value;
                 if (nav.SubfileLength == 0)
                 {
                     value = default(T);
                 }
                 else
                 {
                     value = init(id, nav, nav.SubfileLength);
                 }
                 yield return(new KeyValuePair <int, T>(id, value));
             }
         }
     }
 }