Tags » Code Snippet

Code Snipet: Constructor

Handy keyboard shortcut for quickly adding a new Constructor to a Class.

Step 1: Place your cursor where you want to add the Constructor:

Step 2: Type “ctor”: 13 more words

Code Snippet: Console Writeline

Handy keyboard shortcut this one for quickly adding Console.Writeline() to a method.

Step 1: Place your cursor where you want to add Console.Writeline():

Step 2: Type “cw”: 13 more words

Visual Studio Code Snippets

In  an attempt to improve my use of Visual Studio 2015 I have decided to actually investigate and learn some of the many code snippets and keyboard shortcuts that exist to make my coding quicker and easier. 17 more words

WPF / MVVM, RadioButton, binding enum and manipulating IsEnabled of Control.

A usefull snippet to create a RadioButton that manipulates a binded value in the ViewModel, and than manipulates Objects in the Control.

<UserControl.Resources>
	<ResourceDictionary>
		<geoTaskEditor:EnumConvertor x:Key="ConvertEnum" />
	</ResourceDictionary>
</UserControl.Resources>

<StackPanel>
	<StackPanel>
		<Label Content="@Target type:"/>
		<RadioButton GroupName="TargetType" Content="Target 1" IsChecked="{Binding TargetType, Converter={StaticResource ConvertEnum}, ConverterParameter={x:Static anyNamespace:TargetsTypes.Target1}, Mode=TwoWay}" />
		<RadioButton GroupName="TargetType" Content="Target 2" IsChecked="{Binding TargetType, Converter={StaticResource ConvertEnum}, ConverterParameter={x:Static anyNamespace:TargetsTypes.Target2}, Mode=TwoWay}"/>
	</StackPanel>
	
	<ContentControl Content="{Binding TargetA}" IsEnabled="{Binding TargetType, Converter={StaticResource ConvertEnum}, ConverterParameter={x:Static anyNamespace:TargetsTypes.Target1}}" />
	<myNamespace:MyView Content="{Binding TargetB}" IsEnabled="{Binding TargetType, Converter={StaticResource ConvertEnum}, ConverterParameter={x:Static anyNamespace:TargetsTypes.Target2}}" />
</StackPanel>
… 41 more words
.Net

Code Snippets on Xcode - How to call your most used methods quickly

Code snippets let you call your methods with typing 3 or 4 characters. They are most likely short cuts which you can customize contents as you wish and Xcode lets you to add your custom method calling shortcuts. 128 more words

Objective-C

Code Snippet - Given Path is File or Folder in C#

FileAttributes attribute = File.GetAttributes(@”C:\path.txt”);
if (attribute.HasFlag(FileAttributes.Directory))
{
Console.WriteLine(“Given input is File.”); //”C:\path.txt” is the input
}

Code Snippet

WPF Snippet - Setting a Binding on a Converter Parameter Property

A somewhat techy post today.

I came across a problem at work recently – I was attempting to bind the result of a converter to the command parameter of a button. 207 more words

Software Development