CopySourceUrlInfo Class
Represents the URL of a source item and descriptive text.
This class and its members are reserved for internal use and are not intended to be used in your code.
System.Object
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.TemplateBasedControl
Microsoft.SharePoint.WebControls.FormComponent
Microsoft.SharePoint.WebControls.CopySourceUrlInfo
System.Web.UI.Control
Microsoft.SharePoint.WebControls.SPControl
Microsoft.SharePoint.WebControls.TemplateBasedControl
Microsoft.SharePoint.WebControls.FormComponent
Microsoft.SharePoint.WebControls.CopySourceUrlInfo
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
CopySourceUrlInfo
Description
The Microsoft.SharePoint.WebControls.CopySourceUrlInfo class inherits from the Microsoft.SharePoint.WebControls.FormComponent class which is the foundational control for form and field rendering controls. The CopySourceUrlInfo class is responsible for displaying the list item copy source based on the current list context, if applicable, in a friendly format.
CopySourceUrlInfo functions by toggling visibility based on some basic checks, ensuring that the control mode is not SPControlMode.New and the ListItem.CopySource property has a value. Following, the description message will be pooled by using SPResource.GetString in order to get the message:
"This item is a copy of :"
The remaining portion of the message will be constructed using the ListItem.CopySource string property, which provides the URL of the source item from which the current item was copied.
Usage Scenario
The primary usage of ListItem.CopySource is internal since the message is displayed when working the default list architecture. However, when developing custom applications that will take advantage of the copying, it is helpful to display as an informative message for users.
In the below, I am creating a new CopySourceUrlInfo object, and providing it a unique indentifier by asssigning the CopySourceUrlInfo.ID property. Following, I am adding the control to the current instance control collection.
C# Code Example
protected override void CreateChildControls()
{
CopySourceUrlInfo info = new CopySourceUrlInfo();
info.ID = "info";
Controls.Add(info);
}
Visual Basic .NET Code Example
Protected Overloads Overrides Sub CreateChildControls()
Dim info As New CopySourceUrlInfo()
info.ID = "info"
Controls.Add(info)
End Sub
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
The Microsoft.SharePoint.WebControls.CopySourceUrlInfo class inherits from the Microsoft.SharePoint.WebControls.FormComponent class which is the foundational control for form and field rendering controls. The CopySourceUrlInfo class is responsible for displaying the list item copy source based on the current list context, if applicable, in a friendly format.
CopySourceUrlInfo functions by toggling visibility based on some basic checks, ensuring that the control mode is not SPControlMode.New and the ListItem.CopySource property has a value. Following, the description message will be pooled by using SPResource.GetString in order to get the message:
"This item is a copy of :"
The remaining portion of the message will be constructed using the ListItem.CopySource string property, which provides the URL of the source item from which the current item was copied.
Usage Scenario
The primary usage of ListItem.CopySource is internal since the message is displayed when working the default list architecture. However, when developing custom applications that will take advantage of the copying, it is helpful to display as an informative message for users.
In the below, I am creating a new CopySourceUrlInfo object, and providing it a unique indentifier by asssigning the CopySourceUrlInfo.ID property. Following, I am adding the control to the current instance control collection.
C# Code Example
protected override void CreateChildControls()
{
CopySourceUrlInfo info = new CopySourceUrlInfo();
info.ID = "info";
Controls.Add(info);
}
Visual Basic .NET Code Example
Protected Overloads Overrides Sub CreateChildControls()
Dim info As New CopySourceUrlInfo()
info.ID = "info"
Controls.Add(info)
End Sub
Adam Buenz
SharePoint Foundation MVP - http://www.sharepointsecurity.com
- 6/3/2010
- Adam Buenz - MVP