Beispiel #1
0
 public RemoteRESTCloverConnector(CloverDeviceConfiguration config)
 {
     System.Reflection.Assembly assembly = System.Reflection.Assembly.Load("CloverConnector");
     _SDKInfo = assembly.GetAssemblyAttribute <System.Reflection.AssemblyDescriptionAttribute>().Description + ":"
                + (assembly.GetAssemblyAttribute <System.Reflection.AssemblyFileVersionAttribute>()).Version
                + (assembly.GetAssemblyAttribute <System.Reflection.AssemblyInformationalVersionAttribute>()).InformationalVersion;
     Config = config;
 }
Beispiel #2
0
 public RemoteWebSocketCloverConnector(CloverDeviceConfiguration config)
 {
     System.Reflection.Assembly assembly = System.Reflection.Assembly.Load("CloverConnector");
     _SDKInfo = assembly.GetAssemblyAttribute <System.Reflection.AssemblyDescriptionAttribute>().Description + ":"
                + (assembly.GetAssemblyAttribute <System.Reflection.AssemblyFileVersionAttribute>()).Version
                + (assembly.GetAssemblyAttribute <System.Reflection.AssemblyInformationalVersionAttribute>()).InformationalVersion;
     this.config = config;
     endpoint    = ((RemoteWebSocketCloverConfiguration)config).endpoint;
 }
        internal static string getRemoteSdk(this CloverDeviceConfiguration config, CloverTransport transport)
        {
            string REG_KEY  = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\CloverSDK";
            string receiver = "DLL";

            try
            {
                object rReceiver = Registry.GetValue(REG_KEY, "DisplayName", "unset");
                if (rReceiver != null && !rReceiver.ToString().Equals("unset"))
                {
                    receiver = rReceiver.ToString();
                }
            }
            catch (Exception e)
            {
                using (EventLog eventLog = new EventLog("Application"))
                {
                    eventLog.Source = "Application";
                    eventLog.WriteEntry($"{config.getMessagePackageName().GetType()}->{e.Message}");
                }
            }

            string shortTitle         = transport.ShortTitle();
            string shortTransportType = String.IsNullOrWhiteSpace(shortTitle) ? "UNKNOWN" : shortTitle;

            // Build SdkInfo string
            System.Reflection.Assembly assembly = System.Reflection.Assembly.Load("CloverConnector");
            string sdkInfoString = AssemblyUtils.GetAssemblyAttribute <System.Reflection.AssemblyDescriptionAttribute>(assembly).Description
                                   + "_" + receiver
                                   + "|" + shortTransportType
                                   + ":"
                                   + (assembly.GetAssemblyAttribute <System.Reflection.AssemblyFileVersionAttribute>()).Version
                                   + (assembly.GetAssemblyAttribute <System.Reflection.AssemblyInformationalVersionAttribute>()).InformationalVersion;

            using (EventLog eventLog = new EventLog("Application"))
            {
                eventLog.Source = "Application";
                eventLog.WriteEntry($"{config.getMessagePackageName().GetType()}->SDKInfo from assembly and registry = {sdkInfoString}");
            }

            return(sdkInfoString);
        }
Beispiel #4
0
        ///
        /// </summary>
        /// <returns></returns>
        private string getSDKInfoString()
        {
            string REG_KEY  = "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\CloverSDK";
            string receiver = "DLL";

            try
            {
                object rReceiver = Registry.GetValue(REG_KEY, "DisplayName", "unset");
                if (rReceiver != null && !rReceiver.ToString().Equals("unset"))
                {
                    receiver = rReceiver.ToString();
                }
            }
            catch (Exception e)
            {
                using (EventLog eventLog = new EventLog("Application"))
                {
                    eventLog.Source = "Application";
                    eventLog.WriteEntry($"{packageName.GetType()}->{e.Message}");
                }
            }

            // Build SdkInfo string
            System.Reflection.Assembly assembly = System.Reflection.Assembly.Load("CloverConnector");
            string sdkInfoString = AssemblyUtils.GetAssemblyAttribute <System.Reflection.AssemblyDescriptionAttribute>(assembly).Description
                                   + "_" + receiver
                                   + "|" + shortTransportType
                                   + ":"
                                   + (assembly.GetAssemblyAttribute <System.Reflection.AssemblyFileVersionAttribute>()).Version
                                   + (assembly.GetAssemblyAttribute <System.Reflection.AssemblyInformationalVersionAttribute>()).InformationalVersion;

            using (EventLog eventLog = new EventLog("Application"))
            {
                eventLog.Source = "Application";
                eventLog.WriteEntry($"{packageName.GetType()}->SDKInfo from assembly and registry = {sdkInfoString}");
            }

            return(sdkInfoString);
        }
 public static void GetVersion(System.Reflection.Assembly executingAssembly, out string company, out string product, out Version version)
 {
     company = executingAssembly.GetAssemblyAttribute <System.Reflection.AssemblyCompanyAttribute>().Company;
     product = executingAssembly.GetAssemblyAttribute <System.Reflection.AssemblyProductAttribute>().Product;
     version = executingAssembly.GetName().Version;
 }