Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full support for MKD extension #84

Merged
merged 1 commit into from
Jan 25, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/MarkPad/Settings/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
MouseLeftButtonDown="DragMoveWindow"
ShowInTaskbar="False"
SnapsToDevicePixels="True"
WindowStartupLocation="CenterOwner" Width="300" Height="320" ResizeMode="NoResize">
WindowStartupLocation="CenterOwner" Width="300" Height="365" ResizeMode="NoResize">
<i:Interaction.Behaviors>
<Behaviours:BorderlessWindowBehavior ResizeWithGrip="False" />
</i:Interaction.Behaviors>
Expand Down Expand Up @@ -34,8 +34,8 @@
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="93" />
<RowDefinition Height="107*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock TextWrapping="Wrap" VerticalAlignment="Top" FontFamily="Segoe UI" FontWeight="Light" FontSize="29.333" Text="settings" />
Expand All @@ -50,7 +50,8 @@
<CheckBox x:Name="FileMDBinding" Content=".md" />
<CheckBox x:Name="FileMDownBinding" Content=".mdown" />
<CheckBox x:Name="FileMarkdownBinding" Content=".markdown" />
</StackPanel>
<CheckBox x:Name="FileMKDBinding" Content=".mkd" />
</StackPanel>
<StackPanel Grid.Row="2" Margin="0 10 0 0">
<TextBlock Text="Blog Sites" />
<StackPanel Orientation="Horizontal">
Expand Down
7 changes: 6 additions & 1 deletion src/MarkPad/Settings/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public SettingsViewModel(ISettingsService settingsService, IWindowManager window

FileMDownBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[2]) &&
!string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[2]).GetValue("").ToString());

FileMKDBinding = key.GetSubKeyNames().Contains(Constants.DefaultExtensions[3]) &&
!string.IsNullOrEmpty(key.OpenSubKey(Constants.DefaultExtensions[3]).GetValue("").ToString());
}

var blogs = settingsService.Get<List<BlogSetting>>("Blogs") ?? new List<BlogSetting>();
Expand All @@ -45,6 +48,7 @@ public SettingsViewModel(ISettingsService settingsService, IWindowManager window
public bool FileMDBinding { get; set; }
public bool FileMarkdownBinding { get; set; }
public bool FileMDownBinding { get; set; }
public bool FileMKDBinding { get; set; }

public BlogSetting CurrentBlog { get; set; }
public ObservableCollection<BlogSetting> Blogs { get; set; }
Expand Down Expand Up @@ -129,7 +133,8 @@ private void UpdateExtensionRegistryKeys()
{
if ((i == 0 && FileMDBinding) ||
(i == 1 && FileMarkdownBinding) ||
(i == 2 && FileMDownBinding))
(i == 2 && FileMDownBinding) ||
(i == 3 && FileMKDBinding))
extensionKey.SetValue("", markpadKeyName);
else
extensionKey.SetValue("", "");
Expand Down