﻿<?xml version="1.0" encoding="utf-8" ?>
<ControlType>
<!---
<Category> is the category or "classification" of the control. It determines how rules wizard and other designers treat the control.
	The following Categories are available: 
		Display: 	A control that has a static value/representation at runtime. (Display only, value cannot be changed with rules)
		Input: 		A control that has a dynamic value at runtime. (can be read/write and value can be set with rules)
		Listing: 	A control that has a value derived from an associated data source. Listing controls support being populated with one or more SmartObject records
		Action: 	A control usually without value that is used to perform an action by the user (example: Submit, Save, Navigate etc using Buttons, Links etc)
-->
	<Category>Display</Category>
<!--
<Group> is the name of the toolbox group where the control can be found at design time
-->
	<Group>MyCustomControlProject</Group>
<!--
<Name> is the short name for the control type stored in Form and View definitions.
-->
	<Name>MyCustomControl1</Name>
<!--
<DisplayName> is shown in the toolbox's "Controls" tab, and is the name used when creating control instance names.
	Example: MyCustomControl2_Definition, MyCustomControl2_Definition1, MyCustomControl2_Definition2 etc   
-->
	<DisplayName>MyCustomControl1</DisplayName>
<!--
<FullName> is used to load and instantiate the control. It tells smartforms where to find the control
	Format: {TypeFullName},{AssemblyName(without .dll extension)}
-->
	<FullName>MyCustomControlProject.MyCustomControl1.MyControl,MyCustomControlProject</FullName>
<!--
<GetPropertyMethod> and <SetPropertyMethod> tells smartforms which methods in the .js file should be called to Get or Set a property for the control
	Format: {TypeFullName}.methodName}
-->
	<GetPropertyMethod>MyCustomControlProject.SubFolder.MyCustomControl2.getProperty</GetPropertyMethod>
	<SetPropertyMethod>MyCustomControlProject.SubFolder.MyCustomControl2.setProperty</SetPropertyMethod>
<!--
<GetValueMethod> and <SetValueMethod> are the .js methods called when something gets or sets the control's value
-->
	<GetValueMethod>MyCustomControlProject.SubFolder.MyCustomControl2.getValue</GetValueMethod>
	<SetValueMethod>MyCustomControlProject.SubFolder.MyCustomControl2.setValue</SetValueMethod>
<!--
<GetDefaultValueMethod> is the .js method used to get the default value for the control
-->
	<GetDefaultValueMethod>MyCustomControlProject.SubFolder.MyCustomControl2.getDefaultValue</GetDefaultValueMethod>
<!--
<DataTypes> list the data types that the control supports
		Available Data types are:
		AutoGuid, AutoNumber, DateTime, Decimal, File, Guid, HyperLink, Image, Memo, MultiValue, Number, Text, Xml, YesNo
-->
	<DataTypes>
		<DataType>Text</DataType>
		<DataType>Memo</DataType>
	</DataTypes>
<!--
<Events> lists all the events that the control exposes. These events are listed in the Rules editor.
    Event handlers for non-standard JQuery events must be implemented in the control's .js file
-->
	<Events>
		<Event>OnClick</Event>
		<Event>OnChange</Event>
	</Events>
<!--
<DefaultEventName> is the default event that the Rules composer will select when the designer creates a rule for the control
-->
	<DefaultEventName>OnClick</DefaultEventName>
<!--
<Properties> defines the various properties that the control may have. These are usually shown in the 
  Properties tab when you design the form and select the control
-->
<!--
<Prop> is a property in the Properties collection. It supports the following attributes:
	ID: 			the unique name for the property
	setFunction: 	which function in the .js file should be called to set the value of the property
	friendlyName: 	the display name of the property in the design tool
	type: 			whether the property is a simple or complex type. Supported values are "simple", "drop" and "complex"
	category: 		specifies the property "group" that the property will be grouped under at design time
	refreshdisplay:	whether the control should be refreshed when the property is changed. Supported values are "true" or "false"
	DesignerSet:	the .js method called when the value is changed by the K2 designer
	DesignerValidate: the method used to validate the user's design-time input for the control. Mostly used to ensure unique Id for the control name
	inputlength:	the maximim length of design-time input for the control
    
	Below is an example of a Prop item
    <Prop ID="Property1"
			setFunction="TestClientSideControl.CustomSmartFormControlItem1.setProperty1" friendlyname="Sample Property 1" type="simple" category="General"
			refreshdisplay="true"
			DesignerSet="TestClientSideControl.CustomSmartFormControlItem1._showEditStyles" />
-->
	<Properties>
	<!--
	"ControlName" is the Controls name (identifier) 
	-->
		<Prop ID="ControlName" ValidationPattern="\S" ValidationMessage="InvalidName" refreshdisplay="true" DesignerValidate="SourceCode.Forms.Designers.validateControlName" friendlyname="Name" type="string" category="Detail" inputlength="255" />
	<!--
	"DataType" is a property that tells smartforms runtime what the controls data type is
	-->
		<Prop ID="DataType" setFunction="SetDataType" friendlyname="Data Type" type="drop" category="Detail" refreshdisplay="true" getDropItemsFunction="getDataTypesForControl" SelectionValue="" SelectionText="" inputlength="255">
			<InitialValue>Text</InitialValue>
		</Prop>
	<!--
	"CustomProp" is a custom property for the control. You can reference control properties in the code behind, see .cs file for example 
	-->
		<Prop ID="CustomProp"  friendlyname="Custom Property" type="string" category="Detail" refreshdisplay="true">
			<!--you can set a default value by setting the <Value> for the <Prop>-->
		</Prop>
	<!--
	"Value" is the default value for the control, retrieved with control.attr('value') in the .js code
	-->
		<Prop ID="Value" friendlyname="Value" type="string" category="Detail" refreshdisplay="true"/>
	<!--
	"IsVisible" is used to show or hide the control 
	-->
		<Prop ID="IsVisible" friendlyname="Visible" type="bool" category="General" refreshdisplay="true" setFunction="SetControlIsVisible">
			<Value>true</Value>
		</Prop>
	<!--
	"IsEnabled" is used to enable/disable the control
	-->
		<Prop ID="IsEnabled" friendlyname="Enabled" type="bool" category="General" refreshdisplay="true">
			<Value>true</Value>
		</Prop>
	<!--
	"ControlExpression" is used when you want to allow the designer to set the control value with an expression
	-->
		<Prop ID="ControlExpression" friendlyname="Expression" type="complex" category="General" DesignerSet="SourceCode.Forms.Designers.View.Conditions._showControlCalculation" />
	<!--
	The "Styles" property is only applicable for controls where the control Style can be changed
	-->
		<Prop ID="Styles"
			setFunction="MyCustomControlProject.SubFolder.MyCustomControl2.setStyles" friendlyname="Styles" type="complex" category="General"
			refreshdisplay="true"
			DesignerSet="SourceCode.Forms.Designers.View.Styles._showEditStyles" />
	</Properties>
<!--
<Styles> describes which styles can be applied to the control. 
    In this sample we allow all styles, but you can remove the styles you do not want to expose
-->
	<Styles>
		<Style IsDefault="True">
			<Border>
				<Right>
					<Style />
					<Width />
					<Color />
				</Right>
				<Left>
					<Style />
					<Width />
					<Color />
				</Left>
				<Default>
					<Style />
					<Width />
					<Color />
				</Default>
				<Top>
					<Style />
					<Width />
					<Color />
				</Top>
				<Bottom>
					<Style />
					<Width />
					<Color />
				</Bottom>
			</Border>
			<Padding>
				<Default />
				<Top />
				<Left />
				<Bottom />
				<Right />
			</Padding>
			<Margin>
				<Default />
				<Top />
				<Left />
				<Bottom />
				<Right />
			</Margin>
			<Font>
				<Family />
				<Size />
				<Color />
				<Style />
				<Weight />
			</Font>
			<BackgroundColor />
			<Text>
				<Decoration />
				<Align />
			</Text>
			<Format />
		</Style>
	</Styles>
</ControlType>