コード例 #1
0
        public List <ServerInfo> LoadServerInfos()
        {
            if (!serverInfoCacheInited)
            {
                serverInfoCache       = LoadServerInfosFromFile();
                serverInfoCacheInited = true;
            }

            return(ListCloner.Copy(serverInfoCache));
        }
コード例 #2
0
        public void SaveServerInfos(List <ServerInfo> update)
        {
            string filepath = FileUtil.DataFolder.FullFilePath(ServerInfoSavedXmlFile);

            try
            {
                ServerInfosXmlSerializer.ToXmlFile(update, filepath);
            }
            catch (Exception e)
            {
                AddinViewController.ShowErrorDialog("Can't save servers in:" + filepath, e.ToString());
                update = null;
            }

            if (update != null)
            {
                serverInfoCache       = ListCloner.Copy(update);
                serverInfoCacheInited = true;
            }
        }