Example #1
0
        protected override void Init()
        {
            _symbolGraph = new BarMarketGraph(this)
            {
                Name = "Bar market graph"
            };
            _pathLogic = new PathLogic <CurrencyNode>(1000);
            foreach (var symbol in Symbols)
            {
                if (symbol.IsNull || !symbol.IsTradeAllowed)
                {
                    continue;
                }

                var barSymbol  = new BarSymbol(symbol, this);
                var commission = symbol.CalculateCommission(Account.Type, false);
                if (double.IsNaN(commission))
                {
                    commission = 0;
                }
                _symbolGraph.AddEdge(symbol.BaseCurrency, symbol.CounterCurrency, barSymbol, commission);
                _symbolGraph.AddEdge(symbol.CounterCurrency, symbol.BaseCurrency, barSymbol, commission);
            }

            _currencyId      = _symbolGraph[Currency]?.Id ?? -1;
            _currencyListIds = new List <int>();
            foreach (var currency in CurrencyList.ParseCsvLine())
            {
                var node = _symbolGraph[currency];
                if (node != null)
                {
                    _currencyListIds.Add(node.Id);
                }
            }
        }
 public FormMain()
 {
     InitializeComponent();
     path    = new PathLogic();
     updater = new UpdateLogic();
     remote  = new RemoteLogic();
 }
Example #3
0
        protected override void Init()
        {
            _symbolGraph = new MarketGraph(this)
            {
                Name = "Market graph"
            };
            _pathLogic = new PathLogic <CurrencyNode>(1000);
            foreach (var symbol in Symbols)
            {
                if (symbol.IsNull || !symbol.IsTradeAllowed)
                {
                    continue;
                }

                var commission = symbol.CalculateCommission(Account.Type, false);
                if (double.IsNaN(commission))
                {
                    commission = 0;
                }
                _symbolGraph.AddEdge(symbol.BaseCurrency, symbol.CounterCurrency, symbol, commission);
                _symbolGraph.AddEdge(symbol.CounterCurrency, symbol.BaseCurrency, symbol, commission);

                symbol.Subscribe();
            }

            _currencyId     = _symbolGraph[BaseCurrency]?.Id ?? -1;
            _lastSearchTime = DateTime.Now - _delay - _delay;
        }
Example #4
0
        public FormMain()
        {
            InitializeComponent();
            path    = new PathLogic();
            updater = new UpdateLogic();
            remote  = new RemoteLogic();

            skinManager = MaterialSkinManager.Instance;
            skinManager.AddFormToManage(this);
            skinManager.Theme       = MaterialSkinManager.Themes.LIGHT;
            skinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);

            // Show tooltips
            listViewMods.ShowItemToolTips = true;

            // Upgrade settings from previous version
            if (Properties.Settings.Default.UpgradeRequired)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeRequired = false;
                Properties.Settings.Default.Save();
            }

            var modList = Properties.Settings.Default.ModsList.Split(',');

            foreach (var mod in modList)
            {
                if (!defaultMods.Contains(mod))
                {
                    defaultMods.Add(mod.ToLower());
                }
            }
        }
Example #5
0
        public void ExportAndPlay()
        {
            Export();
            string songFolder = PathLogic.GetSongFolder();

            File.Delete(Path.Combine(songFolder, audicaFile.desc.songID + ".audica"));
            File.Copy(audicaFile.filepath, Path.Combine(songFolder, audicaFile.desc.songID + ".audica"));

            string newPath = Path.GetFullPath(Path.Combine(songFolder, @"..\..\..\..\"));

            System.Diagnostics.Process.Start(Path.Combine(newPath, "Audica.exe"));
        }
Example #6
0
        public MainWindow()
        {
            Logger.Setup();
            InitializeComponent();
            var pl = new PathLogic();

            var bsPath = pl.GetInstallationPath();

            if (Directory.Exists(bsPath))
            {
                SetCustomSongPath(bsPath);
            }
        }
Example #7
0
        public void PathLogic()
        {
            Mock <IUnitOfWork>     uow  = new Mock <IUnitOfWork>();
            Mock <IPathRepository> repo = new Mock <IPathRepository>();

            PathLogic logic = new PathLogic(uow.Object, repo.Object);

            var path     = new Path();
            var sequence = new MockSequence();

            repo.InSequence(sequence).Setup(r => r.Create(path));
            repo.InSequence(sequence).Setup(r => r.Update(path));
            repo.InSequence(sequence).Setup(r => r.Get(path.Id));
            repo.InSequence(sequence).Setup(r => r.Delete(path.Id));
            logic.Create(path);
            logic.Update(path);
            logic.Get(path.Id);
            logic.Delete(path.Id);
        }
Example #8
0
        public FormMain()
        {
            InitializeComponent();
            path    = new PathLogic();
            updater = new UpdateLogic();
            remote  = new RemoteLogic();
            listViewMods.ShowItemToolTips = true;
            // Show tooltips

            var modList = Properties.Settings.Default.ModsList.Split(',');

            foreach (var mod in modList)
            {
                if (!defaultMods.Contains(mod))
                {
                    defaultMods.Add(mod.ToLower());
                }
            }
        }
Example #9
0
        /*public static void InstallGame()
         * {
         *  if (!Directory.Exists(Environment.CurrentDirectory + "\\Beat Saber")) {
         *      Con.Error("Folder does not exist, cannot move nothing.");
         *      BeginInputOption();
         *  } else {
         *      AskForPath();
         *
         *      try
         *      {
         *          FileSystem.CopyDirectory("Beat Saber", "Beat Saber - Copy");
         *          FileSystem.MoveDirectory("Beat Saber", gamePath, true);
         *          Con.Space();
         *          Con.LogSuccess("Finished moving Files");
         *          Con.Space();
         *          FileSystem.RenameDirectory("Beat Saber - Copy", "Beat Saber");
         *          Con.Log("If you need any help, join the Beat Saber Legacy Group discord.");
         *          Con.Log("Find more information on our website:", "https://bslegacy.com", ConsoleColor.Green);
         *          Con.Space();
         *          Con.Log("Install plugins here:", "https://bslegacy.com/plugins", ConsoleColor.Green);
         *          Con.Space();
         *          Con.Log("\t\t - RiskiVR (Risk#3904)");
         *          Con.Space();
         *          BeginInputOption();
         *      }
         *      catch
         *      {
         *          Con.Space();
         *          Con.Error("Move Directory Failed or operation was canceled");
         *          Con.Space();
         *          BeginInputOption();
         *      }
         *  }
         * }*/

        public static void AskForPath()
        {
            Con.Space();
            Con.Log("Current game path is ", PathLogic.NotFoundHandler(), ConsoleColor.Yellow);
            Con.Log("Would you like to change this?", " [Y/N]", ConsoleColor.Yellow);
            Con.Input();
            string changeLocalation = Console.ReadLine();

            if (changeLocalation == "Y" || changeLocalation == "y" || changeLocalation == "YES" || changeLocalation == "yes" || changeLocalation == "Yes")
            {
                try
                {
                    FolderSelect.InitialFolder = PathLogic.NotFoundHandler();
                    FolderSelect.ShowDialog();
                    gamePath = FolderSelect.Folder;
                }
                catch { Con.Error("Select Folder Failed"); BeginInputOption(); }
            }
            else
            {
                gamePath = PathLogic.NotFoundHandler();
            }
        }
        public void PathLogic()
        {
            Mock<IUnitOfWork> uow = new Mock<IUnitOfWork>();
            Mock<IPathRepository> repo = new Mock<IPathRepository>();

            PathLogic logic = new PathLogic(uow.Object, repo.Object);

            var path = new Path();
            var sequence = new MockSequence();
            repo.InSequence(sequence).Setup(r => r.Create(path));
            repo.InSequence(sequence).Setup(r => r.Update(path));
            repo.InSequence(sequence).Setup(r => r.Get(path.Id));
            repo.InSequence(sequence).Setup(r => r.Delete(path.Id));
            logic.Create(path);
            logic.Update(path);
            logic.Get(path.Id);
            logic.Delete(path.Id);
        }
Example #11
0
 public FormPlatformSelect(PathLogic _logic)
 {
     InitializeComponent();
     logic = _logic;
 }