Exemplo n.º 1
0
 internal string AddDirectory(string elementPath, string directoryName, string location, string root, bool isKey) {
     var element = FindElementWithUniqueId(elementPath);
     if (element == null || string.IsNullOrWhiteSpace(directoryName)) {
         return null;
     }
     if (element.Name == Iso19770_2.Elements.Payload || element.Name == Iso19770_2.Elements.Evidence || element.Name == Iso19770_2.Elements.Directory) {
         var file = new ResourceCollection(element).AddDirectory(directoryName);
         if (!string.IsNullOrWhiteSpace(location)) {
             file.Location = location;
         }
         if (!string.IsNullOrWhiteSpace(root)) {
             file.Root = root;
         }
         if (isKey) {
             file.IsKey = true;
         }
         return file.ElementUniqueId;
     }
     return null;
 }
Exemplo n.º 2
0
 internal string AddProcess(string elementPath, string processName, int pid) {
     var element = FindElementWithUniqueId(elementPath);
     if (element == null || string.IsNullOrWhiteSpace(processName)) {
         return null;
     }
     if (element.Name == Iso19770_2.Elements.Payload || element.Name == Iso19770_2.Elements.Evidence) {
         var process = new ResourceCollection(element).AddProcess(processName);
         if (pid != 0) {
             process.Pid = pid;
         }
         return process.ElementUniqueId;
     }
     return null;
 }