Esempio n. 1
0
        public static string[] GetSteamLibraryDirectories()
        {
            var dir = GetSteamDirectory();

            if (dir != null)
            {
                var libraryfolders = Path.Combine(dir, "steamapps", "libraryfolders.vdf");
                if (File.Exists(libraryfolders))
                {
                    KeyValues kv = KVFile.ImportKeyValue(File.ReadAllText(libraryfolders), false);

                    int    i = 1;
                    object obj;
                    var    list = new List <string>();

                    list.Add(Path.GetFullPath(Path.Combine(dir, "steamapps")));
                    while ((obj = kv.Root.GetValue(i++.ToString())) != null)
                    {
                        list.Add(Path.GetFullPath(Path.Combine((string)obj, "steamapps")));
                    }

                    if (list.Count > 0)
                    {
                        return(list.ToArray());
                    }
                }
            }
            return(null);
        }
Esempio n. 2
0
        private void OpenEditor()
        {
            KVFile kvFile = contextRegistry.ActiveContext.As <KVFile>();

            if (kvFile != null)
            {
                //Open the file in a Key-Value editor
                kvEditor.OpenKVDocument(kvFile);
                return;
            }

            TextFile textFile = contextRegistry.ActiveContext.As <TextFile>();

            if (textFile != null)
            {
                //Open the file in a Text Editor

                textEditor.OpenDocument(textFile);
            }
        }