|
by: PMarino |
last post by:
Hi all - I'm sure I'm being brain-dead here - and I think the answer is 'you
can't do that', but I thought I would try.
I have an interface that is Generic, with two type arguments. I want to
create a second interface that specifices the second type argument. I also
want to have objects implement that second interface without having to
implement the more generic methods that are inherited from the first. This
is especially evident...
|
by: Adam Clauss |
last post by:
I ran into a problem a while back when attempting to convert existing .NET
1.1 based code to .NET 2.0 using Generic collections rather than Hashtable,
ArrayList, etc.
I ran into an issue because the old code allowed me to do what basically was
the following assignment:
class SomeClass
{
private Queue q;
SomeClass(Queue q)
|
by: anders.forsgren |
last post by:
I have a generic collection looking like this
Set<T> : ICollection<T>
{
// Create set from existing collection.
public Set(ICollection<T> objs) {/* */}
// Add objects to set
public void AddRange(ICollection<T> objs){ /* */ }
}
|
by: Brian Richards |
last post by:
Without generics generally I'd dervie from CollectionBase to create typed
collections. Generics mostly fill in this gap except that there are no
virtual methods on List<T> so we can no longer notify other object when a
collection changes during add, remove and set operations. I was curious how
Others were getting around this problem? I thought of doing something like:
class MyCollection : IList<T>, ICollection<T>
{
private List<T>...
|
by: Angel Mateos |
last post by:
I have this structure:
Class ElemBase
Class Elem1 : Inherits ElemBase
Class ColecBase(Of GenElem As {ElemBase, New}) : Inherits
System.ComponentModel.BindingList(Of GenElem)
Class Colec1 : Inherits ColecBase(Of Elem1)
|
|
by: Edward Diener |
last post by:
Following the example in the help for the generic List class, which
shows the Serializable attribute being used on the generic class, like so:
generic<typename T>
public ref class List : IList<T>, ICollection<T>,
IEnumerable<T>, IList, ICollection, IEnumerable
I try to do the same for my own generic class, like so:
|
by: Michi Henning |
last post by:
I can pass a generic collection as ICollection<Tjust fine:
static void flatCollection(ICollection<intc) {}
// ...
List<intl = new List<int>();
flatCollection(l); // Works fine
Now I want to pass nested collections generically:
|
by: confused1234 |
last post by:
Hi i'm trying to pass a field of type
System.Collections.Generic.ICollection< FeedImage>
to a function.
I dont't have a clue what this icollection is.
but i tried some code
System.Collections.Generic.ICollection< FeedImage> imagea ;
FeedImage fee = new FeedImage ("http://www.image.com/image.jpg", "http://www.image.com");
|
by: Lloyd Dupont |
last post by:
Don't mistake generic type for what you would like them to be!!
IFoo<Ahas nothing in common with IFoo<B>!
They are completely different type create dynamically at runtime.
What you ask is a bit akin to ask: "the System.Web.UI and
System.Windows.Controls namespace both contains a Control class, could I use
one in place of the other? common they have the same name!"
If you want to use a method common to both you should do as Alun...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|