Hi Evgeny,
The following sdm model demonstrates how to extend existing Directory and File resources to create new set of Directory and File resources that can be added from Settings and Constraints Editor. In this example, myFile extends existing File resource with one additional setting called myVersion. Similarly, myDirectory resource extends existing Directory resource with one additional setting called myName.
Note that in the containment definition between myDirectory and myFile, there is no ?淪upportsUserCreation??property with value false. By default, all containment definitions support user creation. As a result, for all systems/endpoints/resources containing new myDirectory resource, the resource can be added from Settings and Constraints Editor. In this sample, we added a second containment definition between GenericApplicationEndpoint and myDirectory resource to be able to demonstrate user creation in Application Designer. If you compile and add this model to registry, when you restart Visual Studio and open Application Designer, you will see that myDirectory resource can be added to GenericApplicationEndpoint.
<?xml version="1.0" encoding="utf-8"?> <SystemDefinitionModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="myFileSystem" Version="1.0.60130.0" DocumentLanguage="en" xmlns="http://schemas.microsoft.com/SystemDefinitionModel/2005/1">
<Import Alias="FileSystem" Name="Microsoft.FileSystem" Culture="neutral" /> <Import Alias="Generic" Name="Microsoft.Generic" Culture="neutral" /> <ResourceDefinition Name="myFile" Extends="FileSystem:File" Abstract="true"> <SettingDeclaration Name="myVersion" Definition="System:Version" CanBeNull="true" /> </ResourceDefinition>
<ResourceDefinition Name="myDirectory" Extends="FileSystem:Directory" Abstract="true"> <SettingDeclaration Name="myName" Definition="System:String" /> </ResourceDefinition> <ContainmentDefinition Name="myDirectoryContainsmyFile" Extends="System:ContainmentDefinition" ParentDefinition="myDirectory" MemberDefinition="myFile" /> <ContainmentDefinition Name="GenericApplicationEndpointContainsmyDirectory" Extends="System:ContainmentDefinition" ParentDefinition="Generic:GenericApplicationEndpoint" MemberDefinition="myDirectory" />
</SystemDefinitionModel>
Thanks,
Gokhan Ozer |