Exemple #1
0
        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;
            }
        }
Exemple #2
0
        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;
        }
Exemple #3
0
 public ClipboardSender(IntPtr handle, Setting setting)
 {
     this.handle = handle;
     this.setting = setting;
 }
Exemple #4
0
 public LoginForm(Setting setting, MainForm form)
 {
     InitializeComponent();
     this.setting = setting;
     this.mainForm = form;
 }