Exemplo n.º 1
0
        /// <summary>
        /// Applies a set of values from a Template to the results of a SQLite Data Operation.
        /// <para>Note that currently this class requires a COMPILER-LEVEL VARIABLE of 'NET35'</para>
        /// </summary>
        /// <remarks>This method is particularly for a personal project or two, however
        /// the methods for this are here to suggest the extension of this namespace
        /// to include more support to data-template operations.</remarks>
        /// <returns>THe template-formatted string.</returns>
        /// <param name="sqliteConnection">SQLiteConnection.</param>
        /// <param name="query">A SQL SELECT query.</param>
        /// <param name="dataFillCallback">A callback to fill generated dataset.</param>
        /// <param name="rowContainer">A Row-level string providing a container for subsequent rows.</param>
        /// <param name="rowContainerTag">The supplied tag such as '{0}' which is used as a string replacement value for the row-container.
        /// The templated row-results be stacked where this token was placed.</param>
        /// <param name="rowTemplate">A template applied to each resulting row.</param>
        /// <param name="rowSeparator">usually an empty sting, or a EOL terminator.</param>
        /// <param name="replaceMethod">User supplied callback to provide row-field specific filters to data results.</param>
        /// <exception cref="ArgumentException">is thrown if any paraemter is null.</exception>
        static public string SQLiteSelect_Tpl(
            // database constructs
            string sqliteConnection,
            string query,
            SQLiteDb.CBRowParam dataFillCallback,
            // template constructs
            string rowContainer,
            string rowContainerTag,
            string rowTemplate,
            string rowSeparator,
            Func <string, DataRowView, string> replaceMethod)
        {
            List <string> list   = new List <string>();
            string        output = null;

            using (SQLiteDb db = new SQLiteDb(sqliteConnection))
                using (DataSet ds = db.Select("settings", query, dataFillCallback))
                    using (DataView v = ds.GetDataView("settings"))
                    {
                        output = v.DataViewReplace(rowContainer, rowTemplate, rowSeparator, rowContainerTag, replaceMethod);
                    }
            return(output);
        }
Exemplo n.º 2
0
 protected void Act1(SQLiteSettings c, SQLiteDb db, SQLiteDb.CBRowParam cba, SQLiteDb.CBParams cbp)
 {
 }