Пример #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);
            }
        }
Пример #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);
        }
Пример #3
0
 public void Remove(NvdlContext item)
 {
     List.Add(item);
 }
Пример #4
0
 public void Add(NvdlContext item)
 {
     List.Add(item);
 }
Пример #5
0
 internal SimpleMode GetCompiledMode(NvdlContext c)
 {
     return(compiledModes [c] as SimpleMode);
 }
Пример #6
0
 internal void AddCompiledMode(NvdlContext c, SimpleMode m)
 {
     compiledModes.Add(c, m);
 }
Пример #7
0
		internal SimpleMode GetCompiledMode (NvdlContext c)
		{
			return compiledModes [c] as SimpleMode;
		}
Пример #8
0
		internal void AddCompiledMode (NvdlContext c, SimpleMode m)
		{
			compiledModes.Add (c, m);
		}
Пример #9
0
		public void Remove (NvdlContext item)
		{
			List.Add (item);
		}
Пример #10
0
		public void Add (NvdlContext item)
		{
			List.Add (item);
		}
Пример #11
0
 internal SimpleMode GetCompiledMode(NvdlContext c)
 {
     return(compiledModes.ContainsKey(c) ? compiledModes [c] : null);
 }
Пример #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;
		}
Пример #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);
			}
		}