Beispiel #1
0
        private void AddNewNick(object sender, RoutedEventArgs e)
        {
            nickalert ob = new nickalert {
                name = "New NickAlert", color = "#00f0f0", activated = false
            };

            items.Add(ob);
            ((App)Application.Current).nicks.Add(ob);
            ((App)Application.Current).SaveSettings();
        }
Beispiel #2
0
        private void SaveNicks(object sender, RoutedEventArgs e)
        {
            nickalert ob;

            ((App)Application.Current).nicks.Clear();
            for (int i = 0; i < nickListGrid.Items.Count; i++)
            {
                Color c = (Color)FindVisualChild <ColorPicker>(nickListGrid.Columns[1].GetCellContent(GetRow(nickListGrid, i))).SelectedColor;
                ob = new nickalert
                {
                    name      = FindVisualChild <TextBox>(nickListGrid.Columns[0].GetCellContent(GetRow(nickListGrid, i))).Text,
                    color     = string.Format("#{0:X2}{1:X2}{2:X2}", c.R, c.G, c.B),
                    activated = (bool)FindVisualChild <CheckBox>(nickListGrid.Columns[2].GetCellContent(GetRow(nickListGrid, i))).IsChecked
                };
                ((App)Application.Current).nicks.Add(ob);
            }
            ((App)Application.Current).SaveSettings();
            System.Windows.MessageBox.Show("Settings Saved!");
        }