Beispiel #1
0
 public void SetVariable(IVariable variable)
 {
     if (variable == null)
     {
         throw new MathException("variable cannot be null");
     }
     var = variable;
     if (variable is MathNode)
     {
         root = ((MathNode)variable).root;
     }
     if (root == null)
     {
         //create a root for drawing the variable
         root = new MathNodeRoot();
         if (var is MathNode)
         {
             root[0] = (MathNode)var;
             ((MathNode)var).IsFocused = false;
         }
         else
         {
         }
         root.SetFont(this.Font);
     }
 }
        protected void ReadVariable(XmlNode node)
        {
            MathNodeVariable v  = Variable as MathNodeVariable;
            MathNodeRoot     r  = v.Parent as MathNodeRoot;
            XmlNode          nd = node.SelectSingleNode("Font");

            if (nd != null)
            {
                object v0;
                if (XmlSerialization.ReadValue(nd, out v0))
                {
                    if (v0 != null)
                    {
                        r.SetFont((Font)v0);
                    }
                }
            }
            nd = node.SelectSingleNode("Var");
            if (nd != null)
            {
                v.Load(nd);
            }
            v.VariableName = this.Name;
        }
Beispiel #3
0
 public void SetTextFont(Font f)
 {
     root.SetFont(f);
 }