Browse Source

SelectionService

reports
Peter Forstmeier 11 years ago
parent
commit
8558464a0f
  1. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseSection.cs
  2. 15
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs
  3. 15
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/SectionDesigner.cs
  4. 10
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/TextItemDesigner.cs
  5. 15
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Views/DesignerView.cs

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignableItems/BaseSection.cs

@ -31,7 +31,6 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -31,7 +31,6 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
// [EditorBrowsableAttribute()]
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
Console.WriteLine("BaseSection:OnPaint");
base.OnPaint(e);
Draw(e.Graphics);
}
@ -39,8 +38,7 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems @@ -39,8 +38,7 @@ namespace ICSharpCode.Reporting.Addin.DesignableItems
public override void Draw(Graphics graphics)
{
Console.WriteLine("Draw section");
base.DrawControl(graphics,Rectangle.Inflate(this.ClientRectangle,-2,-2));
DrawControl(graphics, Rectangle.Inflate(this.ClientRectangle, -2, -2));
}

15
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/ReportRootDesigner.cs

@ -216,11 +216,12 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -216,11 +216,12 @@ namespace ICSharpCode.Reporting.Addin.Designer
if (section != null) {
this.sections.Add(section);
// section.SizeChanged += new EventHandler( OnSectionSizeChanged);
// foreach (Control cc in section.Controls) {
// AddToHost(cc);
// this.host.Container.Add(cc);
// }
section.SizeChanged += new EventHandler( OnSectionSizeChanged);
Console.Write("reportRootDesigner:OnComponentAdded");
foreach (Control cc in section.Controls) {
AddToHost(cc);
this.host.Container.Add(cc);
}
//
this.Control.Controls.Add(section);
RecalculateSections();
@ -258,14 +259,14 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -258,14 +259,14 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
private void OnComponentChanging(object sender, ComponentChangingEventArgs ce)
void OnComponentChanging(object sender, ComponentChangingEventArgs ce)
{
System.Console.WriteLine("RootDesigner:OnComponentChanging");
// Host.CreateTransaction();
}
private void OnSelectionChanged(object sender, EventArgs e)
void OnSelectionChanged(object sender, EventArgs e)
{
currentSelection = ((ISelectionService)sender).GetSelectedComponents();
}

15
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/SectionDesigner.cs

@ -46,13 +46,6 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -46,13 +46,6 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
}
protected override void OnPaintAdornments(PaintEventArgs pe)
{
Console.WriteLine("SectionDesigner:OnPaintAdornments");
base.OnPaintAdornments(pe);
}
protected override void OnDragDrop(DragEventArgs de)
{
@ -68,15 +61,9 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -68,15 +61,9 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
protected override void PostFilterProperties(System.Collections.IDictionary properties)
{
// DesignerHelper.RemoveProperties(properties);
base.PostFilterProperties(properties);
}
void OnSelectionChanged(object sender, EventArgs e)
{
Console.WriteLine("Section : OnSelectionChanged");
Control.Invalidate( );
}

10
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Designer/TextItemDesigner.cs

@ -24,13 +24,13 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -24,13 +24,13 @@ namespace ICSharpCode.Reporting.Addin.Designer
ISelectionService selectionService;
IComponentChangeService componentChangeService;
BaseTextItem ctrl;
ICSharpCode.Reporting.Addin.DesignableItems.BaseTextItem ctrl;
public override void Initialize(IComponent component)
{
base.Initialize(component);
GetService();
ctrl = (BaseTextItem) component;
ctrl = (ICSharpCode.Reporting.Addin.DesignableItems.BaseTextItem) component;
}
protected override void PostFilterProperties(System.Collections.IDictionary properties)
@ -40,7 +40,7 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -40,7 +40,7 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
private void GetService ()
void GetService ()
{
selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
if (selectionService != null)
@ -57,13 +57,13 @@ namespace ICSharpCode.Reporting.Addin.Designer @@ -57,13 +57,13 @@ namespace ICSharpCode.Reporting.Addin.Designer
}
private void OnSelectionChanged(object sender, EventArgs e)
void OnSelectionChanged(object sender, EventArgs e)
{
Control.Invalidate( );
}
private void OnComponentRename(object sender,ComponentRenameEventArgs e) {
void OnComponentRename(object sender,ComponentRenameEventArgs e) {
if (e.Component == this.Component) {
Control.Name = e.NewName;
Control.Invalidate();

15
src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Views/DesignerView.cs

@ -205,14 +205,16 @@ namespace ICSharpCode.Reporting.Addin.Views @@ -205,14 +205,16 @@ namespace ICSharpCode.Reporting.Addin.Views
void SelectionChangedHandler(object sender, EventArgs args)
{
var ser = (ISelectionService)sender;
var it = ser.PrimarySelection as AbstractItem;
if (it != null) {
if (String.IsNullOrEmpty(it.Site.Name)) {
it.Site.Name = it.Name;
var selectionService = (ISelectionService)sender;
Console.WriteLine("Sel service {0}",selectionService != null);
var abstractItem = selectionService.PrimarySelection as AbstractItem;
Console.Write("SelectionChangedHandler:AbstractItem {0}",abstractItem != null);
if (abstractItem != null) {
if (String.IsNullOrEmpty(abstractItem.Site.Name)) {
abstractItem.Site.Name = abstractItem.Name;
}
}
// UpdatePropertyPadSelection((ISelectionService)sender);
UpdatePropertyPadSelection((ISelectionService)sender);
}
#endregion
@ -258,6 +260,7 @@ namespace ICSharpCode.Reporting.Addin.Views @@ -258,6 +260,7 @@ namespace ICSharpCode.Reporting.Addin.Views
void UpdatePropertyPadSelection(ISelectionService selectionService)
{
Console.Write("UpdatePropertyPadSelection");
ICollection selection = selectionService.GetSelectedComponents();
object[] selArray = new object[selection.Count];
selection.CopyTo(selArray, 0);

Loading…
Cancel
Save