I've been looking through various DAML references but can't seem to find esri_geodatabase_folderConnectionContainer and alternative values for placeswith when defining a custom project item container in Config.DAML. I'm following the "ProConcepts Custom Items" document. I'm developing an add-in that needs to store private data in the project and am thinking a custom project item is the way to do it. If possible I'd prefer the project item not be visible to the use.
Solved! Go to Solution.
This Pro Guide might help: ProGuide-Custom-settings
Note that OnReadSettingsAsync is called only if you _have_ settings in a given aprx (and the module is already loaded). It is called when the project is opened. OnWriteSettingsAsync will be called on project save.
HI Alan,
You can use BackStage_PropertyPage ArcGIS Pro sample to store private data in the project. More info here:
Thanks, Gintautas, I'd discovered that after posting this question. This approach seems to require creating a property sheet that is displayed in the backstage, which is undesirable in my case. It's also limited to string representations, not a big deal, but less than ideal. I really want to store complex data, preferably without it being visible to the user.
It looks like it might be possible to do a property page that displays only a minimal number of properties but actually store many more behind the scene. I'm implementing an experiment today.
In ArcObjects our application stored private custom data by storing a custom object as a PageLayoutExtension.
Hi Alan,
You can use project settings without user interface. You can find implementation in module class. All complex settings you can serialize and store as strings
Get Outlook for Android<https://aka.ms/ghei36>
I tried that yesterday. The debugger shows that OnReadSettingsAsync() and OnWriteSettingsAsync() are never being called. That's why it appears to me a property page is necessary.
Unless it's possible to instantiate ModuleSettingsReader and ModuleSettingsWriter in my module and make those calls form within the module?
Hi Alan, Is your Add-in set to autoload? (Config.daml "Autoload" attribute set to true)
Otherwise the add-in will only load when needed.
Modules are declared within the root ArcGIS element but must be further enclosed within a module's container element. The autoLoad attribute is used to control whether the module is loaded just-in-time (JIT)—the default—or automatically when the application starts. In almost all cases, autoLoad should be set to false.
<modules> <insertModule id="acme_mainModule" caption="Acme" className="MainModule" autoLoad="false"> <!--Declare additional customizations here..--> </insertModule> </modules>
If declaring a new module, all constituent plug-in declarations contained within the insertModule element are implicitly inserts, so the insert prefix on element names can be omitted (for example, insertButton becomes simply button).
Thank you, Uma, but that does not cause OnReadSettingsAsync() or OnWriteSettingsAsync() to be called, it only changes when my breakpoint in Initialize() is hit.
This Pro Guide might help: ProGuide-Custom-settings
Note that OnReadSettingsAsync is called only if you _have_ settings in a given aprx (and the module is already loaded). It is called when the project is opened. OnWriteSettingsAsync will be called on project save.
BINGO! Thanks...