• 大小: 708KB
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2021-06-11
  • 语言: C#
  • 标签: WPF  XAML  HTML  

资源简介

WPF中的Html编辑器,源代码,资源来源于网络,特此共享

资源截图

代码片段和文件信息

using System;

namespace Smith.WPF.HtmlEditor
{
    /// 
    /// 提供 System.Drawing.Color 和 System.Windows.Media.Color 之间的转换方法。
    /// To provide methods to handle convertion between System.Drawing.Color and System.Windows.Media.Color.
    /// 

    internal static class ColorExtension
    {
        /// 
        /// 将 System.Drawing.Color 转换到 System.Windows.Media.Color。
        /// Convert System.Drawing.Color to System.Windows.Media.Color.
        /// 

        public static System.Windows.Media.Color ColorConvert(this System.Drawing.Color color)
        {
            return System.Windows.Media.Color.FromArgb(color.A color.R color.G color.B);
        }

        /// 
        /// 将 System.Windows.Media.Color 转换到 System.Drawing.Color。
        /// Convert System.Windows.Media.Color to System.Drawing.Color.
        /// 

        public static System.Drawing.Color ColorConvert(this System.Windows.Media.Color color)
        {
            return System.Drawing.Color.FromArgb(color.A color.R color.G color.B);
        }

        /// 
        /// 判断 System.Drawing.Color 和 System.Windows.Media.Color 是否表示相同的颜色。
        /// 

        public static bool ColorEqual(this System.Drawing.Color drawingColor System.Windows.Media.Color mediaColor)
        {
            return (drawingColor.A == mediaColor.A &&
                    drawingColor.R == mediaColor.R &&
                    drawingColor.G == mediaColor.G &&
                    drawingColor.B == mediaColor.B);
        }

        /// 
        /// 判断 System.Windows.Media.Color 和 System.Drawing.Color 是否表示相同的颜色。
        /// 

        public static bool ColorEqual(this System.Windows.Media.Color mediaColor System.Drawing.Color drawingColor)
        {
            return (drawingColor.A == mediaColor.A &&
                    drawingColor.R == mediaColor.R &&
                    drawingColor.G == mediaColor.G &&
                    drawingColor.B == mediaColor.B);
        }

        /// 
        /// 将表达式转换到 System.Windows.Media.Color。
        /// Convert an expression to System.Windows.Media.Color.
        /// 

        public static System.Windows.Media.Color ConvertToColor(string value)
        {
            return (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(value);
            //int r = 0 g = 0 b = 0;
            //if (value.StartsWith(“#“))
            //{
            //    int v = Convert.ToInt32(value.Substring(1) 16);
            //    r = (v >> 16) & 255; g = (v >> 8) & 255; b = v & 255;
            //}
            //return System.Windows.Media.Color.FromRgb(Convert.ToByte(r) Convert.ToByte(g) Convert.ToByte(b));
        }

        public static readonly System.Windows.Media.Color DefaultBackColor = System.Windows.SystemColors.WindowColor;

        public static readonly System.Windows

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-21 16:56  SmithHtmlEditor\
     目录           0  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor\
     目录           0  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\
     文件         315  2010-10-16 13:59  SmithHtmlEditor\SmithHtmlEditor.Demo\App.xaml
     文件         994  2010-10-18 23:03  SmithHtmlEditor\SmithHtmlEditor.Demo\App.xaml.cs
     目录           0  2011-04-14 21:28  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\
     文件        1044  2011-05-02 00:54  SmithHtmlEditor\SmithHtmlEditor.Demo\BindingTestWindow.xaml
     文件         627  2011-05-02 00:47  SmithHtmlEditor\SmithHtmlEditor.Demo\BindingTestWindow.xaml.cs
     目录           0  2011-05-02 00:45  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\
     目录           0  2011-05-02 00:45  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\en-US\
     文件        7168  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\en-US\Smith.WPF.HtmlEditor.resources.dll
     文件       15360  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\Smith.WPF.HtmlEditor.Demo.exe
     文件       38400  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\Smith.WPF.HtmlEditor.Demo.pdb
     文件       22704  2014-04-22 11:28  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\Smith.WPF.HtmlEditor.Demo.vshost.exe
     文件         490  2012-06-06 02:06  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\Smith.WPF.HtmlEditor.Demo.vshost.exe.manifest
     文件      152576  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\Smith.WPF.HtmlEditor.dll
     文件      280064  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\Smith.WPF.HtmlEditor.pdb
     文件         700  2011-05-01 20:27  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\smithhtmleditor.config.xml
     文件         197  2011-05-01 13:11  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\smithhtmleditor.stylesheet.css
     目录           0  2011-05-01 21:04  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\zh-CN\
     文件        3584  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\zh-CN\Smith.WPF.HtmlEditor.Demo.resources.dll
     文件        7168  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Debug\zh-CN\Smith.WPF.HtmlEditor.resources.dll
     目录           0  2011-04-14 21:28  SmithHtmlEditor\SmithHtmlEditor.Demo\bin\Release\
     文件        2218  2011-05-02 00:38  SmithHtmlEditor\SmithHtmlEditor.Demo\MainWindow.xaml
     文件        2561  2011-05-02 10:10  SmithHtmlEditor\SmithHtmlEditor.Demo\MainWindow.xaml.cs
     目录           0  2011-02-28 15:31  SmithHtmlEditor\SmithHtmlEditor.Demo\obj\
     目录           0  2014-04-22 11:28  SmithHtmlEditor\SmithHtmlEditor.Demo\obj\Debug\
     文件        2326  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\obj\Debug\App.g.cs
     文件        2326  2014-04-21 17:26  SmithHtmlEditor\SmithHtmlEditor.Demo\obj\Debug\App.g.i.cs
     文件        1547  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\obj\Debug\BindingTestWindow.baml
     文件        4008  2014-04-21 16:57  SmithHtmlEditor\SmithHtmlEditor.Demo\obj\Debug\BindingTestWindow.g.cs
............此处省略183个文件信息

评论

共有 条评论