Beispiel #1
0
        /// <summary>
        /// Get Client and Services versions and server name
        /// </summary>
        /// <param name="clientVersion"></param>
        /// <param name="servicesVersion"></param>
        /// <param name="server"></param>

        public static void GetClientAndServicesVersions(
            out string clientVersion,
            out string servicesVersion,
            out string server,
            bool includeSessionCount = false)
        {
            Version cv = Assembly.GetExecutingAssembly().GetName().Version;             // version comes from this assembly (ServiceFacade)

            clientVersion   = VersionMx.FormatVersion(cv);
            servicesVersion = server = "";

            if (ServiceFacade.UseRemoteServices)
            {
                if (ServiceHostInfo == null)                 // get from services if don't have already
                {
                    ServiceHostInfo = ServiceFacade.GetServiceHostInfo();
                }

                if (ServiceHostInfo != null)
                {
                    servicesVersion = VersionMx.FormatVersion(ServiceHostInfo.Version);
                    server          = ServiceHostInfo.ServerName;
                    if (includeSessionCount)
                    {
                        int sessionCount = UsageDao.GetCurrentSessionCount();
                        server += " (" + sessionCount + " sessions)";
                    }
                }
            }

            else             // not using services
            {
                servicesVersion = "Integrated";
            }

            return;
        }