P4.Net Overview

Perforce API for the .Net CLR

Overview

Introduction

P4.Net is an API for the Microsoft .Net Common Language Runtime (CLR). It can be used from any managed language including C#, VB.Net, and J#.

  • Support for Framework versions 1.1 and 2.0.
  • Results can be streamed as "pre-parsed", and are abstracted to "Recordsets" and "Records".
  • Direct manipulation of forms (p4 client, branch, user, etc.).
  • Connections are auto-managed (no need to set "ParseForms" or "Tagged" like other APIs).
  • P4PendingChangelist object makes submitting changes a snap.
    •

    License

    P4.Net is protected under this license, which is the MIT license.

    Support

    P4.Net is supported by me personally, in my spare time. If you have any issues you can contact me at p4shawn <at> gmail <dot> com. I use P4.Net at work extensively, so I'm motivated to fix any bugs. But I can't guarantee I'll be able to help everyone in a timely fashion, or even at all.

    P4.Net vs. P4COM

    P4COM can absolutely be used from managed languages w/o issues. So why would you want to use P4.Net? P4COM requires you to register the dll when deploying, but since P4.Net is entirely managed code, there is no need to register any dlls. You can literally use xcopy deployment (or p4 sync :-). Also, P4COM is constrained by some of the inherent limitations in COM. P4.Net uses inheritance, indexers and collection interfaces that all give it a cleaner, more .Net-like interface than P4COM (IMHO).

    Obtaining P4.Net

    P4.Net distributables can be downloaded here. It includes the binaries, help file (chm), and sample applications.

    Source code is maintained in the Perforce public depot: //guest/shawn_hladky/P4.Net

    Deploying P4.Net

    Choose the appropriate binaries. They are available strong-named or not, and for the 1.1 and 2.0 framework. Include the assemblies (p4dn.dll and p4api.dll) in the bin folder with your application, or install to the GAC.

    Architecture

    P4.Net is divided into two distinct components.

    p4dn: Written in C++ (with Managed Extensions), this component marshals all objects between the native Perforce C++ API and managed types. It generally follows the object model of the native Perforce API. It was ported from Jacob Gladish's implementation in the Perforce public depot.

    P4API: Written in C#, this component consumes p4dn, and abstracts the complexity of the native API into an easier to use interface. The object model is inspired from a combination P4Ruby, P4Python, P4COM, and ADO.

    Release Roadmap

    Past

    P4.Net began life in early 2004. I needed to build two Perforce automation tools to support some new processes. C# was the language of choice for these tools, but I've had a bad history with COM interop. So I looked for alternatives to P4COM, and I stumbled across Jacob Gladish's PerforceDotNet implementation in the Perforce public depot. I built these tools around PerforceDotNet, and ended up fixing a few bugs and adding functionality along the way.

    PerforceDotNet proved to be very robust, but its object model mirrored the native C++ API... which is not really friendly for simple day-to-day scripting. As a result, I didn't do much else with it. Instead, I was turned on to Python and P4Python. Flash-forward to early 2006, and I realized I needed to add some major enhancements to one of the PerforceDotNet-based applications. I dreaded having to work directly with PerforceDotNet's interface, and I seriously considered a full re-write in Python.

    But then I thought the Perforce community could really use a native .Net interface in the likes of P4Python. I realized I'd need a full layer on top of PerforceDotNet, that mimicked an object model more like P4Python. I also realized that PerforceDotNet would need some major changes to support the full API functionality. So I came up with the term P4.Net as an umbrella for the two components, and started submitting code.

    Present

    Of course, in typical software project fashion, I under-estimated the work involved. And even worse, I under-estimated the spare time I'd find to work on it. It's taken me about a year to deliver 0.9, the beta release. Although there are some known issues, I'm proud of the quality of this release... and I hope you find it to be more robust and functional than the typical open-source beta.

    Future

    1.0, general release, should be complete summer 2007. It will add support for print and raw form text, as well as fixing miscellaneous bugs.

    2.0 should be complete early 2008. It will focus on a major re-write of p4dn, and will only support the .Net framework 2.0. P4API will likely add overloaded methods to support generics for many inputs. And the one glaring bug, support for internationalized servers, will finally be fixed.

    Other ideas I have, but no plans on when they'll be implemented:

  • P4COM bridge. A wrapper class that mimics P4COM's object model, but uses P4.Net under the hood. This could be used as a drop-in replacement for .Net applications currently using P4COM... just update the reference and recompile.
  • Filelog object model. I've written a couple of scripts that try to interpret the output of p4 filelog... and I ended up with a bad headache at the end of the day. Tony Smith has come up with an object model to simplify this in P4Ruby. I'd like to do something similar in P4.Net.
  • Enhance P4MSBuildTasks. I'd like to take it from a sample application to a full-fledged product. This means it will need to support forms and have a lot more documentation.
  • Add a web application as a sample.
  • P4Python Bridge. Like the P4COM bride, this would allow Python scripts that used P4Python to run under IronPython using P4.Net, without changing the scripts.

    • Copyright © 2006 Shawn Hladky


P4.Net: Getting Started

Perforce API for the .Net CLR

Getting Started

Connecting to the Server

The P4Connection class is the main player in P4.Net. This represents a connection to the Perforce server. Every utility that uses P4.Net will have some variation of the following code:

P4Connection p4 = new P4Connection();
p4.Connect();

// Run some commands
p4.Disconnect();

Rule number 1: Always remember to disconnect. This frees unmanaged memory, and cleanly disconnects from the Perforce server. P4Connection implements IDisposable, and the Dispose and Disconnect methods can be used interchangeably.

P4.Net is based off the command-line syntax (as are most other Perforce APIs). Almost all of the commands you issue in P4.Net will use the same arguments as the p4 client executable. For example, say you need to find the latest submitted changelist under a given path (//depot/path). From the command line:

c:\> p4 changes -m1 -s submitted //depot/path/...

From P4.Net:

P4Connect p4 = new P4Connection();
p4.Connect();
P4Recordset changes = p4.Run("changes", "-m1", "-s", "submitted", "//depot/path/...");
p4.Disconnect();

If you don’t know what all the arguments for p4 changes mean, then p4 help changes is your best friend. The first step in building anything with P4.Net, is to know the exact command lines you’d run manually.

Interpreting Output

Although the arguments to run Perforce commands are similar to the command line interface, the way we interpret the output can be dramatically different. This is where the power of the API comes in. In the example above, the result changes is of type P4Recordset. This is a rich object in P4.Net that provides a parsed version of the command output. At the core of the P4Recordset is the enumerable collection of P4Records. Each P4Record generally represents all the data on one line’s output from the command-line. P4Records are dictionary-like objects allowing you to access fields by a key:

// we used the -m1 switch, so we know there is just one record returned.
P4Record change = changes[0];
int changeNumber = int(change["change"]);

It can also be accessed using the Fields property:

int changeNumber = int(change.Fields["change"]);

So, how do you know what keys are available? Well, it depends on the command run, the server version, and sometimes the arguments to the command. The RecordsetViewer sample application is a great tool for determining the keys that are returned from a command. In addition to RecordsetViewer, you can use the -Ztag global option of the p4 command line client to see how the output is parsed. At runtime, you can access all of the keys returned from the Fields.Keys property:

foreach (string key in change.Fields.Keys)
{
    Console.WriteLine("{0} : {1}", key, change[key]);
}

In addition to the normal parsed output, there may be warnings, errors, and informational messages from the command that are not parsed (i.e. it will be the same English message returned at the command line). Again, the RecordsetViewer sample application can help you identify all the elements returned in a P4Recordset for a particular command. At runtime, we can access those messages as shown below:

foreach (string e in changes.Errors) Console.WriteLine(e);
foreach (string e in changes.Warnings) Console.WriteLine(e);
foreach (string e in changes.Messages) Console.WriteLine(e);

Not all fields have a single string for a value. Some commands return arrays of strings in a field. To access these values at runtime, you can use the ArrayFields property of the P4Record object.

P4Recordset describes = p4.Run("describe", "-s", "1234");

//One changelist, one record... at least if that changelist exists
P4Record describe = describes[0];

Console.WriteLine("Changelist: {0}", describe["Change"]);

Console.WriteLine("Files:");

foreach( int i=0; i< describe.ArrayFields["depotFile"].Length; i++)
{
    Console.WriteLine("   {0}#{1}",  describe.ArrayFields["depotFile"][i], describe.ArrayFields["rev"][i]);
}

In the preceding examples, we only looked at the first record in the recordset. However many commands will return multiple records. We can enumerate them as follows:

// This example enumerates all the files in a folder hierarchy, and prints the ones
// that are deleted at the head revision.  (Note, there’s a more efficient way to do this.)
P4Recordset fstats = p4.Run("fstat", "//depot/path/...");
foreach( P4Record stat in fstats)
{
    if (stat["headAction"] == "delete")
    {
        Console.WriteLine(stat["depotFile"]);
    }
}

Unparsed Output

Not all commands support the parsed output. In that case, all of the output will be simple English statements, just as the command line outputs. Again, this is highly dependent on the version of the Perforce server. You can see the Perforce C++ API release notes for your version to see if the parsed output is supported for a given command (referred to as ‘tagged’ in the C++ documentation).

While you can access these messages from the P4Recordset.Messages property, it’s often easier to use the RunUnParsed method of the P4Connection class, which returns a P4UnParsedRecordset object. This is similar to the P4Recordset object, except there are no Fields and ArrayFields properties, and the default enumerator is the Messages array.

RunUnParsed can also help ensure forward compatibility with newer server versions. In recent releases, many commands that previously only supported the unparsed output, now support parsed output. If the server is upgraded, code that called Run, would still look at the P4Recordset.Messages. However the output from the upgraded server would now be available only in Fields and ArrayFields. By using RunUnParsed, you are guaranteed to get the raw strings from the server.

Forms

Another major object in P4.Net is the P4Form object. Perforce forms are the text files that pop up in an editor when a "form" command is run. They have fields that are specially formatted in the file, and you can view or change these fields by following the formatting standards. You can see this behavior in the command line:

c:\> p4 user

In P4.Net, you do not have to worry about this special formatting. The fields are read/modified using Fields and ArrayFields properties (P4Form inherits P4Record). The only trick is you need to use the methods Fetch_Form and Save_Form:

// Change the root of the current workspace.
P4Connection p4 = new P4Connection();
p4.Connect();
P4Form client = p4.Fetch_Form("client");
client["Root"] = @"c:\p4";
p4.Save_Form(client);
p4.Disconnect();

Submitting Files

In P4.Net, there’s no straight-forward way to submit the default pending changelist. This is by design. If the client workspace has opened files in the default changelist before any P4.Net automation runs, those files will "come along for the ride" when you submit the default changelist. If the user has a JobView set, all jobs in that JobView will automatically be fixed when you submit the default changelist. Both of those behaviors are almost never desired, and I’ve found many scripts that have those bugs.

So, how do you submit files in P4.Net? The key is to create a named pending changelist before opening any files. Then add the switches "-c", and "1234" (1234 is the changelist number) to all commands that are opening files. This is quite simple using the P4PendingChangelist object:

P4Connection p4 = new P4Connection();
p4.Connect();
P4PendingChangelist  cl = p4.CreatePendingChangelist("My New Changelist\nVery, Very bad description!\nShame on me!");
p4.Run("edit", "-c", cl.Number.ToString(), "//depot/path/foo.cs", "//depot/path/bar.cs");
// Do something to manipulate the files
cl.Submit();
p4.Disconnect();

Connections Revisited.

Finally, let’s look at the connection properties. You may be wondering how the P4Connection object knows which Port/Client/User to use. It turns out P4.Net will use the default properties using the same logic as all Perforce clients (see Technote 36 and the P4 User Guide). Of course, any of these can be explicitly overridden on the P4Connection object. However, I’ve found using the built-in Perforce configuration system to be much more portable and maintainable than explicitly defining the configuration for each custom tool.

Copyright © 2006 Shawn Hladky


P4.Net Sample Applications

Perforce API for the .Net CLR

Sample Applications

About the samples

All of the sample applications are written in Visual Studio 2005. If you don't have VS2005, you can still build them with MSBuild and the .Net 2.0 SDK.

Job Labeler

Job labeler is a Windows service that polls the Peforce server for new job fixes, and creates a label representing the files fixed by a job.

Motivation: Many shops use jobs to organize a collection of changes. For example, if you have Perforce integrated with a defect tracking system, you will have a job representing a defect, and there may be several changes fixed by that job. A frequent question that comes up is, "What files were modified to fix this defect?" Since the JobLabeler sample application creates a label representing the files fixed by a job, this question is readily answered with "p4 files @={joblabel}".

Techniques: Even if you don't use jobs in this manner (or jobs at all), there are a number of techniques that may be used in your applications.

  • Using P4.Net from a Windows service
  • Polling the Perforce server for change.
  • Reading/Writing counters to maintain state.
  • Using parsed and unparsed output of several commands.
  • Fetching/Setting p4 settings from an app.config file.

    • JobLabeler requires some administrative setup to run. See the readme file for details.

    Recordset Viewer

    Recordset Viewer is a Windows GUI application that helps the user visualize the Recordset output from the commands they run.

    Motivation: When you're using P4.Net (or other P4 APIs), it can be difficult to sort through the vast information returned from Perforce. The RecordsetViewer graphically displays all the key/value pairs, as well as messages, warnings, and errors.

    Techniques: A few techniques are demonstrated:

  • Validating a variety of Perforce connection settings.
  • A connection dialog.
  • This is the only sample in VB.Net.
  • Iterating P4RecordSet objects.

    • MSBuild Custom Tasks

    P4MSBuildTasks is a .Net assembly providing custom tasks for MSBuild.

    Motivation: Integrating MSBuild with Perforce is something a lot of shops will want to do. I imagine there will be a number of people that use these tasks, and don't even care about the internals of P4.Net.

    Usage: P4MSBuildTasks works quite a bit differently than the traditional source control integration tasks (for MSBuild, NAnt, or Ant). The traditional approach is to have individual tasks to perform a specific action. For example, you might have tasks like P4Sync, P4Edit, P4Label, etc.

    In P4MSBuildTasks, there's one main task that executes any Perforce command. So how's that any better than just executing p4.exe directly? The key is the rich output. The P4RunCommand task outputs an itemgroup representing each P4Record output. All the key/value pairs are represented as Item metadata. As an example, the output from p4 files would be an itemgroup similar to the following:

    <ItemGroup>
  <P4Output Include="P4Output-files-00000000">
    <change>5427</change>
    <rev>1</rev>
    <type>text</type>
    <depotFile>//depot/file1.txt</depotFile>
    <action>add</action>
    <time>1146612676</time>
  </P4Output>
  <P4Output Include="P4Output-files-00000001">
    <change>5798</change>
    <rev>2</rev>
    <type>text</type>
    <depotFile>//depot/file2.txt</depotFile>
    <action>edit</action>
    <time>1166501810</time>
  </P4Output>
</ItemGroup>

    Using batching and transformations, you can use this output later in the script. For example, you can print a line 'file#revision' for each record output by batching:

    <Message Text="%(P4Output.depotFile)#%(P4Output.rev)" />

    You can also use transformations to feed output of one Perforce command into the input of another. Check out the sample "WorkingOffline.proj". It is well-commented, and provides a number of techniques you can use.


P4.Net API Comparisons

Perforce API for the .Net CLR

Comparisons with other Perforce APIs

Other APIs

There are a number of Perforce APIs out there... P4Ruby, P4Python, P4Perl, and P4COM are some of the most popular. My goal was to make P4.Net as similar as possible to these. In general, if you're familiar with the Ruby/Python/Perl APIs, you'll be able to transition to P4.Net fairly quickly. The biggest conceptual difference is that those APIs are used in dynamic languages, and P4.Net targets static languages. As a result, P4.Net uses custom types where the other APIs use built-in types, and P4.Net will use separate methods/properties to distinguish actions that output different types.

Python Example

Let's just dive into a sample, and do a side-by-side comparison. In this case, I'll compare P4.Net using IronPython to P4Python using standard Python. Note, I don't mean to suggest that P4.Net/IronPython is superior to P4Python/Standard Python, I just want to show apples-to-apples comparisons, without interference from individual language features.

 | # Standard Python and P4Python | # IronPython and P4.Net
 |  | import clr
1 |  | from System import Array, String
 |  | clr.AddReferenceToFile('P4API.dll')
 | import p4 as P4API | import P4API
 | p4 = P4API.P4() | p4 = P4API.P4Connection()
2 | p4.parse_forms() |
 | p4.connect() | p4.Connect()
 | lname = 'P4NetTestingSample' | lname = 'P4NetTestingSample'
 | # build my label | # build my label
 | labelForm = p4.fetch_label(lname) | labelForm = p4.Fetch_Form('label', lname)
 | labelForm['Description'] = 'Created for P4.Net sample' | labelForm['Description'] = 'Created for P4.Net sample'
3 | view = ['//guest/shawn_hladky/...'] | view = Array[String](['//guest/shawn_hladky/...'])
 | labelForm['View'] = view | labelForm.ArrayFields['View'] = view
 | res = p4.save_label(labelForm) | res = p4.Save_Form(labelForm)
4 | if len(p4.errors) > 0: | if res.HasErrors():
 | for e in p4.errors: print e | for e in res.Errors: print e
 | # My list of changes. This is totally arbitrary | # My list of changes. This is totally arbitrary
 | changes=['5774', '5680', '5636', '5444'] | changes=['5774', '5680', '5636', '5444']
 | sorted_changes = changes.sort() | sorted_changes = changes.sort()
 | # dictionary: keyed by file, value = revision | # dictionary: keyed by file, value = revision
 | filerevs = {} | filerevs = {}
 | # spin the description on each file | # spin the description on each file
5 | for chg in p4.run_describe('-s', *changes): | for chg in p4.Run('describe', '-s', *changes):
6 | depotFiles = chg['depotFile'] | depotFiles = chg.ArrayFields['depotFile']
 | revisions = chg['rev'] | revisions = chg.ArrayFields['rev']
 | for i in range(0, len(depotFiles)): | for i in range(0, len(depotFiles)):
 | key,value = depotFiles[i], revisions[i] | key,value = depotFiles[i], revisions[i]
 | filerevs[key]=value | filerevs[key]=value
 | # convert the dictionary to a list | # convert the dictionary to a list
 | flist = [] | flist = []
 | for k,v in filerevs.items(): | for k,v in filerevs.items():
 | flist.append("%s#%s" % (k,v)) | flist.append("%s#%s" % (k,v))
 | # now I want to run in non-parsed mode |
 | p4.disconnect() |
 | p4 = P4API.P4() |
7 | p4.connect() |
 | out = p4.run('labelsync', '-l', lname, *flist) | out = p4.RunUnParsed('labelsync', '-l', lname, *flist)
 | for s in out: print s | for s in out: print s
 | # delete the label to keep the public depot clean :-) | # delete the label to keep the public depot clean :-)
 | p4.run('label', '-d', lname) | p4.RunUnParsed('label', '-d', lname)
 | p4.disconnect() | p4.Disconnect()

Block 1

This is some overhead required for IronPython. It will load the CLR, and P4.Net.

Block 2

This chunk of code is establishing a connection to the Perforce server. There are a couple things unique to P4.Net worth noting here. Classes in P4.Net are more explicitly named. Here the connection class is named P4Connection. While we're talking about naming, P4.Net uses traditional .Net conventions, and all method names use camel case.

Also, note that P4.Net does not need the parse_forms() method. P4.Net is designed to be more statically typed than P4Python/P4Ruby/P4Perl. You use different methods to retrieve tagged vs. untagged output. Therefore, P4.Net auto-manages the connection, and will dynamically switch modes in the native C++ API when needed.

Block 3

There's several things going on in this chunk, so let's break it down line-by-line:

P4Python: labelForm = p4.fetch_label(lname)
P4.Net  : labelForm = p4.Fetch_Form('label', lname)

Since P4.Net isn't meant for dynamic languages, there are no shortcut methods available.

P4Python: labelForm['Description'] = 'Created for P4.Net sample'
P4.Net  : labelForm['Description'] = 'Created for P4.Net sample'

Identical syntax!

P4Python: view = ['//guest/shawn_hladky/...']
P4.Net  : view = Array[String](['//guest/shawn_hladky/...'])

IronPython doesn't explicitly convert Python lists to .Net Arrays.

P4Python: labelForm['View'] = view
P4.Net  : labelForm.ArrayFields['View'] = view

In P4.Net, you use the ArrayFields property when getting/setting fields with array values.

P4Python: res = p4.save_label(labelForm)
P4.Net  : res = p4.Save_Form(labelForm)

There's no shortcut methode available in P4.Net; however, sine the form is a rich object, it already knows the command, and doesn't need to be supplied with the Save_Form method.

Block 4

This is a subtle, but significant departure from the other APIs. In P4.Net, results are rich objects, not just simple lists. All warnings, errors, and messages are associated with the results object. In other APIs, these are part of the connection object, and are reset with each run.

Block 5 & 6

More of the same... no short-cut methods, and use the ArrayFields property. Only in this instance we're dealing with a P4Recordset instead of a form.

Block 7

In P4.Net, you use different methods to return tagged and untagged output. This means P4.Net auto-manages the connection for you, so no need to explicitly reset as other APIs require.


P4Record Class

Perforce API for the .Net CLR

Known Limitations

Internationalized Servers

Perforce servers running in "unicode" or "internationalized" are unsupported.

I would like to have this fixed for v1.0, but unfortunately there are some major changes that need to happen. My plan is to fix this for 2.0, and therefore will only run on the 2.0 Framework.

Forms

Direct manipulation of the form text is not supported. That is, there is no way get the raw text of a form command or to save a form with the raw text. Instead, you must use the P4Form object.

p4 print

There is currently no way to obtain an in-memory stream of file contents using the 'print' command. In other APIs, if multiple files are output using 'print', the contents of the file are concatenated into one in-memory variable. I have an idea that would correct this behavior, but it is more complex to consume. So I've punted on the idea for now, and it is unsupported.

p4 filelog

The parsed output for the of the filelog command is awkward. In the native C++ api, the integration metadata is a sparse 2 dimensional array. The parsing logic in P4.Net does not account for this, so you end up with an ArrayFieldDictionary with keys like 'fromFile1,'. So, I could fix this, and come up with some sort of TwoDimArrayFieldDictionary. However, the trying to make sense of the filelog output using the 2-d arrays will almost certainly give you a headache. Instead, I want to research Tony Smith's implementation in P4Ruby. He has created an object model that represents the filelog metadata in an easy-to-use interface.

Submitting Default Changelist

In P4.Net, there’s no straight-forward way to submit the default pending changelist. This is by design. If the client workspace has opened files in the default changelist before any P4.Net automation runs, those files will "come along for the ride" when you submit the default changelist. If the user has a JobView set, all jobs in that JobView will automatically be fixed when you submit that default changelist. Both of those behaviors are almost never desired, and I’ve found many scripts that have those bugs.

Note, starting in 2006.2, Perforce has native support for automatically submitting the default changelist. This is accomplished with: p4 submit -d "change description". I caution it's usage, as it has the same limitations decribed above.

Changing Port after Connected

You can not change the P4Port setting after a P4Connection has been connected. This is true even after a Disconnect(). Instead, create a new P4Connection object.

Supported Server Versions

Servers lower than 2004.2 begin to fail the unit tests. However, it is not a complete failure. One issue is the use of p4 login. The other failure is in the ConvertDate methods, because they use p4 info in parsed mode to determine the server's time zone. If you avoid those methods, P4.Net should work fine against older servers.


P4.Net Copyright

P4.Net -- Managed API for Perforce
P4.Net Copyright

Copyright © 2007 Shawn Hladky

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


P4API

Perforce API for the .Net CLR

P4API Namespace

Missing <summary> Documentation for P4API

Namespace hierarchy

Classes

Class | Description
ArrayFieldDictionary | Strongly typed dictionary to represent array-valued fields returned from Perforce commands.
FieldDictionary | Strongly typed dictionary to represent fields returned from Perforce commands.
MergeData | Contains information about the files being merged.
P4BaseRecordSet | Base functionality for P4Recordset and P4UnParsedRecordset.
P4Callback |
P4Connection | A connection to a Perforce server instance.
P4Form | Represents a Perforce 'Form' object.
P4Integration | P4Integration objects hold details about the integrations that have been performed on a particular revision. Used primarily with the P4Revision class
P4Map | Represents a Perforce Map object.
P4Message |
P4PendingChangelist | Represents a pending changelist from Perforce.
P4PrintStreamEventArgs | EventArgs class to supply file details.
P4PromptEventArgs | Arguments provided for an OnPrompt event.
P4Record | P4Record is a dictionary-like object that provides a means of interpreting Perforce results.
P4RecordSet | Provides output of a Perforce Command in "tagged" moded.
P4RecordsetCallback | A P4Callback class that populates a P4Recordset.
P4Revision | Each P4Revision object holds details about a particular revision of a file. It may also contain the history of any integrations to/from the file
P4UnParsedRecordSet | This class represents the "unparsed" output from a Perforce command.

Delegates

Delegate | Description
OnPrintEndEventHandler | Delegate to handle the OnPrintEndFile event.
OnPrintStreamEventHandler | Delegate to handle the OnPrintStream event.
OnPromptEventHandler | Delegate to handle the OnPrompt event.

Enumerations

Enumeration | Description
MergeAction | Actions to take when resolving a file.
P4ExceptionLevels | Defines the exception levels available in P4Connection.
P4MessageSeverity | Perforce Message Severity


ArrayFieldDictionary Class

Strongly typed dictionary to represent array-valued fields returned from Perforce commands.

For a list of all members of this type, see ArrayFieldDictionary Members.

System.Object
P4API.ArrayFieldDictionary

[Visual Basic]
Public Class ArrayFieldDictionary
[C#]
public class ArrayFieldDictionary

Remarks

The FieldDictionary only contains fields that contain a string array values. Fields that return a single string values are stored in FieldDictionary.
If a value is read from a key that does not exist, an empty array will be returned. If a value is set with a key that does not exist, it will automatically be added. This behavior is to support many Perforce commands that omit a key, rather than supply a default value.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

ArrayFieldDictionary Members | P4API Namespace


ArrayFieldDictionary Members

ArrayFieldDictionary overview

Public Instance Properties

Count | Gets the number of elements in the dictionary
Item | Returns the value assocatied to the key.
Keys | Gets all keys contained in the dictionary.

Public Instance Methods

Clear | Clears all elements of the dictionary.
ContainsKey | Tests if the key exists in the dictionary.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
Remove | Removes elements from the dictionary.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ArrayFieldDictionary Class | P4API Namespace


ArrayFieldDictionary Properties

The properties of the ArrayFieldDictionary class are listed below. For a complete list of ArrayFieldDictionary class members, see the ArrayFieldDictionary Members topic.

Public Instance Properties

Count | Gets the number of elements in the dictionary
Item | Returns the value assocatied to the key.
Keys | Gets all keys contained in the dictionary.

See Also

ArrayFieldDictionary Class | P4API Namespace


Item Property

Perforce API for the .Net CLR

ArrayFieldDictionary.Item Property

Returns the value assocatied to the key.

[Visual Basic]
Public Default Property Item( _
ByVal key As String _
) As String()
[C#]
public string[] this[
string key
] {get; set;}

Parameters

key
The key to search on.

See Also

ArrayFieldDictionary Class | P4API Namespace


Keys Property

Perforce API for the .Net CLR

ArrayFieldDictionary.Keys Property

Gets all keys contained in the dictionary.

[Visual Basic]
Public ReadOnly Property Keys As String()
[C#]
public string[] Keys {get;}

Property Value

Keys in the ArrayFieldDictionary.

See Also

ArrayFieldDictionary Class | P4API Namespace


ArrayFieldDictionary Methods

The methods of the ArrayFieldDictionary class are listed below. For a complete list of ArrayFieldDictionary class members, see the ArrayFieldDictionary Members topic.

Public Instance Methods

Clear | Clears all elements of the dictionary.
ContainsKey | Tests if the key exists in the dictionary.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
Remove | Removes elements from the dictionary.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ArrayFieldDictionary Class | P4API Namespace


ArrayFieldDictionary.Clear Method

Clears all elements of the dictionary.

[Visual Basic]
Public Sub Clear()
[C#]
public void Clear();

See Also

ArrayFieldDictionary Class | P4API Namespace


ArrayFieldDictionary.ContainsKey Method

Tests if the key exists in the dictionary.

[Visual Basic]
Public Function ContainsKey( _
ByVal key As String _
) As Boolean
[C#]
public bool ContainsKey(
string key
);

Parameters

key
The key to test

Return Value

True if the key is defined in the dictionary.

See Also

ArrayFieldDictionary Class | P4API Namespace


ArrayFieldDictionary.Remove Method

Removes elements from the dictionary.

[Visual Basic]
Public Sub Remove( _
ByVal key As String _
)
[C#]
public void Remove(
string key
);

Parameters

key
The key of the element to remove.

See Also

ArrayFieldDictionary Class | P4API Namespace


FieldDictionary Class

Strongly typed dictionary to represent fields returned from Perforce commands.

For a list of all members of this type, see FieldDictionary Members.

System.Object
P4API.FieldDictionary

[Visual Basic]
Public Class FieldDictionary
[C#]
public class FieldDictionary

Remarks

The FieldDictionary only contains fields that contain a single string value. Fields that return array values are stored in ArrayFieldDictionary.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

FieldDictionary Members | P4API Namespace


FieldDictionary Members

FieldDictionary overview

Public Instance Properties

Count | Gets the number of elements in the dictionary
Item | Returns the value assocatied to the key.
Keys | Gets all keys contained in the dictionary.

Public Instance Methods

Clear | Clears all elements of the dictionary.
ContainsKey | Tests if the key exists in the dictionary.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
Remove | Removes elements from the dictionary.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FieldDictionary Class | P4API Namespace


FieldDictionary Properties

The properties of the FieldDictionary class are listed below. For a complete list of FieldDictionary class members, see the FieldDictionary Members topic.

Public Instance Properties

Count | Gets the number of elements in the dictionary
Item | Returns the value assocatied to the key.
Keys | Gets all keys contained in the dictionary.

See Also

FieldDictionary Class | P4API Namespace


Item Property

Perforce API for the .Net CLR

FieldDictionary.Item Property

Returns the value assocatied to the key.

[Visual Basic]
Public Default Property Item( _
ByVal key As String _
) As String
[C#]
public string this[
string key
] {get; set;}

Parameters

key
The key to search on.

See Also

FieldDictionary Class | P4API Namespace


Keys Property

Perforce API for the .Net CLR

FieldDictionary.Keys Property

Gets all keys contained in the dictionary.

[Visual Basic]
Public ReadOnly Property Keys As String()
[C#]
public string[] Keys {get;}

Property Value

Keys in the FieldDictionary

See Also

FieldDictionary Class | P4API Namespace


FieldDictionary Methods

The methods of the FieldDictionary class are listed below. For a complete list of FieldDictionary class members, see the FieldDictionary Members topic.

Public Instance Methods

Clear | Clears all elements of the dictionary.
ContainsKey | Tests if the key exists in the dictionary.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
Remove | Removes elements from the dictionary.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FieldDictionary Class | P4API Namespace


FieldDictionary.Clear Method

Clears all elements of the dictionary.

[Visual Basic]
Public Sub Clear()
[C#]
public void Clear();

See Also

FieldDictionary Class | P4API Namespace


FieldDictionary.ContainsKey Method

Tests if the key exists in the dictionary.

[Visual Basic]
Public Function ContainsKey( _
ByVal key As String _
) As Boolean
[C#]
public bool ContainsKey(
string key
);

Parameters

key
The key to test

Return Value

True if the key is defined in the dictionary.

See Also

FieldDictionary Class | P4API Namespace


FieldDictionary.Remove Method

Removes elements from the dictionary.

[Visual Basic]
Public Sub Remove( _
ByVal key As String _
)
[C#]
public void Remove(
string key
);

Parameters

key
The key of the element to remove.

See Also

FieldDictionary Class | P4API Namespace


OnPromptEventHandler Delegate

Delegate to handle the OnPrompt event.

[Visual Basic]
Public Delegate Sub OnPromptEventHandler( _
ByVal sender As Object, _
ByVal args As P4PromptEventArgs _
)
[C#]
public delegate void OnPromptEventHandler(
object sender,
P4PromptEventArgs args
);

Parameters

sender
Sender
args
P4PromptEventArgs

Remarks

Handle Perforce "prompts". Prompts are from commands that ask the user to respond, such as:

  • login
  • passwd
  • resolve (without an -a* switch)

    • Requirements

    Namespace: P4API

    Assembly: p4api (in p4api.dll)

    See Also

    P4API Namespace | OnPrompt


P4BaseRecordSet Class

Base functionality for P4Recordset and P4UnParsedRecordset.

For a list of all members of this type, see P4BaseRecordSet Members.

System.Object
P4API.P4BaseRecordSet
P4API.P4RecordSet
P4API.P4UnParsedRecordSet

[Visual Basic]
MustInherit Public Class P4BaseRecordSet
[C#]
public abstract class P4BaseRecordSet

Remarks

This is a base class for internal use. Do not use directly.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4BaseRecordSet Members | P4API Namespace | P4RecordSet


P4BaseRecordSet Members

P4BaseRecordSet overview

Public Instance Properties

ErrorMessage | Gets an error messages returned from the Perforce command.
Errors | Gets an array of error messages returned from the Perforce command.
P4Messages | Gets an array of P4Messages returned from the Perforce command.
Warnings | Gets an array of warning messages returned from the Perforce command.

Public Instance Methods

Dump | Dumps recordset data to the Trace listner.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
HasErrors | Checks the Recordset to determine if errors occured.
HasWarnings | Checks the Recordset to determine if warnings occured.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4BaseRecordSet Class | P4API Namespace | P4RecordSet


P4BaseRecordSet Properties

The properties of the P4BaseRecordSet class are listed below. For a complete list of P4BaseRecordSet class members, see the P4BaseRecordSet Members topic.

Public Instance Properties

ErrorMessage | Gets an error messages returned from the Perforce command.
Errors | Gets an array of error messages returned from the Perforce command.
P4Messages | Gets an array of P4Messages returned from the Perforce command.
Warnings | Gets an array of warning messages returned from the Perforce command.

See Also

P4BaseRecordSet Class | P4API Namespace | P4RecordSet


ErrorMessage Property

Perforce API for the .Net CLR

P4BaseRecordSet.ErrorMessage Property

Gets an error messages returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property ErrorMessage As String
[C#]
public string ErrorMessage {get;}

Remarks

Errors are concatanated to one string, seperated by new lines.

See Also

P4BaseRecordSet Class | P4API Namespace


Errors Property

Perforce API for the .Net CLR

P4BaseRecordSet.Errors Property

Gets an array of error messages returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property Errors As String()
[C#]
public string[] Errors {get;}

Remarks

These are the error messages that are returned from Perforce.

See Also

P4BaseRecordSet Class | P4API Namespace


Warnings Property

Perforce API for the .Net CLR

P4BaseRecordSet.Warnings Property

Gets an array of warning messages returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property Warnings As String()
[C#]
public string[] Warnings {get;}

Property Value

Array of warnings returned from Perforce.

Remarks

These are the warning messages that are returned from Perforce.

See Also

P4BaseRecordSet Class | P4API Namespace


P4BaseRecordSet Methods

The methods of the P4BaseRecordSet class are listed below. For a complete list of P4BaseRecordSet class members, see the P4BaseRecordSet Members topic.

Public Instance Methods

Dump | Dumps recordset data to the Trace listner.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
HasErrors | Checks the Recordset to determine if errors occured.
HasWarnings | Checks the Recordset to determine if warnings occured.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4BaseRecordSet Class | P4API Namespace | P4RecordSet


P4BaseRecordSet.HasErrors Method

Checks the Recordset to determine if errors occured.

[Visual Basic]
Public Function HasErrors() As Boolean
[C#]
public bool HasErrors();

Return Value

True if the p4 command returned errors.

Remarks

This is the same as testing Errors.Count.

See Also

P4BaseRecordSet Class | P4API Namespace


P4BaseRecordSet.HasWarnings Method

Checks the Recordset to determine if warnings occured.

[Visual Basic]
Public Function HasWarnings() As Boolean
[C#]
public bool HasWarnings();

Return Value

True if the p4 command returned warnings.

Remarks

This is the same as testing Warnings.Count.

See Also

P4BaseRecordSet Class | P4API Namespace


P4Connection Class

A connection to a Perforce server instance.

For a list of all members of this type, see P4Connection Members.

System.Object
P4API.P4Connection

[Visual Basic]
Public Class P4Connection
Implements IDisposable
[C#]
public class P4Connection : IDisposable

Remarks

The P4Connection class is the main player in P4.Net. This represents a connection to the Perforce server. Every utility that uses P4.Net will have some variation of the following code:

P4Connection p4 = new P4Connection();
p4.Connect();

// Run some commands
p4.Disconnect();

Rule number 1: Always remember to disconnect. This frees unmanaged memory, and cleanly disconnects from the Perforce server. P4Connection implements IDisposable, and the Dispose and Disconnect methods can be used interchangeably.

P4.Net is based off the command-line syntax (as are most other Perforce APIs). Almost all of the commands you issue in P4.Net will use the same arguments as the p4 client executable. For example, say you need to find the latest submitted changelist under a given path (//depot/path).

From the command line:

c:\> p4 changes -m1 -s submitted //depot/path/...

From P4.Net:

P4Connect p4 = new P4Connection();
p4.Connect();
P4Recordset changes = p4.Run("changes", "-m1", "-s", "submitted", "//depot/path/...");
p4.Disconnect();

If you don’t know what all the arguments for p4 changes mean, then p4 help changes is your best friend. The first step in building anything with P4.Net, is to know the exact command lines you’d run manually.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4Connection Members | P4API Namespace


P4Connection Members

P4Connection overview

Public Instance Constructors

P4Connection Constructor Initializes a new instance of the P4Connection class.

Public Instance Properties

Api | Sets the client API protocol level.
CallingProgram | Get/Sets the name of the calling program.
CallingVersion | Gets/Sets the version of the calling program's version.
Charset | Gets/Sets the client character set.
Client | Gets/Sets the client workspace.
CWD | Gets/Sets the current working directory.
ExceptionLevel | Gets/Sets the Exception level when running Perforce commands.
Host | Gets/Sets the Host-name of the client.
Language | Sets the Language for message translations.
MaxLockTime | Gets/Sets a value that overrides the defined MaxLockTime.
MaxResults | Gets/Sets a value that overrides the defined MaxResults.
MaxScanRows | Gets/Sets a value that overrides the defined MaxScanRows.
Password | Sets the password to conenct with.
Port | Gets/Sets the Perforce Server port.
ServerLevel | Checks the server level (version) of the Perforce server.
TicketFile | Sets the ticket file used for Authentication.
User | Gets/Sets the User login used to connect to Perforce.

Public Instance Methods

Connect | Connect to the Perforce server
ConvertDate | Overloaded. Converts Perforce date (integer) to .Net DateTime.
CreatePendingChangelist | Creates a new pending changelist.
Disconnect | Disconnect from the Perforce Server
Dispose | Calls Disconnect.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fetch_Form | Fetch a form object from Perforce.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
IsServerCaseSensitive | Checks the case-sensitivity of the Perforce server.
IsValidConnection | Determines if the Perforce connection is valid.
Login | Login to the Perforce Server
Parse_Form | Parse the raw text of a Perforce form into a P4Form object
PrintBinary | Print the contents of a file in Perforce to a byte array.
PrintStream | Overloaded. Prints the contents of a Perforce file to a Stream.
PrintStreamEvents | Runs a print command, and raises events for each file printed.
PrintText | Print the contents of a file in Perforce to a string.
Run | Executes a Perforce command in tagged mode.
RunCallback | Runs the specified command, calling the appropriate callback methods as Perforce returns information.
RunCallbackUnparsed | Runs the callback unparsed.
RunUnParsed | Executes a Perforce command in non-tagged mode.
Save_Form | Overloaded. Saves the form to Perforce.
ToString (inherited from Object) | Returns a String that represents the current Object.

Public Instance Events

OnPrintEndFile | Raised from P4PrintStreamEvents after a file is printed.
OnPrintStream | Raised from P4PrintStreamEvents before a file is printed.
OnPrompt | Raised when Perforce is prompting for a response.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Connection Class | P4API Namespace


P4Connection Constructor

Initializes a new instance of the P4Connection class.

[Visual Basic]
Public Sub New()
[C#]
public P4Connection();

See Also

P4Connection Class | P4API Namespace


P4Connection Properties

The properties of the P4Connection class are listed below. For a complete list of P4Connection class members, see the P4Connection Members topic.

Public Instance Properties

Api | Sets the client API protocol level.
CallingProgram | Get/Sets the name of the calling program.
CallingVersion | Gets/Sets the version of the calling program's version.
Charset | Gets/Sets the client character set.
Client | Gets/Sets the client workspace.
CWD | Gets/Sets the current working directory.
ExceptionLevel | Gets/Sets the Exception level when running Perforce commands.
Host | Gets/Sets the Host-name of the client.
Language | Sets the Language for message translations.
MaxLockTime | Gets/Sets a value that overrides the defined MaxLockTime.
MaxResults | Gets/Sets a value that overrides the defined MaxResults.
MaxScanRows | Gets/Sets a value that overrides the defined MaxScanRows.
Password | Sets the password to conenct with.
Port | Gets/Sets the Perforce Server port.
ServerLevel | Checks the server level (version) of the Perforce server.
TicketFile | Sets the ticket file used for Authentication.
User | Gets/Sets the User login used to connect to Perforce.

See Also

P4Connection Class | P4API Namespace


CallingProgram Property

Perforce API for the .Net CLR

P4Connection.CallingProgram Property

Get/Sets the name of the calling program.

[Visual Basic]
Public Property CallingProgram As String
[C#]
public string CallingProgram {get; set;}

Property Value

Defaults to "P4.Net API".

Remarks

This value is seen in p4 monitor and in the server log files.

See Also

P4Connection Class | P4API Namespace


CallingVersion Property

Perforce API for the .Net CLR

P4Connection.CallingVersion Property

Gets/Sets the version of the calling program's version.

[Visual Basic]
Public Property CallingVersion As String
[C#]
public string CallingVersion {get; set;}

Property Value

Defaults to the assembly version of the P4API.dll.

Remarks

This value is seen in p4 monitor and the server log files.

See Also

P4Connection Class | P4API Namespace


Charset Property

Perforce API for the .Net CLR

P4Connection.Charset Property

Gets/Sets the client character set.

[Visual Basic]
Public Property Charset As String
[C#]
public string Charset {get; set;}

Property Value

The client's charset.

Remarks

Defaults to the value set in your Perforce environment. After you've set Charset, you can unset (revert to the default) by setting to Charset to null.

See Also

P4Connection Class | P4API Namespace


Client Property

Perforce API for the .Net CLR

P4Connection.Client Property

Gets/Sets the client workspace.

[Visual Basic]
Public Property Client As String
[C#]
public string Client {get; set;}

Property Value

The client name.

Remarks

Many Perforce commands require a valid client spec to be set in order to run. Defaults to the value set in your Perforce environment. After you've set Client, you can unset (revert to the default) by setting to Client to null.

See Also

P4Connection Class | P4API Namespace


CWD Property

Perforce API for the .Net CLR

P4Connection.CWD Property

Gets/Sets the current working directory.

[Visual Basic]
Public Property CWD As String
[C#]
public string CWD {get; set;}

Property Value

The current working directory for the Perforce connection.

Remarks

Setting CWD can be used so that relative paths are specified. Keep in mind that changing the CWD also might cause P4CONFIG settings to change.

See Also

P4Connection Class | P4API Namespace


ExceptionLevel Property

Perforce API for the .Net CLR

P4Connection.ExceptionLevel Property

Gets/Sets the Exception level when running Perforce commands.

[Visual Basic]
Public Property ExceptionLevel As P4ExceptionLevels
[C#]
public P4ExceptionLevels ExceptionLevel {get; set;}

Property Value

The exception level for the connection.

Remarks

This property controls when P4.Net will throw exceptions when the underlying Perforce commands raise errors and warnings.

The default is P4ExceptionLevels.NoExceptionOnWarnings

See Also

P4Connection Class | P4API Namespace


Host Property

Perforce API for the .Net CLR

P4Connection.Host Property

Gets/Sets the Host-name of the client.

[Visual Basic]
Public Property Host As String
[C#]
public string Host {get; set;}

Property Value

The client Host name.

Remarks

Forcing the Host to a different name is useful when using a client that was defined on a different host. Of course, that can cause issues with the client's have list, so use with caution.

See Also

P4Connection Class | P4API Namespace


Password Property

Perforce API for the .Net CLR

P4Connection.Password Property

Sets the password to conenct with.

[Visual Basic]
Public Property Password As String
[C#]
public string Password {get; set;}

Property Value

The user's password.

Remarks

Do not set the literal password with a server running security level 2 or higher. For those servers, Use the Login method and/or a ticket in place of the Password.

See Also

P4Connection Class | P4API Namespace


Port Property

Perforce API for the .Net CLR

P4Connection.Port Property

Gets/Sets the Perforce Server port.

[Visual Basic]
Public Property Port As String
[C#]
public string Port {get; set;}

Property Value

The port.

Remarks

Defaults to the value set in your Perforce environment. Port can not be changed after running Connect (not even after a Disconnect). To connect to a server on another port, create a new instance of P4Connection.

See Also

P4Connection Class | P4API Namespace


TicketFile Property

Perforce API for the .Net CLR

P4Connection.TicketFile Property

Sets the ticket file used for Authentication.

[Visual Basic]
Public Property TicketFile As String
[C#]
public string TicketFile {get; set;}

Property Value

Overrided the ticket file location.

Remarks

Use this to override the default location of the TicketFile.

See Also

P4Connection Class | P4API Namespace


User Property

Perforce API for the .Net CLR

P4Connection.User Property

Gets/Sets the User login used to connect to Perforce.

[Visual Basic]
Public Property User As String
[C#]
public string User {get; set;}

Property Value

The user.

Remarks

Defaults to the value set in your Perforce environment. After you've set User, you can unset (revert to the default) by setting to User to null.

See Also

P4Connection Class | P4API Namespace


P4Connection Methods

The methods of the P4Connection class are listed below. For a complete list of P4Connection class members, see the P4Connection Members topic.

Public Instance Methods

Connect | Connect to the Perforce server
ConvertDate | Overloaded. Converts Perforce date (integer) to .Net DateTime.
CreatePendingChangelist | Creates a new pending changelist.
Disconnect | Disconnect from the Perforce Server
Dispose | Calls Disconnect.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fetch_Form | Fetch a form object from Perforce.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
IsServerCaseSensitive | Checks the case-sensitivity of the Perforce server.
IsValidConnection | Determines if the Perforce connection is valid.
Login | Login to the Perforce Server
Parse_Form | Parse the raw text of a Perforce form into a P4Form object
PrintBinary | Print the contents of a file in Perforce to a byte array.
PrintStream | Overloaded. Prints the contents of a Perforce file to a Stream.
PrintStreamEvents | Runs a print command, and raises events for each file printed.
PrintText | Print the contents of a file in Perforce to a string.
Run | Executes a Perforce command in tagged mode.
RunCallback | Runs the specified command, calling the appropriate callback methods as Perforce returns information.
RunCallbackUnparsed | Runs the callback unparsed.
RunUnParsed | Executes a Perforce command in non-tagged mode.
Save_Form | Overloaded. Saves the form to Perforce.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Connection Class | P4API Namespace


P4Connection.Connect Method

Connect to the Perforce server

[Visual Basic]
Public Sub Connect()
[C#]
public void Connect();

See Also

P4Connection Class | P4API Namespace


ConvertDate Method

Perforce API for the .Net CLR

P4Connection.ConvertDate Method

Converts .Net DateTime to Perforce date (integer).

Overload List

Converts .Net DateTime to Perforce date (integer).

public int ConvertDate(DateTime);

Converts Perforce date (integer) to .Net DateTime.

public DateTime ConvertDate(int);

Converts Perforce date (integer value as a string) to .Net DateTime.

public DateTime ConvertDate(string);

See Also

P4Connection Class | P4API Namespace


P4Connection.ConvertDate Method (DateTime)

Converts .Net DateTime to Perforce date (integer).

[Visual Basic]
Overloads Public Function ConvertDate( _
ByVal date As Date _
) As Integer
[C#]
public int ConvertDate(
DateTime date
);

Parameters

date
Missing <param> documentation for date

Return Value

Missing <returns> documentation for M:P4API.P4Connection.ConvertDate(System.DateTime)

Remarks

The Perforce API returns most dates as an integer representing the number of seconds since 1/1/1970 in UTC. The command line client generally returns dates as strings in the Perforce server's time zone. The ConvertDate methods use the client's time zone for the offset.

See Also

P4Connection Class | P4API Namespace | P4Connection.ConvertDate Overload List


P4Connection.ConvertDate Method (Int32)

Converts Perforce date (integer) to .Net DateTime.

[Visual Basic]
Overloads Public Function ConvertDate( _
ByVal p4Date As Integer _
) As Date
[C#]
public DateTime ConvertDate(
int p4Date
);

Parameters

p4Date
Missing <param> documentation for p4Date

Return Value

DateTime in .Net format.

Remarks

The Perforce API returns most dates as an integer representing the number of seconds since 1/1/1970 in UTC. The command line client generally returns dates as strings in the Perforce server's time zone. The ConvertDate methods use the client's time zone for the offset.

See Also

P4Connection Class | P4API Namespace | P4Connection.ConvertDate Overload List


P4Connection.ConvertDate Method (String)

Converts Perforce date (integer value as a string) to .Net DateTime.

[Visual Basic]
Overloads Public Function ConvertDate( _
ByVal p4Date As String _
) As Date
[C#]
public DateTime ConvertDate(
string p4Date
);

Parameters

p4Date
Missing <param> documentation for p4Date

Return Value

Missing <returns> documentation for M:P4API.P4Connection.ConvertDate(System.String)

Remarks

The Perforce API returns most dates as an integer representing the number of seconds since 1/1/1970 in UTC. The command line client generally returns dates as strings in the Perforce server's time zone. The ConvertDate methods use the client's time zone for the offset.

See Also

P4Connection Class | P4API Namespace | P4Connection.ConvertDate Overload List


P4Connection.CreatePendingChangelist Method

Creates a new pending changelist.

[Visual Basic]
Public Function CreatePendingChangelist( _
ByVal Description As String _
) As P4PendingChangelist
[C#]
public P4PendingChangelist CreatePendingChangelist(
string Description
);

Parameters

Description
The description.

Return Value

P4PendingChangelist object representing the named pending changelist

See Also

P4Connection Class | P4API Namespace


P4Connection.Disconnect Method

Disconnect from the Perforce Server

[Visual Basic]
Public Sub Disconnect()
[C#]
public void Disconnect();

See Also

P4Connection Class | P4API Namespace


P4Connection.Dispose Method

Calls Disconnect.

[Visual Basic]
NotOverridable Public Sub Dispose() _
Implements IDisposable.Dispose
[C#]
public void Dispose();

Implements

IDisposable.Dispose

See Also

P4Connection Class | P4API Namespace


P4Connection.Fetch_Form Method

Fetch a form object from Perforce.

[Visual Basic]
Public Function Fetch_Form( _
ByVal FormCommand As String, _
ParamArray Args As String() _
) As P4Form
[C#]
public P4Form Fetch_Form(
string FormCommand,
params string[] Args
);

Parameters

FormCommand
The form command.
Args
The args.

Return Value

A Form object. The fields of the form can be read or updated. If you update a filed, you can save it with Save_Form.

Remarks

Forms are the things that pop-up in an editor when run from a command line. In P4.Net (and most other Perforce APIs), you do not need to parse/format the text manually. Instead, you can get/set the fields using the Fields and ArrayFields collections.

The following is a list of common form commands:

  • client
  • branch
  • label
  • job
  • user
  • group
  • protect
  • triggers
  • branch
    •

    When fetching or saving a form, do not use the '-o' and '-i' flags. P4.Net will automatically include them.

    See Also

    P4Connection Class | P4API Namespace


P4Connection.IsValidConnection Method

Determines if the Perforce connection is valid.

[Visual Basic]
Public Function IsValidConnection( _
ByVal checkLogin As Boolean, _
ByVal checkClient As Boolean _
) As Boolean
[C#]
public bool IsValidConnection(
bool checkLogin,
bool checkClient
);

Parameters

checkLogin
if set to true it will check if the user is logged in.
checkClient
if set to true it will verify the client exists.

Return Value

true if the connection is valid; otherwise, false.

Remarks

IsValidConnection performs the following 3 checks (depending on the arguments passed).

  • Runs p4 info, and verifies the server is valid.
  • If checkClient is true, verifies that p4 info returns a clientName that is not "*unknown*.
  • If checkLogin is true, verifies that p4 login -s does not have errors.

    • See Also

    P4Connection Class | P4API Namespace


P4Connection.Login Method

Login to the Perforce Server

[Visual Basic]
Public Sub Login( _
ByVal password As String _
)
[C#]
public void Login(
string password
);

Parameters

password
The password.

See Also

P4Connection Class | P4API Namespace


P4Connection.Run Method

Executes a Perforce command in tagged mode.

[Visual Basic]
Public Function Run( _
ByVal Command As String, _
ParamArray Args As String() _
) As P4RecordSet
[C#]
public P4RecordSet Run(
string Command,
params string[] Args
);

Parameters

Command
The command.
Args
The arguments to the Perforce command. Remember to use a dash (-) in front of all switches

Return Value

A P4Recordset containing the results of the command.

See Also

P4Connection Class | P4API Namespace


P4Connection.RunUnParsed Method

Executes a Perforce command in non-tagged mode.

[Visual Basic]
Public Function RunUnParsed( _
ByVal Command As String, _
ParamArray Args As String() _
) As P4UnParsedRecordSet
[C#]
public P4UnParsedRecordSet RunUnParsed(
string Command,
params string[] Args
);

Parameters

Command
The command.
Args
The args.

Return Value

Missing <returns> documentation for M:P4API.P4Connection.RunUnParsed(System.String,System.String[])

See Also

P4Connection Class | P4API Namespace


Save_Form Method

Perforce API for the .Net CLR

P4Connection.Save_Form Method

Saves the form to Perforce.

Overload List

Saves the form to Perforce.

public P4UnParsedRecordSet Save_Form(P4Form);

Saves the form to Perforce.

public P4UnParsedRecordSet Save_Form(P4Form,bool);

Saves the form to Perforce.

public P4UnParsedRecordSet Save_Form(P4Form,params string[]);

Saves the form to Perforce.

public P4UnParsedRecordSet Save_Form(string,string,bool);

Saves the form to Perforce.

public P4UnParsedRecordSet Save_Form(string,string,params string[]);

See Also

P4Connection Class | P4API Namespace


P4Connection.Save_Form Method (P4Form)

Saves the form to Perforce.

[Visual Basic]
Overloads Public Function Save_Form( _
ByVal Form As P4Form _
) As P4UnParsedRecordSet
[C#]
public P4UnParsedRecordSet Save_Form(
P4Form Form
);

Parameters

Form
The P4Form object retrieved from Fetch_Form.

Return Value

P4UnParsedRecordSet. Output can be parsed to verify the form was processed correctly.

Remarks

Forms are the things that pop-up in an editor when run from a command line. In P4.Net (and most other Perforce APIs), you do not need to parse/format the text manually. Instead, you can get/set the fields using the Fields and ArrayFields collections.

The following is a list of common form commands:

  • client
  • branch
  • label
  • job
  • user
  • group
  • protect
  • triggers
  • branch
    •

    When fetching or saving a form, do not use the '-o' and '-i' flags. P4.Net will automatically include them.

    See Also

    P4Connection Class | P4API Namespace | P4Connection.Save_Form Overload List


P4Connection.Save_Form Method (String, String, String[])

Saves the form to Perforce.

[Visual Basic]
Overloads Public Function Save_Form( _
ByVal formCommand As String, _
ByVal formSpec As String, _
ParamArray args As String() _
) As P4UnParsedRecordSet
[C#]
public P4UnParsedRecordSet Save_Form(
string formCommand,
string formSpec,
params string[] args
);

Parameters

formCommand
The form command to run.
formSpec
The formatted spec.
args
Arguments to the form command.

Return Value

P4UnParsedRecordSet. Output can be parsed to verify the form was processed correctly.

See Also

P4Connection Class | P4API Namespace | P4Connection.Save_Form Overload List


P4Connection Events

The events of the P4Connection class are listed below. For a complete list of P4Connection class members, see the P4Connection Members topic.

Public Instance Events

OnPrintEndFile | Raised from P4PrintStreamEvents after a file is printed.
OnPrintStream | Raised from P4PrintStreamEvents before a file is printed.
OnPrompt | Raised when Perforce is prompting for a response.

See Also

P4Connection Class | P4API Namespace


P4Connection.OnPrompt Event

Raised when Perforce is prompting for a response.

[Visual Basic]
Public Event OnPrompt As OnPromptEventHandler
[C#]
public event OnPromptEventHandler OnPrompt;

Event Data

The event handler receives an argument of type P4PromptEventArgs containing data related to this event. The following P4PromptEventArgs properties provide information specific to this event.

Property | Description
Message | The message from Perforce.
Response | The value to respond to Perforce with.

Remarks

Handle Perforce "prompts". Prompts are from commands that ask the user to respond, such as:

  • login
  • passwd
  • resolve (without an -a* switch)

    • Example

    The following sample will change the user's password.

    public class PasswordSetter
{
    private P4Connection _p4 = null;
    private string _oldPassword = "";
    private string _newPassword = "";
    PasswordSetter(P4Connection p4)
    {
        _p4 = p4;
    }

    public void SetPassword(string OldPassword, string NewPassword)
    {
        OnPromptEventHandler eh = new OnPromptEventHandler(OnPrompt);
        _p4.OnPrompt += eh;

        _oldPassword = OldPassword;
        _newPassword = NewPassword;

        //run passwd
        P4UnParsedRecordSet r = _p4.RunUnParsed("passwd");

        //Clear the event just in case
        _p4.OnPrompt -= eh;

        //Clear the passwords from memory
        _newPassword = "";
        _oldPassword = "";
    }

    private void OnPrompt(object sender, P4PromptEventArgs e)
    {
        switch (e.Message)
        {
            case ("Enter old password: "):
                e.Response = _oldPassword;
                break;
            case ("Enter new password: "):
                e.Response = _newPassword;
                break;
            case ("Re-enter new password: "):
                e.Response = _newPassword;
                break;
        }
    }
}

    See Also

    P4Connection Class | P4API Namespace


P4ExceptionLevels Enumeration

Defines the exception levels available in P4Connection.

[Visual Basic]
Public Enum P4ExceptionLevels
[C#]
public enum P4ExceptionLevels

Members

Member Name | Description
NoExceptionOnWarnings | Exceptions will only be thrown when Perforce has errors. This is the default exception level.
NoExceptionOnErrors | Exceptions will never be thrown when Perforce has errors.
ExceptionOnBothErrorsAndWarnings | Exceptions will be thrown for both Errors and Warnings.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4API Namespace


P4Form Class

Represents a Perforce 'Form' object.

For a list of all members of this type, see P4Form Members.

System.Object
P4API.P4Record
P4API.P4Form

[Visual Basic]
Public Class P4Form
Inherits P4Record
[C#]
public class P4Form : P4Record

Remarks

Forms are the things that pop-up in an editor when run from a command line. In P4.Net (and most other Perforce APIs), you do not need to parse/format the text manually. Instead, you can get/set the fields using the Fields and ArrayFields collections.

The following is a list of common form commands:

  • client
  • branch
  • label
  • job
  • user
  • group
  • protect
  • triggers
  • branch
    •

    When fetching or saving a form, do not use the '-o' and '-i' flags. P4.Net will automatically include them.

    Example

    The following example updates the current client. It changes the client root, and adds a line to the view.

              P4Connection p4 = new P4Connection();
          p4.Connect();

          P4Form MyClient = p4.Fetch_Form("client");

          //Change the root and properties
          MyClient["Root"] = @"C:\p4\P4.NetClient";
          MyClient["Description"] = "Created from P4.Net!";

          //Fetch the clientName (for use later in building the view spec).
          string clientName = MyClient["Client"];

          // Build a new array, that has one more element than the current view
          string[] NewView = new string[MyClient.ArrayFields["View"].Length + 1];

          // Copy the existing view lines to the new array
          MyClient.ArrayFields["View"].CopyTo(NewView,0);

          // Set the new view line
          NewView[NewView.Length - 1] = string.Format("//depot/newpath/... //{0}/newpath/...", clientName);

          MyClient.ArrayFields["View"] = NewView;

          // Save the form
          P4UnParsedRecordSet MyResult = p4.Save_Form(MyClient);
          p4.Disconnect();

    Requirements

    Namespace: P4API

    Assembly: p4api (in p4api.dll)

    See Also

    P4Form Members | P4API Namespace


P4Form Members

P4Form overview

Public Static (Shared) Methods

LoadFromSpec Parses a Perforce form without making a server connection.

Public Instance Properties

ArrayFields (inherited from P4Record) | Gets the ArrayFieldDictionary returned from the Perforce command.
Fields (inherited from P4Record) | Gets the FieldDictionary returned from the Perforce command.
FormCommand | Gets the form command.
Item (inherited from P4Record) | Returns the value of of the Field by key. This is the same as Fields[key].
PermittedFields | Gets a StringCollection containing the names of all the allowable fields in the form.
SpecDef | The underlying C++ API 'specdef' defining the form.

Public Instance Methods

Clone | Copies the P4Form object into a new instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
FormatSpec | Formats the P4Form as a formated Perforce spec.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Form Class | P4API Namespace


P4Form Properties

The properties of the P4Form class are listed below. For a complete list of P4Form class members, see the P4Form Members topic.

Public Instance Properties

ArrayFields (inherited from P4Record) | Gets the ArrayFieldDictionary returned from the Perforce command.
Fields (inherited from P4Record) | Gets the FieldDictionary returned from the Perforce command.
FormCommand | Gets the form command.
Item (inherited from P4Record) | Returns the value of of the Field by key. This is the same as Fields[key].
PermittedFields | Gets a StringCollection containing the names of all the allowable fields in the form.
SpecDef | The underlying C++ API 'specdef' defining the form.

See Also

P4Form Class | P4API Namespace


FormCommand Property

Perforce API for the .Net CLR

P4Form.FormCommand Property

Gets the form command.

[Visual Basic]
Public ReadOnly Property FormCommand As String
[C#]
public string FormCommand {get;}

Property Value

The command that was executed when the form was run.

See Also

P4Form Class | P4API Namespace


P4PendingChangelist Class

Represents a pending changelist from Perforce.

For a list of all members of this type, see P4PendingChangelist Members.

System.Object
P4API.P4PendingChangelist

[Visual Basic]
Public Class P4PendingChangelist
[C#]
public class P4PendingChangelist

Remarks

The P4PendindingChangelist object is used to submit files with P4.Net. The first step is to create a new pending changelist, then add the switches "-c", and "1234" (1234 is the changelist number) to all commands that are opening files. In P4.Net, there’s no straight-forward way to submit the default pending changelist. This is by design. If the client workspace has opened files in the default changelist before any P4.Net automation runs, those files will "come along for the ride" when you submit the default changelist. If the user has a JobView set, all jobs in that JobView will automatically be fixed when you submit the default changelist. Both of those behaviors are almost never desired, and I’ve found many scripts that have those bugs.

Example

The following example demonstrates submiting files with P4PendingChangelist.

P4Connection p4 = new P4Connection();
p4.Connect();
P4PendingChangelist  cl = p4.CreatePendingChangelist("My New Changelist\nVery, Very bad description!\nShame on me!");
p4.Run("edit", "-c", cl.Number.ToString(), "//depot/path/foo.cs", "//depot/path/bar.cs");
// Do something to manipulate the files
cl.Submit();
p4.Disconnect();

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4PendingChangelist Members | P4API Namespace


P4PendingChangelist Members

P4PendingChangelist overview

Public Instance Properties

Description | Gets the pending changelist's description.
Number | Gets the pending changelist's number.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
Submit | Submits the pending changelist to Perforce.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4PendingChangelist Class | P4API Namespace


P4PendingChangelist Properties

The properties of the P4PendingChangelist class are listed below. For a complete list of P4PendingChangelist class members, see the P4PendingChangelist Members topic.

Public Instance Properties

Description | Gets the pending changelist's description.
Number | Gets the pending changelist's number.

See Also

P4PendingChangelist Class | P4API Namespace


Description Property

Perforce API for the .Net CLR

P4PendingChangelist.Description Property

Gets the pending changelist's description.

[Visual Basic]
Public ReadOnly Property Description As String
[C#]
public string Description {get;}

Property Value

The description.

See Also

P4PendingChangelist Class | P4API Namespace


Number Property

Perforce API for the .Net CLR

P4PendingChangelist.Number Property

Gets the pending changelist's number.

[Visual Basic]
Public ReadOnly Property Number As Integer
[C#]
public int Number {get;}

Property Value

The changelist number.

See Also

P4PendingChangelist Class | P4API Namespace


P4PendingChangelist Methods

The methods of the P4PendingChangelist class are listed below. For a complete list of P4PendingChangelist class members, see the P4PendingChangelist Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
Submit | Submits the pending changelist to Perforce.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4PendingChangelist Class | P4API Namespace


P4PendingChangelist.Submit Method

Submits the pending changelist to Perforce.

[Visual Basic]
Public Function Submit() As P4UnParsedRecordSet
[C#]
public P4UnParsedRecordSet Submit();

Return Value

P4UnParsedRecordSet with the results of the submit.

See Also

P4PendingChangelist Class | P4API Namespace


P4PromptEventArgs Class

Arguments provided for an OnPrompt event.

For a list of all members of this type, see P4PromptEventArgs Members.

System.Object
System.EventArgs
P4API.P4PromptEventArgs

[Visual Basic]
Public Class P4PromptEventArgs
Inherits EventArgs
[C#]
public class P4PromptEventArgs : EventArgs

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4PromptEventArgs Members | P4API Namespace


P4PromptEventArgs Members

P4PromptEventArgs overview

Public Instance Properties

Message | The message from Perforce.
Response | The value to respond to Perforce with.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4PromptEventArgs Class | P4API Namespace


P4PromptEventArgs Properties

The properties of the P4PromptEventArgs class are listed below. For a complete list of P4PromptEventArgs class members, see the P4PromptEventArgs Members topic.

Public Instance Properties

Message | The message from Perforce.
Response | The value to respond to Perforce with.

See Also

P4PromptEventArgs Class | P4API Namespace


Message Property

Perforce API for the .Net CLR

P4PromptEventArgs.Message Property

The message from Perforce.

[Visual Basic]
Public ReadOnly Property Message As String
[C#]
public string Message {get;}

Property Value

The prompt message from Perforce.

See Also

P4PromptEventArgs Class | P4API Namespace


Response Property

Perforce API for the .Net CLR

P4PromptEventArgs.Response Property

The value to respond to Perforce with.

[Visual Basic]
Public Property Response As String
[C#]
public string Response {get; set;}

Property Value

The response to the Perforce command.

See Also

P4PromptEventArgs Class | P4API Namespace


P4Record Class

P4Record is a dictionary-like object that provides a means of interpreting Perforce results.

For a list of all members of this type, see P4Record Members.

System.Object
P4API.P4Record
P4API.P4Form

[Visual Basic]
Public Class P4Record
[C#]
public class P4Record

Remarks

The Perforce api provides "parsed" output in the form of key-value pairs. Keys are always strings (case sensitive). From the raw api, the values come in 3 flavors:

  • Simple strings.
  • List of strings.
  • Sparse multi-demensional list of strings.
    • P4.Net does not yet handle the third type (which only comes from certain output of p4 filelog).

    To access simple string values by key, use the Fields property (or the default indexer).

    To access lists of strings by key, use the ArrayFields property.

    Requirements

    Namespace: P4API

    Assembly: p4api (in p4api.dll)

    See Also

    P4Record Members | P4API Namespace


P4Record Members

P4Record overview

Public Instance Properties

ArrayFields | Gets the ArrayFieldDictionary returned from the Perforce command.
Fields | Gets the FieldDictionary returned from the Perforce command.
Item | Returns the value of of the Field by key. This is the same as Fields[key].

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Record Class | P4API Namespace


P4Record Properties

The properties of the P4Record class are listed below. For a complete list of P4Record class members, see the P4Record Members topic.

Public Instance Properties

ArrayFields | Gets the ArrayFieldDictionary returned from the Perforce command.
Fields | Gets the FieldDictionary returned from the Perforce command.
Item | Returns the value of of the Field by key. This is the same as Fields[key].

See Also

P4Record Class | P4API Namespace


ArrayFields Property

Perforce API for the .Net CLR

P4Record.ArrayFields Property

Gets the ArrayFieldDictionary returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property ArrayFields As ArrayFieldDictionary
[C#]
public ArrayFieldDictionary ArrayFields {get;}

Property Value

The array-value fields returned for the current record.

See Also

P4Record Class | P4API Namespace


Fields Property

Perforce API for the .Net CLR

P4Record.Fields Property

Gets the FieldDictionary returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property Fields As FieldDictionary
[C#]
public FieldDictionary Fields {get;}

Property Value

The single-value fields returned for the current record.

See Also

P4Record Class | P4API Namespace


Item Property

Perforce API for the .Net CLR

P4Record.Item Property

Returns the value of of the Field by key. This is the same as Fields[key].

[Visual Basic]
Public Default Property Item( _
ByVal key As String _
) As String
[C#]
public string this[
string key
] {get; set;}

Parameters

key
The key for

Property Value

The value for field 'key'.

See Also

P4Record Class | P4API Namespace


P4RecordSet Class

Provides output of a Perforce Command in "tagged" moded.

For a list of all members of this type, see P4RecordSet Members.

System.Object
P4API.P4BaseRecordSet
P4API.P4RecordSet

[Visual Basic]
Public Class P4RecordSet
Inherits P4BaseRecordSet
Implements IEnumerable
[C#]
public class P4RecordSet : P4BaseRecordSet, IEnumerable

Remarks

P4Recordset is an enumerable collection of P4Records that supply keyed access to information returned from Perforce.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4RecordSet Members | P4API Namespace


P4RecordSet Members

P4RecordSet overview

Public Instance Properties

ErrorMessage (inherited from P4BaseRecordSet) | Gets an error messages returned from the Perforce command.
Errors (inherited from P4BaseRecordSet) | Gets an array of error messages returned from the Perforce command.
Item | Gets the record at the specified index.
Messages | Gets an array of string messages returned from the Perforce command.
P4Messages (inherited from P4BaseRecordSet) | Gets an array of P4Messages returned from the Perforce command.
Records | Gets an array of records returned from the Perforce command.
Warnings (inherited from P4BaseRecordSet) | Gets an array of warning messages returned from the Perforce command.

Public Instance Methods

Dump (inherited from P4BaseRecordSet) | Dumps recordset data to the Trace listner.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
HasErrors (inherited from P4BaseRecordSet) | Checks the Recordset to determine if errors occured.
HasWarnings (inherited from P4BaseRecordSet) | Checks the Recordset to determine if warnings occured.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4RecordSet Class | P4API Namespace


P4RecordSet Properties

The properties of the P4RecordSet class are listed below. For a complete list of P4RecordSet class members, see the P4RecordSet Members topic.

Public Instance Properties

ErrorMessage (inherited from P4BaseRecordSet) | Gets an error messages returned from the Perforce command.
Errors (inherited from P4BaseRecordSet) | Gets an array of error messages returned from the Perforce command.
Item | Gets the record at the specified index.
Messages | Gets an array of string messages returned from the Perforce command.
P4Messages (inherited from P4BaseRecordSet) | Gets an array of P4Messages returned from the Perforce command.
Records | Gets an array of records returned from the Perforce command.
Warnings (inherited from P4BaseRecordSet) | Gets an array of warning messages returned from the Perforce command.

See Also

P4RecordSet Class | P4API Namespace


Item Property

Perforce API for the .Net CLR

P4RecordSet.Item Property

Gets the record at the specified index.

[Visual Basic]
Public Default ReadOnly Property Item( _
ByVal Index As Integer _
) As P4Record
[C#]
public P4Record this[
int Index
] {get;}

Parameters

Index
Index of the record to get.

Property Value

Returns the record at 'Index'.

See Also

P4RecordSet Class | P4API Namespace


Messages Property

Perforce API for the .Net CLR

P4RecordSet.Messages Property

Gets an array of string messages returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property Messages As String()
[C#]
new public string[] Messages {get;}

Property Value

Array of informational messages returned from a Perforce command.

See Also

P4RecordSet Class | P4API Namespace


Records Property

Perforce API for the .Net CLR

P4RecordSet.Records Property

Gets an array of records returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property Records As P4Record()
[C#]
public P4Record[] Records {get;}

Property Value

Array of P4Records.

See Also

P4RecordSet Class | P4API Namespace


P4UnParsedRecordSet Class

This class represents the "unparsed" output from a Perforce command.

For a list of all members of this type, see P4UnParsedRecordSet Members.

System.Object
P4API.P4BaseRecordSet
P4API.P4UnParsedRecordSet

[Visual Basic]
Public Class P4UnParsedRecordSet
Inherits P4BaseRecordSet
Implements IEnumerable
[C#]
public class P4UnParsedRecordSet : P4BaseRecordSet, IEnumerable

Remarks

In general P4UnParsedRecordSet will return an array of strings which is analagous to a line printed to stdout in p4.exe. Errors and Warnings are stored in the Errors and Warnings properties respectively.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4UnParsedRecordSet Members | P4API Namespace


P4UnParsedRecordSet Members

P4UnParsedRecordSet overview

Public Instance Properties

ErrorMessage (inherited from P4BaseRecordSet) | Gets an error messages returned from the Perforce command.
Errors (inherited from P4BaseRecordSet) | Gets an array of error messages returned from the Perforce command.
Item | Gets message at the specified index.
Messages | Gets array of messages returned from the Perforce command.
P4Messages (inherited from P4BaseRecordSet) | Gets an array of P4Messages returned from the Perforce command.
Warnings (inherited from P4BaseRecordSet) | Gets an array of warning messages returned from the Perforce command.

Public Instance Methods

Dump (inherited from P4BaseRecordSet) | Dumps recordset data to the Trace listner.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
HasErrors (inherited from P4BaseRecordSet) | Checks the Recordset to determine if errors occured.
HasWarnings (inherited from P4BaseRecordSet) | Checks the Recordset to determine if warnings occured.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4UnParsedRecordSet Class | P4API Namespace


P4UnParsedRecordSet Properties

The properties of the P4UnParsedRecordSet class are listed below. For a complete list of P4UnParsedRecordSet class members, see the P4UnParsedRecordSet Members topic.

Public Instance Properties

ErrorMessage (inherited from P4BaseRecordSet) | Gets an error messages returned from the Perforce command.
Errors (inherited from P4BaseRecordSet) | Gets an array of error messages returned from the Perforce command.
Item | Gets message at the specified index.
Messages | Gets array of messages returned from the Perforce command.
P4Messages (inherited from P4BaseRecordSet) | Gets an array of P4Messages returned from the Perforce command.
Warnings (inherited from P4BaseRecordSet) | Gets an array of warning messages returned from the Perforce command.

See Also

P4UnParsedRecordSet Class | P4API Namespace


Item Property

Perforce API for the .Net CLR

P4UnParsedRecordSet.Item Property

Gets message at the specified index.

[Visual Basic]
Public Default ReadOnly Property Item( _
ByVal index As Integer _
) As String
[C#]
public string this[
int index
] {get;}

Parameters

index
Index of the message.

Property Value

Message at 'index'.

Remarks

This is the same as running record.Messages[0];

See Also

P4UnParsedRecordSet Class | P4API Namespace


Messages Property

Perforce API for the .Net CLR

P4UnParsedRecordSet.Messages Property

Gets array of messages returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property Messages As String()
[C#]
new public string[] Messages {get;}

Property Value

Array of messages returned from Perforce.

See Also

P4UnParsedRecordSet Class | P4API Namespace


P4API.Exceptions

Perforce API for the .Net CLR

P4API.Exceptions Namespace

Missing <summary> Documentation for P4API.Exceptions

Namespace hierarchy

Classes

Class | Description
DiffNotImplemented | Support for diff (without -s* flag) not yet implemented
ErrorPauseCalled | ClientUser ErrorPause method was called. This in unsupported in P4.Net.
FileNotFound | Exception: File not found!
FormCommandException | Exception: Interactive 'Form' commands are unsupported in P4API. Use the 'Fetch_Form' and 'Save_Form' methods of the P4Connection object.
FormFetchException | Exception: Error attempting to fetch form.
FormParseException | Error parsing the form spec.
InvalidFormArgument | Exception: You can not use the '-o' and '-i' flags in Fetch_Form and Save_Form.
InvalidLogin | Exception: Invalid login credentials.
MergeNotImplemented | Support for merging not yet implemented
P4APIExceptions | Base exception for P4API.
PerforceInitializationError | Exception: Unable to connect to the Perforce Server!
RunException | Exception: Error running Perforce command!
RunUnParsedException | Exception: Error running Perforce command!
ServerAlreadyConnected | Exception: Changing the port when a server is connected is not allowed!
ServerNotConnected | Exception: Attempting to run a command while the Perforce Server is not connected!
ServerNotConnected_SetVar_AfterInit | Exception: Attempting to set a property that can not be set after the server is connected!
StreamNotWriteable | Exception: Can not write to stream.


FormCommandException Class

Exception: Interactive 'Form' commands are unsupported in P4API. Use the 'Fetch_Form' and 'Save_Form' methods of the P4Connection object.

For a list of all members of this type, see FormCommandException Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.FormCommandException

[Visual Basic]
Public Class FormCommandException
Inherits P4APIExceptions
[C#]
public class FormCommandException : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

FormCommandException Members | P4API.Exceptions Namespace


FormCommandException Members

FormCommandException overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FormCommandException Class | P4API.Exceptions Namespace


FormCommandException Properties

The properties of the FormCommandException class are listed below. For a complete list of FormCommandException class members, see the FormCommandException Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

FormCommandException Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

FormCommandException.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

FormCommandException Class | P4API.Exceptions Namespace


FormFetchException Class

Exception: Error attempting to fetch form.

For a list of all members of this type, see FormFetchException Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.FormFetchException

[Visual Basic]
Public Class FormFetchException
Inherits P4APIExceptions
[C#]
public class FormFetchException : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

FormFetchException Members | P4API.Exceptions Namespace


FormFetchException Members

FormFetchException overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FormFetchException Class | P4API.Exceptions Namespace


FormFetchException Properties

The properties of the FormFetchException class are listed below. For a complete list of FormFetchException class members, see the FormFetchException Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

FormFetchException Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

FormFetchException.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

FormFetchException Class | P4API.Exceptions Namespace


InvalidFormArgument Class

Exception: You can not use the '-o' and '-i' flags in Fetch_Form and Save_Form.

For a list of all members of this type, see InvalidFormArgument Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.InvalidFormArgument

[Visual Basic]
Public Class InvalidFormArgument
Inherits P4APIExceptions
[C#]
public class InvalidFormArgument : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

InvalidFormArgument Members | P4API.Exceptions Namespace


InvalidFormArgument Members

InvalidFormArgument overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

InvalidFormArgument Class | P4API.Exceptions Namespace


InvalidFormArgument Properties

The properties of the InvalidFormArgument class are listed below. For a complete list of InvalidFormArgument class members, see the InvalidFormArgument Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

InvalidFormArgument Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

InvalidFormArgument.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

InvalidFormArgument Class | P4API.Exceptions Namespace


InvalidLogin Class

Exception: Invalid login credentials.

For a list of all members of this type, see InvalidLogin Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.InvalidLogin

[Visual Basic]
Public Class InvalidLogin
Inherits P4APIExceptions
[C#]
public class InvalidLogin : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

InvalidLogin Members | P4API.Exceptions Namespace


InvalidLogin Members

InvalidLogin overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

InvalidLogin Class | P4API.Exceptions Namespace


InvalidLogin Properties

The properties of the InvalidLogin class are listed below. For a complete list of InvalidLogin class members, see the InvalidLogin Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

InvalidLogin Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

InvalidLogin.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

InvalidLogin Class | P4API.Exceptions Namespace


P4APIExceptions Class

Base exception for P4API.

For a list of all members of this type, see P4APIExceptions Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
Derived types

[Visual Basic]
Public Class P4APIExceptions
Inherits Exception
[C#]
public class P4APIExceptions : Exception

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

P4APIExceptions Members | P4API.Exceptions Namespace


P4APIExceptions Members

P4APIExceptions overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4APIExceptions Class | P4API.Exceptions Namespace


P4APIExceptions Properties

The properties of the P4APIExceptions class are listed below. For a complete list of P4APIExceptions class members, see the P4APIExceptions Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

P4APIExceptions Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

P4APIExceptions.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

P4APIExceptions Class | P4API.Exceptions Namespace


PerforceInitializationError Class

Exception: Unable to connect to the Perforce Server!

For a list of all members of this type, see PerforceInitializationError Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.PerforceInitializationError

[Visual Basic]
Public Class PerforceInitializationError
Inherits P4APIExceptions
[C#]
public class PerforceInitializationError : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

PerforceInitializationError Members | P4API.Exceptions Namespace


PerforceInitializationError Members

PerforceInitializationError overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

PerforceInitializationError Class | P4API.Exceptions Namespace


PerforceInitializationError Properties

The properties of the PerforceInitializationError class are listed below. For a complete list of PerforceInitializationError class members, see the PerforceInitializationError Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

PerforceInitializationError Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

PerforceInitializationError.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

PerforceInitializationError Class | P4API.Exceptions Namespace


RunException Class

Exception: Error running Perforce command!

For a list of all members of this type, see RunException Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.RunException

[Visual Basic]
Public Class RunException
Inherits P4APIExceptions
[C#]
public class RunException : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

RunException Members | P4API.Exceptions Namespace


RunException Members

RunException overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

RunException Class | P4API.Exceptions Namespace


RunException Properties

The properties of the RunException class are listed below. For a complete list of RunException class members, see the RunException Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

RunException Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

RunException.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

RunException Class | P4API.Exceptions Namespace


RunUnParsedException Class

Exception: Error running Perforce command!

For a list of all members of this type, see RunUnParsedException Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.RunUnParsedException

[Visual Basic]
Public Class RunUnParsedException
Inherits P4APIExceptions
[C#]
public class RunUnParsedException : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

RunUnParsedException Members | P4API.Exceptions Namespace


RunUnParsedException Members

RunUnParsedException overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Result | Gets the P4UnParsedRecordSet that would have been returned if an exception was not thrown.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

RunUnParsedException Class | P4API.Exceptions Namespace


RunUnParsedException Properties

The properties of the RunUnParsedException class are listed below. For a complete list of RunUnParsedException class members, see the RunUnParsedException Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Result | Gets the P4UnParsedRecordSet that would have been returned if an exception was not thrown.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

RunUnParsedException Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

RunUnParsedException.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

RunUnParsedException Class | P4API.Exceptions Namespace


Result Property

Perforce API for the .Net CLR

RunUnParsedException.Result Property

Gets the P4UnParsedRecordSet that would have been returned if an exception was not thrown.

[Visual Basic]
Public ReadOnly Property Result As P4UnParsedRecordSet
[C#]
public P4API.P4UnParsedRecordSet Result {get;}

See Also

RunUnParsedException Class | P4API.Exceptions Namespace


ServerAlreadyConnected Class

Exception: Changing the port when a server is connected is not allowed!

For a list of all members of this type, see ServerAlreadyConnected Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.ServerAlreadyConnected

[Visual Basic]
Public Class ServerAlreadyConnected
Inherits P4APIExceptions
[C#]
public class ServerAlreadyConnected : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

ServerAlreadyConnected Members | P4API.Exceptions Namespace


ServerAlreadyConnected Members

ServerAlreadyConnected overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ServerAlreadyConnected Class | P4API.Exceptions Namespace


ServerAlreadyConnected Properties

The properties of the ServerAlreadyConnected class are listed below. For a complete list of ServerAlreadyConnected class members, see the ServerAlreadyConnected Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

ServerAlreadyConnected Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

ServerAlreadyConnected.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

ServerAlreadyConnected Class | P4API.Exceptions Namespace


ServerNotConnected Class

Exception: Attempting to run a command while the Perforce Server is not connected!

For a list of all members of this type, see ServerNotConnected Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.ServerNotConnected

[Visual Basic]
Public Class ServerNotConnected
Inherits P4APIExceptions
[C#]
public class ServerNotConnected : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

ServerNotConnected Members | P4API.Exceptions Namespace


ServerNotConnected Members

ServerNotConnected overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ServerNotConnected Class | P4API.Exceptions Namespace


ServerNotConnected Properties

The properties of the ServerNotConnected class are listed below. For a complete list of ServerNotConnected class members, see the ServerNotConnected Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

ServerNotConnected Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

ServerNotConnected.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

ServerNotConnected Class | P4API.Exceptions Namespace


ServerNotConnected_SetVar_AfterInit Class

Exception: Attempting to set a property that can not be set after the server is connected!

For a list of all members of this type, see ServerNotConnected_SetVar_AfterInit Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.ServerNotConnected_SetVar_AfterInit

[Visual Basic]
Public Class ServerNotConnected_SetVar_AfterInit
Inherits P4APIExceptions
[C#]
public class ServerNotConnected_SetVar_AfterInit : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

ServerNotConnected_SetVar_AfterInit Members | P4API.Exceptions Namespace


ServerNotConnected_SetVar_AfterInit Members

ServerNotConnected_SetVar_AfterInit overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ServerNotConnected_SetVar_AfterInit Class | P4API.Exceptions Namespace


ServerNotConnected_SetVar_AfterInit Properties

The properties of the ServerNotConnected_SetVar_AfterInit class are listed below. For a complete list of ServerNotConnected_SetVar_AfterInit class members, see the ServerNotConnected_SetVar_AfterInit Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

ServerNotConnected_SetVar_AfterInit Class | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

ServerNotConnected_SetVar_AfterInit.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

ServerNotConnected_SetVar_AfterInit Class | P4API.Exceptions Namespace


Count Property

Perforce API for the .Net CLR

ArrayFieldDictionary.Count Property

Gets the number of elements in the dictionary

[Visual Basic]
Public ReadOnly Property Count As Integer
[C#]
public int Count {get;}

Property Value

Number of items.

See Also

ArrayFieldDictionary Class | P4API Namespace


DiffNotImplemented Class

Support for diff (without -s* flag) not yet implemented

For a list of all members of this type, see DiffNotImplemented Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.DiffNotImplemented

[Visual Basic]
Public Class DiffNotImplemented
Inherits P4APIExceptions
[C#]
public class DiffNotImplemented : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

DiffNotImplemented Members | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

DiffNotImplemented.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

DiffNotImplemented Class | P4API.Exceptions Namespace


DiffNotImplemented Members

DiffNotImplemented overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

DiffNotImplemented Class | P4API.Exceptions Namespace


DiffNotImplemented Properties

The properties of the DiffNotImplemented class are listed below. For a complete list of DiffNotImplemented class members, see the DiffNotImplemented Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

DiffNotImplemented Class | P4API.Exceptions Namespace


ErrorPauseCalled Class

ClientUser ErrorPause method was called. This in unsupported in P4.Net.

For a list of all members of this type, see ErrorPauseCalled Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.ErrorPauseCalled

[Visual Basic]
Public Class ErrorPauseCalled
Inherits P4APIExceptions
[C#]
public class ErrorPauseCalled : P4APIExceptions

Remarks

If you see this, please let the curator know the steps to reproduce. This should not be reachable code.

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

ErrorPauseCalled Members | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

ErrorPauseCalled.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

ErrorPauseCalled Class | P4API.Exceptions Namespace


ErrorPauseCalled Constructor

Initializes a new instance of the ErrorPauseCalled class.

[Visual Basic]
Public Sub New()
[C#]
public ErrorPauseCalled();

See Also

ErrorPauseCalled Class | P4API.Exceptions Namespace


ErrorPauseCalled Members

ErrorPauseCalled overview

Public Instance Constructors

ErrorPauseCalled Constructor Initializes a new instance of the ErrorPauseCalled class.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

ErrorPauseCalled Class | P4API.Exceptions Namespace


ErrorPauseCalled Properties

The properties of the ErrorPauseCalled class are listed below. For a complete list of ErrorPauseCalled class members, see the ErrorPauseCalled Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

ErrorPauseCalled Class | P4API.Exceptions Namespace


FileNotFound Class

Exception: File not found!

For a list of all members of this type, see FileNotFound Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.FileNotFound

[Visual Basic]
Public Class FileNotFound
Inherits P4APIExceptions
[C#]
public class FileNotFound : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

FileNotFound Members | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

FileNotFound.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

FileNotFound Class | P4API.Exceptions Namespace


FileNotFound Members

FileNotFound overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FileNotFound Class | P4API.Exceptions Namespace


FileNotFound Properties

The properties of the FileNotFound class are listed below. For a complete list of FileNotFound class members, see the FileNotFound Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

FileNotFound Class | P4API.Exceptions Namespace


FormParseException Class

Error parsing the form spec.

For a list of all members of this type, see FormParseException Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.FormParseException

[Visual Basic]
Public Class FormParseException
Inherits P4APIExceptions
[C#]
public class FormParseException : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

FormParseException Members | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

FormParseException.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

FormParseException Class | P4API.Exceptions Namespace


FormParseException Members

FormParseException overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

FormParseException Class | P4API.Exceptions Namespace


FormParseException Properties

The properties of the FormParseException class are listed below. For a complete list of FormParseException class members, see the FormParseException Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

FormParseException Class | P4API.Exceptions Namespace


MergeNotImplemented Class

Support for merging not yet implemented

For a list of all members of this type, see MergeNotImplemented Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.MergeNotImplemented

[Visual Basic]
Public Class MergeNotImplemented
Inherits P4APIExceptions
[C#]
public class MergeNotImplemented : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

MergeNotImplemented Members | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

MergeNotImplemented.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

MergeNotImplemented Class | P4API.Exceptions Namespace


MergeNotImplemented Members

MergeNotImplemented overview

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

MergeNotImplemented Class | P4API.Exceptions Namespace


MergeNotImplemented Properties

The properties of the MergeNotImplemented class are listed below. For a complete list of MergeNotImplemented class members, see the MergeNotImplemented Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

MergeNotImplemented Class | P4API.Exceptions Namespace


P4APIExceptions Hierarchy

System.Object
Exception
P4APIExceptions
DiffNotImplemented
ErrorPauseCalled
FileNotFound
FormCommandException
FormFetchException
FormParseException
InvalidFormArgument
InvalidLogin
MergeNotImplemented
PerforceInitializationError
RunException
RunUnParsedException
ServerAlreadyConnected
ServerNotConnected
ServerNotConnected_SetVar_AfterInit
StreamNotWriteable

See Also

P4APIExceptions Class | P4APIExceptions Members | P4API.Exceptions Namespace


StreamNotWriteable Class

Exception: Can not write to stream.

For a list of all members of this type, see StreamNotWriteable Members.

System.Object
System.Exception
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.StreamNotWriteable

[Visual Basic]
Public Class StreamNotWriteable
Inherits P4APIExceptions
[C#]
public class StreamNotWriteable : P4APIExceptions

Requirements

Namespace: P4API.Exceptions

Assembly: p4api (in p4api.dll)

See Also

StreamNotWriteable Members | P4API.Exceptions Namespace


Message Property

Perforce API for the .Net CLR

StreamNotWriteable.Message Property

Gets the error message for the exception.

[Visual Basic]
Overrides Public ReadOnly Property Message As String
[C#]
public override string Message {get;}

See Also

StreamNotWriteable Class | P4API.Exceptions Namespace


StreamNotWriteable Constructor

Initializes a new instance of the StreamNotWriteable class.

[Visual Basic]
Public Sub New()
[C#]
public StreamNotWriteable();

See Also

StreamNotWriteable Class | P4API.Exceptions Namespace


StreamNotWriteable Members

StreamNotWriteable overview

Public Instance Constructors

StreamNotWriteable Constructor Initializes a new instance of the StreamNotWriteable class.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetBaseException (inherited from Exception) | When overridden in a derived class, returns the Exception that is the root cause of one or more subsequent exceptions.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetObjectData (inherited from Exception) | When overridden in a derived class, sets the SerializationInfo with information about the exception.
GetType (inherited from Exception) | Gets the runtime type of the current instance.
ToString (inherited from Exception) | Creates and returns a string representation of the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

StreamNotWriteable Class | P4API.Exceptions Namespace


StreamNotWriteable Properties

The properties of the StreamNotWriteable class are listed below. For a complete list of StreamNotWriteable class members, see the StreamNotWriteable Members topic.

Public Instance Properties

Data (inherited from Exception) | Gets a collection of key/value pairs that provide additional user-defined information about the exception.
HelpLink (inherited from Exception) | Gets or sets a link to the help file associated with this exception.
InnerException (inherited from Exception) | Gets the Exception instance that caused the current exception.
Message | Gets the error message for the exception.
Source (inherited from Exception) | Gets or sets the name of the application or the object that causes the error.
StackTrace (inherited from Exception) | Gets a string representation of the frames on the call stack at the time the current exception was thrown.
TargetSite (inherited from Exception) | Gets the method that throws the current exception.

Protected Instance Properties

HResult (inherited from Exception) Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception.

See Also

StreamNotWriteable Class | P4API.Exceptions Namespace


P4API.ExceptionsHierarchy

Perforce API for the .Net CLR

P4API.Exceptions Hierarchy

System.Object
System.Exception ---- System.Runtime.Serialization.ISerializable
P4API.Exceptions.P4APIExceptions
P4API.Exceptions.DiffNotImplemented
P4API.Exceptions.ErrorPauseCalled
P4API.Exceptions.FileNotFound
P4API.Exceptions.FormCommandException
P4API.Exceptions.FormFetchException
P4API.Exceptions.FormParseException
P4API.Exceptions.InvalidFormArgument
P4API.Exceptions.InvalidLogin
P4API.Exceptions.MergeNotImplemented
P4API.Exceptions.PerforceInitializationError
P4API.Exceptions.RunException
P4API.Exceptions.RunUnParsedException
P4API.Exceptions.ServerAlreadyConnected
P4API.Exceptions.ServerNotConnected
P4API.Exceptions.ServerNotConnected_SetVar_AfterInit
P4API.Exceptions.StreamNotWriteable

See Also

P4API.Exceptions Namespace


Count Property

Perforce API for the .Net CLR

FieldDictionary.Count Property

Gets the number of elements in the dictionary

[Visual Basic]
Public ReadOnly Property Count As Integer
[C#]
public int Count {get;}

Property Value

Count of items.

See Also

FieldDictionary Class | P4API Namespace


MergeAction Enumeration

Actions to take when resolving a file.

[Visual Basic]
Public Enum MergeAction
[C#]
public enum MergeAction

Remarks

Members

Member Name | Description
Quit | Quit the resolve workflow.
Skip | Skip this file in the resolve workflow.
AcceptMerged | Accept the merged file from Perforce. This file must not be edited.
AcceptEdit | Accept the result file with your edits. The result file should be edited before returning this merge action.
AcceptTheirs | Accept 'their' file ('your' changes will be lost).
AcceptYours | Accept 'your' file ('thier' changes will be lost).

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4API Namespace


MergeData Class

Contains information about the files being merged.

For a list of all members of this type, see MergeData Members.

System.Object
P4API.MergeData

[Visual Basic]
Public Class MergeData
Implements IDisposable
[C#]
public class MergeData : IDisposable

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

MergeData Members | P4API Namespace


BaseFile Property

Perforce API for the .Net CLR

MergeData.BaseFile Property

Base file for the 3-way merge.

[Visual Basic]
Public ReadOnly Property BaseFile As FileInfo
[C#]
public System.IO.FileInfo BaseFile {get;}

See Also

MergeData Class | P4API Namespace


BaseName Property

Perforce API for the .Net CLR

MergeData.BaseName Property

Perforce name of the base file. Format is '//depot/path/file.ext#rev'.

[Visual Basic]
Public ReadOnly Property BaseName As String
[C#]
public string BaseName {get;}

See Also

MergeData Class | P4API Namespace


BothChunks Property

Perforce API for the .Net CLR

MergeData.BothChunks Property

Returns the number of chunks that have the same change in both files.

[Visual Basic]
Public ReadOnly Property BothChunks As Integer
[C#]
public int BothChunks {get;}

See Also

MergeData Class | P4API Namespace


ConflictChunks Property

Perforce API for the .Net CLR

MergeData.ConflictChunks Property

Returns the number of chunks that have conflicts.

[Visual Basic]
Public ReadOnly Property ConflictChunks As Integer
[C#]
public int ConflictChunks {get;}

See Also

MergeData Class | P4API Namespace


MergeData.Dispose Method

Frees unmanaged memory.

[Visual Basic]
NotOverridable Public Sub Dispose() _
Implements IDisposable.Dispose
[C#]
public void Dispose();

Implements

IDisposable.Dispose

See Also

MergeData Class | P4API Namespace


MergeDigest Property

Perforce API for the .Net CLR

MergeData.MergeDigest Property

Returns the MD5 checksum of WHAT?? file.

[Visual Basic]
Public ReadOnly Property MergeDigest As String
[C#]
public string MergeDigest {get;}

See Also

MergeData Class | P4API Namespace


MergeHint Property

Perforce API for the .Net CLR

MergeData.MergeHint Property

Perforce's recommended merge action.

[Visual Basic]
Public ReadOnly Property MergeHint As MergeAction
[C#]
public MergeAction MergeHint {get;}

See Also

MergeData Class | P4API Namespace


ResultFile Property

Perforce API for the .Net CLR

MergeData.ResultFile Property

File where merged result should be written.

[Visual Basic]
Public ReadOnly Property ResultFile As FileInfo
[C#]
public System.IO.FileInfo ResultFile {get;}

See Also

MergeData Class | P4API Namespace


MergeData.RunMergeTool Method

Runs the external merge tool configured by P4MERGE.

[Visual Basic]
Public Function RunMergeTool() As Boolean
[C#]
public bool RunMergeTool();

Return Value

True if the merge tool exits with code 0, false otherwise.

See Also

MergeData Class | P4API Namespace


TheirChunks Property

Perforce API for the .Net CLR

MergeData.TheirChunks Property

Returns the number of chunks with changes in their file.

[Visual Basic]
Public ReadOnly Property TheirChunks As Integer
[C#]
public int TheirChunks {get;}

See Also

MergeData Class | P4API Namespace


TheirDigest Property

Perforce API for the .Net CLR

MergeData.TheirDigest Property

Returns the MD5 checksum of their file.

[Visual Basic]
Public ReadOnly Property TheirDigest As String
[C#]
public string TheirDigest {get;}

See Also

MergeData Class | P4API Namespace


TheirFile Property

Perforce API for the .Net CLR

MergeData.TheirFile Property

Thier file for the 3-way merge.

[Visual Basic]
Public ReadOnly Property TheirFile As FileInfo
[C#]
public System.IO.FileInfo TheirFile {get;}

See Also

MergeData Class | P4API Namespace


TheirName Property

Perforce API for the .Net CLR

MergeData.TheirName Property

Perforce name of their file. Format is '//depot/path/file.ext#rev'.

[Visual Basic]
Public ReadOnly Property TheirName As String
[C#]
public string TheirName {get;}

See Also

MergeData Class | P4API Namespace


YourChunks Property

Perforce API for the .Net CLR

MergeData.YourChunks Property

Returns the number of chunks changed in your file.

[Visual Basic]
Public ReadOnly Property YourChunks As Integer
[C#]
public int YourChunks {get;}

See Also

MergeData Class | P4API Namespace


YourDigest Property

Perforce API for the .Net CLR

MergeData.YourDigest Property

Returns the MD5 checksum of your file.

[Visual Basic]
Public ReadOnly Property YourDigest As String
[C#]
public string YourDigest {get;}

See Also

MergeData Class | P4API Namespace


YourFile Property

Perforce API for the .Net CLR

MergeData.YourFile Property

Your file for the 3-way merge.

[Visual Basic]
Public ReadOnly Property YourFile As FileInfo
[C#]
public System.IO.FileInfo YourFile {get;}

See Also

MergeData Class | P4API Namespace


YourName Property

Perforce API for the .Net CLR

MergeData.YourName Property

Perforce name of your file. Format is '//client/path/file.ext'.

[Visual Basic]
Public ReadOnly Property YourName As String
[C#]
public string YourName {get;}

See Also

MergeData Class | P4API Namespace


MergeData Members

MergeData overview

Public Instance Properties

BaseFile | Base file for the 3-way merge.
BaseName | Perforce name of the base file. Format is '//depot/path/file.ext#rev'.
BothChunks | Returns the number of chunks that have the same change in both files.
ConflictChunks | Returns the number of chunks that have conflicts.
MergeDigest | Returns the MD5 checksum of WHAT?? file.
MergeHint | Perforce's recommended merge action.
ResultFile | File where merged result should be written.
TheirChunks | Returns the number of chunks with changes in their file.
TheirDigest | Returns the MD5 checksum of their file.
TheirFile | Thier file for the 3-way merge.
TheirName | Perforce name of their file. Format is '//depot/path/file.ext#rev'.
YourChunks | Returns the number of chunks changed in your file.
YourDigest | Returns the MD5 checksum of your file.
YourFile | Your file for the 3-way merge.
YourName | Perforce name of your file. Format is '//client/path/file.ext'.

Public Instance Methods

Dispose | Frees unmanaged memory.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
RunMergeTool | Runs the external merge tool configured by P4MERGE.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

MergeData Class | P4API Namespace


MergeData Methods

The methods of the MergeData class are listed below. For a complete list of MergeData class members, see the MergeData Members topic.

Public Instance Methods

Dispose | Frees unmanaged memory.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
RunMergeTool | Runs the external merge tool configured by P4MERGE.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

MergeData Class | P4API Namespace


MergeData Properties

The properties of the MergeData class are listed below. For a complete list of MergeData class members, see the MergeData Members topic.

Public Instance Properties

BaseFile | Base file for the 3-way merge.
BaseName | Perforce name of the base file. Format is '//depot/path/file.ext#rev'.
BothChunks | Returns the number of chunks that have the same change in both files.
ConflictChunks | Returns the number of chunks that have conflicts.
MergeDigest | Returns the MD5 checksum of WHAT?? file.
MergeHint | Perforce's recommended merge action.
ResultFile | File where merged result should be written.
TheirChunks | Returns the number of chunks with changes in their file.
TheirDigest | Returns the MD5 checksum of their file.
TheirFile | Thier file for the 3-way merge.
TheirName | Perforce name of their file. Format is '//depot/path/file.ext#rev'.
YourChunks | Returns the number of chunks changed in your file.
YourDigest | Returns the MD5 checksum of your file.
YourFile | Your file for the 3-way merge.
YourName | Perforce name of your file. Format is '//client/path/file.ext'.

See Also

MergeData Class | P4API Namespace


OnPrintEndEventHandler Delegate

Delegate to handle the OnPrintEndFile event.

[Visual Basic]
Public Delegate Sub OnPrintEndEventHandler( _
ByVal args As P4PrintStreamEventArgs, _
ByVal stream As Stream _
)
[C#]
public delegate void OnPrintEndEventHandler(
P4PrintStreamEventArgs args,
Stream stream
);

Parameters

args
Arguments describing the printed file.
stream
The stream that was written.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4API Namespace | OnPrintEndFile


OnPrintStreamEventHandler Delegate

Delegate to handle the OnPrintStream event.

[Visual Basic]
Public Delegate Sub OnPrintStreamEventHandler( _
ByVal args As P4PrintStreamEventArgs, _
ByRef outputStream As Stream _
)
[C#]
public delegate void OnPrintStreamEventHandler(
P4PrintStreamEventArgs args,
out Stream outputStream
);

Parameters

args
Arguments describing the printed file.
outputStream
The stream to write the file.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4API Namespace | OnPrintStream


P4BaseRecordSet.Dump Method

Dumps recordset data to the Trace listner.

[Visual Basic]
Public Sub Dump()
[C#]
public void Dump();

Remarks

Only availble for debug libraries.

See Also

P4BaseRecordSet Class | P4API Namespace


P4Messages Property

Perforce API for the .Net CLR

P4BaseRecordSet.P4Messages Property

Gets an array of P4Messages returned from the Perforce command.

[Visual Basic]
Public ReadOnly Property P4Messages As IList`1([P4API.P4Message, p4api, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null))
[C#]
public P4Message, p4api, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]] P4Messages {get;}

Remarks

These are the error messages that are returned from Perforce.

See Also

P4BaseRecordSet Class | P4API Namespace


P4Callback Class

For a list of all members of this type, see P4Callback Members.

System.Object
P4API.P4Callback
P4API.P4RecordsetCallback

[Visual Basic]
MustInherit Public Class P4Callback
[C#]
public abstract class P4Callback

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4Callback Members | P4API Namespace


P4Callback.Cancel Method

Allows consumers to cancel the current command.

[Visual Basic]
Overridable Public Function Cancel() As Boolean
[C#]
public virtual bool Cancel();

Return Value

Return true to kill the current command.

Remarks

The cancel method is called periodically during long-running commands. You can't always guarantee when it will be called, or how quickly it will cancel the command.

See Also

P4Callback Class | P4API Namespace


ContentEncoding Property

Perforce API for the .Net CLR

P4Callback.ContentEncoding Property

Gets the content encoding.

[Visual Basic]
Protected ReadOnly Property ContentEncoding As Encoding
[C#]
protected System.Text.Encoding ContentEncoding {get;}

Property Value

The content encoding is either UTF-8 for Unicode-enabled servers or ASCII otherwise.

See Also

P4Callback Class | P4API Namespace


P4Callback.Edit Method

Executed when a command requests an editor to launch.

[Visual Basic]
Overridable Public Sub Edit( _
ByVal f1 As FileInfo _
)
[C#]
public virtual void Edit(
FileInfo f1
);

Parameters

f1
The file on the local system to launch in the editor.

See Also

P4Callback Class | P4API Namespace


P4Callback.Finished Method

Executes when the command is finished.

[Visual Basic]
Overridable Public Sub Finished()
[C#]
public virtual void Finished();

See Also

P4Callback Class | P4API Namespace


P4Callback.InputData Method

Executed when a command expects a file buffer input.

[Visual Basic]
Overridable Public Sub InputData( _
ByVal buffer As StringBuilder _
)
[C#]
public virtual void InputData(
StringBuilder buffer
);

Parameters

buffer
A reference to a buffer. Append strings to the buffer to send file content to the server.

Remarks

InputData is called from form input commands. In general it's easier to use the P4Form class to manipulate forms than handling through the P4Callback interface.

See Also

P4Callback Class | P4API Namespace


P4Callback.OutputContent Method

Executed when a command outputs file content.

[Visual Basic]
Overridable Public Sub OutputContent( _
ByVal buffer As Byte(), _
ByVal IsText As Boolean _
)
[C#]
public virtual void OutputContent(
byte[] buffer,
bool IsText
);

Parameters

buffer
A buffer containing a chunk of data.
IsText
If set to true [is text].

Remarks

OutputContent is typically called from the 'print' command, but can also be called from 'describe', 'diff', or 'diff2'. Output content may be called several times for a single file if it is large. You must orchestrate between calls to OutputMessage and OutputContent to know which file you are working with. If the content is textual, you can use the ContentEncoding property to convert to text.

See Also

P4Callback Class | P4API Namespace


P4Callback.OutputInfo Method

Executed when a textual message is output from the underlying API.

[Visual Basic]
Overridable Public Sub OutputInfo( _
ByVal data As String _
)
[C#]
public virtual void OutputInfo(
string data
);

Parameters

data
The textual message.

Remarks

The majority of commands output messages from OutputMessage, but there are some commands that ocasionally call OutputInfo without the full data of the message string.

See Also

P4Callback Class | P4API Namespace


P4Callback.OutputMessage Method

Executed when a textual message is streamed from the server.

[Visual Basic]
MustOverride Public Sub OutputMessage( _
ByVal message As P4Message _
)
[C#]
public abstract void OutputMessage(
P4Message message
);

Parameters

message
The message.

See Also

P4Callback Class | P4API Namespace


P4Callback.OutputRecord Method

Executed when tagged output is streamed from the server.

[Visual Basic]
Overridable Public Sub OutputRecord( _
ByVal record As P4Record _
)
[C#]
public virtual void OutputRecord(
P4Record record
);

Parameters

record
The tagged output in the form of a P4Record.

See Also

P4Callback Class | P4API Namespace


P4Callback.Prompt Method

Executed when the Perforce command needs to "prompt" the user for a response.

[Visual Basic]
Overridable Public Sub Prompt( _
ByVal message As String, _
ByRef response As String _
)
[C#]
public virtual void Prompt(
string message,
ref string response
);

Parameters

message
The message output from the Perforce command.
response
The response sent back to Perforce.

See Also

P4Callback Class | P4API Namespace


P4Callback.ResolveFile Method

Executed when a 'resolve' command seeks input on how to resolve a file.

[Visual Basic]
Overridable Public Function ResolveFile( _
ByVal mergeData As MergeData _
) As MergeAction
[C#]
public virtual MergeAction ResolveFile(
MergeData mergeData
);

Parameters

mergeData
The merge data containing information on the files to resolve.

Return Value

Merge action for the file.

Remarks

mergeData is disposed after ResolveFile completes. Do not persist a reference to the mergeData object.

See Also

P4Callback Class | P4API Namespace


SpecDef Property

Perforce API for the .Net CLR

P4Callback.SpecDef Property

Gets the specdef for a form if it exists.

[Visual Basic]
Protected ReadOnly Property SpecDef As String
[C#]
protected string SpecDef {get;}

Property Value

A specdef is a specially coded character string that Perforce uses internally to define the structure of fields in a form.

See Also

P4Callback Class | P4API Namespace


P4Callback Constructor

Initializes a new instance of the P4Callback class.

[Visual Basic]
Protected Sub New()
[C#]
protected P4Callback();

See Also

P4Callback Class | P4API Namespace


P4Callback Members

P4Callback overview

Public Instance Methods

Cancel | Allows consumers to cancel the current command.
Edit | Executed when a command requests an editor to launch.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Finished | Executes when the command is finished.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
InputData | Executed when a command expects a file buffer input.
OutputContent | Executed when a command outputs file content.
OutputInfo | Executed when a textual message is output from the underlying API.
OutputMessage | Executed when a textual message is streamed from the server.
OutputRecord | Executed when tagged output is streamed from the server.
Prompt | Executed when the Perforce command needs to "prompt" the user for a response.
ResolveFile | Executed when a 'resolve' command seeks input on how to resolve a file.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Constructors

P4Callback Constructor Initializes a new instance of the P4Callback class.

Protected Instance Properties

ContentEncoding | Gets the content encoding.
SpecDef | Gets the specdef for a form if it exists.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Callback Class | P4API Namespace


P4Callback Methods

The methods of the P4Callback class are listed below. For a complete list of P4Callback class members, see the P4Callback Members topic.

Public Instance Methods

Cancel | Allows consumers to cancel the current command.
Edit | Executed when a command requests an editor to launch.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Finished | Executes when the command is finished.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
InputData | Executed when a command expects a file buffer input.
OutputContent | Executed when a command outputs file content.
OutputInfo | Executed when a textual message is output from the underlying API.
OutputMessage | Executed when a textual message is streamed from the server.
OutputRecord | Executed when tagged output is streamed from the server.
Prompt | Executed when the Perforce command needs to "prompt" the user for a response.
ResolveFile | Executed when a 'resolve' command seeks input on how to resolve a file.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Callback Class | P4API Namespace


P4Callback Properties

The properties of the P4Callback class are listed below. For a complete list of P4Callback class members, see the P4Callback Members topic.

Protected Instance Properties

ContentEncoding | Gets the content encoding.
SpecDef | Gets the specdef for a form if it exists.

See Also

P4Callback Class | P4API Namespace


Api Property

Perforce API for the .Net CLR

P4Connection.Api Property

Sets the client API protocol level.

[Visual Basic]
Public Property Api As Integer
[C#]
public int Api {get; set;}

Property Value

The Perforce API level.

Remarks

Sets the API compatibility level desired. This is useful when writing scripts using Perforce commands that do not yet support tagged output. In these cases, upgrading to a later server that supports tagged output for the commands in question can break your script. Using this method allows you to lock your script to the output format of an older Perforce release and facilitate seamless upgrades. Note that this method must be called prior to calling Connect.
See the http://kb.perforce.com/P4dServerReference/ProtocolLevels/PerforceClientLevels for the API integer levels that correspond to each Perforce release.

See Also

P4Connection Class | P4API Namespace


P4Connection.IsServerCaseSensitive Method

Checks the case-sensitivity of the Perforce server.

[Visual Basic]
Public Function IsServerCaseSensitive() As Boolean
[C#]
public bool IsServerCaseSensitive();

Return Value

True when the connected server is case-sensitive.

Remarks

This must be called after connecting to the server.

See Also

P4Connection Class | P4API Namespace


Language Property

Perforce API for the .Net CLR

P4Connection.Language Property

Sets the Language for message translations.

[Visual Basic]
Public Property Language As String
[C#]
public string Language {get; set;}

Property Value

Overrided the ticket file location.

Remarks

Use this to override the default location of the TicketFile.

See Also

P4Connection Class | P4API Namespace


MaxLockTime Property

Perforce API for the .Net CLR

P4Connection.MaxLockTime Property

Gets/Sets a value that overrides the defined MaxLockTime.

[Visual Basic]
Public Property MaxLockTime As Integer
[C#]
public int MaxLockTime {get; set;}

Property Value

Overrides the MaxLockTime defined at the server.

Remarks

Servers may set a limit for MaxLockTime for certain users. Set this value to override. A value of 0 indicates no override.

See Also

P4Connection Class | P4API Namespace


MaxResults Property

Perforce API for the .Net CLR

P4Connection.MaxResults Property

Gets/Sets a value that overrides the defined MaxResults.

[Visual Basic]
Public Property MaxResults As Integer
[C#]
public int MaxResults {get; set;}

Property Value

Overrides the MaxResults defined at the server.

Remarks

Servers may set a limit for MaxResults for certain users. Set this value to override. A value of 0 indicates no override.

See Also

P4Connection Class | P4API Namespace


MaxScanRows Property

Perforce API for the .Net CLR

P4Connection.MaxScanRows Property

Gets/Sets a value that overrides the defined MaxScanRows.

[Visual Basic]
Public Property MaxScanRows As Integer
[C#]
public int MaxScanRows {get; set;}

Property Value

Overrides the MaxScanRows defined at the server.

Remarks

Servers may set a limit for MaxScanRows for certain users. Set this value to override. A value of 0 indicates no override.

See Also

P4Connection Class | P4API Namespace


P4Connection.OnPrintEndFile Event

Raised from P4PrintStreamEvents after a file is printed.

[Visual Basic]
Public Event OnPrintEndFile As OnPrintEndEventHandler
[C#]
public event OnPrintEndEventHandler OnPrintEndFile;

Event Data

The event handler receives an argument of type P4PrintStreamEventArgs containing data related to this event. The following P4PrintStreamEventArgs properties provide information specific to this event.

Property | Description
Action | Submit action for the file being printed.
Change | The Perforce changelist number for the file being printed.
DepotFile | The Perforce depot path to the file being printed.
FileTime | The timestamp of the file being printed.
FileType | The Perforce file type of the file being printed.
TextEncoding | Encoding to be used for files with a Perforce type of 'text'.
UnicodeEncoding | Encoding to be used for files with a Perforce type of 'unicode'.

Remarks

Use this event to close any streams that were created by the OnPrintStreamEventHandler event.

See Also

P4Connection Class | P4API Namespace


P4Connection.OnPrintStream Event

Raised from P4PrintStreamEvents before a file is printed.

[Visual Basic]
Public Event OnPrintStream As OnPrintStreamEventHandler
[C#]
public event OnPrintStreamEventHandler OnPrintStream;

Event Data

The event handler receives an argument of type P4PrintStreamEventArgs containing data related to this event. The following P4PrintStreamEventArgs properties provide information specific to this event.

Property | Description
Action | Submit action for the file being printed.
Change | The Perforce changelist number for the file being printed.
DepotFile | The Perforce depot path to the file being printed.
FileTime | The timestamp of the file being printed.
FileType | The Perforce file type of the file being printed.
TextEncoding | Encoding to be used for files with a Perforce type of 'text'.
UnicodeEncoding | Encoding to be used for files with a Perforce type of 'unicode'.

Remarks

Handle this event to initialize a stream that P4API will write to.

See Also

P4Connection Class | P4API Namespace


P4Connection.Parse_Form Method

Parse the raw text of a Perforce form into a P4Form object

[Visual Basic]
Public Function Parse_Form( _
ByVal formCommand As String, _
ByVal formContents As String _
) As P4Form
[C#]
public P4Form Parse_Form(
string formCommand,
string formContents
);

Parameters

formCommand
The form command.
formContents
Raw contents of the form spec.

Return Value

A P4Form object. The fields of the form can be read or updated. If you update a filed, you can save it with Save_Form.

Remarks

Forms are the things that pop-up in an editor when run from a command line. In P4.Net (and most other Perforce APIs), you do not need to parse/format the text manually. Instead, you can get/set the fields using the Fields and ArrayFields collections.

The following is a list of common form commands:

  • client
  • branch
  • label
  • job
  • user
  • group
  • protect
  • triggers
  • branch
    •

    When fetching or saving a form, do not use the '-o' and '-i' flags. P4.Net will automatically include them.

    See Also

    P4Connection Class | P4API Namespace


P4Connection.PrintBinary Method

Print the contents of a file in Perforce to a byte array.

[Visual Basic]
Public Function PrintBinary( _
ByVal depotPath As String _
) As Byte()
[C#]
public byte[] PrintBinary(
string depotPath
);

Parameters

depotPath
Perforce path to the file.

Return Value

Contents of the file. Text files will be encoded with ANSI encodinge. Unicode files will be encoded as UTF-8 (regardless of P4CHARSET setting).

See Also

P4Connection Class | P4API Namespace


P4Connection.PrintStream Method (Stream, String, Encoding)

Prints the contents of a Perforce file to a Stream.

[Visual Basic]
Overloads Public Sub PrintStream( _
ByVal stream As Stream, _
ByVal depotPath As String, _
ByVal encoding As Encoding _
)
[C#]
public void PrintStream(
Stream stream,
string depotPath,
Encoding encoding
);

Parameters

stream
Writable stream to write the contents to.
depotPath
Perforce path of the file to print.
encoding
Text encoding of the Stream.

Remarks

If a file is does not exist, a FileNotFound exception will be thrown (regardless of the ExceptionLevel setting).
Depot Path, Client Path or Local Path can generally be used for the argument depotPath (so long as the argument is valid for the

p4 print
command line.
Encoding will only be applied to files with a Perforce type of 'text' or 'unicode'.
The stream argument can be any valid stream, so long as it is initialized and writable.

See Also

P4Connection Class | P4API Namespace | P4Connection.PrintStream Overload List


P4Connection.PrintStream Method (Stream, String)

Prints the contents of a Perforce file to a Stream.

[Visual Basic]
Overloads Public Sub PrintStream( _
ByVal stream As Stream, _
ByVal depotPath As String _
)
[C#]
public void PrintStream(
Stream stream,
string depotPath
);

Parameters

stream
Writable stream to write the contents to.
depotPath
Perforce path of the file to print.

Remarks

If a file is does not exist, a FileNotFound exception will be thrown (regardless of the ExceptionLevel setting).
Depot Path, Client Path or Local Path can generally be used for the argument depotPath (so long as the argument is valid for the

p4 print
command line.
The stream argument can be any valid stream, so long as it is initialized and writable.

See Also

P4Connection Class | P4API Namespace | P4Connection.PrintStream Overload List


PrintStream Method

Perforce API for the .Net CLR

P4Connection.PrintStream Method

Prints the contents of a Perforce file to a Stream.

Overload List

Prints the contents of a Perforce file to a Stream.

public void PrintStream(Stream,string);

Prints the contents of a Perforce file to a Stream.

public void PrintStream(Stream,string,Encoding);

See Also

P4Connection Class | P4API Namespace


P4Connection.PrintStreamEvents Method

Runs a print command, and raises events for each file printed.

[Visual Basic]
Public Sub PrintStreamEvents( _
ParamArray args As String() _
)
[C#]
public void PrintStreamEvents(
params string[] args
);

Parameters

args
Arguments to the
p4 print
command.

Remarks

This method is useful when you need to print several files with a single call to the Perforce server.

Events

Event Type | Reason
 | OnPrintStream
 | OnPrintEndFile

Example

See Also

P4Connection Class | P4API Namespace


P4Connection.PrintText Method

Print the contents of a file in Perforce to a string.

[Visual Basic]
Public Function PrintText( _
ByVal depotPath As String _
) As String
[C#]
public string PrintText(
string depotPath
);

Parameters

depotPath
Perforce path to the file.

Return Value

Contents of the file.

Remarks

Attempting to call PrintText on a binary file will likely cause corruption.
If a file is does not exist, a FileNotFound exception will be thrown (regardless of the ExceptionLevel setting).
Depot Path, Client Path or Local Path can generally be used for the argument depotPath (so long as the argument is valid for the

p4 print
command line.

See Also

P4Connection Class | P4API Namespace


P4Connection.RunCallback Method

Runs the specified command, calling the appropriate callback methods as Perforce returns information.

[Visual Basic]
Public Sub RunCallback( _
ByVal Callback As P4Callback, _
ByVal Command As String, _
ParamArray Args As String() _
)
[C#]
public void RunCallback(
P4Callback Callback,
string Command,
params string[] Args
);

Parameters

Callback
A callback instance to recieve information as the command is run.
Command
The Perforce command to run.
Args
Arguments to the Perforce command

See Also

P4Connection Class | P4API Namespace


P4Connection.RunCallbackUnparsed Method

Runs the callback unparsed.

[Visual Basic]
Public Sub RunCallbackUnparsed( _
ByVal Callback As P4Callback, _
ByVal Command As String, _
ParamArray Args As String() _
)
[C#]
public void RunCallbackUnparsed(
P4Callback Callback,
string Command,
params string[] Args
);

Parameters

Callback
The callback.
Command
The command.
Args
The args.

See Also

P4Connection Class | P4API Namespace


P4Connection.Save_Form Method (String, String, Boolean)

Saves the form to Perforce.

[Visual Basic]
Overloads Public Function Save_Form( _
ByVal formCommand As String, _
ByVal formSpec As String, _
ByVal Force As Boolean _
) As P4UnParsedRecordSet
[C#]
public P4UnParsedRecordSet Save_Form(
string formCommand,
string formSpec,
bool Force
);

Parameters

formCommand
The form command to run.
formSpec
The formatted spec.
Force
True to pass the '-f' flag when saving.

Return Value

P4UnParsedRecordSet. Output can be parsed to verify the form was processed correctly.

See Also

P4Connection Class | P4API Namespace | P4Connection.Save_Form Overload List


P4Connection.Save_Form Method (P4Form, Boolean)

Saves the form to Perforce.

[Visual Basic]
Overloads Public Function Save_Form( _
ByVal Form As P4Form, _
ByVal Force As Boolean _
) As P4UnParsedRecordSet
[C#]
public P4UnParsedRecordSet Save_Form(
P4Form Form,
bool Force
);

Parameters

Form
The P4Form object retrieved from Fetch_Form.
Force
True to pass the '-f' flag when saving.

Return Value

P4UnParsedRecordSet. Output can be parsed to verify the form was processed correctly.

Remarks

Forms are the things that pop-up in an editor when run from a command line. In P4.Net (and most other Perforce APIs), you do not need to parse/format the text manually. Instead, you can get/set the fields using the Fields and ArrayFields collections.

The following is a list of common form commands:

  • client
  • branch
  • label
  • job
  • user
  • group
  • protect
  • triggers
  • branch
    •

    When fetching or saving a form, do not use the '-o' and '-i' flags. P4.Net will automatically include them.

    See Also

    P4Connection Class | P4API Namespace | P4Connection.Save_Form Overload List


P4Connection.Save_Form Method (P4Form, String[])

Saves the form to Perforce.

[Visual Basic]
Overloads Public Function Save_Form( _
ByVal Form As P4Form, _
ParamArray args As String() _
) As P4UnParsedRecordSet
[C#]
public P4UnParsedRecordSet Save_Form(
P4Form Form,
params string[] args
);

Parameters

Form
The P4Form object retrieved from Fetch_Form.
args
Arguments passed to the form command.

Return Value

P4UnParsedRecordSet. Output can be parsed to verify the form was processed correctly.

Remarks

Forms are the things that pop-up in an editor when run from a command line. In P4.Net (and most other Perforce APIs), you do not need to parse/format the text manually. Instead, you can get/set the fields using the Fields and ArrayFields collections.

The following is a list of common form commands:

  • client
  • branch
  • label
  • job
  • user
  • group
  • protect
  • triggers
  • branch
    •

    When fetching or saving a form, do not use the '-o' and '-i' flags. P4.Net will automatically include them.

    See Also

    P4Connection Class | P4API Namespace | P4Connection.Save_Form Overload List


ServerLevel Property

Perforce API for the .Net CLR

P4Connection.ServerLevel Property

Checks the server level (version) of the Perforce server.

[Visual Basic]
Public ReadOnly Property ServerLevel As Integer
[C#]
public int ServerLevel {get;}

Property Value

The server's version level.

Remarks

See http://kb.perforce.com/P4dServerReference/ProtocolLevels/PerforceServerLevels for more informantion.

See Also

P4Connection Class | P4API Namespace


P4Form.Clone Method

Copies the P4Form object into a new instance.

[Visual Basic]
Public Function Clone() As P4Form
[C#]
public P4Form Clone();

Return Value

A copy of the P4Form object.

See Also

P4Form Class | P4API Namespace


P4Form.FormatSpec Method

Formats the P4Form as a formated Perforce spec.

[Visual Basic]
Public Function FormatSpec() As String
[C#]
public string FormatSpec();

Return Value

String of the formated form spec.

See Also

P4Form Class | P4API Namespace


P4Form.LoadFromSpec Method

Parses a Perforce form without making a server connection.

[Visual Basic]
Public Shared Function LoadFromSpec( _
ByVal formCommand As String, _
ByVal specDef As String, _
ByVal formContents As String, _
ByVal encoding As Encoding _
) As P4Form
[C#]
public static P4Form LoadFromSpec(
string formCommand,
string specDef,
string formContents,
Encoding encoding
);

Parameters

formCommand
The command that would otherwise be used to fetch the form.
specDef
The Perforce 'specdef' for the form.
formContents
The raw formated form text.
encoding
Server encoding (either ANSI or UFT-8).

Return Value

A Perforce form object.

Remarks

LoadFromSpec can be used to parse a form without making a call to the server. LoadFromSpec can be useful in form triggers. It does require you to know the SpecDef to call, which can change when upgrading or changing the server configuration.

See Also

P4Form Class | P4API Namespace


PermittedFields Property

Perforce API for the .Net CLR

P4Form.PermittedFields Property

Gets a StringCollection containing the names of all the allowable fields in the form.

[Visual Basic]
Public ReadOnly Property PermittedFields As StringCollection
[C#]
public System.Collections.Specialized.StringCollection PermittedFields {get;}

Property Value

StringCollection containing the names of all the allowable fields in the form.

Remarks

The fields returned by PermittedFields are not necessarily included in Fields.Keys or ArrayFields.Keys. Perforce forms usually do not have keys for empty values.

See Also

P4Form Class | P4API Namespace


SpecDef Property

Perforce API for the .Net CLR

P4Form.SpecDef Property

The underlying C++ API 'specdef' defining the form.

[Visual Basic]
Public ReadOnly Property SpecDef As String
[C#]
public string SpecDef {get;}

Property Value

The C++ 'specdef' that defines the format of the spec.

Remarks

The SpecDef is a formatted string that Perforce uses internally to parse forms. SpecDefs will vary by form, server version, and even with specific server configurations. In general, you should avoid using a SpecDef directly; however, in some cases you can avoid a server call by using the SpecDef.

See Also

P4Form Class | P4API Namespace


P4Form Methods

The methods of the P4Form class are listed below. For a complete list of P4Form class members, see the P4Form Members topic.

Public Static (Shared) Methods

LoadFromSpec Parses a Perforce form without making a server connection.

Public Instance Methods

Clone | Copies the P4Form object into a new instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
FormatSpec | Formats the P4Form as a formated Perforce spec.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Form Class | P4API Namespace


P4Integration Class

P4Integration objects hold details about the integrations that have been performed on a particular revision. Used primarily with the P4Revision class

For a list of all members of this type, see P4Integration Members.

System.Object
P4API.P4Integration

[Visual Basic]
Public Class P4Integration
[C#]
public class P4Integration

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4Integration Members | P4API Namespace


EndRev Property

Perforce API for the .Net CLR

P4Integration.EndRev Property

Returns the end revision number used for this integration.

[Visual Basic]
Public ReadOnly Property EndRev As Integer
[C#]
public int EndRev {get;}

See Also

P4Integration Class | P4API Namespace


File Property

Perforce API for the .Net CLR

P4Integration.File Property

Returns the path to the file being integrated to/from.

[Visual Basic]
Public ReadOnly Property File As String
[C#]
public string File {get;}

See Also

P4Integration Class | P4API Namespace


How Property

Perforce API for the .Net CLR

P4Integration.How Property

Returns the type of the integration record - how that record was created.

[Visual Basic]
Public ReadOnly Property How As String
[C#]
public string How {get;}

See Also

P4Integration Class | P4API Namespace


StartRev Property

Perforce API for the .Net CLR

P4Integration.StartRev Property

Returns the start revision number used for this integration.

[Visual Basic]
Public ReadOnly Property StartRev As Integer
[C#]
public int StartRev {get;}

See Also

P4Integration Class | P4API Namespace


P4Integration.ToString Method

Representation of the integration record.

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

Return Value

String representing the integration record.

See Also

P4Integration Class | P4API Namespace


P4Integration Members

P4Integration overview

Public Instance Properties

EndRev | Returns the end revision number used for this integration.
File | Returns the path to the file being integrated to/from.
How | Returns the type of the integration record - how that record was created.
StartRev | Returns the start revision number used for this integration.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Representation of the integration record.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Integration Class | P4API Namespace


P4Integration Methods

The methods of the P4Integration class are listed below. For a complete list of P4Integration class members, see the P4Integration Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Representation of the integration record.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Integration Class | P4API Namespace


P4Integration Properties

The properties of the P4Integration class are listed below. For a complete list of P4Integration class members, see the P4Integration Members topic.

Public Instance Properties

EndRev | Returns the end revision number used for this integration.
File | Returns the path to the file being integrated to/from.
How | Returns the type of the integration record - how that record was created.
StartRev | Returns the start revision number used for this integration.

See Also

P4Integration Class | P4API Namespace


P4Map Class

Represents a Perforce Map object.

For a list of all members of this type, see P4Map Members.

System.Object
P4API.P4Map

[Visual Basic]
Public Class P4Map
Implements IDisposable
[C#]
public class P4Map : IDisposable

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4Map Members | P4API Namespace


P4Map.Clear Method

Clears all view lines from the map.

[Visual Basic]
Public Sub Clear()
[C#]
public void Clear();

See Also

P4Map Class | P4API Namespace


Count Property

Perforce API for the .Net CLR

P4Map.Count Property

Returns the number of view lines in the map.

[Visual Basic]
Public ReadOnly Property Count As Integer
[C#]
public int Count {get;}

See Also

P4Map Class | P4API Namespace


P4Map.Dispose Method

Cleans up unmanaged resources.

[Visual Basic]
NotOverridable Public Sub Dispose() _
Implements IDisposable.Dispose
[C#]
public void Dispose();

Implements

IDisposable.Dispose

See Also

P4Map Class | P4API Namespace


P4Map.Finalize Method

Calls dispose method if not already disposed.

[Visual Basic]
Overrides Protected Sub Finalize()
[C#]
protected override void Finalize();

See Also

P4Map Class | P4API Namespace


P4Map.Includes Method

Determines if the path is contained in the view.

[Visual Basic]
Public Function Includes( _
ByVal path As String _
) As Boolean
[C#]
public bool Includes(
string path
);

Parameters

path
Path to check.

Return Value

True when the view includes the path.

See Also

P4Map Class | P4API Namespace


P4Map.IncludesAll Method

Determines if the view contains all of the specified paths.

[Visual Basic]
Public Function IncludesAll( _
ParamArray paths As String() _
) As Boolean
[C#]
public bool IncludesAll(
params string[] paths
);

Parameters

paths
Paths to check.

Return Value

True if all of the paths are contained in the view.

See Also

P4Map Class | P4API Namespace


P4Map.IncludesAny Method

Determines if the view contains any of the specified paths.

[Visual Basic]
Public Function IncludesAny( _
ParamArray paths As String() _
) As Boolean
[C#]
public bool IncludesAny(
params string[] paths
);

Parameters

paths
Paths to check.

Return Value

True if any of the paths are contained in the view.

See Also

P4Map Class | P4API Namespace


P4Map.Insert Method

Inserts a new view line at the end of the map.

[Visual Basic]
Public Sub Insert( _
ParamArray lines As String() _
)
[C#]
public void Insert(
params string[] lines
);

Parameters

lines
Missing <param> documentation for lines

See Also

P4Map Class | P4API Namespace


P4Map.Insert2 Method (String, String)

Inserts a new view line at the end of the map.

[Visual Basic]
Overloads Public Sub Insert2( _
ByVal left As String, _
ByVal right As String _
)
[C#]
public void Insert2(
string left,
string right
);

Parameters

left
Left-hand path of the view line.
right
Right-hand path of the view line.

See Also

P4Map Class | P4API Namespace | P4Map.Insert2 Overload List


P4Map.Insert2 Method (0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]])

Missing <summary> documentation for M:P4API.P4Map.Insert2(System.Collections.Generic.IList`1[[System.String,0: mscorlib,0: Version=2.0.0.0,0: Culture=neutral,0: PublicKeyToken=b77a5c561934e089]],System.Collections.Generic.IList`1[[System.String,0: mscorlib,0: Version=2.0.0.0,0: Culture=neutral,0: PublicKeyToken=b77a5c561934e089]])

[Visual Basic]
Overloads Public Sub Insert2( _
ByVal left As IList`1([System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)), _
ByVal right As IList`1([System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)) _
)
[C#]
public void Insert2(
0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] left,
0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] right
);

Parameters

left
Missing <param> documentation for left
right
Missing <param> documentation for right

See Also

P4Map Class | P4API Namespace | P4Map.Insert2 Overload List


Insert2 Method

Perforce API for the .Net CLR

P4Map.Insert2 Method

Missing <summary> documentation for M:P4API.P4Map.Insert2(System.Collections.Generic.IList`1[[System.String,0: mscorlib,0: Version=2.0.0.0,0: Culture=neutral,0: PublicKeyToken=b77a5c561934e089]],System.Collections.Generic.IList`1[[System.String,0: mscorlib,0: Version=2.0.0.0,0: Culture=neutral,0: PublicKeyToken=b77a5c561934e089]])

Overload List

Missing <summary> documentation for M:P4API.P4Map.Insert2(System.Collections.Generic.IList`1[[System.String,0: mscorlib,0: Version=2.0.0.0,0: Culture=neutral,0: PublicKeyToken=b77a5c561934e089]],System.Collections.Generic.IList`1[[System.String,0: mscorlib,0: Version=2.0.0.0,0: Culture=neutral,0: PublicKeyToken=b77a5c561934e089]])

public void Insert2(0, Culture=neutral, PublicKeyToken=b77a5c561934e089]],0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]);

Inserts a new view line at the end of the map.

public void Insert2(string,string);

See Also

P4Map Class | P4API Namespace


P4Map.IsEmpty Method

Returns true if the map has no lines.

[Visual Basic]
Public Function IsEmpty() As Boolean
[C#]
public bool IsEmpty();

Return Value

True if there are no view lines.

See Also

P4Map Class | P4API Namespace


P4Map.Join Method

Joins two map objects to form the intersection of the two views.

[Visual Basic]
Public Shared Function Join( _
ByVal left As P4Map, _
ByVal right As P4Map _
) As P4Map
[C#]
public static P4Map Join(
P4Map left,
P4Map right
);

Parameters

left
Left-hand map.
right
Right-hand map.

Return Value

P4Map object of the intersection of the two maps.

See Also

P4Map Class | P4API Namespace


P4Map.Lhs Method

Gets the left-hand side of the view lines.

[Visual Basic]
Public Function Lhs() As IList`1([System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))
[C#]
public 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] Lhs();

Return Value

List containing the left-hand side of the view.

See Also

P4Map Class | P4API Namespace


P4Map.Reverse Method

Reverses the view lines.

[Visual Basic]
Public Function Reverse() As P4Map
[C#]
public P4Map Reverse();

Return Value

A P4Map object containing the reversed view.

See Also

P4Map Class | P4API Namespace


P4Map.Rhs Method

Gets the right-hand side of the view lines.

[Visual Basic]
Public Function Rhs() As IList`1([System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))
[C#]
public 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] Rhs();

Return Value

List containing the right-hand side of the view.

See Also

P4Map Class | P4API Namespace


P4Map.ToArray Method

Gets a list of the view lines.

[Visual Basic]
Public Function ToArray() As IList`1([System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))
[C#]
public 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] ToArray();

Return Value

List fo strings containing each view line.

See Also

P4Map Class | P4API Namespace


P4Map.ToString Method

Returns string representation of the view.

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

Return Value

String representing the view.

See Also

P4Map Class | P4API Namespace


P4Map.Translate Method (String[])

Translates a list of paths through the view.

[Visual Basic]
Overloads Public Function Translate( _
ParamArray paths As String() _
) As IList`1([System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))
[C#]
public 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] Translate(
params string[] paths
);

Parameters

paths
Paths to be translated.

Return Value

Translated paths.

See Also

P4Map Class | P4API Namespace | P4Map.Translate Overload List


P4Map.Translate Method (String)

Translates a path through the view.

[Visual Basic]
Overloads Public Function Translate( _
ByVal path As String _
) As String
[C#]
public string Translate(
string path
);

Parameters

path
Path to be translated.

Return Value

Translated path.

See Also

P4Map Class | P4API Namespace | P4Map.Translate Overload List


Translate Method

Perforce API for the .Net CLR

P4Map.Translate Method

Translates a path through the view.

Overload List

Translates a path through the view.

public string Translate(string);

Translates a list of paths through the view.

public 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] Translate(params string[]);

See Also

P4Map Class | P4API Namespace


P4Map.TranslateReverse Method (String[])

Translates a list of paths through the reverse view (left-to-right).

[Visual Basic]
Overloads Public Function TranslateReverse( _
ParamArray paths As String() _
) As IList`1([System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089))
[C#]
public 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] TranslateReverse(
params string[] paths
);

Parameters

paths
Paths to be translated.

Return Value

Translated paths.

See Also

P4Map Class | P4API Namespace | P4Map.TranslateReverse Overload List


P4Map.TranslateReverse Method (String)

Translates a path through the reverse view (left-to-right).

[Visual Basic]
Overloads Public Function TranslateReverse( _
ByVal path As String _
) As String
[C#]
public string TranslateReverse(
string path
);

Parameters

path
Path to be translated.

Return Value

Translated path.

See Also

P4Map Class | P4API Namespace | P4Map.TranslateReverse Overload List


TranslateReverse Method

Perforce API for the .Net CLR

P4Map.TranslateReverse Method

Translates a path through the reverse view (left-to-right).

Overload List

Translates a path through the reverse view (left-to-right).

public string TranslateReverse(string);

Translates a list of paths through the reverse view (left-to-right).

public 0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] TranslateReverse(params string[]);

See Also

P4Map Class | P4API Namespace


P4Map Constructor

Creates an empty Map.

Overload List

Creates an empty Map.

public P4Map();

Creates a P4Map object populated with the view defined by lines.

public P4Map(params string[]);

See Also

P4Map Class | P4API Namespace


P4Map Constructor ()

Creates an empty Map.

[Visual Basic]
Overloads Public Sub New()
[C#]
public P4Map();

See Also

P4Map Class | P4API Namespace | P4Map Constructor Overload List


P4Map Constructor (String[])

Creates a P4Map object populated with the view defined by lines.

[Visual Basic]
Overloads Public Sub New( _
ParamArray lines As String() _
)
[C#]
public P4Map(
params string[] lines
);

Parameters

lines
Lines in the Map view.

See Also

P4Map Class | P4API Namespace | P4Map Constructor Overload List


P4Map Members

P4Map overview

Public Static (Shared) Methods

Join Joins two map objects to form the intersection of the two views.

Public Instance Constructors

P4Map Overloaded. Initializes a new instance of the P4Map class.

Public Instance Properties

Count Returns the number of view lines in the map.

Public Instance Methods

Clear | Clears all view lines from the map.
Dispose | Cleans up unmanaged resources.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
Includes | Determines if the path is contained in the view.
IncludesAll | Determines if the view contains all of the specified paths.
IncludesAny | Determines if the view contains any of the specified paths.
Insert | Inserts a new view line at the end of the map.
Insert2 | Overloaded. Inserts a new view line at the end of the map.
IsEmpty | Returns true if the map has no lines.
Lhs | Gets the left-hand side of the view lines.
Reverse | Reverses the view lines.
Rhs | Gets the right-hand side of the view lines.
ToArray | Gets a list of the view lines.
ToString | Returns string representation of the view.
Translate | Overloaded. Translates a list of paths through the view.
TranslateReverse | Overloaded. Translates a list of paths through the reverse view (left-to-right).

Protected Instance Methods

Finalize | Calls dispose method if not already disposed.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Map Class | P4API Namespace


P4Map Methods

The methods of the P4Map class are listed below. For a complete list of P4Map class members, see the P4Map Members topic.

Public Static (Shared) Methods

Join Joins two map objects to form the intersection of the two views.

Public Instance Methods

Clear | Clears all view lines from the map.
Dispose | Cleans up unmanaged resources.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
Includes | Determines if the path is contained in the view.
IncludesAll | Determines if the view contains all of the specified paths.
IncludesAny | Determines if the view contains any of the specified paths.
Insert | Inserts a new view line at the end of the map.
Insert2 | Overloaded. Inserts a new view line at the end of the map.
IsEmpty | Returns true if the map has no lines.
Lhs | Gets the left-hand side of the view lines.
Reverse | Reverses the view lines.
Rhs | Gets the right-hand side of the view lines.
ToArray | Gets a list of the view lines.
ToString | Returns string representation of the view.
Translate | Overloaded. Translates a list of paths through the view.
TranslateReverse | Overloaded. Translates a list of paths through the reverse view (left-to-right).

Protected Instance Methods

Finalize | Calls dispose method if not already disposed.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Map Class | P4API Namespace


P4Map Properties

The properties of the P4Map class are listed below. For a complete list of P4Map class members, see the P4Map Members topic.

Public Instance Properties

Count Returns the number of view lines in the map.

See Also

P4Map Class | P4API Namespace


P4Message Class

For a list of all members of this type, see P4Message Members.

System.Object
P4API.P4Message

[Visual Basic]
Public Class P4Message
[C#]
public class P4Message

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4Message Members | P4API Namespace


P4Message.Dump Method

Dumps this instance.

[Visual Basic]
Public Sub Dump()
[C#]
public void Dump();

See Also

P4Message Class | P4API Namespace


P4Message.Format Method

Formats this instance.

[Visual Basic]
Public Function Format() As String
[C#]
public string Format();

Return Value

Missing <returns> documentation for M:P4API.P4Message.Format

See Also

P4Message Class | P4API Namespace


P4Message.GetValue Method

Gets the value.

[Visual Basic]
Public Function GetValue( _
ByVal var As String _
) As String
[C#]
public string GetValue(
string var
);

Parameters

var
The var.

Return Value

Missing <returns> documentation for M:P4API.P4Message.GetValue(System.String)

See Also

P4Message Class | P4API Namespace


Identity Property

Perforce API for the .Net CLR

P4Message.Identity Property

Gets the identity.

[Visual Basic]
Public ReadOnly Property Identity As Integer
[C#]
public int Identity {get;}

Property Value

The identity.

See Also

P4Message Class | P4API Namespace


Severity Property

Perforce API for the .Net CLR

P4Message.Severity Property

Gets the severity.

[Visual Basic]
Public ReadOnly Property Severity As P4MessageSeverity
[C#]
public P4MessageSeverity Severity {get;}

Property Value

The severity.

See Also

P4Message Class | P4API Namespace


P4Message.ToString Method

Returns a String that represents the current Object.

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

Return Value

A String that represents the current Object.

See Also

P4Message Class | P4API Namespace


Variables Property

Perforce API for the .Net CLR

P4Message.Variables Property

Gets the variables.

[Visual Basic]
Public ReadOnly Property Variables As String()
[C#]
public string[] Variables {get;}

Property Value

The variables.

See Also

P4Message Class | P4API Namespace


P4Message Members

P4Message overview

Public Instance Properties

Identity | Gets the identity.
Severity | Gets the severity.
Variables | Gets the variables.

Public Instance Methods

Dump | Dumps this instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Format | Formats this instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
GetValue | Gets the value.
ToString | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Message Class | P4API Namespace


P4Message Methods

The methods of the P4Message class are listed below. For a complete list of P4Message class members, see the P4Message Members topic.

Public Instance Methods

Dump | Dumps this instance.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Format | Formats this instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
GetValue | Gets the value.
ToString | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Message Class | P4API Namespace


P4Message Properties

The properties of the P4Message class are listed below. For a complete list of P4Message class members, see the P4Message Members topic.

Public Instance Properties

Identity | Gets the identity.
Severity | Gets the severity.
Variables | Gets the variables.

See Also

P4Message Class | P4API Namespace


P4MessageSeverity Enumeration

Perforce Message Severity

[Visual Basic]
Public Enum P4MessageSeverity
[C#]
public enum P4MessageSeverity

Members

Member Name | Description
Empty | No Error
Info | Informational Message
Warning | Warning Message
Failed | Error Message
Fatal | Fatal Message

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4API Namespace


P4PrintStreamEventArgs Class

EventArgs class to supply file details.

For a list of all members of this type, see P4PrintStreamEventArgs Members.

System.Object
System.EventArgs
P4API.P4PrintStreamEventArgs

[Visual Basic]
Public Class P4PrintStreamEventArgs
Inherits EventArgs
[C#]
public class P4PrintStreamEventArgs : EventArgs

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4PrintStreamEventArgs Members | P4API Namespace


Action Property

Perforce API for the .Net CLR

P4PrintStreamEventArgs.Action Property

Submit action for the file being printed.

[Visual Basic]
Public ReadOnly Property Action As String
[C#]
public string Action {get;}

Property Value

The last submit action for the file being printed.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


Change Property

Perforce API for the .Net CLR

P4PrintStreamEventArgs.Change Property

The Perforce changelist number for the file being printed.

[Visual Basic]
Public ReadOnly Property Change As Integer
[C#]
public int Change {get;}

Property Value

The Perforce changelist number for the file being printed.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


DepotFile Property

Perforce API for the .Net CLR

P4PrintStreamEventArgs.DepotFile Property

The Perforce depot path to the file being printed.

[Visual Basic]
Public ReadOnly Property DepotFile As String
[C#]
public string DepotFile {get;}

Property Value

The depot path to the file.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


FileTime Property

Perforce API for the .Net CLR

P4PrintStreamEventArgs.FileTime Property

The timestamp of the file being printed.

[Visual Basic]
Public ReadOnly Property FileTime As Date
[C#]
public System.DateTime FileTime {get;}

Property Value

The timestamp of the file being printed.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


FileType Property

Perforce API for the .Net CLR

P4PrintStreamEventArgs.FileType Property

The Perforce file type of the file being printed.

[Visual Basic]
Public ReadOnly Property FileType As String
[C#]
public string FileType {get;}

Property Value

The Perforce filetype of the file being printed.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


TextEncoding Property

Perforce API for the .Net CLR

P4PrintStreamEventArgs.TextEncoding Property

Encoding to be used for files with a Perforce type of 'text'.

[Visual Basic]
Public Property TextEncoding As Encoding
[C#]
public System.Text.Encoding TextEncoding {get; set;}

Property Value

The encoding for Text Files being printed.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


UnicodeEncoding Property

Perforce API for the .Net CLR

P4PrintStreamEventArgs.UnicodeEncoding Property

Encoding to be used for files with a Perforce type of 'unicode'.

[Visual Basic]
Public Property UnicodeEncoding As Encoding
[C#]
public System.Text.Encoding UnicodeEncoding {get; set;}

Property Value

The encoding form unicode files being printed.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


P4PrintStreamEventArgs Members

P4PrintStreamEventArgs overview

Public Instance Properties

Action | Submit action for the file being printed.
Change | The Perforce changelist number for the file being printed.
DepotFile | The Perforce depot path to the file being printed.
FileTime | The timestamp of the file being printed.
FileType | The Perforce file type of the file being printed.
TextEncoding | Encoding to be used for files with a Perforce type of 'text'.
UnicodeEncoding | Encoding to be used for files with a Perforce type of 'unicode'.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


P4PrintStreamEventArgs Properties

The properties of the P4PrintStreamEventArgs class are listed below. For a complete list of P4PrintStreamEventArgs class members, see the P4PrintStreamEventArgs Members topic.

Public Instance Properties

Action | Submit action for the file being printed.
Change | The Perforce changelist number for the file being printed.
DepotFile | The Perforce depot path to the file being printed.
FileTime | The timestamp of the file being printed.
FileType | The Perforce file type of the file being printed.
TextEncoding | Encoding to be used for files with a Perforce type of 'text'.
UnicodeEncoding | Encoding to be used for files with a Perforce type of 'unicode'.

See Also

P4PrintStreamEventArgs Class | P4API Namespace


P4RecordsetCallback Class

A P4Callback class that populates a P4Recordset.

For a list of all members of this type, see P4RecordsetCallback Members.

System.Object
P4API.P4Callback
P4API.P4RecordsetCallback

[Visual Basic]
Public Class P4RecordsetCallback
Inherits P4Callback
[C#]
public class P4RecordsetCallback : P4Callback

Remarks

Subclassing P4RecordsetCallback can be usefull when changing code that used the P4Connection.Run method. By subclassing P4RecordsetCallback, you can intercept calls to provide status updates, but still have access to the populated recordset when the command completes. Be sure to call the base methods in overriden methods to ensure the recordset is correctly poulated.

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4RecordsetCallback Members | P4API Namespace


P4RecordsetCallback.Cancel Method

Cancels this instance.

[Visual Basic]
Overrides Public Function Cancel() As Boolean
[C#]
public override bool Cancel();

Return Value

Missing <returns> documentation for M:P4API.P4RecordsetCallback.Cancel

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.Edit Method

Edits the specified f1.

[Visual Basic]
Overrides Public Sub Edit( _
ByVal f1 As FileInfo _
)
[C#]
public override void Edit(
FileInfo f1
);

Parameters

f1
The f1.

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.Finished Method

Finisheds this instance.

[Visual Basic]
Overrides Public Sub Finished()
[C#]
public override void Finished();

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.InputData Method

Inputs the data.

[Visual Basic]
Overrides Public Sub InputData( _
ByVal buffer As StringBuilder _
)
[C#]
public override void InputData(
StringBuilder buffer
);

Parameters

buffer
The buffer.

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.OutputContent Method

Outputs the content.

[Visual Basic]
Overrides Public Sub OutputContent( _
ByVal buffer As Byte(), _
ByVal IsText As Boolean _
)
[C#]
public override void OutputContent(
byte[] buffer,
bool IsText
);

Parameters

buffer
The buffer.
IsText
if set to true [is text].

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.OutputInfo Method

Outputs the info.

[Visual Basic]
Overrides Public Sub OutputInfo( _
ByVal data As String _
)
[C#]
public override void OutputInfo(
string data
);

Parameters

data
The data.

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.OutputMessage Method

Outputs the message.

[Visual Basic]
Overrides Public Sub OutputMessage( _
ByVal message As P4Message _
)
[C#]
public override void OutputMessage(
P4Message message
);

Parameters

message
The message.

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.OutputRecord Method

Outputs the record.

[Visual Basic]
Overrides Public Sub OutputRecord( _
ByVal record As P4Record _
)
[C#]
public override void OutputRecord(
P4Record record
);

Parameters

record
The record.

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.Prompt Method

Prompts the specified MSG.

[Visual Basic]
Overrides Public Sub Prompt( _
ByVal msg As String, _
ByRef rsp As String _
)
[C#]
public override void Prompt(
string msg,
ref string rsp
);

Parameters

msg
The MSG.
rsp
The RSP.

See Also

P4RecordsetCallback Class | P4API Namespace


Recordset Property

Perforce API for the .Net CLR

P4RecordsetCallback.Recordset Property

Gets the recordset.

[Visual Basic]
Public ReadOnly Property Recordset As P4RecordSet
[C#]
public P4RecordSet Recordset {get;}

Property Value

The recordset.

Remarks

The recordset that has been populated when the command completes.

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback.ResolveFile Method

Resolves the file.

[Visual Basic]
Overrides Public Function ResolveFile( _
ByVal mergeData As MergeData _
) As MergeAction
[C#]
public override MergeAction ResolveFile(
MergeData mergeData
);

Parameters

mergeData
The merge data.

Return Value

Missing <returns> documentation for M:P4API.P4RecordsetCallback.ResolveFile(P4API.MergeData)

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback Constructor

Initializes a new instance of the P4RecordsetCallback class.

[Visual Basic]
Overloads Public Sub New()
[C#]
public P4RecordsetCallback();

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback Members

P4RecordsetCallback overview

Public Instance Constructors

P4RecordsetCallback Constructor Initializes a new instance of the P4RecordsetCallback class.

Public Instance Properties

Recordset Gets the recordset.

Public Instance Methods

Cancel | Cancels this instance.
Edit | Edits the specified f1.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Finished | Finisheds this instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
InputData | Inputs the data.
OutputContent | Outputs the content.
OutputInfo | Outputs the info.
OutputMessage | Outputs the message.
OutputRecord | Outputs the record.
Prompt | Prompts the specified MSG.
ResolveFile | Resolves the file.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Properties

ContentEncoding (inherited from P4Callback) | Gets the content encoding.
SpecDef (inherited from P4Callback) | Gets the specdef for a form if it exists.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback Methods

The methods of the P4RecordsetCallback class are listed below. For a complete list of P4RecordsetCallback class members, see the P4RecordsetCallback Members topic.

Public Instance Methods

Cancel | Cancels this instance.
Edit | Edits the specified f1.
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Finished | Finisheds this instance.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
InputData | Inputs the data.
OutputContent | Outputs the content.
OutputInfo | Outputs the info.
OutputMessage | Outputs the message.
OutputRecord | Outputs the record.
Prompt | Prompts the specified MSG.
ResolveFile | Resolves the file.
ToString (inherited from Object) | Returns a String that represents the current Object.

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4RecordsetCallback Class | P4API Namespace


P4RecordsetCallback Properties

The properties of the P4RecordsetCallback class are listed below. For a complete list of P4RecordsetCallback class members, see the P4RecordsetCallback Members topic.

Public Instance Properties

Recordset Gets the recordset.

Protected Instance Properties

ContentEncoding (inherited from P4Callback) | Gets the content encoding.
SpecDef (inherited from P4Callback) | Gets the specdef for a form if it exists.

See Also

P4RecordsetCallback Class | P4API Namespace


P4Revision Class

Each P4Revision object holds details about a particular revision of a file. It may also contain the history of any integrations to/from the file

For a list of all members of this type, see P4Revision Members.

System.Object
P4API.P4Revision

[Visual Basic]
Public Class P4Revision
[C#]
public class P4Revision

Requirements

Namespace: P4API

Assembly: p4api (in p4api.dll)

See Also

P4Revision Members | P4API Namespace


Action Property

Perforce API for the .Net CLR

P4Revision.Action Property

Returns the name of the action which gave rise to this revision of the file.

[Visual Basic]
Public ReadOnly Property Action As String
[C#]
public string Action {get;}

See Also

P4Revision Class | P4API Namespace


Change Property

Perforce API for the .Net CLR

P4Revision.Change Property

Returns the change number that gave rise to this revision of the file.

[Visual Basic]
Public ReadOnly Property Change As Integer
[C#]
public int Change {get;}

See Also

P4Revision Class | P4API Namespace


Client Property

Perforce API for the .Net CLR

P4Revision.Client Property

Returns the name of the client from which this revision was submitted.

[Visual Basic]
Public ReadOnly Property Client As String
[C#]
public string Client {get;}

See Also

P4Revision Class | P4API Namespace


DepotFile Property

Perforce API for the .Net CLR

P4Revision.DepotFile Property

Returns the name of the depot file to which this object refers.

[Visual Basic]
Public ReadOnly Property DepotFile As String
[C#]
public string DepotFile {get;}

See Also

P4Revision Class | P4API Namespace


Description Property

Perforce API for the .Net CLR

P4Revision.Description Property

Returns the description of the change which created this revision.

[Visual Basic]
Public ReadOnly Property Description As String
[C#]
public string Description {get;}

Remarks

Note that only the first 31 characters are returned unless you use p4 filelog -L for the first 250 characters, or p4 filelog -l for the full text.

See Also

P4Revision Class | P4API Namespace


Digest Property

Perforce API for the .Net CLR

P4Revision.Digest Property

Returns the MD5 checksum of this revision.

[Visual Basic]
Public ReadOnly Property Digest As String
[C#]
public string Digest {get;}

See Also

P4Revision Class | P4API Namespace


FileSize Property

Perforce API for the .Net CLR

P4Revision.FileSize Property

Returns this revision's size in bytes.

[Visual Basic]
Public ReadOnly Property FileSize As Integer
[C#]
public int FileSize {get;}

See Also

P4Revision Class | P4API Namespace


FileType Property

Perforce API for the .Net CLR

P4Revision.FileType Property

Returns this revision's Perforce filetype.

[Visual Basic]
Public ReadOnly Property FileType As String
[C#]
public string FileType {get;}

See Also

P4Revision Class | P4API Namespace


Integrations Property

Perforce API for the .Net CLR

P4Revision.Integrations Property

Returns the list of P4Integration objects for this revision.

[Visual Basic]
Public ReadOnly Property Integrations As IList`1([P4API.P4Integration, p4api, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null))
[C#]
public P4Integration, p4api, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]] Integrations {get;}

See Also

P4Revision Class | P4API Namespace


Rev Property

Perforce API for the .Net CLR

P4Revision.Rev Property

Returns the number of this revision of the file.

[Visual Basic]
Public ReadOnly Property Rev As Integer
[C#]
public int Rev {get;}

See Also

P4Revision Class | P4API Namespace


Time Property

Perforce API for the .Net CLR

P4Revision.Time Property

Returns the date/time that this revision was created.

[Visual Basic]
Public ReadOnly Property Time As Date
[C#]
public System.DateTime Time {get;}

See Also

P4Revision Class | P4API Namespace


P4Revision.ToString Method

Representation of the P4Revision

[Visual Basic]
Overrides Public Function ToString() As String
[C#]
public override string ToString();

Return Value

String representation of the revision record.

See Also

P4Revision Class | P4API Namespace


User Property

Perforce API for the .Net CLR

P4Revision.User Property

Returns the name of the user who created this revision.

[Visual Basic]
Public ReadOnly Property User As String
[C#]
public string User {get;}

See Also

P4Revision Class | P4API Namespace


P4Revision Members

P4Revision overview

Public Instance Properties

Action | Returns the name of the action which gave rise to this revision of the file.
Change | Returns the change number that gave rise to this revision of the file.
Client | Returns the name of the client from which this revision was submitted.
DepotFile | Returns the name of the depot file to which this object refers.
Description | Returns the description of the change which created this revision.
Digest | Returns the MD5 checksum of this revision.
FileSize | Returns this revision's size in bytes.
FileType | Returns this revision's Perforce filetype.
Integrations | Returns the list of P4Integration objects for this revision.
Rev | Returns the number of this revision of the file.
Time | Returns the date/time that this revision was created.
User | Returns the name of the user who created this revision.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Representation of the P4Revision

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Revision Class | P4API Namespace


P4Revision Methods

The methods of the P4Revision class are listed below. For a complete list of P4Revision class members, see the P4Revision Members topic.

Public Instance Methods

Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type.
GetType (inherited from Object) | Gets the Type of the current instance.
ToString | Representation of the P4Revision

Protected Instance Methods

Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.

See Also

P4Revision Class | P4API Namespace


P4Revision Properties

The properties of the P4Revision class are listed below. For a complete list of P4Revision class members, see the P4Revision Members topic.

Public Instance Properties

Action | Returns the name of the action which gave rise to this revision of the file.
Change | Returns the change number that gave rise to this revision of the file.
Client | Returns the name of the client from which this revision was submitted.
DepotFile | Returns the name of the depot file to which this object refers.
Description | Returns the description of the change which created this revision.
Digest | Returns the MD5 checksum of this revision.
FileSize | Returns this revision's size in bytes.
FileType | Returns this revision's Perforce filetype.
Integrations | Returns the list of P4Integration objects for this revision.
Rev | Returns the number of this revision of the file.
Time | Returns the date/time that this revision was created.
User | Returns the name of the user who created this revision.

See Also

P4Revision Class | P4API Namespace


P4APIHierarchy

Perforce API for the .Net CLR

P4API Hierarchy

System.Object
P4API.ArrayFieldDictionary
P4API.FieldDictionary
P4API.MergeData ---- System.IDisposable
P4API.P4BaseRecordSet
P4API.P4RecordSet ---- System.Collections.IEnumerable
P4API.P4UnParsedRecordSet ---- System.Collections.IEnumerable
P4API.P4Callback
P4API.P4RecordsetCallback
P4API.P4Connection ---- System.IDisposable
P4API.P4Integration
P4API.P4Map ---- System.IDisposable
P4API.P4Message
P4API.P4PendingChangelist
P4API.P4Record
P4API.P4Form
P4API.P4Revision
System.Delegate ---- System.ICloneable, System.Runtime.Serialization.ISerializable
System.MulticastDelegate
P4API.OnPrintEndEventHandler
P4API.OnPrintStreamEventHandler
P4API.OnPromptEventHandler
System.EventArgs
P4API.P4PrintStreamEventArgs
P4API.P4PromptEventArgs
System.ValueType
System.Enum ---- System.IComparable, System.IConvertible, System.IFormattable
P4API.MergeAction
P4API.P4ExceptionLevels
P4API.P4MessageSeverity

See Also

P4API Namespace