当前位置: 首页>>代码示例>>C#>>正文


C# XmlElement.GetAttributeAsBoolean方法代码示例

本文整理汇总了C#中System.Xml.XmlElement.GetAttributeAsBoolean方法的典型用法代码示例。如果您正苦于以下问题:C# XmlElement.GetAttributeAsBoolean方法的具体用法?C# XmlElement.GetAttributeAsBoolean怎么用?C# XmlElement.GetAttributeAsBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlElement的用法示例。


在下文中一共展示了XmlElement.GetAttributeAsBoolean方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClassBase

        protected ClassBase (XmlElement ns, XmlElement elem) : base (ns, elem) {
                    
            deprecated = elem.GetAttributeAsBoolean ("deprecated");
            isabstract = elem.GetAttributeAsBoolean ("abstract");

            foreach (XmlNode node in elem.ChildNodes) {
                if (!(node is XmlElement)) continue;
                XmlElement member = (XmlElement) node;
                if (member.GetAttributeAsBoolean ("hidden"))
                    continue;
                
                string name;
                switch (node.Name) {
                case "method":
                    name = member.GetAttribute("name");
                    while (methods.ContainsKey(name))
                        name += "mangled";
                    methods.Add (name, new Method (member, this));
                    break;

                case "property":
                    name = member.GetAttribute("name");
                    while (props.ContainsKey(name))
                        name += "mangled";
                    props.Add (name, new Property (member, this));
                    break;

                case "field":
                    name = member.GetAttribute("name");
                    while (fields.ContainsKey (name))
                        name += "mangled";
                    fields.Add (name, new ObjectField (member, this));
                    break;

                case "implements":
                    ParseImplements (member);
                    break;

                case "constructor":
                    ctors.Add (new Ctor (member, this));
                    break;

                case "constant":
                    name = member.GetAttribute ("name");
                    constants.Add (name, new Constant (member));
                    break;

                default:
                    break;
                }
            }
        }
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:52,代码来源:ClassBase.cs

示例2: ReturnValue

 public ReturnValue(XmlElement elem)
 {
     if (elem != null) {
         is_null_term = elem.GetAttributeAsBoolean ("null_term_array");
         is_array = elem.GetAttributeAsBoolean ("array") || elem.HasAttribute ("array_length_param");
         array_length_param = elem.GetAttribute ("array_length_param");
         elements_owned = elem.GetAttributeAsBoolean ("elements_owned");
         owned = elem.GetAttributeAsBoolean ("owned");
         ctype = elem.GetAttribute("type");
         default_value = elem.GetAttribute ("default_value");
         element_ctype = elem.GetAttribute ("element_type");
     }
 }
开发者ID:CSRedRat,项目名称:gtk-sharp,代码行数:13,代码来源:ReturnValue.cs

示例3: Method

        public Method (XmlElement elem, ClassBase container_type) : base (elem, container_type)
        {
            this.retval = new ReturnValue (elem["return-type"]);
            
            if (!container_type.IsDeprecated) {
                deprecated = elem.GetAttributeAsBoolean ("deprecated");
            }
            
            win32_utf8_variant = elem.GetAttributeAsBoolean ("win32_utf8_variant");

            if (Name == "GetType")
                Name = "GetGType";
        }
开发者ID:arkydon,项目名称:gtk-sharp,代码行数:13,代码来源:Method.cs

示例4: Ctor

        public Ctor (XmlElement elem, ClassBase implementor) : base (elem, implementor)
        {
            preferred = elem.GetAttributeAsBoolean ("preferred");
            if (implementor is ObjectGen)
                needs_chaining = true;
            name = implementor.Name;
        }
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:7,代码来源:Ctor.cs

示例5: InterfaceGen

        public InterfaceGen (XmlElement ns, XmlElement elem) : base (ns, elem, true)
        {
            consume_only = elem.GetAttributeAsBoolean ("consume_only");
            foreach (XmlNode node in elem.ChildNodes) {
                if (!(node is XmlElement)) continue;
                XmlElement member = (XmlElement) node;

                switch (member.Name) {
                case "signal":
                    object sig = sigs [member.GetAttribute ("name")];
                    if (sig == null)
                        sig = new Signal (node as XmlElement, this);
                    break;
                default:
                    if (!base.IsNodeNameHandled (node.Name))
                        new LogWriter (QualifiedName).Warn ("Unexpected node " + node.Name);
                    break;
                }
            }
        }
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:20,代码来源:InterfaceGen.cs

示例6: MethodBase

        protected MethodBase (XmlElement elem, ClassBase container_type)
        {
            this.elem = elem;
            this.container_type = container_type;
            this.name = elem.GetAttribute ("name");
            parms = new Parameters (elem ["parameters"]);
            IsStatic = elem.GetAttribute ("shared") == "true";
            if (elem.GetAttributeAsBoolean ("new_flag"))
                mods = "new ";
            if (elem.HasAttribute ("accessibility")) {
                string attr = elem.GetAttribute ("accessibility");
                switch (attr) {
                    case "public":
                    case "protected":
                    case "internal":
                    case "private":
                    case "protected internal":
                        protection = attr;
                        break;
                }
            }
        }
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:22,代码来源:MethodBase.cs

示例7: AddVM

        VirtualMethod AddVM(XmlElement vm_elem, bool is_signal_vm, bool is_interface)
        {
            VirtualMethod vm;
            if (is_signal_vm)
                vm = new DefaultSignalHandler (vm_elem, this);
            else if (is_interface) {
                string target_name = vm_elem.HasAttribute ("target_method") ? vm_elem.GetAttribute ("target_method") : vm_elem.GetAttribute ("name");
                vm = new InterfaceVM (vm_elem, methods [target_name] as Method, this);
            } else
                vm = new GObjectVM (vm_elem, this);

            if (vm_elem.GetAttributeAsBoolean ("padding") || vm_elem.GetAttributeAsBoolean ("hidden"))
                hidden_vms.Add (vm);
            else {
                if (vm is GObjectVM)
                    virtual_methods.Add (vm);
                else
                    interface_vms.Add (vm);
            }
            if (vm.CName != "")
                class_members.Add (vm);

            return vm;
        }
开发者ID:CSRedRat,项目名称:gtk-sharp,代码行数:24,代码来源:ObjectBase.cs

示例8: ArrayParameter

 public ArrayParameter(XmlElement elem)
     : base(elem)
 {
     null_terminated = elem.GetAttributeAsBoolean ("null_term_array");
 }
开发者ID:CSRedRat,项目名称:gtk-sharp,代码行数:5,代码来源:Parameters.cs

示例9: ArrayParameter

        public ArrayParameter (XmlElement elem) : base (elem)
        {
            null_terminated = elem.GetAttributeAsBoolean ("null_term_array");
            if (elem.HasAttribute ("array_len"))
                FixedArrayLength = Int32.Parse (elem.GetAttribute ("array_len"));
        }
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:6,代码来源:ArrayParameter.cs


注:本文中的System.Xml.XmlElement.GetAttributeAsBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。