System.Xml.Xsl.XsltOld.Stylesheet.SortWhiteSpace C# (CSharp) Method

SortWhiteSpace() private method

private SortWhiteSpace ( ) : void
return void
        internal void SortWhiteSpace(){
            if (this.queryKeyTable != null){
                for (int i= 0; i < this.whitespaceList.Count  ; i++ ) {
                    for(int j = this.whitespaceList.Count - 1; j > i; j--) {
                        WhitespaceElement elem1, elem2;
                        elem1 = (WhitespaceElement) this.whitespaceList[j - 1];
                        elem2 = (WhitespaceElement) this.whitespaceList[j];
                        if (elem2.Priority < elem1.Priority) {
                            this.whitespaceList[j - 1] = elem2;
                            this.whitespaceList[j] = elem1;
                        }
                    }
                }
                this.whitespace = true;
            }
            if (this.imports != null) {
                for (int importIndex = this.imports.Count - 1; importIndex >= 0; importIndex --) {
                    Stylesheet stylesheet = (Stylesheet) this.imports[importIndex];
                    if (stylesheet.Whitespace) {
                        stylesheet.SortWhiteSpace();
                        this.whitespace = true;
                    }
                }
            }
        }

Usage Example

Ejemplo n.º 1
0
 internal void SortWhiteSpace()
 {
     if (_queryKeyTable != null)
     {
         for (int i = 0; i < _whitespaceList.Count; i++)
         {
             for (int j = _whitespaceList.Count - 1; j > i; j--)
             {
                 WhitespaceElement elem1, elem2;
                 elem1 = (WhitespaceElement)_whitespaceList[j - 1];
                 elem2 = (WhitespaceElement)_whitespaceList[j];
                 if (elem2.Priority < elem1.Priority)
                 {
                     _whitespaceList[j - 1] = elem2;
                     _whitespaceList[j]     = elem1;
                 }
             }
         }
         _whitespace = true;
     }
     if (_imports != null)
     {
         for (int importIndex = _imports.Count - 1; importIndex >= 0; importIndex--)
         {
             Stylesheet stylesheet = (Stylesheet)_imports[importIndex];
             if (stylesheet.Whitespace)
             {
                 stylesheet.SortWhiteSpace();
                 _whitespace = true;
             }
         }
     }
 }