/// <summary> /// Gets the device information. /// </summary> /// <returns></returns> /// <remarks> /// Sequence Diagram:<br/> /// <img src="SequenceDiagrams/SD_PrintReleaseDevice.Browser.LogOn.GetDeviceInformation.jpg"/> /// </remarks> private DEVICE_INFO_TYPE GetDeviceInformation() { DEVICE_INFO_TYPE deviceInfo = null; try { CreateWS(); string generic = "1.0.0.23"; CONFIGURATION_TYPE configurationType = null; deviceSettingType = new DEVICE_SETTING_TYPE(); SCREEN_INFO_TYPE[] screenInfoType = null; deviceInfo = _ws.GetDeviceSettings(ref generic, out deviceSettingType, out configurationType, out screenInfoType); string deviceAutoClear = System.Configuration.ConfigurationSettings.AppSettings["DeviceAutoClear"]; if (deviceAutoClear.ToLower() == "off") { PROPERTY_TYPE[] acSetting = new PROPERTY_TYPE[1]; acSetting[0] = new PROPERTY_TYPE(); acSetting[0].sysname = "enableAutoClear"; acSetting[0].Value = "false"; //or "false" // IF value is set to false, Device auto logout will be removed. string OSASESSIONID = Request.Params["UISessionID"].ToString(); _ws.SetDeviceContext(OSASESSIONID, acSetting, ref OsaDirectManager.Core.g_WSDLGeneric); } } catch (Exception) { } return(deviceInfo); }
/// <summary> /// Determines whether [is post script enabled] [the specified device ip]. /// </summary> /// <param name="deviceIp">The device ip.</param> /// <returns> /// <c>true</c> if [is post script enabled] [the specified device ip]; otherwise, <c>false</c>. /// </returns> public static bool IsPostScriptEnabled(string deviceIp) { bool isPostScriptEnabled = false; string generic = "1.0.0.21"; MFPCoreWS ws = new MFPCoreWS(); ws.Url = OsaDirectManager.Core.GetMFPURL(deviceIp); SECURITY_SOAPHEADER_TYPE sec = new SECURITY_SOAPHEADER_TYPE(); sec.licensekey = OsaDirectManager.Core.OSA_LICENSE_KEY; ws.Security = sec; DEVICE_INFO_TYPE devinfo = new DEVICE_INFO_TYPE(); DEVICE_SETTING_TYPE devset = new DEVICE_SETTING_TYPE(); CONFIGURATION_TYPE config = new CONFIGURATION_TYPE(); SCREEN_INFO_TYPE[] screeninfo; devinfo = ws.GetDeviceSettings(ref generic, out devset, out config, out screeninfo); if (devset != null) { foreach (PROPERTY_TYPE prop in devset.osainfo) { if (prop.sysname.IndexOf("print-postscript", StringComparison.OrdinalIgnoreCase) >= 0) { if (prop.Value == "enabled") { isPostScriptEnabled = true; } } } } return(isPostScriptEnabled); }
/// <summary> /// Gets the device information. /// </summary> /// <returns></returns> /// <remarks> /// Sequence Diagram:<br/> /// <img src="SequenceDiagrams/SD_PrintReleaseDevice.Browser.LogOn.GetDeviceInformation.jpg"/> /// </remarks> private DEVICE_INFO_TYPE GetDeviceInformation() { DEVICE_INFO_TYPE deviceInfo = null; try { CreateWS(); string generic = "1.0.0.23"; CONFIGURATION_TYPE configurationType = null; deviceSettingType = new DEVICE_SETTING_TYPE(); SCREEN_INFO_TYPE[] screenInfoType = null; deviceInfo = _ws.GetDeviceSettings(ref generic, out deviceSettingType, out configurationType, out screenInfoType); //PROPERTY_TYPE[] acSetting = new PROPERTY_TYPE[1]; //acSetting[0] = new PROPERTY_TYPE(); //acSetting[0].sysname = "enableAutoClear"; //acSetting[0].Value = "true"; //or "false" //string OSASESSIONID = Request.Params["UISessionID"].ToString(); //_ws.SetDeviceContext(OSASESSIONID, acSetting, ref OsaDirectManager.Core.g_WSDLGeneric); } catch (Exception ex) { isValidLicenceFile = true; LogManager.RecordMessage(deviceIpAddress, "deviceInfo", LogManager.MessageType.Exception, "Message From MFP Login", "Event Exception", ex.Message, ex.StackTrace); } return(deviceInfo); }
/// <summary> /// Determines whether [is setting exist] [the specified device ip]. /// </summary> /// <param name="deviceIp">The device ip.</param> /// <param name="isStapleEnabled">if set to <c>true</c> [is staple enabled].</param> /// <param name="isPunchEnabled">if set to <c>true</c> [is punch enabled].</param> internal static void IsSettingExist(string deviceIp, out bool isStapleEnabled, out bool isPunchEnabled, out bool isdocumentFilingSettings) { isStapleEnabled = false; isPunchEnabled = false; isdocumentFilingSettings = false; string generic = "1.0.0.21"; MFPCoreWS ws = new MFPCoreWS(); ws.Url = OsaDirectManager.Core.GetMFPURL(deviceIp); SECURITY_SOAPHEADER_TYPE sec = new SECURITY_SOAPHEADER_TYPE(); sec.licensekey = OsaDirectManager.Core.OSA_LICENSE_KEY; ws.Security = sec; DEVICE_INFO_TYPE devinfo = new DEVICE_INFO_TYPE(); DEVICE_SETTING_TYPE devset = new DEVICE_SETTING_TYPE(); CONFIGURATION_TYPE config = new CONFIGURATION_TYPE(); SCREEN_INFO_TYPE[] screeninfo; devinfo = ws.GetDeviceSettings(ref generic, out devset, out config, out screeninfo); if (devset != null) { foreach (PROPERTY_TYPE prop in config.hardware) { if (prop.sysname == "staple") { if (prop.Value == "true") { isStapleEnabled = true; } } if (prop.sysname == "punch") { if (prop.Value == "true") { isPunchEnabled = true; } } } } if (devinfo != null) { if (devinfo.modelname == "SHARP MX-C310") { isdocumentFilingSettings = false; } else { isdocumentFilingSettings = true; } } }