public void InitialiseSolutionSettings(ISettingsStorageMountPoint mountPoint)
        {
            var entry = mySettingsSchema.GetIndexedEntry((InstalledDictionariesSettings s) => s.InstalledDictionaries);
            var path  = (FileSystemPath.Parse(GetType().Assembly.Location).Parent / "Extensions/JetBrains.unity/dictionaries/unity.dic").FullPath;

            ScalarSettingsStoreAccess.SetIndexedValue(mountPoint, entry, path, null, true, null, myLogger);
        }
Пример #2
0
        public void InitialiseSolutionSettings(ISettingsStorageMountPoint mountPoint)
        {
            // This is called on the main thread, load the settings and initialise in the background
            myThreading.Tasks.Factory.StartNew(() =>
            {
                var streamName = GetType().Namespace + ".Abbreviations.txt";
                var stream     = GetType().Assembly.GetManifestResourceStream(streamName);
                if (stream == null)
                {
                    myLogger.Warn($"Cannot load resource stream: {streamName}");
                    return;
                }

                using (var streamReader = new StreamReader(stream))
                {
                    var entry = mySettingsSchema.GetIndexedEntry((CSharpNamingSettings s) => s.Abbreviations);

                    string abbreviation;
                    while ((abbreviation = streamReader.ReadLine()) != null)
                    {
                        ScalarSettingsStoreAccess.SetIndexedValue(mountPoint, entry, abbreviation, null, abbreviation,
                                                                  null, myLogger);
                    }
                }
            });
        }
Пример #3
0
 private void SetIndexedValue <TKeyClass, TEntryIndex, TEntryValue>([NotNull] ISettingsStorageMountPoint mount,
                                                                    [NotNull] Expression <Func <TKeyClass, IIndexedEntry <TEntryIndex, TEntryValue> > > lambdaexpression,
                                                                    [NotNull] TEntryIndex index,
                                                                    [NotNull] TEntryValue value,
                                                                    IDictionary <SettingsKey, object> keyIndices = null)
 {
     ScalarSettingsStoreAccess.SetIndexedValue(mount, settingsSchema.GetIndexedEntry(lambdaexpression), index,
                                               keyIndices, value, null, logger);
 }
        private void AddAutoImportExclusions(ISettingsStorageMountPoint mountPoint, params string[] settings)
        {
            var entry      = mySettingsSchema.GetIndexedEntry((AutoImport2Settings s) => s.BlackLists);
            var indexedKey = new Dictionary <SettingsKey, object>
            {
                { mySettingsSchema.GetKey <AutoImport2Settings>(), CSharpLanguage.Name }
            };

            foreach (var setting in settings)
            {
                ScalarSettingsStoreAccess.SetIndexedValue(mountPoint, entry, setting, indexedKey, true, null, myLogger);
            }
        }