public object VisitGlobalStyle(XshtdGlobalStyles globStyles, XshtdGlobalStyle style)
            {
                if (style.TypeName != null)
                {
                    if (style.TypeName.Length == 0)
                    {
                        throw Error(style, "Name must not be the empty string");
                    }

                    if (globStyles == null)
                    {
                        throw Error(globStyles, "GlobalStyles parameter must not be null");
                    }

                    GlobalStyle globDef;
                    if (def._GlobalStyles.TryGetValue(style.TypeName, out globDef) == true)
                    {
                        throw Error(style, "GlobalStyle definition '" + style.TypeName + "' has duplicates.");
                    }

                    globDef = new GlobalStyle(style.TypeName);
                    globDef.backgroundcolor = style.background;
                    globDef.foregroundcolor = style.foreground;
                    globDef.bordercolor     = style.bordercolor;

                    globDef.Freeze();

                    def._GlobalStyles.Add(style.TypeName, new GlobalStyle(style.TypeName));
                }

                return(null);
            }
Beispiel #2
0
 private void ManagerMenu_Load(object sender, EventArgs e)
 {
     //user profile
     GlobalStyle.SetProfile(profile1);
     GlobalStyle.setAccessibility(accessibility1);
     GlobalStyle.SetStyleForm(Controls);
     GlobalStyle.SetSizeForm(this);
 }
Beispiel #3
0
 private uint CalculateHash(string content)
 {
     return(content.GetStableHashCode() +
            Id.GetStableHashCode() +
            (!ClassnameChanged.HasDelegate ? Classname.GetStableHashCode() : 0) +
            Enum.GetName(typeof(MediaQueries), MediaQuery).GetStableHashCode() +
            Enum.GetName(typeof(PseudoClasses), PseudoClass).GetStableHashCode() +
            GlobalStyle.GetStableHashCode());
 }
Beispiel #4
0
        protected virtual Task InitializeGlobalStyle()
        {
            var style = Browser.Document.CreateElement("style");

            style.AppendChild(Browser.Document.CreateTextNode(""));  // Webkit hack
            Browser.Document.Head.AppendChild(style);
            var styleSheet = style.As <JsObject>()["sheet"].As <StyleSheet>();

            GlobalStyle = new GlobalStyle(styleSheet);
            return(TaskConstants.Completed);
        }
        bool GlobalStyle.ISource.TryGetGlobalProperty <T>(string name, out T value)
        {
            if (_GlobalStyle == null)
            {
                // initialize
                new FontStyle(Drawing.Fonts.HersheyFont.Default, ColorStyle.White, 0.1f, Drawing.Fonts.FontAlignStyle.FlipAuto)
                .TrySetDefaultFontTo(ref _GlobalStyle);
            }

            return(GlobalStyle.TryGetGlobalProperty(_GlobalStyle, name, out value));
        }
Beispiel #6
0
 public void Styles()
 {
     GlobalStyle.SetStyleForm(Controls);
     radGridView1.TableElement.Padding     = new Padding(0);
     radGridView1.TableElement.DrawBorder  = false;
     radGridView1.TableElement.CellSpacing = -1;
     radGridView1.TableElement.Text        = "";
     radGridView1.TableElement.RowHeight   = 80;
     radGridView1.MasterTemplate.BestFitColumns();
     radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
 }
    public static void print_render_info(GlobalRenderInformation info)
    {
        print_render_info((RenderInformationBase)info);

        // and finally the styles
        Console.WriteLine("\nStyles: ");
        for (int j = 0; j < info.getNumGlobalStyles(); ++j)
        {
            GlobalStyle style = info.getGlobalStyle(j);
            print_style(style, j);
        }
    }
Beispiel #8
0
 private void AddStyle()
 {
     GlobalStyle.SetStyleForm(Controls);
     radGridView1.TableElement.Padding     = new Padding(0);
     radGridView1.TableElement.DrawBorder  = false;
     radGridView1.TableElement.CellSpacing = -1;
     radGridView1.TableElement.Text        = "";
     radGridView1.TableElement.RowHeight   = 60;
     radGridView1.MasterTemplate.BestFitColumns();
     date_begin.Format        = DateTimePickerFormat.Custom;
     date_End.Format          = DateTimePickerFormat.Custom;
     date_begin.CustomFormat  = "MMM - dd - yyyy";
     date_End.CustomFormat    = "MMM - dd - yyyy";
     date_End.NullableValue   = null;
     date_begin.NullableValue = null;
     radGridView1.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
 }
        public ReplayFile(Stream stream)
        {
            var reader = new BinaryReader(stream);

            var magic = reader.ReadUInt32();

            if (magic != Magic)
            {
                throw new Exception("Unrecognised replay file format.");
            }

            FormatVersion = reader.ReadByte();
            PluginVersion = reader.ReadSmString();

            MapName       = reader.ReadSmString();
            Course        = reader.ReadInt32();
            Mode          = (GlobalMode)reader.ReadInt32();
            Style         = (GlobalStyle)reader.ReadInt32();
            Time          = TimeSpan.FromSeconds(reader.ReadSingle());
            TeleportsUsed = reader.ReadInt32();
            SteamId       = reader.ReadInt32();
            SteamId2      = reader.ReadSmString();
            reader.ReadSmString();
            PlayerName = reader.ReadSmString();
            var tickCount = reader.ReadInt32();

            TickRate = (int)Math.Round(tickCount / Time.TotalSeconds);

            Ticks.Clear();

            for (var i = 0; i < tickCount; ++i)
            {
                Ticks.Add(new TickData
                {
                    Position = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle()),
                    Angles   = new Vector2(reader.ReadSingle(), reader.ReadSingle()),
                    Buttons  = (Button)reader.ReadInt32(),
                    Flags    = (EntityFlag)reader.ReadInt32()
                });
            }
        }
Beispiel #10
0
        protected virtual void InitializeGlobalStyle()
        {
            var style = Browser.Document.CreateElement("style");

            style.AppendChild(Browser.Document.CreateTextNode(""));  // Webkit hack
            Browser.Document.Head.AppendChild(style);
            var styleSheet = style.As <JsObject>()["sheet"].As <StyleSheet>();

            // Reset the styles to a clean base

/*
 *          styleSheet.InsertRule("html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; }", 0);
 *          styleSheet.InsertRule("strong, b { font-weight: bold; }", 0);
 *          styleSheet.InsertRule("* { box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; }", 0);
 *          styleSheet.InsertRule("article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }", 0);
 *          styleSheet.InsertRule("html, body { height: 100%; }", 0);
 *          styleSheet.InsertRule("ol, ul { list-style: none; }", 0);
 *          styleSheet.InsertRule("blockquote, q { quotes: none; }", 0);
 *          styleSheet.InsertRule("blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }", 0);
 *          styleSheet.InsertRule("table { border-collapse: separate; border-spacing: 0; }", 0);
 */

            GlobalStyle = new GlobalStyle(styleSheet);
        }
 /// <inheritdoc/>
 bool GlobalStyle.ISource.TrySetGlobalProperty <T>(string name, T value)
 {
     return(GlobalStyle.TrySetGlobalProperty(_Target, name, value));
 }
Beispiel #12
0
 /// <inheritdoc/>
 bool GlobalStyle.ISource.TryGetGlobalProperty <T>(string name, out T value)
 {
     return(GlobalStyle.TryGetGlobalProperty(_Owner, name, out value));
 }
 public Canvas2DFactory()
 {
     GlobalStyle.TrySetGlobalProperty(ref _GlobalStyle, GlobalStyle.FONT, InteropTypes.Graphics.Drawing.Fonts.HersheyFont.Default);
 }
 public bool TrySetGlobalProperty <T>(string name, T value)
 {
     return(GlobalStyle.TrySetGlobalProperty(ref _GlobalStyle, name, value));
 }