Esempio n. 1
0
        void _userControlEvent_OnAfterEdit(object sender, CollectionEditEventArgs e)
        {
            FormHostingContainer.Instance.ActiveHosting.MakeDirty();
            SEUndoUnitEventEdit undoUnit = new SEUndoUnitEventEdit(e);

            undoUnit.Action = new Action <SEUndoUnitAbstract, SEUndoEngine.Type>(
                delegate(SEUndoUnitAbstract unit, SEUndoEngine.Type type)
            {
                EventBase even = undoUnit.Value as EventBase;
                if (even == null)
                {
                    if (undoUnit.Values.Count > 0)
                    {
                        even = undoUnit.Values[0] as EventBase;
                    }
                }
                if (even != null)
                {
                    IEventSupport eventSupport = (IEventSupport)even.HostEntity;
                    eventSupport.EventUpdate(this);
                }
            }
                );
            FormHostingContainer.Instance.ActiveHosting.UndoEngine.AddUndoUnit(undoUnit);
        }
Esempio n. 2
0
 private void EventSupport_EventUpdated(object sender, IEventSupport eventSupport)
 {
     if (sender != this)
     {
         BuildTree();
     }
 }
        private void EventUpdate()
        {
            IEventSupport eventSupport = this.HostEntity as IEventSupport;

            if (eventSupport != null)
            {
                eventSupport.EventUpdate(this);
            }
        }
        public static void EventsValidate(IWarningable entity)
        {
            IEventSupport eventSupport = entity as IEventSupport;

            if (eventSupport != null)
            {
                foreach (EventBase _event in eventSupport.Events)
                {
                    IWarningable eventWarning = _event as IWarningable;
                    if (eventWarning == null)
                    {
                        continue;
                    }
                    eventWarning.CheckWarning();
                    if (eventWarning.Warning.ExistWarning)
                    {
                        entity.Warning.AddWarningSign(eventWarning.Warning);
                    }
                }
            }
        }