Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 8558464

Browse files
SelectionService
1 parent ae1f313 commit 8558464

5 files changed

Lines changed: 24 additions & 35 deletions

File tree

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,14 @@ public BaseSection():base()
3131
// [EditorBrowsableAttribute()]
3232
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
3333
{
34-
Console.WriteLine("BaseSection:OnPaint");
3534
base.OnPaint(e);
3635
Draw(e.Graphics);
3736
}
3837

3938

4039
public override void Draw(Graphics graphics)
4140
{
42-
Console.WriteLine("Draw section");
43-
base.DrawControl(graphics,Rectangle.Inflate(this.ClientRectangle,-2,-2));
41+
DrawControl(graphics, Rectangle.Inflate(this.ClientRectangle, -2, -2));
4442
}
4543

4644

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,12 @@ private void OnComponentAdded(object sender, ComponentEventArgs ce)
216216

217217
if (section != null) {
218218
this.sections.Add(section);
219-
// section.SizeChanged += new EventHandler( OnSectionSizeChanged);
220-
// foreach (Control cc in section.Controls) {
221-
// AddToHost(cc);
222-
// this.host.Container.Add(cc);
223-
// }
219+
section.SizeChanged += new EventHandler( OnSectionSizeChanged);
220+
Console.Write("reportRootDesigner:OnComponentAdded");
221+
foreach (Control cc in section.Controls) {
222+
AddToHost(cc);
223+
this.host.Container.Add(cc);
224+
}
224225
//
225226
this.Control.Controls.Add(section);
226227
RecalculateSections();
@@ -258,14 +259,14 @@ private void OnComponentChanged(object sender, ComponentChangedEventArgs ce)
258259
}
259260

260261

261-
private void OnComponentChanging(object sender, ComponentChangingEventArgs ce)
262+
void OnComponentChanging(object sender, ComponentChangingEventArgs ce)
262263
{
263264
System.Console.WriteLine("RootDesigner:OnComponentChanging");
264265
// Host.CreateTransaction();
265266
}
266267

267268

268-
private void OnSelectionChanged(object sender, EventArgs e)
269+
void OnSelectionChanged(object sender, EventArgs e)
269270
{
270271
currentSelection = ((ISelectionService)sender).GetSelectedComponents();
271272
}

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

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,6 @@ public override SelectionRules SelectionRules {
4646
}
4747
}
4848

49-
protected override void OnPaintAdornments(PaintEventArgs pe)
50-
{
51-
Console.WriteLine("SectionDesigner:OnPaintAdornments");
52-
base.OnPaintAdornments(pe);
53-
}
54-
55-
5649

5750
protected override void OnDragDrop(DragEventArgs de)
5851
{
@@ -68,15 +61,9 @@ public override bool CanBeParentedTo(System.ComponentModel.Design.IDesigner pare
6861
}
6962

7063

71-
protected override void PostFilterProperties(System.Collections.IDictionary properties)
72-
{
73-
// DesignerHelper.RemoveProperties(properties);
74-
base.PostFilterProperties(properties);
75-
}
76-
77-
7864
void OnSelectionChanged(object sender, EventArgs e)
7965
{
66+
Console.WriteLine("Section : OnSelectionChanged");
8067
Control.Invalidate( );
8168
}
8269

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ public class TextItemDesigner:ControlDesigner
2424

2525
ISelectionService selectionService;
2626
IComponentChangeService componentChangeService;
27-
BaseTextItem ctrl;
27+
ICSharpCode.Reporting.Addin.DesignableItems.BaseTextItem ctrl;
2828

2929
public override void Initialize(IComponent component)
3030
{
3131
base.Initialize(component);
3232
GetService();
33-
ctrl = (BaseTextItem) component;
33+
ctrl = (ICSharpCode.Reporting.Addin.DesignableItems.BaseTextItem) component;
3434
}
3535

3636
protected override void PostFilterProperties(System.Collections.IDictionary properties)
@@ -40,7 +40,7 @@ protected override void PostFilterProperties(System.Collections.IDictionary prop
4040
}
4141

4242

43-
private void GetService ()
43+
void GetService ()
4444
{
4545
selectionService = GetService(typeof(ISelectionService)) as ISelectionService;
4646
if (selectionService != null)
@@ -57,13 +57,13 @@ private void GetService ()
5757
}
5858

5959

60-
private void OnSelectionChanged(object sender, EventArgs e)
60+
void OnSelectionChanged(object sender, EventArgs e)
6161
{
6262
Control.Invalidate( );
6363
}
6464

6565

66-
private void OnComponentRename(object sender,ComponentRenameEventArgs e) {
66+
void OnComponentRename(object sender,ComponentRenameEventArgs e) {
6767
if (e.Component == this.Component) {
6868
Control.Name = e.NewName;
6969
Control.Invalidate();

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,16 @@ private void MakeDirty()
205205

206206
void SelectionChangedHandler(object sender, EventArgs args)
207207
{
208-
var ser = (ISelectionService)sender;
209-
var it = ser.PrimarySelection as AbstractItem;
210-
if (it != null) {
211-
if (String.IsNullOrEmpty(it.Site.Name)) {
212-
it.Site.Name = it.Name;
208+
var selectionService = (ISelectionService)sender;
209+
Console.WriteLine("Sel service {0}",selectionService != null);
210+
var abstractItem = selectionService.PrimarySelection as AbstractItem;
211+
Console.Write("SelectionChangedHandler:AbstractItem {0}",abstractItem != null);
212+
if (abstractItem != null) {
213+
if (String.IsNullOrEmpty(abstractItem.Site.Name)) {
214+
abstractItem.Site.Name = abstractItem.Name;
213215
}
214216
}
215-
// UpdatePropertyPadSelection((ISelectionService)sender);
217+
UpdatePropertyPadSelection((ISelectionService)sender);
216218
}
217219

218220
#endregion
@@ -258,6 +260,7 @@ void UpdatePropertyPad()
258260

259261
void UpdatePropertyPadSelection(ISelectionService selectionService)
260262
{
263+
Console.Write("UpdatePropertyPadSelection");
261264
ICollection selection = selectionService.GetSelectedComponents();
262265
object[] selArray = new object[selection.Count];
263266
selection.CopyTo(selArray, 0);

0 commit comments

Comments
 (0)