예제 #1
0
        public void Release(IClientXObject <TKind> _object)
        {
            var descriptor = GetDescriptor(_object.Uid);

            descriptor.Release(_object);
            if (descriptor.IsEmpty)
            {
                ObjectReleased(_object.Uid, _object.Kind);
            }
        }
예제 #2
0
        private void XObjectChanged(IClientXObject <TKind> _xObject)
        {
            var xObject = ((ClientXObject <TKind>)_xObject);
            var changes = xObject.GetChanges().ToArray();

            var xReport = new XReport(_xObject.Uid, changes, Kind, EState.UNDO_ABLE | EState.REVERT_ABLE);

            Report.MergeChanges(xReport);

            ResetState();

            foreach (var obj in m_instances.Values)
            {
                if (!ReferenceEquals(obj, _xObject))
                {
                    obj.Changed -= XObjectChanged;
                    obj.ApplyChanges(xReport, false);
                    obj.Changed += XObjectChanged;
                }
            }

            m_client.ClientObjectChanged(xReport);
        }
예제 #3
0
        public void Release(IClientXObject <TKind> _object)
        {
            var type = _object.GetType();

            if (!m_instancesCounter.ContainsKey(_object))
            {
                return;
            }
            var rest = --m_instancesCounter[_object];

            if (rest == 0)
            {
                m_instances.Remove(type);
                m_instancesCounter.Remove(_object);
                if (_object is IDisposable)
                {
                    ((IDisposable)_object).Dispose();
                }
            }
            if (m_instances.Count == 0)
            {
                Report = null;
            }
        }
예제 #4
0
 private void ItemChanged(IClientXObject <TKind> _obj)
 {
     UpdateIsDirty();
 }