Loads a server style file into the SymbologyControl.
[Visual Basic .NET] Public Sub LoadStyleFile ( _ ByVal fileName As String _ )
[C#] public void LoadStyleFile ( string fileName );
[C++]
HRESULT LoadStyleFile(
BSTR fileName
);
[C++]Parameters
fileName [in] fileName is a parameter of type BSTR
Product Availability
Description
Loads the contents of the specified server style file (*.ServerStyle) into the SymbologyControl. Each ServerStyleGalleryItem within the server style file is added to a SymbologyStyleClass based on its type. For example, a SimpleFillSymbol will be added to the esriStyleClassFillSymbols SymbologyStyleClass.
Items are 'demand loaded' to the end of a SymbologyStyleClass item collection. This is done to increase performance and means items are only loaded into a SymbologyStyleClass when it is the current StyleClass or when the SymbologyStyleClass is being accessed programmatically. To force items to be loaded into a SymbologyStyleClass when it is not the current StyleClass, use the ISymbologyStyleClass::Update method.
Passing the same server style file to the LoadStyleFile method multiple times within the lifetime of an application, causes the contents of the server style file to be re-loaded into the SymbologyControl.
Errors Returned
1008 800a03f0: The file is not recognized as a Server Style file.
1054 800a041e: The specified filename is invalid.
1075 800a0433: ArcGIS for Desktop is not installed on this machine so Style files cannot be read.
Remarks
Server Styles are collections of symbols and map elements that are often grouped by functionality. For example, symbols and map elements used by the transportation industry maybe grouped into Transportation Server Style.
Server Styles are stored in files that have a .ServerStyle extension. Esri provides several styles for you to use out of the box. These styles are found under \\install_location\ArcGIS\Styles. You will find commonly used symbols and map elements in ESRI.ServerStyle, and more domain specific style items in relevantly named .ServerStyle files (for example, Transportation.ServerStyle).
A style is composed of several style items. These style items provide access to individual map elements and symbols. Style items are organized into style classes, which are types of style items. A style class may have several groups of items organized into categories. For example, Precipitation is a style item that belongs to the Color Ramps style class and the Default Ramps category.