예제 #1
0
파일: MainForm.cs 프로젝트: Sank-WoT/Forex
 // Создание изменение интерфейса
 public void EditInterface(string lang)
 {
     Gettext.LanguageCode                = lang;
     settingsToolStripMenuItem.Text      = Gettext._("Settings");
     windowToolStripMenuItem.Text        = Gettext._("Window");
     chartToolStripMenuItem.Text         = Gettext._("Chart");
     AboutToolStripMenuItem.Text         = Gettext._("About");
     создателиToolStripMenuItem.Text     = Gettext._("Autors");
     helpToolStripMenuItem1.Text         = Gettext._("Help");
     currencyPairsToolStripMenuItem.Text = Gettext._("Currency pairs");
     eURUSDToolStripMenuItem.Text        = Gettext._("EUR/USD");
     USDJPYToolStripMenuItem.Text        = Gettext._("USD/JPY");
     langToolStripMenuItem.Text          = Gettext._("Russian");
 }
예제 #2
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            label.text = Gettext._(label.text);
            switch (property.propertyType)
            {
            case SerializedPropertyType.Float:
                var attribute = (LocalizableAttribute)this.attribute;
                EditorGUI.Slider(position, property, attribute.min, attribute.max, label);
                break;

            default:
                EditorGUI.PropertyField(position, property, label);
                break;
            }
        }
예제 #3
0
파일: MainForm.cs 프로젝트: Sank-WoT/Forex
        /// <summary>
        ///  Метод закрытия приложения
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnClosing(object sender, FormClosingEventArgs e)
        {
            string mess = "";

            mess = Gettext._("Are You Sure?");

            if (MessageBox.Show(mess, "", MessageBoxButtons.YesNo) == DialogResult.No)
            {
                e.Cancel    = true;
                Activ.Form1 = false;
            }
            else
            {
                // Продолжить закрытие
                e.Cancel = false;
                // Скрыть форму до закрытия
                this.Hide();
            }
        }
예제 #4
0
파일: Internet.cs 프로젝트: Sank-WoT/Forex
        /// <summary>
        /// Этот метод проверяет интернет соединение и переводит программу в автономный режим в случае его отсутсвия +
        /// </summary>
        /// <param name="value">Название котировки</param>
        /// <param name="internetActionFinished">оповещении о Окончание запроса </param>
        public bool ReqestInet(string value, bool internetActionFinished)
        {
            bool inet;

            try
            {
                // запрос на сайт
                var webReq = WebRequest.Create("http://myfirstphpapp-skro.rhcloud.com/get_currency.php?time=" + "0" + "&limit=" + "1" + "&sign=" + value);
                // получение ответа
                WebResponse webRes = webReq.GetResponse();
                webRes.Close();
                inet = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(Gettext._("Lack of or inaccessible internet site go offline"));
                inet = false;
            }
            return(inet);
        }
예제 #5
0
        private void OnWizardCreate()
        {
            var components = new List <Type>();

            if (this.metaInformation)
            {
                components.Add(typeof(VRMMeta));
            }
            if (this.vrmBlendShape)
            {
                components.Add(typeof(VRMBlendShapeProxy));
            }
            if (this.firstPerson)
            {
                components.Add(typeof(VRMFirstPerson));
            }
            if (this.lookAt)
            {
                components.Add(typeof(VRMLookAtHead));
            }
            if (this.vrmSpringBone)
            {
                components.Add(typeof(VRMSpringBone));
            }

            CopyVRMSettings.Copy(
                source: this.sourceAvatar.gameObject,
                destination: this.destinationAvatar.gameObject,
                components
                );

            EditorUtility.DisplayDialog(
                MenuItems.Name + "-" + MenuItems.Version,
                Gettext._("Settings copying and pasting is completed."),
                Gettext._("OK")
                );
        }
예제 #6
0
파일: MainForm.cs 프로젝트: Sank-WoT/Forex
        /// <summary>
        /// Конструктор стартового состояния окна
        /// </summary>
        /// <param name="x">размер по оси x</param>
        /// <param name="y">размер по оси y</param>

        public MainForm(int x, int y)
        {
            Gettext.LanguageCode = "ru";
            string pathDirectory = Application.StartupPath;                  // Путь к директории
            string pathFile      = pathDirectory + "\\" + "eurusd" + ".txt"; // Путь к файлу c котировками eurusd

            Methods Time = new Methods();

            // проверка интернет соединения ассинхронно
            tConnect = Task.Run(() =>
            {
                Internet inCon   = new Internet();
                InetConnect.Inet = inCon.TryCon("eurusd", sync, internetActionFinished);
            });

            switch (Time.TradeStop(DateTime.Now))
            {
            case "Sat": MessageBox.Show(Gettext._("Forex day off")); break;

            case "Sun": MessageBox.Show(Gettext._("Forex day off")); break;
            }

            this.InitializeComponent();
            // размеры контейнера
            startContainer.Size     = new Size(x, y - WSettings.Size.Height);
            startContainer.Location = new Point(0, 0);
            // проверка существования директории
            DirectoryWork.Set(pathDirectory);
            // проверка существования файла
            FileInspection.Set(pathFile);
            // настройка под все  экраны
            xS = x / 1920.0;
            // настройка под все  экраны
            yS = y / 1080.0;
            // задание размеров экрана
            this.Size = new Size(x, y);

            #region Переменные командной комбинации к Меню текущей форме
            // командная комбинация клавиш для откытия настроек окна
            windowToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.W;
            // командная комбинация клавиш для откытия настроек графика
            chartToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.C;
            // командная комбинация клавиш для откытия графика USDEUR
            eURUSDToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.U;
            // командная комбинация клавиш для откытия графика EURYPJ
            USDJPYToolStripMenuItem.ShortcutKeys = Keys.Control | Keys.Y;
            #endregion

            // Грузящийся курсор
            Cursor.Current = Cursors.WaitCursor;
            tConnect.Wait();
            // Возвращение к нормальному состоянию
            Cursor.Current = Cursors.Default;

            // передача строки подключения
            Bd BasaDan = new Bd("Data Source = (LocalDB)\\MSSQLLocalDB; AttachDbFilename='" + Application.StartupPath + "\\Forex.mdf'; Integrated Security = True; Connect Timeout = 30");
            // проверка интернет соединения
            if (true == InetConnect.Inet)
            {
                tTask = LoadBdQuote(BasaDan);
                List <int>    timeL = new List <int>();
                List <double> sellL = new List <double>();
                List <double> buyL  = new List <double>();
                // получение событий парралельно
                ParserEventFabric Parse = new ParserEventFabric();
                BasaDan.LoadInBdEvent("https://myfirstphpapp-skro.rhcloud.com/get_Event.php", BasaDan.SelectLastIdEvent(), Parse);

                ParserEventGroupFabric Parse1 = new ParserEventGroupFabric();
                BasaDan.LoadInBdEventGroup("https://myfirstphpapp-skro.rhcloud.com/get_EventGroup.php", BasaDan.SelectLastIdEventGroup(), Parse1);

                BasaDan.Select("eurusd", ref timeL, ref sellL, ref buyL);
            }
            // выбор событий из БД по id
            //Events = BasaDan.SelectEvent(5000);
            // выбор событий по Id_Group
            // Events = BasaDan.SelectSameEvent(20);
            // выбор грядущих событий
            // выбор из группы события по id
            // Groups = BasaDan.SelectEventGroup(500);
            // выбор группы по name
            // Groups = BasaDan.SelectEventGroup("'Выступление представителя ФРС США Джеффри Лэкера'");
            int NowTime = Convert.ToInt32((DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0)).TotalSeconds - 15) - 3600 * 1;
            Console.WriteLine(NowTime);
            FutureEvent = BasaDan.SelectEventTime(1495209600);
        }
예제 #7
0
파일: MainForm.cs 프로젝트: Sank-WoT/Forex
 /// <summary>
 /// The output method window about the creators
 /// </summary>
 /// <param name="sender">object</param>
 /// <param name="e">EventArgs</param>
 private void CreatoresToolStripMenuItem_Click(object sender, EventArgs e)
 {
     // сообщение о создателях
     MessageBox.Show(Gettext._("Creators \n\nSerobabov Alexandr - executive Director \nBondarev Alexandr -  executive Director\nTamarenko Andrey - specialist in web technologies\n\n ©Product Project Mordor"));
 }
예제 #8
0
        protected override bool DrawWizardGUI()
        {
            base.DrawWizardGUI();
            this.isValid = true;

            if (!this.metaInformation && !this.vrmBlendShape && !this.firstPerson && !this.vrmSpringBone)
            {
                this.isValid = false;
                return(true);
            }

            EditorGUILayout.HelpBox(string.Format(
                                        this.vrmBlendShape
                    ? Gettext._("“{0}”and its VRMBlendShapes will be overwritten.")
                    : Gettext._("“{0}”will be overwritten."),
                                        "Destination Avatar"
                                        ), MessageType.None);

            if (this.sourceAvatar && this.destinationAvatar &&
                CopyVRMSettings.GetPrefabAssetPath(this.sourceAvatar.gameObject)
                == CopyVRMSettings.GetPrefabAssetPath(this.destinationAvatar.gameObject))
            {
                EditorGUILayout.HelpBox(string.Format(
                                            Gettext._("“{0}” and “{1}” are instances of same prefab."),
                                            "Source Avatar",
                                            "Destination Avatar"
                                            ), MessageType.Error);
                this.isValid = false;
            }

            foreach (var labelAndAnimator in new Dictionary <string, Animator> {
                { "Source Avatar", this.sourceAvatar },
                { "Destination Avatar", this.destinationAvatar },
            })
            {
                if (!labelAndAnimator.Value)
                {
                    this.isValid = false;
                    continue;
                }

                Transform transform = labelAndAnimator.Value.transform;
                if (transform != transform.root)
                {
                    EditorGUILayout.HelpBox(
                        string.Format(Gettext._("“{0}” is not root object."), labelAndAnimator.Key),
                        MessageType.Error
                        );
                    this.isValid = false;
                    continue;
                }

                foreach (var typeAndPropertyName in CopyVRMSettings.RequiredComponentsAndFields)
                {
                    var component = labelAndAnimator.Value.GetComponent(typeAndPropertyName.Key);
                    if (!labelAndAnimator.Value.GetComponent(typeAndPropertyName.Key))
                    {
                        EditorGUILayout.HelpBox(string.Format(
                                                    Gettext._("“{0}” is not set “{1}” component."),
                                                    labelAndAnimator.Key,
                                                    typeAndPropertyName.Key
                                                    ), MessageType.Error);
                        this.isValid = false;
                        continue;
                    }

                    if (string.IsNullOrEmpty(typeAndPropertyName.Value))
                    {
                        continue;
                    }

                    if (typeAndPropertyName.Key.GetField(
                            name: typeAndPropertyName.Value,
                            bindingAttr: BindingFlags.DeclaredOnly | BindingFlags.Instance | BindingFlags.Public
                            ).GetValue(obj: component) == null)
                    {
                        EditorGUILayout.HelpBox(string.Format(
                                                    Gettext._("“{0}”’s “{1}” is null."),
                                                    labelAndAnimator.Key,
                                                    typeAndPropertyName.Key + "." + typeAndPropertyName.Value
                                                    ), MessageType.Error);
                        this.isValid = false;
                        continue;
                    }
                }
            }

            return(true);
        }
예제 #9
0
 /// <summary>
 /// ダイアログを開きます。
 /// </summary>
 internal static void Open()
 {
     ScriptableWizard
     .DisplayWizard <Wizard>(MenuItems.Name + "-" + MenuItems.Version, Gettext._("Copy and Paste"));
 }