Exemplo n.º 1
0
 public bool Add(Item item)
 {
     Console.WriteLine("Add " + item.HDDPath);
     Console.WriteLine("As " + item.FullName);
     TVariant arg = new TVariant();
     FileSystem.ExecCmdVar(
         String.Format("{0} {1};{2}", "add", item.HDDPath, item.Directory),
         ref arg);
     GetLastError(arg);
     return arg.AsBool();
 }
Exemplo n.º 2
0
 public bool Extract(Item item, string newFileName)
 {
     Console.WriteLine("Extract " + item.FullName);
     Console.WriteLine("To " + newFileName);
     TVariant arg = new TVariant();
     FileSystem.ExecCmdVar(
         String.Format("{0} {1};{2}", "extract", item.FullName, newFileName),
         ref arg);
     GetLastError(arg);
     return arg.AsBool();
 }
Exemplo n.º 3
0
 private void GetLastError(TVariant arg)
 {
     if (arg.AsBool()) {
         LastError = "";
         return;
     }
     LastError = MarshalUtils.MarshalString((pnt, length) => {
         FileSystem.ExecCmdStr("last_error", pnt, out length);
         return length;
     });
     Console.WriteLine(LastError);
 }
Exemplo n.º 4
0
 public bool Save(string fileName)
 {
     if (Path.HasExtension(fileName))
         fileName = Path.ChangeExtension(fileName, ".dcp");
     else
         fileName += ".dcp";
     Console.WriteLine("Save as " + fileName);
     TVariant arg = new TVariant();
     FileSystem.ExecCmdVar(
         String.Format("{0} {1}", "save", fileName),
         ref arg);
     GetLastError(arg);
     return arg.AsBool();
 }
Exemplo n.º 5
0
 public bool Remove(Item item)
 {
     Console.WriteLine("Remove " + item.FullName);
     TVariant arg = new TVariant();
     FileSystem.ExecCmdVar(
         String.Format("{0} {1}", "remove", item.FullName),
         ref arg);
     GetLastError(arg);
     return arg.AsBool();
 }
Exemplo n.º 6
0
 public bool Open(string fileName)
 {
     Console.WriteLine("Open " + fileName);
     TVariant arg = new TVariant();
     FileSystem.ExecCmdVar(
         String.Format("{0} {1}", "open", fileName),
         ref arg);
     GetLastError(arg);
     return arg.AsBool();
 }