public virtual void OnLoad() { if (Loaded != null) { Loaded.Invoke(); } }
protected override void OnElementPropertyChanged(PropertyChangedEventArgs args) { base.OnElementPropertyChanged(args); /* * Console.WriteLine("Container: " + this.Container); * Console.WriteLine("Control: " + this.Control); * Console.WriteLine("Element: " + this.Element); */ //Console.WriteLine("OnElementPropertyChanged set LoadedControl to " + LoadedControl + " from Control " + Control + " Element: " + Element); /* special implementation neccessary beacuse the native Control is not being ready at start/in mainpage contructor */ if (Control != null && LoadedControl == null) { LoadedControl = Control; // Console.WriteLine("OnElementPropertyChanged set LoadedControl to " + LoadedControl + " from Control " + Control); Loaded.Invoke(); } // handling case with Xamarin.Forms.Layout // https://forums.xamarin.com/discussion/comment/386827#Comment_386827 if (Container != null && LoadedControl == null) { LoadedControl = Container; // Console.WriteLine("OnElementPropertyChanged set LoadedControl to " + LoadedControl + " from Container " + Container); Loaded.Invoke(); } // no page equivalent in native }
/// <summary> /// Raises event 'Loaded' /// </summary> protected virtual void OnLoaded() { if (Loaded != null) { Loaded.Invoke(this, System.EventArgs.Empty); } }
void Settings_SettingsLoaded(object sender, System.Configuration.SettingsLoadedEventArgs e) { if (Loaded != null) { Loaded.Invoke(Assembly.GetExecutingAssembly(), this); } }
public async Task LoadAsync() { var wordpressUrl = configuration.GetServiceUri("app"); blogInfo = await http.GetFromJsonAsync <BlogInfoModel>($"{wordpressUrl}/wp-json/wp/v2/bloginfo"); Loaded?.Invoke(this, EventArgs.Empty); }
private async void ViewBase_Loaded(object sender, RoutedEventArgs e) { if (_isLeaving == false) { Loaded?.Invoke(sender, e); await PlayEnterAnimationAsync(); } }
/// <summary> /// Loads this instance. /// </summary> public void Load() { _log.Info($"{Resources.Loading} {Resources.Options}"); _manager.Load(); SelectedCulture = Core.Properties.Settings.Default.StartUpCulture; IsLoaded = true; Loaded?.Invoke(this, new LoadedEventEventArgs()); }
/// <summary> /// Initializes the command /// </summary> /// <param name="connectionInfo">Some information about the connection</param> public void Initialize(ConnectionInfo connectionInfo) { ConnectionInfo = connectionInfo; if (Loaded != null) { Loaded.Invoke(this, EventArgs.Empty); } }
/// <summary> /// Called when the fragment is resumed. /// </summary> public override void OnResume() { base.OnResume(); Loaded?.Invoke(this); InitializeBindingContext(); }
public async Task InitializeHospital() { Patients.Clear(); (await PatientDataSource.GetPatientsAsync()).ForEach(p => Patients.Add(new PatientViewModel(p))); Loaded?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Загрузка данных из указанного файла /// </summary> /// <param name="fileName">Имя файла</param> /// <returns>True если загрузка произошла успешно</returns> public bool LoadFromFile(string fileName) { bool result = LoadSessionData(fileName); ActiveSession.Info.IsLoaded = true; Loaded?.Invoke(null, EventArgs.Empty); return(result); }
private void ObjectExplorerForm_VisibleChanged(object sender, EventArgs e) { if (!_isLoaded) { Loaded?.Invoke(sender, e); _isLoaded = true; } }
private static void OnLoaded(Image sender) { #if WPF sender.RaiseEvent(new RoutedEventArgs(LoadedEvent, sender)); #elif WINRT || SILVERLIGHT Loaded?.Invoke(sender, EventArgs.Empty); #endif }
private void OnLoaded() { lock (_syncFire) { CanFire = true; } _uiDispatcher.Invoke(() => Loaded?.Invoke(this, new EventArgs())); }
//------------------------------------------------------------------------------- // Load or reload the settings from disk. public void Load() { if (File.Exists(SettingsFilePath)) { var options = new System.Text.Json.JsonSerializerOptions { // Allow JSON comments (even though they would be overwritten when // we save). // Basically, we want to be very permissive here. Strictness is only // annoying for the user. ReadCommentHandling = System.Text.Json.JsonCommentHandling.Skip, // Same with trailing commas and case insensitivity. AllowTrailingCommas = true, PropertyNameCaseInsensitive = false, }; try { string json; try { json = File.ReadAllText(SettingsFilePath); } catch (IOException) { // IO error (like they are still writing the file). Wait and try again. QueueLoad(1000); return; } this.fields = System.Text.Json.JsonSerializer.Deserialize <Fields>(json, options); } catch { // Serialization error. } // If we make it to here and it's null, this is the first time we're // running or something went wrong. if (this.fields == null) { this.fields = new Fields(); } // Sanitization here. Most is handled by JSON format parsing. if (this.fields.MarblesDoneToday < 0) { this.fields.MarblesDoneToday = 0; } } else { // Will use default values. this.fields = new Fields(); Save(); } Loaded?.Invoke(this); }
protected virtual void OnLoaded() { if (loaded) { throw new NotImplementedException("Called onload twice"); } loaded = true; Loaded?.Invoke(this, new EventArgs()); }
private void ViewBase_Loaded(object sender, RoutedEventArgs e) { if (_isLeaving == false) { Loaded?.Invoke(sender, e); var enterStoryboard = GetEnterStoryboard(); enterStoryboard?.Begin(); } }
public Settings() { this.SettingsLoaded += (object sender, System.Configuration.SettingsLoadedEventArgs e) => { if (Loaded != null) { Loaded.Invoke(Assembly.GetExecutingAssembly(), this); } }; }
public static void OnLoaded() { if (TZXTapeCounter >= TZXFile.TZXLength) { LoadComplete = true; } Loaded?.Invoke(); }
protected override void OnLoadEnd(CefBrowser browser, CefFrame frame, int httpStatusCode) { base.OnLoadEnd(browser, frame, httpStatusCode); if (frame.IsMain) { Loaded?.Invoke(this, EventArgs.Empty); } }
private void TimerElapsed(object sender, ElapsedEventArgs e) { ((System.Timers.Timer)sender).Dispose(); Invoke(new Action(() => { Hide(); Loaded?.Invoke(this); })); }
internal void Update(ulong accountHi, ulong accountLo, string battleTagName, int battleTagNumber) { AccountHi = accountHi; AccountLo = accountLo; BattleTagName = battleTagName; BattleTagNumber = battleTagNumber; Loaded?.Invoke(); IsLoaded = true; }
/// <summary> /// Загрузка данных /// </summary> /// <returns>True если загрузка произошла успешно</returns> public bool Load() { bool result = false; // имя файла с сессией string sessionFileNameToLoad = null; // проверка есть файл, с которым работали в последний раз if (File.Exists(Path.Combine(SESSIONS_FOLDER, "lastsession"))) { EmcosSiteWrapperApp.LogInfo("Обнаружен файл с именем файла последней сессии."); var lastusedfile = string.Empty; try { EmcosSiteWrapperApp.LogInfo("Попытка чтения имени файла последней сессии."); // чтение имени файла lastusedfile = File.ReadAllText(Path.Combine(SESSIONS_FOLDER, "lastsession")).Trim(); EmcosSiteWrapperApp.LogInfo("Имя файла последней сессии получено."); if (File.Exists(lastusedfile)) { sessionFileNameToLoad = lastusedfile; EmcosSiteWrapperApp.LogInfo("Файл последней сессии существует, попытаемся его загрузить."); } else { EmcosSiteWrapperApp.LogInfo("Указанный файл последней сессии не найден."); } } catch (System.IO.IOException ex) { EmcosSiteWrapperApp.LogInfo("Ошибка при чтении имени файла последней сессии."); _callBackAction(ex); } } else { if (String.IsNullOrWhiteSpace(BALANCE_SESSION_FILENAME) || File.Exists(Path.Combine(SESSIONS_FOLDER, BALANCE_SESSION_FILENAME + SESSION_FILE_EXTENSION)) == false) { EmcosSiteWrapperApp.LogInfo("Сессия не обнаружена."); return(false); } } // if (LoadSessionData(sessionFileNameToLoad)) { EmcosSiteWrapperApp.LogInfo("Сессия обнаружена и загружена."); ActiveSession.Info.IsLoaded = true; Loaded?.Invoke(null, EventArgs.Empty); result = true; } else { EmcosSiteWrapperApp.LogInfo(String.Format("Не удалось загрузить сессию. Файл [{0}].", sessionFileNameToLoad ?? BALANCE_SESSION_FILENAME + SESSION_FILE_EXTENSION)); } return(result); }
/// <summary> /// Load and index the given log files /// </summary> /// <param name="files">The files to index</param> /// <param name="progress">Action to report indexing progress</param> /// <param name="cancellationToken">CancellationToken for cancelling the index update</param> public void Load(string[] files, Action <double> progress, CancellationToken cancellationToken) { _source = files; for (var i = 0; i < _indexers.Length; i++) { _indexers[i].Initialize(); } Update(progress, cancellationToken); Loaded?.Invoke(this, EventArgs.Empty); }
/// <summary> /// Called when the view is loaded. /// </summary> public override void ViewDidAppear(bool animated) { base.ViewDidAppear(animated); RaiseViewModelChanged(); Loaded?.Invoke(this); InitializeBindingContext(); }
public async Task LoadContent(IContentLibrary contentLibrary) { await Task.WhenAll(new List <Task>(Effects.Select(x => x.LoadContent(contentLibrary, _lazyGraphicsDevice()))) { _spriteTargetA.LoadContent(contentLibrary), _spriteTargetB.LoadContent(contentLibrary) }); Loaded?.Invoke(this); }
/// <summary> /// Called when the view is loaded. /// </summary> protected override void OnResume() { base.OnResume(); RaiseViewModelChanged(); Loaded?.Invoke(this); InitializeBindingContext(); }
protected override void SceneInitialization(IContextState context, RenderEngine engine, ElementTag camera) { var smanager = Context.GetSystemManager(); smanager.CreateSystem <DefaultInputSystem>(); smanager.CreateSystem <ZoomToAllObjectsSystem>(); smanager.CreateSystem <MovingSystem>(); smanager.CreateSystem <CollidingSystem>(); smanager.CreateSystem <DefaultOrthographicCameraSystem>(); smanager.CreateSystem <LightsSystem>(); // smanager.CreateSystem<MovementSystem>(); // smanager.CreateSystem<EmptyAnimationSystem>(); // smanager.CreateSystem<MeshAnimationSystem>(); // smanager.CreateSystem<StickOnHeightMapSystem>(); // smanager.CreateSystem<ObjectMovementSystem>(); // smanager.CreateSystem<Systems.TerrainGeneratorSystem>(); // smanager.CreateSystem<Physics.Engine.PhysicalSystem>(); smanager .CreateSystem <RenderSystem>() .Init(engine.Graphics) // .CreateNested<SkyGradientColoringRenderTechnique>() // .CreateNested<SkyPlaneWithParallaxRenderTechnique>() // .CreateNested<TerrainRenderTechnique>()// //.CreateNested<Toolkit.D3D.CameraViews.CameraViewsRenderTechnique<CustomRenderProperties>>() //.CreateNested<OITTriangleColoredVertexRenderTechnique<ToolkitRenderProperties>>() .CreateNested <TriangleColoredVertexRenderTechnique <ToolkitRenderProperties> >() .CreateNested <TriangleTexturedVertexRenderTechnique <ToolkitRenderProperties> >() .CreateNested <LineVertexRenderTechnique <ToolkitRenderProperties> >() //.CreateNested<CudaTestTechniques<ToolkitRenderProperties>>() .CreateNested <SpherePointRenderTechnique <ToolkitRenderProperties> >() //.CreateNested<AminRenderTechniqueSystem>() ; //smanager // .CreateSystem<AminRenderSystem>() // .Init(device);Context var manager = Context.GetEntityManager(); cameraObject = CameraObject.UpdateOrthographic <RenderSystem>(camera, Context, Surface); LightObject.CreateAmbientLight(manager, 0.2f); //0.05f LightObject.CreateFollowCameraDirectLight(manager, System.Numerics.Vector3.UnitZ, 0.8f); //0.95f CoordinateSystem = CoordinateSystemLinesGameObject.Create(context, false); Loaded?.Invoke(); //VisualSphereObject.SphereGeo(Context, ElementTag.New($"Point"), new VisualSphereObject.Data { // Center = new Vector3(10, 20, 10), // Color = V4Colors.Yellow, // Radius = 10 //}); }
internal WindowSession Show() { var completion = new TaskCompletionSource <bool?>(); dispatcher.InvokeAsync(() => { try { if (closeRequested) { completion.SetResult(closeResult); return; } wpfWindow = new MaterialFormsWindow(this, Id); if (closeRequested) { completion.SetResult(closeResult); return; } wpfWindow.Loaded += (sender, args) => { lock (syncRoot) { if (closeRequested) { completion.SetResult(closeResult); wpfWindow.Close(); return; } IsLoaded = true; } Loaded?.Invoke(this, EventArgs.Empty); }; var result = wpfWindow.ShowDialog(); completion.SetResult(closeRequested ? closeResult : result); } catch (Exception ex) { completion.SetException(ex); } finally { IsClosed = true; wpfWindow = null; } }); task = completion.Task; return(this); }
internal void InvokeEvent_Loaded(object sender, RoutedEventArgs e) { if (IsLoaded) { return; } IsLoaded = true; Loaded?.Invoke(this, e); }