Esempio n. 1
0
        /// <inheritdoc />
        public void Load()
        {
            PreLoad?.Invoke(this, new LoadEventArgs(Assets));

            InternalLoad();

            PostLoad?.Invoke(this, new LoadEventArgs(Assets));
        }
Esempio n. 2
0
        public void OnLoad(object sender, RoutedEventArgs e)
        {
            this.Loaded -= OnLoad;

            PreLoad?.Invoke(this, EventArgs.Empty);

            UpdateGroup();
        }
Esempio n. 3
0
        /// <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));
        }
Esempio n. 4
0
        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);
                }
            }
        }
Esempio n. 5
0
        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));
            }
        }
Esempio n. 6
0
        /// <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));
        }
Esempio n. 7
0
 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();
 }
Esempio n. 8
0
        /// <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));
        }
Esempio n. 9
0
 protected virtual void OnPreLoad() => PreLoad?.Invoke(this, EventArgs.Empty);