public static void ChangeLabelForSlide(SlideModel slide, string text) { if (dictionary_ == null) { dictionary_ = new Dictionary <SlideModel, StatusLabel>(); } if (!dictionary_.ContainsKey(slide)) { StatusLabel label = new StatusLabel(slide, text); dictionary_[slide] = label; using (Synchronizer.Lock(slide.SyncRoot)) { slide.AnnotationSheets.Add(label); } } else { StatusLabel label = dictionary_[slide]; using (Synchronizer.Lock(label.SyncRoot)) { label.Text = text; } } }
public static void ChangeLabelForSlide(SlideModel slide, string text) { if (dictionary_ == null) { dictionary_ = new Dictionary<SlideModel, StatusLabel>(); } if (!dictionary_.ContainsKey(slide)) { StatusLabel label = new StatusLabel(slide, text); dictionary_[slide] = label; using (Synchronizer.Lock(slide.SyncRoot)) { slide.AnnotationSheets.Add(label); } }else{ StatusLabel label = dictionary_[slide]; using (Synchronizer.Lock(label.SyncRoot)) { label.Text = text; } } }