Beispiel #1
0
        public IWindow ResolveWindow()
        {
            ConnectionProperties connectionProperties = new ConnectionProperties();
            RestClient           restClient           = new RestClient(connectionProperties);
            ConverterJson        converterJson        = new ConverterJson();

            IUserDao          userDao          = new UserDao(restClient, converterJson);
            IPlayerDao        playerDao        = new PlayerDao(restClient, converterJson);
            IFactionDao       factionDao       = new FactionDao(restClient, converterJson);
            IFactionPlayerDao factionPlayerDao = new FactionPlayerDao(restClient, converterJson);
            //Mapper mapper = new Mapper();
            Converter <Player, PlayerDto> playerConverter = new PlayerConverter();

            IUserService          userService          = new UserService(userDao);
            IPlayerService        playerService        = new PlayerService(playerDao);
            IFactionService       factionService       = new FactionService(factionDao);
            IFactionPlayerService factionPlayerService = new FactionPlayerService(factionPlayerDao);

            IVMFacade        vmFacade        = new VMFacade(factionPlayerService, factionService, playerService);
            IPlayerVmFacade  playerVmFacade  = new PlayerVmFacade(factionPlayerService, factionService, playerService);
            IFactionVmFacade factionVmFacade = new FactionVmFacade(factionPlayerService, factionService, playerService);

            IUserViewModel    userViewModel    = new UserViewModel(vmFacade, userService);
            IPlayerViewModel  playerViewModel  = new PlayerViewModel(playerVmFacade);
            IFactionViewModel factionViewModel = new FactionViewModel(factionVmFacade);
            IMainViewModel    mainViewModel    = new MainViewModel(connectionProperties, playerViewModel, factionViewModel, userViewModel);
            ViewModelFactory  vmFactory        = new ViewModelFactory(mainViewModel);

            Window main = new Main();

            _window = new MainWindowAdapter(main, vmFactory);
            //vmFactory.CreatePlayerVM(_window);
            return(_window);
        }
Beispiel #2
0
        public void Save(IList <TEntity> obj)
        {
            _db.Set <TEntity>().AddRange(obj);

            foreach (var o in obj)
            {
                GravaLog(new LogEntidade(null, ConverterJson.ObjetoParaJson(o), null, typeof(TEntity).Name, EAcao.Inserido));
            }
        }
Beispiel #3
0
 public UserDao(RestClient restClient, ConverterJson converterJson)
 {
     _restClient    = restClient;
     _converterJson = converterJson;
 }
Beispiel #4
0
 public static void SendNewItemVendor(ItemVendor item)
 {
     SendPlayer s = new SendPlayer(new Send());
     ConverterJson conv = new ConverterJson();
     string jSon = conv.ConvertTOJson(item);
     s.SendPlayerNewItemVendor(jSon);
 }
Beispiel #5
0
 public static void AtualizaEstoqueID(long IdChar)
 {
     Util.WriteLog("Inicio da Atualização de Estoque");
     List<ItemUnitChar> l = CharacterFactory.GetItensChar(StyxWoW.Me, Convert.ToInt64(IdChar));
     SendPlayer s = new SendPlayer(new Send());
     ConverterJson conv = new ConverterJson();
     string jSon = conv.ConvertTOJson(l);
     s.SendItensPlayer(jSon);
     Util.WriteLog("Final da Atualização de Estoque");
 }
Beispiel #6
0
        public static void AtualizaEstoqueGuildID(string nameGuild, long idGuild)
        {
            try
            {
                SendGuild sGuild = new SendGuild(new Send());
                ConverterJson conv = new ConverterJson();
                List<ItemUnitGuild> itensGuild = GuildFactory.GetInstanceGuild(nameGuild, idGuild);
                string itens = conv.ConvertTOJson(itensGuild);
                sGuild.SendGuildItens(itens);

            }
            catch (AggregateException aex)
            {
                aex.Handle((ex) =>
                {
                    return true;
                });
            }
            catch (Exception ex)
            {

                Util.WriteLog(ex.Message);
            }
        }
        //private readonly RestClient _restClient;
        //private readonly ConverterJson _converterJson;

        public ExamplePlayerDao(RestClient restClient, ConverterJson converterJson) : base(restClient, converterJson)
        {
        }
 public GenericDao(RestClient restClient, ConverterJson converterJson)
 {
     _restClient    = restClient;
     _converterJson = converterJson;
 }
Beispiel #9
0
 public FactionDao(RestClient restClient, ConverterJson converterJson)
 {
     _restClient    = restClient;
     _converterJson = converterJson;
 }
Beispiel #10
0
 public PlayerDao(RestClient restClient, ConverterJson converterJson) : base(restClient, converterJson)
 {
     _restClient    = restClient;
     _converterJson = converterJson;
 }