示例#1
0
文件: RulerInfo.cs 项目: wxjwz/ruler
 public static void CopyInto(IRulerInfo source, IRulerInfo targetInstance)
 {
     targetInstance.Width       = source.Width;
     targetInstance.Height      = source.Height;
     targetInstance.IsVertical  = source.IsVertical;
     targetInstance.Opacity     = source.Opacity;
     targetInstance.ShowToolTip = source.ShowToolTip;
     targetInstance.IsLocked    = source.IsLocked;
     targetInstance.TopMost     = source.TopMost;
 }
示例#2
0
 public static void CopyInto <T>(this IRulerInfo ruler, T targetInstance)
     where T : IRulerInfo
 {
     targetInstance.Width       = ruler.Width;
     targetInstance.Height      = ruler.Height;
     targetInstance.IsVertical  = ruler.IsVertical;
     targetInstance.Opacity     = ruler.Opacity;
     targetInstance.ShowToolTip = ruler.ShowToolTip;
     targetInstance.IsLocked    = ruler.IsLocked;
     targetInstance.TopMost     = ruler.TopMost;
 }
示例#3
0
        public static void SaveInfo(this IRulerInfo ruler)
        {
            Properties.Settings.Default.IsVertical    = ruler.IsVertical;
            Properties.Settings.Default.Length        = ruler.Length;
            Properties.Settings.Default.Thickness     = ruler.Thickness;
            Properties.Settings.Default.Opacity       = ruler.Opacity;
            Properties.Settings.Default.ShowToolTip   = ruler.ShowToolTip;
            Properties.Settings.Default.IsLocked      = ruler.IsLocked;
            Properties.Settings.Default.TopMost       = ruler.TopMost;
            Properties.Settings.Default.BackColor     = RulerInfo.GetNameFromColor(ruler.BackColor) == "CUSTOM"?RulerInfo.GetHexFromColor(ruler.BackColor):RulerInfo.GetNameFromColor(ruler.BackColor);
            Properties.Settings.Default.ShowUpTicks   = ruler.ShowUpTicks;
            Properties.Settings.Default.ShowDownTicks = ruler.ShowDownTicks;
            Properties.Settings.Default.IsFlipped     = ruler.IsFlipped;

            Properties.Settings.Default.Save();
        }
示例#4
0
 public static void CopyInto(this IRulerInfo ruler, IRulerInfo targetInstance)
 {
     // IsVertical needs to be set first to ensure the min size are properly set
     // before Length and Thickness are set.
     targetInstance.IsVertical    = ruler.IsVertical;
     targetInstance.Length        = ruler.Length;
     targetInstance.Thickness     = ruler.Thickness;
     targetInstance.Opacity       = ruler.Opacity;
     targetInstance.ShowToolTip   = ruler.ShowToolTip;
     targetInstance.IsLocked      = ruler.IsLocked;
     targetInstance.TopMost       = ruler.TopMost;
     targetInstance.BackColor     = ruler.BackColor;
     targetInstance.ShowUpTicks   = ruler.ShowUpTicks;
     targetInstance.ShowDownTicks = ruler.ShowDownTicks;
     targetInstance.IsFlipped     = ruler.IsFlipped;
 }