Exemplo n.º 1
0
 private void BaseForm_Load(object sender, EventArgs e)
 {
     ResizeForm();
     ResetTitulo();
     ChecaPermissao();
     AfterLoad?.Invoke(this, e);
 }
Exemplo n.º 2
0
 public void invoke_AfterLoad(object sender, EventArgs args)
 {
     if (AfterLoad != null)
     {
         AfterLoad.Invoke(sender, args);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes Load process
 /// </summary>
 public void Load()
 {
     BeforeLoad?.Invoke();
     currentData = Serializer.DeserializeData(fileName, folderName);
     Debug.Log(debugPrefix + "Loaded " + currentData.Count + " entries from " + Path.Combine(Application.persistentDataPath, folderName) + " from " + fileName);
     AfterLoad?.Invoke();
 }
Exemplo n.º 4
0
        public void Load()
        {
            if (IsLoaded)
            {
                if (!_managedDomain)
                {
                    throw new InvalidOperationException("This shim is attached to an app domain it does not manage.  Call Unload to detach the shim before calling Load");
                }
                Unload();
            }

            _managedDomain = true;
            AppDomainSetup ads = new AppDomainSetup();

            //FIXME: ApplicationBase must include the referring assembly for _domain.AssemblyResolve to work,
            // but must be pointed at the referred assembly to load dependencies...I think this is ok. -- JR 03/21/17
            ads.ApplicationBase          = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); // AppDomain.CurrentDomain.BaseDirectory;
            ads.DisallowBindingRedirects = false;
            ads.DisallowCodeDownload     = true;
            ads.ConfigurationFile        = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
            ads.ShadowCopyFiles          = "true";

            Evidence securityInfo = new Evidence();

            _domain = AppDomain.CreateDomain(_domainName, securityInfo, ads);
            _domain.AssemblyResolve += AssemblyResolver;

            AfterLoad?.Invoke(this);
        }
Exemplo n.º 5
0
 private void BackgroundWorkerOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     if (e.Result != null)
     {
         if (e.Error != null)
         {
             _logText.AppendText(e.Error.Message + "\n" + e.Error.StackTrace);
             _statusLabel.Text      = "ERROR!";
             _statusLabel.ForeColor = Color.Red;
         }
         else
         {
             AfterLoad?.Invoke(this, new EventArgs <World>(e.Result as World));
         }
     }
     else
     {
         _logText.AppendText("Repair of corrupt XML cancelled!");
         _statusLabel.Text      = "ERROR!";
         _statusLabel.ForeColor = Color.Red;
     }
     foreach (string delete in _extractedFiles)
     {
         File.Delete(delete);
     }
     _extractedFiles.Clear();
 }
Exemplo n.º 6
0
 public void Attach(AppDomain domain)
 {
     _domain                  = domain;
     _managedDomain           = false;
     _domain.AssemblyResolve += AssemblyResolver;
     AfterLoad?.Invoke(this);
 }
Exemplo n.º 7
0
 static void Init()
 {
     m_DataManager   = new MyPlayerPrefsDataManager <string[]>("troll", "face");
     m_EventsManager = new MyPlayerPrefsApplicationEventsManager();
     m_EventsManager.OnFocusEvent += OnFocus;
     m_EventsManager.OnPauseEvent += OnPause;
     m_EventsManager.OnQuitEvent  += OnQuit;
     AfterLoad?.Invoke();
 }
Exemplo n.º 8
0
        /// <summary>
        /// Loads the highest priority extension for the given key.
        /// </summary>
        /// <typeparam name="TExtensionType">The extension type to load.</typeparam>
        /// <param name="key">The named key of the descendant of ExtensionAttribute you wish to load.</param>
        /// <param name="args">Arguments to be passed to the extended type's constructor.</param>
        /// <returns>A instance of an extension type's subclass.</returns>
        public TExtensionType Load <TExtensionType>(String key, params Object[] args)
            where TExtensionType : class
        {
            var record = EnsureArgTypes <TExtensionType>(args);

            var ctor = FindConstructor <TExtensionType>(key);
            var obj  = (TExtensionType)ctor.Invoke(args);

            AfterLoad?.Invoke(record, obj);

            return(obj);
        }
Exemplo n.º 9
0
 /// <summary>
 /// Copies data from other serializer if it loaded data (executes load if not)
 /// </summary>
 /// <param name="source"></param>
 public void CopyLoadedDataFrom(SaveData source)
 {
     BeforeLoad?.Invoke();
     if (source.currentData == null)
     {
         source.Load();
     }
     currentData = new Dictionary <string, object>(source.currentData);
     folderName  = source.folderName;
     fileName    = source.fileName;
     AfterLoad?.Invoke();
     Debug.Log(debugPrefix + "Copied " + currentData.Count + " entries from " + source.name);
 }
Exemplo n.º 10
0
 public R <PlayResource, LocalStr> Load(AudioResource resource)
 {
     try {
         if (ShouldFailLoad)
         {
             return(new LocalStr(LoadFailedMessage));
         }
         return(new PlayResource(MakeResourceURI(resource.ResourceId, LoadedResources), resource));
     } finally {
         LoadedResources++;
         AfterLoad?.Invoke(this, EventArgs.Empty);
     }
 }
Exemplo n.º 11
0
        public IReadOnlyDictionary <String, TExtensionType> LoadAll <TExtensionType>(params Object[] args)
            where TExtensionType : class
        {
            var record = EnsureArgTypes <TExtensionType>(args);

            var ctors = FindAllConstructors <TExtensionType>();

            return(ctors.ToDictionary(kvp => kvp.Key, kvp =>
            {
                var obj = (TExtensionType)kvp.Value.Invoke(args);
                AfterLoad?.Invoke(record, obj);
                return obj;
            }));
        }
Exemplo n.º 12
0
        /// <summary>
        /// Lazily loads all extensions for the given key.
        /// </summary>
        /// <typeparam name="TExtensionType">The extension type to load.</typeparam>
        /// <param name="key">The named key of the descendant of ExtensionAttribute you wish to load.</param>
        /// <param name="args">Arguments to be passed to the extended type's constructor.</param>
        /// <returns>A lazy enumerable of instances of the specified type/key's extensions.</returns>
        public IEnumerable <TExtensionType> DeepLoad <TExtensionType>(String key, params Object[] args)
            where TExtensionType : class
        {
            var record = EnsureArgTypes <TExtensionType>(args);

            var ctors = DeepFindConstructor <TExtensionType>(key);

            return(ctors.Select(ctor =>
            {
                var obj = (TExtensionType)ctor.Invoke(args);
                AfterLoad?.Invoke(record, obj);
                return obj;
            }));
        }
Exemplo n.º 13
0
 /// <summary>
 /// Raises the <see cref="AfterLoad" /> event.
 /// </summary>
 /// <param name="args">The <see cref="LoadStateEventArgs"/> instance containing the event data.</param>
 protected virtual void OnAfterLoad(LoadStateEventArgs args) => AfterLoad?.Invoke(this, args);
Exemplo n.º 14
0
 protected virtual void OnAfterLoad()
 {
     AfterLoad?.Invoke();
 }