Beispiel #1
0
		/// <summary>
		/// action element is faked out for now.
		/// currently we only grab the last child (activated state)
		/// and render it
		/// </summary>
		public object Visit(MathMLActionElement e, object args) 
		{			
			Area cache = Area.GetArea(e);
			if(cache != null) return cache;

			IFormattingContext ctx = (IFormattingContext)args;

			try
			{
				MathMLElement selectedElement = (MathMLElement)e.ChildNodes[e.Selection];
				Area area = (Area)selectedElement.Accept(this, ctx);

				// check to see if we are colored
				Object userData = e.GetUserData("mouseenter");
				if(userData != null && userData is bool && (bool)userData)
				{
					Color background = e.Background;
					Color color = e.Color;

					if(!color.IsEmpty && !background.IsEmpty)
					{
						area = AreaFactory.Color(color, area);
						area = AreaFactory.Background(background, area);
					}
					else if(!color.IsEmpty) 
					{
						area = AreaFactory.Color(color, area);
					}
					else if(!background.IsEmpty)
					{
						area = AreaFactory.Background(background, area);
					}
				
				}
				return CompleteArea(ctx, e, area);
			}
			catch(Exception ex)
			{
				return Error(ctx, e, ex.Message);
			}
		}