Exemplo n.º 1
0
		public RestoreZoneAffinity(Restore child, 
								   Content content, 
								   StringCollection best,
								   StringCollection next,
								   StringCollection previous)
			: base(child, content)
		{
			// Remember parameters
			_best = best;				
			_next = next;				
			_previous = previous;	
			
			if (content.Visible)			
				_space = content.ParentWindowContent.ZoneArea;
			else
				_space = 50m;
		}
Exemplo n.º 2
0
		public RestoreWindowContent(Restore child, 
									Content content, 
									StringCollection next, 
									StringCollection previous,
									bool selected)
			: base(child, content)
		{
			// Remember parameters
            _selected = selected;
            _next = next;
			_previous = previous;
		}
Exemplo n.º 3
0
		public RestoreContentDockingAffinity(Restore child, 
										     State state, 
											 Content content, 
											 StringCollection best,
											 StringCollection next,
											 StringCollection previous,
											 StringCollection nextAll,
											 StringCollection previousAll)
			: base(child, state, content)
		{
			// Remember parameters
			_best = best;
			_next = next;
			_previous = previous;
			_nextAll = nextAll;
			_previousAll = previousAll;
			_size = content.DisplaySize;
			_location = content.DisplayLocation;
		}
Exemplo n.º 4
0
		public RestoreContentFloatingAffinity(Restore child, 
										      State state, 
											  Content content, 
											  StringCollection best,
											  StringCollection associates)
			: base(child, state, content)
		{
			// Remember parameters
			_best = best;
			_associates = associates;
			_size = content.DisplaySize;
			_location = content.DisplayLocation;

			// Remove target from collection of friends
			if (_best.Contains(content.Title))
				_best.Remove(content.Title);

			// Remove target from collection of associates
			if (_associates.Contains(content.Title))
				_associates.Remove(content.Title);
		}
Exemplo n.º 5
0
 public RestoreAutoHideAffinity(Restore child, 
                                State state,
                                Content content, 
                                StringCollection next,
                                StringCollection previous,
                                StringCollection nextAll,
                                StringCollection previousAll)
 : base(child, state, content)
 {
     // Remember parameters
     _next = next;				
     _previous = previous;	
     _nextAll = nextAll;				
     _previousAll = previousAll;	
 }
Exemplo n.º 6
0
		public Restore(Restore child)
		{
			// Remember parameter
			_child = child;
		}
Exemplo n.º 7
0
		public Restore()
		{
			// Default state
			_child = null;
		}
Exemplo n.º 8
0
 public RestoreAutoHideState(Restore child, State state, Content content)
     : base(child, state, content)
 {
 }
Exemplo n.º 9
0
		public RestoreContent(Restore child, Content content)
			: base(child)
		{
			// Remember parameter
			_title = content.Title;
			_content = content;
		}
Exemplo n.º 10
0
		public RestoreContentState(Restore child, State state, Content content)
			: base(child, content)
		{
			// Remember parameter
			_state = state;
		}
Exemplo n.º 11
0
 public virtual Restore RecordRestore(Window w, object child, Restore childRestore)
 {
     return null;
 }
Exemplo n.º 12
0
		public override Restore RecordRestore(Window w, object child, Restore childRestore)
		{
			Content c = child as Content;

			// We currently only understand Windows that have Content as children
			if (c != null)
			{
				StringCollection best;
				StringCollection next;
				StringCollection previous;

				GetWindowContentFriends(w, out best, out next, out previous); 

				// Create a restore object that will find the correct WindowContent to 
				// place a Content in within a specified Zone, or it will create a new 
				// WindowContent in an appropriate relative ordering
				Restore zoneRestore = new RestoreZoneAffinity(childRestore, c, best, next, previous); 

				if (_state == State.Floating)
				{
					// Create a restore object to find the correct Floating Form to restore inside
					// or it will create a new Floating Form as appropriate
					return new RestoreContentFloatingAffinity(zoneRestore, _state, c, best, ZoneHelper.ContentNames(this));
				}
				else
				{
					StringCollection zoneBest;
					StringCollection zoneNext;
					StringCollection zonePrevious;
					StringCollection zoneNextAll;
					StringCollection zonePreviousAll;

					GetZoneContentFriends(c, out zoneBest, out zoneNext, out zonePrevious, 
														   out zoneNextAll, out zonePreviousAll); 

					// Create a restore object able to find the correct Zone in the appropriate 
					// docking direction and then restore into that Zone. If no appropriate Zone 
					// found then create a new one
					return new RestoreContentDockingAffinity(zoneRestore, _state, c, zoneBest, 
															 zoneNext, zonePrevious,
															 zoneNextAll, zonePreviousAll);
				}
			}

			return null;
		}
Exemplo n.º 13
0
		public Restore RecordFloatingRestore()
		{
			// Remove any existing Restore object
			_floatingRestore = null;

			// Do we have a parent window we are inside?
			if (_parentWindowContent != null)
			{
				// Ask the parent to provide a Restore object for us
				_floatingRestore = _parentWindowContent.RecordRestore(this);
			}

			// If we cannot get a valid Restore object from the parent then we have no choice 
			// but to use the default restore which is less accurate but better than nothing
			if (_floatingRestore == null)
				_floatingRestore = _defaultRestore;

			return _floatingRestore;
		}
Exemplo n.º 14
0
 public Restore RecordAutoHideRestore()
 {
     // Remove any existing restore object
     _autoHideRestore = null;
         
     // We should be inside a parent window
     if (_parentWindowContent != null)
     {
         // And in the auto hidden state
         if (_autoHidden)
         {
             // Get access to the AutoHostPanel that contains use
             AutoHidePanel ahp = _parentWindowContent.DockingManager.AutoHidePanelForContent(this);
             
             // Request the ahp create a relevant restore object for us
             _autoHideRestore = ahp.RestoreObjectForContent(this);
         }
     }
 
     return _autoHideRestore;
 }
Exemplo n.º 15
0
        protected void InternalConstruct(DockingManager manager, 
                                         Control control, 
                                         string title, 
                                         ImageList imageList, 
                                         int imageIndex)
        {
            // Must provide a valid manager instance
            if (manager == null)
                throw new ArgumentNullException("DockingManager");

            // Define the initial object state
            _control = control;
            _title = title;
            _imageList = imageList;
            _imageIndex = imageIndex;
            _manager = manager;
            _parentWindowContent = null;
            _order = _counter++;
            _visible = false;
            _displaySize = new Size(_defaultDisplaySize, _defaultDisplaySize);
            _autoHideSize = new Size(_defaultAutoHideSize, _defaultAutoHideSize);
            _floatingSize = new Size(_defaultFloatingSize, _defaultFloatingSize);
            _displayLocation = new Point(_defaultLocation, _defaultLocation);
			_defaultRestore = new RestoreContentState(State.DockLeft, this);
			_floatingRestore = new RestoreContentState(State.Floating, this);
            _autoHideRestore = new RestoreAutoHideState(State.DockLeft, this);
            _dockingRestore = _defaultRestore;
            _autoHidePanel = null;
			_docked = true;
            _captionBar = true;
            _closeButton = true;
            _hideButton = true;
            _autoHidden = false;
            _fullTitle = title;
        }