Skip to content

Commit

Permalink
add "add link" to dir button
Browse files Browse the repository at this point in the history
  • Loading branch information
burdoto committed Jun 27, 2021
1 parent 90efd42 commit b0801aa
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
15 changes: 14 additions & 1 deletion DirLinkerWPF/DirLinker.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ private void AddLinkFromInput()

var dirEntry = GetOrCreateDir(linkDir);
var linkEntry = dirEntry.GetOrCreateLink(LinkNameInput.Text, targetDir);

LinkDirInput.Text = "";
LinkDirInput.IsEnabled = true;
LinkNameInput.Text = "";
LinkNameInput.IsEnabled = true;
TargetDirInput.Text = "";
TargetDirInput.IsEnabled = true;
}

private LinkDirEntry Add(Configuration.LinkDir blob)
Expand Down Expand Up @@ -157,7 +164,13 @@ private void UpdateLinkList()
}
}
}


public void StartAddLink(string forDir)
{
LinkDirInput.Text = forDir;
LinkDirInput.IsEnabled = false;
}

public void StartEditDirectory(LinkDirEntry linkDirEntry)
{
throw new NotImplementedException();
Expand Down
6 changes: 4 additions & 2 deletions DirLinkerWPF/LinkDirEntry.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="40" />
<ColumnDefinition Width="40" />
<ColumnDefinition Width="40" />
</Grid.ColumnDefinitions>

<TextBlock Grid.Row="0" Grid.Column="0" Text="Link Directory:" />
<TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding LinkDirName}" VerticalAlignment="Bottom" />

<Button Grid.Row="0" Grid.Column="1" Content="Edit" Click="Button_Edit" IsEnabled="False" />
<Button Grid.Row="0" Grid.Column="2" Content="Del" Click="Button_Remove" />
<Button Grid.Row="0" Grid.Column="1" Content="Add" Click="Button_AddLink" IsEnabled="False" />
<Button Grid.Row="0" Grid.Column="2" Content="Edit" Click="Button_Edit" IsEnabled="False" />
<Button Grid.Row="0" Grid.Column="3" Content="Del" Click="Button_Remove" />

<StackPanel Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="9" Orientation="Vertical" Name="LinkList" />
</Grid>
Expand Down
5 changes: 5 additions & 0 deletions DirLinkerWPF/LinkDirEntry.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ private void UpdateHeight()
ListRow.Height = new GridLength(count * 35);
}

private void Button_AddLink(object sender, RoutedEventArgs e)
{
_window.StartAddLink(LinkDirName);
}

private void Button_Edit(object sender, RoutedEventArgs e)
{
throw new NotImplementedException();
Expand Down

0 comments on commit b0801aa

Please sign in to comment.