//------------------------------------------------------
        //
        //  Internal Methods
        //
        //------------------------------------------------------
        #region Internal Methods
        internal WindowCollection Clone()
        {
            WindowCollection clone;

            lock (_list.SyncRoot)
            {
                clone = new WindowCollection(_list.Count);
                for (int i = 0; i < _list.Count; i++)
                {
                    clone._list.Add(_list[i]);
                }
            }
            return(clone);
        }
        // Token: 0x06000E46 RID: 3654 RVA: 0x00036B48 File Offset: 0x00034D48
        internal WindowCollection Clone()
        {
            object           syncRoot = this._list.SyncRoot;
            WindowCollection windowCollection;

            lock (syncRoot)
            {
                windowCollection = new WindowCollection(this._list.Count);
                for (int i = 0; i < this._list.Count; i++)
                {
                    windowCollection._list.Add(this._list[i]);
                }
            }
            return(windowCollection);
        }
示例#3
0
        private void InvalidateResourceReferenceOnWindowCollection(WindowCollection wc, ResourcesChangeInfo info)
        {
            bool hasImplicitStyles  = info.IsResourceAddOperation && HasImplicitStylesInResources;

            for (int i = 0; i < wc.Count; i++)
            {
                // calling thread is the same as the wc[i] thread so synchronously invalidate
                // resouces, else, post a dispatcher workitem to invalidate resources.
                if (wc[i].CheckAccess() == true)
                {
                    // Set the ShouldLookupImplicitStyles flag on the App's windows
                    // to true if App.Resources has implicit styles.

                    if (hasImplicitStyles)
                        wc[i].ShouldLookupImplicitStyles = true;

                    TreeWalkHelper.InvalidateOnResourcesChange(wc[i], null, info);
                }
                else
                {
                    wc[i].Dispatcher.BeginInvoke(
                        DispatcherPriority.Send,
                        (DispatcherOperationCallback) delegate(object obj)
                        {
                            object[] args = obj as object[];

                            // Set the ShouldLookupImplicitStyles flag on the App's windows
                            // to true if App.Resources has implicit styles.

                            if (hasImplicitStyles)
                                ((FrameworkElement)args[0]).ShouldLookupImplicitStyles = true;

                            TreeWalkHelper.InvalidateOnResourcesChange((FrameworkElement)args[0], null, (ResourcesChangeInfo)args[1]);
                            return null;
                        },
                        new object[] {wc[i], info}
                        );
                }
            }
        }
 //------------------------------------------------------
 //
 //  Internal Methods
 //
 //------------------------------------------------------
 #region Internal Methods
 internal WindowCollection Clone()
 {
     WindowCollection clone;
     lock (_list.SyncRoot)
     {
         clone = new WindowCollection(_list.Count);
         for (int i = 0; i < _list.Count; i++)
         {
             clone._list.Add(_list[i]);
         }
     }
     return clone;
 }
示例#5
0
        static private INavigatorBase FindTargetInWindowCollection(WindowCollection wc, string targetName)
        {
            INavigatorBase navigator = null;
            NavigationWindow nw = null;

            for (int i = 0; i < wc.Count; i++)
            {
                nw = wc[i] as NavigationWindow;

                if (nw != null)
                {
                    // if we're on the same thread as that of nw then we can simple try to
                    // find target in nw, else we need to find target on the nw's thread.
                    // We do that below by using nw.Dispatcher.Invoke
                    if (nw.CheckAccess() == true)
                    {
                        navigator = FindTargetInNavigationWindow(nw, targetName);
                    }
                    else
                    {
                        navigator = (INavigator)nw.Dispatcher.Invoke(
                            DispatcherPriority.Send,
                            (DispatcherOperationCallback)delegate(object unused)
                            {
                                return FindTargetInNavigationWindow(nw, targetName);
                            },
                            null
                        );
                    }

                    if (navigator != null)
                    {
                        return navigator;
                    }
                }
            }
            return null;
        }