// Constructor for autofac public UbiquitiStatsProvider(IOptions <UbiquitiPollerConfiguration> config) { config.Value.EnsureValidConfig(); _responseFilterOids = config.Value.Oids.ToDictionary(x => x.Oid, x => x.PhysicalProperty); _rootOip = config.Value.RootOid; _snmpService = new SnmpAdapter(config.Value.SnmpAgentIp, config.Value.SnmpCommunity); }
// Constructor for unit testing purposes public UbiquitiStatsProvider(ISnmpService snmp, Dictionary <string, PhysicalProperty> responseFilter) { _snmpService = snmp; _responseFilterOids = responseFilter; }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel() { Log.Info("Client: Main View Model initializing..."); _oidTreeViewModel = new OidTreeViewModel(); IfDeviceAvaliableCommand = new RelayCommand(CheckDevice, CanCheckDevice); PerformActionCommand = new RelayCommand(PerformActionAsync, CanPerformAction); CopyToClipboardCommand = new RelayCommand(CopyToClipboard, CanCopy); _snmpService = new SnmpServiceService(Log); ////if (IsInDesignMode) ////{ //// // Code runs in Blend --> create design time data. ////} ////else ////{ //// // Code runs "for real" ////} }
public SnmpSonarService(ISnmpService snmpService) { _snmpService = snmpService; }