I’ve gotten a lot requests for the snippet manager I used at my Mix08 session.
So as promised, here it is for everyone who is interested: app, code.
The first incarnation of this application was done by Nick Kramer (Thanks Nick!). I’ve tweaked it and added a WPF frontend.
How do I use it?
- To use a snippet, drag the title of the snippet to the desired target app.
- In order to move the app around, drag the black bottom portion of the window.
- The topmost checkbox and load/close buttons work as you would expect.
If desired, you can start the app from the commandline:
snippetmanager.exe /notontop [snippetsfile] [snippetsfile] …
where /notontop indicates that the snippet manager should start out NOT being topmost.
What is the format of the snippet file?
The format of the snippet file is:
| Line | Meaning |
| /////////////////////////////// | Separates the contents of one snippet from another snippet. |
| // First Snippet Title | Indicates what the “title” for a snippet should be.
(Note: if a snippet does not have a title, the first line of the snippet appears in the snippet manager.) |
| ————————– | Separates sections of snippets and restarts numbering of snippets. |
| partial line:<content> | Should treat <content> as part of an existing line. (i.e. Snippet should not include a line break at its end.) |
| <other> | Any other line is treated as the content of a snippet |
Given the “exactness” of the file format, I’d recommend always copying and editing the sample snippet file.
The sample snippet file (which was used in the above screen shot) is included in the zip and shown below:
1: ///////////////////////////////
2: // First Snippet Title
3: <Style x:Key="TitleStyle" TargetType="TextBlock">
4: <Setter Property="FontSize" Value="35"/>
5: </Style>
6: ///////////////////////////////
7: // Second Snippet Title
8: partial line:Style="{StaticResource TitleStyle}"
9: ///////////////////////////////
10: Snippet content (no title)
11: ///////////////////////////////
12: --------------------------
13: ///////////////////////////////
14: // Second Snippet Section
15: <ControlTemplate x:Key="SubmitButtonTemplate" TargetType="Button">
16: <Grid Width="70" Height="20" Background="DarkGray">
17: <TextBlock Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="12" FontFamily="/fonts/IngebretsenNeato.ttf#Ingebretsen Neato" Text="Submit"/>
18: </Grid>
19: </ControlTemplate>
