473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Creating attribute for a collection.

It is a strange question;

I have a collection of Types which is derived off of IDictionary. When
ever something changes in the collection, I want to mark the
collection as changed a boolean flag. How can I do that or is it a
correct way of doing it?

public class MyType
{
}

public class TypeCollection<TValue>:IDictionary<string, TValue>
{
}

public class MyTypeCollection<TValue>:TypeCollection<TValue>
{
}

what I want to do is to set a boolean value in MyTypeCollection to
true when something changes in that collection.

Thanks,
Oct 14 '08 #1
1 1079
you need to implement the interface and add your bool inside. This will mark
changes for add, delete. Changes to properties on the objects themselfs
would require more work.

public class MyCollection<T, T2: IDictionary<T, T2>
{

#region IDictionary<T,T2Members

public void Add(T key, T2 value)
{
throw new NotImplementedException();
}

public bool ContainsKey(T key)
{
throw new NotImplementedException();
}
....

"CSharper" <cs******@gmx.comwrote in message
news:ef**********************************@g17g2000 prg.googlegroups.com...
It is a strange question;

I have a collection of Types which is derived off of IDictionary. When
ever something changes in the collection, I want to mark the
collection as changed a boolean flag. How can I do that or is it a
correct way of doing it?

public class MyType
{
}

public class TypeCollection<TValue>:IDictionary<string, TValue>
{
}

public class MyTypeCollection<TValue>:TypeCollection<TValue>
{
}

what I want to do is to set a boolean value in MyTypeCollection to
true when something changes in that collection.

Thanks,
Oct 14 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David Elliott | last post by:
I am looking to use a field attribute in a to find and use a property. If given Find("Record Artist", "Billy Joel"); I am looking to find the first instance in the collection where the value the...
7
by: Justin | last post by:
I am extremely new at SQL Server2000 and t-sql and I'm looking to create a simple trigger. For explanation sake, let's say I have 3 columns in one table ... Col_1, Col_2 and Col_3. The data type...
6
by: NotGiven | last post by:
I want to learn moer of what I saw in a recent example. They create a page that created new fields/element. It's not like they were hidden and they displayed them, they were not there, then the...
7
by: 7mary4 | last post by:
I am working on a kiosk for a museum, we will be using firefox as the browser, with windows, and a touch screen. We'd like to create a slide show of a small portfolio when the visitors click...
3
by: Ken Varn | last post by:
I am just starting the process of creating ASP.NET server controls. I have created controls for .NET applications, but have just started with ASP.NET. I am a little confused about some areas that...
5
by: | last post by:
Trying to learn about manipulating collections of objects, and populating these objects dynamically from datasources. Could someone post a code sample that shows the following: Instantiating a...
6
by: Joe | last post by:
Hello All: Does anyone know the difference between the name and id attributes in an Html control? I noticed on PostBack that I can not retrieve the Request.Form("id_value") but I can retrieve...
0
by: =?Utf-8?B?QXR1bA==?= | last post by:
When .Net 1.0 webservice (VS2003) generates a wsdl - <wsdl:binding name="TestSoap" type="tns:TestSoap"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/(note:...
1
by: apurvaG | last post by:
Hi All, I need to fetch index of particular attribute of a XMLNode using xslt. I know one we can do it by iterating through the arrtribute collection and then comparing the attribute name to get...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.