Exemplo n.º 1
0
 public void Execute(DrawTheory theory)
 {
     foreach (IAtom atom in this.elements)
     {
         atom.Execute(theory);
     }
 }
Exemplo 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 ());
         }
     }
 }
Exemplo 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;
     }
 }
Exemplo 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;
     }
 }
Exemplo 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);
     }
 }
Exemplo 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);
        }
Exemplo 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!");
            }
        }
Exemplo 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 ());
         }
     }
 }
Exemplo 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);
            }
        }
Exemplo 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);
     }
 }
Exemplo 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));
 }
Exemplo n.º 13
0
 public virtual void FilteredExecute(DrawTheory theory)
 {
     this.body.Execute (theory);
 }
Exemplo n.º 14
0
 public static void Chapter(DrawTheory dt, double time = double.NaN)
 {
     dt.AddChapter(time);
 }
Exemplo n.º 15
0
 public static void Graph(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
 }
Exemplo n.º 16
0
 public static void Title(DrawTheory dt, string title)
 {
     dt.SetName(title);
 }
Exemplo n.º 17
0
 public static void Node(DrawTheory dt, IFunctionInstance name, string graph, double time = double.NaN)
 {
 }
Exemplo 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));
 }
Exemplo n.º 19
0
 public void Execute(DrawTheory theory)
 {
     this.Predicate.Execute(theory, this.Terms);
 }
Exemplo 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));
 }
Exemplo n.º 21
0
 public static void Edge(DrawTheory dt, string node1, string node2, string graph)
 {
 }
Exemplo 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));
 }
Exemplo n.º 23
0
 public override void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments, IEnumerable<IAtom> body)
 {
     ExecuteResult (theory, arguments, body);
 }
Exemplo n.º 24
0
 public virtual void FilteredExecute(DrawTheory theory)
 {
     this.body.Execute(theory);
 }
Exemplo n.º 25
0
 public static void Ellipse(DrawTheory dt, string text)
 {
     Console.WriteLine(text);
 }
Exemplo n.º 26
0
 public static void Graph(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
 }
Exemplo n.º 27
0
 public static void Execute(DrawTheory dt)
 {
     dt.Source.Reload();
 }
Exemplo n.º 28
0
 public static void RotateZ(DrawTheory dt, IFunctionInstance name, double alpha, double time = double.NaN)
 {
 }
Exemplo n.º 29
0
 public virtual void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments)
 {
     this.Execute(theory, arguments, EnumerableUtils.Zero <IAtom> ());
 }
Exemplo 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);
 }
Exemplo n.º 31
0
 public static void Ellipse(DrawTheory dt, string text)
 {
     Console.WriteLine (text);
 }
Exemplo 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);
 }
Exemplo n.º 33
0
 public static void Hide(DrawTheory dt, IFunctionInstance name, double time = double.NaN)
 {
     dt.AddModifier (name, time, x => x.SetElement ("Visible", false));
 }
Exemplo 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));
 }
Exemplo n.º 35
0
 public virtual void Execute(DrawTheory theory, params object[] parameters)
 {
     this.FilteredExecute (theory);
 }
Exemplo n.º 36
0
 public static void Title(DrawTheory dt, string title)
 {
     dt.SetName (title);
 }
Exemplo n.º 37
0
 protected OutputDevice(DrawTheory theory, IProgramManager manager)
 {
     this.theory  = theory;
     this.manager = manager;
 }
Exemplo 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));
 }
Exemplo n.º 39
0
 public OutputPrintDevice(DrawTheory theory, IProgramManager manager) : base(theory, manager)
 {
 }
Exemplo n.º 40
0
 public virtual void Execute(DrawTheory theory)
 {
     this.head.Predicate.Execute(theory, this.head.Terms, this.Body.Elements);
 }
Exemplo n.º 41
0
 public virtual void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments, IEnumerable<IAtom> body)
 {
 }
Exemplo 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);
        }
Exemplo n.º 43
0
 public static void Zscale(DrawTheory dt, IFunctionInstance name, double zscale, double time = double.NaN)
 {
 }
Exemplo n.º 44
0
 public static void Ellipse(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
     dt.AddShape(new ShapeEllipse(name, width, height));
 }
Exemplo n.º 45
0
 public virtual void Execute(DrawTheory theory, IEnumerable<IFunctionInstance> arguments)
 {
     this.Execute (theory, arguments, EnumerableUtils.Zero<IAtom> ());
 }
Exemplo n.º 46
0
 public static void Zshift(DrawTheory dt, IFunctionInstance name, double zpos, double time = double.NaN)
 {
 }
Exemplo n.º 47
0
 public OutputLaTeXDevice(DrawTheory theory, IProgramManager manager)
     : base(theory,manager)
 {
 }
Exemplo n.º 48
0
 public OutputPdfStripDevice(DrawTheory dt, IProgramManager manager)
     : base(dt,manager)
 {
 }
Exemplo n.º 49
0
 public static void Chapter(DrawTheory dt, double time = double.NaN)
 {
     dt.AddChapter (time);
 }
Exemplo n.º 50
0
 public static void Execute(DrawTheory dt, string command)
 {
     dt.Source.Alter (command);
 }
Exemplo n.º 51
0
 public OutputPdfDevice(DrawTheory dt, IProgramManager manager) : base(dt, manager)
 {
 }
Exemplo 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);
 }
Exemplo n.º 53
0
 public static void Execute(DrawTheory dt)
 {
     dt.Source.Reload ();
 }
Exemplo 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));
 }
Exemplo n.º 55
0
 public static void Execute(DrawTheory dt, string command)
 {
     dt.Source.Alter(command);
 }
Exemplo n.º 56
0
 public static void Edge(DrawTheory dt, string node1, string node2, string graph)
 {
 }
Exemplo n.º 57
0
 public virtual void Execute(DrawTheory theory, params object[] parameters)
 {
     this.FilteredExecute(theory);
 }
Exemplo 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)));
 }
Exemplo n.º 59
0
 public virtual void Execute(DrawTheory theory, IEnumerable <IFunctionInstance> arguments, IEnumerable <IAtom> body)
 {
 }
Exemplo n.º 60
0
 public static void Ellipse(DrawTheory dt, IFunctionInstance name, double width, double height)
 {
     dt.AddShape (new ShapeEllipse (name, width, height));
 }