public override string execute(Blackfin bf, string[] args)
            {
                try
                {
                    int       slot = int.Parse(args[0]);
                    IPAddress ip   = IPAddress.Parse(args[1]);
                    switch (slot)
                    {
                    case 1:
                        bf.SetDNS1(ip); // Resets the IP board, always returns false for an IP connection
                        throw new ConnectionResetException("Set DNS 1");

                    case 2:
                        bf.SetDNS2(ip); // Resets the IP board, always returns false for an IP connection
                        throw new ConnectionResetException("Set DNS 2");

                    case 3:
                        bf.SetDNS3(ip); // Resets the IP board, always returns false for an IP connection
                        throw new ConnectionResetException("Set DNS 3");
                    }
                }
                catch (OverflowException)
                {}
                catch (FormatException)
                {}

                throw new CommandArgumentException("Invalid DNS slot value");
            }
 public override string execute(Blackfin bf, string[] args)
 {
     try
     {
         short index = short.Parse(args[0]);
         bool  dst   = bool.Parse(args[1]);
         if (index >= IrisysTimeZone.TimeZones.Count())
         {
             throw new CommandArgumentException("Timezone index out of bounds");
         }
         IrisysTimeZone tz = new IrisysTimeZone(IrisysTimeZone.TimeZones.ElementAt(index));
         if (tz.SupportsDST)
         {
             tz.ApplyDST = dst;
         }
         if (!bf.SetUnitTimeZone(tz))
         {
             return(null);
         }
         return("Set Timezone to " + tz.TimeZoneID);
     }
     catch (FormatException)
     {
         throw new CommandArgumentException("Timezone index incorrect");
     }
 }
            public override string execute(Blackfin bf, string[] args)
            {
                try
                {
                    switch (int.Parse(args[0]))
                    {
                    case 1:
                        return(bf.GetDNS1().ToString());

                    case 2:
                        return(bf.GetDNS2().ToString());

                    case 3:
                        return(bf.GetDNS3().ToString());
                    }
                }
                catch (FormatException)
                {
                }
                catch (OverflowException)
                {
                }

                throw new CommandArgumentException("Invalid DNS slot value");
            }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetNetworkChecksum())
     {
         return(null);
     }
     return("Network Checksum: " + bf.NetworkChecksum);
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetGateway())
     {
         return(null);
     }
     return(bf.Gateway.ToString());
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetIPAddress())
     {
         return(null);
     }
     return(bf.IPAddress.ToString());
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetSiteID())
     {
         return(null);
     }
     return(bf.SiteID);
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetClientConfigTimeout())
     {
         return(null);
     }
     return(bf.ClientConfigTimeout + "");
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetClientConfigIP())
     {
         return(null);
     }
     return(bf.ClientConfigIP.ToString());
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetDeviceName())
     {
         return(null);
     }
     return(bf.DeviceName);
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.SetUserString(args[0]))
     {
         return(null);
     }
     return("The user string has been set");
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.SetSiteID(args[0]))
     {
         return(null);
     }
     return("Set site id");
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.SetDeviceName(args[0]))
     {
         return(null);
     }
     return("Set device name");
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetUpTime())
     {
         return(null);
     }
     return("The device has been running for " + bf.UpTime + " seconds");
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetUnitTime())
     {
         return(null);
     }
     return(bf.UnitTime.ToString());
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetSerialNumber())
     {
         return(null);
     }
     return(SerialNumberConverter.ConvertSerialNumber(bf.SerialNumber));
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetClientConfigEnable())
     {
         return(null);
     }
     return("Client connection mode is " + ((bf.ClientConfigEnable) ? "enabled" : "disabled"));
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetDHCPEnabled())
     {
         return(null);
     }
     return(bf.DHCPEnabled + "");
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetClientConfigHostname())
     {
         return(null);
     }
     return(bf.ClientConfigHostname);
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetMonitorFirmwareVersion())
     {
         return(null);
     }
     return(bf.MonitorFirmwareVersion);
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetCountLogPeriod())
     {
         return(null);
     }
     return(bf.CountLogPeriod.ToString());
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetMACAddress())
     {
         return(null);
     }
     return(bf.MACAddress);
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetCurrentCount())
     {
         return(null);
     }
     return(PrintCounts(bf.Counts.First()));
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetSubnetMask())
     {
         return(null);
     }
     return(bf.SubnetMask.ToString());
 }
 /// <summary>
 /// Ask the user to confirm they want to continue, then call abstract execute function
 /// </summary>
 /// <param name="bf"></param>
 /// <param name="args"></param>
 /// <returns></returns>
 public override String execute(Blackfin bf, String[] args)
 {
     if (args[0].ToLower().Equals("y"))
     {
         execute(bf);
     }
     return("user cancelled (" + args[0] + ")");
 }
 public override string execute(Blackfin bf)
 {
     if (!bf.ResetDeviceStatus())
     {
         return(null);
     }
     return("Reset device status");
 }
 public override string execute(Blackfin bf)
 {
     if (!bf.ResetCountLogs())
     {
         return(null);
     }
     return("Reset count logs");
 }
 public override string execute(Blackfin bf, string[] args)
 {
     if (!bf.GetLocaleString())
     {
         return(null);
     }
     return(bf.LocaleString);
 }
 public override string execute(Blackfin bf)
 {
     if (!bf.ResetCurrentCount())
     {
         return(null);
     }
     return("Reset current counts");
 }
            public override string execute(Blackfin bf, string[] args)
            {
                if (!bf.GetUnitTimeZone())
                {
                    return(null);
                }
                IrisysTimeZone tz = bf.UnitTimeZone;

                return(tz.DisplayName);
            }