private void tsbAddImageToLibrary(object sender, EventArgs e) { if (listBoxImages.SelectedIndex >= 0 && listBoxImages.SelectedIndex < listBoxImages.Items.Count) { MNReferencedImage ri = (MNReferencedImage)listBoxImages.Items[listBoxImages.SelectedIndex]; if (ri != null) { MNSharedObjects.AddImage(ri); MNSharedObjects.Save(); } } }
private void tsbAddStyleToLibrary(object sender, EventArgs e) { ListBox lb = listBoxStyles; if (lb.SelectedIndex >= 0 && lb.SelectedIndex < lb.Items.Count) { MNReferencedStyle selectedStyle = lb.Items[lb.SelectedIndex] as MNReferencedStyle; if (selectedStyle != null) { MNSharedObjects.AddStyle(selectedStyle); MNSharedObjects.Save(); } } }