This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Writes the args to the default logging output using the format provided. | |
/// </summary> | |
public static void WriteLine(LoggingLevel level,string format, params object[] args) | |
{ | |
var name = new StackFrame(2,false).GetMethod().Name; | |
string prefix = string.Format("[{0} - {1}] ",level,name); | |
string message = string.Format(prefix + format, args); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Returns the original summary for a member inherited from a specified type. | |
/// </summary> | |
/// <param name="memberID">The member ID to lookup.</param> | |
/// <param name="declaringType">The type that declares that member.</param> | |
/// <returns>The summary xml. If not found, returns an zero length string.</returns> | |
public string GetSummary(string memberID, Type declaringType) { | |
//extract member type (T:, P:, etc.) | |
string memberType = memberID.Substring(0, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Open | |
C:\Users\username\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\Custom.css | |
and pasted this into it | |
*/ | |
.even { | |
padding: 10px !important; | |
font-family: Segoe UI !important; | |
border-bottom: 1px solid #EEE !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// | |
/// Formats the provided XML so it's indented and humanly-readable. | |
/// | |
/// <param name="inputXml" />The input XML to format. | |
/// | |
public static string FormatXml(string inputXml) | |
{ | |
XmlDocument document = new XmlDocument(); | |
document.Load(new StringReader(inputXml)); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var list = MimeType.Load(); | |
MimeType mimetype = list.FirstOrDefault(m => m.Extension == "jpg"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MimeType | |
{ | |
public string Extension { get; set; } | |
public string Value { get; set; } | |
public MimeType() | |
{ | |
Extension = ""; | |
Value = ""; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Note: any line starting with ; is a comment! | |
; This file contains Roadkill Install page localization strings. | |
; | |
; Shared buttons and labels | |
Shared_Stage1=Welcome | |
Shared_Stage2=Database | |
Shared_Stage3=Security | |
Shared_Stage4=Extras | |
Shared_Stage5=Finished |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Note: any line starting with ; is a comment! | |
; This file contains Roadkill site-wide localization strings. | |
Navigation_Login=Login | |
Navigation_Logout=Logout | |
Navigation_LoggedInAs=Logged in as | |
Navigation_MainPage=Main Page | |
Navigation_Categories=Categories | |
Navigation_All pages=All pages | |
Navigation_NewPage=New page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<system.diagnostics> | |
<!-- Add multiple sources for varying levels of tracing --> | |
<sources> | |
<source name="debugSource" switchName="defaultSwitch" switchType="System.Diagnostics.SourceSwitch"> | |
<listeners> | |
<add name="eventLogListener" type="System.Diagnostics.EventLogTraceListener" initializeData="ASP.NET 2.0.50727.0" /> | |
</listeners> | |
</source> | |
</sources> | |
<switches> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private TraceSource _traceSource = new TraceSource("defaultSource"); | |
public void LogInformation(string message,object params args) | |
{ | |
if ((_traceSource.Switch.Level & SourceLevels.Information) == SourceLevels.Information) | |
{ | |
... | |
} | |
} |
OlderNewer