private void brainstormManager_ideaUpdatedHandler(GenericIdeationObjects.IdeationUnit updatedIdea, GenericIdeationObjects.IdeationUnit.IdeaUpdateType updateType) { // lock (sync) { switch (updateType) { case IdeationUnit.IdeaUpdateType.Position: updateNoteUIPosition(updatedIdea); break; case IdeationUnit.IdeaUpdateType.Content: updateNoteUIContent(updatedIdea); break; } TakeASnapshot(); switch (updateType) { case IdeationUnit.IdeaUpdateType.Position: timelineManager.AddUPDATEPositionChange(updatedIdea.Id, updatedIdea.CenterX, updatedIdea.CenterY); break; case IdeationUnit.IdeaUpdateType.Content: timelineManager.AddUPDATEContentChange(updatedIdea.Id, updatedIdea.Content); break; } } }
private void brainstormManager_ideaRemovedHandler(GenericIdeationObjects.IdeationUnit removedIdea) { // lock (sync) { removeNoteUI(removedIdea); TakeASnapshot(); timelineManager.AddDELETEChange(removedIdea.Id); } }
private void brainstormManager_ideaAddedEventHandler(GenericIdeationObjects.IdeationUnit addedIdea) { // lock (sync) { List <IdeationUnit> oneItemList = new List <IdeationUnit>(); oneItemList.Add(addedIdea); addNewIdeaUIs(oneItemList, true); TakeASnapshot(); timelineManager.AddADDChange(addedIdea); } }
private void updateNoteUIContent(GenericIdeationObjects.IdeationUnit updatedIdea) { this.Dispatcher.Invoke(new Action <IdeationUnit>((ideaToUpdate) => { try { ScatterViewItem noteContainer = findNoteContainerOfIdea(ideaToUpdate); IPostItUI noteUI = (IPostItUI)noteContainer.Content; noteUI.update(ideaToUpdate); noteContainer.Content = noteUI; } catch (Exception ex) { Utilities.UtilitiesLib.LogError(ex); } }), new object[] { updatedIdea.Clone() }); }
private void updateNoteUIPosition(GenericIdeationObjects.IdeationUnit updatedIdea) { this.Dispatcher.Invoke(new Action <IdeationUnit>((ideaToUpdate) => { try { ScatterViewItem noteContainer = findNoteContainerOfIdea(ideaToUpdate); if (noteContainer != null) { noteContainer.Center = new System.Windows.Point(ideaToUpdate.CenterX, ideaToUpdate.CenterY); Utilities.BrainstormingEventLogger.GetInstance(dropboxGeneralNoteDownloader.Storage).UploadLogString(Utilities.BrainstormingEventLogger.getLogStr_NoteMoved(ideaToUpdate)); } } catch (Exception ex) { Utilities.UtilitiesLib.LogError(ex); } }), new object[] { updatedIdea }); }
private void removeNoteUI(IdeationUnit associatedIdea) { this.Dispatcher.Invoke(new Action<IdeationUnit>((ideaToDel) => { try { ScatterViewItem ideaContainer = findNoteContainerOfIdea(ideaToDel); sv_MainCanvas.Items.Remove(ideaContainer); Utilities.BrainstormingEventLogger.GetInstance(dropboxGeneralNoteDownloader.Storage).UploadLogString(Utilities.BrainstormingEventLogger.getLogStr_NoteDeleted(associatedIdea)); } catch (Exception ex) { Utilities.UtilitiesLib.LogError(ex); } }), new object[] { associatedIdea }); }
private void noteUIManipluatedEventHandler(object sender, IdeationUnit underlyingIdea, float newX, float newY) { //auto adjust to align postit note vertically ScatterViewItem container = findNoteContainerOfIdea(underlyingIdea); if (Math.Abs(container.Orientation) <= 20) { container.Orientation = 0; } TakeASnapshot(); brainstormManager.UpdateIdeaPosition(underlyingIdea.Id, newX, newY); }
private void noteUIDeletedEventHandler(object sender, IdeationUnit associatedIdea) { brainstormManager.RemoveIdea(associatedIdea); }
private ScatterViewItem findNoteContainerOfIdea(IdeationUnit idea) { ScatterViewItem matchedItem = null; foreach (ScatterViewItem item in sv_MainCanvas.Items) { IPostItUI noteUI = (IPostItUI)item.Content; if (noteUI.getNoteID() == idea.Id) { matchedItem = item; } } return matchedItem; }
void brainstormManager_ideaUIColorChangeHandler(IdeationUnit updatedIdea, string colorCode) { TakeASnapshot(); timelineManager.AddCOLORChange(updatedIdea.Id, colorCode); }
private void brainstormManager_ideaRestoredHandler(IdeationUnit restoredIdea) { // lock (sync) { List<IdeationUnit> oneItemList = new List<IdeationUnit>(); oneItemList.Add(restoredIdea); addNewIdeaUIs(oneItemList, false); TakeASnapshot(); timelineManager.AddRESTOREChange(restoredIdea.Id); Utilities.BrainstormingEventLogger.GetInstance(dropboxGeneralNoteDownloader.Storage).UploadLogString(Utilities.BrainstormingEventLogger.getLogStr_NoteRestored(restoredIdea)); } }
private void AddSingleStrokeBasedNote(IdeationUnit strokeBasedIdea) { try { StrokeData ideaData = (StrokeData)(strokeBasedIdea.Content); List<System.Windows.Point> strokePoints = ideaData.StrokePoints; StylusPointCollection stylusPoints = new StylusPointCollection(); foreach (System.Windows.Point p in strokePoints) { StylusPoint stylusP = new StylusPoint(p.X, p.Y); stylusPoints.Add(stylusP); } Stroke newStroke = new Stroke(stylusPoints); if (!ideaData.IsErasingStroke) { newStroke.DrawingAttributes = DrawingCanvasModeSwitcher.normalDrawingAttribute.Clone(); newStroke.DrawingAttributes.Color = (System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString(ideaData.StrokeColorCode); } else { newStroke.DrawingAttributes = new DrawingAttributes(); newStroke.DrawingAttributes.Color = System.Windows.Media.Color.FromRgb(0, 0, 0); newStroke.DrawingAttributes.Width = newStroke.DrawingAttributes.Height = 30; } drawingCanvas.Strokes.Add(newStroke); } catch (Exception ex) { Utilities.UtilitiesLib.LogError(ex); } }
private void AddSinglePostItNote(IdeationUnit idea, int initAngle, bool init) { try { IPostItUI addedIdeaUI = null; ScatterViewItem container = new ScatterViewItem(); PostItNote castNote = (PostItNote)idea; if (castNote.Content is Bitmap) { ImageBasedPostItUI noteUI = new ImageBasedPostItUI(); noteUI.Tag = idea; noteUI.setNoteID(castNote.Id); noteUI.update(idea); noteUI.Width = noteUI.InitWidth; noteUI.Height = noteUI.InitHeight; if (castNote.MetaData.UiBackgroundColor.Length > 0) { noteUI.setBackgroundPostItColor(castNote.MetaData.UiBackgroundColor); noteUI.approvedNewBackgroundColor(castNote.MetaData.UiBackgroundColor); } container.Content = noteUI; container.Width = noteUI.Width; container.Height = noteUI.Height; if (idea.CenterX == 0 && idea.CenterY == 0) { int centerX = (int)(container.Width / 2); int centerY = (int)(sv_MainCanvas.Height - container.Height / 2); idea.CenterX = centerX; idea.CenterY = centerY; } sv_MainCanvas.Items.Add(container); container.Center = new System.Windows.Point(idea.CenterX, idea.CenterY); container.Orientation = initAngle; container.ZIndex = 1; container.CanScale = false; addedIdeaUI = noteUI; addedIdeaUI.InitContainer(container); } if (addedIdeaUI != null) { if (init) { addedIdeaUI.startJustAddedAnimation(container.Orientation); } addedIdeaUI.noteUITranslatedEventHandler += new NoteUITranslatedEvent(noteUIManipluatedEventHandler); addedIdeaUI.noteUIDeletedEventHandler += new NoteUIDeletedEvent(noteUIDeletedEventHandler); addedIdeaUI.noteUISizeChangedListener += new NoteUISizeChangedEvent(addedIdeaUI_noteUISizeChangedListener); addedIdeaUI.colorPaletteLaunchedEventHandler += new ColorPaletteLaunchedEvent(addedIdeaUI_colorPaletteLaunchedEventHandler); } Utilities.BrainstormingEventLogger.GetInstance(dropboxGeneralNoteDownloader.Storage).UploadLogString(Utilities.BrainstormingEventLogger.getLogStr_NoteAdded(idea)); } catch (Exception ex) { Utilities.UtilitiesLib.LogError(ex); } }
private void AddSingleIdeaGroup(IdeationUnit ideaGroup) { try { IdeaGroupUI groupUI = new IdeaGroupUI(); groupUI.setNoteID(ideaGroup.Id); groupUI.Tag = ideaGroup; groupUI.update(ideaGroup); ScatterViewItem container = new ScatterViewItem(); container.Content = groupUI; container.Background = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0)); container.Width = groupUI.Width; container.Height = groupUI.Height; container.Orientation = 0; container.CanScale = false; container.CanRotate = false; container.Center = new System.Windows.Point(ideaGroup.CenterX, ideaGroup.CenterY); groupUI.InitContainer(container); sv_MainCanvas.Items.Add(container); } catch (Exception ex) { Utilities.UtilitiesLib.LogError(ex); } }
void addedIdeaUI_noteUISizeChangedListener(object sender, IdeationUnit associatedIdea, float scaleX, float scaleY) { TakeASnapshot(); Utilities.BrainstormingEventLogger.GetInstance(dropboxGeneralNoteDownloader.Storage).UploadLogString(Utilities.BrainstormingEventLogger.getLogStr_NoteSizeChanged(associatedIdea, scaleX, scaleY)); }