E() public static method

Converts nullable index to file index and subfile index
public static E ( int index, int &fileIndex, int &subfileIndex ) : bool
index int /// Nullable index. (0 = null, 1 - 99 => 0 - 99, 100+ => 100+) ///
fileIndex int /// File index. ///
subfileIndex int /// Subfile index. ///
return bool
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));
             }
         }
     }
 }