Ejemplo n.º 1
0
	public void OnOptionClick(int option)
	{
		if(!canClick)
			return;

		SoundManager.GetInstance().OnClickSound();
		bool result = option == correctOption;

		if(!result)
		{
			optionGO[option].GetComponent<Button>().image.sprite = wrongSprite;
			SoundManager.GetInstance().wrongAns++;
			ParseManager.IncrementWrong();
			if(SoundManager.GetInstance().correctAnsInRow>1)
			{
				ParseManager.AddCorrectInRow(SoundManager.GetInstance().correctAnsInRow);
			}
			SoundManager.GetInstance().correctAnsInRow = 0;
		}
		else
		{
			ParseManager.IncrementCorrect();
			SoundManager.GetInstance().correctAns++;
			SoundManager.GetInstance().correctAnsInRow++;
		}

		optionGO[correctOption].GetComponent<Button>().image.sprite = rightSprite;


		if(SoundManager.GetInstance().FEEDBACK)
			LoadFeeback(result);

		nextBtn.SetActive(true);
		canClick = false;
	}
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            ParseManager parseManager = new ParseManager();

            parseManager.SaveToXml();
            Console.ReadLine();
        }
Ejemplo n.º 3
0
 public ImportProcessor(DatabaseAccess databaseAccess, ParseManager parseManager, string ftpFolderPath, string processedFolderPath)
 {
     _databaseAccess      = databaseAccess;
     _parseManager        = parseManager;
     _ftpFolderPath       = ftpFolderPath;
     _processedFolderPath = processedFolderPath;
 }
Ejemplo n.º 4
0
        public async void Search()
        {
            var json = await _fetch.GetJson(_url.Search(query, page), token);

            var searchedRepos = await ParseManager.Parse <Repos>(json);

            totalPages = (int)Math.Ceiling(searchedRepos.Total / 10);
            repos      = searchedRepos.Data;

            if (page == 1)
            {
                previousPage.Enabled = false;
            }
            else
            {
                previousPage.Enabled = true;
            }

            if (totalPages == 1)
            {
                nextPage.Enabled      = false;
                navigation.Visibility = ViewStates.Gone;
            }
            else
            {
                nextPage.Enabled      = true;
                navigation.Visibility = ViewStates.Visible;
            }

            pageInfo.Text = $"Page: {page} of {totalPages}";

            listView.Adapter = new RepoListAdapter(this, token, user, repos);
        }
Ejemplo n.º 5
0
 public void interpolatedData3x3_1_1()
 {
     ParseManager parser = new ParseManager();
     FileGws gws = parser.ParseGws(gws3x3);
     AutomaticGrid.Geometrical result = new AutomaticGrid.Geometrical(gws, 2.0, 0.0, 4.0, 0.0, 2.5, 1, 1, 1, 1);
     Assert.AreEqual(9.41, Math.Round(result.firstCellHeightMap.data[1, 1][2], 2));
 }
Ejemplo n.º 6
0
        public MainWindow()
        {
            InitializeComponent();

            WindowStyle = WindowStyle.None;

            MonikaStatic = Monika;

            MouseSetup();
            InitializeScript();

            var fd = new OpenFileDialog()
            {
                DefaultExt = "txt",
                Filter     = "Text Files(*.txt)|*.txt"
            };

            fd.ShowDialog();
            if (fd.FileName.Length > 0)
            {
                _actions = ParseManager.ParseRawScript(File.ReadAllText(fd.FileName));
            }

            /*
             * _actions.Add(new DDLCDelayAction(3000) { isSkiped = true });
             * _actions.Add(new DDLCScriptAction("딜레이 3초!"));
             * _actions.Add(new DDLCProcessAction(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe") { isSkiped = true });
             * _actions.Add(new DDLCDelayAction(1500) { isSkiped = true });
             * _actions.Add(new DDLCKeyinputAction("{alt down}{tab}{alt up}") { isSkiped = true });
             * _actions.Add(new DDLCScriptAction(@"크롬 프로그램을 실행하였습니다.
             * 경로 : C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"));
             * _actions.Add(new DDLCScriptAction("스크립트 재생해보기"));
             */
        }
Ejemplo n.º 7
0
        private ParseManager GetParseManager()
        {
            var parsers      = GetDataParsers();
            var parseManager = new ParseManager(parsers);

            return(parseManager);
        }
Ejemplo n.º 8
0
        public void Setup()
        {
            var calcConfig  = new CalculatorConfigModel();
            var parseConfig = new ParseConfigModel();

            _calculatorManager = new CalculatorManager(calcConfig);
            _parseManager      = new ParseManager(parseConfig);
        }
Ejemplo n.º 9
0
 private void Update()
 {
     if (!DoneInstantiating && ParseManager.DoneInstantiating && URLLoader.DoneInstatiating)
     {
         DoneInstantiating = true;
         SetStates(ParseManager.GetStates(false));
     }
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Gets the commits and binds to the ListView
        /// </summary>
        private async Task GetCommits()
        {
            var commitsJson = await _fetch.GetJson(_url.Commits(MainActivity.repo), MainActivity.token);

            commits = await ParseManager.Parse <List <CommitRepo> >(commitsJson);

            commitList.Adapter = new CommitListAdapter(this, commits);
        }
Ejemplo n.º 11
0
        public static async Task <Token> GetLocalAccessToken()
        {
            StreamReader strm = new StreamReader(Application.Context.Assets.Open("LocalStorage.txt"));
            var          json = await strm.ReadToEndAsync();

            var token = await ParseManager.Parse <Token>(json);

            return(token);
        }
Ejemplo n.º 12
0
    public void LoadCities3()
    {
        allStateCities[2].Cities.startingItemList = ParseManager.GetCities(allStateCities[2].States.selectedTextMesh.text, false);
        allStateCities[2].Cities.ItemList         = allStateCities[2].Cities.startingItemList;
        allStateCities[2].Cities.UpdateList();

        linkMan.SetDispatchStateCity();
        linkMan.SetPickUpStateCity();
        linkMan.SetDropOffStateCity();
    }
Ejemplo n.º 13
0
 private void GetProductFromDiv(IElement div)
 {
     try
     { ParseManager parseManager = new ParseManager();
       string       urlForPage   = div.GetElementsByClassName("g-i-tile-i-title")[0].GetElementsByTagName("a")[0].GetAttribute("href");
       var          product      = parseManager.Parse(Store.Rozetka, urlForPage);
       _productRepository.AddProduct(product); }
     catch (Exception ex)
     {
     }
 }
Ejemplo n.º 14
0
        public static PbBillInfo GetBillBase(string fileName)
        {
            ParseManager parseManagerApp = new ParseManager();
            PbBillInfo   billInfo        = parseManagerApp.ParseBillFileApp(fileName);

            fName = fileName.Substring(fileName.LastIndexOf("\\") + 2,
                                       fileName.LastIndexOf(".") - fileName.LastIndexOf("\\") - 1);

            Log("------>>>> 开始解析" + fName + ".ini");
            return(billInfo);
        }
Ejemplo n.º 15
0
 public void OnNameOkClick()
 {
     SoundManager.GetInstance().OnClickSound();
     if (!string.IsNullOrEmpty(nameField.text))
     {
         var name = nameField.text + Random.Range(1, 1000).ToString();
         PlayerPrefs.SetString("name", name);
         namePanel.SetActive(false);
         waitPanel.SetActive(true);
         ParseManager.RegisterUser(name, "123456", RegisterCallback);
     }
 }
Ejemplo n.º 16
0
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
//			DontDestroyOnLoad(gameObject);
        }
//		else if(instance != this)
//		{
//			Destroy(gameObject);
//		}
    }
Ejemplo n.º 17
0
    public void SetStates(List <string> allStates)
    {
        for (int i = 0; i < allStateCities.Count; i++)
        {
            allStateCities[i].States.startingItemList = allStates;
            allStateCities[i].States.ItemList         = allStates;
            allStateCities[i].States.UpdateList();

            allStateCities[i].Cities.startingItemList = ParseManager.GetCities(allStateCities[i].States.selectedTextMesh.text, false);
            allStateCities[i].Cities.ItemList         = allStateCities[i].Cities.startingItemList;
            allStateCities[i].Cities.UpdateList();
        }
    }
Ejemplo n.º 18
0
        private ParseManager GetParseManager(string rootPath, string fileName)
        {
            var dataObtainers = new List <IDataObtainer>();

            dataObtainers.Add(new ReleaseDataObtainer());
            var dataParser = new DataParser(dataObtainers);

            var parsers = new List <IDataParser>();

            parsers.Add(dataParser);
            var parseManager = new ParseManager(parsers);

            return(parseManager);
        }
Ejemplo n.º 19
0
    // Use this for initialization
    void Start()
    {
//		Debug.unityLogger.logEnabled = false;
        if (ParseUser.CurrentUser != null)
        {
            ParseManager.CreateSession();
        }

        StartCoroutine(Ping());

//		ParseClient.Initialize(new ParseClient.Configuration {
//			ApplicationId = "WmhUZz1Rb6GZcefbNefJFp8PoT4FXxFHwocHBZpl",
//			WindowsKey = "NfKyDeh4MHS0a0FGYNg52BcaJaEiywMHltpCAyyi",
//			Server = "https://parseapi.back4app.com"
//		});
    }
Ejemplo n.º 20
0
 public static void test4()
 {
     string[] descList =
     {
         "索引",
         "名字",
         "技能1id",
         "技能1概率",
         "技能2id",
         "技能2概率",
         "声望概率",
         "声望id",
     };
     string[] nameList =
     {
         "id",
         "name",
         "skill#id",
         "skill#rate",
         "skill#id",
         "skill#rate",
         "repu#rate",
         "repu#id",
     };
     string[] typeList =
     {
         "INT",
         "STRING",
         "ST_ARRAY#INT$1",
         "ST_ARRAY#INT$1",
         "ST_ARRAY#INT$2",
         "ST_ARRAY#INT$2",
         "ST#FLOAT",
         "ST#INT",
     };
     ParseManager.GetInstance().BeginMessage("test", descList.ToList(), nameList.ToList(), typeList.ToList());
     ParseManager.GenerateProto("");
 }
Ejemplo n.º 21
0
 public void interpolatedData3x3_2_6_125_375ax()
 {
     ParseManager parser = new ParseManager();
     FileGws gws = parser.ParseGws(gws3x3);
     AutomaticGrid.Geometrical result = new AutomaticGrid.Geometrical(gws, 2.0, 2.0, 6.0, 1.25, 3.75, 1, 1, 1, 1);
     Assert.AreEqual(2.0, Math.Round(result.firstCellHeightMap.data[0, 0][0], 2));
 }
Ejemplo n.º 22
0
 public void Test_save_to_bws()
 {
     ParseManager parser = new ParseManager();
     FileGws gws = parser.ParseGws(gws3x3);
     AutomaticGrid.Geometrical result = new AutomaticGrid.Geometrical(gws, 2.0, 0.0, 8.0, 0.0, 5.0, 10, 12, 100, 10);
     WSProject project = new WSProject(project_file.FullName);
     Assert.IsTrue(result.SaveToBws(project, "test"));
 }
Ejemplo n.º 23
0
 public void test_RefinementGenerator_write_the_bws_file_in_the_proper_Directory_aritm()
 {
     WSProject project = new WSProject(project_file.FullName);
     string bws_filename = "test_bws_position234";
     ParseManager parser = new ParseManager();
     FileGws gws = parser.ParseGws(gws3x3);
     AutomaticGrid.Geometrical result = new AutomaticGrid.Geometrical(gws, 2.0, 0.0, 8.0, 0.0, 5.0, 10, 12, 100, 10);
     bool save = result.SaveToBws(project, bws_filename);
     string expected_file_path = project.file.Directory.FullName + "\\dtm\\" + "test_bws_position234" + ".bws"; ;
     FileInfo expected_file = new FileInfo(expected_file_path);
     Assert.IsTrue(expected_file.Exists);
     //
 }
Ejemplo n.º 24
0
 public void test_RefinementGenerator_load_proper_bws_file_name_project_parameters()
 {
     WSProject project = new WSProject(project_file.FullName);
     string bws_filename = "test_bws_position";
     string bws_file = bws_filename + ".bws";
     ParseManager parser = new ParseManager();
     FileGws gws = parser.ParseGws(gws3x3);
     AutomaticGrid.Geometrical result = new AutomaticGrid.Geometrical(gws, 2.0, 0.0, 8.0, 0.0, 5.0, 10, 12, 100, 10);
     bool save = result.SaveToBws(project, bws_filename);
     Assert.AreEqual(bws_file, project.parameters.CFD.RefinementFileName);
 }
Ejemplo n.º 25
0
 public void Setup()
 {
     _parseManager = new ParseManager(new ParseConfigModel());
 }
Ejemplo n.º 26
0
 public void interpolatedData3x3_6_8_375_5d()
 {
     ParseManager parser = new ParseManager();
     FileGws gws = parser.ParseGws(gws3x3);
     AutomaticGrid.Geometrical result = new AutomaticGrid.Geometrical(gws, 2.0, 6.0, 8.0, 3.75, 5.0, 1, 1, 1, 1);
     Assert.AreEqual(8.5, Math.Round(result.firstCellHeightMap.data[1, 0][2], 2));
 }
Ejemplo n.º 27
0
        protected override async void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            Button    signIn     = FindViewById <Button>(Resource.Id.SignIn);
            ImageView userAvatar = FindViewById <ImageView>(Resource.Id.UserAvatar);
            Button    getStarred = FindViewById <Button>(Resource.Id.GetStarred);
            TextView  greeting   = FindViewById <TextView>(Resource.Id.Greeting);

            pageInfo     = FindViewById <TextView>(Resource.Id.PageInfo);
            navigation   = FindViewById <LinearLayout>(Resource.Id.Navigation);
            previousPage = FindViewById <Button>(Resource.Id.PreviousPage);
            nextPage     = FindViewById <Button>(Resource.Id.NextPage);

            listView = FindViewById <ListView>(Resource.Id.RepoList);

            token = await GetLocalStorage.GetLocalAccessToken();

            signIn.Click += async(sender, e) =>
            {
                var json = await _fetch.GetJson(_url.User, token);

                user = await ParseManager.Parse <User>(json);

                if (user != null)
                {
                    greeting.Text = $"Welcome {user.UserName}";
                    var bitmap = GetImageHelper.GetImageBitmapFromUrl(user.avatarUrl);
                    userAvatar.SetImageBitmap(bitmap);
                    getStarred.Enabled = true;
                    signIn.Visibility  = ViewStates.Gone;
                }
            };

            getStarred.Click += async(sender, e) =>
            {
                var json = await _fetch.GetJson(_url.Starred(user), token);

                repos = await ParseManager.Parse <List <Repo> >(json);

                foreach (Repo repo in repos)
                {
                    repo.IsStarred = true;
                }
                ;

                navigation.Visibility = ViewStates.Gone;

                listView.Adapter = new RepoListAdapter(this, token, user, repos);
            };

            listView.ItemClick += (sender, e) =>
            {
                var listView = sender as ListView;
                repo = repos[e.Position];
                var intent = new Intent(this, typeof(RepoActivity));
                StartActivity(intent);
            };

            previousPage.Click += (sender1, e1) =>
            {
                page--;
                Search();
            };

            nextPage.Click += (sender2, e2) =>
            {
                page++;
                Search();
            };
        }
Ejemplo n.º 28
0
 void DoStates()
 {
     SetStates(ParseManager.GetStates(false));
 }
Ejemplo n.º 29
0
 public void TestFileHFirstCellArray2_2()
 {
     ParseManager parser = new ParseManager();
     FileGws gws = parser.ParseGws(gws3x3);
     MyMath.DoubleMap hfirstcellmap = AutomaticGrid.Geometrical.HFirstCell(gws.Map(FileGws.MapType.Rough));
     MyMath.DoubleMap tempMap = MyMath.SmoothedMap(hfirstcellmap, 2.0);
     Assert.AreEqual(6.05, Math.Round(tempMap.data[2, 2][2], 2));
 }
Ejemplo n.º 30
0
	void Awake () {
		this.parseManager = GameObject.Find("NetworkManager").GetComponent<ParseManager>();
		this.DownloadedGraffiti = new Dictionary<Artwork, List<Graffiti>>();
	}
Ejemplo n.º 31
0
 public void test_maxGroungHeight_to_be_verified()
 {
     ParseManager parser = new ParseManager();
     FileGws gws = parser.ParseGws(gws3x3);
     AutomaticGrid.Geometrical result = new AutomaticGrid.Geometrical(gws, 2.0, 0.0, 8.0, 0.0, 5.0, 10, 10, 100, 10);
     // valore da verificare!
     Assert.AreEqual(6.25, Math.Round(result.maxGroungHeight,2));
 }
Ejemplo n.º 32
0
        public async Task <string> ParseAsync(int totalNum, int currentPageIndex, int pageCount)
        {
            var pageInfo = ParseManager.PageInfo;

            var parsedContent = string.Empty;

            ParseManager.ContextInfo.PageItemIndex = currentPageIndex * ListInfo.PageNum;

            try
            {
                if (!string.IsNullOrEmpty(SqlString))
                {
                    //var pageSqlString = DatabaseApi.Instance.GetPageSqlString(SqlString, ListInfo.OrderByString, totalNum, ListInfo.PageNum, currentPageIndex);
                    var pageSqlString = ParseManager.DatabaseManager.GetStlPageSqlString(SqlString, ListInfo.Order, totalNum, ListInfo.PageNum, currentPageIndex);

                    var dataSource = await ParseManager.DatabaseManager.ParserGetSqlDataSourceAsync(ListInfo.DatabaseType, ListInfo.ConnectionString, pageSqlString);

                    parsedContent = await ParseElementAsync(ParseManager, ListInfo, dataSource);
                }

                //if (_dataSet != null)
                //{
                //    var dataSource = new PagedDataSource { DataSource = _dataSet.Tables[0].DefaultView }; //分页类

                //    if (pageCount > 1)
                //    {
                //        dataSource.AllowPaging = true;
                //        dataSource.PageSize = _listInfo.PageNum;//每页显示的项数
                //    }
                //    else
                //    {
                //        dataSource.AllowPaging = false;
                //    }

                //    dataSource.CurrentPageIndex = currentPageIndex;//当前页的索引

                //    if (_listInfo.Layout == ELayout.None)
                //    {
                //        var rptContents = new Repeater
                //        {
                //            ItemTemplate =
                //                new RepeaterTemplate(_listInfo.ItemTemplate, _listInfo.SelectedItems,
                //                    _listInfo.SelectedValues, _listInfo.SeparatorRepeatTemplate,
                //                    _listInfo.SeparatorRepeat, _pageInfo, EContextType.SqlContent, _contextInfo)
                //        };

                //        if (!string.IsNullOrEmpty(_listInfo.HeaderTemplate))
                //        {
                //            rptContents.HeaderTemplate = new SeparatorTemplate(_listInfo.HeaderTemplate);
                //        }
                //        if (!string.IsNullOrEmpty(_listInfo.FooterTemplate))
                //        {
                //            rptContents.FooterTemplate = new SeparatorTemplate(_listInfo.FooterTemplate);
                //        }
                //        if (!string.IsNullOrEmpty(_listInfo.SeparatorTemplate))
                //        {
                //            rptContents.SeparatorTemplate = new SeparatorTemplate(_listInfo.SeparatorTemplate);
                //        }
                //        if (!string.IsNullOrEmpty(_listInfo.AlternatingItemTemplate))
                //        {
                //            rptContents.AlternatingItemTemplate = new RepeaterTemplate(_listInfo.AlternatingItemTemplate, _listInfo.SelectedItems, _listInfo.SelectedValues, _listInfo.SeparatorRepeatTemplate, _listInfo.SeparatorRepeat, _pageInfo, EContextType.SqlContent, _contextInfo);
                //        }

                //        rptContents.DataSource = dataSource;
                //        rptContents.DataBind();

                //        if (rptContents.Items.Count > 0)
                //        {
                //            parsedContent = ControlUtils.GetControlRenderHtml(rptContents);
                //        }
                //    }
                //    else
                //    {
                //        var pdlContents = new ParsedDataList();

                //        //设置显示属性
                //        TemplateUtility.PutListInfoToMyDataList(pdlContents, _listInfo);

                //        pdlContents.ItemTemplate = new DataListTemplate(_listInfo.ItemTemplate, _listInfo.SelectedItems, _listInfo.SelectedValues, _listInfo.SeparatorRepeatTemplate, _listInfo.SeparatorRepeat, _pageInfo, EContextType.SqlContent, _contextInfo);
                //        if (!string.IsNullOrEmpty(_listInfo.HeaderTemplate))
                //        {
                //            pdlContents.HeaderTemplate = new SeparatorTemplate(_listInfo.HeaderTemplate);
                //        }
                //        if (!string.IsNullOrEmpty(_listInfo.FooterTemplate))
                //        {
                //            pdlContents.FooterTemplate = new SeparatorTemplate(_listInfo.FooterTemplate);
                //        }
                //        if (!string.IsNullOrEmpty(_listInfo.SeparatorTemplate))
                //        {
                //            pdlContents.SeparatorTemplate = new SeparatorTemplate(_listInfo.SeparatorTemplate);
                //        }
                //        if (!string.IsNullOrEmpty(_listInfo.AlternatingItemTemplate))
                //        {
                //            pdlContents.AlternatingItemTemplate = new DataListTemplate(_listInfo.AlternatingItemTemplate, _listInfo.SelectedItems, _listInfo.SelectedValues, _listInfo.SeparatorRepeatTemplate, _listInfo.SeparatorRepeat, _pageInfo, EContextType.SqlContent, _contextInfo);
                //        }

                //        pdlContents.DataSource = dataSource;
                //        pdlContents.DataBind();

                //        if (pdlContents.Items.Count > 0)
                //        {
                //            parsedContent = ControlUtils.GetControlRenderHtml(pdlContents);
                //        }
                //    }
                //}
            }
            catch (Exception ex)
            {
                parsedContent = await ParseManager.AddStlErrorLogAsync(ElementName, StlPageSqlContentsElement, ex);
            }

            //还原翻页为0,使得其他列表能够正确解析ItemIndex
            ParseManager.ContextInfo.PageItemIndex = 0;

            return(parsedContent);
        }
Ejemplo n.º 33
0
        static void Main(string[] args)
        {
            #region добавление компаний (api)
            //for(int i = 1; i < 21; i++)
            //{
            //    Console.WriteLine("Цикл №" + i);
            //    var companies = CompanyService.SearchCompanyOpenDataParse(i);
            //    using (trustmeContext db = new trustmeContext())
            //    {
            //        db.Okeds.Add(new Oked { Id = 1, Name = "" });
            //        db.SaveChanges();
            //        var companiesList = companies.Select(x => new Company
            //        {
            //            Id = Guid.NewGuid(),
            //            Address = x.addressru,
            //            Bin = x.bin,
            //            NameRu = x.nameru,
            //            OkedId = 1,
            //            CityId = 86,
            //            RegionId = 18
            //        }).ToList();
            //        foreach (var company in companiesList)
            //        {
            //            if (!db.Companies.Any(c => c.Bin.Contains(company.Bin)))
            //            {
            //                db.Companies.Add(company);
            //                db.SaveChanges();
            //            }
            //        }
            //    }
            //}
            #endregion
            #region добавление областей
            //List<Region> regions = new List<Region>();
            //Region ALMATY = new Region { Id = 1, Name = "Город Алматы" };
            //Region NURSULTAN = new Region { Id = 2, Name = "Город Нур-Султан" };
            //Region SHYMKENT = new Region { Id = 3, Name = "Город Шымкент" };
            //Region akm = new Region { Id = 4, Name = "Акмолинская область‎" };
            //Region akt = new Region { Id = 5, Name = "Актюбинская область" };
            //Region alm = new Region { Id = 6, Name = "Алматинская область‎" };
            //Region atu = new Region { Id = 7, Name = "Атырауская область" };
            //Region vko = new Region { Id = 8, Name = "Восточно-Казахстанская область‎" };
            //Region zham = new Region { Id = 9, Name = "Жамбылская область" };
            //Region zko = new Region { Id = 10, Name = "Западно-Казахстанская область‎" };
            //Region kar = new Region { Id = 11, Name = "Карагандинская область‎" };
            //Region kos = new Region { Id = 12, Name = "Костанайская область‎" };
            //Region kuz = new Region { Id = 13, Name = "Кызылординская область‎" };
            //Region man = new Region { Id = 14, Name = "Мангистауская область" };
            //Region pav = new Region { Id = 15, Name = "Павлодарская область‎" };
            //Region sko = new Region { Id = 16, Name = "Северо-Казахстанская область" };
            //Region tur = new Region { Id = 17, Name = "Туркестанская область" };
            //Region emptyRegion = new Region { Id = 18, Name = "Не определен" };

            //regions.AddRange(new Region[] { ALMATY, NURSULTAN, SHYMKENT, akm, akt, alm, atu, vko, zham, zko, kar, kos, kuz, man, pav, sko, tur, emptyRegion });
            //using (trustmeContext db = new trustmeContext())
            //{
            //    // добавление в базу областей
            //    db.Regions.AddRange(regions);
            //    db.SaveChanges();
            //}
            #endregion
            #region добавление в базу городов
            //List<City> cities = new List<City>();
            //City abai = new City { Id = 1, Name = "Абай", /*Region = kar,*/ RegionId = kar.Id };
            //City akkol = new City { Id = 2, Name = "Акколь", /*Region = akm,*/ RegionId = akm.Id };
            //City aksai = new City { Id = 3, Name = "Аксай", /*Region = zko,*/ RegionId = zko.Id };
            //City aksu = new City { Id = 4, Name = "Аксу", /*Region = pav,*/ RegionId = pav.Id };
            //City aktau = new City { Id = 5, Name = "Актау", /*Region = man,*/ RegionId = man.Id };
            //City aktobe = new City { Id = 6, Name = "Актобе", /*Region = akt,*/ RegionId = akt.Id };
            //City alga = new City { Id = 7, Name = "Алга", /*Region = akt,*/ RegionId = akt.Id };
            ////City almaty = new City { Id = 8, Name = "Алматы", /*Region = null,*/ RegionId = 0 };
            //City aral = new City { Id = 8, Name = "Арал", /*Region = kuz,*/ RegionId = kuz.Id };
            //City arkalyk = new City { Id = 9, Name = "Аркалык", /*Region = kos,*/ RegionId = kos.Id };
            //City arys = new City { Id = 10, Name = "Арыс", /*Region = tur,*/ RegionId = tur.Id };
            ////City nursultan = new City { Id = 12, Name = "Нур-Султан", /*Region = null,*/ RegionId = 0 };
            //City atbasar = new City { Id = 11, Name = "Атбасар", /*Region = akm,*/ RegionId = akm.Id };
            //City atyrau = new City { Id = 12, Name = "Атырау", /*Region = atu,*/ RegionId = atu.Id };
            //City ayagoz = new City { Id = 13, Name = "Аягоз", /*Region = vko,*/ RegionId = vko.Id };
            //City baikonyr = new City { Id = 14, Name = "Байконыр", /*Region = kuz,*/ RegionId = kuz.Id };
            //City balkhash = new City { Id = 15, Name = "Балхаш", /*Region = kar,*/ RegionId = kar.Id };
            //City bulaevo = new City { Id = 16, Name = "Булаево", /*Region = sko,*/ RegionId = sko.Id };
            //City derzhavinsk = new City { Id = 17, Name = "Державинск", /*Region = akm,*/ RegionId = akm.Id };
            //City ereimentau = new City { Id = 18, Name = "Ерейментау", /*Region = akm,*/ RegionId = akm.Id };
            //City esik = new City { Id = 19, Name = "Есик", /*Region = alm,*/ RegionId = alm.Id };
            //City esil = new City { Id = 20, Name = "Есиль", /*Region = akm,*/ RegionId = akm.Id };
            //City zhanaozen = new City { Id = 21, Name = "Жанаозен", /*Region = man,*/ RegionId = man.Id };
            //City zhanatas = new City { Id = 22, Name = "Жанатас", /*Region = zham,*/ RegionId = zham.Id };
            //City zharkent = new City { Id = 23, Name = "Жаркент", /*Region = alm,*/ RegionId = alm.Id };
            //City zhezkazgan = new City { Id = 24, Name = "Жезказган", /*Region = kar,*/ RegionId = kar.Id };
            //City zhem = new City { Id = 25, Name = "Жем", /*Region = akt,*/ RegionId = akt.Id };
            //City zhetysay = new City { Id = 26, Name = "Жетысай", /*Region = tur,*/ RegionId = tur.Id };
            //City zhitikara = new City { Id = 27, Name = "Житикара", /*Region = kos,*/ RegionId = kos.Id };
            //City zaysan = new City { Id = 28, Name = "Зайсан", /*Region = vko,*/ RegionId = vko.Id };
            //City zyryanovsk = new City { Id = 29, Name = "Зыряновск", /*Region = vko,*/ RegionId = vko.Id };
            //City kazalinsk = new City { Id = 30, Name = "Казалинск", /*Region = kuz,*/ RegionId = kuz.Id };
            //City kandyagash = new City { Id = 31, Name = "Кандыагаш", /*Region = akt,*/ RegionId = akt.Id };
            //City kapshagay = new City { Id = 32, Name = "Капшагай", /*Region = alm,*/ RegionId = alm.Id };
            //City karaganda = new City { Id = 33, Name = "Караганды", /*Region = kar,*/ RegionId = kar.Id };
            //City karazhal = new City { Id = 34, Name = "Каражал", /*Region = kar,*/ RegionId = kar.Id };
            //City karatau = new City { Id = 35, Name = "Каратау", /*Region = zham,*/ RegionId = zham.Id };
            //City karkaralinsk = new City { Id = 36, Name = "Каркаралинск", /*Region = kar,*/ RegionId = kar.Id };
            //City kaskelen = new City { Id = 37, Name = "Каскелен", /*Region = alm,*/ RegionId = alm.Id };
            //City kentau = new City { Id = 38, Name = "Кентау", /*Region = tur,*/ RegionId = tur.Id };
            //City kokshetau = new City { Id = 39, Name = "Кокшетау", /*Region = akm,*/ RegionId = akm.Id };
            //City kostanay = new City { Id = 40, Name = "Костанай", /*Region = kos,*/ RegionId = kos.Id };
            //City kulsary = new City { Id = 41, Name = "Кулсары", /*Region = atu,*/ RegionId = atu.Id };
            //City kurchatov = new City { Id = 42, Name = "Курчатов", /*Region = vko,*/ RegionId = vko.Id };
            //City kyzylorda = new City { Id = 43, Name = "Кызылорда", /*Region = kuz,*/ RegionId = kuz.Id };
            //City lenger = new City { Id = 44, Name = "Ленгер", /*Region = tur,*/ RegionId = tur.Id };
            //City lisakovsk = new City { Id = 45, Name = "Лисаковск", /*Region = kos,*/ RegionId = kos.Id };
            //City makinsk = new City { Id = 46, Name = "Макинск", /*Region = akm,*/ RegionId = akm.Id };
            //City mamlyutka = new City { Id = 47, Name = "Мамлютка", /*Region = sko,*/ RegionId = sko.Id };
            //City pavlodar = new City { Id = 48, Name = "Павлодар", /*Region = pav,*/ RegionId = pav.Id };
            //City petropavlovsk = new City { Id = 49, Name = "Петропавловск", /*Region = sko,*/ RegionId = sko.Id };
            //City priozersk = new City { Id = 50, Name = "Приозёрск", /*Region = kar,*/ RegionId = kar.Id };
            //City ridder = new City { Id = 51, Name = "Риддер", /*Region = vko,*/ RegionId = vko.Id };
            //City rudnui = new City { Id = 52, Name = "Рудный", /*Region = kos,*/ RegionId = kos.Id };
            //City saran = new City { Id = 53, Name = "Сарань", /*Region = kar,*/ RegionId = kar.Id };
            //City sarkand = new City { Id = 54, Name = "Сарканд", /*Region = alm,*/ RegionId = alm.Id };
            //City saryagash = new City { Id = 55, Name = "Сарыагаш", /*Region = tur,*/ RegionId = tur.Id };
            //City satpayev = new City { Id = 56, Name = "Сатпаев", /*Region = kar,*/ RegionId = kar.Id };
            //City semey = new City { Id = 57, Name = "Семей", /*Region = vko,*/ RegionId = vko.Id };
            //City sergeevka = new City { Id = 58, Name = "Сергеевка", /*Region = sko,*/ RegionId = sko.Id };
            //City serebryansk = new City { Id = 59, Name = "Серебрянск", /*Region = vko,*/ RegionId = vko.Id };
            //City stepnogorsk = new City { Id = 60, Name = "Степногорск", /*Region = akm,*/ RegionId = akm.Id };
            //City stepnyak = new City { Id = 61, Name = "Степняк", /*Region = akm,*/ RegionId = akm.Id };
            //City taiynsha = new City { Id = 62, Name = "Тайынша", /*Region = sko,*/ RegionId = sko.Id };
            //City talgar = new City { Id = 63, Name = "Талгар", /*Region = alm,*/ RegionId = alm.Id };
            //City taldykorgan = new City { Id = 64, Name = "Талдыкорган", /*Region = alm,*/ RegionId = alm.Id };
            //City taraz = new City { Id = 65, Name = "Тараз", /*Region = zham,*/ RegionId = zham.Id };
            //City tekeli = new City { Id = 66, Name = "Текели", /*Region = alm,*/ RegionId = alm.Id };
            //City temir = new City { Id = 67, Name = "Темир", /*Region = akt,*/ RegionId = akt.Id };
            //City temirtau = new City { Id = 68, Name = "Темиртау", /*Region = kar,*/ RegionId = kar.Id };
            //City tobyl = new City { Id = 69, Name = "Тобыл", /*Region = kos,*/ RegionId = kos.Id };
            //City turkestan = new City { Id = 70, Name = "Туркестан", /*Region = tur,*/ RegionId = tur.Id };
            //City uralsk = new City { Id = 71, Name = "Уральск", /*Region = zko,*/ RegionId = zko.Id };
            //City ustKamenogorsk = new City { Id = 72, Name = "Усть-Каменогорск", /*Region = vko,*/ RegionId = vko.Id };
            //City usharal = new City { Id = 73, Name = "Ушарал", /*Region = alm,*/ RegionId = alm.Id };
            //City ushtobe = new City { Id = 74, Name = "Уштобе", /*Region = alm,*/ RegionId = alm.Id };
            //City fortShevchenko = new City { Id = 75, Name = "Форт-Шевченко", /*Region = man,*/ RegionId = man.Id };
            //City khromtau = new City { Id = 76, Name = "Хромтау", /*Region = akt,*/ RegionId = akt.Id };
            //City shardara = new City { Id = 77, Name = "Шардара", /*Region = tur,*/ RegionId = tur.Id };
            //City shalkar = new City { Id = 78, Name = "Шалкар", /*Region = akt,*/ RegionId = akt.Id };
            //City shar = new City { Id = 79, Name = "Шар", /*Region = vko,*/ RegionId = vko.Id };
            //City shakhtinsk = new City { Id = 80, Name = "Шахтинск", /*Region = kar,*/ RegionId = kar.Id };
            //City shemonaikha = new City { Id = 81, Name = "Шемонаиха", /*Region = vko,*/ RegionId = vko.Id };
            //City shu = new City { Id = 82, Name = "Шу", /*Region = zham,*/ RegionId = zham.Id };
            ////City shymkent = new City { Id = 85, Name = "Шымкент", /*Region = null,*/ RegionId = 0 };
            //City shchuchinsk = new City { Id = 83, Name = "Щучинск", /*Region = akm,*/ RegionId = akm.Id };
            //City ekibastuz = new City { Id = 84, Name = "Экибастуз", /*Region = pav,*/ RegionId = pav.Id };
            //City emba = new City { Id = 85, Name = "Эмба", /*Region = akt,*/ RegionId = akt.Id };
            //City emptyCity = new City { Id = 86, Name = "Не определен", /*Region = akt,*/ RegionId = emptyRegion.Id };
            //cities.AddRange(new City[] { abai, akkol, aksai, aksu, aktau, aktobe, alga, aral, arkalyk, arys, atbasar, atyrau, ayagoz, baikonyr, balkhash, bulaevo, derzhavinsk, ereimentau, esik, esil, zhanaozen, zhanatas, zharkent, zhezkazgan, zhem, zhetysay, zhitikara, zaysan, zyryanovsk, kazalinsk, kandyagash, kapshagay, karaganda, karazhal, karatau, karkaralinsk, kaskelen, kentau, kokshetau, kostanay, kulsary, kurchatov, kyzylorda, lenger, lisakovsk, makinsk, mamlyutka, pavlodar, petropavlovsk, priozersk, ridder, rudnui, saran, sarkand, saryagash, satpayev, semey, sergeevka, serebryansk, stepnogorsk, stepnyak, taiynsha, talgar, taldykorgan, taraz, tekeli, temir, temirtau, tobyl, turkestan, uralsk, ustKamenogorsk, usharal, ushtobe, fortShevchenko, khromtau, shardara, shalkar, shar, shakhtinsk, shemonaikha, shu, shchuchinsk, ekibastuz, emba, emptyCity });
            //using (trustmeContext db = new trustmeContext())
            //{
            //    foreach (var item in cities)
            //    {
            //        db.Cities.Add(item);
            //        db.SaveChanges();
            //    }
            //}
            #endregion
            ParseManager parsing = new ParseManager();
            Console.WriteLine("ГОТОВО");
            Console.ReadKey();
        }