Exemplo n.º 1
0
 public void NotifyGetAttrib(object sender, AfterGetAttribEventArgs eventArgs)
 {
     if (eventArgs.ReturnValue == ErrorCode.Success)
     {
         WriteInfo(sender, String.Format(">> Error: {0}", eventArgs.ReturnValue));
         WriteInfo(sender, String.Format(">> byte[]: [{0}]", eventArgs.Buffer.ToHexa()));
         WriteInfo(sender, String.Format(">> string: \"{0}\"", eventArgs.Buffer.ToAsciiString()));
     }
     else
     {
         WriteWarning(sender, String.Format(Header + ">> Error: {0}", LogLevel.Warning, eventArgs.ReturnValue));
     }
 }
Exemplo n.º 2
0
        public void NotifyGetAttrib(object sender, AfterGetAttribEventArgs eventArgs)
        {
            Gui.InvokeOnUiThread(() =>
            {
                if (eventArgs.ReturnValue == ErrorCode.Success)
                {
                    Gui.SetLogForeColor(Colors.LogDefaultColor);
                    WriteLogLine(LogLevel.Info, sender, $"<=  byte[]: [{eventArgs.Buffer.ToHexa()}]");
                }
                else
                {
                    Gui.SetLogForeColor(Colors.LogErrorColor);
                    WriteLogLine(LogLevel.Error, sender, String.Format(Header + "<=  {0}", eventArgs.ReturnValue));
                }

                Gui.UpdateLastError(eventArgs.ReturnValue);
            });
        }
Exemplo n.º 3
0
 public void NotifyGetAttrib(object sender, AfterGetAttribEventArgs eventArgs)
 {
     if (eventArgs.ReturnValue == ErrorCode.Success)
     {
         WriteInfo(sender, String.Format(">> Error: {0}", eventArgs.ReturnValue));
         WriteInfo(sender, String.Format(">> byte[]: [{0}]", eventArgs.Buffer.ToHexa()));
         if (eventArgs.Attrib == Attrib.AtrString)
         {
             var atr = new Atr(eventArgs.Buffer);
             WriteInfo(sender, String.Format(">> ATR: [{0}]", atr));
         }
         else if (eventArgs.Attrib != Attrib.AtrString)
         {
             WriteInfo(sender, String.Format(">> string: \"{0}\"", eventArgs.Buffer.ToAsciiString()));
         }
     }
     else
     {
         WriteWarning(sender, String.Format(">> Error: {0}", eventArgs.ReturnValue));
     }
 }