コード例 #1
0
        /// <summary>
        /// Demonstrates the ColumnChangedEvent via an interface
        /// </summary>
        public void RunDemo1()
        {
            DemoDataRow dataRow = new DemoDataRow();
            dataRow.AttachColumnChangedObserver(this);

            dataRow["FirstName"] = "John";
            dataRow["LastName"] = "Doe";
            dataRow["FirstName"] = "Jane";

            dataRow.ToConsole();

            Console.ReadLine();
        }
コード例 #2
0
        /// <summary>
        /// Demonstates the ColumnDeleted event using a pseudo delegate (function pointer in other languages)
        /// </summary>
        public void RunDemo3()
        {
            DemoDataRow dataRow = new DemoDataRow();
            dataRow.AttachColumnDeletedObserver(OnColumnDeleted);

            dataRow["FirstName"] = "John";
            dataRow["LastName"] = "Doe";
            dataRow["Age"] = "34";

            dataRow.DeleteColumn("LastName");

            dataRow.ToConsole();

            Console.ReadLine();
        }