示例#1
0
        /// <summary>
        /// Wraps an ASPX page with the master page.  When previewing, will call Out.Wrap.  When publishing, will output the Page Directive to use a specified Masterpage.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="asset"></param>
        /// <param name="masterPageAsset">the master page asset.</param>
        public static void WrapAspxMaster(OutputContext context, Asset asset, Asset masterPageAsset,
                                          string pageInherits   = DEFAULT_PAGE_INHERITS, string pageLanguage = DEFAULT_PAGE_LANGUAGE,
                                          string masterPageType = "", string extraParams = "", bool isOutWrapped = true)
        {
            if (context.IsPublishing)
            {
                //write out page directive that ties to the masterpage on the published aspx page
                string pageDirective = string.Format("<$@ Page MasterPageFile=\"~{0}\" Inherits=\"{1}\" Language=\"{2}\" {3}$>\n",
                                                     masterPageAsset.GetLink(LinkType.Include), pageInherits, pageLanguage,
                                                     extraParams);

                //add master type if specified or different from default
                if (!String.IsNullOrWhiteSpace(masterPageType))
                {
                    pageDirective += string.Format("\n<$@ MasterType TypeName=\"{0}\" $>", masterPageType);
                }

                Out.Write(pageDirective);
            }
            else if (isOutWrapped)
            {
                Asset templateFolder = Asset.Load(masterPageAsset.TemplateId);
                Out.DebugWriteLine("WrapAspxMaster: {0}", masterPageAsset.AssetPath.ToString());
                Out.Wrap(templateFolder.AssetPath.ToString());
            }
        }
示例#2
0
 public void Info(string format, params object[] args)
 {
     if (IsInfoEnabled)
     {
         string m = "INFO " + string.Format(format, args);
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         sb.Append(m).AppendLine();
     }
 }
示例#3
0
 public void Info(string message)
 {
     if (IsInfoEnabled)
     {
         string m = "INFO " + message;
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         sb.Append(m).AppendLine();
     }
 }
示例#4
0
 public void Debug(string format, params object[] args)
 {
     if (IsDebugEnabled)
     {
         string m = "DEBUG " + string.Format(format, args);
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         sb.Append(m).AppendLine();
     }
 }
示例#5
0
 public void Debug(string message)
 {
     if (IsDebugEnabled)
     {
         string m = "DEBUG " + message;
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         sb.Append(m).AppendLine();
     }
 }
示例#6
0
 public void Info(string message)
 {
     if (IsInfoEnabled)
     {
         string m = _ComponentName + "INFO " + (_MessagePrefix == null ? "" : _MessagePrefix) + message;
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         WriteToLog(m);
     }
 }
示例#7
0
 public void Debug(string format, params object[] args)
 {
     if (IsDebugEnabled)
     {
         string m = _ComponentName + "DEBUG " + (_MessagePrefix == null ? "" : _MessagePrefix) + string.Format(format, args);
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         WriteToLog(m);
     }
 }
示例#8
0
 public void Debug(string message)
 {
     if (IsDebugEnabled)
     {
         string m = _ComponentName + "DEBUG " + (_MessagePrefix == null ? "" : _MessagePrefix) + message;
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         WriteToLog(m);
     }
 }
示例#9
0
 public void Warn(string format, params object[] args)
 {
     if (IsInfoEnabled)
     {
         string m = _ComponentName + "WARN " + string.Format(format, args);
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         WriteToLog(m);
     }
 }
示例#10
0
 public void Warn(Exception exception, string message)
 {
     if (IsWarnEnabled)
     {
         string m = _ComponentName + "WARN " + (_MessagePrefix == null ? "" : _MessagePrefix) + message.TrimEnd(new char[] { '.' }) + ": " + exception.ToString();
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         WriteToLog(m);
     }
 }
示例#11
0
 public void Warn(Exception exception, string message)
 {
     if (IsWarnEnabled)
     {
         HasErrors = true;
         string m = "WARN " + exception.ToString();
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         sb.Append(m).AppendLine();
     }
 }
示例#12
0
 public void Error(Exception exception, string format, params object[] args)
 {
     if (IsErrorEnabled)
     {
         HasErrors = true;
         string m = "ERROR " + string.Format(format, args) + " " + exception.ToString();
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         sb.Append(m).AppendLine();
     }
 }
示例#13
0
 public void Error(Exception exception, string message)
 {
     if (IsErrorEnabled)
     {
         HasErrors = true;
         string m = _ComponentName + "ERROR " + (_MessagePrefix == null ? "" : _MessagePrefix) + exception.ToString();
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         WriteToLog(m);
     }
 }
示例#14
0
 public void Error(Exception exception, string format, params object[] args)
 {
     if (IsErrorEnabled)
     {
         HasErrors = true;
         string m = _ComponentName + "ERROR " + (_MessagePrefix == null ? "" : _MessagePrefix) + string.Format(format, args) + " " + exception.ToString();
         if (DebugWriteLine)
         {
             Out.DebugWriteLine(m);
         }
         WriteToLog(m);
     }
 }