PC Review


Reply
Thread Tools Rate Thread

C# "class reserve" word used as a class name?

 
 
nadeem_far@yahoo.com
Guest
Posts: n/a
 
      25th Jun 2006
Hello All,

I have a couple of questions and I am not able to find them any where
on internet.

1. We are using a third party class library which exposes a class with
the name of "class".

Now how can i create an object of this "class" class as class is a
reserve word in C#.

We are using c#.


2. How do you create a webservice object if the webservice class in
sitting in another namespace?


Thanks.

NS

 
Reply With Quote
 
 
 
 
Miha Markic [MVP C#]
Guest
Posts: n/a
 
      25th Jun 2006

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello All,
>
> I have a couple of questions and I am not able to find them any where
> on internet.
>
> 1. We are using a third party class library which exposes a class with
> the name of "class".
>
> Now how can i create an object of this "class" class as class is a
> reserve word in C#.


use @class notation.


--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/


 
Reply With Quote
 
Tom Spink
Guest
Posts: n/a
 
      25th Jun 2006
(E-Mail Removed) wrote:

> Hello All,
>
> I have a couple of questions and I am not able to find them any where
> on internet.
>
> 1. We are using a third party class library which exposes a class with
> the name of "class".
>
> Now how can i create an object of this "class" class as class is a
> reserve word in C#.
>
> We are using c#.
>
>
> 2. How do you create a webservice object if the webservice class in
> sitting in another namespace?
>
>
> Thanks.
>
> NS


Hi NS,

> 1. We are using a third party class library which exposes a class with
> the name of "class".


Prefix it with '@':

///
@class inst = new @class();
///

> 2. How do you create a webservice object if the webservice class in
> sitting in another namespace?


Do you mean in another namespace, in your code? Or in a totally different
assembly?

Either way, to access by namespace, you can either import the namespace with
a 'using' directive, or fully-qualify the type name when trying to use it:

using <namespace>;

(Using directives *must* be at the top of your code file, or the top of a
namespace declaration)

And if the class resides in a different assembly, you need to reference that
assembly when compiling. In the VS .NET IDE, just right-click
on 'Refernces' and choose 'Add Reference...' then browse for the assembly.

Hope this helps,
-- Tom Spink
 
Reply With Quote
 
nadeem_far@yahoo.com
Guest
Posts: n/a
 
      26th Jun 2006
Tom Spink wrote:
> (E-Mail Removed) wrote:
>
> > Hello All,
> >
> > I have a couple of questions and I am not able to find them any where
> > on internet.
> >
> > 1. We are using a third party class library which exposes a class with
> > the name of "class".
> >
> > Now how can i create an object of this "class" class as class is a
> > reserve word in C#.
> >
> > We are using c#.
> >
> >
> > 2. How do you create a webservice object if the webservice class in
> > sitting in another namespace?
> >
> >
> > Thanks.
> >
> > NS

>
> Hi NS,
>
> > 1. We are using a third party class library which exposes a class with
> > the name of "class".

>
> Prefix it with '@':
>
> ///
> @class inst = new @class();
> ///
>
> > 2. How do you create a webservice object if the webservice class in
> > sitting in another namespace?

>
> Do you mean in another namespace, in your code? Or in a totally different
> assembly?
>
> Either way, to access by namespace, you can either import the namespace with
> a 'using' directive, or fully-qualify the type name when trying to use it:
>
> using <namespace>;
>
> (Using directives *must* be at the top of your code file, or the top of a
> namespace declaration)
>
> And if the class resides in a different assembly, you need to reference that
> assembly when compiling. In the VS .NET IDE, just right-click
> on 'Refernces' and choose 'Add Reference...' then browse for the assembly.
>
> Hope this helps,
> -- Tom Spink


Tom/Miha,

Thanks for your help.

NS

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when returning user-defined class from "factory" class... =?Utf-8?B?R2Vvcmdl?= Microsoft Excel Programming 5 2nd Oct 2007 06:06 PM
Guide to take a vb6 class and "convert" it to a class usable in vb .net Matt Brown - identify Microsoft VB .NET 2 7th Feb 2007 01:16 AM
return Inherited class instead of "original" class Karsten Schramm Microsoft C# .NET 2 12th Jul 2006 05:43 PM
Best way to "cast" base class to specialized class SA Microsoft VB .NET 6 26th Apr 2005 04:33 PM
error loading c# class in visual studio - "class can be designed" Steve Richter Microsoft C# .NET 3 17th Apr 2005 08:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:26 AM.