示例#1
0
        /// <summary>
        /// 加载bartender配置
        /// </summary>
        /// <param name="ba">传入修改的数据</param>
        /// <returns></returns>
        public bool LoadBartenderIniConfig(IBarTenderTool ba)
        {
            bool ok = false;

            string filename = "BartenderConfig";

            IniLibrary.IniTool initool = new IniTool(ref filename, "BartenderConfig", null);

            if (File.Exists(initool.FileName_Path1))
            {
                ba.IdenticalCopiesOfLabel1 = Convert.ToInt32(initool.ReadString(ba.ToString(), "IdenticalCopiesOfLabel1", "1"));
                ba.NumberSerializedLabels1 = Convert.ToInt32(initool.ReadString(ba.ToString(), "NumberSerializedLabels1", "1"));
                ba.PathFileName            = initool.ReadString(ba.ToString(), "PathFileName", ba.PathFileName);
            }
            else
            {
                initool.WriteString(ba.ToString(), "IdenticalCopiesOfLabel1", ba.IdenticalCopiesOfLabel1.ToString());
                initool.WriteString(ba.ToString(), "NumberSerializedLabels1", ba.NumberSerializedLabels1.ToString());
                initool.WriteString(ba.ToString(), "PathFileName", ba.PathFileName);
            }
            ok = true;
            return(ok);
        }