/// <summary> /// Currents the mapping. /// </summary> /// <returns> /// The <see cref="RasLoginAppMapping"/>. /// </returns> public static RasLoginAppMapping CurrentMapping() { if (instance != null) { return(instance); } lock (SingletonLock) { if (instance != null) { return(instance); } instance = new RasLoginAppMapping(); var readObject = PListService.LoadPropertiesAsArray( PListService.LoginAppMapping, PListService.DocumentPath); if (readObject != null && readObject.Count > 1) { instance.SetInstanceMapping(readObject[0].Value); instance.SetAppIdMapping(readObject[1].Value); } } return(instance); }
/// <summary> /// Writes the mapping. /// </summary> public void WriteMapping() { var list = new ArrayPList() { new PListValue { PropertyType = "dict", Value = ToPList(this.serverInstanceMapping) }, new PListValue { PropertyType = "dict", Value = ToPList(this.serverAppIdMapping) }, }; PListService.Save(list, PListService.LoginAppMapping, PListService.DocumentPath); }