Skip to content

Commit

Permalink
Merge branch 'main' into user/ssparach/moreAccessibilityBugFixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssparach committed Oct 10, 2024
2 parents 04e0512 + ff2f078 commit ab99110
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<PlatformTarget>$(Platform)</PlatformTarget>
<ErrorOnDuplicatePublishOutputFiles>false</ErrorOnDuplicatePublishOutputFiles>
<Configurations>Debug;Release;Debug_FailFast</Configurations>
<WindowsSdkPackageVersion>10.0.22621.34</WindowsSdkPackageVersion>
</PropertyGroup>

<!--
Expand Down
1 change: 1 addition & 0 deletions extensionsdk/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisMode>Recommended</AnalysisMode>
<PlatformTarget>$(Platform)</PlatformTarget>
<WindowsSdkPackageVersion>10.0.19041.34</WindowsSdkPackageVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,4 +306,11 @@ private void AdjustFocus(object sender)
_log.Information($"Set focus to add reposiotry card result: {isFocusSet}");
}
}

public void UnassignSourceControlProviderFromRepository(string repositoryRootPath)
{
ExtraFolderPropertiesWrapper.Unregister(repositoryRootPath);
RepoTracker.ModifySourceControlProviderForTrackedRepository(_unassigned, repositoryRootPath);
RefreshTrackedRepositories();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ private void SourceControlProviderMenuFlyout_Opening(object sender, object e)
{
if (sender is MenuFlyout menuFlyout)
{
var stringResource = new StringResource("DevHome.Customization.pri", "DevHome.Customization/Resources");
menuFlyout.Items.Clear();

foreach (var extension in ViewModel.ExtensionService.GetInstalledExtensionsAsync(ProviderType.LocalRepository).Result)
Expand All @@ -56,10 +57,26 @@ private void SourceControlProviderMenuFlyout_Opening(object sender, object e)
};
menuItem.Click += AssignSourceControlProviderButton_Click;

var stringResource = new StringResource("DevHome.Customization.pri", "DevHome.Customization/Resources");
ToolTipService.SetToolTip(menuItem, stringResource.GetLocalized("PrefixForDevHomeVersion", extension.PackageDisplayName));
menuFlyout.Items.Add(menuItem);
}

var unassignMenuItem = new MenuFlyoutItem
{
Text = stringResource.GetLocalized("MenuFlyoutUnregisteredRepository_Content"),
};
unassignMenuItem.Click += UnassignFolderButton_Click;
menuFlyout.Items.Add(unassignMenuItem);
}
}

public void UnassignFolderButton_Click(object sender, RoutedEventArgs e)
{
// Extract relevant data from view and give to view model for unassign
MenuFlyoutItem menuItem = (MenuFlyoutItem)sender;
if (menuItem.DataContext is RepositoryInformation repoInfo)
{
ViewModel.UnassignSourceControlProviderFromRepository(repoInfo.RepositoryRootPath);
}
}

Expand Down

0 comments on commit ab99110

Please sign in to comment.