StyleDefinition

We found 10 examples in language CSharp for this search. You will see 17 fragments of code.

Other methods


        public bool Equals(StyleDefinition styleDefinition)
        {
            if (styleDefinition == null)
            {
                return false;
            }
            return Equals(Href, styleDefinition.Href) && Equals(Media, styleDefinition.Media);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(this, obj))
            {
                return true;
            }
            return Equals(obj as StyleDefinition);
        }


        public bool Equals(StyleDefinition styleDefinition)
        {
            if(styleDefinition == null)
            {
                return false;
            }
            return Equals(Href, styleDefinition.Href) && Equals(Media, styleDefinition.Media);
        }

        public override bool Equals(object obj)
        {
            if(ReferenceEquals(this, obj))
            {
                return true;
            }
            return Equals(obj as StyleDefinition);
        }


        public bool Equals(StyleDefinition styleDefinition)
        {
            if(styleDefinition == null)
            {
                return false;
            }
            return Equals(Href, styleDefinition.Href) && Equals(Media, styleDefinition.Media);
        }

        public override bool Equals(object obj)
        {
            if(ReferenceEquals(this, obj))
            {
                return true;
            }
            return Equals(obj as StyleDefinition);
        }

            public Cell CreateCell(List<StyleDefinition> styles, string value)
            {
                return new Cell { Styles = styles, Value = value };
            }
    
            public List<Cell> CreateRow(Dictionary<int, List<StyleDefinition>> styles, IEnumerable<string> values)
            {
                var res = new List<Cell>();
                var it = values.GetEnumerator();
                foreach( var kp in styles) {
                    // logic for cell with key = kp.Key
                    res.Add(CreateCell(kp.Value, it.Current));
                    it.MoveNext();
                }
    
                return res;
            }


		private void SaveToIniClicked(object sender, RoutedEventArgs e)
		{
			Logger.Info("Saving style {0} to DmdDevice.ini...", StyleNameComboBox.Text);
			var styleName = NewStyleName ?? StyleNameComboBox.Text;
			_alphaNumericConfig.SetStyle(styleName, _displaySetting.StyleDefinition);
			StyleSelectionChanged(styleName);
			StyleNameComboBox.ItemsSource = StyleNames;
			StyleNameComboBox.SelectedItem = styleName;
		}

		private void LoadFromIniClicked(object sender, RoutedEventArgs e)
		{
			_displaySetting.StyleDefinition = _alphaNumericConfig.GetStyle(NewStyleName);
			RasterizeAll();
			UpdateControls();
		}

		private void ApplyClicked(object sender, RoutedEventArgs e)
		{
			OnStyleApplied.OnNext(_displaySetting.StyleDefinition.Copy());
			if (NewStyleName != null) {
				_alphaNumericConfig.ApplyStyle(NewStyleName);
			}
		}


        public bool Equals(StyleDefinition styleDefinition)
        {
            if(styleDefinition == null)
            {
                return false;
            }
            return Equals(Href, styleDefinition.Href) && Equals(Media, styleDefinition.Media);
        }

        public override bool Equals(object obj)
        {
            if(ReferenceEquals(this, obj))
            {
                return true;
            }
            return Equals(obj as StyleDefinition);
        }


        public StyleSheet ImportStyleSheetFromFile(string fileName, MaterialDatabase materialDatabase) {
            return Import(new StyleDefinition(null, fileName), materialDatabase, true);
        }


		public void ApplyStyle(RasterizeStyleDefinition styleDef)
		{
			StyleDefinition = styleDef;
			Style = StyleDefinition.Scale(Dim.SvgScale);
		}

using WebMaker.Html.Style;

namespace WebMaker.Web.General
{
    /// <summary>
    /// Základní webový styl
    /// </summary>
    public class BasicWebStyle : WebStyle
    {
        public static readonly StyleColor BasicColor = new StyleColor(104, 154, 248);
        public static readonly StyleColor DarkGray = new StyleColor(202);
        public static readonly StyleColor LightGray = new StyleColor(231);

        /// <summary>
        /// Vytvoří instanci třídy BasicWebStyle
        /// </summary>
        /// <param name="foreground">Barva stylu</param>
        public BasicWebStyle(StyleColor background, StyleColor foreground, int borderRadius = 0, int navBorderWidth = 10)
        {
            const int navAPadding = 10;
            const int navAMinWidth = 175;
            const int transition = 100;
            const int mainMinWidth = 500;
            const int mainMaxWidth = 1000;
            const int mainMargin = 20;
            const int marginBottom = 20;

            StyleSheet = new StyleSheet()
            {
                new StyleDefinition("*")
                {
                    new ZeroStyleAttribute("margin"),
                    new ZeroStyleAttribute("padding")
                },
                new StyleDefinition("body")
                {
                    new ColorStyleAttribute("background-color", background),
                    new TextStyleAttribute("font-family", "Arial, Helvetica, sans-serif"),
                },
                new StyleDefinition("nav")
                {
                    new ColorStyleAttribute("background-color", background),
                    new TextStyleAttribute("padding", "auto"),

                    new PixelStyleAttribute("border-width", navBorderWidth),
                    new TextStyleAttribute("border-style", "solid"),
                    new ColorStyleAttribute("border-color", foreground),
                    new NoneStyleAttribute("border-left-style"),
                    new NoneStyleAttribute("border-right-style"),
                    new NoneStyleAttribute("border-top-style")
                },
                new StyleDefinition("nav a")
                {
                    new ColorStyleAttribute("background-color", background),
                    new ColorStyleAttribute("color", StyleColor.Black),

                    new TextStyleAttribute("display", "inline-block"),

                    new PixelStyleAttribute("padding-top", navAPadding),
                    new PixelStyleAttribute("padding-bottom", navAPadding),
                    new PixelStyleAttribute("min-width", navAMinWidth),

                    new TextStyleAttribute("text-align", "center"),
                    new NoneStyleAttribute("text-decoration"),

                    new PixelStyleAttribute("border-radius", borderRadius)
                },
                new StyleDefinition("nav a:visited")
                {
                    new TextStyleAttribute("color", "inherit")
                },
                new StyleDefinition("nav a:hover")
                {
                    new ColorStyleAttribute("background-color", foreground + background),
                    new UnitStyleAttribute("transition", transition, AttributeUnit.Ms)
                },
                new StyleDefinition("nav a.selected, nav a:active")
                {
                    new ColorStyleAttribute("background-color", foreground)
                },
                new StyleDefinition("nav a.selected")
                {
                    new TextStyleAttribute("font-weight", "bold")
                },
                new StyleDefinition("main")
                {
                    new PixelStyleAttribute("min-width", mainMinWidth),
                    new PixelStyleAttribute("max-width", mainMaxWidth),
                    new PixelStyleAttribute("margin", mainMargin),
                },
                new StyleDefinition("h1, h2, h3, h4, h5, h6, p, img, ol, ul")
                {
                    new PixelStyleAttribute("margin-bottom", marginBottom)
                },
                new StyleDefinition("ol, ul")
                {
                    new TextStyleAttribute("list-style-position", "inside")
                },
            };
        }

        public BasicWebStyle() : this(LightGray, BasicColor)
        {
        }
    }
}


        public static StyleDefinition GetVisualStyle(MyGuiControlButtonStyleEnum style)
        {
            return m_styles[(int)style];
        }

DocumentFormat.OpenXml.Drawing.Diagrams.StyleDefinition : IEnumerable

Constructors :

public StyleDefinition()
public StyleDefinition(IEnumerable<OpenXmlElement> childElements = )
public StyleDefinition(OpenXmlElement[] childElements = )
public StyleDefinition(String outerXml = )

Methods :

public StringValue get_UniqueId()
public Void set_UniqueId(StringValue value = )
public StringValue get_MinVersion()
public Void set_MinVersion(StringValue value = )
public OpenXmlElement CloneNode(Boolean deep = )
public Void Load(DiagramStylePart openXmlPart = )
public Void Save(DiagramStylePart openXmlPart = )
public DiagramStylePart get_DiagramStylePart()
public Void Save(Stream stream = )
public Void Save()
public Void Reload()
public Void WriteTo(XmlWriter xmlWriter = )
public OpenXmlElement get_FirstChild()
public OpenXmlElement get_LastChild()
public Boolean get_HasChildren()
public String get_InnerText()
public Void set_InnerXml(String value = )
public Boolean AddChild(OpenXmlElement newChild = , Boolean throwOnError = True)
public T AppendChild(T newChild = )
public T InsertAfter(T newChild = , OpenXmlElement referenceChild = )
public T InsertBefore(T newChild = , OpenXmlElement referenceChild = )
public T InsertAt(T newChild = , Int32 index = )
public T PrependChild(T newChild = )
public T RemoveChild(T child = )
public Void RemoveAllChildren()
public T ReplaceChild(OpenXmlElement newChild = , T oldChild = )
public Void RemoveAllChildren()
public Void Remove()
public Boolean IsAfter(OpenXmlElement element = )
public Boolean IsBefore(OpenXmlElement element = )
public Void AddAnnotation(Object annotation = )
public T Annotation()
public Object Annotation(Type type = )
public IEnumerable<T> Annotations()
public IEnumerable<Object> Annotations(Type type = )
public Void RemoveAnnotations()
public Void RemoveAnnotations(Type type = )
public IEnumerator<OpenXmlElement> GetEnumerator()
public Object Clone()
public MarkupCompatibilityAttributes get_MCAttributes()
public Void set_MCAttributes(MarkupCompatibilityAttributes value = )
public String LookupNamespace(String prefix = )
public String LookupPrefix(String namespaceUri = )
public IFeatureCollection get_Features()
public OpenXmlElementContext get_OpenXmlElementContext()
public Boolean get_HasAttributes()
public IEnumerable<OpenXmlAttribute> get_ExtendedAttributes()
public OpenXmlElementList get_ChildElements()
public OpenXmlElement get_Parent()
public String get_NamespaceUri()
public String get_LocalName()
public String get_Prefix()
public IEnumerable<KeyValuePair<StringString>> get_NamespaceDeclarations()
public XmlQualifiedName get_XmlQualifiedName()
public XName get_XName()
public String get_InnerXml()
public String get_OuterXml()
public OpenXmlAttribute GetAttribute(String localName = , String namespaceUri = )
public IList<OpenXmlAttribute> GetAttributes()
public Void SetAttribute(OpenXmlAttribute openXmlAttribute = )
public Void RemoveAttribute(String localName = , String namespaceUri = )
public Void SetAttributes(IEnumerable<OpenXmlAttribute> openXmlAttributes = )
public Void ClearAllAttributes()
public Void AddNamespaceDeclaration(String prefix = , String uri = )
public Void RemoveNamespaceDeclaration(String prefix = )
public T GetFirstChild()
public OpenXmlElement PreviousSibling()
public T PreviousSibling()
public OpenXmlElement NextSibling()
public T NextSibling()
public IEnumerable<OpenXmlElement> Ancestors()
public IEnumerable<T> Ancestors()
public IEnumerable<T> Elements()
public IEnumerable<OpenXmlElement> Elements()
public IEnumerable<T> Descendants()
public IEnumerable<OpenXmlElement> Descendants()
public IEnumerable<OpenXmlElement> ElementsBefore()
public IEnumerable<OpenXmlElement> ElementsAfter()
public Void Append(IEnumerable<OpenXmlElement> newChildren = )
public Void Append(OpenXmlElement[] newChildren = )
public T InsertAfterSelf(T newElement = )
public T InsertBeforeSelf(T newElement = )
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()