Delete Fody and PropertyChanged.Fody (#9120)

This commit is contained in:
Mykhailo Pylyp
2021-01-20 11:23:56 +02:00
committed by GitHub
parent d2a1ac9c3f
commit 433e2e57ed
11 changed files with 163 additions and 184 deletions

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged />
</Weavers>

View File

@@ -1,74 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="PropertyChanged" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="InjectOnPropertyNameChanged" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="CheckForEquality" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="CheckForEqualityUsingBaseEquals" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should use the Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="UseStaticEqualsFromBase" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -88,10 +88,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fody" Version="6.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
<PackageReference Include="Mages" Version="1.6.0">
<NoWarn>NU1701</NoWarn>
@@ -108,9 +104,6 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PropertyChanged.Fody" Version="3.3.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="SharpZipLib" Version="1.2.0" />
<PackageReference Include="System.Runtime" Version="4.3.1" />
<PackageReference Include="Microsoft.VCRTForwarders.140" Version="1.0.6" />

View File

@@ -15,11 +15,50 @@ namespace PowerLauncher.ViewModel
public string PluginName { get; set; }
public string Title { get; set; }
private string _title;
public string Glyph { get; set; }
public string Title
{
get => _title;
set
{
if (_title != value)
{
_title = value;
OnPropertyChanged(nameof(Title));
}
}
}
public string FontFamily { get; set; }
private string _glyph;
public string Glyph
{
get => _glyph;
set
{
if (_glyph != value)
{
_glyph = value;
OnPropertyChanged(nameof(Glyph));
}
}
}
private string _fontFamily;
public string FontFamily
{
get => _fontFamily;
set
{
if (_fontFamily != value)
{
_fontFamily = value;
OnPropertyChanged(nameof(FontFamily));
}
}
}
public ICommand Command
{

View File

@@ -296,15 +296,55 @@ namespace PowerLauncher.ViewModel
public Brush MainWindowBorderBrush { get; set; }
public ResultsViewModel Results { get; private set; }
private ResultsViewModel _results;
public ResultsViewModel Results
{
get => _results;
private set
{
if (value != _results)
{
_results = value;
OnPropertyChanged(nameof(Results));
}
}
}
public ResultsViewModel ContextMenu { get; private set; }
public ResultsViewModel History { get; private set; }
public string SystemQueryText { get; set; } = string.Empty;
private string _systemQueryText = string.Empty;
public string QueryText { get; set; } = string.Empty;
public string SystemQueryText
{
get => _systemQueryText;
set
{
if (_systemQueryText != value)
{
_systemQueryText = value;
OnPropertyChanged(nameof(SystemQueryText));
}
}
}
private string _queryText = string.Empty;
public string QueryText
{
get => _queryText;
set
{
if (_queryText != value)
{
_queryText = value;
OnPropertyChanged(nameof(QueryText));
}
}
}
/// <summary>
/// we need move cursor to end when we manually changed query
@@ -380,7 +420,12 @@ namespace PowerLauncher.ViewModel
set
{
_visibility = value;
if (_visibility != value)
{
_visibility = value;
OnPropertyChanged(nameof(MainWindowVisibility));
}
if (value == Visibility.Visible)
{
PowerToysTelemetry.Log.WriteEvent(new LauncherShowEvent());

View File

@@ -36,9 +36,35 @@ namespace PowerLauncher.ViewModel
public bool IsHovered { get; set; }
public bool AreContextButtonsActive { get; set; }
private bool _areContextButtonsActive;
public int ContextMenuSelectedIndex { get; set; }
public bool AreContextButtonsActive
{
get => _areContextButtonsActive;
set
{
if (_areContextButtonsActive != value)
{
_areContextButtonsActive = value;
OnPropertyChanged(nameof(AreContextButtonsActive));
}
}
}
private int _contextMenuSelectedIndex;
public int ContextMenuSelectedIndex
{
get => _contextMenuSelectedIndex;
set
{
if (_contextMenuSelectedIndex != value)
{
_contextMenuSelectedIndex = value;
OnPropertyChanged(nameof(ContextMenuSelectedIndex));
}
}
}
public const int NoSelectionIndex = -1;

View File

@@ -52,7 +52,20 @@ namespace PowerLauncher.ViewModel
}
}
public int SelectedIndex { get; set; }
private int _selectedIndex;
public int SelectedIndex
{
get => _selectedIndex;
set
{
if (_selectedIndex != value)
{
_selectedIndex = value;
OnPropertyChanged(nameof(SelectedIndex));
}
}
}
private ResultViewModel _selectedItem;
@@ -84,7 +97,20 @@ namespace PowerLauncher.ViewModel
public Thickness Margin { get; set; }
public Visibility Visibility { get; set; } = Visibility.Hidden;
private Visibility _visibility = Visibility.Hidden;
public Visibility Visibility
{
get => _visibility;
set
{
if (_visibility != value)
{
_visibility = value;
OnPropertyChanged(nameof(Visibility));
}
}
}
public ResultCollection Results { get; }

View File

@@ -38,7 +38,7 @@ namespace Wox.Infrastructure.UserSettings
{
_previousHotkey = _hotkey;
_hotkey = value;
OnPropertyChanged();
OnPropertyChanged(nameof(Hotkey));
}
}
}
@@ -115,12 +115,25 @@ namespace Wox.Infrastructure.UserSettings
if (_maxResultsToShow != value)
{
_maxResultsToShow = value;
OnPropertyChanged();
OnPropertyChanged(nameof(MaxResultsToShow));
}
}
}
public int ActivateTimes { get; set; }
private int _activeTimes;
public int ActivateTimes
{
get => _activeTimes;
set
{
if (_activeTimes != value)
{
_activeTimes = value;
OnPropertyChanged(nameof(ActivateTimes));
}
}
}
// Order defaults to 0 or -1, so 1 will let this property appear last
[JsonProperty(Order = 1)]

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<PropertyChanged />
</Weavers>

View File

@@ -1,74 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="PropertyChanged" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="InjectOnPropertyNameChanged" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the On_PropertyName_Changed feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TriggerDependentProperties" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the Dependent properties feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EnableIsChangedProperty" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if the IsChanged property feature is enabled.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="EventInvokerNames" type="xs:string">
<xs:annotation>
<xs:documentation>Used to change the name of the method that fires the notify event. This is a string that accepts multiple values in a comma separated form.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="CheckForEquality" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should be inserted. If false, equality checking will be disabled for the project.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="CheckForEqualityUsingBaseEquals" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should use the Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="UseStaticEqualsFromBase" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to control if equality checks should use the static Equals method resolved from the base class.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressWarnings" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings from this weaver.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="SuppressOnPropertyNameChangedWarning" type="xs:boolean">
<xs:annotation>
<xs:documentation>Used to turn off build warnings about mismatched On_PropertyName_Changed methods.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -71,10 +71,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Fody" Version="6.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2020.1.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
<PrivateAssets>all</PrivateAssets>
@@ -83,9 +79,6 @@
<PackageReference Include="Mono.Cecil" Version="0.11.3" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.6.5" />
<PackageReference Include="PropertyChanged.Fody" Version="3.3.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Runtime" Version="4.3.1" />
</ItemGroup>