Exemple #1
0
        private void SetInstanceCustomProperties(CustomProperties customProperties)
        {
            if (customProperties == null || customProperties.Properties.Count == 0)
            {
                MobileCenterLog.Error(MobileCenterLog.LogTag, "Custom properties may not be null or empty");
                return;
            }
            var customPropertiesLog = new CustomPropertiesLog();

            customPropertiesLog.Properties = customProperties.Properties;
            _channel.Enqueue(customPropertiesLog);
        }
Exemple #2
0
        private void SendStartSessionIfNeeded()
        {
            var now = TimeHelper.CurrentTimeInMilliseconds();

            if (_sid != null && !HasSessionTimedOut(now))
            {
                return;
            }

            if (_sessions.Count == StorageMaxSessions)
            {
                _sessions.Remove(_sessions.Keys.Min());
            }
            _sid = Guid.NewGuid();
            _sessions.Add(now, _sid.Value);
            _applicationSettings[StorageKey] = SessionsAsString();
            var startSessionLog = new StartSessionLog {
                Sid = _sid
            };

            _channel.Enqueue(startSessionLog);
        }