Ejemplo n.º 1
0
 // Start is called before the first frame update
 void Start()
 {
     so   = SocketObject.Instance;
     dw   = DataWorker.Instance;
     mine = GetComponent <PlayerScript> ();
     StartCoroutine(AttackByTime());
 }
Ejemplo n.º 2
0
 public string[] DictionaryReadingTest(string fileData)
 {
     File.WriteAllText("TestFile.txt", fileData);
     DataWorker.ReadWordsFromFile("TestFile.txt");
     File.Delete("TestFile.txt");
     return(DataWorker.WordsSet.AllWords);
 }
Ejemplo n.º 3
0
        public string getServiceList()
        {
            var dataWorker = new DataWorker();

            var allWebservices = dataWorker.getWebServiceList();

            WebServiceNode wsn5588 = null;
            int            count   = 0;

            foreach (WebServiceNode wsn in allWebservices)
            {
                Console.WriteLine(String.Format("{0} - {1}", count++, wsn.ServiceID));
                if (5588 == wsn.ServiceID)
                {
                    wsn5588 = wsn;
                }
            }

            if (allWebservices != null)
            {
                var json = JsonConvert.SerializeObject(allWebservices);
                json = "{ \"data\":" + json + "}";
                return(json);
            }
            else
            {
                throw new NullReferenceException();
            }
        }
Ejemplo n.º 4
0
    //List<Room> room = new List<Room>();

    // Use this for initialization
    void Start()
    {
        so = SocketObject.Instance;
        dw = DataWorker.Instance;
        gm = GameManager.Instance;

        //StartCoroutine ("RequestRoomData");

        /*
         * gm._GameState
         *  .DistinctUntilChanged()
         *  .Where(x => x == GameState.ConnectionComp)
         *  .Subscribe(_ => setMenu01Player());
         */

        gm._GameState
        .DistinctUntilChanged()
        .Where(x => x == GameState.CheckRoomData)
        .Subscribe(_ => QuickStart());

        gm._GameState
        .DistinctUntilChanged()
        .Where(x => x == GameState.RoomDataUpdate)
        .Subscribe(_ => RoomDataCheck());
    }
Ejemplo n.º 5
0
        //Метод регистрации пользователя.
        private void RegisterButton_Click(object sender, RoutedEventArgs e)
        {
            string login      = Login.Text.Trim();
            string password_1 = Password_1.Password.Trim();
            string password_2 = Password_2.Password.Trim();
            string name       = Name.Text.Trim();
            string surname    = Surname.Text.Trim();
            string company    = Company.Text.Trim();

            bool check_login    = CheckLogin(this.Login, this.LoginBorder, login);
            bool check_password = CheckPassword(this.Password_1, this.Password_2, this.PasswordBorder_1, this.PasswordBorder_2, password_1, password_2);
            bool check_name     = CheckName(this.Name, this.NameBorder, name);
            bool check_surname  = CheckSurname(this.Surname, this.SurnameBorder, surname);
            bool check_company  = CheckСompany(this.Company, this.CompanyBorder, company);

            if (check_login & check_password & check_name & check_surname & check_company)
            {
                DataWorker.CreatePosition(login, password_1, name, surname, company);

                this.TextResult.Text = "Вы успешно зарегистрировались";
            }
            else
            {
                this.TextResult.Text = "Повторите попытку регистрации";
            }
        }
Ejemplo n.º 6
0
    // Start is called before the first frame update
    void Start()
    {
        so = SocketObject.Instance;
        dw = DataWorker.Instance;
        if (!debug)
        {
            ps = transform.parent.GetComponent <PlayerScript>();
        }

        copyMesh      = Instantiate(originMesh);
        mf            = GetComponent <SkinnedMeshRenderer>();
        mc            = GetComponent <MeshCollider>();
        mf.sharedMesh = copyMesh;
        mf.sharedMesh.RecalculateBounds();
        mf.sharedMesh.RecalculateNormals();
        mc.sharedMesh = mf.sharedMesh;

        for (int i = 0; i < GetComponent <Renderer>().sharedMaterials.Length; i++)
        {
            GetComponent <Renderer>().sharedMaterials[i] = mat;
        }

        start = end = Vector3.zero;
        if (!debug)
        {
            ps.model = this;
        }
    }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     so     = SocketObject.Instance;
     dw     = DataWorker.Instance;
     gm     = GameManager.Instance;
     IChaos = new IntermittentChaos();
     StartCoroutine("Chaos");
 }
Ejemplo n.º 8
0
 //Обновление списка номенклатур
 private void UpdateNomenclatureView()
 {
     AllNomenclature = DataWorker.Sel_nomenclature();
     MainWindow.AllNomenclatureView.ItemsSource = null;
     MainWindow.AllNomenclatureView.Items.Clear();
     MainWindow.AllNomenclatureView.ItemsSource = AllNomenclature;
     MainWindow.AllNomenclatureView.Items.Refresh();
 }
Ejemplo n.º 9
0
 private void UpdateAllUsersView()
 {
     AllUsers = DataWorker.GetAllUsers();
     MainWindow.AllUsersView.ItemsSource = null;
     MainWindow.AllUsersView.Items.Clear();
     MainWindow.AllUsersView.ItemsSource = AllUsers;
     MainWindow.AllUsersView.Items.Refresh();
 }
Ejemplo n.º 10
0
 // Start is called before the first frame update
 void Start()
 {
     so      = SocketObject.Instance;
     dw      = DataWorker.Instance;
     mine    = GetComponent <PlayerScript>();
     handPos = hand.transform.localPosition;
     StartCoroutine(AttackByTime());
 }
Ejemplo n.º 11
0
        static void Main()
        {
            IDataWorker worker = new DataWorker();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1(worker.Accounts.GetAll()));
        }
Ejemplo n.º 12
0
 private void UpdateAllSupplysView()
 {
     //наполнили, обнунлили и опять добавили
     AllSupplys = DataWorker.GetAllSupplys();
     MainWindow.AllSupplysView.ItemsSource = null;
     MainWindow.AllSupplysView.Items.Clear();
     MainWindow.AllSupplysView.ItemsSource = AllSupplys;
     MainWindow.AllSupplysView.Items.Refresh();
 }
Ejemplo n.º 13
0
 //Метод кнопки для запуска теста.
 public void StartTestingButton_Click(object sender, RoutedEventArgs e)
 {
     TestLabel.Content   = NameTest;
     GridMain.Visibility = Visibility.Visible;
     Questions           = DataWorker.GetAllQuestions(NameTest);
     Answers             = DataWorker.GetAllAnswers(NameTest);
     Dispatcher_Timer();
     ShowQuestion();
 }
Ejemplo n.º 14
0
 private void updateAllDepartmentsView()
 {
     AllDepartments = DataWorker.findAllDepartments();
     DepartmentWindow.AllDepartments.ItemsSource = null;
     DepartmentWindow.AllDepartments.Items.Clear();
     DepartmentWindow.AllDepartments.ItemsSource = AllDepartments;
     DepartmentWindow.AllDepartments.Items.Refresh();
     DepartmentName = null;
 }
Ejemplo n.º 15
0
 // Start is called before the first frame update
 void Start()
 {
     so = SocketObject.Instance;
     dw = DataWorker.Instance;
     gm = GameManager.Instance;
     a  = AttackUI.GetComponent <filledImage> ();
     d  = DiffenceUI.GetComponent <filledImage> ();
     s  = SpeedUI.GetComponent <filledImage> ();
 }
Ejemplo n.º 16
0
        public void SaveCreatedDataToNpy()
        {
            foreach (KeyValuePair <int, List <byte[]> > entry in CreatedData)
            {
                DataWorker.WriteToNpyFile(entry.Value, entry.Key);
            }

            CreatedData = new Dictionary <int, List <byte[]> >();
        }
Ejemplo n.º 17
0
 private void updateAllPositionsView()
 {
     AllPositions = DataWorker.findAllPositions();
     PositionWindow.AllPositions.ItemsSource = null;
     PositionWindow.AllPositions.Items.Clear();
     PositionWindow.AllPositions.ItemsSource = AllPositions;
     PositionWindow.AllPositions.Items.Refresh();
     PositionName       = null;
     PositionDepartment = null;
 }
Ejemplo n.º 18
0
        // Сохранение игры при закрытии окна
        private static void GameWin_Closed(object?sender, EventArgs e)
        {
            if (Player.WordsList.Count != field.WordsList.Count)
            {
                DataWorker.SaveField(field, DataWorker.FieldSavePath);
                DataWorker.SavePlayer(DataWorker.PlayerSavePath);
            }

            SetMainWindow();
        }
Ejemplo n.º 19
0
 // Use this for initialization
 void Start()
 {
     so = SocketObject.Instance;
     dw = DataWorker.Instance;
     gm = GameManager.Instance;
     if (this.gameObject.name.Equals("NameInputField") && so.connecting)
     {
         GetComponent <InputField> ().text = SocketObject.Instance.name;
     }
 }
Ejemplo n.º 20
0
 // Use this for initialization
 void Start()
 {
     so = SocketObject.Instance;
     dw = DataWorker.Instance;
     gm = GameManager.Instance;
     pd = new PlayerData();
     //toPos = transform.position;
     //transform.LookAt(new Vector3(0, transform.position.y, 0));
     //fpsCam.hRotation = transform.rotation;
 }
        public async void OnStartCommandExecute(object obj)
        {
            IsStartEnabled = false;
            IsStopEnabled  = true;

            TeleStatus = "Рассылка запущена!";
            await Task.Run(async() =>
            {
                while (IsStopEnabled)
                {
                    foreach (var item in DataGridQueries)
                    {
                        if (item.Status == "Ожидание...")
                        {
                            if (item.DateTimeSending <= DateTime.Now)
                            {
                                TelegramContext = new TelegramLogic(PhoneNumber);
                                await TelegramContext.LogInAsync();
                                bool result      = false;
                                string exception = null;
                                try
                                {
                                    result = await TelegramContext.SendMessage(new TelegramLibrary.Models.SendingQueryModel()
                                    {
                                        PhotoPath      = item?.PhotoPath,
                                        SendingChannel = item.SendingChannel,
                                        SendingText    = item?.SendingText
                                    });
                                }
                                catch (Exception ex) { exception = ex.StackTrace; }

                                if (result)
                                {
                                    item.Status = "Успешно!";
                                    SuccessfullyRequested++;
                                    WaitingRequest--;
                                    DataWorker.AddInfoToDB(PhoneNumber, item.SendingChannel, String.IsNullOrEmpty(item?.PhotoPath),
                                                           item?.SendingText, item.DateTimeSending, true, exception);
                                }
                                else
                                {
                                    item.Status = "Не отправлено!";
                                    BadRequested++;
                                    WaitingRequest--;
                                    DataWorker.AddInfoToDB(PhoneNumber, item.SendingChannel, String.IsNullOrEmpty(item?.PhotoPath),
                                                           item?.SendingText, item.DateTimeSending, false, exception);
                                }
                                TelegramContext.LogOut();
                            }
                        }
                    }
                    Thread.Sleep(15000);
                }
            });
        }
Ejemplo n.º 22
0
        public string getOntology(string conceptKeyword)
        {
            var dataWorker       = new DataWorker();
            var ontologytreeJson = string.Empty;

            keywordsList = new SortedSet <string>();
            json         = string.Empty;
            //get ontology from hiscentral

            var getOntologytree = dataWorker.getOntologyTree(conceptKeyword);

            XmlDocument ontologytreeXML = new XmlDocument();

            if (getOntologytree != null)
            {
                ontologytreeXML.LoadXml(getOntologytree);
                //string json = Newtonsoft.Json.JsonConvert.SerializeXmlNode(doc.DocumentElement);
            }

            // Ontology tree
            var tree = new OntologyTree();

            //var tmpxmldoc = ReadOntologyXmlFile();
            FillTree(ontologytreeXML.DocumentElement, tree.Nodes);



            //XmlReader rdr = XmlReader.Create(new System.IO.StringReader(ontologytreeXML));
            //while (rdr.Read())
            //{
            //    if (rdr.NodeType == XmlNodeType.Element)
            //    {
            //        Console.WriteLine(rdr.LocalName);
            //    }
            //}

            if (tree != null)
            {
                //    XmlDocument doc = new XmlDocument();
                //    doc.LoadXml(ontologytreeXml);
                //string json = Newtonsoft.Json.JsonConvert.SerializeXmlNode(doc.DocumentElement);
                ontologytreeJson = Newtonsoft.Json.JsonConvert.SerializeObject(tree.Nodes[0].children,
                                                                               new JsonSerializerSettings
                {
                    ReferenceLoopHandling      = ReferenceLoopHandling.Ignore,
                    PreserveReferencesHandling = PreserveReferencesHandling.None
                                                 // PreserveReferencesHandling = PreserveReferencesHandling.Objects
                }
                                                                               );
            }
            return(ontologytreeJson);
        }
Ejemplo n.º 23
0
        //Метод отвечающий за кнопку смены данных.
        public void Button_Click(object sender, RoutedEventArgs e)
        {
            string NewName    = Name.Text.Trim();
            string NewSurname = Surname.Text.Trim();
            string NewCompany = Company.Text.Trim();
            bool   check_name;
            bool   check_surname;
            bool   check_company;

            RegisterWindow registerWindow = new RegisterWindow();

            if (DataUser.Name != NewName)
            {
                check_name = registerWindow.CheckName(this.Name, this.NameBorder, NewName);
            }
            else
            {
                check_name = true;
            }

            if (DataUser.Surname != NewSurname)
            {
                check_surname = registerWindow.CheckSurname(this.Surname, this.SurnameBorder, NewSurname);
            }
            else
            {
                check_surname = true;
            }

            if (DataUser.Company != NewCompany)
            {
                check_company = registerWindow.CheckСompany(this.Company, this.CompanyBorder, NewCompany);
            }
            else
            {
                check_company = true;
            }

            if (check_name & check_surname & check_company)
            {
                DataUser = DataWorker.EditUser(DataUser, NewName, NewSurname, NewCompany);
                MainWindow mainWindow = new MainWindow
                {
                    DataUser = DataUser
                };
                TextResult.Text = "Вы успешно сменили личные данные";
            }
            else
            {
                TextResult.Text = "Повторите попытку";
            }
        }
Ejemplo n.º 24
0
        public async Task <HttpResponseMessage> DeleteAccountAsync(long id)
        {
            DataWorker.Accounts.Delete(id);

            if (await DataWorker.SaveChangesAsync() == 1)
            {
                return(Request.CreateResponse(HttpStatusCode.NoContent));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
        }
Ejemplo n.º 25
0
        private void Deserialize()
        {
            var locale = DataWorker.Deserialize(AppDomain.CurrentDomain.BaseDirectory + @"\ProjectList.json", typeof(ObservableCollection <Project>)) as ObservableCollection <Project>;

            if (locale != null)
            {
                Collection = locale;
            }
            if (Collection.Count != 0)
            {
                SelectedItem = Collection[0];
            }
        }
Ejemplo n.º 26
0
 // Use this for initialization
 void Start()
 {
     so = SocketObject.Instance;
     dw = DataWorker.Instance;
     gm = GameManager.Instance;
     //pd = new PlayerData ();
     StartCoroutine("SyncPosition");
     fpsCam = GetComponent <fpsCamera> ();
     anim   = GetComponent <Animator> ();
     toPos  = transform.position;
     transform.LookAt(new Vector3(0, transform.position.y, 0));
     fpsCam.hRotation = transform.rotation;
     //avater.GetComponent<MeshCollider>().sharedMesh = avater.GetComponent<SkinnedMeshRenderer>().sharedMesh;
 }
 private void SelectPanel() // Проверка наличия данных для графика
 {
     if (!DataWorker.CheckData(DateTime.Now.ToShortDateString()))
     {
         panelGraphic.Controls.Clear();
         panelGraphic.Controls.Add(new Graphic_UserControl());
         GetThisUC(); // Получаем новый Контрол
     }
     else
     {
         panelGraphic.Controls.Clear();
         panelGraphic.Controls.Add(new NoResult_UserControl());
     }
 }
Ejemplo n.º 28
0
        public async Task <HttpResponseMessage> UpdateAccountAsync(Account account)
        {
            account.ChangedAt = DateTimeOffset.Now;
            DataWorker.Accounts.Update(account);

            if (await DataWorker.SaveChangesAsync() == 1)
            {
                return(Request.CreateResponse(HttpStatusCode.NoContent));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
        }
Ejemplo n.º 29
0
        //Метод реализующий авторизацию пользователя.
        public void Button_Auth_Click(object sender, RoutedEventArgs e)
        {
            string login    = Login.Text.Trim();
            string password = Password.Password.Trim();

            if (login.Length < 5)
            {
                Login.ToolTip     = "Введите логин";
                Login.BorderBrush = Brushes.Red;
                Login.CaretBrush  = Brushes.Red;
            }
            else
            {
                Login.ToolTip     = null;
                Login.BorderBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#89000000"));
            }

            if (password.Length < 5)
            {
                Password.ToolTip     = "Введите пароль";
                Password.BorderBrush = Brushes.Red;
            }
            else
            {
                Password.ToolTip     = null;
                Password.BorderBrush = (SolidColorBrush)(new BrushConverter().ConvertFrom("#89000000"));
            }

            if (login.Length >= 5)
            {
                if (password.Length >= 5)
                {
                    DataUser = DataWorker.AuthUser(login, password);

                    if (DataUser != null)
                    {
                        this.TextResult.Text = "Вы успешно авторизовались!";
                    }
                    else
                    {
                        this.TextResult.Text = "Пользователь не найден";
                    }
                }
            }
            else
            {
                this.TextResult.Text = "Некорректные данные!";
            }
        }
Ejemplo n.º 30
0
        /// <summary>
        /// Initializes main object T, here called deserializing and initializing object
        /// </summary>
        protected void Init()
        {
            _path = SetPath();
            var locale = DataWorker.Deserialize(_path, typeof(T));

            if (locale is T && locale != null)
            {
                Ject = locale as T;
            }
            else
            {
                Ctor();
                DataWorker.Serialize(_path, Ject);
            }
        }
Ejemplo n.º 31
0
        public bool LoadDataCallback(int handle)
        {
            if (ABC4TrustEvent != null)
            {
                DataWorker dw = new DataWorker(ABC4TrustEvent, handle);

                Thread detectThread = new Thread(new ThreadStart(dw.doit));
                detectThread.Start();
                return true;
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("No EventHandler / Event for callback !!");
                return false;
            }
        }