Click here to Skip to main content
15,505,126 members
Home / Discussions / C#
   

C#

 
GeneralRe: Accessing one of many possible objects passed to a function Pin
TNCaver17-Apr-22 12:16
TNCaver17-Apr-22 12:16 
AnswerRe: Accessing one of many possible objects passed to a function Pin
Mycroft Holmes16-Apr-22 13:56
professionalMycroft Holmes16-Apr-22 13:56 
GeneralRe: Accessing one of many possible objects passed to a function Pin
TNCaver17-Apr-22 12:18
TNCaver17-Apr-22 12:18 
AnswerClarification Pin
TNCaver17-Apr-22 12:14
TNCaver17-Apr-22 12:14 
GeneralRe: Clarification Pin
Mycroft Holmes17-Apr-22 13:10
professionalMycroft Holmes17-Apr-22 13:10 
GeneralRe: Clarification Pin
TNCaver17-Apr-22 15:16
TNCaver17-Apr-22 15:16 
GeneralRe: Clarification Pin
Richard Deeming18-Apr-22 22:56
mveRichard Deeming18-Apr-22 22:56 
AnswerRe: Accessing one of many possible objects passed to a function Pin
Gerry Schmitz18-Apr-22 6:31
mveGerry Schmitz18-Apr-22 6:31 
string s1, s2;

if ( unknownClass is MyBase myBase ) {

   s1 = myBase.CommonProperty;

   if ( unknownClass is ClassOne one ) {
      s2 = one.ClassOneProperty;

   } else if ( unknownClass is ClassTwo two ) {
      s2 = two.ClassTwoProperty;
   }
}      


"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I

QuestionHow to trigger an event with a COM port? Pin
Member 1405587913-Apr-22 3:10
Member 1405587913-Apr-22 3:10 
AnswerRe: How to trigger an event with a COM port? Pin
Ralf Meier13-Apr-22 3:47
mveRalf Meier13-Apr-22 3:47 
AnswerRe: How to trigger an event with a COM port? Pin
OriginalGriff13-Apr-22 3:48
mveOriginalGriff13-Apr-22 3:48 
AnswerRe: How to trigger an event with a COM port? Pin
Raphael Adeniji13-Apr-22 12:31
Raphael Adeniji13-Apr-22 12:31 
QuestionNeed help advice Pin
hardsoft11-Apr-22 19:06
hardsoft11-Apr-22 19:06 
AnswerRe: Need help advice Pin
Gerry Schmitz12-Apr-22 5:59
mveGerry Schmitz12-Apr-22 5:59 
GeneralRe: Need help advice Pin
hardsoft12-Apr-22 14:25
hardsoft12-Apr-22 14:25 
GeneralRe: Need help advice Pin
Gerry Schmitz12-Apr-22 14:41
mveGerry Schmitz12-Apr-22 14:41 
GeneralRe: Need help advice Pin
hardsoft12-Apr-22 15:04
hardsoft12-Apr-22 15:04 
QuestionProblem to read Com port with while loop? Pin
Member 1405587911-Apr-22 1:55
Member 1405587911-Apr-22 1:55 
AnswerRe: Problem to read Com port with while loop? Pin
OriginalGriff11-Apr-22 2:28
mveOriginalGriff11-Apr-22 2:28 
AnswerRe: Problem to read Com port with while loop? Pin
Raphael Adeniji11-Apr-22 3:39
Raphael Adeniji11-Apr-22 3:39 
AnswerRe: Problem to read Com port with while loop? Pin
Luc Pattyn11-Apr-22 13:21
sitebuilderLuc Pattyn11-Apr-22 13:21 
QuestionMigrating Web Applications (Web Forms) to Dot Net Core Blazor Applications Pin
Raphael Adeniji10-Apr-22 20:44
Raphael Adeniji10-Apr-22 20:44 
AnswerRe: Migrating Web Applications (Web Forms) to Dot Net Core Blazor Applications Pin
Richard MacCutchan10-Apr-22 22:28
mveRichard MacCutchan10-Apr-22 22:28 
GeneralRe: Migrating Web Applications (Web Forms) to Dot Net Core Blazor Applications Pin
Raphael Adeniji11-Apr-22 3:28
Raphael Adeniji11-Apr-22 3:28 
GeneralRe: Migrating Web Applications (Web Forms) to Dot Net Core Blazor Applications Pin
Richard MacCutchan11-Apr-22 7:06
mveRichard MacCutchan11-Apr-22 7:06 

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.