Exemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();



            Action <string> msg      = s => { MessageBox.Show(s); };
            var             Savefile = "Notizen.jason";

            if (File.Exists(Savefile))
            {
                String JASONString = File.ReadAllText(Savefile);

                var ser = JsonConvert.DeserializeObject <List <NotizProperty> >(JASONString);

                var datenliste = ser;
                msg(JASONString);
                foreach (var NZ in datenliste)
                {
                    var n = new Notiz(NZ.BrushFarbe);
                    n.Title = "Old " + NZ.Title;
                    n.textBox.Background = NZ.BrushFarbe;
                    n.textBox.Text       = NZ.Text;
                    n.Property.IDRegister.Add(RegisterCounter++, n.Property.Title);
                    n.Show();
                    Notizen.Add(n);
                }
            }
        }
Exemplo n.º 2
0
        private void Button_OnClick(object sender, RoutedEventArgs e)
        {
            // Notiz Fenster Laden
            // Farbe von Button auf Fenster Übertragen
            var ButtonFarbe = ((Button)sender).Background;
            var n           = new Notiz(ButtonFarbe);

            n.Property.Text = "Inset u re Text";
            n.Show();
            n.Property.IDRegister.Add(RegisterCounter++, n.Property.Title);
            n.Property.BrushFarbe = ButtonFarbe;
            Notizen.Add(n);
            // Notiz Fenster Display
            var JasonTEXT = JsonConvert.SerializeObject(value: n.Property, formatting: Formatting.Indented);

            MessageBox.Show(JasonTEXT);
        }