Skip to content

Commit

Permalink
new - all code snippets for visual basic
Browse files Browse the repository at this point in the history
new - snippet for Desharp.Debug.Fire.Log()
fixed - snippet for Desharp.Debug.Configure()
  • Loading branch information
tomFlidr committed Jun 10, 2017
1 parent aa20854 commit 2edad52
Show file tree
Hide file tree
Showing 21 changed files with 492 additions and 121 deletions.
19 changes: 9 additions & 10 deletions Visual C#/dda.snippet → C#/dda.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>dda</Title>
<Title>Desharp.Debug.Assert(comparation, description);</Title>
<Shortcut>dda</Shortcut>
<Description>Code snippet for: Desharp.Debug.Assert(comparation, description);</Description>
<Description>Print to application output or log into file (if enabled) first param to be true or not and describe what was equal or not in first param by second param message.</Description>
<Author>Tom Flídr</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
Expand All @@ -18,21 +15,23 @@
</Literal>
<Literal>
<ID>comparation</ID>
<Default></Default>
<ToolTip>Comparation to log/dump.</ToolTip>
<Default>true</Default>
<ToolTip>Comparation boolean to dump or log, way to compare things is up to you.</ToolTip>
</Literal>
<Literal>
<ID>description</ID>
<Default></Default>
<ToolTip>Comparation description.</ToolTip>
<ToolTip>Any text to describe previous comparation.</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Assert($comparation$, "$description$");$snippetEnd$]]></Code>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Assert(
$comparation$,
"$description$"
);$snippetEnd$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
58 changes: 58 additions & 0 deletions C#/ddc.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Desharp.Debug.Configure(new DebugConfig {...});</Title>
<Shortcut>ddc</Shortcut>
<Description>Configure Desharp assembly from running application environment and override any XML config settings or automaticly detected settings.</Description>
<Author>Tom Flídr</Author>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>DesharpDebug</ID>
<Function>SimpleTypeName(global::Desharp.Debug)</Function>
</Literal>
<Literal Editable="false">
<ID>DesharpDebugConfig</ID>
<Function>SimpleTypeName(global::Desharp.DebugConfig)</Function>
</Literal>
<Literal Editable="false">
<ID>DesharpLogFormat</ID>
<Function>SimpleTypeName(global::Desharp.LogFormat)</Function>
</Literal>
<Literal>
<ID>enabled</ID>
<Default>true</Default>
<ToolTip>Debug dumping into output is enabled or not.</ToolTip>
</Literal>
<Literal>
<ID>depth</ID>
<Default>3</Default>
<ToolTip>How many levels in complex type variables will be iterated throw to dump all it's properties, fields and other values.</ToolTip>
</Literal>
<Literal>
<ID>directory</ID>
<Default>logs</Default>
<ToolTip>Relative or absolute path into directory where all log files and mail notify boolean files will be stored.</ToolTip>
</Literal>
<Literal>
<ID>logFormat</ID>
<Default>Auto</Default>
<ToolTip>Application environment - usually automaticly determinated by Desharp asembly - change this value only when you REALLY know what you are doing!</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Configure(new $DesharpDebugConfig$ {
Enabled = $enabled$,
Depth = $depth$,
Directory = "~/$directory$",
LogFormat = $DesharpLogFormat$.$logFormat$
});$snippetEnd$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
12 changes: 4 additions & 8 deletions Visual C#/ddd.snippet → C#/ddd.snippet
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ddd</Title>
<Title>Desharp.Debug.Dump(obj);</Title>
<Shortcut>ddd</Shortcut>
<Description>Code snippet for: Desharp.Debug.Dump(obj);</Description>
<Description>Print any structuralized .NET object in Debugger Output window or in Console window.</Description>
<Author>Tom Flídr</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
Expand All @@ -19,12 +16,11 @@
<Literal>
<ID>obj</ID>
<Default>obj</Default>
<ToolTip>Any C# object to dump into application output.</ToolTip>
<ToolTip>Any .NET object to print in Debugger Output window or directly in Console window.</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Dump($obj$);$snippetEnd$]]></Code>
Expand Down
12 changes: 4 additions & 8 deletions Visual C#/dddd.snippet → C#/dddd.snippet
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>dddd</Title>
<Title>Desharp.Debug.DumpAndDie(obj);</Title>
<Shortcut>dddd</Shortcut>
<Description>Code snippet for: Desharp.Debug.DumpAndDie(obj);</Description>
<Description>Print any structuralized .NET object as last in Debugger Output window or in Console window and exit running application.</Description>
<Author>Tom Flídr</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
Expand All @@ -19,12 +16,11 @@
<Literal>
<ID>obj</ID>
<Default>obj</Default>
<ToolTip>Any C# object to dump into application output.</ToolTip>
<ToolTip>Any .NET object to print in Debugger Output window or directly in Console window.</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.DumpAndDie($obj$);$snippetEnd$]]></Code>
Expand Down
24 changes: 12 additions & 12 deletions Visual C#/dddo.snippet → C#/dddo.snippet
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>dddo</Title>
<Shortcut>dddo</Shortcut>
<Description>Code snippet for dump with options: Desharp.Debug.Dump(obj, new Desharp.DumpOptions {...});</Description>
<Author>Tom Flídr</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>DesharpDebug</ID>
<Function>SimpleTypeName(global::Desharp.Debug)</Function>
</Literal>
<Literal Editable="false">
<ID>DesharpDumpOptions</ID>
<Function>SimpleTypeName(global::Desharp.DumpOptions)</Function>
</Literal>
<Literal>
<ID>obj</ID>
<Default>obj</Default>
<ToolTip>Any C# object to dump into HDD log.</ToolTip>
<ToolTip>Any .NET object to print in Debugger Output window or directly in Console window.</ToolTip>
</Literal>
<Literal>
<ID>depth</ID>
<Default>4</Default>
<ToolTip>First argument C# object dumping depth.</ToolTip>
<ToolTip>Printed object structure depth (levels count to print).</ToolTip>
</Literal>
<Literal>
<ID>return</ID>
<Default>false</Default>
<ToolTip>Return dumped object as string.</ToolTip>
<ToolTip>True to return printed object as string object reprezentation.</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Dump($obj$, new Desharp.DumpOptions {
Depth = $depth$,
Return = $return$
});$snippetEnd$]]></Code>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Dump($obj$, new $DesharpDumpOptions$ {
Depth = $depth$,
Return = $return$
});$snippetEnd$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
10 changes: 3 additions & 7 deletions Visual C#/dde.snippet → C#/dde.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>dde</Title>
<Title>Desharp.Debug.Log(e);</Title>
<Shortcut>dde</Shortcut>
<Description>Code snippet for logging exceptions: Desharp.Debug.Log(e);</Description>
<Description>Log rendered exception instance as string with all inner exceptions into file exceptions.(log|html).</Description>
<Author>Tom Flídr</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
Expand All @@ -19,12 +16,11 @@
<Literal>
<ID>e</ID>
<Default>e</Default>
<ToolTip>Any C# Exception instance to dump into application output.</ToolTip>
<ToolTip>Any .NET object inherited from System.Exception to render into HDD exceptions log.</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Log($e$);$snippetEnd$]]></Code>
Expand Down
34 changes: 34 additions & 0 deletions C#/ddf.snippet
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Desharp.Debug.Fire.Log(obj);</Title>
<Shortcut>ddf</Shortcut>
<Description>Print any serializable .NET object into JSON and log in client browser console through FirePHP/fire4chrome browser extension.</Description>
<Author>Tom Flídr</Author>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>DesharpDebug</ID>
<Function>SimpleTypeName(global::Desharp.Debug)</Function>
</Literal>
<Literal>
<ID>browserConsoleMethod</ID>
<Default>Log</Default>
<ToolTip>Any .NET object to print in Debugger Output window or directly in Console window.</ToolTip>
</Literal>
<Literal>
<ID>obj</ID>
<Default>obj</Default>
<ToolTip>Any serializable .NET object into JSON and log in client browser console through FirePHP/Fire4Chrome browser extension.</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Fire.$browserConsoleMethod$($obj$);$snippetEnd$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
18 changes: 9 additions & 9 deletions Visual C#/ddl.snippet → C#/ddl.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ddl</Title>
<Title>Desharp.Debug.Log(obj, Desharp.Level.DEBUG);</Title>
<Shortcut>ddl</Shortcut>
<Description>Code snippet for: Desharp.Debug.Log(obj, Desharp.Level.DEBUG);</Description>
<Description>Log any structuralized .NET object into HDD log file, chosen by second param.</Description>
<Author>Tom Flídr</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>DesharpDebug</ID>
<Function>SimpleTypeName(global::Desharp.Debug)</Function>
</Literal>
<Literal Editable="false">
<ID>DesharpLevel</ID>
<Function>SimpleTypeName(global::Desharp.Level)</Function>
</Literal>
<Literal>
<ID>obj</ID>
<Default>obj</Default>
<ToolTip>Any C# object to dump into HDD log.</ToolTip>
<ToolTip>Any .NET object to log into HDD log file, chosen by second param.</ToolTip>
</Literal>
<Literal>
<ID>level</ID>
<Default>DEBUG</Default>
<ToolTip>Log level - ALERT, CRITICAL, DEBUG, EMERGENCY, ERROR, INFO, JAVASCRIPT, NOTICE or WARNING.</ToolTip>
<ToolTip>Log level (log file name): ALERT, CRITICAL, DEBUG, EMERGENCY, ERROR, INFO, JAVASCRIPT, NOTICE or WARNING.</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Log($obj$, Desharp.Level.$level$);$snippetEnd$]]></Code>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Log($obj$, $DesharpLevel$.$level$);$snippetEnd$]]></Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
8 changes: 2 additions & 6 deletions Visual C#/dds.snippet → C#/dds.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>dds</Title>
<Title>Desharp.Debug.Stop();</Title>
<Shortcut>dds</Shortcut>
<Description>Code snippet for: Desharp.Debug.Stop();</Description>
<Description>Print current thread stack trace into application output and exit web request for web applications or exit running desktop application with all application threads.</Description>
<Author>Tom Flídr</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
Expand All @@ -19,7 +16,6 @@
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Stop();$snippetEnd$]]></Code>
Expand Down
12 changes: 4 additions & 8 deletions Visual C#/ddt.snippet → C#/ddt.snippet
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>ddt</Title>
<Title>Desharp.Debug.Timer(name);</Title>
<Shortcut>ddt</Shortcut>
<Description>Code snippet for: Desharp.Debug.Timer(name);</Description>
<Description>Prints to ouput or into log file number of seconds from last timer call under called name in seconds with 3 floating point decimal spaces.</Description>
<Author>Tom Flídr</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
Expand All @@ -18,13 +15,12 @@
</Literal>
<Literal>
<ID>name</ID>
<Default></Default>
<ToolTip>Name to identify timer.</ToolTip>
<Default>default</Default>
<ToolTip>Timer name, used as key to find last <c>Desharp.Debug.Timer(name);</c> call from internal dictionary to print the timespan in app output or log file.</ToolTip>
</Literal>
<Literal>
<ID>snippetEnd</ID>
<Default></Default>
<ToolTip>Snippet end.</ToolTip>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$DesharpDebug$.Timer("$name$");$snippetEnd$]]></Code>
Expand Down
Loading

0 comments on commit 2edad52

Please sign in to comment.