void PresentationNotifier_OnObjectChanged(object sender, NotifierEventArg<IList<ObjectInfo>> e) { view.Invoke(new MethodInvoker(() => { foreach (var info in e.Data) { if (info.ObjectKey is PresentationKey) { string uid = ((PresentationKey)info.ObjectKey).PresentationUniqueName; var pr = pList.Where(p => p.UniqueName == uid).FirstOrDefault(); if (pr != null) { int i = pList.IndexOf(pr); pList[i] = DesignerClient.Instance.PresentationWorker.GetPresentationInfo(uid); } } } view.RefreshView(); })); }
private void _presentationNotifier_OnLabelAdded(object sender, NotifierEventArg<Label> e) { _configuration.LabelStorageAdapter.AddLabel(e.Data); }
private void PresentationNotifier_OnLabelDeleted(object sender, NotifierEventArg<TechnicalServices.Persistence.SystemPersistence.Configuration.Label> e) { List<Slide> slds = GetAllSlides().Where(sld => sld.IsLocked && sld.LabelId.Equals(e.Data.Id)).ToList(); if (slds.Count > 0) { StringBuilder message = new StringBuilder("Администратор удалил метку " + e.Data.Name); message.Append(". Метка использовалась в слайде: "); foreach (Slide item in slds) { item.LabelId = TechnicalServices.Persistence.SystemPersistence.Configuration.Label.NullId; message.Append(item.Name); } message.Append(". Метка будет удалена из слайда."); MessageBoxExt.Show(message.ToString(), "Предупреждение", MessageBoxButtons.OK, MessageBoxIcon.Warning); } if (OnLabelListChanhed != null) OnLabelListChanhed(); }
private void PresentationNotifier_OnLabelAdded(object sender, NotifierEventArg<TechnicalServices.Persistence.SystemPersistence.Configuration.Label> e) { if (OnLabelListChanhed != null) OnLabelListChanhed(); }
void PresentationNotifier_OnResourceAdded(object sender, NotifierEventArg<ResourceDescriptor> e) { if (e.Data is BackgroundImageDescriptor && e.Data.PresentationUniqueName == m_presentation.UniqueName) { if (!backgrounds.ContainsKey(e.Data.ResourceInfo.Id)) backgrounds.Add(e.Data.ResourceInfo.Id, (BackgroundImageDescriptor)e.Data); } }
void PresentationNotifier_OnResourceAdded(object sender, NotifierEventArg<ResourceDescriptor> e) { populateCategories(); if (OnSourcesChanged != null) OnSourcesChanged(); }
void PresentationNotifier_OnResourceDeleted(object sender, NotifierEventArg<ResourceDescriptor> e) { if ((nodeToRemove != null && nodeToRemove.Mapping != e.Data) || nodeToRemove == null) { if (resourceNodes.Keys.Any(k => k.Equals(e.Data))) { foreach (var n in resourceNodes) { if (n.Key.Equals(e.Data)) { bool Global = !e.Data.IsLocal; ISourceNode node = n.Value; node.Mapping.Removed = true; _view.RemoveSourceFromCategory(Global ? global_categories[node.Mapping.ResourceInfo.Type] : local_categories[node.Mapping.ResourceInfo.Type], node, Global); if (serviceContainer != null) serviceContainer.Remove(node.Mapping); resourceNodes.Remove(node.Mapping); nodeToRemove = null; break; } } } } }
void PresentationNotifier_OnResourceAdded(object sender, NotifierEventArg<ResourceDescriptor> e) { if (resourceNodes.Keys.Any(r => ResourceDescriptorEquals(e.Data, r))) return; if (localResourceCopying) return; if (!e.Data.IsLocal || (e.Data.IsLocal && e.Data.PresentationUniqueName == m_presentation.UniqueName)) { ResourceDescriptor rd = e.Data; if (!(rd is BackgroundImageDescriptor) && !(rd is INonVisibleResource)) { SourceCategory cat = (rd.IsLocal ? local_categories : global_categories)[rd.ResourceInfo.Type]; ISourceNode node = new SourceWindow(rd) { SourceType = cat.Type }; cat.Resources.Add(node); _view.AddResourceToCategory(cat, node, !rd.IsLocal); resourceNodes.Add(rd, node); } else { if (rd.ResourceInfo is INonVisibleResource) { nonVisibleResources.Add(rd); } } } }
void PresentationNotifier_OnPresentationDeleted(object sender, NotifierEventArg<PresentationInfo> e) { if (pList.Contains(e.Data)) { view.Invoke(new MethodInvoker(() => { var pr = pList.Where(p => p.UniqueName == e.Data.UniqueName).FirstOrDefault(); if (pr != null) pList.Remove(pr); view.RefreshView(); })); } }
void PresentationNotifier_OnObjectLocked(object sender, NotifierEventArg<LockingInfo> e) { if (e.Data.ObjectKey is PresentationKey) UpdateKeyStatus((PresentationKey)e.Data.ObjectKey, e.Data); }
void PresentationNotifier_OnPresentationAdded(object sender, NotifierEventArg<PresentationInfo> e) { //if (creatingPresentation == null || !creatingPresentation.Equals(e.Data)) if (!pList.Contains(e.Data)) { view.Invoke(new MethodInvoker(() => { pList.Add(e.Data); view.Sort(); })); } creatingPresentation = null; }
void PresentationNotifier_OnObjectLocked(object sender, NotifierEventArg<LockingInfo> e) { if (!e.Data.UserIdentity.Equals(_identity)) { if (e.Data.ObjectKey is SlideKey) { UpdateSlideStatus((SlideKey)e.Data.ObjectKey, e.Data); return; } if (e.Data.ObjectKey.GetObjectType() == ObjectType.Presentation) { if (m_Presentation.UniqueName == ((PresentationKey)e.Data.ObjectKey).PresentationUniqueName) { //this.PresentationLocked = false; if (OnPresentationLockedExternally != null) { UserIdentity i = e.Data.UserIdentity; string name = String.IsNullOrEmpty(i.User.FullName) ? i.Name : i.User.FullName; OnPresentationLockedExternally(name, e.Data.RequireLock); } } } } }
void PresentationNotifier_OnObjectChanged(object sender, NotifierEventArg<IList<ObjectInfo>> e) { if (e.Data != null) { foreach (ObjectInfo info in e.Data) { if (!_identity.Equals(info.UserIdentity)) { if (info.ObjectKey.GetObjectType() == ObjectType.Presentation) { if (m_Presentation.UniqueName == ((PresentationKey)info.ObjectKey).PresentationUniqueName && !PresentationLocked) { m_PresentationInfo = DesignerClient.Instance.PresentationWorker.GetPresentationInfo(m_Presentation.UniqueName); Slide[] slides = GetLockedSlides(); m_Presentation = m_PresentationInfo.CreatePresentationStub(); //merge foreach (Slide s in slides) { Slide dest = m_Presentation.SlideList.Find(sl => sl.Id == s.Id); if (dest == null) continue; dest.SaveSlideLevelChanges(s); dest.IsLocked = s.IsLocked; dest.Cached = s.Cached; dest.State = s.State; //dest.SourceList.Clear(); //dest.SourceList.AddRange(s.SourceList); //dest.DeviceList.Clear(); //dest.DeviceList.AddRange(s.DeviceList); //dest.DisplayList.Clear(); //dest.DisplayList.AddRange(s.DisplayList); } //update presentation if (OnPresentationChangedExternally != null) OnPresentationChangedExternally(); continue; } } if (info.ObjectKey.GetObjectType() == ObjectType.Slide) { string presentationUniqueName = ((PresentationKey) ((SlideKey) info.ObjectKey).PresentationKey).PresentationUniqueName; int slideId = ((SlideKey) info.ObjectKey).Id; if (presentationUniqueName == this.m_Presentation.UniqueName) { Slide slide = m_Presentation.SlideList.FirstOrDefault(s => s.Id == ((SlideKey)info.ObjectKey).Id); if (slide != null) { slide.Cached = false; LoadSlide(slide); //refresh slide data if (OnSlideChangedExternally != null) OnSlideChangedExternally(slide); continue; } } } } } } }
void PresentationNotifier_OnPresentationDeleted(object sender, NotifierEventArg<PresentationInfo> e) { if (e.Data.UniqueName == m_Presentation.UniqueName) { if (OnPresentationRemoved != null) OnPresentationRemoved(); } }
void PresentationNotifier_OnDeviceResourceUpdated(object sender, NotifierEventArg<DeviceResourceDescriptor> e) { //e.Data.ResourceInfo.DeviceType.Type; }