public AreaList getarealist() { MessagePackage message = new MessagePackage(); AreaList arealist = new AreaList(); XmlDocument response = GameUtil.getarealist(); try { XmlNodeList nodelist = response.SelectNodes( "/response/body/exploration_area/area_info_list/area_info"); foreach (XmlNode child in nodelist) { debugstring = child.InnerText; Area area = new Area(); area.Areaid = child["id"].InnerText; area.AreaName = child["name"].InnerText; area.AreaProg = child["prog_area"].InnerText; area.CardProg = child["prog_item"].InnerText; area.AreaType = child["area_type"].InnerText; arealist.arealist.Add(area); } message.result = arealist; return(arealist); } catch (System.NullReferenceException) { return(getarealist()); } }
public void PaintSurface(SkiaManager skiaManager, SKCanvas canvas) { (Vector2 Min, Vector2 Max) = RectTransform.Rect; float radius = ((CircleArea)StartRegion).Radius; SKPoint pos = ((CircleArea)StartRegion).Position.ToSKPoint(); canvas.DrawCircle(skiaManager.SketchSpaceToCanvasSpaceMatrix.MapPoint(pos), skiaManager.SketchSpaceToCanvasSpaceMatrix.MapRadius(radius), IdlePaint); canvas.DrawCircle(skiaManager.SketchSpaceToCanvasSpaceMatrix.MapPoint(pos), skiaManager.SketchSpaceToCanvasSpaceMatrix.MapRadius(MaxLength), MaxLengthAreaPaint); if (Pressed) { var endPos = (((CircleArea)StartRegion).Position + Delta).ToSKPoint(); canvas.DrawLine(skiaManager.SketchSpaceToCanvasSpaceMatrix.MapPoint(pos), skiaManager.SketchSpaceToCanvasSpaceMatrix.MapPoint(endPos), LinePaint); var pointer = OnSketchPointer; SKPoint pointerPoint = skiaManager.SketchSpaceToCanvasSpaceMatrix.MapPoint(new SKPoint(pointer.Point.X, pointer.Point.Y)); StringBuilder sb = new StringBuilder(); sb.AppendLine("POINTER INFO:"); foreach (var area in AreaList.ToArray()) { if (area.Status == AreaStatus.Pressed) { sb.Append(area.AreaIdentifier + ", "); } } canvas.DrawText(sb.ToString(), pointerPoint, _BoardFontPaint); } }
public void Refresh(bool refr_1 = true, bool refr_2 = true, bool refr_3 = true, bool refr_4 = true) { if (refr_1) { AreaList.Clear(); AreaList.AddRange(PubMaster.Mod.AreaSql.QueryAreaList()); } if (refr_2) { AreaDevList.Clear(); AreaDevList.AddRange(PubMaster.Mod.AreaSql.QueryAreaDeviceList()); } if (refr_3) { AreaTraList.Clear(); AreaTraList.AddRange(PubMaster.Mod.AreaSql.QueryAreaTrackList()); } if (refr_4) { AreaDevTraList.Clear(); AreaDevTraList.AddRange(PubMaster.Mod.AreaSql.QueryAreaDeviceTrackList()); } }
protected override void Parse(Stream s) { BinaryReader r = new BinaryReader(s); tag = r.ReadUInt32(); if (checking) { if (tag != (uint)FOURCC("FTPT")) { throw new InvalidDataException(String.Format("Invalid Tag read: '{0}'; expected: 'FTPT'; at 0x{1:X8}", FOURCC(tag), s.Position)); } } version = r.ReadUInt32(); instance = r.ReadUInt64(); type = r.ReadUInt32(); group = r.ReadUInt32(); if (type != 0) { minHeightOverrides = new PolygonHeightOverrideList(OnRCOLChanged, s); maxHeightOverrides = new PolygonHeightOverrideList(OnRCOLChanged, s); footprintAreas = new AreaList(OnRCOLChanged, version); slotAreas = new AreaList(OnRCOLChanged, version); } else { minHeightOverrides = new PolygonHeightOverrideList(OnRCOLChanged); maxHeightOverrides = new PolygonHeightOverrideList(OnRCOLChanged); footprintAreas = new AreaList(OnRCOLChanged, s, version); slotAreas = new AreaList(OnRCOLChanged, s, version); maxHeight = r.ReadSingle(); minHeight = r.ReadSingle(); } }
protected new SortedBindingList <AreaInfo> Localize(object value, string column_name) { SortedBindingList <AreaInfo> list = null; AreaList sourceList = null; switch (FilterType) { case IFilterType.None: if (List == null) { MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = List; break; case IFilterType.Filter: if (FilteredList == null) { MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = FilteredList; break; } FCriteria criteria = null; string related = "none"; switch (column_name) { default: { criteria = GetCriteria(column_name, value, _operation); } break; } switch (related) { case "none": { list = sourceList.GetSortedSubList(criteria); } break; } if (list.Count == 0) { MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS); return(sourceList.GetSortedList()); } DatosSearch.DataSource = list; DatosSearch.MoveFirst(); AddFilterLabel(column_name, value); Tabla.Focus(); return(list); }
public HttpResponseMessage GetArea(string Product) { AreaList AreaList = new AreaList(); AreaList.Areas = new List <Area>(); if (con.State == ConnectionState.Closed) { con.Open(); } SqlCommand cmd = new SqlCommand("GetAspenProductAreaSubarea", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ProductName", Product); SqlDataReader dr = cmd.ExecuteReader(); while (dr.Read()) { Area area = new Area { AreaName = dr["AreaName"].ToString() }; AreaList.Areas.Add(area); } if (con.State == ConnectionState.Open) { con.Close(); } return(Request.CreateResponse(HttpStatusCode.OK, AreaList)); }
/// <summary> /// 初始化编辑时地址下拉框 /// </summary> /// <param name="user"></param> public void InitialEditAddress(DataOfUserDetial user) { CountryList.Clear(); ProvinceList.Clear(); CityList.Clear(); AreaList.Clear(); var countryList = new Areas() { parent_id = 0, type = 1 }.GetChildrenList(); var provinceList = new Areas() { parent_id = 1 /*user.countryId*/, type = 2 }.GetChildrenList(); var cityList = new Areas() { parent_id = user.provinceId, type = 3 }.GetChildrenList(); var areaList = new Areas() { parent_id = user.cityId, type = 4 }.GetChildrenList(); CountryList.AddRange(countryList.ToObservableCollection()); ProvinceList.AddRange(provinceList.ToObservableCollection()); CityList.AddRange(cityList.ToObservableCollection()); AreaList.AddRange(areaList.ToObservableCollection()); CountryIndex = 1; //user.countryId; ProvinceIndex = user.provinceId; CityIndex = user.cityId; AreaIndex = user.areaId; }
// Get area list public List <AreaList> GetAreaList(string areaOf) { List <AreaList> areaLists = new List <AreaList>(); try { DBConnectionClass dBConnection = new DBConnectionClass { DatabaseName = "StayInEatIn" }; string Col_Area = areaOf; if (dBConnection.IsConnect()) { var cmd = new SqlCommand("SIEI_AREA_GetAreaList", dBConnection.Connection); SqlDataAdapter reader = new SqlDataAdapter(cmd); reader.SelectCommand.CommandType = CommandType.StoredProcedure; reader.SelectCommand.Parameters.AddWithValue("@H_T", Col_Area); reader.SelectCommand = cmd; if (reader != null) { DataTable dt = new DataTable(); reader.Fill(dt); foreach (DataRow areas in dt.Rows) { AreaList d = new AreaList(); d.Area = (string)areas["Area"]; areaLists.Add(d); } return(areaLists); } else { System.Diagnostics.Debug.WriteLine("Empty Reader"); } dBConnection.Close(); return(null); } else { System.Diagnostics.Debug.WriteLine("Conn Failed"); return(null); } } catch (Exception e) { System.Diagnostics.Debug.WriteLine("Unsuccessful Query Excution"); throw e; } finally { } }
/// <summary> /// Asigna el objeto principal al origen de datos /// <returns>void</returns> /// </summary> public override void RefreshSecondaryData() { AreaList areas = AreaList.GetList(false); Library.Quality.HComboBoxSourceList combo_areas = new Library.Quality.HComboBoxSourceList(areas); Datos_ComboAreas.DataSource = combo_areas; Bar.Grow(); }
/// <summary> /// 显示条码规则列表 /// </summary> public void ShowAreaTable() { foreach (var model in GetAreaList()) { AreaList.Add(model); } ShowAreaList(); }
public FTPT(int APIversion, EventHandler handler, FTPT basis) : base(APIversion, null, null) { this.handler = handler; this.version = basis.version; this.footprintAreas = new AreaList(OnRCOLChanged, basis.footprintAreas, version); this.slotAreas = new AreaList(OnRCOLChanged, basis.slotAreas, version); }
public Bitmap DrawAreas() { AreaList.ForEach(x => x.DrawArea()); LinesList.ForEach(x => x.DrawLine()); GetRackList().ForEach(x => x.DrawRack()); AGVList.ForEach(x => x.LoadImage()); return(iBlade.DrawArea); }
private void comboBoxAreaList_SelectedIndexChanged(object sender, EventArgs e) { AreaList list = new AreaList(); if ((comboBoxAreaList.Items != null) && (comboBoxAreaList.Items.Count > 0) && (comboBoxAreaList.SelectedItem != null)) { this.aid = ((ComboxItem)comboBoxAreaList.SelectedItem).Value.ToString(); } updateFloor(); }
/// <summary> /// search all rooms in AreaList assigning coords then checking neighbours /// and repeating until AreaList is empty /// /// Completed rooms are added to CompletedRooms and removed from AreaList /// /// </summary> /// <returns>Returns CompletedRooms which contains the list of rooms that have coordinates set</returns> public List <Room.Room> AssignCoords() { var startingLoc = AreaList.FirstOrDefault(x => x.areaId == 0); if (startingLoc == null) { return(null); } SetCoords(startingLoc, new Coordinates()); /* * Takes the 1st room and search all 4 exits * and assigns them coordinates adding them * to the completed list */ ProcessRoom(startingLoc); /* * Now completedList has areas, loop areaList looking for rooms * that have exits that lead to one of the rooms in the completed list */ while (AreaList.Count > 0) { var getRoom = AreaList.Last(); //Check if getRoom has a neighbour in the completed List var getNeighbour = GetNeighbour(getRoom); if (getNeighbour != null) { var getExitToNeighbour = GetNeighbourExit(getRoom, getNeighbour); if (getExitToNeighbour != null) { SetCoords(getRoom, GetNewCoord(getNeighbour.coords, getExitToNeighbour.name, true)); } ProcessRoom(getRoom); } else { /* * if nothing found remove the room from areaList * and add back to the top of the Area:ist */ AreaList.Remove(getRoom); AreaList.Insert(0, getRoom); } } //Once all rooms in areaList have been processed return the list of completed rooms return(CompletedRooms); }
private void timer1_Tick(object sender, EventArgs e) { list = updater.updateFairyInfo(); playerinfo = updater.updateInfo(); area = updater.updateArea(); updater.settingRecovery(useAP, useBC); if (aid != null) { floor = updater.updatefloor(aid); } }
public static GetArchitypeListPJ GetAreaandCountryDataPJ(List <String> architypeID) { GetArchitypeListPJ lstresponse = new GetArchitypeListPJ(); using (PJEntities entity = new PJEntities()) { var countryData = entity.Country_Master.ToList(); var areaData = entity.Area_Master.ToList(); for (int i = 0; i < architypeID.Count; i++) { int archetypeID = Convert.ToInt32(architypeID[i]); AreaList _area = new AreaList(); lstresponse.AreaList = (from a in areaData where a.Archetype_Master_Id == archetypeID where a.Is_Active == true select new AreaList() { AreaId = a.Area_Master_Id, AreaName = a.Area_Name }).OrderBy(x => x.AreaName).ToList(); } List <AreaList2> areaListFinal = new List <AreaList2>(); for (int j = 0; j < lstresponse.AreaList.Count; j++) { int archetypeID = Convert.ToInt32(architypeID[j]); for (int i = 0; i < lstresponse.AreaList.Count; i++) { AreaList2 _area = new AreaList2(); _area.AreaId = Convert.ToInt32(lstresponse.AreaList[i].AreaId); _area.AreaName = areaData.Where(x => x.Area_Master_Id == _area.AreaId).FirstOrDefault().Area_Name.ToString(); var countrylist = (from h in countryData where h.Area_Master_Id == _area.AreaId where h.Archetype_Master_Id == archetypeID where h.Is_Active == true select new CountryList() { CountryId = h.Country_Master_Id, CountryName = h.Country_Name, AreaId = h.Area_Master_Id, AreaName = _area.AreaName }).OrderBy(x => x.CountryName).ToList(); _area.CountryList = countrylist; areaListFinal.Add(_area); } } lstresponse.AreaCountryList = areaListFinal; } return(lstresponse); }
public Core() { Offline = true; user = UserInfo.GetYou(); userList = new UserList(); monsterList = new MonsterList(); monsterUserList = new MonsterList(); userList = new UserList(); areaList = new AreaList(); //garden = new Garden.Garden(); mapCore = new MapCore(user); Shop = new Shop(); }
protected override void Parse(Stream s) { BinaryReader r = new BinaryReader(s); tag = r.ReadUInt32(); if (tag != (uint)FOURCC("FTPT")) { throw new InvalidDataException( $"Invalid Tag read: '{FOURCC(tag)}'; expected: 'FTPT'; at 0x{s.Position:X8}"); } version = r.ReadUInt32(); footprintAreas = new AreaList(OnRCOLChanged, s, version); slotAreas = new AreaList(OnRCOLChanged, s, version); }
private void ExecuteAddArea() { using (var unitofWork = new UnitOfWork(new MahalluDBContext())) { var area = new Area() { Name = AreaText }; unitofWork.Areas.Add(area); AreaList.Add(area); eventAggregator.GetEvent <PubSubEvent <ObservableCollection <Area> > >().Publish(AreaList); unitofWork.Complete(); AreaText = String.Empty; } }
public FTPT(int APIversion, EventHandler handler, FTPT basis) : base(APIversion, handler, null) { this.version = basis.version; this.instance = basis.instance; this.type = basis.type; this.group = basis.group; this.minHeightOverrides = basis.minHeightOverrides == null ? null : new PolygonHeightOverrideList(OnRCOLChanged, basis.minHeightOverrides); this.maxHeightOverrides = basis.maxHeightOverrides == null ? null : new PolygonHeightOverrideList(OnRCOLChanged, basis.maxHeightOverrides); this.footprintAreas = basis.footprintAreas == null ? null : new AreaList(OnRCOLChanged, basis.footprintAreas, version); this.slotAreas = basis.slotAreas == null ? null : new AreaList(OnRCOLChanged, basis.slotAreas, version); this.maxHeight = basis.maxHeight; this.minHeight = basis.minHeight; }
protected new SortedBindingList <AreaInfo> Localize(FilterItem item) { SortedBindingList <AreaInfo> list = null; AreaList sourceList = null; switch (FilterType) { case IFilterType.None: if (List == null) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = List; break; case IFilterType.Filter: if (FilteredList == null) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = FilteredList; break; } if (item.FilterProperty == IFilterProperty.All) { FCriteria criteria = GetCriteria(string.Empty, item.Value, null, item.Operation); list = sourceList.GetSortedSubList(criteria, _properties_list); } else { FCriteria criteria = GetCriteria(item.Column, item.Value, null, item.Operation); list = sourceList.GetSortedSubList(criteria, _properties_list); } if (list.Count == 0) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(sourceList.GetSortedList()); } DatosSearch.DataSource = list; DatosSearch.MoveFirst(); AddFilterLabel(item); return(list); }
public Bitmap DrawAreas() { LinesList.ForEach(x => x.DrawLine()); GetRackList().ForEach(x => x.DrawRack()); Area inbound = new Area("INBOUND", new Size(150, 100), new Point(130, 500)); Area outbound = new Area("OUTBOUND", new Size(150, 100), new Point(550, 500)); this.AreaList.Add(inbound); this.AreaList.Add(outbound); AreaList.ForEach(x => x.DrawArea()); return(iBlade.DrawArea); }
public AreaMngForm(bool isModal, Form parent, AreaList list) : base(isModal, parent, list) { InitializeComponent(); SetView(molView.Normal); // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas DatosLocal_BS = Datos; Tabla.DataSource = DatosLocal_BS; SetMainDataGridView(Tabla); Datos.DataSource = AreaList.NewList().GetSortedList(); base.SortProperty = Codigo.DataPropertyName; this.Text = Resources.Labels.AREAS; }
private void ExecuteDelete(Area area) { MessageBoxResult messageBoxResult = MessageBox.Show("Are you sure to delete", "Delete", MessageBoxButton.YesNo, MessageBoxImage.Warning); if (messageBoxResult == MessageBoxResult.Yes) { using (var unitofWork = new UnitOfWork(new MahalluDBContext())) { AreaList.Remove(area); eventAggregator.GetEvent <PubSubEvent <ObservableCollection <Area> > >().Publish(AreaList); var result = unitofWork.Areas.Find((x) => x.Id == area.Id).FirstOrDefault(); unitofWork.Areas.Remove(result); unitofWork.Complete(); } } }
/// <summary> /// 初始化地址 /// </summary> /// <param name="user">对应的用户</param> public void InitialViewAddress(DataOfUserDetial user) { MyDetialPage = 0; CountryList.Clear(); ProvinceList.Clear(); CityList.Clear(); AreaList.Clear(); var countryList = new Areas() { parent_id = 0, type = 1 }.GetChildrenList(); CountryList.AddRange(countryList.ToObservableCollection()); var currentCoun = countryList.FirstOrDefault(c => c.id == user.countryId); DCountry = (currentCoun == null) ? "" : currentCoun.name;//设置国家名称 var provinceList = new Areas() { parent_id = user.countryId == 0 ? (1) : (user.countryId), type = 2 }.GetChildrenList(); //如果未选择国家则默认为中国 ProvinceList.AddRange(provinceList.ToObservableCollection()); var currentProvin = provinceList.FirstOrDefault(c => c.id == user.provinceId); DProvince = (currentProvin == null) ? "" : currentProvin.name;//设置省份名称 var cityList = new Areas() { parent_id = user.provinceId, type = 3 }.GetChildrenList(); CityList.AddRange(cityList.ToObservableCollection()); var cuttentCity = cityList.FirstOrDefault(c => c.id == user.cityId); DCity = cuttentCity == null ? "" : cuttentCity.name;//设置城市名称 var areaList = new Areas() { parent_id = user.cityId, type = 4 }.GetChildrenList(); AreaList.AddRange(areaList.ToObservableCollection()); var currentArea = areaList.FirstOrDefault(c => c.id == user.areaId); DArea = currentArea == null ? "" : currentArea.name;//设置区域名称 }
void BindCityAndArea() { Doctors o = new Doctors(); DataSet ds = o.GetCitiesAndAreas(); DataView dvCities = new DataView(ds.Tables[0]); DataView dvAreas = new DataView(ds.Tables[0]); //dvCities.RowFilter = " Distinct City"; CityList.DataSource = dvCities.ToTable(); CityList.DataTextField = "City"; CityList.DataValueField = "City"; CityList.DataBind(); CityList.Items.Insert(0, "Select"); AreaList.DataSource = ds; AreaList.DataTextField = "LocationName"; AreaList.DataValueField = "LocationId"; AreaList.DataBind(); AreaList.Items.Insert(0, "Select"); HospitalCityList.DataSource = dvCities.ToTable(); HospitalCityList.DataTextField = "City"; HospitalCityList.DataValueField = "City"; HospitalCityList.DataBind(); HospitalCityList.Items.Insert(0, "Select"); HospitalAreaList.DataSource = ds; HospitalAreaList.DataTextField = "LocationName"; HospitalAreaList.DataValueField = "LocationId"; HospitalAreaList.DataBind(); HospitalAreaList.Items.Insert(0, "Select"); HospitalList.Items.Insert(0, "Select"); LabCityList.DataSource = dvCities.ToTable(); LabCityList.DataTextField = "City"; LabCityList.DataValueField = "City"; LabCityList.DataBind(); LabCityList.Items.Insert(0, "Select"); LabAreaList.DataSource = ds; LabAreaList.DataTextField = "LocationName"; LabAreaList.DataValueField = "LocationId"; LabAreaList.DataBind(); LabAreaList.Items.Insert(0, "Select"); }
public override void UpdateList() { switch (_current_action) { case molAction.Add: if (_entity == null) { return; } List.AddItem(_entity.GetInfo(false)); if (FilterType == IFilterType.Filter) { AreaList listA = AreaList.GetList(_filter_results); listA.AddItem(_entity.GetInfo(false)); _filter_results = listA.GetSortedList(); } break; case molAction.Edit: case molAction.Lock: case molAction.Unlock: if (_entity == null) { return; } ActiveItem.CopyFrom(_entity); break; case molAction.Delete: if (ActiveItem == null) { return; } List.RemoveItem(ActiveOID); if (FilterType == IFilterType.Filter) { AreaList listD = AreaList.GetList(_filter_results); listD.RemoveItem(ActiveOID); _filter_results = listD.GetSortedList(); } break; } _entity = null; RefreshSources(); }
/// <summary> /// Toma la lista de bancos de la base de datos y rellena la tabla. /// </summary> protected override void RefreshMainData() { Bar.Grow(string.Empty, "Area"); _selected_oid = ActiveOID; switch (DataType) { case EntityMngFormTypeData.Default: List = AreaList.GetList(false); break; case EntityMngFormTypeData.ByParameter: _sorted_list = List.GetSortedList(); break; } Bar.Grow(string.Empty, "Lista de Productos"); }
public void Proc() { int itemCount = int.Parse(Reader.ReadLine()); int[] timeArr = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray(); int[] spdArr = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray(); for (int i = 0; i < itemCount; i++) { this.AreaList.Add(new Area(i, timeArr[i], spdArr[i])); } this.AreaList[0].EnterMaxSpeed = 0; this.AreaList.Last().LeaveMaxSpeed = 0; if (this.AreaList.Count > 1) { this.AreaList[0].LeaveMaxSpeed = Math.Min(this.AreaList[0].LeaveMaxSpeed, this.AreaList[1].EnterMaxSpeed); } Queue <Area> que = new Queue <Area>(); que.Enqueue(this.AreaList[0]); while (que.Count > 0) { Area current = que.Dequeue(); if (!current.IsModified) { continue; } current.IsModified = false; if (current.ID > 0) { Area prev = this.AreaList[current.ID - 1]; prev.LeaveMaxSpeed = Math.Min(prev.LeaveMaxSpeed, current.EnterMaxSpeed); que.Enqueue(prev); } if (current.ID < this.AreaList.Count - 1) { Area next = this.AreaList[current.ID + 1]; next.EnterMaxSpeed = Math.Min(next.EnterMaxSpeed, current.LeaveMaxSpeed); que.Enqueue(next); } } decimal ans = AreaList.Sum(a => a.GetLength()); Console.WriteLine(ans); }
public override Stream UnParse() { MemoryStream ms = new MemoryStream(); BinaryWriter w = new BinaryWriter(ms); w.Write(tag); w.Write(version); if (footprintAreas == null) { footprintAreas = new AreaList(OnRCOLChanged, version); } footprintAreas.UnParse(ms); if (slotAreas == null) { slotAreas = new AreaList(OnRCOLChanged, version); } slotAreas.UnParse(ms); return(ms); }