コード例 #1
0
        /// <summary>
        /// Perform a restore using provided docking manager.
        /// </summary>
        /// <param name="dm">Reference to source.</param>
        public override void PerformRestore(DockingManager dm)
        {
            // Create collection of Contents to auto hide
            ContentCollection cc = new ContentCollection();

            // In this case, there is only one
            cc.Add(Content);

            // Add to appropriate AutoHidePanel based on _state
            dm.AutoHideContents(cc, State, null);
        }
コード例 #2
0
        /// <summary>
        /// Return a new ContentCollection with same content references.
        /// </summary>
        /// <returns>New ContentCollection instance.</returns>
        public ContentCollection Copy()
        {
            ContentCollection clone = new ContentCollection();

            // Copy each reference across
            foreach (Content c in base.List)
            {
                clone.Add(c);
            }

            return(clone);
        }
コード例 #3
0
ファイル: ZoneHelper.cs プロジェクト: zhaoyin/officeOBA
        /// <summary>
        /// Find collection of content instances inside a Zone.
        /// </summary>
        /// <param name="z">Zone to use.</param>
        /// <returns>Collection of content.</returns>
        public static ContentCollection Contents(Zone z)
        {
            // Container for returned group of found Content objects
            ContentCollection cc = new ContentCollection();

            // Process each Window in the Zone
            foreach (Window w in z.Windows)
            {
                WindowContent wc = w as WindowContent;

                // Is the Zone a Content derived variation?
                if (wc != null)
                {
                    // Add each Content into the collection
                    foreach (Content c in wc.Contents)
                    {
                        cc.Add(c);
                    }
                }
            }

            return(cc);
        }