Beispiel #1
0
        public override void RemoveAction(long actionId)
        {
            TaskListClient taskList = (TaskListClient)_owner.Owner;

            if (taskList.WcfClient == null)
            {
                WinUtil.ShowErrorClientDisconnected();
            }
            else
            {
                taskList.WcfClient.RemoveAction(_owner.Id, actionId);
            }
        }
Beispiel #2
0
        protected override object AddNewCore()
        {
            TaskListClient taskList = (TaskListClient)_owner.Owner;

            if (taskList.WcfClient == null)
            {
                WinUtil.ShowErrorClientDisconnected();
                CancelNew(this.Count);
                return(null);
            }
            lock (SyncRoot)
            {
                // We do not want to really add a new item.
                // Instead, we tell the server to do that, and cancel our own adding.
                // The server will tell us that it has added a task, and we will update then.
                taskList.WcfClient.AddAction(_owner.Id);
                CancelNew(this.Count);
                return(null);
            }
        }