private void pictNew_Click(object sender, EventArgs e) { FormNote newNote = new FormNote(this); newNote.MdiParent = this.MdiParent; newNote.Show(); mActiveNote = newNote; newNote.mInkPicture.DefaultDrawingAttributes.Color = mColor; newNote.mInkPicture.DefaultDrawingAttributes.Height = mHeight; newNote.mInkPicture.DefaultDrawingAttributes.Width = mWidth; newNote.mInkPicture.DefaultDrawingAttributes.PenTip = mPenTip; newNote.setInkMode(mMode); mNotes.Add(newNote); }
private void Palette_Load(object sender, EventArgs e) { mNotes = new List<FormNote>(); string dirPath = string.Empty; if (Program.s_appDataDir.Length > 0) dirPath = Program.s_appDataDir; else dirPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\InkNote"; try { string[] pathes = System.IO.Directory.GetFiles(dirPath, "*.ikn"); foreach (string path in pathes) { FormNote newNote = new FormNote(this, path); newNote.MdiParent = this.MdiParent; newNote.Show(); mActiveNote = newNote; mNotes.Add(newNote); } } catch (Exception ex) { } if (mActiveNote == null) { FormNote newNote = new FormNote(this); newNote.MdiParent = this.MdiParent; newNote.Show(); mActiveNote = newNote; mNotes.Add(newNote); } mColor = mActiveNote.mInkPicture.DefaultDrawingAttributes.Color; mWidth = mActiveNote.mInkPicture.DefaultDrawingAttributes.Width; mHeight = mActiveNote.mInkPicture.DefaultDrawingAttributes.Height; mPenTip = mActiveNote.mInkPicture.DefaultDrawingAttributes.PenTip; mTransparency = mActiveNote.mInkPicture.DefaultDrawingAttributes.Transparency; mMode = MODE.INK_DRAW; mActiveNote.setInkMode(mMode); OnInkDrawMode(); }