コード例 #1
0
        FilterExpression CreateFilter()
        {
            FilterExpression fExpr = null;

            if (valueExpressionType.SelectedItem == null)
            {
                return(null);
            }
            var tp = ((KeyValuePair <odm.ui.controls.FilterExpression.ftype, string>)valueExpressionType.SelectedItem).Key;

            XmlSerializerNamespaces nspaces = new XmlSerializerNamespaces();

            PrefixList.ForEach(p => {
                nspaces.Add(p.Prefix, p.Space);
            });

            switch (tp)
            {
            case FilterExpression.ftype.CONTENT:
                var confiltr = new global::onvif.services.MessageContentFilter();
                confiltr.expression = ExpressionValue;
                if (valueExpressionDialect.SelectedValue != null)
                {
                    confiltr.dialect = ((KeyValuePair <string, string>)valueExpressionDialect.SelectedValue).Key;
                }
                confiltr.namespaces = nspaces;
                fExpr = ContentFilterExpression.CreateFilter(confiltr);
                break;

            default:
                var topfiltr = new global::onvif.services.TopicExpressionFilter();
                topfiltr.expression = ExpressionValue;
                if (valueExpressionDialect.SelectedValue != null)
                {
                    topfiltr.dialect = ((KeyValuePair <string, string>)valueExpressionDialect.SelectedValue).Key;
                }
                topfiltr.namespaces = nspaces;
                fExpr = TopicFilterExpression.CreateFilter(topfiltr);
                break;
            }

            return(fExpr);
        }
コード例 #2
0
        FilterExpression CreateFilter()
        {
            FilterExpression fExpr = null;

            if (valueExpressionType.SelectedItem == null)
            {
                return(null);
            }
            var typeDialect = (TypeDialectPair)valueExpressionType.SelectedItem;


            XmlSerializerNamespaces nspaces = new XmlSerializerNamespaces();

            PrefixList.ForEach(p => {
                nspaces.Add(p.Prefix, p.Space);
            });

            switch (typeDialect.tp)
            {
            case FilterExpression.ftype.CONTENT:
                var confiltr = new global::onvif.services.MessageContentFilter();
                confiltr.expression = ExpressionValue;
                confiltr.dialect    = typeDialect.dialect;
                confiltr.namespaces = nspaces;
                fExpr = ContentFilterExpression.CreateFilter(confiltr);
                break;

            default:
                var topfiltr = new global::onvif.services.TopicExpressionFilter();
                topfiltr.expression = ExpressionValue;
                topfiltr.dialect    = typeDialect.dialect;
                topfiltr.namespaces = nspaces;
                fExpr = TopicFilterExpression.CreateFilter(topfiltr);
                break;
            }

            return(fExpr);
        }
コード例 #3
0
		FilterExpression CreateFilter() {
			FilterExpression fExpr = null;

			if (valueExpressionType.SelectedItem == null)
				return null;
			var typeDialect = (TypeDialectPair)valueExpressionType.SelectedItem;
			

			XmlSerializerNamespaces nspaces = new XmlSerializerNamespaces();
			PrefixList.ForEach(p => {
				nspaces.Add(p.Prefix, p.Space);
			});

			switch (typeDialect.tp) {
				case FilterExpression.ftype.CONTENT:
					var confiltr = new global::onvif.services.MessageContentFilter();
					confiltr.expression = ExpressionValue;
					confiltr.dialect = typeDialect.dialect;
					confiltr.namespaces = nspaces;
					fExpr = ContentFilterExpression.CreateFilter(confiltr);
					break;
				default:
					var topfiltr = new global::onvif.services.TopicExpressionFilter();
					topfiltr.expression = ExpressionValue;
					topfiltr.dialect = typeDialect.dialect;
					topfiltr.namespaces = nspaces;
					fExpr = TopicFilterExpression.CreateFilter(topfiltr);
					break;
			}

			return fExpr;
		}
コード例 #4
0
		FilterExpression CreateFilter() {
			FilterExpression fExpr = null;

			if (valueExpressionType.SelectedItem == null)
				return null;
			var tp = ((KeyValuePair<odm.ui.controls.FilterExpression.ftype, string>)valueExpressionType.SelectedItem).Key;
			
			XmlSerializerNamespaces nspaces = new XmlSerializerNamespaces();
			PrefixList.ForEach(p => {
				nspaces.Add(p.Prefix, p.Space);
			});
			
			switch (tp) { 
				case FilterExpression.ftype.CONTENT:
					var confiltr = new global::onvif.services.MessageContentFilter();
					confiltr.expression = ExpressionValue;
					if(valueExpressionDialect.SelectedValue!=null)
						confiltr.dialect = ((KeyValuePair<string, string>)valueExpressionDialect.SelectedValue).Key;
					confiltr.namespaces = nspaces;
					fExpr = ContentFilterExpression.CreateFilter(confiltr);
					break;
				default:
					var topfiltr = new global::onvif.services.TopicExpressionFilter();
					topfiltr.expression = ExpressionValue;
					if (valueExpressionDialect.SelectedValue != null)
						topfiltr.dialect = ((KeyValuePair<string,string>)valueExpressionDialect.SelectedValue).Key;
					topfiltr.namespaces = nspaces;
					fExpr = TopicFilterExpression.CreateFilter(topfiltr);
					break;
			}

			return fExpr;
		}