using System;
using System.Collections.Generic;
using System.Text;
namespace P4API
{
public class P4PendingChangelist
{
internal P4Form baseForm;
internal P4PendingChangelist(string Description, P4Connection p4)
{
baseForm = p4.Fetch_Form("change");
// clear the Jobs list
string [] NullList = {};
baseForm.ArrayFields["Jobs"] = NullList;
// clear the Files list
baseForm.ArrayFields["Files"] = NullList;
// save the description
baseForm.Fields["Description"] = Description;
P4UnParsedRecordSet r = p4.Save_Form(baseForm);
if (!r.HasErrors())
{
// convert to int to verify we're parsing correctly
int changeNumber = int.Parse(r.Messages[0].Split(' ')[1]);
baseForm.Fields["Change"] = changeNumber.ToString();
}
}
///
/// Gets the pending changelist's number.
///
/// The number.
public int Number
{
get
{
return int.Parse(baseForm.Fields["Change"]);
}
}
///
/// Gets the pending changelist's description.
///
/// The description.
public string Description
{
get
{
return baseForm.Fields["Description"];
}
}
}
}