Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Murray Roke 503 posts 966 karma points c-trib
    Oct 31, 2011 @ 04:15
    Murray Roke
    0

    Feature Suggestion make DocumentTypeBase.NodeTypeAlias property static

    Then I could have:

    DocumentType.GetByAlias(DocTypes.LinkToOrigin.NodeTypeAlias)

    Rather than:

    DocumentType.GetByAlias((new DocTypes.LinkToOrigin()).NodeTypeAlias)

    There could be other static methods to make document creation easier.

  • Vladan Ostojic 94 posts 210 karma points
    Oct 31, 2011 @ 13:09
    Vladan Ostojic
    0

    Hi Murray,

    Thanks for suggestion. However, it is not possible to implement it exactly as you proposed - static member will be defined in a base class so it would be shared between all instances for different document types. It is also not possible to use reflection in base class static member to get these details.

    So instead we'll make a method like this:

    static string GetDocumentTypeAlias(Type documentType)

    so you'll be able to use it as following:

    GetDocumentTypeAlias(typeof(MyDocumentType));

    (I'm not sure yet where exactly we'll put that method)

  • Murray Roke 503 posts 966 karma points c-trib
    Oct 31, 2011 @ 22:58
    Murray Roke
    0

    Sounds good, but if it doesn't fit in somewhere neatly, don't force it, just leave it out :-)

Please Sign in or register to post replies

Write your reply to:

Draft