Spread Windows Forms 7.0 Product Documentation
PSObject Constructor(SerializationInfo,StreamingContext)
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread.DrawingSpace Namespace > PSObject Class > PSObject Constructor : PSObject Constructor(SerializationInfo,StreamingContext)


info
Object that holds the serialized object data
context
Contexual information about the source or destination of the serialization

Glossary Item Box

Creates a new shape object from serialization.

Syntax

Visual Basic (Declaration) 
Protected Function New( _
   ByVal info As SerializationInfo, _
   ByVal context As StreamingContext _
)
Visual Basic (Usage)Copy Code
Dim info As SerializationInfo
Dim context As StreamingContext
 
Dim instance As New PSObject(info, context)
C# 
protected PSObject( 
   SerializationInfo info,
   StreamingContext context
)

Parameters

info
Object that holds the serialized object data
context
Contexual information about the source or destination of the serialization

Example

This example creates a PSObject object.
C#Copy Code
FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape expected = (FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape)Activator.CreateInstance(typeof(FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape));
expected.ShadowColor = Color.AliceBlue;
expected.ShadowOffsetX = 20f;
expected.ShadowOffsetY = 20f;
expected.AlphaBlendShadowColor = 100;
expected.CanRenderText = true;
expected.Formula = "A1:A2";
var fc = new System.Runtime.Serialization.FormatterConverter();
var info = new System.Runtime.Serialization.SerializationInfo(typeof(FarPoint.Win.Spread.DrawingSpace.PSShape), fc);
var context = new System.Runtime.Serialization.StreamingContext();
expected.GetObjectData(info, context);
object[] param = new object[] { info, context };
//Creates a new shape object from serialization.
FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape actual = (FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape)Activator.CreateInstance(typeof(FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape), param);
fpSpread1.Sheets[0].AddShape(actual, 0, 0);
listBox1.Items.Add(actual.ShadowColor.ToString());
Visual BasicCopy Code
Dim expected As FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape = DirectCast(Activator.CreateInstance(GetType(FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape)), FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape)
expected.ShadowColor = Color.AliceBlue
expected.ShadowOffsetX = 20.0F
expected.ShadowOffsetY = 20.0F
expected.AlphaBlendShadowColor = 100
expected.CanRenderText = True
expected.Formula = "A1:A2"
Dim fc = New System.Runtime.Serialization.FormatterConverter()
Dim info = New System.Runtime.Serialization.SerializationInfo(GetType(FarPoint.Win.Spread.DrawingSpace.PSShape), fc)
Dim context = New System.Runtime.Serialization.StreamingContext()
expected.GetObjectData(info, context)
Dim param As Object() = New Object() {info, context}
'Creates a new shape object from serialization.
Dim actual As FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape = DirectCast(Activator.CreateInstance(GetType(FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape), param), FarPoint.Win.Spread.DrawingSpace.SpreadCameraShape)
FpSpread1.Sheets(0).AddShape(actual, 0, 0)
ListBox1.Items.Add(actual.ShadowColor.ToString())

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.