Ejemplo n.º 1
0
 internal void AfterQuerySettings()
 {
     managers.WriteLine("Calling afterquery-event on factories & managers", "HostContext");
     if (OnAfterQuerySettings != null)
     {
         OnAfterQuerySettings.Invoke(this, EventArgs.Empty);
     }
 }
Ejemplo n.º 2
0
        public ManagerBase2()
        {
            HostContext.Current.OnInitialize += delegate(object sender, EventArgs a)
            {
                try
                {
                    Initialize();
                }
                catch
                {
                }
                if (OnInitialize != null)
                {
                    try
                    {
                        OnInitialize.Invoke(this, EventArgs.Empty);
                    }
                    catch (Exception)
                    {
                    }
                }
            };

            HostContext.Current.OnBeforeQuerySettings += delegate(object sender, EventArgs a)
            {
                if (OnBeforeQuerySettings != null)
                {
                    try
                    {
                        OnBeforeQuerySettings.Invoke(this, EventArgs.Empty);
                    }
                    catch (Exception)
                    {
                    }
                }
                try
                {
                    QuerySettings();
                }
                catch (Exception)
                {
                }
            };

            HostContext.Current.OnAfterQuerySettings += delegate(object sender, EventArgs a)
            {
                if (OnAfterQuerySettings != null)
                {
                    try
                    {
                        OnAfterQuerySettings.Invoke(this, EventArgs.Empty);
                    }
                    catch (Exception)
                    {
                    }
                }
            };

            HostContext.Current.OnLoad += delegate(object sender, EventArgs a)
            {
                if (OnLoad != null)
                {
                    try
                    {
                        OnLoad.Invoke(this, EventArgs.Empty);
                    }
                    catch (Exception)
                    {
                    }
                }
                try
                {
                    Load();
                }
                catch (Exception)
                {
                }
            };

            HostContext.Current.OnLoad += delegate(object sender, EventArgs a)
            {
                try
                {
                    FinishedLoading();
                }
                catch (Exception)
                {
                }
                if (OnFinishedLoad != null)
                {
                    try
                    {
                        OnFinishedLoad.Invoke(this, EventArgs.Empty);
                    }
                    catch (Exception)
                    {
                    }
                }
            };
        }