Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 08fee41

Browse files
Cleanup
1 parent 18f420a commit 08fee41

11 files changed

Lines changed: 51 additions & 79 deletions

File tree

data/resources/StringResources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8294,4 +8294,7 @@ a line break</value>
82948294
<data name="SharpReport.Wizard.PageLayout" xml:space="preserve">
82958295
<value>Page Layout </value>
82968296
</data>
8297+
<data name="SharpReport.Wizard.PushModel.NoProject" xml:space="preserve">
8298+
<value>No project selected, please enter FieldNames</value>
8299+
</data>
82978300
</root>

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void BaseValues()
3434
// this.GraphicsUnit = GraphicsUnit.Pixel;
3535
// this.Padding = new Padding(5);
3636
// this.DefaultFont = GlobalValues.DefaultFont;
37-
this.ReportType = ReportType.FormSheet;
37+
// this.ReportType = ReportType.FormSheet;
3838
//
3939
this.DataModel = PushPullModel.FormSheet;
4040
//
@@ -93,9 +93,9 @@ public string FileName
9393
}
9494

9595

96-
[Browsable(true), Category("Base Settings")]
97-
public ReportType ReportType {get;set;}
98-
96+
// [Browsable(true), Category("Base Settings")]
97+
// public ReportType ReportType {get;set;}
98+
//
9999

100100
[Category("Page Settings")]
101101
public int BottomMargin {get;set;}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
</ObjectDataProvider.MethodParameters>
2020
</ObjectDataProvider>
2121

22-
<ObjectDataProvider x:Key="reportTypeEnum" MethodName="GetValues"
22+
<!-- <ObjectDataProvider x:Key="reportTypeEnum" MethodName="GetValues"
2323
ObjectType="{x:Type System:Enum}">
2424
<ObjectDataProvider.MethodParameters>
2525
<x:Type TypeName="sdr:ReportType"/>
2626
</ObjectDataProvider.MethodParameters>
27-
</ObjectDataProvider>
27+
</ObjectDataProvider>-->
2828
</xctk:WizardPage.Resources>
2929

3030
<Grid>
@@ -54,11 +54,11 @@
5454
ItemsSource="{Binding Source={StaticResource pushpullEnum}}">
5555
</ComboBox>
5656

57-
<Label Content="ReportType :" Margin="0,5,0,5" Grid.Column="1" Grid.Row="2"></Label>
57+
<!--<Label Content="ReportType :" Margin="0,5,0,5" Grid.Column="1" Grid.Row="2"></Label>
5858
<ComboBox Name="_ReportType" Margin="10,5,0,5"
5959
Grid.Row="2" Grid.Column="2"
6060
ItemsSource="{Binding Source={StaticResource reportTypeEnum}}">
61-
</ComboBox>
61+
</ComboBox>-->
6262

6363
<Label Content="{core:Localize SharpReport.Wizard.BaseSettings.ReportName}" Margin="0,5,0,5" Grid.Column="1" Grid.Row="4"></Label>
6464
<TextBox Name="_ReportName" Margin="10,5,0,5" Grid.Row="4" Grid.Column="2" Grid.ColumnSpan="3"></TextBox>

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/BaseSettingsPage.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public BaseSettingsPage()
2525
{
2626
InitializeComponent();
2727
_DataModel.SelectedItem = PushPullModel.FormSheet;
28-
_ReportType.SelectedItem = ReportType.FormSheet;
28+
// _ReportType.SelectedItem = ReportType.FormSheet;
2929
_Legal.IsChecked = true;
3030
this.context = new PageOneContext();
3131
}
@@ -44,7 +44,7 @@ public WizardPageType ReportPageType {
4444

4545
void UpdateContext(){
4646
context.DataModel = (PushPullModel) _DataModel.SelectedItem;
47-
context.ReportType = (ReportType) _ReportType.SelectedItem;
47+
// context.ReportType = (ReportType) _ReportType.SelectedItem;
4848
context.ReportName = this._ReportName.Text;
4949
context.FileName = this._Filename.Text;
5050
context.Legal = _Legal.IsChecked == true;
@@ -59,7 +59,7 @@ void _DataModel_SelectionChanged(object sender, SelectionChangedEventArgs e){
5959

6060
switch (pushPullModel) {
6161
case PushPullModel.PushData: {
62-
this._ReportType.SelectedItem = ReportType.DataReport;
62+
// this._ReportType.SelectedItem = ReportType.DataReport;
6363
this.CanFinish = false;
6464
this.CanSelectNextPage = true;
6565
break;
@@ -74,7 +74,7 @@ void _DataModel_SelectionChanged(object sender, SelectionChangedEventArgs e){
7474
case PushPullModel.FormSheet: {
7575
this.CanFinish = true;
7676
CanSelectNextPage = false;
77-
this._ReportType.SelectedItem = ReportType.FormSheet;
77+
// this._ReportType.SelectedItem = ReportType.FormSheet;
7878
break;
7979
}
8080
}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
CanSelectPreviousPage="true"
1313
CanSelectNextPage="false">
1414

15-
<Grid>
15+
<Grid ShowGridLines="True">
1616
<Grid.ColumnDefinitions>
1717
<ColumnDefinition Width="Auto"></ColumnDefinition>
1818
<ColumnDefinition></ColumnDefinition>
@@ -23,12 +23,13 @@
2323
<RowDefinition Height="Auto"></RowDefinition>
2424
<RowDefinition Height="200"></RowDefinition>
2525
</Grid.RowDefinitions>
26+
27+
<TextBlock Name="_projTxt" Text="{core:Localize SharpReport.Wizard.PushModel.SelectProject}"
28+
FontSize="15" ></TextBlock>
2629

27-
<TextBlock Text="{core:Localize SharpReport.Wizard.PushModel.SelectProject}"
28-
Grid.ColumnSpan="2" FontSize="15" ></TextBlock>
29-
<ComboBox Name="_cboTypes" Visibility="Hidden" Grid.Row="1" SelectionChanged="_cboTypes_SelectionChanged" MinWidth="100" ></ComboBox>
30+
<ComboBox Name="_cboTypes" Visibility="Hidden" Grid.Row="1" SelectionChanged="_cboTypes_SelectionChanged" MinWidth="150" ></ComboBox>
3031

31-
<TextBlock Text="{core:Localize SharpReport.Wizard.PushModel.AvailableFields}" FontSize="15" Grid.Column ="1" Margin="15,0,0,0"></TextBlock>
32+
<TextBlock Name="_availTxt" Visibility="Hidden " Text="{core:Localize SharpReport.Wizard.PushModel.AvailableFields}" FontSize="15" Grid.Column ="1" Margin="15,0,0,0"></TextBlock>
3233
<DataGrid Name="_DataGrid"
3334
ItemsSource="{Binding}"
3435
CanUserAddRows="True"

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/Dialog/PushDataReport.xaml.cs

Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@
88
*/
99
using System;
1010
using System.Collections.Generic;
11+
using System.Linq;
12+
using ICSharpCode.Core;
1113
using ICSharpCode.NRefactory.TypeSystem;
1214
using ICSharpCode.Reporting.BaseClasses;
1315
using Xceed.Wpf.Toolkit;
1416
using ICSharpCode.Reporting.Addin.Globals;
1517
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
16-
using System.Linq;
1718

1819
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
1920
{
@@ -31,17 +32,19 @@ public PushDataReport()
3132
items = new List<AbstractColumn>();
3233
_DataGrid.ItemsSource = items;
3334
this.context = new PushModelContext();
34-
var data = new AbstractColumn("MyColumn",typeof(string));
35-
items.Add(data);
3635
cboType.ItemsSource = GlobalLists.DataTypeList();
37-
var definitions = GetTypeDefinitions();
3836

39-
if (definitions != null) {
37+
var definitions = GetTypeDefinitions();
38+
if (definitions.Any()) {
4039
_cboTypes.Visibility = System.Windows.Visibility.Visible;
40+
_availTxt.Visibility = System.Windows.Visibility.Visible;
4141
_cboTypes.ItemsSource = definitions;
4242
_cboTypes.SelectedIndex = 0;
43+
} else {
44+
var data = new AbstractColumn("MyColumn", typeof(string));
45+
items.Add(data);
46+
_projTxt.Text = ResourceService.GetString("SharpReport.Wizard.PushModel.NoProject");
4347
}
44-
4548
}
4649

4750
static IEnumerable<ITypeDefinition> GetTypeDefinitions()
@@ -57,15 +60,16 @@ static IEnumerable<ITypeDefinition> GetTypeDefinitions()
5760

5861
void _cboTypes_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e){
5962

60-
var s = (ITypeDefinition)e.AddedItems[0];
61-
var l = CreateItemsSource(s);
62-
if (l.Count > 0) {
63-
_DataGrid.ItemsSource = l;
63+
var typeDefinition = (ITypeDefinition)e.AddedItems[0];
64+
var itemsList = CreateItemsSource(typeDefinition);
65+
if (itemsList.Count > 0) {
66+
_DataGrid.ItemsSource = itemsList;
6467
}
6568
}
6669

67-
static List<AbstractColumn> CreateItemsSource(ITypeDefinition s){
68-
return s.Properties.Select(p => new AbstractColumn(){
70+
71+
static List<AbstractColumn> CreateItemsSource(ITypeDefinition typeDefinitions){
72+
return typeDefinitions.Properties.Select(p => new AbstractColumn(){
6973
ColumnName = p.Name,
7074
DataTypeName = p.ReturnType.ReflectionName
7175
}).ToList();
@@ -90,44 +94,7 @@ public WizardPageType ReportPageType {
9094
get {return WizardPageType.PushModelPage;}
9195
}
9296

93-
94-
9597
#endregion
9698
}
9799

98-
/*
99-
private void PopulateTestItems()
100-
{
101-
TestItems = new ObservableCollection<TestItem>();
102-
for (int i = 0; i < 5; i++)
103-
{
104-
TestItem ti = new TestItem();
105-
ti.Name = "TestItem" + i;
106-
ti.IsSelected = true;
107-
TestItems.Add(ti);
108-
}
109-
}
110-
111-
private bool _AllSelected;
112-
public bool AllSelected
113-
{
114-
get { return _AllSelected; }
115-
set
116-
{
117-
_AllSelected = value;
118-
TestItems.ToList().ForEach(x => x.IsSelected = value);
119-
NotifyPropertyChanged(m => m.AllSelected);
120-
}
121-
}
122-
123-
private ObservableCollection<TestItem> _TestItems;
124-
public ObservableCollection<TestItem> TestItems
125-
{
126-
get { return _TestItems; }
127-
set
128-
{
129-
_TestItems = value;
130-
NotifyPropertyChanged(m => m.TestItems);
131-
}
132-
}*/
133100
}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ReportGenerator.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ReportSettings GenerateBaseSettings (ReportWizardContext context) {
7171
reportSettings.FileName = pageOneContext.FileName;
7272
reportSettings.Landscape = !pageOneContext.Legal;
7373
reportSettings.ReportName = pageOneContext.ReportName;
74-
reportSettings.ReportType = pageOneContext.ReportType;
74+
// reportSettings.ReportType = pageOneContext.ReportType;
7575
return reportSettings;
7676
}
7777

@@ -184,7 +184,8 @@ static List<IPrintableObject> CreateItems(PushModelContext context) {
184184
static bool IsDataReport(ReportWizardContext context)
185185
{
186186
var poc = (PageOneContext)context.PageOneContext;
187-
return poc.ReportType.Equals(ReportType.DataReport);
187+
// return poc.ReportType.Equals(ReportType.DataReport);
188+
return poc.DataModel != PushPullModel.FormSheet;
188189
}
189190

190191

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/ReportWizard/ViewModels/PageOneContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace ICSharpCode.Reporting.Addin.ReportWizard.ViewModels
1818
public class PageOneContext:IWizardContext
1919
{
2020
public PushPullModel DataModel {get;set;}
21-
public ReportType ReportType {get;set;}
21+
// public ReportType ReportType {get;set;}
2222
public string ReportName {get;set;}
2323
public string FileName {get;set;}
2424
public bool Legal {get;set;}

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/Toolbox/ToolboxProvider.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ static Bitmap RectangleBitmap()
157157
/// <returns>Bitmap</returns>
158158
static Bitmap CircleBitmap()
159159
{
160-
Bitmap b = new Bitmap (19,19);
161-
using (Graphics g = Graphics.FromImage (b)){
160+
var bmp = new Bitmap (19,19);
161+
using (var g = Graphics.FromImage (bmp)){
162162
g.DrawEllipse (new Pen(Color.Black, 1),
163163
1,1,
164164
17,17);
165165
}
166-
return b;
166+
return bmp;
167167
}
168168

169169

src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Globals/GlobalEnums.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ public enum PushPullModel {
3737
/// FormSheet means a blank form with Labels, Lines and Checkboxes
3838
/// DataReport handles all Reports with Data
3939
/// </summary>
40-
public enum ReportType {
40+
/*public enum ReportType {
4141
FormSheet,
4242
DataReport,
4343
}
4444
45-
45+
*/
4646
public enum ReportSection {
4747
ReportHeader,
4848
ReportPageHeader,

0 commit comments

Comments
 (0)