Esempio n. 1
0
        private void Tags_LostFocus(object sender, RoutedEventArgs e)
        {
            DependencyObject senderCast          = (DependencyObject)sender;
            ListBoxItem      selectedListBoxItem = FindParent <ListBoxItem>(senderCast);

            Task mTask = selectedListBoxItem.DataContext as Task;

            if (mTask != null)
            {
                System.Threading.Tasks.Task.Factory.StartNew(() =>
                {
                    try
                    {
                        if (selectedListBoxItem != null)
                        {
                            ChangeTaskTagsCommand ChangeTags = new ChangeTaskTagsCommand(this, mTask);
                            ChangeTags.Execute();
                        }
                    }
                    catch (AggregateException error)
                    {
                        MessageBox.Show(error.Message);
                    }
                });
            }
        }
Esempio n. 2
0
        public void ClientChangeTaskTagsRequest(int RandomID, string NewTags)
        {
            Console.WriteLine("Received request to: Change tags" + RandomID + " with tags: " + NewTags);
            User mUser = FindUser(Context.ConnectionId);

            if (mUser.Tasks.Count == 0)
            {
                EmptyListBroadcast();
                return;
            }

            ChangeTaskTagsCommand mChangeTags = new ChangeTaskTagsCommand(mUser, RandomID, NewTags);

            mChangeTags.Execute();

            Clients.Clients(mUser.ConnectionIDs).UpdateTask(RandomID, NewTags, 4);
        }