This message was discovered on ASPFriends.com 'aspngcontrolscs' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| Jesse Liberty (VIP) |
I'm translating working code from C# to VB.NET. In C# I have this:
[ControlBuilderAttribute(typeof(BookCounterBuilder)),ParseChildren(false)] public class BookInquiryList : System.Web.UI.WebControls.WebControl, INamingContainer
How do I translate this to VB.NET (which does not have a typeOf operator?
Here is Book?CounterBuilder in C#:
internal class BookCounterBuilder : ControlBuilder { public override Type GetChildControlType( string tagName, IDictionary attributtes) { if (tagName == "BookCounter") return typeof(BookCounter); else return null; }
public override void AppendLiteralString(string s) { } }
Thanks!
-j ------------------------------- Jesse Liberty
|
|
| |
| |
| Jeffrey Widmer |
<ControlBuilderAttribute(GetType(BookCounterBuilder)),ParseChildren(false)> _ public class BookInquiryList Inherits System.Web.UI.WebControls.WebControl Implements INamingContainer end class
-----Original Message----- From: Jesse Liberty [mailto:Click here to reveal e-mail address] Sent: Wednesday, January 02, 2002 11:41 AM To: aspngcontrolscs Subject: [aspngcontrolscs] Control Builder attribute in VB?
I'm translating working code from C# to VB.NET. In C# I have this:
[ControlBuilderAttribute(typeof(BookCounterBuilder)),ParseChildren(false)] public class BookInquiryList : System.Web.UI.WebControls.WebControl, INamingContainer
How do I translate this to VB.NET (which does not have a typeOf operator?
Here is Book?CounterBuilder in C#:
internal class BookCounterBuilder : ControlBuilder { public override Type GetChildControlType( string tagName, IDictionary attributtes) { if (tagName == "BookCounter") return typeof(BookCounter); else return null; }
public override void AppendLiteralString(string s) { } }
Thanks!
-j ------------------------------- Jesse Liberty
| [aspngcontrolscs] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/asplists/aspngcontrolscs.asp = JOIN/QUIT | http://www.asplists.com/search = SEARCH Archives
|
|
| |
|
| |
| Scott Watermasysk (VIP) |
Use GetType.
<ControlBuilderAttribute(typeof(BookCounterBuilder)),ParseChildren(false)>
Then chage: public override Type GetChildControlType( string tagName, IDictionary attributtes) { If (tagName == "BookCounter") return GetType(BookCounter); else return null; }
What do you mean, VB.Net does not have TypeOf
HTH, Scott
-----Original Message----- From: Jesse Liberty [mailto:Click here to reveal e-mail address] Sent: Wednesday, January 02, 2002 11:41 AM To: aspngcontrolscs Subject: [aspngcontrolscs] Control Builder attribute in VB?
I'm translating working code from C# to VB.NET. In C# I have this:
[ControlBuilderAttribute(typeof(BookCounterBuilder)),ParseChildren(false)] public class BookInquiryList : System.Web.UI.WebControls.WebControl, INamingContainer
How do I translate this to VB.NET (which does not have a typeOf operator?
Here is Book?CounterBuilder in C#:
internal class BookCounterBuilder : ControlBuilder { public override Type GetChildControlType( string tagName, IDictionary attributtes) { if (tagName == "BookCounter") return typeof(BookCounter); else return null; }
public override void AppendLiteralString(string s) { } }
Thanks!
-j
------------------------------- Jesse Liberty
| [aspngcontrolscs] member Click here to reveal e-mail address = YOUR ID | http://www.asplists.com/asplists/aspngcontrolscs.asp = JOIN/QUIT | http://www.asplists.com/search = SEARCH Archives
|
|
| |
|
| |
| Jesse Liberty (VIP) |
Scott (and Jeffrey Widmer). Thanks! GetType was all I needed. I'm not quite sure what was wrong with my brain.
-j
------------------------------- Jesse Liberty
-----Original Message----- From: Scott Watermasysk [mailto:Click here to reveal e-mail address] Sent: Wednesday, January 02, 2002 11:58 AM To: aspngcontrolscs Subject: [aspngcontrolscs] RE: Control Builder attribute in VB?
Use GetType.
|
|
| |
| |
| Ralf |
hmm I also have a problem with TypeOf from C# --> vb.net
How can I do this "typeof(ACCESS_ALLOWED_ACE)" with GetType?
-------------------------------- using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential)] public struct ACCESS_ALLOWED_ACE { public static readonly int SizeOf = Marshal.SizeOf(typeof(ACCESS_ALLOWED_ACE)); public static readonly int SidOffset = Marshal.OffsetOf(typeof(ACCESS_ALLOWED_ACE), "SidStart").ToInt32();
public ACE_HEADER Header; public ACCESS_MASK Mask; public DWORD SidStart; }
--------------------------------
best regards
Ralf
|
|
| |
|
|
|
|
|
|