public void Initialize(IUIHelper uiHelper) { UIHelper = uiHelper; TaskProperties = new TTaskProperties(); TaskProperties.SetTaskControl(TaskControl); this.Text = string.Format(Resources.EditorFor, UIHelper.TaskHost.Name); }
public bool MakeTurn(string name, string value, ITicTacToe platform = null, IUIHelper uIHelper = null) { this.platform = platform; this.uIHelper = uIHelper; if (Turn) { uIHelper?.ChangeButtonText(name, "X"); ArrayHelper.PutValuesInMap(Map, name, MapValues.X); //uIHelper?.ChangeTurnLabel(MapValues.O); (int, int)aiMove = AI.GetAIMove(Map); var aiButton = ArrayHelper.GetButtonNameFromIntTuple(aiMove); uIHelper?.ChangeButtonText(aiButton, "O"); ArrayHelper.PutValuesInMap(Map, aiButton, MapValues.O); uIHelper?.DisableButton(aiButton); } else { uIHelper?.ChangeButtonText(name, "O"); ArrayHelper.PutValuesInMap(Map, name, MapValues.O); uIHelper?.ChangeTurnLabel(MapValues.X); } uIHelper?.DisableButton(name); //Turn = !Turn; TurnCount++; CheckForWinner(); if (TurnCount == 9) { platform?.ShowDrow(); } return(winState); }
/// <summary> /// Creates the search results control view model. /// </summary> public SearchResultsControlViewModel(IUIHelper uiHelper) { this.uiHelper = uiHelper; this.searchResults = new ObservableCollection <SearchRouteResultViewModel>(); this.searchResults.CollectionChanged += OnSearchResultsCollectionChanged; this.IsLoadingRoutes = true; }
internal void InitializeForm(IUIHelper uiHelper, List <int> inputColumnsLineages) { var inputCols = uiHelper.GetFormInputColumns(); try { initializing = true; clbInputColumns.SuspendLayout(); clbInputColumns.Items.Clear(); lbSelectedItems.SuspendLayout(); lbSelectedItems.Items.Clear(); if (clbInputColumns != null) { inputCols.ForEach(ic => clbInputColumns.Items.Add(ic, inputColumnsLineages.Contains(ic.LineageID))); } foreach (int lineage in inputColumnsLineages) { var inputCol = inputCols.Find(fic => fic.LineageID == lineage); if (inputCol != null) { lbSelectedItems.Items.Add(inputCol); } } } finally { initializing = false; clbInputColumns.ResumeLayout(); lbSelectedItems.ResumeLayout(); } }
internal override void OnInitialization() { base.OnInitialization(); _helper = Helper as IUIHelper; _helper.OnInitialization(DefineUINames, DefineUIEntitys); }
/// <summary> /// Initialize business content. /// This method can be called more than once /// </summary> void Init() { this.Status = this.Parent.Status; this._uiHelper = this.Locator.GetService <IUIHelper>(); this._log = this.Locator.GetService <ILog>(); //this.CurrentActions.Add(new ActionStatusVModel("Test 1") { MaxIndex = 100, CurrentIndex = 12 }); //this.CurrentActions.Add(new ActionStatusVModel("Test 2") { MaxIndex = 100, CurrentIndex = 52 }); }
static void DisplayHeader(IUIHelper uiHelper) { uiHelper.WriteLine("*************************"); uiHelper.WriteLine("*** Minesweaper ***"); uiHelper.WriteLine("*************************"); uiHelper.WriteLine("*** Chris Templeton ***"); uiHelper.WriteLine("*************************"); }
protected override void OnRuntimeEnable() { base.OnRuntimeEnable(); _UIHelper = Target.GetType().GetField("_helper", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(Target) as IUIHelper; _overlayUIs = _UIHelper.GetType().GetField("_overlayUIs", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_UIHelper) as Dictionary <Type, UILogicBase>; _cameraUIs = _UIHelper.GetType().GetField("_cameraUIs", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(_UIHelper) as Dictionary <Type, UILogicBase>; }
public static void GetData(ITicTacToe platform, IUIHelper uIHelper = null) { using (DataContext db = new DataContext(connectionString)) { GetMap(db, platform, uIHelper); GetTurns(db, platform); GetWinnersCount(db, platform); } }
public Minesweaper(int boardSizeX, int boardSizeY, Difficulty diff, IUIHelper uiHelper) { this.uiHelper = uiHelper; board = new Board(boardSizeX, boardSizeY, diff); guesses = new List <string>(); boardWriter = new CLIBoardWriter(board, guesses); hasHitMine = false; }
/// <summary> /// Creates the search results page view model. /// </summary> public SearchResultsPageControlViewModel(IUIHelper uiHelper) { this.HeaderViewModel.SubText = "SEARCH RESULTS"; this.SearchResultsControlViewModel = new SearchResultsControlViewModel(uiHelper); this.SearchResultsControlViewModel.RouteSelected += OnSearchResultsControlViewModelRouteSelected; this.SearchResultsControlViewModel.LocationSelected += OnSearchResultsControlViewModelLocationSelected; this.MapControlViewModel.RefreshBusStopsOnMapViewChanged = false; }
public MapControl() { this.InitializeComponent(); this.userLocationIcon = new UserLocationIcon(); // Setting MapCenter to null will center the map to Puget Sound and set the default Zoom level. this.MapCenter = null; map.ViewChangeEnded += OnMapViewChangeEnded; this.uiHelper = new DefaultUIHelper(this.Dispatcher); }
static void InitLocator(ServiceLocator locator) { //LogVModel log = new LogVModel(); WinLog log = new WinLog(AppContext.Current.ApplicationTitle); //LogVModel log = new LogVModel(); locator.RegisterInstance <Ops.NetCoe.LightFrame.ILog>(log); //locator.RegisterInstance<LogVModel>(log); AppContext.Current.LogTrace("Init locator"); locator.RegisterType <IWebProxy>(() => { IWebProxy proxy = WebRequest.GetSystemWebProxy(); return(proxy); }); locator.RegisterSingleton <Ops.NetCoe.LightFrame.IServiceLocator>(() => locator); //locator.RegisterInstance<VideoHelper>(new VideoHelper()); //ViewFactory vFactory = new ViewFactory(); //vFactory.Register<ImageProjectVModel, ImageProjectView>(); //vFactory.Register<VideoProjectVModel, VideoProjectView>(); //vFactory.Register<PropElementListVModel, PropElementListView>(); //vFactory.Register<TrackGroupVModel, TrackGroupView>(); //vFactory.Register<MediaSplitVModel, MediaSplitView>(); //vFactory.Register<TextRqtVModel, TextRqtView>(); ////locator.RegisterInstance<LogVModel>(log); //locator.RegisterInstance<ViewFactory>(vFactory); //var uiBus = new UIBus(); //locator.RegisterInstance<UIBus>(uiBus); IUIHelper uhlp = App.Current as IUIHelper; if (uhlp == null) { string em = "Initialization failure: Class App does not implement IUIHelper interface"; AppContext.Current.LogTechError(em, null); throw new TechnicalException(em); } locator.RegisterInstance <IUIHelper>(uhlp); //locator.RegisterInstance<ICrypto>(new Crypto()); //locator.RegisterType<IisWebsiteVModel, IisWebsiteVModel>(); //locator.RegisterType<DeploymentTaskVModel, DeploymentTaskVModel>(); //ServiceEndpointPrefix = AppContext.Current.GetAppCfgItem("ServicePrefix"); //if (ServiceEndpointPrefix == null) { // ServiceEndpointPrefix = "Default"; // AppContext.Current.LogWarning("Configuration error: value appSettings\\@ServicePrefix is not specified. Will fall back to 'Default'."); //} // Create Main VModel at the end so it can use previos declarations //MainVModel mvm = new MainVModel(); //locator.RegisterInstance<MainVModel>(mvm); }
public static void GetData(ITicTacToe platform, IUIHelper uIHelper = null) { switch (setting) { case Settings.DataBase: DataBaseSaver.GetData(platform, uIHelper); break; case Settings.JSON: JSONSaver.GetData(); break; } ; }
public MapControl() { this.InitializeComponent(); this.userLocationIcon = new UserLocationIcon(); // Setting MapCenter to null will center the map to Puget Sound and set the default Zoom level. this.MapCenter = null; map.ViewChangeEnded += OnMapViewChangeEnded; this.uiHelper = new DefaultUIHelper(this.Dispatcher); this.hasShownOhMyDialog = ApplicationData.Current.LocalSettings.Values.ContainsKey(UtilitiesConstants.OH_MY_KEY); }
public CorreiosProgram(IUIHelper uIHelper, ILogger logger, ILerAquivoTrecho lerAquivoTrecho, ILerArquivoEncomendas lerArquivoEncomendas, IEscreverArquivoRotas escreverArquivoRotas, IProcessarRota processarRota , string pathTrechos, string pathEncomendas, string pathRotas) { _uIHelper = uIHelper; _logger = logger; _lerAquivoTrecho = lerAquivoTrecho; _lerArquivoEncomendas = lerArquivoEncomendas; _escreverArquivoRotas = escreverArquivoRotas; _processarRota = processarRota; _pathTrechos = pathTrechos; _pathEncomendas = pathEncomendas; _pathRotas = pathRotas; }
public MapControl() { this.InitializeComponent(); this.busStopLayer = new MapLayer(); this.userLocationLayer = new MapLayer(); this.map.Layers.Add(this.userLocationLayer); this.map.Layers.Add(this.busStopLayer); // Setting MapCenter to null will center the map to Puget Sound and set the default Zoom level. this.MapCenter = null; this.map.ViewChanged += OnMapViewChangeEnded; this.map.CenterChanged += OnMapCenterChanged; this.uiHelper = new DefaultUIHelper(); this.updateViewTask = Task.FromResult <object>(null); this.cancellationTokenSource = new CancellationTokenSource(); }
protected override void OnRuntimeEnable() { base.OnRuntimeEnable(); _UIHelper = _helper as IUIHelper; }
public void InitializeUIForm(IUIHelper uiHelper) { this.UIHelper = uiHelper; this.Text = string.Format(Resources.EditorFor, UIHelper.ComponentMetadata.Name); }
public CustomGameMenu(IUIHelper uiHelper) : base(uiHelper) { xSize = 10; ySize = 10; diff = Difficulty.Medium; }
internal override void OnInitialization() { base.OnInitialization(); _helper = Helper as IUIHelper; }
public UIHelperService(ILdapServerConnection connection) { helper = new UIHelper(connection); }
/// <summary> /// Creates the search results control view model. /// </summary> public SearchResultsControlViewModel(IUIHelper uiHelper) { this.uiHelper = uiHelper; this.searchResults = new ObservableCollection<SearchRouteResultViewModel>(); this.searchResults.CollectionChanged += OnSearchResultsCollectionChanged; this.IsLoadingRoutes = true; }
public DifficultyMenu(IUIHelper uiHelper) : base(uiHelper) { }
public void Initialize(IUIHelper uiHelper) { UIHelper = uiHelper; }
/// <summary> /// Adds new output column to TreeView /// </summary> /// <param name="trvOutputColumns">TreeView to which the OutputColumn should be created</param> /// <param name="creator">UiOutputColumnCreator to be used for new OutputColumn creaton</param> /// <param name="propertyChangedHandler">PropertyChange EventHandler to be associated with the newly created FormInputColumn</param> public virtual void AddUIOutputColumn(TreeView trvOutputColumns, NewUiOutputColumnCreator creator, IUIHelper uiHelper, PropertyChangedEventHandler o_PropertyChanged) { TreeNode node = trvOutputColumns.SelectedNode; if (node != null) { if (node.Tag is FormOutputColumn) { node = node.Parent; } FormOutput o = node.Tag as FormOutput; FormOutputColumn col = creator(o.DTSOutput, uiHelper); col.UIHelper = this; col.PropertyChanged += o_PropertyChanged; TreeNode cn = new TreeNode(col.Name); cn.Name = col.Guid.ToString(); cn.Tag = col; col.AssociatedTreeNode = cn; node.Nodes.Add(cn); trvOutputColumns.SelectedNode = cn; cn.EnsureVisible(); } }
public Menu(IUIHelper uiHelper) { this.uiHelper = uiHelper; isRunning = true; }