Example #1
0
        /// <summary>
        /// Is called on OnInitialisation to retrieve BlockHandler reference.
        /// If the control has no associated block, it is deleted.
        /// </summary>
        protected virtual void Initialise()
        {
            try
            {
                Block = BlockHandlerController.GetBlock(BlockGUID);

                var axis = AxisManager.Get(Axis);
                if (Enabled && Block != null && axis != null && axis.Status == AxisStatus.OK)
                {
                    ClearKeys();
                }
            }
            catch (BlockNotFoundException)
            {
                Block = null;
                ControlManager.Blocks.Remove(BlockGUID);
            }
        }