Ejemplo n.º 1
0
 public void Execute(DrawTheory theory)
 {
     foreach (IAtom atom in this.elements)
     {
         atom.Execute(theory);
     }
 }
Ejemplo n.º 2
0
 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 ());
         }
     }
 }
Ejemplo n.º 3
0
 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;
     }
 }
Ejemplo n.º 5
0
 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;
     }
 }
Ejemplo n.º 6
0
 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);
     }
 }
Ejemplo n.º 7
0
        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);
        }
Ejemplo n.º 8
0
        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!");
            }
        }
Ejemplo n.º 9
0
 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 ());
         }
     }
 }
Ejemplo n.º 10
0
        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);
            }
        }
Ejemplo n.º 11
0
 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);
     }
 }
Ejemplo n.º 12
0
 public static void Image(DrawTheory dt, IFunctionInstance name, string filepath, double width, double height)
 {
     dt.AddShape (new ShapeImage (name, filepath, width, height));
 }
Ejemplo n.º 13
0
 public virtual void FilteredExecute(DrawTheory theory)
 {
     this.body.Execute (theory);
 }
Ejemplo n.º 14
0
 public static void Chapter(DrawTheory dt, double time = double.NaN)
 {
     dt.AddChapter(time);
 }
Ejemplo n.º 15
0
 public static void Graph(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
 }
Ejemplo n.º 16
0
 public static void Title(DrawTheory dt, string title)
 {
     dt.SetName(title);
 }
Ejemplo n.º 17
0
 public static void Node(DrawTheory dt, IFunctionInstance name, string graph, double time = double.NaN)
 {
 }
Ejemplo n.º 18
0
 public static void Xpos(DrawTheory dt, IFunctionInstance name, double xpos, double time = double.NaN)
 {
     dt.AddModifier(name, time, x => x.SetXPos(xpos));
 }
Ejemplo n.º 19
0
 public void Execute(DrawTheory theory)
 {
     this.Predicate.Execute(theory, this.Terms);
 }
Ejemplo n.º 20
0
 public static void Image(DrawTheory dt, IFunctionInstance name, string filepath, double width, double height)
 {
     dt.AddShape(new ShapeImage(name, filepath, width, height));
 }
Ejemplo n.º 21
0
 public static void Edge(DrawTheory dt, string node1, string node2, string graph)
 {
 }
Ejemplo n.º 22
0
 public static void Text(DrawTheory dt, IFunctionInstance name, string text, double time = double.NaN)
 {
     dt.AddModifier(name, time, x => x.SetElement("Text", text));
 }
Ejemplo n.º 23
0
 public override void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments, IEnumerable<IAtom> body)
 {
     ExecuteResult (theory, arguments, body);
 }
Ejemplo n.º 24
0
 public virtual void FilteredExecute(DrawTheory theory)
 {
     this.body.Execute(theory);
 }
Ejemplo n.º 25
0
 public static void Ellipse(DrawTheory dt, string text)
 {
     Console.WriteLine(text);
 }
Ejemplo n.º 26
0
 public static void Graph(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
 }
Ejemplo n.º 27
0
 public static void Execute(DrawTheory dt)
 {
     dt.Source.Reload();
 }
Ejemplo n.º 28
0
 public static void RotateZ(DrawTheory dt, IFunctionInstance name, double alpha, double time = double.NaN)
 {
 }
Ejemplo n.º 29
0
 public virtual void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments)
 {
     this.Execute(theory, arguments, EnumerableUtils.Zero <IAtom> ());
 }
Ejemplo n.º 30
0
 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);
 }
Ejemplo n.º 31
0
 public static void Ellipse(DrawTheory dt, string text)
 {
     Console.WriteLine (text);
 }
Ejemplo n.º 32
0
 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);
 }
Ejemplo n.º 33
0
 public static void Hide(DrawTheory dt, IFunctionInstance name, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetElement ("Visible", false));
 }
Ejemplo n.º 34
0
 public static void Text(DrawTheory dt, IFunctionInstance name, string text, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetElement ("Text", text));
 }
Ejemplo n.º 35
0
 public virtual void Execute(DrawTheory theory, params object[] parameters)
 {
     this.FilteredExecute (theory);
 }
Ejemplo n.º 36
0
 public static void Title(DrawTheory dt, string title)
 {
     dt.SetName (title);
 }
Ejemplo n.º 37
0
 protected OutputDevice(DrawTheory theory, IProgramManager manager)
 {
     this.theory  = theory;
     this.manager = manager;
 }
Ejemplo n.º 38
0
 public static void Zpos(DrawTheory dt, IFunctionInstance name, double zpos, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetZPos (zpos));
 }
Ejemplo n.º 39
0
 public OutputPrintDevice(DrawTheory theory, IProgramManager manager) : base(theory, manager)
 {
 }
Ejemplo n.º 40
0
 public virtual void Execute(DrawTheory theory)
 {
     this.head.Predicate.Execute(theory, this.head.Terms, this.Body.Elements);
 }
Ejemplo n.º 41
0
 public virtual void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments, IEnumerable<IAtom> body)
 {
 }
Ejemplo n.º 42
0
        public override void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body)
        {
            IHook hook = this.ExecuteResult(theory, arguments, body) as IHook;

            theory.AddHook(hook);
        }
Ejemplo n.º 43
0
 public static void Zscale(DrawTheory dt, IFunctionInstance name, double zscale, double time = double.NaN)
 {
 }
Ejemplo n.º 44
0
 public static void Ellipse(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
     dt.AddShape(new ShapeEllipse(name, width, height));
 }
Ejemplo n.º 45
0
 public virtual void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments)
 {
     this.Execute (theory, arguments, EnumerableUtils.Zero<IAtom> ());
 }
Ejemplo n.º 46
0
 public static void Zshift(DrawTheory dt, IFunctionInstance name, double zpos, double time = double.NaN)
 {
 }
Ejemplo n.º 47
0
 public OutputLaTeXDevice(DrawTheory theory, IProgramManager manager)
     : base(theory,manager)
 {
 }
Ejemplo n.º 48
0
 public OutputPdfStripDevice(DrawTheory dt, IProgramManager manager)
     : base(dt,manager)
 {
 }
Ejemplo n.º 49
0
 public static void Chapter(DrawTheory dt, double time = double.NaN)
 {
     dt.AddChapter (time);
 }
Ejemplo n.º 50
0
 public static void Execute(DrawTheory dt, string command)
 {
     dt.Source.Alter (command);
 }
Ejemplo n.º 51
0
 public OutputPdfDevice(DrawTheory dt, IProgramManager manager) : base(dt, manager)
 {
 }
Ejemplo n.º 52
0
 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);
 }
Ejemplo n.º 53
0
 public static void Execute(DrawTheory dt)
 {
     dt.Source.Reload ();
 }
Ejemplo n.º 54
0
 public static void Depth(DrawTheory dt, IFunctionInstance name, double index, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetZPos (index));
 }
Ejemplo n.º 55
0
 public static void Execute(DrawTheory dt, string command)
 {
     dt.Source.Alter(command);
 }
Ejemplo n.º 56
0
 public static void Edge(DrawTheory dt, string node1, string node2, string graph)
 {
 }
Ejemplo n.º 57
0
 public virtual void Execute(DrawTheory theory, params object[] parameters)
 {
     this.FilteredExecute(theory);
 }
Ejemplo n.º 58
0
 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)));
 }
Ejemplo n.º 59
0
 public virtual void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body)
 {
 }
Ejemplo n.º 60
0
 public static void Ellipse(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
     dt.AddShape (new ShapeEllipse (name, width, height));
 }