Exemple #1
0
        private void PrimitiveUpdateEvent(ReplicationPrimitiveUpdateEvent ev)
        {
            var prop = _selfHosted.GetType().GetProperties().FirstOrDefault(s => s.GetCustomAttribute(typeof(SPReplicationAttribute)) != null && s.GetCustomAttribute <SPReplicationAttribute>().ObjectName == ev.ObjectName).PropertyType;

            if (prop != null)
            {
                if (_activatedReplicationObjects.ContainsKey(ev.ObjectName))
                {
                    var methodInfo = _activatedReplicationObjects[ev.ObjectName].GetType().GetMethod("UpdateReceive");
                    methodInfo.Invoke(_activatedReplicationObjects[ev.ObjectName], new object[] { ev.Value });
                }
            }
        }
        public static void DispatchPrimitiveReplicationInfo(SPClient client, ReplicationPrimitiveUpdateEvent ev)
        {
            var objectName = ev.ObjectName;

            foreach (var ri in _replicationInfos)
            {
                if (ri.Key.Equals(client))
                {
                    continue;
                }

                if (ri.Value.Contains(objectName))
                {
                    ri.Key.PrimitiveWillUpdate(ev.ObjectName, ev.Value);
                }
            }
        }