Esempio n. 1
0
        public void PopulateListView(string keyword, System.Windows.Forms.ListView lv)
        {
            var item = lv.Items.Add(keyword);

            item.SubItems.Add(this.ColorName);
            item.SubItems.Add(Util.Utility.Localize(this.Bold));
            item.SubItems.Add(Util.Utility.Localize(this.Italic));

            item.ForeColor = ColorDefinition.GetDrawingColor(this.Color);
        }
        public void Save(string fileName = null)
        {
            if (fileName == null)
            {
                fileName = this.FileName;
            }

            this.Version = ColorDefinition.GetVersion();

            var json = Newtonsoft.Json.JsonConvert.SerializeObject(this.JsonObject, Newtonsoft.Json.Formatting.Indented);

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            System.IO.File.WriteAllText(fileName, json);
        }