public SimpleContext(NvdlContext context) { source = context; FillLocation(context); this.useModeName = context.UseMode; try { string [] spaths = context.Path.Split('|'); ArrayList al = new ArrayList(); foreach (string spathws in spaths) { string spath = spathws.Trim( Nvdl.Whitespaces); if (spath.Length == 0) { continue; } ParsePath(al, TrimName(spath)); } path = (SimplePath [])al.ToArray( typeof(SimplePath)); } catch (XmlException ex) { throw new NvdlCompileException(String.Format("Invalid path string: {0}", path), ex, context); } }
private NvdlContext ReadContext() { NvdlContext el = new NvdlContext(); FillLocation(el); el.Path = reader.GetAttribute("path"); el.UseMode = reader.GetAttribute("useMode"); FillForeignAttribute(el); if (reader.IsEmptyElement) { reader.Skip(); return(el); } reader.Read(); do { reader.MoveToContent(); if (reader.NodeType == XmlNodeType.EndElement) { break; } if (reader.NamespaceURI != Nvdl.Namespace) { el.Foreign.Add(XDocument.ReadFrom(reader)); continue; } switch (reader.LocalName) { case "mode": el.NestedMode = ReadNestedMode(); break; default: throw new NotSupportedException(); } } while (!reader.EOF); if (!reader.EOF) { reader.Read(); } return(el); }
public void Remove(NvdlContext item) { List.Add(item); }
public void Add(NvdlContext item) { List.Add(item); }
internal SimpleMode GetCompiledMode(NvdlContext c) { return(compiledModes [c] as SimpleMode); }
internal void AddCompiledMode(NvdlContext c, SimpleMode m) { compiledModes.Add(c, m); }
internal SimpleMode GetCompiledMode (NvdlContext c) { return compiledModes [c] as SimpleMode; }
internal void AddCompiledMode (NvdlContext c, SimpleMode m) { compiledModes.Add (c, m); }
public void Remove (NvdlContext item) { List.Add (item); }
public void Add (NvdlContext item) { List.Add (item); }
internal SimpleMode GetCompiledMode(NvdlContext c) { return(compiledModes.ContainsKey(c) ? compiledModes [c] : null); }
private NvdlContext ReadContext () { NvdlContext el = new NvdlContext (); FillLocation (el); el.Path = reader.GetAttribute ("path"); el.UseMode = reader.GetAttribute ("useMode"); FillForeignAttribute (el); if (reader.IsEmptyElement) { reader.Skip (); return el; } reader.Read (); do { reader.MoveToContent (); if (reader.NodeType == XmlNodeType.EndElement) break; if (reader.NamespaceURI != Nvdl.Namespace) { el.Foreign.Add (doc.ReadNode (reader)); continue; } switch (reader.LocalName) { case "mode": el.NestedMode = ReadNestedMode (); break; default: throw new NotSupportedException (); } } while (!reader.EOF); if (!reader.EOF) reader.Read (); return el; }
public SimpleContext (NvdlContext context) { source = context; FillLocation (context); this.useModeName = context.UseMode; try { string [] spaths = context.Path.Split ('|'); ArrayList al = new ArrayList (); foreach (string spathws in spaths) { string spath = spathws.Trim ( Nvdl.Whitespaces); if (spath.Length == 0) continue; ParsePath (al, TrimName (spath)); } path = (SimplePath []) al.ToArray ( typeof (SimplePath)); } catch (XmlException ex) { throw new NvdlCompileException (String.Format ("Invalid path string: {0}", path), ex, context); } }