private void CargarControles() { PrevencionRiesgosWCF.PrevencionClient proxy = new PrevencionRiesgosWCF.PrevencionClient(); Regiones = RegionCollection.Deserializar(proxy.ReadRegionCiudadComunaCollection()).ToDictionary(x => x.IdRegion, x => x); var giros = GiroCollection.Deserializar(proxy.ReadGiroCollection()); proxy.Close(); cbRegion.DisplayMemberPath = "Nombre"; cbRegion.SelectedValuePath = "IdRegion"; cbCiudad.DisplayMemberPath = "Nombre"; cbCiudad.SelectedValuePath = "IdCiudad"; cbComuna.DisplayMemberPath = "Nombre"; cbComuna.SelectedValuePath = "IdComuna"; CargarComboRegion(Regiones.First().Key); cbGiro.DisplayMemberPath = "Nombre"; cbGiro.SelectedValuePath = "IdGiro"; cbGiro.ItemsSource = giros; cbGiro.SelectedValue = giros.First().IdGiro; cbGiro.Items.Refresh(); }
public static IntVec3 WorldToDataPosition(RegionCollection regionCollection, Vector3 worldPosition) { Transform transform = regionCollection.GetPositionPointer(); transform.position = worldPosition; return(new IntVec3((int)transform.localPosition.x, (int)transform.localPosition.y, (int)transform.localPosition.z)); }
public DataSplitFinder(IntVec3 startPosition, RegionCollection regionCollection, List <DataSplitFinder> finders, List <DataSplitFinder> findersToRemove) { _regionCollection = regionCollection; _finders = finders; _findersToRemove = findersToRemove; _confirmed.Add(startPosition); }
public RegionCollection FetchAll() { RegionCollection coll = new RegionCollection(); Query qry = new Query(Region.Schema); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
private void cmdSave_Click(object sender, EventArgs e) { int regionId; int.TryParse(this.Request["id"], out regionId); Region region = Region.SelectUsingPK(regionId); if (region == null) { //For some reason Microsoft did not make this an autonumber int?maxRegionId = RegionCollection.GetMax(x => x.RegionId); RegionCollection regionCollection = new RegionCollection(); region = regionCollection.NewItem(maxRegionId.Value + 1); region.RegionDescription = txtDescription.Text; regionCollection.AddItem(region); regionCollection.Persist(); } else { region.RegionDescription = txtDescription.Text; region.Persist(); } this.Response.Redirect(SessionHelper.LastRegionListSearch); }
public RegionCollection FetchRegionsByPageIdAndTemplateRegionId(int pageId, int templateRegionId) { IDataReader reader = SPs.FetchRegionsByPageIdAndTemplateRegionId(pageId, templateRegionId).GetReader(); RegionCollection regionCollection = new RegionCollection(); regionCollection.LoadAndCloseReader(reader); return regionCollection; }
public RegionCollection Region_LoadAll() { RegionCollection coll = new RegionCollection(); coll.es.IsLazyLoadDisabled = true; coll.LoadAll(); return(coll); }
/// <summary> /// Creates a new instance of the <see cref="ExceptionHandlerRegion{TInstruction}"/> class. /// </summary> public ExceptionHandlerRegion() { ProtectedRegion = new BasicControlFlowRegion <TInstruction> { ParentRegion = this }; HandlerRegions = new RegionCollection <TInstruction>(this); }
private void Regiones() { string jsonRegion = proxy.ReadRegiones(); //Se obtiene el Json de Servicio listaRegion = RegionCollection.Deserializar(jsonRegion); //Convierte lista de servicio en clase de coleccion ddRegion.DataSource = listaRegion; ddRegion.DataBind(); regionId = int.Parse(ddRegion.SelectedValue); }
/// <summary> /// Creates a new instance of the <see cref="ExceptionHandlerRegion{TInstruction}"/> class. /// </summary> public ExceptionHandlerRegion() { ProtectedRegion = new ScopeRegion <TInstruction> { // We need to manually set the parent region here. ParentRegion = this }; Handlers = new RegionCollection <TInstruction, HandlerRegion <TInstruction> >(this); }
public static void SetAt(RegionCollection regionCollection, IntVec3 dataPosition, Block block) { DataPoints points = new DataPoints(dataPosition); Region region = regionCollection.GetRegion(points.regionDataPosition.x, points.regionDataPosition.y, points.regionDataPosition.z); if (!ReferenceEquals(region, null)) { region.SetBlock(points.voxelDataPosition.x, points.voxelDataPosition.y, points.voxelDataPosition.z, block); } }
public RegionCollection Region_LoadByDynamic(string serializedQuery) { RegionQuery query = RegionQuery.SerializeHelper.FromXml( serializedQuery, typeof(RegionQuery), AllKnownTypes) as RegionQuery; RegionCollection coll = new RegionCollection(); coll.es.IsLazyLoadDisabled = true; coll.Load(query); return(coll); }
public static Block GetAt(RegionCollection regionCollection, IntVec3 dataPosition) { DataPoints points = new DataPoints(dataPosition); Region region = regionCollection.GetRegion(points.regionDataPosition.x, points.regionDataPosition.y, points.regionDataPosition.z); if (!ReferenceEquals(region, null)) { return(region.GetBlock(points.voxelDataPosition.x, points.voxelDataPosition.y, points.voxelDataPosition.z)); } return(new Block(0, 1, 0)); }
public RegionCollection.RegionCollectionWCFPacket Region_LoadAll() { RegionCollection coll = new RegionCollection(); if (coll.LoadAll()) { return(coll); } return(null); }
public RegionCollectionProxyStub Region_LoadAll() { RegionCollection coll = new RegionCollection(); if (coll.LoadAll()) { return(coll); } return(null); }
public RegionCollectionProxyStub Region_SaveCollection(RegionCollectionProxyStub collection) { if (collection != null) { RegionCollection c = collection.GetCollection(); c.Save(); return(c); } return(null); }
private static void TrimBadPoints(RegionCollection regionCollection, List <IntVec3> positions) { for (int i = 0; i < positions.Count; i++) { IntVec3 position = positions[i]; IntVec3 dimensions = regionCollection.GetDimensions() * VoxelData.SIZE; if (!ValidPosition(regionCollection.GetDimensions() * VoxelData.SIZE, position) || GetAt(regionCollection, position).visible == 0) { positions.RemoveAt(i); i--; } } }
public static RegionCollection ToDtoCollection(this EntityCollection <RegionEntity> entities) { OnBeforeEntityCollectionToDtoCollection(entities); var seenObjects = new Hashtable(); var collection = new RegionCollection(); foreach (var entity in entities) { collection.Add(entity.ToDto(seenObjects, new Hashtable())); } OnAfterEntityCollectionToDtoCollection(entities, collection); return(collection); }
public RegionCollectionProxyStub Region_QueryForCollection(string serializedQuery) { RegionQuery query = RegionQuery.SerializeHelper.FromXml( serializedQuery, typeof(RegionQuery), AllKnownTypes) as RegionQuery; RegionCollection coll = new RegionCollection(); if (coll.Load(query)) { return(coll); } return(null); }
void proc_click(Object sender, EventArgs e) { int i, j; Workbook workbook = new Workbook(); Worksheet warea = new Worksheet("Area"); RegionCollection rc = new RegionCollection(); for (i = 0; i < imWidth; i++) { for (j = 0; j < imHeight; j++) { rc.Add(mask[i, j]); } } j = 3; warea.Cells[0, 0] = new Cell("Region"); warea.Cells[0, 1] = new Cell("Area"); warea.Cells[1, 0] = new Cell("Pared"); warea.Cells[1, 1] = new Cell(rc.GetVal(1)); warea.Cells[2, 0] = new Cell("Exterior"); warea.Cells[2, 1] = new Cell(rc.GetVal(2)); for (i = 3; i < rc.Count; i++) { if (rc.GetVal(i) > 0) { warea.Cells[j, 0] = new Cell("Alveolo"); warea.Cells[j, 1] = new Cell(rc.GetVal(i)); j++; } } for (i = 0; i < 100; i++) { warea.Cells[i + j + 1, 0] = new Cell(""); } double[] lm = new Lm(imWidth, imHeight, mask).Process(); Worksheet wlm = new Worksheet("Lm"); wlm.Cells[0, 0] = new Cell("Lm X"); wlm.Cells[0, 1] = new Cell(lm[0]); wlm.Cells[1, 0] = new Cell("Lm y"); wlm.Cells[1, 1] = new Cell(lm[1]); wlm.Cells[2, 0] = new Cell("Lm medio"); wlm.Cells[2, 1] = new Cell((lm[0] + lm[1]) / 2); workbook.Worksheets.Add(warea); workbook.Worksheets.Add(wlm); string f = "C:\\histo\\histo.xls"; workbook.Save(f); Process.Start(f); }
protected override void OnInit(EventArgs e) { base.OnInit(e); cmdSave.Click += new EventHandler(cmdSave_Click); cmdCancel.Click += new EventHandler(cmdCancel_Click); if (!this.IsPostBack) { //Load the products RegionCollection regionCollection = RegionCollection.RunSelect(); cboRegion.DataTextField = Region.FieldNameConstants.RegionDescription.ToString(); cboRegion.DataValueField = Region.FieldNameConstants.RegionId.ToString(); cboRegion.DataSource = (from x in regionCollection orderby x.RegionDescription select x); cboRegion.DataBind(); } }
private void grdItem_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "GoDelete") { int id = int.Parse((string)e.CommandArgument); try { RegionCollection.DeleteData(x => x.RegionId == id); } catch (Exception ex) { lblError.Text = "The item has dependencies and cannot be deleted."; return; } this.Populate(); } }
private static void CheckSplit(System.Object splitCheckInfo) { RegionCollection regionCollection = ((SplitCheckInfo)splitCheckInfo).regionCollection; List <IntVec3> startPositions = ((SplitCheckInfo)splitCheckInfo).positions; TrimBadPoints(regionCollection, startPositions); List <DataSplitFinder> finders = new List <DataSplitFinder>(); List <DataSplitFinder> findersToRemove = new List <DataSplitFinder>(); foreach (IntVec3 position in startPositions) { finders.Add(new DataSplitFinder(position, regionCollection, finders, findersToRemove)); } int iterationCalls = 0; while (finders.Count > 1) { if (iterationCalls > MAX_ITERATIONS) { Debug.LogError("Split check could not be completed: Area too large"); break; } foreach (DataSplitFinder finder in finders) { if (!findersToRemove.Contains(finder)) { iterationCalls++; finder.Iterate(); } } foreach (DataSplitFinder finder in findersToRemove) { finders.Remove(finder); } } //Debug.Log(string.Format("{0} iteration calls made.", iterationCalls)); }
private void cmdSave_Click(object sender, EventArgs e) { int regionId; int.TryParse(this.Request["id"], out regionId); Region region = Region.SelectUsingPK(regionId); if (region == null) { //For some reason Microsoft did not make this an autonumber int? maxRegionId = RegionCollection.GetMax(x => x.RegionId); RegionCollection regionCollection = new RegionCollection(); region = regionCollection.NewItem(maxRegionId.Value + 1); region.RegionDescription = txtDescription.Text; regionCollection.AddItem(region); regionCollection.Persist(); } else { region.RegionDescription = txtDescription.Text; region.Persist(); } this.Response.Redirect(SessionHelper.LastRegionListSearch); }
public MainViewModel() { RegionCollection = new RegionCollection(); _SelectedRegion = RegionCollection.GetRegion(AppSettingsService.GetSetting(AppSettingsService.REGION_SETTINGS).ToString()); _NumberOfImageLoad = (double)AppSettingsService.GetSetting(AppSettingsService.NUMBER_OF_IMAGE_LOAD_SETTINGS); DefaultSave = (bool)AppSettingsService.GetSetting(AppSettingsService.DEFAULT_SAVE_SETTINGS); DefaultSaveLocationPath = AppSettingsService.GetSetting(AppSettingsService.DEFAULT_SAVE_LOCATION_SETTINGS).ToString(); AutoWallpaper = (bool)AppSettingsService.GetSetting(AppSettingsService.AUTO_WALLPAPER_SETTINGS); AutoWallpaper_Wifi = (bool)AppSettingsService.GetSetting(AppSettingsService.AUTO_WALLPAPER_WIFI_SETTINGS); IsAutoWallpaperTaskLoading = false; LiveTile = (bool)AppSettingsService.GetSetting(AppSettingsService.LIVE_TILE_SETTINGS); LiveTile_Wifi = (bool)AppSettingsService.GetSetting(AppSettingsService.LIVE_TILE_WIFI_SETTINGS); IsLiveTileBackgroundTaskLoading = false; AutoSave = (bool)AppSettingsService.GetSetting(AppSettingsService.AUTO_SAVE_SETTINGS); AutoSaveLocationPath = AppSettingsService.GetSetting(AppSettingsService.AUTO_SAVE_LOCATION_SETTINGS).ToString(); AutoSave_Wifi = (bool)AppSettingsService.GetSetting(AppSettingsService.AUTO_SAVE_WIFI_SETTINGS); IsAutoSaveBackgroundTaskLoading = false; Theme = (int)AppSettingsService.GetSetting(AppSettingsService.THEME_SETTINGS); }
public RegionManager() { Regions = new RegionCollection(); }
static partial void OnAfterEntityCollectionToDtoCollection(EntityCollection <RegionEntity> entities, RegionCollection dtos);
/// <summary> /// Initializes a new instance of <see cref="RegionManager"/>. /// </summary> public RegionManager() { regionCollection = new RegionCollection(this); }
public MeshGeneratorInfo(Region region, RegionCollection regionCollection, IntVec3 dataPosition) { this.region = region; this.regionCollection = regionCollection; this.dataPosition = dataPosition; }
internal ParagraphMetrics( Paragraph paragraph, FormatterSink formattedData, TextGeometryCache geometryCache) { Contract.Requires(paragraph != null); Contract.Requires(formattedData != null); Contract.Requires(geometryCache != null); _Paragraph = paragraph; _Leading = formattedData.Leading; _LayoutRegion = formattedData.LayoutRegion; _BaselineOffset = formattedData.BaselineOffset; _Clusters = formattedData.Clusters.ToArray(); _ClusterBidiLevels = new byte[formattedData.Clusters.Count]; _Outlines = CreateOutlineList(formattedData, geometryCache, out _ClusterBidiLevels); // create the text index to cluster index transformation table _TextToCluster = new int[formattedData.FullText.Length]; for(int i = 0; i < _Clusters.Length; ++i) { foreach(int characterIndex in _Clusters[i].Characters) { _TextToCluster[characterIndex] = i; } } // determine the region that encompasses all formatted clusters float left = float.MaxValue; float top = float.MaxValue; float right = float.MinValue; float bottom = float.MinValue; for(int i = 0; i < _Clusters.Length; ++i) { left = Math.Min(left, _Clusters[i].Region.Left); top = Math.Min(top, _Clusters[i].Region.Top); right = Math.Max(right, _Clusters[i].Region.Right); bottom = Math.Max(bottom, _Clusters[i].Region.Bottom); } _TextRegion = Rectangle.FromEdges(left, top, right, bottom); // determine the ranges of each line _LineListBuilder.Clear(); int lastLine = 0; IndexedRange range = IndexedRange.Empty; for(int i = 0; i < formattedData.Runs.Count; ++i) { if(formattedData.Runs[i].LineNumber > lastLine) { _LineListBuilder.Add(ToTextRange(range)); range = new IndexedRange(formattedData.Runs[i].Clusters.StartIndex, 0); lastLine = formattedData.Runs[i].LineNumber; } range = range.Extend(formattedData.Runs[i].Clusters.Length); } if(range.Length > 0) { _LineListBuilder.Add(ToTextRange(range)); } _Lines = new LineCollection(_LineListBuilder); // build a collection of regions mapping to text indexes _RegionListBuilder.Clear(); for(int i = 0; i < paragraph.Text.Length; ++i) { _RegionListBuilder.Add(_Clusters[_TextToCluster[i]].Region); } _Regions = new RegionCollection(_RegionListBuilder); }
/// <summary> /// Creates a new instance of the <see cref="BasicControlFlowRegion{TInstruction}"/> class. /// </summary> public BasicControlFlowRegion() { Regions = new RegionCollection <TInstruction>(this); Nodes = new RegionNodeCollection <TInstruction>(this); }
public RegionCollection FetchByQuery(Query qry) { RegionCollection coll = new RegionCollection(); coll.LoadAndCloseReader(qry.ExecuteReader()); return coll; }
public RegionCollection FetchByID(object RegionId) { RegionCollection coll = new RegionCollection().Where("RegionId", RegionId).Load(); return coll; }
public async Task Regions() { RegionCollection response = await crest.GetRoot().QueryAsync(r => r.Regions); }
/// <summary> /// Initializes a new instance of <see cref="RegionManager"/>. /// </summary> public RegionManager() { regionCollection = new RegionCollection(this); }
/// <summary> /// Creates a new empty graph. /// </summary> /// <param name="architecture">The architecture description of the instructions stored in the control flow graph.</param> public ControlFlowGraph(IInstructionSetArchitecture <TInstruction> architecture) { Architecture = architecture ?? throw new ArgumentNullException(nameof(architecture)); Nodes = new NodeCollection <TInstruction>(this); Regions = new RegionCollection <TInstruction, ControlFlowRegion <TInstruction> >(this); }
public void Open(string guid, string kladr) { connection.ConnectionString = ConnectionString; connection.Open(); CustomReloadCollection(RegionCollection, FiasSql.RegionSql, null); var searchResult = new Dictionary <string, string>(); using (var transaction = connection.BeginTransaction()) { using (var query = new DbQuery(connection, transaction)) { query.SqlText = "select ID_REGION, ID_AUTO, ID_AREA, ID_CITY, ID_CTAR, ID_PLACE, ID_STREET, ID_HOUSE from PR_FIAS_EXTRACT(@ID_GUID, @ID_KLADR)"; query.Parameters.Add(query.GetNewParameter("ID_GUID", guid == string.Empty ? null : guid)); query.Parameters.Add(query.GetNewParameter("ID_KLADR", kladr == string.Empty ? null : kladr)); query.ExecuteDataReader(); if (query.DataReader.Read()) { for (var i = 0; i < query.DataReader.FieldCount; i++) { searchResult.Add(query.DataReader.GetName(i), query.DataReader[i].ToString()); } } } } if (searchResult.Count == 0) { return; } if (searchResult["ID_REGION"] != string.Empty) { SelectedRegion = RegionCollection.FirstOrDefault(a => a.Id == searchResult["ID_REGION"]); } if (searchResult["ID_AUTO"] != string.Empty) { SelectedAuto = AutoCollection.FirstOrDefault(a => a.Id == searchResult["ID_AUTO"]); } if (searchResult["ID_AREA"] != string.Empty) { SelectedArea = AreaCollection.FirstOrDefault(a => a.Id == searchResult["ID_AREA"]); } if (searchResult["ID_CITY"] != string.Empty) { SelectedCity = CityCollection.FirstOrDefault(a => a.Id == searchResult["ID_CITY"]); } if (searchResult["ID_CTAR"] != string.Empty) { SelectedCtar = CtarCollection.FirstOrDefault(a => a.Id == searchResult["ID_CTAR"]); } if (searchResult["ID_PLACE"] != string.Empty) { SelectedPlace = PlaceCollection.FirstOrDefault(a => a.Id == searchResult["ID_PLACE"]); } if (searchResult["ID_STREET"] != string.Empty) { SelectedStreet = StreetCollection.FirstOrDefault(a => a.Id == searchResult["ID_STREET"]); } if (searchResult["ID_HOUSE"] != string.Empty) { SelectedHouse = HouseCollection.FirstOrDefault(a => a.Id == searchResult["ID_HOUSE"]); } }