Wednesday

Derive Collection class:Override Add,Insert,Remove methods

These methods are not overridable,
will be more correctly to override InsertItem,RemoveItem methods, they will be called from other methods Add,Insert,Remove , etc

using System.Collections.ObjectModel;
using System.Diagnostics;
using System;
namespace CollectionTest
{
class Program
{
static void Main(string[] args)
{
Debug.Write("MAIN");
LimitedCollection<String> col = new LimitedCollection<String>();
col.Add("hello");
col.Insert(0,"hello");

}
}
public class LimitedCollection<T> : Collection<T>
{
protected override void InsertItem(int index, T item)
{
base.InsertItem(index, item);
Debug.Write("InsertItem called");
}
}
}

more...

No comments:

imagemagic add text to image

rem different types of text annotations on existing images rem cyan yellow orange gold rem -gravity SouthWest rem draw text and anno...