示例#1
0
		public bool MakeWritingSystemIdChange(WritingSystem ws, string oldId)
		{
			if (DoSomethingToLiftFile((p) =>
					 //todo: expand the regular expression here to account for all reasonable patterns
					 GrepFile(PathToLiftFile,
							  string.Format("lang\\s*=\\s*[\"']{0}[\"']",
											Regex.Escape(oldId)),
							  string.Format("lang=\"{0}\"", ws.Id))))
			{
				WritingSystems.IdOfWritingSystemChanged(ws, oldId);
				DefaultViewTemplate.ChangeWritingSystemId(oldId, ws.Id);

				if (WritingSystemChanged != null)
				{
					StringPair p = new StringPair();
					p.from = oldId;
					p.to = ws.Id;
					WritingSystemChanged.Invoke(this, p);
				}
				return true;
			}

			return false;
		}