Пример #1
0
        //-------------------------
        public static void LoadList(string loadPath, ObservableCollection <OpenPathEntry> list)
        {
            if (list == null)
            {
                return;
            }

            list.Clear();

            if (File.Exists(loadPath))
            {
                // Read the file and display it line by line.
                System.IO.StreamReader file = new System.IO.StreamReader(loadPath);

                string line = "";
                while ((line = file.ReadLine()) != null)
                {
                    string[] lineChunks = line.Split('@');
                    if (lineChunks.Length == 2)
                    {
                        //Sample: <KEY>@<PATH>
                        OpenPathEntry entry = new OpenPathEntry(lineChunks[0], lineChunks[1]);
                        list.Add(entry);
                    }
                }
                file.Close();
            }
        }
 //-------------------------
 private void HandleSave(object parameter)
 {
     OpenPathEntry.SaveList(OPENFILE_LIST_FILE, _openFileEntryList);
     OpenPathEntry.LoadList(OPENFILE_LIST_FILE, _openFileEntryList);
 }
 //-------------------------
 public static void InitializeList()
 {
     OpenPathEntry.LoadList(OPENFILE_LIST_FILE, _openFileEntryList);
 }
 //-------------------------
 public static void InitializeList()
 {
     OpenPathEntry.LoadList(OPENDIR_LIST_FILE, _openDirEntryList);
 }