.NETGURU
Control Builder attribute in VB?
Messages   Related Types
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
Reply to this message...
 
    
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
Reply to this message...
 
    
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
Reply to this message...
 
    
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.
Reply to this message...
 
    
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
Reply to this message...
 
 
System.Collections.IDictionary
System.Runtime.InteropServices.LayoutKind
System.Runtime.InteropServices.Marshal
System.Web.UI.ControlBuilder
System.Web.UI.ControlBuilderAttribute
System.Web.UI.INamingContainer
System.Web.UI.WebControls.WebControl




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification