public void DoWatch(string method, string nameadded)
 {
     if (method == "GET")
     {
         JSONRequest jsonrequest = new JSONRequest
         {
             urlRequest    = $"/rest/api/2/issue/{this.issueKey}/watchers/",
             methodRequest = method
         };
         Request    requestIssue = new Request(jsonrequest);
         RootObject rootObject   = new RootObject();
         watchers = requestIssue.GetResponses <RootObject>().watchers;
         if (Additional.Count == 0)
         {
             for (int i = 0; i < watchers.Count; ++i)
             {
                 Additional.Add(new RTMobile.User {
                     name = watchers[i].name, displayName = watchers[i].displayName
                 });
             }
         }
     }
     if (method == "POST")
     {
         JSONRequest jsonrequest = new JSONRequest
         {
             urlRequest    = $"/rest/api/2/issue/{this.issueKey}/watchers",
             methodRequest = method
         };
         Request requestIssue = new Request(jsonrequest);
         requestIssue.GetResponses <RootObject>(String.Format("\"{0}\"", nameadded));
     }
 }
Beispiel #2
0
        private void CheckFeatures()
        {
            Missing.Clear();
            Additional.Clear();

            foreach (string feature in Cpu.Features)
            {
                bool expected = Expected.Contains(feature);
                bool present  = Cpu.Features[feature];
                if (expected && !present)
                {
                    Missing.Add(feature);
                }
                else if (!expected && present)
                {
                    Additional.Add(feature);
                }
            }

            foreach (string feature in Expected)
            {
                if (!Cpu.Features[feature])
                {
                    Missing.Add(feature);
                }
            }
        }
        public void OneItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            if (e.SelectedItem != null)
            {
                ((ListView)sender).SelectedItem = null;
                var us = e.SelectedItem as RTMobile.User;
                if (Additional.Count != 0)
                {
                    for (int j = 0; j < Additional.Count; ++j)
                    {
                        if (Additional[j].displayName != us.displayName)
                        {
                            if (j == Additional.Count - 1)
                            {
                                Additional.Add(us);

                                OnPropertyChanged(nameof(Additional));
                                break;
                            }
                        }
                        else
                        {
                            DisplayAlert("Ошибка", "Уже есть в наблюдателях!", "OK").ConfigureAwait(true);
                            break;
                        }
                    }
                }
                else
                {
                    Additional.Add(us);
                    OnPropertyChanged(nameof(Additional));
                };
            }
        }