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

Commit 9767767

Browse files
Remove GlobalEnums.cs, start work on Wizard
1 parent c639cd9 commit 9767767

17 files changed

Lines changed: 485 additions & 33 deletions

File tree

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/ICSharpCode.Reporting.Addin.csproj

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@
7373
<Reference Include="WindowsBase">
7474
<RequiredTargetFramework>3.0</RequiredTargetFramework>
7575
</Reference>
76+
<Reference Include="Xceed.Wpf.Toolkit">
77+
<HintPath>..\..\..\..\Libraries\WPFExtendedToolkit\Xceed.Wpf.Toolkit.dll</HintPath>
78+
</Reference>
7679
</ItemGroup>
7780
<ItemGroup>
7881
<Folder Include="Configuration" />
82+
<Folder Include="src\New Folder" />
7983
<Folder Include="src" />
8084
<Folder Include="src\DesignerBinding" />
8185
<Folder Include="src\Commands" />
@@ -84,8 +88,10 @@
8488
<Folder Include="src\DesignableItems" />
8589
<Folder Include="src\Factory" />
8690
<Folder Include="src\Dialogs" />
91+
<Folder Include="src\ReportWizard\Dialog" />
92+
<Folder Include="src\ReportWizard\ViewModels" />
8793
<Folder Include="src\UndoRedo" />
88-
<Folder Include="src\Wizard" />
94+
<Folder Include="src\ReportWizard" />
8995
<Folder Include="src\Toolbox" />
9096
<Folder Include="src\TypeProvider" />
9197
<Folder Include="src\XML" />
@@ -140,6 +146,19 @@
140146
<Compile Include="src\Globals\DesignerGlobals.cs" />
141147
<Compile Include="src\Globals\GlobalLists.cs" />
142148
<Compile Include="src\Globals\StringWriterWithEncoding.cs" />
149+
<Compile Include="src\ReportWizard\Dialog\IHasContext.cs" />
150+
<Compile Include="src\ReportWizard\Dialog\BaseSettingsPage.xaml.cs">
151+
<DependentUpon>BaseSettingsPage.xaml</DependentUpon>
152+
<SubType>Code</SubType>
153+
</Compile>
154+
<Compile Include="src\ReportWizard\Dialog\ReportWizard.xaml.cs">
155+
<DependentUpon>ReportWizard.xaml</DependentUpon>
156+
<SubType>Code</SubType>
157+
</Compile>
158+
<Compile Include="src\ReportWizard\ReportGenerator.cs" />
159+
<Compile Include="src\ReportWizard\ReportWizardCommand.cs" />
160+
<Compile Include="src\ReportWizard\ViewModels\PageOneContext.cs" />
161+
<Compile Include="src\ReportWizard\ViewModels\ReportWizardContext.cs" />
143162
<Compile Include="src\Services\DefaultMemberRelationshipService.cs" />
144163
<Compile Include="src\Services\DesignerSerializationService.cs" />
145164
<Compile Include="src\Services\MenuCommandService.cs" />
@@ -210,5 +229,9 @@
210229
<DependentUpon>EditorDialog.cs</DependentUpon>
211230
</EmbeddedResource>
212231
</ItemGroup>
232+
<ItemGroup>
233+
<Page Include="src\ReportWizard\Dialog\BaseSettingsPage.xaml" />
234+
<Page Include="src\ReportWizard\Dialog\ReportWizard.xaml" />
235+
</ItemGroup>
213236
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
214237
</Project>

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,9 +34,9 @@ void BaseValues()
3434
// this.GraphicsUnit = GraphicsUnit.Pixel;
3535
// this.Padding = new Padding(5);
3636
// this.DefaultFont = GlobalValues.DefaultFont;
37-
this.ReportType = GlobalEnums.ReportType.FormSheet;
37+
this.ReportType = ReportType.FormSheet;
3838
//
39-
this.DataModel = GlobalEnums.PushPullModel.FormSheet;
39+
this.DataModel = PushPullModel.FormSheet;
4040
//
4141
// this.CommandType = System.Data.CommandType.Text;
4242
// this.ConnectionString = String.Empty;
@@ -130,11 +130,11 @@ public Size PageSize {
130130
public bool Landscape {get;set;}
131131

132132
// [Category("Data")]
133-
public GlobalEnums.PushPullModel DataModel {get;set;}
133+
public PushPullModel DataModel {get;set;}
134134

135135

136136
// [Browsable(true), Category("Base Settings")]
137-
public GlobalEnums.ReportType ReportType {get;set;}
137+
public ReportType ReportType {get;set;}
138138

139139

140140
// [Category("Parameters")]

src/AddIns/Misc/Reporting/ICSharpCode.Reporting.Addin/src/DesignerBinding/DesignerBinding.cs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
using ICSharpCode.Core;
1414
using ICSharpCode.Reporting.Factories;
1515
using ICSharpCode.Reporting.Items;
16-
using ICSharpCode.SharpDevelop;
1716
using ICSharpCode.SharpDevelop.Workbench;
1817
using ICSharpCode.Reporting.Addin.Commands;
1918
using ICSharpCode.Reporting.Addin.Factory;
19+
using ICSharpCode.Reporting.Addin.ReportWizard;
2020

2121
namespace ICSharpCode.Reporting.Addin.DesignerBinding {
2222

@@ -44,6 +44,21 @@ public double AutoDetectFileContent(FileName fileName, System.IO.Stream fileCont
4444

4545
public IViewContent CreateContentForFile(OpenedFile file)
4646
{
47+
if (file.IsDirty) {
48+
var cmd = new ReportWizardCommand(file);
49+
cmd.Run();
50+
if (cmd.Canceled) {
51+
LoggingService.Info("reportWizard canceled");
52+
return null;
53+
}
54+
}
55+
56+
var viewCmd = new CreateDesignerCommand(file);
57+
viewCmd.Run();
58+
LoggingService.Info("return DesignerView");
59+
return viewCmd.DesignerView;
60+
61+
/*
4762
if (file.IsDirty) {
4863
4964
var reportModel = ReportModelFactory.Create();
@@ -55,10 +70,8 @@ public IViewContent CreateContentForFile(OpenedFile file)
5570
file.SetData(ar);
5671
}
5772
58-
var viewCmd = new CreateDesignerCommand(file);
59-
viewCmd.Run();
60-
LoggingService.Info("return DesignerView");
61-
return viewCmd.DesignerView;
73+
74+
*/
6275
}
6376

6477
static byte[] XmlToArray(XmlDocument doc)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.BaseSettingsPage"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
5+
xmlns:System="clr-namespace:System;assembly=mscorlib"
6+
xmlns:aa="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
7+
xmlns:ics="clr-namespace:ICSharpCode.Reporting.Globals;assembly=ICSharpCode.Reporting"
8+
Title="Base Settings"
9+
Description="Basic Settings and Layout"
10+
Background="LightGray">
11+
12+
<!-- Enter="WizardPage_Enter"
13+
Leave="WizardPage_Leave"-->
14+
15+
<!-- !xctk:WizardPage x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.PageWithContext"-->
16+
<xctk:WizardPage.Resources>
17+
<ObjectDataProvider x:Key="dataFromEnum" MethodName="GetValues"
18+
ObjectType="{x:Type System:Enum}">
19+
<ObjectDataProvider.MethodParameters>
20+
<x:Type TypeName="aa:PushPullModel"/>
21+
</ObjectDataProvider.MethodParameters>
22+
</ObjectDataProvider>
23+
</xctk:WizardPage.Resources>
24+
25+
<Grid ShowGridLines="true">
26+
<Grid.RowDefinitions>
27+
<RowDefinition Height="Auto"> </RowDefinition>
28+
<RowDefinition Height="Auto"></RowDefinition>
29+
<RowDefinition Height="Auto"></RowDefinition>
30+
<RowDefinition Height="Auto"></RowDefinition>
31+
<RowDefinition Height="Auto"></RowDefinition>
32+
<RowDefinition Height="Auto"></RowDefinition>
33+
<RowDefinition Height="Auto"></RowDefinition>
34+
<RowDefinition Height="Auto"></RowDefinition>
35+
<RowDefinition Height="Auto"></RowDefinition>
36+
<RowDefinition Height="Auto"></RowDefinition>
37+
</Grid.RowDefinitions>
38+
<Grid.ColumnDefinitions>
39+
<ColumnDefinition></ColumnDefinition>
40+
<ColumnDefinition></ColumnDefinition>
41+
<ColumnDefinition></ColumnDefinition>
42+
<ColumnDefinition></ColumnDefinition>
43+
</Grid.ColumnDefinitions>
44+
45+
<Label Content="DataModel :"></Label>
46+
<!--<RadioButton Name="_FormSheet" GroupName="DataModel" Content="FormSheet" Margin="0,5,0,5" Grid.Row="1" ></RadioButton>
47+
<RadioButton Name="_PushModel" GroupName="DataModel" Content="PushModel" Margin="0,5,0,5" Grid.Row="1" Grid.Column="1"></RadioButton>
48+
-->
49+
<ComboBox ItemsSource="{Binding Source={StaticResource dataFromEnum}}" Grid.Column="1" ></ComboBox>
50+
51+
<Label Content="ReportType :" Margin="0,5,0,5" Grid.Row="2"></Label>
52+
<RadioButton Name="_FormSheetType" GroupName="ReportType" Content="FormSheet" Margin="0,5,0,5" Grid.Row="3" ></RadioButton>
53+
<RadioButton Name="_DataModelType" GroupName="ReportType" Content="PushModel" Margin="0,5,0,5" Grid.Row="3" Grid.Column="1"></RadioButton>
54+
55+
<Label Content="Report Name :" Margin="0,5,0,5" Grid.Row="4"></Label>
56+
<TextBox Name="_ReportName" Margin="10,5,0,5" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3"></TextBox>
57+
58+
<Label Content="Filename :" Margin="0,5,0,5" Grid.Row="5"></Label>
59+
<TextBox Name="_Filename" Margin="10,5,0,5" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="3"></TextBox>
60+
61+
<Label Content="Page Layout :" Grid.Row="6" Margin="0,5,0,5"></Label>
62+
<RadioButton Name="_Legal" GroupName="PageLayout" Content="Legal" Grid.Row="7" Margin="0,5,0,5" ></RadioButton>
63+
<RadioButton Name="_Landscape" GroupName="PageLayout" Content="Landscape" Grid.Row="7" Grid.Column="1" Margin="0,5,0,5"></RadioButton>
64+
</Grid>
65+
66+
</xctk:WizardPage>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Created by SharpDevelop.
3+
* User: Peter Forstmeier
4+
* Date: 08.07.2014
5+
* Time: 20:26
6+
*
7+
* To change this template use Tools | Options | Coding | Edit Standard Headers.
8+
*/
9+
using System;
10+
using System.Windows;
11+
using Xceed.Wpf.Toolkit;
12+
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
13+
14+
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog{
15+
16+
/// <summary>
17+
/// Interaction logic for PageOne.xamlWizardPage,IHasContext
18+
/// </summary>
19+
public partial class BaseSettingsPage : WizardPage,IHasContext
20+
{
21+
PageOneContext context;
22+
23+
public BaseSettingsPage()
24+
{
25+
InitializeComponent();
26+
this.context = new PageOneContext();
27+
}
28+
29+
30+
public IWizardContext Context {
31+
get{
32+
UpdateContext();
33+
return context;}
34+
}
35+
36+
public int PageNumber {
37+
get {return 1;}
38+
}
39+
40+
41+
void WizardPage_Enter(object sender, RoutedEventArgs e)
42+
{
43+
44+
Console.Write("Create Context for PageOne");
45+
}
46+
47+
void WizardPage_Leave(object sender, RoutedEventArgs e)
48+
{
49+
// NewMethod();
50+
}
51+
52+
void UpdateContext()
53+
{
54+
// context.FormSheet = this._FormSheet.IsChecked == true;
55+
// context.PushModel = this._PushModel.IsChecked == true;
56+
context.ReportName = this._ReportName.Text;
57+
context.FileName = this._Filename.Text;
58+
context.Legal = _Legal.IsChecked == true;
59+
;
60+
context.Landscape = _Landscape.IsChecked == true;
61+
}
62+
}
63+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Created by SharpDevelop.
3+
* User: Peter Forstmeier
4+
* Date: 16.07.2014
5+
* Time: 20:41
6+
*
7+
* To change this template use Tools | Options | Coding | Edit Standard Headers.
8+
*/
9+
using System;
10+
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
11+
12+
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
13+
{
14+
/// <summary>
15+
/// Description of IHasContext.
16+
/// </summary>
17+
public interface IHasContext
18+
{
19+
IWizardContext Context {get;}
20+
int PageNumber {get;}
21+
}
22+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<Window x:Class="ICSharpCode.Reporting.Addin.ReportWizard.Dialog.ReportWizard"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
5+
xmlns:local="clr-namespace:ICSharpCode.Reporting.Addin.ReportWizard.Dialog"
6+
Title="{Binding Title}"
7+
Height="600" Width="600">
8+
9+
<xctk:Wizard x:Name="_wizard" FinishButtonClosesWindow="True"
10+
Next="_wizard_Next"
11+
PageChanged="_wizard_PageChanged"
12+
Finish="_wizard_Finish"
13+
CanHelp="False">
14+
15+
<xctk:WizardPage PageType="Exterior" Title="Welcome to Reporting Wizard"
16+
Description="This Wizard will walk you though how to do something." />
17+
18+
<!-- ! <local:BaseSettingsPage ></local:BaseSettingsPage> -->
19+
20+
21+
<xctk:WizardPage PageType="Interior"
22+
Title="Page 1"
23+
Description="This is the first page in the process." />
24+
<xctk:WizardPage PageType="Interior"
25+
Title="Page 2"
26+
Description="This is the second page in the process" />
27+
<xctk:WizardPage PageType="Interior"
28+
Title="Last Page"
29+
Description="This is the last page in the process"
30+
CanFinish="True" />
31+
</xctk:Wizard>
32+
33+
</Window>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Created by SharpDevelop.
3+
* User: Peter Forstmeier
4+
* Date: 07.07.2014
5+
* Time: 20:18
6+
*
7+
* To change this template use Tools | Options | Coding | Edit Standard Headers.
8+
*/
9+
using System;
10+
using System.Windows;
11+
using Xceed.Wpf.Toolkit;
12+
using ICSharpCode.Reporting.Addin.ReportWizard.ViewModels;
13+
using System.Linq;
14+
15+
namespace ICSharpCode.Reporting.Addin.ReportWizard.Dialog
16+
{
17+
/// <summary>
18+
/// Interaction logic for Window1.xaml
19+
/// </summary>
20+
public partial class ReportWizard : Window
21+
{
22+
ReportWizardContext context;
23+
BaseSettingsPage baseSettingsPage;
24+
25+
public ReportWizard(ReportWizardContext context)
26+
{
27+
InitializeComponent();
28+
this.context = context;
29+
baseSettingsPage = new BaseSettingsPage();
30+
_wizard.Items.Insert(2,baseSettingsPage);
31+
32+
}
33+
34+
35+
void _wizard_Next(object sender, Xceed.Wpf.Toolkit.Core.CancelRoutedEventArgs e)
36+
{
37+
}
38+
39+
40+
void _wizard_PageChanged(object sender, RoutedEventArgs e)
41+
{
42+
43+
}
44+
45+
void _wizard_Finish(object sender, RoutedEventArgs e)
46+
{
47+
var x = _wizard.Items;
48+
49+
foreach (var element in this._wizard.Items) {
50+
var isHasContext = element is IHasContext;
51+
if (isHasContext) {
52+
53+
var hasContext = (IHasContext) element;
54+
Console.WriteLine(" {0} - {1}",hasContext.PageNumber,element.ToString());
55+
}
56+
}
57+
58+
context.PageOneContext = baseSettingsPage.Context;
59+
60+
}
61+
62+
}
63+
}

0 commit comments

Comments
 (0)