Click here to Skip to main content
15,884,176 members
Home / Discussions / C#
   

C#

 
GeneralCrystal Reports and Sql Server 2000 Pin
obelisk298-Jan-04 12:34
obelisk298-Jan-04 12:34 
GeneralRe: Crystal Reports and Sql Server 2000 Pin
Heath Stewart8-Jan-04 12:46
protectorHeath Stewart8-Jan-04 12:46 
GeneralRe: Crystal Reports and Sql Server 2000 Pin
obelisk298-Jan-04 13:01
obelisk298-Jan-04 13:01 
GeneralRe: Crystal Reports and Sql Server 2000 Pin
Heath Stewart8-Jan-04 13:11
protectorHeath Stewart8-Jan-04 13:11 
GeneralRe: Crystal Reports and Sql Server 2000 Pin
obelisk298-Jan-04 13:20
obelisk298-Jan-04 13:20 
GeneralRe: Crystal Reports and Sql Server 2000 Pin
obelisk298-Jan-04 14:10
obelisk298-Jan-04 14:10 
GeneralRe: Crystal Reports and Sql Server 2000 Pin
obelisk298-Jan-04 14:30
obelisk298-Jan-04 14:30 
GeneralDynamic Casting for use in Polymorphic/overloaded methods. Pin
Scott Barr8-Jan-04 11:12
Scott Barr8-Jan-04 11:12 
Here is a code example of what I want to do.

<br />
        //Method that makes the polymorphic call.<br />
        private void AdminTree_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)<br />
        {   <br />
                this.DisplayProperties( e.Node );<br />
        }<br />
<br />
        //Default polymorpic/overloaded function<br />
        private void DisplayProperties( object inNode )<br />
        {<br />
            //Do Nothing.<br />
        }<br />
<br />
        //Polymorpic/overloaded function to take care of Question Nodes<br />
        private void DisplayProperties( QuestionNode inNode )<br />
        {<br />
            this.PropertiesGroupBox.Controls.Clear();<br />
<br />
            //Deal with all Question QuestionNode properties from the Question data model.<br />
            this.QuestionPropertiesControl.QuestionText.Text = inNode.QuestionData.Question;<br />
            this.QuestionPropertiesControl.AnswserType.Text = inNode.QuestionData.CatalogAnswerType.AnswerTypeName;<br />
            this.QuestionPropertiesControl.Status.Text = inNode.QuestionData.Status;<br />
            this.QuestionPropertiesControl.Dock = System.Windows.Forms.DockStyle.Fill;<br />
<br />
            this.PropertiesGroupBox.Controls.Add( this.QuestionPropertiesControl );            <br />
        }<br />
<br />
        //Polymorpic/overloaded function to take care of CatalogNodes<br />
        private void DisplayProperties( CatalogNode inNode )<br />
        {<br />
            this.PropertiesGroupBox.Controls.Clear();<br />
<br />
            //Deal with all CatalogNode properties from the Catalog data model.<br />
            this.CatalogPropertiesControl.CatalogName.Text   = inNode.CatalogData.Name;<br />
            this.CatalogPropertiesControl.DisplayText.Text   = inNode.CatalogData.ViewName;<br />
            this.CatalogPropertiesControl.Status.Text        = inNode.CatalogData.Status;<br />
            this.CatalogPropertiesControl.Dock = System.Windows.Forms.DockStyle.Fill;<br />
<br />
            this.PropertiesGroupBox.Controls.Add( this.CatalogPropertiesControl );     <br />
            <br />
        }<br />


I currently have AdminTree_AfterSelect written as follows. It works but I was wondering if anyone had any ideas on a cleaner way of doing it. Smile | :)

<br />
        private void AdminTree_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)<br />
        {   <br />
            if( e.Node is QuestionNode )<br />
            {<br />
                this.DisplayProperties( e.Node as QuestionNode );<br />
            }<br />
            else if( e.Node is CatalogNode )<br />
            {<br />
                this.DisplayProperties( e.Node as CatalogNode );<br />
            }<br />
        }<br />


Thanks in advance!
GeneralRe: Dynamic Casting for use in Polymorphic/overloaded methods. Pin
Heath Stewart8-Jan-04 11:50
protectorHeath Stewart8-Jan-04 11:50 
GeneralRe: Dynamic Casting for use in Polymorphic/overloaded methods. Pin
Scott Barr9-Jan-04 4:42
Scott Barr9-Jan-04 4:42 
GeneralRe: Dynamic Casting for use in Polymorphic/overloaded methods. Pin
Heath Stewart9-Jan-04 5:15
protectorHeath Stewart9-Jan-04 5:15 
GeneralRe: Dynamic Casting for use in Polymorphic/overloaded methods. Pin
Scott Barr9-Jan-04 5:30
Scott Barr9-Jan-04 5:30 
GeneralType convertion and Unmanaged code Pin
Shahin778-Jan-04 10:48
Shahin778-Jan-04 10:48 
GeneralRe: Type convertion and Unmanaged code Pin
Heath Stewart8-Jan-04 11:39
protectorHeath Stewart8-Jan-04 11:39 
GeneralRe: Type convertion and Unmanaged code Pin
Shahin778-Jan-04 11:52
Shahin778-Jan-04 11:52 
GeneralRe: Type convertion and Unmanaged code Pin
Heath Stewart8-Jan-04 12:16
protectorHeath Stewart8-Jan-04 12:16 
GeneralRe: Type convertion and Unmanaged code Pin
Heath Stewart8-Jan-04 12:37
protectorHeath Stewart8-Jan-04 12:37 
GeneralRe: Type convertion and Unmanaged code Pin
Shahin778-Jan-04 14:15
Shahin778-Jan-04 14:15 
GeneralStartup Switch Options ... Pin
Daniel Negron8-Jan-04 10:08
Daniel Negron8-Jan-04 10:08 
GeneralRe: Startup Switch Options ... Pin
Niels Penneman8-Jan-04 10:43
Niels Penneman8-Jan-04 10:43 
GeneralRe: Startup Switch Options ... Pin
Heath Stewart8-Jan-04 11:34
protectorHeath Stewart8-Jan-04 11:34 
GeneralWriting CD/DVD Pin
Christian Graus8-Jan-04 9:37
protectorChristian Graus8-Jan-04 9:37 
GeneralRe: Writing CD/DVD Pin
Mazdak8-Jan-04 9:55
Mazdak8-Jan-04 9:55 
GeneralRe: Writing CD/DVD Pin
Christian Graus8-Jan-04 9:59
protectorChristian Graus8-Jan-04 9:59 
GeneralRe: Writing CD/DVD Pin
Kentamanos8-Jan-04 10:25
Kentamanos8-Jan-04 10:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.