Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-287588: Addendum To RSRP-275049 - Page_Load Event Method Not Being Placed Into Proper Region

$
0
0
Reporter Troy Kinsey (J9-500) Troy Kinsey (J9-500)
Created Jan 4, 2012 10:03:12 PM
Updated Jan 4, 2012 10:03:12 PM
Priority Normal
Type Unspecified
Fix versions No Fix versions
State Submitted
Assignee Unassigned
Subsystem No subsystem
Affected versions No Affected versions
Fixed in build No Fixed in build
I submitted a bug previously at http://youtrack.jetbrains.net/issue/RSRP-275049 that detailed how event handlers were not being placed into regions. I believe that this issue has been partially fixed in the official 6.1 release (Build 6.1.37.86). I tried reordering my code with the new ReSharper version and now I'm running into a related problem. The issue is that the Page_Load event handler is not being placed into the event handlers region. My click events and repeater events are being placed properly into an event handlers region, but not the page load. I'm going to include my type members layout xml and a sample web forms C# clip. Use my xml settings and then try to clean up the C# code. You'll notice that the page load method gets placed inside the protected methods region. Also, I noticed that the reordering operation takes a long time. You also might want to look into why it takes a long time to reorder the code.


<?xml version="1.0" encoding="utf-8" ?>

<!–
I. Overall

I.1 Each pattern can have <Match>....</Match> element. For the given type declaration, the pattern with the match, evaluated to 'true' with the largest weight, will be used
I.2 Each pattern consists of the sequence of <Entry>...</Entry> elements. Type member declarations are distributed between entries
I.3 If pattern has RemoveAllRegions="true" attribute, then all regions will be cleared prior to reordering. Otherwise, only auto-generated regions will be cleared
I.4 The contents of each entry is sorted by given keys (First key is primary, next key is secondary, etc). Then the declarations are grouped and en-regioned by given property

II. Available match operands

Each operand may have Weight="..." attribute. This weight will be added to the match weight if the operand is evaluated to 'true'.
The default weight is 1

II.1 Boolean functions:
II.1.1 <And>....</And>
II.1.2 <Or>....</Or>
II.1.3 <Not>....</Not>

II.2 Operands
II.2.1 <Kind Is="..."/>. Kinds are: class, struct, interface, enum, delegate, type, constructor, destructor, property, indexer, method, operator, field, constant, event, member
II.2.2 <Name Is="..." [IgnoreCase="true/false"] />. The 'Is' attribute contains regular expression
II.2.3 <HasAttribute CLRName="..." [Inherit="true/false"] />. The 'CLRName' attribute contains regular expression
II.2.4 <Access Is="..."/>. The 'Is' values are: public, protected, internal, protected internal, private
II.2.5 <Static/>
II.2.6 <Abstract/>
II.2.7 <Virtual/>
II.2.8 <Override/>
II.2.9 <Sealed/>
II.2.10 <Readonly/>
II.2.11 <ImplementsInterface CLRName="..."/>. The 'CLRName' attribute contains regular expression
II.2.12 <HandlesEvent />
-->

<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">

    <!– My Pattern –>
    <Pattern RemoveAllRegions="true">

        <!– Delegates & Events –>
        <Entry>
            <Match>
                <Or>
                    <Kind Is="delegate"/>
                    <Kind Is="event"/>
                </Or>
            </Match>
            <Sort>
                <Kind Order="delegate event"/>
            </Sort>
            <Group Region="Delegates &amp; Events"/>
        </Entry>

        <!– Enumerations –>
        <Entry>
            <Match>
                <Kind Is="enum"/>
            </Match>
            <Sort>
                <Name/>
            </Sort>
            <Group Region="Enumerations"/>
        </Entry>

        <!– Constants –>
        <Entry>
            <Match>
                <And>
                    <Kind Is="field"/>
                    <Kind Is="constant"/>
                </And>
            </Match>
            <Sort>
                <Access Order="public internal protected-internal protected private"/>
                <Name/>
            </Sort>
            <Group Region="Constants"/>
        </Entry>

        <!– Instance Fields –>
        <Entry>
            <Match>
                <And>
                    <Kind Is="field"/>
                    <Not>
                        <Kind Is="constant"/>
                    </Not>
                </And>
            </Match>
            <Sort>
                <Access Order="public internal protected-internal protected private"/>
                <Readonly/>
                <Name/>
            </Sort>
            <Group Region="Fields"/>
        </Entry>

        <!– Indexers –>
        <Entry>
            <Match>
                <Kind Is="indexer"/>
            </Match>
            <Sort>
                <Name/>
            </Sort>
            <Group Region="Indexers"/>
        </Entry>

        <!– Properties –>
        <Entry>
            <Match>
                <Kind Is="property"/>
            </Match>
            <Sort>
                <Access Order="public internal protected-internal protected private"/>
                <Name/>
            </Sort>
            <Group Region="Properties"/>
        </Entry>

        <!– Constructors –>
        <Entry>
            <Match>
                <Kind Is="constructor"/>
            </Match>
            <Sort>
                <Static/>
                <Name/>
            </Sort>
            <Group Region="Constructors"/>
        </Entry>

        <!– Event Handlers –>
        <Entry>
            <Match>
                <And>
                    <Kind Is="method"/>
                    <HandlesEvent/>
                </And>
            </Match>
            <Sort>
                <Access Order="public internal protected-internal protected private"/>
                <Name/>
            </Sort>
            <Group Region="Event Handlers"/>
        </Entry>

        <!– Private Methods –>
        <Entry>
            <Match>
                <And>
                    <Kind Is="method"/>
                    <Access Is="private"/>
                </And>
            </Match>
            <Sort>
                <Name/>
            </Sort>
            <Group Region="Private Methods"/>
        </Entry>

        <!– Protected Methods –>
        <Entry>
            <Match>
                <And>
                    <Kind Is="method"/>
                    <Access Is="protected"/>
                    <Not>
                        <HandlesEvent/>
                    </Not>
                </And>
            </Match>
            <Sort>
                <Name/>
            </Sort>
            <Group Region="Protected Methods"/>
        </Entry>

        <!– Public Methods –>
        <Entry>
            <Match>
                <And>
                    <Kind Is="method"/>
                    <Access Is="public"/>
                </And>
            </Match>
            <Sort>
                <Name/>
            </Sort>
            <Group Region="Public Methods"/>
        </Entry>

        <!– Private Classes –>
        <Entry>
            <Match>
                <And>
                    <Kind Is="class"/>
                    <Access Is="private"/>
                </And>
            </Match>
            <Sort>
                <Name/>
            </Sort>
            <Group Region="Private Classes"/>
        </Entry>

        <!– All Other Members –>
        <Entry/>
    </Pattern>

</Patterns>



using System;
using System.Data;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Demo
{
    public partial class WebForm1 : Page
    {
        public string InitallySelectedProductIDs
        {
            get;
            set;
        }

        public string MarketSegmentDescription
        {
            get;
            set;
        }

        public string MarketSegmentGroupID
        {
            get;
            set;
        }

        public string SegmentID
        {
            get;
            set;
        }

        protected string GetClass(string id)
        {
            return string.Empty;
        }

        protected string GetVendorLogo(string logo, string name)
        {
            return string.Empty;
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void BtnAdvanceOptions_Click(object sender, EventArgs e)
        {
        }

        protected void productsRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
        }

        private bool AreEqual(DataTable previousResults, DataTable results)
        {
            return true;
        }

        private void LoadProductsByProductIDs()
        {
        }

        private void LoadProductsBySingleProduct()
        {
        }
    }
}

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>