/// <summary> /// /// </summary> /// <param name="lineList"></param> /// <param name="leftLoc"></param> /// <param name="rightLoc"></param> private void AddCurves(IList lineList, Locations leftLoc, Locations rightLoc) { for (IEnumerator i = lineList.GetEnumerator(); i.MoveNext(); ) { ICoordinate[] coords = (ICoordinate[]) i.Current; AddCurve(coords, leftLoc, rightLoc); } }
/// <summary> /// Constructs a TopologyLocation specifying how points on, to the left of, and to the /// right of some GraphComponent relate to some Geometry. Possible values for the /// parameters are Location.Null, Location.Exterior, Location.Boundary, /// and Location.Interior. /// </summary> /// <param name="on"></param> /// <param name="left"></param> /// <param name="right"></param> public TopologyLocation(Locations on, Locations left, Locations right) { Init(3); location[(int)Positions.On] = on; location[(int)Positions.Left] = left; location[(int)Positions.Right] = right; }
/// <summary> /// /// </summary> /// <param name="lineList"></param> /// <param name="leftLoc"></param> /// <param name="rightLoc"></param> private void AddCurves(IEnumerable lineList, Locations leftLoc, Locations rightLoc) { for (IEnumerator i = lineList.GetEnumerator(); i.MoveNext(); ) { AddCurve(i.Current as IList<Coordinate>, leftLoc, rightLoc); } }
/// <summary> /// Clone an existing slide (make a copy) /// </summary> /// <param name="presentation">PPT.Presentation object instance</param> /// <param name="slide">PPT.Slide instance that is to be cloned</param> /// <param name="destination">Destination for the cloned slide</param> /// <param name="locationIndex">Optional index for the new slide (slide.Index)</param> /// <returns></returns> public PPT.SlideRange CloneSlide( PPT.Presentation presentation, PPT.Slide slide, Locations.Location destination, int locationIndex = 0) { PPT.SlideRange dupeSlide = slide.Duplicate(); switch (destination) { case Locations.Location.First: dupeSlide.MoveTo(1); break; case Locations.Location.Last: dupeSlide.MoveTo((presentation.Slides.Count)); break; case Locations.Location.Custom: dupeSlide.MoveTo(locationIndex); break; } return dupeSlide; }
void OnTriggerEnter(Collider other) { //Step 1 - Find out if we have any prior memory of this item / person / place. LocationCue locCue = other.GetComponent<LocationCue>(); if (locCue == null) return; CurrentLocation = locCue.CurrentLocation; }
/// <summary> /// Computes the factor for the change in depth when moving from one location to another. /// E.g. if crossing from the Interior to the Exterior the depth decreases, so the factor is -1. /// </summary> public static int DepthFactor(Locations currLocation, Locations nextLocation) { if (currLocation == Locations.Exterior && nextLocation == Locations.Interior) return 1; else if (currLocation == Locations.Interior && nextLocation == Locations.Exterior) return -1; return 0; }
/// <summary> /// Creates a {SegmentString} for a coordinate list which is a raw offset curve, /// and adds it to the list of buffer curves. /// The SegmentString is tagged with a Label giving the topology of the curve. /// The curve may be oriented in either direction. /// If the curve is oriented CW, the locations will be: /// Left: Location.Exterior. /// Right: Location.Interior. /// </summary> private void AddCurve(ICoordinate[] coord, Locations leftLoc, Locations rightLoc) { // don't add null curves! if (coord.Length < 2) return; // add the edge for a coordinate list which is a raw offset curve SegmentString e = new SegmentString(coord, new Label(0, Locations.Boundary, leftLoc, rightLoc)); curveList.Add(e); }
public void CanPaginateLocationsTest() { Locations locationsBeforePagination = new Locations(); Locations locationsAfterPagination = locationsBeforePagination.Paginate<Location>() as Locations; Assert.That(locationsAfterPagination, Is.Not.Null); }
public override void GetLocations(Action<Locations> callback) { var url = serverUrl + "/locations"; Get (url,false, data => { var l = new Locations (data as string); callback(l); }); }
public LocationInfo() { loc = Locations.NONE; isMem = false; isReg = false; isFlag = false; isOffset = false; isWide = false; val = 0; }
/// <summary> /// /// </summary> /// <param name="location"></param> /// <returns></returns> public static int DepthAtLocation(Locations location) { if (location == Locations.Exterior) return 0; if (location == Locations.Interior) return 1; return Null; }
/// <summary> /// This method will call the Tribute Manager class to get the Country list and State list /// </summary> /// /// <param name="countries">This will pass the parent location (country) for the state and null for the country /// </param> /// <returns>This method will return the list of location(state, country)</returns> public IList<Locations> GetCountryList(Locations countries) { try { return FacadeManager.TributeManager.GetCountryList(countries); } catch (Exception ex) { throw ex; } }
/// <summary> /// function to load country names to dropdownlist /// </summary> public void onCountryLoad() { Locations loc = new Locations(); loc.LocationParentId = 0; ddlCountry.DataSource = _usrmgr.Locations(loc); ddlCountry.DataTextField = "LocationName"; ddlCountry.DataValueField = "LocationId"; ddlCountry.DataBind(); ddlCountry.SelectedValue = Convert.ToString(5); }
/// <summary> /// See methods Get(int, int) and Set(int, int, int value) /// </summary> public Dimensions this[Locations row, Locations column] { get { return Get(row, column); } set { Set(row, column, value); } }
/// <summary> /// Converts the location value to a location symbol, for example, <c>EXTERIOR => 'e'</c>. /// </summary> /// <param name="locationValue"></param> /// <returns>Either 'e', 'b', 'i' or '-'.</returns> public static char ToLocationSymbol(Locations locationValue) { switch (locationValue) { case Locations.Exterior: return 'e'; case Locations.Boundary: return 'b'; case Locations.Interior: return 'i'; case Locations.Null: return '-'; } throw new ArgumentException("Unknown location value: " + locationValue); }
public static int Insert(Location location) { dynamic table = new Locations(); var locations = table.Find(user_id: location.UserId, formatted_address: location.FormattedAddress); foreach (var item in locations) { table.Update(new { formatted_address = location.FormattedAddress }, item.id); return item.id; } // do it up - the new ID will be returned from the query var results = table.Insert(new { user_id = location.UserId, formatted_address = location.FormattedAddress, latitude = location.Latitude, longitude = location.Longitude }); return 1; }
/// <summary> /// This method will handle arguments of Location.NULL correctly. /// </summary> /// <returns><c>true</c> if the locations correspond to the opCode.</returns> public static bool IsResultOfOp(Locations loc0, Locations loc1, SpatialFunctions opCode) { if (loc0 == Locations.Boundary) loc0 = Locations.Interior; if (loc1 == Locations.Boundary) loc1 = Locations.Interior; switch (opCode) { case SpatialFunctions.Intersection: return loc0 == Locations.Interior && loc1 == Locations.Interior; case SpatialFunctions.Union: return loc0 == Locations.Interior || loc1 == Locations.Interior; case SpatialFunctions.Difference: return loc0 == Locations.Interior && loc1 != Locations.Interior; case SpatialFunctions.SymDifference: return (loc0 == Locations.Interior && loc1 != Locations.Interior) || (loc0 != Locations.Interior && loc1 == Locations.Interior); default: return false; } }
public void SwitchLocation(Locations locationTo) { Player player = GetPlayer(); _locations[Location].RemoveChild(player); Location = locationTo; _locations[locationTo].AddEntity(player); EosEvent.RaiseEvent(player, new EventArgs(), EventType.ChangeLocation); }
public LocationNode(Locations wl) : base(wl.ToString(), MemoryType.Location) { RelatedCues = new string[] { string.Format("LOC_{0}", UID) }; }
public List <USStateCaseCountBLDto> GetCountOfUSCasesByState(Metrics metrics, Locations locations, string State, DateTime?Date) { return(Utilities.MapUSStateCasesDADtoToBLDto(covidDataRepository.GetCountOfUSCasesByState(metrics.ToDALMetrics(), locations.ToDALocations(), State, Date))); }
internal static Covid.BLL.Service.Utils.Locations ToBLLocations(this Locations locations) { return(LocationsMap[locations]); }
public void deleteLocation(int locationId) { Locations.Remove((from l in Locations where l.ID == locationId select l).FirstOrDefault()); }
public void addLocation(Location location) { Locations.Add(location); }
private static HtmlBuilder SettingsMenu( this HtmlBuilder hb, Context context, SiteSettings ss, long siteId, bool canManageSite, bool canManageDepts, bool canManageGroups, bool canManageUsers, bool canManageRegistrations, bool canManageTenants, bool canManageTrashBox) { return(hb.Ul( id: "SettingsMenu", css: "menu", action: () => hb .Li( action: () => hb .A( href: Locations.ItemEdit( context: context, id: siteId), action: () => hb .Span(css: "ui-icon ui-icon-gear") .Text(text: SiteSettingsDisplayName( context: context, ss: ss))), _using: canManageSite) .LockTableMenu( context: context, ss: ss, canManageSite: canManageSite) .Li( action: () => hb .A( href: Locations.Edit( context: context, controller: "Tenants"), action: () => hb .Span(css: "ui-icon ui-icon-gear") .Text(text: Displays.TenantAdmin(context: context))), _using: canManageTenants) .Li( action: () => hb .A( href: Locations.Index( context: context, controller: "Depts"), action: () => hb .Span(css: "ui-icon ui-icon-gear") .Text(text: Displays.DeptAdmin(context: context))), _using: canManageDepts) .Li( action: () => hb .A( href: Locations.Index( context: context, controller: "Groups"), action: () => hb .Span(css: "ui-icon ui-icon-gear") .Text(text: Displays.GroupAdmin(context: context))), _using: canManageGroups) .Li( action: () => hb .A( href: Locations.Index( context: context, controller: "Users"), action: () => hb .Span(css: "ui-icon ui-icon-gear") .Text(text: Displays.UserAdmin(context: context))), _using: canManageUsers) .Li( action: () => hb .A( href: Locations.Index( context: context, controller: "Registrations"), action: () => hb .Span(css: "ui-icon ui-icon-gear") .Text(text: Displays.Registrations(context: context))), _using: canManageRegistrations) .Li( action: () => hb .A( href: Locations.ItemTrashBox( context: context, id: siteId), action: () => hb .Span(css: "ui-icon ui-icon-trash") .Text(text: Displays.TrashBox(context: context))), _using: canManageTrashBox))); }
public ActionResult <Locations> CreateLocation([FromBody] Locations entry) { context.Locations.Add(entry); context.SaveChanges(); return(entry); }
public void AddToLocations(Locations locations) { base.AddObject("Locations", locations); }
private Locations Locationid(string ID) { Locations objLocations = new Locations(); if (ID != null) { objLocations.LocationParentId = int.Parse(ID); } else { objLocations.LocationParentId = 0; } return objLocations; }
private static string BackUrl( Context context, long siteId, long parentId, string referenceType, string siteReferenceType) { var referer = HttpUtility.UrlDecode(context.UrlReferrer); switch (context.Controller) { case "admins": return(Locations.Top(context: context)); case "versions": return(referer != null ? referer : Locations.Top(context: context)); case "tenants": return(AdminsOrTop(context: context)); case "depts": case "groups": case "users": switch (context.Action) { case "new": case "edit": return(Strings.CoalesceEmpty( referer?.EndsWith("/new") == false ? referer : null, Locations.Get( context: context, parts: context.Controller))); case "editapi": return(referer != null ? referer : Locations.Top(context: context)); default: return(AdminsOrTop(context: context)); } case "registrations": switch (context.Action) { case "new": case "edit": return(Strings.CoalesceEmpty( referer?.EndsWith("/new") == false ? referer : null, Locations.Get( context: context, parts: context.Controller))); case "editapi": return(referer != null ? referer : Locations.Top(context: context)); default: return(AdminsOrTop(context: context)); } default: switch (referenceType) { case "Sites": switch (context.Action) { case "new": case "trashbox": return(Locations.ItemIndex( context: context, id: siteId)); case "edit": switch (siteReferenceType) { case "Wikis": return(Locations.ItemIndex( context: context, id: parentId)); default: return(Locations.ItemIndex( context: context, id: siteId)); } default: return(Locations.ItemIndex( context: context, id: parentId)); } case "Wikis": return(context.QueryStrings.Int("back") == 1 && !referer.IsNullOrEmpty() ? referer : Locations.ItemIndex( context: context, id: parentId)); default: switch (context.Action) { case "new": case "edit": return(context.QueryStrings.Int("back") == 1 && !referer.IsNullOrEmpty() ? referer : Locations.Get( context: context, parts: new string[] { context.Publish ? "Publishes" : "Items", siteId.ToString(), Requests.ViewModes.GetSessionData( context: context, siteId: siteId) })); case "trashbox": return(Locations.ItemIndex( context: context, id: siteId)); default: return(Locations.ItemIndex( context: context, id: parentId)); } } } }
private static HtmlBuilder AccountMenu(this HtmlBuilder hb, Context context) { return(hb.Ul(id: "AccountMenu", css: "menu", action: () => hb .Li(action: () => hb .A( href: Locations.Logout(context: context), action: () => hb .Span(css: "ui-icon ui-icon-locked") .Text(text: Displays.Logout(context: context)))) .Li( action: () => hb .A( href: Locations.Edit( context: context, controller: "Users", id: context.UserId), action: () => hb .Span(css: "ui-icon ui-icon-wrench") .Text(text: Displays.EditProfile(context: context))), _using: Parameters.Service.ShowProfiles) .Li( action: () => hb .A( href: Locations.Get( context: context, parts: new string[] { "Users", "EditApi" }), action: () => hb .Span(css: "ui-icon ui-icon-link") .Text(text: Displays.ApiSettings(context: context))), _using: context.ContractSettings.Api != false && Parameters.Api.Enabled) .Li(action: () => hb .A( href: Parameters.General.HtmlUsageGuideUrl, target: "_blank", action: () => hb .Span(css: "ui-icon ui-icon-help") .Text(text: Displays.UsageGuide(context: context)))) .Li(action: () => hb .A( href: Parameters.General.HtmlBlogUrl, target: "_blank", action: () => hb .Span(css: "ui-icon ui-icon-info") .Text(text: Displays.Blog(context: context)))) .Li(action: () => hb .A( href: Parameters.General.HtmlSupportUrl, target: "_blank", action: () => hb .Span(css: "ui-icon ui-icon-contact") .Text(text: Displays.Support(context: context)))) .Li(action: () => hb .A( href: Parameters.General.HtmlContactUrl, target: "_blank", action: () => hb .Span(css: "ui-icon ui-icon-contact") .Text(text: Displays.Contact(context: context)))) .Li(action: () => hb .A( href: Parameters.General.HtmlPortalUrl, target: "_blank", action: () => hb .Span(css: "ui-icon ui-icon-cart") .Text(text: Displays.Portal(context: context)))) .Li(action: () => hb .A( href: Locations.Get( context: context, parts: "versions"), action: () => hb .Span(css: "ui-icon ui-icon-info") .Text(text: Displays.Version(context: context)))))); }
void IDisposable.Dispose() { Locations.Dispose(); }
public override int GetHashCode() { return((Locations.SequenceHashCode(), ContentHash, Size).GetHashCode()); }
/// <summary> /// Fixed: /// </summary> private static HtmlBuilder Editor( this HtmlBuilder hb, SiteSettings ss, GroupModel groupModel) { var commentsColumn = ss.GetColumn("Comments"); var commentsColumnPermissionType = commentsColumn.ColumnPermissionType(); var showComments = ss.ShowComments(commentsColumnPermissionType); var tabsCss = showComments ? null : "max"; return(hb.Div(id: "Editor", action: () => hb .Form( attributes: new HtmlAttributes() .Id("GroupForm") .Class("main-form confirm-reload") .Action(groupModel.GroupId != 0 ? Locations.Action("Groups", groupModel.GroupId) : Locations.Action("Groups")), action: () => hb .RecordHeader( ss: ss, baseModel: groupModel, tableName: "Groups") .Div( id: "EditorComments", action: () => hb .Comments( comments: groupModel.Comments, column: commentsColumn, verType: groupModel.VerType, columnPermissionType: commentsColumnPermissionType), _using: showComments) .Div(id: "EditorTabsContainer", css: tabsCss, action: () => hb .EditorTabs(groupModel: groupModel) .FieldSetGeneral( ss: ss, groupModel: groupModel) .FieldSetMembers(groupModel: groupModel) .FieldSet( attributes: new HtmlAttributes() .Id("FieldSetHistories") .DataAction("Histories") .DataMethod("post"), _using: groupModel.MethodType != BaseModel.MethodTypes.New) .MainCommands( ss: ss, siteId: 0, verType: groupModel.VerType, referenceId: groupModel.GroupId, updateButton: true, mailButton: true, deleteButton: true, extensions: () => hb .MainCommandExtensions( groupModel: groupModel, ss: ss))) .Hidden(controlId: "BaseUrl", value: Locations.BaseUrl()) .Hidden( controlId: "MethodType", value: groupModel.MethodType.ToString().ToLower()) .Hidden( controlId: "Groups_Timestamp", css: "always-send", value: groupModel.Timestamp) .Hidden( controlId: "SwitchTargets", css: "always-send", value: groupModel.SwitchTargets?.Join(), _using: !Request.IsAjax())) .OutgoingMailsForm("Groups", groupModel.GroupId, groupModel.Ver) .CopyDialog("Groups", groupModel.GroupId) .OutgoingMailDialog() .EditorExtensions(groupModel: groupModel, ss: ss))); }
public void deleteLocation(Location location) { Locations.Remove(location); }
public override int GetHashCode() { return(Locations != null?Locations.GetHashCode() : 0); }
public bool IsInMetaLocation(string metaLocationName) { return(Locations.ContainsKey(metaLocationName)); }
public GanonsTower(World world, Config config) : base(world, config) { RegionItems = new[] { KeyGT, BigKeyGT, MapGT, CompassGT }; Locations = new List <Location> { new Location(this, 256 + 189, 0x308161, LocationType.Regular, "Ganon's Tower - Bob's Torch", items => items.Boots), new Location(this, 256 + 190, 0x1EAB8, LocationType.Regular, "Ganon's Tower - DMs Room - Top Left", items => items.Hammer && items.Hookshot), new Location(this, 256 + 191, 0x1EABB, LocationType.Regular, "Ganon's Tower - DMs Room - Top Right", items => items.Hammer && items.Hookshot), new Location(this, 256 + 192, 0x1EABE, LocationType.Regular, "Ganon's Tower - DMs Room - Bottom Left", items => items.Hammer && items.Hookshot), new Location(this, 256 + 193, 0x1EAC1, LocationType.Regular, "Ganon's Tower - DMs Room - Bottom Right", items => items.Hammer && items.Hookshot), new Location(this, 256 + 194, 0x1EAD3, LocationType.Regular, "Ganon's Tower - Map Chest", items => items.Hammer && (items.Hookshot || items.Boots) && items.KeyGT >= (new[] { BigKeyGT, KeyGT }.Any(type => Locations.Get("Ganon's Tower - Map Chest").ItemIs(type, World)) ? 3 : 4)) .AlwaysAllow((item, items) => item.Is(KeyGT, World) && items.KeyGT >= 3), new Location(this, 256 + 195, 0x1EAD0, LocationType.Regular, "Ganon's Tower - Firesnake Room", items => items.Hammer && items.Hookshot && items.KeyGT >= (new[] { Locations.Get("Ganon's Tower - Randomizer Room - Top Right"), Locations.Get("Ganon's Tower - Randomizer Room - Top Left"), Locations.Get("Ganon's Tower - Randomizer Room - Bottom Left"), Locations.Get("Ganon's Tower - Randomizer Room - Bottom Right") }.Any(l => l.ItemIs(BigKeyGT, World)) || Locations.Get("Ganon's Tower - Firesnake Room").ItemIs(KeyGT, World) ? 2 : 3)), new Location(this, 256 + 196, 0x1EAC4, LocationType.Regular, "Ganon's Tower - Randomizer Room - Top Left", items => LeftSide(items, new[] { Locations.Get("Ganon's Tower - Randomizer Room - Top Right"), Locations.Get("Ganon's Tower - Randomizer Room - Bottom Left"), Locations.Get("Ganon's Tower - Randomizer Room - Bottom Right") })), new Location(this, 256 + 197, 0x1EAC7, LocationType.Regular, "Ganon's Tower - Randomizer Room - Top Right", items => LeftSide(items, new[] { Locations.Get("Ganon's Tower - Randomizer Room - Top Left"), Locations.Get("Ganon's Tower - Randomizer Room - Bottom Left"), Locations.Get("Ganon's Tower - Randomizer Room - Bottom Right") })), new Location(this, 256 + 198, 0x1EACA, LocationType.Regular, "Ganon's Tower - Randomizer Room - Bottom Left", items => LeftSide(items, new[] { Locations.Get("Ganon's Tower - Randomizer Room - Top Right"), Locations.Get("Ganon's Tower - Randomizer Room - Top Left"), Locations.Get("Ganon's Tower - Randomizer Room - Bottom Right") })), new Location(this, 256 + 199, 0x1EACD, LocationType.Regular, "Ganon's Tower - Randomizer Room - Bottom Right", items => LeftSide(items, new[] { Locations.Get("Ganon's Tower - Randomizer Room - Top Right"), Locations.Get("Ganon's Tower - Randomizer Room - Top Left"), Locations.Get("Ganon's Tower - Randomizer Room - Bottom Left") })), new Location(this, 256 + 200, 0x1EAD9, LocationType.Regular, "Ganon's Tower - Hope Room - Left"), new Location(this, 256 + 201, 0x1EADC, LocationType.Regular, "Ganon's Tower - Hope Room - Right"), new Location(this, 256 + 202, 0x1EAE2, LocationType.Regular, "Ganon's Tower - Tile Room", items => items.Somaria), new Location(this, 256 + 203, 0x1EAE5, LocationType.Regular, "Ganon's Tower - Compass Room - Top Left", items => RightSide(items, new[] { Locations.Get("Ganon's Tower - Compass Room - Top Right"), Locations.Get("Ganon's Tower - Compass Room - Bottom Left"), Locations.Get("Ganon's Tower - Compass Room - Bottom Right") })), new Location(this, 256 + 204, 0x1EAE8, LocationType.Regular, "Ganon's Tower - Compass Room - Top Right", items => RightSide(items, new[] { Locations.Get("Ganon's Tower - Compass Room - Top Left"), Locations.Get("Ganon's Tower - Compass Room - Bottom Left"), Locations.Get("Ganon's Tower - Compass Room - Bottom Right") })), new Location(this, 256 + 205, 0x1EAEB, LocationType.Regular, "Ganon's Tower - Compass Room - Bottom Left", items => RightSide(items, new[] { Locations.Get("Ganon's Tower - Compass Room - Top Right"), Locations.Get("Ganon's Tower - Compass Room - Top Left"), Locations.Get("Ganon's Tower - Compass Room - Bottom Right") })), new Location(this, 256 + 206, 0x1EAEE, LocationType.Regular, "Ganon's Tower - Compass Room - Bottom Right", items => RightSide(items, new[] { Locations.Get("Ganon's Tower - Compass Room - Top Right"), Locations.Get("Ganon's Tower - Compass Room - Top Left"), Locations.Get("Ganon's Tower - Compass Room - Bottom Left") })), new Location(this, 256 + 207, 0x1EADF, LocationType.Regular, "Ganon's Tower - Bob's Chest", items => items.KeyGT >= 3 && ( items.Hammer && items.Hookshot || items.Somaria && items.Firerod)), new Location(this, 256 + 208, 0x1EAD6, LocationType.Regular, "Ganon's Tower - Big Chest", items => items.BigKeyGT && items.KeyGT >= 3 && ( items.Hammer && items.Hookshot || items.Somaria && items.Firerod)) .Allow((item, items) => item.IsNot(BigKeyGT, World)), new Location(this, 256 + 209, 0x1EAF1, LocationType.Regular, "Ganon's Tower - Big Key Chest", BigKeyRoom), new Location(this, 256 + 210, 0x1EAF4, LocationType.Regular, "Ganon's Tower - Big Key Room - Left", BigKeyRoom), new Location(this, 256 + 211, 0x1EAF7, LocationType.Regular, "Ganon's Tower - Big Key Room - Right", BigKeyRoom), new Location(this, 256 + 212, 0x1EAFD, LocationType.Regular, "Ganon's Tower - Mini Helmasaur Room - Left", TowerAscend) .Allow((item, items) => item.IsNot(BigKeyGT, World)), new Location(this, 256 + 213, 0x1EB00, LocationType.Regular, "Ganon's Tower - Mini Helmasaur Room - Right", TowerAscend) .Allow((item, items) => item.IsNot(BigKeyGT, World)), new Location(this, 256 + 214, 0x1EB03, LocationType.Regular, "Ganon's Tower - Pre-Moldorm Chest", TowerAscend) .Allow((item, items) => item.IsNot(BigKeyGT, World)), new Location(this, 256 + 215, 0x1EB06, LocationType.Regular, "Ganon's Tower - Moldorm Chest", items => items.BigKeyGT && items.KeyGT >= 4 && items.Bow && items.CanLightTorches() && CanBeatMoldorm(items) && items.Hookshot) .Allow((item, items) => new[] { KeyGT, BigKeyGT }.All(type => item.IsNot(type, World))), }; }
private static string AdminsOrTop(Context context) { return(Permissions.CanManageTenant(context: context) ? Locations.Admins(context: context) : Locations.Top(context: context)); }
private void booksDeleteButton_Click(object sender, EventArgs e) { if (bookslistBox.SelectedItem == null) { MessageBox.Show("Nobena knjiga ni izbrana."); } else { databaseController dbc = new databaseController(); string selectedBook = bookslistBox.SelectedItem.ToString();//exception needs to be handled selectedBook = selectedBook.Trim(); string[] BookID = selectedBook.Split('|'); int id_b = Convert.ToInt32(BookID[0].Trim()); selectedBook = BookID[1].Trim();//title string author_name = BookID[2].Trim(); string author_surname = BookID[3].Trim(); int lost = Convert.ToInt32(BookID[4].Trim()); string year = BookID[5].Trim(); string location_name = BookID[6].Trim(); string publisher_name = BookID[7].Trim(); string genre_genretype = BookID[8].Trim(); int id_g = 0; Authors aid = new Authors(0, author_name, author_surname); dbc.idAuthors(aid); int author_id = 0; foreach (int k in dbc.idAuthors(aid)) { author_id = k; } Locations lid = new Locations(0, location_name, ""); dbc.idLocations(lid); int location_id = 0; foreach (int k in dbc.idLocations(lid)) { location_id = k; } Publishers pid = new Publishers(0, publisher_name); dbc.idPublishers(pid); int publisher_id = 0; foreach (int k in dbc.idPublishers(pid)) { publisher_id = k; } Genres gid = new Genres(0, genre_genretype); dbc.idGenres(gid); int genre_id = 0; foreach (int k in dbc.idGenres(gid)) { genre_id = k; } Books b = new Books(id_b, selectedBook, "", year, lost, genre_id, publisher_id, location_id); #region author_id Book_Authors id = new Book_Authors(0, id_b); dbc.ReadAuthorsID(id); int id_a = 0; foreach (int k in dbc.ReadAuthorsID(id)) { id_a = k; } /*string selectedAuthor = authorsBooksCombobox.SelectedItem.ToString();//exception needs to be handled * selectedAuthor = selectedAuthor.Trim(); * string[] AuthorID = selectedAuthor.Split('|'); * selectedAuthor = AuthorID[1].Trim(); * string surname = AuthorID[2].Trim(); * int id_a = Convert.ToInt32(AuthorID[0].Trim());*/ #endregion Book_Authors ba = new Book_Authors(author_id, id_b); //MessageBox.Show("author"+Convert.ToString(author_id), "book" + Convert.ToString(id_b)); dbc.DeleteBooksAuthors(ba); dbc.DeleteBooks(b); bookslistBox.Items.Clear(); OutputBooks(); userUnLendedBookslistBox.Items.Clear(); userLendedBookslistBox.Items.Clear(); //OutputBooksOnRents_Lended(); OutputBooksOnRents_UnLended(); } }
/// <summary> /// Label an isolated node with its relationship to the target point. /// </summary> /// <param name="n"></param> /// <param name="targetIndex"></param> private void LabelIsolatedNode(Node n, int targetIndex) { Locations loc = ptLocator.Locate(n.Coordinate, arg[targetIndex].Geometry); n.Label.SetAllLocations(targetIndex, loc); }
private void rentABookButton_Click(object sender, EventArgs e) { if (userShowcomboBox.SelectedItem == null) { MessageBox.Show("Izberite člana."); } else { databaseController dbc = new databaseController(); string selectedUser = userShowcomboBox.SelectedItem.ToString();//exception needs to be handled selectedUser = selectedUser.Trim(); string[] UserID = selectedUser.Split('|'); int id_u = Convert.ToInt32(UserID[0].Trim()); string name = UserID[1].Trim();//title string surname = UserID[2].Trim(); string tel = UserID[3].Trim(); string address = UserID[3].Trim(); string location_name = UserID[3].Trim(); string location_postalcode = UserID[3].Trim(); Locations lid = new Locations(0, location_name, ""); dbc.idLocations(lid); int location_id = 0; foreach (int k in dbc.idLocations(lid)) { location_id = k; } Users uid = new Users(0, name, surname, "", "", "", "", 0); dbc.idUsers(uid); int user_id = 0; foreach (int k in dbc.idUsers(uid)) { user_id = k; } if (userUnLendedBookslistBox.SelectedItem == null) { MessageBox.Show("Izberite knjigo."); } else { string selectedBook = userUnLendedBookslistBox.SelectedItem.ToString();//exception needs to be handled selectedBook = selectedBook.Trim(); string[] BookID = selectedBook.Split('|'); int id_b = Convert.ToInt32(BookID[0].Trim()); selectedBook = BookID[1].Trim();//title string author_name = BookID[2].Trim(); string author_surname = BookID[3].Trim(); int lost = Convert.ToInt32(BookID[4].Trim()); string year = BookID[5].Trim(); string location_name_book = BookID[6].Trim(); string publisher_name = BookID[7].Trim(); string genre_genretype = BookID[8].Trim(); int id_g = 0; Authors aid = new Authors(0, author_name, author_surname); dbc.idAuthors(aid); int author_id = 0; foreach (int k in dbc.idAuthors(aid)) { author_id = k; } Locations lid_book = new Locations(0, location_name, ""); dbc.idLocations(lid); int location_id_book = 0; foreach (int k in dbc.idLocations(lid)) { location_id = k; } Publishers pid = new Publishers(0, publisher_name); dbc.idPublishers(pid); int publisher_id = 0; foreach (int k in dbc.idPublishers(pid)) { publisher_id = k; } Genres gid = new Genres(0, genre_genretype); dbc.idGenres(gid); int genre_id = 0; foreach (int k in dbc.idGenres(gid)) { genre_id = k; } Rents rid = new Rents(0, 0, "", id_b, user_id); dbc.idRents(rid); int rent_id = 0; foreach (int k in dbc.idRents(rid)) { rent_id = k; } string rent_date = Convert.ToString(DateTime.Now); int rent_state = 1; Rents rentss = new Rents(rent_id, rent_state, rent_date, id_b, id_u); dbc.UpdateRentsLend(rentss); userUnLendedBookslistBox.Items.Clear(); OutputBooksOnRents_UnLended(); } } }
public List <CovidGlobalCaseCountDADto> FetchGlobalCasesFromAPI(Metrics metrics, Locations location) { WebRequest request = WebRequest.Create(configuration.GetSection("AppSettings")["covidConfirmedCasesAPI"]); if (metrics == Metrics.DEATHS) { request = WebRequest.Create(configuration.GetSection("AppSettings")["covidDeathsAPI"]); } else if (metrics == Metrics.RECOVERIES) { request = WebRequest.Create(configuration.GetSection("AppSettings")["covidRecoveriesAPI"]); } request.Method = "GET"; WebResponse response = request.GetResponse(); Stream dataStream = response.GetResponseStream(); StreamReader readerStream = new StreamReader(dataStream); Console.WriteLine(((HttpWebResponse)response).StatusDescription); string responseFromServer = readerStream.ReadToEnd(); //Console.WriteLine(responseFromServer); response.Close(); TextReader reader = new StringReader(responseFromServer); CsvReader csvReader = new CsvReader(reader, CultureInfo.InvariantCulture); dynamic records = csvReader.GetRecords <dynamic>(); List <CovidGlobalCaseCountBLDto> bALCaseCountRecords = new List <CovidGlobalCaseCountBLDto>(); Date latestDate = covidDataRepository.GetLastUpdateDate(metrics.ToDALMetrics(), location.ToDALocations()).Date; //IDictionary<string, object> caseCounts = new IDictionary; string csvRecordCompositeKey = ""; int counterKeys = 0; foreach (var rec in records) { counterKeys = 0; csvRecordCompositeKey = ""; foreach (KeyValuePair <string, object> count in rec) { if (count.Key == "Province/State" || count.Key == "Country/Region" || count.Key == "Lat" || count.Key == "Long") { csvRecordCompositeKey += (string)count.Value == "" ? "Null" + "_" : count.Value + "_"; } if (counterKeys > 3) { if (DateTime.Compare(DateTime.ParseExact(count.Key, "M/d/yy", System.Globalization.CultureInfo.InvariantCulture), latestDate) > 0) { CovidGlobalCaseCountBLDto caseRecord = new CovidGlobalCaseCountBLDto(); caseRecord.Date = DateTime.ParseExact(count.Key, "M/d/yy", System.Globalization.CultureInfo.InvariantCulture); caseRecord.Count = Convert.ToInt32(count.Value); caseRecord.dbCompositeKey = csvRecordCompositeKey.Remove(csvRecordCompositeKey.Length - 1); bALCaseCountRecords.Add(caseRecord); } } counterKeys++; } } var dALCaseCountRecords = Utils.Utilities.MapCaseCountsBLDTOtoDADTO(bALCaseCountRecords); return(dALCaseCountRecords); }
protected void Page_Load(object sender, EventArgs e) { intProfile = Int32.Parse(Request.Cookies["profileid"].Value); oForecast = new Forecast(intProfile, dsn); oServerName = new ServerName(intProfile, dsn); oServer = new Servers(intProfile, dsn); oPage = new Pages(intProfile, dsn); oOperatingSystem = new OperatingSystems(intProfile, dsn); if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "") { intPage = Int32.Parse(Request.QueryString["pageid"]); } if (Request.QueryString["action"] != null && Request.QueryString["action"] != "") { panFinish.Visible = true; } else { if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "") { intApplication = Int32.Parse(Request.QueryString["applicationid"]); } if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "") { intApplication = Int32.Parse(Request.Cookies["application"].Value); } if (Request.QueryString["id"] != null && Request.QueryString["id"] != "") { intAnswer = Int32.Parse(Request.QueryString["id"]); } if (!IsPostBack) { if (intAnswer > 0) { DataSet ds = oForecast.GetAnswer(intAnswer); if (ds.Tables[0].Rows.Count > 0) { Projects oProject = new Projects(intProfile, dsn); Requests oRequest = new Requests(intProfile, dsn); Organizations oOrganization = new Organizations(intProfile, dsn); Segment oSegment = new Segment(intProfile, dsn); Platforms oPlatform = new Platforms(intProfile, dsn); ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn); Confidence oConfidence = new Confidence(intProfile, dsn); Classes oClass = new Classes(intProfile, dsn); Environments oEnvironment = new Environments(intProfile, dsn); Locations oLocation = new Locations(intProfile, dsn); Users oUser = new Users(intProfile, dsn); lblID.Text = intAnswer.ToString(); int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["forecastid"].ToString()); int intRequest = Int32.Parse(oForecast.Get(intForecast, "requestid")); int intProject = oRequest.GetProjectNumber(intRequest); lblName.Text = oProject.Get(intProject, "name"); lblNumber.Text = oProject.Get(intProject, "number"); lblPortfolio.Text = oOrganization.GetName(Int32.Parse(oProject.Get(intProject, "organization"))); lblSegment.Text = oSegment.GetName(Int32.Parse(oProject.Get(intProject, "segmentid"))); lblPlatform.Text = oPlatform.GetName(Int32.Parse(ds.Tables[0].Rows[0]["platformid"].ToString())); lblNickname.Text = ds.Tables[0].Rows[0]["name"].ToString(); int intModel = Int32.Parse(ds.Tables[0].Rows[0]["modelid"].ToString()); if (intModel == 0) { intModel = oForecast.GetModelAsset(intAnswer); } if (intModel == 0) { intModel = oForecast.GetModel(intAnswer); } lblModel.Text = oModelsProperties.Get(intModel, "name"); lblCommitment.Text = DateTime.Parse(ds.Tables[0].Rows[0]["implementation"].ToString()).ToLongDateString(); lblQuantity.Text = ds.Tables[0].Rows[0]["quantity"].ToString(); lblConfidence.Text = oConfidence.Get(Int32.Parse(ds.Tables[0].Rows[0]["confidenceid"].ToString()), "name"); int intClass = Int32.Parse(ds.Tables[0].Rows[0]["classid"].ToString()); lblClass.Text = oClass.Get(intClass, "name"); if (oClass.IsProd(intClass)) { panTest.Visible = true; lblTest.Text = (ds.Tables[0].Rows[0]["test"].ToString() == "1" ? "Yes" : "No"); } lblEnvironment.Text = oEnvironment.Get(Int32.Parse(ds.Tables[0].Rows[0]["environmentid"].ToString()), "name"); lblLocation.Text = oLocation.GetFull(Int32.Parse(ds.Tables[0].Rows[0]["addressid"].ToString())); lblIP.Text = ds.Tables[0].Rows[0]["workstation"].ToString(); lblDesignedBy.Text = oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())); lblRequestor.Text = ds.Tables[0].Rows[0]["userid"].ToString(); lblDesignedOn.Text = DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToString(); lblUpdated.Text = DateTime.Parse(ds.Tables[0].Rows[0]["modified"].ToString()).ToString(); panShow.Visible = true; btnSave.Enabled = true; // Load Components rptApproval.DataSource = oServerName.GetComponentDetailUserApprovalsByUser(intProfile, intAnswer, 0); rptApproval.DataBind(); foreach (RepeaterItem ri in rptApproval.Items) { int intServer = Int32.Parse(((Label)ri.FindControl("lblServer")).Text); int intDetail = Int32.Parse(((Label)ri.FindControl("lblDetail")).Text); RadioButton radApprove = (RadioButton)ri.FindControl("radApprove"); RadioButton radDeny = (RadioButton)ri.FindControl("radDeny"); HtmlTableRow trLicense = (HtmlTableRow)ri.FindControl("trLicense"); HtmlTableRow trComments = (HtmlTableRow)ri.FindControl("trComments"); TextBox txtLicense = (TextBox)ri.FindControl("txtLicense"); TextBox txtComments = (TextBox)ri.FindControl("txtComments"); Label lblOS = (Label)ri.FindControl("lblOS"); int intOS = 0; Int32.TryParse(oServer.Get(intServer, "osid"), out intOS); lblOS.Text = oOperatingSystem.Get(intOS, "name"); radApprove.Attributes.Add("onclick", "ShowHideDiv('" + trLicense.ClientID + "','inline');ShowHideDiv('" + trComments.ClientID + "','inline');"); radDeny.Attributes.Add("onclick", "ShowHideDiv('" + trLicense.ClientID + "','none');ShowHideDiv('" + trComments.ClientID + "','inline');"); DataSet dsResult = oServerName.GetComponentDetailUserApprovals(intServer, intDetail); if (dsResult.Tables[0].Rows.Count > 0) { // Load previous information DataRow drResult = dsResult.Tables[0].Rows[0]; if (drResult["approved"].ToString() == "1") { radApprove.Checked = true; txtLicense.Text = drResult["license"].ToString(); trLicense.Style["display"] = "inline"; txtComments.Text = drResult["comments"].ToString(); trComments.Style["display"] = "inline"; } if (drResult["approved"].ToString() == "0") { radDeny.Checked = true; txtComments.Text = drResult["comments"].ToString(); trComments.Style["display"] = "inline"; } } } } } } } }
/// <summary> /// /// </summary> /// <param name="location"></param> public TopologyLocation(Locations[] location) { Init(location.Length); }
private IDsObjectPicker Initialize() { DSObjectPicker picker = new DSObjectPicker(); IDsObjectPicker ipicker = (IDsObjectPicker)picker; List <DSOP_SCOPE_INIT_INFO> scopeInitInfoList = new List <DSOP_SCOPE_INIT_INFO>(); // Note the same default and filters are used by all scopes uint defaultFilter = GetDefaultFilter(); uint upLevelFilter = GetUpLevelFilter(); uint downLevelFilter = GetDownLevelFilter(); uint providerFlags = GetProviderFlags(); // Internall, use one scope for the default (starting) locations. uint startingScope = GetScope(DefaultLocations); if (startingScope > 0) { DSOP_SCOPE_INIT_INFO startingScopeInfo = new DSOP_SCOPE_INIT_INFO(); startingScopeInfo.cbSize = (uint)Marshal.SizeOf(typeof(DSOP_SCOPE_INIT_INFO)); startingScopeInfo.flType = startingScope; startingScopeInfo.flScope = DSOP_SCOPE_INIT_INFO_FLAGS.DSOP_SCOPE_FLAG_STARTING_SCOPE | defaultFilter | providerFlags; startingScopeInfo.FilterFlags.Uplevel.flBothModes = upLevelFilter; startingScopeInfo.FilterFlags.flDownlevel = downLevelFilter; startingScopeInfo.pwzADsPath = null; startingScopeInfo.pwzDcName = null; startingScopeInfo.hr = 0; scopeInitInfoList.Add(startingScopeInfo); } // And another scope for all other locations (AllowedLocation values not in DefaultLocation) Locations otherLocations = AllowedLocations & (~DefaultLocations); uint otherScope = GetScope(otherLocations); if (otherScope > 0) { DSOP_SCOPE_INIT_INFO otherScopeInfo = new DSOP_SCOPE_INIT_INFO(); otherScopeInfo.cbSize = (uint)Marshal.SizeOf(typeof(DSOP_SCOPE_INIT_INFO)); otherScopeInfo.flType = otherScope; otherScopeInfo.flScope = defaultFilter | providerFlags; otherScopeInfo.FilterFlags.Uplevel.flBothModes = upLevelFilter; otherScopeInfo.FilterFlags.flDownlevel = downLevelFilter; otherScopeInfo.pwzADsPath = null; otherScopeInfo.pwzDcName = null; otherScopeInfo.hr = 0; scopeInitInfoList.Add(otherScopeInfo); } DSOP_SCOPE_INIT_INFO[] scopeInitInfo = scopeInitInfoList.ToArray(); // TODO: Scopes for alternate ADs, alternate domains, alternate computers, etc // Allocate memory from the unmananged mem of the process, this should be freed later!?? IntPtr refScopeInitInfo = Marshal.AllocHGlobal (Marshal.SizeOf(typeof(DSOP_SCOPE_INIT_INFO)) * scopeInitInfo.Length); // Marshal structs to pointers for (int index = 0; index < scopeInitInfo.Length; index++) { Marshal.StructureToPtr(scopeInitInfo[index], refScopeInitInfo.OffsetWith(index * Marshal.SizeOf(typeof(DSOP_SCOPE_INIT_INFO))), false); } // Initialize structure with data to initialize an object picker dialog box. DSOP_INIT_INFO initInfo = new DSOP_INIT_INFO(); initInfo.cbSize = (uint)Marshal.SizeOf(initInfo); initInfo.pwzTargetComputer = TargetComputer; initInfo.cDsScopeInfos = (uint)scopeInitInfo.Length; initInfo.aDsScopeInfos = refScopeInitInfo; // Flags that determine the object picker options. uint flOptions = 0; if (MultiSelect) { flOptions |= DSOP_INIT_INFO_FLAGS.DSOP_FLAG_MULTISELECT; } // Only set DSOP_INIT_INFO_FLAGS.DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK // if we know target is not a DC (which then saves initialization time). if (SkipDomainControllerCheck) { flOptions |= DSOP_INIT_INFO_FLAGS.DSOP_FLAG_SKIP_TARGET_COMPUTER_DC_CHECK; } initInfo.flOptions = flOptions; // there's a (seeming?) bug on my Windows XP when fetching the objectClass attribute - the pwzClass field is corrupted... // plus, it returns a multivalued array for this attribute. In Windows 2008 R2, however, only last value is returned, // just as in pwzClass. So won't actually be retrieving __objectClass__ - will give pwzClass instead List <string> goingToFetch = new List <string>(AttributesToFetch); for (int i = 0; i < goingToFetch.Count; i++) { if (goingToFetch[i].Equals("objectClass", StringComparison.OrdinalIgnoreCase)) { goingToFetch[i] = "__objectClass__"; } } initInfo.cAttributesToFetch = (uint)goingToFetch.Count; UnmanagedArrayOfStrings unmanagedAttributesToFetch = new UnmanagedArrayOfStrings(goingToFetch); initInfo.apwzAttributeNames = unmanagedAttributesToFetch.ArrayPtr; // If the user has defined new credentials, set them now if (!string.IsNullOrEmpty(userName)) { var cred = (IDsObjectPickerCredentials)ipicker; cred.SetCredentials(userName, password); } try { // Initialize the Object Picker Dialog Box with our options int hresult = ipicker.Initialize(ref initInfo); if (hresult != HRESULT.S_OK) { Marshal.ReleaseComObject(ipicker); throw new COMException("IDsObjectPicker.Initialize failed", hresult); } return(ipicker); } finally { /* * from MSDN (http://msdn.microsoft.com/en-us/library/ms675899(VS.85).aspx): * * Initialize can be called multiple times, but only the last call has effect. * Be aware that object picker makes its own copy of InitInfo. */ Marshal.FreeHGlobal(refScopeInitInfo); unmanagedAttributesToFetch.Dispose(); } }
/// <summary> /// /// </summary> /// <param name="on"></param> public TopologyLocation(Locations on) { Init(1); location[(int)Positions.On] = on; }
private void setDesktopDir(string desktopDir) { SystemDirectory desktop = new SystemDirectory(desktopDir, Dispatcher.CurrentDispatcher); Locations.Add(desktop); }
public Location( byte b ) { location = (Locations)b; }
public async void SetHistoryChart() { var historyItemPrices = await ApiController.GetHistoryItemPricesFromJsonAsync(Item.UniqueName, Locations.GetLocationsListByArea(new IsLocationAreaActive(ShowBlackZoneOutpostsChecked, ShowVillagesChecked, true)), DateTime.Now.AddDays(-30), GetQualities()).ConfigureAwait(true); var date = new List <string>(); var seriesCollectionHistory = new SeriesCollection(); foreach (var marketHistory in historyItemPrices) { var amount = new ChartValues <int>(); foreach (var data in marketHistory?.Data?.OrderBy(x => x.Timestamp).ToList() ?? new List <MarketHistoryResponse>()) { if (!date.Exists(x => x.Contains(data.Timestamp.ToString("g", CultureInfo.CurrentCulture)))) { date.Add(data.Timestamp.ToString("g", CultureInfo.CurrentCulture)); } amount.Add(data.AveragePrice); } seriesCollectionHistory.Add(new LineSeries { Title = Locations.GetName(Locations.GetName(marketHistory?.Location)), Values = amount, Fill = Locations.GetLocationBrush(Locations.GetName(marketHistory?.Location), true), Stroke = Locations.GetLocationBrush(Locations.GetName(marketHistory?.Location), false) }); } LabelsHistory = date.ToArray(); SeriesCollectionHistory = seriesCollectionHistory; }
public ShardLocations() { Receive<GetLocations>(_ => Sender.Tell(_locations)); Receive<Locations>(l => _locations = l); }
public List <DayEntry> GetAllAveragessForLocation(Locations location, SortColumns sortBy = SortColumns.Date, SortDirection sortDir = SortDirection.Ascending) { List <DayEntry> result = new(); var groupedByDate = _ctx.Measurements.Where(l => l.Location == location) .GroupBy(g => g.Time.Date, (key, g) => new DayEntry { Date = key, AverageTemperature = g.Average(a => a.Degrees), AverageHumidity = g.Average(a => a.Humidity) }); switch (sortBy) { case SortColumns.Date: if (sortDir == SortDirection.Ascending) { result = groupedByDate.OrderBy(o => o.Date).ToList(); } else { result = groupedByDate.OrderByDescending(o => o.Date).ToList(); } GetMoldPercentage(result); break; case SortColumns.Temperature: if (sortDir == SortDirection.Ascending) { result = groupedByDate.OrderBy(o => o.AverageTemperature).ToList(); } else { result = groupedByDate.OrderByDescending(o => o.AverageTemperature).ToList(); } GetMoldPercentage(result); break; case SortColumns.Humidity: if (sortDir == SortDirection.Ascending) { result = groupedByDate.OrderBy(o => o.AverageHumidity).ToList(); } else { result = groupedByDate.OrderByDescending(o => o.AverageHumidity).ToList(); } GetMoldPercentage(result); break; case SortColumns.MoldRisk: // We need to get this from database first, so we have to sort by something else first and then sort when moldrisk is calculated result = groupedByDate.OrderBy(o => o.Date).ToList(); GetMoldPercentage(result); if (sortDir == SortDirection.Ascending) { result = result.OrderBy(o => o.AverageMoldPercentage).ToList(); } else { result = result.OrderByDescending(o => o.AverageMoldPercentage).ToList(); } break; default: break; } return(result); }
public static Locations CreateLocations(global::System.Guid locationId, string businessName, string country, string externalUser) { Locations locations = new Locations(); locations.LocationId = locationId; locations.BusinessName = businessName; locations.Country = country; locations.ExternalUser = externalUser; return locations; }
public Location Location(string name) { return(Locations.FirstOrDefault(x => x.Name == name)); }
public LocationsBox (Locations locations, UIManager uiManager) : this(new Builder("locations_box.ui")) { Locations = locations; // create the actions Gtk.Action create = new Gtk.Action("createLocation","Create Location","",Stock.Add); create.Activated += OnCreateLocation; Gtk.Action delete = new Gtk.Action("deleteLocation","Delete Location","",Stock.Remove); delete.Activated += OnDeleteLocation; Gtk.Action gotoItem = new Gtk.Action("gotoLocationItem","Goto Item","",Stock.GoForward); gotoItem.Activated += OnGotoLocationItem; Gtk.Action action = new Gtk.Action("location","Location"); ActionGroup group = new ActionGroup("location"); group.Add(create); group.Add(delete); group.Add(gotoItem); group.Add(action); uiManager.InsertActionGroup(group,0); // create item column with id TreeViewColumn col = new TreeViewColumn (); locationsItemColumn = col; col.Title = "Item"; col.Expand = true; CellRenderer render; render = new CellRendererPixbuf (); col.PackStart (render, false); col.AddAttribute (render, "pixbuf", 1); render = new CellRendererText (); (render as CellRendererText).Editable = true; render.EditingStarted += OnStartLocationItemEdit; col.PackStart (render, true); col.AddAttribute (render, "text", 2); locationsView.AppendColumn(col); locationsView.AppendColumn ("ID", new Gtk.CellRendererText (), "text", 3); // create the labeled column col = new TreeViewColumn (); col.Title = "Labeled"; render = new CellRendererToggle (); (render as CellRendererToggle).Toggled += OnLabeledToggle; col.PackStart (render, false); col.AddAttribute (render, "active", 4); col.AddAttribute (render, "activatable", 5); locationsView.AppendColumn(col); // create the amount column col = new TreeViewColumn (); col.Title = "Amount"; render = new CellRendererSpin (); (render as CellRendererText).Editable = true; (render as CellRendererText).Edited += OnAmountEdited; Adjustment adj = new Adjustment(0, 0, 0, 0, 0, 0); //set all limits etc to 0 adj.Upper = 1000000000; // assign some special values, that aren't 0 adj.PageIncrement = 10; adj.StepIncrement = 1; (render as CellRendererSpin).Adjustment = adj; col.PackStart (render, false); col.AddAttribute (render, "text", 6); locationsView.AppendColumn (col); //set model etc locations.CollectionChanged += OnLocationCreation; TreeModelFilter filter = new LocationsFilter ( new LocationsModel( locations )); filter.Model.RowInserted += OnRowInserted; filter.VisibleFunc = new TreeModelFilterVisibleFunc (FilterLocations); locationsView.Model = filter; locationsView.Reorderable = true; // create the items chooser completion locationCompletion = new LocationItemChooser(); TreeModel compModel = new TreeModelAdapter( new ItemsModel(locations.Inventory.Items)); locationCompletion.Model = compModel; locationCompletion.MatchFunc = LocationItemCompletionMatch; locationCompletion.MinimumKeyLength = 0; // add the item info cell renderer to the completion render = new CellRendererText (); locationCompletion.PackStart (render, true); locationCompletion.AddAttribute (render, "text", 2); // create the popups uiManager.AddUiFromResource("locations_box_menues.xml"); locationPopup = (Menu) uiManager.GetWidget("/locationPopup"); }
/// <summary> /// /// </summary> /// <param name="locIndex"></param> /// <param name="locValue"></param> public void SetLocation(Positions locIndex, Locations locValue) { location[(int)locIndex] = locValue; }
/// <summary> /// Add an offset curve for a ring. /// The side and left and right topological location arguments /// assume that the ring is oriented CW. /// If the ring is in the opposite orientation, /// the left and right locations must be interchanged and the side flipped. /// </summary> /// <param name="coord">The coordinates of the ring (must not contain repeated points).</param> /// <param name="offsetDistance">The distance at which to create the buffer.</param> /// <param name="side">The side of the ring on which to construct the buffer line.</param> /// <param name="cwLeftLoc">The location on the L side of the ring (if it is CW).</param> /// <param name="cwRightLoc">The location on the R side of the ring (if it is CW).</param> private void AddPolygonRing(IList<Coordinate> coord, double offsetDistance, Positions side, Locations cwLeftLoc, Locations cwRightLoc) { Locations leftLoc = cwLeftLoc; Locations rightLoc = cwRightLoc; if (CGAlgorithms.IsCounterClockwise(coord)) { leftLoc = cwRightLoc; rightLoc = cwLeftLoc; side = Position.Opposite(side); } IList lineList = _curveBuilder.GetRingCurve(coord, side, offsetDistance); AddCurves(lineList, leftLoc, rightLoc); }
/// <summary> /// /// </summary> /// <param name="locValue"></param> public void SetLocation(Locations locValue) { SetLocation(Positions.On, locValue); }
/// <summary> /// /// </summary> /// <param name="geomIndex"></param> /// <param name="posIndex"></param> /// <param name="location"></param> public void Add(int geomIndex, Positions posIndex, Locations location) { if (location == Locations.Interior) depth[geomIndex, (int)posIndex]++; }
/// <summary> /// /// </summary> /// <param name="on"></param> /// <param name="left"></param> /// <param name="right"></param> public void SetLocations(Locations on, Locations left, Locations right) { location[(int)Positions.On] = on; location[(int)Positions.Left] = left; location[(int)Positions.Right] = right; }
static void ApplicationService(string Name) { try { TrimClient trimClient = new TrimClient(serviceapi); trimClient.Credentials = System.Net.CredentialCache.DefaultCredentials; // Locations request = new Locations(); request.q = "me"; request.Properties = new List<string>() { "SortName" }; var Loc = trimClient.Get<LocationsResponse>(request); Console.WriteLine("Logged onto Eddie as " + Loc.Results[0].SortName); JsonSerializer s = new JsonSerializer(); T1Application t1 = null; using (StreamReader sr = new StreamReader(Name)) { using (JsonTextReader reader = new JsonTextReader(sr)) { //T1Integration t1 = new T1Integration(); t1 = (T1Application)s.Deserialize(reader, typeof(T1Application)); } } if (t1 != null) { Console.WriteLine("T1 export file processed."); if (t1.EddieUri == 0) { Record record = new Record(); record.RecordType = new RecordTypeRef() { Uri = 1 }; record.Title = t1.PropertyTitle + " - " + DateTime.Now.ToString(); record.Classification = new ClassificationRef() { Uri=2598 }; record.SetCustomField("PropertyNumber", t1.PropertyNumber); record.SetCustomField("ApplicationNumber", t1.ApplicationNumber); record.SetCustomField("PropertyAddress", t1.PropertyAddress); RecordsResponse response = trimClient.Post<RecordsResponse>(record); if(response.Results.Count==1) { Console.WriteLine("New property container created in Eddie - RM Uri: " + response.Results.First().Uri.ToString()); } // FileInfo f = new FileInfo(t1.documentLoc); if (f.Exists) { Record doc = new Record(); doc.Properties = new List<string>() { "Number" , "Url"}; doc.RecordType = new RecordTypeRef() { Uri = 2 }; doc.Container = new RecordRef() { Uri = response.Results.First().Uri }; doc.Title= t1.ApplicationTitle + " - " + DateTime.Now.ToString(); doc.SetCustomField("PropertyNumber", t1.PropertyNumber); doc.SetCustomField("ApplicationNumber", t1.ApplicationNumber); RecordsResponse response11= trimClient.PostFileWithRequest<RecordsResponse>(f, doc); if(response11.Results.Count==1) { Record rr = response11.Results.First(); Console.WriteLine("New application document created in Eddie - RM Uri: " + rr.Uri.ToString()); t1.EddieUri = rr.Uri; t1.EddieRecordNumber = rr.Number; t1.EddieRecordUrl = rr.Url; } } } else { //Add amend function } using (StreamWriter sw = new StreamWriter(pathout + "T1 Application - " + t1.PropertyNumber.ToString() + ".txt")) { using (JsonWriter writer = new JsonTextWriter(sw)) { s.Serialize(writer, t1); Console.WriteLine("Application file returned"); } }; FileInfo f2 = new FileInfo(Name); if (f2.Exists) f2.Delete(); } } //catch (ServiceStack.ServiceClient.Web.WebServiceException ex) //{ // Console.WriteLine("Service stack error: "+ex.ErrorMessage); //} catch (Exception exp) { Console.WriteLine("General error: " + exp.Message.ToString()); throw; } }