I recently upgraded our application to use the MapSuite Winforms Desktop Edition 9.0.0.0. After I had updated to the 9.0.0.0 dlls, I started getting nearly 200 compiler warnings in Visual Studio 2013 that the MapSuite.Core.AreaStyles is obsolete (also TextStyles, PointStyles, LineStyles). The warning recommends using the WorlMapKitAreaStyles (also WorldMapKitTextStyles, WorldMapKitPointStyles, WorldMapKitLineStyles).
Most of my warnings were on calls that were using the "CreateSimpleAreaStyle" type methods to quickly create an AreaStyle. I do not see any "CreateSimple" methods in the WorldMapKitAreaStyles (also applies to similar CreateSimple methods in TextStyles, PointStyles, LineStyles).
Are the "CreateSimple" methods available in the new class structure? Is there an alternate way to quickly create a new Style?
Thanks for any help.
Richard
MapSuite.Core.AreaStyles is obsolete
Hi Richard,
I think you can keep use original APIs, because the WorldMapKit…Styles provide more style for choose, but for "CreateSimple…" method you can only use …Styles.
Regards,
Don
I just ran into the same problem. What is the replacement for AreaStyles.CreateSimpleAreaStyle and LineStyles.CreateSimpleLineStyle? You can’t mark something as obsolete and then tell consumers to just use it anyway. And I can’t seem to find what I need for a direct replacement.
Hi Russ,
I am sorry I don’t know why the APIs set as obsoleted, please just ignore the warning for now.
I will ask for more detail about that.
Regards,
Don
Guys,
We were not meaning to obsolete those “create” methods, this is a mistake we’ve added the obsolete message to the class but not just the predefined styles. We would fix it in the daily build in a couple days.
And we just want to guide users to use the new predefined styles and not going to really get rid of those old ones, that’s why we don’t have something like “this API will be removed from version X.X” in the obsolete message.
Thanks,
Ben
Thank you. Please let me know as soon as this correction makes it to the production build. We have a hard requirement that our products build without warnings, and we are now forced to use classes marked obsolete when it should actually be only a subset of properties that are marked obsolete. For now, I’ve littered our code with #pragmas to stop the warning, but that is only acceptable for the short term. We also cannot use your development build for anything other than development and test work. For any product deployed beyond the development and test team we can only use the production build.
Yes Thank you.
I echo most of what Russ has said. Although, we do not have a hard requirement to build without warnings, it is a goal of our project to do so. I do not mind when progress causes code to become obsolete but I was having trouble finding documentation or samples that showed how the new classes could be used to replace the older. We also must use production builds in our delivered product and we use the development builds very seldom except for testing. Please alert us when this will make it into the production build.
Thanks.
Richard
Russ and Richard,
The changes should be available in daily build on Friday, both dev and release branches, and the version number should be 9.0.65.0/9.0.0.65 or later.
Thanks,
Ben
Thanks, I’ll be looking for that build.
Changes have been applied to the source and should be available on Friday as scheduled. Let me know if you see any issues then.
I’m running production 9.0.0.77 and still receive these warnings. Is the fix only in the dev builds?
Hi Clay,
We also applied the changes to the release branch. Not removing the obsolete message from those classes completely , we remove it from the class attribution but keep them at their static properties, using their static method like Createxxx() won’t have such message. So, I am guessing if you are still using those static properties like AreaStyles.Waters etc?
Thanks,
Troy
Troy,
I tried the build 9.0.0.78 and the warnings are no longer there when I compile but I am now having difficulty loading shapefiles to a ShapefileFeatureLayer. I was using build 9.0.21.0 and the shapefile read in correctly or more precisely when I tried to get the features with
FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns)
it would return all the columns for each field in the database defined for the shapefile. When I build using 9.0.0.78, the features are returned but the columns array is empty. At the moment I cannot see any daily production build except 9.0.0.78. Any ideas why the shapefile no longer load correctly?
Richard Styer
Hi Richard,
FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns) return empty have been fixed but it looks the release version hadn’t been update after 78.
I will let our release manager knows it, please wait the new package.
Thanks for let us know that.
Regards,
Don