Esempio n. 1
0
        ///############################################################
        /// <summary>
        /// Renders the requested JavaScript file references.
        /// </summary>
        /// <remarks>
        /// NOTE: <c>cnCnRendererComplexSorter</c> is not yet implemented.
        /// </remarks>
        /// <param name="eJavaScriptFile">Enumeration representing the JavaScript/DHTML code to return.</param>
        /// <param name="oSettings">Cn.Web.Settings.Current instance representing the current enviroment.</param>
        /// <returns>String representing the required JavaScript file script block(s) for the referenced <paramref>eJavaScriptFile</paramref>.</returns>
        /// <exception cref="Cn.CnException">Thrown when the passed <paramref>eJavaScriptFile</paramref> is unreconized.</exception>
        /// <exception cref="Cn.CnException">Thrown when the passed <paramref>eJavaScriptFile</paramref> is <c>cnRenderAllJavaScript</c> and the referenced <paramref>oSettings.RenderedJavaScriptFiles</paramref> signanifies that some or all of the JavaScript file script blocks have been rendered previously.</exception>
        ///############################################################
        /// <LastUpdated>March 3, 2010</LastUpdated>
        public static string GenerateFileReferences(enumJavaScriptFiles eJavaScriptFile, Settings.Current oSettings)
        {
            string sPath = Settings.Value(Settings.enumSettingValues.cnUIDirectory);
            string sCRLF = oSettings.CRLF;
            string sReturn;
            int    iRenderedJavaScriptFiles = oSettings.GeneratedJavaScriptFileReferences;

            //#### If we are in .Debug mode, append g_cJavaScriptDebugDirectory onto the sPath
            if (oSettings.Debug)
            {
                sPath += g_cJavaScriptDebugDirectory;
            }
            //#### Else we are not in .Debug mode, so append g_cJavaScriptDirectory onto the sPath
            else
            {
                sPath += g_cJavaScriptDirectory;
            }

            //#### Pass the call off to .DoRender to generate the required JavaScript file references, Response.Write'ing out the returned value
            sReturn = DoGetScriptReferences(eJavaScriptFile, ref iRenderedJavaScriptFiles, oSettings.EndUserMessagesLanguageCode, sPath, sCRLF, oSettings.Debug);

            //#### Reset oSettings's .RenderedJavaScriptFiles to the local iRenderedJavaScriptFiles
            //####     NOTE: This is required because you cannot pass a property byref (as is required by the .DoGetScriptReferences call above)
            oSettings.GeneratedJavaScriptFileReferences = iRenderedJavaScriptFiles;

            //#### Return the above determined value to the caller
            return(sReturn);
        }
Esempio n. 2
0
 ///############################################################
 /// <summary>
 /// Retrieves the defined UI URL.
 /// </summary>
 /// <param name="oSettings">Cn.Web.Settings.Current instance representing the current enviroment.</param>
 /// <returns>String representing the defined UI URL.</returns>
 ///############################################################
 /// <LastUpdated>June 18, 2010</LastUpdated>
 public static string BaseURL(Settings.Current oSettings)
 {
     //#### Pass the call off to our sibling implementation, returning its result as our own
     return(BaseURL(oSettings.Debug));
 }