Skip to content

Commit

Permalink
🎨 Improve formatting of method definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
Lamparter committed Aug 29, 2024
1 parent 73e63b7 commit 1bfcefc
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/FluentHub.App/UserControls/GitCloneFlyout.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@

<Button
HorizontalAlignment="Stretch"
Click="GitHubDeskButton_Click"
Click="OpenGitHubDesktopButton_Click"
IsEnabled="True">
<StackPanel Orientation="Horizontal" Spacing="8">
<FontIcon
Expand Down
52 changes: 26 additions & 26 deletions src/FluentHub.App/UserControls/GitCloneFlyout.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,32 @@ private void CopyButton_Click(object sender, RoutedEventArgs e)
Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(dp);
}

private void CopyGitCommand_Click(object sender, RoutedEventArgs e)
{
var dp = new Windows.ApplicationModel.DataTransfer.DataPackage();
dp.SetText("git clone" + " " + CloneUriTextBox.Text);
Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(dp);
}

private async void OpenGitHubDesktopButton_Click(object sender, RoutedEventArgs e)
{
string encodedUrl = Uri.EscapeDataString(_repoGitUrl);
string openGitHubDesktopUrl = "x-github-client://openRepo/" + encodedUrl;

var uri = new Uri(openGitHubDesktopUrl);

var success = await Windows.System.Launcher.LaunchUriAsync(uri);

if (success)
{
Log.Write(Serilog.Events.LogEventLevel.Information, "Opened GitHub Desktop with the repository");
}
else
{
Log.Error("Error opening GitHub Desktop");
}
}

private async void OpenVSButton_Click(object sender, RoutedEventArgs e)
{
string encodedUrl = Uri.EscapeDataString(_repoGitUrl);
Expand Down Expand Up @@ -155,31 +181,5 @@ private async void DownloadZipButton_Click(object sender, RoutedEventArgs e)
Log.Error(downloadZipUrl, "Something went wrong downloading the repository in archive form. The URL was not found or it doesn't work");
}
}

private async void GitHubDeskButton_Click(object sender, RoutedEventArgs e)
{
string encodedUrl = Uri.EscapeDataString(_repoGitUrl);
string openGitHubDesktopUrl = "x-github-client://openRepo/" + encodedUrl;

var uri = new Uri(openGitHubDesktopUrl);

var success = await Windows.System.Launcher.LaunchUriAsync(uri);

if (success)
{
Log.Write(Serilog.Events.LogEventLevel.Information, "Opened GitHub Desktop with the repository");
}
else
{
Log.Error("Error opening GitHub Desktop");
}
}

private void CopyGitCommand_Click(object sender, RoutedEventArgs e)
{
var dp = new Windows.ApplicationModel.DataTransfer.DataPackage();
dp.SetText("git clone" + " " + CloneUriTextBox.Text);
Windows.ApplicationModel.DataTransfer.Clipboard.SetContent(dp);
}
}
}

0 comments on commit 1bfcefc

Please sign in to comment.