Store.Add C# (CSharp) Method

Add() public method

public Add ( Product, product ) : void
product Product,
return void
    public void Add(Product product)
    {
        products [current++] = product;

        //Raising or firing the event
        if (ProductAdded != null)
            ProductAdded ();
    }

Usage Example

示例#1
0
    public static void Main()
    {
        var store = new Store ();

        //Handling the event
        store.ProductAdded += OnProductAdded;

        store.Add (new Product ());
    }
All Usage Examples Of Store::Add
Store