Ejemplo n.º 1
0
        private static FoldingDesc ParseFolding(XmlNode foldingNode)
        {
            FoldingDesc folding = new FoldingDesc();

            //regex
            folding.startMarkerRegex  = foldingNode.Attributes["start"].Value;
            folding.finishMarkerRegex = foldingNode.Attributes["finish"].Value;
            //options
            var optionsA = foldingNode.Attributes["options"];

            if (optionsA != null)
            {
                folding.options = (RegexOptions)Enum.Parse(typeof(RegexOptions), optionsA.Value);
            }

            return(folding);
        }
        private static FoldingDesc ParseFolding(XmlNode foldingNode)
        {
            FoldingDesc folding = new FoldingDesc();
            //regex
            folding.startMarkerRegex = foldingNode.Attributes["start"].Value;
            folding.finishMarkerRegex = foldingNode.Attributes["finish"].Value;
            //options
            var optionsA = foldingNode.Attributes["options"];
            if (optionsA != null)
                folding.options = (RegexOptions)Enum.Parse(typeof(RegexOptions), optionsA.Value);

            return folding;
        }
 protected static FoldingDesc ParseFolding(XmlNode foldingNode)
 {
     var foldingDesc = new FoldingDesc();
     foldingDesc.startMarkerRegex = foldingNode.Attributes["start"].Value;
     foldingDesc.finishMarkerRegex = foldingNode.Attributes["finish"].Value;
     var xmlAttribute = foldingNode.Attributes["options"];
     var flag = xmlAttribute != null;
     if (flag)
     {
         foldingDesc.options = (RegexOptions) Enum.Parse(typeof (RegexOptions), xmlAttribute.Value);
     }
     return foldingDesc;
 }