/// <inheritdoc /> public void Load() { PreLoad?.Invoke(this, new LoadEventArgs(Assets)); InternalLoad(); PostLoad?.Invoke(this, new LoadEventArgs(Assets)); }
public void OnLoad(object sender, RoutedEventArgs e) { this.Loaded -= OnLoad; PreLoad?.Invoke(this, EventArgs.Empty); UpdateGroup(); }
/// <inheritdoc /> public void Load() { PreLoad?.Invoke(this, new LoadEventArgs(this.Assets)); foreach (Cursor mouseCursor in Cursor.All) { mouseCursor.Load(Assets); } PostLoad?.Invoke(this, new LoadEventArgs(this.Assets)); }
public static void Load(Assembly assembly, AppDomain appDomain = null) { if (libs.ContainsKey(assembly)) { return; } var attrData = assembly.CustomAttributes .FirstOrDefault(a => a.AttributeType == typeof(InitLoaderAttribute)); if (attrData != null) { var p1 = attrData.ConstructorArguments[0]; var initLoaderAtt = (InitLoaderAttribute)Activator.CreateInstance( typeof(InitLoaderAttribute), p1.Value); object t; if (appDomain is null) { t = Activator.CreateInstance(initLoaderAtt.InitType); } else { throw new NotImplementedException(); //t = appDomain.CreateInstanceAndUnwrap( // assembly.FullName, // initLoaderAtt.InitType.FullName); } if (t is LibInitializer init) { LibInfo libInfo = new LibInfo(appDomain, assembly, init); if (!(appDomain is null)) { domainLibs.Add(appDomain, libInfo); } libs.Add(assembly, libInfo); libInfo.Registers.ItemRegistered += Registers_MethodRegistered; PreLoad?.Invoke(libInfo); if (init is PlatformInitializer platformInitializer) { var platform = (PlatformRegister)Activator.CreateInstance(platformInitializer.PlatformType); platformInitializer.Platform = platform; libInfo.Registers.RegisterPlatform(platform); } init.Initialize(libInfo.Registers); OnLoad?.Invoke(libInfo); } } }
public virtual void OnLoad(object sender, RoutedEventArgs e) { this.Loaded -= OnLoad; PreLoad?.Invoke(this, EventArgs.Empty); if (DesignerProperties.GetIsInDesignMode(this)) { return; } if (this.Type == null) { throw new InvalidOperationException("Type property is not set for control {0}".FormatWith(LabelText)); } }
/// <inheritdoc /> public void Load() { PreLoad?.Invoke(this, new LoadEventArgs(Assets)); foreach (Dialog dialog in Dialogs) { dialog.Load(); } foreach (Window window in Windows) { window.Load(); } Mouse.Load(); PostLoad?.Invoke(this, new LoadEventArgs(Assets)); }
static void Load(SaveFile saveFile) { Migrations.Migrate(saveFile); PreLoad?.Invoke(); GameTime.save = saveFile.gameTime; CurrencySystem.instance.save = saveFile.currency; ConveyorSystem.instance.save = saveFile.conveyor; MachineSystem.instance.save = saveFile.machine; TileSelectionManager.instance.save = saveFile.tileSelection; OverviewCameraController.instance.save = saveFile.overviewCameraController; Analytics.instance.save = saveFile.analytics; BackgroundMusic.instance.SetSave(in saveFile.backgroundMusic); InterfaceSelectionManager.instance.SetSave(in saveFile.interfaceSelection); MachineGroupAchievements.instance.SetSave(in saveFile.machineGroupAchievements); MachineUnlockSystem.instance.SetSave(in saveFile.machineUnlocks); ProgressionStore.instance.SetSave(in saveFile.progressionSystem); SpacePlatform.SetSave(in saveFile.spacePlatforms); PostLoad?.Invoke(); LoadComplete?.Invoke(); }
/// <inheritdoc /> public void Load() { PreLoad?.Invoke(this, new LoadEventArgs(Assets)); this.background = this.Assets.CreateTexture2D(1, 1); background.SetData(new[] { Background }); InternalLoad(); if (!isWidthSet) { Width = DefaultWidth; } if (!isHeightSet) { Height = DefaultHeight; } this.IsLoaded = true; PostLoad?.Invoke(this, new LoadEventArgs(Assets)); }
protected virtual void OnPreLoad() => PreLoad?.Invoke(this, EventArgs.Empty);