Пример #1
0
        public AuthUl(AuthAc authAc, AUserModel userModel)
        {
            _AuthAc = authAc;
            _UserModel = userModel;

            InitializeComponent();
        }
Пример #2
0
        public SignAc(Main main, AUserModel userModel)
        {
            _Main = main;
            _UserModel = userModel;

            InitializeComponent();
        }
Пример #3
0
        public AuthCa(AUserModel userModel)
        {
            _UserModel = userModel;

            InitializeComponent();

            this.Icon = Me.Amon.Properties.Resources.Icon;
        }
Пример #4
0
        public SignFk(SignAc signAc, AUserModel userModel)
        {
            _SignAc = signAc;
            _UserModel = userModel;

            InitializeComponent();

            //_SignAc.ShowTips(null, "");
        }
Пример #5
0
        public WPwd(Main main, AUserModel userModel)
        {
            _Main = main;
            _UserModel = userModel as UserModel;

            InitializeComponent();

            CheckForIllegalCrossThreadCalls = false;
            this.Icon = Me.Amon.Properties.Resources.Icon;
        }
Пример #6
0
        public SignUl(SignAc signAc, AUserModel userModel)
        {
            _SignAc = signAc;
            _UserModel = userModel;

            InitializeComponent();

            TbPath.Text = Path.Combine(_UserModel.SysHome, CApp.DIR_DATA);
            _SignAc.ShowTips(BtPath, "选择目录");
        }
Пример #7
0
        public SignIn(SignAc signAc, AUserModel userModel)
        {
            _SignAc = signAc;
            _UserModel = userModel;

            InitializeComponent();

            _SignAc.ShowTips(PbSignUp, "用户注册");
            _SignAc.ShowTips(PbSignFk, "找回口令");
        }
Пример #8
0
        private void ExportWPwdCat(AUserModel userModel, XmlWriterSettings setting)
        {
            string file = Path.Combine(userModel.DatHome, "WPwd-Cat.xml");
            StreamWriter stream = new StreamWriter(file);
            using (XmlWriter writer = XmlWriter.Create(stream, setting))
            {
                writer.WriteStartElement("Amon");

                writer.WriteElementString("App", "WPwd");
                writer.WriteElementString("Ver", "1");

                writer.WriteStartElement("Cats");
                foreach (Cat cat in _DataModel.ListCat(CApp.IAPP_WPWD, ""))
                {
                    cat.ToXml(writer);
                }
                writer.WriteEndElement();

                writer.WriteEndElement();
            }
            stream.Close();
        }
Пример #9
0
        public void Init(AUserModel userModel)
        {
            _UdcList = new List<Udc>();
            _UdcList.Add(new Udc { Id = "aucs000000000001", Name = "仅数字", Tips = "仅数字", Data = "0123456789" });
            _UdcList.Add(new Udc { Id = "aucs000000000002", Name = "大写字母", Tips = "大写字母", Data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" });
            _UdcList.Add(new Udc { Id = "aucs000000000003", Name = "小写字母", Tips = "小写字母", Data = "abcdefghijklmnopqrstuvwxyz" });
            _UdcList.Add(new Udc { Id = "aucs000000000004", Name = "大小写字母", Tips = "大小写字母", Data = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" });
            _UdcList.Add(new Udc { Id = "aucs000000000005", Name = "数字及字母", Tips = "数字及字母", Data = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" });
            _UdcList.Add(new Udc { Id = "aucs000000000006", Name = "可输入英文符号", Tips = "可输入英文符号", Data = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" });
            //foreach (Udc udc in userModel.DBA.ListUdc())
            //{
            //    _UdcList.Add(udc);
            //}
            foreach (Udc item in _UdcList)
            {
                if (item.Id == _UdcKey)
                {
                    Default = item;
                }
            }

            Modified = 0x7FFFFFFF;
        }
Пример #10
0
        public IApp CreateApp(AUserModel userModel)
        {
            Main.LogInfo("创建新实例:" + Id);

            switch ((Id ?? "").ToLower())
            {
                case CApp.IAPP_WBAR:
                    App = new Bar.WBar(userModel);
                    break;
                case CApp.IAPP_WICO:
                    App = new Ico.WIco(userModel);
                    break;
                case CApp.IAPP_WIMG:
                    App = new Img.WImg(userModel);
                    break;
                case CApp.IAPP_WSPY:
                    //App = new Spy.ASpy(userModel);
                    break;
                default:
                    break;
            }

            return App;
        }
Пример #11
0
        /// <summary>
        /// 类别
        /// </summary>
        /// <param name="userModel"></param>
        /// <param name="setting"></param>
        private void ImportWPwdCat(AUserModel userModel, XmlReaderSettings setting)
        {
            string file = Path.Combine(userModel.DatHome, "WPwd-Cat.xml");
            if (!File.Exists(file))
            {
                return;
            }

            StreamReader stream = new StreamReader(file);
            using (XmlReader reader = XmlReader.Create(stream, setting))
            {
                Cat cat;
                while (reader.Name == "Cat" || reader.ReadToFollowing("Cat"))
                {
                    cat = new Cat();
                    if (!cat.FromXml(reader))
                    {
                        continue;
                    }
                    _DataModel.DeleteVcs(cat);
                    _DataModel.SaveVcs(cat);
                }
            }
            stream.Close();
        }
Пример #12
0
 public void Import(AUserModel userModel)
 {
     XmlReaderSettings setting = new XmlReaderSettings { IgnoreWhitespace = true };
     ImportWPwdDir(userModel, setting);
 }
Пример #13
0
 public void Export(AUserModel userModel)
 {
     XmlWriterSettings setting = new XmlWriterSettings { Indent = true };
     ExportWPwdCat(userModel, setting);
 }
Пример #14
0
        public void Init(AUserModel userModel)
        {
            _DbPath = Path.Combine(userModel.DatHome, CApp.FILE_DB);

            if (!File.Exists(_DbPath))
            {
                Directory.CreateDirectory(Path.GetDirectoryName(_DbPath));
                DbInit();
            }
        }
Пример #15
0
 public SkinModel(AUserModel userModel)
 {
     _UserModel = userModel;
 }
Пример #16
0
        public IApp CreateApp(AUserModel userModel)
        {
            Main.LogInfo("创建新实例:" + Id);

            return null;
        }
Пример #17
0
        private void Main_Load(object sender, EventArgs e)
        {
            Icon = Me.Amon.Properties.Resources.Icon;

            _UserModel = new Pwd.M.UserModel();
            //_UserModel = new Pcs.M.UserModel();
            _UserModel.Init();

            // 系统日志
            string logFile = Path.Combine(_UserModel.SysHome, CApp.FILE_LOG);
            if (File.Exists(logFile))
            {
                _Writer = new StreamWriter(logFile, true, Encoding.UTF8);
                _Writer.AutoFlush = true;
                _Writer.WriteLine(string.Format("============{0}============", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")));
            }

            ShowUser();
        }
Пример #18
0
 public static void Export(AUserModel userModel)
 {
 }
Пример #19
0
        public WBar(AUserModel userModel)
        {
            InitializeComponent();

            this.Icon = Me.Amon.Properties.Resources.Icon;
        }
Пример #20
0
 public void Init(AUserModel userModel)
 {
 }
Пример #21
0
        /// <summary>
        /// 目录
        /// </summary>
        /// <param name="userModel"></param>
        /// <param name="setting"></param>
        private void ImportWPwdDir(AUserModel userModel, XmlReaderSettings setting)
        {
            string file = Path.Combine(userModel.DatHome, "WPwd-Dir.xml");
            if (!File.Exists(file))
            {
                return;
            }

            StreamReader stream = new StreamReader(file);
            using (XmlReader reader = XmlReader.Create(stream, setting))
            {
                Dir dir;
                while (reader.Name == "Dir" || reader.ReadToFollowing("Dir"))
                {
                    dir = new Dir();
                    if (!dir.FromXml(reader))
                    {
                        continue;
                    }
                    _DataModel.DeleteVcs(dir);
                    _DataModel.SaveVcs(dir);
                }
            }
            stream.Close();
        }
Пример #22
0
        private void ImportWPwdLib(AUserModel userModel, XmlReaderSettings setting)
        {
            string file = Path.Combine(userModel.DatHome, "WPwd-Lib.xml");
            if (File.Exists(file))
            {
                return;
            }

            StreamReader stream = new StreamReader(file);
            using (XmlReader reader = XmlReader.Create(stream, setting))
            {
                Lib header;
                while (reader.Name == "Lib" || reader.ReadToFollowing("Lib"))
                {
                    header = new Lib();
                    if (!header.FromXml(reader))
                    {
                        continue;
                    }
                    _DataModel.DeleteVcs(header);
                    _DataModel.SaveVcs(header);
                }
            }
            stream.Close();
        }
Пример #23
0
        public Reset(AUserModel userModel)
        {
            _UserModel = userModel;

            InitializeComponent();
        }
Пример #24
0
 public ADataModel(AUserModel userModel)
 {
     _UserModel = userModel;
 }
Пример #25
0
        public void DbInit(AUserModel userModel)
        {
            _DbPath = Path.Combine(userModel.DatHome, CApp.FILE_DB);

            if (!File.Exists(_DbPath))
            {
                DbInit();
            }
        }