Exemple #1
0
        /// <summary>
        /// Create a window
        /// </summary>
        /// <param name="properties">props</param>
        /// <returns>ux window</returns>
        public static UXWindow CreateWindow(Marshalling.MarshallingHash properties, int width, int height, params UXControl[] controls)
        {
            UXWindow win = UXWindow.CreateUXWindow("win", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Width", width },
                    { "Height", height },
                    { "Constraint-Width", "FIXED" },
                    { "Constraint-Height", "FIXED" },
                    {
                        "children",
                        ChildCollection.CreateChildCollection("children", () => {
                            return controls.ToList();
                        })
                    }
                });
            });

            if (properties != null)
            {
                win.Bind(properties);
            }
            return(win);
        }
        /// <summary>
        /// Render a box
        /// </summary>
        /// <param name="box">box to render</param>
        public void RenderControl(UXBox box)
        {
            UXTable t = new UXTable();
            UXCell  c = new UXCell();

            foreach (IUXObject ux in box.Children)
            {
                c.Add(ux);
            }
            Marshalling.MarshallingHash hash = Marshalling.MarshallingHash.CreateMarshalling("content", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "ColumnCount", 1 },
                    { "LineCount", 1 },
                    { "children",
                      ChildCollection.CreateChildCollection("row", () =>
                        {
                            return new List <IUXObject>()
                            {
                                Creation.CreateRow(1, null, c)
                            };
                        }) }
                });
            });
            t.Bind(hash);
            RenderControl(t);
        }
        /// <summary>
        /// Create UXRow
        /// </summary>
        /// <param name="data">data hash</param>
        /// <param name="ui">ui properties</param>
        /// <returns>row</returns>
        public static UXCell CreateUXCell(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXCell cell = new UXCell();

            cell.Bind(data);
            cell.Bind(ui);
            return(cell);
        }
Exemple #4
0
        /// <summary>
        /// Create clickable text
        /// </summary>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXClickableText CreateUXClickableText(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXClickableText ux = new UXClickableText();

            ux.Bind(data);
            ux.Bind(ui);
            return(ux);
        }
Exemple #5
0
        /// <summary>
        /// Create an UX by marshalling information
        /// </summary>
        /// <param name="name">window name</param>
        /// <param name="hash">properties to adjust UX</param>
        /// <returns>UXWindow</returns>
        public static UXWindow CreateUXWindow(string name, Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXWindow win = new UXWindow();

            win.Bind(data);
            win.Bind(ui);
            return(win);
        }
Exemple #6
0
        /// <summary>
        /// Create a box
        /// </summary>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXBox CreateUXBox(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXBox box = new UXBox();

            box.Bind(data);
            box.Bind(ui);
            return(box);
        }
Exemple #7
0
        /// <summary>
        /// Create a box
        /// </summary>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXButton CreateUXButton(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXButton button = new UXButton();

            button.Bind(data);
            button.Bind(ui);
            return(button);
        }
Exemple #8
0
        /// <summary>
        /// Create ckeck box
        /// </summary>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXCheck CreateUXCheck(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXCheck ux = new UXCheck();

            ux.Bind(data);
            ux.Bind(ui);
            return(ux);
        }
        /// <summary>
        /// Create clickable image
        /// </summary>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXClickableImage CreateUXClickableImage(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXClickableImage ux = new UXClickableImage();

            ux.Bind(data);
            ux.Bind(ui);
            return(ux);
        }
        /// <summary>
        /// Create editable text
        /// </summary>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXTree CreateUXTree(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXTree tree = new UXTree();

            tree.Bind(data);
            tree.Bind(ui);
            return(tree);
        }
        public void OpenProject()
        {
            UXFramework.UXTree          tree = CreateTreeView(0, currentProject, currentNode);
            UXFramework.UXBox           box  = UXFramework.Creation.CreateBox(null, 1120, 0);
            Marshalling.MarshallingHash hash = Marshalling.MarshallingHash.CreateMarshalling("left", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Width", 220 },
                    { "Constraint-Width", "FIXED" },
                });
            });
            UXFramework.UXCell c1 = UXFramework.Creation.CreateCell(hash, tree);
            hash = Marshalling.MarshallingHash.CreateMarshalling("right", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Width", 1100 },
                    { "Constraint-Width", "FIXED" },
                });
            });
            UXFramework.UXCell c2 = UXFramework.Creation.CreateCell(hash, box);

            hash = Marshalling.MarshallingHash.CreateMarshalling("row", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Disposition", "LEFT_TOP" },
                    { "align", "left" },
                    { "valign", "top" }
                });
            });
            UXFramework.UXRow   row   = UXFramework.Creation.CreateRow(2, hash, c1, c2);
            UXFramework.UXTable table = UXFramework.Creation.CreateTable("boxes", 2, 1, null, row);

            UXFramework.UXWindow win = UXFramework.UXWindow.CreateUXWindow("openProject", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Width", 1320 },
                    { "Height", 700 },
                    { "Constraint-Width", "FIXED" },
                    { "Constraint-Height", "FIXED" },
                    { "BackColor", "Blue" },
                    { "ForeColor", "White" },
                    { "children",
                      UXFramework.ChildCollection.CreateChildCollection("children", () => {
                            List <UXFramework.IUXObject> children = new List <UXFramework.IUXObject>();
                            children.Add(table);
                            return children;
                        }) }
                });
            });

            win.Navigate(this.web);
        }
Exemple #12
0
        /// <summary>
        /// Create UXRow
        /// </summary>
        /// <param name="data">data hash</param>
        /// <param name="ui">ui properties</param>
        /// <returns>row</returns>
        public static UXRow CreateUXRow(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXRow row = new UXRow();

            row.Bind(data);
            row.Bind(ui);
            foreach (Marshalling.IMarshalling m in row.GetProperty("childs").Values)
            {
                row.Add(m.Value);
            }
            return(row);
        }
        public static void Splash(WebBrowser web)
        {
            Marshalling.MarshallingHash ui = Marshalling.MarshallingHash.CreateMarshalling("splash.ui", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Width", 1320 },
                    { "Height", 700 },
                    { "Constraint-Width", "FIXED" },
                    { "Constraint-Height", "FIXED" },
                    { "BackColor", "Blue" },
                    { "ForeColor", "White" }
                });
            });

            Marshalling.MarshallingHash data = Marshalling.MarshallingHash.CreateMarshalling("splash", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Id", "splash" },
                    { "Text", "Easy WEB For Developers" },
                    { "Height", 100 },
                    { "Constraint-Height", "FIXED" }
                });
            });

            UXReadOnlyText ro = UXReadOnlyText.CreateUXReadOnlyText(data, new Marshalling.MarshallingHash("ui"));

            Marshalling.MarshallingHash top = Marshalling.MarshallingHash.CreateMarshalling("splash", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    {
                        "children", Marshalling.MarshallingList.CreateMarshalling("children", () => {
                            return new List <IUXObject>()
                            {
                                ro
                            };
                        })
                    }
                });
            });

            UXWindow win = UXWindow.CreateUXWindow("splash", top, ui);

            browser = web;
            win.Navigate(web);

            t          = new Timer();
            t.Interval = 3000;
            t.Tick    += T_Tick;
            t.Start();
        }
Exemple #14
0
        /// <summary>
        /// Create table
        /// </summary>
        /// <param name="parent">parent ui</param>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXTable CreateUXTable(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXTable table = new UXTable();

            table.Bind(data);
            table.Bind(ui);
            foreach (Marshalling.IMarshalling m in table.GetProperty("childs").Values)
            {
                table.Add(m.Value);
            }
            return(table);
        }
Exemple #15
0
        /// <summary>
        /// Create editable text
        /// </summary>
        /// <param name="data">data to show</param>
        /// <param name="ui">ui properties</param>
        public static UXTreeItem CreateUXTreeItem(Marshalling.MarshallingHash data, Marshalling.MarshallingHash ui)
        {
            UXTreeItem treeItem = new UXTreeItem();

            treeItem.Bind(data);
            treeItem.Bind(ui);
            foreach (Marshalling.IMarshalling m in treeItem.GetProperty("children").Values)
            {
                treeItem.Add(m.Value);
            }
            return(treeItem);
        }
Exemple #16
0
        static void Main(string[] args)
        {
            Library2.File f = new Library2.File("test");
            Marshalling.MarshallingHash hash = f.ExportToHash();
            Library2.File f2 = Marshalling.PersistentDataObject.Import <Library2.File>(hash);

            Console.WriteLine(f2.ToString());

            Library2.Project p    = new Library2.Project("p");
            Library2.Page    page = new Library2.Page("first");


            Console.ReadKey();
        }
Exemple #17
0
        /// <summary>
        /// Create a cell
        /// </summary>
        /// <param name="properties">props</param>
        /// <param name="controls">controls</param>
        /// <returns>ux cell</returns>
        public static UXCell CreateCell(Marshalling.MarshallingHash properties, params UXControl[] controls)
        {
            UXCell cell = UXCell.CreateUXCell("cell", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "children", UXFramework.Creation.CreateChildren(controls) }
                });
            });

            if (properties != null)
            {
                cell.Bind(properties);
            }
            return(cell);
        }
Exemple #18
0
        /// <summary>
        /// Create an image
        /// </summary>
        /// <param name="properties">props</param>
        /// <param name="id">ux id</param>
        /// <param name="text">ux text</param>
        /// <returns>ux read only text</returns>
        public static UXImage CreateImage(Marshalling.MarshallingHash properties, string id, string fileName)
        {
            UXImage im = UXImage.CreateUXImage("image", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Id", id },
                    { "ImageFile", fileName }
                });
            });

            if (properties != null)
            {
                im.Bind(properties);
            }
            return(im);
        }
Exemple #19
0
        /// <summary>
        /// Create a read only text
        /// </summary>
        /// <param name="properties">props</param>
        /// <param name="id">ux id</param>
        /// <param name="text">ux text</param>
        /// <returns>ux read only text</returns>
        public static UXReadOnlyText CreateReadOnlyText(Marshalling.MarshallingHash properties, string id, string text)
        {
            UXReadOnlyText t = UXReadOnlyText.CreateUXReadOnlyText("text", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Id", id },
                    { "Text", text }
                });
            });

            if (properties != null)
            {
                t.Bind(properties);
            }
            return(t);
        }
Exemple #20
0
        /// <summary>
        /// Create a row
        /// </summary>
        /// <param name="ColumnCount">column count</param>
        /// <param name="properties">props</param>
        /// <param name="cells">columns</param>
        /// <returns>ux row</returns>
        public static UXRow CreateRow(uint ColumnCount, Marshalling.MarshallingHash properties, params UXCell[] cells)
        {
            UXRow row = UXRow.CreateUXRow("row", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "ColumnCount", ColumnCount },
                    { "children", UXFramework.Creation.CreateChildren(cells) }
                });
            });

            if (properties != null)
            {
                row.Bind(properties);
            }
            return(row);
        }
Exemple #21
0
        /// <summary>
        /// Create a box
        /// </summary>
        /// <param name="properties">props</param>
        /// <returns>ux read only text</returns>
        public static UXBox CreateBox(Marshalling.MarshallingHash properties, int width, int height)
        {
            UXBox im = UXBox.CreateUXBox("box", () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "Width", width },
                    { "Height", height },
                    { "Constraint-Width", "FIXED" },
                    { "Constraint-Height", "FIXED" }
                });
            });

            if (properties != null)
            {
                im.Bind(properties);
            }
            return(im);
        }
Exemple #22
0
        /// <summary>
        /// Create tree
        /// </summary>
        /// <param name="properties">props</param>
        /// <param name="id">id</param>
        /// <param name="first">first row</param>
        /// <param name="nexts">next rows</param>
        /// <returns>ux tree</returns>
        public static UXTree CreateTree(Marshalling.MarshallingHash properties, string id, UXRow first, params UXRow[] nexts)
        {
            UXTree t = UXTree.CreateUXTree("tree", () =>
            {
                List <UXRow> rows = new List <UXRow>();
                rows.Add(first);
                rows = rows.Concat(nexts).ToList();
                return(new Dictionary <string, dynamic>()
                {
                    { "Id", id },
                    { "children", rows }
                });
            });

            if (properties != null)
            {
                t.Bind(properties);
            }
            return(t);
        }
 /// <summary>
 /// Add a new element into hash
 /// </summary>
 /// <param name="e">new element</param>
 public void Add(Func <IDictionary <string, dynamic> > f)
 {
     Marshalling.MarshallingHash h = Marshalling.MarshallingHash.CreateMarshalling("", f);
     h.Copy(false, this);
 }
Exemple #24
0
        /// <summary>
        /// Create a table
        /// </summary>
        /// <param name="name">name of table</param>
        /// <param name="ColumnCount">column count</param>
        /// <param name="LineCount">line count</param>
        /// <param name="properties">props</param>
        /// <param name="rows">lines</param>
        /// <returns>ux table</returns>
        public static UXTable CreateTable(string name, uint ColumnCount, uint LineCount, Marshalling.MarshallingHash properties, params UXRow[] rows)
        {
            UXTable t = UXTable.CreateUXTable(name, () =>
            {
                return(new Dictionary <string, dynamic>()
                {
                    { "ColumnCount", ColumnCount },
                    { "LineCount", LineCount },
                    { "children", UXFramework.Creation.CreateChildren(rows) }
                });
            });

            if (properties != null)
            {
                t.Bind(properties);
            }
            return(t);
        }