Exemplo n.º 1
0
        public MoodSelector()
        {
            InitializeComponent();
            InitMoodSeq();
            _at = new AnimationThread(Animation);
            if(File.Exists(@"moods.txt"))
                moods_list = JsonConvert.DeserializeObject<BindingList<MoodSeq>>(File.ReadAllText(@"moods.txt"));
            else
                moods_list = new BindingList<MoodSeq>();

            // How to bind a list to a combobox bidirectionally
            moodsBindingSource.DataSource = moods_list;
            moodsCmbBox.DataSource = moodsBindingSource.DataSource;
            moodsCmbBox.SelectedIndex = -1;
        }
Exemplo n.º 2
0
        public MoodSelector()
        {
            InitializeComponent();
            InitMoodSeq();
            _at = new AnimationThread(Animation);
            if (File.Exists(@"moods.txt"))
            {
                moods_list = JsonConvert.DeserializeObject <BindingList <MoodSeq> >(File.ReadAllText(@"moods.txt"));
            }
            else
            {
                moods_list = new BindingList <MoodSeq>();
            }

            // How to bind a list to a combobox bidirectionally
            moodsBindingSource.DataSource = moods_list;
            moodsCmbBox.DataSource        = moodsBindingSource.DataSource;
            moodsCmbBox.SelectedIndex     = -1;
        }
Exemplo n.º 3
0
 public RainbowGenerator(IHueGenerator huey)
 {
     InitializeComponent();
     _huey = huey;
     _at = new AnimationThread(Animate);
 }
Exemplo n.º 4
0
 public RainbowGenerator(IHueGenerator huey)
 {
     InitializeComponent();
     _huey = huey;
     _at   = new AnimationThread(Animate);
 }