public string NameSpotId() { string result = ""; result = SpotName + "-Surf-Report" + "-" + SpotId.ToString(); return(result); }
WriteXML(XmlWriter writer) { if (writer == null) { throw new ArgumentNullException("writer"); } writer.WriteStartElement( XpsS0Markup.SignatureDefinition, XpsS0Markup.SignatureDefinitionNamespace ); //Spot ID, Signer Name and xml:lang are attributes of SignatureDefinition //Spot ID is required. If it is not specified, then we throw. if (SpotId != null) { writer.WriteAttributeString(XpsS0Markup.SpotId, XmlConvert.EncodeName(SpotId.ToString())); } else { throw new XpsPackagingException(SR.Get(SRID.ReachPackaging_SpotIDRequiredAttribute)); } if (RequestedSigner != null) { writer.WriteAttributeString(XpsS0Markup.RequestedSigner, RequestedSigner); } if (Culture != null) { XmlLanguage language = XmlLanguage.GetLanguage(Culture.Name); writer.WriteAttributeString(XpsS0Markup.XmlLang, language.ToString()); } //SpotLocation, Intent, Signby, and Signing Location are elements of SignatureDefinition if (SpotLocation != null) { writer.WriteStartElement(XpsS0Markup.SpotLocation); Uri pageUri = new Uri(SpotLocation.PageUri.GetComponents(UriComponents.SerializationInfoString, UriFormat.SafeUnescaped), UriKind.RelativeOrAbsolute); string pageUriAsString = pageUri.GetComponents(UriComponents.SerializationInfoString, UriFormat.UriEscaped); writer.WriteAttributeString(XpsS0Markup.PageUri, pageUriAsString); writer.WriteAttributeString(XpsS0Markup.StartX, SpotLocation.StartX.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteAttributeString(XpsS0Markup.StartY, SpotLocation.StartY.ToString(System.Globalization.CultureInfo.InvariantCulture)); writer.WriteEndElement(); } if (Intent != null) { writer.WriteStartElement(XpsS0Markup.Intent); writer.WriteString(Intent); writer.WriteEndElement(); } if (SignBy != null) { writer.WriteStartElement(XpsS0Markup.SignBy); writer.WriteString(((DateTime)SignBy).ToUniversalTime().ToString("s", DateTimeFormatInfo.InvariantInfo) + "Z"); writer.WriteEndElement(); } if (SigningLocale != null) { writer.WriteStartElement(XpsS0Markup.SigningLocale); writer.WriteString(SigningLocale); writer.WriteEndElement(); } // //Signature Definition // writer.WriteEndElement(); _hasBeenModified = false; }