IStyleGallery styleGallery = new ServerStyleGalleryClass(); IStyleGalleryStorage styleStor = (IStyleGalleryStorage)styleGallery; string startupPath = Environment.CurrentDirectory; string strFilePath = startupPath + "\\Data\\Styles\\SoDo.ServerStyle"; styleStor.AddFile(strFilePath); IEnumStyleGalleryItem styleItems; styleItems = styleGallery.get_Items("Line Symbols", strFilePath, "Default"); // Return NULL value styleItems.Reset(); IStyleGalleryItem styleGalleryItem = styleItems.Next();
Solved! Go to Solution.
I know that this is stating the obvious but perhaps the server style file which was generated does not contain the thing that you are asking for.
The help reads:
"The style items from the specified style file, in the specified class and category. The style set and category may be blank to return all items"
Modify your code to get everything thing and see if that works. If it does then print out what you get.
if (styleItems != null) System.Runtime.InteropServices.Marshal.ReleaseComObject(styleItems);
styleItems = styleGallery.get_Items("Line Symbols", strFilePath,"");
I know that this is stating the obvious but perhaps the server style file which was generated does not contain the thing that you are asking for.
The help reads:
"The style items from the specified style file, in the specified class and category. The style set and category may be blank to return all items"
Modify your code to get everything thing and see if that works. If it does then print out what you get.
if (styleItems != null) System.Runtime.InteropServices.Marshal.ReleaseComObject(styleItems);
styleItems = styleGallery.get_Items("Line Symbols", strFilePath,"");