コード例 #1
0
 public void RemoveStylingData(HTMLActiveModifiers modifiers)
 {
     foreach (Action <HTMLActiveModifiers> action in StylingDataRemovalActions)
     {
         action(modifiers);
     }
 }
コード例 #2
0
        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);
        }
コード例 #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);
                 }
             }
         }
     }
 }
コード例 #4
0
 public override void ApplyModifiers(ref string finalOutput, string nodeData, HTMLActiveModifiers modifiers)
 {
     modifiers.Italic = true;
     ApplyStylingData(nodeData, modifiers);
 }
コード例 #5
0
 public override void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers)
 {
     modifiers.Italic = false;
 }
コード例 #6
0
 public override void ApplyModifiers(ref string finalOutput, string nodeData, HTMLActiveModifiers modifiers)
 {
     finalOutput += "\\n";
     ApplyStylingData(nodeData, modifiers);
 }
コード例 #7
0
 public override void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers)
 {
     RemoveStylingData(modifiers);
 }
コード例 #8
0
 public abstract void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers);
コード例 #9
0
 public abstract void ApplyModifiers(ref string finalOutput, string nodeData, HTMLActiveModifiers modifiers);
コード例 #10
0
 public override void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers)
 {
     modifiers.Strikethrough = false;
 }
コード例 #11
0
 public override void RemoveModifiers(ref string finalOutput, HTMLActiveModifiers modifiers)
 {
     modifiers.Color = null;
 }