public Pubnub(PNConfiguration config) { savedSdkVerion = Version; InstanceId = Guid.NewGuid().ToString(); pubnubConfig = config; if (config != null) { pubnubLog = config.PubnubLog; } JsonPluggableLibrary = new NewtonsoftJsonDotNet(config, pubnubLog); if (config != null && config.EnableTelemetry) { telemetryManager = new EndPoint.TelemetryManager(pubnubConfig, pubnubLog); } CheckRequiredConfigValues(); if (config != null && pubnubLog != null) { PNPlatform.Print(config, pubnubLog); } if (config != null && config.PresenceTimeout < 20) { config.PresenceTimeout = 20; if (pubnubLog != null) { LoggingMethod.WriteToLog(pubnubLog, string.Format("DateTime: {0}, WARNING: The PresenceTimeout cannot be less than 20, defaulting the value to 20. Please update the settings in your code.", DateTime.Now.ToString(CultureInfo.InvariantCulture)), config.LogVerbosity); } } }
static Pubnub() { #if NET35 || NET40 var assemblyVersion = typeof(Pubnub).Assembly.GetName().Version; #else var assembly = typeof(Pubnub).GetTypeInfo().Assembly; var assemblyName = new AssemblyName(assembly.FullName); string assemblyVersion = assemblyName.Version.ToString(); #endif Version = string.Format("{0}CSharp{1}", PNPlatform.Get(), assemblyVersion); }
public Pubnub(PNConfiguration config) { savedSdkVerion = sdkVersion; instanceId = Guid.NewGuid().ToString(); pubnubConfig = config; if (config != null) { pubnubLog = config.PubnubLog; } jsonPluggableLibrary = new NewtonsoftJsonDotNet(config, pubnubLog); if (config != null && config.EnableTelemetry) { telemetryManager = new EndPoint.TelemetryManager(pubnubConfig, pubnubLog); } CheckRequiredConfigValues(); if (config != null && pubnubLog != null) { PNPlatform.Print(config, pubnubLog); } }