public override TextNode Deserialize(string filename) { TextNode mainNode = new TextNode(); string[] line; int lineNumber; string[] tokenArray; this._mStream.ReadLine(out line, out lineNumber); tokenArray = new string[line.Length - 1]; Array.Copy(line, 1, tokenArray, 0, tokenArray.Length); while (this._mStream.ReadLine(out line, out lineNumber)) { if (line.Any(item => string.IsNullOrEmpty(item))) { DeserializeMessageEventArgs messageEventArgs = new DeserializeMessageEventArgs(); messageEventArgs.mLineNumber = lineNumber; messageEventArgs.mCode = DeserializeMessageCode.MissingElementCsvEntry; messageEventArgs.mType = DeserializeMessageType.Warning; this.OnNewDeserializeMessage(messageEventArgs); } mainNode._mChildNodes.Add(this.CreateLocalisationNode(line, tokenArray)); } return(mainNode); }
public override TextNode Deserialize(string fileName) { TextNode mainNode = new TextNode(); String[] line; int lineNumber; this._mStream.ReadLine(out line, out lineNumber); while (this._mStream.ReadLine(out line, out lineNumber)) { if (line.Any(item => String.IsNullOrEmpty(item))) { DeserializeMessageEventArgs messageEventArgs = new DeserializeMessageEventArgs(); messageEventArgs.mLineNumber = lineNumber; messageEventArgs.mCode = DeserializeMessageCode.MissingElementCsvEntry; messageEventArgs.mType = DeserializeMessageType.Warning; this.OnNewDeserializeMessage(messageEventArgs); continue; } mainNode._mChildNodes.Add(this.CreateProvinceNode(line)); } return(mainNode); }
protected virtual void OnNewDeserializeMessage(DeserializeMessageEventArgs args) { this.NewDeserializeMessage?.Invoke(this, args); }