예제 #1
0
        private void displaySelectedEventPhoto()
        {
            try
            {
                if (eventsListBox.SelectedItems.Count == 1)
                {
                    BasicEventData selectedEvent = eventsListBox.SelectedItem as BasicEventData;

                    eventPictureBox.LoadAsync(selectedEvent.PictureNormalURL);
                }
            }
            catch (Exception)
            {
            }
        }
예제 #2
0
        static List <BasicEventData> Spam(List <BasicEventData> light, double spamSpeed)
        {
            for (int i = light.Count - 1; i > 0; i--)
            {
                BasicEventData previous = light[i - 1];
                BasicEventData now      = light[i];

                // We remove spam under that speed
                if (now.beat - previous.beat <= spamSpeed)
                {
                    light.Remove(now);
                }
            }

            return(light);
        }
예제 #3
0
        private void displaySelectedEventAttending()
        {
            participateListBox.Items.Clear();
            participateListBox.DisplayMember = "Name";
            try
            {
                if (eventsListBox.SelectedItems.Count == 1)
                {
                    BasicEventData selectedEvent = eventsListBox.SelectedItem as BasicEventData;

                    foreach (BasicUserData participant in selectedEvent.AttendingUsers)
                    {
                        participateListBox.Items.Add(participant);
                    }
                }
            }
            catch (Exception)
            {
            }
        }
예제 #4
0
        static List <BasicEventData> Mod(List <BasicEventData> light, double speed)
        {
            for (int i = light.Count - 1; i > 0; i--)
            {
                BasicEventData previous = light[i - 1];
                BasicEventData now      = light[i];

                // The light are pretty close
                if (now.beat - previous.beat <= speed)
                {
                    // One of them is an Off event
                    if (now.value == 4 || now.value == 0)
                    {
                        light.Remove(now);
                    }
                    else if (previous.value == 4 || previous.value == 0)
                    {
                        light.Remove(previous);
                    }
                }
            }

            // Now with fast stuff removed.
            for (int i = 1; i < light.Count; i++)
            {
                BasicEventData previous = light[i - 1];
                BasicEventData now      = light[i];

                // Swap light between Fade and On if they are close.
                if (now.beat - previous.beat <= speed && now.value == previous.value)
                {
                    if (now.value == EventLightValue.BLUE_FADE || now.value == EventLightValue.RED_FADE || now.value == EventLightValue.BLUE_ON || now.value == EventLightValue.RED_ON)
                    {
                        now.value = Utils.Swap(now.value);
                    }
                }
            }

            return(light);
        }
예제 #5
0
        static List <BasicEventData> On(List <BasicEventData> light, double onSpeed)
        {
            for (int i = light.Count - 1; i > 0; i--)
            {
                BasicEventData previous = light[i - 1];
                BasicEventData now      = light[i];

                // If no light for a long duration, we turn on something.
                if (now.beat - previous.beat >= onSpeed)
                {
                    if (previous.value < 4)
                    {
                        previous.value = EventLightValue.BLUE_ON;
                    }
                    else
                    {
                        previous.value = EventLightValue.RED_ON;
                    }
                }
            }

            return(light);
        }