Exemplo n.º 1
0
        private void InitializeLogger()
        {
            var logFile = LayerBlockchainNetwork.GetIpAddress().Replace(':', '_') + ".txt";

            var config  = new NLog.Config.LoggingConfiguration();
            var logfile = new NLog.Targets.FileTarget("logfile")
            {
                FileName = logFile
            };
            var logconsole = new NLog.Targets.ConsoleTarget("logconsole");

            config.AddRule(LogLevel.Trace, LogLevel.Fatal, logconsole);
            config.AddRule(LogLevel.Trace, LogLevel.Fatal, logfile);

            LogManager.Configuration = config;
        }
Exemplo n.º 2
0
        public WalletPage(User user)
        {
            InitializeComponent();
            InitializeLogger();
            TryCreateShortcut(); // create shortcut, so i will be able to show toasts

            //INITIALIZE CHAIN, ETC
            _loggedUser = user;
            var bank = new WalletBank();

            _loggedUserWallet = bank.FindWallet(user.Address);
            _friChain         = new BlockChain(LayerBlockchainNetwork.GetIpAddress());

            //REGISTER CLOSING EVENET
            Application.Current.MainWindow.Closing += new CancelEventHandler(AppClosing);

            //SET GUI PROPERTIES
            InitializeProfile();
            UpdateBalance();
            UpdateRawChain();
            UpdatePeerList();
        }