public LocalDetailsEditor(Idea IdeaSource, VisualSymbol SymbolSource, bool AccessToGlobalDetails, bool AccessOnlyTables = false, DetailDesignator InitialDesignatorToEdit = null) : this() { this.IdeaSource = IdeaSource; this.SymbolSource = SymbolSource; this.AccessToGlobalDetails = AccessToGlobalDetails; if (AccessOnlyTables) { this.EntitlingPanel.SetVisible(false); } if (this.AccessToGlobalDetails) { this.VisualGlobalDetailsSource = DetailEditingCard.GenerateGlobalDetailsFor(this.IdeaSource, this.SymbolSource); this.GlobalDetailsMaintainer.SetDetailsSource(this.IdeaSource, this.SymbolSource, this.VisualGlobalDetailsSource, false, false, InitialDesignatorToEdit); this.GlobalDetailsMaintainer.ShowCustomLookZone = true; // (this.SymbolSource != null); } else { this.LocalDetailsMaintainer.Title = "Designations..."; this.AppearanceTitlePanel.SetVisible(false); this.BtnSwitchDetailsScopeOrder.SetVisible(false); this.GlobalDetailsMaintainer.SetVisible(false); } this.VisualLocalDetailsSource = DetailEditingCard.GenerateLocalDetailsFor(this.IdeaSource, this.SymbolSource, this.VisualGlobalDetailsSource); this.LocalDetailsMaintainer.SetDetailsSource(this.IdeaSource, this.SymbolSource, this.VisualLocalDetailsSource, true, AccessOnlyTables, InitialDesignatorToEdit); this.LocalDetailsMaintainer.ShowCustomLookZone = true; // (this.SymbolSource != null); }
/// <summary> /// Fixes individual detail-designator. /// </summary> private static void ModelRev1_FixDetailDesignator(DetailDesignator Evaluated) { if (Evaluated == null) { return; } // Initializer must be getted indirectly, because of underlying Store-Box based storage. var BoxedProp = DetailDesignator.__Initializer.Get(Evaluated) as StoreBoxBase; if (BoxedProp == null) { return; } var StoredBytes = BoxedProp.GetStoredValueBytes(); if (StoredBytes == null || StoredBytes.BytesToString() != "Formal Element.Summary") { return; } // Evaluated.Initializer = null; Evaluated.Initializer = FormalElement.__Summary; //T Console.WriteLine(DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss.fff")); }
private void DetailsToolPanel_AddClicked(object arg1, RoutedEventArgs arg2) { /*- if (!ProductDirector.ConfirmImmediateApply("IdeaEditing.DetailAdd", "ApplyDialogChangesDirectly")) * return; */ var DetailOptions = new List <IRecognizableElement>(); DetailOptions.Add(new SimplePresentationElement(AttachmentDetailDesignator.KindTitle, AttachmentDetailDesignator.KindName, AttachmentDetailDesignator.KindSummary, AttachmentDetailDesignator.KindPictogram)); DetailOptions.Add(new SimplePresentationElement(LinkDetailDesignator.KindTitle, LinkDetailDesignator.KindName, LinkDetailDesignator.KindSummary, LinkDetailDesignator.KindPictogram)); if (ProductDirector.ValidateEditionPermission(AppExec.LIC_EDITION_LITE, "designate Table detail", false)) { DetailOptions.Add(new SimplePresentationElement(TableDetailDesignator.KindTitle, TableDetailDesignator.KindName, TableDetailDesignator.KindSummary, TableDetailDesignator.KindPictogram)); } var DetailToCreate = Display.DialogMultiOption("Designation of Detail", "Select the type of detail to be designated...", "", null, true, TableDetailDesignator.KindName, DetailOptions.ToArray()); if (DetailToCreate == null) { return; } var SelectedDetailOption = DetailOptions.FirstOrDefault(det => det.TechName == DetailToCreate); var DesignationName = SelectedDetailOption.Name + " - Detail Definition " + (this.DetailsSource.Count + 1).ToString(); DetailDefinitionCard NewEditCard = null; var Owner = Ownership.Create <IdeaDefinition, Idea>(this.SourceDefinitor); DetailDesignator CreatedDesignation = null; if (DetailToCreate == TableDetailDesignator.KindName) { CreatedDesignation = DomainServices.CreateTableDesignation(this.SourceEngine, Owner, DesignationName); } else if (DetailToCreate == AttachmentDetailDesignator.KindName) { CreatedDesignation = DomainServices.CreateAttachmentDesignation(Owner, DesignationName); } else if (DetailToCreate == LinkDetailDesignator.KindName) { CreatedDesignation = DomainServices.CreateLinkDesignation(Owner, DesignationName); } if (CreatedDesignation == null) { return; } NewEditCard = new DetailDefinitionCard(false, new Assignment <DetailDesignator>(CreatedDesignation, this.DetailsSourceIsGlobal)); this.DetailsSource.Add(NewEditCard); this.DetailsListBox.SelectedItem = NewEditCard; }
public void SetDetailDefinitionsSource(EntityEditEngine EditEngine, IdeaDefinition SourceDefinitor, IList <DetailDefinitionCard> Source, bool IsGlobal, DetailDesignator InitialDesignatorToEdit = null) { this.SourceDefinitor = SourceDefinitor; this.SourceEngine = EditEngine; this.DetailsSource = Source; this.DetailsSourceIsGlobal = IsGlobal; this.InitialDesignatorToEdit = InitialDesignatorToEdit; this.DetailsListBox.ItemsSource = Source; this.DetailsToolPanel.TargetListBox = this.DetailsListBox; // Notice that selection is made (see applied style), but focus highlight is only applied when it happens. if (this.DetailsSource.Count > 0) { this.DetailsListBox.SelectedIndex = 0; } }
public void SetDetailsSource(Idea SourceIdea, VisualSymbol SourceSymbol, IList <DetailEditingCard> Source, bool IsLocal, bool AccessOnlyTables = false, DetailDesignator InitialDesignatorToEdit = null) { General.ContractRequires(SourceSymbol == null || SourceIdea == SourceSymbol.OwnerRepresentation.RepresentedIdea); this.SourceIdea = SourceIdea; this.SourceSymbol = SourceSymbol; this.DetailsSource = Source; this.IsLocal = IsLocal; this.AccessOnlyTables = AccessOnlyTables; this.InitialDesignatorToEdit = InitialDesignatorToEdit; this.SourceEngine = SourceIdea.EditEngine as CompositionEngine; this.DetailsListBox.ItemsSource = Source; this.DetailsToolPanel.TargetListBox = this.DetailsListBox; // Notice that selection is made (see applied style), but focus highlight is only applied when it happens. if (this.DetailsSource.Count > 0) { this.DetailsListBox.SelectedIndex = 0; } }
//------------------------------------------------------------------------------------------------------------------------ public override Visual DeterminePointedVisual(Point Position) { PreviousPosition = CurrentPosition; CurrentPosition = Position; if (CurrentPosition == PreviousPosition || IsManipulating) { return(CurrentPointedVisual); } var NewPointed = GetPointedVisual(Position); IsManipulatingHeading = !NewPointed.IsOneOf(FrmPointingDetailsPanel, IndDetailsBottom, IndDetailsBottomLeft, IndDetailsBottomRight, IndDetailsLeft, IndDetailsRight); if (NewPointed != CurrentPointedVisual) { CurrentPointedVisual = NewPointed; bool IsPointingToIndicator = true; if (NewPointed.IsOneOf(IndHeadingTop, IndHeadingBottom, IndDetailsBottom)) { ResizingDirection = (NewPointed == IndHeadingTop ? EManipulationDirection.Top : EManipulationDirection.Bottom); TentativeAction = ESymbolManipulationAction.Resize; Cursor = Cursors.SizeNS; } else if (NewPointed.IsOneOf(IndHeadingLeft, IndHeadingRight, IndDetailsLeft, IndDetailsRight)) { ResizingDirection = (NewPointed.IsOneOf(IndHeadingLeft, IndDetailsLeft) ? EManipulationDirection.Left : EManipulationDirection.Right); TentativeAction = ESymbolManipulationAction.Resize; Cursor = Cursors.SizeWE; } else if (NewPointed.IsOneOf(IndHeadingTopLeft, IndHeadingBottomRight, IndDetailsBottomRight)) { ResizingDirection = (NewPointed == IndHeadingTopLeft ? EManipulationDirection.TopLeft : EManipulationDirection.BottomRight); TentativeAction = ESymbolManipulationAction.Resize; Cursor = Cursors.SizeNWSE; } else if (NewPointed.IsOneOf(IndHeadingBottomLeft, IndHeadingTopRight, IndDetailsBottomLeft)) { ResizingDirection = (NewPointed == IndHeadingTopRight ? EManipulationDirection.TopRight : EManipulationDirection.BottomLeft); TentativeAction = ESymbolManipulationAction.Resize; Cursor = Cursors.SizeNESW; } else if (NewPointed.IsOneOf(FrmPointingHeadingPanel, FrmPointingDetailsPanel)) { TentativeAction = ESymbolManipulationAction.Move; Cursor = Cursors.ScrollAll; } else if (NewPointed == FrmEditZone || NewPointed == null) { if (ManipulatedSymbol.OwnerRepresentation.IsShortcut) { TentativeAction = ESymbolManipulationAction.GoToShortcutTarget; Cursor = Cursors.UpArrow; } else { // Do not Edit In-Place if multiselecting... if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl) || Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)) { TentativeAction = ESymbolManipulationAction.Move; Cursor = Cursors.ScrollAll; } else { TentativeAction = ESymbolManipulationAction.EditInPlace; Cursor = Cursors.Pen; } } } else if (NewPointed.IsIn(FrmMarkingZones.Keys)) { LastPointedMarkerAssignment = FrmMarkingZones[NewPointed]; TentativeAction = ESymbolManipulationAction.MarkerEdit; Cursor = Cursors.Pen; } else if (NewPointed.IsIn(FrmDetailContentAssignZones.Keys)) { LastPointedDetailDesignator = FrmDetailContentAssignZones[NewPointed]; TentativeAction = ESymbolManipulationAction.IndividualDetailChange; Cursor = Cursors.Hand; } else if (NewPointed.IsIn(FrmDetailContentEditZones.Keys)) { LastPointedDetailDesignator = FrmDetailContentEditZones[NewPointed]; TentativeAction = ESymbolManipulationAction.IndividualDetailAccess; Cursor = Cursors.Pen; } else if (NewPointed.IsIn(FrmDetailTitleExpandZones.Keys)) { LastPointedDetailDesignator = FrmDetailTitleExpandZones[NewPointed]; TentativeAction = ESymbolManipulationAction.SwitchIndividualDetail; Cursor = Cursors.UpArrow; } else if (NewPointed.IsIn(FrmDetailTitleDesignateZones.Keys)) { LastPointedDetailDesignator = FrmDetailTitleDesignateZones[NewPointed]; TentativeAction = ESymbolManipulationAction.IndividualDetailDesignation; Cursor = Cursors.Arrow; } else { Cursor = Cursors.Hand; if (NewPointed == ActSwitchDetails) { TentativeAction = ESymbolManipulationAction.ActionSwitchDetails; } else if (NewPointed == ActSwitchRelated) { TentativeAction = ESymbolManipulationAction.ActionSwitchRelated; } else if (NewPointed == ActShowComposite) { TentativeAction = ESymbolManipulationAction.ActionShowCompositeAsView; } else if (NewPointed == DefaultActionIndicator) { TentativeAction = ESymbolManipulationAction.ActionEditProperties; } else if (NewPointed == ActSwitchCompositeView) { TentativeAction = ESymbolManipulationAction.ActionShowCompositeAsDetail; } else if (NewPointed == ActAddDetail) { TentativeAction = ESymbolManipulationAction.ActionAddDetail; } else { IsPointingToIndicator = false; } } if (IsPointingToIndicator) { var IndDescription = TentativeAction.GetDescription(); if (TentativeAction == ESymbolManipulationAction.EditInPlace && ManipulatedSymbol.OwnerRepresentation is RelationshipVisualRepresentation representation) { var RepRel = representation.RepresentedRelationship; if (!RepRel.RelationshipDefinitor.Value.IsSimple || RepRel.Links.Count <= 1) { IndDescription += " Drag to extend the pointed Relationship with a new Link/Connector."; } } ProductDirector.ShowAssistance(IndDescription); /* Problem: This tooltip stops the adorner working * var Tip = this.ToolTip as ToolTip; * * if (Tip == null || (Tip.Content as string).IsAbsent()) * { * Tip = (Tip == null ? new ToolTip() : Tip); * this.ToolTip = Tip; * * Tip.Content = IndDescription; * Tip.IsOpen = true; * Tip.StaysOpen = false; * } */ } else { ProductDirector.ShowAssistance(); } ProductDirector.ShowPointingTo(ManipulatedSymbol); } return(NewPointed); }
public static LocalDetailsEditor CreateLocalDetailsEditor(Idea IdeaSource, VisualSymbol SymbolSource, bool AccessToGlobalDetails, bool AccessOnlyTables = false, DetailDesignator InitialDesignatorToEdit = null) { return(new LocalDetailsEditor(IdeaSource, SymbolSource, AccessToGlobalDetails, AccessOnlyTables, InitialDesignatorToEdit)); }
public GlobalDetailsDefinitor(EntityEditEngine EditEngine, IdeaDefinition DefinitorSource, DetailDesignator InitialDesignatorToEdit = null) : this() { this.DefinitorSource = DefinitorSource; this.VisualGlobalDetailDefsSource = DetailDefinitionCard.GenerateGlobalDetailsForDefinitor(this.DefinitorSource); this.GlobalDetailDefsMaintainer.SetDetailDefinitionsSource(EditEngine, this.DefinitorSource, this.VisualGlobalDetailDefsSource, true, InitialDesignatorToEdit); }
public static GlobalDetailsDefinitor CreateGlobalDetailsDefinitor(EntityEditEngine EditEngine, IdeaDefinition DefinitorSource, DetailDesignator InitialDesignatorToEdit = null) { return(new GlobalDetailsDefinitor(EditEngine, DefinitorSource, InitialDesignatorToEdit)); }