protected override void ProcessRecord()
{
if (Overwrite.IsPresent && !string.IsNullOrEmpty(NewName))
WriteWarning("Since you specified Overwrite, the new name supplied will be igored.");
string rawJson = File.ReadAllText(InputFile);
MemoryStream ms = new MemoryStream(UnicodeEncoding.Unicode.GetBytes(rawJson));
ser = new DataContractJsonSerializer(typeof(Experiment));
Experiment exp = (Experiment)ser.ReadObject(ms);
if (Overwrite)
Sdk.SaveExperiment(GetWorkspaceSetting(), exp, rawJson);
else
Sdk.SaveExperimentAs(GetWorkspaceSetting(), exp, rawJson, string.IsNullOrEmpty(NewName) ? exp.Description : NewName);
WriteObject(string.Format("File \"{0}\" imported as an Experiment graph.", InputFile));
}
}