Thursday 19 April 2012

Get to know more using the Dapfor real time stock quotes API

For developers and software designers API (Application programming interface) is an important concept. But it is real time stock quotes API is crucial too for the people dealing in finance and trade. The real time stock quotes API allows people to deal with the regular aspects of stock trading and the internal tutorials to deal with the trading system better. For a financial organization to flourish, real time stock quotes API must be well read. For the reading purposes real time stock quotes API must be well documented. Dapfor is an organization dealing with real time stock quotes since 2007, and hence has the most comprehensive real time stock quotes API in the trade and finance software industry today. The facilities provided by the real time stock quotes API of Dapfor allows you to learn things effectively, quickly and apply them in the real industry.

public class Product : INotifyPropertyChanged
{
    private double price;

    public double Price
    {
        get { return price; }
        set
        {
            //If the price is not the same, change it and notify about price changing
            if (price != value)
            {
                price = value;
                //The event can be raised from any thread. The grid will synchronize thread with GUI without blocking the calling thread.
                //While painting, sorting or filtering the grid can ask this object in the GUI (!) thread to return the price value.
                if(PropertyChanged != null)
                {
                    PropertyChanged(this, new PropertyChangedEventArgs("Price"));
                }
            }
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;
}

public void CreateFilter(Grid grid)
{
    //Set a filter that hides all rows, that contain products with price less than 10
    grid.Filter = new Filter(delegate(Row row)
    {
        //There are three ways to get price:
        //1. From the Cell through the Value property, which returns a double value: row["Price"].Value
        //2. Through the IDataAccessor and IDataField: row.DataAccessor["Price"].Value
        //3. From the data object itself: ((Product)row.DataObject).Price

        if ((double)row["Price"].Value < 10)
        {
            //Filter the row
            return true;
        }

        //The row is not filtered
        return false;
    });
}

//Populate the grid
public void PopulateGrid(Grid grid)
{
    Product product1 = new Product();
    Product product2 = new Product();

    grid.Rows.Add(product1);
    grid.Rows.Add(product2);

    //Update the product's price
    //Data objects will notify the Grid, and it will display only the product2.
    //The product1 will be hidden
    product1.Price = 9;
    product2.Price = 11;
}

The above comprehensive code of the real time stock quotes API developed by Dapfor allows you to understand the concept of IFilter. The IFilter is called whenever new data is added to the .net grid. Therefore just by studying the real time stock quotes API you will be able to understand how it works. Even the real time stock quotes API are given online as a tutorial on the Dapfor website. So whichever method you feel is convenient you should choose that. The real time stock quotes API also have other features and tutorials enlisted in it. Check the real time stock quotes API online for more on trade related software information.

No comments:

Post a Comment