public AttributeLayout GetAttributeLayout() { if (Prefix == "xmlns" || LocalName == "xmlns") { if (Value.StartsWith("http://schemas.microsoft.com")) { return(AttributeLayout.XmlnsMicrosoft); } if (Value.StartsWith("clr")) { return(AttributeLayout.XmlnsWithClr); } return(AttributeLayout.Xmlns); } if (Prefix == "x") { return(AttributeLayout.X); } if (Prefix != null) { return(AttributeLayout.WithPrefix); } if (LocalName.Contains(".")) { return(AttributeLayout.Attached); } if (AttributeComparrer.SpecialOrder.Contains(LocalName)) { return(AttributeLayout.SpecialOrder); } return(AttributeLayout.ByName); }
private void InitializeForCountyAdmin() { DialogCredentialMessage.InnerHtml = "Your sign-in credentials allow only " + Counties.GetFullName(_SecureAdminPage.StateCode, _SecureAdminPage.CountyCode) + " local districts to be selected."; StateName.InnerHtml = States.GetName(_SecureAdminPage.StateCode); StateDropDownList.AddCssClasses("hidden"); StateRadioButton.AddCssClasses("invisible"); CountyName.InnerHtml = Counties.GetName(_SecureAdminPage.StateCode, _SecureAdminPage.CountyCode); CountyDropDownList.AddCssClasses("hidden"); LocalName.AddCssClasses("hidden"); switch (_SecureAdminPage.AdminPageLevel) { case AdminPageLevel.County: CountyRadioButton.Checked = true; PopulateLocalDropDown(true); break; case AdminPageLevel.Local: LocalRadioButton.Checked = true; PopulateLocalDropDown(); break; } }
private static IEnumerable <T> GetReferences <T>(XDocument document, LocalName localName, Func <XElement, T> convertFunc) where T : ReferenceBase { var refrences = document.ElementsBy(localName); var result = refrences.Select(convertFunc); return(result); }
/// <summary> /// Sobre escritura del método equals /// </summary> /// <param name="obj">Objeto a comparar</param> /// <returns></returns> public override bool Equals(object obj) { if (!(obj is Measure) || obj == null) { return(false); } if (this == obj) { return(true); } Measure measureAComparar = (Measure)obj; if (Namespace == null && measureAComparar.Namespace == null && LocalName == null && measureAComparar.LocalName == null) { return(true); } if ((Namespace == null && measureAComparar.Namespace != null) || (Namespace != null && measureAComparar.Namespace == null)) { return(false); } if ((LocalName == null && measureAComparar.LocalName != null) || (LocalName != null && measureAComparar.LocalName == null)) { return(false); } return(Namespace.Equals(measureAComparar.Namespace) && LocalName.Equals(measureAComparar.LocalName)); }
public void TransformBatchContentWithEnvironmentTagAndPartition() { var setup = Given( input => input .Message(EnvelopeFactory.Create <Envelope>().AsStream()) .Message(MessageBodyFactory.Create <Batch.Content>(MessageBody.Samples.LoadString("Message.BatchContentWithEnvironmentTagAndPartition.xml")).AsStream())) .Transform .OutputsXml( output => output .ConformingTo <Envelope>() .ConformingTo <Batch.Release>() .WithStrictConformanceLevel()); var result = setup.Validate(); result.NamespaceManager.AddNamespace("env", SchemaMetadata.For <Envelope>().TargetNamespace); result.NamespaceManager.AddNamespace("tns", SchemaMetadata.For <Batch.Release>().TargetNamespace); result.SelectSingleNode("/*") !.LocalName.Should().Be("Envelope"); result.Select("/env:Envelope/tns:ReleaseBatch").Cast <object>().Should().HaveCount(3); result.Select("/env:Envelope/*").Cast <object>().Should().HaveCount(3); var part = result.SelectSingleNode("/env:Envelope/tns:ReleaseBatch[3]"); part !.SelectSingleNode("tns:EnvelopeSpecName") !.Value.Should().Be(SchemaMetadata.For <Batch.Release>().DocumentSpec.DocSpecName); part !.SelectSingleNode("tns:EnvironmentTag") !.Value.Should().Be("graffiti"); part !.SelectSingleNode("tns:Partition") !.Value.Should().Be("A"); }
public bool IsEmptyData() { bool isEmpty = false; if (Name.Equals(DEFAULT_NAME)) { if (Uuid.Equals(DEFAULT_UUID)) { if (Rssi == DEFAULT_RSSI) { if (Status.Equals(DEFAULT_STATUS)) { if (LocalName.Equals(DEFAULT_LOCAL_NAME)) { if (Connectable.Equals(DEFAULT_CONNECTABLE)) { isEmpty = true; } } } } } } return(isEmpty); }
/// /// <summary> * if this is a new layout, return the partition key signaturename else return Signature/@Name of this or its /// * appropriate parent /// * </summary> /// * <returns> the name of the signature </returns> /// public override string getSignatureName() { if (LocalName.Equals(ElementName.SIGNATURE)) { return(getName()); } if (LocalName.Equals(ElementName.SHEET)) { KElement parentNode = getParentNode_KElement(); if (parentNode is JDFSignature) { JDFSignature sig = (JDFSignature)parentNode; return(sig.getSignatureName()); } } else if (LocalName.Equals(ElementName.SURFACE)) { KElement parentNode = getParentNode_KElement().getParentNode_KElement(); if (parentNode is JDFSignature) { JDFSignature sig = (JDFSignature)parentNode; return(sig.getSignatureName()); } } return(base.getSignatureName()); }
// FDG ***** DO override GetHashCode whenever you override Equals. /// <summary> /// Gets the hash code for this instance of an OpenXmlAttribute structure. /// </summary> /// <returns>The hash code for this instance of an OpenXmlAttribute structure.</returns> public override int GetHashCode() { int hashCode = 0; if (LocalName != null) { hashCode ^= LocalName.GetHashCode(); } if (NamespaceUri != null) { hashCode ^= NamespaceUri.GetHashCode(); } if (Prefix != null) { hashCode ^= Prefix.GetHashCode(); } if (Value != null) { hashCode ^= Value.GetHashCode(); } return(hashCode); }
private void InitializeForStateAdmin() { DialogCredentialMessage.InnerHtml = "Your sign-in credentials allow any " + States.GetName(_SecureAdminPage.StateCode) + " jurisdiction to be selected."; StateName.InnerHtml = States.GetName(_SecureAdminPage.StateCode); StateDropDownList.AddCssClasses("hidden"); CountyName.AddCssClasses("hidden"); switch (_SecureAdminPage.AdminPageLevel) { case AdminPageLevel.State: StateRadioButton.Checked = true; LocalRadioButton.Disabled = true; PopulateCountyDropDown(true); LocalDropDownList.AddCssClasses("hidden"); break; case AdminPageLevel.County: CountyRadioButton.Checked = true; PopulateCountyDropDown(); PopulateLocalDropDown(true); LocalName.AddCssClasses("hidden"); break; case AdminPageLevel.Local: LocalRadioButton.Checked = true; PopulateCountyDropDown(); PopulateLocalDropDown(); LocalName.AddCssClasses("hidden"); break; } }
public override int GetHashCode() { var d = LocalName?.GetHashCode() ?? 1; var id = Value?.GetHashCode() ?? 0; return(d + id); }
public override int GetHashCode() { unchecked { var result = 1000000009 * LocalName.GetHashCode(); result += 1000000021 * Namespace.GetHashCode(); return(result); } }
/// <summary> /// Returns the hash code for this instance. /// </summary> /// <returns> /// A 32-bit signed integer hash code. /// </returns> public override int GetHashCode() { unchecked { return (((LocalName?.GetHashCode() ?? 0) * 397) ^ (Namespace != null ? Namespace.GetHashCode() : 0)); } }
/// <summary></summary> public override int GetHashCode() { if (FullNamespace == null) { return(LocalName.GetHashCode()); } return(LocalName.GetHashCode() ^ FullNamespace.GetHashCode()); }
public static XElement ElementBy(this XContainer container, LocalName localName) { Contract.Requires(container.IsNotNull()); Contract.Requires(localName.IsNotNull()); var element = container.ElementsBy(localName).FirstOrDefault(); return(element); }
public async Task <ActionResult> DrawingPdf(string projectName, string hash, int index, string token = null) { string localFileName = await _userResolver.EnsureLocalFile(projectName, LocalName.DrawingPdf(index), hash); return(new PhysicalFileResult(localFileName, "application/pdf") { FileDownloadName = LocalName.DrawingPdf(index) }); }
public static IEnumerable <XElement> ElementsBy(this XContainer container, LocalName localName) { Contract.Requires(container.IsNotNull()); Contract.Requires(localName.IsNotNull()); var elements = container.Descendants().Where(item => item.Name.LocalName.Equals(localName.Value)); return(elements); }
public override object ProvideValue(IServiceProvider serviceProvider) { var targetProvider = (IProvideValueTarget) serviceProvider.GetService(typeof(IProvideValueTarget)); var target = (FrameworkElement)targetProvider.TargetObject; string name = LocalName.GetBaseName(target); if (_qualifier != null) { name += _qualifier; } return name; }
private void InitializeForMaster() { DialogCredentialMessage.InnerHtml = "Your sign-in credentials permit any jurisdiction to be selected."; StateName.AddCssClasses("hidden"); switch (_SecureAdminPage.AdminPageLevel) { case AdminPageLevel.President: case AdminPageLevel.PresidentTemplate: case AdminPageLevel.Federal: StateRadioButton.Checked = true; CountyRadioButton.Disabled = true; LocalRadioButton.Disabled = true; PopulateStateDropDown(); CountyDropDownList.AddCssClasses("hidden"); LocalDropDownList.AddCssClasses("hidden"); break; case AdminPageLevel.State: StateRadioButton.Checked = true; LocalRadioButton.Disabled = true; PopulateStateDropDown(); PopulateCountyDropDown(true); CountyName.AddCssClasses("hidden"); LocalDropDownList.AddCssClasses("hidden"); break; case AdminPageLevel.County: CountyRadioButton.Checked = true; PopulateStateDropDown(); PopulateCountyDropDown(); CountyName.AddCssClasses("hidden"); PopulateLocalDropDown(true); LocalName.AddCssClasses("hidden"); break; case AdminPageLevel.Local: LocalRadioButton.Checked = true; PopulateStateDropDown(); PopulateCountyDropDown(); PopulateLocalDropDown(); CountyName.AddCssClasses("hidden"); LocalName.AddCssClasses("hidden"); break; case AdminPageLevel.Unknown: StateRadioButton.Checked = true; CountyRadioButton.Disabled = true; LocalRadioButton.Disabled = true; PopulateStateDropDown(true); CountyDropDownList.AddCssClasses("hidden"); LocalDropDownList.AddCssClasses("hidden"); break; } }
public override int GetHashCode() { unchecked { var hashCode = (SourceName != null ? SourceName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LocalName != null ? LocalName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Path != null ? Path.GetHashCode() : 0); return(hashCode); } }
protected internal override AttributeInfo getTheAttributeInfo() { AttributeInfo ai = base.getTheAttributeInfo(); if (LocalName.Equals(ElementName.SURFACE)) { ai.updateReplace(atrInfoTable); } return(ai); }
/// <summary> /// Asserts that the name of the element is among specified element names. /// </summary> /// <param name="allowedNames">The allowed names.</param> public void AssertName(params string[] allowedNames) { foreach (var en in allowedNames) { if (LocalName.Equals(en, StringComparison.OrdinalIgnoreCase)) { return; } } throw new InvalidOperationException("Assertion failed. Expected element name '" + string.Join("|", allowedNames) + "', actual: '" + LocalName + "'."); }
public override bool init() { bool bRet = base.init(); if (LocalName.Equals(ElementName.SIGNATURE)) // signatures are // resource elements // only!, no class { removeAttribute(AttributeName.CLASS); } return(bRet); }
/// /// <summary> * init this comment by adding agentname, agentversion and id /// * </summary> /// * <returns> boolean </returns> /// public override bool init() { EnumVersion v = getVersion(true); if (v.getValue() >= EnumVersion.Version_1_3.getValue() && LocalName.Equals(ElementName.COMMENT)) { appendAnchor(null); setAgentName(JDFAudit.getStaticAgentName()); setAgentVersion(JDFAudit.getStaticAgentVersion()); } return(base.init()); }
/// /// <summary> * if this is a new layout, return the partition key signaturename else /// * return Signature/@Name of this or its appropriate parent /// * </summary> /// * <returns> the name of the signature </returns> /// public override string getSheetName() { if (LocalName.Equals(ElementName.SHEET)) { return(getName()); } if (LocalName.Equals(ElementName.SURFACE)) { JDFSheet sh = (JDFSheet)getParentNode_KElement(); return(sh.getSheetName()); } return(base.getSheetName()); }
public static IParsingResultExtended Parse(ParsingContext context) { RewindState rewind = context.RewindState; IParsingResultExtended name = NestedName.Parse(context); if (name != null) { return(name); } name = UnscopedName.Parse(context); if (name != null) { if (context.Parser.Peek == 'I') { context.SubstitutionTable.Add(name); TemplateArgs args = TemplateArgs.Parse(context); if (args == null) { context.Rewind(rewind); return(null); } return(new UnscopedTemplate(name, args)); } else { return(name); } } name = UnscopedTemplateName.Parse(context); if (name != null) { TemplateArgs args = TemplateArgs.Parse(context); if (args == null) { context.Rewind(rewind); return(null); } return(new UnscopedTemplate(name, args)); } return(LocalName.Parse(context)); }
public override int GetHashCode() { var hashCode = 17; unchecked { hashCode = 31 * hashCode + LocalName.GetHashCode(); if (NamespaceUri != null) { hashCode = 31 * hashCode + NamespaceUri.GetHashCode(); } } return(hashCode); }
private void OnRequestNameexibition(IGameEvent e) { StandardSendGameEvent ssge = (StandardSendGameEvent)e; if (ssge.MyObject.Length < 3) { LocalName.RequestLocalNameExibition((string)ssge.MyObject[0], (bool)ssge.MyObject[1]); } else if (ssge.MyObject.Length == 3) { LocalName.RequestLocalNameExibition((string)ssge.MyObject[0], (bool)ssge.MyObject[1], (float)ssge.MyObject[2]); } else if (ssge.MyObject.Length == 4) { LocalName.RequestLocalNameExibition((string)ssge.MyObject[0], (bool)ssge.MyObject[1], (float)ssge.MyObject[2], (float)ssge.MyObject[3]); } }
public int CompareTo(object obj) { if (obj == null) { throw new ArgumentNullException("obj"); } ReferenceName name = obj as ReferenceName; if (name == null) { throw new ArgumentOutOfRangeException("obj", obj, "Can only be compared to ReferenceName"); } int ret = SubSystem.CompareTo(name.SubSystem); return(ret != 0 ? ret : LocalName.CompareTo(name.SubSystem)); }
public XamlName(string localName, string namespaceName = null) { this.LocalName = localName ?? String.Empty; this.NamespaceName = namespaceName ?? String.Empty; int typeSeparatorIndex = LocalName.IndexOf('.'); if (typeSeparatorIndex != -1) { MemberName = LocalName.Substring(typeSeparatorIndex + 1); ContainingTypeName = new XamlName(LocalName.Substring(0, typeSeparatorIndex), NamespaceName); IsMemberName = true; } else { MemberName = LocalName; } }
/// /// <summary> * version fixing routine for JDF /// * /// * uses heuristics to modify this element and its children to be compatible with a given version<br> /// * in general, it will be able to move from low to high versions but potentially fail when attempting to move from /// * higher to lower versions /// * </summary> /// * <param name="version"> version that the resulting element should correspond to </param> /// * <returns> true if successful </returns> /// public override bool fixVersion(EnumVersion version) { if (version != null) { if (version.getValue() >= EnumVersion.Version_1_3.getValue() && LocalName.Equals(ElementName.COMMENT)) { appendAnchor(null); } else { removeAttribute(AttributeName.ID); removeAttribute(AttributeName.AGENTNAME); removeAttribute(AttributeName.AGENTVERSION); removeAttribute(AttributeName.AUTHOR); removeAttribute(AttributeName.TIMESTAMP); } } return(base.fixVersion(version)); }