housekeeping: Fix the majority of warnings in the project. (#1872)
This commit is contained in:
Родитель
b3e480fecd
Коммит
cbe38c97b9
|
@ -1,7 +1,6 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<Copyright>Copyright (c) .NET Foundation and Contributors</Copyright>
|
||||
<PackageLicenseUrl>https://opensource.org/licenses/mit</PackageLicenseUrl>
|
||||
<PackageProjectUrl>https://reactiveui.net</PackageProjectUrl>
|
||||
<PackageIconUrl>https://i.imgur.com/7WDbqSy.png</PackageIconUrl>
|
||||
<Authors>.NET Foundation and Contributors</Authors>
|
||||
|
|
|
@ -0,0 +1,161 @@
|
|||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1503:Braces should not be omitted", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddCtorToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddFieldToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.FieldDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ConvertAttributeToCode(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.Object")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ConvertAttributeToCode(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.Object")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCodeTypeReference(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCodeTypeReference(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateDelegateDeclaration(Mono.Cecil.TypeDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.FormatParameterConstant(Mono.Cecil.IConstantProvider)~System.Object")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.FormatParameterConstant(Mono.Cecil.IConstantProvider)~System.Object")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateEvent(Mono.Cecil.EventDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeMember")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateEvent(Mono.Cecil.EventDefinition,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeMember")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetBaseTypes(Mono.Cecil.TypeDefinition)~System.Collections.Generic.IEnumerable{Mono.Cecil.TypeDefinition}")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetMethodAttributes(Mono.Cecil.MethodDefinition)~System.CodeDom.MemberAttributes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.HasVisiblePropertyMethod(System.CodeDom.MemberAttributes)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.HasVisiblePropertyMethod(System.CodeDom.MemberAttributes)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsCompilerGenerated(Mono.Cecil.IMemberDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsCompilerGenerated(Mono.Cecil.IMemberDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDelegate(Mono.Cecil.TypeDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDelegate(Mono.Cecil.TypeDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsExtensionMethod(Mono.Cecil.ICustomAttributeProvider)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsExtensionMethod(Mono.Cecil.ICustomAttributeProvider)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsHidingMethod(Mono.Cecil.MethodDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsHidingMethod(Mono.Cecil.MethodDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.MakeReadonly(System.CodeDom.CodeTypeReference)~System.CodeDom.CodeTypeReference")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.MakeReadonly(System.CodeDom.CodeTypeReference)~System.CodeDom.CodeTypeReference")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ModifyCodeTypeReference(System.CodeDom.CodeTypeReference,System.String)~System.CodeDom.CodeTypeReference")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseLineEndings(System.String)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseLineEndings(System.String)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeAttribute(Mono.Cecil.CustomAttribute,System.Collections.Generic.HashSet{System.String})~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeAttribute(Mono.Cecil.CustomAttribute,System.Collections.Generic.HashSet{System.String})~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeType(Mono.Cecil.TypeDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldIncludeType(Mono.Cecil.TypeDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldOutputBaseType(Mono.Cecil.TypeDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.ShouldOutputBaseType(Mono.Cecil.TypeDefinition)~System.Boolean")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:Access modifier should be declared", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Readability", "RCS1018:Add default access modifier.", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1003:Symbols should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetPropertyAttributes(System.CodeDom.MemberAttributes,System.CodeDom.MemberAttributes)~System.CodeDom.MemberAttributes")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1122:Use string.Empty for empty strings", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GetTypeName(Mono.Cecil.TypeReference)~System.String")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1305:Specify IFormatProvider", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateGenericArguments(Mono.Cecil.TypeReference)~System.CodeDom.CodeTypeReference[]")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreatePublicApiForAssembly(Mono.Cecil.AssemblyDefinition,System.Func{Mono.Cecil.TypeDefinition,System.Boolean},System.Boolean,System.String[],System.Collections.Generic.HashSet{System.String})~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GenerateCodeAttributeDeclaration(System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},Mono.Cecil.CustomAttribute)~System.CodeDom.CodeAttributeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1513:Closing brace should be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateGenericParameters(Mono.Cecil.IGenericParameterProvider,System.CodeDom.CodeTypeParameterCollection)")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "RCS1001:Add braces (when expression spans over multiple lines).", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1117:Parameters should be on same line or separate lines", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.GeneratePublicApi(System.Reflection.Assembly,System.Type[],System.Boolean,System.String[],System.String[])~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1117:Parameters should be on same line or separate lines", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.NormaliseGeneratedCode(System.IO.StringWriter)~System.String")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMemberToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.IMemberDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeAttributeDeclarationCollection")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateCustomAttributes(Mono.Cecil.ICustomAttributeProvider,System.CodeDom.CodeAttributeDeclarationCollection,System.Func{System.CodeDom.CodeTypeReference,System.CodeDom.CodeTypeReference},System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.PopulateMethodParameters(Mono.Cecil.IMethodSignature,System.CodeDom.CodeParameterDeclarationExpressionCollection,System.Collections.Generic.HashSet{System.String},System.Boolean)")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:Split parameters should start on line after declaration", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1000:Keywords should be spaced correctly", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1209:Using alias directives should be placed after other using directives", Justification = "NuGet Inclusion")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1210:Using directives should be ordered alphabetically by namespace", Justification = "NuGet Inclusion")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1208:System using directives should be placed before other using directives", Justification = "NuGet Inclusion")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:Elements should appear in the correct order", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.OperatorNameMap")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:Elements should appear in the correct order", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.SkipAttributeNames")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1825:Avoid zero-length array allocations.", Justification = "NuGet Inclusion", Scope = "member", Target = "~F:PublicApiGenerator.ApiGenerator.defaultWhitelistedNamespacePrefixes")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Globalization", "CA1307:Specify StringComparison", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.IsDotNetTypeMember(Mono.Cecil.IMemberDefinition,System.String[])~System.Boolean")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1512:Single-line comments should not be followed by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddPropertyToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.PropertyDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.AddMethodToTypeDeclaration(System.CodeDom.CodeTypeDeclaration,Mono.Cecil.MethodDefinition,System.Collections.Generic.HashSet{System.String})")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1515:Single-line comment should be preceded by blank line", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.LayoutRules", "SA1520:Use braces consistently", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateTypeDeclaration(Mono.Cecil.TypeDefinition,System.String[],System.Collections.Generic.HashSet{System.String})~System.CodeDom.CodeTypeDeclaration")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "NuGet Inclusion", Scope = "type", Target = "~T:PublicApiGenerator.CecilEx")]
|
||||
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1005:Single line comments should begin with single space", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.CreateInitialiserExpression(Mono.Cecil.CustomAttributeArgument)~System.CodeDom.CodeExpression")]
|
||||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1111:Closing parenthesis should be on line of last parameter", Justification = "NuGet Inclusion", Scope = "member", Target = "~M:PublicApiGenerator.ApiGenerator.RemoveUnnecessaryWhiteSpace(System.String)~System.String")]
|
|
@ -1,7 +1,6 @@
|
|||
<Project>
|
||||
<PropertyGroup>
|
||||
<Authors>.NET Foundation and Contributors</Authors>
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)reactiveui.ruleset</CodeAnalysisRuleSet>
|
||||
<Copyright>Copyright (c) .NET Foundation and Contributors</Copyright>
|
||||
<PackageLicenseUrl>https://opensource.org/licenses/mit</PackageLicenseUrl>
|
||||
<PackageProjectUrl>https://reactiveui.net</PackageProjectUrl>
|
||||
|
@ -13,9 +12,7 @@
|
|||
<RepositoryUrl>https://github.com/reactiveui/reactiveui</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
|
||||
<NoWarn>$(NoWarn);1591;1701;1702;1705;VSX1000</NoWarn>
|
||||
<GenerateDocumentationFile Condition=" '$(Configuration)' == 'Release' ">true</GenerateDocumentationFile>
|
||||
<Platform>AnyCPU</Platform>
|
||||
<IsTestProject>$(MSBuildProjectName.Contains('Tests'))</IsTestProject>
|
||||
|
||||
|
@ -28,15 +25,15 @@
|
|||
<!-- Optional: Include PDB in the built .nupkg -->
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup Condition="!$(IsTestProject)">
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)reactiveui.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="$(IsTestProject)">
|
||||
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)reactiveui.tests.ruleset</CodeAnalysisRuleSet>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="..\..\LICENSE" Pack="true" PackagePath="LICENSE" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(IsTestProject)">
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
|
@ -48,6 +45,10 @@
|
|||
<PackageReference Include="Microsoft.Reactive.Testing" Version="4.0.0" />
|
||||
<PackageReference Include="PublicApiGenerator" Version="8.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="$(IsTestProject)">
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ApiGeneratorGlobalSuppressions.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
|
||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0-beta2-18618-05" PrivateAssets="All" />
|
||||
|
@ -56,7 +57,11 @@
|
|||
<PropertyGroup>
|
||||
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)</SolutionDir>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="$(MSBuildThisFileDirectory)..\LICENSE" Pack="true" PackagePath="LICENSE" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="stylecop.analyzers" Version="1.1.1-beta.61" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" PrivateAssets="all" />
|
||||
|
|
|
@ -2,6 +2,15 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated from a template.
|
||||
//
|
||||
// Manual changes to this file may cause unexpected behavior in your application.
|
||||
// Manual changes to this file will be overwritten if the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#pragma warning disable 1591,0618,0105,0672,0108,SA1402,SA1200,SA1514,SA1615,SA1210,SA1001,SA1403,SA1201,SA1306,SA1601,SA1513,SA1004,SA1516,SA1508,SA1629,SA1507,SA1121,SA1208
|
||||
|
||||
using System;
|
||||
|
|
|
@ -17,12 +17,12 @@ namespace EventBuilder.Platforms
|
|||
AutoPlatform Platform { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the assemblies.
|
||||
/// Gets the assemblies.
|
||||
/// </summary>
|
||||
List<string> Assemblies { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cecil search directories.
|
||||
/// Gets the cecil search directories.
|
||||
/// Cecil when run on Mono needs some direction as to the location of the platform specific MSCORLIB.
|
||||
/// </summary>
|
||||
List<string> CecilSearchDirectories { get; }
|
||||
|
|
|
@ -1,4 +1,17 @@
|
|||
#pragma warning disable 1591,0618,0105,0672,SA1600
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated from a template.
|
||||
//
|
||||
// Manual changes to this file may cause unexpected behavior in your application.
|
||||
// Manual changes to this file will be overwritten if the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#pragma warning disable 1591,0618,0105,0672,0108,SA1402,SA1200,SA1514,SA1615,SA1210,SA1001,SA1403,SA1201,SA1306,SA1601,SA1513,SA1004,SA1516,SA1508,SA1629,SA1507,SA1121,SA1208
|
||||
|
||||
using System;
|
||||
using System.Reactive;
|
||||
|
|
|
@ -72,11 +72,11 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// This should be called in the Fragement's OnCreateView, with the newly inflated layout.
|
||||
/// </summary>
|
||||
/// <param name="this">The fragment.</param>
|
||||
/// <param name="inflatedView">The newly inflated <see cref="View"/> returned from <see cref="LayoutInflater.Inflate"/>.</param>
|
||||
/// <param name="inflatedView">The newly inflated <see cref="View"/> returned from Inflate.</param>
|
||||
/// <param name="resolveMembers">The strategy used to resolve properties that either subclass <see cref="View"/>, have a <see cref="WireUpResourceAttribute"/> or have a <see cref="IgnoreResourceAttribute"/>.</param>
|
||||
public static void WireUpControls(this Android.Support.V4.App.Fragment @this, View inflatedView, ResolveStrategy resolveMembers = ResolveStrategy.Implicit)
|
||||
{
|
||||
var members = @this.GetWireUpMembers(ResolveStrategy.Implicit);
|
||||
var members = @this.GetWireUpMembers(resolveMembers);
|
||||
|
||||
members.ToList().ForEach(m =>
|
||||
{
|
||||
|
@ -104,8 +104,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
|
||||
switch (resolveStrategy)
|
||||
{
|
||||
default:
|
||||
case ResolveStrategy.Implicit:
|
||||
default: // Implicit uses the default case.
|
||||
return members.Where(m => m.PropertyType.IsSubclassOf(typeof(View))
|
||||
|| m.GetCustomAttribute<WireUpResourceAttribute>(true) != null);
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Subjects;
|
||||
|
@ -21,6 +22,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// (i.e. you can call RaiseAndSetIfChanged).
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The view model type.</typeparam>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactiveAppCompatActivity<TViewModel> : ReactiveAppCompatActivity, IViewFor<TViewModel>, ICanActivate
|
||||
where TViewModel : class
|
||||
{
|
||||
|
@ -52,49 +54,13 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// This is an Activity that is both an Activity and has ReactiveObject powers
|
||||
/// (i.e. you can call RaiseAndSetIfChanged).
|
||||
/// </summary>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactiveAppCompatActivity : AppCompatActivity, IReactiveObject, IReactiveNotifyPropertyChanged<ReactiveAppCompatActivity>, IHandleObservableErrors
|
||||
{
|
||||
private readonly Subject<Unit> _activated = new Subject<Unit>();
|
||||
private readonly Subject<Unit> _deactivated = new Subject<Unit>();
|
||||
private readonly Subject<Tuple<int, Result, Intent>> _activityResult = new Subject<Tuple<int, Result, Intent>>();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangingEventHandler PropertyChanging
|
||||
{
|
||||
add => PropertyChangingEventManager.AddHandler(this, value);
|
||||
remove => PropertyChangingEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangedEventHandler PropertyChanged
|
||||
{
|
||||
add => PropertyChangedEventManager.AddHandler(this, value);
|
||||
remove => PropertyChangedEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args)
|
||||
{
|
||||
PropertyChangingEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *before* a property is about to
|
||||
/// be changed.
|
||||
/// </summary>
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveAppCompatActivity>> Changing => this.GetChangingObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *after* a property has changed.
|
||||
/// </summary>
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveAppCompatActivity>> Changed => this.GetChangedObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReactiveAppCompatActivity" /> class.
|
||||
/// </summary>
|
||||
|
@ -112,18 +78,26 @@ namespace ReactiveUI.AndroidSupport
|
|||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When this method is called, an object will not fire change
|
||||
/// notifications (neither traditional nor Observable notifications)
|
||||
/// until the return value is disposed.
|
||||
/// </summary>
|
||||
/// <returns>An object that, when disposed, reenables change
|
||||
/// notifications.</returns>
|
||||
public IDisposable SuppressChangeNotifications()
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangingEventHandler PropertyChanging
|
||||
{
|
||||
return IReactiveObjectExtensions.SuppressChangeNotifications(this);
|
||||
add => PropertyChangingEventManager.AddHandler(this, value);
|
||||
remove => PropertyChangingEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangedEventHandler PropertyChanged
|
||||
{
|
||||
add => PropertyChangedEventManager.AddHandler(this, value);
|
||||
remove => PropertyChangedEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveAppCompatActivity>> Changing => this.GetChangingObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveAppCompatActivity>> Changed => this.GetChangedObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IObservable<Exception> ThrownExceptions => this.GetThrownExceptionsObservable();
|
||||
|
||||
|
@ -151,6 +125,24 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// </value>
|
||||
public IObservable<Tuple<int, Result, Intent>> ActivityResult => _activityResult.AsObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args)
|
||||
{
|
||||
PropertyChangingEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IDisposable SuppressChangeNotifications()
|
||||
{
|
||||
return IReactiveObjectExtensions.SuppressChangeNotifications(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the activity for result asynchronously.
|
||||
/// </summary>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Subjects;
|
||||
|
@ -15,6 +16,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// (i.e. you can call RaiseAndSetIfChanged).
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The view model type.</typeparam>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactiveDialogFragment<TViewModel> : ReactiveDialogFragment, IViewFor<TViewModel>, ICanActivate
|
||||
where TViewModel : class
|
||||
{
|
||||
|
@ -46,6 +48,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// This is a Fragment that is both an Activity and has ReactiveObject powers
|
||||
/// (i.e. you can call RaiseAndSetIfChanged).
|
||||
/// </summary>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactiveDialogFragment : Android.Support.V4.App.DialogFragment, IReactiveNotifyPropertyChanged<ReactiveDialogFragment>, IReactiveObject, IHandleObservableErrors
|
||||
{
|
||||
private readonly Subject<Unit> _activated = new Subject<Unit>();
|
||||
|
@ -76,24 +79,19 @@ namespace ReactiveUI.AndroidSupport
|
|||
public IObservable<Exception> ThrownExceptions => this.GetThrownExceptionsObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a signal when the fragment is activated.
|
||||
/// Gets a observable that signals when the fragment is activated.
|
||||
/// </summary>
|
||||
public IObservable<Unit> Activated => _activated.AsObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets a signal when the fragment is deactivated.
|
||||
/// Gets a observable that signals when the fragment is deactivated.
|
||||
/// </summary>
|
||||
public IObservable<Unit> Deactivated => _deactivated.AsObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *before* a property is about to
|
||||
/// be changed.
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveDialogFragment>> Changing => this.GetChangingObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *after* a property has changed.
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveDialogFragment>> Changed => this.GetChangedObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
@ -108,13 +106,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
PropertyChangedEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When this method is called, an object will not fire change
|
||||
/// notifications (neither traditional nor Observable notifications)
|
||||
/// until the return value is disposed.
|
||||
/// </summary>
|
||||
/// <returns>An object that, when disposed, reenables change
|
||||
/// notifications.</returns>
|
||||
/// <inheritdoc />
|
||||
public IDisposable SuppressChangeNotifications()
|
||||
{
|
||||
return IReactiveObjectExtensions.SuppressChangeNotifications(this);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
|
@ -33,6 +34,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// (i.e. you can call RaiseAndSetIfChanged).
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The view model type.</typeparam>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactiveFragment<TViewModel> : ReactiveFragment, IViewFor<TViewModel>, ICanActivate
|
||||
where TViewModel : class
|
||||
{
|
||||
|
@ -64,6 +66,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// This is a Fragment that is both an Activity and has ReactiveObject powers
|
||||
/// (i.e. you can call RaiseAndSetIfChanged).
|
||||
/// </summary>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactiveFragment : Android.Support.V4.App.Fragment, IReactiveNotifyPropertyChanged<ReactiveFragment>, IReactiveObject, IHandleObservableErrors
|
||||
{
|
||||
private readonly Subject<Unit> _activated = new Subject<Unit>();
|
||||
|
@ -103,15 +106,10 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// </summary>
|
||||
public IObservable<Unit> Deactivated => _deactivated.AsObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *before* a property is about to
|
||||
/// be changed.
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveFragment>> Changing => this.GetChangingObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *after* a property has changed.
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveFragment>> Changed => this.GetChangedObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
@ -126,13 +124,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
PropertyChangedEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When this method is called, an object will not fire change
|
||||
/// notifications (neither traditional nor Observable notifications)
|
||||
/// until the return value is disposed.
|
||||
/// </summary>
|
||||
/// <returns>An object that, when disposed, re-enables change
|
||||
/// notifications.</returns>
|
||||
/// <inheritdoc />
|
||||
public IDisposable SuppressChangeNotifications()
|
||||
{
|
||||
return IReactiveObjectExtensions.SuppressChangeNotifications(this);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
|
@ -35,6 +36,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// (i.e. you can call RaiseAndSetIfChanged).
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The view model type.</typeparam>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactiveFragmentActivity<TViewModel> : ReactiveFragmentActivity, IViewFor<TViewModel>, ICanActivate
|
||||
where TViewModel : class
|
||||
{
|
||||
|
@ -66,6 +68,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// This is an Activity that is both an Activity and has ReactiveObject powers
|
||||
/// (i.e. you can call RaiseAndSetIfChanged).
|
||||
/// </summary>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactiveFragmentActivity : FragmentActivity, IReactiveObject, IReactiveNotifyPropertyChanged<ReactiveFragmentActivity>, IHandleObservableErrors
|
||||
{
|
||||
private readonly Subject<Unit> _activated = new Subject<Unit>();
|
||||
|
@ -79,12 +82,6 @@ namespace ReactiveUI.AndroidSupport
|
|||
remove => PropertyChangingEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args)
|
||||
{
|
||||
PropertyChangingEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangedEventHandler PropertyChanged
|
||||
{
|
||||
|
@ -92,21 +89,10 @@ namespace ReactiveUI.AndroidSupport
|
|||
remove => PropertyChangedEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *before* a property is about to
|
||||
/// be changed.
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveFragmentActivity>> Changing => this.GetChangingObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *after* a property has changed.
|
||||
/// </summary>
|
||||
/// <inheritdoc />
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveFragmentActivity>> Changed => this.GetChangedObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
@ -127,13 +113,19 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// </summary>
|
||||
public IObservable<Tuple<int, Result, Intent>> ActivityResult => _activityResult.AsObservable();
|
||||
|
||||
/// <summary>
|
||||
/// When this method is called, an object will not fire change
|
||||
/// notifications (neither traditional nor Observable notifications)
|
||||
/// until the return value is disposed.
|
||||
/// </summary>
|
||||
/// <returns>An object that, when disposed, re-enables change
|
||||
/// notifications.</returns>
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args)
|
||||
{
|
||||
PropertyChangingEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IDisposable SuppressChangeNotifications() => IReactiveObjectExtensions.SuppressChangeNotifications(this);
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Threading;
|
||||
|
@ -17,13 +18,12 @@ using Object = Java.Lang.Object;
|
|||
|
||||
namespace ReactiveUI.AndroidSupport
|
||||
{
|
||||
#pragma warning disable SA1600 // Elements should be documented
|
||||
/// <summary>
|
||||
/// ReactivePagerAdapter is a PagerAdapter that will interface with a
|
||||
/// Observable change set, in a similar fashion to ReactiveTableViewSource.
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The view model type.</typeparam>
|
||||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactivePagerAdapter<TViewModel> : PagerAdapter, IEnableLogger
|
||||
where TViewModel : class
|
||||
{
|
||||
|
@ -32,6 +32,12 @@ namespace ReactiveUI.AndroidSupport
|
|||
private readonly Action<TViewModel, View> _viewInitializer;
|
||||
private IDisposable _inner;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReactivePagerAdapter{TViewModel}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="changeSet">The change set to page.</param>
|
||||
/// <param name="viewCreator">A function which will create the view.</param>
|
||||
/// <param name="viewInitializer">A action which will initialize a view.</param>
|
||||
public ReactivePagerAdapter(
|
||||
IObservable<IChangeSet<TViewModel>> changeSet,
|
||||
Func<TViewModel, ViewGroup, View> viewCreator,
|
||||
|
@ -44,6 +50,9 @@ namespace ReactiveUI.AndroidSupport
|
|||
_inner = _list.Connect().Subscribe(_ => NotifyDataSetChanged());
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int Count => _list.Count;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool IsViewFromObject(View view, Object @object)
|
||||
{
|
||||
|
@ -64,10 +73,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
ivf.ViewModel = data;
|
||||
}
|
||||
|
||||
if (_viewInitializer != null)
|
||||
{
|
||||
_viewInitializer(data, theView);
|
||||
}
|
||||
_viewInitializer?.Invoke(data, theView);
|
||||
|
||||
container.AddView(theView, 0);
|
||||
return theView;
|
||||
|
@ -80,9 +86,6 @@ namespace ReactiveUI.AndroidSupport
|
|||
container.RemoveView(view);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int Count => _list.Count;
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
|
@ -91,10 +94,23 @@ namespace ReactiveUI.AndroidSupport
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ReactivePagerAdapter is a PagerAdapter that will interface with a
|
||||
/// Observable change set, in a similar fashion to ReactiveTableViewSource.
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The view model type.</typeparam>
|
||||
/// <typeparam name="TCollection">The type of collection.</typeparam>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public class ReactivePagerAdapter<TViewModel, TCollection> : ReactivePagerAdapter<TViewModel>
|
||||
where TViewModel : class
|
||||
where TCollection : INotifyCollectionChanged, IEnumerable<TViewModel>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReactivePagerAdapter{TViewModel, TCollection}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="collection">The collection to page.</param>
|
||||
/// <param name="viewCreator">The function which will create the view.</param>
|
||||
/// <param name="viewInitializer">A action which will initialize the view.</param>
|
||||
public ReactivePagerAdapter(
|
||||
TCollection collection,
|
||||
Func<TViewModel, ViewGroup, View> viewCreator,
|
||||
|
|
|
@ -6,6 +6,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reactive.Disposables;
|
||||
using System.Reactive.Linq;
|
||||
|
@ -25,6 +26,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// to create the your <see cref="ReactiveRecyclerViewViewHolder{TViewModel}"/> based ViewHolder.
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The type of ViewModel that this adapter holds.</typeparam>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public abstract class ReactiveRecyclerViewAdapter<TViewModel> : RecyclerView.Adapter
|
||||
where TViewModel : class, IReactiveObject
|
||||
{
|
||||
|
@ -46,15 +48,15 @@ namespace ReactiveUI.AndroidSupport
|
|||
.Subscribe();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int ItemCount => _list.Count;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void OnBindViewHolder(RecyclerView.ViewHolder holder, int position)
|
||||
{
|
||||
((IViewFor)holder).ViewModel = _list.Items.ElementAt(position);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int ItemCount => _list.Count;
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
|
@ -97,6 +99,7 @@ namespace ReactiveUI.AndroidSupport
|
|||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The type of ViewModel that this adapter holds.</typeparam>
|
||||
/// <typeparam name="TCollection">The type of collection.</typeparam>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public abstract class ReactiveRecyclerViewAdapter<TViewModel, TCollection> : ReactiveRecyclerViewAdapter<TViewModel>
|
||||
where TViewModel : class, IReactiveObject
|
||||
where TCollection : ICollection<TViewModel>, INotifyCollectionChanged
|
||||
|
@ -110,151 +113,4 @@ namespace ReactiveUI.AndroidSupport
|
|||
{
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A <see cref="RecyclerView.ViewHolder"/> implementation that binds to a reactive view model.
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The type of the view model.</typeparam>
|
||||
public class ReactiveRecyclerViewViewHolder<TViewModel> : RecyclerView.ViewHolder, ILayoutViewHost, IViewFor<TViewModel>, IReactiveNotifyPropertyChanged<ReactiveRecyclerViewViewHolder<TViewModel>>, IReactiveObject
|
||||
where TViewModel : class, IReactiveObject
|
||||
{
|
||||
private TViewModel _viewModel;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReactiveRecyclerViewViewHolder{TViewModel}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="view">The view.</param>
|
||||
protected ReactiveRecyclerViewViewHolder(View view)
|
||||
: base(view)
|
||||
{
|
||||
SetupRxObj();
|
||||
|
||||
Selected = Observable.FromEventPattern(
|
||||
h => view.Click += h,
|
||||
h => view.Click -= h)
|
||||
.Select(_ => AdapterPosition);
|
||||
|
||||
LongClicked = Observable.FromEventPattern<View.LongClickEventArgs>(
|
||||
h => view.LongClick += h,
|
||||
h => view.LongClick -= h)
|
||||
.Select(_ => AdapterPosition);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangingEventHandler PropertyChanging
|
||||
{
|
||||
add => PropertyChangingEventManager.AddHandler(this, value);
|
||||
remove => PropertyChangingEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangedEventHandler PropertyChanged
|
||||
{
|
||||
add => PropertyChangedEventManager.AddHandler(this, value);
|
||||
remove => PropertyChangedEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Signals that this ViewHolder has been selected.
|
||||
///
|
||||
/// The <see cref="int"/> is the position of this ViewHolder in the <see cref="RecyclerView"/>
|
||||
/// and corresponds to the <see cref="RecyclerView.ViewHolder.AdapterPosition"/> property.
|
||||
/// </summary>
|
||||
public IObservable<int> Selected { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Signals that this ViewHolder has been long-clicked.
|
||||
///
|
||||
/// The <see cref="int"/> is the position of this ViewHolder in the <see cref="RecyclerView"/>
|
||||
/// and corresponds to the <see cref="RecyclerView.ViewHolder.AdapterPosition"/> property.
|
||||
/// </summary>
|
||||
public IObservable<int> LongClicked { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public View View => ItemView;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
get => _viewModel;
|
||||
set => this.RaiseAndSetIfChanged(ref _viewModel, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
object IViewFor.ViewModel
|
||||
{
|
||||
get => ViewModel;
|
||||
set => ViewModel = (TViewModel)value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *before* a property is about to
|
||||
/// be changed.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveRecyclerViewViewHolder<TViewModel>>> Changing => this.GetChangingObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *after* a property has changed.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveRecyclerViewViewHolder<TViewModel>>> Changed => this.GetChangedObservable();
|
||||
|
||||
/// <summary>
|
||||
/// Gets all public accessible properties.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
protected Lazy<PropertyInfo[]> AllPublicProperties;
|
||||
|
||||
/// <summary>
|
||||
/// An observable sequence of thrown exceptions.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IObservable<Exception> ThrownExceptions => this.GetThrownExceptionsObservable();
|
||||
|
||||
/// <summary>
|
||||
/// When this method is called, an object will not fire change
|
||||
/// notifications (neither traditional nor Observable notifications)
|
||||
/// until the return value is disposed.
|
||||
/// </summary>
|
||||
/// <returns>An object that, when disposed, re-enables change
|
||||
/// notifications.</returns>
|
||||
public IDisposable SuppressChangeNotifications()
|
||||
{
|
||||
return IReactiveObjectExtensions.SuppressChangeNotifications(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating if the change notifications are enabled.
|
||||
/// </summary>
|
||||
/// <returns>A value indicating whether the change notifications are enabled.</returns>
|
||||
public bool AreChangeNotificationsEnabled()
|
||||
{
|
||||
return IReactiveObjectExtensions.AreChangeNotificationsEnabled(this);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args)
|
||||
{
|
||||
PropertyChangingEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
[OnDeserialized]
|
||||
private void SetupRxObj(StreamingContext sc)
|
||||
{
|
||||
SetupRxObj();
|
||||
}
|
||||
|
||||
private void SetupRxObj()
|
||||
{
|
||||
AllPublicProperties = new Lazy<PropertyInfo[]>(() =>
|
||||
GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,157 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using Android.Support.V7.Widget;
|
||||
using Android.Views;
|
||||
|
||||
namespace ReactiveUI.AndroidSupport
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see cref="RecyclerView.ViewHolder"/> implementation that binds to a reactive view model.
|
||||
/// </summary>
|
||||
/// <typeparam name="TViewModel">The type of the view model.</typeparam>
|
||||
public class ReactiveRecyclerViewViewHolder<TViewModel> : RecyclerView.ViewHolder, ILayoutViewHost, IViewFor<TViewModel>, IReactiveNotifyPropertyChanged<ReactiveRecyclerViewViewHolder<TViewModel>>, IReactiveObject
|
||||
where TViewModel : class, IReactiveObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets all public accessible properties.
|
||||
/// </summary>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1401: Field should be private", Justification = "Legacy reasons")]
|
||||
[SuppressMessage("Design", "CA1051: Do not declare visible instance fields", Justification = "Legacy reasons")]
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1306: Field should start with a lower case letter", Justification = "Legacy reasons")]
|
||||
[IgnoreDataMember]
|
||||
protected Lazy<PropertyInfo[]> AllPublicProperties;
|
||||
|
||||
private TViewModel _viewModel;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReactiveRecyclerViewViewHolder{TViewModel}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="view">The view.</param>
|
||||
protected ReactiveRecyclerViewViewHolder(View view)
|
||||
: base(view)
|
||||
{
|
||||
SetupRxObj();
|
||||
|
||||
Selected = Observable.FromEventPattern(
|
||||
h => view.Click += h,
|
||||
h => view.Click -= h)
|
||||
.Select(_ => AdapterPosition);
|
||||
|
||||
LongClicked = Observable.FromEventPattern<View.LongClickEventArgs>(
|
||||
h => view.LongClick += h,
|
||||
h => view.LongClick -= h)
|
||||
.Select(_ => AdapterPosition);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangingEventHandler PropertyChanging
|
||||
{
|
||||
add => PropertyChangingEventManager.AddHandler(this, value);
|
||||
remove => PropertyChangingEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event PropertyChangedEventHandler PropertyChanged
|
||||
{
|
||||
add => PropertyChangedEventManager.AddHandler(this, value);
|
||||
remove => PropertyChangedEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an observable that signals that this ViewHolder has been selected.
|
||||
///
|
||||
/// The <see cref="int"/> is the position of this ViewHolder in the <see cref="RecyclerView"/>
|
||||
/// and corresponds to the <see cref="RecyclerView.ViewHolder.AdapterPosition"/> property.
|
||||
/// </summary>
|
||||
public IObservable<int> Selected { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an observable that signals that this ViewHolder has been long-clicked.
|
||||
///
|
||||
/// The <see cref="int"/> is the position of this ViewHolder in the <see cref="RecyclerView"/>
|
||||
/// and corresponds to the <see cref="RecyclerView.ViewHolder.AdapterPosition"/> property.
|
||||
/// </summary>
|
||||
public IObservable<int> LongClicked { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current view being shown.
|
||||
/// </summary>
|
||||
public View View => ItemView;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
get => _viewModel;
|
||||
set => this.RaiseAndSetIfChanged(ref _viewModel, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets an observable which signals when exceptions are thrown.
|
||||
/// </summary>
|
||||
[IgnoreDataMember]
|
||||
public IObservable<Exception> ThrownExceptions => this.GetThrownExceptionsObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
object IViewFor.ViewModel
|
||||
{
|
||||
get => ViewModel;
|
||||
set => ViewModel = (TViewModel)value;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[IgnoreDataMember]
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveRecyclerViewViewHolder<TViewModel>>> Changing => this.GetChangingObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
[IgnoreDataMember]
|
||||
public IObservable<IReactivePropertyChangedEventArgs<ReactiveRecyclerViewViewHolder<TViewModel>>> Changed => this.GetChangedObservable();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IDisposable SuppressChangeNotifications()
|
||||
{
|
||||
return IReactiveObjectExtensions.SuppressChangeNotifications(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets if change notifications via the INotifyPropertyChanged interface are being sent.
|
||||
/// </summary>
|
||||
/// <returns>A value indicating whether change notifications are enabled or not.</returns>
|
||||
public bool AreChangeNotificationsEnabled()
|
||||
{
|
||||
return IReactiveObjectExtensions.AreChangeNotificationsEnabled(this);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanging(PropertyChangingEventArgs args)
|
||||
{
|
||||
PropertyChangingEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
void IReactiveObject.RaisePropertyChanged(PropertyChangedEventArgs args)
|
||||
{
|
||||
PropertyChangedEventManager.DeliverEvent(this, args);
|
||||
}
|
||||
|
||||
[OnDeserialized]
|
||||
private void SetupRxObj(StreamingContext sc)
|
||||
{
|
||||
SetupRxObj();
|
||||
}
|
||||
|
||||
private void SetupRxObj()
|
||||
{
|
||||
AllPublicProperties = new Lazy<PropertyInfo[]>(() =>
|
||||
GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance).ToArray());
|
||||
}
|
||||
}
|
||||
}
|
|
@ -2,8 +2,6 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>MonoAndroid81</TargetFrameworks>
|
||||
<AssemblyName>ReactiveUI.AndroidSupport</AssemblyName>
|
||||
<RootNamespace>ReactiveUI.AndroidSupport</RootNamespace>
|
||||
<Description>ReactiveUI extensions for the Android Support Library</Description>
|
||||
<PackageId>ReactiveUI.AndroidSupport</PackageId>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -14,6 +14,8 @@ using System.Windows.Controls;
|
|||
using System.Windows.Interactivity;
|
||||
#endif
|
||||
|
||||
#pragma warning disable SA1201 // A field should not follow a property - macro if statements make this hard
|
||||
|
||||
namespace ReactiveUI.Blend
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -79,18 +81,6 @@ namespace ReactiveUI.Blend
|
|||
/// </summary>
|
||||
public bool AutoResubscribeOnError { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnDetaching()
|
||||
{
|
||||
if (_watcher != null)
|
||||
{
|
||||
_watcher.Dispose();
|
||||
_watcher = null;
|
||||
}
|
||||
|
||||
base.OnDetaching();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when [state observable changed].
|
||||
/// </summary>
|
||||
|
@ -132,5 +122,17 @@ namespace ReactiveUI.Blend
|
|||
OnStateObservableChanged(@this, e);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnDetaching()
|
||||
{
|
||||
if (_watcher != null)
|
||||
{
|
||||
_watcher.Dispose();
|
||||
_watcher = null;
|
||||
}
|
||||
|
||||
base.OnDetaching();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,14 @@ namespace ReactiveUI.Blend
|
|||
/// </summary>
|
||||
public class ObservableTrigger : TriggerBase<FrameworkElement>
|
||||
{
|
||||
/// <summary>
|
||||
/// The dependency property registration for the Observable property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ObservableProperty =
|
||||
DependencyProperty.Register("Observable", typeof(IObservable<object>), typeof(ObservableTrigger), new PropertyMetadata(OnObservableChanged));
|
||||
|
||||
private IDisposable _watcher;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the observable which will activate the trigger.
|
||||
/// </summary>
|
||||
|
@ -27,18 +35,10 @@ namespace ReactiveUI.Blend
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// The dependency property registration for the Observable property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ObservableProperty =
|
||||
DependencyProperty.Register("Observable", typeof(IObservable<object>), typeof(ObservableTrigger), new PropertyMetadata(OnObservableChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or set if we should resubscribe the trigger if there is a error when running the IObservable.
|
||||
/// Gets or sets a value indicating whether to resubscribe the trigger if there is a error when running the IObservable.
|
||||
/// </summary>
|
||||
public bool AutoResubscribeOnError { get; set; }
|
||||
|
||||
private IDisposable _watcher;
|
||||
|
||||
/// <summary>
|
||||
/// Called when [observable changed].
|
||||
/// </summary>
|
||||
|
@ -46,23 +46,23 @@ namespace ReactiveUI.Blend
|
|||
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
|
||||
protected static void OnObservableChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
ObservableTrigger This = (ObservableTrigger)sender;
|
||||
if (This._watcher != null)
|
||||
ObservableTrigger triggerItem = (ObservableTrigger)sender;
|
||||
if (triggerItem._watcher != null)
|
||||
{
|
||||
This._watcher.Dispose();
|
||||
This._watcher = null;
|
||||
triggerItem._watcher.Dispose();
|
||||
triggerItem._watcher = null;
|
||||
}
|
||||
|
||||
This._watcher = ((IObservable<object>)e.NewValue).ObserveOn(RxApp.MainThreadScheduler).Subscribe(
|
||||
x => This.InvokeActions(x),
|
||||
triggerItem._watcher = ((IObservable<object>)e.NewValue).ObserveOn(RxApp.MainThreadScheduler).Subscribe(
|
||||
x => triggerItem.InvokeActions(x),
|
||||
ex =>
|
||||
{
|
||||
if (!This.AutoResubscribeOnError)
|
||||
if (!triggerItem.AutoResubscribeOnError)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
OnObservableChanged(This, e);
|
||||
OnObservableChanged(triggerItem, e);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,14 @@ namespace ReactiveUI.Blend
|
|||
public class Behavior<T> : DependencyObject, IBehavior
|
||||
where T : DependencyObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the associated object.
|
||||
/// </summary>
|
||||
public T AssociatedObject { get; private set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
DependencyObject IBehavior.AssociatedObject => AssociatedObject;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public virtual void Attach(DependencyObject associatedObject)
|
||||
{
|
||||
|
@ -53,16 +61,5 @@ namespace ReactiveUI.Blend
|
|||
protected virtual void OnDetaching()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the associated object.
|
||||
/// </summary>
|
||||
public T AssociatedObject { get; private set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
DependencyObject IBehavior.AssociatedObject
|
||||
{
|
||||
get { return AssociatedObject; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,8 +19,26 @@ namespace ReactiveUI.Blend
|
|||
/// Behavior that response to triggered observables.
|
||||
/// </summary>
|
||||
[ContentProperty(Name = "Actions")]
|
||||
public sealed class ObservableTriggerBehavior : Behavior<DependencyObject>
|
||||
public sealed class ObservableTriggerBehavior : Behavior<DependencyObject>, IDisposable
|
||||
{
|
||||
/// <summary>
|
||||
/// The observable dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ObservableProperty =
|
||||
DependencyProperty.Register("Observable", typeof(IObservable<object>), typeof(ObservableTriggerBehavior), new PropertyMetadata(null, OnObservableChanged));
|
||||
|
||||
/// <summary>
|
||||
/// The actions dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ActionsProperty =
|
||||
DependencyProperty.Register("Actions", typeof(ActionCollection), typeof(ObservableTriggerBehavior), new PropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// The source object dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty SourceObjectProperty =
|
||||
DependencyProperty.Register("SourceObject", typeof(object), typeof(ObservableTriggerBehavior), new PropertyMetadata(null, OnSourceObjectChanged));
|
||||
|
||||
private object _resolvedSource;
|
||||
private SerialDisposable _watcher;
|
||||
|
||||
|
@ -52,12 +70,6 @@ namespace ReactiveUI.Blend
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The actions dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ActionsProperty =
|
||||
DependencyProperty.Register("Actions", typeof(ActionCollection), typeof(ObservableTriggerBehavior), new PropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the source object.
|
||||
/// </summary>
|
||||
|
@ -67,12 +79,6 @@ namespace ReactiveUI.Blend
|
|||
set => SetValue(ObservableTriggerBehavior.SourceObjectProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The source object dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty SourceObjectProperty =
|
||||
DependencyProperty.Register("SourceObject", typeof(object), typeof(ObservableTriggerBehavior), new PropertyMetadata(null, OnSourceObjectChanged));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [automatic resubscribe on error].
|
||||
/// </summary>
|
||||
|
@ -87,11 +93,44 @@ namespace ReactiveUI.Blend
|
|||
set => SetValue(ObservableProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The observable dependency property.
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty ObservableProperty =
|
||||
DependencyProperty.Register("Observable", typeof(IObservable<object>), typeof(ObservableTriggerBehavior), new PropertyMetadata(null, OnObservableChanged));
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
_watcher?.Dispose();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
SetResolvedSource(ComputeResolvedSource());
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnDetaching()
|
||||
{
|
||||
SetResolvedSource(null);
|
||||
base.OnDetaching();
|
||||
|
||||
_watcher.Dispose();
|
||||
}
|
||||
|
||||
private static void OnObservableChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
ObservableTriggerBehavior @this = (ObservableTriggerBehavior)sender;
|
||||
|
||||
@this._watcher.Disposable = ((IObservable<object>)e.NewValue).ObserveOn(RxApp.MainThreadScheduler).Subscribe(
|
||||
x => Interaction.ExecuteActions(@this._resolvedSource, @this.Actions, x),
|
||||
ex =>
|
||||
{
|
||||
if (!@this.AutoResubscribeOnError)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
OnObservableChanged(@this, e);
|
||||
});
|
||||
}
|
||||
|
||||
private static void OnSourceObjectChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
|
||||
{
|
||||
|
@ -119,38 +158,5 @@ namespace ReactiveUI.Blend
|
|||
|
||||
return AssociatedObject;
|
||||
}
|
||||
|
||||
private static void OnObservableChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
ObservableTriggerBehavior @this = (ObservableTriggerBehavior)sender;
|
||||
|
||||
@this._watcher.Disposable = ((IObservable<object>)e.NewValue).ObserveOn(RxApp.MainThreadScheduler).Subscribe(
|
||||
x => Interaction.ExecuteActions(@this._resolvedSource, @this.Actions, x),
|
||||
ex =>
|
||||
{
|
||||
if (!@this.AutoResubscribeOnError)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
OnObservableChanged(@this, e);
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnAttached()
|
||||
{
|
||||
base.OnAttached();
|
||||
SetResolvedSource(ComputeResolvedSource());
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void OnDetaching()
|
||||
{
|
||||
SetResolvedSource(null);
|
||||
base.OnDetaching();
|
||||
|
||||
_watcher.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<Description>Provides Observable-based events API for WPF UI controls/eventhandlers. The contents of this package is automatically generated, please target pull-requests to the code generator.</Description>
|
||||
<PackageId>ReactiveUI.Events.WPF</PackageId>
|
||||
<ExtrasEnableWpfProjectSetup>true</ExtrasEnableWpfProjectSetup>
|
||||
<NoWarn>$(NoWarn);CS1570;CA1812</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
<Description>Provides Observable-based events API for Winforms UI controls/eventhandlers. The contents of this package is automatically generated, please target pull-requests to the code generator.</Description>
|
||||
<PackageId>ReactiveUI.Events.Winforms</PackageId>
|
||||
<ExtrasEnableWinFormsProjectSetup>true</ExtrasEnableWinFormsProjectSetup >
|
||||
<NoWarn>$(NoWarn);CS1570;CA1812</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<RootNamespace>ReactiveUI.Events</RootNamespace>
|
||||
<Description>Provides Observable-based events API for Xamarin Forms UI controls/eventhandlers. The contents of this package is automatically generated, please target pull-requests to the code generator.</Description>
|
||||
<PackageId>ReactiveUI.Events.XamForms</PackageId>
|
||||
<NoWarn>$(NoWarn);CS1570;CA1812</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
<RootNamespace>ReactiveUI.Events</RootNamespace>
|
||||
<Description>Provides Observable-based events API for common UI controls/eventhandlers. The contents of this package is automatically generated, please target pull-requests to the code generator.</Description>
|
||||
<PackageId>ReactiveUI.Events</PackageId>
|
||||
<NoWarn>$(NoWarn);CS1570;CA1812</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -8,7 +8,7 @@ using System.Reactive.Subjects;
|
|||
|
||||
namespace ReactiveUI.Events
|
||||
{
|
||||
internal class SingleAwaitSubject<T> : ISubject<T>
|
||||
internal sealed class SingleAwaitSubject<T> : ISubject<T>, IDisposable
|
||||
{
|
||||
private readonly Subject<T> _inner = new Subject<T>();
|
||||
|
||||
|
@ -36,5 +36,11 @@ namespace ReactiveUI.Events
|
|||
{
|
||||
return _inner.Subscribe(observer);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Dispose()
|
||||
{
|
||||
_inner?.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,12 +27,12 @@ namespace ReactiveUI.Fody.Helpers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// The name of the backing property.
|
||||
/// Gets the name of the backing property.
|
||||
/// </summary>
|
||||
public string Target => _targetName;
|
||||
|
||||
/// <summary>
|
||||
/// Target property on the backing property.
|
||||
/// Gets or sets the target property on the backing property.
|
||||
/// </summary>
|
||||
public string TargetProperty { get; set; }
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Fody" Version="3.2.17" PrivateAssets="None" />
|
||||
<PackageReference Include="FodyPackaging" Version="3.2.17" PrivateAssets="All" />
|
||||
<PackageReference Include="Fody" Version="3.3.4" PrivateAssets="None" />
|
||||
<PackageReference Include="FodyPackaging" Version="3.3.4" PrivateAssets="All" />
|
||||
<PackageReference Include="System.Reactive" Version="4.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.AndroidSupport")]
|
||||
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.AndroidSupport")]
|
||||
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Tests")]
|
||||
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Winforms")]
|
||||
[assembly: System.Runtime.CompilerServices.InternalsVisibleToAttribute("ReactiveUI.Wpf")]
|
|
@ -16,7 +16,7 @@ namespace ReactiveUI.Fody.Tests.API
|
|||
public class ApiApprovalTests
|
||||
{
|
||||
[Fact]
|
||||
public void ReactiveUI_Fody()
|
||||
public void ReactiveUIFody()
|
||||
{
|
||||
var publicApi = Filter(ApiGenerator.GeneratePublicApi(typeof(ReactiveAttribute).Assembly));
|
||||
publicApi.ShouldMatchApproved();
|
||||
|
@ -24,14 +24,15 @@ namespace ReactiveUI.Fody.Tests.API
|
|||
|
||||
private static string Filter(string text)
|
||||
{
|
||||
return string.Join(Environment.NewLine, text.Split(new[]
|
||||
{
|
||||
Environment.NewLine
|
||||
}, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyVersion("))
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyFileVersion("))
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyInformationalVersion("))
|
||||
.Where(l => !string.IsNullOrWhiteSpace(l)));
|
||||
return string.Join(Environment.NewLine, text.Split(
|
||||
new[]
|
||||
{
|
||||
Environment.NewLine
|
||||
}, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyVersion("))
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyFileVersion("))
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyInformationalVersion("))
|
||||
.Where(l => !string.IsNullOrWhiteSpace(l)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Licensed to the .NET Foundation under one or more agreements.
|
||||
The .NET Foundation licenses this file to you under the MIT license.
|
||||
See the LICENSE file in the project root for more information.
|
||||
-->
|
||||
|
||||
<Weavers>
|
||||
<ReactiveUI />
|
||||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
|
||||
<ReactiveUI />
|
||||
</Weavers>
|
|
@ -0,0 +1,26 @@
|
|||
<?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="ReactiveUI" minOccurs="0" maxOccurs="1" type="xs:anyType" />
|
||||
</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>
|
|
@ -21,6 +21,11 @@ namespace ReactiveUI.Fody.Tests.Issues
|
|||
|
||||
private class TestModel : ReactiveObject
|
||||
{
|
||||
public TestModel()
|
||||
{
|
||||
OtherProperty = MyProperty;
|
||||
}
|
||||
|
||||
[ObservableAsProperty]
|
||||
public string MyProperty { get; private set; }
|
||||
|
||||
|
@ -31,11 +36,6 @@ namespace ReactiveUI.Fody.Tests.Issues
|
|||
public DateTime MyDateTimeProperty { get; private set; }
|
||||
|
||||
public string OtherProperty { get; private set; }
|
||||
|
||||
public TestModel()
|
||||
{
|
||||
OtherProperty = MyProperty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,16 @@ namespace ReactiveUI.Fody.Tests.Issues
|
|||
|
||||
public class TestModel : ReactiveObject
|
||||
{
|
||||
public extern string MyProperty { [ObservableAsProperty]get; }
|
||||
|
||||
public TestModel(string myProperty)
|
||||
{
|
||||
Observable.Return(myProperty).ToPropertyEx(this, x => x.MyProperty);
|
||||
}
|
||||
|
||||
public extern string MyProperty
|
||||
{
|
||||
[ObservableAsProperty]
|
||||
get;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,17 @@ namespace ReactiveUI.Fody.Tests.Issues
|
|||
|
||||
private class VM : ReactiveObject
|
||||
{
|
||||
[ObservableAsProperty] public double P1 { get; }
|
||||
|
||||
[ObservableAsProperty] public double P2 { get; }
|
||||
|
||||
public VM()
|
||||
{
|
||||
Observable.Return(0.0).ToPropertyEx(this, vm => vm.P1);
|
||||
this.WhenAnyValue(vm => vm.P1).ToPropertyEx(this, vm => vm.P2);
|
||||
}
|
||||
|
||||
[ObservableAsProperty]
|
||||
public double P1 { get; }
|
||||
|
||||
[ObservableAsProperty]
|
||||
public double P2 { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ namespace ReactiveUI.Fody.Tests
|
|||
|
||||
public class TestModel : ReactiveObject
|
||||
{
|
||||
[ObservableAsProperty]
|
||||
public string TestProperty { get; private set; }
|
||||
|
||||
public TestModel()
|
||||
{
|
||||
Observable.Return("foo").ToPropertyEx(this, x => x.TestProperty);
|
||||
}
|
||||
|
||||
[ObservableAsProperty]
|
||||
public string TestProperty { get; private set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,6 @@
|
|||
<!-- Fody expects to find weavers in referenced NuGet packages or the Tools directory at the solution level.
|
||||
Since this is for testing purposes before a NuGet package is created, we'll just use the Tools directory
|
||||
until the projects are setup as suggested here: https://github.com/Fody/BasicFodyAddin -->
|
||||
<Copy SourceFiles="@(WeaverFiles)" DestinationFolder="..\Tools" />
|
||||
<Copy SourceFiles="@(WeaverFiles)" DestinationFolder="..\Tools" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace ReactiveUI.Fody
|
|||
public ModuleDefinition ModuleDefinition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Will log an MessageImportance.High message to MSBuild. OPTIONAL.
|
||||
/// Gets or sets a action that will log an MessageImportance.High message to MSBuild. OPTIONAL.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The log information.
|
||||
|
@ -32,7 +32,7 @@ namespace ReactiveUI.Fody
|
|||
public Action<string> LogInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Locates a type from referenced assemblies by name.
|
||||
/// Gets a function that will find a type from referenced assemblies by name.
|
||||
/// </summary>
|
||||
public Func<string, TypeDefinition> FindType { get; internal set; }
|
||||
|
||||
|
@ -135,7 +135,7 @@ namespace ReactiveUI.Fody
|
|||
}
|
||||
else if (type.CompareTo(ModuleDefinition.TypeSystem.Single))
|
||||
{
|
||||
il.Emit(OpCodes.Ldc_R4, (float)0);
|
||||
il.Emit(OpCodes.Ldc_R4, 0F);
|
||||
}
|
||||
else if (type.CompareTo(ModuleDefinition.TypeSystem.Int64))
|
||||
{
|
||||
|
@ -143,7 +143,7 @@ namespace ReactiveUI.Fody
|
|||
}
|
||||
else if (type.CompareTo(ModuleDefinition.TypeSystem.Double))
|
||||
{
|
||||
il.Emit(OpCodes.Ldc_R8, (double)0);
|
||||
il.Emit(OpCodes.Ldc_R8, 0D);
|
||||
}
|
||||
else if (type.IsGenericParameter || type.IsValueType)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace ReactiveUI.Fody
|
|||
public ModuleDefinition ModuleDefinition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Will log an MessageImportance.High message to MSBuild. OPTIONAL.
|
||||
/// Gets or sets a action that will log an MessageImportance.High message to MSBuild. OPTIONAL.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The log information.
|
||||
|
@ -32,7 +32,7 @@ namespace ReactiveUI.Fody
|
|||
public Action<string> LogInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Will log an error message to MSBuild. OPTIONAL.
|
||||
/// Gets or sets a action which will log an error message to MSBuild. OPTIONAL.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The log error.
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FodyHelpers" Version="3.2.17" />
|
||||
<PackageReference Include="FodyHelpers" Version="3.3.4" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -25,7 +25,7 @@ namespace ReactiveUI.Fody
|
|||
public ModuleDefinition ModuleDefinition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Will log an MessageImportance.High message to MSBuild. OPTIONAL.
|
||||
/// Gets or sets a action that will log an MessageImportance.High message to MSBuild. OPTIONAL.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The log information.
|
||||
|
@ -33,7 +33,7 @@ namespace ReactiveUI.Fody
|
|||
public Action<string> LogInfo { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Will log an error message to MSBuild. OPTIONAL.
|
||||
/// Gets or sets an action that will log an error message to MSBuild. OPTIONAL.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The log error.
|
||||
|
|
|
@ -259,6 +259,11 @@ namespace ReactiveUI
|
|||
TViewModel ViewModel { get; }
|
||||
System.Linq.Expressions.Expression ViewModelExpression { get; }
|
||||
}
|
||||
public interface IReactiveCommand : ReactiveUI.IHandleObservableErrors, System.IDisposable
|
||||
{
|
||||
System.IObservable<bool> CanExecute { get; }
|
||||
System.IObservable<bool> IsExecuting { get; }
|
||||
}
|
||||
public interface IReactiveNotifyPropertyChanged<out TSender>
|
||||
{
|
||||
System.IObservable<ReactiveUI.IReactivePropertyChangedEventArgs<TSender>> Changed { get; }
|
||||
|
@ -486,7 +491,7 @@ namespace ReactiveUI
|
|||
public override System.IObservable<TResult> Execute(TParam parameter = null) { }
|
||||
public override System.IDisposable Subscribe(System.IObserver<TResult> observer) { }
|
||||
}
|
||||
public abstract class ReactiveCommandBase<TParam, TResult> : ReactiveUI.IHandleObservableErrors, System.IDisposable, System.IObservable<TResult>, System.Windows.Input.ICommand
|
||||
public abstract class ReactiveCommandBase<TParam, TResult> : ReactiveUI.IHandleObservableErrors, ReactiveUI.IReactiveCommand, System.IDisposable, System.IObservable<TResult>, System.Windows.Input.ICommand
|
||||
{
|
||||
protected ReactiveCommandBase() { }
|
||||
public abstract System.IObservable<bool> CanExecute { get; }
|
||||
|
|
|
@ -14,6 +14,9 @@ namespace ReactiveUI.Winforms
|
|||
public System.IDisposable BindCommandToObject<TEventArgs>(System.Windows.Input.ICommand command, object target, System.IObservable<object> commandParameter, string eventName) { }
|
||||
public int GetAffinityForObject(System.Type type, bool hasEventTarget) { }
|
||||
}
|
||||
[System.ObsoleteAttribute("ReactiveList is no longer supported. We suggest replacing it with DynamicData htt" +
|
||||
"ps://github.com/rolandpheasant/dynamicdata")]
|
||||
public interface IReactiveDerivedBindingList<T> : ReactiveUI.INotifyCollectionChanging, ReactiveUI.INotifyPropertyChanging, ReactiveUI.IReactiveObject, ReactiveUI.Legacy.IReactiveCollection<T>, ReactiveUI.Legacy.IReactiveDerivedList<T>, ReactiveUI.Legacy.IReactiveNotifyCollectionChanged<T>, ReactiveUI.Legacy.IReactiveNotifyCollectionItemChanged<T>, ReactiveUI.Legacy.IReadOnlyReactiveCollection<T>, ReactiveUI.Legacy.IReadOnlyReactiveList<T>, Splat.IEnableLogger, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.IBindingList, System.ComponentModel.INotifyPropertyChanged, System.IDisposable { }
|
||||
public class PlatformOperations
|
||||
{
|
||||
public PlatformOperations() { }
|
||||
|
@ -92,21 +95,18 @@ namespace ReactiveUI.Winforms
|
|||
}
|
||||
namespace ReactiveUI.Winforms.Legacy
|
||||
{
|
||||
[System.ObsoleteAttribute("ReactiveList is no longer supported. We suggest replacing it with DynamicData htt" +
|
||||
"ps://github.com/rolandpheasant/dynamicdata")]
|
||||
public interface IReactiveDerivedBindingList<T> : ReactiveUI.INotifyCollectionChanging, ReactiveUI.INotifyPropertyChanging, ReactiveUI.IReactiveObject, ReactiveUI.Legacy.IReactiveCollection<T>, ReactiveUI.Legacy.IReactiveDerivedList<T>, ReactiveUI.Legacy.IReactiveNotifyCollectionChanged<T>, ReactiveUI.Legacy.IReactiveNotifyCollectionItemChanged<T>, ReactiveUI.Legacy.IReadOnlyReactiveCollection<T>, ReactiveUI.Legacy.IReadOnlyReactiveList<T>, Splat.IEnableLogger, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.Specialized.INotifyCollectionChanged, System.ComponentModel.IBindingList, System.ComponentModel.INotifyPropertyChanged, System.IDisposable { }
|
||||
[System.ObsoleteAttribute("ReactiveList is no longer supported. We suggest replacing it with DynamicData htt" +
|
||||
"ps://github.com/rolandpheasant/dynamicdata")]
|
||||
public class static ObservableCollectionMixin
|
||||
{
|
||||
public static ReactiveUI.Winforms.Legacy.IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew, TDontCare>(this System.Collections.Generic.IEnumerable<T> @this, System.Func<T, TNew> selector, System.Action<TNew> removed, System.Func<T, bool> filter = null, System.Func<TNew, TNew, int> orderer = null, System.IObservable<TDontCare> signalReset = null) { }
|
||||
public static ReactiveUI.Winforms.Legacy.IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew, TDontCare>(this System.Collections.Generic.IEnumerable<T> @this, System.Func<T, TNew> selector, System.Func<T, bool> filter = null, System.Func<TNew, TNew, int> orderer = null, System.IObservable<TDontCare> signalReset = null) { }
|
||||
public static ReactiveUI.Winforms.Legacy.IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew>(this System.Collections.Generic.IEnumerable<T> @this, System.Func<T, TNew> selector, System.Action<TNew> removed, System.Func<T, bool> filter = null, System.Func<TNew, TNew, int> orderer = null) { }
|
||||
public static ReactiveUI.Winforms.Legacy.IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew>(this System.Collections.Generic.IEnumerable<T> @this, System.Func<T, TNew> selector, System.Func<T, bool> filter = null, System.Func<TNew, TNew, int> orderer = null) { }
|
||||
public static ReactiveUI.Winforms.IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew, TDontCare>(this System.Collections.Generic.IEnumerable<T> collection, System.Func<T, TNew> selector, System.Action<TNew> removed, System.Func<T, bool> filter = null, System.Func<TNew, TNew, int> orderer = null, System.IObservable<TDontCare> signalReset = null) { }
|
||||
public static ReactiveUI.Winforms.IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew, TDontCare>(this System.Collections.Generic.IEnumerable<T> collection, System.Func<T, TNew> selector, System.Func<T, bool> filter = null, System.Func<TNew, TNew, int> orderer = null, System.IObservable<TDontCare> signalReset = null) { }
|
||||
public static ReactiveUI.Winforms.IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew>(this System.Collections.Generic.IEnumerable<T> collection, System.Func<T, TNew> selector, System.Action<TNew> removed, System.Func<T, bool> filter = null, System.Func<TNew, TNew, int> orderer = null) { }
|
||||
public static ReactiveUI.Winforms.IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew>(this System.Collections.Generic.IEnumerable<T> collection, System.Func<T, TNew> selector, System.Func<T, bool> filter = null, System.Func<TNew, TNew, int> orderer = null) { }
|
||||
}
|
||||
[System.ObsoleteAttribute("ReactiveList is no longer supported. We suggest replacing it with DynamicData htt" +
|
||||
"ps://github.com/rolandpheasant/dynamicdata")]
|
||||
public class ReactiveBindingList<T> : ReactiveUI.Legacy.ReactiveList<T>, System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.IBindingList, System.ComponentModel.ICancelAddNew, System.ComponentModel.IRaiseItemChangedEvents
|
||||
public class ReactiveBindingList<T> : ReactiveUI.Legacy.ReactiveList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ComponentModel.IBindingList, System.ComponentModel.ICancelAddNew, System.ComponentModel.IRaiseItemChangedEvents
|
||||
{
|
||||
public ReactiveBindingList() { }
|
||||
public ReactiveBindingList(System.Collections.Generic.IEnumerable<T> items) { }
|
||||
|
|
|
@ -45,14 +45,16 @@ namespace ReactiveUI.Tests.API
|
|||
|
||||
private static string Filter(string text)
|
||||
{
|
||||
return string.Join(Environment.NewLine, text.Split(new[]
|
||||
{
|
||||
Environment.NewLine
|
||||
}, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyVersion("))
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyFileVersion("))
|
||||
.Where(l => !l.StartsWith("[assembly: AssemblyInformationalVersion("))
|
||||
.Where(l => !string.IsNullOrWhiteSpace(l)));
|
||||
return string.Join(Environment.NewLine, text.Split(
|
||||
new[]
|
||||
{
|
||||
Environment.NewLine
|
||||
}, StringSplitOptions.RemoveEmptyEntries)
|
||||
.Where(l =>
|
||||
!l.StartsWith("[assembly: AssemblyVersion(") &&
|
||||
!l.StartsWith("[assembly: AssemblyFileVersion(") &&
|
||||
!l.StartsWith("[assembly: AssemblyInformationalVersion(") &&
|
||||
!string.IsNullOrWhiteSpace(l)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,13 +42,14 @@ namespace ReactiveUI.Tests
|
|||
var manualSave = new Subject<Unit>();
|
||||
|
||||
var timesSaved = 0;
|
||||
fixture.AutoPersist(x =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
fixture.AutoPersist(
|
||||
_ =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
|
||||
// No changes = no saving
|
||||
sched.AdvanceByMs(2 * 100);
|
||||
|
@ -70,13 +71,14 @@ namespace ReactiveUI.Tests
|
|||
var manualSave = new Subject<Unit>();
|
||||
|
||||
var timesSaved = 0;
|
||||
fixture.AutoPersist(x =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
fixture.AutoPersist(
|
||||
_ =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
|
||||
// No changes = no saving
|
||||
sched.AdvanceByMs(2 * 100);
|
||||
|
@ -110,13 +112,14 @@ namespace ReactiveUI.Tests
|
|||
var manualSave = new Subject<Unit>();
|
||||
|
||||
var timesSaved = 0;
|
||||
var disp = fixture.AutoPersist(x =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
var disp = fixture.AutoPersist(
|
||||
_ =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
|
||||
// No changes = no saving
|
||||
sched.AdvanceByMs(2 * 100);
|
||||
|
@ -155,13 +158,14 @@ namespace ReactiveUI.Tests
|
|||
var fixture = new ObservableCollectionExtended<TestFixture> { item };
|
||||
|
||||
var timesSaved = 0;
|
||||
fixture.AutoPersistCollection(x =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
fixture.AutoPersistCollection(
|
||||
_ =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
|
||||
sched.AdvanceByMs(2 * 100);
|
||||
Assert.Equal(0, timesSaved);
|
||||
|
@ -215,13 +219,14 @@ namespace ReactiveUI.Tests
|
|||
var fixture = new ObservableCollectionExtended<TestFixture> { item };
|
||||
|
||||
var timesSaved = 0;
|
||||
var disp = fixture.AutoPersistCollection(x =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
var disp = fixture.AutoPersistCollection(
|
||||
_ =>
|
||||
{
|
||||
timesSaved++;
|
||||
return Observables.Unit;
|
||||
},
|
||||
manualSave,
|
||||
TimeSpan.FromMilliseconds(100));
|
||||
|
||||
sched.AdvanceByMs(2 * 100);
|
||||
Assert.Equal(0, timesSaved);
|
||||
|
|
|
@ -26,11 +26,13 @@ namespace ReactiveUI.Tests
|
|||
|
||||
private async Task<int> AwaitAnObservable()
|
||||
{
|
||||
var o = Observable.Start(() =>
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
return 42;
|
||||
}, RxApp.TaskpoolScheduler);
|
||||
var o = Observable.Start(
|
||||
() =>
|
||||
{
|
||||
Thread.Sleep(1000);
|
||||
return 42;
|
||||
},
|
||||
RxApp.TaskpoolScheduler);
|
||||
|
||||
var ret = await o;
|
||||
return ret;
|
||||
|
|
|
@ -28,7 +28,8 @@ namespace ReactiveUI.Tests
|
|||
|
||||
new TestScheduler().With(sched =>
|
||||
{
|
||||
var fixture = new ObservableAsPropertyHelper<int>(input,
|
||||
var fixture = new ObservableAsPropertyHelper<int>(
|
||||
input,
|
||||
x => output.Add(x),
|
||||
-5);
|
||||
|
||||
|
@ -50,7 +51,8 @@ namespace ReactiveUI.Tests
|
|||
|
||||
new TestScheduler().With(sched =>
|
||||
{
|
||||
var fixture = new ObservableAsPropertyHelper<int>(input,
|
||||
var fixture = new ObservableAsPropertyHelper<int>(
|
||||
input,
|
||||
x => output.Add(x),
|
||||
1);
|
||||
|
||||
|
@ -69,7 +71,8 @@ namespace ReactiveUI.Tests
|
|||
|
||||
new TestScheduler().With(sched =>
|
||||
{
|
||||
var fixture = new ObservableAsPropertyHelper<int>(Observable<int>.Never,
|
||||
var fixture = new ObservableAsPropertyHelper<int>(
|
||||
Observable<int>.Never,
|
||||
x => output.Add(x),
|
||||
32);
|
||||
|
||||
|
@ -83,7 +86,8 @@ namespace ReactiveUI.Tests
|
|||
var sched = new TestScheduler();
|
||||
var input = new Subject<int>();
|
||||
|
||||
var fixture = new ObservableAsPropertyHelper<int>(input,
|
||||
var fixture = new ObservableAsPropertyHelper<int>(
|
||||
input,
|
||||
_ => { },
|
||||
-5,
|
||||
scheduler: sched);
|
||||
|
|
|
@ -200,28 +200,31 @@ namespace ReactiveUI.Tests
|
|||
|
||||
var canStart = Players.ToObservableChangeSet().CountChanged().Select(_ => Players.Count >= 3);
|
||||
StartGame = ReactiveCommand.Create(() => { }, canStart);
|
||||
RandomizeOrder = ReactiveCommand.Create(() =>
|
||||
{
|
||||
using (Players.SuspendNotifications())
|
||||
{
|
||||
var r = new Random();
|
||||
var newOrder = Players.OrderBy(x => r.NextDouble()).ToList();
|
||||
Players.Clear();
|
||||
Players.AddRange(newOrder);
|
||||
}
|
||||
},
|
||||
canStart);
|
||||
RandomizeOrder = ReactiveCommand.Create(
|
||||
() =>
|
||||
{
|
||||
using (Players.SuspendNotifications())
|
||||
{
|
||||
var r = new Random();
|
||||
var newOrder = Players.OrderBy(x => r.NextDouble()).ToList();
|
||||
Players.Clear();
|
||||
Players.AddRange(newOrder);
|
||||
}
|
||||
},
|
||||
canStart);
|
||||
|
||||
RemovePlayer = ReactiveCommand.Create<string>(player => Players.Remove(player));
|
||||
var canAddPlayer = this.WhenAnyValue(x => x.Players.Count,
|
||||
x => x.NewPlayerName,
|
||||
(count, newPlayerName) => count < 7 && !string.IsNullOrWhiteSpace(newPlayerName) && !Players.Contains(newPlayerName));
|
||||
AddPlayer = ReactiveCommand.Create(() =>
|
||||
{
|
||||
Players.Add(NewPlayerName.Trim());
|
||||
NewPlayerName = string.Empty;
|
||||
},
|
||||
canAddPlayer);
|
||||
var canAddPlayer = this.WhenAnyValue(
|
||||
x => x.Players.Count,
|
||||
x => x.NewPlayerName,
|
||||
(count, newPlayerName) => count < 7 && !string.IsNullOrWhiteSpace(newPlayerName) && !Players.Contains(newPlayerName));
|
||||
AddPlayer = ReactiveCommand.Create(
|
||||
() =>
|
||||
{
|
||||
Players.Add(NewPlayerName.Trim());
|
||||
NewPlayerName = string.Empty;
|
||||
},
|
||||
canAddPlayer);
|
||||
}
|
||||
|
||||
public ObservableCollectionExtended<string> Players { get; }
|
||||
|
|
|
@ -62,17 +62,7 @@ namespace ReactiveUI.Winforms
|
|||
return Observable<bool>.Empty;
|
||||
}
|
||||
|
||||
private bool GetCachedIsDesignMode(Control control)
|
||||
{
|
||||
if (_isDesignModeCache == null)
|
||||
{
|
||||
_isDesignModeCache = GetIsDesignMode(control);
|
||||
}
|
||||
|
||||
return _isDesignModeCache.Value;
|
||||
}
|
||||
|
||||
private bool GetIsDesignMode(Control control)
|
||||
private static bool GetIsDesignMode(Control control)
|
||||
{
|
||||
var isDesignMode = false;
|
||||
|
||||
|
@ -93,5 +83,15 @@ namespace ReactiveUI.Winforms
|
|||
|
||||
return isDesignMode;
|
||||
}
|
||||
|
||||
private bool GetCachedIsDesignMode(Control control)
|
||||
{
|
||||
if (_isDesignModeCache == null)
|
||||
{
|
||||
_isDesignModeCache = GetIsDesignMode(control);
|
||||
}
|
||||
|
||||
return _isDesignModeCache.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
0
src/ReactiveUI.Winforms/CreatesCommandBinding.cs → src/ReactiveUI.Winforms/CreatesWinformsCommandBinding.cs
Executable file → Normal file
0
src/ReactiveUI.Winforms/CreatesCommandBinding.cs → src/ReactiveUI.Winforms/CreatesWinformsCommandBinding.cs
Executable file → Normal file
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ReactiveUI.Winforms
|
||||
{
|
||||
[SuppressMessage("Design", "CA1812: Instance not created", Justification = "Created by static method in other assembly.")]
|
||||
internal class PropertyChangedEventManager : WeakEventManager<INotifyPropertyChanged, PropertyChangedEventHandler, PropertyChangedEventArgs>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ReactiveUI.Winforms
|
||||
{
|
||||
[SuppressMessage("Design", "CA1812: Instance not created", Justification = "Created by static method in other assembly.")]
|
||||
internal class PropertyChangingEventManager : WeakEventManager<INotifyPropertyChanging, PropertyChangingEventHandler, PropertyChangingEventArgs>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ReactiveUI.Legacy;
|
||||
|
||||
namespace ReactiveUI.Winforms
|
||||
{
|
||||
/// <summary>
|
||||
/// IReactiveDerivedList represents a bindinglist whose contents will "follow" another
|
||||
/// collection; this method is useful for creating ViewModel collections
|
||||
/// that are automatically updated when the respective Model collection is updated.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type.</typeparam>
|
||||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
[SuppressMessage("Design", "CA1010: IList inheritors should inherit the generic form", Justification = "Legacy code.")]
|
||||
public interface IReactiveDerivedBindingList<T> : IReactiveDerivedList<T>, IBindingList
|
||||
{
|
||||
}
|
||||
}
|
|
@ -1,110 +1,16 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Concurrency;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
using ReactiveUI.Legacy;
|
||||
|
||||
namespace ReactiveUI.Winforms.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// IReactiveDerivedList represents a bindinglist whose contents will "follow" another
|
||||
/// collection; this method is useful for creating ViewModel collections
|
||||
/// that are automatically updated when the respective Model collection is updated.
|
||||
/// A set of extension methods associated with the IReactiveDerivedBindingList{TNew}.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type.</typeparam>
|
||||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
public interface IReactiveDerivedBindingList<T> : IReactiveDerivedList<T>, IBindingList
|
||||
{
|
||||
}
|
||||
|
||||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
internal class ReactiveDerivedBindingList<TSource, TValue> :
|
||||
ReactiveDerivedCollection<TSource, TValue>, IReactiveDerivedBindingList<TValue>
|
||||
{
|
||||
public ReactiveDerivedBindingList(
|
||||
IEnumerable<TSource> source,
|
||||
Func<TSource, TValue> selector,
|
||||
Func<TSource, bool> filter,
|
||||
Func<TValue, TValue, int> orderer,
|
||||
Action<TValue> removed,
|
||||
IObservable<Unit> signalReset)
|
||||
: base(source, selector, filter, orderer, removed, signalReset, Scheduler.Immediate)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void RaiseCollectionChanged(NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
base.RaiseCollectionChanged(e);
|
||||
if (ListChanged != null)
|
||||
{
|
||||
e.AsListChangedEventArgs().ForEach(x => ListChanged(this, x));
|
||||
}
|
||||
}
|
||||
|
||||
private const string ReadonlyExceptionMessage = "Derived collections cannot be modified.";
|
||||
|
||||
public object AddNew()
|
||||
{
|
||||
throw new NotSupportedException(ReadonlyExceptionMessage);
|
||||
}
|
||||
|
||||
public void AddIndex(PropertyDescriptor property)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public void ApplySort(PropertyDescriptor property, ListSortDirection direction)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public int Find(PropertyDescriptor property, object key)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public void RemoveIndex(PropertyDescriptor property)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public void RemoveSort()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public bool AllowNew => false;
|
||||
|
||||
public bool AllowEdit => false;
|
||||
|
||||
public bool AllowRemove => false;
|
||||
|
||||
public bool SupportsChangeNotification => true;
|
||||
|
||||
public bool SupportsSearching => false;
|
||||
|
||||
public bool SupportsSorting => false;
|
||||
|
||||
public bool IsSorted => false;
|
||||
|
||||
public PropertyDescriptor SortProperty => null;
|
||||
|
||||
public ListSortDirection SortDirection => ListSortDirection.Ascending;
|
||||
|
||||
public event ListChangedEventHandler ListChanged;
|
||||
}
|
||||
|
||||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
#pragma warning disable SA1600 // Elements should be documented
|
||||
public static class ObservableCollectionMixin
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -122,6 +28,7 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
/// <typeparam name="T">The type.</typeparam>
|
||||
/// <typeparam name="TNew">The new type.</typeparam>
|
||||
/// <typeparam name="TDontCare">The signal type.</typeparam>
|
||||
/// <param name="collection">The collection we are creating a derived list from.</param>
|
||||
/// <param name="selector">A Select function that will be run on each
|
||||
/// item.</param>
|
||||
/// <param name="removed">An action that is called on each item when
|
||||
|
@ -133,12 +40,11 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
/// <param name="signalReset">When this Observable is signalled,
|
||||
/// the derived collection will be manually
|
||||
/// reordered/refiltered.</param>
|
||||
/// <param name="this">The source collection to follow.</param>
|
||||
/// <returns>A new collection whose items are equivalent to
|
||||
/// Collection.Select().Where().OrderBy() and will mirror changes
|
||||
/// in the initial collection.</returns>
|
||||
public static IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew, TDontCare>(
|
||||
this IEnumerable<T> @this,
|
||||
this IEnumerable<T> collection,
|
||||
Func<T, TNew> selector,
|
||||
Action<TNew> removed,
|
||||
Func<T, bool> filter = null,
|
||||
|
@ -154,7 +60,7 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
reset = signalReset.Select(_ => Unit.Default);
|
||||
}
|
||||
|
||||
return new ReactiveDerivedBindingList<T, TNew>(@this, selector, filter, orderer, removed, reset);
|
||||
return new ReactiveDerivedBindingList<T, TNew>(collection, selector, filter, orderer, removed, reset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -172,6 +78,7 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
/// <typeparam name="T">The type.</typeparam>
|
||||
/// <typeparam name="TNew">The new type.</typeparam>
|
||||
/// <typeparam name="TDontCare">The signal type.</typeparam>
|
||||
/// <param name="collection">The collection we are creating a derived list from.</param>
|
||||
/// <param name="selector">A Select function that will be run on each
|
||||
/// item.</param>
|
||||
/// <param name="filter">A filter to determine whether to exclude items
|
||||
|
@ -181,18 +88,17 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
/// <param name="signalReset">When this Observable is signalled,
|
||||
/// the derived collection will be manually
|
||||
/// reordered/refiltered.</param>
|
||||
/// <param name="this">The source collection to follow.</param>
|
||||
/// <returns>A new collection whose items are equivalent to
|
||||
/// Collection.Select().Where().OrderBy() and will mirror changes
|
||||
/// in the initial collection.</returns>
|
||||
public static IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew, TDontCare>(
|
||||
this IEnumerable<T> @this,
|
||||
this IEnumerable<T> collection,
|
||||
Func<T, TNew> selector,
|
||||
Func<T, bool> filter = null,
|
||||
Func<TNew, TNew, int> orderer = null,
|
||||
IObservable<TDontCare> signalReset = null)
|
||||
{
|
||||
return @this.CreateDerivedBindingList(selector, null, filter, orderer, signalReset);
|
||||
return collection.CreateDerivedBindingList(selector, null, filter, orderer, signalReset);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -208,6 +114,7 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
/// </summary>
|
||||
/// <typeparam name="T">The type.</typeparam>
|
||||
/// <typeparam name="TNew">The new type.</typeparam>
|
||||
/// <param name="collection">The collection we are creating a derived list from.</param>
|
||||
/// <param name="selector">A Select function that will be run on each
|
||||
/// item.</param>
|
||||
/// <param name="removed">An action that is called on each item when
|
||||
|
@ -216,18 +123,17 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
/// in the derived collection.</param>
|
||||
/// <param name="orderer">A comparator method to determine the ordering of
|
||||
/// the resulting collection.</param>
|
||||
/// <param name="this">The source collection to follow.</param>
|
||||
/// <returns>A new collection whose items are equivalent to
|
||||
/// Collection.Select().Where().OrderBy() and will mirror changes
|
||||
/// in the initial collection.</returns>
|
||||
public static IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew>(
|
||||
this IEnumerable<T> @this,
|
||||
this IEnumerable<T> collection,
|
||||
Func<T, TNew> selector,
|
||||
Action<TNew> removed,
|
||||
Func<T, bool> filter = null,
|
||||
Func<TNew, TNew, int> orderer = null)
|
||||
{
|
||||
return @this.CreateDerivedBindingList(selector, removed, filter, orderer, (IObservable<Unit>)null);
|
||||
return collection.CreateDerivedBindingList(selector, removed, filter, orderer, (IObservable<Unit>)null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -243,25 +149,23 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
/// </summary>
|
||||
/// <typeparam name="T">The type.</typeparam>
|
||||
/// <typeparam name="TNew">The new type.</typeparam>
|
||||
/// <param name="collection">The collection we are creating a derived list from.</param>
|
||||
/// <param name="selector">A Select function that will be run on each
|
||||
/// item.</param>
|
||||
/// <param name="filter">A filter to determine whether to exclude items
|
||||
/// in the derived collection.</param>
|
||||
/// <param name="orderer">A comparator method to determine the ordering of
|
||||
/// the resulting collection.</param>
|
||||
/// <param name="this">The source collection to follow.</param>
|
||||
/// <returns>A new collection whose items are equivalent to
|
||||
/// Collection.Select().Where().OrderBy() and will mirror changes
|
||||
/// in the initial collection.</returns>
|
||||
public static IReactiveDerivedBindingList<TNew> CreateDerivedBindingList<T, TNew>(
|
||||
this IEnumerable<T> @this,
|
||||
this IEnumerable<T> collection,
|
||||
Func<T, TNew> selector,
|
||||
Func<T, bool> filter = null,
|
||||
Func<TNew, TNew, int> orderer = null)
|
||||
{
|
||||
return @this.CreateDerivedBindingList(selector, null, filter, orderer, (IObservable<Unit>)null);
|
||||
return collection.CreateDerivedBindingList(selector, null, filter, orderer, (IObservable<Unit>)null);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning restore SA1600 // Elements should be documented
|
||||
}
|
|
@ -12,18 +12,63 @@ using ReactiveUI.Legacy;
|
|||
|
||||
namespace ReactiveUI.Winforms.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// A version of the ReactiveList that works with the Winforms IBindingList.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of item in the list.</typeparam>
|
||||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
#pragma warning disable SA1600 // Elements should be documented
|
||||
public class ReactiveBindingList<T> : ReactiveList<T>,
|
||||
IList<T>, ICollection<T>, IEnumerable<T>,
|
||||
ICollection, IEnumerable, IList, IBindingList,
|
||||
ICancelAddNew, IRaiseItemChangedEvents
|
||||
public class ReactiveBindingList<T> : ReactiveList<T>, IBindingList, ICancelAddNew, IRaiseItemChangedEvents
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReactiveBindingList{T}"/> class.
|
||||
/// </summary>
|
||||
public ReactiveBindingList()
|
||||
: this(null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ReactiveBindingList{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="items">The items.</param>
|
||||
public ReactiveBindingList(IEnumerable<T> items)
|
||||
: base(items)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event ListChangedEventHandler ListChanged;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool RaisesItemChangedEvents => ChangeTrackingEnabled;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool AllowNew => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool AllowEdit => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool AllowRemove => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool SupportsChangeNotification => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool SupportsSearching => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool SupportsSorting => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsSorted => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public PropertyDescriptor SortProperty => null;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ListSortDirection SortDirection => ListSortDirection.Ascending;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void CancelNew(int itemIndex)
|
||||
{
|
||||
|
@ -36,28 +81,6 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
// throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool RaisesItemChangedEvents => ChangeTrackingEnabled;
|
||||
|
||||
/// <summary>
|
||||
/// ReactiveBindingList constructor.
|
||||
/// </summary>
|
||||
/// <param name="items">The items.</param>
|
||||
public ReactiveBindingList(IEnumerable<T> items)
|
||||
: base(items)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void RaiseCollectionChanged(NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
base.RaiseCollectionChanged(e);
|
||||
if (ListChanged != null)
|
||||
{
|
||||
e.AsListChangedEventArgs().ForEach(x => ListChanged(this, x));
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public object AddNew()
|
||||
{
|
||||
|
@ -95,34 +118,13 @@ namespace ReactiveUI.Winforms.Legacy
|
|||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool AllowNew => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool AllowEdit => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool AllowRemove => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool SupportsChangeNotification => true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool SupportsSearching => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool SupportsSorting => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsSorted => false;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public PropertyDescriptor SortProperty => null;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ListSortDirection SortDirection => ListSortDirection.Ascending;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public event ListChangedEventHandler ListChanged;
|
||||
protected override void RaiseCollectionChanged(NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
base.RaiseCollectionChanged(e);
|
||||
if (ListChanged != null)
|
||||
{
|
||||
e.AsListChangedEventArgs().ForEach(x => ListChanged(this, x));
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore SA1600 // Elements should be documented
|
||||
}
|
||||
|
|
|
@ -0,0 +1,93 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Concurrency;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
using ReactiveUI.Legacy;
|
||||
|
||||
namespace ReactiveUI.Winforms.Legacy
|
||||
{
|
||||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
internal class ReactiveDerivedBindingList<TSource, TValue> : ReactiveDerivedCollection<TSource, TValue>, IReactiveDerivedBindingList<TValue>
|
||||
{
|
||||
private const string ReadonlyExceptionMessage = "Derived collections cannot be modified.";
|
||||
|
||||
public ReactiveDerivedBindingList(
|
||||
IEnumerable<TSource> source,
|
||||
Func<TSource, TValue> selector,
|
||||
Func<TSource, bool> filter,
|
||||
Func<TValue, TValue, int> orderer,
|
||||
Action<TValue> removed,
|
||||
IObservable<Unit> signalReset)
|
||||
: base(source, selector, filter, orderer, removed, signalReset, Scheduler.Immediate)
|
||||
{
|
||||
}
|
||||
|
||||
public event ListChangedEventHandler ListChanged;
|
||||
|
||||
public bool AllowNew => false;
|
||||
|
||||
public bool AllowEdit => false;
|
||||
|
||||
public bool AllowRemove => false;
|
||||
|
||||
public bool SupportsChangeNotification => true;
|
||||
|
||||
public bool SupportsSearching => false;
|
||||
|
||||
public bool SupportsSorting => false;
|
||||
|
||||
public bool IsSorted => false;
|
||||
|
||||
public PropertyDescriptor SortProperty => null;
|
||||
|
||||
public ListSortDirection SortDirection => ListSortDirection.Ascending;
|
||||
|
||||
public object AddNew()
|
||||
{
|
||||
throw new NotSupportedException(ReadonlyExceptionMessage);
|
||||
}
|
||||
|
||||
public void AddIndex(PropertyDescriptor property)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public void ApplySort(PropertyDescriptor property, ListSortDirection direction)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public int Find(PropertyDescriptor property, object key)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public void RemoveIndex(PropertyDescriptor property)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public void RemoveSort()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
protected override void RaiseCollectionChanged(NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
base.RaiseCollectionChanged(e);
|
||||
if (ListChanged != null)
|
||||
{
|
||||
e.AsListChangedEventArgs().ForEach(x => ListChanged(this, x));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -10,6 +10,9 @@ using System.Windows.Forms;
|
|||
|
||||
namespace ReactiveUI.Winforms
|
||||
{
|
||||
/// <summary>
|
||||
/// A control host which will handling routing between different ViewModels and Views.
|
||||
/// </summary>
|
||||
[DefaultProperty("ViewModel")]
|
||||
public partial class RoutedControlHost : UserControl, IReactiveObject
|
||||
{
|
||||
|
@ -156,7 +159,7 @@ namespace ReactiveUI.Winforms
|
|||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
private Control InitView(Control view)
|
||||
private static Control InitView(Control view)
|
||||
{
|
||||
view.Dock = DockStyle.Fill;
|
||||
return view;
|
||||
|
|
|
@ -11,6 +11,9 @@ using System.Windows.Forms;
|
|||
|
||||
namespace ReactiveUI.Winforms
|
||||
{
|
||||
/// <summary>
|
||||
/// A view model control host which will find and host the View for a ViewModel.
|
||||
/// </summary>
|
||||
[DefaultProperty("ViewModel")]
|
||||
public partial class ViewModelControlHost : UserControl, IReactiveObject, IViewFor
|
||||
{
|
||||
|
@ -18,11 +21,8 @@ namespace ReactiveUI.Winforms
|
|||
private Control _defaultContent;
|
||||
private IObservable<string> _viewContractObservable;
|
||||
private object _viewModel;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [default cache views enabled].
|
||||
/// </summary>
|
||||
public static bool DefaultCacheViewsEnabled { get; set; }
|
||||
private object _content;
|
||||
private bool _cacheViews;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ViewModelControlHost"/> class.
|
||||
|
@ -52,6 +52,11 @@ namespace ReactiveUI.Winforms
|
|||
remove => PropertyChangedEventManager.RemoveHandler(this, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether [default cache views enabled].
|
||||
/// </summary>
|
||||
public static bool DefaultCacheViewsEnabled { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current view.
|
||||
/// </summary>
|
||||
|
@ -97,8 +102,6 @@ namespace ReactiveUI.Winforms
|
|||
set => this.RaiseAndSetIfChanged(ref _viewModel, value);
|
||||
}
|
||||
|
||||
private object _content;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the content.
|
||||
/// </summary>
|
||||
|
@ -111,8 +114,6 @@ namespace ReactiveUI.Winforms
|
|||
protected set => this.RaiseAndSetIfChanged(ref _content, value);
|
||||
}
|
||||
|
||||
private bool _cacheViews;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether to cache views.
|
||||
/// </summary>
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace ReactiveUI.Winforms
|
||||
{
|
||||
internal class CanExecuteChangedEventManager : WeakEventManager<ICommand, EventHandler, EventArgs>
|
||||
{
|
||||
}
|
||||
|
||||
internal class PropertyChangingEventManager : WeakEventManager<INotifyPropertyChanging, PropertyChangingEventHandler, PropertyChangingEventArgs>
|
||||
{
|
||||
}
|
||||
|
||||
internal class PropertyChangedEventManager : WeakEventManager<INotifyPropertyChanged, PropertyChangedEventHandler, PropertyChangedEventArgs>
|
||||
{
|
||||
}
|
||||
|
||||
internal class CollectionChangingEventManager : WeakEventManager<INotifyCollectionChanging, NotifyCollectionChangedEventHandler, NotifyCollectionChangedEventArgs>
|
||||
{
|
||||
}
|
||||
|
||||
internal class CollectionChangedEventManager : WeakEventManager<INotifyCollectionChanged, NotifyCollectionChangedEventHandler, NotifyCollectionChangedEventArgs>
|
||||
{
|
||||
}
|
||||
}
|
|
@ -24,11 +24,6 @@ namespace ReactiveUI
|
|||
/// </summary>
|
||||
public class AutoSuspendHelper : IEnableLogger
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the time out before the Auto Suspension happens.
|
||||
/// </summary>
|
||||
public TimeSpan IdleTimeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AutoSuspendHelper"/> class.
|
||||
/// </summary>
|
||||
|
@ -69,5 +64,10 @@ namespace ReactiveUI
|
|||
AppDomain.CurrentDomain.UnhandledException += (o, e) => untimelyDeath.OnNext(Unit.Default);
|
||||
RxApp.SuspensionHost.ShouldInvalidateState = untimelyDeath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time out before the Auto Suspension happens.
|
||||
/// </summary>
|
||||
public TimeSpan IdleTimeout { get; set; }
|
||||
}
|
||||
}
|
|
@ -56,7 +56,7 @@ namespace ReactiveUI
|
|||
});
|
||||
}
|
||||
|
||||
private DependencyProperty GetDependencyProperty(Type type, string propertyName)
|
||||
private static DependencyProperty GetDependencyProperty(Type type, string propertyName)
|
||||
{
|
||||
var fi = type.GetTypeInfo().GetFields(BindingFlags.FlattenHierarchy | BindingFlags.Static | BindingFlags.Public)
|
||||
.FirstOrDefault(x => x.Name == propertyName + "Property" && x.IsStatic);
|
|
@ -10,4 +10,8 @@
|
|||
<ProjectReference Include="..\ReactiveUI\ReactiveUI.csproj" />
|
||||
<Compile Include="..\ReactiveUI\Platforms\windows-common\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="..\ReactiveUI\Platforms\windows-common\BindingTypeConverters.cs" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
@ -38,11 +38,6 @@ namespace ReactiveUI
|
|||
Window, IViewFor<TViewModel>
|
||||
where TViewModel : class
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the binding root view model.
|
||||
/// </summary>
|
||||
public TViewModel BindingRoot => ViewModel;
|
||||
|
||||
/// <summary>
|
||||
/// The view model dependency property.
|
||||
/// </summary>
|
||||
|
@ -53,6 +48,11 @@ namespace ReactiveUI
|
|||
typeof(ReactiveWindow<TViewModel>),
|
||||
new PropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// Gets the binding root view model.
|
||||
/// </summary>
|
||||
public TViewModel BindingRoot => ViewModel;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
|
|
|
@ -159,6 +159,31 @@ namespace ReactiveUI
|
|||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
// Wire up all of the various control parts.
|
||||
_container = (Grid)GetTemplateChild("PART_Container");
|
||||
if (_container == null)
|
||||
{
|
||||
throw new ArgumentException("PART_Container not found.");
|
||||
}
|
||||
|
||||
_currentContentPresentationSite =
|
||||
(ContentPresenter)GetTemplateChild("PART_CurrentContentPresentationSite");
|
||||
if (_currentContentPresentationSite == null)
|
||||
{
|
||||
throw new ArgumentException("PART_CurrentContentPresentationSite not found.");
|
||||
}
|
||||
|
||||
_previousContentPresentationSite =
|
||||
(ContentPresenter)GetTemplateChild("PART_PreviousContentPresentationSite");
|
||||
|
||||
// Set the current content site to the first piece of content.
|
||||
_currentContentPresentationSite.Content = Content;
|
||||
VisualStateManager.GoToState(this, NormalState, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the value of the <see cref="ContentControl.Content"/> property changes.
|
||||
/// </summary>
|
||||
|
@ -308,31 +333,6 @@ namespace ReactiveUI
|
|||
return transition;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
// Wire up all of the various control parts.
|
||||
_container = (Grid)GetTemplateChild("PART_Container");
|
||||
if (_container == null)
|
||||
{
|
||||
throw new ArgumentException("PART_Container not found.");
|
||||
}
|
||||
|
||||
_currentContentPresentationSite =
|
||||
(ContentPresenter)GetTemplateChild("PART_CurrentContentPresentationSite");
|
||||
if (_currentContentPresentationSite == null)
|
||||
{
|
||||
throw new ArgumentException("PART_CurrentContentPresentationSite not found.");
|
||||
}
|
||||
|
||||
_previousContentPresentationSite =
|
||||
(ContentPresenter)GetTemplateChild("PART_PreviousContentPresentationSite");
|
||||
|
||||
// Set the current content site to the first piece of content.
|
||||
_currentContentPresentationSite.Content = Content;
|
||||
VisualStateManager.GoToState(this, NormalState, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets default values for certain transition types.
|
||||
/// </summary>
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace ReactiveUI.XamForms
|
|||
/// Attribute that diables animation for a view.
|
||||
/// </summary>
|
||||
/// <seealso cref="System.Attribute" />
|
||||
[AttributeUsage(AttributeTargets.All)]
|
||||
public class DisableAnimationAttribute : Attribute
|
||||
{
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ReactiveUI.XamForms
|
|||
propertyChanged: OnViewModelChanged);
|
||||
|
||||
/// <summary>
|
||||
/// The ViewModel to display.
|
||||
/// Gets or sets the ViewModel to display.
|
||||
/// </summary>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ReactiveUI.XamForms
|
|||
propertyChanged: OnViewModelChanged);
|
||||
|
||||
/// <summary>
|
||||
/// The ViewModel to display.
|
||||
/// Gets or sets the ViewModel to display.
|
||||
/// </summary>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ReactiveUI.XamForms
|
|||
propertyChanged: OnViewModelChanged);
|
||||
|
||||
/// <summary>
|
||||
/// The ViewModel to display.
|
||||
/// Gets or sets the ViewModel to display.
|
||||
/// </summary>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ReactiveUI.XamForms
|
|||
propertyChanged: OnViewModelChanged);
|
||||
|
||||
/// <summary>
|
||||
/// The ViewModel to display.
|
||||
/// Gets or sets the ViewModel to display.
|
||||
/// </summary>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace ReactiveUI.XamForms
|
|||
propertyChanged: OnViewModelChanged);
|
||||
|
||||
/// <summary>
|
||||
/// The ViewModel to display.
|
||||
/// Gets or sets the ViewModel to display.
|
||||
/// </summary>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ReactiveUI.XamForms
|
|||
propertyChanged: OnViewModelChanged);
|
||||
|
||||
/// <summary>
|
||||
/// The ViewModel to display.
|
||||
/// Gets or sets the ViewModel to display.
|
||||
/// </summary>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace ReactiveUI.XamForms
|
|||
propertyChanged: OnViewModelChanged);
|
||||
|
||||
/// <summary>
|
||||
/// The ViewModel to display.
|
||||
/// Gets or sets the ViewModel to display.
|
||||
/// </summary>
|
||||
public TViewModel ViewModel
|
||||
{
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Reactive;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
|
@ -185,6 +186,7 @@ namespace ReactiveUI.XamForms
|
|||
/// </summary>
|
||||
/// <param name="vm">The vm.</param>
|
||||
/// <returns>An observable of the page associated to a <see cref="IRoutableViewModel"/>.</returns>
|
||||
[SuppressMessage("Design", "CA1822: Can be made static", Justification = "Might be used by implementors.")]
|
||||
protected IObservable<Page> PageForViewModel(IRoutableViewModel vm)
|
||||
{
|
||||
if (vm == null)
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace ReactiveUI.XamForms
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// The view model whose associated view is to be displayed.
|
||||
/// Gets or sets the view model whose associated view is to be displayed.
|
||||
/// </summary>
|
||||
public object ViewModel
|
||||
{
|
||||
|
@ -113,7 +113,7 @@ namespace ReactiveUI.XamForms
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// The content to display when <see cref="ViewModel"/> is <see langword="null"/>.
|
||||
/// Gets or sets the content to display when <see cref="ViewModel"/> is <see langword="null"/>.
|
||||
/// </summary>
|
||||
public View DefaultContent
|
||||
{
|
||||
|
@ -122,7 +122,7 @@ namespace ReactiveUI.XamForms
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// The contract to use when resolving the view for the given view model.
|
||||
/// Gets or sets the observable which signals when the contract to use when resolving the view for the given view model has changed.
|
||||
/// </summary>
|
||||
public IObservable<string> ViewContractObservable
|
||||
{
|
||||
|
@ -131,7 +131,7 @@ namespace ReactiveUI.XamForms
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// A fixed contract to use when resolving the view for the given view model.
|
||||
/// Gets or sets the fixed contract to use when resolving the view for the given view model.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This property is a mere convenience so that a fixed contract can be assigned directly in XAML.
|
||||
|
@ -143,7 +143,7 @@ namespace ReactiveUI.XamForms
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Can be used to override the view locator to use when resolving the view. If unspecified, <see cref="ViewLocator.Current"/> will be used.
|
||||
/// Gets or sets the override for the view locator to use when resolving the view. If unspecified, <see cref="ViewLocator.Current"/> will be used.
|
||||
/// </summary>
|
||||
public IViewLocator ViewLocator { get; set; }
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
|||
Directory.build.props = Directory.build.props
|
||||
Directory.build.targets = Directory.build.targets
|
||||
global.json = global.json
|
||||
..\reactiveui.ruleset = ..\reactiveui.ruleset
|
||||
..\stylecop.json = ..\stylecop.json
|
||||
reactiveui.ruleset = reactiveui.ruleset
|
||||
reactiveui.tests.ruleset = reactiveui.tests.ruleset
|
||||
..\stylecop.json = ..\stylecop.json
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ReactiveUI", "ReactiveUI\ReactiveUI.csproj", "{464CB812-F99F-401B-BE4C-E8F0515CD19D}"
|
||||
|
|
|
@ -108,6 +108,11 @@ namespace ReactiveUI
|
|||
_deactivated?.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a action blocks to the list of registered blocks. These will called
|
||||
/// on activation, then disposed on deactivation.
|
||||
/// </summary>
|
||||
/// <param name="block">The block to add.</param>
|
||||
internal void AddActivationBlock(Func<IEnumerable<IDisposable>> block)
|
||||
{
|
||||
_blocks.Add(block);
|
||||
|
|
|
@ -13,6 +13,9 @@ using Splat;
|
|||
|
||||
namespace ReactiveUI
|
||||
{
|
||||
/// <summary>
|
||||
/// Internal relay command used for Command binding.
|
||||
/// </summary>
|
||||
internal class RelayCommand : ICommand
|
||||
{
|
||||
private readonly Func<object, bool> _canExecute;
|
||||
|
|
|
@ -21,55 +21,37 @@ namespace ReactiveUI
|
|||
where TView : IViewFor
|
||||
{
|
||||
/// <summary>
|
||||
/// The instance of the view model this binding is applied to.
|
||||
/// Gets the instance of the view model this binding is applied to.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The view model.
|
||||
/// </value>
|
||||
TViewModel ViewModel { get; }
|
||||
|
||||
/// <summary>
|
||||
/// An expression representing the propertyon the viewmodel bound to the view.
|
||||
/// Gets an expression representing the propertyon the viewmodel bound to the view.
|
||||
/// This can be a child property, for example x.Foo.Bar.Baz in which case
|
||||
/// that will be the expression.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The expression.
|
||||
/// </value>
|
||||
Expression ViewModelExpression { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The instance of the view this binding is applied to.
|
||||
/// Gets the instance of the view this binding is applied to.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The view.
|
||||
/// </value>
|
||||
TView View { get; }
|
||||
|
||||
/// <summary>
|
||||
/// An expression representing the property on the view bound to the viewmodel.
|
||||
/// Gets an expression representing the property on the view bound to the viewmodel.
|
||||
/// This can be a child property, for example x.Foo.Bar.Baz in which case
|
||||
/// that will be the expression.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The expression.
|
||||
/// </value>
|
||||
Expression ViewExpression { get; }
|
||||
|
||||
/// <summary>
|
||||
/// An observable representing changed values for the binding.
|
||||
/// Gets an observable representing changed values for the binding.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The changed.
|
||||
/// </value>
|
||||
IObservable<TValue> Changed { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the direction of the binding.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The direction.
|
||||
/// </value>
|
||||
BindingDirection Direction { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,56 +32,22 @@ namespace ReactiveUI
|
|||
_bindingDisposable = bindingDisposable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The instance of the view model this binding is applied to.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The view model.
|
||||
/// </value>
|
||||
/// <inheritdoc />
|
||||
public TViewModel ViewModel { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// An expression representing the propertyon the viewmodel bound to the view.
|
||||
/// This can be a child property, for example x.Foo.Bar.Baz in which case
|
||||
/// that will be the expression.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The expression.
|
||||
/// </value>
|
||||
/// <inheritdoc />
|
||||
public Expression ViewModelExpression { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The instance of the view this binding is applied to.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The view.
|
||||
/// </value>
|
||||
/// <inheritdoc />
|
||||
public TView View { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// An expression representing the property on the view bound to the viewmodel.
|
||||
/// This can be a child property, for example x.Foo.Bar.Baz in which case
|
||||
/// that will be the expression.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The expression.
|
||||
/// </value>
|
||||
/// <inheritdoc />
|
||||
public Expression ViewExpression { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// An observable representing changed values for the binding.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The changed.
|
||||
/// </value>
|
||||
/// <inheritdoc />
|
||||
public IObservable<TValue> Changed { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the direction of the binding.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The direction.
|
||||
/// </value>
|
||||
/// <inheritdoc />
|
||||
public BindingDirection Direction { get; private set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
|
@ -91,6 +57,10 @@ namespace ReactiveUI
|
|||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Disposes of resources inside the class.
|
||||
/// </summary>
|
||||
/// <param name="isDisposing">If we are disposing managed resources.</param>
|
||||
protected virtual void Dispose(bool isDisposing)
|
||||
{
|
||||
if (isDisposing)
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace ReactiveUI
|
|||
/// If the type you're creating a comparer for is known this class is nothing more than an alias for the generic
|
||||
/// OrderedComparer. This class can be used to create comparers for anonymous types.
|
||||
/// </remarks>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public static class OrderedComparer
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -70,13 +71,12 @@ namespace ReactiveUI
|
|||
}
|
||||
}
|
||||
|
||||
#pragma warning disable SA1402 // File may only contain a single type
|
||||
/// <summary>
|
||||
/// Convenience class providing a starting point for chaining comparers.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The comparison type.</typeparam>
|
||||
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:FileMayOnlyContainASingleType", Justification = "Classes with the same class names within.")]
|
||||
public static class OrderedComparer<T>
|
||||
#pragma warning restore SA1402 // File may only contain a single type
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a comparer that will sort elements in ascending order based on the values returned by the provided
|
||||
|
|
|
@ -15,12 +15,18 @@ namespace ReactiveUI
|
|||
public sealed class LocalizableAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the LocalizableAttribute class.
|
||||
/// Initializes a new instance of the <see cref="LocalizableAttribute"/> class.
|
||||
/// </summary>
|
||||
/// <param name="isLocalizable">If the target is localizable or not.</param>
|
||||
public LocalizableAttribute(bool isLocalizable)
|
||||
{
|
||||
IsLocalizable = isLocalizable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the target is localizable.
|
||||
/// </summary>
|
||||
public bool IsLocalizable { get; }
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -4,7 +4,11 @@
|
|||
|
||||
namespace ReactiveUI
|
||||
{
|
||||
public delegate void PropertyChangingEventHandler(
|
||||
object sender,
|
||||
PropertyChangingEventArgs e);
|
||||
}
|
||||
/// <summary>
|
||||
/// Event handler for the property changing events.
|
||||
/// This will be called before a property value has changed.
|
||||
/// </summary>
|
||||
/// <param name="sender">The sender of the event.</param>
|
||||
/// <param name="e">Details about the changing property.</param>
|
||||
public delegate void PropertyChangingEventHandler(object sender, PropertyChangingEventArgs e);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,9 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace ReactiveUI
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for simplifying and validating expressions.
|
||||
/// </summary>
|
||||
internal class ExpressionRewriter : ExpressionVisitor
|
||||
{
|
||||
public override Expression Visit(Expression node)
|
||||
|
|
|
@ -54,7 +54,7 @@ namespace ReactiveUI
|
|||
private readonly IScheduler _handlerScheduler;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new interaction instance.
|
||||
/// Initializes a new instance of the <see cref="Interaction{TInput, TOutput}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="handlerScheduler">
|
||||
/// The scheduler to use when invoking handlers, which defaults to <c>CurrentThreadScheduler.Instance</c> if <see langword="null"/>.
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace ReactiveUI
|
|||
public interface IHandleObservableErrors
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires whenever an exception would normally terminate ReactiveUI
|
||||
/// Gets a observable which will fire whenever an exception would normally terminate ReactiveUI
|
||||
/// internal state.
|
||||
/// </summary>
|
||||
IObservable<Exception> ThrownExceptions { get; }
|
||||
|
|
|
@ -16,17 +16,17 @@ namespace ReactiveUI
|
|||
public interface IObservedChange<out TSender, out TValue>
|
||||
{
|
||||
/// <summary>
|
||||
/// The object that has raised the change.
|
||||
/// Gets the object that has raised the change.
|
||||
/// </summary>
|
||||
TSender Sender { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The expression of the member that has changed on Sender.
|
||||
/// Gets the expression of the member that has changed on Sender.
|
||||
/// </summary>
|
||||
Expression Expression { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The value of the property that has changed. IMPORTANT NOTE: This
|
||||
/// Gets the value of the property that has changed. IMPORTANT NOTE: This
|
||||
/// property is often not set for performance reasons, unless you have
|
||||
/// explicitly requested an Observable for a property via a method such
|
||||
/// as ObservableForProperty. To retrieve the value for the property,
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace ReactiveUI
|
|||
/// Gets a descriptor that describes (if applicable) the orientation
|
||||
/// of the screen.
|
||||
/// </summary>
|
||||
/// <returns>The orientation of the screen if supported.</returns>
|
||||
/// <returns>The device orientation descriptor.</returns>
|
||||
string GetOrientation();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,14 +14,14 @@ namespace ReactiveUI
|
|||
public interface IReactiveNotifyPropertyChanged<out TSender>
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *before* a property is about to
|
||||
/// Gets an observable that fires *before* a property is about to
|
||||
/// be changed. Note that this should not fire duplicate change notifications if a
|
||||
/// property is set to the same value multiple times.
|
||||
/// </summary>
|
||||
IObservable<IReactivePropertyChangedEventArgs<TSender>> Changing { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Represents an Observable that fires *after* a property has changed.
|
||||
/// Gets an Observable that fires *after* a property has changed.
|
||||
/// Note that this should not fire duplicate change notifications if a
|
||||
/// property is set to the same value multiple times.
|
||||
/// </summary>
|
||||
|
|
|
@ -16,12 +16,12 @@ namespace ReactiveUI
|
|||
public interface IReactivePropertyChangedEventArgs<out TSender>
|
||||
{
|
||||
/// <summary>
|
||||
/// The name of the property that has changed on Sender.
|
||||
/// Gets the name of the property that has changed on Sender.
|
||||
/// </summary>
|
||||
string PropertyName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The object that has raised the change.
|
||||
/// Gets the object that has raised the change.
|
||||
/// </summary>
|
||||
TSender Sender { get; }
|
||||
}
|
||||
|
|
|
@ -10,12 +10,12 @@ namespace ReactiveUI
|
|||
public interface IRoutableViewModel : IReactiveObject
|
||||
{
|
||||
/// <summary>
|
||||
/// A string token representing the current ViewModel, such as 'login' or 'user'.
|
||||
/// Gets a string token representing the current ViewModel, such as 'login' or 'user'.
|
||||
/// </summary>
|
||||
string UrlPathSegment { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The IScreen that this ViewModel is currently being shown in. This
|
||||
/// Gets the IScreen that this ViewModel is currently being shown in. This
|
||||
/// is usually passed into the ViewModel in the Constructor and saved
|
||||
/// as a ReadOnly Property.
|
||||
/// </summary>
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace ReactiveUI
|
|||
public interface IScreen
|
||||
{
|
||||
/// <summary>
|
||||
/// The Router associated with this Screen.
|
||||
/// Gets the Router associated with this Screen.
|
||||
/// </summary>
|
||||
RoutingState Router { get; }
|
||||
}
|
||||
|
|
|
@ -27,45 +27,45 @@ namespace ReactiveUI
|
|||
public interface ISuspensionHost : IReactiveObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Signals when the application is launching new. This can happen when
|
||||
/// Gets or sets the observable which signals when the application is launching new. This can happen when
|
||||
/// an app has recently crashed, as well as the first time the app has
|
||||
/// been launched. Apps should create their state from scratch.
|
||||
/// </summary>
|
||||
IObservable<Unit> IsLaunchingNew { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Signals when the application is resuming from suspended state (i.e.
|
||||
/// Gets or sets the observable which signals when the application is resuming from suspended state (i.e.
|
||||
/// it was previously running but its process was destroyed).
|
||||
/// </summary>
|
||||
IObservable<Unit> IsResuming { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Signals when the application is activated. Note that this may mean
|
||||
/// Gets or sets the observable which signals when the application is activated. Note that this may mean
|
||||
/// that your process was not actively running before this signal.
|
||||
/// </summary>
|
||||
IObservable<Unit> IsUnpausing { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Signals when the application should persist its state to disk.
|
||||
/// Gets or sets the observable which signals when the application should persist its state to disk.
|
||||
/// </summary>
|
||||
/// <value>Returns an IDisposable that should be disposed once the
|
||||
/// application finishes persisting its state.</value>
|
||||
IObservable<IDisposable> ShouldPersistState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Signals that the saved application state should be deleted, this
|
||||
/// Gets or sets the observable which signals that the saved application state should be deleted, this
|
||||
/// usually is called after an app has crashed.
|
||||
/// </summary>
|
||||
IObservable<Unit> ShouldInvalidateState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A method that can be used to create a new application state - usually
|
||||
/// Gets or sets a function that can be used to create a new application state - usually
|
||||
/// this method just calls 'new' on an object.
|
||||
/// </summary>
|
||||
Func<object> CreateNewAppState { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The current application state - get a typed version of this via
|
||||
/// Gets or sets the current application state - get a typed version of this via
|
||||
/// <see cref="SuspensionHostExtensions.GetAppState{T}(ISuspensionHost)"/>.
|
||||
/// The "application state" is a notion entirely defined
|
||||
/// via the client application - the framework places no restrictions on
|
||||
|
|
|
@ -28,6 +28,6 @@ namespace ReactiveUI
|
|||
/// Gets the sender which triggered the property changed event.
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
public TSender Sender { get; private set; }
|
||||
public TSender Sender { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,6 @@ namespace ReactiveUI
|
|||
/// Gets the sender which triggered the Reactive property changed event.
|
||||
/// </summary>
|
||||
/// <inheritdoc/>
|
||||
public TSender Sender { get; private set; }
|
||||
public TSender Sender { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#pragma warning disable SA1600 // Elements should be documented -- not used for legacy
|
||||
|
||||
namespace ReactiveUI.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -22,20 +20,55 @@ namespace ReactiveUI.Legacy
|
|||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
public interface IReactiveList<T> : IReactiveCollection<T>, IList<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the collection is empty.
|
||||
/// </summary>
|
||||
bool IsEmpty { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Adds a range of elements to the collection.
|
||||
/// </summary>
|
||||
/// <param name="collection">A collection of values to add.</param>
|
||||
void AddRange(IEnumerable<T> collection);
|
||||
|
||||
/// <summary>
|
||||
/// Inserts a range of elements to the collection at the specified index.
|
||||
/// </summary>
|
||||
/// <param name="index">The index to start adding the items to.</param>
|
||||
/// <param name="collection">A collection of values to add.</param>
|
||||
void InsertRange(int index, IEnumerable<T> collection);
|
||||
|
||||
/// <summary>
|
||||
/// Remove all the items contained within the specified collection.
|
||||
/// </summary>
|
||||
/// <param name="items">The items to remove.</param>
|
||||
void RemoveAll(IEnumerable<T> items);
|
||||
|
||||
/// <summary>
|
||||
/// Removes items contained at the starting index going to count.
|
||||
/// </summary>
|
||||
/// <param name="index">The index to start removing items from.</param>
|
||||
/// <param name="count">The number of items to remove.</param>
|
||||
void RemoveRange(int index, int count);
|
||||
|
||||
/// <summary>
|
||||
/// Sort the container using the specified comparer.
|
||||
/// </summary>
|
||||
/// <param name="comparer">The comparer to use to sort the list. If none is specified the default comparer will be used.</param>
|
||||
void Sort(IComparer<T> comparer = null);
|
||||
|
||||
/// <summary>
|
||||
/// Sort the container using the specified comparison method.
|
||||
/// </summary>
|
||||
/// <param name="comparison">The comparison type to use to sort the list.</param>
|
||||
void Sort(Comparison<T> comparison);
|
||||
|
||||
/// <summary>
|
||||
/// Sort the items based at the specified index for the number of items specified by the count.
|
||||
/// </summary>
|
||||
/// <param name="index">The index to start sorting at.</param>
|
||||
/// <param name="count">The count to sort.</param>
|
||||
/// <param name="comparer">The comparer to use to sort the list.</param>
|
||||
void Sort(int index, int count, IComparer<T> comparer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,69 +19,74 @@ namespace ReactiveUI.Legacy
|
|||
public interface IReactiveNotifyCollectionChanged<out T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Fires when items are added to the collection, once per item added.
|
||||
/// Gets an observable that signals when items are added to the collection, once per item added.
|
||||
/// Functions that add multiple items such AddRange should fire this
|
||||
/// multiple times. The object provided is the item that was added.
|
||||
/// </summary>
|
||||
IObservable<T> ItemsAdded { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires before an item is going to be added to the collection.
|
||||
/// Gets an observable that signals before an item is going to be added to the collection.
|
||||
/// </summary>
|
||||
IObservable<T> BeforeItemsAdded { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires once an item has been removed from a collection, providing the
|
||||
/// Gets an observable that signals once an item has been removed from a collection, providing the
|
||||
/// item that was removed.
|
||||
/// </summary>
|
||||
IObservable<T> ItemsRemoved { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires before an item will be removed from a collection, providing
|
||||
/// Gets an observable that signals before an item will be removed from a collection, providing
|
||||
/// the item that will be removed.
|
||||
/// </summary>
|
||||
IObservable<T> BeforeItemsRemoved { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires before an items moves from one position in the collection to
|
||||
/// Gets an observable that signals before an items moves from one position in the collection to
|
||||
/// another, providing the item(s) to be moved as well as source and destination
|
||||
/// indices.
|
||||
/// </summary>
|
||||
IObservable<IMoveInfo<T>> BeforeItemsMoved { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires once one or more items moves from one position in the collection to
|
||||
/// Gets an observable that signals once one or more items moves from one position in the collection to
|
||||
/// another, providing the item(s) that was moved as well as source and destination
|
||||
/// indices.
|
||||
/// </summary>
|
||||
IObservable<IMoveInfo<T>> ItemsMoved { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an observable that signals when the collection is changing.
|
||||
/// This Observable is equivalent to the NotifyCollectionChanged event,
|
||||
/// but fires before the collection is changed.
|
||||
/// </summary>
|
||||
IObservable<NotifyCollectionChangedEventArgs> Changing { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an observable that signals when the collection has changed.
|
||||
/// This Observable is equivalent to the NotifyCollectionChanged event,
|
||||
/// and fires after the collection is changed.
|
||||
/// </summary>
|
||||
IObservable<NotifyCollectionChangedEventArgs> Changed { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires when the collection count changes, regardless of reason.
|
||||
/// Gets an observable that signals when the collection count changes, regardless of reason.
|
||||
/// </summary>
|
||||
IObservable<int> CountChanging { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Fires when the collection count changes, regardless of reason.
|
||||
/// Gets an observable that signals when the collection count changes, regardless of reason.
|
||||
/// </summary>
|
||||
IObservable<int> CountChanged { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets an observable that signals when the collection has become empty or not.
|
||||
/// </summary>
|
||||
IObservable<bool> IsEmptyChanged { get; }
|
||||
|
||||
/// <summary>
|
||||
/// This Observable is fired when a ShouldReset fires on the collection. This
|
||||
/// Gets an observable that signals when a ShouldReset fires on the collection. This
|
||||
/// means that you should forget your previous knowledge of the state
|
||||
/// of the collection and reread it.
|
||||
///
|
||||
|
@ -90,6 +95,10 @@ namespace ReactiveUI.Legacy
|
|||
/// </summary>
|
||||
IObservable<Unit> ShouldReset { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Stops change notifications, and returns a disposable which when disposed will trigger a reset event.
|
||||
/// </summary>
|
||||
/// <returns>The disposable to use to turn back on notifications.</returns>
|
||||
IDisposable SuppressChangeNotifications();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,24 +15,21 @@ namespace ReactiveUI.Legacy
|
|||
public interface IReactiveNotifyCollectionItemChanged<out TSender>
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides Item Changing notifications for any item in collection that
|
||||
/// Gets an observable that signals when item changing notifications have occurred for any item in collection that
|
||||
/// implements IReactiveNotifyPropertyChanged. This is only enabled when
|
||||
/// ChangeTrackingEnabled is set to True.
|
||||
/// </summary>
|
||||
IObservable<IReactivePropertyChangedEventArgs<TSender>> ItemChanging { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides Item Changed notifications for any item in collection that
|
||||
/// Gets an observable that signals when item change notifications have occurred Item Changed notifications for any item in collection that
|
||||
/// implements IReactiveNotifyPropertyChanged. This is only enabled when
|
||||
/// ChangeTrackingEnabled is set to True.
|
||||
/// </summary>
|
||||
IObservable<IReactivePropertyChangedEventArgs<TSender>> ItemChanged { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Enables the ItemChanging and ItemChanged properties; when this is
|
||||
/// enabled, whenever a property on any object implementing
|
||||
/// IReactiveNotifyPropertyChanged changes, the change will be
|
||||
/// rebroadcast through ItemChanging/ItemChanged.
|
||||
/// Gets or sets a value indicating whether to track if contained items INotifyPropertyChanged events have been triggered.
|
||||
/// </summary>
|
||||
bool ChangeTrackingEnabled { get; set; }
|
||||
}
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
#pragma warning disable SA1600 // Elements should be documented -- not used for legacy
|
||||
|
||||
namespace ReactiveUI.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -22,6 +20,9 @@ namespace ReactiveUI.Legacy
|
|||
[Obsolete("ReactiveList is no longer supported. We suggest replacing it with DynamicData https://github.com/rolandpheasant/dynamicdata")]
|
||||
public interface IReadOnlyReactiveList<out T> : IReadOnlyReactiveCollection<T>, IReadOnlyList<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the list is empty.
|
||||
/// </summary>
|
||||
bool IsEmpty { get; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,10 @@ using System.Collections.Generic;
|
|||
|
||||
namespace ReactiveUI.Legacy
|
||||
{
|
||||
/// <summary>
|
||||
/// Information about a move between locations within a Reactive collection.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of item contained in the move.</typeparam>
|
||||
internal class MoveInfo<T> : IMoveInfo<T>
|
||||
{
|
||||
public MoveInfo(IEnumerable<T> movedItems, int from, int to)
|
||||
|
|
|
@ -26,6 +26,7 @@ using Splat;
|
|||
#pragma warning disable SA1100 // Do not use prefix -- not used for legacy
|
||||
#pragma warning disable SA1407 // Expression should declare precedence -- not used for legacy
|
||||
#pragma warning disable SA1402 // File many contain only single type -- not used for legacy
|
||||
#pragma warning disable SA1405 // Asset should provide message -- not used for legacy
|
||||
|
||||
namespace ReactiveUI.Legacy
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace ReactiveUI.Legacy
|
|||
CollectionChanged?.Invoke(this, ReplaceIfUnsupported(args));
|
||||
}
|
||||
|
||||
private NotifyCollectionChangedEventArgs ReplaceIfUnsupported(NotifyCollectionChangedEventArgs args)
|
||||
private static NotifyCollectionChangedEventArgs ReplaceIfUnsupported(NotifyCollectionChangedEventArgs args)
|
||||
{
|
||||
// see System.Windows.Data.ListCollectionView.ValidateCollectionChangedEventArgs
|
||||
switch (args.Action)
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
|
@ -21,6 +23,7 @@ namespace ReactiveUI
|
|||
/// Locator.Current.
|
||||
/// </summary>
|
||||
/// <param name="resolver">The resolver to initialize.</param>
|
||||
[SuppressMessage("Globalization", "CA1307: operator could change based on locale settings", Justification = "Replace() does not have third parameter on all platforms")]
|
||||
public static void InitializeReactiveUI(this IMutableDependencyResolver resolver)
|
||||
{
|
||||
var extraNs = new[]
|
||||
|
@ -36,10 +39,9 @@ namespace ReactiveUI
|
|||
|
||||
var fdr = typeof(DependencyResolverMixins);
|
||||
|
||||
var assmName = new AssemblyName(
|
||||
fdr.AssemblyQualifiedName.Replace(fdr.FullName + ", ", string.Empty));
|
||||
var assemblyName = new AssemblyName(fdr.AssemblyQualifiedName.Replace(fdr.FullName + ", ", string.Empty));
|
||||
|
||||
extraNs.ForEach(ns => ProcessRegistrationForNamespace(ns, assmName, resolver));
|
||||
extraNs.ForEach(ns => ProcessRegistrationForNamespace(ns, assemblyName, resolver));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -84,6 +86,7 @@ namespace ReactiveUI
|
|||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("Redundancy", "CA1801: Redundant parameter", Justification = "Used on some platforms")]
|
||||
private static Func<object> TypeFactory(TypeInfo typeInfo)
|
||||
{
|
||||
#if PORTABLE
|
||||
|
@ -94,6 +97,7 @@ namespace ReactiveUI
|
|||
#endif
|
||||
}
|
||||
|
||||
[SuppressMessage("Globalization", "CA1307: operator could change based on locale settings", Justification = "Replace() does not have third parameter on all platforms")]
|
||||
private static void ProcessRegistrationForNamespace(string ns, AssemblyName assemblyName, IMutableDependencyResolver resolver)
|
||||
{
|
||||
var targetType = ns + ".Registrations";
|
||||
|
@ -102,9 +106,9 @@ namespace ReactiveUI
|
|||
var registerTypeClass = Reflection.ReallyFindType(fullName, false);
|
||||
if (registerTypeClass != null)
|
||||
{
|
||||
var registerer = (IWantsToRegisterStuff)Activator.CreateInstance(registerTypeClass);
|
||||
registerer.Register((f, t) => resolver.RegisterConstant(f(), t));
|
||||
var registerer = (IWantsToRegisterStuff)Activator.CreateInstance(registerTypeClass);
|
||||
registerer.Register((f, t) => resolver.RegisterConstant(f(), t));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче