More actions
Nguyenduyan (talk | contribs) No edit summary |
Nguyenduyan (talk | contribs) No edit summary |
||
Line 23: | Line 23: | ||
<source lang="javascript"> | <source lang="javascript"> | ||
//Example for creating new properties | |||
</source> | number folderResourceTemplateRId = 15547989; | ||
<br><source lang="javascript"> | ResourceTemplateHelper rth = new ResourceTemplateHelper (); | ||
FolderResourceTemplate folderRT = rth.GetTemplate(folderResourceTemplateRId); | |||
new ResourceTemplatePropertyNumber ("propertyNameTypeNumber",false,"description",folderRT); | |||
folderRT.SaveProperties(); | |||
</source><br/><source lang="javascript"> | |||
//Example for working with existing properies | |||
number folderResourceTemplateRId = 15547989; | |||
ResourceTemplateHelper rth = new ResourceTemplateHelper (); | |||
FolderResourceTemplate folderRT = rth.GetTemplate(folderResourceTemplateRId); | |||
array arrayProperty = folderRT.Properties; | |||
ResourceTemplatePropertyNumber propertyNumber = arrayProperty[0]; | |||
propertyNumber.IsDecimal=true; | |||
folderRT.SaveProperties(); | |||
</source> | </source> |
Revision as of 06:42, 16 November 2016
ResourceTemplatePropertyNumber
A numeric property on a resource template
Constructors
- (string label "Set label", bool required "Set required", string description "Set description", ResourceTemplate resourceTemplate "ResourceTemplate property gets added to") - Create new numeric property
Methods
Properties
- string Description { get; set; } - Get/set Description
- bool IsDecimal { get; set; } - Get/set IsDecimal
- string Label { get; set; } - Get/set Label
- number MaxValue { get; set; } - Get/set MaxValue, -1 if unset
- number MinValue { get; set; } - Get/set MinValue, -1 if unset
- string ObjectTypeName { get; } - The name of the type of object.
- bool Required { get; set; } - Get/set Required
- TypeInformation TypeInformation { get; } - Get information about this class.
Examples
//Example for creating new properties
number folderResourceTemplateRId = 15547989;
ResourceTemplateHelper rth = new ResourceTemplateHelper ();
FolderResourceTemplate folderRT = rth.GetTemplate(folderResourceTemplateRId);
new ResourceTemplatePropertyNumber ("propertyNameTypeNumber",false,"description",folderRT);
folderRT.SaveProperties();
//Example for working with existing properies
number folderResourceTemplateRId = 15547989;
ResourceTemplateHelper rth = new ResourceTemplateHelper ();
FolderResourceTemplate folderRT = rth.GetTemplate(folderResourceTemplateRId);
array arrayProperty = folderRT.Properties;
ResourceTemplatePropertyNumber propertyNumber = arrayProperty[0];
propertyNumber.IsDecimal=true;
folderRT.SaveProperties();