Exemplo n.º 1
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                foreach (object o in m_items.Values)
                {
                    IDisposable disposable = o as IDisposable;
                    if (disposable != null)
                    {
                        disposable.Dispose();
                    }
                }

                m_items.Clear();
                m_items   = null;
                g_context = null;
            }
        }
Exemplo n.º 2
0
        public override bool DoWork(Func2 <bool> shutdownCallback)
        {
            using (WorkItemContext context = WorkItemContext.Current)
            {
                IWorkItem workItem;

                try
                {
                    workItem = DependencyResolver.Resolve <IWorkItem>(m_workItemName);
                }
                catch (NullReferenceException)
                {
                    /* Container has been reloaded */
                    return(false);
                }

                return(workItem.DoWork(shutdownCallback) && !shutdownCallback());
            }
        }