コード例 #1
0
        internal DeviceFilterNode(WebConfigManager webConfig) : base()
        {
            _webConfig = webConfig;
            _xmlNode   = webConfig.Document.CreateElement("filter");

            Name = SR.GetString(SR.DeviceFilterNode_DefaultFilterName);
            Mode = DeviceFilterMode.Compare;
        }
コード例 #2
0
        internal DeviceFilterNode(
            WebConfigManager webConfig,
            XmlNode xmlNode
            )
        {
            _webConfig = webConfig;
            _xmlNode   = xmlNode;

            Debug.Assert(_xmlNode.Attributes != null);

            if (_xmlNode.Attributes["type"] != null)
            {
                Mode = DeviceFilterMode.Delegate;
                Debug.Assert(
                    _xmlNode.Attributes["argument"] == null && _xmlNode.Attributes["compare"] == null,
                    "Managementobject contains both Compare and Delegate mode properties."
                    );
            }
            else
            {
                Mode = DeviceFilterMode.Compare;
                // we already know type is null, but it nevers hurts...
                Debug.Assert(
                    _xmlNode.Attributes["type"] == null && _xmlNode.Attributes["method"] == null,
                    "Managementobject contains both Compare and Delegate mode properties."
                    );
            }

            _name = _xmlNode.Attributes["name"] == null?
                    null : _xmlNode.Attributes["name"].Value;

            _compare = _xmlNode.Attributes["compare"] == null?
                       null : _xmlNode.Attributes["compare"].Value;

            _argument = _xmlNode.Attributes["argument"] == null?
                        null : _xmlNode.Attributes["argument"].Value;

            _type = _xmlNode.Attributes["type"] == null?
                    null : _xmlNode.Attributes["type"].Value;

            _method = _xmlNode.Attributes["method"] == null?
                      null : _xmlNode.Attributes["method"].Value;
        }
コード例 #3
0
        internal DeviceFilterNode(
            WebConfigManager webConfig,
            XmlNode xmlNode
        ) {
            _webConfig = webConfig;
            _xmlNode = xmlNode;

            Debug.Assert(_xmlNode.Attributes != null);

            if (_xmlNode.Attributes["type"] != null)
            {
                Mode = DeviceFilterMode.Delegate;
                Debug.Assert(
                    _xmlNode.Attributes["argument"] == null && _xmlNode.Attributes["compare"] == null,
                    "Managementobject contains both Compare and Delegate mode properties."
                );
            }
            else
            {
                Mode = DeviceFilterMode.Compare;
                // we already know type is null, but it nevers hurts...
                Debug.Assert(
                    _xmlNode.Attributes["type"] == null && _xmlNode.Attributes["method"] == null,
                    "Managementobject contains both Compare and Delegate mode properties."
                );
            }

            _name = _xmlNode.Attributes["name"] == null? 
                null : _xmlNode.Attributes["name"].Value;

            _compare = _xmlNode.Attributes["compare"] == null?
                null : _xmlNode.Attributes["compare"].Value;

            _argument = _xmlNode.Attributes["argument"] == null?
                null : _xmlNode.Attributes["argument"].Value;

            _type = _xmlNode.Attributes["type"] == null?
                null : _xmlNode.Attributes["type"].Value;

            _method = _xmlNode.Attributes["method"] == null?
                null : _xmlNode.Attributes["method"].Value;
        }
コード例 #4
0
        internal DeviceFilterNode(WebConfigManager webConfig) : base()
        {
            _webConfig = webConfig;
            _xmlNode = webConfig.Document.CreateElement("filter");

            Name = SR.GetString(SR.DeviceFilterNode_DefaultFilterName);
            Mode = DeviceFilterMode.Compare;
        }