/// <summary> /// Draw item type /// </summary> private static void DrawUsesAmmo() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); SimpleLayout.Label("Uses Ammunition" + ":"); boolFields[3].value = SimpleLayout.BoolField(boolFields[3].value); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (boolFields[3].value) { SimpleLayout.Space(5); SimpleLayout.Line(); // item type field DropDownValues itemList = HeroKitCommon.databaseList(HeroKitCommon.ammunitionTypeDatabase); SimpleLayout.BeginHorizontal(); intFields[2].value = SimpleLayout.DropDownList(intFields[2].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Ammunition type"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[3].value = SimpleLayout.IntField(intFields[3].value); SimpleLayout.Label("Range (in meters)"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw item type /// </summary> private static void DrawTarget2() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); SimpleLayout.Label("Uses Ammunition" + ":"); boolFields[3].value = SimpleLayout.BoolField(boolFields[3].value); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (boolFields[3].value) { SimpleLayout.Space(5); SimpleLayout.Line(); // item type field string[] items = { "Another Character", "Caster" }; DropDownValues itemList = new DropDownValues(); itemList.setValues("", items); SimpleLayout.BeginHorizontal(); intFields[1].value = SimpleLayout.DropDownList(intFields[1].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Target"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[17].value = SimpleLayout.IntField(intFields[17].value); SimpleLayout.Label("Range (in meters)"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw exp meter /// </summary> private static void DrawExpMeter() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); boolFields[6].value = SimpleLayout.BoolField(boolFields[6].value); SimpleLayout.Label("Ability has Experience Meter"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (boolFields[6].value) { SimpleLayout.BeginHorizontal(); intFields[11].value = SimpleLayout.IntField(intFields[11].value); SimpleLayout.Label("Experience gained per use of this ability"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[10].value = SimpleLayout.IntField(intFields[10].value); SimpleLayout.Label("Experience needed to morph ability"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); DropDownValues itemList = HeroKitCommon.databaseList(HeroKitCommon.abilityDatabase); SimpleLayout.BeginHorizontal(); intFields[12].value = SimpleLayout.DropDownList(intFields[12].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 250)); SimpleLayout.Label("Morph into..."); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
private static void DrawTimerEndCond() { SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); boolFields[0].value = SimpleLayout.BoolField(boolFields[0].value); SimpleLayout.Label("Turn off condition with timer"); SimpleLayout.EndHorizontal(); if (boolFields[0].value) { SimpleLayout.Line(); // list of stat change types DropDownValues changeTypeValues = new DropDownValues(); string[] changeType = { "Seconds", "Minutes", "Hours" }; changeTypeValues.setValues("", changeType); SimpleLayout.BeginHorizontal(); intFields[0].value = SimpleLayout.DropDownList(intFields[0].value, changeTypeValues, 0, 150); intFields[1].value = SimpleLayout.IntField(intFields[1].value, 150); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
/// <summary> /// Draw item type /// </summary> private static void DrawRange() { // item type field string[] items = { "Projectile launched at target", "Everything within radius around Caster", "Directly on Target" }; DropDownValues itemList = new DropDownValues(); itemList.setValues("", items); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); intFields[2].value = SimpleLayout.DropDownList(intFields[2].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("How ability is used"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // projectile or radius if (intFields[2].value == 1 || intFields[2].value == 2) { SimpleLayout.BeginHorizontal(); intFields[3].value = SimpleLayout.IntField(intFields[3].value); SimpleLayout.Label("Range (in meters)"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } // projectile if (intFields[2].value == 1) { SimpleLayout.BeginHorizontal(); intFields[4].value = SimpleLayout.IntField(intFields[4].value); SimpleLayout.Label("Speed of projectile"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // particle effect on target SimpleLayout.BeginHorizontal(); uoFields[3].value = SimpleLayout.ObjectField(uoFields[3].value as ParticleSystem, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Particle effect for projectile"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } // particle effect on target SimpleLayout.BeginHorizontal(); uoFields[2].value = SimpleLayout.ObjectField(uoFields[2].value as ParticleSystem, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Particle effect on target"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); // particle effect on caster SimpleLayout.BeginHorizontal(); uoFields[1].value = SimpleLayout.ObjectField(uoFields[1].value as ParticleSystem, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Particle effect on caster"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.EndVertical(); }
public ActionResult Create() { var ownershipTypeList = new List<SelectListItem>(); var dd = new DropDownValues(unitOfWork.Context); dd.GetAll("OW").ToList().ForEach(x => ownershipTypeList.Add(new SelectListItem { Text = x.Value, Value = x.Id.ToString() }) ); ViewBag.ownershipTypeList = ownershipTypeList; return View(); }
public NewMarker() { InitializeComponent(); DataContext = this; foreach (Layer l in MainWindow._LayerCollection) { if ((bool)l.IsLayerShown) { DropDownValues.Add(new KeyValuePair <string, string>(l.LayerID.ToString(), l.LayerName)); } } }
/// <summary> /// Draw item type /// </summary> private static void DrawSuccess() { // item type field string[] items = { "100%", "95%", "90%", "85%", "80%", "75%", "70%", "65%", "60%", "55%", "50%", "45%", "40%", "35%", "30%", "25%", "20%", "15%", "15%", "5%" }; DropDownValues itemList = new DropDownValues(); itemList.setValues("", items); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); intFields[5].value = SimpleLayout.DropDownList(intFields[5].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 200)); SimpleLayout.Label("Chance of success"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.EndVertical(); }
/// <summary> /// Draw item type /// </summary> private static void DrawTarget() { // item type field string[] items = { "Enemies", "Friends", "Caster", "Enemies and Friends", "All" }; DropDownValues itemList = new DropDownValues(); itemList.setValues("", items); // item type field string[] scope = { "All", "Some", "One" }; DropDownValues scopeList = new DropDownValues(); scopeList.setValues("", scope); SimpleLayout.BeginVertical(SimpleGUI.Fields.Box.StyleB); SimpleLayout.BeginHorizontal(); intFields[1].value = SimpleLayout.DropDownList(intFields[1].value, itemList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 250)); SimpleLayout.Label("Target"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); intFields[7].value = SimpleLayout.DropDownList(intFields[7].value, scopeList, 0, HeroKit.Editor.HeroKitCommon.GetWidthForField(60, 250)); SimpleLayout.Label("Scope"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); if (intFields[7].value == 2) { SimpleLayout.BeginHorizontal(); intFields[8].value = SimpleLayout.IntField(intFields[8].value); SimpleLayout.Label("Max number of targets"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); SimpleLayout.BeginHorizontal(); boolFields[4].value = SimpleLayout.BoolField(boolFields[4].value); SimpleLayout.Label("Random"); SimpleLayout.Space(); SimpleLayout.EndHorizontal(); } SimpleLayout.EndVertical(); }
public NewPolyline() { InitializeComponent(); polygonposition = MainWindow.currentposition; DataContext = this; foreach (Layer l in MainWindow._LayerCollection) { if ((bool)l.IsLayerShown) { DropDownValues.Add(new KeyValuePair <string, string>(l.LayerID.ToString(), l.LayerName)); } } txtPosition.Text = polygonposition.Lat.ToString() + ", " + polygonposition.Lng.ToString(); txtGEO.Text = MainWindow.GetGEO(polygonposition); cmbLayerList.SelectedIndex = 0; }
public List <DropDownValues> GetDropDownDataIfAvailable(WSEMDBEntities context, string procName, int?employeeID, string optParm1, int?ReportID, string reportParamName) { List <DropDownValues> values = new List <DropDownValues>(); var reportDetailsTeam = dbContext.v2_getReportParamMaster(ReportID, employeeID); var reportDetailsAll = dbContext.v2_getReportParamMaster(ReportID, employeeID); List <string> strTeam = reportDetailsTeam.Where(t => t.Team != null && t.reportParamName == reportParamName).Select(t => t.Team).ToList(); List <string> strAll = reportDetailsAll.Where(t => t.All != null && t.reportParamName == reportParamName).Select(t => t.All).ToList(); string[] team = { }; string[] all = { }; foreach (var item in strTeam) { if (item != null) { team = item.Split(','); } } foreach (var item in strAll) { if (item != null) { all = item.Split(','); } } string[] role = Roles.GetRolesForUser(Membership.GetUser().UserName); if (procName != null) { var DropDownValues = dbContext.GetDropDownFillValues(procName, employeeID, optParm1, null, null, null, null); List <DropDownValues> DropDownList = new List <DropDownValues>(); DropDownList = (from m in DropDownValues select new DropDownValues { Key = Convert.ToString(m.Key), Value = m.Value }).ToList(); DropDownValues selfValue = new DropDownValues() { Key = "-1", Value = "Self" }; DropDownValues allValue = new DropDownValues() { Key = "-3", Value = "All" }; DropDownValues teamValue = new DropDownValues() { Key = "-2", Value = "Team" }; if (strTeam.Count != 0 || strAll.Count != 0) { DropDownList.Insert(0, selfValue); } DropDownList.RemoveAll(x => x.Key == Membership.GetUser().UserName); if (CheckIfValueExist(all, role)) { if (DropDownList.Contains(selfValue)) { DropDownList.Insert(1, allValue); } else { DropDownList.Insert(0, allValue); } } if (CheckIfValueExist(team, role)) { if (DropDownList.Contains(selfValue) && DropDownList.Contains(allValue)) { DropDownList.Insert(2, teamValue); } else if (DropDownList.Contains(selfValue) && !DropDownList.Contains(allValue)) { DropDownList.Insert(1, teamValue); } else if (!DropDownList.Contains(selfValue) && DropDownList.Contains(allValue)) { DropDownList.Insert(1, teamValue); } else if (!DropDownList.Contains(selfValue) && !DropDownList.Contains(allValue)) { DropDownList.Insert(0, teamValue); } } values = DropDownList.ToList(); } return(values); }
public bool SatisfiesFilter <TElement>(TElement item, bool filterStringCaseSensitive) // ar objektas "item" atitinka nustatyta filtra { if (IsDropDown) { if (DropDownValues != null && DropDownValues.Any()) { switch (Type) { case InputType.DateTime: foreach (var val in DropDownValues) { if ((DateTime)val == (DateTime)FieldProterty.GetValue(item)) { return(true); } } return(false); case InputType.Decimal: foreach (var val in DropDownValues) { if ((decimal)val == (decimal)FieldProterty.GetValue(item)) { return(true); } } return(false); case InputType.Number: foreach (var val in DropDownValues) { if ((int)val == (int)FieldProterty.GetValue(item)) { return(true); } } return(false); case InputType.Text: foreach (var val in DropDownValues) { if ((string)val == (string)FieldProterty.GetValue(item)) { return(true); } } return(false); } } else // jei DropDown bet jame nera nustatytu reiksmiu { return(true); } } else // jei ne DropDown { switch (Type) { case InputType.Text: var text = FieldProterty.GetValue(item); if (text == null || (text.ToString() ?? "").Length == 0) { return(false); } if (filterStringCaseSensitive) { return(((string)FieldProterty.GetValue(item)).Contains(Text)); } return(((string)FieldProterty.GetValue(item)).ToLower().Contains(Text.ToLower())); case InputType.Number: if (((int?)FieldProterty.GetValue(item)).HasValue) { if (Number[0].HasValue && Number[1].HasValue) // jei filtruojama nuo - iki { FixFromTo(); // jei nuo > iki, tada apkeiciu nuo su iki vietomis (user error) return((int)FieldProterty.GetValue(item) >= Number[0].Value && (int)FieldProterty.GetValue(item) <= Number[1].Value); } else if (Number[0] != null) // jei nustatytas tik "nuo" filtras { return((int)FieldProterty.GetValue(item) >= Number[0].Value); } else // jei nustatytas tik "iki" filtras { return((int)FieldProterty.GetValue(item) <= Number[1].Value); } } else { return(false); } case InputType.DateTime: if (((DateTime?)FieldProterty.GetValue(item)).HasValue) { if (Date[0].HasValue && Date[1].HasValue) // jei filtruojama nuo - iki { FixFromTo(); // jei nuo > iki, tada apkeiciu nuo su iki vietomis (user error) return(((DateTime)FieldProterty.GetValue(item)).Date >= Date[0].Value.Date && ((DateTime)FieldProterty.GetValue(item)).Date <= Date[1].Value.Date); } else if (Date[0].HasValue) // jei nustatytas tik "nuo" filtras { return(((DateTime)FieldProterty.GetValue(item)).Date >= Date[0].Value.Date); } else // jei nustatytas tik "iki" filtras { return(((DateTime)FieldProterty.GetValue(item)).Date <= Date[1].Value.Date); } } else { return(false); } case InputType.Decimal: if (((decimal?)FieldProterty.GetValue(item)).HasValue) { if (Price[0].HasValue && Price[1].HasValue) // jei filtruojama nuo - iki { FixFromTo(); // jei nuo > iki, tada apkeiciu nuo su iki vietomis (user error) return((decimal)FieldProterty.GetValue(item) >= Price[0].Value && (decimal)FieldProterty.GetValue(item) <= Price[1].Value); } else if (Price[0].HasValue) // jei nustatytas tik "nuo" filtras { return((decimal)FieldProterty.GetValue(item) >= Price[0].Value); } else // jei nustatytas tik "iki" filtras { return((decimal)FieldProterty.GetValue(item) <= Price[1].Value); } } else { return(false); } case InputType.Checkbox: if (((bool?)FieldProterty.GetValue(item)).HasValue) { return((bool)FieldProterty.GetValue(item) == Bool); } else { return(false); } } } return(false); }