Axiom.Samples.SdkTrayManager.MoveWidgetToTray C# (CSharp) Метод

MoveWidgetToTray() публичный Метод

Adds a widget to a specified tray.
public MoveWidgetToTray ( Widget widget, TrayLocation trayLoc, int place ) : void
widget Widget
trayLoc TrayLocation
place int
Результат void
		public void MoveWidgetToTray( Widget widget, TrayLocation trayLoc, int place )
		{
			if ( widget == null )
				throw new ArgumentNullException( "widget", "Widget deos not exist." );

			// remove widget from old tray
			WidgetList wList = mWidgets[ (int)widget.TrayLocation ];
			if ( wList == null )
			{
				wList = new WidgetList();
				mWidgets[ (int)widget.TrayLocation ] = wList;
			}

			if ( wList.Contains( widget ) )
			{
				wList.Remove( widget );
				mTrays[ (int)widget.TrayLocation ].RemoveChild( widget.Name );
			}

			// insert widget into new tray at given position, or at the end if unspecified or invalid
			if ( place == -1 || place > mWidgets[ (int)trayLoc ].Count )
				place = mWidgets[ (int)trayLoc ].Count;
			mWidgets[ (int)trayLoc ].Insert( place, widget );
			// mWidgets[ (int)trayLoc ].Add( widget );
			mTrays[ (int)trayLoc ].AddChild( widget.OverlayElement );

			widget.OverlayElement.HorizontalAlignment = trayWidgetAlign[ (int)trayLoc ];

			// adjust trays if necessary
			if ( widget.TrayLocation != TrayLocation.None || trayLoc != TrayLocation.None )
			{
				AdjustTrays();
			}

			widget.AssigendTray = trayLoc;
			//widget.Show();
			//mTraysLayer.AddElement( (OverlayElementContainer)widget.OverlayElement);
		}

Same methods

SdkTrayManager::MoveWidgetToTray ( String name, TrayLocation trayLoc ) : void
SdkTrayManager::MoveWidgetToTray ( String name, TrayLocation trayLoc, int place ) : void
SdkTrayManager::MoveWidgetToTray ( TrayLocation currentTrayLoc, String name, TrayLocation targetTrayLoc ) : void
SdkTrayManager::MoveWidgetToTray ( TrayLocation currentTrayLoc, String name, TrayLocation targetTrayLoc, int place ) : void
SdkTrayManager::MoveWidgetToTray ( TrayLocation currentTrayLoc, int currentPlace, TrayLocation targetTrayLoc ) : void
SdkTrayManager::MoveWidgetToTray ( TrayLocation currentTrayLoc, int currentPlace, TrayLocation targetTrayLoc, int targetPlace ) : void
SdkTrayManager::MoveWidgetToTray ( Widget widget, TrayLocation trayLoc ) : void