Error CS0436 The type 'ActionKeywords' in 'C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ActionKeywords.xaml.cs' conflicts with the imported type 'ActionKeywords' in 'Wox, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Using the type defined in 'C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ActionKeywords.xaml.cs'. PowerLauncher C:\Repos\PowerToys\src\modules\launcher\PowerLauncher\ActionKeywords.xaml 7 Active
This commit is contained in:
ryanbodrug-microsoft 2020-06-18 13:44:22 -07:00
parent 165ffed9e6
commit 256a17f2c9
2 changed files with 0 additions and 103 deletions

View File

@ -1,45 +0,0 @@
<Window x:Class="Wox.ActionKeywords"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="ActionKeywords"
Icon="Images\app.png"
ResizeMode="NoResize"
Loaded="ActionKeyword_OnLoaded"
WindowStartupLocation="CenterScreen"
Height="200" Width="600">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="170" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Margin="10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
HorizontalAlignment="Right" Text="{DynamicResource oldActionKeyword}" />
<TextBlock x:Name="tbOldActionKeyword" Margin="10" FontSize="14" Grid.Row="0" Grid.Column="1"
VerticalAlignment="Center" HorizontalAlignment="Left">
Old ActionKeywords:
</TextBlock>
<TextBlock Margin="10" FontSize="14" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center"
HorizontalAlignment="Right" Text="{DynamicResource newActionKeyword}" />
<StackPanel Grid.Row="1" Orientation="Horizontal" Grid.Column="1">
<TextBox x:Name="tbAction" Margin="10" Width="400" VerticalAlignment="Center" HorizontalAlignment="Left" />
</StackPanel>
<TextBlock Grid.Row="2" Grid.ColumnSpan="1" Grid.Column="1" Padding="5" Foreground="Gray"
Text="{DynamicResource actionkeyword_tips}" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="3" Grid.Column="1">
<Button x:Name="btnCancel" Click="BtnCancel_OnClick" Margin="10 0 10 0" Width="80" Height="25"
Content="{DynamicResource cancel}" />
<Button x:Name="btnDone" Margin="10 0 10 0" Width="80" Height="25" Click="btnDone_OnClick">
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
</Button>
</StackPanel>
</Grid>
</Window>

View File

@ -1,58 +0,0 @@
using System.Windows;
using Wox.Core.Plugin;
using Wox.Core.Resource;
using Wox.Infrastructure.Exception;
using Wox.Infrastructure.UserSettings;
using Wox.Plugin;
namespace Wox
{
public partial class ActionKeywords : Window
{
private PluginPair _plugin;
private Settings _settings;
private readonly Internationalization _translater = InternationalizationManager.Instance;
public ActionKeywords(string pluginId, Settings settings)
{
InitializeComponent();
_plugin = PluginManager.GetPluginForId(pluginId);
_settings = settings;
if (_plugin == null)
{
MessageBox.Show(_translater.GetTranslation("cannotFindSpecifiedPlugin"));
Close();
}
}
private void ActionKeyword_OnLoaded(object sender, RoutedEventArgs e)
{
tbOldActionKeyword.Text = string.Join(Query.ActionKeywordSeparator, _plugin.Metadata.ActionKeywords.ToArray());
tbAction.Focus();
}
private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
{
Close();
}
private void btnDone_OnClick(object sender, RoutedEventArgs _)
{
var oldActionKeyword = _plugin.Metadata.ActionKeywords[0];
var newActionKeyword = tbAction.Text.Trim();
newActionKeyword = newActionKeyword.Length > 0 ? newActionKeyword : "*";
if (!PluginManager.ActionKeywordRegistered(newActionKeyword))
{
var id = _plugin.Metadata.ID;
PluginManager.ReplaceActionKeyword(id, oldActionKeyword, newActionKeyword);
MessageBox.Show(_translater.GetTranslation("success"));
Close();
}
else
{
string msg = _translater.GetTranslation("newActionKeywordsHasBeenAssigned");
MessageBox.Show(msg);
}
}
}
}