public void Execute(DrawTheory theory) { foreach (IAtom atom in this.elements) { atom.Execute(theory); } }
public override void Execute(DrawTheory theory, params object[] parameters) { if (parameters.Length > 0x00) { EventKey ek = parameters [0x00] as EventKey; if (ek != null && ek.Key.ToString ().ToLower ().Equals (this.Key)) { Console.Error.WriteLine ("FIRE!"); base.Execute (theory, parameters); } else { //Console.Error.WriteLine (ek.Key.ToString ()); } } }
public override object ExecuteResult(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body) { object[] val = EnumerableUtils.FirstsLast(EnumerableUtils.HeadTail(theory, TypeSystem.GetArguments(arguments, this.TermTypes, this.Method.GetParameters().Skip(0x01).SkipLast(0x01).Select(x => x.ParameterType))), body).ToArray(); try { return(this.Method.Invoke(null, val)); } catch (Exception e) { Console.Error.WriteLine("Could not execute the {0} atom.", this.TermString(arguments)); Console.Error.WriteLine(string.Join(" ; ", val.Select(x => x.GetType()))); Console.Error.WriteLine(e); return(null); } }
public override object ExecuteResult(DrawTheory theory, IEnumerable<IFunctionInstance> arguments, IEnumerable<IAtom> body) { object[] val = EnumerableUtils.FirstsLast (EnumerableUtils.HeadTail (theory, TypeSystem.GetArguments (arguments, this.TermTypes, this.Method.GetParameters ().Skip (0x01).SkipLast (0x01).Select (x => x.ParameterType))), body).ToArray (); try { return this.Method.Invoke (null, val); } catch (Exception e) { Console.Error.WriteLine ("Could not execute the {0} atom.", this.TermString (arguments)); Console.Error.WriteLine (string.Join (" ; ", val.Select (x => x.GetType ()))); Console.Error.WriteLine (e); return null; } }
public virtual object ExecuteResult(DrawTheory theory, IEnumerable<IFunctionInstance> arguments, IEnumerable<IAtom> body) { object[] val = EnumerableUtils.HeadTail (theory, TypeSystem.GetArguments (arguments, this.TermTypes, this.method.GetParameters ().Skip (0x01).Select (x => x.ParameterType))).ToArray (); try { object result = this.method.Invoke (null, val); base.Execute (theory, arguments, body); return result; } catch (Exception e) { Console.Error.WriteLine ("Could not execute the {0} atom.", this.TermString (arguments)); Console.Error.WriteLine (e); return null; } }
public virtual object ExecuteResult(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body) { object[] val = EnumerableUtils.HeadTail(theory, TypeSystem.GetArguments(arguments, this.TermTypes, this.method.GetParameters().Skip(0x01).Select(x => x.ParameterType))).ToArray(); try { object result = this.method.Invoke(null, val); base.Execute(theory, arguments, body); return(result); } catch (Exception e) { Console.Error.WriteLine("Could not execute the {0} atom.", this.TermString(arguments)); Console.Error.WriteLine(e); return(null); } }
public void CreateTab <T> (DrawTheory dt, T widget) where T : Widget, IMediaObject { string name = dt.Name; this.mainhierarchy.Add(widget); Box.BoxChild w = ((Box.BoxChild)(this.mainhierarchy [widget])); w.Position = 0; w.Expand = true; w.Fill = true; this.sheets.Add(widget, dt); this.SetCurrent(widget); widget.HasFocus = true; this.tabcontrol.Open(name); }
public OutputHttpServerDevice(DrawTheory dt, IProgramManager manager) : base(dt, manager) { string serverFolder = manager.ServerFolder; string navbarfile = Path.Combine(serverFolder, "navbar.idpml"); if (File.Exists(navbarfile)) { this.navbar = Navbar.FromStream(serverFolder, navbarfile); this.navbar.PostDeserialize(); } else { throw new ArgumentException("The navbar file does not exists!"); } }
public override void Execute(DrawTheory theory, params object[] parameters) { if (parameters.Length > 0x00) { EventKey ek = parameters [0x00] as EventKey; if (ek != null && ek.Key.ToString().ToLower().Equals(this.Key)) { Console.Error.WriteLine("FIRE!"); base.Execute(theory, parameters); } else { //Console.Error.WriteLine (ek.Key.ToString ()); } } }
public static OutputDevice CreateDevice(string name, DrawTheory theory, ProgramManager pm) { Tuple <string, ConstructorInfo> ci; if (constructors.TryGetValue(name.Trim().ToLower(), out ci)) { try { return((OutputDevice)ci.Item2.Invoke(new object[] { theory, pm })); } catch (Exception e) { Console.WriteLine(e.InnerException); throw e; } } else { throw new IdpGieException("Cannot find the appropriate output device \"{0}\". Run `idp --list-devices' for a list of installed devices.", name); } }
private void SetCurrent <T> (T current) where T : Widget, IMediaObject { if (this.current != null) { this.current.Hide(); this.mediabar.CurrentChanged -= (x, y) => current.Seek(y); } this.current = current; if (this.current != null) { DrawTheory dt = this.sheets [this.current]; this.mediabar.Min = dt.MinTime; this.mediabar.Max = dt.MaxTime + 1.0d; this.mediabar.CurrentChanged += (x, y) => current.Seek(y); this.current.Show(); } else { this.mediabar.Mode = MediaMode.Pause; this.mediabar.SetMinCurrentMax(0.0d, 0.0d, 0.0d); } }
public static void Image(DrawTheory dt, IFunctionInstance name, string filepath, double width, double height) { dt.AddShape (new ShapeImage (name, filepath, width, height)); }
public virtual void FilteredExecute(DrawTheory theory) { this.body.Execute (theory); }
public static void Chapter(DrawTheory dt, double time = double.NaN) { dt.AddChapter(time); }
public static void Graph(DrawTheory dt, IFunctionInstance name, double width, double height) { }
public static void Title(DrawTheory dt, string title) { dt.SetName(title); }
public static void Node(DrawTheory dt, IFunctionInstance name, string graph, double time = double.NaN) { }
public static void Xpos(DrawTheory dt, IFunctionInstance name, double xpos, double time = double.NaN) { dt.AddModifier(name, time, x => x.SetXPos(xpos)); }
public void Execute(DrawTheory theory) { this.Predicate.Execute(theory, this.Terms); }
public static void Image(DrawTheory dt, IFunctionInstance name, string filepath, double width, double height) { dt.AddShape(new ShapeImage(name, filepath, width, height)); }
public static void Edge(DrawTheory dt, string node1, string node2, string graph) { }
public static void Text(DrawTheory dt, IFunctionInstance name, string text, double time = double.NaN) { dt.AddModifier(name, time, x => x.SetElement("Text", text)); }
public override void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments, IEnumerable<IAtom> body) { ExecuteResult (theory, arguments, body); }
public virtual void FilteredExecute(DrawTheory theory) { this.body.Execute(theory); }
public static void Ellipse(DrawTheory dt, string text) { Console.WriteLine(text); }
public static void Execute(DrawTheory dt) { dt.Source.Reload(); }
public static void RotateZ(DrawTheory dt, IFunctionInstance name, double alpha, double time = double.NaN) { }
public virtual void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments) { this.Execute(theory, arguments, EnumerableUtils.Zero <IAtom> ()); }
public static void Scale(DrawTheory dt, IFunctionInstance name, double xscale, double yscale, double zscale, double time = double.NaN) { Xscale (dt, name, xscale, time); Yscale (dt, name, yscale, time); Zscale (dt, name, zscale, time); }
public static void Ellipse(DrawTheory dt, string text) { Console.WriteLine (text); }
public static void Shift(DrawTheory dt, IFunctionInstance name, double xpos, double ypos, double zpos, double time = double.NaN) { Xshift (dt, name, xpos, time); Yshift (dt, name, ypos, time); Zshift (dt, name, zpos, time); }
public static void Hide(DrawTheory dt, IFunctionInstance name, double time = double.NaN) { dt.AddModifier (name, time, x => x.SetElement ("Visible", false)); }
public static void Text(DrawTheory dt, IFunctionInstance name, string text, double time = double.NaN) { dt.AddModifier (name, time, x => x.SetElement ("Text", text)); }
public virtual void Execute(DrawTheory theory, params object[] parameters) { this.FilteredExecute (theory); }
public static void Title(DrawTheory dt, string title) { dt.SetName (title); }
protected OutputDevice(DrawTheory theory, IProgramManager manager) { this.theory = theory; this.manager = manager; }
public static void Zpos(DrawTheory dt, IFunctionInstance name, double zpos, double time = double.NaN) { dt.AddModifier (name, time, x => x.SetZPos (zpos)); }
public OutputPrintDevice(DrawTheory theory, IProgramManager manager) : base(theory, manager) { }
public virtual void Execute(DrawTheory theory) { this.head.Predicate.Execute(theory, this.head.Terms, this.Body.Elements); }
public virtual void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments, IEnumerable<IAtom> body) { }
public override void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body) { IHook hook = this.ExecuteResult(theory, arguments, body) as IHook; theory.AddHook(hook); }
public static void Zscale(DrawTheory dt, IFunctionInstance name, double zscale, double time = double.NaN) { }
public static void Ellipse(DrawTheory dt, IFunctionInstance name, double width, double height) { dt.AddShape(new ShapeEllipse(name, width, height)); }
public virtual void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments) { this.Execute (theory, arguments, EnumerableUtils.Zero<IAtom> ()); }
public static void Zshift(DrawTheory dt, IFunctionInstance name, double zpos, double time = double.NaN) { }
public OutputLaTeXDevice(DrawTheory theory, IProgramManager manager) : base(theory,manager) { }
public OutputPdfStripDevice(DrawTheory dt, IProgramManager manager) : base(dt,manager) { }
public static void Chapter(DrawTheory dt, double time = double.NaN) { dt.AddChapter (time); }
public static void Execute(DrawTheory dt, string command) { dt.Source.Alter (command); }
public OutputPdfDevice(DrawTheory dt, IProgramManager manager) : base(dt, manager) { }
public static void Color(DrawTheory dt, IFunctionInstance name, double r, double g, double b, double time = double.NaN) { InnerColor (dt, name, r, g, b, time); }
public static void Execute(DrawTheory dt) { dt.Source.Reload (); }
public static void Depth(DrawTheory dt, IFunctionInstance name, double index, double time = double.NaN) { dt.AddModifier (name, time, x => x.SetZPos (index)); }
public static void Execute(DrawTheory dt, string command) { dt.Source.Alter(command); }
public virtual void Execute(DrawTheory theory, params object[] parameters) { this.FilteredExecute(theory); }
public static void EdgeColor(DrawTheory dt, IFunctionInstance name, double r, double g, double b, double time = double.NaN) { dt.AddModifier (name, time, x => x.SetElement ("EdgeColor", new Color (r * MathExtra.Inv255, g * MathExtra.Inv255, b * MathExtra.Inv255))); }
public virtual void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body) { }
public static void Ellipse(DrawTheory dt, IFunctionInstance name, double width, double height) { dt.AddShape (new ShapeEllipse (name, width, height)); }