Microsoft Content Management Server - programmatically remove custom property definitions

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > January 2005 > programmatically remove custom property definitions





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author programmatically remove custom property definitions
Nikolaj

2005-01-04, 7:47 am

Thanks to this newsgroup I have discovered how to create custom property
definitions programatically.
template.CreateCustomPropertyDefinition();

Is it also possible to remove custom property definitions.

The idea is that the cp definitions of my template should always match a
collection of checkboxes and dropdownlists on my template file (aspx).

This way I design a user interface in visual studio and save values in
custom properties.

Thanks.
Mei Ying [MVP]

2005-01-04, 8:46 pm

You could do it by calling CustomerPropertyDefinition.Delete(). But I'd be
careful with that - once the custom property definition is deleted, there's
no easy way to get the custom property values back!

--
regards
Mei Ying
---
Blog: http://meiyinglim.blogspot.com
Contact: meiyinglim@hotmail.com
---
"Nikolaj" <Nikolaj@discussions.microsoft.com> wrote in message
news:6C1E7593-80B7-4A79-8B1D-FFB80225C6DD@microsoft.com...
> Thanks to this newsgroup I have discovered how to create custom property
> definitions programatically.
> template.CreateCustomPropertyDefinition();
>
> Is it also possible to remove custom property definitions.
>
> The idea is that the cp definitions of my template should always match a
> collection of checkboxes and dropdownlists on my template file (aspx).
>
> This way I design a user interface in visual studio and save values in
> custom properties.
>
> Thanks.



Stefan [MSFT]

2005-01-04, 8:46 pm

Hi Nikolaj,

sure! Retrieve the CustomPropertyDefintion object you need to delete and
call it's Delete method.

Cheers,
Stefan.


"Nikolaj" <Nikolaj@discussions.microsoft.com> wrote in message
news:6C1E7593-80B7-4A79-8B1D-FFB80225C6DD@microsoft.com...
> Thanks to this newsgroup I have discovered how to create custom property
> definitions programatically.
> template.CreateCustomPropertyDefinition();
>
> Is it also possible to remove custom property definitions.
>
> The idea is that the cp definitions of my template should always match a
> collection of checkboxes and dropdownlists on my template file (aspx).
>
> This way I design a user interface in visual studio and save values in
> custom properties.
>
> Thanks.



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com