Пример #1
0
        private PoeTradeSettings TryLoadSettings()
        {
            Console.WriteLine($"Looking for settings in path '{PoeControlUrlFilePath()}' ...");
            var settings = TryFindPoeTradeSettings();

            if (settings == null)
            {
                Console.WriteLine(@"Please enter your poe trade id (i.e. http://control.poe.xyz.is/YOURID)");
                var tradeId = Console.ReadLine();

                if (tradeId != null)
                {
                    settings = new PoeTradeSettings()
                    {
                        BaseUrl   = @"http://control.poe.xyz.is/",
                        ControlId = tradeId
                    };
                    SavePoeTradeSettings(settings);
                }
            }

            return(settings);
        }
Пример #2
0
 private void SavePoeTradeSettings(PoeTradeSettings tradeId)
 {
     File.WriteAllText(PoeControlUrlFilePath(), JsonConvert.SerializeObject(tradeId, Formatting.Indented));
 }