using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsMobile.Status;


namespace CallingNumber
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            #if DEBUG
                MinimizeBox = false;
            #else
                MinimizeBox = true;
            #endif
        }

        SystemState _wifeCallingWatcher;

        private void menuClear_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            _wifeCallingWatcher = new SystemState(SystemProperty.PhoneIncomingCallerName);         
            _wifeCallingWatcher.ComparisonType = StatusComparisonType.Contains;
            _wifeCallingWatcher.ComparisonValue = "Жена";
            _wifeCallingWatcher.Changed += new ChangeEventHandler(WifeCallingWatcher_Changed);
        }

        void WifeCallingWatcher_Changed(object sender, ChangeEventArgs args)
        {
            // пишем свой код
            textBox1.Text = "Звонит жена с работы";
        }
    }
}