﻿<?xml version="1.0" encoding="utf-8"?><Type Name="DoNotLockOnWeakIdentityObjectsRule" FullName="Gendarme.Rules.Concurrency.DoNotLockOnWeakIdentityObjectsRule"><TypeSignature Language="C#" Value="public class DoNotLockOnWeakIdentityObjectsRule : Gendarme.Rules.Concurrency.LockAnalyzerRule" /><TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit DoNotLockOnWeakIdentityObjectsRule extends Gendarme.Rules.Concurrency.LockAnalyzerRule" /><AssemblyInfo><AssemblyName>Gendarme.Rules.Concurrency</AssemblyName><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><Base><BaseTypeName>Gendarme.Rules.Concurrency.LockAnalyzerRule</BaseTypeName></Base><Interfaces /><Attributes><Attribute><AttributeName>Gendarme.Framework.FxCopCompatibility("Microsoft.Reliability", "CA2002:DoNotLockOnObjectsWithWeakIdentity")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Problem("This method uses a lock on an object with weak identity, i.e. one that is directly accessible across application domains.")</AttributeName></Attribute><Attribute><AttributeName>Gendarme.Framework.Solution("To be safe it is important to lock on an object that is private to your code.")</AttributeName></Attribute></Attributes><Docs><summary>
            This rule ensures there are no locks on objects with weak identity.
            An object with weak identity is one that can be directly accessed across
            different application domains. Because these objects can be accessed
            by different application domains it is very difficult to ensure that the
            locking is done correctly so problems such as deadlocks are much more likely.
            The following types have a weak identities:
            <list type="bullet"><item><description><c>System.MarshalByRefObject</c></description></item><item><description><c>System.OutOfMemoryException</c></description></item><item><description><c>System.Reflection.MemberInfo</c></description></item><item><description><c>System.Reflection.ParameterInfo</c></description></item><item><description><c>System.ExecutionEngineException</c></description></item><item><description><c>System.StackOverflowException</c></description></item><item><description><c>System.String</c></description></item><item><description><c>System.Threading.Thread</c></description></item></list></summary><remarks>To be added.</remarks><example>
            Bad example:
            <code>
            public void WeakIdLocked ()
            {
            	lock ("CustomString") {
            		// ...
            	}
            }
            </code></example><example>
            Good example:
            <code>
            public void WeakIdNotLocked ()
            {
            	Phone phone = new Phone ();
            lock (phone) {
            		// ...
            }
            }
            </code></example></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public DoNotLockOnWeakIdentityObjectsRule ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><Parameters /><Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Analyze"><MemberSignature Language="C#" Value="public override void Analyze (Mono.Cecil.MethodDefinition method, Mono.Cecil.MethodReference enter, Mono.Cecil.Cil.Instruction ins);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Analyze(class Mono.Cecil.MethodDefinition method, class Mono.Cecil.MethodReference enter, class Mono.Cecil.Cil.Instruction ins) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>3.10.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="method" Type="Mono.Cecil.MethodDefinition" /><Parameter Name="enter" Type="Mono.Cecil.MethodReference" /><Parameter Name="ins" Type="Mono.Cecil.Cil.Instruction" /></Parameters><Docs><param name="method">To be added.</param><param name="enter">To be added.</param><param name="ins">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member></Members></Type>