Click here to Skip to main content
16,006,845 members
Home / Discussions / C#
   

C#

 
GeneralRe: NotifyIcon text? Pin
sasdav24-Jul-02 10:29
sasdav24-Jul-02 10:29 
GeneralRe: NotifyIcon text? Pin
Eric Gunnerson (msft)24-Jul-02 10:57
Eric Gunnerson (msft)24-Jul-02 10:57 
GeneralRe: NotifyIcon text? Pin
sasdav25-Jul-02 2:32
sasdav25-Jul-02 2:32 
QuestionCorrect way to try-catch in foreach loop? Pin
leppie22-Jul-02 22:15
leppie22-Jul-02 22:15 
AnswerRe: Correct way to try-catch in foreach loop? Pin
James T. Johnson22-Jul-02 23:08
James T. Johnson22-Jul-02 23:08 
GeneralRe: Correct way to try-catch in foreach loop? Pin
leppie23-Jul-02 0:06
leppie23-Jul-02 0:06 
GeneralRe: Correct way to try-catch in foreach loop? Pin
James T. Johnson23-Jul-02 0:27
James T. Johnson23-Jul-02 0:27 
GeneralRe: Correct way to try-catch in foreach loop? Pin
leppie23-Jul-02 0:45
leppie23-Jul-02 0:45 
Thx, James

James T. Johnson wrote:
There is one problem you may run into; and that is if you want to actually execute DoStuff on instances of MyClass as well as instances of a class that inherits from MyClass.

Thats exactly what I ran into, but simplified the code when I posted (me bad).

So is / as should be used like:
class Player{}
class Dealer : Player {}
class Players : ArrayList {}

...

Players players = new Players();

void Method()
{
    foreach (Player player in players)
    {
        if (player is Dealer)
        {
            Dealer dealer = player as Dealer; 
            dealer.DoDealerStuff();
        }
    }
}


Seems to make alot more sense after writing it myself, dunno if the post is neccesary, but its here now Submit shall be clicked Smile | :) .

MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc
for more info. Big Grin | :-D
GeneralRe: Correct way to try-catch in foreach loop? Pin
James T. Johnson23-Jul-02 1:24
James T. Johnson23-Jul-02 1:24 
GeneralRe: Correct way to try-catch in foreach loop? Pin
jparsons23-Jul-02 1:46
jparsons23-Jul-02 1:46 
GeneralRe: Correct way to try-catch in foreach loop? Pin
leppie23-Jul-02 7:17
leppie23-Jul-02 7:17 
GeneralNon-client area of controls Pin
Kastro22-Jul-02 18:32
Kastro22-Jul-02 18:32 
GeneralProperty Grid without an object Pin
Luis Alonso Ramos22-Jul-02 14:43
Luis Alonso Ramos22-Jul-02 14:43 
GeneralRe: Property Grid without an object Pin
James T. Johnson22-Jul-02 17:54
James T. Johnson22-Jul-02 17:54 
GeneralRe: Property Grid without an object Pin
Luis Alonso Ramos22-Jul-02 18:55
Luis Alonso Ramos22-Jul-02 18:55 
GeneralRe: Property Grid without an object Pin
James T. Johnson22-Jul-02 23:16
James T. Johnson22-Jul-02 23:16 
GeneralRe: Property Grid without an object Pin
leppie22-Jul-02 20:40
leppie22-Jul-02 20:40 
GeneralRe: Property Grid without an object Pin
Luis Alonso Ramos24-Jul-02 5:53
Luis Alonso Ramos24-Jul-02 5:53 
GeneralRe: Property Grid without an object Pin
Nathan Blomquist24-Jul-02 6:32
Nathan Blomquist24-Jul-02 6:32 
GeneralRe: Property Grid without an object Pin
Luis Alonso Ramos24-Jul-02 7:32
Luis Alonso Ramos24-Jul-02 7:32 
GeneralRe: Property Grid without an object Pin
Luis Alonso Ramos24-Jul-02 9:49
Luis Alonso Ramos24-Jul-02 9:49 
GeneralRe: Property Grid without an object Pin
Nathan Blomquist24-Jul-02 10:14
Nathan Blomquist24-Jul-02 10:14 
GeneralRe: Property Grid without an object Pin
Luis Alonso Ramos24-Jul-02 10:48
Luis Alonso Ramos24-Jul-02 10:48 
QuestionWhat override when the control is added? Pin
Zombies with Coffee, LLC22-Jul-02 11:04
professionalZombies with Coffee, LLC22-Jul-02 11:04 
AnswerRe: What override when the control is added? Pin
James T. Johnson22-Jul-02 13:35
James T. Johnson22-Jul-02 13:35 

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.