Esempio n. 1
0
        /// <summary>
        /// 删除控件数据
        /// </summary>
        /// <param name="infos"></param>
        /// <returns></returns>
        public bool DeleteDatabaseToControl(params ControlEnum[] ce)
        {
            ControlEnumNameDll control = new ControlEnumNameDll();
            int cout = control.Delete(ce.ToList());

            if (cout == ce.Length)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 序列化
        /// </summary>
        public static void Serialize()
        {
            string dllPath   = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            string contrPath = dllPath.Replace("application\\", "Cofigure\\SerializeContr.dat");

            if (File.Exists(contrPath))
            {
                File.Delete(contrPath);
            }
            List <ControlEnum> users = new ControlEnumNameDll().GetList();
            FileStream         fs    = new FileStream(contrPath, FileMode.Create);
            BinaryFormatter    bf    = new BinaryFormatter();

            bf.Serialize(fs, users);
            fs.Close();
        }
        private static void DeleControlData()
        {
            string dllPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            string contr   = dllPath.Replace("application\\", "Cofigure\\SerializeContr.dat");

            if (File.Exists(contr))
            {
                try
                {
                    File.Delete(contr);
                }
                catch
                {
                }
            }
            ControlEnumNameDll contrdata = new ControlEnumNameDll();

            contrdata.Delete(contrdata.GetList());
        }