Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

jofli

@jofli
About
Posts
8
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • \r\n
    J jofli

    PIEBALDconsult wrote:

    jofli wrote: Recieved And maybe didn't graduate high school either? Big Grin

    http://www.recieved.co.uk/[^] Well, at least he tried to use English namings. And I must admit that sometimes it's not that easy, if you're not a native speaker.

    The Weird and The Wonderful ruby

  • \r\n
    J jofli

    That's right, but afaik he only codes c#.

    The Weird and The Wonderful ruby

  • \r\n
    J jofli

    Reflector showed me this 'gem' in a contractors project:

    string cBRK = Convert.ToChar(int.Parse("13")).ToString() + Convert.ToChar(int.Parse("10")).ToString();

    this.ReportStatus("93101Bytes" + cBRK + BytesRecieved.ToString() + cBRK + fileSize.ToString() + cBRK);

    kind regards, JoFli

    The Weird and The Wonderful ruby

  • Override virtual or abstracts with derived return types
    J jofli

    I like this solution! Even if i tried to avoid doing a cast, this one seems elegant to me. Thank You for that. But i'm still curious why this (OP) is not allowed ...

    C# csharp question

  • Override virtual or abstracts with derived return types
    J jofli

    I'm facing this problem in several situations and i'm pretty sure this is an architectural question. This would be a good sample: There is a mask with a persons list and some search fields. I have a ViewModel class which provides the data (List) and the filter object (PersonFilter) where the search fields are bound to (WPF). Later i want to build a customers mask. Where the Customer class is an extension of Person and the CustomerFilter an extension PersonFilter. So i would love to extend my ViewModel, but i cannot override my Filter Property. Even if i'm sure that there won't be a solution, which let me do it this way. I thought it is time time to ask here. Thanks and regards, Johannes

    C# csharp question

  • Override virtual or abstracts with derived return types
    J jofli

    Hi Rahul, thanks! I understand that i'm not allowed to change the return type. But i thought it should be allowed to extend it. So from the perspective of 'Class_a' the return type will always be "Stream". I know that i could use 'new' instead of 'override', but that wouldn't be the same and won't work with abstracts. This rule doesn't make sense to me. regards, Johannes

    C# csharp question

  • Override virtual or abstracts with derived return types
    J jofli

    Have you found any elegant solution for this?

    C# csharp question

  • Override virtual or abstracts with derived return types
    J jofli

    Hi all, maybe someone can explain me, why this doesn't work in C#. Do i missed something, or is it a stupid idea to extend a return type of an override?

    public class Class_a
    {
    Stream _something;

        public virtual Stream Property
        {
            get
            {
                return \_something; 
            }
            set
            {
                \_something = value; 
            }
        }
    }
    
    public class Class\_b : Class\_a
    {
        FileStream \_something;
        
        public override FileStream Property
        {
            get
            {
                return \_something;
            }
            set
            {
                \_something = value;
            }
        }
    }
    

    Thanks & Regards, Johannes

    C# csharp question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups