Esempio n. 1
0
        public static ColorItemPersist GetByName(string name)
        {
            string dir   = AppDomain.CurrentDomain.BaseDirectory + "LinearColorTable";
            string fname = dir + "\\" + name + ".lgt";

            if (!File.Exists(fname))
            {
                return(null);
            }
            return(ObjectToDisk.DerializeClassFromBinary(fname) as ColorItemPersist);
        }
Esempio n. 2
0
        public static void SaveToFile(ColorItem[] colorItems, string name)
        {
            ColorItemPersist colorPersist = new ColorItemPersist();

            colorPersist.ColorItems = colorItems;
            colorPersist.Name       = name;
            string dir = AppDomain.CurrentDomain.BaseDirectory + "LinearColorTable";

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            string fname = dir + "\\" + name + ".lgt";

            ObjectToDisk.SerializeClassToBinary(colorPersist, fname);
        }