예제 #1
0
        private void FlushBufferAndStart()
        {
            RemoteSettingsLogMessage result;

            lock (flushLock)
            {
                if (isStarted)
                {
                    return;
                }
                List <KeyValuePair <string, string> > mainIdentifiers = new List <KeyValuePair <string, string> >
                {
                    new KeyValuePair <string, string>("applicationName", filterProvider.GetApplicationName()),
                    new KeyValuePair <string, string>("applicationVersion", filterProvider.GetApplicationVersion()),
                    new KeyValuePair <string, string>("branchName", filterProvider.GetBranchBuildFrom())
                };
                settingsProvider.MainIdentifiers = mainIdentifiers;
                settingsProvider.Path            = Path.GetTempPath();
                settingsProvider.Folder          = "VSRemoteSettingsLog";
                logFile.Initialize(settingsProvider);
                while (Buffer.TryDequeue(out result))
                {
                    LogMessageNoBuffer(result);
                }
                isStarted = true;
            }
            while (Buffer.TryDequeue(out result))
            {
                LogMessageNoBuffer(result);
            }
        }
예제 #2
0
        public IRemoteSettingsStorageHandler Build(ICollectionKeyValueStorage storage, bool usePrefix, RemoteSettingsFilterProvider filterProvider, IScopeParserFactory scopeParserFactory)
        {
            CodeContract.RequiresArgumentNotNull <RemoteSettingsFilterProvider>(filterProvider, "filterProvider");
            List <string> list = new List <string>();

            list.AddIfNotEmpty(filterProvider.GetApplicationName());
            list.AddIfNotEmpty(filterProvider.GetApplicationVersion());
            list.AddIfNotEmpty(filterProvider.GetBranchBuildFrom());
            string text = string.Join("\\", list);
            string collectionPathPrefix = (!usePrefix) ? text : string.Format("{0}\\{1}", "Software\\Coding4Fun\\VisualStudio\\RemoteSettings", text, CultureInfo.InvariantCulture);

            return(new RemoteSettingsStorageHandler(storage, collectionPathPrefix, scopeParserFactory, false, logger));
        }