Exemplo n.º 1
0
 public void RemoveStylingData(HTMLActiveModifiers modifiers)
 {
     foreach (Action <HTMLActiveModifiers> action in StylingDataRemovalActions)
     {
         action(modifiers);
     }
 }
        public override void ApplyModifiers(ref string finalOutput, string nodeData, HTMLActiveModifiers modifiers)
        {
            Regex regex = new Regex("color=\"([#0123456789abcdef]*)\"");
            Match match = regex.Match(nodeData);

            if (match.Success)
            {
                modifiers.Color = match.Groups[1].Value;
                nodeData        = nodeData.Replace(match.Value, "");
            }
            ApplyStylingData(nodeData, modifiers);
        }
Exemplo n.º 3
0
 public void ApplyStylingData(string nodeData, HTMLActiveModifiers modifiers)
 {
     if (!string.IsNullOrEmpty(nodeData))
     {
         Match match = null;
         if (MatchRegex(nodeData, "style=\"(.*?)\"", out match))
         {
             nodeData = match.Groups[1].Value;
             match    = null;
             foreach (string subpart in nodeData.Split(";"))
             {
                 if (MatchRegex(subpart, @"color: rgb\(([0-9]*), ([0-9]*), ([0-9]*)\)", out match))
                 {
                     string color = "#";
                     color          += BitConverter.ToString(new byte[] { byte.Parse(match.Groups[1].Value), byte.Parse(match.Groups[2].Value), byte.Parse(match.Groups[3].Value) }).Replace("-", "").ToLower();
                     modifiers.Color = color;
                     StylingDataRemovalActions.Add(m => m.Color = null);
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
 public override void ApplyModifiers(ref string finalOutput, string nodeData, HTMLActiveModifiers modifiers)
 {
     modifiers.Italic = true;
     ApplyStylingData(nodeData, modifiers);
 }
Exemplo n.º 5
0
 public override void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers)
 {
     modifiers.Italic = false;
 }
 public override void ApplyModifiers(ref string finalOutput, string nodeData, HTMLActiveModifiers modifiers)
 {
     finalOutput += "\\n";
     ApplyStylingData(nodeData, modifiers);
 }
 public override void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers)
 {
     RemoveStylingData(modifiers);
 }
 public abstract void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers);
 public abstract void ApplyModifiers(ref string finalOutput, string nodeData, HTMLActiveModifiers modifiers);
Exemplo n.º 10
0
 public override void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers)
 {
     modifiers.Strikethrough = false;
 }
 public override void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers)
 {
     modifiers.Color = null;
 }