Create a new label in the repository.
Namespace: Perforce.P4Assembly: p4api.net (in p4api.net.dll) Version: 2015.1.103.4687 (2015.1.103.4687)
Syntax
C# |
---|
public Label CreateLabel( Label label ) |
Visual Basic |
---|
Public Function CreateLabel ( _ label As Label _ ) As Label |
Visual C++ |
---|
public: Label^ CreateLabel( Label^ label ) |
Parameters
- label
- Type: Perforce.P4..::..Label
Label specification for the new label
Return Value
The Label object if new label was created, null if creation failed
Examples
To create a new label:
CopyC#

Label l = new Label(); l.Id = "newLabel"; l.Owner = "admin"; l.Description = "created by admin"; l.Options = "unlocked"; l.ViewMap = new ViewMap(); string v0 = "//depot/main/..."; string v1 = "//depot/rel1/..."; string v2 = "//depot/rel2/..."; string v3 = "//depot/dev/..."; l.ViewMap.Add(v0); l.ViewMap.Add(v1); l.ViewMap.Add(v2); l.ViewMap.Add(v3); Label newLabel = rep.CreateLabel(l, null);