コード例 #1
0
    /// <summary>
    /// Gets and bulk updates css stylesheets. Called when the "Get and bulk update stylesheets" button is pressed.
    /// Expects the CreateCssStylesheet method to be run first.
    /// </summary>
    private bool GetAndBulkUpdateCssStylesheets()
    {
        // Prepare the parameters
        string where = "StylesheetName LIKE N'MyNewStylesheet%'";

        // Get the data
        DataSet stylesheets = CssStylesheetInfoProvider.GetCssStylesheets().Where(where);

        if (!DataHelper.DataSourceIsEmpty(stylesheets))
        {
            // Loop through the individual items
            foreach (DataRow stylesheetDr in stylesheets.Tables[0].Rows)
            {
                // Create object from DataRow
                CssStylesheetInfo modifyStylesheet = new CssStylesheetInfo(stylesheetDr);

                // Update the properties
                modifyStylesheet.StylesheetDisplayName = modifyStylesheet.StylesheetDisplayName.ToUpper();

                // Save the changes
                CssStylesheetInfoProvider.SetCssStylesheetInfo(modifyStylesheet);
            }

            return(true);
        }

        return(false);
    }