Click here to Skip to main content
15,845,912 members
Home / Discussions / C#
   

C#

 
AnswerRe: Communicating with unmanaged DLL Pin
Midi_Mick17-Jan-17 4:19
professionalMidi_Mick17-Jan-17 4:19 
GeneralRe: Communicating with unmanaged DLL Pin
Member 1041441717-Jan-17 5:13
Member 1041441717-Jan-17 5:13 
AnswerRe: Communicating with unmanaged DLL Pin
Bernhard Hiller18-Jan-17 0:26
Bernhard Hiller18-Jan-17 0:26 
QuestionRe: Communicating with unmanaged DLL Pin
Member 1390693510-Jul-18 23:01
Member 1390693510-Jul-18 23:01 
QuestionGlade errors after launching debug Pin
Sascha Manns17-Jan-17 0:18
professionalSascha Manns17-Jan-17 0:18 
AnswerRe: Glade errors after launching debug [Solved] Pin
Sascha Manns17-Jan-17 6:41
professionalSascha Manns17-Jan-17 6:41 
QuestionImplementing Strategy Pattern Pin
Liagapi16-Jan-17 23:20
Liagapi16-Jan-17 23:20 
AnswerRe: Implementing Strategy Pattern Pin
Pete O'Hanlon16-Jan-17 23:46
subeditorPete O'Hanlon16-Jan-17 23:46 
The reason you can't access it is because you are passing in a Shape which does not have the relevant parameters because they are defined in the subclasses. If you know that you are passing in a certain type, then you just need to cast them before you try to access them. For instance, in the Circle strategy, your Calculate method could be converted to this:
C#
double Calculate(Shape shape)
{
  Circle circle = shape as Circle;
  if (circle == null)
  {
    throw new InvalidOperationException("You didn't pass in a circle");
  }
  return Math.Pow(circle.Radius, 2)* 3.14;
}

This space for rent

GeneralRe: Implementing Strategy Pattern Pin
Liagapi17-Jan-17 0:22
Liagapi17-Jan-17 0:22 
GeneralRe: Implementing Strategy Pattern Pin
harold aptroot17-Jan-17 0:05
harold aptroot17-Jan-17 0:05 
GeneralRe: Implementing Strategy Pattern Pin
Liagapi17-Jan-17 3:25
Liagapi17-Jan-17 3:25 
AnswerRe: Implementing Strategy Pattern Pin
F-ES Sitecore17-Jan-17 0:18
professionalF-ES Sitecore17-Jan-17 0:18 
GeneralRe: Implementing Strategy Pattern Pin
Liagapi17-Jan-17 0:28
Liagapi17-Jan-17 0:28 
GeneralRe: Implementing Strategy Pattern Pin
Bernhard Hiller18-Jan-17 0:21
Bernhard Hiller18-Jan-17 0:21 
AnswerRe: Implementing Strategy Pattern Pin
Gerry Schmitz17-Jan-17 6:48
mveGerry Schmitz17-Jan-17 6:48 
QuestionConvert DateTimeOffset to DateTime in Linq To Entities Pin
Kevin Marois16-Jan-17 14:18
professionalKevin Marois16-Jan-17 14:18 
AnswerRe: Convert DateTimeOffset to DateTime in Linq To Entities Pin
Pete O'Hanlon16-Jan-17 23:52
subeditorPete O'Hanlon16-Jan-17 23:52 
GeneralRe: Convert DateTimeOffset to DateTime in Linq To Entities Pin
Kevin Marois17-Jan-17 6:08
professionalKevin Marois17-Jan-17 6:08 
GeneralRe: Convert DateTimeOffset to DateTime in Linq To Entities Pin
Kevin Marois17-Jan-17 6:54
professionalKevin Marois17-Jan-17 6:54 
GeneralRe: Convert DateTimeOffset to DateTime in Linq To Entities Pin
Pete O'Hanlon17-Jan-17 6:56
subeditorPete O'Hanlon17-Jan-17 6:56 
GeneralRe: Convert DateTimeOffset to DateTime in Linq To Entities Pin
Kevin Marois17-Jan-17 6:57
professionalKevin Marois17-Jan-17 6:57 
AnswerRe: Convert DateTimeOffset to DateTime in Linq To Entities Pin
Richard Deeming17-Jan-17 3:34
mveRichard Deeming17-Jan-17 3:34 
GeneralRe: Convert DateTimeOffset to DateTime in Linq To Entities Pin
Kevin Marois17-Jan-17 6:19
professionalKevin Marois17-Jan-17 6:19 
GeneralRe: Convert DateTimeOffset to DateTime in Linq To Entities Pin
Richard Deeming17-Jan-17 9:29
mveRichard Deeming17-Jan-17 9:29 
QuestionShow checkbox check in the datagridview line Pin
abboudi_ammar16-Jan-17 11:53
abboudi_ammar16-Jan-17 11:53 

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.