/// <summary>
        /// Will initialize given the components.
        /// </summary>
        private void InitializeComponents(IEnumerable <IInitializable> components)
        {
            try
            {
                foreach (var component in components.ToList())
                {
                    var buffer = component;

                    if (InitializingComponent != null)
                    {
                        ThreadContext.BeginInvoke(() => InitializingComponent(this, buffer));
                    }

                    component.Initialize();
                }

                ThreadContext.BeginInvoke(RaiseCompleted);
            }
            catch (Exception)
            {
                //TODO: error handling
                throw;
            }
        }
Ejemplo n.º 2
0
 ///
 public void Invoke(Action action)
 {
     ThreadContext.BeginInvoke(action);
 }