Exemplo n.º 1
0
 public MarkingsEditor(Idea TargetIdea,
                       Func <MarkerAssignment> CreationOperation,
                       Action <MarkerAssignment> EditingOperation,
                       MarkerAssignment InitialPointedMarker)
     : this()
 {
     this.TargetIdea           = TargetIdea;
     this.CreationOperation    = CreationOperation;
     this.EditingOperation     = EditingOperation;
     this.InitialPointedMarker = InitialPointedMarker;
 }
Exemplo n.º 2
0
        // ---------------------------------------------------------------------------------------------------------------------------------------------------------
        public static MarkerAssignment CreateMarkerAssignment(EntityEditEngine Engine, MarkerDefinition Definitor)
        {
            var Result = new MarkerAssignment(Engine, Definitor);

            var EditOnCreationConfigured = AppExec.GetConfiguration <bool>("IdeaEditing", "MarkerEditing.EditOnCreation", false);
            var EditOnCreationExplicit   = (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl));

            if (EditOnCreationConfigured || EditOnCreationExplicit)
            {
                if (!EditMarkerAssignmentDescriptor(Engine, Result))
                {
                    return(null);
                }
            }

            return(Result);
        }
Exemplo n.º 3
0
        public static bool EditMarkerAssignmentDescriptor(EntityEditEngine Engine, MarkerAssignment Target)
        {
            var Descriptor = Target.Descriptor.NullDefault(new SimplePresentationElement("", ""));
            var EditResult = ((CompositionEngine)Engine).EditSimplePresentationElement(Descriptor, "Edit '" + Target.Definitor.Name + "' marker");

            if (EditResult)
            {
                // NOTE: In the future, this should also attach the descriptor if any new editable property is populated
                if (Descriptor.AutoPopulate() || Descriptor.Pictogram != null)
                {
                    Target.Descriptor = Descriptor;
                }
                else
                {
                    Target.Descriptor = null;
                }
            }

            // Indicate applied or cancelled
            return(EditResult);
        }