Config.cs

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using System.Windows.Forms;
using System.Drawing;
using System.IO;

namespace JColorPad
{
    public abstract class Config
    {
        static string path = Path.GetTempPath() + "JColorPad.xml";
        public static void Init()
        {          

            if (!File.Exists(path))
            {
                StreamWriter sw = new StreamWriter(path);
                sw.Write(global::JColorPad.Properties.Resources.config);
                sw.Close();
            }
            Empty = new XmlDocument();
            Empty.Load(path);
        }

        private static XmlDocument Empty; 

        private static Point location;

        public static Point Location
        {
            get
            {
                XmlNode node = Empty.SelectSingleNode("//location");
                location = (Point)new PointConverter().ConvertFromString(node.InnerText);
                return location;
            }
            set
            {
                location = value;
                XmlNode node = Empty.SelectSingleNode("//location");
                node.InnerText = new PointConverter().ConvertToString(value);
                Empty.Save(path);
            }
        }
        private static bool topmost;

        public static bool TopMost
        {
            get
            {
                XmlNode node = Empty.SelectSingleNode("//TopMost");
                topmost = bool.Parse(node.InnerText);
                return topmost;
            }
            set
            {
                topmost = value;
                XmlNode node = Empty.SelectSingleNode("//TopMost");
后面还有 7 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。