public static Image GetImage(string path, GetStreamDelegate handler)
        {
            Image  img = null;
            Stream ms  = handler(path);

            if (ms != null)
            {
                img = Image.FromStream(ms);
            }
            return(img);
        }
Example #2
0
 /// <summary>
 /// Initialize a new instance of the class and set the function delegates, properties and member variables to those values associated with the
 /// specified communication interface.
 /// </summary>
 /// <param name="communicationInterface">Reference to the communication interface containing the properties and member variables that are to
 /// be used to initialize the class.</param>
 public CommunicationEvent(ICommunicationParent communicationInterface)
     : base(communicationInterface)
 {
     #region - [Initialize VcuCommunication.event.cpp Function Delegates] -
     // ----------------------------------------------------------------------
     // Initialize the function delegates to either the VcuCommunication32.dll
     // or VcuCommunication64.dll functions depending upon whether the
     // Windows operating system is 64 bit or 32 bit.
     // ----------------------------------------------------------------------
     if (m_Is64BitOperatingSystem == true)
     {
         m_LoadFaultlog = VcuCommunication64Event.LoadFaultlog;
         m_CheckFaultlogger = VcuCommunication64Event.CheckFaultlogger;
         m_GetFaultHdr = VcuCommunication64Event.GetFaultHdr;
         m_GetFaultVar = VcuCommunication64Event.GetFaultVar;
         m_GetFltFlagInfo = VcuCommunication64Event.GetFltFlagInfo;
         m_GetFltHistInfo = VcuCommunication64Event.GetFltHistInfo;
         m_FreeEventLogMemory = VcuCommunication64Event.FreeEventLogMemory;
         m_SetFaultFlags = VcuCommunication64Event.SetFaultFlags;
         m_ClearEvent = VcuCommunication64Event.ClearEvent;
         m_InitializeEventLog = VcuCommunication64Event.InitializeEventLog;
         m_GetStream = VcuCommunication64Event.GetStream;
         m_GetStreamInformation = VcuCommunication64Event.GetStreamInformation;
         m_GetDefaultStreamInformation = VcuCommunication64Event.GetDefaultStreamInformation;
         m_SetDefaultStreamInformation = VcuCommunication64Event.SetDefaultStreamInformation;
         m_GetEventLog = VcuCommunication64Event.GetEventLog;
         m_ChangeEventLog = VcuCommunication64Event.ChangeEventLog;
         m_ExitEventLog = VcuCommunication64Event.ExitEventLog;
     }
     else
     {
         m_LoadFaultlog = VcuCommunication32Event.LoadFaultlog;
         m_CheckFaultlogger = VcuCommunication32Event.CheckFaultlogger;
         m_GetFaultHdr = VcuCommunication32Event.GetFaultHdr;
         m_GetFaultVar = VcuCommunication32Event.GetFaultVar;
         m_GetFltFlagInfo = VcuCommunication32Event.GetFltFlagInfo;
         m_GetFltHistInfo = VcuCommunication32Event.GetFltHistInfo;
         m_FreeEventLogMemory = VcuCommunication32Event.FreeEventLogMemory;
         m_SetFaultFlags = VcuCommunication32Event.SetFaultFlags;
         m_ClearEvent = VcuCommunication32Event.ClearEvent;
         m_InitializeEventLog = VcuCommunication32Event.InitializeEventLog;
         m_GetStream = VcuCommunication32Event.GetStream;
         m_GetStreamInformation = VcuCommunication32Event.GetStreamInformation;
         m_GetDefaultStreamInformation = VcuCommunication32Event.GetDefaultStreamInformation;
         m_SetDefaultStreamInformation = VcuCommunication32Event.SetDefaultStreamInformation;
         m_GetEventLog = VcuCommunication32Event.GetEventLog;
         m_ChangeEventLog = VcuCommunication32Event.ChangeEventLog;
         m_ExitEventLog = VcuCommunication32Event.ExitEventLog;
     }
     #endregion - [Initialize VcuCommunication.event.cpp Function Delegates] -
 }