Ejemplo n.º 1
0
		public static Size ReadSize(MashupParseContext context)
		{
			XMLTagReader xMLTagReader = context.NewTagReader("Size");
			Size result = new Size(context.GetRequiredAttributeInt("Width"), context.GetRequiredAttributeInt("Height"));
			xMLTagReader.SkipAllSubTags();
			return result;
		}
		public SourceMapLegendFrame(MashupParseContext context)
		{
			XMLTagReader xMLTagReader = context.NewTagReader(SourceMapLegendFrame.GetXMLTag());
			this.filename = context.GetRequiredAttribute("Filename");
			this.loadedSize.Width = context.GetRequiredAttributeInt("Width");
			this.loadedSize.Height = context.GetRequiredAttributeInt("Height");
			this.useLoadedSize = true;
			xMLTagReader.SkipAllSubTags();
		}
Ejemplo n.º 3
0
            public ManifestSuperBlock(MashupParseContext context, TellManifestDirty tellDirty)
            {
                this.tellDirty = tellDirty;
                XMLTagReader xMLTagReader = context.NewTagReader(GetXmlTag());

                _nextUnassignedBlockId = context.GetRequiredAttributeInt("NextUnassignedBlockId");
                _splitThreshold        = context.GetRequiredAttributeInt("SplitThreshold");
                xMLTagReader.SkipAllSubTags();
            }
Ejemplo n.º 4
0
        public SourceMapLegendFrame(MashupParseContext context)
        {
            XMLTagReader xMLTagReader = context.NewTagReader(GetXMLTag());

            filename          = context.GetRequiredAttribute("Filename");
            loadedSize.Width  = context.GetRequiredAttributeInt("Width");
            loadedSize.Height = context.GetRequiredAttributeInt("Height");
            useLoadedSize     = true;
            xMLTagReader.SkipAllSubTags();
        }
Ejemplo n.º 5
0
        public static Size ReadSize(MashupParseContext context)
        {
            XMLTagReader xMLTagReader = context.NewTagReader("Size");
            Size         result       = new Size(context.GetRequiredAttributeInt("Width"), context.GetRequiredAttributeInt("Height"));

            xMLTagReader.SkipAllSubTags();
            return(result);
        }
		public LocalDocumentDescriptor(MashupParseContext context, string pathBase)
		{
			XMLTagReader xMLTagReader = context.NewTagReader(LocalDocumentDescriptor.GetXMLTag());
			string requiredAttribute = context.GetRequiredAttribute(LocalDocumentDescriptor.LocalDocumentFilenameAttr);
			this._filename = Path.Combine(pathBase, requiredAttribute);
			this._pageNumber = context.GetRequiredAttributeInt(LocalDocumentDescriptor.LocalDocumentPageNumberAttr);
			xMLTagReader.SkipAllSubTags();
		}
Ejemplo n.º 7
0
        public LocalDocumentDescriptor(MashupParseContext context, string pathBase)
        {
            XMLTagReader xMLTagReader      = context.NewTagReader(GetXMLTag());
            string       requiredAttribute = context.GetRequiredAttribute(LocalDocumentFilenameAttr);

            _filename   = Path.Combine(pathBase, requiredAttribute);
            _pageNumber = context.GetRequiredAttributeInt(LocalDocumentPageNumberAttr);
            xMLTagReader.SkipAllSubTags();
        }
Ejemplo n.º 8
0
            public ManifestRecord(MashupParseContext context, ManifestBlock block)
            {
                this.block = block;
                XMLTagReader xMLTagReader = context.NewTagReader("ManifestRecord");

                path                    = context.GetRequiredAttribute("Path");
                _fileExists             = context.GetRequiredAttributeBoolean("FileExists");
                _fileLength             = context.GetRequiredAttributeLong("FileLength");
                indirectManifestBlockId = context.GetRequiredAttributeInt("IndirectManifestBlockId");
                xMLTagReader.SkipAllSubTags();
            }
Ejemplo n.º 9
0
        private void TryOneFetchFormatString()
        {
            try
            {
                HttpWebRequest httpWebRequest =
                    (HttpWebRequest)WebRequest.Create(BuildConfig.theConfig.veFormatUpdateURL);
                httpWebRequest.Timeout = 5000;
                HttpWebResponse httpWebResponse;
                try
                {
                    httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
                }
                catch (WebException)
                {
                    return;
                }

                if (httpWebResponse.StatusCode == HttpStatusCode.OK)
                {
                    Stream             responseStream     = httpWebResponse.GetResponseStream();
                    XmlTextReader      reader             = new XmlTextReader(responseStream);
                    MashupParseContext mashupParseContext = new MashupParseContext(reader);
                    using (mashupParseContext)
                    {
                        while (mashupParseContext.reader.Read())
                        {
                            if (mashupParseContext.reader.NodeType == XmlNodeType.Element &&
                                mashupParseContext.reader.Name == "VEUrlFormat")
                            {
                                XMLTagReader xMLTagReader = mashupParseContext.NewTagReader("VEUrlFormat");
                                formatString     = mashupParseContext.GetRequiredAttribute("FormatString");
                                generationNumber = mashupParseContext.GetRequiredAttributeInt("GenerationNumber");
                                xMLTagReader.SkipAllSubTags();
                                break;
                            }
                        }

                        mashupParseContext.Dispose();
                    }
                }
            }
            catch (Exception ex)
            {
                D.Sayf(0, "VEUrlFormat fetch failed with unexpected {0}", new object[] { ex });
            }
        }
Ejemplo n.º 10
0
		private void TryOneFetchFormatString()
		{
			try
			{
				HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(BuildConfig.theConfig.veFormatUpdateURL);
				httpWebRequest.Timeout = 5000;
				HttpWebResponse httpWebResponse;
				try
				{
					httpWebResponse = (HttpWebResponse)httpWebRequest.GetResponse();
				}
				catch (WebException)
				{
					return;
				}
				if (httpWebResponse.StatusCode == HttpStatusCode.OK)
				{
					Stream responseStream = httpWebResponse.GetResponseStream();
					XmlTextReader reader = new XmlTextReader(responseStream);
					MashupParseContext mashupParseContext = new MashupParseContext(reader);
					using (mashupParseContext)
					{
						while (mashupParseContext.reader.Read())
						{
							if (mashupParseContext.reader.NodeType == XmlNodeType.Element && mashupParseContext.reader.Name == "VEUrlFormat")
							{
								XMLTagReader xMLTagReader = mashupParseContext.NewTagReader("VEUrlFormat");
								this.formatString = mashupParseContext.GetRequiredAttribute("FormatString");
								this.generationNumber = mashupParseContext.GetRequiredAttributeInt("GenerationNumber");
								xMLTagReader.SkipAllSubTags();
								break;
							}
						}
						mashupParseContext.Dispose();
					}
				}
			}
			catch (Exception ex)
			{
				D.Sayf(0, "VEUrlFormat fetch failed with unexpected {0}", new object[]
				{
					ex
				});
			}
		}
Ejemplo n.º 11
0
		public FadeOptions(MashupParseContext context, DirtyEvent dirty)
		{
			this.dirty = dirty;
			XMLTagReader xMLTagReader = context.NewTagReader("FadeOptions");
			this._fadeBase = FadeOptions.FadeRange.Parse(context, "DefaultValue");
			while (xMLTagReader.FindNextStartTag())
			{
				if (xMLTagReader.TagIs("FadeAtZoom"))
				{
					XMLTagReader xMLTagReader2 = context.NewTagReader("FadeAtZoom");
					int requiredAttributeInt = context.GetRequiredAttributeInt("ZoomLevel");
					double value = FadeOptions.FadeRange.Parse(context, "FadeValue");
					if (this._zoomToFadeMap.ContainsKey(requiredAttributeInt))
					{
						throw new InvalidMashupFile(context, string.Format("Fade specified twice for zoom level {0}", requiredAttributeInt));
					}
					this._zoomToFadeMap[requiredAttributeInt] = value;
					xMLTagReader2.SkipAllSubTags();
				}
			}
		}
Ejemplo n.º 12
0
        public FadeOptions(MashupParseContext context, DirtyEvent dirty)
        {
            this.dirty = dirty;
            XMLTagReader xMLTagReader = context.NewTagReader("FadeOptions");

            this._fadeBase = FadeOptions.FadeRange.Parse(context, "DefaultValue");
            while (xMLTagReader.FindNextStartTag())
            {
                if (xMLTagReader.TagIs("FadeAtZoom"))
                {
                    XMLTagReader xMLTagReader2        = context.NewTagReader("FadeAtZoom");
                    int          requiredAttributeInt = context.GetRequiredAttributeInt("ZoomLevel");
                    double       value = FadeOptions.FadeRange.Parse(context, "FadeValue");
                    if (this._zoomToFadeMap.ContainsKey(requiredAttributeInt))
                    {
                        throw new InvalidMashupFile(context, string.Format("Fade specified twice for zoom level {0}", requiredAttributeInt));
                    }
                    this._zoomToFadeMap[requiredAttributeInt] = value;
                    xMLTagReader2.SkipAllSubTags();
                }
            }
        }