public ActionResult Index() { ViewBag.CountryList = SelectionList.CountryList().Select(m => new { m.CountryId, m.CountryName }); ViewBag.StateList = SelectionList.StateList().Select(m => new { m.StateId, m.StateName }); ViewBag.CityList = SelectionList.CityList().Select(m => new { m.CityId, m.CityName }); return(View()); }
public ActionResult Edit(int id) { ViewBag.CustomerList = SelectionList.CustomerList().Select(m => new { m.CustomerId, m.CustomerName }); ViewBag.MachineTypeList = SelectionList.MachineTypeList().Select(m => new { m.MachineTypeId, m.MachineTypeName }); ViewBag.MachineModelList = SelectionList.MachineModelsList().Select(m => new { m.MachineModelId, m.MachineName }); return(View("Create", _dbRepository.SelectById(id))); }
private void Paginate() { IEnumerable <IGrouping <string, Item> > groupedItems = Items.GroupBy(i => i.Name); List <ListItem <Item> > listItems = new List <ListItem <Item> >(); foreach (IGrouping <string, Item> grouping in groupedItems) { listItems.Add(new ListItem <Item>(grouping.ElementAt(0))); } listItems.GroupBy(i => i.Item.Name); Listing = new SelectionList <ListItem <Item> >( listItems, new ItemListing <ListItem <Item> >(DisplayAction), "You left the inventory", ItemsPerPage ) { InitEventAction = new ItemListing <ListItem <Item> >(InitEvent), DeconstructEventAction = new ItemListing <ListItem <Item> >(DeconstructEvent), InitListItem = new InitListing <ListItem <Item> >(InitListItem), Header = Header, ErrorMarginTop = 2 }; Listing.Paginate(); }
void Start() { if (clickVolume < 0.0f) { clickVolume = 0.0f; } if (clickVolume > 1.0f) { clickVolume = 1.0f; } List <AudioClip> sounds = new List <AudioClip> (); List <float> volumes = new List <float> (); sounds.Add(clickSound); volumes.Add(clickVolume); audioElement = new AudioElement(sounds, volumes, "SelectPlayerMenu", null); avatars = ResourceManager.GetAvatars(); if (avatars.Length > 0) { avatarIndex = 0; } SelectionList.LoadEntries(PlayerManager.GetPlayerNames()); /* PlayerManager.Load (); * PlayerManager.SetAvatarTextures (avatars); * if (avatars.Length > 0) * avatarIndex = 0; * SelectionList.LoadEntries (PlayerManager.GetPlayerNames ());*/ }
public static Option RegisterShip(bool reRegister = false) { ConsoleWriter.ClearScreen(); var lines = File.ReadAllLines(@"UI/maps/5a.RegisterShip.txt"); var drawables = TextEditor.Add.DrawablesAt(lines, 0); var nextLine = drawables.Max(x => x.CoordinateY); var ships = APICollector.ReturnShipsAsync().Where(s => double.Parse(s.ShipLength) <= 150).ToArray(); var shipLines = ships.Select(x => "$ " + x.Model).ToArray(); drawables.AddRange(TextEditor.Add.DrawablesAt(shipLines, nextLine + 3)); TextEditor.Center.ToScreen(drawables, Console.WindowWidth, Console.WindowHeight); var selectionList = new SelectionList <SpaceShip>(ForegroundColor, '$'); selectionList.GetCharPositions(drawables); selectionList.AddSelections(ships); ConsoleWriter.TryAppend(drawables); ConsoleWriter.Update(); var ship = selectionList.GetSelection(); if (reRegister) { DatabaseManagement.AccountManagement.ReRegisterShip(_account, ship); return(Option.Account); } DatabaseManagement.AccountManagement.Register(_account.User, ship, _namepass.accountName, _namepass.password); return(Option.Login); }
void OnGUI() { if (confirmDialog.IsConfirming()) { string message = "\"" + saveName + "\" already exists. Do you wish to continue?"; confirmDialog.Show(message, mySkin); } else if (confirmDialog.MadeChoice()) { if (confirmDialog.ClickedYes()) { SaveGame(); } confirmDialog.EndConfirmation(); } else { if (SelectionList.MouseDoubleClick()) { PlayClick(); saveName = SelectionList.GetCurrentEntry(); StartSave(); } } GUI.skin = mySkin; DrawMenu(); if (Event.current.keyCode == KeyCode.Return) { StartSave(); } }
protected override void SaveComponent() { // Delegate to base implementation first! // This will properly close ListTreeNode editing mode. base.SaveComponent(); _listDesigner.Items.Clear(); foreach (ItemTreeNode itemNode in TreeList.TvList.Nodes) { if (itemNode.Dirty) { itemNode.RuntimeItem.Text = itemNode.Text; itemNode.RuntimeItem.Value = itemNode.Value; if (!_isBaseControlList) { itemNode.RuntimeItem.Selected = itemNode.Selected; } } _listDesigner.Items.Add(itemNode.RuntimeItem); } if (_isBaseControlList) { List list = (List)GetBaseControl(); list.ItemsAsLinks = _itemsAsLinksCheckBox.Checked; TypeDescriptor.Refresh(list); } else { SelectionList selectionList = (SelectionList)GetBaseControl(); TypeDescriptor.Refresh(selectionList); } }
/// <summary> /// Method to return main view /// </summary> /// <returns>View</returns> public IActionResult Index() { ViewBag.UserList = SelectionList.UserList().Select(x => new { x.UserId, x.Name }); ViewBag.ScreenList = SelectionList.ScreenList().Select(x => new { x.TableName, x.ScreenName }); ViewBag.EntityActionList = SelectionList.EntityActionList(); return(View()); }
public SelectionList CompleteTradedVolumeToRunner(SelectionList runnersToUpdateTo, SelectionList runnersToUpdateFrom) { for (var x = 0; x < runnersToUpdateFrom.Count; x++) { if (!runnersToUpdateTo.Contains(runnersToUpdateFrom[x].selectionId)) { runnersToUpdateTo.Add(runnersToUpdateFrom[x]); } else { var index = runnersToUpdateTo.GetRunnerIndexNoBySelectionId(runnersToUpdateFrom[x].selectionId); if (index >= 0) { runnersToUpdateTo[index].tradedVolume = runnersToUpdateFrom[x].tradedVolume; runnersToUpdateTo[index].actualSPPrice = runnersToUpdateFrom[x].actualSPPrice; } } } if (runnersToUpdateFrom.Count < runnersToUpdateTo.Count) { for (var x = 0; x < runnersToUpdateTo.Count; x++) { if (!runnersToUpdateFrom.Contains(runnersToUpdateTo[x].selectionId)) { runnersToUpdateTo[x].tradedVolume = new TradedVolumeList(); } } } return(runnersToUpdateTo); }
public IActionResult Index() { ViewBag.CustomerList = SelectionList.CustomerList().Select(x => new { x.CustomerId, x.Name }); ViewBag.ConsigneeList = SelectionList.ConsigneeList().Select(x => new { x.ConsigneeId, x.Name }); ViewBag.OrderStatusList = SelectionList.OrderStatusList().Select(x => new { x.OrderStatusId, x.Name }); return(View()); }
public override void OnInit(EventArgs e) { ListCommandEventHandler listCommandEventHandler; // Create secondary child controls for rendering secondary UI. // Note that their ViewState is disabled because they are used // for rendering only. //--------------------------------------------------------------- _selectList = new SelectionList(); _selectList.Visible = false; _selectList.EnableViewState = false; Control.Controls.Add(_selectList); _textBox = new TextBox(); _textBox.Visible = false; _textBox.EnableViewState = false; Control.Controls.Add(_textBox); // Below are initialization of several list controls. A note is // that here the usage of DataMember is solely for remembering // how many items a particular list control is bounded to. The // property is not used as originally designed. //--------------------------------------------------------------- _optionList = new List(); _optionList.DataMember = "5"; listCommandEventHandler = new ListCommandEventHandler(this.OptionListEventHandler); InitList(_optionList, listCommandEventHandler); // Use MobileCapabilities to check screen size and determine how // many months should be displayed for different devices. _monthsToDisplay = MonthsToDisplay(Device.ScreenCharactersHeight); // Create the list of months, including [Next] and [Prev] links _monthList = new List(); _monthList.DataMember = Convert.ToString(_monthsToDisplay + 2); listCommandEventHandler = new ListCommandEventHandler(this.MonthListEventHandler); InitList(_monthList, listCommandEventHandler); _weekList = new List(); _weekList.DataMember = "6"; listCommandEventHandler = new ListCommandEventHandler(this.WeekListEventHandler); InitList(_weekList, listCommandEventHandler); _dayList = new List(); _dayList.DataMember = "7"; listCommandEventHandler = new ListCommandEventHandler(this.DayListEventHandler); InitList(_dayList, listCommandEventHandler); // Initialize the VisibleDate which will be used to keep track // the ongoing selection of year, month and day from multiple // secondary UI screens. If the page is loaded for the first // time, it doesn't need to be initialized (since it is not used // yet) so no unnecessary viewstate value will be generated. if (Page.IsPostBack && Control.VisibleDate == DateTime.MinValue) { Control.VisibleDate = DateTime.Today; } }
public void SelectionListOnCollectionChanged() { tlog.Debug(tag, $"SelectionListOnCollectionChanged START"); var model = new TestModel(); string[] list = { "Jiangsu", "Zhejiang", "Shanghai" }; var incc = new NCImpl(); incc.CollectionChanged += OnCollectionChanged; List <object> item = new List <object>(); item.Add(item); using (CollectionView cv = new CollectionView(model)) { var testingTarget = new SelectionList(cv, item); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <SelectionList>(testingTarget, "should be an instance of testing target class!"); testingTarget.Insert(0, "Beijing"); tlog.Debug(tag, "Contains : " + testingTarget.Contains("Beijing")); } tlog.Debug(tag, $"SelectionListOnCollectionChanged END (OK)"); }
public void SelectionListGetEnumerator() { tlog.Debug(tag, $"SelectionListGetEnumerator START"); var model = new TestModel(); string[] list = { "Jiangsu", "Zhejiang", "Shanghai" }; using (CollectionView cv = new CollectionView(model)) { var testingTarget = new SelectionList(cv); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <SelectionList>(testingTarget, "should be an instance of testing target class!"); testingTarget.Insert(0, "China"); var index = testingTarget.IndexOf("China"); tlog.Debug(tag, "IndexOf : " + index); var result = testingTarget.GetEnumerator(); tlog.Debug(tag, "Enumerator : " + result); } tlog.Debug(tag, $"SelectionListGetEnumerator END (OK)"); }
public void SelectionListContains() { tlog.Debug(tag, $"SelectionListContains START"); var model = new TestModel(); using (CollectionView cv = new CollectionView(model)) { var testingTarget = new SelectionList(cv); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <SelectionList>(testingTarget, "should be an instance of testing target class!"); tlog.Debug(tag, "IsReadOnly : " + testingTarget.IsReadOnly.ToString()); try { testingTarget.Add("TEST"); var result = testingTarget.Contains("TEST"); tlog.Debug(tag, "Contains : " + result); } catch (Exception e) { tlog.Debug(tag, e.Message.ToString()); Assert.Fail("Caught Exception : Failed!"); } } tlog.Debug(tag, $"SelectionListContains END (OK)"); }
public void SelectionListCopyTo() { tlog.Debug(tag, $"SelectionListCopyTo START"); var model = new TestModel(); string[] list = { "Jiangsu", "Zhejiang", "Shanghai" }; using (CollectionView cv = new CollectionView(model)) { var testingTarget = new SelectionList(cv); Assert.IsNotNull(testingTarget, "should be not null"); Assert.IsInstanceOf <SelectionList>(testingTarget, "should be an instance of testing target class!"); testingTarget.CopyTo(list, 1); var result = testingTarget.Remove("Zhejiang"); tlog.Debug(tag, "Remove : " + result); testingTarget.Insert(0, "Beijing"); tlog.Debug(tag, "Contains : " + testingTarget.Contains("Beijing")); testingTarget.RemoveAt(0); tlog.Debug(tag, "Contains : " + testingTarget.Contains("Beijing")); } tlog.Debug(tag, $"SelectionListCopyTo END (OK)"); }
protected override void UpdateControlsEnabling() { if (TreeList.TvList.SelectedNode == null) { TreeList.TvList.Enabled = _txtValue.Enabled = false; _txtValue.Text = String.Empty; } else { TreeList.TvList.Enabled = _txtValue.Enabled = true; } if (!_isBaseControlList) { SelectionList selectionListControl = (SelectionList)GetBaseControl(); if (TreeList.TvList.SelectedNode == null) { _ckbSelected.Enabled = false; _ckbSelected.Checked = false; } else { _ckbSelected.Enabled = true; } } }
void OnGUI() { if (confirmDialog.IsConfirming()) { string message = "\"" + saveName + "\" already exists. Do you widh to continue?"; confirmDialog.Show(message, mySkin); } else if (confirmDialog.MadeChoice()) { if (confirmDialog.ClickedYes()) { SaveGame(); } confirmDialog.EndConfirmation(); } else { if (SelectionList.MouseDoubleClick()) { PlayClick(); saveName = SelectionList.GetCurrentEntry(); StartSave(); } GUI.skin = mySkin; DrawMenu(); // Handle enter being hit when typing in the text field if (Event.current.keyCode == KeyCode.Return) { StartSave(); } // If typing and cancel is hit, nothing happens.. // doesn't appear to be a quick fix either.. } }
public ActionResult Index() { ViewBag.CustomerList = SelectionList.CustomerList().Select(m => new { m.CustomerId, m.CustomerName }); ViewBag.MachineTypeList = SelectionList.MachineTypeList().Select(m => new { m.MachineTypeId, m.MachineTypeName }); ViewBag.MachineModelList = SelectionList.MachineModelsList().Select(m => new { m.MachineModelId, m.MachineName }); return(View()); }
/// <summary> /// Method to bind Dispatch grid for invoice /// </summary> /// <param name="request"></param> /// <param name="invoiceId"></param> /// <returns></returns> public IActionResult KendoReadDispatchByInvoice([DataSourceRequest] DataSourceRequest request, long?invoiceId = null) { if (invoiceId != null) { return(Json(SelectionList.DispatchListByInvoice(invoiceId).Select(x => new { x.DispatchId, x.DispatchNo, x.DispatchDate }).ToDataSourceResult(request))); } return(Json(string.Empty)); }
public void Activate() { SelectionList.LoadEntries(RTSLockstep.PlayerManager.GetSavedGames()); if (GameResourceManager.LevelName != null && GameResourceManager.LevelName != "") { saveName = GameResourceManager.LevelName; } }
public Model() { this.store = new Store(); this.graph = new Graph(); this.factory = new Factory(store); this.selections = new SelectionList(); this.scene = new Scene(store, graph, selections); }
public override global::System.Data.DataSet Clone() { SelectionList cln = ((SelectionList)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public ShapesList(SelectionList list) { if (list == null) { throw new ArgumentNullException("list"); } _list = list; }
public void SelectCase(string commandText, string alias) { if (!commandText.EndsWith("END")) { throw new Exception($"{alias}: Case command is not completed"); } SelectionList.Add($"{ commandText } {Adapter.Alias(alias)}"); }
/// <summary> /// <para> /// Initializes the designer. /// </para> /// </summary> /// <param name='component'> /// The control element being designed. /// </param> /// <remarks> /// <para> /// This is called by the designer host to establish the component being /// designed. /// </para> /// </remarks> /// <seealso cref='System.ComponentModel.Design.IDesigner'/> public override void Initialize(IComponent component) { Debug.Assert(component is System.Web.UI.MobileControls.SelectionList, "SelectionListDesigner.Initialize - Invalid SelectionList Control"); _selectionList = (SelectionList)component; base.Initialize(component); }
public ActionResult Edit(int id) { ViewBag.MachineTypeList = SelectionList.MachineTypeList().Select(m => new { m.MachineTypeId, m.MachineTypeName }); ViewBag.MachineModelList = SelectionList.MachineModelsList().Select(m => new { m.MachineModelId, m.MachineName }); ViewBag.MachinePartList = SelectionList.MachinePartsList().Select(m => new { m.MachinePartId, m.ProductValue }); ViewBag.GSTPercentageList = SelectionList.GSTPercentageList().Select(m => new { m.Id, Percentage = m.Percentage + " %" }); return(View("Create", _dbRepository.SelectById(id))); }
public void Activate() { SelectionList.LoadEntries(PlayerManager.GetSavedGames()); if (ResourceManager.LevelName != null && ResourceManager.LevelName != "") { saveName = ResourceManager.LevelName; } }
void ClearVariables() { focusedMasterKey = null; focusedDetailKey = null; focusedGroupValues = null; SelectionList.Clear(); MasterRowList.Clear(); GroupRowList.Clear(); }
public IActionResult Index() { ViewBag.ProductList = SelectionList.ProductList().Select(x => new { x.ProductId, Name = x.FilmType + " " + x.Thickness }); ViewBag.OrderList = SelectionList.OrderList().Select(x => new { x.OrderId, x.OrderNo }); ViewBag.QualityList = SelectionList.SlittingStatusList().Select(x => new { x.SlittingStatusId, x.Name }); ViewBag.JumboList = SelectionList.JumboList().Select(x => new { x.JumboId, x.JumboNo }); return(View()); }
public ActionResult Create() { ViewBag.CustomerList = SelectionList.CustomerList().Select(m => new { m.CustomerId, m.CustomerName }); ViewBag.MachineTypeList = SelectionList.MachineTypeList().Select(m => new { m.MachineTypeId, m.MachineTypeName }); ViewBag.MachineModelList = SelectionList.MachineModelsList().Select(m => new { m.MachineModelId, m.MachineName }); return(View(new tblAMCQuotation { QuotationDate = DateTime.Now.Date })); }
public ViewModelOptions() { _gisIDColumnOrdinals = Settings.Default.GisIDColumnOrdinals.Cast<string>() .Select(s => Int32.Parse(s)).ToList(); _historyColumns = new SelectionList<string>(_incidMMPolygonsTable.Columns.Cast<DataColumn>() .Where(c => !_gisIDColumnOrdinals.Contains(c.Ordinal) && !c.ColumnName.StartsWith("shape_")) .Select(c => EscapeAccessKey(c.ColumnName)).ToArray()); List<int> historyColumnOrdinals = Settings.Default.HistoryColumnOrdinals.Cast<string>() .Select(s => Int32.Parse(s)).Where(i => !_gisIDColumnOrdinals.Contains(i) && !_incidMMPolygonsTable.Columns[i].ColumnName.StartsWith("shape_")).ToList(); foreach (SelectionItem<string> si in _historyColumns) si.IsSelected = historyColumnOrdinals.Contains( _incidMMPolygonsTable.Columns[UnescapeAccessKey(si.Item)].Ordinal); }
public void Populate(params TimerSequenceItem[] items) { Items = new SelectionList<TimerSequenceItem>(); Items.AddRange(items); Timer = new ActionTimer(Items[0].Time, () => { if (Items.IsNextAvailable()) { Items.Next(); Timer.TimeLimit = Items.CurrentValue.Time; Timer.Reset(); Timer.Start(); } else { if (FinishedCallback != null) { FinishedCallback(); return; } } Items.CurrentValue.Callback(); }); }
// Pre-initiates all the required things in the game private void reqPreInit() { gdm= new GraphicsDeviceManager(this); cameras= new SelectionList<Camera>(new Camera(this)); views= new SelectionList<Viewport>(); states= new GameStateManager(this); registry= new Registry(); gui= new GuiManager(); clearColor= getColor("royalblue"); IsMouseVisible= true; updateEvent= delegate(GameTime time) {}; drawEvent= delegate(GameTime time) {}; inputEvent= delegate(InputArgs args) {}; effects= new HashTable<Effect>(8); textures= new HashTable<Texture2D>(8); fonts= new HashTable<SpriteFont>(8); videos= new HashTable<Video>(8); sounds= new HashTable<SoundEffect>(8); songs= new HashTable<Song>(8); models= new HashTable<Model>(8); lastScrollData= 0; lastMousePosition= Mouse.GetState().Position; }
void Start() { Steps = new SelectionList<TutorialStep>() { new TutorialStep(){ ViewMode = HamburglarViewMode.Building, ActivationItem = GetItem("Intro") // page causes next }, new TutorialStep(){ ViewMode = HamburglarViewMode.Building, ActivationItem = GetItem("Zoom") // page causes next }, new TutorialStep(){ ViewMode = HamburglarViewMode.Building, ActivationItem = GetItem("Door"), FloorRayCastInterceptor = (Vector3 p, FloorItemCollider x) => { if (!x.FloorSegment.IsElevator) { // it's a door! NextStep(); } } }, new TutorialStep(){ ViewMode = HamburglarViewMode.Room, ActivationItem = GetItem("Loot"), RoomRayCastInterceptor = (Vector3 p, RoomItemCollider x) => { if (x.Item.Type != FurnitureType.Door) { HamburglarContext.Instance.LootPrompt.ShowDisplay(p,x.Item, 1, true, 0); } } }, new TutorialStep(){ ViewMode = HamburglarViewMode.Room, ActivationItem = GetItem("LeaveTrap") }, new TutorialStep(){ ViewMode = HamburglarViewMode.Room, ActivationItem = GetItem("LeaveRoom"), RoomRayCastInterceptor = (Vector3 p, RoomItemCollider x) => { if (x.Item.Type == FurnitureType.Door) { // it's an item NextStep(); } } }, new TutorialStep(){ ViewMode = HamburglarViewMode.Building, ActivationItem = GetItem("SeeOtherPlayers"), FloorRayCastInterceptor = (Vector3 p, FloorItemCollider x) => { if (x.FloorSegment.IsDoorOpen) { // it's a door! NextStep(); } } }, new TutorialStep(){ ViewMode = HamburglarViewMode.Room, ActivationItem = GetItem("KickOutRules") }, new TutorialStep(){ ViewMode = HamburglarViewMode.Building, ActivationItem = GetItem("Recap") } }; Steps.EndOfList += Steps_EndOfList; }
public void GetMaps() { var waitCursor = WaitCursor.Start(); Task.Factory.StartNew(() => Task.WaitAll(Task.Factory.StartNew(() => Source.GetAllMaps()), Task.Factory.StartNew(() => Target.GetAllMaps()))) .ContinueWith(t => Target.TagAllExistingMapsAndSetTargetCategories(Source), TaskContinuationOptions.NotOnFaulted) .ContinueWith(t => { TransferMaps = new SelectionList<TransferMap>(Source.Maps); Summary = Source.GetSummary(); MapsArePrepared = Source.Maps.Count > 0; }, CancellationToken.None, TaskContinuationOptions.NotOnFaulted, TaskScheduler.FromCurrentSynchronizationContext()) .ContinueWith(t => waitCursor.Stop(), TaskScheduler.FromCurrentSynchronizationContext()); }
protected override void OnInitialize() { DisplayName = "Transfer Doma Maps"; _tracker.Startup(); TransferMaps = new SelectionList<TransferMap>(new List<TransferMap>()); base.OnInitialize(); }
public ViewModelOptions() { _gisIDColumnOrdinals = Settings.Default.GisIDColumnOrdinals.Cast<string>() .Select(s => Int32.Parse(s)).ToList(); _historyColumns = new SelectionList<string>(_incidMMPolygonsTable.Columns.Cast<DataColumn>() .Where(c => !_gisIDColumnOrdinals.Contains(c.Ordinal) && !c.ColumnName.StartsWith("shape_")) .Select(c => EscapeAccessKey(c.ColumnName)).ToArray()); List<int> historyColumnOrdinals = Settings.Default.HistoryColumnOrdinals.Cast<string>() .Select(s => Int32.Parse(s)).Where(i => !_gisIDColumnOrdinals.Contains(i) && !_incidMMPolygonsTable.Columns[i].ColumnName.StartsWith("shape_")).ToList(); foreach (SelectionItem<string> si in _historyColumns) si.IsSelected = historyColumnOrdinals.Contains( _incidMMPolygonsTable.Columns[UnescapeAccessKey(si.Item)].Ordinal); //--------------------------------------------------------------------- // FIX: 010 Don't clear the map path when cancelling option updates // Store the map path so that it can be reset if the user // cancels updates to the options. _bakMapPath = _mapPath; //--------------------------------------------------------------------- }