コード例 #1
0
        public ShellViewModel(IEventAggregator eventAggregator, IConfigService configService)
        {
            _eventAggregator = eventAggregator;
            _configService = configService;
            _adminInfo = _configService.AdminInfos;
            ConfigDisplayCommand = new DelegateCommand(ConfigDisplayExecuted);
            AdminLoginRequest = new GenericInteractionRequest<AdminLoginNotification>();
            ConfigRequest = new GenericInteractionRequest<ConfigNotification>();
            //注册消息

        }
コード例 #2
0
 private void LoadAdminInfo()
 {
     if (!System.IO.File.Exists(Properties.Resource.AdminInfoFilePath))
     {
         _adminInfo = new AdminInfo { Name = "admin", Password = MD5Converter.GetMD5("123456") };
         _adminInfo.FilePath = Properties.Resource.AdminInfoFilePath;
     }
     else
     {
         _adminInfo = (AdminInfo)_serializer.DeSerialize(Properties.Resource.AdminInfoFilePath, typeof(AdminInfo));
     }
     SaveAdminInfo();
 }