Пример #1
0
        /// <summary>
        /// Do display initialization.
        /// Returns true on success
        /// </summary>
        private bool DoInit()
        {
            IDW_INITRESULT initResult = new IDW_INITRESULT();
            DSPResult      ret        = IDW_Init(initResult);

            //Check the API call worked
            if (ret != DSPResult.DSP_SUCCEEDED)
            {
                ImonErrorMessage = DSPResult2String(ret);
                LogError(string.Format("{0}.IsDisabled: {1}", ClassErrorName, ImonErrorMessage));
                return(false);
            }
            //Check that the initialization was carried out properly
            else if (initResult.iInitResult != DSPNInitResult.DSPN_SUCCEEDED)
            {
                ImonErrorMessage = DSPNResult2String(initResult.iInitResult);
                LogError(string.Format("{0}.IsDisabled: {1}", ClassErrorName, ImonErrorMessage));
                return(false);
            }
            //Check we that we have a display
            else if (initResult.iDspType == DSPType.DSPN_DSP_NONE)
            {
                ImonErrorMessage = UnsupportedDeviceErrorMessage;
                LogError(string.Format("{0}.IsDisabled: {1}", ClassErrorName, ImonErrorMessage));
                return(false);
            }

            DisplayType     = initResult.iDspType;
            Initialized     = true;
            iInitToggleTime = DateTime.Now;
            return(true);
        }
Пример #2
0
 protected static extern DSPResult IDW_Init(IDW_INITRESULT initResult);
Пример #3
0
 protected static extern DSPResult IDW_Init(IDW_INITRESULT initResult);
Пример #4
0
        /// <summary>
        /// Do display initialization.
        /// Returns true on success
        /// </summary>
        private bool DoInit()
        {
            IDW_INITRESULT initResult = new IDW_INITRESULT();
            DSPResult ret = IDW_Init(initResult);
            //Check the API call worked
            if (ret != DSPResult.DSP_SUCCEEDED)
            {
                ImonErrorMessage = DSPResult2String(ret);
                LogError(string.Format("{0}.IsDisabled: {1}", ClassErrorName, ImonErrorMessage));
                return false;
            }
            //Check that the initialization was carried out properly
            else if (initResult.iInitResult != DSPNInitResult.DSPN_SUCCEEDED)
            {
                ImonErrorMessage = DSPNResult2String(initResult.iInitResult);
                LogError(string.Format("{0}.IsDisabled: {1}", ClassErrorName, ImonErrorMessage));
                return false;
            }
            //Check we that we have a display
            else if (initResult.iDspType == DSPType.DSPN_DSP_NONE)
            {                
                ImonErrorMessage = UnsupportedDeviceErrorMessage;
                LogError(string.Format("{0}.IsDisabled: {1}", ClassErrorName, ImonErrorMessage));
                return false;
            }

            DisplayType = initResult.iDspType;
            Initialized = true;
            iInitToggleTime = DateTime.Now;
            return true;
        }