Ejemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            fixer = new Frack_Fixer(FS, CloudCoinCore.Config.milliSecondsToTimeOut);
            Title = "CloudCoin CE - 1.2.0";
            lblWorkspace.StringValue = "Workspace : " + FS.RootPath;
            printWelcome();
            ShowCoins();
            raidaLevel.MaxValue = raida.nodes.Count();
            Echo(true);
            txtLogs.TextColor = NSColor.White;
            //txtOnes.TextColor = NSColor.White;
            //txtFives.TextColor = NSColor.White;
            //txtQtrs.TextColor = NSColor.White;
            //txtHundreds.TextColor = NSColor.White;
            //txtTwoFifties.TextColor = NSColor.White;
            //txtOnes.BackgroundColor = NSColor.FromRgb(45, 146, 255);
            //txtOnes.Cell.BackgroundColor = NSColor.FromRgb(45, 146, 255);
            txtOnes.Formatter     = new NumberOnlyFormattter();
            txtFives.Formatter    = new NumberOnlyFormattter();
            txtQtrs.Formatter     = new NumberOnlyFormattter();
            txtHundreds.Formatter = new NumberOnlyFormattter();
            txtQtrs.Formatter     = new NumberOnlyFormattter();

            logger = new SimpleLogger(FS.LogsFolder + "logs" + DateTime.Now.ToString("yyyyMMdd").ToLower() + ".log", true);


            //txtOnes.TextColor = NSColor.FromRgb(45, 146, 255);
            raida.LoggerHandler += Raida_LogRecieved;



            // Do any additional setup after loading the view.
        }
Ejemplo n.º 2
0
        public static void Main(params string[] args)
        {
            Setup();
            initConfig();
            updateLog("Loading Network Directory");
            SetupRAIDA();
            FS.LoadFileSystem();
            RAIDA.logger = logger;
            fixer        = new Frack_Fixer(FS, Config.milliSecondsToTimeOut);

            Console.Clear();
            // Program.exe <-g|--greeting|-$ <greeting>> [name <fullname>]
            // [-?|-h|--help] [-u|--uppercase]
            #region CommandLineArguments
            CommandLineApplication commandLineApplication =
                new CommandLineApplication(throwOnUnexpectedArg: false);
            CommandArgument names = null;
            commandLineApplication.Command("name",
                                           (target) =>
                                           names = target.Argument(
                                               "fullname",
                                               "Enter the full name of the person to be greeted.",
                                               multipleValues: true));
            CommandOption greeting = commandLineApplication.Option(
                "-$|-g |--greeting <greeting>",
                "The greeting to display. The greeting supports"
                + " a format string where {fullname} will be "
                + "substituted with the full name.",
                CommandOptionType.NoValue);
            CommandOption uppercase = commandLineApplication.Option(
                "-u | --uppercase", "Display the greeting in uppercase.",
                CommandOptionType.NoValue);
            commandLineApplication.HelpOption("-? | -h | --help");

            CommandOption echo = commandLineApplication.Option(
                "-$|-e |--echo ",
                "The greeting to display. The greeting supports"
                + " a format string where {fullname} will be "
                + "substituted with the full name.",
                CommandOptionType.NoValue);

            CommandOption total = commandLineApplication.Option(
                "-$|-b |--bank ",
                "Shows details of your coins in bank.",
                CommandOptionType.NoValue);

            CommandOption backup = commandLineApplication.Option(
                "-$|-ba |--backup ",
                "Backup your coins to specified folder.",
                CommandOptionType.SingleValue);


            CommandOption folders = commandLineApplication.Option(
                "-$|-f |--folders ",
                "The command to display CloudCoin Working Folder Structure",
                CommandOptionType.NoValue);

            CommandOption pown = commandLineApplication.Option(
                "-$|-p |--pown ",
                "The command to pown/detect/import your CloudCoins.",
                CommandOptionType.NoValue);

            CommandOption detection = commandLineApplication.Option(
                "-$|-d |--detect ",
                "The command to pown/detect/import your CloudCoins.",
                CommandOptionType.NoValue);

            CommandOption import = commandLineApplication.Option(
                "-$|-i |--import ",
                "The command to pown/detect/import your CloudCoins.",
                CommandOptionType.NoValue);

            #endregion

            if (args.Length < 1)
            {
                printWelcome();
                while (true)
                {
                    try
                    {
                        int input = DisplayMenu();
                        ProcessInput(input).Wait();
                        if (input == 10)
                        {
                            break;
                        }
                    }
                    catch (Exception e)
                    {
                        break;
                    }
                }
            }
            else
            {
                commandLineApplication.OnExecute(async() =>
                {
                    if (echo.HasValue())
                    {
                        //ech();
                        await EchoRaida();
                    }
                    if (folders.HasValue())
                    {
                        ShowFolders();
                    }

                    if (pown.HasValue() || detection.HasValue() || import.HasValue())
                    {
                        await RAIDA.ProcessNetworkCoins(NetworkNumber);
                    }
                    if (greeting.HasValue())
                    {
                        printWelcome();
                    }
                    if (total.HasValue())
                    {
                        showCoins();
                    }
                    if (backup.HasValue())
                    {
                        Console.WriteLine(backup.Value());
                    }
                    return(0);
                });
                commandLineApplication.Execute(args);
            }
        }
        public MainWindow()
        {
            showDisclaimer();
            rootFolder = getWorkspace();

            raida    = RAIDA.GetInstance();
            raida.FS = RAIDA.FileSystem = FS = new FileSystem(rootFolder);
            FS.CreateDirectories();
            FS.LoadFileSystem();
            logger = new SimpleLogger(FS.LogsFolder + "logs" + DateTime.Now.ToString("yyyyMMdd").ToLower() + ".log", true);
            fixer  = new Frack_Fixer(FS, timeout);
            UpdateCELog("");
            printStarLine();
            UpdateCELog("Starting CloudCoin CE at " + DateTime.Now.ToString("dd-MMM-yyyy hh:mm:ss"));
            printStarLine();
            SetupRAIDA();
            RAIDA.window = this;
            InitializeComponent();
            FS.CreateDirectories();
            //loadJson();
            printWelcome();
            noteOne.NoteCount      = "1";
            noteFive.NoteCount     = "5";
            noteQtr.NoteCount      = "10";
            noteHundred.NoteCount  = "100";
            noteTwoFifty.NoteCount = "250";

            raida1.IsActive  = true;
            raida2.IsActive  = true;
            raida3.IsActive  = true;
            raida4.IsActive  = true;
            raida5.IsActive  = true;
            raida6.IsActive  = true;
            raida7.IsActive  = true;
            raida8.IsActive  = true;
            raida9.IsActive  = true;
            raida10.IsActive = true;
            raida11.IsActive = true;
            raida12.IsActive = true;
            raida13.IsActive = true;
            raida14.IsActive = true;
            raida15.IsActive = true;
            raida16.IsActive = true;
            raida17.IsActive = true;
            raida18.IsActive = true;
            raida19.IsActive = true;
            raida20.IsActive = true;
            raida21.IsActive = true;
            raida22.IsActive = true;
            raida23.IsActive = true;
            raida24.IsActive = true;
            raida25.IsActive = true;



            SetLEDFlashing(true);

            Echo();

            ShowCoins();

            new Thread(delegate() {
                Task.Delay(20000).ContinueWith(t => fix());
                //fix();
            }).Start();

            resumeImport();

            this.PreviewKeyDown += MainWindow_PreviewKeyDown;
        }