public MainForm(bool minimized) { InitializeComponent(); this.setting = Setting.Load(Application.LocalUserAppDataPath); this.urlPattern = new Regex("^https?://([A-Za-z0-9-].*?).springnote.com/pages/([0-9]+)", RegexOptions.IgnoreCase | RegexOptions.Compiled); this.clipboardSender = new ClipboardSender(this.Handle, this.setting); if (minimized) { this.WindowState = FormWindowState.Minimized; } }
public static Setting Load(string root) { string path = root + "\\clipnote.config.xml"; Setting ret; try { XmlSerializer serializer = new XmlSerializer(typeof(Setting)); FileStream stream = new FileStream(path, FileMode.Open); ret = (Setting)serializer.Deserialize(stream); stream.Close(); } catch(IOException) { ret = new Setting(); } ret.Initialize(path); return ret; }
public ClipboardSender(IntPtr handle, Setting setting) { this.handle = handle; this.setting = setting; }
public LoginForm(Setting setting, MainForm form) { InitializeComponent(); this.setting = setting; this.mainForm = form; }