Exemple #1
0
        private void DomNode_AttributeChanging(object sender, AttributeEventArgs e)
        {
            ITimelineObject item = e.DomNode.As <ITimelineObject>();

            if (item != null)
            {
                if (!IsEditable(item, e.AttributeInfo))
                {
                    if (ActiveDocument.Cast <ITransactionContext>().InTransaction)
                    {
                        throw new InvalidTransactionException("timeline object can't be edited");
                    }
                    else
                    {
                        return;
                    }
                }

                // Check if a URI on a timeline reference has changed, so we can unload
                //  old document and load new document.
                if (e.AttributeInfo.Equivalent(Schema.timelineRefType.refAttribute))
                {
                    UnloadSubDocument((Uri)e.OldValue);
                    LoadSubDocument((Uri)e.NewValue);
                }
            }
        }