Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

Implementing a queue in a wrapper class --- please help...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
almurph@altavista.com - 25 Mar 2008 12:51 GMT
Hi,

    I'm using ASP.NET 2.0 and have to implement a queue object. That's no
problem - its just:

    Queue myQueue<object> = new Queue<object>();

    The thing is though - I want to make this queue available through a
wrapper class (so its available to everything) but I dont know how to
do this. can you assist? You know i want to use getters and setters or
is this applicable? Any comments/suggestions/help/code-sampels much
appreciated.

Thank you,
Al.
Peter Ritchie [C# MVP] - 25 Mar 2008 16:01 GMT
Why do you want a wrapper class?  Why not simply expose a Queue<object>
property/member?

Signature

Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote.
http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#

> Hi,
>
[quoted text clipped - 8 lines]
> is this applicable? Any comments/suggestions/help/code-sampels much
> appreciated.
sloan - 26 Mar 2008 15:16 GMT
I think its the simple setup below.
Am I missing something?

Do you want "object" to be a Generic?

public class MyWrapper
{

private Queue _myQueue<object> = new Queue<object>();

public Queue TheQueue//bad naming convention here

{

get { return _myQueue; }

set { _myQueue= value; }

}

}

//

MyWrapper w = new MyWrapper();
w.TheQueue.Dequeue(); //?? whatever the methods are

> Hi,
>
[quoted text clipped - 11 lines]
> Thank you,
> Al.
Ignacio Machin ( .NET/ C# MVP ) - 26 Mar 2008 16:14 GMT
On Mar 25, 7:51 am, "almu...@altavista.com" <almu...@altavista.com>
wrote:
> Hi,
>
[quoted text clipped - 11 lines]
> Thank you,
> Al.

Hi,

Are you refering to a singleton?
Take a look at Jon's Skeet article about how to best implement a
singleton

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.