Exemplo n.º 1
0
 public void RaiseUpdated(EditableObject updatedObject)
 {
     if (Updated != null)
     {
         Updated(this, new EditableObjectEventArgs(updatedObject));
     }
 }
Exemplo n.º 2
0
        protected override void DisposeManaged()
        {
#if DEBUG
            if (!Parent.ReleaseSubobject(this))
            {
                throw new InvalidOperationException();
            }
#else
            Parent.ReleaseSubobject(this);
#endif
            Parent = null;
            base.DisposeManaged();
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 6
0
 public ModuleObjectDetailBase OpenModuleObjectDetail(EditableObject editObject, bool focus, object tag)
 {
     return(OpenModuleObjectDetail(editObject.Key, _moduleObjectDetailTypes[editObject.GetType()], editObject, focus, tag));
 }
Exemplo n.º 7
0
 public ModuleObjectDetailBase OpenModuleObjectDetail(EditableObject editObject, bool focus)
 {
     return(OpenModuleObjectDetail(editObject, focus, null));
 }
Exemplo n.º 8
0
 public EditableSubobject(EditableObject parent)
 {
     Parent = parent;
 }
Exemplo n.º 9
0
 public ModuleObjectDetail(EditableObject editObject)
 {
     EditObject = editObject;
 }
Exemplo n.º 10
0
 public ModuleObjectDetail(EditableObject editObject, object tag)
     : this(editObject)
 {
     Tag = tag;
 }
Exemplo n.º 11
0
 public EditableObjectEventArgs(EditableObject updatedObject)
 {
     this.updatedObject = updatedObject;
 }