Ejemplo n.º 1
0
            /// <summary>
            /// Set the cursor for the current search to the specified index.
            /// </summary>
            /// <param name="origin">The origin to move from.</param>
            /// <param name="offset">The offset to move the index by.</param>
            /// <returns>True if successful, otherwise false is returned.</returns>
            public bool SetCursor(IndexOrigin origin, int offset)
            {
                bool cursorSet = false;

                switch (origin)
                {
                case IndexOrigin.CUR:
                {
                    int newIndex = ((index == -1) ? 0 : index) + offset;
                    if ((newIndex >= 0) && (newIndex < Count))
                    {
                        index     = newIndex;
                        cursorSet = true;
                    }
                    break;
                }

                case IndexOrigin.END:
                {
                    int newIndex = Count + offset;
                    if ((newIndex >= 0) && (newIndex < Count))
                    {
                        index     = newIndex;
                        cursorSet = true;
                    }
                    break;
                }

                case IndexOrigin.SET:
                {
                    if ((offset >= 0) && (offset < Count))
                    {
                        index     = offset;
                        cursorSet = true;
                    }
                    break;
                }
                }

                return(cursorSet);
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Set the Index to the specified offset from the origin.
 /// </summary>
 /// <param name="origin">The origin to move from</param>
 /// <param name="offset">The offset to move the index by.</param>
 /// <returns>True if successful.</returns>
 public bool SetIndex(IndexOrigin origin, int offset)
 {
     return(Flaim.SetIndex(this, origin, offset));
 }
Ejemplo n.º 3
0
 private static extern bool FWSetListIndex(IntPtr pResults, IndexOrigin origin, int offset);
Ejemplo n.º 4
0
 /// <summary>
 /// Set the Index to the specified offset from the origin.
 /// </summary>
 /// <param name="results">The resultset.</param>
 /// <param name="origin">The origin to move from</param>
 /// <param name="offset">The offset to move the index by.</param>
 /// <returns>True if successful.</returns>
 internal bool SetIndex(FlaimResultSet results, IndexOrigin origin, int offset)
 {
     return(FWSetListIndex(results.ResultSet, origin, offset));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Set the Index to the specified offset from the origin.
 /// </summary>
 /// <param name="results">The resultset.</param>
 /// <param name="origin">The origin to move from</param>
 /// <param name="offset">The offset to move the index by.</param>
 /// <returns>True if successful.</returns>
 public bool SetIndex(FlaimResultSet results, IndexOrigin origin, int offset)
 {
     return(Flaim.SetIndex(results, origin, offset));
 }