Beispiel #1
0
 public void AddDiscardedIdea(GenericIdeationObjects.IdeationUnit idea)
 {
     try
     {
         IPostItUI addedIdeaUI = null;
         if (idea is PostItNote)
         {
             PostItNote castNote = (PostItNote)idea;
             if (castNote.Content is Bitmap)
             {
                 ImageBasedPostItUI noteUI = new ImageBasedPostItUI();
                 noteUI.Tag = idea;
                 noteUI.setNoteID(castNote.Id);
                 noteUI.updateDisplayedContent(((Bitmap)castNote.Content).Clone());
                 noteUI.Width = noteUI.Height = this.Height * 2 / 3;
                 noteUI.DisableZoomButtons();
                 addedIdeaUI = noteUI;
             }
         }
         if (addedIdeaUI != null)
         {
             addedIdeaUI.noteUIDeletedEventHandler += new NoteUIDeletedEvent(ideaUI_noteUIDeletedEventHandler);
             this.discardedItemsContainer.Children.Add((UserControl)addedIdeaUI);
         }
     }
     catch (Exception ex)
     {
         Utilities.UtilitiesLib.LogError(ex);
     }
 }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
        void colorPalette_selectedColorApprovedHandler(object sender, Control callingControl, string approvedColorCode)
        {
            PostItColorPalette palette  = (sender as PostItColorPalette);
            ImageBasedPostItUI postItUI = (callingControl as ImageBasedPostItUI);

            if (postItUI.getLatestApprovedtBackgroundColor().CompareTo(approvedColorCode) != 0)
            {
                postItUI.approvedNewBackgroundColor(approvedColorCode);
                TakeASnapshot();
                brainstormManager.ChangeIdeaUIColor(postItUI.getAssociatedIdea().Id, approvedColorCode);
            }
            mainGrid.Children.Remove(sender as PostItColorPalette);
        }
Beispiel #4
0
        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);
            }
        }