public void AddObject(CheckPointObject cpObject) { if (cpObject != null && !string.IsNullOrEmpty(cpObject.Name) && !HasObject(cpObject.Name)) { _repository.Add(cpObject.Name, new ObjectInfo(cpObject, false)); } }
public static string GenerateObjectScript(CheckPointObject cpObject) { string scriptInstruction = cpObject.ToCLIScriptInstruction(); var sb = new StringBuilder(); if (!string.IsNullOrEmpty(scriptInstruction)) { sb.Append(GenerateInstructionScript(scriptInstruction)).Append(Environment.NewLine); } sb.Append("cmd='mgmt_cli ").Append(cpObject.ToCLIScript()).Append(" ignore-warnings true -s id.txt --user-agent mgmt_cli_smartmove'") .Append(Environment.NewLine) .Append("run_command"); return(sb.ToString()); }
public ObjectInfo(CheckPointObject cpObject, bool isPredefined) { Object = cpObject; IsPredefined = isPredefined; }