Re: GetHashCode and variable names given by VS Designer

From: Jeffrey Tan[MSFT] (v-jetan_at_online.microsoft.com)
Date: 11/29/04

  • Next message: MikeY: "Re: Reference & Resource, help needed"
    Date: Mon, 29 Nov 2004 09:27:06 GMT
    
    

    Hi LF,

    Thanks for your posting!!

    After trying your code snippet I have reproduced out this issue.

    I suspect that VS.net designer will store the CodeDOM references in
    hashtable, so when generating the reference, it will query the object's
    GetHashCode method. Because you apply the string.GetHashCode logic to the
    Test.GetHashCode method, designer will generate the same reference names
    for the Test items with the same string field.

    I think this behavior is by design. I am not sure why you use
    isComplete=false for InstanceDescriptor, your Test class has only one field
    "Data", so when use set it in Test's constructor, all the information for
    Test class is complete, isComplete=true for InstanceDescriptor is more
    suitable for this senario. And using isComplete=false for
    InstanceDescriptor will not have such problem in VS.net.

    If you have any other concern on this issue, please feel free to tell me.
    Thanks

    Best regards,
    Jeffrey Tan
    Microsoft Online Partner Support
    Get Secure! - www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.


  • Next message: MikeY: "Re: Reference & Resource, help needed"

    Relevant Pages

    • Re: Giving an application a window icon in a sensible way
      ... My mistake, then. ... that began with your posting a question and continued -- well, ... This was misinterpreted as suggesting I didn't make the first post. ... That sounded to me like a reference to a specific thread. ...
      (comp.lang.java.programmer)
    • Re: compiles as a form -- but not as a control
      ... reference MyObject ... I have a collection of controls that represent an address in my project. ... when I aggregated the controls and code into a VB user-control, the designer ... manager, CodeAssignStatement statement) ...
      (microsoft.public.dotnet.languages.vb)
    • Re: Aggregation vs composition
      ... >> reference to internal data. ... he can usually guarantee that the reference to the internal data ... Or must they both cooperate to ensure this? ... They must corporate in as much as the designer of A must document when it ...
      (comp.object)
    • RE: Excel 2007 cell reference problems
      ... Please also help me to capture somes screenshots to show the symptom in ... This posting is provided "AS IS" with no warranties, ... Excel 2007 cell reference problems ... | The physical cell can contain any number. ...
      (microsoft.public.office.misc)
    • RE: Calling VB.Net classes from VB6
      ... When you build your .NET dll, the compiler is actually creating two files. ... Your VB6 program will reference MyLibrary.tlb (which is a COM wrapper for ... reference that directly. ... This posting is provided "AS IS" with no warranties, ...
      (microsoft.public.dotnet.languages.vb)

    Loading