private void InsertElementActivated(object sender, InterfaceActivationEventArgs e) { ActivateDockElement(typeof(ElementInsertPanel), e); }
private void ActivateDockElement(Type panelType, InterfaceActivationEventArgs e) { WidgetPanel dockElement = panels[panelType]; if (dockElement == null) throw new InvalidOperationException("Failed to find panel for: " + panelType.ToString()); if (dockElement.DockState != DockState.Hidden) { dockElement.Activate(); e.Handled = true; } }
private void ChangeElementActivated(object sender, InterfaceActivationEventArgs e) { ActivateDockElement(typeof(ElementChangePanel), e); }
private void ChangeElementActivated(object sender, InterfaceActivationEventArgs e) { ActivateDockElement(dockElementChange, e); }
private void InsertElementActivated(object sender, InterfaceActivationEventArgs e) { ActivateDockElement(dockElementInsert, e); }
private void ActivateDockElement(DockableWindow dockElement, InterfaceActivationEventArgs e) { if (dockElement.DockSituation != DockSituation.None) { if (!dockElement.IsOpen) dockElement.Open(); dockElement.Activate(); e.Handled = true; } }
private void ChangeAttributesActivated(object sender, InterfaceActivationEventArgs e) { ActivateDockElement(dockAttributes, e); }
// private void InsertOrChangeElement(EventHandler handler, ICollection valid, ICollection all) // { // PopupElements ps=new PopupElements(); // ps.ElementList.ItemSelected+=handler; // // ps.ElementList.ValidItems=valid; // ps.ElementList.AllItems=all; // // Point pt=caret.Location; // pt.Offset(OffsetX, OffsetY); // pt.Y+=caret.Height; // pt.X=Math.Min(pt.X, VisibleRectangle.Width-ps.Width); // pt.Y=Math.Min(pt.Y, VisibleRectangle.Height-ps.Height); // ps.StartPosition=FormStartPosition.Manual; // pt=PointToScreen(pt); // ps.Location=pt; // // ps.Show(); // } protected virtual void OnInsertElementActivated(InterfaceActivationEventArgs e) { if ( InsertElementActivated != null ) InsertElementActivated(this, e); }
protected virtual void OnChangeElementActivated(InterfaceActivationEventArgs e) { if ( ChangeElementActivated != null ) ChangeElementActivated(this, e); }
public virtual void EditModifyAttribute() { if ( doc == null || doc.DocumentElement == null ) return; InterfaceActivationEventArgs ea=new InterfaceActivationEventArgs(); OnChangeAttributesActivated(ea); if ( ea.Handled ) return; AttributeChangePanel acp=new AttributeChangePanel(); acp.EnableSelectionTracking=false; acp.Editor=this; ShowPopup(acp); }
public void EditInsertElement() { if ( !licenceValid ) return; InterfaceActivationEventArgs e=new InterfaceActivationEventArgs(); OnInsertElementActivated(e); if ( e.Handled ) return; if ( currentSelection.IsRange && !currentSelection.IsBalanced ) { MessageBox.Show("The selection must be balanced in order to insert an element", "Insert Element", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } ElementInsertPanel eip=new ElementInsertPanel(); eip.EnableSelectionTracking=false; eip.Editor=this; ShowPopup(eip); }
public void EditChangeElement() { if ( doc == null ) return; InterfaceActivationEventArgs e=new InterfaceActivationEventArgs(); OnChangeElementActivated(e); if ( e.Handled ) return; ElementChangePanel eip=new ElementChangePanel(); eip.EnableSelectionTracking=false; eip.Editor=this; ShowPopup(eip); }