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);
 }
コード例 #4
0
        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);
            }
        }
コード例 #5
0
        private void AddProjectFilesToSwea(List <IProjectFile> projectFiles)
        {
            if (!myUnityYamlSupport.IsUnityYamlParsingEnabled.Value)
            {
                return;
            }

            // Note that we don't want to use DaemonExcludedFilesManager.AddFileToForceEnable here, because that will
            // add the files to .sln.dotSettings.user. We'll do it ourselves, in our hidden solution settings layer
            using (myLocks.UsingWriteLock())
            {
                var filesAndFoldersToSkipEntry = mySettingsSchema.GetIndexedEntry <ExcludedFilesSettingsKey, string, ExcludedFileState>(key => key.FilesAndFoldersToSkip2);
                var mountPoint = mySettingsLayersProvider.SolutionMountPoint;
                foreach (var file in projectFiles)
                {
                    var id = file.GetPersistentID();
                    ScalarSettingsStoreAccess.SetIndexedValue(mountPoint, filesAndFoldersToSkipEntry, id, null,
                                                              ExcludedFileState.ForceIncluded, null, myLogger);
                }
            }
        }