/// <summary> /// /// </summary> /// <param name="nodeGuid"></param> /// <param name="configEnv"></param> /// <param name="coreAssembly"></param> /// <param name="applAssembly"></param> /// <param name="userIdentityName"></param> /// <param name="userFullName"></param> public V131ClientInfo( Guid nodeGuid, V131EnvId configEnv, Assembly coreAssembly, Assembly applAssembly, string userIdentityName, string userFullName) { NodeGuid = nodeGuid; BuildEnv = CoreHelper.ToV131EnvId(EnvHelper.ParseEnvName(BuildConst.BuildEnv)); ConfigEnv = configEnv; // get remaining data members from system HostName = Dns.GetHostName(); IPHostEntry hostEntry = Dns.GetHostEntry(HostName); IPAddress[] hostIPs = hostEntry.AddressList; NetAddrs = new string[hostIPs.Length]; for (int i = 0; i < hostIPs.Length; i++) { NetAddrs[i] = hostIPs[i].ToString(); if (hostIPs[i].AddressFamily == AddressFamily.InterNetwork) { HostIpV4 = hostIPs[i].ToString(); } } UserInfo = new V131UserInfo(userIdentityName, userFullName); // get calling application details // if unmanaged - get Win32 details Assembly application = applAssembly ?? Assembly.GetEntryAssembly(); ApplInfo = application != null ? new V131AssmInfo(application) : new V131AssmInfo(Process.GetCurrentProcess().MainModule); // get calling component details CompInfo = new V131AssmInfo(coreAssembly); }
public static EnvId ToEnvId(V131EnvId env) { switch (env) { case V131EnvId.Undefined: return(EnvId.Undefined); case V131EnvId.UTT_UnitTest: return(EnvId.Utt_UnitTest); case V131EnvId.DEV_Development: return(EnvId.Dev_Development); case V131EnvId.SIT_SystemTest: return(EnvId.Sit_SystemTest); case V131EnvId.STG_StagingLive: return(EnvId.Stg_StagingLive); case V131EnvId.PRD_Production: return(EnvId.Prd_Production); default: throw new ArgumentException($"Unknown V131EnvId: {env}"); } }