Click here to Skip to main content
15,918,808 members
Home / Discussions / C#
   

C#

 
GeneralRe: playing rmvb videos using csharp.net Pin
zumty17-Aug-08 20:48
zumty17-Aug-08 20:48 
QuestionNeed advice on light weight database-like design Pin
DeepToot17-Aug-08 13:37
DeepToot17-Aug-08 13:37 
AnswerRe: Need advice on light weight database-like design Pin
N a v a n e e t h17-Aug-08 19:40
N a v a n e e t h17-Aug-08 19:40 
QuestionCheck if form is open? Pin
Arcdigital17-Aug-08 11:37
Arcdigital17-Aug-08 11:37 
AnswerRe: Check if form is open? Pin
lisan_al_ghaib17-Aug-08 12:37
lisan_al_ghaib17-Aug-08 12:37 
AnswerRe: Check if form is open? another way Pin
Natza Mitzi17-Aug-08 13:45
Natza Mitzi17-Aug-08 13:45 
QuestionCasting from a Base to Derived Class Pin
Jammer17-Aug-08 8:21
Jammer17-Aug-08 8:21 
AnswerRe: Casting from a Base to Derived Class Pin
Pete O'Hanlon17-Aug-08 8:34
mvePete O'Hanlon17-Aug-08 8:34 
Here's a sample to play around with. The derivation works fine with this.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestDerivation
{
  class Program
  {
    static void Main(string[] args)
    {
      List<BaseClass> list = new List<BaseClass>();
      list.Add(new BaseClass { Id = 1 });
      list.Add(new Derived { Id = 2, Name = "Jammer" });
      foreach (BaseClass item in list)
      {
        if (item is Derived)
        {
          Derived derived = item as Derived;
          Console.WriteLine("{0} {1}", derived.Id, derived.Name);
        }
        else
        {
          Console.WriteLine("{0}", item.Id);
        }
      }
      Console.Read();
    }
  }
  public class BaseClass
  {
    public int Id { get; set; }
  }
  public class Derived : BaseClass
  {
    public string Name { get; set; }
  }
}


Deja View - the feeling that you've seen this post before.

My blog | My articles



AnswerRe: Casting from a Base to Derived Class Pin
Wendelius17-Aug-08 8:37
mentorWendelius17-Aug-08 8:37 
GeneralRe: Casting from a Base to Derived Class Pin
Jammer17-Aug-08 9:25
Jammer17-Aug-08 9:25 
GeneralRe: Casting from a Base to Derived Class Pin
Jammer17-Aug-08 9:30
Jammer17-Aug-08 9:30 
GeneralRe: Casting from a Base to Derived Class Pin
Wendelius17-Aug-08 9:52
mentorWendelius17-Aug-08 9:52 
GeneralRe: Casting from a Base to Derived Class Pin
Jammer17-Aug-08 10:15
Jammer17-Aug-08 10:15 
GeneralRe: Casting from a Base to Derived Class Pin
Wendelius17-Aug-08 10:17
mentorWendelius17-Aug-08 10:17 
QuestionHow to Bind combobox to Datatable coloums in connected mode??(Windows application) Pin
rahul2117-Aug-08 6:00
rahul2117-Aug-08 6:00 
AnswerRe: How to Bind combobox to Datatable coloums in connected mode??(Windows application) Pin
Manas Bhardwaj17-Aug-08 6:40
professionalManas Bhardwaj17-Aug-08 6:40 
AnswerRe: How to Bind combobox to Datatable coloums in connected mode??(Windows application) Pin
N a v a n e e t h17-Aug-08 7:04
N a v a n e e t h17-Aug-08 7:04 
QuestionSendKeys and ^ Pin
Dominik Reichl17-Aug-08 2:16
Dominik Reichl17-Aug-08 2:16 
AnswerRe: SendKeys and ^ Pin
Wendelius17-Aug-08 3:04
mentorWendelius17-Aug-08 3:04 
QuestionRe: SendKeys and ^ Pin
Dominik Reichl17-Aug-08 3:59
Dominik Reichl17-Aug-08 3:59 
AnswerRe: SendKeys and ^ Pin
Wendelius17-Aug-08 4:31
mentorWendelius17-Aug-08 4:31 
QuestionImplementing IDisposable in Sealed class Pin
Blumen17-Aug-08 0:48
Blumen17-Aug-08 0:48 
AnswerRe: Implementing IDisposable in Sealed class Pin
Colin Angus Mackay17-Aug-08 0:59
Colin Angus Mackay17-Aug-08 0:59 
GeneralRe: Implementing IDisposable in Sealed class Pin
Blumen17-Aug-08 1:30
Blumen17-Aug-08 1:30 
GeneralRe: Implementing IDisposable in Sealed class Pin
Colin Angus Mackay17-Aug-08 2:03
Colin Angus Mackay17-Aug-08 2:03 

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.