Class StyleInfoStore
Provides storage for the StyleInfoBase object.
Inheritance
Namespace: Syncfusion.UI.Xaml.CellGrid.Styles
Assembly: Syncfusion.SfCellGrid.UWP.dll
Syntax
public abstract class StyleInfoStore : Object, IDisposable, ICloneable, IStyleInfo, IXmlSerializable
Remarks
You cannot instantiate a StyleInfoStore class directly. You have to derive a concrete class from this class that you can instantiate.
In derived classes of StyleInfoBase, you always need to implement a StyleInfoBase / StyleInfoStore pair. The StyleInfoStore holds all the data that are specific to the style object and should be persisted.
The StyleInfoBase is a wrapper around the StyleInfoStore. It provides type safe accessor properties to modify data of the underlying data store and can hold temporary information about the style object that does not need to be persisted.
In Essential Grid for example, the GridStyleInfo class holds extensive identity information about a style object such as cached base styles, row and column index, a reference to the grid model and more. These are all the information that can be discarded when the style is no longer used (because maybe the cell is not visible anymore). Only the StyleInfoStore part needs to be kept alive.
StyleInfoStore allows you to register any number of properties but keeps the data very memory efficient. Only properties that are actually used for a style object will be allocated for an object. The StyleObjectStore handles the storage of objects. For short integers, enums and Boolean values the data will be stored in a BitVector32 structure to save even more memory.
See the overview for StyleInfoBase for further discussion about style objects.
Constructors
StyleInfoStore()
Initializes an empty StyleInfoStore.
Declaration
protected StyleInfoStore()
Properties
IsChanged
Indicates whether any properties have been changed.
Declaration
public bool IsChanged { get; }
Property Value
Type |
---|
System.Boolean |
IsEmpty
Indicates whether this is an empty object and no properties have been initialized.
Declaration
public bool IsEmpty { get; }
Property Value
Type |
---|
System.Boolean |
PropertyGridSortOrder
The PropertyGridSortOrder class checks this property to find out about the sort order of the properties in this StyleInfoStore.
Declaration
public string[] PropertyGridSortOrder { get; }
Property Value
Type |
---|
System.String[] |
StaticDataStore
Static data must be declared static in derived classes (this avoids collisions when StyleInfoStore is used in the same project for different types of style classes).
Declaration
protected abstract StaticData StaticDataStore { get; }
Property Value
Type |
---|
StaticData |
Store
Declaration
public StyleInfoStore Store { get; }
Property Value
Type |
---|
StyleInfoStore |
StyleInfoProperties
Returns a collection with StyleInfoProperty objects.
Declaration
public ICollection StyleInfoProperties { get; }
Property Value
Type |
---|
System.Collections.ICollection |
Methods
Clear()
Clears out all properties for this StyleInfoStore.
Declaration
public void Clear()
Clone()
Creates an exact copy of the current object.
Declaration
public virtual object Clone()
Returns
Type | Description |
---|---|
System.Object | A StyleInfoStore with same data as the current object. |
CopyTo(StyleInfoStore)
Copies all properties to another StyleInfoStore.
Declaration
public void CopyTo(StyleInfoStore target)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoStore | target | The target to copy all properties to. |
Dispose()
Call the Dispose and SuppressFinalize method for dipose the instance of StyleInfoStore class.
Declaration
public void Dispose()
Dispose(Boolean)
Dispose the live resources used by the StyleInfoStore class.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Dispose the instance, if it is True |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type |
---|
System.Boolean |
FindStyleInfoProperty(String)
Searches the StyleInfoProperty with the given name.
Declaration
public StyleInfoProperty FindStyleInfoProperty(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the property to look for. |
Returns
Type | Description |
---|---|
StyleInfoProperty | A StyleInfoProperty that is associated with the specified name. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
---|
System.Int32 |
GetSchema()
Declaration
public XmlSchema GetSchema()
Returns
Type |
---|
System.Xml.Schema.XmlSchema |
GetShortValue(StyleInfoProperty)
Queries the System.Int16 value for a specific property that has been initialized for the current object.
Declaration
public short GetShortValue(StyleInfoProperty sip)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoProperty | sip | A StyleInfoProperty that identifies the property to operate on. |
Returns
Type |
---|
System.Int16 |
GetValue(StyleInfoProperty)
Queries the value for a specific property that has been initialized for the current object.
Declaration
public virtual object GetValue(StyleInfoProperty sip)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoProperty | sip | A StyleInfoProperty that identifies the property to operate on. |
Returns
Type |
---|
System.Object |
HasValue(StyleInfoProperty)
Indicates whether a specific property has been initialized for the current object.
Declaration
public bool HasValue(StyleInfoProperty sip)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoProperty | sip | A StyleInfoProperty that identifies the property to operate on. |
Returns
Type |
---|
System.Boolean |
IsSubset(IStyleInfo)
Compares all properties with another style object and determines if the current set of initialized properties is a subset of the other style object.
Declaration
public bool IsSubset(IStyleInfo istyle)
Parameters
Type | Name | Description |
---|---|---|
IStyleInfo | istyle | The other style to compare with. |
Returns
Type | Description |
---|---|
System.Boolean | True if this style object is a subset of the other style object. |
IsValueModified(StyleInfoProperty)
Indicates whether a specific property has been modified for the current object.
Declaration
public bool IsValueModified(StyleInfoProperty sip)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoProperty | sip | A StyleInfoProperty that identifies the property to operate on. |
Returns
Type |
---|
System.Boolean |
MergeStyle(IStyleInfo)
Merges two styles. Resets all properties that differ among the two style objects and keeps only those properties that are equal.
Declaration
public void MergeStyle(IStyleInfo istyle)
Parameters
Type | Name | Description |
---|---|---|
IStyleInfo | istyle | The other style object this style object should merge with. |
ModifyStyle(IStyleInfo, StyleModifyType)
Applies changes to a style object as specified with StyleModifyType.
Declaration
public void ModifyStyle(IStyleInfo istyle, StyleModifyType mt)
Parameters
Type | Name | Description |
---|---|---|
IStyleInfo | istyle | The style object to be applied on the current object. |
StyleModifyType | mt | The actual operation to be performed. |
ParseString(String)
Declaration
public void ParseString(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s |
ProcessReadXml(XmlReader, StyleInfoProperty)
Allows customization of serializing the StyleInfoProperty. Returns True if you override this method and do not want default serialization behavior for this property.
Declaration
protected virtual bool ProcessReadXml(XmlReader reader, StyleInfoProperty sip)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | |
StyleInfoProperty | sip |
Returns
Type |
---|
System.Boolean |
ProcessWriteXml(XmlWriter, StyleInfoProperty)
Allows customization of serializing the StyleInfoProperty. Returns True if you override this method and do not want default serialization behavior for this property.
Declaration
protected virtual bool ProcessWriteXml(XmlWriter writer, StyleInfoProperty sip)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | |
StyleInfoProperty | sip |
Returns
Type |
---|
System.Boolean |
ReadXml(XmlReader)
Serializes all properties of this object from XML.
Declaration
public void ReadXml(XmlReader r)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | r |
RegisterXmlSerializer(Type, XmlSerializer)
Registers the XmlSerializer for a specific type. This XmlSerializer will be used when a object of the specified type is read back in from an xml stream. You can for example register an "ImageHolder" serializer for a custom ImageHolder type and have that serializer be used when GridStyleInfo.CellValue contains an ImageHolder object.
Declaration
public static void RegisterXmlSerializer(Type type, XmlSerializer xmlSerializer)
Parameters
Type | Name | Description |
---|---|---|
System.Type | type | |
System.Xml.Serialization.XmlSerializer | xmlSerializer |
Examples
XmlSerializer imageHolderSerializer = new XmlSerializer(typeof(object), new Type[] { typeof(ImageHolder) });
GridStyleInfoStore.RegisterXmlSerializer(typeof(ImageHolder), imageHolderSerializer);
ResetChangedBits()
Resets all "Changed" bits that mark certain properties as modified.
Declaration
public void ResetChangedBits()
ResetValue(StyleInfoProperty)
Marks a specific property as uninitialized for the current object.
Declaration
public void ResetValue(StyleInfoProperty sip)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoProperty | sip | A StyleInfoProperty that identifies the property to operate on. |
SetValue(StyleInfoProperty, Int16)
Initializes the System.Int16 value for a specific property.
Declaration
public void SetValue(StyleInfoProperty sip, short value)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoProperty | sip | A StyleInfoProperty that identifies the property to operate on. |
System.Int16 | value | The value to be saved for the property. |
SetValue(StyleInfoProperty, Object)
Overloaded. Initializes the value for a specific property.
Declaration
public void SetValue(StyleInfoProperty sip, object value)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoProperty | sip | A StyleInfoProperty that identifies the property to operate on. |
System.Object | value | The value to be saved for the property. |
SetValueModified(StyleInfoProperty, Boolean)
Marks a specific property as modified or unmodified for the current object.
Declaration
public void SetValueModified(StyleInfoProperty sip, bool value)
Parameters
Type | Name | Description |
---|---|---|
StyleInfoProperty | sip | A StyleInfoProperty that identifies the property to operate on. |
System.Boolean | value | The new value. |
ToString()
Declaration
public override string ToString()
Returns
Type |
---|
System.String |
WriteXml(XmlWriter)
Serializes all properties of this object to XML.
Declaration
public void WriteXml(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer |