當前位置: 首頁>>代碼示例>>C#>>正文


C# Compiler.AddQuery方法代碼示例

本文整理匯總了C#中System.Xml.Xsl.XsltOld.Compiler.AddQuery方法的典型用法代碼示例。如果您正苦於以下問題:C# Compiler.AddQuery方法的具體用法?C# Compiler.AddQuery怎麽用?C# Compiler.AddQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Xml.Xsl.XsltOld.Compiler的用法示例。


在下文中一共展示了Compiler.AddQuery方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler)
        {
            string name = compiler.Input.LocalName;
            string value = compiler.Input.Value;
            if (Ref.Equal(name, compiler.Atoms.Select))
            {
                _selectKey = compiler.AddQuery(value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Mode))
            {
                Debug.Assert(_mode == null);
                if (compiler.AllowBuiltInMode && value == "*")
                {
                    _mode = Compiler.BuiltInMode;
                }
                else
                {
                    _mode = compiler.CreateXPathQName(value);
                }
            }
            else
            {
                return false;
            }

            return true;
        }
開發者ID:Corillian,項目名稱:corefx,代碼行數:27,代碼來源:ApplyTemplatesAction.cs

示例2: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;

            if (Ref.Equal(name, compiler.Atoms.Match)) {
                Debug.Assert(this.matchKey == Compiler.InvalidQueryKey);
                this.matchKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey:*/true, /*pattern*/true);
            }
            else if (Ref.Equal(name, compiler.Atoms.Name)) {
                Debug.Assert(this.name == null);
                this.name = compiler.CreateXPathQName(value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Priority)) {
                Debug.Assert(Double.IsNaN(this.priority));
                this.priority = XmlConvert.ToXPathDouble(value);
                if (double.IsNaN(this.priority) && ! compiler.ForwardCompatibility) {
                    throw XsltException.Create(Res.Xslt_InvalidAttrValue, "priority", value);
                }
            }
            else if (Ref.Equal(name, compiler.Atoms.Mode)) {
                Debug.Assert(this.mode == null);
                if (compiler.AllowBuiltInMode && value == "*") {
                    this.mode = Compiler.BuiltInMode;
                }
                else {
                    this.mode = compiler.CreateXPathQName(value);
                }
            }
            else {
                return false;
            }

            return true;
        }
開發者ID:iskiselev,項目名稱:JSIL.NetFramework,代碼行數:34,代碼來源:TemplateAction.cs

示例3: CompileSingle

        internal virtual void CompileSingle(Compiler compiler)
        {
            _matchKey = compiler.AddQuery("/", /*allowVars:*/false, /*allowKey:*/true, /*pattern*/true);
            _priority = Compiler.RootPriority;

            CompileOnceTemplate(compiler);
        }
開發者ID:Corillian,項目名稱:corefx,代碼行數:7,代碼來源:TemplateAction.cs

示例4: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;
            if (Ref.Equal(name, compiler.Atoms.Select)) {
                this.selectKey = compiler.AddQuery(value);
            }
            else {
                return false;
            }

            return true;
        }
開發者ID:uQr,項目名稱:referencesource,代碼行數:12,代碼來源:CopyOfAction.cs

示例5: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler) {
            string name   = compiler.Input.LocalName;
            string value  = compiler.Input.Value;

            if (Keywords.Equals(name, compiler.Atoms.Select)) {
                this.selectKey = compiler.AddQuery(value);
            }
            else if (Keywords.Equals(name, compiler.Atoms.DisableOutputEscaping)) {
                this.disableOutputEscaping = compiler.GetYesNo(value);
            }
            else {
                return false;
            }

            return true;
        }
開發者ID:gbarnett,項目名稱:shared-source-cli-2.0,代碼行數:16,代碼來源:valueofaction.cs

示例6: AddSpace

 internal void AddSpace(Compiler compiler, String query, double Priority, bool PreserveSpace) {
     WhitespaceElement elem;
     if (this.queryKeyTable != null) {
         if (this.queryKeyTable.Contains(query)) {
             elem = (WhitespaceElement) this.queryKeyTable[query];
             elem.ReplaceValue(PreserveSpace);
             return;
         }
     }
     else{
         this.queryKeyTable = new Hashtable();
         this.whitespaceList = new ArrayList();
     }
     int key = compiler.AddQuery(query);
     elem = new WhitespaceElement(key, Priority, PreserveSpace);
     this.queryKeyTable[query] = elem;
     this.whitespaceList.Add(elem);
 }
開發者ID:uQr,項目名稱:referencesource,代碼行數:18,代碼來源:Stylesheet.cs

示例7: CompileAttribute

 internal override bool CompileAttribute(Compiler compiler) {
     string name   = compiler.Input.LocalName;
     string value  = compiler.Input.Value;
     if (Keywords.Equals(name, compiler.Atoms.Level)) {
         if (value != "any" && value != "multiple" && value != "single") {
             throw XsltException.Create(Res.Xslt_InvalidAttrValue, Keywords.s_Level, value);
         }
         this.level = value;
     }
     else if (Keywords.Equals(name, compiler.Atoms.Count)) {
         this.countPattern = value;
         this.countKey = compiler.AddQuery(value, /*allowVars:*/true, /*allowKey:*/true, /*pattern*/true);
     }
     else if (Keywords.Equals(name, compiler.Atoms.From)) {
         this.from = value;
         this.fromKey = compiler.AddQuery(value, /*allowVars:*/true, /*allowKey:*/true, /*pattern*/true);
     }
     else if (Keywords.Equals(name, compiler.Atoms.Value)) {
         this.value = value;
         this.valueKey = compiler.AddQuery(value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.Format)) {
         this.formatAvt = Avt.CompileAvt(compiler, value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.Lang)) {
         this.langAvt = Avt.CompileAvt(compiler, value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.LetterValue)) {
         this.letterAvt = Avt.CompileAvt(compiler, value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.GroupingSeparator)) {
         this.groupingSepAvt = Avt.CompileAvt(compiler, value);
     }
     else if (Keywords.Equals(name, compiler.Atoms.GroupingSize)) {
         this.groupingSizeAvt = Avt.CompileAvt(compiler, value);
     }
     else {
        return false;
     }
     return true;
 }
開發者ID:gbarnett,項目名稱:shared-source-cli-2.0,代碼行數:41,代碼來源:numberaction.cs

示例8: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler)
        {
            string name = compiler.Input.LocalName;
            string value = compiler.Input.Value;

            if (Ref.Equal(name, compiler.Atoms.Name))
            {
                Debug.Assert(this.name == null && this.nameStr == null);
                this.nameStr = value;
                this.name = compiler.CreateXPathQName(this.nameStr);
            }
            else if (Ref.Equal(name, compiler.Atoms.Select))
            {
                this.selectKey = compiler.AddQuery(value);
            }
            else
            {
                return false;
            }

            return true;
        }
開發者ID:Corillian,項目名稱:corefx,代碼行數:22,代碼來源:VariableAction.cs

示例9: CompileAttribute

        internal override bool CompileAttribute(Compiler compiler)
        {
            string name = compiler.Input.LocalName;
            string value = compiler.Input.Value;

            if (Ref.Equal(name, compiler.Atoms.Select))
            {
                _selectKey = compiler.AddQuery(value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Lang))
            {
                _langAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.DataType))
            {
                _dataTypeAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.Order))
            {
                _orderAvt = Avt.CompileAvt(compiler, value);
            }
            else if (Ref.Equal(name, compiler.Atoms.CaseOrder))
            {
                _caseOrderAvt = Avt.CompileAvt(compiler, value);
            }
            else
            {
                return false;
            }
            return true;
        }
開發者ID:geoffkizer,項目名稱:corefx,代碼行數:31,代碼來源:SortAction.cs

示例10: Compile

        internal override void Compile(Compiler compiler)
        {
            CompileAttributes(compiler);
            CheckEmpty(compiler);
            if (_selectKey == Compiler.InvalidQueryKey)
            {
                _selectKey = compiler.AddQuery(".");
            }

            _forwardCompatibility = compiler.ForwardCompatibility;
            _manager = compiler.CloneScopeManager();

            _lang = ParseLang(PrecalculateAvt(ref _langAvt));
            _dataType = ParseDataType(PrecalculateAvt(ref _dataTypeAvt), _manager);
            _order = ParseOrder(PrecalculateAvt(ref _orderAvt));
            _caseOrder = ParseCaseOrder(PrecalculateAvt(ref _caseOrderAvt));

            if (_langAvt == null && _dataTypeAvt == null && _orderAvt == null && _caseOrderAvt == null)
            {
                _sort = new Sort(_selectKey, _lang, _dataType, _order, _caseOrder);
            }
        }
開發者ID:geoffkizer,項目名稱:corefx,代碼行數:22,代碼來源:SortAction.cs

示例11: CompileKey

        internal void CompileKey(Compiler compiler){
            NavigatorInput input    = compiler.Input;
            string         element  = input.LocalName;
            int            MatchKey = Compiler.InvalidQueryKey;
            int            UseKey   = Compiler.InvalidQueryKey;

            XmlQualifiedName Name = null;
            if (input.MoveToFirstAttribute()) {
                do {
                    string nspace = input.NamespaceURI;
                    string name   = input.LocalName;
                    string value  = input.Value;

                    if (nspace.Length != 0) continue;

					if (Ref.Equal(name, input.Atoms.Name)) {
                        Name = compiler.CreateXPathQName(value);
                    }
                    else if (Ref.Equal(name, input.Atoms.Match)) {
                        MatchKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/true);
                    }
                    else if (Ref.Equal(name, input.Atoms.Use)) {
                        UseKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/false);
                    }
                    else {
                        if (! compiler.ForwardCompatibility) {
                            throw XsltException.Create(Res.Xslt_InvalidAttribute, name, element);
                        }
                    }
                }
                while(input.MoveToNextAttribute());
                input.ToParent();
            }

            CheckRequiredAttribute(compiler, MatchKey != Compiler.InvalidQueryKey, "match");
            CheckRequiredAttribute(compiler, UseKey   != Compiler.InvalidQueryKey, "use"  );
            CheckRequiredAttribute(compiler, Name     != null                    , "name" );
            // It is a breaking change to check for emptiness, SQLBUDT 324364
            //CheckEmpty(compiler);

            compiler.InsertKey(Name, MatchKey, UseKey);
        }
開發者ID:JokerMisfits,項目名稱:linux-packaging-mono,代碼行數:42,代碼來源:ContainerAction.cs

示例12: Compile

        internal override void Compile(Compiler compiler) {
            CompileAttributes(compiler);
            CheckEmpty(compiler);
            if (selectKey == Compiler.InvalidQueryKey) {
                selectKey = compiler.AddQuery(".");
            }

            this.forwardCompatibility = compiler.ForwardCompatibility;
            this.manager = compiler.CloneScopeManager();

            this.lang      = ParseLang(     PrecalculateAvt(ref this.langAvt     ));
            this.dataType  = ParseDataType( PrecalculateAvt(ref this.dataTypeAvt ), manager);
            this.order     = ParseOrder(    PrecalculateAvt(ref this.orderAvt    ));
            this.caseOrder = ParseCaseOrder(PrecalculateAvt(ref this.caseOrderAvt));

            if(this.langAvt == null && this.dataTypeAvt == null && this.orderAvt == null && this.caseOrderAvt == null) {
                this.sort = new Sort(this.selectKey, this.lang, this.dataType, this.order, this.caseOrder);
            }
        }
開發者ID:gbarnett,項目名稱:shared-source-cli-2.0,代碼行數:19,代碼來源:sortaction.cs

示例13: CompileKey

        internal void CompileKey(Compiler compiler){
            NavigatorInput input    = compiler.Input;
            string         element  = input.LocalName;
            int            MatchKey = Compiler.InvalidQueryKey;
            int            UseKey   = Compiler.InvalidQueryKey;

            XmlQualifiedName Name = null;
            if (input.MoveToFirstAttribute()) {
                do {
                    string nspace = input.NamespaceURI;
                    string name   = input.LocalName;
                    string value  = input.Value;

                    if (! Keywords.Equals(nspace, input.Atoms.Empty)) continue;

					if (Keywords.Equals(name, input.Atoms.Name)) {
                        Name = compiler.CreateXPathQName(value);
                    }
                    else if (Keywords.Equals(name, input.Atoms.Match)) {
                        MatchKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/true);
                    }
                    else if (Keywords.Equals(name, input.Atoms.Use)) {
                        UseKey = compiler.AddQuery(value, /*allowVars:*/false, /*allowKey*/false, /*pattern*/false);
                    }
                    else {
                        if (! compiler.ForwardCompatibility) {
                            throw XsltException.Create(Res.Xslt_InvalidAttribute, name, element);
                        }
                    }
                }
                while(input.MoveToNextAttribute());
                input.ToParent();
            }

            CheckRequiredAttribute(compiler, MatchKey != Compiler.InvalidQueryKey, Keywords.s_Match);
            CheckRequiredAttribute(compiler, UseKey   != Compiler.InvalidQueryKey, Keywords.s_Use  );
            CheckRequiredAttribute(compiler, Name     != null                    , Keywords.s_Name );

            compiler.InsertKey(Name, MatchKey, UseKey);
        }
開發者ID:gbarnett,項目名稱:shared-source-cli-2.0,代碼行數:40,代碼來源:containeraction.cs


注:本文中的System.Xml.Xsl.XsltOld.Compiler.AddQuery方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。