Beispiel #1
0
        private void updateValues(String name, Dictionary <string, string> result)
        {
            ContentApp app = ctx.app.obj as ContentApp;

            String newStyle = CssFormUtil.mergeStyle(app.Style, name, result);

            app.Style = newStyle;
            db.update(app, "Style");

            echoToParentPart(lang("opok"));
        }
        public void AddRow(int columnCount)
        {
            ContentApp app = ctx.app.obj as ContentApp;

            app.Layout = app.Layout + "/" + columnCount;

            int    row         = app.RowList.Length;
            String newStyle    = getStyle(row, columnCount);
            String mergedStyle = CssFormUtil.mergeStyle(app.Style, newStyle);

            app.Style = mergedStyle;

            db.update(app, new string[] { "Layout", "Style" });

            echoToParentPrivate();
        }
Beispiel #3
0
        public void testMergeStyle()
        {
            string oStyle   = @"#row1_column1 { width:32%; margin:5px 5px 5px 10px; }
#row1_column2 { width:40%; margin:5px; }
#row1_column3 { width:24%; margin:5px; }
#row2_column1 { width:100%; height:; background-color:; background-image:; background-position:; background-repeat:; border-width:; border-color:; border-style:; font-size:; font-family:; font-style:; font-weight:; text-decoration:; text-align:; margin-left:; margin-top:; margin-right:; margin-bottom:; padding-left:; padding-top:; padding-right:; padding-bottom:; display:; }
";
            string newStyle = @"#row2_column1 { width:98%; margin-top:5px; margin-right:5px; margin-bottom:5px; margin-left:10px; }";


            string merged = CssFormUtil.mergeStyle(oStyle, newStyle);

            Console.WriteLine(merged);

            int oIndex = merged.IndexOf("#row2_column1 { width:100%; ");
            int nIndex = merged.IndexOf("#row2_column1 { width:98%; ");

            Assert.IsTrue(oIndex < 0);
            Assert.IsTrue(nIndex > 0);
        }