Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <CustomPatterns>
- <Pattern Severity="WARNING">
- <Comment>Maybe not intended object identity comparision use object.Equals instead.</Comment>
- <ReplaceComment>replace with object.Equals()</ReplaceComment>
- <ReplacePattern>object.Equals( $objex$, $objeder$ )</ReplacePattern>
- <SearchPattern><![CDATA[$objex$ == $objeder$
- ]]></SearchPattern>
- <Params />
- <Placeholders>
- <ExpressionPlaceholder Name="objex" ExpressionType="System.Object" ExactType="True" />
- <ExpressionPlaceholder Name="objeder" ExpressionType="System.Object" ExactType="False" />
- </Placeholders>
- </Pattern>
- <Pattern Severity="HINT">
- <Comment>As cast + if==null to static cast</Comment>
- <ReplaceComment>to static cast</ReplaceComment>
- <ReplacePattern><![CDATA[var $var$ = ($type$)$objex$;
- $block$]]></ReplacePattern>
- <SearchPattern><![CDATA[$type$ $var$ = $objex$ as $type$;
- if( $var$ != null )
- {
- $block$
- }
- ]]></SearchPattern>
- <Params />
- <Placeholders>
- <ExpressionPlaceholder Name="objex" ExpressionType="" ExactType="False" />
- <IdentifierPlaceholder Name="var" Type="" ExactType="False" RegEx="" CaseSensitive="True" />
- <StatementPlaceholder Name="block" Minimal="1" Maximal="-1" />
- <TypePlaceholder Name="type" Type="" ExactType="True" />
- </Placeholders>
- </Pattern>
- <Pattern Severity="HINT">
- <Comment>Static cast can be written as "as-Cast with if==null"</Comment>
- <ReplaceComment>to "as-Cast mit if==null"</ReplaceComment>
- <ReplacePattern><![CDATA[$type$ $var$ = $objex$ as $type$;
- if( $var$ != null )
- {
- $block$
- }
- ]]></ReplacePattern>
- <SearchPattern><![CDATA[var $var$ = ($type$)$objex$;
- $block$
- ]]></SearchPattern>
- <Params />
- <Placeholders>
- <ExpressionPlaceholder Name="objex" ExpressionType="" ExactType="True" />
- <IdentifierPlaceholder Name="var" Type="" ExactType="False" RegEx="" CaseSensitive="True" />
- <StatementPlaceholder Name="block" Minimal="1" Maximal="-1" />
- <TypePlaceholder Name="type" Type="" ExactType="True" />
- </Placeholders>
- </Pattern>
- </CustomPatterns>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement