Exemplo n.º 1
0
        public Boolean CheckSyncRequired(DevExpress.ExpressApp.IObjectSpace os, SyncISyncObject obj)
        {
            Type type = obj.GetType();

            foreach (SyncISyncPush type_sync in this.GetTypeSyncImpls(type))
            {
                type_sync.CheckSyncRequired(os, obj);
            }
            return(obj.IsSyncRequired);
        }
Exemplo n.º 2
0
        private void SyncAction_Execute(object sender, SimpleActionExecuteEventArgs e)
        {
            if (!(this.View.CurrentObject is SyncISyncObject))
            {
                return;
            }
            SyncISyncObject obj = (SyncISyncObject)this.View.CurrentObject;

            this.ObjectSpace.SetModified(obj);
            this.ObjectSpace.CommitChanges();
            SyncActionStateUpdate();
        }
Exemplo n.º 3
0
 protected void SyncActionEnabledUpdate()
 {
     if (this.View.CurrentObject is SyncISyncObject)
     {
         SyncISyncObject obj = (SyncISyncObject)this.View.CurrentObject;
         if (obj.IsSyncRequired)
         {
             SyncAction.Enabled.SetItemValue("SyncCObjectViewController", true);
         }
         else
         {
             SyncAction.Enabled.SetItemValue("SyncCObjectViewController", false);
         }
     }
 }
Exemplo n.º 4
0
        public IList <SyncISyncObject> CheckSyncRequired(DevExpress.ExpressApp.IObjectSpace os)
        {
            IList <SyncISyncObject> result = new List <SyncISyncObject>();

            foreach (var obj in os.ModifiedObjects)
            {
                if (obj is SyncISyncObject)
                {
                    SyncISyncObject tobj = (SyncISyncObject)obj;
                    if (this.CheckSyncRequired(os, tobj))
                    {
                        result.Add(tobj);
                    }
                }
            }
            return(result);
        }
Exemplo n.º 5
0
        public void Send(DevExpress.ExpressApp.IObjectSpace os, SyncISyncObject obj)
        {
            Type    type       = obj.GetType();
            Boolean is_complet = true;
            Boolean is_enter   = false;

            foreach (SyncISyncPush type_sync in this.GetTypeSyncImpls(type))
            {
                is_enter = true;
                try {
                    type_sync.Send(os, obj);
                } catch (Exception e) {
                    is_complet = false;
                    Tracing.Tracer.LogError(e);
                }
            }
            if (is_enter && is_complet)
            {
                obj.IsSyncRequired = false;
            }
        }