Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public void Remove(NvdlContext item)
 {
     List.Add(item);
 }
Ejemplo n.º 4
0
 public void Add(NvdlContext item)
 {
     List.Add(item);
 }
Ejemplo n.º 5
0
 internal SimpleMode GetCompiledMode(NvdlContext c)
 {
     return(compiledModes [c] as SimpleMode);
 }
Ejemplo n.º 6
0
 internal void AddCompiledMode(NvdlContext c, SimpleMode m)
 {
     compiledModes.Add(c, m);
 }
Ejemplo n.º 7
0
		internal SimpleMode GetCompiledMode (NvdlContext c)
		{
			return compiledModes [c] as SimpleMode;
		}
Ejemplo n.º 8
0
		internal void AddCompiledMode (NvdlContext c, SimpleMode m)
		{
			compiledModes.Add (c, m);
		}
Ejemplo n.º 9
0
		public void Remove (NvdlContext item)
		{
			List.Add (item);
		}
Ejemplo n.º 10
0
		public void Add (NvdlContext item)
		{
			List.Add (item);
		}
Ejemplo n.º 11
0
 internal SimpleMode GetCompiledMode(NvdlContext c)
 {
     return(compiledModes.ContainsKey(c) ? compiledModes [c] : null);
 }
Ejemplo n.º 12
0
		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;
		}
Ejemplo n.º 13
0
		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);
			}
		}