Example #1
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        this.KeyReleaseEvent += ClipboardWorkaround.HandleKeyReleaseEvent;
        TDIMain.MainNotebook  = tdiMain;
        this.KeyReleaseEvent += TDIMain.TDIHandleKeyReleaseEvent;
        //Передаем лебл
        QSMain.StatusBarLabel = labelStatus;
        this.Title            = MainSupport.GetTitle();
        QSMain.MakeNewStatusTargetForNlog();

        MainSupport.LoadBaseParameters();

        MainUpdater.RunCheckVersion(true, true, true);
        QSMain.CheckServer(this);          // Проверяем настройки сервера

        if (QSMain.User.Login == "root")
        {
            string        Message = "Вы зашли в программу под администратором базы данных. У вас есть только возможность создавать других пользователей.";
            MessageDialog md      = new MessageDialog(this, DialogFlags.DestroyWithParent,
                                                      MessageType.Info,
                                                      ButtonsType.Ok,
                                                      Message);
            md.Run();
            md.Destroy();
            Users WinUser = new Users();
            WinUser.Show();
            WinUser.Run();
            WinUser.Destroy();
            return;
        }

        UsersAction.Sensitive = QSMain.User.Admin;
    }
Example #2
0
        private void main_Load_1(object sender, EventArgs e)
        {
            {
                mainUpdater = new MainUpdater(sAPI_Key, sAPI_Secret);

                coinList = mainUpdater.getUpdateList();
                if (coinList.Count < 1)
                {
                    MessageBox.Show("Init error due to API error, try again.");
                    Close();
                    return;
                }
                mainUpdater.updateHoldList();
                holdList = mainUpdater.holdList.Copy();

                for (int i = 0; i < coinList.Count; i++)
                {
                    list_coinName.Items.Add(coinList[i]);
                }

                showHoldList = new DataTable();
                showHoldList.Columns.Add("Name", typeof(string));
                showHoldList.Columns.Add("Units", typeof(double));
                showHoldList.Columns.Add("Value", typeof(double));
                showHoldList.Columns.Add("Total", typeof(double));
            }

            {
                tradeHistory = new TradeHistory(sAPI_Key, sAPI_Secret);
                if (tradeHistory.loadFile() < 0)
                {
                    Close();
                    return;
                }
            }

            {
                macro = new MacroSetting(sAPI_Key, sAPI_Secret, coinList);
                macro.setLastKrw();

                if (macro.loadFile() < 0)
                {
                    Close();
                    return;
                }
            }

            {
                thread_updater      = new Thread(() => executeMainUpdater());
                thread_tradeHistory = new Thread(() => executeTradeHistoryUpdate());
                thread_macro        = new Thread(() => executeMacro());

                thread_updater.Start();
                thread_tradeHistory.Start();
                thread_macro.Start();
            }

            isInit = true;
        }
Example #3
0
        private void Awake()
        {
            _updater   = gameObject.AddComponent <MainUpdater>();
            _loader    = gameObject.AddComponent <MainLoader>();
            _luaLoader = gameObject.AddComponent <LuaLoader>();
            _luaHelper = gameObject.AddComponent <LuaHelper>();

            DontDestroyOnLoad(gameObject);
        }
Example #4
0
        public MainWindow()
        {
            DataContext = Settings.Default;
            InitializeComponent();

            if (Settings.Default.maximized == false)
            {
                this.WindowState = WindowState.Normal;
            }
            else
            {
                this.WindowState = WindowState.Maximized;
            }

            logger.Trace("Запуск приложения");

            if (File.Exists("jobs.xml"))
            {
                // передаем в конструктор тип класса
                XmlSerializer formatter = new XmlSerializer(typeof(SavedJob));

                // десериализация
                using (FileStream fs = new FileStream("jobs.xml", FileMode.OpenOrCreate))
                {
                    XmlReader reader = new XmlTextReader(fs);
                    if (formatter.CanDeserialize(reader))
                    {
                        SavedJob newjob = (SavedJob)formatter.Deserialize(reader);

                        if (newjob != null)
                        {
                            MainJob.Jobs = newjob.Jobs;
                        }
                    }
                }
            }

            db_ToYandex.DataContext = MainJob.Jobs;

            updater = new MainUpdater(this);
        }
Example #5
0
        public MainWindow() : base(WindowType.Toplevel)
        {
            Build();

            QSMain.StatusBarLabel = labelStatus;
            this.Title            = QSSupportLib.MainSupport.GetTitle();
            QSMain.MakeNewStatusTargetForNlog();
            QSSupportLib.MainSupport.LoadBaseParameters();

            MainUpdater.RunCheckVersion(true, true, true);

            Reference.RunReferenceItemDlg += OnRunReferenceItemDialog;
            QSMain.ReferenceUpdated       += OnReferenceUpdate;

            if (QSMain.User.Login == "root")
            {
                string        Message = "Вы зашли в программу под администратором базы данных. У вас есть только возможность создавать других пользователей.";
                MessageDialog md      = new MessageDialog(this, DialogFlags.DestroyWithParent,
                                                          MessageType.Info,
                                                          ButtonsType.Ok,
                                                          Message);
                md.Run();
                md.Destroy();
                OnUsersActionActivated(null, null);
                return;
            }

            UsersAction.Sensitive    = QSMain.User.Admin;
            labelUser.LabelProp      = QSMain.User.Name;
            ActionDocTypes.Sensitive = QSMain.User.Permissions["edit_db"];
            buttonInput.Sensitive    = QSMain.User.Permissions["can_edit"];

            // Создаем главное окно
            ComboWorks.ComboFillReference(comboDocType, "doc_types", ComboWorks.ListMode.OnlyItems);
            selectperiodDocs.ActiveRadio = SelectPeriod.Period.Week;
        }
Example #6
0
 public void Initialize(MainLoader loader, MainUpdater updater)
 {
     _loader  = loader;
     _updater = updater;
 }
 public LoadAssetOperation(MainLoader loader, MainUpdater updater, string assetPath)
 {
     _loader    = loader;
     _updater   = updater;
     _assetPath = assetPath;
 }
Example #8
0
        private void main_Load(object sender, EventArgs e)
        {
            {
                mainUpdater = new MainUpdater(sAPI_Key, sAPI_Secret);

                coinList = new List <string>(mainUpdater.setCoinList());
                if (coinList == null)
                {
                    MessageBox.Show("Init error due to API error, try again.");
                    Close();
                    return;
                }
                mainUpdater.update();
                account = mainUpdater.account;
                ticker  = mainUpdater.ticker;

                for (int i = 0; i < coinList.Count; i++)
                {
                    list_coinName.Items.Add(coinList[i]);
                }

                showAccount = new DataTable();
                showAccount.Columns.Add("Name", typeof(string));
                showAccount.Columns.Add("Units", typeof(double));
                showAccount.Columns.Add("Price", typeof(double));
                showAccount.Columns.Add("Total", typeof(double));

                for (int i = 0; i < account.Count; i++)
                {
                    if (!"USDT".Equals(account[i].coinName.ToUpper()))
                    {
                        DataRow dataRow = showAccount.NewRow();
                        dataRow["Name"]  = account[i].coinName;
                        dataRow["Units"] = account[i].locked + account[i].valid;
                        dataRow["Price"] = account[i].coinName == "KRW" ? 1 : ticker[account[i].coinName].close;
                        dataRow["Total"] = (double)dataRow["Units"] * (double)dataRow["Price"];
                        showAccount.Rows.Add(dataRow);
                    }
                }

                dataGridView_holdList.DataSource = showAccount;
                dataGridView_holdList.Columns["Units"].DefaultCellStyle.Format = "#,0.####";
                dataGridView_holdList.Columns["Price"].DefaultCellStyle.Format = "#,0.##";
                dataGridView_holdList.Columns["Total"].DefaultCellStyle.Format = "#,0.##";
            }

            {
                tradeHistory = new TradeHistory(sAPI_Key, sAPI_Secret);
                if (tradeHistory.loadFile() < 0)
                {
                    Close();
                    return;
                }
            }

            {
                macro = new MacroSetting(sAPI_Key, sAPI_Secret, coinList);
                if (macro.loadFile() < 0)
                {
                    Close();
                    return;
                }
            }

            {
                bot = new BotSetting(sAPI_Key, sAPI_Secret, coinList);
                if (bot.loadFile() < 0)
                {
                    Close();
                    return;
                }
            }

            {
                thread_updater      = new Thread(() => executeMainUpdater());
                thread_tradeHistory = new Thread(() => executeTradeHistoryUpdate());
                thread_macro        = new Thread(() => executeMacro());

                thread_updater.Start();
                thread_tradeHistory.Start();
                thread_macro.Start();
            }

            isInit = true;
        }