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
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. What a fright!!

What a fright!!

Scheduled Pinned Locked Moved The Weird and The Wonderful
regexquestiondiscussion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • _ Offline
    _ Offline
    _Erik_
    wrote on last edited by
    #1

    Found this in the daily WTF.

    private IAlertDocument CompareObjectAsIAlertDocumentOrNullIfNotCastable(object compareObject) {
    return compareObject as IAlertDocument;
    }

    What do you think? I can follow this pattern:

    string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj)
    {
    return obj.ToString();
    }

    F D 2 Replies Last reply
    0
    • _ _Erik_

      Found this in the daily WTF.

      private IAlertDocument CompareObjectAsIAlertDocumentOrNullIfNotCastable(object compareObject) {
      return compareObject as IAlertDocument;
      }

      What do you think? I can follow this pattern:

      string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj)
      {
      return obj.ToString();
      }

      F Offline
      F Offline
      fjdiewornncalwe
      wrote on last edited by
      #2

      _Erik_ wrote:

      string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj) { return obj.ToString(); }

      You forgot part of the method name... It should be... GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObjectAsLongAsTheObjectIsNotNull

      I wasn't, now I am, then I won't be anymore.

      _ 1 Reply Last reply
      0
      • F fjdiewornncalwe

        _Erik_ wrote:

        string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj) { return obj.ToString(); }

        You forgot part of the method name... It should be... GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObjectAsLongAsTheObjectIsNotNull

        I wasn't, now I am, then I won't be anymore.

        _ Offline
        _ Offline
        _Erik_
        wrote on last edited by
        #3

        Damn it!! I thought I could follow the pattern!! :thumbsup:

        1 Reply Last reply
        0
        • _ _Erik_

          Found this in the daily WTF.

          private IAlertDocument CompareObjectAsIAlertDocumentOrNullIfNotCastable(object compareObject) {
          return compareObject as IAlertDocument;
          }

          What do you think? I can follow this pattern:

          string GetAStringThatRepresentsTheObjectPassedAsAnObjectParameterSoItWorksForAnyObject(object obj)
          {
          return obj.ToString();
          }

          D Offline
          D Offline
          Dwayne J Baldwin
          wrote on last edited by
          #4

          Throw new UserFellAsleepAtTheKeyboardException(me)

          Dwayne J. Baldwin

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

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