PrintDocument for WinForms
ObjectResolvedScript プロパティ (RenderObject)


C1.PrintDocument.6 アセンブリ > C1.C1Preview 名前空間 > RenderObject クラス : ObjectResolvedScript プロパティ
Gets or sets the script that is executed when the current object has been completely resolved, all its fragments created and added to the RenderObject.Fragments collection of the current object.
シンタックス
'宣言
 
Public Property ObjectResolvedScript As System.String
'使用法
 
Dim instance As RenderObject
Dim value As System.String
 
instance.ObjectResolvedScript = value
 
value = instance.ObjectResolvedScript
public System.string ObjectResolvedScript {get; set;}
解説
This script may be used to adjust the look of an object after resolving, for instance the background of the object may be set depending on whether the object has been split between pages (i.e. the RenderObject.Fragments collection contains more than 1 element). The following code sets the background of a RenderArea to red if it has been split between pages, and to green if it has not been split: C1PrintDocument doc = new C1PrintDocument(); RenderArea ra = new RenderArea(); ra.ObjectResolvedScript = "if RenderObject.Fragments.Count > 1 then\r\n" + "RenderObject.Style.BackColor = Color.Red\r\n" + "else\r\n" + "RenderObject.Style.BackColor = Color.Green\r\n" + "end if\r\n"; ra.Style.Borders.All = LineDef.DefaultBold; // ... fill ra with sample content: for (int i = 0; i < 30; i++) ra.Children.Add(new RenderText("Line " + i.ToString())); doc.Body.Children.Add(ra); Note that while you can adjust any style properties on the object, the size and position of the object will not be re-calculated even if a property affecting it (such as font size) changes (so, for instance, if the font size is increased, clipping may occur). Basically, this means that normally only properties that do not affect the object's layout (such as text and background colors) should be changed in this script.
参照

RenderObject クラス
RenderObject メンバ