public void InitializeProperties()
 {
     for (int i = 0; i < Sessions.Count(); i++)
     {
         Sessions[i]            = new SessionUC();
         Sessions[i].Visibility = Visibility.Hidden;
     }
 }
Beispiel #2
0
 public int GetSessionCount(IUser user)
 {
     if (user == null)
     {
         throw new ArgumentNullException(nameof(user));
     }
     lock (Sync)
         return(Sessions.Count(s => s.HasUser() && s.User.Equals(user)));
 }
Beispiel #3
0
        public void UpdateColorIdentifier()
        {
            IList <OxyColor> colorList = Graph.DefaultColors;

            for (int iSession = 0; iSession < Sessions.Count(); iSession++)
            {
                sessions[iSession].color.Color = Color.FromRgb(
                    colorList.ElementAt(iSession).R,
                    colorList.ElementAt(iSession).G,
                    colorList.ElementAt(iSession).B);
            }
        }
Beispiel #4
0
 public void GetSessionCount(IUser user, Action <int> callback)
 {
     if (user == null)
     {
         throw new ArgumentNullException(nameof(user));
     }
     if (callback == null)
     {
         throw new ArgumentNullException(nameof(callback));
     }
     lock (Sync)
         callback(Sessions.Count(s => user.Equals(s.User)));
 }
Beispiel #5
0
        public double Distance(IDistancable t)
        {
            User u = t as User;

            if (u == null)
            {
                return(-1);
            }

            double dis = Math.Abs(Sessions.Count() - u.Sessions.Count());

            foreach (var s in Sessions)
            {
                foreach (var ss in u.Sessions)
                {
                    dis += s.Distance(ss);
                }
            }

            return(dis);
        }
Beispiel #6
0
 public void UnloadData()
 {
     if (SelectedIndex >= 0 && SelectedIndex < Sessions.Count())
     {
         if (savedframedetailIndex != -1 && savedframedetailIndex > SelectedIndex)
         {
             displayedIndex--;
             savedframedetailIndex--;
         }
         else if (savedframedetailIndex == SelectedIndex)
         {
             displayedIndex        = -1;
             savedframedetailIndex = -1;
         }
         CsvPaths.RemoveAt(SelectedIndex);
         Sessions.RemoveAt(SelectedIndex);
         FileNames.RemoveAt(SelectedIndex);
         frameRanges.RemoveAt(SelectedIndex);
         SelectedIndex = -1;
         UpdateGraphs();
         UpdateColorIdentifier();
     }
 }
Beispiel #7
0
 public int GetNumberOfAllASession()
 {
     return(Sessions.Count());
 }
Beispiel #8
0
 private int NumberOfCompletedSessions()
 {
     return(Sessions.Count((s) => s.Complete()));
 }
Beispiel #9
0
 public bool FactorExists(int index, Factor.Level factor)
 {
     ThrowIf.Argument.IsNull(Sessions, "Subject.Sessions");
     return(Sessions.Count((s) => s.Levels[index].Name == factor.Name) > 0);
 }
Beispiel #10
0
 public bool SessionExists(string sessionID)
 {
     return(Sessions.Count((s) => s.ID == sessionID) > 0);
 }
Beispiel #11
0
        public nint RowsInSection(UITableView tableView, nint section)
        {
            var startDate = EventDates.ElementAt((int)section);

            return(Sessions.Count(s => s.Starts.GetValueOrDefault().Date == startDate));
        }