Skip to content

Commit 2edad52

Browse files
committed
new - all code snippets for visual basic
new - snippet for Desharp.Debug.Fire.Log() fixed - snippet for Desharp.Debug.Configure()
1 parent aa20854 commit 2edad52

21 files changed

+492
-121
lines changed

Visual C#/dda.snippet renamed to C#/dda.snippet

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
33
<CodeSnippet Format="1.0.0">
44
<Header>
5-
<Title>dda</Title>
5+
<Title>Desharp.Debug.Assert(comparation, description);</Title>
66
<Shortcut>dda</Shortcut>
7-
<Description>Code snippet for: Desharp.Debug.Assert(comparation, description);</Description>
7+
<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>
88
<Author>Tom Flídr</Author>
9-
<SnippetTypes>
10-
<SnippetType>Expansion</SnippetType>
11-
</SnippetTypes>
129
</Header>
1310
<Snippet>
1411
<Declarations>
@@ -18,21 +15,23 @@
1815
</Literal>
1916
<Literal>
2017
<ID>comparation</ID>
21-
<Default></Default>
22-
<ToolTip>Comparation to log/dump.</ToolTip>
18+
<Default>true</Default>
19+
<ToolTip>Comparation boolean to dump or log, way to compare things is up to you.</ToolTip>
2320
</Literal>
2421
<Literal>
2522
<ID>description</ID>
2623
<Default></Default>
27-
<ToolTip>Comparation description.</ToolTip>
24+
<ToolTip>Any text to describe previous comparation.</ToolTip>
2825
</Literal>
2926
<Literal>
3027
<ID>snippetEnd</ID>
3128
<Default></Default>
32-
<ToolTip>Snippet end.</ToolTip>
3329
</Literal>
3430
</Declarations>
35-
<Code Language="csharp"><![CDATA[$DesharpDebug$.Assert($comparation$, "$description$");$snippetEnd$]]></Code>
31+
<Code Language="csharp"><![CDATA[$DesharpDebug$.Assert(
32+
$comparation$,
33+
"$description$"
34+
);$snippetEnd$]]></Code>
3635
</Snippet>
3736
</CodeSnippet>
3837
</CodeSnippets>

C#/ddc.snippet

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
3+
<CodeSnippet Format="1.0.0">
4+
<Header>
5+
<Title>Desharp.Debug.Configure(new DebugConfig {...});</Title>
6+
<Shortcut>ddc</Shortcut>
7+
<Description>Configure Desharp assembly from running application environment and override any XML config settings or automaticly detected settings.</Description>
8+
<Author>Tom Flídr</Author>
9+
</Header>
10+
<Snippet>
11+
<Declarations>
12+
<Literal Editable="false">
13+
<ID>DesharpDebug</ID>
14+
<Function>SimpleTypeName(global::Desharp.Debug)</Function>
15+
</Literal>
16+
<Literal Editable="false">
17+
<ID>DesharpDebugConfig</ID>
18+
<Function>SimpleTypeName(global::Desharp.DebugConfig)</Function>
19+
</Literal>
20+
<Literal Editable="false">
21+
<ID>DesharpLogFormat</ID>
22+
<Function>SimpleTypeName(global::Desharp.LogFormat)</Function>
23+
</Literal>
24+
<Literal>
25+
<ID>enabled</ID>
26+
<Default>true</Default>
27+
<ToolTip>Debug dumping into output is enabled or not.</ToolTip>
28+
</Literal>
29+
<Literal>
30+
<ID>depth</ID>
31+
<Default>3</Default>
32+
<ToolTip>How many levels in complex type variables will be iterated throw to dump all it's properties, fields and other values.</ToolTip>
33+
</Literal>
34+
<Literal>
35+
<ID>directory</ID>
36+
<Default>logs</Default>
37+
<ToolTip>Relative or absolute path into directory where all log files and mail notify boolean files will be stored.</ToolTip>
38+
</Literal>
39+
<Literal>
40+
<ID>logFormat</ID>
41+
<Default>Auto</Default>
42+
<ToolTip>Application environment - usually automaticly determinated by Desharp asembly - change this value only when you REALLY know what you are doing!</ToolTip>
43+
</Literal>
44+
<Literal>
45+
<ID>snippetEnd</ID>
46+
<Default></Default>
47+
<ToolTip>Snippet end.</ToolTip>
48+
</Literal>
49+
</Declarations>
50+
<Code Language="csharp"><![CDATA[$DesharpDebug$.Configure(new $DesharpDebugConfig$ {
51+
Enabled = $enabled$,
52+
Depth = $depth$,
53+
Directory = "~/$directory$",
54+
LogFormat = $DesharpLogFormat$.$logFormat$
55+
});$snippetEnd$]]></Code>
56+
</Snippet>
57+
</CodeSnippet>
58+
</CodeSnippets>

Visual C#/ddd.snippet renamed to C#/ddd.snippet

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2-
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
2+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
33
<CodeSnippet Format="1.0.0">
44
<Header>
5-
<Title>ddd</Title>
5+
<Title>Desharp.Debug.Dump(obj);</Title>
66
<Shortcut>ddd</Shortcut>
7-
<Description>Code snippet for: Desharp.Debug.Dump(obj);</Description>
7+
<Description>Print any structuralized .NET object in Debugger Output window or in Console window.</Description>
88
<Author>Tom Flídr</Author>
9-
<SnippetTypes>
10-
<SnippetType>Expansion</SnippetType>
11-
</SnippetTypes>
129
</Header>
1310
<Snippet>
1411
<Declarations>
@@ -19,12 +16,11 @@
1916
<Literal>
2017
<ID>obj</ID>
2118
<Default>obj</Default>
22-
<ToolTip>Any C# object to dump into application output.</ToolTip>
19+
<ToolTip>Any .NET object to print in Debugger Output window or directly in Console window.</ToolTip>
2320
</Literal>
2421
<Literal>
2522
<ID>snippetEnd</ID>
2623
<Default></Default>
27-
<ToolTip>Snippet end.</ToolTip>
2824
</Literal>
2925
</Declarations>
3026
<Code Language="csharp"><![CDATA[$DesharpDebug$.Dump($obj$);$snippetEnd$]]></Code>

Visual C#/dddd.snippet renamed to C#/dddd.snippet

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2-
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
2+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
33
<CodeSnippet Format="1.0.0">
44
<Header>
5-
<Title>dddd</Title>
5+
<Title>Desharp.Debug.DumpAndDie(obj);</Title>
66
<Shortcut>dddd</Shortcut>
7-
<Description>Code snippet for: Desharp.Debug.DumpAndDie(obj);</Description>
7+
<Description>Print any structuralized .NET object as last in Debugger Output window or in Console window and exit running application.</Description>
88
<Author>Tom Flídr</Author>
9-
<SnippetTypes>
10-
<SnippetType>Expansion</SnippetType>
11-
</SnippetTypes>
129
</Header>
1310
<Snippet>
1411
<Declarations>
@@ -19,12 +16,11 @@
1916
<Literal>
2017
<ID>obj</ID>
2118
<Default>obj</Default>
22-
<ToolTip>Any C# object to dump into application output.</ToolTip>
19+
<ToolTip>Any .NET object to print in Debugger Output window or directly in Console window.</ToolTip>
2320
</Literal>
2421
<Literal>
2522
<ID>snippetEnd</ID>
2623
<Default></Default>
27-
<ToolTip>Snippet end.</ToolTip>
2824
</Literal>
2925
</Declarations>
3026
<Code Language="csharp"><![CDATA[$DesharpDebug$.DumpAndDie($obj$);$snippetEnd$]]></Code>
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
<?xml version="1.0" encoding="utf-8" ?>
2-
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
2+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
33
<CodeSnippet Format="1.0.0">
44
<Header>
55
<Title>dddo</Title>
66
<Shortcut>dddo</Shortcut>
77
<Description>Code snippet for dump with options: Desharp.Debug.Dump(obj, new Desharp.DumpOptions {...});</Description>
88
<Author>Tom Flídr</Author>
9-
<SnippetTypes>
10-
<SnippetType>Expansion</SnippetType>
11-
</SnippetTypes>
129
</Header>
1310
<Snippet>
1411
<Declarations>
1512
<Literal Editable="false">
1613
<ID>DesharpDebug</ID>
1714
<Function>SimpleTypeName(global::Desharp.Debug)</Function>
1815
</Literal>
16+
<Literal Editable="false">
17+
<ID>DesharpDumpOptions</ID>
18+
<Function>SimpleTypeName(global::Desharp.DumpOptions)</Function>
19+
</Literal>
1920
<Literal>
2021
<ID>obj</ID>
2122
<Default>obj</Default>
22-
<ToolTip>Any C# object to dump into HDD log.</ToolTip>
23+
<ToolTip>Any .NET object to print in Debugger Output window or directly in Console window.</ToolTip>
2324
</Literal>
2425
<Literal>
2526
<ID>depth</ID>
2627
<Default>4</Default>
27-
<ToolTip>First argument C# object dumping depth.</ToolTip>
28+
<ToolTip>Printed object structure depth (levels count to print).</ToolTip>
2829
</Literal>
2930
<Literal>
3031
<ID>return</ID>
3132
<Default>false</Default>
32-
<ToolTip>Return dumped object as string.</ToolTip>
33+
<ToolTip>True to return printed object as string object reprezentation.</ToolTip>
3334
</Literal>
3435
<Literal>
3536
<ID>snippetEnd</ID>
3637
<Default></Default>
37-
<ToolTip>Snippet end.</ToolTip>
3838
</Literal>
3939
</Declarations>
40-
<Code Language="csharp"><![CDATA[$DesharpDebug$.Dump($obj$, new Desharp.DumpOptions {
41-
Depth = $depth$,
42-
Return = $return$
43-
});$snippetEnd$]]></Code>
40+
<Code Language="csharp"><![CDATA[$DesharpDebug$.Dump($obj$, new $DesharpDumpOptions$ {
41+
Depth = $depth$,
42+
Return = $return$
43+
});$snippetEnd$]]></Code>
4444
</Snippet>
4545
</CodeSnippet>
4646
</CodeSnippets>

Visual C#/dde.snippet renamed to C#/dde.snippet

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
33
<CodeSnippet Format="1.0.0">
44
<Header>
5-
<Title>dde</Title>
5+
<Title>Desharp.Debug.Log(e);</Title>
66
<Shortcut>dde</Shortcut>
7-
<Description>Code snippet for logging exceptions: Desharp.Debug.Log(e);</Description>
7+
<Description>Log rendered exception instance as string with all inner exceptions into file exceptions.(log|html).</Description>
88
<Author>Tom Flídr</Author>
9-
<SnippetTypes>
10-
<SnippetType>Expansion</SnippetType>
11-
</SnippetTypes>
129
</Header>
1310
<Snippet>
1411
<Declarations>
@@ -19,12 +16,11 @@
1916
<Literal>
2017
<ID>e</ID>
2118
<Default>e</Default>
22-
<ToolTip>Any C# Exception instance to dump into application output.</ToolTip>
19+
<ToolTip>Any .NET object inherited from System.Exception to render into HDD exceptions log.</ToolTip>
2320
</Literal>
2421
<Literal>
2522
<ID>snippetEnd</ID>
2623
<Default></Default>
27-
<ToolTip>Snippet end.</ToolTip>
2824
</Literal>
2925
</Declarations>
3026
<Code Language="csharp"><![CDATA[$DesharpDebug$.Log($e$);$snippetEnd$]]></Code>

C#/ddf.snippet

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
3+
<CodeSnippet Format="1.0.0">
4+
<Header>
5+
<Title>Desharp.Debug.Fire.Log(obj);</Title>
6+
<Shortcut>ddf</Shortcut>
7+
<Description>Print any serializable .NET object into JSON and log in client browser console through FirePHP/fire4chrome browser extension.</Description>
8+
<Author>Tom Flídr</Author>
9+
</Header>
10+
<Snippet>
11+
<Declarations>
12+
<Literal Editable="false">
13+
<ID>DesharpDebug</ID>
14+
<Function>SimpleTypeName(global::Desharp.Debug)</Function>
15+
</Literal>
16+
<Literal>
17+
<ID>browserConsoleMethod</ID>
18+
<Default>Log</Default>
19+
<ToolTip>Any .NET object to print in Debugger Output window or directly in Console window.</ToolTip>
20+
</Literal>
21+
<Literal>
22+
<ID>obj</ID>
23+
<Default>obj</Default>
24+
<ToolTip>Any serializable .NET object into JSON and log in client browser console through FirePHP/Fire4Chrome browser extension.</ToolTip>
25+
</Literal>
26+
<Literal>
27+
<ID>snippetEnd</ID>
28+
<Default></Default>
29+
</Literal>
30+
</Declarations>
31+
<Code Language="csharp"><![CDATA[$DesharpDebug$.Fire.$browserConsoleMethod$($obj$);$snippetEnd$]]></Code>
32+
</Snippet>
33+
</CodeSnippet>
34+
</CodeSnippets>

Visual C#/ddl.snippet renamed to C#/ddl.snippet

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@
22
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
33
<CodeSnippet Format="1.0.0">
44
<Header>
5-
<Title>ddl</Title>
5+
<Title>Desharp.Debug.Log(obj, Desharp.Level.DEBUG);</Title>
66
<Shortcut>ddl</Shortcut>
7-
<Description>Code snippet for: Desharp.Debug.Log(obj, Desharp.Level.DEBUG);</Description>
7+
<Description>Log any structuralized .NET object into HDD log file, chosen by second param.</Description>
88
<Author>Tom Flídr</Author>
9-
<SnippetTypes>
10-
<SnippetType>Expansion</SnippetType>
11-
</SnippetTypes>
129
</Header>
1310
<Snippet>
1411
<Declarations>
1512
<Literal Editable="false">
1613
<ID>DesharpDebug</ID>
1714
<Function>SimpleTypeName(global::Desharp.Debug)</Function>
1815
</Literal>
16+
<Literal Editable="false">
17+
<ID>DesharpLevel</ID>
18+
<Function>SimpleTypeName(global::Desharp.Level)</Function>
19+
</Literal>
1920
<Literal>
2021
<ID>obj</ID>
2122
<Default>obj</Default>
22-
<ToolTip>Any C# object to dump into HDD log.</ToolTip>
23+
<ToolTip>Any .NET object to log into HDD log file, chosen by second param.</ToolTip>
2324
</Literal>
2425
<Literal>
2526
<ID>level</ID>
2627
<Default>DEBUG</Default>
27-
<ToolTip>Log level - ALERT, CRITICAL, DEBUG, EMERGENCY, ERROR, INFO, JAVASCRIPT, NOTICE or WARNING.</ToolTip>
28+
<ToolTip>Log level (log file name): ALERT, CRITICAL, DEBUG, EMERGENCY, ERROR, INFO, JAVASCRIPT, NOTICE or WARNING.</ToolTip>
2829
</Literal>
2930
<Literal>
3031
<ID>snippetEnd</ID>
3132
<Default></Default>
32-
<ToolTip>Snippet end.</ToolTip>
3333
</Literal>
3434
</Declarations>
35-
<Code Language="csharp"><![CDATA[$DesharpDebug$.Log($obj$, Desharp.Level.$level$);$snippetEnd$]]></Code>
35+
<Code Language="csharp"><![CDATA[$DesharpDebug$.Log($obj$, $DesharpLevel$.$level$);$snippetEnd$]]></Code>
3636
</Snippet>
3737
</CodeSnippet>
3838
</CodeSnippets>

Visual C#/dds.snippet renamed to C#/dds.snippet

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
33
<CodeSnippet Format="1.0.0">
44
<Header>
5-
<Title>dds</Title>
5+
<Title>Desharp.Debug.Stop();</Title>
66
<Shortcut>dds</Shortcut>
7-
<Description>Code snippet for: Desharp.Debug.Stop();</Description>
7+
<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>
88
<Author>Tom Flídr</Author>
9-
<SnippetTypes>
10-
<SnippetType>Expansion</SnippetType>
11-
</SnippetTypes>
129
</Header>
1310
<Snippet>
1411
<Declarations>
@@ -19,7 +16,6 @@
1916
<Literal>
2017
<ID>snippetEnd</ID>
2118
<Default></Default>
22-
<ToolTip>Snippet end.</ToolTip>
2319
</Literal>
2420
</Declarations>
2521
<Code Language="csharp"><![CDATA[$DesharpDebug$.Stop();$snippetEnd$]]></Code>

Visual C#/ddt.snippet renamed to C#/ddt.snippet

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
33
<CodeSnippet Format="1.0.0">
44
<Header>
5-
<Title>ddt</Title>
5+
<Title>Desharp.Debug.Timer(name);</Title>
66
<Shortcut>ddt</Shortcut>
7-
<Description>Code snippet for: Desharp.Debug.Timer(name);</Description>
7+
<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>
88
<Author>Tom Flídr</Author>
9-
<SnippetTypes>
10-
<SnippetType>Expansion</SnippetType>
11-
</SnippetTypes>
129
</Header>
1310
<Snippet>
1411
<Declarations>
@@ -18,13 +15,12 @@
1815
</Literal>
1916
<Literal>
2017
<ID>name</ID>
21-
<Default></Default>
22-
<ToolTip>Name to identify timer.</ToolTip>
18+
<Default>default</Default>
19+
<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>
2320
</Literal>
2421
<Literal>
2522
<ID>snippetEnd</ID>
2623
<Default></Default>
27-
<ToolTip>Snippet end.</ToolTip>
2824
</Literal>
2925
</Declarations>
3026
<Code Language="csharp"><![CDATA[$DesharpDebug$.Timer("$name$");$snippetEnd$]]></Code>

0 commit comments

Comments
 (0)