/// <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>
        /// 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;
                }
            }
        }
예제 #3
0
        /// <summary>
        /// Creates the WS.
        /// </summary>
        /// <returns></returns>
        /// <remarks>
        /// Sequence Diagram:<br/>
        /// 	<img src="SequenceDiagrams/SD_PrintReleaseDevice.Browser.LogOn.CreateWS.jpg"/>
        /// </remarks>
        private bool CreateWS()
        {
            bool Ret = false;

            string MFPIP = Request.Params["REMOTE_ADDR"].ToString();
            string URL = OsaDirectManager.Core.GetMFPURL(MFPIP);
            _ws = new MFPCoreWS();
            _ws.Url = URL;
            ////////////////////////////////////////////////////////////////////////
            //set the security headers	
            SECURITY_SOAPHEADER_TYPE sec = new SECURITY_SOAPHEADER_TYPE();
            sec.licensekey = OsaDirectManager.Core.OSA_LICENSE_KEY;
            _ws.Security = sec;
            ////////////////////////////////////////////////////////////////////
            Ret = true;

            return Ret;
        }
예제 #4
0
 /// <summary>
 /// create the webservice object
 /// </summary>
 /// <returnsboolreturns>
 /// <remarks>
 /// Sequence Diagram:<br/>
 ///     <img src="SequenceDiagrams/SD_PrintReleaseDevice.Browser.PrintJobs.CreateWS.jpg"/>
 /// </remarks>
 private bool CreateWS()
 {
     try
     {
         string mfpIPAddress = Request.Params["REMOTE_ADDR"].ToString();
         string mfpUri       = OsaDirectManager.Core.GetMFPURL(mfpIPAddress);
         mfpWebService     = new MFPCoreWS();
         mfpWebService.Url = mfpUri;
         SECURITY_SOAPHEADER_TYPE securityHeader = new SECURITY_SOAPHEADER_TYPE();
         securityHeader.licensekey = OsaDirectManager.Core.OSA_LICENSE_KEY;
         mfpWebService.Security    = securityHeader;
         return(true);
     }
     catch
     {
         return(false);
     }
 }
예제 #5
0
        /// <summary>
        /// create the web service object
        /// </summary>
        /// <returnsboolreturns>
        /// <remarks>
        /// Sequence Diagram:<br/>
        ///     <img src="SequenceDiagrams/SD_PrintReleaseDevice.Mfp.JobStatus.CreateWS.jpg"/>
        /// </remarks>
        private bool CreateWS()
        {
            bool returnValue = false;

            try
            {
                string mfpIPAddress     = Request.Params["REMOTE_ADDR"].ToString();
                string mfpWebServiceUrl = OsaDirectManager.Core.GetMFPURL(mfpIPAddress);
                mfpWebService     = new MFPCoreWS();
                mfpWebService.Url = mfpWebServiceUrl;
                SECURITY_SOAPHEADER_TYPE securityHeaderType = new SECURITY_SOAPHEADER_TYPE();
                securityHeaderType.licensekey = OsaDirectManager.Core.OSA_LICENSE_KEY;
                mfpWebService.Security        = securityHeaderType;
                returnValue = true;
            }
            catch (Exception)
            {
                returnValue = false;
            }
            return(returnValue);
        }