This sample shows how to use a self created Event which will triggert if a boolean Variable is set to "True" (CalculateArrayReady).

public void Macro_Event()
        {
            CalculateArray myCalculation = new CalculateArray();

            myCalculation.CalculatedArray += new CalculateArray.CalculateArrayReadyEventHandler(myCalculation_CalculatedArray);

            //do something
            myCalculation.CalculateArrayReady = false;
            //do someting
            myCalculation.CalculateArrayReady = true;

            myCalculation.CalculatedArray -= new CalculateArray.CalculateArrayReadyEventHandler(myCalculation_CalculatedArray);
        }


        //This Event will be triggert if the CalculateArrayReady = true
        void myCalculation_CalculatedArray(object source, EventArgs e)
        {
            System.Diagnostics.Debug.Print("myEvent is Triggert by True! :  " + source.ToString() + " " + e.ToString());
        }


//Self created Class to use a Event which is triggert if the 
    //Variable is true
    class CalculateArray
    {
        public delegate void CalculateArrayReadyEventHandler(object source, EventArgs e);

        public event CalculateArrayReadyEventHandler CalculatedArray;

        private bool calculateArrayReady = false;

        public bool CalculateArrayReady
        {
            get { return calculateArrayReady; }

            set
            {
                calculateArrayReady = value;
                if (calculateArrayReady == true)
                {
                    //Calculate is ready!
                    System.Diagnostics.Debug.Print("Calculate is ready!");

                    if (CalculatedArray != null)
                    {
                        //Event will be triggert
                        CalculatedArray(this, new EventArgs());
                    }
                }
                else
                {
                    System.Diagnostics.Debug.Print("Calculate is not ready!");
                }
            }
        }
    }