Tagged Questions
0
votes
0answers
36 views
Visual Studio 2010 snippets not working
For some reason the automatic insertion of code snippets doesn't work in my Visual Studio 2010. I want to do exactly this:
http://www.onesoft.dk/post/Using-the-switch-code-snippet-with-an-enum.aspx
...
0
votes
0answers
80 views
C# - snippet or template to assign all fields/properties quickly?
Quick points for someone who might know the answer - is there a snippet or tool that can quickly generate template code to assign all public fields and/or properties of an object?
Example:
public ...
0
votes
0answers
86 views
Generate method stub snippet: Alter signature to make access level public
By default, the "Extract method..." command of Visual Studio generates method stubs with the lowest possible access level, usually private. The relevant code snippet for it only references ...
2
votes
2answers
49 views
How to make VS assume everything is public by default
I use VS2012 and ReSharper 7 to write C# code. My projects are rarely so large or complicated as to require thinking about granular access levels. It's usually easier for me to just make everything ...
0
votes
3answers
113 views
Keyboard event tutorial c# [duplicate]
Can somebody give me a snippet, about event when a user presses Down Arrow button or Up Arrow button, in console something to be triggered example
Console.WriteLine("You have pressed up/down arrow ...
0
votes
0answers
59 views
Get selected text in code snippet ExpansionFunction
While creating code snippets, as this link describes, we can pass arguments into an expansion function.
So how can we pass the $selected$ into an expansion function or say get the selected text in ...
1
vote
1answer
80 views
How do I use snippets to get properties from the current class?
Is it possible for me to create a snippet and have it analyze a current class, get the properties of said class, and then create a sql function that writes out line by line each property in a command ...
3
votes
3answers
175 views
Shortcut to string in Visual Studio
When using Visual Studio console applications I often use the following line of code:
Console.WriteLine("press [enter] to exit");
Is there a way of setting up a short-cut key in Visual Studio so ...
1
vote
1answer
85 views
Parse Replacement Literal in Visual Studio Snippet [duplicate]
Possible Duplicate:
Formatting Literal parameters of a C# code snippet
EDIT: This can be closed. Found an exact duplicate, seems there is no solution. =(
Exact Duplicate:
Formatting ...
0
votes
1answer
141 views
Write some logic inside a .snippet file in C#
I am just curious if it is possible to write some logic inside a .snippet file or is there any work around to do something like that?
For example: Read an xml file and based on that generate the ...
1
vote
1answer
198 views
Get namespace in a Code Snippet
The Microsoft link here lists three methods that we can use.
But how do we get the current namespace?
I see there is a similar question, but the answer to that is using Macros, which doesnt solve ...
0
votes
1answer
101 views
How to Extract an Html element from a snipet of Html with HtmlAgilityPack?
Here is the Html code:
<table style="border:1px solid #000">
<tr style="background:#ddd;">
<td width="150">TableEle1</td>
<td width="150">TableEle2</td>
...
0
votes
3answers
804 views
Is there any free ASP.NET MVC Rich Text Editor with the ability to add Code Snippets?
I have an ASP.NET MVC application and I would need a Rich Text Editor which allows the user to add Code Snippets for HTML, JavaScript and C# codes.
Remember how Visual Studio formats such codes in ...
6
votes
2answers
163 views
How to write a code snippet to generate a method in C#?
I want to write a code snippet which does following thing, like if I have a class let's say MyClass:
class MyClass
{
public int Age { get; set; }
public string Name { get; set; ...
2
votes
1answer
138 views
Castle Windsor Visual Studio Code Snippet for ILogger
In Visual Studio you can use code snippets e.g. when your are editing a class you can type ctor and the default constructor will automaticly be added to your class.
Is it possible to create a code ...