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. The Lounge
  3. Today I just rocked.

Today I just rocked.

Scheduled Pinned Locked Moved The Lounge
wpfwcfregex
5 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.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    var meth = binder.BindToMethod(BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Static, binder.GetMethodGroup(
    code.Namespaces[1].Types[0],
    "Bar",
    BindingFlags.NonPublic | BindingFlags.Static),
    ref args, null, System.Globalization.CultureInfo.CurrentCulture,null);
    Console.WriteLine(CodeDomUtility.ToString(meth));

    I implemented reflection binding over CodeDOM objects as though they were real types. I even support the #)(%*@)#% BindingFlags enumeration Above is just calling the stupid thing. You should see what the code to make it work looks like. What it does: say in your codedom you have

    class Foo
    {
    public int Bar(string foo)
    {
    Console.WriteLine(foo);
    return foo.GetHashCode();
    }
    public string Bar(int foo)
    {
    Console.WriteLine(foo);
    return foo.ToString();
    }
    }

    Based on a group of methods with the same name, and a set of arguments or types you give it, match the signature to what you passed in, and return the appropriate method that best matches the signature, including doing widening conversions on primitive types, and skipping type checking on null arguments. This is H-A-R-D But I did it. Woo. Does it for indexed properties as well. Gosh I never want to have to implement a binder again.

    When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

    M 1 Reply Last reply
    0
    • H honey the codewitch

      var meth = binder.BindToMethod(BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Static, binder.GetMethodGroup(
      code.Namespaces[1].Types[0],
      "Bar",
      BindingFlags.NonPublic | BindingFlags.Static),
      ref args, null, System.Globalization.CultureInfo.CurrentCulture,null);
      Console.WriteLine(CodeDomUtility.ToString(meth));

      I implemented reflection binding over CodeDOM objects as though they were real types. I even support the #)(%*@)#% BindingFlags enumeration Above is just calling the stupid thing. You should see what the code to make it work looks like. What it does: say in your codedom you have

      class Foo
      {
      public int Bar(string foo)
      {
      Console.WriteLine(foo);
      return foo.GetHashCode();
      }
      public string Bar(int foo)
      {
      Console.WriteLine(foo);
      return foo.ToString();
      }
      }

      Based on a group of methods with the same name, and a set of arguments or types you give it, match the signature to what you passed in, and return the appropriate method that best matches the signature, including doing widening conversions on primitive types, and skipping type checking on null arguments. This is H-A-R-D But I did it. Woo. Does it for indexed properties as well. Gosh I never want to have to implement a binder again.

      When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

      M Offline
      M Offline
      Maximilien
      wrote on last edited by
      #2

      honey the codewitch wrote:

      var meth = binder

      so, you're cooking, erm, coding meth ?

      I'd rather be phishing!

      H 1 Reply Last reply
      0
      • M Maximilien

        honey the codewitch wrote:

        var meth = binder

        so, you're cooking, erm, coding meth ?

        I'd rather be phishing!

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #3

        That's not even the worst of them. I've used die as short for delegate-invoke-expression recently. I've used f-c at least once that i can recall, p-s probably dozens more. :laugh: edited for forum rules

        When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

        Richard DeemingR 1 Reply Last reply
        0
        • H honey the codewitch

          That's not even the worst of them. I've used die as short for delegate-invoke-expression recently. I've used f-c at least once that i can recall, p-s probably dozens more. :laugh: edited for forum rules

          When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          I'm still impressed that someone at Microsoft managed to slip both PIDL and SHITEMID past their corporate overlords. :) Common Explorer Concepts (Windows) | Microsoft Docs[^]


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          H 1 Reply Last reply
          0
          • Richard DeemingR Richard Deeming

            I'm still impressed that someone at Microsoft managed to slip both PIDL and SHITEMID past their corporate overlords. :) Common Explorer Concepts (Windows) | Microsoft Docs[^]


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            H Offline
            H Offline
            honey the codewitch
            wrote on last edited by
            #5

            haha and I'm such a microsoftie i didn't even think anything of PIDL until you just said something.

            When I was growin' up, I was the smartest kid I knew. Maybe that was just because I didn't know that many kids. All I know is now I feel the opposite.

            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