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
C

cybertone

@cybertone
About
Posts
8
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • From the C# forum
    C cybertone

    I think, this code is a result of Reflector disassembling :-D

    The Weird and The Wonderful help csharp com data-structures tools

  • FTW?
    C cybertone

    By the way, C# compiler (with optimization option 'on') generates these IL instructions for set accessor:

    ldarg.0
    ldarg.1
    stfld bool <reference_to_local_field>
    ret

    ; so, at the C# level it whould be:

    this._<reference_to_local_field> = value;

    ; So, this construction is obviously needless :-D

    modified on Monday, January 19, 2009 1:56 AM

    The Weird and The Wonderful csharp ruby collaboration question

  • ToolStripMenuItem.Owner vs ContextMenuStrip
    C cybertone

    Yes... item.Owner isn't ContextMenuStrip - it's type is ToolStripDropDownMenu. :suss: Construction like item.OwnerItem.Owner is not comprehensible, because: 1) It works for 2 level menu only, not for 3+ 2) For first level it throws exception Certainly, it is possible to use construction like: ToolStripItem parent = item; while(parent.OwnerItem != null)    parent = parent.OwnerItem; ContextMenuStrip menu = (ContextMenuStrip)parent.Owner; ... but it looks not as it would be desirable.
    P.S. What for the reference to object which property item.Owner (on 2+ level) refers is necessary to me? :confused:

    .NET (Core and Framework) visual-studio help question

  • ToolStripMenuItem.Owner vs ContextMenuStrip
    C cybertone

    Yesterday i've received an interesting "feature"(or bug?). My form has context menu (ContextMenuStrip) with two levels: menuItem_1 -> menuItem_1_1 -> menuItem_1_2 menuItem_2 every menu item has Click event handler: void MenuItem_Click(object sender, EventArgs e) { ToolStripMenuItem item = (ToolStripMenuItem)sender; ContextMenuStrip menu = item.Owner as ContextMenuStrip; MessageBox.Show(menu == null ? "false" : "true"); } I've got: menuItem_1 click => true menuItem_1_1 click => false menuItem_1_2 click => false menuItem_2 click => true So, ToolStripMenuItem's Owner on 2+ level is not a ContextMenuStrip!!! :eek: Is it normal? I bet - not... And how I can receive the reference to the ContextMenuStrip to which the 2+ level menu item belongs? :confused:

    .NET (Core and Framework) visual-studio help question

  • Type conversion strange bug
    C cybertone

    Yesterday I've caught a very strange bug float a = 81.1666641F; float b = 18F; float c = 6.3166666F; float d = (a - b) / c; int e = (int)((a - b) / c); int f = (int)d; Console.WriteLine(d); Console.WriteLine(e); Console.WriteLine(f); -------------------------- OUTPUT: 10.0 9 10

    Clever Code help

  • Type conversion strange bug
    C cybertone

    Yesterday I've caught a very strange bug float a = 81.1666641F; float b = 18F; float c = 6.3166666F; float d = (a - b) / c; int e = (int)((a - b) / c); int f = (int)d; Console.WriteLine(d); Console.WriteLine(e); Console.WriteLine(f); -------------------------- OUTPUT: 10.0 9 10 :~

    .NET (Core and Framework) help

  • System.Reflection.Emit.EventBuilder
    C cybertone

    I haven't any problem with Emit technology, excepting EventBuilder class. It's simple to create an "event" as ilasm does (using delegate field, public methods add_* and remove_*)... but it isn't an event(Type.GetEvent(...) returns null)! EventBuilder perfoms three interesting methods - SetAddOnMethod, SetRemoveOnMethod and SetRaiseMethod. And... what's the methods body should be? ILasm way? If yes, how can I get a delegate field for EventBuilder based event?

    C# question

  • System.Reflection.Emit.EventBuilder
    C cybertone

    Does anybody know, how the System.Reflection.Emit.EventBuilder works? How can I define a simple event with it?

    C# 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