Save() public method

Saves using the specified writer.
public Save ( IKeySetWriter writer ) : bool
writer IKeySetWriter The writer.
return bool
Exemplo n.º 1
0
        public override int Run(string[] remainingArguments)
        {
            using (var keySet = new MutableKeySet(_location))
            {
                var status = keySet.Demote(_version);
                if (status == null)
                {
                    Console.WriteLine("{0} {1}", Localized.MsgUnknownVersion, _version);
                    return -1;
                }
                try
                {
                    if (keySet.Save(new KeySetWriter(_location, overwrite: true)))
                    {
                        Console.WriteLine(Localized.MsgDemotedVersion, _version, status);
                        return 0;
                    }
                }
                catch
                {
                }
            }

            Console.WriteLine("{0} {1}", Localized.MsgCouldNotWrite, _location);
            return -1;
        }
Exemplo n.º 2
0
 public override int Run(string[] remainingArguments)
 {
     using (var keySet = new MutableKeySet(_location))
     {
         var status = keySet.Revoke(_version);
         if (!status)
         {
             Console.WriteLine("{0} {1}.", Localized.MsgCouldNotRevoke, _version);
             return -1;
         }
         try
         {
             if (keySet.Save(new KeySetWriter(_location, overwrite: true)))
             {
                 Console.WriteLine("{0} {1}.", Localized.MsgRevokedVersion, _version);
                 return 0;
             }
         }
         catch
         {
         }
         Console.WriteLine("{0} {1}.", Localized.MsgCouldNotWrite, _location);
         return -1;
     }
 }