protected override void Execute(CodeActivityContext context) { var projectID = ProjectID.Get(context); var modelID = ModelID.Get(context); var locationID = LocationID.Get(context); var bearerToken = BearerToken.Get(context); var content = Content.Get(context); var jsonData = String.Format("{ \"payload\": { \"textSnippet\": { \"content\": \"{0}\", \"mime_type\": \"text/plain\" } } }", content); var jsonDataBytes = Encoding.ASCII.GetBytes(jsonData); request = HttpWebRequest.CreateHttp(String.Format("https://automl.googleapis.com/v1/projects/{0}/locations/{1}/models/{2}:predict", projectID, locationID, modelID)); request.Method = "POST"; request.ContentType = "application/json"; request.Headers.Add(HttpRequestHeader.Authorization, $"Bearer {bearerToken}"); using (var req_stream = request.GetRequestStream()) { req_stream.Write(jsonDataBytes, 0, jsonDataBytes.Length); req_stream.Close(); } var response = request.GetResponse(); }
private void btnOK_Click(object sender, EventArgs e) { if (this.CompanyID.GetCheckedValues().Length == 0) { Mess.Info("Please select at least one company!"); CompanyID.ShowPopup(); return; } if (this.LocationID.GetCheckedValues().Length == 0) { Mess.Info("Please select at least one location!"); LocationID.ShowPopup(); return; } if (DateFrom.EditValue == null || DateFrom.DateTime == DateTime.MinValue) { Mess.Info("Please select a Period From!"); DateFrom.ShowPopup(); return; } if (DateTo.EditValue == null || DateTo.DateTime == DateTime.MinValue) { Mess.Info("Please select a Period To!"); DateTo.ShowPopup(); return; } this.DialogResult = System.Windows.Forms.DialogResult.Yes; this.Close(); }
public Settings() { DataPath = Util.ResolveUserDocumentsPath("Rylogic", "EDTradeAdvisor", "Data"); JournalFilesDir = Util.ResolveUserProfilePath("Saved Games", "Frontier Developments", "Elite Dangerous"); CmdrName = string.Empty; EDSMApiKey = string.Empty; DataAge = TimeSpan.FromHours(1); RouteCount = 10; OriginHistory = new LocationID[0]; Origin = default(LocationID); Destination = default(LocationID); UseCurrentLocation = false; AnyDestination = true; MaxTradeRouteDistance = null; CargoCapacity = 4; AvailableCredits = 1000; MaxJumpRange = 8; MaxStationDistance = null; RequiredPadSize = ELandingPadSize.Small; IgnorePlanetBases = false; IgnorePermitSystems = false; UpdateMarketDataFromJournal = true; ReadCargoCapacityFromLoadout = true; ReadMaxJumpRangeFromLoadout = true; AutoSaveOnChanges = true; }
private void Location_Load(object sender, EventArgs e) { resetText(); LocationID.Focus(); dataGridView1.DataSource = vt.getList(); dataGridView1.AutoResizeColumns(); }
private string CreateGetFlagString(LocationID locationID) { string flagString = string.Empty; if (locationToItemMap.TryGetValue(locationID, out ItemID newItemID)) { ItemInfo newItemInfo = ItemDB.GetItemInfo(newItemID); if (newItemInfo.boxName.Equals("Crystal S")) { flagString = "\n[@take,Crystal S,02item,1]"; } L2FlagBoxEnd[] getFLags = CreateGetFlags(newItemID, newItemInfo); if (getFLags != null) { for (int i = 0; i < getFLags.Length; i++) { L2FlagBoxEnd flag = getFLags[i]; if (flag.calcu == CALCU.ADD) { flagString += string.Format("\n[@setf,{0},{1},+,{2}]", flag.seet_no1, flag.flag_no1, flag.data); } else if (flag.calcu == CALCU.EQR) { flagString += string.Format("\n[@setf,{0},{1},=,{2}]", flag.seet_no1, flag.flag_no1, flag.data); } } } } return(flagString); }
private string ChangeTalkFlagCheck(LocationID locationID, string original) { int id; if (locationToItemMap.TryGetValue((int)locationID, out id)) { ItemID newItemID = (ItemID)id; ItemInfo newItemInfo = ItemFlags.GetItemInfo(newItemID); ItemData newItemData = GetNewItemData(newItemInfo); int flagValue = 0; if (newItemID == ItemID.ChainWhip || newItemID == ItemID.SilverShield || newItemID == ItemID.MobileSuperx3P) { flagValue = 1; } else if (newItemID == ItemID.FlailWhip || newItemID == ItemID.AngelShield) { flagValue = 2; } return(String.Format(original, (int)newItemData.getItemName(), flagValue)); } return(original); }
public EmployeeViewModel(object param) { var employeeClicked = param as Employee; if (employeeClicked != null) { EmployeeId = employeeClicked.EmployeeId; FirstName = employeeClicked.FirstName; LastName = employeeClicked.LastName; LocationID = employeeClicked.LocationID; LocationName = employeeClicked.LocationName; ImageURL = employeeClicked.ImageURL; Title = employeeClicked.Title; FullName = employeeClicked.FullName; Dictionary <string, string> myDict = new Dictionary <string, string> { { "EmployeeId", EmployeeId.ToString() }, { "FirstName", FirstName }, { "LastName", LastName }, { "LocationID", LocationID.ToString() } }; _logger.LoggEvent("Load EmployeeViewModel", myDict); } TapCommand = new Command(OnTapped); }
private void InitalizeComponent() { download.Items.Clear(); download.Items.AddRange(new string[] { "Mbps", "Kbps" }); download.SelectedIndex = 0; upload.Items.Clear(); upload.Items.AddRange(new string[] { "Mbps", "Kbps" }); upload.SelectedIndex = 0; code.Text = ""; cost.Text = ""; LocationID.Items.Clear(); DataTable dtm = new DataTable(); dtm = DB.SelectArrayDataTable("SELECT LocationID,LocationName FROM IT..Technical_MasterLocation", new object[] { }); DataRow drm = dtm.Rows[0]; LocationID.DataSource = dtm; LocationID.DataTextField = "LocationName"; LocationID.DataValueField = "LocationID"; LocationID.DataBind(); }
public Location(LocationID id, string name, string description, bool isSafeZone = false, bool isStore = false) { ID = id; Name = name; Description = description; IsSafeZone = isSafeZone; IsStore = isStore; }
public override int GetHashCode() { int hashPrevious = PreviousID == 0 ? 0 : PreviousID.GetHashCode(); int hashID = LocationID == 0 ? 0 : LocationID.GetHashCode(); int hashTitle = LocationTitle == null ? 0 : LocationTitle.GetHashCode(); return(hashPrevious ^ hashID ^ hashTitle); }
protected void btnClear_Click(object sender, EventArgs e) { CategoryId.ClearSelection(); AgeGroupId.ClearSelection(); BranchId.ClearSelection(); LocationID.ClearSelection(); odsBadges.DataBind(); rptr.DataBind(); }
private string CreateSetItemString(LocationID locationID) { if (locationToItemMap.TryGetValue(locationID, out ItemID newItemID)) { ItemInfo newItemInfo = ItemDB.GetItemInfo(newItemID); return(string.Format("[@sitm,{0},{1},{2},{3}]", newItemInfo.shopType, newItemInfo.shopName, newItemInfo.shopPrice, newItemInfo.shopAmount)); } return(string.Empty); }
public Location(LocationID id, string name, string desc, Item itemRequiredToEnter = null, Quest questAvailableHere = null, Monster monsterLivingHere = null) { this.ID = id; this.Name = name; this.Description = desc; this.ItemRequiredToEnter = itemRequiredToEnter; this.QuestAvailableHere = questAvailableHere; this.MonsterLivingHere = monsterLivingHere; }
private string ChangeTalkStringAndFlagCheck(LocationID locationID, string original) { int id; if (locationToItemMap.TryGetValue((int)locationID, out id)) { ItemID newItemID = (ItemID)id; ItemInfo newItemInfo = ItemFlags.GetItemInfo(newItemID); ItemData newItemData = GetNewItemData(newItemInfo); int flagValue = 0; if (newItemID == ItemID.ChainWhip || newItemID == ItemID.SilverShield || newItemID == ItemID.MobileSuperx3P) { flagValue = 1; } else if (newItemID == ItemID.FlailWhip || newItemID == ItemID.AngelShield) { flagValue = 2; } //TODO:put this is into a method to remove redundancy string takeString; if (newItemInfo.boxName.Equals("Crystal S") || newItemInfo.boxName.Equals("Sacred Orb") || newItemInfo.boxName.Equals("MSX3p")) { takeString = String.Format("[@take,{0},02item,1]\n", newItemInfo.boxName); } else { takeString = String.Format("[@take,{0},02item,1]\n", newItemInfo.shopName); } //if the item has more than just its set flags add the flags to the mojiscript string L2FlagBoxEnd[] getFLags = ItemFlags.GetItemGetFlags(newItemID); if (getFLags != null) { for (int i = 0; i < getFLags.Length; i++) { L2FlagBoxEnd flag = getFLags[i]; if (flag.calcu == CALCU.ADD) { takeString += String.Format("[@setf,{0},{1},+,{2}]\n", flag.seet_no1, flag.flag_no1, flag.data); } else if (flag.calcu == CALCU.EQR) { takeString += String.Format("[@setf,{0},{1},=,{2}]\n", flag.seet_no1, flag.flag_no1, flag.data); } } } return(String.Format(original, (int)newItemData.getItemName(), flagValue, takeString)); } return(original); }
private bool IsLocationCursed(LocationID locationID) { foreach (LocationID cursedID in cursedChests) { if (locationID == cursedID) { return(true); } } return(false); }
public Location(JsonLocation jsonLocation) { Name = jsonLocation.Name; LocationType = jsonLocation.LocationType; IsGuardianChest = jsonLocation.IsGuardianChest; logicString = jsonLocation.Logic; hardLogicString = jsonLocation.HardLogic; Item = jsonLocation.Item; Enum.TryParse(Name.RemoveWhitespace(), out LocationID temp); Id = temp; }
/// <summary> /// Constructor /// </summary> /// <param name="location"> /// The location parent class. /// </param> /// <param name="map"> /// The map identity on which the location is represented. /// </param> /// <param name="x"> /// The X coordinate of the map location. /// </param> /// <param name="y"> /// The Y coordinate of the map location. /// </param> /// <param name="requirement"> /// The mode requirement for displaying this map location. /// </param> public MapLocation( LocationID locationID, MapID map, double x, double y, IRequirement requirement = null) { _locationID = locationID; Map = map; X = x; Y = y; Requirement = requirement ?? RequirementDictionary.Instance[RequirementType.NoRequirement]; LocationDictionary.Instance.LocationCreated += OnLocationCreated; }
public Dungeon(LocationID id, string name, string description, int dimensionX, int dimensionY, int floors, int BattleSpace) : base(id, name, description) { DimensionX = dimensionX; DimensionY = dimensionY; Floors = floors; Exits[Direction.North] = 1; Exits[Direction.South] = 1; Exits[Direction.West] = 1; Exits[Direction.East] = 1; }
/// <summary> /// Constructor /// </summary> /// <param name="id"> /// The ID of the location. /// </param> /// <param name="name"> /// A string representing the name of the dungeon. /// </param> /// <param name="mapLocations"> /// A list of map locations. /// </param> /// <param name="map"> /// A 32-bit signed integer representing the number of maps in the dungeon. /// </param> /// <param name="compass"> /// A 32-bit signed integer representing the number of compasses in the dungeon. /// </param> /// <param name="smallKeys"> /// A 32-bit signed integer representing the number of small keys in the dungeon. /// </param> /// <param name="bigKey"> /// A 32-bit signed integer representing the number of big keys in the dungeon. /// </param> /// <param name="mapItem"> /// The map item. /// </param> /// <param name="compassItem"> /// The compass item. /// </param> /// <param name="smallKeyItem"> /// The small key item. /// </param> /// <param name="bigKeyItem"> /// The big key item. /// </param> /// <param name="nodes"> /// A list of dungeon node IDs within the dungeon. /// </param> /// <param name="items"> /// A list of dungeon item IDs within the dungeon. /// </param> /// <param name="bosses"> /// A list of dungeon item IDs for bosses within the dungeon. /// </param> /// <param name="smallKeyDoors"> /// A list of small key door IDs within the dungeon. /// </param> /// <param name="bigKeyDoors"> /// A list of big key door IDs within the dungeon. /// </param> /// <param name="entryNodes"> /// A list of entry nodes for this dungeon. /// </param> public Dungeon( LocationID id, string name, List <MapLocation> mapLocations, int map, int compass, int smallKeys, int bigKey, IItem mapItem, IItem compassItem, IItem smallKeyItem, IItem bigKeyItem, List <DungeonNodeID> nodes, List <DungeonItemID> items, List <DungeonItemID> bosses, List <KeyDoorID> smallKeyDoors, List <KeyDoorID> bigKeyDoors, List <IRequirementNode> entryNodes) : base(id, name, mapLocations) { Map = map; Compass = compass; SmallKeys = smallKeys; BigKey = bigKey; MapItem = mapItem; CompassItem = compassItem; SmallKeyItem = smallKeyItem; BigKeyItem = bigKeyItem; Nodes = nodes ?? throw new ArgumentNullException(nameof(nodes)); Items = items ?? throw new ArgumentNullException(nameof(items)); Bosses = bosses ?? throw new ArgumentNullException(nameof(bosses)); SmallKeyDoors = smallKeyDoors ?? throw new ArgumentNullException(nameof(smallKeyDoors)); BigKeyDoors = bigKeyDoors ?? throw new ArgumentNullException(nameof(bigKeyDoors)); KeyLayouts = KeyLayoutFactory.GetDungeonKeyLayouts(this); EntryNodes = entryNodes ?? throw new ArgumentNullException(nameof(entryNodes)); for (int i = 0; i < Environment.ProcessorCount - 1; i++) { CreateDungeonData(); } foreach (var section in Sections) { section.PropertyChanged += OnSectionChanged; } foreach (var node in EntryNodes) { node.PropertyChanged += OnNodeChanged; } if (SmallKeyItem != null) { SmallKeyItem.PropertyChanged += OnItemChanged; ItemDictionary.Instance[ItemType.SmallKey].PropertyChanged += OnItemChanged; } if (BigKeyItem != null) { BigKeyItem.PropertyChanged += OnItemChanged; } Mode.Instance.PropertyChanged += OnModeChanged; SubscribeToConnectionRequirements(); UpdateSectionAccessibility(); }
/// <summary> /// Subscribes to the LocationCreated event on the LocationDictionary class. /// </summary> /// <param name="sender"> /// The sending object of the event. /// </param> /// <param name="e"> /// The arguments of the LocationCreated event. /// </param> private void OnLocationCreated(object sender, LocationID id) { if (id == _locationID) { Location = LocationDictionary.Instance[_locationID]; } if (Location != null) { LocationDictionary.Instance.LocationCreated -= OnLocationCreated; } }
private void btnClear_Click(object sender, EventArgs e) { DateTime now = DateTime.Now; InvoiceNumber.EditValue = string.Empty; IssuedFrom.EditValue = new DateTime(now.Year, now.Month, 1); IssuedTo.EditValue = new DateTime(now.Year, now.Month, DateTime.DaysInMonth(now.Year, now.Month)); PeriodFrom.EditValue = null; PeriodTo.EditValue = null; CompanyID.SetEditValue(string.Empty); LocationID.SetEditValue(string.Empty); }
public ILocation this[LocationID key] { get { if (!ContainsKey(key)) { Create(key); } return(((IDictionary <LocationID, ILocation>)_dictionary)[key]); } set => ((IDictionary <LocationID, ILocation>)_dictionary)[key] = value;
private string CreateSetItemString(LocationID locationID) { if (locationToItemMap.TryGetValue((int)locationID, out int id)) { ItemID newItemID = (ItemID)id; //get the item data for the new item, only really need the ItemInfo newItemInfo = ItemFlags.GetItemInfo(newItemID); return(String.Format("[@sitm,{0},{1},{2},{3}]", newItemInfo.shopType, newItemInfo.shopName, newItemInfo.shopPrice, newItemInfo.shopAmount)); } return(String.Empty); }
protected void btnClear_Click(object sender, EventArgs e) { CategoryId.ClearSelection(); AgeGroupId.ClearSelection(); BranchId.ClearSelection(); LocationID.ClearSelection(); odsBadges.DataBind(); rptr.DataBind(); var wt = new WebTools(); CategoryId.CssClass = wt.CssRemoveClass(CategoryId.CssClass, "gra-search-active"); AgeGroupId.CssClass = wt.CssRemoveClass(AgeGroupId.CssClass, "gra-search-active"); BranchId.CssClass = wt.CssRemoveClass(BranchId.CssClass, "gra-search-active"); LocationID.CssClass = wt.CssRemoveClass(LocationID.CssClass, "gra-search-active"); }
/// <summary> /// method to create an element /// </summary> /// <param name="description">description</param> /// <param name="locationID"> locationID</param> /// <param name="wsprice"> wholesale price</param> /// <returns>an instance of the element</returns> /// public static Element CreateElement(string description, LocationID locationID, decimal wsprice, decimal worktime = 0) { var element = new Element { Description = description, Location = locationID, }; if (wsprice > 0) { element.MakeRetail(markup, wsprice); } db.Elements.Add(element); db.SaveChanges(); return(element); }
/// <summary> /// 将蓝图转换成一个要显示的 ListViewItem /// </summary> /// <returns></returns> public ListViewItem ListViewItem() { ListViewItem lvi = new ListViewItem(); // 蓝图名称 if (BluePrints == null) { lvi.Text = invTypes.GetInvTypes(BluePrintID).Name; } else { lvi.Text = BluePrints.invTypes.Name; } lvi.SubItems.Add(ID.ToString()); lvi.SubItems.Add(ItemID.ToString()); lvi.SubItems.Add(BluePrintID.ToString()); lvi.SubItems.Add(MaterialEfficiency.ToString()); lvi.SubItems.Add(TimeEfficiency.ToString()); lvi.SubItems.Add(Quantity.ToString()); lvi.SubItems.Add(Runs.ToString()); // 如果是角色拥有则显示角色名称, 否则直接显示"军团" if (CharacterOwned) { if (Characters == null) { lvi.SubItems.Add(Characters.GetCharacters(Owner).CharacterName); } else { lvi.SubItems.Add(Characters.CharacterName); } } else { lvi.SubItems.Add("军团"); } lvi.SubItems.Add(LocationID.ToString()); lvi.SubItems.Add(LocationFlag.ToString()); lvi.SubItems.Add(UpdateTime.ToString()); lvi.SubItems.Add(Cost.ToString()); return(lvi); }
private string ChangeTalkString(LocationID locationID, string original) { if (locationToItemMap.TryGetValue((int)locationID, out int id)) { ItemID newItemID = (ItemID)id; //get the item data for the new item ItemInfo newItemInfo = ItemFlags.GetItemInfo(newItemID); //Sacred orbs might require some special work here if setting the orbcount flag doesnt give you the level up string take; if (newItemInfo.boxName.Equals("Crystal S") || newItemInfo.boxName.Equals("Sacred Orb") || newItemInfo.boxName.Equals("MSX3p")) { take = String.Format("[@take,{0},02item,1]\n", newItemInfo.boxName); } else { take = String.Format("[@take,{0},02item,1]\n", newItemInfo.shopName); } //if the item has more than just its set flags add the flags to the mojiscript string L2FlagBoxEnd[] getFLags = ItemFlags.GetItemGetFlags(newItemID); if (getFLags != null) { for (int i = 0; i < getFLags.Length; i++) { L2FlagBoxEnd flag = getFLags[i]; if (flag.calcu == CALCU.ADD) { take += String.Format("[@setf,{0},{1},+,{2}]\n", flag.seet_no1, flag.flag_no1, flag.data); } else if (flag.calcu == CALCU.EQR) { take += String.Format("[@setf,{0},{1},=,{2}]\n", flag.seet_no1, flag.flag_no1, flag.data); } } } return(String.Format(original, take)); } //should never get to here this will break this characters dialogue return(String.Empty); }
private string ChangeTalkString(LocationID locationID, string original) { if (locationToItemMap.TryGetValue(locationID, out ItemID newItemID)) { ItemInfo newItemInfo = ItemDB.GetItemInfo(newItemID); string take; if (newItemInfo.boxName.Equals("Crystal S") || newItemInfo.boxName.Equals("Sacred Orb") || newItemInfo.boxName.Equals("MSX3p")) { take = string.Format("[@take,{0},02item,1]\n", newItemInfo.boxName); } else { take = string.Format("[@take,{0},02item,1]\n", newItemInfo.shopName); } //if the item has more than just its set flags add the flags to the mojiscript string L2FlagBoxEnd[] getFLags = CreateGetFlags(newItemID, newItemInfo); if (getFLags != null) { for (int i = 0; i < getFLags.Length; i++) { L2FlagBoxEnd flag = getFLags[i]; if (flag.calcu == CALCU.ADD) { take += string.Format("[@setf,{0},{1},+,{2}]\n", flag.seet_no1, flag.flag_no1, flag.data); } else if (flag.calcu == CALCU.EQR) { take += string.Format("[@setf,{0},{1},=,{2}]\n", flag.seet_no1, flag.flag_no1, flag.data); } } } return(string.Format(original, take)); } return(string.Empty); }
private void btnGenerate_Click(object sender, EventArgs e) { if (ReportID.EditValue == null || ReportID.EditValue.ToString() == "0") { Mess.Info("Please select a report!"); ReportID.ShowPopup(); return; } using (var db = DB.GetContext()) { uint reportID = Convert.ToUInt32(ReportID.EditValue); uint[] companies = CompanyID.GetCheckedValues(); uint[] locations = LocationID.GetCheckedValues(); uint[] drivers = DriverID.GetCheckedValues(); DateTime fromDt = FromDate.DateTime; DateTime toDt = ToDate.DateTime; var report = ReportRepository.GenerateReport(db, reportID, companies, locations, drivers, fromDt, toDt); //report.DataSource.WriteXmlSchema("D:\\schema.xml"); ReportBinder.ShowReport(report); } }
private string ChangeTalkFlagCheck(LocationID locationID, COMPARISON comp, string original) { if (locationToItemMap.TryGetValue(locationID, out ItemID newItemID)) { ItemInfo newItemInfo = ItemDB.GetItemInfo(newItemID); int flagValue = 0; if (comp == COMPARISON.Greater) { if (newItemID == ItemID.ChainWhip || newItemID == ItemID.SilverShield || newItemID == ItemID.MobileSuperx3P) { flagValue = 1; } else if (newItemID == ItemID.FlailWhip || newItemID == ItemID.AngelShield) { flagValue = 2; } } else if (comp == COMPARISON.Less) { flagValue = 1; if (newItemID == ItemID.ChainWhip || newItemID == ItemID.SilverShield || newItemID == ItemID.MobileSuperx3P) { flagValue = 2; } else if (newItemID == ItemID.FlailWhip || newItemID == ItemID.AngelShield) { flagValue = 3; } } return(string.Format(original, newItemInfo.itemFlag, flagValue)); } return(string.Empty); }