Type: IResourceColor
Summary:
Remarks:
CopyToClipboard
Summary:
ToCSVString(System.Char)
Summary:
Returns:
A string that contains properties of the object in a CSV format.
GetUserPropertyInstance(System.String)
Summary:
Parameters:
Returns:
Returns the user property instance object. If not found, the methods returns null.
Example:
This example shows how to set the value of a user property by using this method
cc1 = Project.Equipment.Get("CC1");
// get the value of a user property using the method
userPropertyInstance = cc1.GetUserPropertyInstance("UserProperty1");
if(userPropertyInstance != null) {
userPropertyInstance.Value = 3;
}
IsUserProperty(System.String)
Summary:
Parameters:
Returns:
Returns true if the object contains a user property with the name you specified in parameter.
GetUserPropertyValue(System.String)
Summary:
Parameters:
Returns:
Returns null if user property is not found. Otherwise returns the value of the user property.
Example:
This example shows how to get the value of a user property using this method and also by using the indexer
cc1 = Project.Equipment.Get("CC1");
// get the value of a user property using the method
val = cc1.GetUserPropertyValue("UserProperty1");
// get the value of a user property using the indexer operator
val = cc1["UserProperty1"];
SetUserPropertyValue(System.String,System.Object)
Summary:
Parameters:
Example:
This example shows how to set the value of a user property using this method and also by using the indexer
cc1 = Project.Equipment.Get("CC1");
// set the value of a user property using the method
cc1.SetUserPropertyValue("UserProperty1", 3);
// set the value of a user property using the indexer operator
cc1["UserProperty1"] = 3;
ToXmlString
Summary:
Returns:
the string that contains xml version of the object
FromXmlString(System.String)
Summary:
Parameters:
PrimaryColor
Summary:
Type:
System.Drawing.Color
Access:
Read and Write
Example:
This example shows how to get and set the color
// display color values in the console
c = Project.Colors["Sym3 Red"].PrimaryColor
print("Alpha = " + c.A)
print("Red = " + c.R)
print("Green = " + c.G)
print("Blue = " + c.B)
// change color with predefined value
Project.Colors["Sym3 Red"].PrimaryColor = System.Drawing.Color.Blue
// change color with user defined color
Project.Colors["Sym3 Red"].PrimaryColor = System.Drawing.Color.FromArgb(255, 200, 200, 10);
SecondaryColor
Summary:
Type:
System.Drawing.Color
Access:
Read and Write
Example:
This example shows how to get and set the color
// display color values in the console
c = Project.Colors["Sym3 Red"].SecondaryColor
print("Alpha = " + c.A)
print("Red = " + c.R)
print("Green = " + c.G)
print("Blue = " + c.B)
// change color with predefined value
Project.Colors["Sym3 Red"].SecondaryColor = System.Drawing.Color.Blue
// change color with user defined color
Project.Colors["Sym3 Red"].SecondaryColor = System.Drawing.Color.FromArgb(255, 200, 200, 10);
Flash
Summary:
Type:
System.Boolean
Access:
Read and Write
FlashRate
Summary:
Type:
System.UInt32
Access:
Read and Write
Id
Summary:
Type:
System.Guid
Access:
Read
Example:
This example shows how to get the id of an object in a string format. The following script will output a string like 'b3122ae0-dcf7-43b6-b17c-5381afaca5cb'
strid = Project.Colors.Get("myColor").Id.ToString();
print(strid)
Name
Summary:
Type:
System.String
Access:
Read and Write
Example:
This example shows how to get and set the name of an object.
// get the color name
colorname = Project.Colors.Get("myColor").Name;
// set the color name
Project.Colors.Get("myColor").Name = "myNewName";
TypeName
Summary:
Type:
System.String
Access:
Read
DisplayTypeName
Summary:
Type:
System.String
Access:
Read
BaseProject
UserPropertyInstances
Summary:
Type:
System.Collections.ObjectModel.ObservableCollection`1[BCS.IUserPropertyInstance]
Access:
Read
//******************************************************************************
// HOW TO : Colors
//******************************************************************************
//------------------------------------------------------------------------------
// How to create
//------------------------------------------------------------------------------
// create a new entity
var newEntity = Project.Colors.New()
print("A new entity has been created with default name: " + newEntity.Name)
// create a new entity with a specific name
var newEntity2 = Project.Colors.New("MyColor")
print("A new entity has been created: " + newEntity2.Name)
//------------------------------------------------------------------------------
// How to access entity
//------------------------------------------------------------------------------
// get by name using method 'Get'
var entity1 = Project.Colors.Get("Sym3 Red")
print("Get entity by name: " + entity1.Name)
// get by name using operator []
var entity2 = Project.Colors["Sym3 Red"]
print("Get entity by name: " + entity2.Name)
// get by index:
var entity3 = Project.Colors[1]
print("Get entity by index: " + entity3.Name)
//------------------------------------------------------------------------------
// How to loop
//------------------------------------------------------------------------------
var entities = Project.Colors.Objects;
for (var i = 0; i < Project.Colors.Count; i++) {
print(entities[i].Name);
}
//------------------------------------------------------------------------------
// How to delete
//------------------------------------------------------------------------------
// remove entity
Project.Colors.Remove(newEntity)
//------------------------------------------------------------------------------
// How to edit
//------------------------------------------------------------------------------
var entityToEdit = Project.Colors.New("MyColorToEdit")
// change properties:
entityToEdit.Name = "MyColorToEditModified";
entityToEdit.PrimaryColor = System.Drawing.Color.FromArgb(255, 200, 200, 10);
entityToEdit.SecondaryColor = System.Drawing.Color.Green;
entityToEdit.Flash = true;
entityToEdit.FlashRate = 400; // in ms