Exemplo n.º 1
0
        public void SetUIData(CameraEventTitleElement cete)
        {
            EventJSON evt = cete.rawEvent;

            if (evt != null)
            {
                Device.BeginInvokeOnMainThread(() => {
                    eventName.Text       = evt.eventName;
                    eventCreator.Text    = "Created by:  " + evt.createdBy;
                    eventMaxPlayers.Text = "Max Players: " + evt.maxPlayers;
                    if (evt.categories.Count > 0)
                    {
                        eventStartDate.Text = "Start time:  " + evt.categories[0].start.ToString();
                    }
                    joinPhrase.Text = "Join Phrase: " + evt.accessKey;

                    // hmm, should use a list view here instead...
                    // get everything else up and running, then alter this.
                    catNames.Clear();
                    foreach (CategoryJSON category in evt.categories)
                    {
                        catNames.Add(category.description);
                        categories.Add(category);
                    }
                });
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Called from join.
        /// </summary>
        /// <param name="cerj"></param>
        public void AddEvent(EventJSON cerj)
        {
            selectionView.AddEvent(cerj);
            selectionView.clearJoinPassphrase();
            MasterPage mp = ((MasterPage)Application.Current.MainPage);

            mp.thePages.profilePage.EventsPage.AddEvent(cerj);
        }
Exemplo n.º 3
0
        public void AddEvent(EventJSON cerj)
        {
            CameraEventTitleElement cete = new CameraEventTitleElement {
                eventName = cerj.eventName,
                accessKey = cerj.accessKey,
                eventId   = cerj.eventId,
                fullEvent = cerj,
            };

            events.Insert(0, cete);
        }
Exemplo n.º 4
0
        public async void OnJoinClicked(object sender, EventArgs args)
        {
            await joinPassphrase.FadeTo(0, 175);

            await joinImageEnd.FadeTo(0, 175);

            await joinPassphrase.FadeTo(1, 175);

            await joinImageEnd.FadeTo(1, 175);

            if ((joinPassphrase.Text != null) && (!joinPassphrase.Text.Equals("")))
            {
                string query  = "joinevent?accesskey=" + joinPassphrase.Text;
                string result = await GlobalSingletonHelpers.requestFromServerAsync(HttpMethod.Post, query, "");

                if (result.Equals("fail"))
                {
                }
                else
                {
                    /*
                     * IList<CategoryJSON> newCategories = JsonHelper.DeserializeToList<CategoryJSON>(result);
                     * foreach (CategoryJSON newCat in newCategories) {
                     *  CameraClosedCategoryElement coce = new CameraClosedCategoryElement(newCat);
                     *
                     *  // This does an object memory check rather than an equivalence check.
                     *  // should be a way to make this work, but brute force it for now.
                     *  //if (!openCategorys.Contains<CameraOpenCategoryElement>(coce)) {
                     *  if (!hasCategory(coce)) {
                     *      openCategorys.Add(coce);
                     *  }
                     * }
                     */
                    EventJSON newEvent = JsonConvert.DeserializeObject <EventJSON>(result);
                    //AddEvent(newEvent);
                    cameraPage.AddEvent(newEvent);  // calls this.addevent, but also the profile page's.
                }
            }
        }
Exemplo n.º 5
0
        public void AddEvent(EventJSON evt)
        {
            // title row here.
            CameraEventTitleElement cete = new CameraEventTitleElement()
            {
                eventName = evt.eventName, accessKey = evt.accessKey, eventId = evt.eventId, rawEvent = evt,
            };

            openCategorys.Add(cete);
            // now the categories for this event.
            int uploadCategoryCount = 0;

            foreach (CategoryJSON category in evt.categories)
            {
                if (category.state == CategoryJSON.UPLOAD)
                {
                    CameraClosedCategoryElement ccce = new CameraClosedCategoryElement(category);
                    if (!hasCategory(ccce))
                    {
                        openCategorys.Add(ccce);
                        uploadCategoryCount++;
                    }
                }
                else if (category.state == CategoryJSON.PENDING)
                {
                    CameraClosedCategoryElement ccce = new CameraClosedCategoryElement(category);
                    if (!hasCategory(ccce))
                    {
                        openCategorys.Add(ccce);
                        uploadCategoryCount++;
                    }
                }
            }
            if (uploadCategoryCount == 0)
            {
                cete.stillUploading = false;
            }
        }