本文整理汇总了C#中System.Xml.XmlAttributeCollection类的典型用法代码示例。如果您正苦于以下问题:C# XmlAttributeCollection类的具体用法?C# XmlAttributeCollection怎么用?C# XmlAttributeCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlAttributeCollection类属于System.Xml命名空间,在下文中一共展示了XmlAttributeCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: SetValue
public void SetValue(XmlAttributeCollection inValue)
{
constructList.Add(new ItemConstruct());
// 构造函数
ItemConstruct construct = new ItemConstruct(new List<string>() { "System.String" });
construct.Struct.Statements.Add(Line("string[] ss", "inArg0.Split(\'^\')"));
classer.CustomAttributes.Add(new CodeAttributeDeclaration("ProtoContract"));
for (int i = 0; i < inValue.Count; i++)
{
fieldList.Add(new ItemField(inValue[i].Name, inValue[i].Value, MemberAttributes.Private));
ItemProperty item = new ItemProperty(inValue[i].Name);
item.SetGetName();
item.SetSetName();
item.SetValueType(inValue[i].Value);
item.SetModifier(MemberAttributes.Public | MemberAttributes.Final);
item.SetField("ProtoMember", (i + 1).ToString());
propertyList.Add(item);
Type t = Stringer.ToType(inValue[i].Value);
string right = t == typeof(System.String) ? "ss[" + i + "]" :
t == typeof(System.UInt32) ? "uint.Parse(ss[" + i + "])" :
t == typeof(System.Single) ? "float.Parse(ss[" + i + "])" : "new " + t.ToString() + "(inValues[" + i + "])";
construct.Struct.Statements.Add(Line("_" + Stringer.FirstLetterLower(inValue[i].Name), right));
}
constructList.Add(construct);
Create();
}
开发者ID:killliu,项目名称:AutoCSharp,代码行数:31,代码来源:XmlToCSharp.cs
示例2: CreateFromXML
public static void CreateFromXML(Scene scene, XmlAttributeCollection attributes)
{
int playerNumber = attributes.Int("player", 0);
Session playerSession;
Color color = Color.None;
if (playerNumber == 0)
{
playerSession = Global.PlayerOneSession;
color = Color.White;
}
else if (playerNumber == 1)
{
playerSession = Global.PlayerTwoSession;
color = Color.Yellow;
}
else if (playerNumber == 2)
{
playerSession = Global.PlayerThreeSession;
color = Color.Blue;
}
else
{
playerSession = Global.PlayerFourSession;
color = Color.Grey;
}
Bomberman player = new Bomberman(playerSession, color);
player.SetPosition(attributes.Int("x", 0), attributes.Int("y", 0));
scene.Add(player);
}
开发者ID:patHyatt,项目名称:Frenemey,代码行数:34,代码来源:Bomberman.cs
示例3: SetProperties
internal static void SetProperties(Object instance, XmlAttributeCollection attrs) {
// This is called from both XSD and XDR schemas.
// Do we realy need it in XSD ???
for (int i = 0; i < attrs.Count; i++) {
if (attrs[i].NamespaceURI == Keywords.MSDNS) {
string name = attrs[i].LocalName;
string value = attrs[i].Value;
if (name == "DefaultValue" || name == "RemotingFormat")
continue;
// Webdata 97925, skipp expressions, we will handle them after SetProperties (in xdrschema)
if (name == "Expression" && instance is DataColumn)
continue;
PropertyDescriptor pd = TypeDescriptor.GetProperties(instance)[name];
if (pd != null) {
// Standard property
Type type = pd.PropertyType;
TypeConverter converter = XMLSchema.GetConverter(type);
object propValue;
if (converter.CanConvertFrom(typeof(string))) {
propValue = converter.ConvertFromString(value);
}else if (type == typeof(Type)) {
propValue = DataStorage.GetType(value);
}else if (type == typeof(CultureInfo)) {
propValue = new CultureInfo(value);
}else {
throw ExceptionBuilder.CannotConvert(value,type.FullName);
}
pd.SetValue(instance, propValue);
}
}
}
}// SetProperties
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:35,代码来源:XMLSchema.cs
示例4: GatewayProvider
public GatewayProvider(XmlAttributeCollection attributes)
{
if (attributes == null)
{
throw new ArgumentNullException("attributes");
}
this.name = attributes["name"].Value.ToLower();
this.requestType = attributes["requestType"].Value;
this.notifyType = attributes["notifyType"].Value;
this.displayName = attributes["displayName"].Value;
string[] strArray = attributes["supportedCurrency"].Value.Split(new char[] { ',' });
this.supportedCurrencys = new List<string>();
foreach (string str in strArray)
{
this.supportedCurrencys.Add(str);
}
this.providerAttributes = new NameValueCollection();
foreach (XmlAttribute attribute in attributes)
{
if ((((attribute.Name != "name") && (attribute.Name != "displayName")) && ((attribute.Name != "requestType") && (attribute.Name != "notifyType"))) && (attribute.Name != "supportedCurrency"))
{
this.providerAttributes.Add(attribute.Name, attribute.Value);
}
}
}
开发者ID:huaminglee,项目名称:myyyyshop,代码行数:25,代码来源:GatewayProvider.cs
示例5: ReceiveStep
/// <summary>
/// Initializes a new instance of the ReceiveStep class
/// </summary>
/// <param name="attributes">Xml attributes from the BPEL file</param>
public ReceiveStep(XmlAttributeCollection attributes)
{
if (attributes != null)
{
foreach (XmlAttribute attrib in attributes)
{
if (attrib.LocalName == "name")
{
StepId = attrib.Value;
}
else if (attrib.LocalName == "variable")
{
this.variableName = attrib.Value;
}
}
}
if (this.variableName.Equals("subWorkflowComplete", StringComparison.OrdinalIgnoreCase))
{
}
else
{
// message name so use variableName in search criteria
this._messageName = this.variableName;
}
}
开发者ID:snbbgyth,项目名称:WorkFlowEngine,代码行数:32,代码来源:ReceiveStep.cs
示例6: Rectangle
public Rectangle(XmlAttributeCollection fontAttrs, XmlAttributeCollection rectAttrs)
{
this._rectangleAttrs = rectAttrs;
FontAttributes = fontAttrs;
init();
}
开发者ID:cedricmartel,项目名称:PdfTemplate,代码行数:7,代码来源:Rectangle.cs
示例7: AttributeValue
public static String AttributeValue( XmlAttributeCollection attrs, String name )
{
XmlNode n = attrs[name];
if( n != null )
return n.Value;
return null;
}
开发者ID:naeemy,项目名称:zimbra-sources,代码行数:7,代码来源:XmlUtil.cs
示例8: DefaultCustomElement
/// <summary>
/// Constructor
/// </summary>
/// <param name="fontAttrs"></param>
/// <param name="elementAttrs"></param>
/// <param name="vars"></param>
public DefaultCustomElement( XmlAttributeCollection fontAttrs, XmlAttributeCollection elementAttrs, List<Variable> vars):base(fontAttrs, elementAttrs, vars)
{
// FontAttributes = fontAttrs;
// // this._elementAttrs = elementAttrs;
// base.Attributes = elementAttrs;
// base.Vars = vars;
}
开发者ID:cedricmartel,项目名称:PdfTemplate,代码行数:13,代码来源:DefaultCustomElement.cs
示例9: InvokeStep
/// <summary>
/// Initializes a new instance of the InvokeStep class
/// </summary>
/// <param name="attributes">Xml attributes from the BPEL file
/// when invoking execution of workflow activities</param>
public InvokeStep(XmlAttributeCollection attributes)
{
InvokeContext = new InvokeContextModel();
// this.type = InvokeType.Unknown;
foreach (XmlAttribute attrib in attributes)
{
switch (attrib.LocalName.ToLower())
{
case "operation":
InvokeContext.Operation = attrib.Value;
break;
case "name":
InvokeContext.Name = attrib.Value;
StepId = attrib.Value;
break;
case "partnerlink":
InvokeContext.PartnerLink = attrib.Value;
break;
case "porttype":
InvokeContext.PortType = attrib.Value;
break;
case "inputvariable":
InvokeContext.InputVariable = attrib.Value;
break;
default:
break;
}
}
}
开发者ID:snbbgyth,项目名称:WorkFlowEngine,代码行数:35,代码来源:InvokeStep.cs
示例10: IsEqual
private static bool IsEqual(XmlAttributeCollection left, XmlAttributeCollection right)
{
if (left == null)
{
return right == null;
}
if (right == null)
{
return false;
}
if (left.Count != right.Count)
{
return false;
}
foreach (XmlAttribute attr in left)
{
var rightAttrNode = right.GetNamedItem(attr.Name);
if (rightAttrNode == null)
{
return false;
}
if ((rightAttrNode as XmlAttribute).Value != attr.Value)
{
return false;
}
}
return true;
}
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:34,代码来源:XHTMLComparator.cs
示例11: CEntityTransition
public CEntityTransition(CMap map, XmlAttributeCollection attributes, XmlNodeList properties)
{
m_map = map;
int l = Convert.ToInt16(attributes["x"].Value);
int t = Convert.ToInt16(attributes["y"].Value);
int w = Convert.ToInt16(attributes["width"].Value);
int h = Convert.ToInt16(attributes["height"].Value);
m_rect = new Rectangle(l, t, w, h);
foreach (XmlNode node in properties) {
switch (node.Attributes["name"].Value) {
case "Map":
newmap = node.InnerText.Trim();
break;
case "X":
newx = Convert.ToInt16(node.InnerText.Trim());
break;
case "Y":
newy = Convert.ToInt16(node.InnerText.Trim());
break;
}
}
map.Entities.AddLast(this);
}
开发者ID:kfdm,项目名称:murasaki,代码行数:25,代码来源:CEntityTransition.cs
示例12: PrepareHtmlClass
public PrepareHtmlClass(XmlAttributeCollection attributes, ref Dictionary<String, HtmlClass> liststylesheets, Dictionary<String, HtmlClass> listalreadystylesheets)
{
string csstext = string.Empty;
if (attributes["href"] != null)
{
string namefile = attributes["href"].Value;
if (namefile.StartsWith(@"https:/") || namefile.StartsWith(@"http:/"))
csstext = readcssfromnet(namefile);
else
{
//falta direfenciar si viene desde http, https, o sin dirección(solo el nombre o ruta del archivo)
}
if (csstext != string.Empty)
if (!liststylesheets.Keys.Contains(namefile))
{
if (listalreadystylesheets != null)
if (listalreadystylesheets.Keys.Contains(namefile))//style sheet has already been read before, no need to read it again
{
liststylesheets.Add(csstext, listalreadystylesheets[namefile]);
return;
}
HtmlClass css = new CssParser().Parser(csstext);
css.IdHtmlClass = namefile;
liststylesheets.Add(namefile, css);
}
}
}
开发者ID:adrianillo,项目名称:HtmlToPdf,代码行数:29,代码来源:PrepareHtmlClass.cs
示例13: OnEventStep
/// <summary>
/// Initializes a new instance of the OnMessageStep class
/// </summary>
/// <param name="attributes">Xml attributes from the BPEL file</param>
public OnEventStep(XmlAttributeCollection attributes)
{
// read attributes
foreach (XmlAttribute attrib in attributes)
{
switch (attrib.LocalName)
{
case "name":
StepId = attrib.Value;
break;
case "operation":
switch (attrib.Value)
{
case "messageTimeout":
// EventType = WorkflowEventType.Timeout;
break;
case "cancel":
// EventType = WorkflowEventType.Cancel;
break;
default:
// var ex = ErrorAndExceptionService.CreateLocutusException(this, "E67.01", null);
// throw ex;
return;
}
break;
case "variable":
if (string.IsNullOrEmpty(attrib.Value))
{
}
EventKey = attrib.Value;
break;
}
}
}
开发者ID:snbbgyth,项目名称:WorkFlowEngine,代码行数:39,代码来源:OnEventStep.cs
示例14: LinkBehavior
public LinkBehavior(XmlAttributeCollection collection)
: base(collection)
{
fileNode = null;
contextNode = null;
typeNode = null;
}
开发者ID:RaptorFactor,项目名称:Steam4NET,代码行数:7,代码来源:LinkBehavior.cs
示例15: AreEqualAttribs
public bool AreEqualAttribs (XmlAttributeCollection expected, XmlAttributeCollection actual)
{
if (expected.Count != actual.Count)
return false;
for (int i=0; i<expected.Count; i++) {
if ((flags & Flags.IgnoreAttribOrder) != 0) {
string ln = expected[i].LocalName;
string ns = expected[i].NamespaceURI;
string val = expected[i].Value;
_expected = ns+":"+ln+"="+val;
XmlAttribute atr2 = actual[ln, ns];
_actual = atr2 == null ? "<<missing>>" : ns + ":" + ln + "=" + atr2.Value;
if (atr2 == null || atr2.Value.Trim().ToLower() != val.Trim().ToLower())
return false;
} else {
if (expected [i].LocalName != actual [i].LocalName)
return false;
if (expected [i].NamespaceURI != actual [i].NamespaceURI)
return false;
if (expected [i].Value.Trim().ToLower() != actual [i].Value.Trim().ToLower())
return false;
}
}
return true;
}
开发者ID:nlhepler,项目名称:mono,代码行数:25,代码来源:XmlComparer.cs
示例16: BuildTableCell
private TableCell BuildTableCell(XmlNode node, XmlAttributeCollection fontAttrs)
{
TableCell tableCell = new TableCell(node.Attributes, fontAttrs);
BuildTableCellChildElement(tableCell, node, fontAttrs);
return tableCell;
}
开发者ID:cedricmartel,项目名称:PdfTemplate,代码行数:7,代码来源:TableGenerator.cs
示例17: UpdatePreservationInfo
internal void UpdatePreservationInfo(XmlAttributeCollection updatedAttributes, XmlFormatter formatter)
{
if (updatedAttributes.Count == 0)
{
if (this.orderedAttributes.Count <= 0)
return;
this.leadingSpaces.Clear();
this.orderedAttributes.Clear();
}
else
{
Dictionary<string, bool> dictionary = new Dictionary<string, bool>();
foreach (string index in this.orderedAttributes)
dictionary[index] = false;
foreach (XmlAttribute xmlAttribute in (XmlNamedNodeMap)updatedAttributes)
{
if (!dictionary.ContainsKey(xmlAttribute.Name))
this.orderedAttributes.Add(xmlAttribute.Name);
dictionary[xmlAttribute.Name] = true;
}
bool flag1 = true;
string str = (string)null;
foreach (string key in this.orderedAttributes)
{
bool flag2 = dictionary[key];
if (!flag2)
{
if (this.leadingSpaces.ContainsKey(key))
{
string space = this.leadingSpaces[key];
if (flag1)
{
if (str == null)
str = space;
}
else if (this.ContainsNewLine(space))
str = space;
this.leadingSpaces.Remove(key);
}
}
else if (str != null)
{
if (flag1 || !this.leadingSpaces.ContainsKey(key) || !this.ContainsNewLine(this.leadingSpaces[key]))
this.leadingSpaces[key] = str;
str = (string)null;
}
else if (!this.leadingSpaces.ContainsKey(key))
{
if (flag1)
this.leadingSpaces[key] = " ";
else if (this.OneAttributePerLine)
this.leadingSpaces[key] = this.GetAttributeNewLineString(formatter);
else
this.EnsureAttributeNewLineString(formatter);
}
flag1 = flag1 && !flag2;
}
}
}
开发者ID:micahlmartin,项目名称:XmlTransformer,代码行数:59,代码来源:XmlAttributePreservationDict.cs
示例18: Motherboard
public Motherboard(XmlAttributeCollection attributes)
{
Brand = attributes[0].InnerXml.ToString();
Size = attributes[1].InnerXml.ToString();
CPUSocket = attributes[2].InnerXml.ToString();
RAMType = attributes[3].InnerXml.ToString();
RAMSlots = int.Parse(attributes[4].InnerXml);
}
开发者ID:GabrielWilds,项目名称:JSLCode,代码行数:8,代码来源:Motherboard.cs
示例19: TestSuiteResult
public TestSuiteResult(XmlAttributeCollection attributes)
{
children = new List<ITestSuiteChildResult>();
name = attributes["name"].Value;
filename = attributes["file"].Value;
line = int.Parse(attributes["line"].Value);
}
开发者ID:edpack1980,项目名称:uml-auto-assessment,代码行数:8,代码来源:TestSuiteResult.cs
示例20: CreateFromXML
public static void CreateFromXML(Scene scene, XmlAttributeCollection attributes)
{
Brick brick = new Brick();
brick.SetPosition(attributes.Int("x", 0), attributes.Int("y", 0));
brick.Graphic = new Image("Assets/Images/grasses.png", new Rectangle(256, 0, Global.GridSize, Global.GridSize));
scene.Add(brick);
}
开发者ID:patHyatt,项目名称:Frenemey,代码行数:8,代码来源:Brick.cs
注:本文中的System.Xml.XmlAttributeCollection类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论