Example #1
0
        public int GetInt32(string collection, string propertyName, int defaultValue)
        {
            int value;
            int hr = _store.GetIntOrDefault(collection, propertyName, defaultValue, out value);

            return(ErrorHandler.Succeeded(hr) ? value : 0);
        }
Example #2
0
        public int GetInt32(string collection, string propertyName, int defaultValue)
        {
            return(NuGetUIThreadHelper.JoinableTaskFactory.Run(async() =>
            {
                await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

                var hr = _store.GetIntOrDefault(collection, propertyName, defaultValue, out var value);
                return ErrorHandler.Succeeded(hr) ? value : 0;
            }));
        }