Пример #1
0
 public void RaiseUpdated(EditableObject updatedObject)
 {
     if (Updated != null)
     {
         Updated(this, new EditableObjectEventArgs(updatedObject));
     }
 }
Пример #2
0
        protected override void DisposeManaged()
        {
#if DEBUG
            if (!Parent.ReleaseSubobject(this))
            {
                throw new InvalidOperationException();
            }
#else
            Parent.ReleaseSubobject(this);
#endif
            Parent = null;
            base.DisposeManaged();
        }
Пример #3
0
 void RaiseEditObjectChanged(EditableObject oldValue, EditableObject newValue)
 {
     if (oldValue != null)
     {
         oldValue.Changed  -= OnEditObjectChanged;
         oldValue.Reloaded -= OnEditObjectReloaded;
     }
     if (newValue != null)
     {
         newValue.Changed  += OnEditObjectChanged;
         newValue.Reloaded += OnEditObjectReloaded;
         OnEditObjectReloaded(EditObject, EventArgs.Empty);
     }
 }
Пример #4
0
        /// <summary>
        /// Creates a new module detail object.
        /// </summary>
        /// <param name="moduleObjectDetailType">Type of the module object detail.</param>
        /// <param name="editObject">The edit object.</param>
        /// <param name="focus">if set to <c>true</c> [focus].</param>
        /// <param name="tag">The tag.</param>
        /// <returns></returns>
        ModuleObjectDetailBase CreateNewModuleObjectDetail(Type moduleObjectDetailType, EditableObject editObject, bool focus, object tag)
        {
            ModuleObjectDetailBase moduleObjectDetail;

            if (editObject == null)
            {
                moduleObjectDetail = (ModuleObjectDetailBase)GetModuleObjectDetailContructorWithTagOnly(moduleObjectDetailType).Invoke(new object[] { tag });
            }
            else
            {
                if (tag == null)
                {
                    moduleObjectDetail = (ModuleObjectDetail)GetModuleObjectDetailContructor(moduleObjectDetailType, editObject.GetType()).Invoke(new object[] { editObject });
                }
                else
                {
                    moduleObjectDetail = (ModuleObjectDetail)GetModuleObjectDetailContructorWithTag(moduleObjectDetailType, editObject.GetType()).Invoke(new object[] { editObject, tag });
                }
            }
            moduleObjectDetail.AfterDispose += OnModuleObjectDetailAfterDispose;
            AddModuleObjectDetail(moduleObjectDetail);
            if (focus)
            {
                moduleObjectDetail.Focus();
            }
            return(moduleObjectDetail);
        }
Пример #5
0
        /// <summary>
        /// Opens or creates a module object detail given it's type and key
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="moduleObjectDetailType">Type of the module object detail.</param>
        /// <param name="editObject">The edit object.</param>
        /// <param name="focus">if set to <c>true</c> [focus].</param>
        /// <param name="tag">The tag.</param>
        /// <returns></returns>
        private ModuleObjectDetailBase OpenModuleObjectDetail(object key, Type moduleObjectDetailType, EditableObject editObject, bool focus, object tag)
        {
            ModuleObjectDetailBase moduleObjectDetail;

            if (_modulesByKey.TryGetValue(key, out moduleObjectDetail))
            {
                moduleObjectDetail.Focus();
            }
            else
            {
                moduleObjectDetail = CreateNewModuleObjectDetail(moduleObjectDetailType, editObject, focus, tag);
            }
            return(moduleObjectDetail);
        }
Пример #6
0
 public ModuleObjectDetailBase OpenModuleObjectDetail(EditableObject editObject, bool focus, object tag)
 {
     return(OpenModuleObjectDetail(editObject.Key, _moduleObjectDetailTypes[editObject.GetType()], editObject, focus, tag));
 }
Пример #7
0
 public ModuleObjectDetailBase OpenModuleObjectDetail(EditableObject editObject, bool focus)
 {
     return(OpenModuleObjectDetail(editObject, focus, null));
 }
Пример #8
0
 public EditableSubobject(EditableObject parent)
 {
     Parent = parent;
 }
Пример #9
0
 public ModuleObjectDetail(EditableObject editObject)
 {
     EditObject = editObject;
 }
Пример #10
0
 public ModuleObjectDetail(EditableObject editObject, object tag)
     : this(editObject)
 {
     Tag = tag;
 }
Пример #11
0
 public EditableObjectEventArgs(EditableObject updatedObject)
 {
     this.updatedObject = updatedObject;
 }