Esempio n. 1
0
        internal override void Fire_ObjectCreating(ref bool cancel)
        {
            if (ObjectCreating != null)
            {
                ObjectWriteEventArgs e = new ObjectWriteEventArgs();

                ObjectCreating((T)this, e);

                if (e.CancelWrite)
                {
                    cancel = true;
                }
            }

            if (AnyObjectCreating != null)
            {
                ObjectWriteEventArgs e = new ObjectWriteEventArgs();

                AnyObjectCreating((T)this, e);

                if (e.CancelWrite)
                {
                    cancel = true;
                }
            }
        }
Esempio n. 2
0
        internal override void Fire_ObjectUpdating(ref bool cancel)
        {
            if (!IsDirty)
            {
                return;
            }

            if (ObjectUpdating != null)
            {
                ObjectWriteEventArgs eventArgs = new ObjectWriteEventArgs();

                ObjectUpdating((T)this, eventArgs);

                if (eventArgs.CancelWrite)
                {
                    cancel = true;
                }
            }

            if (AnyObjectUpdating != null)
            {
                ObjectWriteEventArgs eventArgs = new ObjectWriteEventArgs();

                AnyObjectUpdating((T)this, eventArgs);

                if (eventArgs.CancelWrite)
                {
                    cancel = true;
                }
            }
        }